pace-chart-lib 1.0.80 → 1.0.82

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.
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".highlight{fill-opacity:1!important;stroke-opacity:1;transition:fill-opacity .25s ease-out}.unhighlight{fill-opacity:.08!important;stroke-opacity:.08;transition:fill-opacity .25s ease-in}")),document.head.appendChild(t)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- (function(Je,Me){typeof exports=="object"&&typeof module<"u"?Me(exports,require("react"),require("d3"),require("d3-svg-annotation"),require("d3-cloud"),require("venn.js"),require("d3-sankey"),require("d3-org-chart"),require("chart.js"),require("chartjs-plugin-datalabels")):typeof define=="function"&&define.amd?define(["exports","react","d3","d3-svg-annotation","d3-cloud","venn.js","d3-sankey","d3-org-chart","chart.js","chartjs-plugin-datalabels"],Me):(Je=typeof globalThis<"u"?globalThis:Je||self,Me(Je["pace-chart-lib"]={},Je.React,Je.d3,Je.d3Annotation,Je.d3Cloud,Je.venn,Je.d3Sankey,Je.OrgChart,Je.Chart,Je.ChartDataLabels))})(this,(function(Je,Me,oi,bl,gl,Al,Ll,ml,kt,fl){"use strict";function ci(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const v=ci(oi),xt=ci(bl),Tl=ci(Al),wi=ci(Ll);var di={exports:{}},qa={};/**
2
+ (function(Ze,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("react"),require("d3"),require("d3-svg-annotation"),require("d3-cloud"),require("venn.js"),require("d3-sankey"),require("d3-org-chart"),require("chart.js"),require("chartjs-plugin-datalabels")):typeof define=="function"&&define.amd?define(["exports","react","d3","d3-svg-annotation","d3-cloud","venn.js","d3-sankey","d3-org-chart","chart.js","chartjs-plugin-datalabels"],Ce):(Ze=typeof globalThis<"u"?globalThis:Ze||self,Ce(Ze["pace-chart-lib"]={},Ze.React,Ze.d3,Ze.d3Annotation,Ze.d3Cloud,Ze.venn,Ze.d3Sankey,Ze.OrgChart,Ze.Chart,Ze.ChartDataLabels))})(this,(function(Ze,Ce,yi,Ll,ml,fl,Tl,vl,Ct,kl){"use strict";function ui(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const v=ui(yi),pt=ui(Ll),Cl=ui(fl),Ni=ui(Tl);var xi={exports:{}},Qa={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var Di;function vl(){if(Di)return qa;Di=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(c,x,n){var l=null;if(n!==void 0&&(l=""+n),x.key!==void 0&&(l=""+x.key),"key"in x){n={};for(var s in x)s!=="key"&&(n[s]=x[s])}else n=x;return x=n.ref,{$$typeof:t,type:c,key:l,ref:x!==void 0?x:null,props:n}}return qa.Fragment=e,qa.jsx=r,qa.jsxs=r,qa}var Ka={};/**
10
+ */var Pi;function Ml(){if(Pi)return Qa;Pi=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(o,x,l){var r=null;if(l!==void 0&&(r=""+l),x.key!==void 0&&(r=""+x.key),"key"in x){l={};for(var c in x)c!=="key"&&(l[c]=x[c])}else l=x;return x=l.ref,{$$typeof:t,type:o,key:r,ref:x!==void 0?x:null,props:l}}return Qa.Fragment=e,Qa.jsx=n,Qa.jsxs=n,Qa}var Oa={};/**
11
11
  * @license React
12
12
  * react-jsx-runtime.development.js
13
13
  *
@@ -15,15 +15,15 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var Vi;function kl(){return Vi||(Vi=1,process.env.NODE_ENV!=="production"&&(function(){function t(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===ce?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case A:return"Fragment";case g:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case D:return"SuspenseList";case Z:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case _:return"Portal";case U:return(h.displayName||"Context")+".Provider";case B:return(h._context.displayName||"Context")+".Consumer";case W:var k=h.render;return h=h.displayName,h||(h=k.displayName||k.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case V:return k=h.displayName||null,k!==null?k:t(h.type)||"Memo";case $:k=h._payload,h=h._init;try{return t(h(k))}catch{}}return null}function e(h){return""+h}function r(h){try{e(h);var k=!1}catch{k=!0}if(k){k=console;var o=k.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return o.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),e(h)}}function c(h){if(h===A)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===$)return"<...>";try{var k=t(h);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function x(){var h=ne.A;return h===null?null:h.getOwner()}function n(){return Error("react-stack-top-frame")}function l(h){if(ae.call(h,"key")){var k=Object.getOwnPropertyDescriptor(h,"key").get;if(k&&k.isReactWarning)return!1}return h.key!==void 0}function s(h,k){function o(){be||(be=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}o.isReactWarning=!0,Object.defineProperty(h,"key",{get:o,configurable:!0})}function p(){var h=t(this.type);return pe[h]||(pe[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function f(h,k,o,d,i,y,T,a){return o=y.ref,h={$$typeof:b,type:h,key:k,props:y,_owner:i},(o!==void 0?o:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:p}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function L(h,k,o,d,i,y,T,a){var m=k.children;if(m!==void 0)if(d)if(ue(m)){for(d=0;d<m.length;d++)u(m[d]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(m);if(ae.call(k,"key")){m=t(h);var N=Object.keys(k).filter(function(K){return K!=="key"});d=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",M[m+d]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ */var Ii;function Sl(){return Ii||(Ii=1,process.env.NODE_ENV!=="production"&&(function(){function t(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===ye?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case A:return"Fragment";case b:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case K:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case W:return"Portal";case Y:return(h.displayName||"Context")+".Provider";case U:return(h._context.displayName||"Context")+".Consumer";case H:var k=h.render;return h=h.displayName,h||(h=k.displayName||k.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case w:return k=h.displayName||null,k!==null?k:t(h.type)||"Memo";case z:k=h._payload,h=h._init;try{return t(h(k))}catch{}}return null}function e(h){return""+h}function n(h){try{e(h);var k=!1}catch{k=!0}if(k){k=console;var s=k.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return s.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),e(h)}}function o(h){if(h===A)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===z)return"<...>";try{var k=t(h);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function x(){var h=se.A;return h===null?null:h.getOwner()}function l(){return Error("react-stack-top-frame")}function r(h){if(te.call(h,"key")){var k=Object.getOwnPropertyDescriptor(h,"key").get;if(k&&k.isReactWarning)return!1}return h.key!==void 0}function c(h,k){function s(){pe||(pe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}s.isReactWarning=!0,Object.defineProperty(h,"key",{get:s,configurable:!0})}function p(){var h=t(this.type);return he[h]||(he[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function m(h,k,s,d,i,y,T,a){return s=y.ref,h={$$typeof:g,type:h,key:k,props:y,_owner:i},(s!==void 0?s:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:p}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function L(h,k,s,d,i,y,T,a){var f=k.children;if(f!==void 0)if(d)if(xe(f)){for(d=0;d<f.length;d++)u(f[d]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(f);if(te.call(k,"key")){f=t(h);var N=Object.keys(k).filter(function(Z){return Z!=="key"});d=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",M[f+d]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
19
19
  let props = %s;
20
20
  <%s {...props} />
21
21
  React keys must be passed directly to JSX without using spread:
22
22
  let props = %s;
23
- <%s key={someKey} {...props} />`,d,m,N,m),M[m+d]=!0)}if(m=null,o!==void 0&&(r(o),m=""+o),l(k)&&(r(k.key),m=""+k.key),"key"in k){o={};for(var re in k)re!=="key"&&(o[re]=k[re])}else o=k;return m&&s(o,typeof h=="function"?h.displayName||h.name||"Unknown":h),f(h,m,y,i,x(),o,T,a)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===b&&h._store&&(h._store.validated=1)}var S=Me,b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),U=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),ne=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=Object.prototype.hasOwnProperty,ue=Array.isArray,ge=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(h){return h()}};var be,pe={},Q=S["react-stack-bottom-frame"].bind(S,n)(),G=ge(c(n)),M={};Ka.Fragment=A,Ka.jsx=function(h,k,o,d,i){var y=1e4>ne.recentlyCreatedOwnerStacks++;return L(h,k,o,!1,d,i,y?Error("react-stack-top-frame"):Q,y?ge(c(h)):G)},Ka.jsxs=function(h,k,o,d,i){var y=1e4>ne.recentlyCreatedOwnerStacks++;return L(h,k,o,!0,d,i,y?Error("react-stack-top-frame"):Q,y?ge(c(h)):G)}})()),Ka}var Ni;function Cl(){return Ni||(Ni=1,process.env.NODE_ENV==="production"?di.exports=vl():di.exports=kl()),di.exports}var Ge=Cl();function Ae(t,e,r){console.error(t,e,r)}var ct=(t=>(t.rectangle="rectangle",t.circle="circle",t.hollowCircle="hollowCircle",t.areaWithLine="areaWithLine",t.line="line",t.custom="custom",t.none="none",t))(ct||{}),$t=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))($t||{}),pt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(pt||{}),ya=(t=>(t.butt="butt",t.round="round",t.square="square",t))(ya||{}),Qe=(t=>(t.primary="Primary",t.secondary="Secondary",t))(Qe||{}),It=(t=>(t.visible="visible",t.hidden="hidden",t))(It||{});const fa="20,10,5,5,5,10",Ml={1:"",2:v.curveLinear,3:v.curveStep},Sl={1:xt.annotationLabel,2:xt.annotationLabel,3:xt.annotationCallout,4:xt.annotationCalloutElbow,5:xt.annotationCalloutCurve};var je=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(je||{}),Qa=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(Qa||{}),Aa=(t=>(t.percentage=",.0%",t.general="",t.scientific=".2n",t.currency_USD=".2$",t.currency_CAD=".2c",t.currency_EUR=".2ē",t.currency_CHF=".2ch",t.currency_UK=".2£",t.currency_INR=".2₹",t.commaSeparated=",",t))(Aa||{}),yi=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(yi||{}),Bt=(t=>(t.start="1",t.middle="2",t.end="3",t))(Bt||{}),Fa=(t=>(t.top="1",t.bottom="2",t))(Fa||{});const Ta={none:"1",discrete:"2",colorTheme:"3"},_t={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var Oa=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(Oa||{});const Fl={singleColor:"2",multiColor:"1"},oe={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Ia=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Ia||{}),Ea=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(Ea||{});const Wt={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var Re=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(Re||{});const tt="Calibri";var fi=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(fi||{}),va=(t=>(t.total="Total",t.base="base",t.dimensionTotal="dimensionTotal",t.up="up",t.down="down",t))(va||{});const et={easeLinear:v.easeLinear,easeCubicIn:v.easeCubicIn,easeCubicOut:v.easeCubicOut,easeCubicInOut:v.easeCubicInOut,easeBounceOut:v.easeBounceOut,easeElasticOut:v.easeElasticOut,easeBackOut:v.easeBackOut},Pi={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:Re.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:Re.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:tt,chartTitleFontStyle:[],chartTitleColor:Re.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:Re.black,xAxisColorInverted:Re.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:tt,xAxisLabelFontStyle:[],xAxisLabelColor:Re.black,xAxisNumberFormat:"MMM-YY",xAxisQuarterFormat:"Long",xAxisDisplayUnits:"None",xAxisDisplayUnitsLabel:!1,xAxisLabelRotation:90,xAxisDateFormat:"DD-MM-YYYY",xAxisLabelDecimalPrecision:"2",xAxisLabelText:"",xAxisLabelDynamicText:"",xAxisLabelHTML:"",xAxisPosition:"0",xAxisBackgroundColor:"",xAxisIntervalsVisibility:!1,xAxisMinText:"",xAxisMaxText:"",xAxisIntervalText:"",hideZeroValues:!1,xAxisSortBy:"0",customSort:[],labelTextWrap:!0,multiLineLabelWrap:!1,maxXAxisLabelWidth:100},xAxisScale:{absoluteXAxisScale:!1,customScale:"0"},xAxisTitle:{xAxisTitleVisibility:!0,xAxisTitleFontSize:"11",xAxisTitleFontFamily:tt,xAxisTitleFontStyle:[],xAxisTitleColor:Re.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:Re.transparent,yAxisColorInverted:Re.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:tt,yAxisLabelFontStyle:[],yAxisLabelColor:Re.black,yAxisNumberFormat:",",yAxisDisplayUnits:"Auto",yAxisLabelRotation:90,yAxisDisplayUnitsLabel:!1,yAxisDateFormat:"DD-MM-YYYY",yAxisLabelDecimalPrecision:"0",yAxisLabelText:"",yAxisLabelDynamicText:"",yAxisLabelHTML:"",yAxisPosition:"0",yAxisBackgroundColor:"",yAxisIntervalsVisibility:!1,yAxisMinText:"",yAxisMaxText:"",yAxisIntervalText:"",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:tt,yAxisTitleFontStyle:[],yAxisTitleColor:Re.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:Re.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:tt,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:Re.black,secondaryYAxisNumberFormat:",",secondaryYAxisDisplayUnits:"None",secondaryYAxisDisplayUnitsLabel:!1,secondaryYAxisSyncWithPrimaryLabel:!1,secondaryYAxisDateFormat:"DD-MM-YYYY",secondaryYAxisLabelDecimalPrecision:"2",secondaryYAxisBackgroundColor:"#e5e5e5",secondaryYAxisIntervalsVisibility:!1,secondaryYAxisMinText:"",secondaryYAxisMaxText:"",secondaryYAxisIntervalText:""},secondaryYAxisTitle:{secondaryYAxisTitleVisibility:!0,secondaryYAxisTitleFontSize:"11",secondaryYAxisTitleFontFamily:tt,secondaryYAxisTitleFontStyle:[],secondaryYAxisTitleColor:Re.black,secondaryYAxisTitleText:"Measure",secondaryYAxisDynamicTitleText:"",secondaryYAxisTitleHTML:""},legends:{legendVisibility:!0,primaryTitleVisibility:!0,primaryTitleText:"Primary Axis",primaryTitleFontSize:"11",primaryTitleFontFamily:tt,primaryTitleFontStyle:[],secondaryTitleVisibility:!0,secondaryTitleText:"Secondary Axis",secondaryTitleFontSize:"11",secondaryTitleFontFamily:tt,secondaryTitleFontStyle:[],legendPosition:"Top",legendAlignment:"Top",legendAlignmentTopBottom:"Start",legendFontSize:"11",legendFontFamily:tt,legendFontStyle:[],legendBorder:!1,legendBorderThickness:"1",legendBorderColor:Re.black,vennLabelColor:Re.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:Re.black},plotArea:{plotAreaColor:Re.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:Re.black,plotAreaGapWidth:"50",plotAreaSeriesWidth:"50",plotAreaBarWidth:"50",gridLinesVisibility:!0,gridLinesHorizontal:!0,gridLinesVertical:!1,ticksHeight:"100",ticksWidth:"100",gridLinesColor:"#ccc",xCoordinate:"None",yCoordinate:"None",dataLabels:!0,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsforMaps:!1,dataLabelPosition:"1",dataLabelSize:"12",dataLabelValueColor:Re.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:Re.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:tt,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:Re.black,dataLabelNameFontSize:"11",dataLabelNameFontFamily:tt,dataLabelNameFontStyle:[],fillOpacity:"0.7",innerRadius:"50",cornerRadius:"0",axialGrid:!0,arcPadding:"5",axialTicks:"10",arcTransition:!0,innerRadiusForSpeedometer:"30",ticks:"3",pointerColor:Re.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:Re.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:Re.black,opacity:"0.5",plotAreaCalculatedHigh:"#00FF00",plotAreaCalculatedLow:"#FF0000",plotAreaDataLabel:"1",plotAreaDisplayUnits:"None",plotAreaHideLineAndMarkers:!0,dataLabelsOptions:"1",xscaleposition:"1",yscaleposition:"1",numberOfBubbles:!1,totalAlias:!1,totalAliasText:"",refLineBorderThickness:"1",refLineBorderColor:Re.black,flipPyramid:!1,opacityforProgressScale:"0.2",opacityforProgressGoal:"1",lineStyle:"Solid",lineWidth:"2",fitChart:!0,scaleFactor:"5",rotation:"0",intersectionLabelVisibility:!1,intersectionValueVisibility:!1,dataLabelsCoordinates:[],hideInsignificantValue:!1,sortBy:"default",chartDirection:"right",plotAreaRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},heatMap:{showHeatMap:!1,heatMapMinColor:"#FF0000",heatMapMaxColor:"#7cfc00"},marker:{markerVisibility:!0,markerSize:"1",markerShape:"Circle",lineWidth:"1.5",markerColor:Re.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:Re.black,annotationFontSize:"9",annotationFontFamily:tt,annotationFontStyle:[],annotationDecimalPrecision:"2",annotationDisplayUnits:"None",annotationBoxVisibility:[],annotationHideZeroValues:!0,annotationShowHiddenValues:!0,annotationSetLabelColor:"1",annotationRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},total:{totalVisibility:!1,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsCoordinates:[],totalNumberFormat:",",totalColor:Re.black,totalFontSize:"9",totalFontFamily:tt,totalFontStyle:[],totalConnectorType:"None",totalDecimalPrecision:"2",totalPosition:"1",totalAlignment:"1",totalHideZeroValues:!0,totalDisplayUnits:"None",editTotalTextToggle:!1,editTotalText:"Total",showTotalLabel:!0},toolTip:{toolTipVisibility:!0,toolTipTheme:"Light",toolTipNumberFormat:",",toolTipNumberFormatProgress:",.0%",toolTipDecimalPrecision:"2",toolTipLabelText:"",toolTipDisplayUnits:"None",toolTipLabelDynamicText:""},nodes:{nodesColor:"#d9d7d7",nodesSingleColor:!1,nodesFillOpacity:"1",spacing:"15",sankeyNodeWidth:"10",sankeyChartType:"Left",curviness:"0.5",nodesBorderVisibility:!0,nodesBorderThickness:"1",nodesBorderColor:Re.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:tt,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:Re.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:Re.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:Re.black,nodesDisplayUnits:"None",percentageVisibility:!1,nodesLabelOverflow:!0},links:{linksColor:"Source",linksFillOpacity:"0.5"},bins:{binsGapWidth:"0",binsFillOpacity:"0.5",binsCalculation:"Automatic",binsCalculationValue:"3",binsBorderVisibility:!1,binsBorderThickness:"1",binsBorderColor:Re.black,binsBorderOpacity:"0.5"},connector:{connectorVisibility:"2",connectorFollow:"1",connectorStepSize:"1",connectorExclude:[],connectorCustomRange:[],connectorFontSize:"11",connectorFontFamily:tt,connectorFontStyle:[],connectorKPI:"1",connectorNumberFormat:",",connectorLineThickness:"1",connectorLineColor:"#080808",connectorMarkerColor:Re.black,connectorFontColor:Re.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:Re.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:tt,footerNoteFontStyle:[],footerNoteFontColor:Re.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:Re.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:Re.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:tt,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:Re.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:tt,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:Re.black,pointerValueDecimalPrecision:"2",displayUnits:"None"},text:{textFontFamily:tt,textSpacing:"5",textRotation:90},colorScale:{showColor:"1",startColor:"#c1d8f3",endColor:"#4c6ba5",division1:"#c1d8f3",division2:"#b3cbed",division3:"#a4bfe8",division4:"#96b2e2",division5:"#88a6dc",division6:"#7999d7",division7:"#6b8dd1",division8:"#5c80cb",division9:"#4e74c6",division10:"#4c6ba5"},customScaling:{warningTextDummyNode:!1,customScalingtoggle:!1,division1:"#b3b3b3",share1:"",division2:"#b3b3b3",share2:"",division3:"#b3b3b3",share3:"",division4:"#b3b3b3",share4:"",division5:"#b3b3b3",share5:"",division6:"#b3b3b3",share6:"",division7:"#b3b3b3",share7:"",division8:"#b3b3b3",share8:"",division9:"#b3b3b3",share9:"",division10:"#b3b3b3",share10:""},colorScaleForMaps:{defaultColor:"#808080",showColorForMaps:"1",startColorForMaps:"#c1d8f3",endColorForMaps:"#4c6ba5"},pointerValue:{showPointerValue:!1,pointerValueNumberFormat:",",pointerValueDecimalPrecision:"2",connectorKPIforSpeedometer:"1",kpiAlias:!1,kpiAliasText:"",pointerValueDisplayUnits:"None",pointerValueFontSize:"11",pointerValueFontFamily:tt,pointerValueFontStyle:[],pointerValueColor:Re.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:Re.black,bubbleBorderColor:Re.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:Re.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:Re.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:tt,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:Re.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:tt,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:Re.black,dataTableAxisLabel:!0,dataTableLegends:!0,disableLegendIcon:!0,legendsWrapText:!1},dataTableOuterBorder:{borderButtonVisibility:!0,lineStyle:"solid",lineColor:"#d9d9d9",lineWidth:"1"},dataTableInnerBorder:{verticalBorderLineButton:!0,verticalBorderLineStyle:"solid",verticalBorderLineColor:"#d9d9d9",verticalBorderLineWidth:"1",horizontalBorderLineButton:!0,horizontalBorderLineStyle:"solid",horizontalBorderLineColor:"#d9d9d9",horizontalBorderLineWidth:"1"},chartPadding:{paddingArrayLTRB:[0,0,0,0]},statisticalTest:{zTest:!1,runZTest:[],zTestInputData:[]},cjsOptions:{cjsTension:0,cjsBorderRadius:0},animation:{animationEnabled:!1,animationDuration:1500,animationEffect:"easeCubicOut"},swapAxis:{swapAxisEnabled:!1}},jt={top:0,right:0,bottom:0,left:0};var se=(t=>(t.WaterfallChart="WaterfallChart",t.StackLineChart="StackLineChart",t.NormalizedStackLineChart="NormalizedStackLineChart",t.LineChart="LineChart",t.ColumnChart="ColumnChart",t.StackColumnChart="StackColumnChart",t.AreaChart="AreaChart",t.PieChart="PieChart",t.SankeyChart="SankeyChart",t.DonutChart="DonutChart",t.HorizontalBarChart="HorizontalBarChart",t.StackAreaChart="StackAreaChart",t.NormalizedStackAreaChart="NormalizedStackAreaChart",t.Treemap="Treemap",t.StackHorizontalBarChart="StackHorizontalBarChart",t.NormalizedStackColumnChart="NormalizedStackColumnChart",t.NormalizedStackHorizontalBarChart="NormalizedStackHorizontalBarChart",t.ScatterChart="ScatterChart",t.CustomColumnChart="CustomColumnChart",t.customBarChart="CustomBarChart",t.ColumnHistogramChart="ColumnHistogramChart",t.HorizontalHistogramChart="HorizontalHistogramChart",t.Maps="Maps",t.TornadoChart="TornadoChart",t.PieofPie="PieofPie",t.WordCloud="WordCloud",t.BubbleChart="BubbleChart",t.VennChart="VennChart",t.Speedometer="Speedometer",t.LayeredColumnChart="LayeredColumnChart",t.LayeredHorizontalBarChart="LayeredHorizontalBarChart",t.OrganizationChart="OrganizationChart",t.PyramidChart="PyramidChart",t.ProgressChart="ProgressChart",t.RadialBarChart="RadialBarChart",t.CombinationLine="CombinationLine",t.CombinationArea="CombinationArea",t.CombinationStackArea="CombinationStackArea",t.TornadoDefaultEntry="defaultEntry",t.DotPlot="DotPlot",t))(se||{});const ui={1:"",2:v.curveLinear,3:v.curveStep},wl=[se.ColumnChart,se.StackColumnChart,se.NormalizedStackColumnChart,se.LineChart,se.StackLineChart,se.NormalizedStackLineChart,se.AreaChart,se.StackAreaChart,se.NormalizedStackAreaChart],Ii=[se.PieChart,se.PieofPie,se.DonutChart,se.PyramidChart,se.OrganizationChart,se.VennChart,se.ProgressChart,se.Maps,se.WordCloud,se.SankeyChart,se.Speedometer,se.RadialBarChart];function Nt(t,e,r,c,x){var n=document.createElement("div");n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.fontSize=e==null?"":e+"px",n.style.fontFamily=r??"",n.style.margin="0",n.style.padding="1px",n.style.border="none",x?(n.style.width=x+"px",n.style.whiteSpace="normal",n.style.overflowWrap="break-word"):n.style.whiteSpace="nowrap",n.innerHTML=t,document.body.appendChild(n);var l=n.getBoundingClientRect(),s=l.width,p=l.height;return c!=null?(n.style.transform=`rotate(${c}deg)`,l=n.getBoundingClientRect(),n.remove(),[s,p,l.width,l.height]):(n.remove(),[l.width,l.height])}function Dl(t,e){let r=t.dataTableProperties&&t.dataTableProperties.dataTable,c=r?e*7<50?50:e*7>100?100:e*7:0;return r&&c<30&&(c=30),c}function Ti(t,e,r,c,x,n,l,s,p,f,L,u,S){let b=n.dataTableProperties&&n.dataTableProperties.dataTable&&n.xAxisLabel.xAxisPosition=="0"&&!S,_=!1;//!formatOptions.plotArea.fitChart;
24
- let A=t<200?200:S?e:t,R=e<200?200:S?t:e,g=A*.15*.8,B=Jl(l,n),U=g<B[0]+10?g:B[0]+10,W=u?ft(n.xAxisLabel.xAxisNumberFormat,s).map(h=>h):s,P=W?W[0]+"":"",D=P.length;W&&W.forEach(h=>{h=h+"";let k=h.trim()?.length||0;k>D&&(D=k,P=h.trim())});let V=Nt(P,n.xAxisLabel.xAxisLabelFontSize,n.xAxisLabel.xAxisLabelFontFamily,n.xAxisLabel.xAxisLabelRotation),$=V[0]+5,Z=V[3]+10,ce;n.xAxisLabel.labelTextWrap?n.xAxisLabel.multiLineLabelWrap?ce=n.xAxisLabel.maxXAxisLabelWidth:ce=Z<R*.15?Z:R*.15:ce=Z;let ne=n.xAxisTitle.xAxisTitleVisibility?n.xAxisTitle.xAxisDynamicTitleText.length!==0?Nt(n.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:Nt(n.xAxisTitle.xAxisTitleText,"13",tt)[1]:b?5:0;ne=ne>R*.1?R*.1:ne;let ae=b?0:n.xAxisLabel.xAxisLabelVisibility?ce:0,ue=n.yAxisTitle.yAxisTitleVisibility?n.yAxisTitle.yAxisDynamicTitleText.length!==0?Nt(n.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:Nt(n.yAxisTitle.yAxisTitleText,"13",tt)[1]:0;ue=ue>A*.1?A*.1:ue;const ge=r*1.1,be=x*1.1;let pe=n.yAxisLabel.yAxisLabelVisibility?zi(ge,be,n,!1,L)+5:Dl(n,v.max(l,h=>h?.length||0)||0)+10,Q=n.secondaryYAxisLabel.secondaryYAxisLabelVisibility?zi(c,p,n,!0,L):0,G=n.secondaryYAxisTitle.secondaryYAxisTitleVisibility?n.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?Nt(n.secondaryYAxisTitle.secondaryYAxisTitleHTML,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:Nt(n.secondaryYAxisTitle.secondaryYAxisTitleText,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;G=G>A*.1?A*.1:G;let M=n.chartTitle.chartTitleVisibility?n.chartTitle.dynamicTitleText.length!==0?Nt(n.chartTitle.chartTitleHTML,void 0,void 0)[1]:Nt(n.chartTitle.chartTitleText,"16",tt)[1]:0;return M=M>R*.1?R*.1:M,{width:A,height:R,isChartScrollable:_,legendMargin:U,dimensionHeightWidthArray:V,actualDimesionWidth:$,maxDimensionWidth:Z,xTitle:ne,xLabel:ae,yTitle:ue,yLabel:pe,secondaryYLabel:Q,secondaryAxisTitleWidth:G,chartTitleHeight:M}}function Vl(t,e,r,c,x,n,l,s,p,f,L,u,S,b){try{const _=b??Ti(t,e,r,c,x,n,l,s,p,f,L,u,S),A=S?_.xTitle+_.xLabel:_.yTitle+_.yLabel,R=n.legends.legendPosition,g=n.legends.legendVisibility,B=n.xAxisLabel.xAxisPosition=="1"&&S;let U=0,W=0;const P=f&&!S?_.secondaryYLabel+_.secondaryAxisTitleWidth:0;switch(R){case je.none:case je.none:W=15+P,U=A+5;break;case je.top:W=B?A+5:15+P,U=B?5+P+_.xTitle:A+5;break;case je.right:W=B?A+5+_.legendMargin:_.legendMargin+P+20,U=B?5+P+_.xTitle+_.legendMargin:A+5;break;case je.bottom:W=B?A+5:15+P,U=B?5+P+_.xTitle:A+5;break;case je.left:U=_.legendMargin+A+33,W=15+P;break;default:W=15+P,U=A+5}const D=n.chartPadding?.paddingArrayLTRB;return D&&(U+=D[0],W+=D[2]),n.dataTableProperties&&n.dataTableProperties.dataTable&&L&&!S&&(U=U+35),{left:U,right:W,yLabel:_.yLabel,yTitle:_.yTitle,xLabel:_.xLabel,xTitle:_.xTitle,dimensionHeightWidthArray:_.dimensionHeightWidthArray,chartTitleHeight:_.chartTitleHeight,legendMargin:_.legendMargin,secondaryYLabel:_.secondaryYLabel,secondaryAxisTitleWidth:_.secondaryAxisTitleWidth}}catch(_){throw _}}function Nl(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_){try{const A=b??Ti(t,e,r,c,x,n,l,s,p,f,L,u,S),g=n.legends.legendVisibility?n.legends.legendPosition:je.none,B=_&&!S?12:0,U=S?A.yTitle+A.yLabel:A.xTitle+A.xLabel;let W=0,P=0;switch(g){case je.none:W=A.chartTitleHeight+5,P=U+5+B;break;case je.top:W=35+A.chartTitleHeight,P=U+B;break;case je.right:W=A.chartTitleHeight+5,P=U+5+B;break;case je.bottom:P=30+U+B,W=A.chartTitleHeight+5;break;case je.left:W=A.chartTitleHeight+5,P=U+5+B;break;default:W=A.chartTitleHeight+5,P=U+5+B}n.xAxisLabel.xAxisPosition&&!S&&n.xAxisLabel.xAxisPosition=="1"&&(P=P-A.xLabel,W=W+A.xLabel),L&&!S&&(W=W+12);const D=f&&S?A.secondaryYLabel+A.secondaryAxisTitleWidth:0;D&&(W=W+D);const V=n.chartPadding?.paddingArrayLTRB;return V&&(W+=V[1],P+=V[3]),{top:W,bottom:P,chartTitleHeight:A.chartTitleHeight,xAxisRelatedMargin:U,xLabel:A.xLabel,xTitle:A.xTitle}}catch(A){throw A}}function Ct(t,e,r,c,x,n,l,s,p,f,L,u,S,b){try{const _=Ti(t,e,r,c,x,n,l,s,p,f,L,u,S),A=Vl(t,e,r,c,x,n,l,s,p,f,L,u,S,_),R=Nl(t,e,r,c,x,n,l,s,p,f,L,u,S,_,!0);let g,B=t-A.left-A.right,U=e-R.top-R.bottom,W,P=!1;({visibleBars:g,columnWidth:W,scrollbarVisible:P}=Hl(S?U:B,n,b));const D={top:R.top,bottom:R.bottom,left:A.left,right:A.right};if(S){const V=L?30:0;D.right=D.right+V}return n.connector.connectorVisibility!="2"&&b?.chartType==se.StackColumnChart&&(D.top=D.top+20),n.connector.connectorVisibility!="2"&&b?.chartType==se.StackHorizontalBarChart&&(D.right=D.top+20),{margin:D,yLabel:A.yLabel,xLabel:A.xLabel,yTitle:A.yTitle,xTitle:A.xTitle,dimensionHeightWidthArray:A.dimensionHeightWidthArray,chartTitleHeight:A.chartTitleHeight,legendMargin:A.legendMargin,secondaryYLabel:A.secondaryYLabel,secondaryAxisTitleWidth:A.secondaryAxisTitleWidth,visibleBars:g,columnWidth:W,scrollbarVisible:P}}catch(_){throw _}}function Mt(t,e,r,c){t.attr("viewBox","0 0 "+e+" "+r);const{chartAreaColor:x,chartAreaBorder:n}=c.chartArea;if(t.style("background-color",x),n){const l=c.chartArea.chartAreaBorderColor,s=c.chartArea.chartAreaBorderThickness,p=c.chartArea.chartAreaBorderStyle.toString(),f=p==="1"?"solid":p==="2"?"dashed":"dotted";t.style("outline",`${s}px ${f} ${l}`).style("outline-offset",`-${s}px`)}else t.style("outline","none").style("outline-offset",null)}const St=(t,e)=>{let r=v.select(t.current);r.selectAll("*").remove();let c=Ei(Pi,e),x=t.current.getBoundingClientRect(),n=x.width,l=x.height;return{formatOptions:c,svg:r,width:n,height:l}},ta=(t,e,r)=>{if(!t.dataTableProperties.dataTable)return{formatOptions:t};let c=!1;return e.forEach(x=>{x?.properties?.showInDataTable==!0&&(c=!0)}),r.forEach(x=>{x?.properties?.showInDataTable==!0&&(c=!0)}),c||(t.dataTableProperties.dataTable=!1),{formatOptions:t}};function Ei(t,e){if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const c=t[r],x=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!x||n===void 0){e[r]=Array.isArray(c)?[...c]:typeof c=="object"&&c!==null?{...c}:c;return}const l=Ri(c),s=Ri(n);l&&s&&Ei(c,n)}),e}function Ri(t){return Object.prototype.toString.call(t)==="[object Object]"}function Et(t,e,r,c,x){parseFloat(t.yAxisLabel.yAxisIntervalText);let n=parseFloat(t.yAxisLabel.yAxisMaxText),l=parseFloat(t.yAxisLabel.yAxisMinText),s=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText),p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText);if(parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText),t.yAxisLabel.yAxisIntervalsVisibility){t.xAxisLabel.xAxisPosition=="2"&&(t.xAxisLabel.xAxisPosition="0"),l=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let U=t.yAxisLabel.yAxisMaxText;n=String(U).length>0?parseFloat(U):r,n&&(r=n),parseFloat(t.yAxisLabel.yAxisIntervalText)<r&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else n=void 0,l=void 0;if(t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<x&&(p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),s=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):x,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(s=void 0,p=void 0),t.secondaryYAxisLabel.secondaryYAxisSyncWithPrimaryLabel){s=void 0,p=void 0;const U=n!==void 0&&!Number.isNaN(n)?n:r,W=Math.max(U,x);r=W,x=W,n!==void 0&&!Number.isNaN(n)&&(n=W)}let f=e?Ze(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,L=r?Ze(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,u=c?Ze(c,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=x?Ze(x,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,b=n?Ze(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,_=l?Ze(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,A=s?Ze(s,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,R=p?Ze(p,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,g=f<L||f===L?r:e;if(l){let U=_<L?r:l;g=g<U?U:g}if(n){let U=b>f?n:e;g=g<U?U:g}n&&l&&(g=b>_?n:l);let B=u<S?x:c;if(p){let U=R<S?x:p;B=B<U?U:B}if(s){let U=A>S?s:x;B=B<U?U:B}return s&&p&&(B=A>R?s:p),{maxNumberForPrimaryAxis:g,maxNumberForSecondaryAxis:B,customYaxisMaxValue:r,secondaryCustomYaxisMaxValue:x}}function Ze(t,e,r,c,x){try{let n,l="",s=c,p;if(e==="Auto")return Pl(t);switch(e!=Qa.none&&(e==Qa.thousands&&(n=1e3,l="K"),e==Qa.millions&&(n=1e6,l="M"),e==Qa.billions&&(n=1e9,l="B"),t=t/n),x&&t<0&&(t=-t),r){case Aa.percentage:return p=`.${s}%`,v.format(p)(t);case Aa.general:return p=`.${s}f`,v.format(p)(t)+l;case Aa.scientific:let f=Number(s);return p=`.${f==0?1:(f+1).toString()}n`,v.format(p)(t)+l;case Aa.currency_USD:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"$"+v.format(p)(t)+l;case Aa.currency_CAD:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"C$"+v.format(p)(t)+l;case Aa.currency_EUR:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"€"+v.format(p)(t)+l;case Aa.currency_CHF:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"CHF"+v.format(p)(t)+l;case Aa.currency_UK:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"£"+v.format(p)(t)+l;case Aa.currency_INR:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"₹"+v.format(p)(t)+l;case Aa.commaSeparated:return p=`,.${s}f`,v.format(p)(t)+l;default:return p=".2f",v.format(p)(t)+l}}catch(n){throw n}}function Pl(t){if(t==null||isNaN(t))return"-";const e=Math.abs(t);if(e>=1e9)return v.format(".2s")(t).replace("G","B");if(e>=1e6)return v.format(".2s")(t);if(e>=1e3)return v.format(".2s")(t);if(e>=1){const r=v.format(".2f")(t);return+r===Math.floor(t)?v.format(".0f")(t):r}else return e>=.01?v.format(".2f")(t):e>0?v.format(".2e")(t):"0"}function zi(t,e,r,c,x){try{{let n,l,s=c?r.secondaryYAxisLabel.secondaryYAxisDisplayUnits:r.yAxisLabel.yAxisDisplayUnits,p=c?r.secondaryYAxisLabel.secondaryYAxisNumberFormat:r.yAxisLabel.yAxisNumberFormat,f=c?r.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:r.yAxisLabel.yAxisLabelDecimalPrecision,L=c?r.secondaryYAxisLabel.secondaryYAxisLabelFontSize:r.yAxisLabel.yAxisLabelFontSize,u=c?r.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:r.yAxisLabel.yAxisLabelFontFamily;if(s!="None")return n=Ze(Math.floor(t)||Math.floor(e),s,p,f??"2").toString(),l=Nt(n,L,u)[0],l<30?30:l+5;try{return n=Ze(Math.floor(t)||Math.floor(e),s,p,f??"2").toString(),x&&(n="-100%"),l=Nt(n,L,u)[0],l<30?30:l+5}catch{}}}catch(n){throw n}}function Ft(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){throw r}}function vt(t,e,r,c,x,n,l){try{let s=l??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",s+"-clip").append("rect").attr("width",c).attr("height",r>0?x-r:x),t.append("rect").attr("width",c).attr("height",r>0?x-r:x).attr("stroke",e.plotArea.plotAreaBorder&&!Ii.includes(n)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==Re.white&&!Ii.includes(n)?e.plotArea.plotAreaColor:"none")}catch(s){throw s}}function Il(t,e){const r=t.yPosition,c=t.yPosition+t.height,x=e.yPosition,n=e.yPosition+e.height;return r<n&&c>x}function dt(t,e,r,c,x,n,l,s,p){try{let f=c.yAxisLabel.yAxisIntervalsVisibility,L=!1,u=f?parseFloat(c.yAxisLabel.yAxisIntervalText):void 0,S=[],b;if(x.chartType===se.TornadoChart){const A=Math.max(Math.abs(e),Math.abs(t)),R=l||A,g=n||e;if(u&&u>0){for(let B=g;B<=R+1e-6;B+=u)S.push(parseFloat(B.toFixed(6)));b=S.length}else{L=!0;const B=6,W=(R-g)/B;for(let P=0;P<=B;P++){const D=g+P*W;S.push(parseFloat(D.toFixed(6)))}b=s?p/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:L}}if(!l&&t>0){const R=(t-e)*.05;t=t+R}if(u&&u!==0&&u!==void 0){let A=n||n==0?n:e,R=l||l==0?l:t;A<0?b=Math.floor((R-A)/u):b=Math.floor(R/u);let g=18;(l||l==0)&&(t=l);let B=n||n==0?n:e<0?Math.round(e):0;if(S.push(B),b>100){let U="Tick count cannot exceed more than 100.";A<0?u=(R-B)/100:u=R/100}if(b=b<100?b:100,b>g)for(let U=0;U<parseInt(b)&&(B+=u,parseFloat(B.toFixed(5))<=t);U++)S.push(B);else for(let U=0;U<g&&(B+=u,B<=t);U++)S.push(B)}else{L=!0;let A=Nt((l||x.yMaxLeft).toString(),c.yAxisLabel.yAxisLabelFontSize,c.yAxisLabel.yAxisLabelFontFamily,0);S=$i(n||x.yMinLeft,t,s?p:r,s?A[1]:A[0]),b=s?p/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:L}}catch(f){throw f}}function $i(t,e,r,c=80){const x=e-t;if(!isFinite(x)||Math.abs(x)<1e-12)return[Number(t.toFixed(12))];const n=x<10?10:Math.max(2,Math.floor(r/c)),l=x/n,s=Math.pow(10,Math.floor(Math.log10(l))),p=[1,1.5,2,2.5,5,10];let f=p.map(_=>_*s).find(_=>Math.ceil(x/_)<=n);f||(f=p.at(-1)*s);const L=Math.floor(t/f)*f,u=Math.ceil(e/f)*f,S=Math.round((u-L)/f),b=new Array(S+1);for(let _=0;_<=S;_++)b[_]=Number((L+_*f).toFixed(12));return b}function Jt(t,e,r,c,x,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-c},0)`).attr("height",r>0?n-r:n).attr("width",c).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Re.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(x);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Re.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(l){throw l}}function hi(t,e,r,c,x,n,l){let s=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${l},0)`).attr("height",r>0?n-r:n).attr("width",c).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Re.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const p=t.append("g").call(x).attr("transform",`translate(${l},0)`);p.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==Re.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",s.includes("Italic")?"Italic":"").style("text-decoration",s.includes("Underline")?"Underline":"").style("font-weight",s.includes("Bold")?"Bold":"").attr("visibility",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),p.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",e.secondaryYAxisLabel.secondaryYAxisWidth),p.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",e.plotArea.fitChart?"1":"0").append("text").attr("transform","rotate(90)").attr("text-anchor","start").attr("class","DisplayUnit").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor).style("font-size",parseFloat(e.secondaryYAxisLabel.secondaryYAxisLabelFontSize)*.8).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle).attr("visibility",e.secondaryYAxisLabel.secondaryYAxisDisplayUnitsLabel==!1?"hidden":"visible").text("("+e.secondaryYAxisLabel.secondaryYAxisDisplayUnits+")")}function bt(t,e){try{let r=[],c=e/30<t.length?Math.round(e/30):t.length;if(c>=t.length)return r=t,r;let x=Math.round(t.length/c);(t.length-1)%x!=0&&(t.length-1)%(x+1)==0&&(x=x+1),r.push(t[0]);let n;for(let l=1;l<t.length-1;l++){const s=l*x;if(s>t.length)break;r.push(t[s]),n=s}if(!r.includes(t[t.length-1])){let l=n>=Math.round(t.length-t.length*.02);r.push(t[t.length-1])}return r=r.filter(l=>l)}catch(r){throw r}}function Ot(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_){try{let A=e.chartType!==se.ColumnHistogramChart?bt(b,u):[],R=[],g=s[3]+10;e.chartType!=se.ColumnHistogramChart?R=L?ft(c.xAxisLabel.xAxisNumberFormat,A.map(Q=>Q)).map(Q=>Q):A:A.forEach(Q=>{R.push(e.formattedDimensionListMap.get(Q))});let B=!c.plotArea.fitChart&&(e.chartType==se.AreaChart||e.chartType==se.StackAreaChart||e.chartType==se.NormalizedStackAreaChart);t||(t=t);let U=c.xAxisLabel.xAxisLabelFontStyle,W="rotate("+-c.xAxisLabel.xAxisLabelRotation+")";c.dataTableProperties&&c.dataTableProperties.dataTable&&wl.includes(e.chartType)&&c.xAxisLabel.xAxisPosition!="1"&&(c.xAxisLabel.xAxisLabelVisibility=!1);let P=c.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const D=t.append("g").attr("id","x-axis");D.append("rect").attr("transform",`translate(1,${P==="0"?x>0?S-x:S:P==="1"?-r:n(0)})`).attr("height",r).attr("width",u).attr("fill",c.xAxisLabel.xAxisLabelVisibility&&c.xAxisLabel.xAxisBackgroundColor?c.xAxisLabel.xAxisBackgroundColor!==Re.white?c.xAxisLabel.xAxisBackgroundColor:"none":c.chartArea.chartAreaColor);const V=D.append("g").attr("transform",`translate(0,${P=="0"?x>0?S-x:S:P=="1"?0:n(0)})`).call(l);let $=P==="1"?"5":"0",Z;c.xAxisLabel.labelTextWrap?c.xAxisLabel.multiLineLabelWrap?Z=c.xAxisLabel.maxXAxisLabelWidth:Z=g<p*.15?g:p*.15:Z=c.xAxisLabel.xAxisLabelRotation==0?f:g;const ce=typeof _.step=="function"?_.step():f,ne=parseInt(c.xAxisLabel.xAxisLabelFontSize)*1.2,ae=Math.floor(ce/ne),ue=c.xAxisLabel.xAxisLabelRotation==0;let ge=V.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(Z)).style("height",ce+"px").attr("transform",(Q,G)=>`rotate(${P==="1"?-c.xAxisLabel.xAxisLabelRotation:c.xAxisLabel.xAxisLabelRotation!=0?180-c.xAxisLabel.xAxisLabelRotation:0}) translate (${c.xAxisLabel.xAxisLabelRotation!=0?$+`, -${G==0&&B?15:ce/2}`:-Z/2+" , "+(P==="1"?"-15":"8")})`);ue||ge.style("overflow","visible"),Yi()==="safari"&&ge.attr("width",c.xAxisLabel.labelTextWrap?g<p*.125?g:p*.125:r).attr("height","20px");let pe=ge.append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",ue?"center":"end").style("align-items",ue?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("transform",Yi()==="safari"||P==="1"?"":c.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(c.xAxisLabel.labelTextWrap&&!c.xAxisLabel.multiLineLabelWrap||!c.xAxisLabel.labelTextWrap)&&pe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),c.xAxisLabel.labelTextWrap&&c.xAxisLabel.multiLineLabelWrap&&pe.style("-webkit-line-clamp",ae.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),pe.style("text-align",c.xAxisLabel.xAxisLabelRotation!=0?"start":"center").style("user-select","none").style("margin",0).style("padding","0 1px").style("font-family",c.xAxisLabel.xAxisLabelFontFamily).style("color",c.xAxisLabel.xAxisLabelColor).style("font-size",c.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",U.includes("Italic")?"Italic":"").style("text-decoration",U.includes("Underline")?"Underline":"").style("font-weight",U.includes("Bold")?"Bold":"").style("visibility",c.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===se.ColumnHistogramChart?pe.attr("title",(Q,G)=>Ze(Q,c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisNumberFormat,c.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((Q,G)=>Ze(Q,c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisNumberFormat,c.xAxisLabel.xAxisLabelDecimalPrecision,!1)):pe.attr("title",(Q,G)=>(""+R[G]).trim()).html((Q,G)=>(""+R[G]).trim()),V.selectAll("text").style("visibility",(c.xAxisLabel.xAxisLabelVisibility,"hidden")),V.selectAll("line").style("stroke",c.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",c.xAxisLabel.xAxisLabelVisibility||c.plotArea.gridLinesVertical?"visible":"hidden"),V.select(".domain").style("stroke",c.xAxisLabel.xAxisColor).attr("stroke-width",c.xAxisLabel.xAxisWidth?c.xAxisLabel.xAxisWidth:c.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges").attr("visibility",c.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").raise(),t}catch(A){throw A}}function Yi(){let t="";try{const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1:t="edge";break;case(e.indexOf("opr")>-1&&!!window.opr):t="opera";break;case(e.indexOf("chrome")>-1&&!!window.chrome):t="chrome";break;case e.indexOf("trident")>-1:t="ie";break;case e.indexOf("firefox")>-1:t="firefox";break;case(e.indexOf("safari")>-1||e.indexOf("applewebkit")>-1):t="safari";break;default:t="other";break}}catch(e){throw e}finally{return t}}const Ui={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},El=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const r=Math.floor(e-25569),c=new Date(r*86400*1e3);return Number.isNaN(c.getTime())?null:{day:c.getUTCDate(),month:c.getUTCMonth(),year:c.getUTCFullYear()}},Rl=t=>String(t%100).padStart(2,"0"),zl=(t,e,r,c)=>{const x=Ui.short[e],n=Ui.long[e],l=String(t).padStart(2,"0"),s=String(e+1).padStart(2,"0"),p=Rl(r),f=String(r);switch(c){case"Month":return n;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${f}`;case"Year":return f;case"Default":return`${l}-${x}-${f}`;case"DD-MM-YYYY":return`${l}-${s}-${f}`;case"MM-DD-YYYY":return`${s}-${l}-${f}`;case"DD-MM":return`${l}-${s}`;case"YYYY-MM-DD":return`${f}-${s}-${l}`;case"YYYY-MM":return`${f}-${s}`;case"YYYY":return f;case"MM-YYYY":return`${s}-${f}`;case"MMM-YY":return`${x}-${p}`;case"YY-MMM":return`${p}-${x}`;case"MMMM-YY":return`${n}-${p}`;case"MMMM-YYYY":return`${n}-${f}`;case"DD-MMM":return`${l}-${x}`;case"DD-MMM-YY":return`${l}-${x}-${p}`;case"DD-MMM-YYYY":return`${l}-${x}-${f}`;default:return`${l}-${x}-${f}`}},ft=(t,e)=>{try{return e.map(r=>{const c=El(r);if(!c)return r;const{day:x,month:n,year:l}=c;return zl(x,n,l,t)})}catch(r){throw r}};function Ga(t,e,r){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let c=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(r).enter().filter(n=>n.isVisible).append("g").attr("class","seriesLabels").attr("transform",n=>`translate(${n.xPosition}, ${n.yPosition})`).append("foreignObject").attr("width",n=>n.width).attr("height",n=>n.height).append("xhtml:div").style("display","flex").style("align-items","center").style("justify-content","center").style("width","100%").style("height","100%").append("xhtml:div").style("width","fit-content").style("height","100%").style("padding-left","5px").style("padding-right","5px").style("border-radius","4px").style("background-color",t.seriesLabel.seriesLabelBackgroundColor).style("font-size",t.seriesLabel.seriesLabelFontSize+"px").style("font-family",t.seriesLabel.seriesLabelFontFamily).style("font-style",c.includes("Italic")?"italic":"").style("text-decoration",c.includes("Underline")?"underline":"").style("font-weight",c.includes("Bold")?"bold":"").style("color","black").text(n=>n.seriesValue)}}function $l(t,e,r,c,x,n){const l=r.xAxisLabel.xAxisPosition!="1"?e.left-20-x:5;return t?`rotate(-90) translate(-${e.top+c},${l})`:`translate(${e.left},${e.top+c+(r?.xAxisLabel?.xAxisPosition=="1"?0:t?n:x)})`}function wt(t,e,r,c,x,n,l,s,p,f,L){try{let u=r.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",$l(e,c,t,L,x,p)).attr("class","xAxisTitle").attr("width",e?L:f).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?u.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):u.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){throw u}}function Dt(t,e,r,c,x,n,l,s,p,f,L){try{let u=r>0?t-r:t,S=x.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",c?n.left:`-${n.top+u}`).attr("y",c?n.top+u+s:n.left-l-s).attr("class","yAxisTitle").attr("transform",c?"":"rotate(-90)").attr("width",c?p:u).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?S.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):S.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),x}catch(u){throw u}}function Ht(t,e,r,c,x,n,l,s,p,f=!1){let L=t.append("foreignObject").attr("visibility",e&&c.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",f?`${r.left}`:`-${r.top+(x>0?n-x:n)}`).attr("y",f?`${r.top-s-p-2}`:`${r.left+l+s-2}`).attr("class","yAxisTitleSecondary").attr("transform",f?"rotate(0)":"rotate(-90)").attr("width",f?l:x>0?n-x:n).attr("height",p+"px");c.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?L.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",c.secondaryYAxisTitle.secondaryYAxisTitleText).html(c.secondaryYAxisTitle.secondaryYAxisTitleHTML?c.secondaryYAxisTitle.secondaryYAxisTitleHTML:c.secondaryYAxisTitle.secondaryYAxisTitleText):L.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","3px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size",c.secondaryYAxisTitle.secondaryYAxisTitleFontSize+"px").style("font-family",c.secondaryYAxisTitle.secondaryYAxisTitleFontFamily).style("font-style",c.secondaryYAxisTitle.secondaryYAxisTitleFontStyle).attr("title",c.secondaryYAxisTitle.secondaryYAxisTitleText).html(c.secondaryYAxisTitle.secondaryYAxisTitleText)}function Vt(t,e,r,c){let x=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r-4).attr("height",c+"px");const n=p=>{const f=document.createElement("div");return f.innerHTML=p,f.textContent||f.innerText||""},s=!!e.chartTitle.chartTitleHTML?n(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?x.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",s).style("white-space","pre").style("text-overflow","ellipsis").html(e.chartTitle.chartTitleHTML?e.chartTitle.chartTitleHTML:e.chartTitle.chartTitleText):x.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow","hidden").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",e.chartTitle.chartTitleFontFamily).attr("title",e.chartTitle.chartTitleText).html(e.chartTitle.chartTitleText)}function mt(t){if(t.line.interpolationType=="1")return v.curveLinear;if(t.line.interpolationType=="2"&&t.line.smoothType=="1")return v.curveMonotoneX;if(t.line.interpolationType=="2"&&t.line.smoothType=="2")return v.curveCardinal.tension(parseFloat(t.line.cardinalTension));if(t.line.interpolationType=="3"&&t.line.stepPosition=="1")return v.curveStepBefore;if(t.line.interpolationType=="3"&&t.line.stepPosition=="2")return v.curveStep;if(t.line.interpolationType=="3"&&t.line.stepPosition=="3")return v.curveStepAfter}function Yl(t){const e=t.indexOf(" - ");return e==-1?fi.default:t.slice(e+3)}const ka=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function _a(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Yt(t,e,r){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:c,minVal:x,maxVal:n}=e.annotation.annotationRangeFilter;return t.filter(l=>{const s=r(l);switch(c){case"lt":return s<=n;case"gt":return s>=x;case"in":return s>=x&&s<=n;case"not-in":return s<x||s>n;default:return!0}})}function Ra(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W,P,D,V){try{const $=f===se.TornadoChart;let Z=new Map,ce=p.annotation.annotationType??"1",ne=p.annotation.annotationPosition.toString()!="4"?p.annotation.annotationPosition:null,ae=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const ue=p.annotation.connectorType?.toLowerCase()==="curve";if(p.annotation.annotationVisibility){let ge=[ce=="1"?"connector":""],be=[],pe=n.annotation(),Q=p.annotation.connectorType,G=p.annotation.annotationVisibility,M=p.annotation.annotationFontStyle,h=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates)),k=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";h=vi(h,p,f);let o=[],d=[];switch(h.length!=0&&h.forEach(a=>{a.dx=a.dx*u/a.width,a.dy=a.dy*L/a.height,a.width=u,a.height=L}),G){case"2":t.forEach(a=>{a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"3":t.forEach(a=>{a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"4":t.forEach(a=>{a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})}),t.forEach(a=>{a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"1":for(let a=0;a<t[0].data.length;a++)t.forEach(m=>{m.data[a]&&be.push({Dimension:m.data[a].dimension,Measure:m.data[a].value,Legend:m.data[a].legend,LabelPosition:ne||m.properties.annotationPosition,Labelcolor:m.properties[ae],hoverText:ka(m,V),Axis:m.properties.axis,LegendUniqueId:m.properties.legendUniqueId})});break;case"5":break;case"6":t.forEach(a=>{switch(a.properties.annotation.toString()){case"1":for(let N=0;N<t[0].data.length;N++)a.data[N]&&be.push({Dimension:a.data[N].dimension,Measure:a.data[N].value,Legend:a.data[N].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"2":break;case"3":a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"4":a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"5":a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId}),a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;be.forEach((a,m)=>{i<a.Measure&&(i=a.Measure)});let y=i*.1;be.forEach((a,m)=>{let N={note:{label:a.Measure>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":Ze(f===se.TornadoChart?Math.abs(a.Measure):a.Measure,p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:D&&f!==se.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":f===se.TornadoChart?"end":"middle"},data:D?{y:$?Yl(a.Legend):a.Dimension,x:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure}:{x:a.Dimension,y:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure},dx:0,dy:0,connector:{end:k,curve:ui[p.annotation.connectorCurve],points:ue?_a(0,0):[[0,0],[0,0]]},disable:ge,subject:{height:15,width:15},color:a.Labelcolor,type:xi(n,parseFloat(ce)),height:L,width:u};if(D){let re=a.Axis===Qe.primary?r:c;(bt(b,_).includes(a.Dimension)||f===se.TornadoChart)&&!l.includes(a.Legend)&&re(a.Measure)<=S&&re(a.Measure)>=0&&o.push(N)}else bt(b,S).includes(a.Dimension)&&!l.includes(a.Legend)&&(a.Axis==Qe.primary?r(a.Measure)<=_&&r(a.Measure)>=0:c(a.Measure)<=_&&c(a.Measure)>=0)&&o.push(N)}),p.annotation.annotationHideZeroValues&&(o=o.filter(a=>D?a.data.x.measure!==0:a.data.y.measure!==0)),o=Yt(o,p,a=>D?a.data.x.measure:a.data.y.measure),h.length===0?(h=o,Z=new Map(h.map(a=>[a.data.legendUniqueId,{measure:D?a.data.x.measure:a.data.y.measure,dimension:D?a.data.y:a.data.x,legendUniqueId:a.data.legendUniqueId,dx:a.dx,dy:a.dy,connectorPoints:a.connector?.points||[],isVisible:a.data.isVisible??!0,width:a.width,height:a.height}]))):Z=new Map(h.map(a=>[a.legendUniqueId,a])),o.forEach(a=>{const m=a.data.legendUniqueId;if(h.length!=0){const N=Z.get(m);N&&(a.dx=N.dx,a.dy=N.dy,a.data.isVisible=N.isVisible??!0,N?.connectorPoints&&N.connectorPoints.length>=(ue?3:2)?a.connector.points=N.connectorPoints:a.connector.points=ue?_a(a.dx,a.dy):[[0,0],[0,0]])}d.push(a)}),pe.editMode(p.annotation.annotationDraggable&&W).accessors({x:function(a){if(D){let m=a.x.axis===Qe.primary?r:c,N=a.x.axis;return Bi(p,a.x.measure?a.x.measure:0,a.position,m,y,void 0,f,P,N)}else if(f===se.ColumnChart){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=B(m);return N!=null?e(a.x)+N-(U-B.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==Qe.primary)return ei(a.y.measure,parseFloat(a.position),r,y,a.prevValue,f);if(D){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=B&&f!==se.DotPlot?B(m):0;return $?B(a.y)+B.bandwidth()/2:B?e(a.y)+N-(U-B.bandwidth())/2-5:e(a.y)-5}else return ei(a.y.measure,parseFloat(a.position),c,y,a.prevValue,f)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,h.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(T.selectAll(".annotation-note-label").filter(N=>N.data.x==a.data.x&&N.data.y.measure==a.data.y.measure).attr("display","block"),m.data.isVisible=!0)})),d.forEach(m=>{(m.data?.legendUniqueId==a.data.legendUniqueId||m.legendUniqueId==a.data.legendUniqueId)&&(m.dx=a._dx*u/m.width,m.dy=a._dy*L/m.height,m.connectorPoints=a.connector?.points?.map(N=>[...N])||[])}),g){const m=d.map(N=>({legendUniqueId:N.data?.legendUniqueId||N.legendUniqueId,dx:N.dx,dy:N.dy,connectorPoints:N.connectorPoints||[],isVisible:(N.data?.isVisible||N.isVisible)??!0,width:N.width,height:N.height}));g(m)}T.selectAll(".connector").attr("hoverId",m=>m.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]),T.selectAll(`.connector-${k}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),T.selectAll(".note-line").attr("hoverId",m=>m.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]).filter(m=>m._dx==0&&m._dy==0).remove(),T.selectAll(".annotation-note-label").filter(m=>m.data&&m.data.isVisible).style("display","block")}).on("noteclick",function(a){p.annotation.annotationDraggable&&W&&(a.data.isVisible=!1,h.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(T.selectAll(".annotation-note-label").filter(N=>N.data.x==a.data.x&&N.data.y.measure==a.data.y.measure).attr("display","none"),m.data.isVisible=!1)}),T.selectAll(".annotation-note-label").filter(m=>m.data&&!m.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>r.invert(a.y)}).notePadding(0).annotations(d),p.plotArea.fitChart&&R.selectAll(".annotation-group").remove();let T=Ci(R,p,x,M,pe,k,D);if(p.animation?.animationEnabled){const a=p.animation.animationDuration,m=et[p.animation.animationEffect],N=pe.accessors(),re=f===se.LineChart,K=f===se.DotPlot,me=(Le,ze=0)=>{const Se=N.x(Le.data),ie=N.y(Le.data);return`translate(${Se+ze}, ${ie})`};if(K)T.selectAll(".annotation").attr("opacity",0).attr("transform",Le=>me(Le,-15)).transition().duration(a).ease(m).attr("opacity",1).attr("transform",Le=>me(Le));else if(re){const Le=e.range?e.range():[0,1],ze=Math.min(Le[0],Le[1]),Se=Math.max(Le[0],Le[1])-ze,ie=(De,ye=100)=>{for(let fe=0;fe<=ye;fe++){const $e=fe/ye;if((m??v.easeLinear)($e)>=De)return $e}return 1};T.selectAll(".annotation").attr("opacity",0).each(function(De){const ye=N.x(De.data)??ze,fe=Se>0?Math.max(0,Math.min(1,(ye-ze)/Se)):0,$e=ie(fe)*a;v.select(this).transition().delay($e).duration(0).attr("opacity",1)})}else T.selectAll(".annotation").attr("transform",function(Le){if(D){const ze=r?r(0):0,Se=N.y(Le.data);return`translate(${ze}, ${Se})`}else{const ze=N.x(Le.data),Se=Le.data?.y?.axis===Qe.primary?r:c??r,ie=Se?Se(0):0;return`translate(${ze}, ${ie})`}}).transition().duration(a).ease(m).attr("transform",function(Le){const ze=N.x(Le.data),Se=N.y(Le.data);return`translate(${ze}, ${Se})`})}}}catch($){throw $}}function Ul(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W,P){try{let D=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let V=[D=="1"?"connector":""],$=[],Z=new Map,ce=n.annotation(),ne=u.annotation.connectorType,ae=u.annotation.annotationVisibility,ue=u.annotation.annotationFontStyle,ge=[],be=[],pe=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const Q=u.annotation.connectorType?.toLowerCase()==="curve";let G=JSON.parse(JSON.stringify(u.plotArea.dataLabelsCoordinates));G=vi(G,u,se.CustomColumnChart);let M=[],h=[];G.length!=0&&G.forEach(i=>{i.dx=i.dx*b/i.width,i.dy=i.dy*S/i.height,i.width=b,i.height=S});for(let i=0;i<t.length;i++)t.forEach(y=>{y.properties.type&&y.properties.type!=se.ColumnChart&&!be.includes(y.properties.type)&&be.push(y.properties.type)});switch(ae){case"2":t.forEach((i,y)=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(T=>$.push(T[0]));break;case se.StackAreaChart:s.forEach(T=>$.push(T[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case se.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"4":t.forEach((i,y)=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(T=>$.push(T[0]));break;case se.StackAreaChart:s.forEach(T=>$.push(T[0]));break}}),t.forEach(i=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case se.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"1":t.forEach(i=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:i.data.forEach(a=>$.push({...a,alias:i.properties?.alias}));break;case se.StackColumnChart:let y=l.findIndex(a=>a.key===i.properties.legend);y!==-1&&l[y].forEach(a=>$.push(a));break;case se.StackAreaChart:let T=s.findIndex(a=>a.key===i.properties.legend);T!==-1&&s[T].forEach(a=>$.push(a));break}});break;case"5":break;case"6":t.forEach((i,y)=>{let T=i.properties.annotation.toString();switch(i.properties.type){case se.ColumnChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)$.push(i.data[N]);break;case"2":break;case"3":$.push(i.data[0]);break;case"4":$.push(i.data[i.data.length-1]);break;case"5":$.push(i.data[0]),$.push(i.data[i.data.length-1]);break}break;case se.AreaChart:case se.LineChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)$.push({dimension:i.data[N].dimension,value:i.data[N].value,legend:i.data[N].legend,labelPosition:i.data[N].labelPosition,labelColor:i.data[N].labelColor,axis:i.data[N].axis,type:i.properties.type,alias:i.properties?.alias});break;case"2":break;case"3":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias});break;case"4":$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break;case"5":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias}),$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break}break;case se.StackColumnChart:const a=l.findIndex(N=>N.key===i.properties.legend);a!==-1&&l[a].forEach((N,re)=>{switch(String(l[a].individualAnnotationVisibility)){case"1":$.push(l[a][re]);break;case"2":break;case"3":let K=l[a][0];$.find(Se=>Se.key==K.key)||$.push(K);break;case"4":let me=l[a][l[0].length-1];$.find(Se=>Se.key==me.key)||$.push(me);break;case"5":let Le=l[a][0],ze=l[a][l[0].length-1];if(!$.find(Se=>Se.key==Le.key||Se.key==ze.key)){$.push(l[a][0]),$.push(l[a][l[0].length-1]);break}}});break;case se.StackAreaChart:const m=s.findIndex(N=>N.key===i.properties.legend);m!=-1&&s[m].forEach((N,re)=>{switch(String(s[m].individualAnnotationVisibility)){case"1":$.push(s[m][re]);break;case"2":break;case"3":let K=s[m][0];$.find(Se=>Se.key==K.key)||$.push(K);break;case"4":let me=s[m][s[0].length-1];$.find(Se=>Se.key==me.key)||$.push(me);break;case"5":let Le=s[m][0],ze=s[m][s[0].length-1];if(!$.find(Se=>Se.key==Le.key||Se.key==ze.key)){$.push(Le),$.push(ze);break}}});break}});break}let k=0;$.forEach((i,y)=>{k<i.value&&(k=i.value)});let o=k*.1;$.forEach((i,y)=>{let T={note:{label:i.value||i.value==0?i.value>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i.value/1e9)+"B":Ze(i.value,u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision):i[1]-i[0]>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i[1]-i[0]/1e9)+"B":Ze(i[1]-i[0],u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision),align:"middle"},data:{x:i.dimension&&i.legend?{dimension:i.dimension,legend:i.legend,type:i.type,axis:i.axis||i.data.axis}:{dimension:i.data.dimension,legend:i.key,type:i.data.type,stacklegend:i.data.legend,axis:i.data.axis},y:i.value||i.value==0?i.value:i.data.type!=se.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0],prevValue:i[0]>=0?i[0]:i[1],position:parseInt(i.labelPosition)?parseInt(i.labelPosition):parseInt(i.data.labelPosition),type:i.type,currentLegend:i.legend?.includes("~$~")?i.legend.split("~$~")[1]:i.key?.includes("~$~")?i.key.split("~$~")[1]:i.legend??i.key,isVisible:!0,hoverId:i?.alias?.replaceAll(" ","-"),legendUniqueId:i.legendUniqueId+"~$~"+(i.dimension??i.data.dimension)+"~$~"+(i.value||i.value==0?i.value:i.data.type!=se.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0])},dx:0,dy:0,connector:{end:pe,curve:ui[u.annotation.connectorCurve],points:Q?_a(0,0):[[0,0],[0,0]]},disable:V,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:xi(n,parseFloat(D)),height:S,width:b};i.legend&&i.dimension?!p.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==Qe.primary?r(i.value)<=R&&r(i.value)>=0:c(i.value)<=R&&c(i.value)>=0)&&M.push(T):!p.includes(i.key)&&(i.data.axis==Qe.primary?r(i[1])<=R&&r(i[1])>=0:c(i[1])<=R&&c(i[1])>=0)&&M.push(T)}),u.annotation.annotationHideZeroValues&&(M=M.filter(i=>i.data.y!==0)),M=Yt(M,u,i=>i.data.y),G.length===0?(G=M,Z=new Map(G.map(i=>[i.data.legendUniqueId,{measure:i.data.y,dimension:i.data.x.dimension,legendUniqueId:i.data.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connector?.points||[],isVisible:i.data.isVisible??!0,width:i.width,height:i.height}]))):Z=new Map(G.map(i=>[i.legendUniqueId,i])),M.forEach(i=>{const y=i.data.legendUniqueId;if(G.length!=0){const T=Z.get(y);T&&(i.dx=T.dx,i.dy=T.dy,i.data.isVisible=T.isVisible??!0,T?.connectorPoints&&T.connectorPoints.length>=(Q?3:2)?i.connector.points=T.connectorPoints:i.connector.points=Q?_a(i.dx,i.dy):[[0,0],[0,0]],u.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&h.push(i)}),ce.editMode(u.annotation.annotationDraggable&&P).accessors({x:function(i){const y=i.x.type||i.type;if(be.includes(y))switch(y){case se.StackColumnChart:return e(i.x.dimension)+W(i.x.stacklegend)-(L-W.bandwidth())/2;case se.StackAreaChart:case se.LineChart:case se.AreaChart:return e(i.x.dimension)}else{if(i.x.legend){const T=i.legendUniqueId.includes("~$~")?i.legendUniqueId.split("~$~")[0]:i.legendUniqueId;return e(i.x.dimension)+W(T)-(L-W.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const y=i.type??i.x.type;return i.x.axis==Qe.primary?ei(i.y,parseFloat(i.position),r,o,i.prevValue,y):ei(i.y,parseFloat(i.position),c,o,i.prevValue,y)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,G.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(T=>T.data.x.dimension==i.data.x.dimension&&T.data.x.legend==i.data.x.legend&&T.data.x.type==i.data.x.type&&T.data.prevValue==i.data.prevValue).attr("display","block"),y.data.isVisible=!0)})),h.forEach(y=>{(y.data?.legendUniqueId==i.data.legendUniqueId||y.legendUniqueId==i.data.legendUniqueId)&&(y.dx=i._dx*b/y.width,y.dy=i._dy*S/y.height,y.connectorPoints=i.connector?.points?.map(T=>[...T])||[])}),U){const y=h.map(T=>({legendUniqueId:T.data?.legendUniqueId||T.legendUniqueId,dx:T.dx,dy:T.dy,connectorPoints:T.connector.points||T.connectorPoints||[],isVisible:(T.data?.isVisible||T.isVisible)??!0,width:T.width,height:T.height}));U(y)}d.selectAll(".connector").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[u.annotation.connectorStyle.toLowerCase()]),d.selectAll(`.connector-${pe}`).attr("fill",u.annotation.connectorColor||"#ccc").style("stroke",u.annotation.connectorColor||"#ccc"),d.selectAll(".note-line").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[u.annotation.connectorStyle.toLowerCase()]).filter(y=>y._dx==0&&y._dy==0).remove(),d.selectAll(".annotation-note-label").filter(y=>y.data&&y.data.isVisible).style("display","block")}).on("noteclick",function(i){u.annotation.annotationDraggable&&P&&(i.data.isVisible=!1,G.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(T=>T.data.x.dimension==i.data.x.dimension&&T.data.x.legend==i.data.x.legend&&T.data.x.type==i.data.x.type&&T.data.prevValue==i.data.prevValue).attr("display","none"),y.data.isVisible=!1)}),d.selectAll(".annotation-note-label").filter(y=>y.data&&!y.data.isVisible).style("display","none"))}).accessorsInverse({x:i=>e.invert(i.x),y:i=>i.x.axis==Qe.primary?r.invert(i.y):c.invert(i.y)}).notePadding(0).annotations(h),u.plotArea.fitChart||B.selectAll(".annotation-group").remove();let d=Ci(B,u,x,ue,ce,pe,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=et[u.animation.animationEffect],T=ce.accessors();d.selectAll(".annotation").attr("transform",function(a){const m=T.x(a.data),N=a.data.type||a.type,K=(a.data?.x?.axis||a.data?.axis)===Qe.primary?r:c;let me;return N===se.StackColumnChart||N===se.StackAreaChart?me=K(a.data.prevValue??0):me=K(0),`translate(${m}, ${me})`}).transition().duration(i).ease(y).attr("transform",function(a){const m=T.x(a.data),N=T.y(a.data);return`translate(${m}, ${N})`})}}}catch(D){throw D}}const vi=(t,e,r)=>{try{let c=[se.PieChart,se.DonutChart].includes(r)?"plotArea":"annotation";return t=e[c].annotationDraggable&&!!1?t??[]:[],t}catch(c){throw c}},xi=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},ei=(t,e,r,c,x,n)=>{try{let l=[se.LineChart,se.StackLineChart,se.StackAreaChart,se.NormalizedStackAreaChart,se.NormalizedStackLineChart,se.StackAreaChart];switch(x||(x=0),e){case 1:let s;switch(n){case se.LineChart:case se.HorizontalBarChart:case se.ColumnChart:case se.AreaChart:case se.StackAreaChart:s=t<0?r(t)+7:r(t)-15;break;case se.StackHorizontalBarChart:case se.NormalizedStackLineChart:case se.StackLineChart:case se.NormalizedStackAreaChart:case se.StackAreaChart:case se.StackColumnChart:s=t<0?r(t)+5:r(t)-15;break;case se.TornadoChart:s=r(t)+r.bandwidth()/2;break;default:s=t<0?r(x)+5:r(t)-15}return s;case 2:return l.includes(n)?r(t):t===0?n==="stack"?"":r(0)-15:r(x+(t-x)/2);case 3:return l.includes(n)?t===-1||t<0?r(t)-10:r(t)+10:n.includes("stack")?t===-1&&x===0?r(0)+10:t===1&&x!==0?r(x)-10:x<0?r(x)+10:x===0&&t<0?r(0)+10:x===0&&t>0?r(0)-10:r(x)-10:t<0?r(0)+10:r(0)-10}}catch(l){throw l}},aa=(t,e,r,c,x,n)=>{try{const l=n?.DataTableData??[];let s=[],p=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){t.dataTableProperties.dataTableAxisLabel?p=ki(x[0],void 0,t):p=0;const f=[...c,...l];t.xAxisLabel.xAxisLabelVisibility=!1;const u=!t.dataTableProperties.disableLegendIcon?35:0;let S=e+r-u;f.forEach((b,_)=>{if(b?.properties?.showInDataTable??!0){let A={data:b.data.filter(R=>x.includes(R.dimension)),properties:{legend:b.properties.alias,color:b.properties.color,markerColor:b.properties.markerColor,markerShape:b.properties.markerShape,lineStyle:b.properties.lineStyle,height:ki(b.properties.alias.includes("~$~")?b.properties.alias.split("~$~")[1]:b.properties.alias,S,t)}};p+=A.properties.height,s.push(A)}})}else p=0,s=[];return s.length==0&&(p=0,s=[],t.dataTableProperties.dataTable=!1),{dataTable:s,dataTableHeight:p}}catch{}},ki=(t,e,r)=>{try{let c=20,x=Nt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily)[0];return c=Nt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily,void 0,x>e&&!r.dataTableProperties.legendsWrapText?e:void 0)[1],c}catch(c){throw c}};function ia(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W,P){try{let D=function(T,a,m,N){a===0&&T.append("foreignObject").attr("x",-W.left).attr("y",ue).attr("class","blankClass").attr("width",W.left).attr("height",y).append("xhtml:div").style("width",W.left).style("height",`${y}px`).style("border-width",Q?`0px 0px ${V.dataTableAxisLabel?M:0}px 0px`:"0px 0px 0px 0px").style("border-style",Q?`solid ${h} ${h} solid`:"solid solid solid solid").style("border-color",Q?`black ${G} ${G} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const K=T.append("foreignObject").attr("x",-W.left).attr("y",ue+pe).attr("width",W.left).attr("height",N).append("xhtml:div").style("display","flex").style("justify-content","center").style("align-items","center").attr("class","parentClass").style("flex-wrap","wrap").style("flex-direction","row").style("pointer-events","auto").style("width",ae).style("height",`${N}px`).style("padding-left",V.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>wa(S,a,void 0,Z,ce,"width")).style("border-style",()=>wa(S,a,void 0,Z,ce,"style")).style("border-color",()=>wa(S,a,void 0,Z,ce,"color"));if(!V.disableLegendIcon)switch(u){case se.ColumnChart:case se.StackColumnChart:case se.NormalizedStackColumnChart:K.append("xhtml:div").style("height","10px").style("width","15px").style("background",m.properties.color).style("border-radius","1px");break;case se.LineChart:case se.StackLineChart:case se.NormalizedStackLineChart:Zi(m,K,S);break;case se.AreaChart:case se.StackAreaChart:case se.NormalizedStackAreaChart:Xi(m,K,S);break}const me=m.properties.legend,Le=S?.legends?.legendColorMode=="1"?m?.properties?.color:S?.legends?.legendSelectedUnicolor,ze=K.append("xhtml:div").style("max-width",ae).attr("class","legendsColumn").style("text-align","left").style("vertical-align","middle").call(d).style("padding-left","5px").style("white-space","normal").style("overflow-wrap","break-word").style("color",Le??"black").style("width",V.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",me).text(me);V.legendsWrapText&&ze.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const V=S.dataTableProperties,$=V.dataTableFontStyle,Z=A.length,ce=c.length,ne=g[0]?g[0]:0,ae=typeof l.step=="function"?l.step():x,ue=P-L,ge=2;let be=20,pe=0;const Q=S.dataTableOuterBorder.borderButtonVisibility,G=S.dataTableOuterBorder.lineColor,M=S.dataTableOuterBorder.lineWidth,h=S.dataTableOuterBorder.lineStyle,k=T=>T===0?ae+ge+ne/2:T===Z-1?ae+ge-ne/2:ae,o=T=>Ze(u.includes("100stack")?T.TooltipMeasure/T.TotalMeasure:T.TooltipMeasure||T.value,V.dataTableDisplayUnits,V.dataTableNumberFormat,V.dataTableDecimalPrecision),d=T=>T.style("font-size",V.dataTableFontSize+"px").style("font-family",V.dataTableFontFamily).style("font-style",$.includes("Italic")?"Italic":"").style("text-decoration",$.includes("Underline")?"Underline":"").style("font-weight",$.includes("Bold")?"Bold":"");v.selectAll("#dataTableG"+U).remove();const i=r.append("g").attr("id","dataTableG"+U);let y=0;V.dataTableAxisLabel&&(y=ki(A[0],void 0,S),be=y),c.forEach((T,a)=>{pe+=!V.dataTableAxisLabel&&a===0?0:be,be=T.properties.height,V.dataTableLegends&&D(i,a,T,be);const m=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+U+" .foreignObject").data(()=>T.data).enter().filter(N=>l(N.dimension)).append("g").attr("fill",Re.transparent).attr("transform",(N,re)=>`translate(${re===0?0:l(N.dimension)-ae/2},0)`);a===0&&V.dataTableAxisLabel&&m.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",ue).attr("id",(N,re)=>re).attr("width",(N,re)=>k(re)).attr("height",`${y}px`).append("xhtml:div").style("width",(N,re)=>k(re)).style("height",`${y}px`).style("border-width",(N,re)=>wa(S,re,void 0,Z,ce,"width","colHeaders")).style("border-style",(N,re)=>wa(S,re,void 0,Z,ce,"style","colHeaders")).style("border-color",(N,re)=>wa(S,re,void 0,Z,ce,"color","colHeaders")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-left","3px").call(d).style("color",S.xAxisLabel.xAxisLabelColor??"black").attr("title",N=>B.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)).text(N=>B.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)),m.append("foreignObject").attr("x",0).attr("y",ue+pe).attr("width",(N,re)=>k(re)).attr("height",be).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(N,re)=>k(re)).style("height",`${be}px`).style("line-height",`${be}px`).style("border-width",(N,re)=>wa(S,a,re,Z,ce,"width")).style("border-style",(N,re)=>wa(S,a,re,Z,ce,"style")).style("border-color",(N,re)=>wa(S,a,re,Z,ce,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(d).style("color",V.dataTableLabelColor).attr("title",N=>o(N)).text(N=>o(N))})}catch(D){throw D}}function wa(t,e,r,c,x,n,l){try{const s=t.dataTableOuterBorder,p=t.dataTableInnerBorder,f=s.borderButtonVisibility,L=p.horizontalBorderLineButton,u=p.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,b={w:s.lineWidth,s:s.lineStyle,c:s.lineColor},_={w:p.horizontalBorderLineWidth,s:p.horizontalBorderLineStyle,c:p.horizontalBorderLineColor},A={w:p.verticalBorderLineWidth,s:p.verticalBorderLineStyle,c:p.verticalBorderLineColor},R={w:"0",s:"solid",c:"black"},g=f?b:R,B=L?_:R,U=u?A:R,W=c-1,P=x-1;let D=R,V=R,$=R,Z=R;switch(l?(D=g,$=B,Z=e===0?g:R,V=e===W?g:U):r===void 0?(Z=g,V=R,D=e===0&&!S?g:R,$=e===P?g:B):(D=e===0&&!S?g:R,$=e===P?g:B,Z=r===0?U:R,V=r===W?g:U),n){case"width":return`${D.w}px ${V.w}px ${$.w}px ${Z.w}px`;case"style":return`${D.s} ${V.s} ${$.s} ${Z.s}`;case"color":return`${D.c} ${V.c} ${$.c} ${Z.c}`}}catch(s){throw s}}function At(t,e,r){let c=[];for(let x=0;x<t.length;x++){const n=t[x];let l={},s=0,p=0,f=0;for(let L=0;L<e.length;L++){let u=e[L].data.find(S=>S.dimension===t[x])?.value||0;l[e[L].properties.legend]=u,s=s+(r?Math.abs(u):u),p+=u>0?u:0,f+=u}l.total=s,l.dimension=n,l.absoluteTotal=p,l.displayTotal=f,c.push(l)}return c}function la(t,e,r,c,x,n,l,s){try{let p=r.seriesLabel.seriesLabelApplySeries,f=r.seriesLabel.seriesLabelPosition,L=[],u=c[0].legend,S=Nt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily);return c.forEach(b=>{let _=!1;if(p=="1"?_=!0:_=b.properties.seriesLabelVisibility,_){let A={},R=f=="Right"?b.data[b.data.length-1]:b.data[0],g=s?R.value>0?R[1]:R[0]:R.value;b.properties.axis==Qe.primary||!x?A.yPosition=e(g):n&&x&&(A.yPosition=x(g)),(A.yPosition<0||A.yPosition>l)&&(_=!1),A.yPosition=A.yPosition-S[1]/2,A.isVisible=_,A.seriesValue=b.properties.alias,A.height=S[1],A.width=S[0];let B=!1;L.length>0&&L.some(U=>{B||(B=Il(U,A))}),_&&!B&&L.push(A)}else return}),u="",L.forEach(b=>{b.seriesValue.length>u.length&&(u=b.seriesValue)}),S=Nt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,L.forEach(b=>{b.height=S[1],b.width=S[0],b.xPosition=f=="Right"?t+(n?10:0)-S[0]:5}),{labelArray:L,heightWidth:S}}catch(p){throw p}}function za(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W){try{let P=p.annotation.annotationType??"1";if(p.annotation.annotationVisibility){let D=[P=="1"?"connector":""],V=[],$=new Map,Z=n.annotation(),ce=p.annotation.connectorType,ne=p.annotation.annotationVisibility,ae=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",ue=p.annotation.annotationFontStyle,ge=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";const be=p.annotation.connectorType?.toLowerCase()==="curve";let pe=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates));pe=vi(pe,p,f);let Q=[],G=[];switch(pe.length!=0&&pe.forEach(o=>{o.dx=o.dx*u/o.width,o.dy=o.dy*L/o.height,o.width=u,o.height=L}),ne){case"2":t.forEach(o=>V.push(o[0]));break;case"3":t.forEach(o=>V.push(o[o.length-1]));break;case"4":t.forEach(o=>V.push(o[0])),t.forEach(o=>V.push(o[o.length-1]));break;case"1":for(let o=0;o<t[0].length;o++)t.forEach(d=>V.push(d[o]));break;case"5":break;case"6":t.forEach(o=>{switch(o[0]?.properties?.annotation?.toString()){case"1":for(let i=0;i<t[0].length;i++)V.push(o[i]);break;case"2":break;case"3":V.push(o[0]);break;case"4":V.push(o[t[0].length-1]);break;case"5":V.push(o[0]),V.push(o[t[0].length-1]);break}});break}let M=0;V.forEach((o,d)=>{M<o.Measure&&(M=o.Measure)});let h=M*.1;p.annotation.annotationHideZeroValues&&(V=V.filter(o=>(o[1]<0&&o[0]<0?o[0]-o[1]:o[1]===0&&o[0]<0?o[1]+o[0]:o[1]-o[0])!==0)),V.forEach((o,d)=>{let i={note:{label:o[1]-o[0]>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(o[1]-o[0]/1e9)+"B":Ze(o[1]<0&&o[0]<0?o[0]-o[1]:o[1]===0&&o[0]<0?o[1]+o[0]:o[1]-o[0],p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:W?o.data.labelPosition==2?"middle":"start":"middle"},data:W?{y:o.data.dimension,x:o[1]>0?o[1]:o[0],prevValue:o[0]>=0?o[0]:o[1],position:p.annotation.annotationPosition=="4"?o.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:o.key.includes("~$~")?o.key.split("~$~")[1]:o.key,isVisible:!0,hoverId:o.properties.alias?Ja(o.properties.alias):Ja(o.key),legendUniqueId:o.properties.legendUniqueId+"~$~"+o.data.dimension+"~$~"+(o.key.includes("~$~")?o.key.split("~$~")[1]:o.key)+"~$~"+(o[1]>0?o[1]:o[0])}:{x:o.data.dimension,y:o[1]>0?o[1]:o[0],prevValue:o[0]>=0?o[0]:o[1],position:p.annotation.annotationPosition=="4"?o.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:o.key.includes("~$~")?o.key.split("~$~")[1]:o.key,isVisible:!0,hoverId:o.properties?.alias?Ja(o.properties.alias):Ja(o.key),legendUniqueId:o.properties.legendUniqueId+"~$~"+o.data.dimension+"~$~"+(o.key.includes("~$~")?o.key.split("~$~")[1]:o.key)+"~$~"+(o[1]>0?o[1]:o[0])},dx:0,dy:0,connector:{end:ge,curve:ui[p.annotation.connectorCurve],points:be?_a(0,0):[[0,0],[0,0]]},disable:D,subject:{height:15,width:15},color:o.properties&&o.properties[ae]?o.properties[ae]:o.data.labelColor,type:xi(n,parseFloat(P)),height:L,width:u};b.includes(o.data.dimension)&&Bl(_,S,W,o,r)&&Q.push(i)}),Q=Yt(Q,p,o=>W?o.data.x-o.data.prevValue:o.data.y-o.data.prevValue),pe.length===0?(pe=Q,$=new Map(pe.map(o=>[o.data.legendUniqueId,{measure:W?o.data.x:o.data.y,dimension:W?o.data.y:o.data.x,legendUniqueId:o.data.legendUniqueId,dx:o.dx,dy:o.dy,connectorPoints:o.connector?.points||[],isVisible:o.data.isVisible??!0,width:o.width,height:o.height}]))):$=new Map(pe.map(o=>[o.legendUniqueId,o])),Q.forEach(o=>{const d=o.data.legendUniqueId;if(pe.length!=0){const i=$.get(d);i&&(o.dx=i.dx,o.dy=i.dy,o.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(be?3:2)?o.connector.points=i.connectorPoints:o.connector.points=be?_a(o.dx,o.dy):[[0,0],[0,0]])}G.push(o)}),Z.editMode(p.annotation.annotationDraggable&&U).accessors({x:function(o){return W?Bi(p,o.x,parseFloat(o.position),r,h,o.prevValue,f):e(o.x)+e.bandwidth()/2},y:function(o){return W?e(o.y)+e.bandwidth()/2:ei(o.y,parseFloat(o.position),r,h,o.prevValue,f)}}).on("dragend",function(o){if(o.data.isVisible||(o.data.isVisible=!0,pe.forEach(d=>{d.data.x==o.data.x&&d.data.y==o.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==o.data.x&&i.data.y==o.data.y).attr("display","block"),d.data.isVisible=!0)})),G.forEach(d=>{(d.data?.legendUniqueId==o.data.legendUniqueId||d.legendUniqueId==o.data.legendUniqueId)&&(d.dx=o._dx*u/d.width,d.dy=o._dy*L/d.height,d.connectorPoints=o.connector?.points?.map(i=>[...i])||[])}),g){const d=G.map(i=>({legendUniqueId:i.data?.legendUniqueId||i.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connectorPoints||[],isVisible:(i.data?.isVisible||i.isVisible)??!0,width:i.width,height:i.height}));g(d)}k.selectAll(".connector").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]),k.selectAll(`.connector-${ge}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]).filter(d=>d._dx==0&&d._dy==0).remove(),k.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block")}).on("noteclick",function(o){p.annotation.annotationDraggable&&U&&(o.data.isVisible=!1,pe.forEach(d=>{d.data.x==o.data.x&&d.data.y==o.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==o.data.x&&i.data.y==o.data.y).attr("display","none"),d.data.isVisible=!1)}),k.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"))}).accessorsInverse({x:o=>e.invert(o.x),y:o=>r.invert(o.y)}).notePadding(0).annotations(G),R.selectAll(".annotation-group").remove();let k=Ci(R,p,x,ue,Z,ge,W);if(p.animation?.animationEnabled){const o=p.animation.animationDuration,d=et[p.animation.animationEffect],i=Z.accessors();if(f===se.StackLineChart||f===se.NormalizedStackLineChart){const T=e.range?e.range():[0,1],a=Math.min(T[0],T[1]),m=Math.max(T[0],T[1])-a,N=(re,K=100)=>{for(let me=0;me<=K;me++){const Le=me/K;if((d??v.easeLinear)(Le)>=re)return Le}return 1};k.selectAll(".annotation").attr("opacity",0).each(function(re){const K=i.x(re.data)??a,me=m>0?Math.max(0,Math.min(1,(K-a)/m)):0,Le=N(me)*o;v.select(this).transition().delay(Le).duration(0).attr("opacity",1)})}else k.selectAll(".annotation").attr("transform",function(T){if(W){const a=r?r(0):0,m=i.y(T.data);return`translate(${a}, ${m})`}else{const a=i.x(T.data),m=r?r(0):0;return`translate(${a}, ${m})`}}).transition().duration(o).ease(d).attr("transform",function(T){const a=i.x(T.data),m=i.y(T.data);return`translate(${a}, ${m})`})}}}catch(P){throw P}}function Bl(t,e,r,c,x){const n=x(c[1]>0?c[1]:c[0]);return r?n>=0&&n<=e:n<=t&&n>=0}const Ci=(t,e,r,c,x,n,l)=>{t.selectAll(".annotation-group").remove();let s=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.annotation.annotationColor).style("font-family",e.annotation.annotationFontFamily).style("font-size",e.annotation.annotationFontSize).style("font-style",c.includes("Italic")?"Italic":"").style("text-decoration",c.includes("Underline")?"Underline":"").style("font-weight",c.includes("Bold")?"Bold":"").call(x);return s.selectAll("rect").style("visibility","hidden"),s.selectAll(".annotation-subject").remove(),s.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.annotation.connectorStyle.toLowerCase()]).style("visibility",p=>(l?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(`.connector-${n}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",p=>(l?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.annotation.connectorStyle.toLowerCase()]).filter(p=>p._dx==0&&p._dy==0).remove(),s.selectAll(".connector-end").filter(p=>p.connector.end=="dot"&&p._dx==0&&p._dy==0).remove(),s.selectAll(".annotation-note-label").filter(p=>p.data&&!p.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&s.selectAll(".annotation-note-content").attr("transform",function(){const f=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(f)return`translate(${l?0:parseFloat(f[1])}, 0)`}),s.selectAll("text").style("text-anchor",p=>l&&p.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==Re.white?e.annotation.annotationColor:"none"),s.selectAll("tspan").attr("hoverId",p=>p.data.hoverId?p.data.hoverId:p.data.currentLegend.replaceAll(" ","-")).style("visibility",p=>parseFloat(p.data.y)==0&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s},ra=(t,e,r,c,x,n)=>{try{let l=t.yAxisLabel.yAxisLabelFontStyle,s="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${c})`).attr("height",r+10).attr("width",x).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==Re.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const p=e.append("g").call(n).attr("transform",`translate(0,${c})`);p.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),p.selectAll("text").style("text-anchor",s=="rotate(0)"?"middle":"end").attr("dx",s=="rotate(0)"?".2em":"-.1em").attr("dy",s=="rotate(0)"?"1em":".15em").attr("transform",s).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==Re.white?t.yAxisLabel.yAxisLabelColor:"none").style("font-size",t.yAxisLabel.yAxisLabelFontSize).style("font-family",t.yAxisLabel.yAxisLabelFontFamily).style("font-style",t.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",t.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),p.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.yAxisLabel.yAxisColor).attr("stroke-width",t.yAxisLabel.yAxisWidth?t.yAxisLabel.yAxisWidth:t.plotArea.plotAreaBorderThickness)}catch(l){throw l}};function Wl(t,e,r,c,x,n,l,s){return t?`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
25
- translate(${-(c(x*.01)+n)} ,${-s/2})`:`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
26
- translate(${r.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-n},${-s/2}`:-l/2+" ,2"})`}const na=(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R)=>{try{const g=L===se.TornadoChart;let B=t.xAxisLabel.xAxisLabelFontStyle,U=parseInt(t.xAxisLabel.xAxisPosition),W=bt(f,c),P=u?ft(t.xAxisLabel.xAxisNumberFormat,W.map(pe=>pe)).map(pe=>pe):W;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let D;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?D=t.xAxisLabel.maxXAxisLabelWidth:D=r;let V=A.step();const $=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,Z=Math.floor(V/$),ce=t.xAxisLabel.xAxisLabelRotation==0;let ne=e.append("rect").attr("id","yAxisRect").attr("transform",L===se.TornadoChart?`translate(${-D-1},0)`:`translate(${U===0?-D-5:U===1?x:s(0)+(-D-5)},0)`).attr("height",c).attr("width",L===se.TornadoChart?D:D+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==Re.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const ae=e.append("g").attr("id","yAxisG").attr("transform",g?`translate(${s(0)},0)`:`translate(${U===0?0:U===1?x:s(0)},0)`).call(n);let be=ae.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",D).attr("height",V+"px").attr("transform",Wl(g,U,t,s,p,D,r,V)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",ce?"center":"start").style("align-items",ce?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("text-align",t.xAxisLabel.xAxisLabelRotation==0?"center":"start").style("user-select","none").style("margin",0);if((t.xAxisLabel.labelTextWrap&&!t.xAxisLabel.multiLineLabelWrap||!t.xAxisLabel.labelTextWrap)&&be.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap&&be.style("-webkit-line-clamp",Z.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),be.style("padding",0).style("font-family",t.xAxisLabel.xAxisLabelFontFamily).style("font-style",t.xAxisLabel.xAxisLabelFontStyle).style("color",t.xAxisLabel.xAxisLabelColor).style("font-size",t.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",B.includes("Italic")?"Italic":"").style("text-decoration",B.includes("Underline")?"Underline":"").style("font-weight",B.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(pe,Q)=>P[Q]).html((pe,Q)=>P[Q]),L===se.TornadoChart){if(l){const pe=e.append("g").attr("transform",`translate(${s(0)},0)`).call(l);pe.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),pe.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),pe.selectAll("text").style("visibility","hidden")}ae.selectAll("text").style("visibility","hidden")}else ae.selectAll("text").style("visibility","hidden");ae.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),ae.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(g){throw g}},Bi=(t,e,r,c,x,n,l,s,p)=>{try{n=n??0;const f=Ze(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,l===se.TornadoChart),L=String(f).length,u=c(e),S=c(n),b=c(0),_=l??"",A=_.includes("stack"),R=_==="100%stackBar";switch(r){case 1:return R?e<0&&e!==-1?u-20:e===-1||e>0&&e!==1?u+10:u-10:e<0||s&&p==="positive"?u-L*5:u+5;case 2:return e===0?A?"":b+15:c(n+(e-n)/2);case 3:return A?n<0?S-L*5:n===0&&e<0?b-L*5:n===0&&e>0?b+10:S+10:e<0?b-L*5:b+10;default:return u}}catch(f){throw f}},pi=(t,e,r,c,x)=>{try{let n=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-r})`).attr("height",r).attr("width",x).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Re.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const l=e.append("g").call(c).attr("transform","translate(0,0)");l.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),l.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==Re.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",n.includes("Italic")?"Italic":"").style("text-decoration",n.includes("Underline")?"Underline":"").style("font-weight",n.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),l.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(n){throw n}},Mi=(t,e)=>e*(1+t),Wi=(t,e)=>e/(1+t);function Hl(t,e,r){const c=t>0?t:0,x=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,n=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,l=Array.isArray(r?.dimensionList)?r.dimensionList.length:0;let s=0,p=0,f=!1;if(l>0&&c>0){const L=c/l,u=Wi(n,L);if(u>=x||e.plotArea.fitChart)p=u,s=l,f=!1;else{const S=Mi(n,x),b=Math.floor(c/S);b<=1?(s=1,p=Wi(n,c),f=l>1):(s=b,p=x,f=s<l)}}else s=0,p=0,f=!1;return{visibleBars:s,columnWidth:p,scrollbarVisible:f}}const ja=(t,e,r)=>Math.max(e,Math.min(r,t)),Gt=(t,e,r,c,x,n,l,s,p,f,L,u,S=!1)=>{const b=(_,A,R,g,B)=>{try{if(B&&(_=f+_),!p||!Array.isArray(p.dimensionList)||!Array.isArray(t))return;_=_==null?0:Number(_),A=A==null?0:Number(A),R=R==null?0:Number(R),f=ja(Math.round(_),0,Math.max(0,A)),s=typeof s=="number"?s:0;const U=f,W=U+s;let P=p.dimensionList.slice(U,W),D=JSON.parse(JSON.stringify(t||[]));D.forEach((ue,ge)=>{const be=Array.isArray(ue?.data)?ue.data:[];D[ge].data=be.filter(pe=>P.includes(pe?.dimension))});const V=x?.left??0,$=x?.top??0,Z=Number(n)||0,ce=Number(innerHeight)||0,ne=Number(R)||0,ae=A===0?1:A;if(S){const ue=$+(ce-ne)*(A===0?0:f)/ae;g&&typeof g.attr=="function"&&g.attr("y",ue)}else{const ue=V+(Z-ne)*(A===0?0:f)/ae;g&&typeof g.attr=="function"&&g.attr("x",ue)}u(P,D,s)}catch(U){typeof Ae=="function"&&Ae("ColumnChart","updateFromScrollPosition",U)}};if(l){const _=e-x.top-x.bottom,A=Math.max(0,t[0].data.length-s),R=e-8;c.append("rect").attr("id","scrollbarTrack").attr("x",S?r-8:x.left).attr("y",S?x.top:R).attr("width",S?8:n).attr("height",S?_:8).attr("fill","#ccc");const g=(S?_:n)*s/p.dimensionList.length,B=c.append("rect").attr("x",S?r-8:x.left).attr("y",S?x.top:R).attr("width",S?8:g).attr("height",S?g:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");B.call(v.drag().on("drag",U=>{if(S){const P=(ja(U.y,x.top,x.top+_-g)-x.top)/(_-g)*(A||1);b(P,A,g,B,!1),B.attr("y",x.top+(_-g)*(A===0?0:f)/(A===0?1:A))}else{const P=(ja(U.x,x.left,x.left+n-g)-x.left)/(n-g)*(A||1);b(P,A,g,B,!1),B.attr("x",x.left+(n-g)*(A===0?0:f)/(A===0?1:A))}})),c.on("wheel",U=>{U.preventDefault();const P=(S?U.deltaY:U.deltaX)>0?1:-1;if(b(P,A,g,B,!0),S){const D=x.top+(_-g)*(A===0?0:f)/(A===0?1:A);B.attr("y",D)}else{const D=x.left+(n-g)*(A===0?0:f)/(A===0?1:A);B.attr("x",D)}})}else c.on("wheel",null);b(0,0,0,null,!0)};function ti(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_){try{if(l.total.totalVisibility){const A=l.annotation.annotationVisibility!="5"?10:0;let R=l.total.annotationType??"1",g=[R=="1"?"connector":""],B=x.annotation(),U=l.total.connectorType,W=l.total.totalFontStyle,P=l.total.connectorType?l.total.connectorType.toLowerCase():"None";n=[];let D=[],V=Array.from(t,([Z,ce])=>({Dimension:Z,Measure:ce}));l.total.totalHideZeroValues&&(V=V.filter(Z=>Z.Measure!==0)),V.forEach((Z,ce)=>{let ne={note:{label:Z.Measure>=1e9&&l.total.totalNumberFormat===".2s"?Math.round(Z.Measure/1e9)+"B":Ze(Z.Measure,l.total.totalDisplayUnits||l.plotArea.plotAreaDisplayUnits,l.total.totalNumberFormat,l.total.totalDecimalPrecision)},data:{y:Z.Measure,x:Z.Dimension},dx:0,dy:0,connector:{end:P,curve:ui[l.total.connectorCurve]},disable:g,subject:{height:15,width:15},color:l.total.totalColor,type:xi(x,parseFloat(R)),height:p,width:f};D.push(ne)}),B.editMode(l.total.annotationDraggable&&u).accessors({x:function(Z){if(!S)return e(Z.x);if(Z.y>=0){const ne=_?.get(Z.x)??Z.y;return r(ne)+25}const ce=b?.get(Z.x)??Z.y;return r(ce)-25},y:function(Z){if(S){const ne=parseFloat(l.total.totalFontSize)||12;return l.annotation.annotationVisibility!=="5"?e(Z.x)-ne-4:e(Z.x)-ne/2}if(Z.y>=0){const ne=_?.get(Z.x)??Z.y;return r(ne)-A-15}const ce=b?.get(Z.x)??Z.y;return r(ce)+A+5}}).on("dragend",function(Z){$.selectAll(".connector").style("stroke",l.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[l.total.connectorStyle.toLowerCase()]),$.selectAll(`.connector-${P}`).attr("fill",l.total.connectorColor||"#ccc").style("stroke",l.total.connectorColor||"#ccc"),$.selectAll(".note-line").attr("hoverId",ce=>ce.data.currentLegend).style("stroke",l.total.connectorColor||"#ccc").attr("stroke-dasharray",$t[l.total.connectorStyle.toLowerCase()]).filter(ce=>ce._dx==0&&ce._dy==0).remove()}).accessorsInverse({x:Z=>e.invert(Z.x),y:Z=>r.invert(Z.y)}).notePadding(0).annotations(D);let $=Gl(L,l,c,W,B,P);l.animation?.animationEnabled&&$.selectAll(".annotation").each(function(Z){const ce=v.select(this),ae=ce.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!ae)return;const ue=parseFloat(ae[1]),ge=parseFloat(ae[2]);if(S){const be=r(0);ce.attr("transform",`translate(${be},${ge})`).transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`translate(${ue},${ge})`)}else{const be=r(0);ce.attr("transform",`translate(${ue},${be})`).transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`translate(${ue},${ge})`)}})}}catch(A){throw A}}const Gl=(t,e,r,c,x,n)=>{t.selectAll(".total-annotation-group").remove();let l=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.total.totalColor).style("font-family",e.total.totalFontFamily).style("font-size",e.total.totalFontSize).style("font-style",c.includes("Italic")?"Italic":"").style("text-decoration",c.includes("Underline")?"Underline":"").style("font-weight",c.includes("Bold")?"Bold":"").call(x);return l.selectAll("rect").style("visibility","hidden"),l.selectAll(".annotation-subject").remove(),l.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.total.connectorStyle.toLowerCase()]),l.selectAll(`.connector-${n}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),l.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.total.connectorStyle.toLowerCase()]).filter(s=>s._dx==0&&s._dy==0).remove(),l.selectAll(".connector-end").filter(s=>s.connector.end=="dot"&&s._dx==0&&s._dy==0).remove(),e.total.annotationType=="1"&&l.selectAll(".annotation-note-content").attr("transform",function(){const p=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(p)return`translate(${parseFloat(p[1])}, 0)`}),l.selectAll("text").append("text").style("fill",e.total.totalColor!==Re.white?e.total.totalColor:"none"),l};function ai(t,e,r){e.clear(),r&&r.length>0&&r.forEach(c=>{e.set(c,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(c=>{c.data.forEach((x,n)=>{if(e.has(x.dimension)){let l=e.get(x.dimension)||0;l+=x.value||0,e.set(x.dimension,l)}})})}function sa(t,e,r,c=!1){const x=c&&t.xAxisLabel.xAxisPosition=="1"?-1:1,n=r>0?r:0,l=parseFloat(t.plotArea.ticksHeight)||100,s=(e-n)*l/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-s*x:0}function Rt(t,e,r=0){const c=parseFloat(t.plotArea.ticksWidth)||100,x=(e-r)*c/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-x:0}const Hi={color:"defaultColor",name:"",type:"Line",axis:Qe.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:tt,labelColor:Re.black,hideZeroValues:!1,markerShape:"Circle",lineStyle:"Solid",annotationPosition:1,markerColor:"defaultColor",areaBorderColor:"defaultColor",lineWidth:1.5,markerSize:1,opacity:.5,annotation:1,disableAnnotation:!0,disableAnnotationPosition:!0,connector:1,disableConnector:!0,measureUniqueId:"measureUniId",legendUniqueId:"uniqueLegendId",disableMarkerShape:!0,disableMarkerSize:!0,disableMarkerColor:!0,disableLineWidth:!0,disableLineStyle:!0,borderStyle:"Solid",borderWidth:2,borderRadius:0,borderColor:"black",labelFontSize:11,labelFontStyle:[],labelFont:tt,labelFontColor:"black",valueFontSize:11,valueFontStyle:[],valueFont:tt,valueFontColor:"black",backgroundColor:Re.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:Re.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var lt=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(lt||{});const _l="11px",jl="1.6";function Tt(t,e,r){return(c,x)=>{!t.current||!e.current||e.current(r(c,x))}}function gt(t,e,r){return t?.(e,r)??void 0}const ut="CommonFunctions.ts";se.ColumnChart,se.StackColumnChart,se.NormalizedStackColumnChart,se.LineChart,se.StackLineChart,se.NormalizedStackLineChart,se.AreaChart,se.StackAreaChart,se.NormalizedStackAreaChart,se.PieChart,se.PieofPie,se.DonutChart,se.PyramidChart,se.OrganizationChart,se.VennChart,se.ProgressChart,se.Maps,se.WordCloud,se.SankeyChart,se.Speedometer,se.RadialBarChart;function Pt(t,e,r,c,x,n,l,s,p,f,L,u,S,b){try{let _=l.legends.legendPosition,A=l.legends.legendAlignmentTopBottom,R=l.legends.legendAlignment;if(l.legends.legendVisibility)switch(_){case je.none:break;case je.right:let g=l.plotArea.fitChart?t-c-10:t-c-20;ua(e,s,x-(n+15),c+5,n+5,g,_,R,u,l,p,!1,b);break;case je.top:ua(e,s,7,c,x-10,30,_,A,u,l,p,!1,b);break;case je.left:let B=l.plotArea.fitChart?t-c-10:t-c-20;const U=f?f+L.bottom:0;ua(e,s,7,c+5,n+5,B-U,_,R,u,l,p,!1,b);break;case je.bottom:ua(e,s,7,t-35,x-10,30,_,A,u,l,p,!1,b);break}}catch(_){Ae(ut,"drawLegends",_)}}function Jl(t,e){try{let r=0,c=t[0];return t.forEach(x=>{if(x!==void 0){let n=x.includes("~$~")?x.split("~$~")[1]:x.includes("-")?x.slice(x.indexOf("-")+1):x,l=n.length;r<l&&(r=l,c=n)}}),Nt(c,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(r){Ae(ut,"calculateMaxLegendWidth",r)}}function Da(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A=!1){try{const R=(P,D)=>A?[D,P]:[P,D];let g=s.plotArea.hideZeroValues;s.plotArea.plotAreaHideLineAndMarkers===void 0&&(s.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(P=>P.data.forEach(D=>{D.markerShape=[se.CombinationLine,se.CombinationArea].includes(r)&&!s.plotArea.plotAreaHideLineAndMarkers?"None":P.properties.markerShape?P.properties.markerShape:"Circle",D.currentMeasure=P.properties.currentMeasure,D.markerColor=P.properties.markerColor?P.properties.markerColor:"Blue",D.alias=P.properties.alias,D.markerSize=P.properties.markerShape!="None"&&P.properties.markerSize&&P.properties.markerShape!="None"?r==="Area"?s.plotArea.plotAreaHideLineAndMarkers?P.properties.markerSize:0:P.properties.markerSize:0}));let B=t.selectAll(".lineGroup").data(e,P=>P.legend);B.enter().append("g").attr("class","parentGroup").attr("hoverId",P=>(P.properties.alias||P.properties.name||"Legend").replace(/\s+/g,"-")).merge(B).each(function(P){let V=v.select(this).selectAll("path").data(P.data);const Z=V.enter().append("path").attr("fill",ce=>ce.markerColor).merge(V).attr("d",ce=>v.symbol().type(Gi(ce.markerShape)).size(ce.markerSize*50)()).attr("visibility",ce=>{const ne=!c(ce.dimension)&&c(ce.dimension)!==0,ae=s.marker.markerVisibility?Zl(e,ce,r,g,n,u,S)?It.hidden:[se.NormalizedStackLineChart,se.CombinationLine,se.CombinationArea].includes(r)||[se.StackAreaChart,se.AreaChart,se.CombinationStackArea].includes(r)?s.plotArea.plotAreaHideLineAndMarkers?It.visible:It.hidden:It.visible:[se.CombinationLine,se.CombinationArea].includes(r)||["Area"].includes(r)&&s.plotArea.plotAreaHideLineAndMarkers?It.visible:It.hidden;return ne?It.hidden:ae}).attr("transform",ce=>{let ne=ce.axis==Qe.primary?x:n;const ae=c(ce.dimension),ue=[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ce[1]>0?ne(ce[1]):ne(ce[0]):ne(ce.value),[ge,be]=R(ae,ue);return`translate(${ge},${be})`}).on("mousemove",function(ce,ne){const ae=ne,ue=ne,ge=v.select(this.parentNode),be=Array.isArray(ae.dimension)?ae.dimension[0]:ae.dimension,pe=String(p.formattedDimensionListMap.get(be)??""),Q=_?.(String(be??""),{...ne,formattedDimensionValue:pe})??void 0;yt([{key:s.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(s.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():s.xAxisTitle.xAxisTitleText,value:p.formattedDimensionListMap.get(Array.isArray(ae.dimension)?ae.dimension[0]:ae.dimension)},{key:s.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(s.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ne.properties?.currentMeasure?ne.properties.currentMeasure:s.yAxisTitle.yAxisTitleText||ae.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(r)?ae[1]-ae[0]:ae.value,s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ue.alias.includes("~$~")?ue.alias.split("~$~")[1]:ue.alias}],s,ce,ne,Q),ge.selectAll(".hoverHighlight").remove();const G=c(ae.dimension),M=()=>{const o=ae.axis===Qe.primary?x:n;return[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ae[1]>0?o(ae[1]):o(ae[0]):o(ae.value)},[h,k]=R(G,M());ge.insert("circle",":first-child").attr("class","hoverHighlight").attr("cx",h).attr("cy",k).attr("fill",ue.markerColor).attr("opacity",.5).attr("r",ue.markerSize*10),v.select(this).transition().duration(100).attr("transform",()=>{const o=ae.axis===Qe.primary?x:n,d=c(ae.dimension),i=[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ae[1]>0?o(ae[1]):o(ae[0]):o(ae.value),[y,T]=R(d,i);return`translate(${y},${T}) scale(1.3)`})}).on("mouseout",function(ce,ne){const ae=ne,ue=v.select(this.parentNode);ot(),ue.selectAll(".hoverHighlight").remove(),v.select(this).transition().duration(100).attr("transform",()=>{const ge=ae.axis===Qe.primary?x:n,be=c(ae.dimension),pe=[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ae[1]>0?ge(ae[1]):ge(ae[0]):ge(ae.value),[Q,G]=R(be,pe);return`translate(${Q},${G}) scale(1)`})});if(s.animation.animationEnabled){const ce=s.animation.animationDuration,ne=et[s.animation.animationEffect]??v.easeLinear;if([se.AreaChart,se.StackAreaChart,se.NormalizedStackAreaChart,se.CombinationArea,se.CombinationStackArea].includes(r)){const ue=[se.StackAreaChart,se.NormalizedStackAreaChart,se.CombinationStackArea];Z.each(function(ge){const be=ge.axis===Qe.primary?x:n,pe=c(ge.dimension),Q=ue.includes(r)?ge[1]>0?be(ge[1]):be(ge[0]):be(ge.value),G=x(0),[M,h]=R(pe,G),[k,o]=R(pe,Q);v.select(this).attr("transform",`translate(${M},${h})`).transition().duration(ce).ease(ne).attr("transform",`translate(${k},${o})`)})}else{const ue=c.range(),ge=Math.min(ue[0],ue[1]),be=Math.max(ue[0],ue[1])-ge,pe=(Q,G=100)=>{for(let M=0;M<=G;M++){const h=M/G;if(ne(h)>=Q)return h}return 1};Z.attr("opacity",0).each(function(Q){const G=c(Q.dimension)??ge,M=be>0?Math.max(0,Math.min(1,(G-ge)/be)):0,h=pe(M)*ce;v.select(this).transition().delay(h).duration(0).attr("opacity",1)})}}})}catch(R){Ae(ut,"lineMarkers",R)}}function Gi(t){return t=="Square"?v.symbolSquare:t=="Circle"?v.symbolCircle:t=="Cross"?v.symbolCross:t=="Triangle"?v.symbolTriangle:t=="Star"?v.symbolStar:t=="Diamond"?v.symbolDiamond:t=="Wye"?v.symbolWye:v.symbolCircle}const Zl=(t,e,r,c,x,n,l)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?c&&e.value==0||e.value>x.domain()[1]||e.value<x.domain()[0]:r.includes("Stack")?e.value>0?c&&e[1]==0||e[1]<n||e[1]>l:c&&e[0]==0||e[0]<n||e[0]>l:c&&e.value==0||e.value<n||e.value>l}catch(s){Ae(ut,"checkVisibleConditions",s)}};function bi(t,e,r,c,x,n,l,s,p,f=!1){try{let L=function(S){try{let b=v.pointer(S),_=1e99,A,R=null;const g=f?b[1]:b[0],B=f?b[0]:b[1];for(let W=0;W<u.length;W++){let P=Math.abs(g-n(u[W]));P<_&&(_=P,R=W)}let U=1e99;for(let W=0;W<x.length;W++){const P=p?x[W].data[R].value>0?x[W].data[R][1]:x[W].data[R][0]:x[W].data[R].value;let D=Math.abs(B-l(P));D<U&&(U=D,A=W)}r.attr("transform",Xl(x[A],R,n,l,p,f)).append("circle").attr("r",x[A].properties.markerSize*2.5).attr("id","tooltip").attr("fill",x[A].properties.markerColor).text(yt([{key:t.xAxisTitle.xAxisTitleText,value:x[A].data[R].dimension},{key:x[A].properties.currentMeasure?x[A].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:Ze(s===se.NormalizedStackAreaChart?A===0?x[A].data[R].value:x[A].data[R].value-x[A-1].data[R].value:x[A].data[R].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:x[A].data[R].legend.includes("~$~")?x[A].data[R].legend.split("~$~")[1]:x[A].data[R].legend}],t,void 0,x[A].properties))}catch(b){Ae(ut,"onHoverMarkerForAreaChartFamily.mousemove",b)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){r.style("display",null)}).on("mousemove",L).on("mouseout",function(){r.style("display","none"),ot()});let u=c}catch(L){Ae(ut,"onHoverMarkerForAreaChartFamily",L)}}const Xl=(t,e,r,c,x,n=!1)=>{try{const l=x?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value,s=r(t.data[e].dimension),p=c(l);return n?`translate(${p},${s})`:`translate(${s},${p})`}catch(l){Ae(ut,"getCoordinates",l)}};function zt(t,e,r,c,x){try{const n=document.createElement("div");Object.assign(n.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(n),n.style.transform="",n.style.width="",n.style.whiteSpace="nowrap",n.style.overflowWrap="",e!=null&&(n.style.fontSize=`${e}px`),r!=null&&(n.style.fontFamily=r),x!=null,n.textContent=t;const l=n.getBoundingClientRect(),s=l.width,p=l.height;if(c&&c!==0){n.style.transform=`rotate(${c}deg)`;const f=n.getBoundingClientRect();return n.remove(),{width:s,height:p,rotatedWidth:f.width,rotatedHeight:f.height}}return n.remove(),{width:s,height:p,rotatedWidth:0,rotatedHeight:0}}catch(n){Ae(ut,"preCalculateTextDimensions",n)}}function _i(t,e){try{if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const c=t[r],x=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!x||n===void 0){e[r]=Array.isArray(c)?[...c]:typeof c=="object"&&c!==null?{...c}:c;return}const l=ji(c),s=ji(n);l&&s&&_i(c,n)}),e}catch(r){Ae(ut,"addUndefinedDefaults",r)}}function ji(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){Ae(ut,"isPlainObject",e)}}function qe(t,e,r){try{let c=1,x="",n=r,l;return function(s){try{let p=s??0;if(t==="Auto")return ql(p);switch(t&&t!=="None"&&(t==="Thousands"&&(c=1e3,x="K"),t==="Millions"&&(c=1e6,x="M"),t==="Billions"&&(c=1e9,x="B"),p=p/c),e){case",.0%":return l=`.${n}%`,v.format(l)(p);case"":return l=`.${n}f`,v.format(l)(p)+x;case".2n":return l=`.${n==0?1:parseFloat(n)+1}n`,v.format(l)(p)+x;case".2$":return l=`,.${n}f`,"$"+v.format(l)(p)+x;case".2c":return l=`,.${n}f`,"C$"+v.format(l)(p)+x;case".2ē":return l=`,.${n}f`,"€"+v.format(l)(p)+x;case".2ch":return l=`,.${n}f`,"CHF"+v.format(l)(p)+x;case".2£":return l=`,.${n}f`,"£"+v.format(l)(p)+x;case".2₹":return l=`,.${n}f`,"₹"+v.format(l)(p)+x;case",":return l=`,.${n}f`,v.format(l)(p)+x;default:return l=".2f",v.format(l)(p)+x}}catch(p){Ae(ut,"getNumberWithFormatFunction.inner",p)}}}catch(c){Ae(ut,"getNumberWithFormatFunction",c)}}function ql(t){if(t==null)return"0";let e=Math.abs(t);return e>=1e9?(t/1e9).toFixed(2)+"B":e>=1e6?(t/1e6).toFixed(2)+"M":e>=1e3?(t/1e3).toFixed(2)+"K":t.toFixed(2)}function yt(t,e,r,c,x){try{const n=c?.color??c?.markerColor??"blue",l=c?.markerShape?.toLowerCase()??"circle",s=e.toolTip.toolTipTheme==="Light",p=s?"rgba(255, 255, 255)":"#272729ff",f=s?"black":Re.white,L=s?"gray":"#d1d5db",u=(V,$=6)=>{if(!V)return"";const Z=V.split(" ");let ce="";for(let ne=0;ne<Z.length;ne+=$)ce+=Z.slice(ne,ne+$).join(" ")+"<br/>";return ce};v.selectAll(".chartTooltip").style("visibility",It.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),b=v.select("#chartTooltipDiv").html("").append("div").attr("class",s?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",f).style("background",p).style("border",S==="1"?"1px solid #d0d0d0":"1px solid #d4d4d4").style("border-radius",S==="1"?"0":"4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",S==="1"?"none":s?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),_=r||window.event,A=_.pageX,R=_.pageY,g=t.reduce((V,$)=>{const Z=(()=>{switch(l){case"circle":return"border-radius: 50%;";case"square":return"";case"triangle":return"clip-path: polygon(50% 0%, 0% 100%, 100% 100%);";case"cross":return"clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);";case"star":return"clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);";case"diamond":return"clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);";case"wye":return"clip-path: polygon(50% 0%, 60% 40%, 100% 40%, 65% 60%, 75% 100%, 50% 75%, 25% 100%, 35% 60%, 0 40%, 40% 40%);";default:return"border-radius: 50%;"}})();return V+=`
23
+ <%s key={someKey} {...props} />`,d,f,N,f),M[f+d]=!0)}if(f=null,s!==void 0&&(n(s),f=""+s),r(k)&&(n(k.key),f=""+k.key),"key"in k){s={};for(var ne in k)ne!=="key"&&(s[ne]=k[ne])}else s=k;return f&&c(s,typeof h=="function"?h.displayName||h.name||"Unknown":h),m(h,f,y,i,x(),s,T,a)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===g&&h._store&&(h._store.validated=1)}var S=Ce,g=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),ye=Symbol.for("react.client.reference"),se=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,xe=Array.isArray,ge=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(h){return h()}};var pe,he={},O=S["react-stack-bottom-frame"].bind(S,l)(),X=ge(o(l)),M={};Oa.Fragment=A,Oa.jsx=function(h,k,s,d,i){var y=1e4>se.recentlyCreatedOwnerStacks++;return L(h,k,s,!1,d,i,y?Error("react-stack-top-frame"):O,y?ge(o(h)):X)},Oa.jsxs=function(h,k,s,d,i){var y=1e4>se.recentlyCreatedOwnerStacks++;return L(h,k,s,!0,d,i,y?Error("react-stack-top-frame"):O,y?ge(o(h)):X)}})()),Oa}var Ei;function Fl(){return Ei||(Ei=1,process.env.NODE_ENV==="production"?xi.exports=Ml():xi.exports=Sl()),xi.exports}var Ge=Fl();function me(t,e,n){console.error(t,e,n)}var ct=(t=>(t.rectangle="rectangle",t.circle="circle",t.hollowCircle="hollowCircle",t.areaWithLine="areaWithLine",t.line="line",t.custom="custom",t.none="none",t))(ct||{}),Yt=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))(Yt||{}),bt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(bt||{}),ya=(t=>(t.butt="butt",t.round="round",t.square="square",t))(ya||{}),Qe=(t=>(t.primary="Primary",t.secondary="Secondary",t))(Qe||{}),Et=(t=>(t.visible="visible",t.hidden="hidden",t))(Et||{});const fa="20,10,5,5,5,10",wl={1:"",2:v.curveLinear,3:v.curveStep},Dl={1:pt.annotationLabel,2:pt.annotationLabel,3:pt.annotationCallout,4:pt.annotationCalloutElbow,5:pt.annotationCalloutCurve};var Je=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(Je||{}),ei=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(ei||{}),Aa=(t=>(t.percentage=",.0%",t.general="",t.scientific=".2n",t.currency_USD=".2$",t.currency_CAD=".2c",t.currency_EUR=".2ē",t.currency_CHF=".2ch",t.currency_UK=".2£",t.currency_INR=".2₹",t.commaSeparated=",",t))(Aa||{}),hi=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(hi||{}),Wt=(t=>(t.start="1",t.middle="2",t.end="3",t))(Wt||{}),Fa=(t=>(t.top="1",t.bottom="2",t))(Fa||{});const Ta={none:"1",discrete:"2",colorTheme:"3"},jt={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var ti=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(ti||{});const Vl={singleColor:"2",multiColor:"1"},ce={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Ea=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Ea||{}),Ra=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(Ra||{});const Ht={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var Ie=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(Ie||{});const tt="Calibri";var Ci=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(Ci||{}),va=(t=>(t.total="Total",t.base="base",t.dimensionTotal="dimensionTotal",t.up="up",t.down="down",t))(va||{});const et={easeLinear:v.easeLinear,easeCubicIn:v.easeCubicIn,easeCubicOut:v.easeCubicOut,easeCubicInOut:v.easeCubicInOut,easeBounceOut:v.easeBounceOut,easeElasticOut:v.easeElasticOut,easeBackOut:v.easeBackOut},Ri={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:Ie.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:Ie.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:tt,chartTitleFontStyle:[],chartTitleColor:Ie.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:Ie.black,xAxisColorInverted:Ie.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:tt,xAxisLabelFontStyle:[],xAxisLabelColor:Ie.black,xAxisNumberFormat:"MMM-YY",xAxisQuarterFormat:"Long",xAxisDisplayUnits:"None",xAxisDisplayUnitsLabel:!1,xAxisLabelRotation:90,xAxisDateFormat:"DD-MM-YYYY",xAxisLabelDecimalPrecision:"2",xAxisLabelText:"",xAxisLabelDynamicText:"",xAxisLabelHTML:"",xAxisPosition:"0",xAxisBackgroundColor:"",xAxisIntervalsVisibility:!1,xAxisMinText:"",xAxisMaxText:"",xAxisIntervalText:"",xAxisTicksMode:"Auto",xAxisTicksCount:"3",hideZeroValues:!1,xAxisSortBy:"0",customSort:[],labelTextWrap:!0,multiLineLabelWrap:!1,maxXAxisLabelWidth:100},xAxisScale:{absoluteXAxisScale:!1,customScale:"0"},xAxisTitle:{xAxisTitleVisibility:!0,xAxisTitleFontSize:"11",xAxisTitleFontFamily:tt,xAxisTitleFontStyle:[],xAxisTitleColor:Ie.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:Ie.transparent,yAxisColorInverted:Ie.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:tt,yAxisLabelFontStyle:[],yAxisLabelColor:Ie.black,yAxisNumberFormat:",",yAxisDisplayUnits:"Auto",yAxisLabelRotation:90,yAxisDisplayUnitsLabel:!1,yAxisDateFormat:"DD-MM-YYYY",yAxisLabelDecimalPrecision:"0",yAxisLabelText:"",yAxisLabelDynamicText:"",yAxisLabelHTML:"",yAxisPosition:"0",yAxisBackgroundColor:"",yAxisIntervalsVisibility:!1,yAxisMinText:"",yAxisMaxText:"",yAxisIntervalText:"",yAxisTicksMode:"Auto",yAxisTicksCount:"3",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:tt,yAxisTitleFontStyle:[],yAxisTitleColor:Ie.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:Ie.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:tt,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:Ie.black,secondaryYAxisNumberFormat:",",secondaryYAxisDisplayUnits:"None",secondaryYAxisDisplayUnitsLabel:!1,secondaryYAxisSyncWithPrimaryLabel:!1,secondaryYAxisDateFormat:"DD-MM-YYYY",secondaryYAxisLabelDecimalPrecision:"2",secondaryYAxisBackgroundColor:"#e5e5e5",secondaryYAxisIntervalsVisibility:!1,secondaryYAxisMinText:"",secondaryYAxisMaxText:"",secondaryYAxisIntervalText:""},secondaryYAxisTitle:{secondaryYAxisTitleVisibility:!0,secondaryYAxisTitleFontSize:"11",secondaryYAxisTitleFontFamily:tt,secondaryYAxisTitleFontStyle:[],secondaryYAxisTitleColor:Ie.black,secondaryYAxisTitleText:"Measure",secondaryYAxisDynamicTitleText:"",secondaryYAxisTitleHTML:""},legends:{legendVisibility:!0,primaryTitleVisibility:!0,primaryTitleText:"Primary Axis",primaryTitleFontSize:"11",primaryTitleFontFamily:tt,primaryTitleFontStyle:[],secondaryTitleVisibility:!0,secondaryTitleText:"Secondary Axis",secondaryTitleFontSize:"11",secondaryTitleFontFamily:tt,secondaryTitleFontStyle:[],legendPosition:"Top",legendAlignment:"Top",legendAlignmentTopBottom:"Start",legendFontSize:"11",legendFontFamily:tt,legendFontStyle:[],legendBorder:!1,legendBorderThickness:"1",legendBorderColor:Ie.black,vennLabelColor:Ie.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:Ie.black},plotArea:{plotAreaColor:Ie.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:Ie.black,plotAreaGapWidth:"50",plotAreaSeriesWidth:"50",plotAreaBarWidth:"50",gridLinesVisibility:!0,gridLinesHorizontal:!0,gridLinesVertical:!1,ticksHeight:"100",ticksWidth:"100",gridLinesColor:"#ccc",xCoordinate:"None",yCoordinate:"None",dataLabels:!0,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsforMaps:!1,dataLabelPosition:"1",dataLabelSize:"12",dataLabelValueColor:Ie.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:Ie.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:tt,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:Ie.black,dataLabelNameFontSize:"11",dataLabelNameFontFamily:tt,dataLabelNameFontStyle:[],fillOpacity:"0.7",innerRadius:"50",cornerRadius:"0",axialGrid:!0,arcPadding:"5",axialTicks:"10",arcTransition:!0,innerRadiusForSpeedometer:"30",ticks:"3",pointerColor:Ie.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:Ie.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:Ie.black,opacity:"0.5",plotAreaCalculatedHigh:"#00FF00",plotAreaCalculatedLow:"#FF0000",plotAreaDataLabel:"1",plotAreaDisplayUnits:"None",plotAreaHideLineAndMarkers:!0,dataLabelsOptions:"1",xscaleposition:"1",yscaleposition:"1",numberOfBubbles:!1,totalAlias:!1,totalAliasText:"",refLineBorderThickness:"1",refLineBorderColor:Ie.black,flipPyramid:!1,opacityforProgressScale:"0.2",opacityforProgressGoal:"1",lineStyle:"Solid",lineWidth:"2",fitChart:!0,scaleFactor:"5",rotation:"0",intersectionLabelVisibility:!1,intersectionValueVisibility:!1,dataLabelsCoordinates:[],hideInsignificantValue:!1,sortBy:"default",chartDirection:"right",plotAreaRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},heatMap:{showHeatMap:!1,heatMapMinColor:"#FF0000",heatMapMaxColor:"#7cfc00"},marker:{markerVisibility:!0,markerSize:"1",markerShape:"Circle",lineWidth:"1.5",markerColor:Ie.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:Ie.black,annotationFontSize:"9",annotationFontFamily:tt,annotationFontStyle:[],annotationDecimalPrecision:"2",annotationDisplayUnits:"None",annotationBoxVisibility:[],annotationHideZeroValues:!0,annotationShowHiddenValues:!0,annotationSetLabelColor:"1",annotationRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},total:{totalVisibility:!1,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsCoordinates:[],totalNumberFormat:",",totalColor:Ie.black,totalFontSize:"9",totalFontFamily:tt,totalFontStyle:[],totalConnectorType:"None",totalDecimalPrecision:"2",totalPosition:"1",totalAlignment:"1",totalHideZeroValues:!0,totalDisplayUnits:"None",editTotalTextToggle:!1,editTotalText:"Total",showTotalLabel:!0},toolTip:{toolTipVisibility:!0,toolTipTheme:"Light",toolTipNumberFormat:",",toolTipNumberFormatProgress:",.0%",toolTipDecimalPrecision:"2",toolTipLabelText:"",toolTipDisplayUnits:"None",toolTipLabelDynamicText:""},nodes:{nodesColor:"#d9d7d7",nodesSingleColor:!1,nodesFillOpacity:"1",spacing:"15",sankeyNodeWidth:"10",sankeyChartType:"Left",curviness:"0.5",nodesBorderVisibility:!0,nodesBorderThickness:"1",nodesBorderColor:Ie.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:tt,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:Ie.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:Ie.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:Ie.black,nodesDisplayUnits:"None",percentageVisibility:!1,nodesLabelOverflow:!0},links:{linksColor:"Source",linksFillOpacity:"0.5"},bins:{binsGapWidth:"0",binsFillOpacity:"0.5",binsCalculation:"Automatic",binsCalculationValue:"3",binsBorderVisibility:!1,binsBorderThickness:"1",binsBorderColor:Ie.black,binsBorderOpacity:"0.5"},connector:{connectorVisibility:"2",connectorFollow:"1",connectorStepSize:"1",connectorExclude:[],connectorCustomRange:[],connectorFontSize:"11",connectorFontFamily:tt,connectorFontStyle:[],connectorKPI:"1",connectorNumberFormat:",",connectorLineThickness:"1",connectorLineColor:"#080808",connectorMarkerColor:Ie.black,connectorFontColor:Ie.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:Ie.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:tt,footerNoteFontStyle:[],footerNoteFontColor:Ie.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:Ie.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:Ie.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:tt,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:Ie.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:tt,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:Ie.black,pointerValueDecimalPrecision:"2",displayUnits:"None"},text:{textFontFamily:tt,textSpacing:"5",textRotation:90},colorScale:{showColor:"1",startColor:"#c1d8f3",endColor:"#4c6ba5",division1:"#c1d8f3",division2:"#b3cbed",division3:"#a4bfe8",division4:"#96b2e2",division5:"#88a6dc",division6:"#7999d7",division7:"#6b8dd1",division8:"#5c80cb",division9:"#4e74c6",division10:"#4c6ba5"},customScaling:{warningTextDummyNode:!1,customScalingtoggle:!1,division1:"#b3b3b3",share1:"",division2:"#b3b3b3",share2:"",division3:"#b3b3b3",share3:"",division4:"#b3b3b3",share4:"",division5:"#b3b3b3",share5:"",division6:"#b3b3b3",share6:"",division7:"#b3b3b3",share7:"",division8:"#b3b3b3",share8:"",division9:"#b3b3b3",share9:"",division10:"#b3b3b3",share10:""},colorScaleForMaps:{defaultColor:"#808080",showColorForMaps:"1",startColorForMaps:"#c1d8f3",endColorForMaps:"#4c6ba5"},pointerValue:{showPointerValue:!1,pointerValueNumberFormat:",",pointerValueDecimalPrecision:"2",connectorKPIforSpeedometer:"1",kpiAlias:!1,kpiAliasText:"",pointerValueDisplayUnits:"None",pointerValueFontSize:"11",pointerValueFontFamily:tt,pointerValueFontStyle:[],pointerValueColor:Ie.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:Ie.black,bubbleBorderColor:Ie.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:Ie.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:Ie.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:tt,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:Ie.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:tt,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:Ie.black,dataTableAxisLabel:!0,dataTableLegends:!0,disableLegendIcon:!0,legendsWrapText:!1},dataTableOuterBorder:{borderButtonVisibility:!0,lineStyle:"solid",lineColor:"#d9d9d9",lineWidth:"1"},dataTableInnerBorder:{verticalBorderLineButton:!0,verticalBorderLineStyle:"solid",verticalBorderLineColor:"#d9d9d9",verticalBorderLineWidth:"1",horizontalBorderLineButton:!0,horizontalBorderLineStyle:"solid",horizontalBorderLineColor:"#d9d9d9",horizontalBorderLineWidth:"1"},chartPadding:{paddingArrayLTRB:[0,0,0,0]},statisticalTest:{zTest:!1,runZTest:[],zTestInputData:[]},cjsOptions:{cjsTension:0,cjsBorderRadius:0},animation:{animationEnabled:!1,animationDuration:1500,animationEffect:"easeCubicOut"},swapAxis:{swapAxisEnabled:!1}},Jt={top:0,right:0,bottom:0,left:0};var le=(t=>(t.WaterfallChart="WaterfallChart",t.StackLineChart="StackLineChart",t.NormalizedStackLineChart="NormalizedStackLineChart",t.LineChart="LineChart",t.ColumnChart="ColumnChart",t.StackColumnChart="StackColumnChart",t.AreaChart="AreaChart",t.PieChart="PieChart",t.SankeyChart="SankeyChart",t.DonutChart="DonutChart",t.HorizontalBarChart="HorizontalBarChart",t.StackAreaChart="StackAreaChart",t.NormalizedStackAreaChart="NormalizedStackAreaChart",t.Treemap="Treemap",t.StackHorizontalBarChart="StackHorizontalBarChart",t.NormalizedStackColumnChart="NormalizedStackColumnChart",t.NormalizedStackHorizontalBarChart="NormalizedStackHorizontalBarChart",t.ScatterChart="ScatterChart",t.CustomColumnChart="CustomColumnChart",t.customBarChart="CustomBarChart",t.ColumnHistogramChart="ColumnHistogramChart",t.HorizontalHistogramChart="HorizontalHistogramChart",t.Maps="Maps",t.TornadoChart="TornadoChart",t.PieofPie="PieofPie",t.WordCloud="WordCloud",t.BubbleChart="BubbleChart",t.VennChart="VennChart",t.Speedometer="Speedometer",t.LayeredColumnChart="LayeredColumnChart",t.LayeredHorizontalBarChart="LayeredHorizontalBarChart",t.OrganizationChart="OrganizationChart",t.PyramidChart="PyramidChart",t.ProgressChart="ProgressChart",t.RadialBarChart="RadialBarChart",t.CombinationLine="CombinationLine",t.CombinationArea="CombinationArea",t.CombinationStackArea="CombinationStackArea",t.TornadoDefaultEntry="defaultEntry",t.DotPlot="DotPlot",t))(le||{});const pi={1:"",2:v.curveLinear,3:v.curveStep},Nl=[le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart],wa={auto:"Auto",custom:"Custom"};function za(t,e,n){const o=Math.max(2,parseInt(n)||3),x=(e-t)/(o-1),l=[];for(let r=0;r<o;r++)l.push(parseFloat((t+r*x).toFixed(6)));return l}const Pl=[le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LayeredColumnChart,le.CustomColumnChart,le.ColumnHistogramChart,le.HorizontalBarChart,le.StackHorizontalBarChart,le.NormalizedStackHorizontalBarChart,le.LayeredHorizontalBarChart,le.HorizontalHistogramChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.WaterfallChart,le.DotPlot],zi=[le.PieChart,le.PieofPie,le.DonutChart,le.PyramidChart,le.OrganizationChart,le.VennChart,le.ProgressChart,le.Maps,le.WordCloud,le.SankeyChart,le.Speedometer,le.RadialBarChart];function Pt(t,e,n,o,x){var l=document.createElement("div");l.style.visibility="hidden",l.style.position="absolute",l.style.top="-9999px",l.style.left="-9999px",l.style.fontSize=e==null?"":e+"px",l.style.fontFamily=n??"",l.style.margin="0",l.style.padding="1px",l.style.border="none",x?(l.style.width=x+"px",l.style.whiteSpace="normal",l.style.overflowWrap="break-word"):l.style.whiteSpace="nowrap",l.innerHTML=t,document.body.appendChild(l);var r=l.getBoundingClientRect(),c=r.width,p=r.height;return o!=null?(l.style.transform=`rotate(${o}deg)`,r=l.getBoundingClientRect(),l.remove(),[c,p,r.width,r.height]):(l.remove(),[r.width,r.height])}function Il(t,e){let n=t.dataTableProperties&&t.dataTableProperties.dataTable,o=n?e*7<50?50:e*7>100?100:e*7:0;return n&&o<30&&(o=30),o}function Mi(t,e,n,o,x,l,r,c,p,m,L,u,S,g=[]){let W=l.dataTableProperties&&l.dataTableProperties.dataTable&&l.xAxisLabel.xAxisPosition=="0"&&!S,A=!1;//!formatOptions.plotArea.fitChart;
24
+ let E=t<200?200:S?e:t,b=e<200?200:S?t:e,U=E*.15*.8,Y=Ol(r,l),H=U<Y[0]+10?U:Y[0]+10,I=u?Tt(l.xAxisLabel.xAxisNumberFormat,c).map(k=>k):c,D=I?I[0]+"":"",w=D.length;I&&I.forEach(k=>{k=k+"";let s=k.trim()?.length||0;s>w&&(w=s,D=k.trim())});let z=Pt(D,l.xAxisLabel.xAxisLabelFontSize,l.xAxisLabel.xAxisLabelFontFamily,l.xAxisLabel.xAxisLabelRotation),K=z[0]+5,ye=z[3]+10,se;l.xAxisLabel.labelTextWrap?l.xAxisLabel.multiLineLabelWrap?se=l.xAxisLabel.maxXAxisLabelWidth:se=ye<b*.15?ye:b*.15:se=ye;let te=l.xAxisTitle.xAxisTitleVisibility?l.xAxisTitle.xAxisDynamicTitleText.length!==0?Pt(l.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:Pt(l.xAxisTitle.xAxisTitleText,"13",tt)[1]:W?5:0;te=te>b*.1?b*.1:te;let xe=W?0:l.xAxisLabel.xAxisLabelVisibility?se:0,ge=l.yAxisTitle.yAxisTitleVisibility?l.yAxisTitle.yAxisDynamicTitleText.length!==0?Pt(l.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:Pt(l.yAxisTitle.yAxisTitleText,"13",tt)[1]:0;ge=ge>E*.1?E*.1:ge;const pe=n*1.1,he=x*1.1;let O=l.yAxisLabel.yAxisLabelVisibility?Ui(pe,he,l,!1,L)+5:g.length?Il(l,v.max(g,k=>k?.length||0)||0)+10:0,X=l.secondaryYAxisLabel.secondaryYAxisLabelVisibility?Ui(o,p,l,!0,L):0,M=l.secondaryYAxisTitle.secondaryYAxisTitleVisibility?l.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?Pt(l.secondaryYAxisTitle.secondaryYAxisTitleHTML,l.secondaryYAxisTitle.secondaryYAxisTitleFontSize,l.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:Pt(l.secondaryYAxisTitle.secondaryYAxisTitleText,l.secondaryYAxisTitle.secondaryYAxisTitleFontSize,l.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;M=M>E*.1?E*.1:M;let h=l.chartTitle.chartTitleVisibility?l.chartTitle.dynamicTitleText.length!==0?Pt(l.chartTitle.chartTitleHTML,void 0,void 0)[1]:Pt(l.chartTitle.chartTitleText,"16",tt)[1]:0;return h=h>b*.1?b*.1:h,{width:E,height:b,isChartScrollable:A,legendMargin:H,dimensionHeightWidthArray:z,actualDimesionWidth:K,maxDimensionWidth:ye,xTitle:te,xLabel:xe,yTitle:ge,yLabel:O,secondaryYLabel:X,secondaryAxisTitleWidth:M,chartTitleHeight:h}}function El(t,e,n,o,x,l,r,c,p,m,L,u,S,g){try{const W=g??Mi(t,e,n,o,x,l,r,c,p,m,L,u,S),A=S?W.xTitle+W.xLabel:W.yTitle+W.yLabel,E=l.legends.legendPosition,b=l.legends.legendVisibility,U=l.xAxisLabel.xAxisPosition=="1"&&S;let Y=0,H=0;const I=m&&!S?W.secondaryYLabel+W.secondaryAxisTitleWidth:0;switch(E){case Je.none:case Je.none:H=15+I,Y=A+5;break;case Je.top:H=U?A+5:15+I,Y=U?5+I+W.xTitle:A+5;break;case Je.right:H=U?A+5+W.legendMargin:W.legendMargin+I+20,Y=U?5+I+W.xTitle+W.legendMargin:A+5;break;case Je.bottom:H=U?A+5:15+I,Y=U?5+I+W.xTitle:A+5;break;case Je.left:Y=W.legendMargin+A+33,H=15+I;break;default:H=15+I,Y=A+5}const D=l.chartPadding?.paddingArrayLTRB;return D&&(Y+=D[0],H+=D[2]),l.dataTableProperties&&l.dataTableProperties.dataTable&&L&&!S&&(Y=Y+35),{left:Y,right:H,yLabel:W.yLabel,yTitle:W.yTitle,xLabel:W.xLabel,xTitle:W.xTitle,dimensionHeightWidthArray:W.dimensionHeightWidthArray,chartTitleHeight:W.chartTitleHeight,legendMargin:W.legendMargin,secondaryYLabel:W.secondaryYLabel,secondaryAxisTitleWidth:W.secondaryAxisTitleWidth}}catch(W){throw W}}function Rl(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{const A=g??Mi(t,e,n,o,x,l,r,c,p,m,L,u,S),b=l.legends.legendVisibility?l.legends.legendPosition:Je.none,U=W&&!S?12:0,Y=S?A.yTitle+A.yLabel:A.xTitle+A.xLabel;let H=0,I=0;switch(b){case Je.none:H=A.chartTitleHeight+5,I=Y+5+U;break;case Je.top:H=35+A.chartTitleHeight,I=Y+U;break;case Je.right:H=A.chartTitleHeight+5,I=Y+5+U;break;case Je.bottom:I=30+Y+U,H=A.chartTitleHeight+5;break;case Je.left:H=A.chartTitleHeight+5,I=Y+5+U;break;default:H=A.chartTitleHeight+5,I=Y+5+U}l.xAxisLabel.xAxisPosition&&!S&&l.xAxisLabel.xAxisPosition=="1"&&(I=I-A.xLabel,H=H+A.xLabel),L&&!S&&(H=H+12);const D=m&&S?A.secondaryYLabel+A.secondaryAxisTitleWidth:0;D&&(H=H+D);const w=l.chartPadding?.paddingArrayLTRB;return w&&(H+=w[1],I+=w[3]),{top:H,bottom:I,chartTitleHeight:A.chartTitleHeight,xAxisRelatedMargin:Y,xLabel:A.xLabel,xTitle:A.xTitle}}catch(A){throw A}}function Mt(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{const A=Mi(t,e,n,o,x,l,r,c,p,m,L,u,S,W),E=El(t,e,n,o,x,l,r,c,p,m,L,u,S,A),b=Rl(t,e,n,o,x,l,r,c,p,m,L,u,S,A,!0);let U,Y=t-E.left-E.right,H=e-b.top-b.bottom,I,D=!1;({visibleBars:U,columnWidth:I,scrollbarVisible:D}=Xl(S?H:Y,l,g));const w={top:b.top,bottom:b.bottom,left:E.left,right:E.right};if(S){const z=L?30:0;w.right=w.right+z}return l.connector.connectorVisibility!="2"&&g?.chartType==le.StackColumnChart&&(w.top=w.top+20),l.connector.connectorVisibility!="2"&&g?.chartType==le.StackHorizontalBarChart&&(w.right=w.top+20),{margin:w,yLabel:E.yLabel,xLabel:E.xLabel,yTitle:E.yTitle,xTitle:E.xTitle,dimensionHeightWidthArray:E.dimensionHeightWidthArray,chartTitleHeight:E.chartTitleHeight,legendMargin:E.legendMargin,secondaryYLabel:E.secondaryYLabel,secondaryAxisTitleWidth:E.secondaryAxisTitleWidth,visibleBars:U,columnWidth:I,scrollbarVisible:D}}catch(A){throw A}}function St(t,e,n,o){t.attr("viewBox","0 0 "+e+" "+n);const{chartAreaColor:x,chartAreaBorder:l}=o.chartArea;if(t.style("background-color",x),l){const r=o.chartArea.chartAreaBorderColor,c=o.chartArea.chartAreaBorderThickness,p=o.chartArea.chartAreaBorderStyle.toString(),m=p==="1"?"solid":p==="2"?"dashed":"dotted";t.style("outline",`${c}px ${m} ${r}`).style("outline-offset",`-${c}px`)}else t.style("outline","none").style("outline-offset",null)}const Ft=(t,e)=>{let n=v.select(t.current);n.selectAll("*").remove();let o=$i(Ri,e),x=t.current.getBoundingClientRect(),l=x.width,r=x.height;return{formatOptions:o,svg:n,width:l,height:r}},ea=(t,e,n)=>{let o=[];if(!t.dataTableProperties.dataTable)return{formatOptions:t,dataTableLegendsList:o};let x=!1;return e.forEach(l=>{l?.properties?.showInDataTable==!0&&(x=!0,o.push(l.properties.alias))}),n.forEach(l=>{l?.properties?.showInDataTable==!0&&(x=!0,o.push(l.properties.alias))}),x||(t.dataTableProperties.dataTable=!1),t.dataTableProperties.dataTableLegends||(o=[]),{formatOptions:t,dataTableLegendsList:o}};function $i(t,e){if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(n=>{const o=t[n],x=Object.prototype.hasOwnProperty.call(e,n),l=e[n];if(!x||l===void 0){e[n]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const r=Yi(o),c=Yi(l);r&&c&&$i(o,l)}),e}function Yi(t){return Object.prototype.toString.call(t)==="[object Object]"}function Rt(t,e,n,o,x){parseFloat(t.yAxisLabel.yAxisIntervalText);let l=parseFloat(t.yAxisLabel.yAxisMaxText),r=parseFloat(t.yAxisLabel.yAxisMinText),c=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText),p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText);if(parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText),t.yAxisLabel.yAxisIntervalsVisibility){t.xAxisLabel.xAxisPosition=="2"&&(t.xAxisLabel.xAxisPosition="0"),r=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let Y=t.yAxisLabel.yAxisMaxText;l=String(Y).length>0?parseFloat(Y):n,l&&(n=l),parseFloat(t.yAxisLabel.yAxisIntervalText)<n&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else l=void 0,r=void 0;if(t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<x&&(p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),c=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):x,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(c=void 0,p=void 0),t.secondaryYAxisLabel.secondaryYAxisSyncWithPrimaryLabel){c=void 0,p=void 0;const Y=l!==void 0&&!Number.isNaN(l)?l:n,H=Math.max(Y,x);n=H,x=H,l!==void 0&&!Number.isNaN(l)&&(l=H)}let m=e?Xe(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,L=n?Xe(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,u=o?Xe(o,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=x?Xe(x,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,g=l?Xe(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,W=r?Xe(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,A=c?Xe(c,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,E=p?Xe(p,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,b=m<L||m===L?n:e;if(r){let Y=W<L?n:r;b=b<Y?Y:b}if(l){let Y=g>m?l:e;b=b<Y?Y:b}l&&r&&(b=g>W?l:r);let U=u<S?x:o;if(p){let Y=E<S?x:p;U=U<Y?Y:U}if(c){let Y=A>S?c:x;U=U<Y?Y:U}return c&&p&&(U=A>E?c:p),{maxNumberForPrimaryAxis:b,maxNumberForSecondaryAxis:U,customYaxisMaxValue:n,secondaryCustomYaxisMaxValue:x}}function Xe(t,e,n,o,x){try{let l,r="",c=o,p;if(e==="Auto")return zl(t);switch(e!=ei.none&&(e==ei.thousands&&(l=1e3,r="K"),e==ei.millions&&(l=1e6,r="M"),e==ei.billions&&(l=1e9,r="B"),t=t/l),x&&t<0&&(t=-t),n){case Aa.percentage:return p=`.${c}%`,v.format(p)(t);case Aa.general:return p=`.${c}f`,v.format(p)(t)+r;case Aa.scientific:let m=Number(c);return p=`.${m==0?1:(m+1).toString()}n`,v.format(p)(t)+r;case Aa.currency_USD:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"$"+v.format(p)(t)+r;case Aa.currency_CAD:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"C$"+v.format(p)(t)+r;case Aa.currency_EUR:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"€"+v.format(p)(t)+r;case Aa.currency_CHF:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"CHF"+v.format(p)(t)+r;case Aa.currency_UK:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"£"+v.format(p)(t)+r;case Aa.currency_INR:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"₹"+v.format(p)(t)+r;case Aa.commaSeparated:return p=`,.${c}f`,v.format(p)(t)+r;default:return p=".2f",v.format(p)(t)+r}}catch(l){throw l}}function zl(t){if(t==null||isNaN(t))return"-";const e=Math.abs(t);if(e>=1e9)return v.format(".2s")(t).replace("G","B");if(e>=1e6)return v.format(".2s")(t);if(e>=1e3)return v.format(".2s")(t);if(e>=1){const n=v.format(".2f")(t);return+n===Math.floor(t)?v.format(".0f")(t):n}else return e>=.01?v.format(".2f")(t):e>0?v.format(".2e")(t):"0"}function Ui(t,e,n,o,x){try{{let l,r,c=o?n.secondaryYAxisLabel.secondaryYAxisDisplayUnits:n.yAxisLabel.yAxisDisplayUnits,p=o?n.secondaryYAxisLabel.secondaryYAxisNumberFormat:n.yAxisLabel.yAxisNumberFormat,m=o?n.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:n.yAxisLabel.yAxisLabelDecimalPrecision,L=o?n.secondaryYAxisLabel.secondaryYAxisLabelFontSize:n.yAxisLabel.yAxisLabelFontSize,u=o?n.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:n.yAxisLabel.yAxisLabelFontFamily;if(c!="None")return l=Xe(Math.floor(t)||Math.floor(e),c,p,m??"2").toString(),r=Pt(l,L,u)[0],r<30?30:r+5;try{return l=Xe(Math.floor(t)||Math.floor(e),c,p,m??"2").toString(),x&&(l="-100%"),r=Pt(l,L,u)[0],r<30?30:r+5}catch{}}}catch(l){throw l}}function wt(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(n){throw n}}function kt(t,e,n,o,x,l,r){try{let c=r??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",c+"-clip").append("rect").attr("width",o).attr("height",n>0?x-n:x),t.append("rect").attr("width",o).attr("height",n>0?x-n:x).attr("stroke",e.plotArea.plotAreaBorder&&!zi.includes(l)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==Ie.white&&!zi.includes(l)?e.plotArea.plotAreaColor:"none")}catch(c){throw c}}function $l(t,e){const n=t.yPosition,o=t.yPosition+t.height,x=e.yPosition,l=e.yPosition+e.height;return n<l&&o>x}function yt(t,e,n,o,x,l,r,c,p){try{let m=o.yAxisLabel.yAxisIntervalsVisibility,L=!1,u=m?parseFloat(o.yAxisLabel.yAxisIntervalText):void 0,S=[],g;if(x.chartType===le.TornadoChart){const A=Math.max(Math.abs(e),Math.abs(t)),E=r||A,b=l||e;if(u&&u>0){for(let U=b;U<=E+1e-6;U+=u)S.push(parseFloat(U.toFixed(6)));g=S.length}else if(o.yAxisLabel.yAxisTicksMode===wa.custom)S=za(b,E,o.yAxisLabel.yAxisTicksCount),g=S.length;else{L=!0;const U=6,H=(E-b)/U;for(let I=0;I<=U;I++){const D=b+I*H;S.push(parseFloat(D.toFixed(6)))}g=c?p/80:n/80}return{yAxisLabelArray:S,customTickValue:g,autoLabelFlag:L}}if(!r&&t>0){const E=(t-e)*.05;t=t+E}if(u&&u!==0&&u!==void 0){let A=l||l==0?l:e,E=r||r==0?r:t;A<0?g=Math.floor((E-A)/u):g=Math.floor(E/u);let b=18;(r||r==0)&&(t=r);let U=l||l==0?l:e<0?Math.round(e):0;if(S.push(U),g>100){let Y="Tick count cannot exceed more than 100.";A<0?u=(E-U)/100:u=E/100}if(g=g<100?g:100,g>b)for(let Y=0;Y<parseInt(g)&&(U+=u,parseFloat(U.toFixed(5))<=t);Y++)S.push(U);else for(let Y=0;Y<b&&(U+=u,U<=t);Y++)S.push(U)}else if(o.yAxisLabel.yAxisTicksMode===wa.custom&&Pl.includes(x.chartType)){const A=l||l==0?l:e;S=za(A,t,o.yAxisLabel.yAxisTicksCount),g=S.length}else{L=!0;let A=Pt((r||x.yMaxLeft).toString(),o.yAxisLabel.yAxisLabelFontSize,o.yAxisLabel.yAxisLabelFontFamily,0);S=Bi(l||x.yMinLeft,t,c?p:n,c?A[1]:A[0]),g=c?p/80:n/80}return{yAxisLabelArray:S,customTickValue:g,autoLabelFlag:L}}catch(m){throw m}}function Bi(t,e,n,o=80){const x=e-t;if(!isFinite(x)||Math.abs(x)<1e-12)return[Number(t.toFixed(12))];const l=x<10?10:Math.max(2,Math.floor(n/o)),r=x/l,c=Math.pow(10,Math.floor(Math.log10(r))),p=[1,1.5,2,2.5,5,10];let m=p.map(W=>W*c).find(W=>Math.ceil(x/W)<=l);m||(m=p.at(-1)*c);const L=Math.floor(t/m)*m,u=Math.ceil(e/m)*m,S=Math.round((u-L)/m),g=new Array(S+1);for(let W=0;W<=S;W++)g[W]=Number((L+W*m).toFixed(12));return g}function Zt(t,e,n,o,x,l){try{let r=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",n>0?l-n:l).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Ie.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const c=t.append("g").call(x);c.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),c.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Ie.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",r.includes("Italic")?"Italic":"").style("text-decoration",r.includes("Underline")?"Underline":"").style("font-weight",r.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),c.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(r){throw r}}function bi(t,e,n,o,x,l,r){let c=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${r},0)`).attr("height",n>0?l-n:l).attr("width",o).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Ie.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const p=t.append("g").call(x).attr("transform",`translate(${r},0)`);p.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==Ie.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",c.includes("Italic")?"Italic":"").style("text-decoration",c.includes("Underline")?"Underline":"").style("font-weight",c.includes("Bold")?"Bold":"").attr("visibility",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),p.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",e.secondaryYAxisLabel.secondaryYAxisWidth),p.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",e.plotArea.fitChart?"1":"0").append("text").attr("transform","rotate(90)").attr("text-anchor","start").attr("class","DisplayUnit").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor).style("font-size",parseFloat(e.secondaryYAxisLabel.secondaryYAxisLabelFontSize)*.8).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle).attr("visibility",e.secondaryYAxisLabel.secondaryYAxisDisplayUnitsLabel==!1?"hidden":"visible").text("("+e.secondaryYAxisLabel.secondaryYAxisDisplayUnits+")")}function Yl(t,e){if(!t||t.length===0)return[];const n=Math.max(2,parseInt(e)||3);if(n>=t.length)return[...t];const o=t.length-1,x=new Set;for(let l=0;l<n;l++)x.add(Math.round(l*o/(n-1)));return Array.from(x).sort((l,r)=>l-r).map(l=>t[l])}function gt(t,e,n){return n.xAxisLabel.xAxisTicksMode===wa.custom?Yl(t,n.xAxisLabel.xAxisTicksCount):Ul(t,e)}function Ul(t,e){try{let n=[],o=e/30<t.length?Math.round(e/30):t.length;if(o>=t.length)return n=t,n;let x=Math.round(t.length/o);(t.length-1)%x!=0&&(t.length-1)%(x+1)==0&&(x=x+1),n.push(t[0]);let l;for(let r=1;r<t.length-1;r++){const c=r*x;if(c>t.length)break;n.push(t[c]),l=c}if(!n.includes(t[t.length-1])){let r=l>=Math.round(t.length-t.length*.02);n.push(t[t.length-1])}return n=n.filter(r=>r)}catch(n){throw n}}function ta(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{let A=e.chartType!==le.ColumnHistogramChart?gt(g,u,o):[],E=[],b=c[3]+10;e.chartType!=le.ColumnHistogramChart?E=L?Tt(o.xAxisLabel.xAxisNumberFormat,A.map(O=>O)).map(O=>O):A:A.forEach(O=>{E.push(e.formattedDimensionListMap.get(O))});let U=!o.plotArea.fitChart&&(e.chartType==le.AreaChart||e.chartType==le.StackAreaChart||e.chartType==le.NormalizedStackAreaChart);t||(t=t);let Y=o.xAxisLabel.xAxisLabelFontStyle,H="rotate("+-o.xAxisLabel.xAxisLabelRotation+")";o.dataTableProperties&&o.dataTableProperties.dataTable&&Nl.includes(e.chartType)&&o.xAxisLabel.xAxisPosition!="1"&&(o.xAxisLabel.xAxisLabelVisibility=!1);let I=o.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const D=t.append("g").attr("id","x-axis");D.append("rect").attr("transform",`translate(1,${I==="0"?x>0?S-x:S:I==="1"?-n:l(0)})`).attr("height",n).attr("width",u).attr("fill",o.xAxisLabel.xAxisLabelVisibility&&o.xAxisLabel.xAxisBackgroundColor?o.xAxisLabel.xAxisBackgroundColor!==Ie.white?o.xAxisLabel.xAxisBackgroundColor:"none":o.chartArea.chartAreaColor);const w=D.append("g").attr("transform",`translate(0,${I=="0"?x>0?S-x:S:I=="1"?0:l(0)})`).call(r);let z=I==="1"?"5":"0",K;o.xAxisLabel.labelTextWrap?o.xAxisLabel.multiLineLabelWrap?K=o.xAxisLabel.maxXAxisLabelWidth:K=b<p*.15?b:p*.15:K=o.xAxisLabel.xAxisLabelRotation==0?m:b;const ye=typeof W.step=="function"?W.step():m,se=parseInt(o.xAxisLabel.xAxisLabelFontSize)*1.2,te=Math.floor(ye/se),xe=o.xAxisLabel.xAxisLabelRotation==0;let ge=w.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(K)).style("height",ye+"px").attr("transform",(O,X)=>`rotate(${I==="1"?-o.xAxisLabel.xAxisLabelRotation:o.xAxisLabel.xAxisLabelRotation!=0?180-o.xAxisLabel.xAxisLabelRotation:0}) translate (${o.xAxisLabel.xAxisLabelRotation!=0?z+`, -${X==0&&U?15:ye/2}`:-K/2+" , "+(I==="1"?"-15":"8")})`);xe||ge.style("overflow","visible"),Wi()==="safari"&&ge.attr("width",o.xAxisLabel.labelTextWrap?b<p*.125?b:p*.125:n).attr("height","20px");let he=ge.append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",xe?"center":"end").style("align-items",xe?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("transform",Wi()==="safari"||I==="1"?"":o.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(o.xAxisLabel.labelTextWrap&&!o.xAxisLabel.multiLineLabelWrap||!o.xAxisLabel.labelTextWrap)&&he.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),o.xAxisLabel.labelTextWrap&&o.xAxisLabel.multiLineLabelWrap&&he.style("-webkit-line-clamp",te.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),he.style("text-align",o.xAxisLabel.xAxisLabelRotation!=0?"start":"center").style("user-select","none").style("margin",0).style("padding","0 1px").style("font-family",o.xAxisLabel.xAxisLabelFontFamily).style("color",o.xAxisLabel.xAxisLabelColor).style("font-size",o.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",Y.includes("Italic")?"Italic":"").style("text-decoration",Y.includes("Underline")?"Underline":"").style("font-weight",Y.includes("Bold")?"Bold":"").style("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===le.ColumnHistogramChart?he.attr("title",(O,X)=>Xe(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((O,X)=>Xe(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)):he.attr("title",(O,X)=>(""+E[X]).trim()).html((O,X)=>(""+E[X]).trim()),w.selectAll("text").style("visibility",(o.xAxisLabel.xAxisLabelVisibility,"hidden")),w.selectAll("line").style("stroke",o.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility||o.plotArea.gridLinesVertical?"visible":"hidden"),w.select(".domain").style("stroke",o.xAxisLabel.xAxisColor).attr("stroke-width",o.xAxisLabel.xAxisWidth?o.xAxisLabel.xAxisWidth:o.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").raise(),t}catch(A){throw A}}function Wi(){let t="";try{const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1:t="edge";break;case(e.indexOf("opr")>-1&&!!window.opr):t="opera";break;case(e.indexOf("chrome")>-1&&!!window.chrome):t="chrome";break;case e.indexOf("trident")>-1:t="ie";break;case e.indexOf("firefox")>-1:t="firefox";break;case(e.indexOf("safari")>-1||e.indexOf("applewebkit")>-1):t="safari";break;default:t="other";break}}catch(e){throw e}finally{return t}}const Hi={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},Bl=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const n=Math.floor(e-25569),o=new Date(n*86400*1e3);return Number.isNaN(o.getTime())?null:{day:o.getUTCDate(),month:o.getUTCMonth(),year:o.getUTCFullYear()}},Wl=t=>String(t%100).padStart(2,"0"),Hl=(t,e,n,o)=>{const x=Hi.short[e],l=Hi.long[e],r=String(t).padStart(2,"0"),c=String(e+1).padStart(2,"0"),p=Wl(n),m=String(n);switch(o){case"Month":return l;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${m}`;case"Year":return m;case"Default":return`${r}-${x}-${m}`;case"DD-MM-YYYY":return`${r}-${c}-${m}`;case"MM-DD-YYYY":return`${c}-${r}-${m}`;case"DD-MM":return`${r}-${c}`;case"YYYY-MM-DD":return`${m}-${c}-${r}`;case"YYYY-MM":return`${m}-${c}`;case"YYYY":return m;case"MM-YYYY":return`${c}-${m}`;case"MMM-YY":return`${x}-${p}`;case"YY-MMM":return`${p}-${x}`;case"MMMM-YY":return`${l}-${p}`;case"MMMM-YYYY":return`${l}-${m}`;case"DD-MMM":return`${r}-${x}`;case"DD-MMM-YY":return`${r}-${x}-${p}`;case"DD-MMM-YYYY":return`${r}-${x}-${m}`;default:return`${r}-${x}-${m}`}},Tt=(t,e)=>{try{return e.map(n=>{const o=Bl(n);if(!o)return n;const{day:x,month:l,year:r}=o;return Hl(x,l,r,t)})}catch(n){throw n}};function ja(t,e,n){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let o=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(n).enter().filter(l=>l.isVisible).append("g").attr("class","seriesLabels").attr("transform",l=>`translate(${l.xPosition}, ${l.yPosition})`).append("foreignObject").attr("width",l=>l.width).attr("height",l=>l.height).append("xhtml:div").style("display","flex").style("align-items","center").style("justify-content","center").style("width","100%").style("height","100%").append("xhtml:div").style("width","fit-content").style("height","100%").style("padding-left","5px").style("padding-right","5px").style("border-radius","4px").style("background-color",t.seriesLabel.seriesLabelBackgroundColor).style("font-size",t.seriesLabel.seriesLabelFontSize+"px").style("font-family",t.seriesLabel.seriesLabelFontFamily).style("font-style",o.includes("Italic")?"italic":"").style("text-decoration",o.includes("Underline")?"underline":"").style("font-weight",o.includes("Bold")?"bold":"").style("color","black").text(l=>l.seriesValue)}}function Gl(t,e,n,o,x,l){const r=n.xAxisLabel.xAxisPosition!="1"?e.left-20-x:5;return t?`rotate(-90) translate(-${e.top+o},${r})`:`translate(${e.left},${e.top+o+(n?.xAxisLabel?.xAxisPosition=="1"?0:t?l:x)})`}function Dt(t,e,n,o,x,l,r,c,p,m,L){try{let u=n.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",Gl(e,o,t,L,x,p)).attr("class","xAxisTitle").attr("width",e?L:m).attr("height",r+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?u.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):u.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){throw u}}function Vt(t,e,n,o,x,l,r,c,p,m,L){try{let u=n>0?t-n:t,S=x.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",o?l.left:`-${l.top+u}`).attr("y",o?l.top+u+c:l.left-r-c).attr("class","yAxisTitle").attr("transform",o?"":"rotate(-90)").attr("width",o?p:u).attr("height",r+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?S.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):S.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),x}catch(u){throw u}}function Gt(t,e,n,o,x,l,r,c,p,m=!1){let L=t.append("foreignObject").attr("visibility",e&&o.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",m?`${n.left}`:`-${n.top+(x>0?l-x:l)}`).attr("y",m?`${n.top-c-p-2}`:`${n.left+r+c-2}`).attr("class","yAxisTitleSecondary").attr("transform",m?"rotate(0)":"rotate(-90)").attr("width",m?r:x>0?l-x:l).attr("height",p+"px");o.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?L.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleHTML?o.secondaryYAxisTitle.secondaryYAxisTitleHTML:o.secondaryYAxisTitle.secondaryYAxisTitleText):L.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","3px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size",o.secondaryYAxisTitle.secondaryYAxisTitleFontSize+"px").style("font-family",o.secondaryYAxisTitle.secondaryYAxisTitleFontFamily).style("font-style",o.secondaryYAxisTitle.secondaryYAxisTitleFontStyle).attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleText)}function Nt(t,e,n,o){let x=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",n-4).attr("height",o+"px");const l=p=>{const m=document.createElement("div");return m.innerHTML=p,m.textContent||m.innerText||""},c=!!e.chartTitle.chartTitleHTML?l(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?x.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",c).style("white-space","pre").style("text-overflow","ellipsis").html(e.chartTitle.chartTitleHTML?e.chartTitle.chartTitleHTML:e.chartTitle.chartTitleText):x.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow","hidden").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",e.chartTitle.chartTitleFontFamily).attr("title",e.chartTitle.chartTitleText).html(e.chartTitle.chartTitleText)}function ft(t){if(t.line.interpolationType=="1")return v.curveLinear;if(t.line.interpolationType=="2"&&t.line.smoothType=="1")return v.curveMonotoneX;if(t.line.interpolationType=="2"&&t.line.smoothType=="2")return v.curveCardinal.tension(parseFloat(t.line.cardinalTension));if(t.line.interpolationType=="3"&&t.line.stepPosition=="1")return v.curveStepBefore;if(t.line.interpolationType=="3"&&t.line.stepPosition=="2")return v.curveStep;if(t.line.interpolationType=="3"&&t.line.stepPosition=="3")return v.curveStepAfter}function _l(t){const e=t.indexOf(" - ");return e==-1?Ci.default:t.slice(e+3)}const ka=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function Ja(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Ut(t,e,n){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:o,minVal:x,maxVal:l}=e.annotation.annotationRangeFilter;return t.filter(r=>{const c=n(r);switch(o){case"lt":return c<=l;case"gt":return c>=x;case"in":return c>=x&&c<=l;case"not-in":return c<x||c>l;default:return!0}})}function $a(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H,I,D,w){try{const z=m===le.TornadoChart;let K=new Map,ye=p.annotation.annotationType??"1",se=p.annotation.annotationPosition.toString()!="4"?p.annotation.annotationPosition:null,te=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const xe=p.annotation.connectorType?.toLowerCase()==="curve";if(p.annotation.annotationVisibility){let ge=[ye=="1"?"connector":""],pe=[],he=l.annotation(),O=p.annotation.connectorType,X=p.annotation.annotationVisibility,M=p.annotation.annotationFontStyle,h=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates)),k=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";h=Si(h,p,m);let s=[],d=[];switch(h.length!=0&&h.forEach(a=>{a.dx=a.dx*u/a.width,a.dy=a.dy*L/a.height,a.width=u,a.height=L}),X){case"2":t.forEach(a=>{a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"3":t.forEach(a=>{a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"4":t.forEach(a=>{a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})}),t.forEach(a=>{a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"1":for(let a=0;a<t[0].data.length;a++)t.forEach(f=>{f.data[a]&&pe.push({Dimension:f.data[a].dimension,Measure:f.data[a].value,Legend:f.data[a].legend,LabelPosition:se||f.properties.annotationPosition,Labelcolor:f.properties[te],hoverText:ka(f,w),Axis:f.properties.axis,LegendUniqueId:f.properties.legendUniqueId})});break;case"5":break;case"6":t.forEach(a=>{switch(a.properties.annotation.toString()){case"1":for(let N=0;N<t[0].data.length;N++)a.data[N]&&pe.push({Dimension:a.data[N].dimension,Measure:a.data[N].value,Legend:a.data[N].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"2":break;case"3":a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"4":a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"5":a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId}),a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;pe.forEach((a,f)=>{i<a.Measure&&(i=a.Measure)});let y=i*.1;pe.forEach((a,f)=>{let N={note:{label:a.Measure>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":Xe(m===le.TornadoChart?Math.abs(a.Measure):a.Measure,p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:D&&m!==le.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":m===le.TornadoChart?"end":"middle"},data:D?{y:z?_l(a.Legend):a.Dimension,x:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure}:{x:a.Dimension,y:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure},dx:0,dy:0,connector:{end:k,curve:pi[p.annotation.connectorCurve],points:xe?Ja(0,0):[[0,0],[0,0]]},disable:ge,subject:{height:15,width:15},color:a.Labelcolor,type:gi(l,parseFloat(ye)),height:L,width:u};if(D){let ne=a.Axis===Qe.primary?n:o;(gt(g,W,p).includes(a.Dimension)||m===le.TornadoChart)&&!r.includes(a.Legend)&&ne(a.Measure)<=S&&ne(a.Measure)>=0&&s.push(N)}else gt(g,S,p).includes(a.Dimension)&&!r.includes(a.Legend)&&(a.Axis==Qe.primary?n(a.Measure)<=W&&n(a.Measure)>=0:o(a.Measure)<=W&&o(a.Measure)>=0)&&s.push(N)}),p.annotation.annotationHideZeroValues&&(s=s.filter(a=>D?a.data.x.measure!==0:a.data.y.measure!==0)),s=Ut(s,p,a=>D?a.data.x.measure:a.data.y.measure),h.length===0?(h=s,K=new Map(h.map(a=>[a.data.legendUniqueId,{measure:D?a.data.x.measure:a.data.y.measure,dimension:D?a.data.y:a.data.x,legendUniqueId:a.data.legendUniqueId,dx:a.dx,dy:a.dy,connectorPoints:a.connector?.points||[],isVisible:a.data.isVisible??!0,width:a.width,height:a.height}]))):K=new Map(h.map(a=>[a.legendUniqueId,a])),s.forEach(a=>{const f=a.data.legendUniqueId;if(h.length!=0){const N=K.get(f);N&&(a.dx=N.dx,a.dy=N.dy,a.data.isVisible=N.isVisible??!0,N?.connectorPoints&&N.connectorPoints.length>=(xe?3:2)?a.connector.points=N.connectorPoints:a.connector.points=xe?Ja(a.dx,a.dy):[[0,0],[0,0]])}d.push(a)}),he.editMode(p.annotation.annotationDraggable&&H).accessors({x:function(a){if(D){let f=a.x.axis===Qe.primary?n:o,N=a.x.axis;return Gi(p,a.x.measure?a.x.measure:0,a.position,f,y,void 0,m,I,N)}else if(m===le.ColumnChart){const f=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=U(f);return N!=null?e(a.x)+N-(Y-U.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==Qe.primary)return ai(a.y.measure,parseFloat(a.position),n,y,a.prevValue,m);if(D){const f=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=U&&m!==le.DotPlot?U(f):0;return z?U(a.y)+U.bandwidth()/2:U?e(a.y)+N-(Y-U.bandwidth())/2-5:e(a.y)-5}else return ai(a.y.measure,parseFloat(a.position),o,y,a.prevValue,m)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,h.forEach(f=>{f.data.x==a.data.x&&f.data.y.measure==a.data.y.measure&&(T.selectAll(".annotation-note-label").filter(N=>N.data.x==a.data.x&&N.data.y.measure==a.data.y.measure).attr("display","block"),f.data.isVisible=!0)})),d.forEach(f=>{(f.data?.legendUniqueId==a.data.legendUniqueId||f.legendUniqueId==a.data.legendUniqueId)&&(f.dx=a._dx*u/f.width,f.dy=a._dy*L/f.height,f.connectorPoints=a.connector?.points?.map(N=>[...N])||[])}),b){const f=d.map(N=>({legendUniqueId:N.data?.legendUniqueId||N.legendUniqueId,dx:N.dx,dy:N.dy,connectorPoints:N.connectorPoints||[],isVisible:(N.data?.isVisible||N.isVisible)??!0,width:N.width,height:N.height}));b(f)}T.selectAll(".connector").attr("hoverId",f=>f.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[p.annotation.connectorStyle.toLowerCase()]),T.selectAll(`.connector-${k}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),T.selectAll(".note-line").attr("hoverId",f=>f.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[p.annotation.connectorStyle.toLowerCase()]).filter(f=>f._dx==0&&f._dy==0).remove(),T.selectAll(".annotation-note-label").filter(f=>f.data&&f.data.isVisible).style("display","block")}).on("noteclick",function(a){p.annotation.annotationDraggable&&H&&(a.data.isVisible=!1,h.forEach(f=>{f.data.x==a.data.x&&f.data.y.measure==a.data.y.measure&&(T.selectAll(".annotation-note-label").filter(N=>N.data.x==a.data.x&&N.data.y.measure==a.data.y.measure).attr("display","none"),f.data.isVisible=!1)}),T.selectAll(".annotation-note-label").filter(f=>f.data&&!f.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>n.invert(a.y)}).notePadding(0).annotations(d),p.plotArea.fitChart&&E.selectAll(".annotation-group").remove();let T=wi(E,p,x,M,he,k,D);if(p.animation?.animationEnabled){const a=p.animation.animationDuration,f=et[p.animation.animationEffect],N=he.accessors(),ne=m===le.LineChart,Z=m===le.DotPlot,fe=(Re,Te=0)=>{const Me=N.x(Re.data),J=N.y(Re.data);return`translate(${Me+Te}, ${J})`};if(Z)T.selectAll(".annotation").attr("opacity",0).attr("transform",Re=>fe(Re,-15)).transition().duration(a).ease(f).attr("opacity",1).attr("transform",Re=>fe(Re));else if(ne){const Re=e.range?e.range():[0,1],Te=Math.min(Re[0],Re[1]),Me=Math.max(Re[0],Re[1])-Te,J=(Ee,Le=100)=>{for(let Ue=0;Ue<=Le;Ue++){const ve=Ue/Le;if((f??v.easeLinear)(ve)>=Ee)return ve}return 1};T.selectAll(".annotation").attr("opacity",0).each(function(Ee){const Le=N.x(Ee.data)??Te,Ue=Me>0?Math.max(0,Math.min(1,(Le-Te)/Me)):0,ve=J(Ue)*a;v.select(this).transition().delay(ve).duration(0).attr("opacity",1)})}else T.selectAll(".annotation").attr("transform",function(Re){if(D){const Te=n?n(0):0,Me=N.y(Re.data);return`translate(${Te}, ${Me})`}else{const Te=N.x(Re.data),Me=Re.data?.y?.axis===Qe.primary?n:o??n,J=Me?Me(0):0;return`translate(${Te}, ${J})`}}).transition().duration(a).ease(f).attr("transform",function(Re){const Te=N.x(Re.data),Me=N.y(Re.data);return`translate(${Te}, ${Me})`})}}}catch(z){throw z}}function jl(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H,I){try{let D=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let w=[D=="1"?"connector":""],z=[],K=new Map,ye=l.annotation(),se=u.annotation.connectorType,te=u.annotation.annotationVisibility,xe=u.annotation.annotationFontStyle,ge=[],pe=[],he=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const O=u.annotation.connectorType?.toLowerCase()==="curve";let X=JSON.parse(JSON.stringify(u.plotArea.dataLabelsCoordinates));X=Si(X,u,le.CustomColumnChart);let M=[],h=[];X.length!=0&&X.forEach(i=>{i.dx=i.dx*g/i.width,i.dy=i.dy*S/i.height,i.width=g,i.height=S});for(let i=0;i<t.length;i++)t.forEach(y=>{y.properties.type&&y.properties.type!=le.ColumnChart&&!pe.includes(y.properties.type)&&pe.push(y.properties.type)});switch(te){case"2":t.forEach((i,y)=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:z.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(T=>z.push(T[0]));break;case le.StackAreaChart:c.forEach(T=>z.push(T[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:z.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(y=>z.push(y[y.length-1]));break;case le.StackAreaChart:c.forEach(y=>z.push(y[y.length-1]));break}});break;case"4":t.forEach((i,y)=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:z.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(T=>z.push(T[0]));break;case le.StackAreaChart:c.forEach(T=>z.push(T[0]));break}}),t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:z.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(y=>z.push(y[y.length-1]));break;case le.StackAreaChart:c.forEach(y=>z.push(y[y.length-1]));break}});break;case"1":t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:i.data.forEach(a=>z.push({...a,alias:i.properties?.alias}));break;case le.StackColumnChart:let y=r.findIndex(a=>a.key===i.properties.legend);y!==-1&&r[y].forEach(a=>z.push(a));break;case le.StackAreaChart:let T=c.findIndex(a=>a.key===i.properties.legend);T!==-1&&c[T].forEach(a=>z.push(a));break}});break;case"5":break;case"6":t.forEach((i,y)=>{let T=i.properties.annotation.toString();switch(i.properties.type){case le.ColumnChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)z.push(i.data[N]);break;case"2":break;case"3":z.push(i.data[0]);break;case"4":z.push(i.data[i.data.length-1]);break;case"5":z.push(i.data[0]),z.push(i.data[i.data.length-1]);break}break;case le.AreaChart:case le.LineChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)z.push({dimension:i.data[N].dimension,value:i.data[N].value,legend:i.data[N].legend,labelPosition:i.data[N].labelPosition,labelColor:i.data[N].labelColor,axis:i.data[N].axis,type:i.properties.type,alias:i.properties?.alias});break;case"2":break;case"3":z.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias});break;case"4":z.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break;case"5":z.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias}),z.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break}break;case le.StackColumnChart:const a=r.findIndex(N=>N.key===i.properties.legend);a!==-1&&r[a].forEach((N,ne)=>{switch(String(r[a].individualAnnotationVisibility)){case"1":z.push(r[a][ne]);break;case"2":break;case"3":let Z=r[a][0];z.find(Me=>Me.key==Z.key)||z.push(Z);break;case"4":let fe=r[a][r[0].length-1];z.find(Me=>Me.key==fe.key)||z.push(fe);break;case"5":let Re=r[a][0],Te=r[a][r[0].length-1];if(!z.find(Me=>Me.key==Re.key||Me.key==Te.key)){z.push(r[a][0]),z.push(r[a][r[0].length-1]);break}}});break;case le.StackAreaChart:const f=c.findIndex(N=>N.key===i.properties.legend);f!=-1&&c[f].forEach((N,ne)=>{switch(String(c[f].individualAnnotationVisibility)){case"1":z.push(c[f][ne]);break;case"2":break;case"3":let Z=c[f][0];z.find(Me=>Me.key==Z.key)||z.push(Z);break;case"4":let fe=c[f][c[0].length-1];z.find(Me=>Me.key==fe.key)||z.push(fe);break;case"5":let Re=c[f][0],Te=c[f][c[0].length-1];if(!z.find(Me=>Me.key==Re.key||Me.key==Te.key)){z.push(Re),z.push(Te);break}}});break}});break}let k=0;z.forEach((i,y)=>{k<i.value&&(k=i.value)});let s=k*.1;z.forEach((i,y)=>{let T={note:{label:i.value||i.value==0?i.value>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i.value/1e9)+"B":Xe(i.value,u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision):i[1]-i[0]>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i[1]-i[0]/1e9)+"B":Xe(i[1]-i[0],u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision),align:"middle"},data:{x:i.dimension&&i.legend?{dimension:i.dimension,legend:i.legend,type:i.type,axis:i.axis||i.data.axis}:{dimension:i.data.dimension,legend:i.key,type:i.data.type,stacklegend:i.data.legend,axis:i.data.axis},y:i.value||i.value==0?i.value:i.data.type!=le.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0],prevValue:i[0]>=0?i[0]:i[1],position:parseInt(i.labelPosition)?parseInt(i.labelPosition):parseInt(i.data.labelPosition),type:i.type,currentLegend:i.legend?.includes("~$~")?i.legend.split("~$~")[1]:i.key?.includes("~$~")?i.key.split("~$~")[1]:i.legend??i.key,isVisible:!0,hoverId:i?.alias?.replaceAll(" ","-"),legendUniqueId:i.legendUniqueId+"~$~"+(i.dimension??i.data.dimension)+"~$~"+(i.value||i.value==0?i.value:i.data.type!=le.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0])},dx:0,dy:0,connector:{end:he,curve:pi[u.annotation.connectorCurve],points:O?Ja(0,0):[[0,0],[0,0]]},disable:w,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:gi(l,parseFloat(D)),height:S,width:g};i.legend&&i.dimension?!p.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==Qe.primary?n(i.value)<=E&&n(i.value)>=0:o(i.value)<=E&&o(i.value)>=0)&&M.push(T):!p.includes(i.key)&&(i.data.axis==Qe.primary?n(i[1])<=E&&n(i[1])>=0:o(i[1])<=E&&o(i[1])>=0)&&M.push(T)}),u.annotation.annotationHideZeroValues&&(M=M.filter(i=>i.data.y!==0)),M=Ut(M,u,i=>i.data.y),X.length===0?(X=M,K=new Map(X.map(i=>[i.data.legendUniqueId,{measure:i.data.y,dimension:i.data.x.dimension,legendUniqueId:i.data.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connector?.points||[],isVisible:i.data.isVisible??!0,width:i.width,height:i.height}]))):K=new Map(X.map(i=>[i.legendUniqueId,i])),M.forEach(i=>{const y=i.data.legendUniqueId;if(X.length!=0){const T=K.get(y);T&&(i.dx=T.dx,i.dy=T.dy,i.data.isVisible=T.isVisible??!0,T?.connectorPoints&&T.connectorPoints.length>=(O?3:2)?i.connector.points=T.connectorPoints:i.connector.points=O?Ja(i.dx,i.dy):[[0,0],[0,0]],u.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&h.push(i)}),ye.editMode(u.annotation.annotationDraggable&&I).accessors({x:function(i){const y=i.x.type||i.type;if(pe.includes(y))switch(y){case le.StackColumnChart:return e(i.x.dimension)+H(i.x.stacklegend)-(L-H.bandwidth())/2;case le.StackAreaChart:case le.LineChart:case le.AreaChart:return e(i.x.dimension)}else{if(i.x.legend){const T=i.legendUniqueId.includes("~$~")?i.legendUniqueId.split("~$~")[0]:i.legendUniqueId;return e(i.x.dimension)+H(T)-(L-H.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const y=i.type??i.x.type;return i.x.axis==Qe.primary?ai(i.y,parseFloat(i.position),n,s,i.prevValue,y):ai(i.y,parseFloat(i.position),o,s,i.prevValue,y)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,X.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(T=>T.data.x.dimension==i.data.x.dimension&&T.data.x.legend==i.data.x.legend&&T.data.x.type==i.data.x.type&&T.data.prevValue==i.data.prevValue).attr("display","block"),y.data.isVisible=!0)})),h.forEach(y=>{(y.data?.legendUniqueId==i.data.legendUniqueId||y.legendUniqueId==i.data.legendUniqueId)&&(y.dx=i._dx*g/y.width,y.dy=i._dy*S/y.height,y.connectorPoints=i.connector?.points?.map(T=>[...T])||[])}),Y){const y=h.map(T=>({legendUniqueId:T.data?.legendUniqueId||T.legendUniqueId,dx:T.dx,dy:T.dy,connectorPoints:T.connector.points||T.connectorPoints||[],isVisible:(T.data?.isVisible||T.isVisible)??!0,width:T.width,height:T.height}));Y(y)}d.selectAll(".connector").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[u.annotation.connectorStyle.toLowerCase()]),d.selectAll(`.connector-${he}`).attr("fill",u.annotation.connectorColor||"#ccc").style("stroke",u.annotation.connectorColor||"#ccc"),d.selectAll(".note-line").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[u.annotation.connectorStyle.toLowerCase()]).filter(y=>y._dx==0&&y._dy==0).remove(),d.selectAll(".annotation-note-label").filter(y=>y.data&&y.data.isVisible).style("display","block")}).on("noteclick",function(i){u.annotation.annotationDraggable&&I&&(i.data.isVisible=!1,X.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(T=>T.data.x.dimension==i.data.x.dimension&&T.data.x.legend==i.data.x.legend&&T.data.x.type==i.data.x.type&&T.data.prevValue==i.data.prevValue).attr("display","none"),y.data.isVisible=!1)}),d.selectAll(".annotation-note-label").filter(y=>y.data&&!y.data.isVisible).style("display","none"))}).accessorsInverse({x:i=>e.invert(i.x),y:i=>i.x.axis==Qe.primary?n.invert(i.y):o.invert(i.y)}).notePadding(0).annotations(h),u.plotArea.fitChart||U.selectAll(".annotation-group").remove();let d=wi(U,u,x,xe,ye,he,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=et[u.animation.animationEffect],T=ye.accessors();d.selectAll(".annotation").attr("transform",function(a){const f=T.x(a.data),N=a.data.type||a.type,Z=(a.data?.x?.axis||a.data?.axis)===Qe.primary?n:o;let fe;return N===le.StackColumnChart||N===le.StackAreaChart?fe=Z(a.data.prevValue??0):fe=Z(0),`translate(${f}, ${fe})`}).transition().duration(i).ease(y).attr("transform",function(a){const f=T.x(a.data),N=T.y(a.data);return`translate(${f}, ${N})`})}}}catch(D){throw D}}const Si=(t,e,n)=>{try{let o=[le.PieChart,le.DonutChart].includes(n)?"plotArea":"annotation";return t=e[o].annotationDraggable&&!!1?t??[]:[],t}catch(o){throw o}},gi=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(n){throw n}},ai=(t,e,n,o,x,l)=>{try{let r=[le.LineChart,le.StackLineChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.NormalizedStackLineChart,le.StackAreaChart];switch(x||(x=0),e){case 1:let c;switch(l){case le.LineChart:case le.HorizontalBarChart:case le.ColumnChart:case le.AreaChart:case le.StackAreaChart:c=t<0?n(t)+7:n(t)-15;break;case le.StackHorizontalBarChart:case le.NormalizedStackLineChart:case le.StackLineChart:case le.NormalizedStackAreaChart:case le.StackAreaChart:case le.StackColumnChart:c=t<0?n(t)+5:n(t)-15;break;case le.TornadoChart:c=n(t)+n.bandwidth()/2;break;default:c=t<0?n(x)+5:n(t)-15}return c;case 2:return r.includes(l)?n(t):t===0?l==="stack"?"":n(0)-15:n(x+(t-x)/2);case 3:return r.includes(l)?t===-1||t<0?n(t)-10:n(t)+10:l.includes("stack")?t===-1&&x===0?n(0)+10:t===1&&x!==0?n(x)-10:x<0?n(x)+10:x===0&&t<0?n(0)+10:x===0&&t>0?n(0)-10:n(x)-10:t<0?n(0)+10:n(0)-10}}catch(r){throw r}},ia=(t,e,n,o,x,l)=>{try{const r=l?.DataTableData??[];let c=[],p=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){const m=t.dataTableProperties.dataTableLegends;t.dataTableProperties.dataTableAxisLabel?p=Fi(x[0],void 0,t):p=0;const L=[...o,...r];t.xAxisLabel.xAxisLabelVisibility=!1;const S=!t.dataTableProperties.disableLegendIcon?35:0;let g=e+n-S;L.forEach((W,A)=>{if(W?.properties?.showInDataTable??!0){let E={data:W.data.filter(b=>x.includes(b.dimension)),properties:{legend:W.properties.alias,color:W.properties.color,markerColor:W.properties.markerColor,markerShape:W.properties.markerShape,lineStyle:W.properties.lineStyle,height:m?Fi(W.properties.alias.includes("~$~")?W.properties.alias.split("~$~")[1]:W.properties.alias,g,t):20}};p+=E.properties.height,c.push(E)}})}else p=0,c=[];return c.length==0&&(p=0,c=[],t.dataTableProperties.dataTable=!1),{dataTable:c,dataTableHeight:p}}catch{}},Fi=(t,e,n)=>{try{let o=20,x=Pt(t,n.dataTableProperties.dataTableFontSize,n.dataTableProperties.dataTableFontFamily)[0];return o=Pt(t,n.dataTableProperties.dataTableFontSize,n.dataTableProperties.dataTableFontFamily,void 0,x>e&&!n.dataTableProperties.legendsWrapText?e:void 0)[1],o}catch(o){throw o}};function ua(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H,I){try{let D=function(T,a,f,N){a===0&&T.append("foreignObject").attr("x",-H.left).attr("y",xe).attr("class","blankClass").attr("width",H.left).attr("height",y).append("xhtml:div").style("width",H.left).style("height",`${y}px`).style("border-width",O?`0px 0px ${w.dataTableAxisLabel?M:0}px 0px`:"0px 0px 0px 0px").style("border-style",O?`solid ${h} ${h} solid`:"solid solid solid solid").style("border-color",O?`black ${X} ${X} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const Z=T.append("foreignObject").attr("x",-H.left).attr("y",xe+he).attr("width",H.left).attr("height",N).append("xhtml:div").style("display","flex").style("justify-content","center").style("align-items","center").attr("class","parentClass").style("flex-wrap","wrap").style("flex-direction","row").style("pointer-events","auto").style("width",te).style("height",`${N}px`).style("padding-left",w.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>Da(S,a,void 0,K,ye,"width")).style("border-style",()=>Da(S,a,void 0,K,ye,"style")).style("border-color",()=>Da(S,a,void 0,K,ye,"color"));if(!w.disableLegendIcon)switch(u){case le.ColumnChart:case le.StackColumnChart:case le.NormalizedStackColumnChart:Z.append("xhtml:div").style("height","10px").style("width","15px").style("background",f.properties.color).style("border-radius","1px");break;case le.LineChart:case le.StackLineChart:case le.NormalizedStackLineChart:Ki(f,Z,S);break;case le.AreaChart:case le.StackAreaChart:case le.NormalizedStackAreaChart:Qi(f,Z,S);break}const fe=f.properties.legend,Re=S?.legends?.legendColorMode=="1"?f?.properties?.color:S?.legends?.legendSelectedUnicolor,Te=Z.append("xhtml:div").style("max-width",te).attr("class","legendsColumn").style("text-align","left").style("vertical-align","middle").call(d).style("padding-left","5px").style("white-space","normal").style("overflow-wrap","break-word").style("color",Re??"black").style("width",w.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",fe).text(fe);w.legendsWrapText&&Te.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const w=S.dataTableProperties,z=w.dataTableFontStyle,K=A.length,ye=o.length,se=b[0]?b[0]:0,te=typeof r.step=="function"?r.step():x,xe=I-L,ge=2;let pe=20,he=0;const O=S.dataTableOuterBorder.borderButtonVisibility,X=S.dataTableOuterBorder.lineColor,M=S.dataTableOuterBorder.lineWidth,h=S.dataTableOuterBorder.lineStyle,k=T=>T===0?te+ge+se/2:T===K-1?te+ge-se/2:te,s=T=>Xe(u.includes("100stack")?T.TooltipMeasure/T.TotalMeasure:T.TooltipMeasure||T.value,w.dataTableDisplayUnits,w.dataTableNumberFormat,w.dataTableDecimalPrecision),d=T=>T.style("font-size",w.dataTableFontSize+"px").style("font-family",w.dataTableFontFamily).style("font-style",z.includes("Italic")?"Italic":"").style("text-decoration",z.includes("Underline")?"Underline":"").style("font-weight",z.includes("Bold")?"Bold":"");v.selectAll("#dataTableG"+Y).remove();const i=n.append("g").attr("id","dataTableG"+Y);let y=0;w.dataTableAxisLabel&&(y=Fi(A[0],void 0,S),pe=y),o.forEach((T,a)=>{he+=!w.dataTableAxisLabel&&a===0?0:pe,pe=T.properties.height,w.dataTableLegends&&D(i,a,T,pe);const f=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+Y+" .foreignObject").data(()=>T.data).enter().filter(N=>r(N.dimension)).append("g").attr("fill",Ie.transparent).attr("transform",(N,ne)=>`translate(${ne===0?0:r(N.dimension)-te/2},0)`);a===0&&w.dataTableAxisLabel&&f.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",xe).attr("id",(N,ne)=>ne).attr("width",(N,ne)=>k(ne)).attr("height",`${y}px`).append("xhtml:div").style("width",(N,ne)=>k(ne)).style("height",`${y}px`).style("border-width",(N,ne)=>Da(S,ne,void 0,K,ye,"width","colHeaders")).style("border-style",(N,ne)=>Da(S,ne,void 0,K,ye,"style","colHeaders")).style("border-color",(N,ne)=>Da(S,ne,void 0,K,ye,"color","colHeaders")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-left","3px").call(d).style("color",S.xAxisLabel.xAxisLabelColor??"black").attr("title",N=>U.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)).text(N=>U.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)),f.append("foreignObject").attr("x",0).attr("y",xe+he).attr("width",(N,ne)=>k(ne)).attr("height",pe).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(N,ne)=>k(ne)).style("height",`${pe}px`).style("line-height",`${pe}px`).style("border-width",(N,ne)=>Da(S,a,ne,K,ye,"width")).style("border-style",(N,ne)=>Da(S,a,ne,K,ye,"style")).style("border-color",(N,ne)=>Da(S,a,ne,K,ye,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(d).style("color",w.dataTableLabelColor).attr("title",N=>s(N)).text(N=>s(N))})}catch(D){throw D}}function Da(t,e,n,o,x,l,r){try{const c=t.dataTableOuterBorder,p=t.dataTableInnerBorder,m=c.borderButtonVisibility,L=p.horizontalBorderLineButton,u=p.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,g={w:c.lineWidth,s:c.lineStyle,c:c.lineColor},W={w:p.horizontalBorderLineWidth,s:p.horizontalBorderLineStyle,c:p.horizontalBorderLineColor},A={w:p.verticalBorderLineWidth,s:p.verticalBorderLineStyle,c:p.verticalBorderLineColor},E={w:"0",s:"solid",c:"black"},b=m?g:E,U=L?W:E,Y=u?A:E,H=o-1,I=x-1;let D=E,w=E,z=E,K=E;switch(r?(D=b,z=U,K=e===0?b:E,w=e===H?b:Y):n===void 0?(K=b,w=E,D=e===0&&!S?b:E,z=e===I?b:U):(D=e===0&&!S?b:E,z=e===I?b:U,K=n===0?Y:E,w=n===H?b:Y),l){case"width":return`${D.w}px ${w.w}px ${z.w}px ${K.w}px`;case"style":return`${D.s} ${w.s} ${z.s} ${K.s}`;case"color":return`${D.c} ${w.c} ${z.c} ${K.c}`}}catch(c){throw c}}function Lt(t,e,n){let o=[];for(let x=0;x<t.length;x++){const l=t[x];let r={},c=0,p=0,m=0;for(let L=0;L<e.length;L++){let u=e[L].data.find(S=>S.dimension===t[x])?.value||0;r[e[L].properties.legend]=u,c=c+(n?Math.abs(u):u),p+=u>0?u:0,m+=u}r.total=c,r.dimension=l,r.absoluteTotal=p,r.displayTotal=m,o.push(r)}return o}function la(t,e,n,o,x,l,r,c){try{let p=n.seriesLabel.seriesLabelApplySeries,m=n.seriesLabel.seriesLabelPosition,L=[],u=o[0].legend,S=Pt(u,n.seriesLabel.seriesLabelFontSize,n.seriesLabel.seriesLabelFontFamily);return o.forEach(g=>{let W=!1;if(p=="1"?W=!0:W=g.properties.seriesLabelVisibility,W){let A={},E=m=="Right"?g.data[g.data.length-1]:g.data[0],b=c?E.value>0?E[1]:E[0]:E.value;g.properties.axis==Qe.primary||!x?A.yPosition=e(b):l&&x&&(A.yPosition=x(b)),(A.yPosition<0||A.yPosition>r)&&(W=!1),A.yPosition=A.yPosition-S[1]/2,A.isVisible=W,A.seriesValue=g.properties.alias,A.height=S[1],A.width=S[0];let U=!1;L.length>0&&L.some(Y=>{U||(U=$l(Y,A))}),W&&!U&&L.push(A)}else return}),u="",L.forEach(g=>{g.seriesValue.length>u.length&&(u=g.seriesValue)}),S=Pt(u,n.seriesLabel.seriesLabelFontSize,n.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,L.forEach(g=>{g.height=S[1],g.width=S[0],g.xPosition=m=="Right"?t+(l?10:0)-S[0]:5}),{labelArray:L,heightWidth:S}}catch(p){throw p}}function Ya(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H){try{let I=p.annotation.annotationType??"1";if(p.annotation.annotationVisibility){let D=[I=="1"?"connector":""],w=[],z=new Map,K=l.annotation(),ye=p.annotation.connectorType,se=p.annotation.annotationVisibility,te=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",xe=p.annotation.annotationFontStyle,ge=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";const pe=p.annotation.connectorType?.toLowerCase()==="curve";let he=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates));he=Si(he,p,m);let O=[],X=[];switch(he.length!=0&&he.forEach(s=>{s.dx=s.dx*u/s.width,s.dy=s.dy*L/s.height,s.width=u,s.height=L}),se){case"2":t.forEach(s=>w.push(s[0]));break;case"3":t.forEach(s=>w.push(s[s.length-1]));break;case"4":t.forEach(s=>w.push(s[0])),t.forEach(s=>w.push(s[s.length-1]));break;case"1":for(let s=0;s<t[0].length;s++)t.forEach(d=>w.push(d[s]));break;case"5":break;case"6":t.forEach(s=>{switch(s[0]?.properties?.annotation?.toString()){case"1":for(let i=0;i<t[0].length;i++)w.push(s[i]);break;case"2":break;case"3":w.push(s[0]);break;case"4":w.push(s[t[0].length-1]);break;case"5":w.push(s[0]),w.push(s[t[0].length-1]);break}});break}let M=0;w.forEach((s,d)=>{M<s.Measure&&(M=s.Measure)});let h=M*.1;p.annotation.annotationHideZeroValues&&(w=w.filter(s=>(s[1]<0&&s[0]<0?s[0]-s[1]:s[1]===0&&s[0]<0?s[1]+s[0]:s[1]-s[0])!==0)),w.forEach((s,d)=>{let i={note:{label:s[1]-s[0]>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(s[1]-s[0]/1e9)+"B":Xe(s[1]<0&&s[0]<0?s[0]-s[1]:s[1]===0&&s[0]<0?s[1]+s[0]:s[1]-s[0],p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:H?s.data.labelPosition==2?"middle":"start":"middle"},data:H?{y:s.data.dimension,x:s[1]>0?s[1]:s[0],prevValue:s[0]>=0?s[0]:s[1],position:p.annotation.annotationPosition=="4"?s.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:s.key.includes("~$~")?s.key.split("~$~")[1]:s.key,isVisible:!0,hoverId:s.properties.alias?Xa(s.properties.alias):Xa(s.key),legendUniqueId:s.properties.legendUniqueId+"~$~"+s.data.dimension+"~$~"+(s.key.includes("~$~")?s.key.split("~$~")[1]:s.key)+"~$~"+(s[1]>0?s[1]:s[0])}:{x:s.data.dimension,y:s[1]>0?s[1]:s[0],prevValue:s[0]>=0?s[0]:s[1],position:p.annotation.annotationPosition=="4"?s.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:s.key.includes("~$~")?s.key.split("~$~")[1]:s.key,isVisible:!0,hoverId:s.properties?.alias?Xa(s.properties.alias):Xa(s.key),legendUniqueId:s.properties.legendUniqueId+"~$~"+s.data.dimension+"~$~"+(s.key.includes("~$~")?s.key.split("~$~")[1]:s.key)+"~$~"+(s[1]>0?s[1]:s[0])},dx:0,dy:0,connector:{end:ge,curve:pi[p.annotation.connectorCurve],points:pe?Ja(0,0):[[0,0],[0,0]]},disable:D,subject:{height:15,width:15},color:s.properties&&s.properties[te]?s.properties[te]:s.data.labelColor,type:gi(l,parseFloat(I)),height:L,width:u};g.includes(s.data.dimension)&&Jl(W,S,H,s,n)&&O.push(i)}),O=Ut(O,p,s=>H?s.data.x-s.data.prevValue:s.data.y-s.data.prevValue),he.length===0?(he=O,z=new Map(he.map(s=>[s.data.legendUniqueId,{measure:H?s.data.x:s.data.y,dimension:H?s.data.y:s.data.x,legendUniqueId:s.data.legendUniqueId,dx:s.dx,dy:s.dy,connectorPoints:s.connector?.points||[],isVisible:s.data.isVisible??!0,width:s.width,height:s.height}]))):z=new Map(he.map(s=>[s.legendUniqueId,s])),O.forEach(s=>{const d=s.data.legendUniqueId;if(he.length!=0){const i=z.get(d);i&&(s.dx=i.dx,s.dy=i.dy,s.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(pe?3:2)?s.connector.points=i.connectorPoints:s.connector.points=pe?Ja(s.dx,s.dy):[[0,0],[0,0]])}X.push(s)}),K.editMode(p.annotation.annotationDraggable&&Y).accessors({x:function(s){return H?Gi(p,s.x,parseFloat(s.position),n,h,s.prevValue,m):e(s.x)+e.bandwidth()/2},y:function(s){return H?e(s.y)+e.bandwidth()/2:ai(s.y,parseFloat(s.position),n,h,s.prevValue,m)}}).on("dragend",function(s){if(s.data.isVisible||(s.data.isVisible=!0,he.forEach(d=>{d.data.x==s.data.x&&d.data.y==s.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==s.data.x&&i.data.y==s.data.y).attr("display","block"),d.data.isVisible=!0)})),X.forEach(d=>{(d.data?.legendUniqueId==s.data.legendUniqueId||d.legendUniqueId==s.data.legendUniqueId)&&(d.dx=s._dx*u/d.width,d.dy=s._dy*L/d.height,d.connectorPoints=s.connector?.points?.map(i=>[...i])||[])}),b){const d=X.map(i=>({legendUniqueId:i.data?.legendUniqueId||i.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connectorPoints||[],isVisible:(i.data?.isVisible||i.isVisible)??!0,width:i.width,height:i.height}));b(d)}k.selectAll(".connector").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[p.annotation.connectorStyle.toLowerCase()]),k.selectAll(`.connector-${ge}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[p.annotation.connectorStyle.toLowerCase()]).filter(d=>d._dx==0&&d._dy==0).remove(),k.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block")}).on("noteclick",function(s){p.annotation.annotationDraggable&&Y&&(s.data.isVisible=!1,he.forEach(d=>{d.data.x==s.data.x&&d.data.y==s.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==s.data.x&&i.data.y==s.data.y).attr("display","none"),d.data.isVisible=!1)}),k.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"))}).accessorsInverse({x:s=>e.invert(s.x),y:s=>n.invert(s.y)}).notePadding(0).annotations(X),E.selectAll(".annotation-group").remove();let k=wi(E,p,x,xe,K,ge,H);if(p.animation?.animationEnabled){const s=p.animation.animationDuration,d=et[p.animation.animationEffect],i=K.accessors();if(m===le.StackLineChart||m===le.NormalizedStackLineChart){const T=e.range?e.range():[0,1],a=Math.min(T[0],T[1]),f=Math.max(T[0],T[1])-a,N=(ne,Z=100)=>{for(let fe=0;fe<=Z;fe++){const Re=fe/Z;if((d??v.easeLinear)(Re)>=ne)return Re}return 1};k.selectAll(".annotation").attr("opacity",0).each(function(ne){const Z=i.x(ne.data)??a,fe=f>0?Math.max(0,Math.min(1,(Z-a)/f)):0,Re=N(fe)*s;v.select(this).transition().delay(Re).duration(0).attr("opacity",1)})}else k.selectAll(".annotation").attr("transform",function(T){if(H){const a=n?n(0):0,f=i.y(T.data);return`translate(${a}, ${f})`}else{const a=i.x(T.data),f=n?n(0):0;return`translate(${a}, ${f})`}}).transition().duration(s).ease(d).attr("transform",function(T){const a=i.x(T.data),f=i.y(T.data);return`translate(${a}, ${f})`})}}}catch(I){throw I}}function Jl(t,e,n,o,x){const l=x(o[1]>0?o[1]:o[0]);return n?l>=0&&l<=e:l<=t&&l>=0}const wi=(t,e,n,o,x,l,r)=>{t.selectAll(".annotation-group").remove();let c=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${n.left},${n.top})`).style("fill",e.annotation.annotationColor).style("font-family",e.annotation.annotationFontFamily).style("font-size",e.annotation.annotationFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(x);return c.selectAll("rect").style("visibility","hidden"),c.selectAll(".annotation-subject").remove(),c.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.annotation.connectorStyle.toLowerCase()]).style("visibility",p=>(r?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),c.selectAll(`.connector-${l}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",p=>(r?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),c.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.annotation.connectorStyle.toLowerCase()]).filter(p=>p._dx==0&&p._dy==0).remove(),c.selectAll(".connector-end").filter(p=>p.connector.end=="dot"&&p._dx==0&&p._dy==0).remove(),c.selectAll(".annotation-note-label").filter(p=>p.data&&!p.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&c.selectAll(".annotation-note-content").attr("transform",function(){const m=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(m)return`translate(${r?0:parseFloat(m[1])}, 0)`}),c.selectAll("text").style("text-anchor",p=>r&&p.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==Ie.white?e.annotation.annotationColor:"none"),c.selectAll("tspan").attr("hoverId",p=>p.data.hoverId?p.data.hoverId:p.data.currentLegend.replaceAll(" ","-")).style("visibility",p=>parseFloat(p.data.y)==0&&e.annotation.annotationHideZeroValues?"hidden":"visible"),c},ra=(t,e,n,o,x,l)=>{try{let r=t.yAxisLabel.yAxisLabelFontStyle,c="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${o})`).attr("height",n+10).attr("width",x).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==Ie.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const p=e.append("g").call(l).attr("transform",`translate(0,${o})`);p.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),p.selectAll("text").style("text-anchor",c=="rotate(0)"?"middle":"end").attr("dx",c=="rotate(0)"?".2em":"-.1em").attr("dy",c=="rotate(0)"?"1em":".15em").attr("transform",c).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==Ie.white?t.yAxisLabel.yAxisLabelColor:"none").style("font-size",t.yAxisLabel.yAxisLabelFontSize).style("font-family",t.yAxisLabel.yAxisLabelFontFamily).style("font-style",t.yAxisLabel.yAxisLabelFontStyle).style("font-style",r.includes("Italic")?"Italic":"").style("text-decoration",r.includes("Underline")?"Underline":"").style("font-weight",r.includes("Bold")?"Bold":"").attr("visibility",t.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),p.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.yAxisLabel.yAxisColor).attr("stroke-width",t.yAxisLabel.yAxisWidth?t.yAxisLabel.yAxisWidth:t.plotArea.plotAreaBorderThickness)}catch(r){throw r}};function Zl(t,e,n,o,x,l,r,c){return t?`rotate(${90-n.xAxisLabel.xAxisLabelRotation})
25
+ translate(${-(o(x*.01)+l)} ,${-c/2})`:`rotate(${90-n.xAxisLabel.xAxisLabelRotation})
26
+ translate(${n.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-l},${-c/2}`:-r/2+" ,2"})`}const na=(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E)=>{try{const b=L===le.TornadoChart;let U=t.xAxisLabel.xAxisLabelFontStyle,Y=parseInt(t.xAxisLabel.xAxisPosition),H=gt(m,o,t),I=u?Tt(t.xAxisLabel.xAxisNumberFormat,H.map(he=>he)).map(he=>he):H;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let D;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?D=t.xAxisLabel.maxXAxisLabelWidth:D=n;let w=A.step();const z=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,K=Math.floor(w/z),ye=t.xAxisLabel.xAxisLabelRotation==0;let se=e.append("rect").attr("id","yAxisRect").attr("transform",L===le.TornadoChart?`translate(${-D-1},0)`:`translate(${Y===0?-D-5:Y===1?x:c(0)+(-D-5)},0)`).attr("height",o).attr("width",L===le.TornadoChart?D:D+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==Ie.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const te=e.append("g").attr("id","yAxisG").attr("transform",b?`translate(${c(0)},0)`:`translate(${Y===0?0:Y===1?x:c(0)},0)`).call(l);let pe=te.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",D).attr("height",w+"px").attr("transform",Zl(b,Y,t,c,p,D,n,w)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",ye?"center":"start").style("align-items",ye?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("text-align",t.xAxisLabel.xAxisLabelRotation==0?"center":"start").style("user-select","none").style("margin",0);if((t.xAxisLabel.labelTextWrap&&!t.xAxisLabel.multiLineLabelWrap||!t.xAxisLabel.labelTextWrap)&&pe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap&&pe.style("-webkit-line-clamp",K.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),pe.style("padding",0).style("font-family",t.xAxisLabel.xAxisLabelFontFamily).style("font-style",t.xAxisLabel.xAxisLabelFontStyle).style("color",t.xAxisLabel.xAxisLabelColor).style("font-size",t.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",U.includes("Italic")?"Italic":"").style("text-decoration",U.includes("Underline")?"Underline":"").style("font-weight",U.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(he,O)=>I[O]).html((he,O)=>I[O]),L===le.TornadoChart){if(r){const he=e.append("g").attr("transform",`translate(${c(0)},0)`).call(r);he.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),he.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),he.selectAll("text").style("visibility","hidden")}te.selectAll("text").style("visibility","hidden")}else te.selectAll("text").style("visibility","hidden");te.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),te.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(b){throw b}},Gi=(t,e,n,o,x,l,r,c,p)=>{try{l=l??0;const m=Xe(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,r===le.TornadoChart),L=String(m).length,u=o(e),S=o(l),g=o(0),W=r??"",A=W.includes("stack"),E=W==="100%stackBar";switch(n){case 1:return E?e<0&&e!==-1?u-20:e===-1||e>0&&e!==1?u+10:u-10:e<0||c&&p==="positive"?u-L*5:u+5;case 2:return e===0?A?"":g+15:o(l+(e-l)/2);case 3:return A?l<0?S-L*5:l===0&&e<0?g-L*5:l===0&&e>0?g+10:S+10:e<0?g-L*5:g+10;default:return u}}catch(m){throw m}},Ai=(t,e,n,o,x)=>{try{let l=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-n})`).attr("height",n).attr("width",x).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Ie.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const r=e.append("g").call(o).attr("transform","translate(0,0)");r.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),r.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==Ie.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),r.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(l){throw l}},Di=(t,e)=>e*(1+t),_i=(t,e)=>e/(1+t);function Xl(t,e,n){const o=t>0?t:0,x=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,l=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,r=Array.isArray(n?.dimensionList)?n.dimensionList.length:0;let c=0,p=0,m=!1;if(r>0&&o>0){const L=o/r,u=_i(l,L);if(u>=x||e.plotArea.fitChart)p=u,c=r,m=!1;else{const S=Di(l,x),g=Math.floor(o/S);g<=1?(c=1,p=_i(l,o),m=r>1):(c=g,p=x,m=c<r)}}else c=0,p=0,m=!1;return{visibleBars:c,columnWidth:p,scrollbarVisible:m}}const Za=(t,e,n)=>Math.max(e,Math.min(n,t)),_t=(t,e,n,o,x,l,r,c,p,m,L,u,S=!1)=>{const g=(W,A,E,b,U)=>{try{if(U&&(W=m+W),!p||!Array.isArray(p.dimensionList)||!Array.isArray(t))return;W=W==null?0:Number(W),A=A==null?0:Number(A),E=E==null?0:Number(E),m=Za(Math.round(W),0,Math.max(0,A)),c=typeof c=="number"?c:0;const Y=m,H=Y+c;let I=p.dimensionList.slice(Y,H),D=JSON.parse(JSON.stringify(t||[]));D.forEach((xe,ge)=>{const pe=Array.isArray(xe?.data)?xe.data:[];D[ge].data=pe.filter(he=>I.includes(he?.dimension))});const w=x?.left??0,z=x?.top??0,K=Number(l)||0,ye=Number(innerHeight)||0,se=Number(E)||0,te=A===0?1:A;if(S){const xe=z+(ye-se)*(A===0?0:m)/te;b&&typeof b.attr=="function"&&b.attr("y",xe)}else{const xe=w+(K-se)*(A===0?0:m)/te;b&&typeof b.attr=="function"&&b.attr("x",xe)}u(I,D,c)}catch(Y){typeof me=="function"&&me("ColumnChart","updateFromScrollPosition",Y)}};if(r){const W=e-x.top-x.bottom,A=Math.max(0,t[0].data.length-c),E=e-8;o.append("rect").attr("id","scrollbarTrack").attr("x",S?n-8:x.left).attr("y",S?x.top:E).attr("width",S?8:l).attr("height",S?W:8).attr("fill","#ccc");const b=(S?W:l)*c/p.dimensionList.length,U=o.append("rect").attr("x",S?n-8:x.left).attr("y",S?x.top:E).attr("width",S?8:b).attr("height",S?b:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");U.call(v.drag().on("drag",Y=>{if(S){const I=(Za(Y.y,x.top,x.top+W-b)-x.top)/(W-b)*(A||1);g(I,A,b,U,!1),U.attr("y",x.top+(W-b)*(A===0?0:m)/(A===0?1:A))}else{const I=(Za(Y.x,x.left,x.left+l-b)-x.left)/(l-b)*(A||1);g(I,A,b,U,!1),U.attr("x",x.left+(l-b)*(A===0?0:m)/(A===0?1:A))}})),o.on("wheel",Y=>{Y.preventDefault();const I=(S?Y.deltaY:Y.deltaX)>0?1:-1;if(g(I,A,b,U,!0),S){const D=x.top+(W-b)*(A===0?0:m)/(A===0?1:A);U.attr("y",D)}else{const D=x.left+(l-b)*(A===0?0:m)/(A===0?1:A);U.attr("x",D)}})}else o.on("wheel",null);g(0,0,0,null,!0)};function ii(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{if(r.total.totalVisibility){const A=r.annotation.annotationVisibility!="5"?10:0;let E=r.total.annotationType??"1",b=[E=="1"?"connector":""],U=x.annotation(),Y=r.total.connectorType,H=r.total.totalFontStyle,I=r.total.connectorType?r.total.connectorType.toLowerCase():"None";l=[];let D=[],w=Array.from(t,([K,ye])=>({Dimension:K,Measure:ye}));r.total.totalHideZeroValues&&(w=w.filter(K=>K.Measure!==0)),w.forEach((K,ye)=>{let se={note:{label:K.Measure>=1e9&&r.total.totalNumberFormat===".2s"?Math.round(K.Measure/1e9)+"B":Xe(K.Measure,r.total.totalDisplayUnits||r.plotArea.plotAreaDisplayUnits,r.total.totalNumberFormat,r.total.totalDecimalPrecision)},data:{y:K.Measure,x:K.Dimension},dx:0,dy:0,connector:{end:I,curve:pi[r.total.connectorCurve]},disable:b,subject:{height:15,width:15},color:r.total.totalColor,type:gi(x,parseFloat(E)),height:p,width:m};D.push(se)}),U.editMode(r.total.annotationDraggable&&u).accessors({x:function(K){if(!S)return e(K.x);if(K.y>=0){const se=W?.get(K.x)??K.y;return n(se)+25}const ye=g?.get(K.x)??K.y;return n(ye)-25},y:function(K){if(S){const se=parseFloat(r.total.totalFontSize)||12;return r.annotation.annotationVisibility!=="5"?e(K.x)-se-4:e(K.x)-se/2}if(K.y>=0){const se=W?.get(K.x)??K.y;return n(se)-A-15}const ye=g?.get(K.x)??K.y;return n(ye)+A+5}}).on("dragend",function(K){z.selectAll(".connector").style("stroke",r.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[r.total.connectorStyle.toLowerCase()]),z.selectAll(`.connector-${I}`).attr("fill",r.total.connectorColor||"#ccc").style("stroke",r.total.connectorColor||"#ccc"),z.selectAll(".note-line").attr("hoverId",ye=>ye.data.currentLegend).style("stroke",r.total.connectorColor||"#ccc").attr("stroke-dasharray",Yt[r.total.connectorStyle.toLowerCase()]).filter(ye=>ye._dx==0&&ye._dy==0).remove()}).accessorsInverse({x:K=>e.invert(K.x),y:K=>n.invert(K.y)}).notePadding(0).annotations(D);let z=ql(L,r,o,H,U,I);r.animation?.animationEnabled&&z.selectAll(".annotation").each(function(K){const ye=v.select(this),te=ye.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!te)return;const xe=parseFloat(te[1]),ge=parseFloat(te[2]);if(S){const pe=n(0);ye.attr("transform",`translate(${pe},${ge})`).transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`translate(${xe},${ge})`)}else{const pe=n(0);ye.attr("transform",`translate(${xe},${pe})`).transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`translate(${xe},${ge})`)}})}}catch(A){throw A}}const ql=(t,e,n,o,x,l)=>{t.selectAll(".total-annotation-group").remove();let r=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${n.left},${n.top})`).style("fill",e.total.totalColor).style("font-family",e.total.totalFontFamily).style("font-size",e.total.totalFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(x);return r.selectAll("rect").style("visibility","hidden"),r.selectAll(".annotation-subject").remove(),r.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.total.connectorStyle.toLowerCase()]),r.selectAll(`.connector-${l}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),r.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.total.connectorStyle.toLowerCase()]).filter(c=>c._dx==0&&c._dy==0).remove(),r.selectAll(".connector-end").filter(c=>c.connector.end=="dot"&&c._dx==0&&c._dy==0).remove(),e.total.annotationType=="1"&&r.selectAll(".annotation-note-content").attr("transform",function(){const p=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(p)return`translate(${parseFloat(p[1])}, 0)`}),r.selectAll("text").append("text").style("fill",e.total.totalColor!==Ie.white?e.total.totalColor:"none"),r};function li(t,e,n){e.clear(),n&&n.length>0&&n.forEach(o=>{e.set(o,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(o=>{o.data.forEach((x,l)=>{if(e.has(x.dimension)){let r=e.get(x.dimension)||0;r+=x.value||0,e.set(x.dimension,r)}})})}function sa(t,e,n,o=!1){const x=o&&t.xAxisLabel.xAxisPosition=="1"?-1:1,l=n>0?n:0,r=parseFloat(t.plotArea.ticksHeight)||100,c=(e-l)*r/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-c*x:0}function zt(t,e,n=0){const o=parseFloat(t.plotArea.ticksWidth)||100,x=(e-n)*o/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-x:0}const ji={color:"defaultColor",name:"",type:"Line",axis:Qe.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:tt,labelColor:Ie.black,hideZeroValues:!1,markerShape:"Circle",lineStyle:"Solid",annotationPosition:1,markerColor:"defaultColor",areaBorderColor:"defaultColor",lineWidth:1.5,markerSize:1,opacity:.5,annotation:1,disableAnnotation:!0,disableAnnotationPosition:!0,connector:1,disableConnector:!0,measureUniqueId:"measureUniId",legendUniqueId:"uniqueLegendId",disableMarkerShape:!0,disableMarkerSize:!0,disableMarkerColor:!0,disableLineWidth:!0,disableLineStyle:!0,borderStyle:"Solid",borderWidth:2,borderRadius:0,borderColor:"black",labelFontSize:11,labelFontStyle:[],labelFont:tt,labelFontColor:"black",valueFontSize:11,valueFontStyle:[],valueFont:tt,valueFontColor:"black",backgroundColor:Ie.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:Ie.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var lt=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(lt||{});const Kl="11px",Ql="1.6";function vt(t,e,n){return(o,x)=>{!t.current||!e.current||e.current(n(o,x))}}function At(t,e,n){return t?.(e,n)??void 0}const xt="CommonFunctions.ts";le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.PieChart,le.PieofPie,le.DonutChart,le.PyramidChart,le.OrganizationChart,le.VennChart,le.ProgressChart,le.Maps,le.WordCloud,le.SankeyChart,le.Speedometer,le.RadialBarChart;function It(t,e,n,o,x,l,r,c,p,m,L,u,S,g){try{let W=r.legends.legendPosition,A=r.legends.legendAlignmentTopBottom,E=r.legends.legendAlignment;if(r.legends.legendVisibility)switch(W){case Je.none:break;case Je.right:let b=r.plotArea.fitChart?t-o-10:t-o-20;xa(e,c,x-(l+15),o+5,l+5,b,W,E,u,r,p,!1,g);break;case Je.top:xa(e,c,7,o,x-10,30,W,A,u,r,p,!1,g);break;case Je.left:let U=r.plotArea.fitChart?t-o-10:t-o-20;const Y=m?m+L.bottom:0;xa(e,c,7,o+5,l+5,U-Y,W,E,u,r,p,!1,g);break;case Je.bottom:xa(e,c,7,t-35,x-10,30,W,A,u,r,p,!1,g);break}}catch(W){me(xt,"drawLegends",W)}}function Ol(t,e){try{let n=0,o=t[0];return t.forEach(x=>{if(x!==void 0){let l=x.includes("~$~")?x.split("~$~")[1]:x.includes("-")?x.slice(x.indexOf("-")+1):x,r=l.length;n<r&&(n=r,o=l)}}),Pt(o,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(n){me(xt,"calculateMaxLegendWidth",n)}}function Va(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A=!1){try{const E=(I,D)=>A?[D,I]:[I,D];let b=c.plotArea.hideZeroValues;c.plotArea.plotAreaHideLineAndMarkers===void 0&&(c.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(I=>I.data.forEach(D=>{D.markerShape=[le.CombinationLine,le.CombinationArea].includes(n)&&!c.plotArea.plotAreaHideLineAndMarkers?"None":I.properties.markerShape?I.properties.markerShape:"Circle",D.currentMeasure=I.properties.currentMeasure,D.markerColor=I.properties.markerColor?I.properties.markerColor:"Blue",D.alias=I.properties.alias,D.markerSize=I.properties.markerShape!="None"&&I.properties.markerSize&&I.properties.markerShape!="None"?n==="Area"?c.plotArea.plotAreaHideLineAndMarkers?I.properties.markerSize:0:I.properties.markerSize:0}));let U=t.selectAll(".lineGroup").data(e,I=>I.legend);U.enter().append("g").attr("class","parentGroup").attr("hoverId",I=>(I.properties.alias||I.properties.name||"Legend").replace(/\s+/g,"-")).merge(U).each(function(I){let w=v.select(this).selectAll("path").data(I.data);const K=w.enter().append("path").attr("fill",ye=>ye.markerColor).merge(w).attr("d",ye=>v.symbol().type(Ji(ye.markerShape)).size(ye.markerSize*50)()).attr("visibility",ye=>{const se=!o(ye.dimension)&&o(ye.dimension)!==0,te=c.marker.markerVisibility?er(e,ye,n,b,l,u,S)?Et.hidden:[le.NormalizedStackLineChart,le.CombinationLine,le.CombinationArea].includes(n)||[le.StackAreaChart,le.AreaChart,le.CombinationStackArea].includes(n)?c.plotArea.plotAreaHideLineAndMarkers?Et.visible:Et.hidden:Et.visible:[le.CombinationLine,le.CombinationArea].includes(n)||["Area"].includes(n)&&c.plotArea.plotAreaHideLineAndMarkers?Et.visible:Et.hidden;return se?Et.hidden:te}).attr("transform",ye=>{let se=ye.axis==Qe.primary?x:l;const te=o(ye.dimension),xe=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?ye[1]>0?se(ye[1]):se(ye[0]):se(ye.value),[ge,pe]=E(te,xe);return`translate(${ge},${pe})`}).on("mousemove",function(ye,se){const te=se,xe=se,ge=v.select(this.parentNode),pe=Array.isArray(te.dimension)?te.dimension[0]:te.dimension,he=String(p.formattedDimensionListMap.get(pe)??""),O=W?.(String(pe??""),{...se,formattedDimensionValue:he})??void 0;ut([{key:c.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(c.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():c.xAxisTitle.xAxisTitleText,value:p.formattedDimensionListMap.get(Array.isArray(te.dimension)?te.dimension[0]:te.dimension)},{key:c.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(c.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():se.properties?.currentMeasure?se.properties.currentMeasure:c.yAxisTitle.yAxisTitleText||te.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(n)?te[1]-te[0]:te.value,c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormat,c.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:xe.alias.includes("~$~")?xe.alias.split("~$~")[1]:xe.alias}],c,ye,se,O),ge.selectAll(".hoverHighlight").remove();const X=o(te.dimension),M=()=>{const s=te.axis===Qe.primary?x:l;return[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?te[1]>0?s(te[1]):s(te[0]):s(te.value)},[h,k]=E(X,M());ge.insert("circle",":first-child").attr("class","hoverHighlight").attr("cx",h).attr("cy",k).attr("fill",xe.markerColor).attr("opacity",.5).attr("r",xe.markerSize*10),v.select(this).transition().duration(100).attr("transform",()=>{const s=te.axis===Qe.primary?x:l,d=o(te.dimension),i=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?te[1]>0?s(te[1]):s(te[0]):s(te.value),[y,T]=E(d,i);return`translate(${y},${T}) scale(1.3)`})}).on("mouseout",function(ye,se){const te=se,xe=v.select(this.parentNode);ot(),xe.selectAll(".hoverHighlight").remove(),v.select(this).transition().duration(100).attr("transform",()=>{const ge=te.axis===Qe.primary?x:l,pe=o(te.dimension),he=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?te[1]>0?ge(te[1]):ge(te[0]):ge(te.value),[O,X]=E(pe,he);return`translate(${O},${X}) scale(1)`})});if(c.animation.animationEnabled){const ye=c.animation.animationDuration,se=et[c.animation.animationEffect]??v.easeLinear;if([le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationArea,le.CombinationStackArea].includes(n)){const xe=[le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationStackArea];K.each(function(ge){const pe=ge.axis===Qe.primary?x:l,he=o(ge.dimension),O=xe.includes(n)?ge[1]>0?pe(ge[1]):pe(ge[0]):pe(ge.value),X=x(0),[M,h]=E(he,X),[k,s]=E(he,O);v.select(this).attr("transform",`translate(${M},${h})`).transition().duration(ye).ease(se).attr("transform",`translate(${k},${s})`)})}else{const xe=o.range(),ge=Math.min(xe[0],xe[1]),pe=Math.max(xe[0],xe[1])-ge,he=(O,X=100)=>{for(let M=0;M<=X;M++){const h=M/X;if(se(h)>=O)return h}return 1};K.attr("opacity",0).each(function(O){const X=o(O.dimension)??ge,M=pe>0?Math.max(0,Math.min(1,(X-ge)/pe)):0,h=he(M)*ye;v.select(this).transition().delay(h).duration(0).attr("opacity",1)})}}})}catch(E){me(xt,"lineMarkers",E)}}function Ji(t){return t=="Square"?v.symbolSquare:t=="Circle"?v.symbolCircle:t=="Cross"?v.symbolCross:t=="Triangle"?v.symbolTriangle:t=="Star"?v.symbolStar:t=="Diamond"?v.symbolDiamond:t=="Wye"?v.symbolWye:v.symbolCircle}const er=(t,e,n,o,x,l,r)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?o&&e.value==0||e.value>x.domain()[1]||e.value<x.domain()[0]:n.includes("Stack")?e.value>0?o&&e[1]==0||e[1]<l||e[1]>r:o&&e[0]==0||e[0]<l||e[0]>r:o&&e.value==0||e.value<l||e.value>r}catch(c){me(xt,"checkVisibleConditions",c)}};function Li(t,e,n,o,x,l,r,c,p,m=!1){try{let L=function(S){try{let g=v.pointer(S),W=1e99,A,E=null;const b=m?g[1]:g[0],U=m?g[0]:g[1];for(let H=0;H<u.length;H++){let I=Math.abs(b-l(u[H]));I<W&&(W=I,E=H)}let Y=1e99;for(let H=0;H<x.length;H++){const I=p?x[H].data[E].value>0?x[H].data[E][1]:x[H].data[E][0]:x[H].data[E].value;let D=Math.abs(U-r(I));D<Y&&(Y=D,A=H)}n.attr("transform",tr(x[A],E,l,r,p,m)).append("circle").attr("r",x[A].properties.markerSize*2.5).attr("id","tooltip").attr("fill",x[A].properties.markerColor).text(ut([{key:t.xAxisTitle.xAxisTitleText,value:x[A].data[E].dimension},{key:x[A].properties.currentMeasure?x[A].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:Xe(c===le.NormalizedStackAreaChart?A===0?x[A].data[E].value:x[A].data[E].value-x[A-1].data[E].value:x[A].data[E].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:x[A].data[E].legend.includes("~$~")?x[A].data[E].legend.split("~$~")[1]:x[A].data[E].legend}],t,void 0,x[A].properties))}catch(g){me(xt,"onHoverMarkerForAreaChartFamily.mousemove",g)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){n.style("display",null)}).on("mousemove",L).on("mouseout",function(){n.style("display","none"),ot()});let u=o}catch(L){me(xt,"onHoverMarkerForAreaChartFamily",L)}}const tr=(t,e,n,o,x,l=!1)=>{try{const r=x?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value,c=n(t.data[e].dimension),p=o(r);return l?`translate(${p},${c})`:`translate(${c},${p})`}catch(r){me(xt,"getCoordinates",r)}};function $t(t,e,n,o,x){try{const l=document.createElement("div");Object.assign(l.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(l),l.style.transform="",l.style.width="",l.style.whiteSpace="nowrap",l.style.overflowWrap="",e!=null&&(l.style.fontSize=`${e}px`),n!=null&&(l.style.fontFamily=n),x!=null,l.textContent=t;const r=l.getBoundingClientRect(),c=r.width,p=r.height;if(o&&o!==0){l.style.transform=`rotate(${o}deg)`;const m=l.getBoundingClientRect();return l.remove(),{width:c,height:p,rotatedWidth:m.width,rotatedHeight:m.height}}return l.remove(),{width:c,height:p,rotatedWidth:0,rotatedHeight:0}}catch(l){me(xt,"preCalculateTextDimensions",l)}}function Zi(t,e){try{if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(n=>{const o=t[n],x=Object.prototype.hasOwnProperty.call(e,n),l=e[n];if(!x||l===void 0){e[n]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const r=Xi(o),c=Xi(l);r&&c&&Zi(o,l)}),e}catch(n){me(xt,"addUndefinedDefaults",n)}}function Xi(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){me(xt,"isPlainObject",e)}}function Ke(t,e,n){try{let o=1,x="",l=n,r;return function(c){try{let p=c??0;if(t==="Auto")return ar(p);switch(t&&t!=="None"&&(t==="Thousands"&&(o=1e3,x="K"),t==="Millions"&&(o=1e6,x="M"),t==="Billions"&&(o=1e9,x="B"),p=p/o),e){case",.0%":return r=`.${l}%`,v.format(r)(p);case"":return r=`.${l}f`,v.format(r)(p)+x;case".2n":return r=`.${l==0?1:parseFloat(l)+1}n`,v.format(r)(p)+x;case".2$":return r=`,.${l}f`,"$"+v.format(r)(p)+x;case".2c":return r=`,.${l}f`,"C$"+v.format(r)(p)+x;case".2ē":return r=`,.${l}f`,"€"+v.format(r)(p)+x;case".2ch":return r=`,.${l}f`,"CHF"+v.format(r)(p)+x;case".2£":return r=`,.${l}f`,"£"+v.format(r)(p)+x;case".2₹":return r=`,.${l}f`,"₹"+v.format(r)(p)+x;case",":return r=`,.${l}f`,v.format(r)(p)+x;default:return r=".2f",v.format(r)(p)+x}}catch(p){me(xt,"getNumberWithFormatFunction.inner",p)}}}catch(o){me(xt,"getNumberWithFormatFunction",o)}}function ar(t){if(t==null)return"0";let e=Math.abs(t);return e>=1e9?(t/1e9).toFixed(2)+"B":e>=1e6?(t/1e6).toFixed(2)+"M":e>=1e3?(t/1e3).toFixed(2)+"K":t.toFixed(2)}function ut(t,e,n,o,x){try{const l=o?.color??o?.markerColor??"blue",r=o?.markerShape?.toLowerCase()??"circle",c=e.toolTip.toolTipTheme==="Light",p=c?"rgba(255, 255, 255)":"#272729ff",m=c?"black":Ie.white,L=c?"gray":"#d1d5db",u=(w,z=6)=>{if(!w)return"";const K=w.split(" ");let ye="";for(let se=0;se<K.length;se+=z)ye+=K.slice(se,se+z).join(" ")+"<br/>";return ye};v.selectAll(".chartTooltip").style("visibility",Et.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),g=v.select("#chartTooltipDiv").html("").append("div").attr("class",c?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",m).style("background",p).style("border",S==="1"?"1px solid #d0d0d0":"1px solid #d4d4d4").style("border-radius",S==="1"?"0":"4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",S==="1"?"none":c?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),W=n||window.event,A=W.pageX,E=W.pageY,b=t.reduce((w,z)=>{const K=(()=>{switch(r){case"circle":return"border-radius: 50%;";case"square":return"";case"triangle":return"clip-path: polygon(50% 0%, 0% 100%, 100% 100%);";case"cross":return"clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);";case"star":return"clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);";case"diamond":return"clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);";case"wye":return"clip-path: polygon(50% 0%, 60% 40%, 100% 40%, 65% 60%, 75% 100%, 50% 75%, 25% 100%, 35% 60%, 0 40%, 40% 40%);";default:return"border-radius: 50%;"}})();return w+=`
27
27
  <div style="
28
28
  display:flex;
29
29
  align-items:flex-start;
@@ -42,7 +42,7 @@ let A=t<200?200:S?e:t,R=e<200?200:S?t:e,g=A*.15*.8,B=Jl(l,n),U=g<B[0]+10?g:B[0]+
42
42
  <span style="
43
43
  width:6px;
44
44
  height:6px;
45
- background:${n};
45
+ background:${l};
46
46
  margin-top:5px;
47
47
  border-radius:50%;
48
48
  "></span>
@@ -52,7 +52,7 @@ let A=t<200?200:S?e:t,R=e<200?200:S?t:e,g=A*.15*.8,B=Jl(l,n),U=g<B[0]+10?g:B[0]+
52
52
  color:${L};
53
53
  white-space:nowrap;
54
54
  ">
55
- ${$.key||""}
55
+ ${z.key||""}
56
56
  </span>
57
57
  </div>
58
58
 
@@ -60,133 +60,133 @@ let A=t<200?200:S?e:t,R=e<200?200:S?t:e,g=A*.15*.8,B=Jl(l,n),U=g<B[0]+10?g:B[0]+
60
60
  <div style="
61
61
  font-size:11px;
62
62
  font-weight:bold;
63
- color:${f};
63
+ color:${m};
64
64
  text-align:right;
65
65
  max-width:200px;
66
66
  word-break:break-word;
67
67
  line-height:1.4;
68
68
  ">
69
- ${u(String($.value),6)}
69
+ ${u(String(z.value),6)}
70
70
  </div>
71
71
 
72
72
  </div>
73
- `,V},"");b.html(x?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${_l}; color:${f}; line-height:${jl};">${x}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${g}</div>`);const B=b.node(),U=B.offsetWidth,W=B.offsetHeight;let P=A+15,D=R+15;P+U>window.innerWidth&&(P=A-U-10),D+W>window.innerHeight&&(D=R-W-10),b.style("left",`${P}px`).style("top",`${D}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(n){console.error("Tooltip Error:",n)}}function ot(){try{v.select("#chartTooltipDiv").html("").style("visibility",It.hidden)}catch(t){Ae(ut,"hideTooltipOnMouseOut",t)}}const Zt=(t,e,r,c)=>{try{let n=v.select(t.current).append("foreignObject").attr("visibility",c.chartTitle.chartTitleVisibility?It.visible:It.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r).attr("height",e+"px");c.chartTitle.dynamicTitleText.length!==0?n.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",c.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",It.visible).style("line-height","1.3em").html(c.chartTitle.chartTitleHTML?c.chartTitle.chartTitleHTML:c.chartTitle.chartTitleText):n.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",It.visible).style("line-height","1.3em").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",c.chartTitle.chartTitleFontFamily).attr("title",c.chartTitle.chartTitleText).html(c.chartTitle.chartTitleText)}catch(x){Ae(ut,"drawChartTitle",x)}},Ji=(t,e)=>{try{return t.reduce((r,c)=>{const x=typeof c=="string"?c:e&&typeof c=="object"&&c[e]||"";return x.length>r.length?x:r},"")}catch(r){Ae(ut,"findStringWithLongestLength",r)}},ua=(t,e,r,c,x,n,l,s,p,f,L,u=!1,S)=>{try{if(f.legends.legendVisibility){let _="",A="";l==je.left||l==je.right?(A="column",_=s==Ia.top?"start":s==Ia.middle?"center":"end"):(A="row",_=s==Ea.start?"start":s==Ea.middle?"center":"end");var b=t.append("foreignObject").attr("x",r).attr("y",c).style("pointer-events","auto").attr("width",x+"px").attr("height",n+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+L).attr("class","legendsBoxWrapper").style("width",x+"px").style("display","flex").style("height",n-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+_).style("flex-direction",A).style("outline-offset","-"+f.legends.legendBorderThickness+"px").style("outline",f.legends.legendBorder?`${f.legends.legendBorderThickness+"px solid"+f.legends.legendBorderColor}`:"none").append("div").attr("class","scrollbar").style("display","flex").style("flex-direction",A).style("flex-wrap","nowrap").style("padding-left","3px");(l==je.top||l==je.bottom)&&b.style("flex-direction","row"),e.forEach((g,B)=>{let U=b.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("width","fit-content").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("dblclick",function(){S(g?.properties)}).on("mousemove",function(){if(f.legends.onHoverEffect){const V=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${V}"]`).classed("highlight",!0).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!0)}}).on("mouseout",function(){if(f.legends.onHoverEffect){const V=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${V}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(l==je.top||l==je.bottom)&&U.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let W;if(!p){let V=g.properties.type;V==se.ColumnChart||V==se.StackColumnChart?W=ct.rectangle:V==se.LineChart||V==se.StackLineChart?W=ct.line:(V==se.AreaChart||V==se.StackAreaChart)&&(W=ct.areaWithLine)}(p||W)==ct.circle?Kl(g,U):(p||W)==ct.hollowCircle?Ql(g,U):(p||W)==ct.line?Zi(g,U,f):(p||W)==ct.areaWithLine?Xi(g,U,f):(p||W)==ct.rectangle&&Ol(g,U);let P=u&&(l==je.bottom||l==je.top)&&B!=e.length-1?" |":"",D=u?f.legends.legendSelectedUnicolor:f.legends.legendColorMode==Fl.multiColor?g.properties.color?g.properties.color:Re.black:f.legends.legendSelectedUnicolor;U.append("div").style("margin-left","5px").style("color",D).style("background",g.properties.axis==Qe.secondary&&f.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(u?f.legends.legendFontSize:g.properties.fontSize)+"px").style("font-family",u?f.legends.legendFontFamily:g.properties.fontFamily).style("font-style",()=>(u?f.legends.legendFontStyle:g.properties.fontStyle).includes(oe.italic)?oe.italic:"").style("text-decoration",()=>(u?f.legends.legendFontStyle:g.properties.fontStyle).includes(oe.underline)?oe.underline:"").style("font-weight",()=>(u?f.legends.legendFontStyle:g.properties.fontStyle).includes(oe.bold)?oe.bold:"").style("white-space","nowrap").attr("title",u?g.legendDisplay+" : "+g.actualValue:g.properties.alias).html(u?g.legendDisplay+" : "+g.actualValue+P:g.properties.alias)})}}catch(_){Ae(ut,"legendsWithScroll",_)}};function Kl(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(r){Ae(ut,"getCircleShape",r)}}function Ql(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("border",`3px solid ${t.properties.Color??t.properties.color}`)}catch(r){Ae(ut,"getHollowCircleShape",r)}}function Zi(t,e,r){try{const c=t.properties?.lineStyle?.toLowerCase()||"solid";let x=e.append("div").style("height","2px").style("width",c=="dashed"?"25px":"20px").style("background",Re.transparent).style("position","relative").style("border-top",c=="none"?"unset":c=="dotted"?"2px dotted "+t.properties.color:c=="dashed"?"2px dashed "+t.properties.color:"2px solid "+t.properties.color);if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":x.append("div").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-6)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","4.5").style("fill",t.properties.markerColor);break;case"square":x.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-2px, -7px)").style("height","8px").style("width","8px").style("top","2px").style("left","9px").style("background",t.properties.markerColor);break;case"triangle":x.append("div").style("position","absolute").style("transform","translate(5px, -6.5px)").style("border-left","6px solid transparent").style("border-right","6px solid transparent").style("border-bottom",`10px solid ${t.properties.markerColor}`);break;case"cross":x.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-5px, -3px)").style("height","4px").style("width","10px").style("background",t.properties.markerColor).append("div").style("height","10px").style("width","4px").style("background",t.properties.markerColor).style("position","relative").style("top","-3px").style("left","3px");break;case"diamond":x.append("div").style("height","7px").style("width","7px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-4px").style("left","7px").style("position","absolute");break;case"star":x.append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-bottom",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-6.5px").style("left","7px").style("transform","rotate(0deg)").append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-top",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","2px").style("left","-4px").style("transform","rotate(360deg)");break;case"wye":x.append("div").style("height","6.5px").style("width","3px").style("background",t.properties.markerColor).style("position","absolute").style("left","10px").style("top","-3.5px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":default:break}}catch(c){Ae(ut,"getLineShape",c)}}function Xi(t,e,r){try{let c=e.append("div").style("height","10px").style("width","15px").style("background",t.properties.color).style("display","flex").style("flex-direction","column").style("border-radius","1px");if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.color).style("position","relative").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-5)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","2.5").style("fill",t.properties.markerColor);break;case"square":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-4px, -3.5px)").style("height","5px").style("width","5px").style("top","2px").style("left","9px").style("background",t.properties.markerColor).style("border-radius","1px");break;case"triangle":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("transform","translate(5px, -3.5px)").style("border-left","3px solid transparent").style("border-right","3px solid transparent").style("border-bottom",`7px solid ${t.properties.markerColor}`);break;case"cross":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-3px, -2px)").style("height","4px").style("width","7px").style("background",t.properties.markerColor).append("div").style("height","6px").style("width","3px").style("background",t.properties.markerColor).style("position","relative").style("top","-1px").style("left","2px");break;case"diamond":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4px").style("width","4px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-1px").style("left","5px").style("position","absolute");break;case"star":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-bottom",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-3px").style("left","6px").style("transform","rotate(0deg)").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-top",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","0.5px").style("left","-2px").style("transform","rotate(360deg)");break;case"wye":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4.5px").style("width","2px").style("background",t.properties.markerColor).style("position","absolute").style("left","6.5px").style("top","-0.5px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor);break;default:break}c.append("div").style("height","20%").style("width","100%").style("background","white"),c.append("div").style("height","60%").style("width","100%").style("background",t.properties.color).style("border-radius","1px")}catch(c){Ae(ut,"getAreaShape",c)}}function Ol(t,e){try{e.append("div").style("height","10px").style("width","15px").style("border-style",t).style("border-width",t).style("border-color",t).style("background",t.properties.color).style("border-radius","1px")}catch(r){Ae(ut,"getReactShape",r)}}const Xt=(t,e,r,c)=>{try{let x=t.current;x.setAttribute("viewBox",`0 0 ${e} ${r}`);const{chartAreaColor:n,chartAreaBorder:l}=c.chartArea;if(x.style.backgroundColor=n,l){let p=c.chartArea.chartAreaBorderColor,f=c.chartArea.chartAreaBorderThickness+"px",L=rt(c.chartArea.chartAreaBorderStyle),u=L==1?"solid":L==2?"dashed":"dotted";x.style.outline=`${f} ${u} ${p}`,x.style.outlineOffset=`-${f}`}else x.style.outline="unset"}catch(x){Ae(ut,"initSvg",x)}},oa=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){Ae(ut,"initChartArea",r)}},qt=(t,e)=>{try{let r=v.select(t.current);r.selectAll("*").remove();let c=_i(Pi,e),x=t.current.getBoundingClientRect(),n=x.width,l=x.height;return{chartFormatOptions:c,svg:r,width:n,height:l}}catch(r){Ae(ut,"firstFunctionBeforeRender",r)}},$a=(t,e,r,c,x,n=!1)=>{try{let l=t.legends.legendPosition;l=t.legends.legendVisibility?t.legends.legendPosition:je.none;let s=e*.15*.8,p=n?c[0]:s<c[0]+15?s:c[0]+15,f=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?zt(t.chartTitle.chartTitleHTML,void 0,void 0).height:zt(t.chartTitle.chartTitleText,16,tt).height:5;switch(l){case je.none:x.top=f+10,x.bottom=15,x.right=15,x.left=15;break;case je.top:x.top=f+50,x.bottom=15,x.right=15,x.left=15;break;case je.right:x.right=p+50,x.top=f+15,x.bottom=15,x.left=15;break;case je.bottom:x.bottom=45,x.top=f+15,x.right=15,x.left=15;break;case je.left:x.left=p+50,x.top=f+15,x.bottom=15,x.right=15}let L=r-x.top-x.bottom,u=e-x.left-x.right;return{margins:x,innerHeight:L,innerWidth:u,legendListWidth:p,chartTitleHeight:f}}catch(l){Ae(ut,"marginCalculationsForChartsWithoutAxis",l)}},Ya=(t,e,r,c,x,n,l,s,p,f,L=!0,u)=>{try{let S=t.legends.legendPosition,b=t.total.totalPosition,_=t.total.totalAlignment,A=t.total.totalVisibility&&L,R=t.legends.legendAlignmentTopBottom,g=t.legends.legendAlignment;switch(S){case je.none:break;case je.right:ua(e,r,c-n-25,l+5+(A&&b==Fa.top&&_==Bt.end?10:0),n+15,x-l-10-(A?b==Fa.top&&_==Bt.end?10:b==Fa.bottom&&_==Bt.start?25:0:0),S,g,f,t,s,!1,u);break;case je.top:ua(e,r,5,l+5,c-10,30,S,R,f,t,s,!1,u);break;case je.left:ua(e,r,5,p.top+(A&&b==Fa.top&&_==Bt.start?10:0),n+15,x-l-10-(A?b==Fa.top&&_==Bt.start?10:b==Fa.bottom&&_==Bt.start?25:0:0),S,g,f,t,s,!1,u);break;case je.bottom:ua(e,r,5,x-35,c-10,30,S,R,f,t,s,!1,u);break}}catch(S){Ae(ut,"initLegendListWithTotalValueAllowance",S)}},Ua=(t,e,r="legend")=>{try{let c=zt(Ji(e,r),rt(t.legends.legendFontSize),t.legends.legendFontFamily);return[c.width,c.height]}catch(c){Ae(ut,"calculateLegendsMaxPossibleWidth",c)}},ii=(t,e,r,c=!1)=>{try{let x=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?zt(t.chartTitle.chartTitleHTML,void 0,void 0).height:zt(t.chartTitle.chartTitleText,16,tt).height:5,n={top:t.chartTitle.chartTitleVisibility?x:20,bottom:c&&t.colorScale.showColor==Ta.colorTheme?40:20,left:20,right:20};return innerHeight=e-n.top-n.bottom,innerWidth=r-n.left-n.right,{margins:n,chartTitleHeight:x,innerHeight,innerWidth}}catch(x){Ae(ut,"marginCalculationsForChartsWithoutLegends",x)}},rt=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const r=parseFloat(e);return isNaN(r)?t:r}catch(e){Ae(ut,"convertStringToNumber",e)}};function Lt(t,e,r=!1){try{return t.map(c=>{let x;c.properties?x={...Hi,...c.properties}:x={...Hi,legend:c.legend,currentLegend:c.legend,alias:c.legend,name:c.legend};const n=e&&e.length!==0?e.map(l=>{const s=c.data.find(p=>p.dimension===l);return s?{...s}:{dimension:l,legend:c.legend,value:0}}):c.data.map(l=>({...l}));return{...c,properties:x,data:r?c.data:n}})}catch(c){Ae(ut,"generalizedChartData",c)}}const gi=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){Ae(ut,"getJQuerySelector",e)}},Ai=(t,e,r,c,x,n,l)=>{try{let s=t-e,p=n-x,f=parseInt(l.connector.connectorKPI),L,u;switch(f){case 1:if(L=`.${r}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return v.format(L)(t);s=Math.abs(s);break;case 3:return L=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(s=Math.round(t/e*100-100)/100,u=v.format(L)(s),u);case 2:return x.toString().length!==4&&(p=NaN),L=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(s=Math.pow(t/e,1/p)-1,u=v.format(L)(s),u)}if(e==0)return"N/A";{let S,b="",_=l.connector.connectorDisplayUnits;switch(_!="None"&&_!=null&&(_=="Thousands"&&(S=1e3,b="K"),_=="Millions"&&(S=1e6,b="M"),_=="Billions"&&(S=1e9,b="B"),s=s/S),isNaN(s)&&(s=0),c){case",.0%":return L=`.${r}%`,v.format(L)(s);case"":return L=`.${r}f`,v.format(L)(s)+b;case".2n":return L=`.${r}n`,v.format(L)(s)+b;case".2$":return L=`,.${r}f`,"$"+v.format(L)(s)+b;case".2c":return L=`,.${r}f`,"C$"+v.format(L)(s)+b;case".2ē":return L=`,.${r}f`,"€"+v.format(L)(s)+b;case".2ch":return L=`,.${r}f`,"CHF"+v.format(L)(s)+b;case",":return L=`,.${r}f`,v.format(L)(s)+b;case".2£":return L=`,.${r}f`,"£"+v.format(L)(s)+b;case".2₹":return L=`,.${r}f`,"₹"+v.format(L)(s)+b;default:return L=".2f",v.format(L)(s)+b}}}catch{}},Ja=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function er(t,e,r){try{let c=function(n){const l=n.split(" - ");return l.length>1?l[0]:n};const x=new Map;return e?.LegendList?.forEach(n=>{x.set(r?c(n?.name):n.measureUniqueId,n)}),t.map(n=>({...n,properties:x.get(r?c(n.legend):n.properties.measureUniqueId)??n.properties})).filter(n=>n.data[0].value!==0)}catch{return t}}const tr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID();let L=0,u=!1;const S=se.ColumnChart,b=Me.useRef(),_=Me.useRef(l);_.current=l;const A=Me.useRef(s);A.current=s;const R=Me.useRef(p);R.current=p;const g=Lt(r.ChartData,r.DimensionList),B=r.DimensionList,U=!1;let W=!1;const P=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,Z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe=[],$e=0,Ue=0;const Ye=new Map;let Pe={dimensionList:B,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{Ee()}catch(H){Ae("Columnchart","createColumnChart",H)}},[e]);const Ee=()=>{({formatOptions:e,svg:m,width:i,height:y}=St(b,e)),{formatOptions:e}=ta(e,g,r.DataTableData??[]),we(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:V,secondaryCustomYaxisMaxValue:Z}=Et(e,Pe.yMinLeft,Pe.yMaxLeft,Pe.yMinRight,Pe.yMaxRight),{margin:ce,yLabel:ne,xLabel:ae,yTitle:ue,xTitle:ge,dimensionHeightWidthArray:be,chartTitleHeight:pe,secondaryAxisTitleWidth:Q,legendMargin:G,secondaryYLabel:M,visibleBars:Ue,columnWidth:L,scrollbarVisible:u}=Ct(i,y,h,k,Pe.yMaxLeft,e,Pe.legendList,Pe.dimensionList,Pe.yMaxRight,W,P,t,!1,Pe),te(ce),{dataTable:T,dataTableHeight:a}=aa(e,ne,ue,g,Pe.dimensionList,r),Mt(m,i,y,e),N=Ft(m,ce),vt(N,e,a,o,d,S,f),Ce(),F(),Jt(N,e,a,ne,Se,d),W&&hi(N,e,a,M,De,d,o),wt(e,U,m,ce,ae,y,ge,Pe.chartType,ne,o,d),Dt(d,e,a,U,m,ce,ue,ne),Ht(m,W,ce,e,a,d,o,M,Q),Vt(m,e,i,pe),Pt(y,m,be,pe,i,G,e,g,f,a,ce,ct.rectangle,S,n),Gt(g,y,i,m,ce,o,u,Ue,Pe,$e,!1,O)},we=()=>{const H=[],E=[];let Y=[],ee=-1/0,z=1/0,I=-1/0,w=1/0,C=1/0,q=-1/0;g.forEach(J=>{E.push(J.properties.legendUniqueId),q=-1/0,C=1/0,J.data.forEach(j=>{H.push(j),J.properties.axis==="Secondary"?(W=!0,I=Math.max(I,j.value),w=Math.min(w,j.value)):(ee=Math.max(ee,j.value),z=Math.min(z,j.value)),q=Math.max(q,j.value),C=Math.min(C,j.value)}),J.properties.setColorScale&&Ye.set(J.properties.legendUniqueId,v.scaleSequential().domain([C,q]).interpolator(oi.interpolateRgb(J.properties.startColor,J.properties.endColor)))}),Pe.chartData=H,Pe.legendList=E,Pe.yMaxLeft=ee,Pe.yMinLeft=z>0?0:z,Pe.yMaxRight=I,Pe.yMinRight=w>0?0:w,Y=t?ft(e.xAxisLabel.xAxisNumberFormat,Pe.dimensionList).map(J=>J):Pe.dimensionList,Pe.dimensionList.forEach((J,j)=>{Pe.formattedDimensionListMap.set(J,Y[j])}),fe=JSON.parse(JSON.stringify(g)),ye=Pe.dimensionList,e.plotArea.hideZeroValues&&(Pe.hideZeroValues=!0)},Ce=()=>{let H=dt(V||Pe.yMaxLeft,Pe.yMinLeft,d,e,Pe,D,V).yAxisLabelArray;if(Pe.yMaxLeft=H[H.length-1],Pe.yMinLeft=H[0],re=v.scaleLinear().domain([Pe.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:Pe.yMinLeft<0?Pe.yMinLeft*1.1:Pe.yMinLeft*.9,Pe.yMaxLeft<=0?0:V!==void 0&&!Number.isNaN(V)?V:Pe.yMaxLeft*1.1]).range([a>0?d-a:d,0]),W){let E=dt(Z||Pe.yMaxRight,Pe.yMinRight,d,e,Pe,$,Z).yAxisLabelArray;Pe.yMaxRight=E[E.length-1],Pe.yMinRight=E[0],K=v.scaleLinear().domain([Pe.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:Pe.yMinRight*1.1,Pe.yMaxRight<=0?Z||0:Z||Pe.yMaxRight*1.1]).range([a>0?d-a:d,0])}ze=[0,o],ve()},ve=()=>{Le=v.scaleBand().domain(Pe.legendList).range([0,L]).paddingInner(Pe.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),me=v.scalePoint().domain(ye).range(ze).padding(.5)},F=()=>{{let H=dt(V||Pe.yMaxLeft,Pe.yMinLeft,d,e,Pe,D,V);Se=v.axisLeft(re).tickFormat(E=>Ze(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,o)).tickValues(H.autoLabelFlag?void 0:H.yAxisLabelArray).ticks(H.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(W){let H=dt(Z||Pe.yMaxRight,$||Pe.yMinRight,d,e,Pe,$,Z);De=v.axisRight(K).tickFormat(E=>Ze(E,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(H.autoLabelFlag?void 0:H.yAxisLabelArray).ticks(H.customTickValue??d/30).tickSize(Rt(e,o)).tickPadding(8).tickSizeOuter(0)}},le=()=>{ie=(parseInt(e.xAxisLabel.xAxisPosition)==1?v.axisTop(me):v.axisBottom(me)).tickSize(sa(e,d,a)).tickSizeOuter(0).tickValues(bt(ye,o))},he=H=>{H.forEach(E=>{E.data.forEach(Y=>{Y.hideZero=E.properties.hideZeroValues,Y.axis=E.properties.axis,Y.legendUniqueId=E.properties.legendUniqueId})}),ye.forEach(E=>{N.append("rect").attr("id",`dim-background-${E}`).attr("class","dimension-background").attr("x",me(E)-me.step()/2).attr("width",me.step()).attr("y",0).attr("height",d).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),H.forEach(E=>{let Y=N.selectAll(".parentGroup").data([E],C=>C.properties.legendUniqueId);Y=Y.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Y);let ee=Y.selectAll(".column-group").data(E.data,C=>C.legend+C.dimension),z=ee.enter().append("g").attr("class","column-group").attr("hoverId",(E.properties.alias||E.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",C=>`translate(${me(C.dimension)-L/2}, 0)`);ee.attr("transform",C=>`translate(${me(C.dimension)-L/2}, 0)`),z.merge(ee).attr("transform",C=>`translate(${me(C.dimension)-L/2}, 0)`);const I=z.append("rect").attr("x",C=>Le(C.legendUniqueId)).attr("width",Le.bandwidth()).attr("y",C=>(E.properties.axis===Qe.primary?re:K)(0)).attr("height",0).attr("fill",C=>Ye.get(E.properties.legendUniqueId)?.(C.value)??E.properties.color).attr("stroke-dasharray",C=>E.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",C=>`${E.properties.stackBorderWidth}px`).attr("stroke",C=>E.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?E.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",C=>C.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>E.properties.legendUniqueId).attr(lt.DimValue,C=>Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension));(e.animation.animationEnabled?I.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):I).attr("y",C=>{const q=E.properties.axis===Qe.primary?re:K;return C.value>0?q(C.value):q(0)}).attr("height",C=>{const q=E.properties.axis===Qe.primary?re:K;return Math.abs(q(C.value)-q(0))}),z.merge(ee).on("mousemove",(C,q)=>{(E.properties.alias||E.properties.name||"Legend").replace(/ /g,"-");const J=Array.isArray(q.dimension)?q.dimension[0]:q.dimension,j=String(Pe.formattedDimensionListMap.get(J)??J??""),Te=gt(_.current,String(J??""),{...E.properties,formattedDimensionValue:j});yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:j},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():q.properties?.currentMeasure?q.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||q.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(S)?q[1]-q[0]:q.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:E.properties.alias}],e,C,E.properties,Te)}).on("mouseout",(C,q)=>{(E.properties.alias||E.properties.name||"Legend").replace(/ /g,"-"),ot()}),z.merge(ee).on("click",Tt(R,A,(C,q)=>({seriesId:E.properties.legendUniqueId,dimValue:Array.isArray(q.dimension)?String(q.dimension[0]):String(q.dimension),legendUniqueId:E.properties.legendUniqueId,seriesDisplayName:E.properties.alias||E.properties.name||""}))),ee.exit().remove()}),N.selectAll(".parentGroup").raise()},te=H=>{o=i-H.left-H.right,d=y-H.bottom-H.top},O=(H,E,Y)=>{fe=E,ye=H,Ue=Y,X()},X=()=>{ve(),le(),Ot(N,Pe,ae,e,a,re,ie,be,y,L,t,o,d,ye,me),he(fe),Ra(g,me,re,K,ce,xt,[],[],e,S,y,i,o,ye,d,f,m,x,Le,L,c),ia(e.plotArea.fitChart,m,N,T,L,re,me,Le,void 0,void 0,a,S,e,ne,ue,Pe.dimensionList,o,ze,Pe.formattedDimensionListMap,f,ce,d)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:b,id:f,style:{width:"100%",height:"100%"}})})},ar=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0,u=!1,S=[];const b=se.CustomColumnChart,_=Me.useRef(),A=Me.useRef(l);A.current=l;const R=Me.useRef(s);R.current=s;const g=Lt(r.ChartData,r.DimensionList),B=r.DimensionList,U=!!e.swapAxis?.swapAxisEnabled;let W=!1;const P=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,Z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se=[],ie=[],De=[],ye=[],fe=[],$e=[],Ue=[],Ye=[],Pe,Ee,we,Ce=new Map,ve,F,le,he,te,O,X,H=[],E=[],Y=0,ee,z={dimensionList:B,chartType:b,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{I()}catch(We){Ae("CustomColumnchart","createCustomColumnChart",We)}},[e]);const I=()=>{({formatOptions:e,svg:m,width:i,height:y}=St(_,e)),w(),{formatOptions:e}=ta(e,g,r.DataTableData??[]),Fi(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:V,secondaryCustomYaxisMaxValue:Z}=Et(e,z.yMinLeft,z.yMaxLeft,z.yMinRight,z.yMaxRight),{margin:ce,yLabel:ne,xLabel:ae,yTitle:ue,xTitle:ge,dimensionHeightWidthArray:be,chartTitleHeight:pe,secondaryAxisTitleWidth:Q,legendMargin:G,secondaryYLabel:M,visibleBars:ee,columnWidth:L,scrollbarVisible:u}=Ct(i,y,h,k,z.yMaxLeft,e,z.legendList,z.dimensionList,z.yMaxRight,W,P,t,U,z),at(ce),{dataTable:T,dataTableHeight:a}=aa(e,ne,ue,g,z.dimensionList,r),U&&(T=[],a=0),Mt(m,i,y,e),N=Ft(m,ce),vt(N,e,a,o,d,b,f),q(),j(),U?(ra(e,N,ne,d,o,he),W&&pi(e,N,M,te,o)):(Jt(N,e,a,ne,Pe,d),W&&hi(N,e,a,M,we,d,o)),wt(e,U,m,ce,ae,y,ge,z.chartType,ne,o,d),Dt(d,e,a,U,m,ce,ue,ne,o),Ht(m,W,ce,e,a,d,o,M,Q,U),Vt(m,e,i,pe),Pt(y,m,be,pe,i,G,e,g,f,a,ce,null,b,n),Gt(g,y,i,m,ce,o,u,ee,z,Y,!1,it,U)},w=()=>{const We=[];let Xe=[],st=-1/0,Ke=1/0,Oe=-1/0,_e=1/0,Ie=[];g.forEach((Ne,He)=>{[se.StackColumnChart,se.StackAreaChart].includes(Ne.properties.type)?se.StackColumnChart===Ne.properties.type&&(We.includes(se.StackColumnChart)||We.push(se.StackColumnChart)):(Ie.push(Ne),Ne.properties.type!==se.LineChart&&Ne.properties.type!==se.AreaChart&&We.push(Ne.properties.legendUniqueId)),Ne.properties.axis==="Secondary"&&(ie.push(Ne),Ne.properties.type==se.StackColumnChart&&$e.push(Ne),Ne.properties.type==se.StackAreaChart&&fe.push(Ne)),Ne.properties.axis===Qe.primary&&(Se.push(Ne),Ne.properties.type==se.StackColumnChart&&ye.push(Ne),Ne.properties.type==se.StackAreaChart&&De.push(Ne)),Ne.data=Ne.data.map(ht=>{const nt={...ht,type:Ne.properties.type,axis:Ne.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ne.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ne.properties.labelColor,legendUniqueId:Ne.properties.legendUniqueId};return nt.axis==="Secondary"?(W=!0,Oe=Math.max(Oe,nt.value),_e=Math.min(_e,nt.value)):(st=Math.max(st,nt.value),Ke=Math.min(Ke,nt.value)),nt})}),H=JSON.parse(JSON.stringify(g)),z.chartData=Ie,z.legendList=We,z.yMaxLeft=st,z.yMinLeft=Ke>0?0:Ke,z.yMaxRight=Oe,z.yMinRight=_e>0?0:_e,Xe=t?ft(e.xAxisLabel.xAxisNumberFormat,z.dimensionList).map(Ne=>Ne):z.dimensionList,z.dimensionList.forEach((Ne,He)=>{z.formattedDimensionListMap.set(Ne,Xe[He])}),e.plotArea.fitChart?X=z.dimensionList:X=z.dimensionList.slice(Y,Y+ee),e.plotArea.hideZeroValues&&(z.hideZeroValues=!0),C(De,ye,fe,$e,g)},C=(We,Xe,st,Ke,Oe)=>{const _e=At(X,We,!1),Ie=At(X,st,!1),Ne=At(X,Xe,!1),He=At(X,Ke,!1);E=[];const ht=[];if(We.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:_e,data:We})}),st.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:Ie,data:st})}),Xe.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:Ne,data:Xe})}),Ke.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:He,data:Ke})}),ht.push(...z.chartData),Oe.length){const nt=[];Oe.forEach(mi=>{nt.push(...ht.filter(pl=>pl.properties?.type===mi.properties.type&&pl.properties.legend===mi.legend))}),E.push(...nt)}else E.push(...ht)},q=()=>{const We=U?[0,a>0?o-a:o]:[a>0?d-a:d,0];{const Xe=v.scaleLinear().domain([z.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:z.yMinLeft<0?z.yMinLeft*1.1:z.yMinLeft*.9,z.yMaxLeft<=0?0:V!==void 0&&!Number.isNaN(V)?V:z.yMaxLeft*1.1]).range(We);U?F=Xe:re=Xe}if(W){const Xe=v.scaleLinear().domain([z.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:z.yMinRight*1.1,z.yMaxRight<=0?(Z||Z==0)&&!Number.isNaN(Z)?Z:0:(Z||Z==0)&&!Number.isNaN(Z)?Z:z.yMaxRight*1.1]).range(We);U?le=Xe:K=Xe}ze=U?[d,0]:[0,o]},J=()=>{Le=v.scaleBand().domain(z.legendList).range([0,L]).paddingInner(z.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0);const We=v.scalePoint().domain(X).range(ze).padding(.5);U?ve=We:me=We},j=()=>{{let We=dt(V||z.yMaxLeft,z.yMinLeft,d,e,z,D,V,U,o);U?he=v.axisBottom(F).tickFormat(Xe=>Ze(Xe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??o/50).tickPadding(8).tickSizeOuter(0):Pe=v.axisLeft(re).tickFormat(Xe=>Ze(Xe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,o)).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(W){let We=dt(V||z.yMaxRight,z.yMinRight,d,e,z,D,V);U?te=v.axisTop(le).tickFormat(Xe=>Ze(Xe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??o/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0):we=v.axisRight(K).tickFormat(Xe=>Ze(Xe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??d/30).tickSize(Rt(e,o)).tickPadding(8).tickSizeOuter(0)}},Te=()=>{U?O=v.axisLeft(ve).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*o*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(X,d)):Ee=v.axisBottom(me).tickSize(sa(e,d,a,!0)).tickSizeOuter(0).tickValues(bt(X,o))},xe=We=>{We.forEach(Ke=>{switch(Ke.properties.type){default:case se.ColumnChart:de(Ke);break;case se.LineChart:break;case se.AreaChart:break;case se.StackColumnChart:Ue=Pa(Ke),Be();break;case se.StackAreaChart:Ye=Pa(Ke),ke(Ke);break}});const Xe=H.filter(Ke=>Ke.properties.type===se.LineChart);Xe.length&&Fe(Xe);const st=H.filter(Ke=>Ke.properties.type===se.AreaChart);st.length&&Ve(st),N.selectAll(".parentGroup").raise()},de=We=>{let Xe=N.selectAll(".parentGroup").data([We],Ie=>Ie.properties?.legendUniqueId);Xe=Xe.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Xe);let st=Xe.selectAll(".column-group").data(We.data,Ie=>Ie.legendUniqueId),Ke=st.enter().append("g").attr("class","column-group").attr("hoverId",Ie=>(We.properties.alias||We.properties.name).includes("-")?(We.properties.alias||We.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(We.properties.alias||We.properties.name).replace(/ /g,"-")).attr("transform",Ie=>U?`translate(0, ${ve(Ie.dimension)})`:`translate(${me(Ie.dimension)}, 0)`);Ke.merge(st).attr("transform",Ie=>U?`translate(0, ${ve(Ie.dimension)-L/2})`:`translate(${me(Ie.dimension)-L/2}, 0)`);const Oe=(U?Ke.append("rect").attr("y",Ie=>Le(Ie.legendUniqueId)).attr("height",Le.bandwidth()).attr("x",()=>(We.properties.axis===Qe.primary?F:le)(0)).attr("width",0):Ke.append("rect").attr("x",Ie=>Le(Ie.legendUniqueId)).attr("width",Le.bandwidth()).attr("y",()=>(We.properties.axis===Qe.primary?re:K)(0)).attr("height",0)).attr("fill",We.properties.color).attr("stroke-dasharray",Ie=>We.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ie=>`${We.properties.stackBorderWidth}px`).attr("stroke",Ie=>We.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?We.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",Ie=>Ie.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>We.properties.legendUniqueId).attr(lt.DimValue,Ie=>Array.isArray(Ie.dimension)?String(Ie.dimension[0]):String(Ie.dimension)).on("mousemove",(Ie,Ne)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:z.formattedDimensionListMap.get(Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(b)?Ne[1]-Ne[0]:Ne.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.legend.includes("~$~")?Ne.legend.split("~$~")[1]:Ne.legend}],e,Ie,g.filter(He=>He.legend===Ne.legend)[0].properties,(()=>{const He=Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension,ht=g.filter(nt=>nt.legend===Ne.legend)[0].properties;return gt(p,String(He??""),{...ht,formattedDimensionValue:String(z.formattedDimensionListMap.get(He)??He??"")})})())}).on("mouseout",ot).on("click",Tt(R,A,(Ie,Ne)=>({seriesId:We.properties.legendUniqueId,dimValue:Array.isArray(Ne.dimension)?String(Ne.dimension[0]):String(Ne.dimension),legendUniqueId:We.properties.legendUniqueId,seriesDisplayName:We.properties.alias||We.properties.name||""}))),_e=e.animation.animationEnabled?Oe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Oe;U?_e.attr("x",Ie=>{const Ne=We.properties.axis===Qe.primary?F:le;return Ie.value>0?Ne(0):Ne(Ie.value)}).attr("width",Ie=>{const Ne=We.properties.axis===Qe.primary?F:le;return Math.abs(Ne(Ie.value)-Ne(0))}):_e.attr("y",Ie=>{const Ne=We.properties.axis===Qe.primary?re:K;return Ie.value>0?Ne(Ie.value):Ne(0)}).attr("height",Ie=>{const Ne=We.properties.axis===Qe.primary?re:K;return Math.abs(Ne(Ie.value)-Ne(0))}),st.exit().remove()},Fe=We=>{We.forEach(_e=>{_e.data.forEach(Ie=>{Ie.hideZero=_e.properties.hideZeroValues,Ie.axis=_e.properties.axis,Ie.legendUniqueId=_e.properties.legendUniqueId})});const Xe=U?v.line().y(_e=>{const Ie=ve(_e.dimension);return Ie??0}).x(_e=>_e.axis==Qe.primary?F(_e.value):le(_e.value)).defined(_e=>e?.plotArea?.hideZeroValues?!!_e.value:!0).curve(mt(e)):v.line().x(_e=>me(_e.dimension)?me(_e.dimension):null).y(_e=>_e.axis==Qe.primary?re(_e.value):K(_e.value)).defined(_e=>e?.plotArea?.hideZeroValues?!!_e.value:!0).curve(mt(e));let st=N.selectAll(".lines.parentGroup").data([1]);st=st.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(st);let Ke=st.selectAll(".line-group").data(We,_e=>_e.properties.legendUniqueId),Oe=Ke.enter().append("g").attr("class","line-group");Oe.attr("hoverId",_e=>(_e.properties.alias||_e.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),Oe.merge(Ke).select("path").attr("d",_e=>Xe(_e.data)).attr("stroke",_e=>_e.properties.color!==Re.white?_e.properties.color:"none").attr("stroke-dasharray",_e=>{switch(_e.properties.lineStyle){case pt.dotted:return"0,3";case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",_e=>_e.properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",_e=>_e.properties.lineStyle!=="None"?_e.properties.lineWidth:"0"),e.animation.animationEnabled&&Oe.merge(Ke).select("path").each(function(){const _e=v.select(this),Ie=this.getTotalLength();_e.attr("stroke-dasharray",Ie+" "+Ie).attr("stroke-dashoffset",Ie),_e.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),Ke.exit().remove(),Da(st,We,se.CombinationLine,U?ve:me,U?F:re,U?le:K,null,e,z,Z,$,D,V,!1,p,U)},Ve=We=>{We.forEach(He=>{He.data.forEach(ht=>{ht.hideZero=He.properties.hideZeroValues,ht.axis=He.properties.axis,ht.legendUniqueId=He.properties.legendUniqueId})});const Xe=U?v.area().y(He=>{const ht=ve(He.dimension);return ht??0}).x0(()=>F(0)).x1(He=>F(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)):v.area().x(He=>me(He.dimension)?me(He.dimension):null).y0(()=>re(0)).y1(He=>re(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)),st=U?v.area().y(He=>{const ht=ve(He.dimension);return ht??0}).x0(()=>F(0)).x1(()=>F(0)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)):v.area().x(He=>me(He.dimension)?me(He.dimension):null).y0(()=>re(0)).y1(()=>re(0)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)),Ke=e.animation.animationEnabled;let Oe=N.selectAll(".areas.parentGroup").data([1]),_e=N.append("g").attr("class","focusClass");Oe=Oe.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Oe);let Ie=Oe.selectAll(".area-group").data(We,He=>He.legend),Ne=Ie.enter().append("g").attr("class","area-group");Ne.append("path").attr("hoverId",He=>(He.properties.alias||He.properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",He=>He.properties.color!==Re.white?He.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",He=>Ke?st(He.data):Xe(He.data)).each(function(He){Ke&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",Xe(He.data))}),Ie.select("path").attr("d",He=>Xe(He.data)),Ne.merge(Ie).select("path").attr("stroke",He=>He.properties.areaBorderColor!==Re.white?He.properties.areaBorderColor:"none").attr("stroke-dasharray",He=>{switch(He.properties.lineStyle){case"dotted":return"0,3";case"dashed":return fa;default:return""}}).attr("stroke-linecap",He=>He.properties.lineStyle==="dotted"?ya.round:"").attr("stroke-width",He=>He.properties.lineStyle!=="None"&&e.plotArea.plotAreaHideLineAndMarkers?He.properties.lineWidth:"0"),bi(e,Oe,_e,X,We,U?ve:me,U?F:re,b,!1,U),Ie.exit().remove(),Da(Oe,We,se.CombinationArea,U?ve:me,U?F:re,U?le:K,null,e,z,Z,$,D,V,!1,void 0,U)},ke=We=>{We.data.forEach(Ne=>{Ne.data.forEach(He=>{He.hideZero=Ne.properties.hideZeroValues,He.axis=Ne.properties.axis,He.legendUniqueId=Ne.properties.legendUniqueId})});const Xe=U?v.area().y(Ne=>{const He=ve(Ne.data.dimension);return He??0}).x0(Ne=>Ne.data.axis===Qe.primary?F(Ne[0]):le(Ne[0])).x1(Ne=>Ne.data.axis===Qe.primary?F(Ne[1]):le(Ne[1])).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)):v.area().x(Ne=>me(Ne.data.dimension)?me(Ne.data.dimension):null).y0(Ne=>Ne.data.axis===Qe.primary?re(Ne[0]):K(Ne[0])).y1(Ne=>Ne.data.axis===Qe.primary?re(Ne[1]):K(Ne[1])).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)),st=U?v.area().y(Ne=>{const He=ve(Ne.data.dimension);return He??0}).x0(()=>F(0)).x1(()=>F(0)).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)):v.area().x(Ne=>me(Ne.data.dimension)?me(Ne.data.dimension):null).y0(()=>re(0)).y1(()=>re(0)).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)),Ke=e.animation.animationEnabled;let Oe=N.selectAll(".parentGroup").data([Ye]);N.append("g").attr("class","focusClass"),Oe=Oe.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Oe);let _e=Oe.selectAll(".area-group").data(Ne=>Ne),Ie=_e.enter().append("g").attr("class",Ne=>"area-group "+Ne.key.replace(/ /g,"-"));Ie.append("path").attr("hoverId",Ne=>(We.data.filter(He=>He.legend===Ne.key)[0].properties.alias||We.data.filter(He=>He.legend===Ne.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ne=>Ne.color!==Re.white?Ne.color:"none").attr("d",Ne=>Ke?st(Ne):Xe(Ne)).each(function(Ne){Ke&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",Xe(Ne))}),_e.select("path").attr("d",Ne=>Xe(Ne)),Ie.merge(_e).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ne=>Ne.color!==Re.white?Ne.color:"none").attr("stroke-dasharray",(Ne,He)=>g[He].properties.lineStyle==="dotted"?"0,3":g[He].properties.lineStyle==="dashed"?fa:"").attr("stroke-linecap",(Ne,He)=>g[He].properties.lineStyle==="dotted"?ya.round:"").attr("stroke-width",(Ne,He)=>g[He].properties.lineStyle!=="None"?g[He].properties.lineWidth:"0"),_e.exit().remove(),Da(Oe,We.data,se.CombinationStackArea,U?ve:me,U?F:re,U?le:K,null,e,z,Z,$,D,V,!1,void 0,U)},Be=()=>{let We=N.selectAll(".parentGroup").data([Ue]);We=We.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(We);let Xe=We.selectAll(".stackcolumns-group").data(Ie=>Ie);Xe=Xe.enter().append("g").attr("class",Ie=>"stackcolumns-group ").merge(Xe);let Ke=Xe.selectAll("rect").data(Ie=>Ie);U?Ke.attr("x",Ie=>Ie.data.axis===Qe.primary?F(Ie[0]):le(Ie[0])).attr("width",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?F(V)-F(Ie[0]):F(Ie[1])-F(Ie[0]):Z&&Ie[1]>Z?le(Z)-le(Ie[0]):le(Ie[1])-le(Ie[0])):Ke.attr("y",Ie=>Ie.data.axis===Qe.primary?re(Ie[1]):K(Ie[1])).attr("height",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?re(Ie[0])-re(V):re(Ie[0])-re(Ie[1]):Z&&Ie[1]>Z?K(Ie[0])-K(Z):K(Ie[0])-K(Ie[1]));const Oe=U?Ke.enter().append("rect").attr("transform",Ie=>`translate(0, ${ve(Ie.data.dimension)-L/2})`).attr("x",Ie=>Ie.data.axis===Qe.primary?F(0):le(0)).attr("width",0):Ke.enter().append("rect").attr("transform",Ie=>`translate(${me(Ie.data.dimension)-L/2},0)`).attr("y",Ie=>Ie.data.axis===Qe.primary?re(0):K(0)).attr("height",0);Oe.merge(Ke).attr("hoverId",Ie=>Ie.alias.includes("~$~")?Ie.alias.split("~$~")[1].replace(/ /g,"-"):Ie.alias.replace(/ /g,"-")).attr(U?"y":"x",Ie=>Le(se.StackColumnChart)).attr(U?"height":"width",Le.bandwidth()).attr("fill",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(nt=>nt.legend===Ie.key);return g[ht]?.properties?.color||"gray"}).attr("stroke",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(mi=>mi.legend===Ie.key),nt=g[ht]?.properties;return nt?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?nt.stackBorderColor:"none"}).attr("stroke-dasharray",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(nt=>nt.legend===Ie.key);return g[ht]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(nt=>nt.legend===Ie.key);return(g[ht]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ie,Ne)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:z.formattedDimensionListMap.get(Ne.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:Ze(Ne.data[Ne.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.key.includes("~$~")?Ne.key.split("~$~")[1]:Ne.key}],e,Ie,g.filter(He=>He.legend===Ne.key)[0].properties,(()=>{const He=g.filter(ht=>ht.legend===Ne.key)[0].properties;return gt(p,String(Ne.data.dimension??""),{...He,formattedDimensionValue:String(z.formattedDimensionListMap.get(Ne.data.dimension)??Ne.data.dimension??"")})})())}).on("mouseout",ot).attr(lt.SeriesId,Ie=>Ie.key??"").attr(lt.DimValue,Ie=>Array.isArray(Ie.data.dimension)?String(Ie.data.dimension[0]):String(Ie.data.dimension)).on("click",Tt(R,A,(Ie,Ne)=>({seriesId:Ne.key??"",dimValue:Array.isArray(Ne.data.dimension)?String(Ne.data.dimension[0]):String(Ne.data.dimension),legendUniqueId:Ne.key??"",seriesDisplayName:Ne.alias||Ne.key||""})));const _e=e.animation.animationEnabled?Oe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Oe;U?_e.attr("x",Ie=>Ie.data.axis===Qe.primary?F(Ie[0]):le(Ie[0])).attr("width",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?F(V)-F(Ie[0]):F(Ie[1])-F(Ie[0]):Z&&Ie[1]>Z?le(Z)-le(Ie[0]):le(Ie[1])-le(Ie[0])):_e.attr("y",Ie=>Ie.data.axis===Qe.primary?re(Ie[1]):K(Ie[1])).attr("height",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?re(Ie[0])-re(V):re(Ie[0])-re(Ie[1]):Z&&Ie[1]>Z?K(Ie[0])-K(Z):K(Ie[0])-K(Ie[1])),Xe.exit().remove()},at=We=>{o=i-We.left-We.right,d=y-We.bottom-We.top},it=(We,Xe,st)=>{H=Xe,X=We,ee=st,ga(r,Ce,X),C(De,ye,fe,$e,Xe),H=JSON.parse(JSON.stringify(E)),H.forEach((Ke,Oe)=>{Ke.properties.type===se.StackColumnChart||Ke.properties.type===se.StackAreaChart?Ke.data.forEach((_e,Ie)=>H[Oe].data[Ie].data=_e.data.filter(Ne=>X.includes(Ne.dimension))):H[Oe].data=Ke.data.filter(_e=>X.includes(_e.dimension))}),Ha()};function ga(We,Xe,st){Xe.clear(),st&&st.length>0&&st.forEach(Ke=>{Xe.set(Ke,0)}),We.ChartData&&We.ChartData.length>0&&We.ChartData.forEach(Ke=>{Ke.properties.type.includes("Stack")&&Ke.data.forEach((Oe,_e)=>{if(Xe.has(Oe.dimension)){let Ie=Xe.get(Oe.dimension)||0;Ie+=Oe.value||0,Xe.set(Oe.dimension,Ie)}})})}const Ha=()=>{J(),Te(),xe(H),U?na(e,N,ae,d,o,O,te,F,z.yMaxLeft,X,b,t,i,be,L,ve):Ot(N,z,ae,e,a,re,Ee,be,y,L,t,o,d,X,me);const We=()=>{U||Ul(H,me,re,K,ce,xt,Ue,Ye,[],[],L,e,y,i,o,X,d,f,m,x,Le,c),ti(Ce,U?ve:me,U?F:re,ce,xt,[],e,b,y,i,m,c,U)};U||ia(e.plotArea.fitChart,m,N,T,L,re,me,Le,void 0,void 0,a,b,e,ne,ue,z.dimensionList,o,ze,z.formattedDimensionListMap,f,ce,d),m.selectAll(".annotation-group").remove(),We()},Pa=We=>{let Xe=We.data.map(Ke=>Ke.legend);S=v.stack().keys(Xe).offset(v.stackOffsetNone)(We.stackData),We.data.forEach((Ke,Oe)=>Ke.data.forEach((_e,Ie)=>{_e[0]=S[Oe][Ie][0],_e[1]=S[Oe][Ie][1]}));let st=e.annotation.annotationSetLabelColor;return S.forEach((Ke,Oe)=>{Ke.forEach(_e=>{_e.key=Ke.key,_e.alias=We.data[Oe].properties.alias,Ke.alias=We.data[Oe].properties.alias,Ke.color=JSON.parse(JSON.stringify(We.data[Oe].properties.color)),Ke.individualAnnotationVisibility=JSON.parse(JSON.stringify(We.data[Oe].properties.annotation)),_e.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?We.data[Oe].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),_e.data.labelColor=st=="2"?JSON.parse(JSON.stringify(We.data[Oe].properties.color)):JSON.parse(JSON.stringify(We.data[Oe].properties.labelColor)),_e.hideZero=JSON.parse(JSON.stringify(We.data[Oe].properties.hideZeroValues)),_e.data.axis=JSON.parse(JSON.stringify(We.data[Oe].properties.axis)),_e.data.color=JSON.parse(JSON.stringify(We.data[Oe].properties.color)),_e.data.legend=We.properties.type,_e.data.type=JSON.parse(JSON.stringify(We.data[Oe].properties.type))})}),S},Fi=()=>{if(Se.length>0){const Xe=(ye.length>0?At(X,ye,!1):At(X,De,!1)).map(st=>st.total);z.yMaxLeft=Math.max(z.yMaxLeft,...Xe),z.yMinLeft=Math.min(z.yMinLeft,...Xe)}if(ie.length>0){const Xe=($e.length>0?At(X,$e,!1):At(X,fe,!1)).map(st=>st.total);z.yMaxRight=Math.max(z.yMaxRight,...Xe),z.yMinRight=Math.min(z.yMinRight,...Xe)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:_,id:f,style:{width:"100%",height:"100%"}})})},ir=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.LayeredColumnChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!1,B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText);let D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze=[];const Se=new Map;let ie=0,De=2,ye=!1,fe={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{$e()}catch(he){Ae("LayeredColumnchart","createLayeredColumnChart",he)}},[e]);const $e=()=>{({formatOptions:e,svg:y,width:k,height:o}=St(S,e)),Ue(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:Q,maxNumberForSecondaryAxis:G,customYaxisMaxValue:P,secondaryCustomYaxisMaxValue:D}=Et(e,fe.yMinLeft,fe.yMaxLeft,fe.yMinRight,fe.yMaxRight),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:De,columnWidth:L,scrollbarVisible:ye}=Ct(k,o,Q,G,fe.yMaxLeft,e,fe.legendList,fe.dimensionList,fe.yMaxRight,B,U,t,!1,fe),ve(V),{dataTable:d,dataTableHeight:i}=aa(e,$,ce,A,fe.dimensionList,r),Mt(y,k,o,e),T=Ft(y,V),vt(T,e,i,M,h,u,f),Ye(),Ee(),Jt(T,e,i,$,K,h),wt(e,g,y,V,Z,o,ne,fe.chartType,$,M,h),Dt(h,e,i,g,y,V,ce,$),Ht(y,B,V,e,i,h,M,pe,ge),Vt(y,e,k,ue),Pt(o,y,ae,ue,k,be,e,A,f,i,V,ct.rectangle,u,n),Gt(A,o,k,y,V,M,ye,De,fe,ie,!1,le)},Ue=()=>{const he=[],te=[];let O=[],X=-1/0,H=1/0,E=-1/0,Y=1/0,ee=-1/0,z=1/0;A.forEach(I=>{te.push(I.properties.legendUniqueId),ee=-1/0,z=1/0,I.data.forEach(w=>{he.push(w),ee=Math.max(ee,w.value),z=Math.min(z,w.value),X=Math.max(X,w.value),H=Math.min(H,w.value)}),I.properties.setColorScale&&Se.set(I.properties.legendUniqueId,v.scaleSequential().domain([z,ee]).interpolator(v.interpolateRgb(I.properties.startColor,I.properties.endColor)))}),fe.chartData=he,fe.legendList=te,fe.yMaxLeft=X,fe.yMinLeft=H>0?0:H,fe.yMaxRight=E,fe.yMinRight=Y>0?0:Y,O=t?ft(e.xAxisLabel.xAxisNumberFormat,fe.dimensionList).map(I=>I):fe.dimensionList,fe.dimensionList.forEach((I,w)=>{fe.formattedDimensionListMap.set(I,O[w])}),ze=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Le=fe.dimensionList:Le=fe.dimensionList.slice(ie,ie+De),e.plotArea.hideZeroValues&&(fe.hideZeroValues=!0)},Ye=()=>{let he=dt(P||fe.yMaxLeft,fe.yMinLeft,h,e,fe,W,P).yAxisLabelArray;fe.yMaxLeft=he[he.length-1],fe.yMinLeft=he[0],a=v.scaleLinear().domain([fe.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:fe.yMinLeft<0?fe.yMinLeft*1.1:fe.yMinLeft*.9,fe.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:fe.yMaxLeft*1.1]).range([i>0?h-i:h,0]),re=[0,M]},Pe=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(fe.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(Le).range(re).padding(.5)},Ee=()=>{we();{let he=dt(P||fe.yMaxLeft,fe.yMinLeft,h,e,fe,W,P);K=v.axisLeft(a).tickFormat(te=>Ze(te,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,M)).tickValues(he.autoLabelFlag?void 0:he.yAxisLabelArray).ticks(he.customTickValue).tickPadding(8).tickSizeOuter(0)}},we=()=>{me=v.axisBottom(N).tickSize(sa(e,h,i)).tickSizeOuter(0).tickValues(bt(Le,M))},Ce=he=>{he.forEach(te=>{te.data.forEach(O=>{O.hideZero=te.properties.hideZeroValues,O.properties=te.properties,O.axis=te.properties.axis})}),he.forEach((te,O)=>{let X=T.selectAll(".parentGroup").filter(z=>z?.properties?.legendUniqueId===te.properties.legendUniqueId).data([te],z=>z.properties.legendUniqueId);X=X.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",te.properties.legendUniqueId).attr("clip-path",`url(#${f}-clip)`).merge(X);let H=X.selectAll(".column-group").data(te.data,z=>z.dimension+"_"+te.properties.legendUniqueId),E=H.enter().append("g").attr("class","column-group").attr("hoverId",(te.properties.alias||te.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",z=>O===0?`translate(${N(z.dimension)-L/2}, 0)`:`translate(${N(z.dimension)-L/(2+O*2)}, 0)`);H.attr("transform",z=>O===0?`translate(${N(z.dimension)-L/2}, 0)`:`translate(${N(z.dimension)-L/(2+O*2)}, 0)`),E.merge(H).attr("transform",z=>O===0?`translate(${N(z.dimension)-L/2}, 0)`:`translate(${N(z.dimension)-L/(2+O*2)}, 0)`);const Y=E.append("rect").attr("x",()=>0).attr("width",O===0?L:L/2+O*2).attr("y",z=>(te.properties.axis===Qe.primary?a:m)(0)).attr("height",0).attr("fill",z=>Se.get(te.properties.legendUniqueId)?.(z.value)??te.properties.color).attr("stroke-dasharray",()=>te.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${te.properties.stackBorderWidth}px`).attr("stroke",()=>te.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?te.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",z=>z.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>te.properties.legendUniqueId).attr(lt.DimValue,z=>Array.isArray(z.dimension)?String(z.dimension[0]):String(z.dimension));(e.animation.animationEnabled?Y.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Y).attr("y",z=>{const I=te.properties.axis===Qe.primary?a:m;return z.value>0?I(z.value):I(0)}).attr("height",z=>{const I=te.properties.axis===Qe.primary?a:m;return Math.abs(I(z.value)-I(0))}),H.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("y",z=>{const I=te.properties.axis===Qe.primary?a:m;return z.value>0?I(z.value):I(0)}).attr("height",z=>{const I=te.properties.axis===Qe.primary?a:m;return Math.abs(I(z.value)-I(0))}),E.merge(H).on("mousemove",(z,I)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:fe.formattedDimensionListMap.get(Array.isArray(I.dimension)?I.dimension[0]:I.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():I.properties?.currentMeasure?I.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||I.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(u)?I[1]-I[0]:I.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:I.properties.alias}],e,z,I.properties,(()=>{const C=Array.isArray(I.dimension)?I.dimension[0]:I.dimension;return gt(p,String(C??""),{...I.properties,formattedDimensionValue:String(fe.formattedDimensionListMap.get(C)??C??"")})})());let w=(te.properties.alias||te.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),v.selectAll('[hoverId="'+w+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(z,I)=>{let w=(te.properties.alias||te.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+w+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}),E.merge(H).on("click",Tt(_,b,(z,I)=>({seriesId:te.properties.legendUniqueId,dimValue:Array.isArray(I.dimension)?String(I.dimension[0]):String(I.dimension),legendUniqueId:te.properties.legendUniqueId,seriesDisplayName:te.properties.alias||te.properties.name||""}))),H.exit().remove()}),T.selectAll(".parentGroup").raise()},ve=he=>{M=k-he.left-he.right,h=o-he.bottom-he.top},F=()=>{Pe(),we(),Ot(T,fe,Z,e,i,a,me,ae,o,L,t,M,h,Le,N),Ce(ze),Ra(A,N,a,void 0,V,xt,[],[],e,u,o,k,M,Le,h,f,y,x,void 0,L,c),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,se.ColumnChart,e,$,ce,fe.dimensionList,M,re,fe.formattedDimensionListMap,f,V,h))},le=(he,te,O)=>{ze=te,Le=he,De=O,F()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},lr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID();let L=0,u=!1;const S=se.StackColumnChart,b=Me.useRef(),_=Me.useRef(s);_.current=s;const A=Me.useRef(p);A.current=p;const R=r.DimensionList,g=(Lt(r.ChartData,r.DimensionList)||[]).reverse(),B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText),e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText);let D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N;const re=new Map;let K,me,Le,ze=[],Se=0,ie,De=[],ye=new Map;const fe=!1;let $e={dimensionList:R,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{Ue()}catch(E){Ae("StackStackColumnchart","createStackColumnChart",E)}},[e]);const Ue=()=>{({formatOptions:e,svg:i,width:h,height:k}=St(b,e)),Ye(),{formatOptions:e}=ta(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,$e.yMinLeft,$e.yMaxLeft,$e.yMinRight,$e.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be,visibleBars:ie,columnWidth:L,scrollbarVisible:u}=Ct(h,k,pe,Q,$e.yMaxLeft,e,$e.legendList,$e.dimensionList,$e.yMaxRight,U,fe,t,!1,$e),F(D),{dataTable:o,dataTableHeight:d}=aa(e,V,Z,g,$e.dimensionList,r),Mt(i,h,k,e),y=Ft(i,D),vt(y,e,d,G,M,S,f),Pe(),we(),Jt(y,e,d,V,K,M),wt(e,B,i,D,$,k,ce,$e.chartType,V,G,M),Dt(M,e,d,B,i,D,Z,V),Ht(i,U,D,e,d,M,G,be,ue),Vt(i,e,h,ae),Pt(k,i,ne,ae,h,ge,e,[...g].reverse(),f,d,D,ct.rectangle,S,n),Gt(g,k,h,i,D,G,u,ie,$e,Se,!1,le)},Ye=()=>{const E=[],Y=[];let ee=-1/0,z=1/0;g.forEach((j,Te)=>{const xe=`${Te}~$~${j.properties.legend}`;j.properties.legend=xe,Y.push(xe),ee=-1/0,z=1/0;for(const de of j.data)ee=Math.max(ee,de.value),z=Math.min(z,de.value),E.push(de);j.properties.setColorScale&&re.set(j.properties.legendUniqueId,v.scaleSequential().domain([z,ee]).interpolator(oi.interpolateRgb(j.properties.startColor,j.properties.endColor)))}),$e.chartData=E,$e.legendList=Y,ze=JSON.parse(JSON.stringify(g));let I=At($e.dimensionList,g,fe);Le=$e.dimensionList;const w=v.stack().keys($e.legendList).offset(v.stackOffsetDiverging)(I);te();let C=1/0,q=-1/0;for(const j of w)for(const[Te,xe]of j)C=Math.min(C,Te),q=Math.max(q,xe);$e.yMinLeft=C>0?0:C,$e.yMaxLeft=q;let J=t?ft(e.xAxisLabel.xAxisNumberFormat,$e.dimensionList).map(j=>j):$e.dimensionList;$e.dimensionList.forEach((j,Te)=>{$e.formattedDimensionListMap.set(j,J[Te])}),e.plotArea.hideZeroValues&&($e.hideZeroValues=!0)},Pe=()=>{T=v.scaleLinear().domain([$e.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:$e.yMinLeft<0?$e.yMinLeft*1.1:$e.yMinLeft*.9,$e.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:$e.yMaxLeft*1.1]).range([d>0?M-d:M,0]),N=[0,G]},Ee=()=>{m=v.scalePoint().domain(Le).range([0,G]).padding(.5)},we=()=>{{const E=dt(P||$e.yMaxLeft,$e.yMinLeft,M,e,$e,W,P);K=v.axisLeft(T).tickFormat(Y=>Ze(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,G)).tickValues(E.autoLabelFlag?void 0:E.yAxisLabelArray).ticks(E.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ce=()=>{me=v.axisBottom(m).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(bt(Le,G))},ve=E=>{E.forEach(J=>{J.data.forEach(j=>{j.hideZero=J.properties.hideZeroValues,j.axis=J.properties.axis})}),Le.forEach(J=>{y.append("rect").attr("id",`dim-background-${J}`).attr("class","dimension-background").attr("x",m(J)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Y=y.selectAll(".parentGroup").data([De]);Y=Y.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Y);let ee=Y.selectAll(".column-group").data(J=>J);ee=ee.enter().append("g").attr("class",J=>"column-group "+J.key.replace(/ /g,"-")).attr("hoverId",J=>J[0]?.properties.alias?Ja(J[0]?.properties.alias):Ja(J.key)).merge(ee);let I=ee.selectAll("rect").data(J=>J);const w=(J,j)=>{const Te=Array.from(ee.nodes()).indexOf(J[j].parentNode);return{props:g[Te]?.properties,groupIndex:Te}},C=I.enter().append("rect").merge(I).attr("x",J=>m(J.data.dimension)-L/2).attr("width",L).attr("y",J=>T(0)).attr("height",0).attr("fill",(J,j,Te)=>{const{props:xe}=w(Te,j);return re.get(xe.legendUniqueId)?.(J.data[J.key])??xe?.color??"gray"}).attr("stroke",(J,j,Te)=>{const{props:xe}=w(Te,j);return xe?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?xe.stackBorderColor:"none"}).attr("stroke-dasharray",(J,j,Te)=>{const{props:xe}=w(Te,j);return xe?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(J,j,Te)=>{const{props:xe}=w(Te,j);return(xe?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(J,j,Te)=>{const{props:xe}=w(Te,j);return J.data[J.key]==0&&xe?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,J=>J.key??"").attr(lt.DimValue,J=>Array.isArray(J.data.dimension)?String(J.data.dimension[0]):String(J.data.dimension)).on("mousemove",(J,j)=>{const Te=String($e.formattedDimensionListMap.get(j.data.dimension)??j.data.dimension??""),xe=gt(l,String(j.data.dimension??""),{...j.properties,formattedDimensionValue:Te});yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:$e.formattedDimensionListMap.get(j.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():j.properties?.currentMeasure?j.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||j.value,value:Ze(j.data[j.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:j.properties.alias}],e,J,j.properties,xe)}).on("mouseout",(J,j)=>{ot()}).on("click",Tt(A,_,(J,j)=>({seriesId:j.key??"",dimValue:Array.isArray(j.data.dimension)?String(j.data.dimension[0]):String(j.data.dimension),legendUniqueId:j.key??"",seriesDisplayName:j.properties?.alias||j.key||""})));(e.animation.animationEnabled?C.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):C).attr("y",J=>J[1]>=J[0]?T(J[1]):T(J[0])).attr("height",J=>Math.abs(T(J[0])-T(J[1]))),ee.exit().remove(),y.selectAll(".parentGroup").raise()},F=E=>{G=h-E.left-E.right,M=k-E.bottom-E.top},le=(E,Y,ee)=>{ze=Y,Le=E,ie=ee,ai(r,ye,Le),he()},he=()=>{Ee(),Ce(),Ot(y,$e,$,e,d,T,me,ne,k,L,t,G,M,Le,m),te();const E=new Map;Le.forEach((Y,ee)=>{let z=0;De.forEach(I=>{const w=I[ee]?.[0]??0;w<z&&(z=w)}),E.set(Y,z)}),ve(ze),za(De,m,T,a,D,xt,[],[],e,S,k,h,G,Le,M,f,i,x,d,c),ti(ye,m,T,D,xt,[],e,S,k,h,i,c,!1,E),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,i,y,o,L,T,m,void 0,void 0,void 0,d,S,e,V,Z,Le,G,N,$e.formattedDimensionListMap,f,D,M)),O()},te=()=>{let E=At(Le,ze,fe);De=v.stack().keys($e.legendList).offset(v.stackOffsetDiverging)(E),ze.forEach((ee,z)=>ee.data.forEach((I,w)=>{I[0]=De[z][w][0],I[1]=De[z][w][1]}));let Y=e.annotation.annotationSetLabelColor;De.forEach((ee,z)=>ee.forEach(I=>{I.key=ee.key,ee.color=JSON.parse(JSON.stringify(g[z].properties.color)),I.data.labelPosition=g[z].properties.dataLabelPosition,I.data.labelColor=Y=="2"?JSON.parse(JSON.stringify(g[z].properties.color)):g[z].properties.labelColor,I.hideZero=JSON.parse(JSON.stringify(g[z].properties.hideZeroValues)),I.properties=g[z].properties}))},O=()=>{try{const E=e?.connector,Y=Number(E?.connectorVisibility);if(!E||Y===2)return;let ee,z=[];Y===1?ee=1:Y===3&&(Number(E.connectorFollow)===1?ee=Number(E.connectorStepSize)||void 0:Number(E.connectorFollow)===2&&(z=E.connectorExclude??[],ee=1));const I=(z||[]).map(j=>String(j).split("-")[0]),w=(De[0]??[]).map((j,Te)=>({Dimension:j.data.dimension,Total:j.data.total,CustomTotal:j.data.total,Index:Te})),C=[],q=[];let J=[];if(ee){if(ee===1)C.push(...w);else for(const j of w)j.Index%ee===0&&C.push(j);for(let j=ee;j<w.length;j+=ee){const Te=Math.min(j+ee,w.length);let xe=w[j]?.Total??Number.NEGATIVE_INFINITY;for(let de=j;de<Te;de++)w[de].Total>xe&&(xe=w[de].Total);Number.isFinite(xe)&&q.push(xe)}J=C.slice(1)}else{const j=E.connectorCustomRange??[],Te=new Map;w.forEach(xe=>Te.set(String(xe.Dimension),xe.Index));for(const xe of j){if(!xe?.from||!xe?.to)continue;const de=Te.get(String(xe.from)),Fe=Te.get(String(xe.to));if(de!=null&&Fe!=null){C.push(w[de]);const Ve=Math.min(de,Fe),ke=Math.max(de,Fe);let Be=w[Ve]?.Total??Number.NEGATIVE_INFINITY;for(let at=Ve;at<=ke;at++)w[at].Total>Be&&(Be=w[at].Total);Number.isFinite(Be)&&q.push(Be)}}for(const xe of j){if(!xe?.from||!xe?.to)continue;const de=Te.get(String(xe.to));de!=null&&J.push(w[de])}}y.selectAll("defs > #arrow").remove(),y.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",E.connectorMarkerColor!==Re.white?E.connectorMarkerColor:"none"),X(C,q,J,ee,I),H(C,q,J,ee,I)}catch{}},X=(E,Y,ee,z,I)=>{try{const w=E.filter((j,Te)=>z!=null?Te<E.length-1:Te<E.length);let C=y.selectAll("path.connector-path").data(w,j=>String(j.Dimension));C.exit().remove(),C.enter().append("path").attr("class","connector-path").style("shape-rendering","crispEdges").attr("fill","none").attr("marker-end","url(#arrow)").merge(C).attr("d",(j,Te)=>e.total.totalVisibility?`M ${m(j.Dimension)+m.bandwidth()/2+5}, ${T(j.Total)-25} V ${-35+Math.min(T(Y[Te]),T(ee[Te].Total),T(j.Total))} H ${m(ee[Te].Dimension)+m.bandwidth()/2-10} V ${-27+T(ee[Te].Total)}`:`M ${m(j.Dimension)+m.bandwidth()/2+5}, ${T(j.Total)-5} V ${-30+Math.min(T(ee[Te].Total),T(j.Total))} H ${m(ee[Te].Dimension)+m.bandwidth()/2-10} V ${-10+T(ee[Te].Total)}`).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",j=>I.includes(j.Dimension)||j.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},H=(E,Y,ee,z,I)=>{try{let w,C=e.connector.connectorFontStyle,q=e.connector.connectorNumberFormat,J=G/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(q=".2s");const j=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Te=Mi(j,L),xe=Te*(typeof m.padding=="function"?m.padding():0),de=E.map((Be,at)=>({d:Be,i:at})).filter(Be=>z!=null?Be.i<E.length-1:Be.i<E.length);let Fe=y.selectAll("text.connector-text").data(de,Be=>String(Be.d.Dimension));Fe.exit().remove(),Fe.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(Fe).attr("x",Be=>{const at=Be.d,it=Be.i,ga=ee[it];return m(ga.Dimension)-Te*z/2}).attr("y",Be=>{const at=Be.d,it=Be.i,ga=Y[it],Ha=ee[it],Pa=Math.min(T(Ha?.Total??0),T(at.Total));return e.total.totalVisibility?J<8?-40+Pa:-41+Pa:J<8?-35+Pa:-40+Pa}).style("text-anchor","middle").text(Be=>{const at=Be.d,it=Be.i;return ee[it]?(at.CustomTotal==0&&ee[it].CustomTotal!=0&&(at.CustomTotal=1),Ai(ee[it].Total,at.Total,parseInt(e.connector.connectorDecimalPrecision),q,parseInt(at.Dimension),parseInt(ee[it].Dimension),e)):""}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",C.includes("Italic")?"Italic":"").style("text-decoration",C.includes("Underline")?"Underline":"").style("font-weight",C.includes("Bold")?"Bold":"").style("visibility",Be=>{const at=Be.d;return I.includes(at.Dimension)||at.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible"}).raise()}catch{}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:b,id:f,style:{width:"100%",height:"100%"}})})},rr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.NormalizedStackColumnChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList).reverse(),R=r.DimensionList,g=!1,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q=!1,G,M,h,k,o,d,i,y,T,a,m,N;const re=new Map;let K,me,Le,ze=[],Se=0,ie=0,De=[];const ye=!0;let fe={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{$e()}catch(te){Ae("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",te)}},[e]);const $e=()=>{({formatOptions:e,svg:i,width:h,height:k}=St(S,e)),Ue(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:be,maxNumberForSecondaryAxis:pe}=Et(e,fe.yMinLeft,fe.yMaxLeft,fe.yMinRight,fe.yMaxRight),{margin:P,yLabel:D,xLabel:V,yTitle:$,xTitle:Z,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:ae,legendMargin:ue,secondaryYLabel:ge,visibleBars:ie,columnWidth:L,scrollbarVisible:Q}=Ct(h,k,be,pe,fe.yMaxLeft,e,fe.legendList,fe.dimensionList,fe.yMaxRight,B,ye,t,!1,fe),ve(P),{dataTable:o,dataTableHeight:d}=aa(e,D,$,A,fe.dimensionList,r),Mt(i,h,k,e),y=Ft(i,P),vt(y,e,d,G,M,u),Ye(),Ee(),Jt(y,e,d,D,K,M),wt(e,g,i,P,V,k,Z,fe.chartType,D,G,M),Dt(M,e,d,g,i,P,$,D),Ht(i,B,P,e,d,M,G,ge,ae),Vt(i,e,h,ne),Pt(k,i,ce,ne,h,ue,e,[...A].reverse(),f,d,P,ct.rectangle,u,n),Gt(A,k,h,i,P,G,Q,ie,fe,Se,!1,F)},Ue=()=>{const te=[],O=[];let X=-1/0,H=1/0;A.forEach((I,w)=>{const C=`${w}~$~${I.properties.legend}`;I.properties.legend=C,O.push(C),X=-1/0,H=1/0;for(const q of I.data)X=Math.max(X,q.value),H=Math.min(H,q.value),te.push(q);I.properties.setColorScale&&re.set(I.properties.legendUniqueId,v.scaleSequential().domain([H,X]).interpolator(v.interpolateRgb(I.properties.startColor,I.properties.endColor)))}),fe.chartData=te,fe.legendList=O,ze=JSON.parse(JSON.stringify(A));let E=At(fe.dimensionList,A,ye);Le=fe.dimensionList;const Y=v.stack().keys(fe.legendList).offset(v.stackOffsetDiverging)(E);he();let ee=1/0;for(const I of Y)for(const[w]of I)ee=Math.min(ee,w);fe.yMinLeft=ee>0?0:ee,fe.yMaxLeft=1;let z=t?ft(e.xAxisLabel.xAxisNumberFormat,fe.dimensionList).map(I=>I):fe.dimensionList;fe.dimensionList.forEach((I,w)=>{fe.formattedDimensionListMap.set(I,z[w])}),e.plotArea.hideZeroValues&&(fe.hideZeroValues=!0)},Ye=()=>{let te=dt(W||fe.yMaxLeft,fe.yMinLeft,M,e,fe,U,W).yAxisLabelArray;if(fe.yMaxLeft=te[te.length-1],fe.yMinLeft=te[0],T=v.scaleLinear().domain([fe.yMinLeft<0?-1:0,1]).range([d>0?M-d:M,0]),N=[0,G],e.seriesLabel.seriesLabelVisibility){let O=la(G,T,e,ze,void 0,B,M,!0);O.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&O.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?N=[0,G-O.heightWidth[0]]:N=[O.heightWidth[0],G]}},Pe=()=>{m=v.scalePoint().domain(Le).range(N).padding(.5)},Ee=()=>{K=v.axisLeft(T).tickSize(Rt(e,G)).ticks(d>0?(M-d)/80:M/80,"%").tickPadding(8).tickSizeOuter(0)},we=()=>{me=v.axisBottom(m).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(bt(Le,G))},Ce=te=>{De.forEach((w,C)=>w.forEach((q,J)=>{te[C].data[J]&&te[C].data[J][0]!==void 0&&te[C].data[J][1]!==void 0&&(te[C].data[J][0]=q[0]=q.data.total===0?0:q[0]/q.data.total,te[C].data[J][1]=q[1]=q.data.total===0?0:q[1]/q.data.total)})),te.forEach(w=>{w.data.forEach(C=>{C.hideZero=w.properties.hideZeroValues,C.axis=w.properties.axis})}),Le.forEach(w=>{y.append("rect").attr("id",`dim-background-${w}`).attr("class","dimension-background").attr("x",m(w)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let O=y.selectAll(".parentGroup").data([De]);O=O.enter().append("g").attr("class","columns parentGroup").merge(O);let X=O.selectAll(".column-group").data(w=>w);X=X.enter().append("g").attr("class",w=>"column-group "+w.key.replace(/ /g,"-")).attr("hoverId",w=>(te[w.index].properties.alias||te[w.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(X);let E=X.selectAll("rect").data(w=>w);const Y=(w,C)=>{const q=Array.from(X.nodes()).indexOf(w[C].parentNode);return{props:A[q]?.properties,groupIndex:q}},ee=E.enter().append("rect").attr("x",w=>m(w.data.dimension)-L/2).attr("width",L).attr("y",T(0)).attr("height",0).attr("fill",(w,C,q)=>{const{props:J}=Y(q,C);return re.get(J.legendUniqueId)?.(w.data[w.key])??J?.color??"gray"}).attr("stroke",(w,C,q)=>{const{props:J}=Y(q,C);return J?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?J.stackBorderColor:"none"}).attr("stroke-dasharray",(w,C,q)=>{const{props:J}=Y(q,C);return J?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(w,C,q)=>{const{props:J}=Y(q,C);return(J?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(w,C,q)=>{const{props:J}=Y(q,C);return w.data[w.key]===0&&J?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,w=>w.key??"").attr(lt.DimValue,w=>Array.isArray(w.data.dimension)?String(w.data.dimension[0]):String(w.data.dimension)),z=e.animation.animationEnabled;(w=>z?w.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):w)(ee).attr("y",w=>w[1]>=w[0]?T(w[1]):T(w[0])).attr("height",w=>Math.abs(T(w[0])-T(w[1]))),ee.merge(E).on("mousemove",(w,C)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:fe.formattedDimensionListMap.get(C.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||C.value,value:Ze(C[1]-C[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,w,C.properties,gt(p,String(C.data.dimension??""),{...C.properties,formattedDimensionValue:String(fe.formattedDimensionListMap.get(C.data.dimension)??C.data.dimension??"")}))}).on("mouseout",(w,C)=>{ot()}).on("click",Tt(_,b,(w,C)=>({seriesId:C.key??"",dimValue:Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension),legendUniqueId:C.key??"",seriesDisplayName:C.properties?.alias||C.key||""}))),X.exit().remove(),y.selectAll(".parentGroup").raise()},ve=te=>{G=h-te.left-te.right,M=k-te.bottom-te.top},F=(te,O,X)=>{ze=O,Le=te,ie=X,le()},le=()=>{Pe(),we(),he(),Ot(y,fe,V,e,d,T,me,ce,k,L,t,G,M,Le,m),Ce(ze),za(De,m,T,a,P,xt,[],[],e,u,k,h,G,Le,M,f,i,x,d,c),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,i,y,o,m.bandwidth(),T,m,void 0,void 0,void 0,d,u,e,D,$,fe.dimensionList,G,N,fe.formattedDimensionListMap,f,P,M))},he=()=>{let te=At(Le,ze,ye);De=v.stack().keys(fe.legendList).offset(v.stackOffsetDiverging)(te),ze.forEach((X,H)=>X.data.forEach((E,Y)=>{E[0]=De[H][Y][0],E[1]=De[H][Y][1]}));let O=e.annotation.annotationSetLabelColor;De.forEach((X,H)=>X.forEach(E=>{E.key=X.key,X.color=JSON.parse(JSON.stringify(A[H].properties.color)),X.individualAnnotationVisibility=JSON.parse(JSON.stringify(A[H].properties.individualAnnotationVisibility)),E.data.labelPosition=A[H].properties.dataLabelPosition,E.data.labelColor=O=="2"?JSON.parse(JSON.stringify(A[H].properties.color)):A[H].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(A[H].properties.hideZeroValues)),E.properties=A[H].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},Ca="ChartsWithoutAxisFunctions.ts";function qi(t,e,r){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:c,minVal:x,maxVal:n}=e.plotArea.plotAreaRangeFilter;return t.filter(l=>{const s=r(l);switch(c){case"lt":return s<=n;case"gt":return s>=x;case"in":return s>=x&&s<=n;case"not-in":return s<x||s>n;default:return!0}})}function Ki(t,e,r,c,x,n){try{c.xAxisLabel.xAxisDateFormat=c.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":c.xAxisLabel.xAxisDateFormat;let l={top:0,left:0,right:0,bottom:0},s=t*.15*.8,p=n[0],f=s<p+10?s:p+10,L=c.plotArea.numberOfBubbles?20:0;const u=qe(c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisNumberFormat,c.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString();let b=Nt(u,c.xAxisLabel.xAxisLabelFontSize,c.xAxisLabel.xAxisLabelFontFamily,c.xAxisLabel.xAxisLabelRotation)[3]+10,_=c.xAxisTitle.xAxisTitleVisibility?c.xAxisTitle.xAxisDynamicTitleText.length!==0?zt(c.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:zt(c.xAxisTitle.xAxisTitleText,13,tt).height:0;_=_>e*.1?e*.1:_;let A=c.xAxisLabel.xAxisLabelVisibility?b:0,R=c.yAxisTitle.yAxisTitleVisibility?c.yAxisTitle.yAxisDynamicTitleText.length!==0?zt(c.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:zt(c.yAxisTitle.yAxisTitleText,13,tt).height:0;R=R>t*.1?t*.1:R;let g=c.yAxisLabel.yAxisLabelVisibility?zt(qe(c.yAxisLabel.yAxisDisplayUnits,c.yAxisLabel.yAxisNumberFormat,c.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString(),rt(c.yAxisLabel.yAxisLabelFontSize),c.yAxisLabel.yAxisLabelFontFamily,c.yAxisLabel.yAxisLabelRotation).width+10:0,B=c.chartTitle.chartTitleVisibility?c.chartTitle.dynamicTitleText.length!==0?zt(c.chartTitle.chartTitleHTML,void 0,void 0).height:zt(c.chartTitle.chartTitleText,16,tt).height:0;B=B>e*.1?e*.1:B;let U=c.legends.legendPosition,W=c.legends.legendVisibility,P=!1;switch(W||(U="None"),U){case je.none:l.top=B+5,l.bottom=_+A+5+L,l.right=15,l.left=R+g+5;break;case je.top:l.top=40+B,l.bottom=_+A+5+L,l.right=15,l.left=R+g+5;break;case je.right:l.right=f+35,l.top=B+5,l.bottom=_+A+5+L,l.left=R+g+5;break;case je.bottom:l.bottom=40+A+_+L,l.top=B+5,l.right=15,l.left=R+g+5;break;case je.left:l.left=f+R+g+33,l.top=B+5,l.bottom=_+A+5+L,l.right=15}c.xAxisLabel.xAxisPosition&&c.xAxisLabel.xAxisPosition=="1"&&(l.bottom=l.bottom-A,l.top=l.top+A);let D=c.chartPadding.paddingArrayLTRB;D&&(l.top+=D[1],l.bottom+=D[3],l.right+=D[2],l.left+=D[0]);let V=e-l.top-l.bottom,$=t-l.left-l.right;return{margins:l,yLabel:g,xLabel:A,yTitle:R,xTitle:_,chartTitleHeight:B,legendMargin:f,innerHeight:V,innerWidth:$}}catch(l){Ma(Ca,"marginCalculationForBubbleScatter",l)}}function Qi(t,e,r){try{let c=parseFloat(t.yAxisLabel.yAxisIntervalText),x=parseFloat(t.yAxisLabel.yAxisMaxText),n=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){n=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let u=t.yAxisLabel.yAxisMaxText;x=u.length>0?parseFloat(u):r,x&&(r=x)}else x=r,n=e,c=void 0;let l=e?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString().length:0,p=x?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(x).toString().length:0,f=n?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString().length:0,L=l<s?r:e;if(n){let u=f<s?r:n;L=L<u?u:L}if(x){let u=p>l?x:e;L=L<u?u:L}return x&&n&&(L=p>f?x:n),{longestMeasure:L,customYaxisIntervalValue:c,customYaxisMaxValue:x,customYaxisMinValue:n}}catch(c){Ma(Ca,"customYscaleLabelFormatting",c)}}function Oi(t,e,r){try{let c=parseFloat(t.xAxisLabel.xAxisIntervalText),x=parseFloat(t.xAxisLabel.xAxisMaxText),n=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){n=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let u=t.xAxisLabel.xAxisMaxText.toString();x=u.length>0?parseFloat(u):r,x&&(r=x)}else x=r,n=e,c=void 0;let l=e?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(r).toString().length:0,p=x?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString().length:0,f=n?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n).toString().length:0,L=l<s?r:e;if(n){let u=f<s?r:n;L=L<u?u:L}if(x){let u=p>l?x:e;L=L<u?u:L}return x&&n&&(L=p>f?x:n),{longestDimension:L,customXaxisIntervalValue:c,customXaxisMaxValue:x,customXaxisMinValue:n}}catch(c){Ma(Ca,"customXscaleLabelFormatting",c)}}function el(t,e,r,c,x,n,l,s,p,f,L){try{let u=t.xAxisLabel.xAxisPosition,S=!0,_=r.append("foreignObject").attr("visibility",e?t.yAxisTitle.yAxisTitleVisibility?"visible":"hidden":t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",!t.plotArea.fitChart&&S?`translate(${c.left},${c.top+L+(t?.xAxisLabel?.xAxisPosition=="1"?0:x)})`:!t.plotArea.fitChart&&!1?`translate(${c.left},${n-l-5})`:`translate(${c.left},${c.top+L+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:x:s=="tornado"?x+5:p+5)})`).attr("class","xAxisTitle").attr("width",f).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?_.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):_.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","5px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){Ma(Ca,"setXaxistitle",u)}}function tl(t,e,r,c,x,n,l,s){try{let p=r>0?t-r:t,f=x.append("foreignObject").attr("visibility",c?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${n.top+p}`).attr("y",n.left-l-s+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",p).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?f.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):f.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),x}catch(p){Ma(Ca,"yAxistitle",p)}}function al(t,e,r,c,x,n){try{let l=parseFloat(c.yAxisLabel.yAxisIntervalText),s=[],p;if(l&&l!==0&&l!==void 0){let f=x||x==0?x:e,L=n||n==0?n:t;f<0?p=Math.floor((L-f)/l):p=Math.floor(L/l);let u=18;(n||n==0)&&(t=n);let S=x||x==0?x:e<0?Math.round(e):0;if(s.push(S),p>100){let b="Tick count cannot exceed more than 100.";f<0?l=(L-S)/100:l=L/100}if(p=p<100?p:100,p>u)for(let b=0;b<parseInt(p)&&(S+=l,parseFloat(S.toFixed(5))<=t);b++)s.push(S);else for(let b=0;b<u&&(S+=l,S<=t);b++)s.push(S)}else p=r/60;return{yAxisLabelArray:s,customTickValue:p}}catch(l){Ma(Ca,"responsiveYaxisLabel",l)}}function Li(t,e,r,c,x,n,l,s){try{let p=!0,f=parseFloat(c.xAxisLabel.xAxisIntervalText),L=[],u;if(f&&f!==0&&f!==void 0){let S=x||x==0?x:e,b=n||n==0?n:t;S<0?u=Math.floor((b-S)/f):u=Math.floor(b/f);let _=18;(n||n==0)&&(t=n);let A=x||x==0?x:e<0?Math.round(e):0;if(L.push(A),p=!1,u>100){let R="Tick count cannot exceed more than 100.";S<0?f=(b-A)/100:f=b/100}if(u=u<100?u:100,u>_)for(let R=0;R<parseInt(u)&&(A+=f,parseFloat(A.toFixed(5))<=t);R++)L.push(A);else for(let R=0;R<_&&(A+=f,A<=t);R++)L.push(A)}else{const S=qe(c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisDateFormat,c.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n||t).toString();let b=Nt(S,c.xAxisLabel.xAxisLabelFontSize,c.xAxisLabel.xAxisLabelFontFamily,0);L=$i(x||e,n||t,s?l:r,b[0]),u=r/30}return{xAxisLabelArray:L,customTickValue:u,autoLabelFlag:p}}catch(p){Ma(Ca,"responsiveXaxisLabel",p)}}function il(t,e,r,c,x,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-c},0)`).attr("height",r>0?n-r:n).attr("width",c).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Re.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(x);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Re.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes(oe.italic)?oe.italic:"").style("text-decoration",l.includes(oe.underline)?oe.underline:"").style("font-weight",l.includes(oe.bold)?oe.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(l){Ma(Ca,"initYaxis",l)}}function ll(t,e,r,c,x,n,l,s,p){try{let f=e.xAxisLabel.xAxisLabelFontStyle,L=e.xAxisLabel.xAxisPosition,u=e.xAxisLabel.xAxisLabelRotation;u=parseInt(u),t.append("rect").attr("transform",`translate(1,${L==="0"?r>0?n-r:n:L==="1"?-c:p(0)})`).attr("height",c).attr("width",l).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==Re.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${L==="0"?n:L==="1"?0:p(0)})`).call(x);let b=L==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(c)).style("height","20px").attr("transform",(A,R)=>`rotate(${L==="1"?-u:u!=0?180-u:0}) translate (${u!=0?b+", -5":-c/2+" , "+(L==="1"?"-15":"8")})`).append("xhtml:h3").style("transform",L==="1"?"":u!=0?"rotate(180deg)":"0").style("white-space","pre").style("text-overflow","ellipsis").style("text-align",u!=0?"start":"center").style("user-select","none").style("margin",0).style("padding",0).style("overflow","hidden").style("font-family",e.xAxisLabel.xAxisLabelFontFamily).style("color",e.xAxisLabel.xAxisLabelColor).style("font-size",e.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",f.includes(oe.italic)?oe.italic:"").style("text-decoration",f.includes(oe.underline)?oe.underline:"").style("font-weight",f.includes(oe.bold)?oe.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(A,R)=>qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(A)).html((A,R)=>qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(A)),S.selectAll("text").style("visibility",(e.xAxisLabel.xAxisLabelVisibility,"hidden")),S.selectAll("line").style("stroke",e.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",e.xAxisLabel.xAxisLabelVisibility||e.plotArea.gridLinesVertical?"visible":"hidden"),S.select(".domain").style("stroke",e.xAxisLabel.xAxisColor).attr("stroke-width",e.xAxisLabel.xAxisWidth?e.xAxisLabel.xAxisWidth:e.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges")}catch(f){Ma(Ca,"initXaxis",f)}}function rl(t,e,r,c,x,n,l,s,p,f,L){try{if(!r.annotation.annotationVisibility)return;const u=r.plotArea.annotationType??"1",S=[u==="1"?"connector":""],b=r.plotArea.connectorType?.toLowerCase()??"none",_=u==="5",A=r.plotArea.rotation??0,R=x===se.PieChart?1.06:1.1,g={1:"",2:v.curveLinear,3:v.curveStep},B=(Q,G)=>[[0,0],[Q/2,G/2],[Q,G]],U={solid:"unset",dotted:"2,2",dashed:"6,4"};let W=t.annotation(),P=JSON.parse(JSON.stringify(r.plotArea.dataLabelsCoordinates||[]));P=P.map(Q=>({dx:Q.dx??0,dy:Q.dy??0,ratioDistance:Q.ratioDistance,ratioAngle:Q.ratioAngle,connectorPoints:Q.connectorPoints||Q.connector?.points||[],radius:Q.radius??p,data:Q.data,width:n,height:l}));const D=e.reduce((Q,G)=>Q+(G?.data?.data?.[0]?.value??0),0),V=D===0?1:D,$=(Q,G)=>{const M=Q.data.data[0].value,h=(Q.x0+Q.x1)/2,k=Q.x1-Q.x0;return{note:{title:r.plotArea.dataLabelName?Q.data.legend:"",label:r.plotArea.dataLabelValue&&M!==0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(M/V)*100).toFixed(rt(r.plotArea.dataLabelDecimalPrecision))+"%":qe(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(M):"",align:"middle",wrap:1e3},data:{x:{legend:Q.data.legend},y:{value:M},midAngle:h,isVisible:!0,hoverId:Q?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:Q.data.legend,dx:0,dy:0,connector:{end:b,curve:g[r.plotArea.connectorCurve],points:_?B(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:nr(t,u),color:r.plotArea.connectorColor??"#ccc",width:n,height:l,index:G}};let Z=e.filter(Q=>Q.x1-Q.x0>1e-4).map($);const ce=Q=>(Q.data.y?.value??0)!==0;Z=Z.filter(ce),Z=Yt(Z,r,Q=>Q.data.y.value);let ne=new Map(P.map(Q=>[Q.data?.x?.legend,Q])),ae=[];Z.forEach(Q=>{const G=Q.data.x.legend,M=ne.get(G);if(M){if(M.ratioDistance!=null&&M.ratioAngle!=null){const h=M.ratioDistance*p;Q.dx=Math.cos(M.ratioAngle)*h,Q.dy=Math.sin(M.ratioAngle)*h}else{const h=p/(M.radius||p);Q.dx=M.dx*h,Q.dy=M.dy*h}Q.data.isVisible=M.data?.isVisible??!0,M.connectorPoints?.length>=(_?3:2)?Q.connector.points=M.connectorPoints:Q.connector.points=_?B(Q.dx,Q.dy):[[0,0],[0,0]]}ae.push(Q)}),W.editMode(r.plotArea.annotationDraggable&&f).accessors({x(Q){return Math.cos(Q.midAngle-Math.PI/2)*(p-p*.35)},y(Q){return Math.sin(Q.midAngle-Math.PI/2)*(p-p*.35)}}).on("dragend",function(Q){ae.forEach(M=>{if(M.data.x.legend===Q.data.x.legend){const h=Q._dx,k=Q._dy,o=Math.sqrt(h*h+k*k),d=Math.atan2(k,h);M.dx=h,M.dy=k,M.ratioDistance=o/p,M.ratioAngle=d,M.width=n,M.height=l,M.connectorPoints=Q.connector?.points||[]}});const G=ae.map(M=>({data:{x:M.data.x,isVisible:M.data.isVisible??!0},dx:M.dx,dy:M.dy,ratioDistance:M.ratioDistance,ratioAngle:M.ratioAngle,connectorPoints:M.connectorPoints||[],width:n,height:l,radius:p}));L&&L(G)}).annotations(ae);const ue=s.append("g").attr("class","annotation-group parentGroup").attr("transform",c).call(W),ge=r.plotArea.dataLabelNameFontStyle??[];ue.selectAll(".annotation-note-title").style("font-family",r.plotArea.dataLabelNameFontFamily).style("font-size",`${r.plotArea.dataLabelNameFontSize}px`).style("font-style",ge.includes("Italic")?"italic":"").style("text-decoration",ge.includes("Underline")?"underline":"").style("font-weight",ge.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelNameColor??"#000");const be=r.plotArea.dataLabelValueFontStyle??[];if(ue.selectAll(".annotation-note-label").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("font-style",be.includes("Italic")?"italic":"").style("text-decoration",be.includes("Underline")?"underline":"").style("font-weight",be.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelValueColor??"#000"),r.plotArea.plotAreaAbsoluteValue&&ue.selectAll(".annotation-note-label").each(function(Q){const G=v.select(this),M=v.format(".2s")(Math.abs(Q.data.y.value));G.append("tspan").attr("x",G.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("fill",r.plotArea.dataLabelValueColor??"#000").text(M)}),b==="diamond"){const Q=r.plotArea.connectorColor??"#ccc",G=5;ue.selectAll(".annotation-connector").each(function(){v.select(this).select("path.connector").empty()||v.select(this).append("polygon").attr("class","connector-end connector-diamond").attr("points",`0,${-G} ${G},0 0,${G} ${-G},0`).style("fill",Q).style("stroke",Q)})}if(ue.selectAll("rect,.annotation-subject").remove(),r.animation?.animationEnabled){const Q=r.animation.animationDuration,G=et[r.animation.animationEffect],M=ue.selectAll(".annotation-note-label");M.interrupt().style("opacity",0),setTimeout(()=>{M.transition().delay((h,k)=>k*30).duration(Q).ease(G).style("opacity",1)},50)}const pe=r.plotArea.connectorColor??"#ccc";ue.selectAll(".connector").style("stroke",pe).attr("hoverId",Q=>Q.data.hoverId).attr("stroke-dasharray",U[r.plotArea.connectorStyle?.toLowerCase()]),ue.selectAll(".connector-end").attr("hoverId",Q=>Q.data.hoverId).style("fill",pe).style("stroke",pe),ue.selectAll(".annotation-note-title").attr("hoverId",Q=>Q.data.hoverId),ue.selectAll(".annotation-note-label").attr("hoverId",Q=>Q.data.hoverId).filter(Q=>!Q.data.isVisible).style("display","none"),ue.selectAll(".annotation-note-label").filter(Q=>r.plotArea.hideInsignificantValue&&Q.data.x1-Q.data.x0<.09).style("visibility","hidden")}catch(u){throw u}}const nr=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},nl=(t,e,r,c,x,n,l,s,p,f)=>{try{if(r.plotArea.numberOfBubbles){let L=e=="Bottom"?c-55:c-25;t.append("foreignObject").attr("transform",`translate(${n.left},${L})`).attr("width",x).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",Re.black).style("font-size","12px ").style("text-overflow","ellipsis").html((r.plotArea.totalAlias?r.plotArea.totalAliasText:"Total count : ")+f)}}catch(L){Ma(Ca,"setnumberOfBubbles",L)}};function Ma(t,e,r){console.error(`[${t}] [${e}]`,r)}const sr=({isDateType:t,formatOptions:e,data:r})=>{const c=crypto.randomUUID(),x=0,n=se.ColumnHistogramChart,l=Me.useRef(),s=r.ChartData,p=r.DimensionList,f=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,R,g,B,U,W,P,D,V,$,Z,ce,ne,ae,ue,ge,be=[],pe=[],Q,G,M,h,k,o,d,i,y,T,a,m,N,re=[],K=0;const me=2;let Le={dimensionList:p,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{ze()}catch(we){Ae("Columnchart","createColumnChart",we)}},[e]);const ze=()=>{({formatOptions:e,svg:k,width:Q,height:G}=St(l,e)),Se(),{maxNumberForPrimaryAxis:ce,maxNumberForSecondaryAxis:ne}=Et(e,Le.yMinLeft,Le.yMaxLeft,Le.yMinRight,Le.yMaxRight),{margin:R,yLabel:g,xLabel:B,yTitle:U,xTitle:W,dimensionHeightWidthArray:P,chartTitleHeight:D,secondaryAxisTitleWidth:V,legendMargin:$,secondaryYLabel:Z}=Ct(Q,G,ce,ne,Le.yMaxLeft,e,Le.legendList,Le.dimensionList,Le.yMaxRight,L,u,t),Ye(R),{dataTable:M,dataTableHeight:h}=aa(e,g,U,s,Le.dimensionList),Mt(k,Q,G,e),o=Ft(k,R),vt(o,e,h,ae,ue,n),ie(),ye(),fe(),Jt(o,e,h,g,a,ue),Pe(s,G,k,R,ae),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,k,o,M,x,d,i,y,void 0,void 0,h,n,e,g,U,Le.dimensionList,ae,T,Le.formattedDimensionListMap,c,R,ue)),wt(e,f,k,R,B,G,W,Le.chartType,g,ae,ue),Dt(ue,e,h,f,k,R,U,g),Ht(k,L,R,e,h,ue,ae,Z,V),Vt(k,e,Q,D),Pt(G,k,P,D,Q,$,e,s,c,h,R,ct.rectangle)},Se=()=>{const we=[],Ce=[];let ve=[],F=-1/0,le=1/0;s.forEach(O=>{Ce.push(O.legend),O.data.forEach(X=>{we.push(X),F=Math.max(F,X.value),le=Math.min(le,X.value)})}),Le.chartData=we,Le.legendList=Ce,Le.yMaxLeft=F,Le.yMinLeft=le>0?0:le,re=JSON.parse(JSON.stringify(s)),re.forEach(O=>O.data.forEach(X=>ve.push(X.value)));let he=S||S==0?S:0,te=b||b==0?b:re[0]?.data?.length;if(Le.yMaxLeft=parseFloat((he+"").length>(te+"").length?he+"":te+""),Le.xMax=v.max(ve),Le.xMin=v.min(ve),Le.xMin===Le.xMax){const O=Le.xMax===0?1:Math.abs(Le.xMax*.1);Le.xMin-=O,Le.xMax+=O}},ie=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=ae/50;break;case"Number of Bins":De(!1);break;case"Bin Width":De(!0)}},De=we=>{re.forEach(le=>le.data.sort(function(he,te){return he.value-te.value}));let Ce=Le.xMax-Le.xMin,ve;we?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ve=Ce/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ve=Ce/parseFloat(e.bins.binsCalculationValue));let F=Le.xMin;if(we)for(be=[F];F<Le.xMax;)F+=ve,be.push(F);else for(be=[F];Math.round(F)<Math.round(Le.xMax);)F+=ve,be.push(Math.round(F))},ye=()=>{i=v.scaleLinear().domain([Le.xMin,Le.xMax]).range([0,ae]);const we=be.length>0?be:i.ticks(ge);let Ce=v.bin().value(F=>F).domain(i.domain()).thresholds(we);re.forEach(F=>{let le=Ce(F.data.map(he=>he.value));pe.push(le)}),re.forEach((F,le)=>pe[le].forEach(he=>{he.name=F.properties.legend,he.color=F.properties.color,he.opacity=F.properties.opacity}));let ve=[];pe.forEach(F=>F.forEach(le=>ve.push(le.length))),Le.yMaxLeft=v.max(ve),Le.yMinLeft=v.min(ve),d=v.scaleLinear().range([ue,0]).domain([S||S==0?S:0,b||b==0?b:Le.yMaxLeft+.2*Le.yMaxLeft])},fe=()=>{$e();{let we=dt(Le.yMaxLeft,Le.yMinLeft,ue,e,Le,S,b,!1,ae);a=v.axisLeft(d).tickFormat(Ce=>Ze(Ce,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,ae)).tickValues(we.autoLabelFlag?void 0:we.yAxisLabelArray).ticks(we.customTickValue).tickPadding(8).tickSizeOuter(0)}},$e=()=>{let we=parseInt(e.xAxisLabel.xAxisPosition);Li(Le.xMax,Le.xMin,ae,e,_,A,ue,!1).xAxisLabelArray.shift(),m=(we==1?v.axisTop(i):v.axisBottom(i)).tickFormat(ve=>Ze(ve,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(sa(e,ue,h)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?m.ticks(ge):m.tickValues(be).ticks(ae/50)},Ue=we=>{const Ce=e.animation.animationEnabled,ve=o.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+c+" .rect").data(pe).enter().append("g").selectAll("rect").data(le=>le).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",1).attr("transform",function(le){return"translate("+i(le.x0)+","+ue+")"}).attr("width",function(le){return i(le.x1)-i(le.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(le.x1)-i(le.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",le=>le.color!==Re.white?le.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(le,he)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:`${he.x0}-${he.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():he.properties?.currentMeasure?he.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:Ze(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(he.length/re[0].data.length):he.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,le)}).on("mouseout",ot);(Ce?ve.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ve).attr("transform",function(le){return"translate("+i(le.x0)+","+(d(le.length)>0?d(le.length):0)+")"}).attr("height",function(le){return ue-d(le.length)}),o.selectAll(".parentGroup").raise()},Ye=we=>{ae=Q-we.left-we.right,ue=G-we.bottom-we.top},Pe=(we,Ce,ve,F,le)=>{if(!e.plotArea.fitChart){const he=we[0].data.length-me,te=Ce-20;N=Le.dimensionList.slice(K,K+me),re=JSON.parse(JSON.stringify(we)),re.forEach((H,E)=>re[E].data=H.data.filter(Y=>N.includes(Y.dimension))),ve.append("rect").attr("x",F.left).attr("y",te).attr("width",le).attr("height",8).attr("fill","#ddd").attr("rx",4);const O=le*me/Le.dimensionList.length,X=ve.append("rect").attr("x",F.left).attr("y",te).attr("width",O).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",H=>{let E=Math.min(Math.max(H.x,F.left),F.left+le-O);X.attr("x",E),K=Math.round((E-F.left)/(le-O)*he),N=Le.dimensionList.slice(K,K+me),re=JSON.parse(JSON.stringify(we)),re.forEach((Y,ee)=>re[ee].data=Y.data.filter(z=>N.includes(z.dimension))),$e(),Ee()}));ve.on("wheel",H=>{H.preventDefault();const E=Math.abs(H.deltaX)>Math.abs(H.deltaY)?H.deltaX:H.deltaY;K+=E>0?1:-1,K=Math.max(0,Math.min(K,he));const Y=F.left+(le-O)*K/he;X.attr("x",Y),re=JSON.parse(JSON.stringify(we)),re.forEach((ee,z)=>re[z].data=ee.data.filter(I=>N.includes(I.dimension))),$e(),Ee()})}Ee()},Ee=()=>{Ot(o,Le,B,e,h,d,m,P,G,x,t,ae,ue,N,i),Ue()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:c,style:{width:"100%",height:"100%"}})})},or=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID(),L=0,u=se.LineChart,S=Me.useRef(),b=Me.useRef(s);b.current=s;const _=Me.useRef(p);_.current=p;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled;let B=!1;const U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h=!1,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye,Pe,Ee=[],we=0,Ce=0,ve=0,F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(I){Ae("Linechart","createLineChart",I)}},[e]);const le=()=>{({formatOptions:e,svg:a,width:d,height:i}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:G,maxNumberForSecondaryAxis:M,customYaxisMaxValue:P,secondaryCustomYaxisMaxValue:V}=Et(e,F.yMinLeft,F.yMaxLeft,F.yMinRight,F.yMaxRight),{margin:$,yLabel:Z,xLabel:ce,yTitle:ne,xTitle:ae,dimensionHeightWidthArray:ue,chartTitleHeight:ge,secondaryAxisTitleWidth:be,legendMargin:pe,secondaryYLabel:Q,visibleBars:Ce,columnWidth:ve,scrollbarVisible:h}=Ct(d,i,G,M,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,U,t,g,F),ee($),{dataTable:y,dataTableHeight:T}=aa(e,Z,ne,A,F.dimensionList,r),g&&(y=[],T=0),Mt(a,d,i,e),m=Ft(a,$),vt(m,e,T,k,o,u,f),te(),H(),g?(ra(e,m,Z,o,k,$e),B&&pi(e,m,Q,Ue,k)):(Jt(m,e,T,Z,ze,o),B&&hi(m,e,T,Q,ie,o,k)),wt(e,g,a,$,ce,i,ae,F.chartType,Z,k,o),Dt(o,e,T,g,a,$,ne,Z,k),B&&Ht(a,B,$,e,T,o,k,Q,be,g),Vt(a,e,d,ge),Pt(i,a,ue,ge,d,pe,e,A,f,T,$,ct.line,u,n),Gt(A,i,d,a,$,k,h,Ce,F,we,!1,O,g)},he=()=>{const I=[],w=[];let C=[],q=-1/0,J=1/0,j=-1/0,Te=1/0;e.plotArea.hideZeroValues&&(F.hideZeroValues=!0),A.forEach(xe=>{w.push(xe.properties.alias?xe.properties.alias:xe.legend),xe.data.forEach(de=>{I.push(de),xe.properties.axis==="Secondary"?(B=!0,j=Math.max(j,de.value),Te=Math.min(Te,de.value)):(q=Math.max(q,de.value),J=Math.min(J,de.value))})}),F.chartData=I,F.legendList=w,F.yMaxLeft=q,F.yMinLeft=J,F.yMaxRight=j,F.yMinRight=Te,C=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(xe=>xe):F.dimensionList,F.dimensionList.forEach((xe,de)=>{F.formattedDimensionListMap.set(xe,C[de])}),Ee=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Pe=F.dimensionList:Pe=F.dimensionList.slice(we,we+Ce)},te=()=>{let I=dt(P||F.yMaxLeft,F.yMinLeft,o,e,F,W,P,g,k).yAxisLabelArray;F.yMaxLeft=I[I.length-1],F.yMinLeft=I[0];const w=g?[0,T>0?k-T:k]:[T>0?o-T:o,0];{const C=v.scaleLinear().domain([F.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:F.yMinLeft*.9:F.yMinLeft<0?F.yMinLeft*1.1:F.yMinLeft*.9,F.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:F.yMaxLeft*1.1]).range(w);g?ye=C:N=C}if(B){const C=v.scaleLinear().domain([F.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:F.yMinRight*1.1,F.yMaxRight<=0?V||0:V||F.yMaxRight*1.1]).range(w);g?fe=C:re=C}if(me=g?[o,0]:[0,k],!g&&e.seriesLabel.seriesLabelVisibility){let C=la(k,N,e,Ee,re,B,o,!1);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Le=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?me=[0,k-C.heightWidth[0]]:me=[C.heightWidth[0],k]}},O=(I,w,C)=>{Ee=w,Pe=I,Ce=C,z()},X=()=>{const I=v.scalePoint().domain(Pe).range(me).padding(.5);g?De=I:K=I},H=()=>{{let I=dt(P||F.yMaxLeft,F.yMinLeft,o,e,F,W,P,g,k);g?$e=v.axisBottom(ye).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-o:0).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/50).tickPadding(8).tickSizeOuter(0):ze=v.axisLeft(N).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,k,Le)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue).tickPadding(8).tickSizeOuter(0)}if(B){let I=dt(V||F.yMaxRight,D||F.yMinRight,o,e,F,D,V);g?Ue=v.axisTop(fe).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/50).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-o:0).tickPadding(8).tickSizeOuter(0):ie=v.axisRight(re).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue).tickSize(Rt(e,k,Le)).tickPadding(8).tickSizeOuter(0)}},E=()=>{g?Ye=v.axisLeft(De).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*k*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Pe,o)):Se=v.axisBottom(K).tickSize(sa(e,o,T,!0)).tickSizeOuter(0).tickValues(bt(Pe,k))},Y=I=>{const w=[...I].reverse();w.forEach(de=>{de.data.forEach(Fe=>{Fe.hideZero=de.properties.hideZeroValues,Fe.axis=de.properties.axis})});const C=g?v.line().y(de=>{const Fe=De(de.dimension);return Fe??0}).x(de=>de.axis===Qe.primary?ye(de.value):fe(de.value)).defined(de=>de.hideZero||F.hideZeroValues?!!de.value:!0).curve(mt(e)):v.line().x(de=>{const Fe=K(de.dimension);return Fe??0}).y(de=>de.axis===Qe.primary?N(de.value):re(de.value)).defined(de=>de.hideZero||F.hideZeroValues?!!de.value:!0).curve(mt(e)),q=e.animation.animationEnabled,J=de=>q?de.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):de;let j=m.selectAll(".parentGroup").data([w]);j=j.enter().append("g").attr("class","lines parentGroup").merge(j);let Te=j.selectAll(".line-group").data(de=>de),xe=Te.enter().append("g").attr("class","line-group");xe.append("path").attr("class","visibleLine").attr("fill","none"),xe.merge(Te).each(function(de){const Ve=v.select(this).selectAll("path.visibleLine").data([de]).join("path").attr("class","visibleLine").attr("d",ke=>C(ke.data)).attr("stroke",ke=>ke.properties.color!==Re.white?ke.properties.color:"none").attr("stroke-dasharray",ke=>{const Be=parseInt(ke.properties.lineWidth);switch(ke.properties.lineStyle){case pt.dotted:return`0,${Be+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",ke=>ke.properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",ke=>ke.properties.lineStyle!=="None"?ke.properties.lineWidth:0).attr("hoverId",(de.properties.alias||de.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${f}-clip)`).attr("d",ke=>C(ke.data)).attr(lt.SeriesId,ke=>ke.properties.legendUniqueId).attr(lt.DimValue,ke=>ke.properties.alias||ke.properties.name||"").on("click",Tt(_,b,(ke,Be)=>({seriesId:Be.properties.legendUniqueId,dimValue:Be.properties.alias||Be.properties.name||"",legendUniqueId:Be.properties.legendUniqueId,seriesDisplayName:Be.properties.alias||Be.properties.name||""})));q&&Ve.each(function(){const ke=v.select(this),Be=this.getTotalLength();ke.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",Be),J(ke).attr("stroke-dashoffset",0)})}),Te.exit().remove(),Da(j,w,"None",g?De:K,g?ye:N,g?fe:re,null,e,F,V,D,W,P,!1,l,g),m.selectAll(".parentGroup").raise()},ee=I=>{k=d-I.left-I.right,o=i-I.bottom-I.top},z=()=>{if(X(),E(),g?na(e,m,ce,o,k,Ye,Ue,ye,F.yMaxLeft,Pe,u,t,d,ue,ve,De):Ot(m,F,ce,e,T,N,Se,ue,i,k/Pe.length,t,k,o,Pe,K),Y(Ee),Ra(A,g?De:K,g?ye:N,g?fe:re,$,xt,[],[],e,u,i,d,k,Pe,o,f,a,x,void 0,void 0,c,!1,g),!g){let I=la(k,N,e,Ee,re,B,o,!1).labelArray;Ga(e,m,I),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,a,m,y,L,N,K,void 0,void 0,void 0,T,u,e,Z,ne,F.dimensionList,k,me,F.formattedDimensionListMap,f,$,o))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.StackLineChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=r.DimensionList,R=(Lt(r.ChartData,r.DimensionList)||[]).reverse(),g=!!e.swapAxis?.swapAxisEnabled,B=new Map,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye=[],Pe=0,Ee=2,we=!1,Ce=0,ve=[];const F=!1;let le={dimensionList:A,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{he()}catch(C){Ae("StackLinechart","createStackLineChart",C)}},[e]);const he=()=>{({formatOptions:e,svg:T,width:o,height:d}=St(S,e)),te(),{formatOptions:e}=ta(e,R,r.DataTableData??[]),{maxNumberForPrimaryAxis:G,maxNumberForSecondaryAxis:M}=Et(e,le.yMinLeft,le.yMaxLeft,le.yMinRight,le.yMaxRight),{margin:$,yLabel:Z,xLabel:ce,yTitle:ne,xTitle:ae,dimensionHeightWidthArray:ue,chartTitleHeight:ge,secondaryAxisTitleWidth:be,legendMargin:pe,secondaryYLabel:Q,visibleBars:Ee,columnWidth:Ce,scrollbarVisible:we}=Ct(o,d,G,M,le.yMaxLeft,e,le.legendList,le.dimensionList,le.yMaxRight,U,F,t,g,le),ee($),{dataTable:i,dataTableHeight:y}=aa(e,Z,ne,R,le.dimensionList,r),g&&(i=[],y=0),Mt(T,o,d,e),a=Ft(T,$),vt(a,e,y,h,k,u,f),O(),H(),g?ra(e,a,Z,k,h,ye):Jt(a,e,y,Z,Le,k),wt(e,g,T,$,ce,d,ae,le.chartType,Z,h,k),Dt(k,e,y,g,T,$,ne,Z,h),Ht(T,U,$,e,y,k,h,Q,be,g),Vt(T,e,o,ge),Pt(d,T,ue,ge,o,pe,e,[...R].reverse(),f,y,$,ct.line,u,n),Gt(R,d,o,T,$,h,we,Ee,le,Pe,!1,w,g),ti(B,g?Se:re,g?ie:m,$,xt,[],e,u,d,o,T,c,g)},te=()=>{const C=[],q=[];e.plotArea.hideZeroValues&&(le.hideZeroValues=!0),R.forEach((Fe,Ve)=>{const ke=`${Ve}~$~${Fe.properties.alias?Fe.properties.alias:Fe.legend}`;Fe.properties.legend=ke,q.push(ke);for(const Be of Fe.data)C.push(Be)}),le.chartData=C,le.legendList=q,Ye=JSON.parse(JSON.stringify(R));let J=At(le.dimensionList,R,F);e.plotArea.fitChart?Ue=le.dimensionList:(Ue=le.dimensionList.slice(Pe,Pe+Ee),Ye.forEach((Fe,Ve)=>Ye[Ve].data=Fe.data.filter(ke=>Ue.includes(ke.dimension))));const j=v.stack().keys(le.legendList).offset(v.stackOffsetDiverging)(J);I();let Te=1/0,xe=-1/0;for(const Fe of j)for(const[Ve,ke]of Fe)Te=Math.min(Te,Ve),xe=Math.max(xe,ke);le.yMinLeft=Te>0?0:Te,le.yMaxLeft=xe;let de=t?ft(e.xAxisLabel.xAxisNumberFormat,le.dimensionList).map(Fe=>Fe):le.dimensionList;le.dimensionList.forEach((Fe,Ve)=>{le.formattedDimensionListMap.set(Fe,de[Ve])})},O=()=>{let C=dt(P||le.yMaxLeft,le.yMinLeft,k,e,le,W,P,g,h).yAxisLabelArray;le.yMaxLeft=C[C.length-1],le.yMinLeft=C[0];const q=g?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const J=v.scaleLinear().domain([le.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:le.yMinLeft<0?le.yMinLeft*1.1:le.yMinLeft*.9,le.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:le.yMaxLeft*1.1]).range(q);g?ie=J:m=J}if(K=g?[k,0]:[0,h],!g&&e.seriesLabel.seriesLabelVisibility){let J=la(h,m,e,Ye,void 0,U,k,!0);J.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=J.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,h-J.heightWidth[0]]:K=[J.heightWidth[0],h]}X()},X=()=>{const C=v.scalePoint().domain(Ue).range(K).padding(.5);g?Se=C:re=C},H=()=>{E();{let C=dt(P||le.yMaxLeft,le.yMinLeft,k,e,le,W,P,g,h);g?ye=v.axisBottom(ie).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Le=v.axisLeft(m).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,h,me)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},E=()=>{g?$e=v.axisLeft(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Ue,k)):ze=v.axisBottom(re).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(bt(Ue,h))},Y=C=>{C.forEach(xe=>{xe.data.forEach(de=>{de.hideZero=xe.properties.hideZeroValues,de.axis=xe.properties.axis})});const q=g?v.line().y(xe=>{const de=Se(xe.data.dimension);return de??0}).x(xe=>xe[1]>0?ie(xe[1]):ie(xe[0])).defined(xe=>{const de=xe;return de.hideZero||le.hideZeroValues?de.data[de.key]:!0}).curve(mt(e)):v.line().x(xe=>{const de=re(xe.data.dimension);return de??0}).y(xe=>xe[1]>0?m(xe[1]):m(xe[0])).defined(xe=>{const de=xe;return de.hideZero||le.hideZeroValues?de.data[de.key]:!0}).curve(mt(e));let J=a.selectAll(".parentGroup").data([ve]);J=J.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(J);let j=J.selectAll(".line-group").data(xe=>xe);const Te=j.enter().append("g").attr("class",xe=>"line-group "+xe.key.replace(/ /g,"-"));Te.append("path").attr("class","line").attr("fill","none"),Te.merge(j).each(function(xe,de){const Fe=v.select(this),Ve=Fe.selectAll("path.visibleLine").data([xe]).join("path").attr("class","visibleLine").attr("hoverId",at=>(R[de]?.properties?.alias||R[de]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",q(xe)).attr("stroke",xe.color!==Re.white?xe.color:"none").attr("stroke-dasharray",at=>{const it=parseInt(R[de].properties.lineWidth.toString());switch(R[de].properties.lineStyle){case pt.dotted:return`0,${it+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",R[de].properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",R[de].properties.lineStyle!==pt.none?R[de].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,R[de].properties.legendUniqueId).attr(lt.DimValue,R[de].properties.alias||R[de].properties.name||"").on("click",Tt(_,b,()=>({seriesId:R[de].properties.legendUniqueId,dimValue:R[de].properties.alias||R[de].properties.name||"",legendUniqueId:R[de].properties.legendUniqueId,seriesDisplayName:R[de].properties.alias||R[de].properties.name||""}))),ke=e.animation.animationEnabled,Be=Ve.node().getTotalLength();ke?Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",Be).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",0),Fe.selectAll("path.hoverLine").data([xe]).join("path").attr("class","hoverLine").attr("d",q(xe)).attr("stroke",Re.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(){T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),T.selectAll('[hoverId="'+gi(R[de].properties.alias||R[de].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),j.exit().remove(),Da(J,C,u,g?Se:re,g?ie:m,g?De:N,null,e,le,V,D,W,P,!1,p,g)},ee=C=>{h=o-C.left-C.right,k=d-C.bottom-C.top},z=()=>{if(X(),E(),g?na(e,a,ce,k,h,$e,fe,ie,le.yMaxLeft,Ue,u,t,o,ue,Ce,Se):Ot(a,le,ce,e,y,m,ze,ue,d,L,t,h,k,Ue,re),I(),Y(Ye),za(ve,g?Se:re,g?ie:m,g?De:N,$,xt,[],[],e,u,d,o,h,Ue,k,f,T,x,y,c,g),!g){let C=la(h,m,e,Ye,void 0,U,k,!0).labelArray;Ga(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,T,a,i,L,m,re,void 0,void 0,void 0,y,se.LineChart,e,Z,ne,le.dimensionList,h,K,le.formattedDimensionListMap,f,$,k))}},I=()=>{let C=At(Ue,Ye,F);ve=v.stack().keys(le.legendList).offset(v.stackOffsetDiverging)(C),Ye.forEach((J,j)=>J.data.forEach((Te,xe)=>{Te[0]=ve[j][xe][0],Te[1]=ve[j][xe][1]}));let q=e.annotation.annotationSetLabelColor;ve.forEach((J,j)=>J.forEach(Te=>{Te.key=J.key,J.color=JSON.parse(JSON.stringify(R[j].properties.color)),J.individualAnnotationVisibility=JSON.parse(JSON.stringify(R[j].properties.individualAnnotationVisibility)),Te.data.labelPosition=R[j].properties.dataLabelPosition,Te.data.labelColor=q=="2"?JSON.parse(JSON.stringify(R[j].properties.color)):R[j].properties.labelColor,Te.hideZero=JSON.parse(JSON.stringify(R[j].properties.hideZeroValues)),Te.properties=R[j].properties}))},w=(C,q,J)=>{Ye=q,Ue=C,Ee=J,ai(r,B,Ue),z()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.NormalizedStackLineChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse()||[],R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue=[],Ye=0,Pe,Ee=0,we=!1,Ce=[];const ve=!0;let F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(C){Ae("NormalizedLinechart","createNormalizedLinechart",C)}},[e]);const le=()=>{({formatOptions:e,svg:y,width:k,height:o}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:Pe,columnWidth:Ee,scrollbarVisible:we}=Ct(k,o,Q,G,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,ve,t,g,F),ee(V),{dataTable:d,dataTableHeight:i}=aa(e,$,ce,A,F.dimensionList,r),g&&(d=[],i=0),Mt(y,k,o,e),T=Ft(y,V),vt(T,e,i,M,h,u,f),te(),H(),g?ra(e,T,$,h,M,De):Jt(T,e,i,$,me,h),wt(e,g,y,V,Z,o,ne,F.chartType,$,M,h),Dt(h,e,i,g,y,V,ce,$,M),Ht(y,B,V,e,i,h,M,pe,ge,g),Vt(y,e,k,ue),Pt(o,y,ae,ue,k,be,e,[...A].reverse(),f,i,V,ct.line,u,n),Gt(A,o,k,y,V,M,we,Pe,F,Ye,!1,z,g)},he=()=>{const C=[],q=[];e.plotArea.hideZeroValues&&(F.hideZeroValues=!0,A.forEach(de=>{de.data=de.data.filter(Fe=>Fe.value!==0)})),A.forEach((de,Fe)=>{const Ve=`${Fe}~$~${de.properties.legend}`;de.properties.legend=Ve,q.push(Ve);for(const ke of de.data)C.push(ke)}),F.chartData=C,F.legendList=q,Ue=JSON.parse(JSON.stringify(A)),$e=F.dimensionList;const J=At(F.dimensionList,A,ve),j=v.stack().keys(F.legendList).offset(v.stackOffsetDiverging)(J);w();let Te=1/0;for(const de of j)for(const[Fe]of de)Te=Math.min(Te,Fe);F.yMinLeft=Te>0?0:Te,F.yMaxLeft=1;const xe=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(de=>de):F.dimensionList;F.formattedDimensionListMap=new Map(F.dimensionList.map((de,Fe)=>[de,xe[Fe]]))},te=()=>{const C=g?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const q=v.scaleLinear().domain([F.yMinLeft<0?-1:0,1]).range(C);g?Se=q:a=q}if(re=g?[h,0]:[0,M],!g&&e.seriesLabel.seriesLabelVisibility){X(Ce,Ue);let q=la(M,a,e,Ue,void 0,B,h,!0);q.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(K=q.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?re=[0,M-q.heightWidth[0]]:re=[q.heightWidth[0],M]}},O=()=>{const C=v.scalePoint().domain($e).range(re).padding(.5);g?ze=C:N=C};function X(C,q){C.forEach((J,j)=>J.forEach((Te,xe)=>{q[j]&&q[j].data[xe]&&(q[j].data[xe][0]=Te[0]=Te.data.total===0?0:Te[0]/Te.data.total,q[j].data[xe][1]=Te[1]=Te.data.total===0?0:Te[1]/Te.data.total)}))}const H=()=>{g?De=v.axisBottom(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).ticks(i>0?(M-i)/80:M/80,"%").tickPadding(8).tickSizeOuter(0):me=v.axisLeft(a).tickSize(Rt(e,M,K)).ticks(i>0?(h-i)/80:h/80,"%").tickPadding(8).tickSizeOuter(0)},E=()=>{g?fe=v.axisLeft(ze).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt($e,h)):Le=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(bt($e,M))},Y=C=>{X(Ce,Ue),C.forEach(xe=>{xe.data.forEach(de=>{de.hideZero=xe.properties.hideZeroValues,de.axis=xe.properties.axis})});const q=g?v.line().y(xe=>{const de=ze(xe.data.dimension);return de??0}).x(xe=>xe[1]>0?Se(xe[1]):Se(xe[0])).curve(mt(e)):v.line().x(xe=>N(xe.data.dimension)?N(xe.data.dimension):null).y(xe=>xe[1]>0?a(xe[1]):a(xe[0])).curve(mt(e));let J=T.selectAll(".parentGroup").data([Ce]);J=J.enter().append("g").attr("class","lines parentGroup").merge(J);let j=J.selectAll(".line-group").data(xe=>xe),Te=j.enter().append("g").attr("class",xe=>"line-group "+xe.key.replace(/ /g,"-"));Te.attr("hoverId",xe=>(C[xe.index]?.properties?.alias||C[xe.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),Te.merge(j).each(function(xe,de){const Fe=v.select(this),Ve=Fe.selectAll("path.visibleLine").data([xe]).join("path").attr("class","visibleLine").attr("d",q(xe)).attr("stroke",xe.color!==Re.white?xe.color:"none").attr("stroke-dasharray",at=>{const it=parseInt(A[de].properties.lineWidth.toString());switch(A[de].properties.lineStyle){case pt.dotted:return`0,${it+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",A[de].properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",A[de].properties.lineStyle!==pt.none?A[de].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,A[de].properties.legendUniqueId).attr(lt.DimValue,A[de].properties.alias||A[de].properties.name||"").on("click",Tt(_,b,()=>({seriesId:A[de].properties.legendUniqueId,dimValue:A[de].properties.alias||A[de].properties.name||"",legendUniqueId:A[de].properties.legendUniqueId,seriesDisplayName:A[de].properties.alias||A[de].properties.name||""}))),ke=e.animation.animationEnabled,Be=Ve.node().getTotalLength();ke?Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",Be).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",0),Fe.selectAll("path.hoverLine").data([xe]).join("path").attr("class","hoverLine").attr("d",q(xe)).attr("stroke",Re.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(at,it){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),y.selectAll('[hoverId="'+gi(C[it.index]?.properties?.alias||C[it.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(at,it){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),y.selectAll('[hoverId="'+gi(C[it.index]?.properties?.alias||it[it.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),j.exit().remove(),Da(J,C,u,g?ze:N,g?Se:a,g?ie:m,null,e,F,D,P,U,W,!0,p,g)},ee=C=>{M=k-C.left-C.right,h=o-C.bottom-C.top},z=(C,q,J)=>{Ue=q,$e=C,Pe=J,I()},I=()=>{if(O(),w(),E(),g?na(e,T,Z,h,M,fe,ye,Se,F.yMaxLeft,$e,u,t,k,ae,Ee,ze):Ot(T,F,Z,e,i,a,Le,ae,o,L,t,M,h,$e,N),Y(Ue),za(Ce,g?ze:N,g?Se:a,g?ie:m,V,xt,[],[],e,u,o,k,M,$e,h,f,y,x,i,c,g),!g){let C=la(M,a,e,Ue,void 0,B,h,!0).labelArray;Ga(e,T,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,se.LineChart,e,$,ce,F.dimensionList,M,re,F.formattedDimensionListMap,f,V,h))}},w=()=>{let C=At($e,Ue,ve);Ce=v.stack().keys(F.legendList).offset(v.stackOffsetDiverging)(C),Ue.forEach((J,j)=>J.data.forEach((Te,xe)=>{Te[0]=Ce[j][xe][0],Te[1]=Ce[j][xe][1]}));let q=e.annotation.annotationSetLabelColor;Ce.forEach((J,j)=>J.forEach(Te=>{Te.key=J.key,J.color=JSON.parse(JSON.stringify(A[j].properties.color)),Te.data.labelPosition=A[j].properties.dataLabelPosition,Te.data.labelColor=q=="2"?JSON.parse(JSON.stringify(A[j].properties.color)):A[j].properties.labelColor,Te.hideZero=JSON.parse(JSON.stringify(A[j].properties.hideZeroValues)),Te.properties=A[j].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID();let L=0;const u=se.HorizontalBarChart,S=Me.useRef(),b=Me.useRef(s);b.current=s;const _=Me.useRef(p);_.current=p;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!0;let B=!1;const U=!1,W=new Map;let P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k=new Map,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye=[],fe=0,$e=2,Ue=!1,Ye={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{Pe()}catch(X){Ae("HorizontalBarchart","createHorizontalBarChart",X)}},[e]);const Pe=()=>{({formatOptions:e,svg:a,width:i,height:y}=St(S,e)),Ee(),{maxNumberForPrimaryAxis:M,maxNumberForSecondaryAxis:h,customYaxisMaxValue:D,secondaryCustomYaxisMaxValue:$}=Et(e,Ye.yMinLeft,Ye.yMaxLeft,Ye.yMinRight,Ye.yMaxRight),{margin:Z,yLabel:ce,xLabel:ne,yTitle:ae,xTitle:ue,dimensionHeightWidthArray:ge,chartTitleHeight:be,secondaryAxisTitleWidth:pe,legendMargin:Q,secondaryYLabel:G,visibleBars:$e,columnWidth:L,scrollbarVisible:Ue}=Ct(i,y,M,h,Ye.yMaxLeft,e,Ye.legendList,Ye.dimensionList,Ye.yMaxRight,B,U,t,g,Ye),he(Z),Mt(a,i,y,e),m=Ft(a,Z),vt(m,e,T,o,d,u,f),we(),ve(),ra(e,m,ce,d,o,ze),B&&pi(e,m,G,Se,o),wt(e,g,a,Z,ne,y,ue,Ye.chartType,ce,o,d),Dt(d,e,T,g,a,Z,ae,ce,o),Ht(a,B,Z,e,T,d,o,G,pe,g),Vt(a,e,i,be),Pt(y,a,ge,be,i,Q,e,A,f,T,Z,ct.rectangle,u,n),Gt(A,y,i,a,Z,o,Ue,$e,Ye,fe,!1,te,g)},Ee=()=>{const X=[],H=[];let E=[],Y=-1/0,ee=1/0,z=-1/0,I=1/0,w=1/0,C=-1/0;A.forEach(q=>{H.push(q.properties.legendUniqueId),C=-1/0,w=1/0,q.data.forEach(J=>{X.push(J),q.properties.axis==="Secondary"?(B=!0,z=Math.max(z,J.value),I=Math.min(I,J.value)):(Y=Math.max(Y,J.value),ee=Math.min(ee,J.value)),C=Math.max(C,J.value),w=Math.min(w,J.value)}),q.properties.setColorScale&&W.set(q.properties.legendUniqueId,v.scaleSequential().domain([w,C]).interpolator(oi.interpolateRgb(q.properties.startColor,q.properties.endColor)))}),Ye.chartData=X,Ye.legendList=H,Ye.yMaxLeft=Y,Ye.yMinLeft=ee>0?0:ee,Ye.yMaxRight=z,Ye.yMinRight=I>0?0:I,E=t?ft(e.xAxisLabel.xAxisNumberFormat,Ye.dimensionList).map(q=>q):Ye.dimensionList,Ye.dimensionList.forEach((q,J)=>{Ye.formattedDimensionListMap.set(q,E[J])}),ye=JSON.parse(JSON.stringify(A)),De=Ye.dimensionList,e.plotArea.hideZeroValues&&(Ye.hideZeroValues=!0)},we=()=>{let X=dt(Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,P,D,g,o).yAxisLabelArray;Ye.yMaxLeft=X[X.length-1],Ye.yMinLeft=X[0],K=v.scaleLinear().domain([Ye.yMinLeft>=0?P!==void 0&&!Number.isNaN(P)?P:0:Ye.yMinLeft<0?Ye.yMinLeft*1.1:Ye.yMinLeft*.9,Ye.yMaxLeft<=0?0:D!==void 0&&!Number.isNaN(D)?D:Ye.yMaxLeft*1.1]).range([0,o]),B&&(me=v.scaleLinear().domain([Ye.yMinRight>=0?(V||V==0)&&!Number.isNaN(V)?V:0:(V||V==0)&&!Number.isNaN(V)?V:Ye.yMinRight*1.1,Ye.yMaxRight<=0?$||0:$||Ye.yMaxRight*1.1]).range([0,o])),Le=[d,0]},Ce=()=>{re=v.scaleBand().domain(Ye.legendList).range([0,L]).paddingInner(Ye.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(De).range(Le).padding(.5)},ve=()=>{{let X=dt(D||Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,P,D,g,o);ze=v.axisBottom(K).tickFormat(H=>Ze(H,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(X.autoLabelFlag?void 0:X.yAxisLabelArray).ticks(X.customTickValue).tickPadding(8).tickSizeOuter(0)}if(B){let X=dt($||Ye.yMaxRight,V||Ye.yMinRight,d,e,Ye,V,$);Se=v.axisTop(me).tickFormat(H=>Ze(H,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(X.autoLabelFlag?void 0:X.yAxisLabelArray).ticks(X.customTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0)}},F=()=>{ie=v.axisLeft(N).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*o*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(De,d))},le=X=>{X.forEach(H=>{H.data.forEach(E=>{E.hideZero=H.properties.hideZeroValues,E.axis=H.properties.axis,E.legendUniqueId=H.properties.legendUniqueId})}),De.forEach(H=>{m.append("rect").attr("id",`dim-background-${H}`).attr("class","dimension-background").attr("y",N(H)-L/2).attr("height",L).attr("x",0).attr("width",o).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),X.forEach(H=>{let E=m.selectAll(".parentGroup").data([H],w=>w.properties.legendUniqueId);E=E.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(E);let Y=E.selectAll(".column-group").data(H.data.map(w=>({...w,properties:H.properties})),w=>w.legend+w.dimension),ee=Y.enter().append("g").attr("class","column-group").attr("hoverId",(H.properties.alias||H.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",w=>`translate(0, ${N(w.dimension)-L/2})`);Y.attr("transform",w=>`translate(0, ${N(w.dimension)-L/2})`),ee.merge(Y).attr("transform",w=>`translate(0, ${N(w.dimension)-L/2})`);const z=ee.append("rect").attr("y",w=>re(w.legendUniqueId)).attr("height",re.bandwidth()).attr("x",w=>{const C=H.properties.axis===Qe.primary?K:me;return w.value>=0,C(0)}).attr("width",0).attr("fill",w=>W.get(H.properties.legendUniqueId)?.(w.value)??H.properties.color).attr("stroke-dasharray",w=>w.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",w=>`${w.properties.stackBorderWidth}px`).attr("stroke",w=>H.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?H.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",w=>w.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>H.properties.legendUniqueId).attr(lt.DimValue,w=>Array.isArray(w.dimension)?String(w.dimension[0]):String(w.dimension));(e.animation.animationEnabled?z.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):z).attr("x",w=>{const C=H.properties.axis===Qe.primary?K:me;return w.value>=0?C(0):C(w.value)}).attr("width",w=>{const C=H.properties.axis===Qe.primary?K:me,q=H.properties.axis===Qe.primary?D:$;return w.value>=0?q&&w.value>q?C(q)-C(0):C(w.value)-C(0):Math.abs(C(0)-C(w.value))}),ee.merge(Y).on("mousemove",(w,C)=>{(H.properties.alias||H.properties.name||"Legend").replace(/ /g,"-");const q=Array.isArray(C.dimension)?C.dimension[0]:C.dimension,J=String(Ye.formattedDimensionListMap.get(q)??q??""),j=gt(l,String(q??""),{...H.properties,formattedDimensionValue:J});yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Ye.formattedDimensionListMap.get(Array.isArray(C.dimension)?C.dimension[0]:C.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||C.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(u)?C[1]-C[0]:C.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,w,H.properties,j)}).on("mouseout",(w,C)=>{(H.properties.alias||H.properties.name||"Legend").replace(/ /g,"-"),ot()}).on("click",Tt(_,b,(w,C)=>({seriesId:H.properties.legendUniqueId,dimValue:Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension),legendUniqueId:H.properties.legendUniqueId,seriesDisplayName:H.properties.alias||H.properties.name||""}))),Y.exit().remove()}),m.selectAll(".parentGroup").raise()},he=X=>{o=i-X.left-X.right,d=y-X.bottom-X.top},te=(X,H,E)=>{ye=H,De=X,$e=E,ai(r,k,De),e.xAxisLabel.hideZeroValues&&(De=De.filter(Y=>k.get(Y)!==0)),O()},O=()=>{Ce(),F(),na(e,m,ne,d,o,ie,Se,K,Ye.yMaxLeft,De,u,t,i,ge,L,N),le(ye),Ra(ye,N,K,me,Z,xt,[],[],e,u,y,i,o,De,d,f,a,x,re,L,c,!1,g)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},ur=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.StackHorizontalBarChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse(),R=r.DimensionList,g=!0,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe;const Q=new Map;let G,M,h,k,o,d,i,y,T,a,m,N,re=[],K=0,me=2,Le=!1,ze=[];const Se=!1;let ie=new Map,De={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{ye()}catch(O){Ae("StackStackHorizontalBarchart","createStackHorizontalBarChart",O)}},[e]);const ye=()=>{({formatOptions:e,svg:o,width:h,height:k}=St(S,e)),fe(),{maxNumberForPrimaryAxis:be,maxNumberForSecondaryAxis:pe}=Et(e,De.yMinLeft,De.yMaxLeft,De.yMinRight,De.yMaxRight),{margin:P,yLabel:D,xLabel:V,yTitle:$,xTitle:Z,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:ae,legendMargin:ue,secondaryYLabel:ge,visibleBars:me,columnWidth:L,scrollbarVisible:Le}=Ct(h,k,be,pe,De.yMaxLeft,e,De.legendList,De.dimensionList,De.yMaxRight,B,Se,t,g,De),we(P),Mt(o,h,k,e),d=Ft(o,P),vt(d,e,0,G,M,u,f),$e(),Ye(),ra(e,d,D,M,G,a),wt(e,g,o,P,V,k,Z,De.chartType,D,G,M),Dt(M,e,0,g,o,P,$,D,h),Vt(o,e,h,ne),Pt(k,o,ce,ne,h,ue,e,[...A].reverse(),f,0,P,ct.rectangle,u,n),Gt(A,k,h,o,P,G,Le,me,De,K,!1,Ce,g)},fe=()=>{const O=[],X=[];let H=-1/0,E=1/0;A.forEach((C,q)=>{const J=`${q}~$~${C.properties.legend}`;C.properties.legend=J,X.push(J),H=-1/0,E=1/0;for(const j of C.data)H=Math.max(H,j.value),E=Math.min(E,j.value),O.push(j);C.properties.setColorScale&&Q.set(C.properties.legendUniqueId,v.scaleSequential().domain([E,H]).interpolator(v.interpolateRgb(C.properties.startColor,C.properties.endColor)))}),De.chartData=O,De.legendList=X,re=JSON.parse(JSON.stringify(A));let Y=At(De.dimensionList,A,Se);e.plotArea.fitChart?N=De.dimensionList:(N=De.dimensionList.slice(K,K+me),re.forEach((C,q)=>re[q].data=C.data.filter(J=>N.includes(J.dimension))));const ee=v.stack().keys(De.legendList).offset(v.stackOffsetDiverging)(Y);F();let z=1/0,I=-1/0;for(const C of ee)for(const[q,J]of C)z=Math.min(z,q),I=Math.max(I,J);De.yMinLeft=z>0?0:z,De.yMaxLeft=I;let w=t?ft(e.xAxisLabel.xAxisNumberFormat,De.dimensionList).map(C=>C):De.dimensionList;De.dimensionList.forEach((C,q)=>{De.formattedDimensionListMap.set(C,w[q])}),e.plotArea.hideZeroValues&&(De.hideZeroValues=!0)},$e=()=>{let O=dt(De.yMaxLeft,De.yMinLeft,M,e,De,U,W,g,G).yAxisLabelArray;De.yMaxLeft=O[O.length-1],De.yMinLeft=O[0],i=v.scaleLinear().domain([De.yMinLeft>=0?U!==void 0&&!Number.isNaN(U)?U:0:De.yMinLeft<0?De.yMinLeft*1.1:De.yMinLeft*.9,De.yMaxLeft<=0?0:W!==void 0&&!Number.isNaN(W)?W:De.yMaxLeft*1.1]).range([0,G]),T=[M,0]},Ue=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Ye=()=>{{let O=dt(W||De.yMaxLeft,De.yMinLeft,M,e,De,U,W,g,G);a=v.axisBottom(i).tickFormat(X=>Ze(X,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-M:0).tickValues(O.autoLabelFlag?void 0:O.yAxisLabelArray).ticks(O.customTickValue).tickPadding(8).tickSizeOuter(0)}},Pe=()=>{m=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*G*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(N,M))},Ee=O=>{O.forEach(w=>{w.data.forEach(C=>{C.hideZero=w.properties.hideZeroValues,C.axis=w.properties.axis})}),N.forEach(w=>{d.append("rect").attr("id",`dim-background-${w}`).attr("class","dimension-background").attr("y",y(w)-L/2).attr("height",L).attr("x",0).attr("width",G).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let X=d.selectAll(".parentGroup").data([ze]);X=X.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(X);let H=X.selectAll(".column-group").data(w=>w);H=H.enter().append("g").attr("class",w=>"column-group "+w.key.replace(/ /g,"-")).attr("hoverId",w=>(O[w.index].properties.alias||O[w.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(H);let Y=H.selectAll("rect").data(w=>w);const ee=(w,C)=>{const q=Array.from(H.nodes()).indexOf(w[C].parentNode);return{props:A[q]?.properties,groupIndex:q}},z=Y.enter().append("rect").merge(Y).attr("y",w=>y(w.data.dimension)-L/2).attr("height",L).attr("fill",(w,C,q)=>{const{props:J}=ee(q,C);return Q.get(J.legendUniqueId)?.(w.data[w.key])??J?.color??"gray"}).attr("stroke",(w,C,q)=>{const J=ee(q,C).props;return J?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?J.stackBorderColor:"none"}).attr("stroke-dasharray",(w,C,q)=>ee(q,C).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(w,C,q)=>(ee(q,C).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",w=>Math.min(i(w[0]),i(w[1]))).attr("width",0).attr("visibility",(w,C,q)=>{const J=ee(q,C).props;return w.data[w.key]===0&&J?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,w=>w.key??"").attr(lt.DimValue,w=>Array.isArray(w.data.dimension)?String(w.data.dimension[0]):String(w.data.dimension)).on("mousemove",(w,C)=>{const q=C.data.dimension;yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:De.formattedDimensionListMap.get(q)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||C.value,value:Ze(C.data[C.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,w,C.properties,gt(p,String(q??""),{...C.properties,formattedDimensionValue:String(De.formattedDimensionListMap.get(q)??q??"")}))}).on("mouseout",(w,C)=>{C.data.dimension,ot()}).on("click",Tt(_,b,(w,C)=>({seriesId:C.key,dimValue:Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension),legendUniqueId:C.key,seriesDisplayName:C.properties?.alias||C.properties?.name||""})));z.attr("x",w=>i(0)),(e.animation.animationEnabled?z.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):z).attr("x",w=>Math.min(i(w[0]),i(w[1]))).attr("width",w=>Math.abs(i(w[1])-i(w[0]))),H.exit().remove(),d.selectAll(".parentGroup").raise()},we=O=>{G=h-O.left-O.right,M=k-O.bottom-O.top},Ce=(O,X,H)=>{re=X,N=O,me=H,ai(r,ie,N),F(),ve()},ve=()=>{Ue(),Pe(),na(e,d,V,M,G,m,void 0,i,De.yMaxLeft,N,u,t,h,ce,L,y);const O=new Map;N.forEach((X,H)=>{let E=0;ze.forEach(Y=>{const ee=Y[H]?.[0]??0;ee<E&&(E=ee)}),O.set(X,E)}),Ee(re),za(ze,y,i,void 0,P,xt,[],[],e,u,k,h,G,N,M,f,o,x,0,c,g),ti(ie,y,i,P,xt,[],e,u,k,h,o,c,g,O),le(),d.selectAll(".connectors").raise()},F=()=>{let O=At(N,re,Se);ze=v.stack().keys(De.legendList).offset(v.stackOffsetDiverging)(O),re.forEach((H,E)=>H.data.forEach((Y,ee)=>{Y[0]=ze[E][ee][0],Y[1]=ze[E][ee][1]}));let X=e.annotation.annotationSetLabelColor;ze.forEach((H,E)=>H.forEach(Y=>{Y.key=H.key,H.color=JSON.parse(JSON.stringify(A[E].properties.color)),Y.data.labelPosition=A[E].properties.dataLabelPosition,Y.data.labelColor=X=="2"?JSON.parse(JSON.stringify(A[E].properties.color)):A[E].properties.labelColor,Y.hideZero=JSON.parse(JSON.stringify(A[E].properties.hideZeroValues)),Y.properties=A[E].properties}))},le=()=>{try{const O=Number(e.connector?.connectorVisibility);if(!e.connector||O===2)return;const X=[],H=[],E=[];let Y;const ee=[];if(O===1)Y=1;else if(O===3){const j=Number(e.connector.connectorFollow);j===1?Y=Number(e.connector.connectorStepSize):j===2&&((e.connector.connectorExclude||[]).forEach(Te=>E.push(Te)),Y=1)}const z=[],I=[],w=[],C=e.connector?.connectorCustomRange||[];E.forEach(j=>{const Te=j.split("-");Te.length&&z.push(Te[0])});const J=(ze?.[0]||[]).map((j,Te)=>({Dimension:j.data.dimension,Total:j.data.total,CustomTotal:j.data.total-(w[Te]??0),Index:Te}));if(Y!=null){for(let j=0;j<J.length;j++)(Y===1||j%Y===0&&Y!==1)&&X.push(J[j]);for(let j=Y;j<J.length;j+=Y){const Te=Math.min(j+Y,J.length);let xe=-1/0;for(let de=j;de<Te;de++)J[de].Total>xe&&(xe=J[de].Total);xe!==-1/0&&ee.push(xe)}for(let j=1;j<X.length;j++)H.push(X[j])}else{const j=[];(C||[]).forEach(Te=>{if(Te?.from&&Te?.to){const xe=J.some(Fe=>Fe.Dimension===Te.from),de=J.some(Fe=>Fe.Dimension===Te.to);xe&&de&&j.push({from:Te.from,to:Te.to})}}),j.forEach(Te=>{const xe=J.findIndex(Fe=>Fe.Dimension===Te.from),de=J.findIndex(Fe=>Fe.Dimension===Te.to);if(xe>=0&&de>=0){const Fe=Math.min(xe,de),Ve=Math.max(xe,de);X.push(J[Fe]);let ke=J[Fe]?.Total??-1/0;for(let Be=Fe;Be<=Ve;Be++)J[Be].Total>ke&&(ke=J[Be].Total);ke!==-1/0&&ee.push(ke),H.push(J[Ve])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Re.white?e.connector.connectorMarkerColor:"none"),he(X,ee,H,Y,z),te(X,ee,H,Y,z)}catch(O){console.error(O)}},he=(O,X,H,E,Y)=>{try{const ee=y.bandwidth()??0,z=d.selectAll(".connector-paths").data([0]),I=z.enter().append("g").attr("class","connector-paths connectors").merge(z),w=O.filter((J,j)=>E!=null?j<O.length-1:j<O.length),C=I.selectAll("path.connector-path").data(w,(J,j)=>J?.Dimension??j);C.exit().remove(),C.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(C).attr("d",(J,j)=>{const Te=H?.[j]??{Total:0,Dimension:J.Dimension},xe=J?.Total??0,de=typeof Te.Total=="number"?i(Te.Total):0,Fe=typeof xe=="number"?i(xe):0,Ve=Math.max(de,Fe);return e.total.totalVisibility?`M ${Fe+50},
74
- ${y(J.Dimension)+ee/2-5}
75
- H ${60+Ve}
76
- V ${y(Te.Dimension)+ee/2+5}
77
- H ${30+de}`:`M ${Fe+30},
78
- ${y(J.Dimension)+ee/2-5}
79
- H ${45+Ve}
80
- V ${y(Te.Dimension)+ee/2+5}
81
- H ${10+de}`}).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(J,j)=>Y.includes(J.Dimension)||J.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}},te=(O,X,H,E,Y)=>{try{const ee=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,z=Mi(ee,L);let I=e.connector.connectorFontStyle,w=e.connector.connectorNumberFormat,C=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(w=".2s");const q=O.filter((de,Fe)=>E!=null?Fe<O.length-1:Fe<O.length),J=d.selectAll(".connector-texts").data([0]),Te=J.enter().append("g").attr("class","connector-texts connectors").merge(J).selectAll("text.connector-text").data(q,de=>de?.Dimension??de);Te.exit().remove(),Te.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(Te).attr("y",(de,Fe)=>{const Ve=H?.[Fe]??{Dimension:de.Dimension,Total:0},ke=y(de.Dimension)??0;return(y(Ve.Dimension)??ke)+E*z/2}).attr("x",(de,Fe)=>{const Ve=H?.[Fe]??{Total:0},ke=de?.Total??0,Be=Math.max(i(Ve.Total),i(ke));return e.total.totalVisibility?70+Be:50+Be}).text((de,Fe)=>{const Ve=H?.[Fe]??{Total:0,CustomTotal:0,Dimension:de.Dimension};return de.CustomTotal==0&&Ve.CustomTotal!=0&&(de.CustomTotal=1),Ai(Ve.Total,de.Total,parseInt(e.connector.connectorDecimalPrecision),w,parseInt(de.Dimension),parseInt(Ve.Dimension),e)}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",I.includes("Italic")?"Italic":"").style("text-decoration",I.includes("Underline")?"Underline":"").style("font-weight",I.includes("Bold")?"Bold":"").style("visibility",(de,Fe)=>Y.includes(de.Dimension)||de.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},hr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.NormalizedStackHorizontalBarChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse(),R=r.DimensionList,g=!0,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h;const k=new Map;let o,d,i,y,T,a,m,N,re=[],K=0,me,Le=!1,ze=[];const Se=!0;let ie={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{De()}catch(F){Ae("StackNormalizedStackBarchart","createNormalizedStackBarChart",F)}},[e]);const De=()=>{({formatOptions:e,svg:o,width:M,height:h}=St(S,e)),ye(),{maxNumberForPrimaryAxis:be,maxNumberForSecondaryAxis:pe}=Et(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:P,yLabel:D,xLabel:V,yTitle:$,xTitle:Z,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:ae,legendMargin:ue,secondaryYLabel:ge,visibleBars:me,columnWidth:L,scrollbarVisible:Le}=Ct(M,h,be,pe,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,B,Se,t,g,ie),Ee(P),Mt(o,M,h,e),d=Ft(o,P),vt(d,e,0,Q,G,u),fe(),Ue(),ra(e,d,D,G,Q,a),wt(e,g,o,P,V,h,Z,ie.chartType,D,Q,G),Dt(G,e,0,g,o,P,$,D,Q),Vt(o,e,M,ne),Pt(h,o,ce,ne,M,ue,e,[...A].reverse(),f,0,P,ct.rectangle,u,n),Gt(A,h,M,o,P,Q,Le,me,ie,K,!1,ve,g)},ye=()=>{const F=[],le=[];let he=-1/0,te=1/0;A.forEach((Y,ee)=>{const z=`${ee}~$~${Y.properties.legend}`;Y.properties.legend=z,le.push(z),he=-1/0,te=1/0;for(const I of Y.data)he=Math.max(he,I.value),te=Math.min(te,I.value),F.push(I);Y.properties.setColorScale&&k.set(Y.properties.legendUniqueId,v.scaleSequential().domain([te,he]).interpolator(v.interpolateRgb(Y.properties.startColor,Y.properties.endColor)))}),ie.chartData=F,ie.legendList=le,re=JSON.parse(JSON.stringify(A));let O=At(ie.dimensionList,A,Se);e.plotArea.fitChart?N=ie.dimensionList:(N=ie.dimensionList.slice(K,K+me),re.forEach((Y,ee)=>re[ee].data=Y.data.filter(z=>N.includes(z.dimension))));const X=v.stack().keys(ie.legendList).offset(v.stackOffsetDiverging)(O);Ce();let H=1/0;for(const Y of X)for(const[ee,z]of Y)H=Math.min(H,ee);ie.yMinLeft=H>0?0:H,ie.yMaxLeft=1;let E=t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(Y=>Y):ie.dimensionList;ie.dimensionList.forEach((Y,ee)=>{ie.formattedDimensionListMap.set(Y,E[ee])}),e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0)},fe=()=>{let F=dt(W||ie.yMaxLeft,ie.yMinLeft,G,e,ie,U,W,g,Q).yAxisLabelArray;ie.yMaxLeft=F[F.length-1],ie.yMinLeft=F[0],i=v.scaleLinear().domain([ie.yMinLeft<0?-1:0,1]).range([0,Q]),T=[G,0]},$e=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Ue=()=>{a=v.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-G:0).ticks(Q/80,"%").tickPadding(8).tickSizeOuter(0)},Ye=()=>{m=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*Q*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(N,G))},Pe=F=>{ze.forEach((Y,ee)=>Y.forEach((z,I)=>{F[ee].data[I][0]=z[0]=z.data.total===0?0:z[0]/z.data.total,F[ee].data[I][1]=z[1]=z.data.total===0?0:z[1]/z.data.total})),F.forEach(Y=>{Y.data.forEach(ee=>{ee.hideZero=Y.properties.hideZeroValues,ee.axis=Y.properties.axis})}),N.forEach(Y=>{d.append("rect").attr("id",`dim-background-${Y}`).attr("class","dimension-background").attr("y",y(Y)-y.bandwidth()/2).attr("height",y.bandwidth()).attr("x",0).attr("width",Q).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let le=d.selectAll(".parentGroup").data([ze]);le=le.enter().append("g").attr("class","columns parentGroup").merge(le);let he=le.selectAll(".column-group").data(Y=>Y);he=he.enter().append("g").attr("class",Y=>"column-group "+Y.key.replace(/ /g,"-")).attr("hoverId",Y=>(F[Y.index].properties.alias||F[Y.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(he);let O=he.selectAll("rect").data(Y=>Y);const X=(Y,ee)=>{const z=Array.from(he.nodes()).indexOf(Y[ee].parentNode);return{props:A[z]?.properties,groupIndex:z}},H=O.enter().append("rect").merge(O).attr("y",Y=>y(Y.data.dimension)-L/2).attr("height",L).attr("fill",(Y,ee,z)=>{const{props:I}=X(z,ee);return k.get(I.legendUniqueId)?.(Y.data[Y.key])??I?.color??"gray"}).attr("stroke",(Y,ee,z)=>{const I=X(z,ee).props;return I?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?I.stackBorderColor:"none"}).attr("stroke-dasharray",(Y,ee,z)=>X(z,ee).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(Y,ee,z)=>(X(z,ee).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",Y=>i(0)).attr("width",0).attr("visibility",(Y,ee,z)=>{const I=X(z,ee).props;return Y.data[Y.key]===0&&I?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,Y=>Y.key??"").attr(lt.DimValue,Y=>Array.isArray(Y.data.dimension)?String(Y.data.dimension[0]):String(Y.data.dimension)).on("mousemove",(Y,ee)=>{const z=ee.data.dimension;yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ie.formattedDimensionListMap.get(z)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ee.properties?.currentMeasure?ee.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||ee.value,value:Ze(ee[1]-ee[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ee.properties.alias}],e,Y,ee.properties,gt(p,String(z??""),{...ee.properties,formattedDimensionValue:String(ie.formattedDimensionListMap.get(z)??z??"")}))}).on("mouseout",(Y,ee)=>{let z=(ee.properties.alias||ee.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+z+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}).on("click",Tt(_,b,(Y,ee)=>({seriesId:ee.key,dimValue:Array.isArray(ee.data.dimension)?String(ee.data.dimension[0]):String(ee.data.dimension),legendUniqueId:ee.key,seriesDisplayName:ee.properties?.alias||ee.properties?.name||""})));(e.animation.animationEnabled?H.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):H).attr("x",Y=>Math.min(i(Y[0]),i(Y[1]))).attr("width",Y=>Math.abs(i(Y[1])-i(Y[0]))),he.exit().remove(),d.selectAll(".parentGroup").raise()},Ee=F=>{Q=M-F.left-F.right,G=h-F.bottom-F.top},we=()=>{$e(),Ye(),na(e,d,V,G,Q,m,void 0,i,ie.yMaxLeft,N,u,t,M,ce,L,y),Pe(re),za(ze,y,i,void 0,P,xt,[],[],e,u,h,M,Q,N,G,f,o,x,0,c,g)},Ce=()=>{let F=At(N,re,Se);ze=v.stack().keys(ie.legendList).offset(v.stackOffsetDiverging)(F),re.forEach((he,te)=>he.data.forEach((O,X)=>{O[0]=ze[te][X][0],O[1]=ze[te][X][1]}));let le=e.annotation.annotationSetLabelColor;ze.forEach((he,te)=>he.forEach(O=>{O.key=he.key,he.color=JSON.parse(JSON.stringify(A[te].properties.color)),O.data.labelPosition=A[te].properties.dataLabelPosition,O.data.labelColor=le=="2"?JSON.parse(JSON.stringify(A[te].properties.color)):A[te].properties.labelColor,O.hideZero=JSON.parse(JSON.stringify(A[te].properties.hideZeroValues)),O.properties=A[te].properties}))},ve=(F,le,he)=>{re=le,N=F,me=he,Ce(),we()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},xr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.LayeredHorizontalBarChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!0,B=!1,U=new Map;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re=[],K=0,me=2,Le=!1,ze=[];const Se=!1;let ie={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{De()}catch(te){Ae("StackStackHorizontalBarchart","createStackHorizontalBarChart",te)}},[e]);const De=()=>{({formatOptions:e,svg:o,width:h,height:k}=St(S,e)),ye(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be,visibleBars:me,columnWidth:L,scrollbarVisible:Le}=Ct(h,k,pe,Q,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,B,Se,t,g,ie),Ee(D),Mt(o,h,k,e),d=Ft(o,D),vt(d,e,0,G,M,u,f),fe(),Ue(),ra(e,d,V,M,G,a),wt(e,g,o,D,$,k,ce,ie.chartType,V,G,M),Dt(M,e,0,g,o,D,Z,V),Vt(o,e,h,ae),Pt(k,o,ne,ae,h,ge,e,A,f,0,D,ct.rectangle,u,n),Gt(A,k,h,o,D,G,Le,me,ie,K,!1,we,g)},ye=()=>{const te=[],O=[];let X=[],H=-1/0,E=1/0,Y=-1/0,ee=1/0,z=-1/0,I=1/0;A.forEach(w=>{O.push(w.properties.legendUniqueId),z=-1/0,I=1/0,w.data.forEach(C=>{te.push(C),z=Math.max(z,C.value),I=Math.min(I,C.value),H=Math.max(H,C.value),E=Math.min(E,C.value)}),w.properties.setColorScale&&U.set(w.properties.legendUniqueId,v.scaleSequential().domain([I,z]).interpolator(v.interpolateRgb(w.properties.startColor,w.properties.endColor)))}),ie.chartData=te,ie.legendList=O,ie.yMaxLeft=H,ie.yMinLeft=E>0?0:E,ie.yMaxRight=Y,ie.yMinRight=ee,X=t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(w=>w):ie.dimensionList,X=t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(w=>w):ie.dimensionList,ie.dimensionList.forEach((w,C)=>{ie.formattedDimensionListMap.set(w,X[C]),ie.formattedDimensionListMap.set(w,X[C])}),re=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?N=ie.dimensionList:N=ie.dimensionList.slice(K,K+me),e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0)},fe=()=>{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P,g,G).yAxisLabelArray;ie.yMaxLeft=te[te.length-1],ie.yMinLeft=te[0],i=v.scaleLinear().domain([ie.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:ie.yMinLeft<0?ie.yMinLeft*1.1:ie.yMinLeft*.9,ie.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:ie.yMaxLeft*1.1]).range([0,G]),T=[M,0],$e()},$e=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(ie.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=v.scalePoint().domain(N).range(T).padding(.5)},Ue=()=>{Ye();{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P,g,G);a=v.axisBottom(i).tickFormat(O=>Ze(O,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-M:0).tickValues(te.autoLabelFlag?void 0:te.yAxisLabelArray).ticks(te.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ye=()=>{m=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*G*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(N,M))},Pe=te=>{te.forEach(O=>{O.data.forEach(X=>{X.hideZero=O.properties.hideZeroValues,X.axis=O.properties.axis,X.properties=O.properties})}),te.forEach((O,X)=>{let H=d.selectAll(".parentGroup").filter(I=>I?.properties?.legendUniqueId===O.properties.legendUniqueId).data([O],I=>I.properties.legendUniqueId);H=H.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",O.properties.legendUniqueId).attr("clip-path",`url(#${f}-clip)`).merge(H);let E=H.selectAll(".column-group").data(O.data,I=>I.dimension+"_"+O.properties.legendUniqueId),Y=E.enter().append("g").attr("class","column-group").attr("hoverId",(O.properties.alias||O.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",I=>X===0?`translate(0, ${y(I.dimension)-L/2})`:`translate(0, ${y(I.dimension)-L/(2+X*2)})`);E.attr("transform",I=>X===0?`translate(0, ${y(I.dimension)-L/2})`:`translate(0, ${y(I.dimension)-L/(2+X*2)})`),Y.merge(E).attr("transform",I=>X===0?`translate(0, ${y(I.dimension)-L/2})`:`translate(0, ${y(I.dimension)-L/(2+X*2)})`);const ee=Y.append("rect").attr("y",0).attr("height",X===0?L:L/2).attr("x",()=>i(0)).attr("width",0).attr("fill",I=>U.get(O.properties.legendUniqueId)?.(I.value)??O.properties.color).attr("stroke-dasharray",()=>O.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${O.properties.stackBorderWidth}px`).attr("stroke",()=>O.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?O.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",I=>I.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>O.properties.legendUniqueId).attr(lt.DimValue,I=>Array.isArray(I.dimension)?String(I.dimension[0]):String(I.dimension));(e.animation.animationEnabled?ee.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ee).attr("x",I=>I.value>0?i(0):i(I.value)).attr("width",I=>I.value>0?i(I.value)-i(0):Math.abs(i(0)-i(I.value))),E.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("x",I=>I.value>0?i(0):i(I.value)).attr("width",I=>I.value>0?i(I.value)-i(0):Math.abs(i(0)-i(I.value))),Y.merge(E).on("mousemove",(I,w)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ie.formattedDimensionListMap.get(w.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():w.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||w.value,value:Ze(w.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:O.properties.alias}],e,I,O.properties,gt(p,String(w.dimension??""),{...O.properties,formattedDimensionValue:String(ie.formattedDimensionListMap.get(w.dimension)??w.dimension??"")}))}).on("mouseout",()=>{ot()}).on("click",Tt(_,b,(I,w)=>({seriesId:O.properties.legendUniqueId,dimValue:Array.isArray(w.dimension)?String(w.dimension[0]):String(w.dimension),legendUniqueId:O.properties.legendUniqueId,seriesDisplayName:O.properties.alias||O.properties.name||""}))),E.exit().remove()}),d.selectAll(".parentGroup").raise()},Ee=te=>{G=h-te.left-te.right,M=k-te.bottom-te.top},we=(te,O,X)=>{re=O,N=te,me=X,Ce()},Ce=()=>{$e(),Ye(),na(e,d,$,M,G,m,void 0,i,ie.yMaxLeft,N,u,t,h,ne,L,y),ve(),Pe(re),Ra(re,y,i,void 0,D,xt,[],[],e,u,k,h,G,N,M,f,o,x,void 0,L,c,!1,g),F()},ve=()=>{let te=At(N,re,Se);ze=v.stack().keys(ie.legendList).offset(v.stackOffsetDiverging)(te),re.forEach((X,H)=>X.data.forEach((E,Y)=>{E[0]=ze[H][Y][0],E[1]=ze[H][Y][1]}));let O=e.annotation.annotationSetLabelColor;ze.forEach((X,H)=>X.forEach(E=>{E.key=X.key,X.color=JSON.parse(JSON.stringify(A[H].properties.color)),E.data.labelPosition=A[H].properties.dataLabelPosition,E.data.labelColor=O=="2"?JSON.parse(JSON.stringify(A[H].properties.color)):A[H].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(A[H].properties.hideZeroValues))}))},F=()=>{try{const te=Number(e.connector?.connectorVisibility);if(!e.connector||te===2)return;const O=[],X=[],H=[];let E;const Y=[];if(te===1)E=1;else if(te===3){const J=Number(e.connector.connectorFollow);J===1?E=Number(e.connector.connectorStepSize):J===2&&((e.connector.connectorExclude||[]).forEach(j=>H.push(j)),E=1)}const ee=[],z=[],I=[],w=e.connector?.connectorCustomRange||[];H.forEach(J=>{const j=J.split("-");j.length&&ee.push(j[0])});const q=(ze?.[0]||[]).map((J,j)=>({Dimension:J.data.Dimension,Total:J.data.Total,CustomTotal:J.data.Total-(I[j]??0),Index:j}));if(E!=null){for(let J=0;J<q.length;J++)(E===1||J%E===0&&E!==1)&&O.push(q[J]);for(let J=E;J<q.length;J+=E){const j=Math.min(J+E,q.length);let Te=-1/0;for(let xe=J;xe<j;xe++)q[xe].Total>Te&&(Te=q[xe].Total);Te!==-1/0&&Y.push(Te)}for(let J=1;J<O.length;J++)X.push(O[J])}else{const J=[];(w||[]).forEach(j=>{if(j?.from&&j?.to){const Te=q.some(de=>de.Dimension===j.from),xe=q.some(de=>de.Dimension===j.to);Te&&xe&&J.push({from:j.from,to:j.to})}}),J.forEach(j=>{const Te=q.findIndex(de=>de.Dimension===j.from),xe=q.findIndex(de=>de.Dimension===j.to);if(Te>=0&&xe>=0){const de=Math.min(Te,xe),Fe=Math.max(Te,xe);O.push(q[de]);let Ve=q[de]?.Total??-1/0;for(let ke=de;ke<=Fe;ke++)q[ke].Total>Ve&&(Ve=q[ke].Total);Ve!==-1/0&&Y.push(Ve),X.push(q[Fe])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Re.white?e.connector.connectorMarkerColor:"none"),le(O,Y,X,E,ee),he(O,Y,X,E,ee)}catch(te){console.error(te)}},le=(te,O,X,H,E)=>{try{d.append("g").selectAll("path").data(te).enter().filter((Y,ee)=>H!=null?ee<te.length-1:ee<te.length).append("path").attr("d",(Y,ee)=>e.total.totalVisibility?`M ${i(Y.Total)+50},
82
- ${y(Y.Dimension)+y.bandwidth()/2-5}
83
- H ${60+Math.max(i(O[ee]),i(X[ee].Total),i(Y.Total))}
84
- V ${y(X[ee].Dimension)+y.bandwidth()/2+5}
85
- H ${30+i(X[ee].Total)}`:`M ${i(Y.Total)+30},
86
- ${y(Y.Dimension)+y.bandwidth()/2-5}
87
- H ${45+Math.max(i(O[ee]),i(X[ee].Total),i(Y.Total))}
88
- V ${y(X[ee].Dimension)+y.bandwidth()/2+5}
89
- H ${10+i(X[ee].Total)}
90
- `).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",Y=>E.includes(Y.Dimension)||Y.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(Y){console.error(Y)}},he=(te,O,X,H,E)=>{try{let Y=e.connector.connectorFontStyle,ee=e.connector.connectorNumberFormat,z=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(ee=".2s"),d.append("g").selectAll("text1").data(te).enter().filter((I,w)=>H!=null?w<te.length-1:w<te.length).append("text").attr("y",(I,w)=>H==null?y(X[w].Dimension)/2+y(I.Dimension)/2+15:H==1?z<6&&y.bandwidth()>40?y(X[w].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(X[w].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(X[w].Dimension)+y.bandwidth()/2+y.bandwidth()/2*H+12).attr("x",(I,w)=>e.total.totalVisibility?70+Math.max(i(O[w]),i(X[w].Total),i(I.Total)):50+Math.max(i(O[w]),i(X[w].Total),i(I.Total))).text((I,w)=>(I.CustomTotal==0&&X[w].CustomTotal!=0&&(I.CustomTotal=1),Ai(X[w].Total,I.Total,parseInt(e.connector.connectorDecimalPrecision),ee,parseInt(I.Dimension),parseInt(X[w].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",Y.includes("Italic")?"Italic":"").style("text-decoration",Y.includes("Underline")?"Underline":"").style("font-weight",Y.includes("Bold")?"Bold":"").style("visibility",I=>E.includes(I.Dimension)||I.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(Y){console.error(Y)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},pr=({isDateType:t,formatOptions:e,data:r})=>{const c=crypto.randomUUID(),x=0,n=se.ColumnHistogramChart,l=Me.useRef(),s=r.ChartData,p=r.DimensionList,f=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,R,g,B,U,W,P,D,V,$,Z,ce,ne,ae,ue,ge,be=[],pe=[],Q,G,M,h,k,o,d,i,y,T,a,m=[],N=0;const re=2;let K={dimensionList:p,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{me()}catch(Pe){Ae("HorizontalHistogramChart","createHorizontalChart",Pe)}},[e]);const me=()=>{({formatOptions:e,svg:k,width:Q,height:G}=St(l,e)),Le(),{formatOptions:e}=ta(e,s,r.DataTableData??[]),{maxNumberForPrimaryAxis:ce,maxNumberForSecondaryAxis:ne}=Et(e,K.yMinLeft,K.yMaxLeft,K.yMinRight,K.yMaxRight),{margin:R,yLabel:g,xLabel:B,yTitle:U,xTitle:W,dimensionHeightWidthArray:P,chartTitleHeight:D,secondaryAxisTitleWidth:V,legendMargin:$,secondaryYLabel:Z}=Ct(Q,G,ce,ne,K.yMaxLeft,e,K.legendList,K.dimensionList,K.yMaxRight,L,u,t),$e(R),{dataTable:M,dataTableHeight:h}=aa(e,g,U,s,K.dimensionList),Mt(k,Q,G,e),o=Ft(k,R),vt(o,e,h,ae,ue,n),ze(),ie(),De(),Ot(o,K,B,e,h,d,T,P,G,x,t,ae,ue,a,d),Jt(o,e,h,g,y,ue),Ue(s,G,k,R,ae),wt(e,f,k,R,B,G,W,K.chartType,g,ae,ue),Dt(ue,e,h,f,k,R,U,g),Ht(k,L,R,e,h,ue,ae,Z,V),Vt(k,e,Q,D),Pt(G,k,P,D,Q,$,e,s,c,h,R,ct.rectangle)},Le=()=>{const Pe=[],Ee=[];let we=[],Ce=-1/0,ve=1/0;s.forEach(he=>{Ee.push(he.legend),he.data.forEach(te=>{Pe.push(te),Ce=Math.max(Ce,te.value),ve=Math.min(ve,te.value)})}),K.chartData=Pe,K.legendList=Ee,K.yMaxLeft=Ce,K.yMinLeft=ve>0?0:ve,m=JSON.parse(JSON.stringify(s)),m.forEach(he=>he.data.forEach(te=>we.push(te.value)));let F=S||S==0?S:0,le=b||b==0?b:m[0]?.data?.length;if(K.yMaxLeft=parseFloat((F+"").length>(le+"").length?F+"":le+""),K.xMax=v.max(we),K.xMin=v.min(we),K.xMin===K.xMax){const he=K.xMax===0?1:Math.abs(K.xMax*.1);K.xMin-=he,K.xMax+=he}},ze=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=ue/50;break;case"Number of Bins":Se(!1);break;case"Bin Width":Se(!0)}},Se=Pe=>{m.forEach(ve=>ve.data.sort((F,le)=>F.value-le.value));let Ee=K.xMax-K.xMin,we;Pe?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),we=Ee/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),we=Ee/parseFloat(e.bins.binsCalculationValue));let Ce=K.xMin;if(Pe)for(be=[Ce];Ce<K.xMax;)Ce+=we,be.push(Ce);else for(be=[Ce];Math.round(Ce)<Math.round(K.xMax);)Ce+=we,be.push(Math.round(Ce))},ie=()=>{d=v.scaleLinear().domain([K.xMin,K.xMax]).range([ue,0]);const Pe=be.length>0?be:d.ticks(ge);let Ee=v.bin().value(Ce=>Ce).domain(d.domain()).thresholds(Pe);m.forEach(Ce=>{let ve=Ee(Ce.data.map(F=>F.value));pe.push(ve)}),m.forEach((Ce,ve)=>pe[ve].forEach(F=>{F.name=Ce.properties.legend,F.color=Ce.properties.color,F.opacity=Ce.properties.opacity}));let we=[];pe.forEach(Ce=>Ce.forEach(ve=>we.push(ve.length))),K.yMaxLeft=v.max(we),K.yMinLeft=v.min(we),i=v.scaleLinear().domain([_||_==0?_:0,A||A==0?A:K.yMaxLeft+.2*K.yMaxLeft]).range([0,ae])},De=()=>{ye();{let Pe=dt(K.yMaxLeft,K.yMinLeft,ae,e,K,S,b,!1,ue);T=v.axisBottom(i).tickFormat(Ee=>Ze(Ee,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-ue+0:0).tickValues(Pe.autoLabelFlag?void 0:Pe.yAxisLabelArray).ticks(Pe.customTickValue).tickPadding(8).tickSizeOuter(0)}},ye=()=>{Li(K.xMax,K.xMin,ue,e,_,A,ae,!1).xAxisLabelArray.shift(),y=v.axisLeft(d).tickFormat(Ee=>Ze(Ee,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-ae:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(ge):y.tickValues(be).ticks(ue/50)},fe=Pe=>{const Ee=e.animation.animationEnabled,we=o.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+c+" .rect").data(pe).enter().append("g").selectAll("rect").data(ve=>ve).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",0).attr("y",ve=>{const F=d(ve.x0),le=d(ve.x1);return Math.min(F,le)}).attr("height",ve=>{const F=d(ve.x0),le=d(ve.x1),he=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(le-F)-he)}).attr("width",0).style("fill",ve=>ve.color!==Re.white?ve.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(ve,F)=>{yt([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():F.properties?.currentMeasure?F.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${F.x0}-${F.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:Ze(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(F.length/m[0].data.length):F.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,ve)}).on("mouseout",ot);(Ee?we.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):we).attr("width",ve=>i(ve.length)),o.selectAll(".parentGroup").raise()},$e=Pe=>{ae=Q-Pe.left-Pe.right,ue=G-Pe.bottom-Pe.top},Ue=(Pe,Ee,we,Ce,ve)=>{if(!e.plotArea.fitChart){const F=Pe[0].data.length-re,le=Ee-20;a=K.dimensionList.slice(N,N+re),m=JSON.parse(JSON.stringify(Pe)),m.forEach((O,X)=>m[X].data=O.data.filter(H=>a.includes(H.dimension))),we.append("rect").attr("x",Ce.left).attr("y",le).attr("width",ve).attr("height",8).attr("fill","#ddd").attr("rx",4);const he=ve*re/K.dimensionList.length,te=we.append("rect").attr("x",Ce.left).attr("y",le).attr("width",he).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",O=>{let X=Math.min(Math.max(O.x,Ce.left),Ce.left+ve-he);te.attr("x",X),N=Math.round((X-Ce.left)/(ve-he)*F),a=K.dimensionList.slice(N,N+re),m=JSON.parse(JSON.stringify(Pe)),m.forEach((H,E)=>m[E].data=H.data.filter(Y=>a.includes(Y.dimension))),ye(),Ye()}));we.on("wheel",O=>{O.preventDefault();const X=Math.abs(O.deltaX)>Math.abs(O.deltaY)?O.deltaX:O.deltaY;N+=X>0?1:-1,N=Math.max(0,Math.min(N,F));const H=Ce.left+(ve-he)*N/F;te.attr("x",H),m=JSON.parse(JSON.stringify(Pe)),m.forEach((E,Y)=>m[Y].data=E.data.filter(ee=>a.includes(ee.dimension))),ye(),Ye()})}Ye()},Ye=()=>{Jt(o,e,h,g,y,ue),fe()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"className",ref:l,id:c,style:{width:"100%",height:"100%"}})})},br=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID(),L=0,u=se.AreaChart,S=Me.useRef(),b=Me.useRef(s);b.current=s;const _=Me.useRef(p);_.current=p;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled;let B=!1;const U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye,Pe=[],Ee=0,we,Ce,ve,F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(I){Ae("Linechart","createLineChart",I)}},[e]);const le=()=>{({formatOptions:e,svg:T,width:o,height:d}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:G,maxNumberForSecondaryAxis:M,customYaxisMaxValue:P,secondaryCustomYaxisMaxValue:V}=Et(e,F.yMinLeft,F.yMaxLeft,F.yMinRight,F.yMaxRight),{margin:$,yLabel:Z,xLabel:ce,yTitle:ne,xTitle:ae,dimensionHeightWidthArray:ue,chartTitleHeight:ge,secondaryAxisTitleWidth:be,legendMargin:pe,secondaryYLabel:Q,visibleBars:we,columnWidth:Ce,scrollbarVisible:ve}=Ct(o,d,G,M,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,U,t,g,F),Y($),{dataTable:i,dataTableHeight:y}=aa(e,Z,ne,A,F.dimensionList,r),g&&(i=[],y=0),Mt(T,o,d,e),a=Ft(T,$),vt(a,e,y,h,k,u,f),te(),X(),g?(ra(e,a,Z,k,h,fe),B&&pi(e,a,Q,$e,h)):(Jt(a,e,y,Z,Le,k),B&&hi(a,e,y,Q,Se,k,h)),wt(e,g,T,$,ce,d,ae,F.chartType,Z,h,k),Dt(k,e,y,g,T,$,ne,Z,h),Ht(T,B,$,e,y,k,h,Q,be,g),Vt(T,e,o,ge),Pt(d,T,ue,ge,o,pe,e,A,f,y,$,ct.areaWithLine,u,n),Gt(A,d,o,T,$,h,ve,we,F,Ee,!1,ee,g)},he=()=>{const I=[],w=[];let C=[],q=-1/0,J=1/0,j=-1/0,Te=1/0;e.plotArea.hideZeroValues&&(F.hideZeroValues=!0,A.forEach(xe=>{xe.data=xe.data.filter(de=>de.value!==0)})),A.forEach(xe=>{w.push(xe.properties.alias?xe.properties.alias:xe.legend),xe.data.forEach(de=>{I.push(de),xe.properties.axis==="Secondary"?(B=!0,j=Math.max(j,de.value),Te=Math.min(Te,de.value)):(q=Math.max(q,de.value),J=Math.min(J,de.value))})}),F.chartData=I,F.legendList=w,F.yMaxLeft=q,F.yMinLeft=J>0?0:J,F.yMaxRight=j,F.yMinRight=Te>0?0:Te,C=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(xe=>xe):F.dimensionList,F.dimensionList.forEach((xe,de)=>{F.formattedDimensionListMap.set(xe,C[de])}),Pe=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Ye=F.dimensionList:Ye=F.dimensionList.slice(Ee,Ee+we)},te=()=>{let I=dt(P||F.yMaxLeft,F.yMinLeft,k,e,F,W,P,g,h).yAxisLabelArray;F.yMaxLeft=I[I.length-1],F.yMinLeft=I[0];const w=g?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const C=v.scaleLinear().domain([F.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:F.yMinLeft<0?F.yMinLeft*1.1:F.yMinLeft*.9,F.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:F.yMaxLeft*1.1]).range(w);g?De=C:m=C}if(B){const C=v.scaleLinear().domain([F.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:F.yMinRight*1.1,F.yMaxRight<=0?V||0:V||F.yMaxRight*1.1]).range(w);g?ye=C:N=C}if(K=g?[k,0]:[0,h],!g&&e.seriesLabel.seriesLabelVisibility){let C=la(h,m,e,Pe,void 0,B,k);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,h-C.heightWidth[0]]:K=[C.heightWidth[0],h]}},O=()=>{const I=v.scalePoint().domain(Ye).range(K).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);g?ie=I:re=I},X=()=>{H();{let I=dt(P||F.yMaxLeft,F.yMinLeft,k,e,F,W,P,g,h);g?fe=v.axisBottom(De).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Le=v.axisLeft(m).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,h,me)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/30).tickPadding(8).tickSizeOuter(0)}if(B){let I=dt(V||F.yMaxRight,D||F.yMinRight,k,e,F,D,V);g?$e=v.axisTop(ye).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??h/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-k:0).tickSizeOuter(0):Se=v.axisRight(N).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-h:0).tickSizeOuter(0)}},H=()=>{g?Ue=v.axisLeft(ie).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Ye,k)):ze=v.axisBottom(re).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(bt(Ye,h))},E=I=>{const w=e.plotArea.plotAreaHideLineAndMarkers;I.forEach(Fe=>{Fe.data.forEach(Ve=>{Ve.hideZero=Fe.properties.hideZeroValues,Ve.axis=Fe.properties.axis})});const C=g?v.area().y(Fe=>{const Ve=ie(Fe.dimension);return Ve??0}).x0(Fe=>Fe.axis===Qe.primary?De(0):ye(0)).x1(Fe=>Fe.axis===Qe.primary?De(Fe.value):ye(Fe.value)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)):v.area().x(Fe=>re(Fe.dimension)?re(Fe.dimension):null).y0(Fe=>Fe.axis===Qe.primary?m(0):N(0)).y1(Fe=>Fe.axis===Qe.primary?m(Fe.value):N(Fe.value)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)),q=g?v.area().y(Fe=>{const Ve=ie(Fe.dimension);return Ve??0}).x0(()=>De(0)).x1(()=>De(0)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)):v.area().x(Fe=>re(Fe.dimension)?re(Fe.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)),J=e.animation.animationEnabled;let j=a.selectAll(".parentGroup").data([I]),Te=a.append("g").attr("class","focusClass");j=j.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${f}-clip)`).merge(j);let xe=j.selectAll(".area-group").data(Fe=>Fe),de=xe.enter().append("g").attr("class","area-group");de.append("path").attr("class","area parentGroup").attr("fill",Fe=>Fe.properties.color!==Re.white?Fe.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",Fe=>(Fe.properties?.alias||Fe.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",Fe=>q(Fe.data)).attr(lt.SeriesId,Fe=>Fe.properties.legendUniqueId).attr(lt.DimValue,Fe=>Fe.properties.alias||Fe.properties.name||"").on("click",Tt(_,b,(Fe,Ve)=>({seriesId:Ve.properties.legendUniqueId,dimValue:Ve.properties.alias||Ve.properties.name||"",legendUniqueId:Ve.properties.legendUniqueId,seriesDisplayName:Ve.properties.alias||Ve.properties.name||""}))).each(function(Fe){J?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(Fe.data)):v.select(this).attr("d",C(Fe.data))}),de.merge(xe).each(function(Fe){const Ve=v.select(this);Ve.selectAll("path.visibleLine").data([Fe]).join("path").attr("class","visibleLine parentGroup").attr("d",ke=>J?q(ke.data):C(ke.data)).attr("stroke",ke=>ke.properties.areaBorderColor!==Re.white?ke.properties.areaBorderColor:"none").attr("stroke-dasharray",ke=>{const Be=parseInt(ke.properties.lineWidth);switch(ke.properties.lineStyle){case pt.dotted:return`0,${Be+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",ke=>ke.properties.lineStyle===pt.dotted?ya.round:ya.butt).attr("stroke-width",ke=>w?ke.properties.lineStyle!==pt.none&&e.plotArea.plotAreaHideLineAndMarkers?ke.properties.lineWidth:"0":0).attr("fill","none").each(function(ke){J&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(ke.data))}),Ve.selectAll("path.hoverLine").data([Fe]).join("path").attr("class","hoverLine").attr("d",ke=>C(ke.data)).attr("fill",Re.transparent).attr("stroke","none").style("pointer-events","all").raise(),bi(e,j,Te,Ye,I,g?ie:re,g?De:m,u,!1,g)}),xe.exit().remove(),Da(j,I,u,g?ie:re,g?De:m,g?ye:N,null,e,F,V,D,W,P,!1,l,g),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},Y=I=>{h=o-I.left-I.right,k=d-I.bottom-I.top},ee=(I,w,C)=>{Pe=w,Ye=I,we=C,z()},z=()=>{if(O(),H(),Ra(A,g?ie:re,g?De:m,g?ye:N,$,xt,[],[],e,u,d,o,h,Ye,k,f,T,x,void 0,void 0,c,!1,g),g?na(e,a,ce,k,h,Ue,$e,De,F.yMaxLeft,Ye,u,t,o,ue,Ce,ie):Ot(a,F,ce,e,y,m,ze,ue,d,L,t,h,k,Ye,re),E(Pe),!g){let I=la(h,m,e,Pe,void 0,B,k).labelArray;Ga(e,a,I),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,T,a,i,L,m,re,void 0,void 0,void 0,y,u,e,Z,ne,Ye,h,K,F.formattedDimensionListMap,f,$,k))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},gr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.StackAreaChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse()||[],R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M=new Map,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye=[],Pe=0,Ee,we,Ce,ve=[];const F=!1;let le={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{he()}catch(C){Ae("StackAreaChart","createAreaChart",C)}},[e]);const he=()=>{({formatOptions:e,svg:T,width:o,height:d}=St(S,e)),te(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:Q,maxNumberForSecondaryAxis:G}=Et(e,le.yMinLeft,le.yMaxLeft,le.yMinRight,le.yMaxRight),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:Ee,columnWidth:we,scrollbarVisible:Ce}=Ct(o,d,Q,G,le.yMaxLeft,e,le.legendList,le.dimensionList,le.yMaxRight,B,F,t,g,le),ee(V),{dataTable:i,dataTableHeight:y}=aa(e,$,ce,A,le.dimensionList,r),g&&(i=[],y=0),Mt(T,o,d,e),a=Ft(T,V),vt(a,e,y,h,k,u,f),O(),H(),g?ra(e,a,$,k,h,ye):Jt(a,e,y,$,Le,k),wt(e,g,T,V,Z,d,ne,le.chartType,$,h,k),Dt(k,e,y,g,T,V,ce,$,h),Ht(T,B,V,e,y,k,h,pe,ge,g),Vt(T,e,o,ue),Pt(d,T,ae,ue,o,be,e,[...A].reverse(),f,y,V,ct.areaWithLine,u,n),Gt(A,d,o,T,V,h,Ce,Ee,le,Pe,!1,z,g)},te=()=>{const C=[],q=[];e.plotArea.hideZeroValues&&(le.hideZeroValues=!0,A.forEach(Fe=>{Fe.data=Fe.data.filter(Ve=>Ve.value!==0)})),A.forEach((Fe,Ve)=>{const ke=`${Ve}~$~${Fe.properties.alias}`;Fe.properties.legend=ke,q.push(ke);for(const Be of Fe.data)C.push(Be)}),le.chartData=C,le.legendList=q,Ye=JSON.parse(JSON.stringify(A));let J=At(le.dimensionList,A,F);e.plotArea.fitChart?Ue=le.dimensionList:(Ue=le.dimensionList.slice(Pe,Pe+Ee),Ye.forEach((Fe,Ve)=>Ye[Ve].data=Fe.data.filter(ke=>Ue.includes(ke.dimension))));const j=v.stack().keys(le.legendList).offset(v.stackOffsetNone)(J);w();let Te=1/0,xe=-1/0;for(const Fe of j)for(const[Ve,ke]of Fe)Te=Math.min(Te,Ve),xe=Math.max(xe,ke);le.yMinLeft=Te>0?0:Te,le.yMaxLeft=xe;let de=t?ft(e.xAxisLabel.xAxisNumberFormat,le.dimensionList).map(Fe=>Fe):le.dimensionList;le.dimensionList.forEach((Fe,Ve)=>{le.formattedDimensionListMap.set(Fe,de[Ve])})},O=()=>{let C=dt(W||le.yMaxLeft,le.yMinLeft,k,e,le,U,W,g,h).yAxisLabelArray;le.yMaxLeft=C[C.length-1],le.yMinLeft=C[0];const q=g?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const J=v.scaleLinear().domain([le.yMinLeft>=0?U!==void 0&&!Number.isNaN(U)?U:0:le.yMinLeft<0?le.yMinLeft*1.1:le.yMinLeft*.9,le.yMaxLeft<=0?0:W!==void 0&&!Number.isNaN(W)?W:le.yMaxLeft*1.1]).range(q);g?ie=J:m=J}if(K=g?[k,0]:[0,h],!g&&e.seriesLabel.seriesLabelVisibility){let J=la(h,m,e,A,void 0,B,k,!0);J.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=J.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,h-J.heightWidth[0]]:K=[J.heightWidth[0],h]}},X=()=>{const C=v.scalePoint().domain(Ue).range(K).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);g?Se=C:re=C},H=()=>{{let C=dt(W||le.yMaxLeft,le.yMinLeft,k,e,le,U,W,g,h);g?ye=v.axisBottom(ie).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Le=v.axisLeft(m).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,h,me)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},E=()=>{g?$e=v.axisLeft(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Ue,k)):ze=v.axisBottom(re).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(bt(Ue,h))},Y=C=>{const q=e.animation.animationEnabled,J=e.plotArea.plotAreaHideLineAndMarkers;C.forEach(ke=>{ke.data.forEach(Be=>{Be.hideZero=ke.properties.hideZeroValues,Be.axis=ke.properties.axis})});const j=g?v.area().y(ke=>{const Be=Se(ke.data.dimension);return Be??0}).x0(ke=>ie(ke[0])).x1(ke=>ie(ke[1])).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e)):v.area().x(ke=>re(ke.data.dimension)?re(ke.data.dimension):null).y0(ke=>m(ke[0])).y1(ke=>m(ke[1])).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e)),Te=g?v.area().y(ke=>{const Be=Se(ke.data.dimension);return Be??0}).x0(()=>ie(0)).x1(()=>ie(0)).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e)):v.area().x(ke=>re(ke.data.dimension)?re(ke.data.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e));let xe=a.selectAll(".lineGroup").data([ve]),de=a.append("g").attr("class","focusClass");xe=xe.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${f}-clip)`).merge(xe);let Fe=xe.selectAll(".area-group").data(ke=>ke),Ve=Fe.enter().append("g").attr("class",ke=>"area-group "+ke.key.replace(/ /g,"-"));Ve.append("path").attr("hoverId",ke=>(C[ke.index].properties.alias||C[ke.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",ke=>ke.color!==Re.white?ke.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",ke=>Te(ke)).attr(lt.SeriesId,ke=>A[ke.index]?.properties?.legendUniqueId??ke.key).attr(lt.DimValue,ke=>A[ke.index]?.properties?.alias||A[ke.index]?.properties?.name||"").on("click",Tt(_,b,(ke,Be)=>{const at=A[Be.index]?.properties?.legendUniqueId??Be.key,it=A[Be.index]?.properties?.alias||A[Be.index]?.properties?.name||"";return{seriesId:at,dimValue:it,legendUniqueId:at,seriesDisplayName:it}})).each(function(ke){q?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j(ke)):v.select(this).attr("d",j(ke))}),Ve.merge(Fe).each(function(ke,Be){const at=v.select(this);at.selectAll("path.visibleLine").data([ke]).join("path").attr("class","visibleLine parentGroup").attr("d",it=>q?Te(it):j(it)).attr("stroke",it=>it.color!==Re.white?A[Be].properties.areaBorderColor:"none").attr("stroke-dasharray",it=>{const ga=parseInt(A[Be].properties.lineWidth.toString());switch(A[Be].properties.lineStyle){case pt.dotted:return`0,${ga+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[Be]?.properties?.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",()=>J?A[Be].properties.lineStyle!==pt.none?A[Be].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(it){q&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j(it))}),at.selectAll("path.hoverLine").data([ke]).join("path").attr("class","hoverLine").attr("d",it=>j(it)).attr("fill",Re.transparent).attr("stroke","none").style("pointer-events","all").raise(),T.selectAll('[hoverId="'+(A[ke.index].properties.alias||A[ke.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),Fe.exit().remove(),bi(e,xe,de,Ue,C,g?Se:re,g?ie:m,u,!0,g),Da(xe,C,u,g?Se:re,g?ie:m,g?De:N,null,e,le,D,P,U,W,!1,p,g),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ee=C=>{h=o-C.left-C.right,k=d-C.bottom-C.top},z=(C,q,J)=>{Ye=q,Ue=C,Ee=J,ai(r,M,Ue),w(),I()},I=()=>{if(X(),E(),g?na(e,a,Z,k,h,$e,fe,ie,le.yMaxLeft,Ue,u,t,o,ae,we,Se):Ot(a,le,Z,e,y,m,ze,ae,d,L,t,h,k,Ue,re),Y(Ye),za(ve,g?Se:re,g?ie:m,g?De:N,V,xt,[],[],e,u,d,o,h,Ue,k,f,T,x,y,c,g),ti(M,g?Se:re,g?ie:m,V,xt,[],e,u,d,o,T,c,g),!g){let C=la(h,m,e,Ye,void 0,B,k,!0).labelArray;Ga(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,T,a,i,L,m,re,void 0,void 0,void 0,y,u,e,$,ce,le.dimensionList,h,K,le.formattedDimensionListMap,f,V,k))}},w=()=>{let C=At(Ue,Ye,F);ve=v.stack().keys(le.legendList).offset(v.stackOffsetNone)(C),Ye.forEach((J,j)=>J.data.forEach((Te,xe)=>{Te[0]=ve[j][xe][0],Te[1]=ve[j][xe][1]}));let q=e.annotation.annotationSetLabelColor;ve.forEach((J,j)=>J.forEach(Te=>{Te.key=J.key,J.color=JSON.parse(JSON.stringify(A[j].properties.color)),Te.data.labelPosition=A[j].properties.dataLabelPosition,Te.data.labelColor=q=="2"?JSON.parse(JSON.stringify(A[j].properties.color)):A[j].properties.labelColor,Te.hideZero=JSON.parse(JSON.stringify(A[j].properties.hideZeroValues)),Te.properties=A[j].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},Ar=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.NormalizedStackAreaChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse()||[],R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue=[],Ye=0,Pe,Ee,we,Ce=[];const ve=!0;let F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(w){Ae("NormalizedLinechart","createLineChart",w)}},[e]);const le=()=>{({formatOptions:e,svg:y,width:k,height:o}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:Pe,columnWidth:we,scrollbarVisible:Ee}=Ct(k,o,Q,G,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,ve,t,g,F),Y(V),{dataTable:d,dataTableHeight:i}=aa(e,$,ce,A,F.dimensionList,r),g&&(d=[],i=0),Mt(y,k,o,e),T=Ft(y,V),vt(T,e,i,M,h,u),te(),X(),g?ra(e,T,$,h,M,De):Jt(T,e,i,$,me,h),wt(e,g,y,V,Z,o,ne,F.chartType,$,M,h),Dt(h,e,i,g,y,V,ce,$,M),Ht(y,B,V,e,i,h,M,pe,ge,g),Vt(y,e,k,ue),Pt(o,y,ae,ue,k,be,e,[...A].reverse(),f,i,V,ct.areaWithLine,u,n),Gt(A,o,k,y,V,M,Ee,Pe,F,Ye,!1,ee,g)},he=()=>{const w=[],C=[];e.plotArea.hideZeroValues&&(F.hideZeroValues=!0,A.forEach(xe=>{xe.data=xe.data.filter(de=>de.value!==0)})),A.forEach((xe,de)=>{const Fe=`${de}~$~${xe.properties.alias}`;xe.properties.legend=Fe,C.push(Fe);for(const Ve of xe.data)w.push(Ve)}),F.chartData=w,F.legendList=C,Ue=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?$e=F.dimensionList:($e=F.dimensionList.slice(Ye,Ye+Pe),Ue.forEach(xe=>{xe.data=xe.data.filter(de=>$e.includes(de.dimension))}));const q=At(F.dimensionList,A,ve),J=v.stack().keys(F.legendList).offset(v.stackOffsetNone)(q);I();let j=1/0;for(const xe of J)for(const[de]of xe)j=Math.min(j,de);F.yMinLeft=j>0?0:j,F.yMaxLeft=1;const Te=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(xe=>xe):F.dimensionList;F.formattedDimensionListMap=new Map(F.dimensionList.map((xe,de)=>[xe,Te[de]]))},te=()=>{const w=g?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const C=v.scaleLinear().domain([F.yMinLeft<0?-1:0,1]).range(w);g?Se=C:a=C}if(re=g?[h,0]:[0,M],!g&&e.seriesLabel.seriesLabelVisibility){let C=la(M,a,e,A,void 0,B,h,!0);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(K=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?re=[0,M-C.heightWidth[0]]:re=[C.heightWidth[0],M]}},O=()=>{const w=v.scalePoint().domain($e).range(re).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);g?ze=w:N=w},X=()=>{g?De=v.axisBottom(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).ticks(i>0?(M-i)/80:M/80,"%").tickPadding(8).tickSizeOuter(0):me=v.axisLeft(a).tickSize(Rt(e,M,K)).ticks(i>0?(h-i)/80:h/80,"%").tickPadding(8).tickSizeOuter(0)},H=()=>{g?fe=v.axisLeft(ze).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt($e,h)):Le=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(bt($e,M))},E=w=>{const C=e.animation.animationEnabled,q=e.plotArea.plotAreaHideLineAndMarkers;Ce.forEach((Ve,ke)=>Ve.forEach((Be,at)=>{const it=Be.data.total;w[ke].data[at]&&(w[ke].data[at][0]=Be[0]=it===0?0:Be[0]/it,w[ke].data[at][1]=Be[1]=it===0?0:Be[1]/it)})),w.forEach(Ve=>{Ve.data.forEach(ke=>{ke.hideZero=Ve.properties.hideZeroValues,ke.axis=Ve.properties.axis})});const J=g?v.area().y(Ve=>{const ke=ze(Ve.data.dimension);return ke??0}).x0(Ve=>Se(Ve[0])).x1(Ve=>Se(Ve[1])).defined(Ve=>Ve.data.hideZero?!!Ve[0]:!0).curve(v.curveLinear):v.area().x(Ve=>N(Ve.data.dimension)?N(Ve.data.dimension):null).y0(Ve=>a(Ve[0])).y1(Ve=>a(Ve[1])).defined(Ve=>Ve.data.hideZero?!!Ve[0]:!0).curve(v.curveLinear),j=g?v.area().y(Ve=>{const ke=ze(Ve.data.dimension);return ke??0}).x0(()=>Se(0)).x1(()=>Se(0)).defined(Ve=>Ve.data.hideZero?!!Ve.data.key:!0).curve(mt(e)):v.area().x(Ve=>N(Ve.data.dimension)?N(Ve.data.dimension):null).y0(()=>a(0)).y1(()=>a(0)).defined(Ve=>Ve.data.hideZero?!!Ve.data.key:!0).curve(mt(e));let Te=T.selectAll(".lineGroup").data([Ce]),xe=T.append("g").attr("class","focusClass");Te=Te.enter().append("g").attr("class","areas lineGroup").merge(Te);let de=Te.selectAll(".area-group").data(Ve=>Ve),Fe=de.enter().append("g").attr("class",Ve=>"area-group "+Ve.key.replace(/ /g,"-"));Fe.append("path").attr("hoverId",Ve=>(w[Ve.index]?.properties?.alias||w[Ve.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ve=>Ve.color!==Re.white?Ve.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",Ve=>j(Ve)).attr(lt.SeriesId,Ve=>A[Ve.index]?.properties?.legendUniqueId??Ve.key).attr(lt.DimValue,Ve=>A[Ve.index]?.properties?.alias||A[Ve.index]?.properties?.name||"").on("click",Tt(_,b,(Ve,ke)=>{const Be=A[ke.index]?.properties?.legendUniqueId??ke.key,at=A[ke.index]?.properties?.alias||A[ke.index]?.properties?.name||"";return{seriesId:Be,dimValue:at,legendUniqueId:Be,seriesDisplayName:at}})).each(function(Ve){const ke=v.select(this);C?ke.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",J(Ve)):ke.attr("d",J(Ve))}),Fe.merge(de).each(function(Ve,ke){const Be=v.select(this);Be.selectAll("path.visibleLine").data([Ve]).join("path").attr("class","visibleLine parentGroup").attr("d",at=>C?j(at):J(at)).attr("stroke",at=>at.color!==Re.white?A[ke].properties.areaBorderColor:"none").attr("stroke-dasharray",at=>{const it=parseInt(A[ke].properties.lineWidth.toString());switch(A[ke].properties.lineStyle){case pt.dotted:return`0,${it+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[ke]?.properties?.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",()=>q?A[ke].properties.lineStyle!==pt.none?A[ke].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(at){C&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",J(at))}),Be.selectAll("path.hoverLine").data([Ve]).join("path").attr("class","hoverLine").attr("d",at=>J(at)).attr("fill",Re.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+gi((w[Ve.index]?.properties?.alias||w[Ve.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),de.exit().remove(),bi(e,Te,xe,$e,w,g?ze:N,g?Se:a,u,!0,g),T.selectAll(".parentGroup").raise(),T.selectAll(".hoverLine").raise(),Da(Te,w,u,g?ze:N,g?Se:a,g?ie:m,null,e,F,D,P,U,W,!0,p,g),!g&&e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,u,e,$,ce,F.dimensionList,M,re,F.formattedDimensionListMap,f,V,h))},Y=w=>{M=k-w.left-w.right,h=o-w.bottom-w.top},ee=(w,C,q)=>{Ue=C,$e=w,Pe=q,I(),z()},z=()=>{if(O(),H(),g?na(e,T,Z,h,M,fe,ye,Se,F.yMaxLeft,$e,u,t,k,ae,we,ze):Ot(T,F,Z,e,i,a,Le,ae,o,L,t,M,h,$e,N),E(Ue),za(Ce,g?ze:N,g?Se:a,g?ie:m,V,xt,[],[],e,u,o,k,M,$e,h,f,y,x,i,c,g),!g){let w=la(M,a,e,Ue,void 0,B,h,!0).labelArray;Ga(e,T,w)}},I=()=>{let w=At($e,Ue,ve);Ce=v.stack().keys(F.legendList).offset(v.stackOffsetNone)(w),Ue.forEach((q,J)=>q.data.forEach((j,Te)=>{Ce[J][Te]&&(j[0]=Ce[J][Te][0],j[1]=Ce[J][Te][1])}));let C=e.annotation.annotationSetLabelColor;Ce.forEach((q,J)=>q.forEach(j=>{j.key=q.key,q.color=JSON.parse(JSON.stringify(A[J].properties.color)),j.data.labelPosition=A[J].properties.dataLabelPosition,j.data.labelColor=C=="2"?JSON.parse(JSON.stringify(A[J].properties.color)):A[J].properties.labelColor,j.hideZero=JSON.parse(JSON.stringify(A[J].properties.hideZeroValues)),j.properties=A[J].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},li={left:"Left",right:"Right",center:"Center"},Ut={left:"left",right:"right",top:"top",bottom:"bottom"},Za={solid:"solid",dashed:"Dashed",dotted:"Dotted"},ri={rounded:"rounded",pill:"pill",extra_rounded:"extra_rounded",squircle:"squircle",rectangle:"rectangle"},ha={curve:"curve",elbow:"elbow",diagonal:"diagonal",s_curve:"s-curve",arc:"arc",reverse_elbow:"reverse-elbow",zigzag:"zigzag"},sl="PieFamilyCommonFunctions.ts",Lr=(t,e,r,c)=>{try{let x=t.total.totalPosition,n=t.total.totalAlignment,l=t.legends.legendPosition,s=0;switch(x){case Fa.top:switch(s=l=="Top"?35:0,n){case Bt.start:return{x:5,y:e+s+10};case Bt.middle:return{x:r/2,y:e+s+10};case Bt.end:return{x:r-20,y:e+s+10}}break;case Fa.bottom:switch(s=l=="Bottom"?30:0,n){case Bt.start:return{x:10,y:c-s-10};case Bt.middle:return{x:r/2,y:c-s-10};case Bt.end:return{x:r-20,y:c-s-10}}break}}catch(x){Ae(sl,"getTotalValueCords",x)}},Si=(t,e,r,c,x,n)=>{try{if(t.total&&t.total.totalVisibility){let l=t.total.totalFontStyle,s=t.total.totalAlignment,p=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":qe(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),f=Lr(t,r,x,n);const L=c.append("g").attr("transform",`translate(${f.x}, ${f.y})`).style("user-select","none");L.append("text").text(t.total.showTotalLabel!==!1?`${t.total.editTotalTextToggle?t.total.editTotalText:"Total"} : ${p}`:p).style("fill",t.total.totalColor!==Re.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",l.includes(oe.italic)?oe.italic:"").style("text-decoration",l.includes(oe.underline)?oe.underline:"").style("font-weight",l.includes(oe.bold)?oe.bold:"").attr("text-anchor",s===Bt.start?"start":s===Bt.middle?"middle":s===Bt.end?"end":""),t.animation?.animationEnabled&&L.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(et[t.animation.animationEffect]).attr("opacity",1)}}catch(l){Ae(sl,"drawTotalValue",l)}},Ba="PieChart.tsx",mr=({data:t,formatOptions:e,chartId:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=Me.useRef(),L=Me.useRef(l);L.current=l;const u=Me.useRef(s);u.current=s;const S=Lt(t.ChartData);let b,_,A,R=40,g=jt,B=[0,0],U,W,P,D,V,$,Z,ce,ne=!1;Me.useEffect(()=>{ae()},[e]);const ae=()=>{({chartFormatOptions:b,svg:V,width:A,height:_}=qt(f,e)),ue(),B=Ua(b,S),{margins:g,innerHeight:U,innerWidth:W,legendListWidth:ce,chartTitleHeight:R}=$a(b,A,_,B,g),ge(),Xt(f,A,_,b),D=oa(V,g),Zt(f,R,A,b),Ya(b,V,S,A,_,ce,R,r,g,ct.circle,void 0,n),be(),pe(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?rl(xt,$,b,Q(),se.PieChart,A,_,D,Math.min(U*.5,W*.5),c,x):M(),Si(b,Z,R,V,A,_)},ue=()=>{try{Z=0,t.ChartData.forEach(h=>{h.properties.dataLabelPosition=="2"&&(ne=!0),Z+=h.data[0].value})}catch(h){Ae(Ba,"loopOverSeriesData",h)}},ge=()=>{try{P=Math.min(U*.5,W*.5),ne&&(P=P*.9)}catch(h){Ae(Ba,"defineChartRadius",h)}},be=()=>{try{let h=rt(b.plotArea.rotation);const k=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;$=v.pie().value(i=>Math.abs(k?100:i.data[0].value)).startAngle((h??0)*(Math.PI/180)%360).endAngle(((h??0)+360)*(Math.PI/180)%360)(t.ChartData).map((i,y)=>({...i,x0:i.startAngle,x1:i.endAngle,y0:0,y1:P,depth:2}))}catch(h){Ae(Ba,"initPieChartData",h)}},pe=()=>{try{const h=v.arc().innerRadius(0).outerRadius(P),k=v.arc().innerRadius(0).outerRadius(P+10),o=D.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${Q()}`).selectAll("path").data($).enter().append("path").attr("class",d=>"path").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",d=>d.data.properties.color!==Re.white?d.data.properties.color:"none").attr(lt.SeriesId,d=>d.data.properties.legendUniqueId??d.data.properties.name??"").attr(lt.DimValue,d=>d.data.properties.alias||d.data.legend||"").on("click",Tt(u,L,(d,i)=>({seriesId:i.data.properties.legendUniqueId??i.data.properties.name??"",dimValue:i.data.properties.alias||i.data.legend||"",legendUniqueId:i.data.properties.legendUniqueId??i.data.properties.name??"",seriesDisplayName:i.data.properties.alias||i.data.properties.name||""}))).on("mouseover.arc",function(d){v.select(this).transition().duration(100).attr("d",k)}).on("mousemove. ",d=>{yt([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(d.currentTarget.__data__.data.data[0].value/Z)*100).toFixed(rt(b.toolTip.toolTipDecimalPrecision))+"%":qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(d.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:d.currentTarget.__data__.data.properties.alias}],b,void 0,d.currentTarget.__data__.data.properties,gt(p,String(d.currentTarget.__data__.data.legend??""),d.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(d){v.select(this).transition().duration(100).attr("d",h),ot()});b.animation.animationEnabled?o.transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attrTween("d",function(d){const i=v.interpolate({startAngle:d.startAngle,endAngle:d.startAngle},d);return y=>h(i(y))}):o.attr("d",d=>h(d))}catch(h){Ae(Ba,"drawPieChart",h)}},Q=()=>{try{return`translate(${W/2},${U/2})`}catch(h){return Ae(Ba,"getPiePosition",h),""}},G=(h,k)=>{try{if(k)return"translate(0 0)";{const o=(h.startAngle+h.endAngle)/2,d=Math.cos(o-Math.PI/2)*(P*.65),i=Math.sin(o-Math.PI/2)*(P*.65);let y=o*180/Math.PI%360,T=0;return y>180&&y<360?T=90:T=-90,y+=T,`translate(${d},${i}) rotate(${y})`}}catch(o){return Ae(Ba,"getDataLabelTransformString",o),""}},M=()=>{try{if(b.plotArea.dataLabels){const h=$&&$.length===1;D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.labelFontSize??11).attr("fill",d=>d.data.properties?.labelFontColor??Re.black).attr("font-style",d=>d.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",d=>d.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",d=>d.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",d=>d.data.properties?.labelFont??tt).attr("transform",d=>G(d,h)).attr("visibility",d=>d.endAngle-d.startAngle<.09&&e.plotArea.hideInsignificantValue?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(d=>{const{plotArea:i}=b;return i.dataLabelName?d.data.properties?.alias||d.data.legend:""}),D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.valueFontSize??11).attr("fill",d=>d.data.properties?.valueFontColor??Re.black).attr("font-style",d=>d.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",d=>d.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",d=>d.data.properties?.valueFont??tt).attr("transform",d=>G(d,h)).attr("visibility",d=>d.endAngle-d.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(d=>{if(b.plotArea.dataLabelValue){const i=d.data.data[0].value;return b.plotArea.dataLabelValue&&i!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/Z)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("fill-opacity",.5).text(d=>{const i=Math.abs(d.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&i!==void 0?v.format(".2s")(i):""});let k=v.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>1?d.y1-1+P/7:0).outerRadius(d=>d.depth>1?d.y1-1+P/7:0),o=v.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>2?d.y0:0).outerRadius(d=>d.y1+P/1.5);D.selectAll("polyline.pie-label-connector").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",Q()).style("stroke",d=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:d.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Za.solid?0:b.connector.connectorStyle===Za.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",d=>{const i=o.centroid(d),y=k.centroid(d);let T=d.x0+(d.x1-d.x0)/2;T=T%(2*Math.PI);const a=P*1.1*(T<Math.PI?1:-1),m=y[1];return[i,y,[a,m]].map(N=>N.join(",")).join(" ")}),D.append("g").attr("class","pie-label-group").attr("transform",Q()).selectAll("foreignObject").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",d=>{let i=d.x0+(d.x1-d.x0)/2;i=i%(2*Math.PI);const T=i<Math.PI?0:-80;return P*1.1*(i<Math.PI?1:-1)+T}).attr("y",d=>k.centroid(d)[1]-30).append("xhtml:div").attr("hoverId",d=>(d.data.properties.alias||d.data.properties.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(d=>{let i=d.data.data[0].value.toString();d.data.data[0].value!==void 0&&(i=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(d.data[0].value/Z)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision))+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(d.data.data[0].value));let y="";return b.plotArea.dataLabelName&&(y+=`<span style="
73
+ `,w},"");g.html(x?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${Kl}; color:${m}; line-height:${Ql};">${x}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${b}</div>`);const U=g.node(),Y=U.offsetWidth,H=U.offsetHeight;let I=A+15,D=E+15;I+Y>window.innerWidth&&(I=A-Y-10),D+H>window.innerHeight&&(D=E-H-10),g.style("left",`${I}px`).style("top",`${D}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(l){console.error("Tooltip Error:",l)}}function ot(){try{v.select("#chartTooltipDiv").html("").style("visibility",Et.hidden)}catch(t){me(xt,"hideTooltipOnMouseOut",t)}}const Xt=(t,e,n,o)=>{try{let l=v.select(t.current).append("foreignObject").attr("visibility",o.chartTitle.chartTitleVisibility?Et.visible:Et.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",n).attr("height",e+"px");o.chartTitle.dynamicTitleText.length!==0?l.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",Et.visible).style("line-height","1.3em").html(o.chartTitle.chartTitleHTML?o.chartTitle.chartTitleHTML:o.chartTitle.chartTitleText):l.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",Et.visible).style("line-height","1.3em").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",o.chartTitle.chartTitleFontFamily).attr("title",o.chartTitle.chartTitleText).html(o.chartTitle.chartTitleText)}catch(x){me(xt,"drawChartTitle",x)}},qi=(t,e)=>{try{return t.reduce((n,o)=>{const x=typeof o=="string"?o:e&&typeof o=="object"&&o[e]||"";return x.length>n.length?x:n},"")}catch(n){me(xt,"findStringWithLongestLength",n)}},xa=(t,e,n,o,x,l,r,c,p,m,L,u=!1,S)=>{try{if(m.legends.legendVisibility){let W="",A="";r==Je.left||r==Je.right?(A="column",W=c==Ea.top?"start":c==Ea.middle?"center":"end"):(A="row",W=c==Ra.start?"start":c==Ra.middle?"center":"end");var g=t.append("foreignObject").attr("x",n).attr("y",o).style("pointer-events","auto").attr("width",x+"px").attr("height",l+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+L).attr("class","legendsBoxWrapper").style("width",x+"px").style("display","flex").style("height",l-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+W).style("flex-direction",A).style("outline-offset","-"+m.legends.legendBorderThickness+"px").style("outline",m.legends.legendBorder?`${m.legends.legendBorderThickness+"px solid"+m.legends.legendBorderColor}`:"none").append("div").attr("class","scrollbar").style("display","flex").style("flex-direction",A).style("flex-wrap","nowrap").style("padding-left","3px");(r==Je.top||r==Je.bottom)&&g.style("flex-direction","row"),e.forEach((b,U)=>{let Y=g.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("width","fit-content").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("dblclick",function(){S(b?.properties)}).on("mousemove",function(){if(m.legends.onHoverEffect){const w=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${w}"]`).classed("highlight",!0).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!0)}}).on("mouseout",function(){if(m.legends.onHoverEffect){const w=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${w}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(r==Je.top||r==Je.bottom)&&Y.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let H;if(!p){let w=b.properties.type;w==le.ColumnChart||w==le.StackColumnChart?H=ct.rectangle:w==le.LineChart||w==le.StackLineChart?H=ct.line:(w==le.AreaChart||w==le.StackAreaChart)&&(H=ct.areaWithLine)}(p||H)==ct.circle?ir(b,Y):(p||H)==ct.hollowCircle?lr(b,Y):(p||H)==ct.line?Ki(b,Y,m):(p||H)==ct.areaWithLine?Qi(b,Y,m):(p||H)==ct.rectangle&&rr(b,Y);let I=u&&(r==Je.bottom||r==Je.top)&&U!=e.length-1?" |":"",D=u?m.legends.legendSelectedUnicolor:m.legends.legendColorMode==Vl.multiColor?b.properties.color?b.properties.color:Ie.black:m.legends.legendSelectedUnicolor;Y.append("div").style("margin-left","5px").style("color",D).style("background",b.properties.axis==Qe.secondary&&m.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(u?m.legends.legendFontSize:b.properties.fontSize)+"px").style("font-family",u?m.legends.legendFontFamily:b.properties.fontFamily).style("font-style",()=>(u?m.legends.legendFontStyle:b.properties.fontStyle).includes(ce.italic)?ce.italic:"").style("text-decoration",()=>(u?m.legends.legendFontStyle:b.properties.fontStyle).includes(ce.underline)?ce.underline:"").style("font-weight",()=>(u?m.legends.legendFontStyle:b.properties.fontStyle).includes(ce.bold)?ce.bold:"").style("white-space","nowrap").attr("title",u?b.legendDisplay+" : "+b.actualValue:b.properties.alias).html(u?b.legendDisplay+" : "+b.actualValue+I:b.properties.alias)})}}catch(W){me(xt,"legendsWithScroll",W)}};function ir(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(n){me(xt,"getCircleShape",n)}}function lr(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("border",`3px solid ${t.properties.Color??t.properties.color}`)}catch(n){me(xt,"getHollowCircleShape",n)}}function Ki(t,e,n){try{const o=t.properties?.lineStyle?.toLowerCase()||"solid";let x=e.append("div").style("height","2px").style("width",o=="dashed"?"25px":"20px").style("background",Ie.transparent).style("position","relative").style("border-top",o=="none"?"unset":o=="dotted"?"2px dotted "+t.properties.color:o=="dashed"?"2px dashed "+t.properties.color:"2px solid "+t.properties.color);if(n.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":x.append("div").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-6)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","4.5").style("fill",t.properties.markerColor);break;case"square":x.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-2px, -7px)").style("height","8px").style("width","8px").style("top","2px").style("left","9px").style("background",t.properties.markerColor);break;case"triangle":x.append("div").style("position","absolute").style("transform","translate(5px, -6.5px)").style("border-left","6px solid transparent").style("border-right","6px solid transparent").style("border-bottom",`10px solid ${t.properties.markerColor}`);break;case"cross":x.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-5px, -3px)").style("height","4px").style("width","10px").style("background",t.properties.markerColor).append("div").style("height","10px").style("width","4px").style("background",t.properties.markerColor).style("position","relative").style("top","-3px").style("left","3px");break;case"diamond":x.append("div").style("height","7px").style("width","7px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-4px").style("left","7px").style("position","absolute");break;case"star":x.append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-bottom",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-6.5px").style("left","7px").style("transform","rotate(0deg)").append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-top",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","2px").style("left","-4px").style("transform","rotate(360deg)");break;case"wye":x.append("div").style("height","6.5px").style("width","3px").style("background",t.properties.markerColor).style("position","absolute").style("left","10px").style("top","-3.5px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":default:break}}catch(o){me(xt,"getLineShape",o)}}function Qi(t,e,n){try{let o=e.append("div").style("height","10px").style("width","15px").style("background",t.properties.color).style("display","flex").style("flex-direction","column").style("border-radius","1px");if(n.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.color).style("position","relative").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-5)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","2.5").style("fill",t.properties.markerColor);break;case"square":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-4px, -3.5px)").style("height","5px").style("width","5px").style("top","2px").style("left","9px").style("background",t.properties.markerColor).style("border-radius","1px");break;case"triangle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("transform","translate(5px, -3.5px)").style("border-left","3px solid transparent").style("border-right","3px solid transparent").style("border-bottom",`7px solid ${t.properties.markerColor}`);break;case"cross":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-3px, -2px)").style("height","4px").style("width","7px").style("background",t.properties.markerColor).append("div").style("height","6px").style("width","3px").style("background",t.properties.markerColor).style("position","relative").style("top","-1px").style("left","2px");break;case"diamond":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4px").style("width","4px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-1px").style("left","5px").style("position","absolute");break;case"star":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-bottom",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-3px").style("left","6px").style("transform","rotate(0deg)").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-top",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","0.5px").style("left","-2px").style("transform","rotate(360deg)");break;case"wye":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4.5px").style("width","2px").style("background",t.properties.markerColor).style("position","absolute").style("left","6.5px").style("top","-0.5px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor);break;default:break}o.append("div").style("height","20%").style("width","100%").style("background","white"),o.append("div").style("height","60%").style("width","100%").style("background",t.properties.color).style("border-radius","1px")}catch(o){me(xt,"getAreaShape",o)}}function rr(t,e){try{e.append("div").style("height","10px").style("width","15px").style("border-style",t).style("border-width",t).style("border-color",t).style("background",t.properties.color).style("border-radius","1px")}catch(n){me(xt,"getReactShape",n)}}const qt=(t,e,n,o)=>{try{let x=t.current;x.setAttribute("viewBox",`0 0 ${e} ${n}`);const{chartAreaColor:l,chartAreaBorder:r}=o.chartArea;if(x.style.backgroundColor=l,r){let p=o.chartArea.chartAreaBorderColor,m=o.chartArea.chartAreaBorderThickness+"px",L=rt(o.chartArea.chartAreaBorderStyle),u=L==1?"solid":L==2?"dashed":"dotted";x.style.outline=`${m} ${u} ${p}`,x.style.outlineOffset=`-${m}`}else x.style.outline="unset"}catch(x){me(xt,"initSvg",x)}},oa=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(n){me(xt,"initChartArea",n)}},Kt=(t,e)=>{try{let n=v.select(t.current);n.selectAll("*").remove();let o=Zi(Ri,e),x=t.current.getBoundingClientRect(),l=x.width,r=x.height;return{chartFormatOptions:o,svg:n,width:l,height:r}}catch(n){me(xt,"firstFunctionBeforeRender",n)}},Ua=(t,e,n,o,x,l=!1)=>{try{let r=t.legends.legendPosition;r=t.legends.legendVisibility?t.legends.legendPosition:Je.none;let c=e*.15*.8,p=l?o[0]:c<o[0]+15?c:o[0]+15,m=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?$t(t.chartTitle.chartTitleHTML,void 0,void 0).height:$t(t.chartTitle.chartTitleText,16,tt).height:5;switch(r){case Je.none:x.top=m+10,x.bottom=15,x.right=15,x.left=15;break;case Je.top:x.top=m+50,x.bottom=15,x.right=15,x.left=15;break;case Je.right:x.right=p+50,x.top=m+15,x.bottom=15,x.left=15;break;case Je.bottom:x.bottom=45,x.top=m+15,x.right=15,x.left=15;break;case Je.left:x.left=p+50,x.top=m+15,x.bottom=15,x.right=15}let L=n-x.top-x.bottom,u=e-x.left-x.right;return{margins:x,innerHeight:L,innerWidth:u,legendListWidth:p,chartTitleHeight:m}}catch(r){me(xt,"marginCalculationsForChartsWithoutAxis",r)}},Wa=(t,e,n,o,x,l,r,c,p,m,L=!0,u)=>{try{let S=t.legends.legendPosition,g=t.total.totalPosition,W=t.total.totalAlignment,A=t.total.totalVisibility&&L,E=t.legends.legendAlignmentTopBottom,b=t.legends.legendAlignment;switch(S){case Je.none:break;case Je.right:xa(e,n,o-l-25,r+5+(A&&g==Fa.top&&W==Wt.end?10:0),l+15,x-r-10-(A?g==Fa.top&&W==Wt.end?10:g==Fa.bottom&&W==Wt.start?25:0:0),S,b,m,t,c,!1,u);break;case Je.top:xa(e,n,5,r+5,o-10,30,S,E,m,t,c,!1,u);break;case Je.left:xa(e,n,5,p.top+(A&&g==Fa.top&&W==Wt.start?10:0),l+15,x-r-10-(A?g==Fa.top&&W==Wt.start?10:g==Fa.bottom&&W==Wt.start?25:0:0),S,b,m,t,c,!1,u);break;case Je.bottom:xa(e,n,5,x-35,o-10,30,S,E,m,t,c,!1,u);break}}catch(S){me(xt,"initLegendListWithTotalValueAllowance",S)}},Ha=(t,e,n="legend")=>{try{let o=$t(qi(e,n),rt(t.legends.legendFontSize),t.legends.legendFontFamily);return[o.width,o.height]}catch(o){me(xt,"calculateLegendsMaxPossibleWidth",o)}},ri=(t,e,n,o=!1)=>{try{let x=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?$t(t.chartTitle.chartTitleHTML,void 0,void 0).height:$t(t.chartTitle.chartTitleText,16,tt).height:5,l={top:t.chartTitle.chartTitleVisibility?x:20,bottom:o&&t.colorScale.showColor==Ta.colorTheme?40:20,left:20,right:20};return innerHeight=e-l.top-l.bottom,innerWidth=n-l.left-l.right,{margins:l,chartTitleHeight:x,innerHeight,innerWidth}}catch(x){me(xt,"marginCalculationsForChartsWithoutLegends",x)}},rt=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const n=parseFloat(e);return isNaN(n)?t:n}catch(e){me(xt,"convertStringToNumber",e)}};function mt(t,e,n=!1){try{return t.map(o=>{let x;o.properties?x={...ji,...o.properties}:x={...ji,legend:o.legend,currentLegend:o.legend,alias:o.legend,name:o.legend};const l=e&&e.length!==0?e.map(r=>{const c=o.data.find(p=>p.dimension===r);return c?{...c}:{dimension:r,legend:o.legend,value:0}}):o.data.map(r=>({...r}));return{...o,properties:x,data:n?o.data:l}})}catch(o){me(xt,"generalizedChartData",o)}}const mi=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){me(xt,"getJQuerySelector",e)}},fi=(t,e,n,o,x,l,r)=>{try{let c=t-e,p=l-x,m=parseInt(r.connector.connectorKPI),L,u;switch(m){case 1:if(L=`.${n}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return v.format(L)(t);c=Math.abs(c);break;case 3:return L=`.${n}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(c=Math.round(t/e*100-100)/100,u=v.format(L)(c),u);case 2:return x.toString().length!==4&&(p=NaN),L=`.${n}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(c=Math.pow(t/e,1/p)-1,u=v.format(L)(c),u)}if(e==0)return"N/A";{let S,g="",W=r.connector.connectorDisplayUnits;switch(W!="None"&&W!=null&&(W=="Thousands"&&(S=1e3,g="K"),W=="Millions"&&(S=1e6,g="M"),W=="Billions"&&(S=1e9,g="B"),c=c/S),isNaN(c)&&(c=0),o){case",.0%":return L=`.${n}%`,v.format(L)(c);case"":return L=`.${n}f`,v.format(L)(c)+g;case".2n":return L=`.${n}n`,v.format(L)(c)+g;case".2$":return L=`,.${n}f`,"$"+v.format(L)(c)+g;case".2c":return L=`,.${n}f`,"C$"+v.format(L)(c)+g;case".2ē":return L=`,.${n}f`,"€"+v.format(L)(c)+g;case".2ch":return L=`,.${n}f`,"CHF"+v.format(L)(c)+g;case",":return L=`,.${n}f`,v.format(L)(c)+g;case".2£":return L=`,.${n}f`,"£"+v.format(L)(c)+g;case".2₹":return L=`,.${n}f`,"₹"+v.format(L)(c)+g;default:return L=".2f",v.format(L)(c)+g}}}catch{}},Xa=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function nr(t,e,n){try{let o=function(l){const r=l.split(" - ");return r.length>1?r[0]:l};const x=new Map;return e?.LegendList?.forEach(l=>{x.set(n?o(l?.name):l.measureUniqueId,l)}),t.map(l=>({...l,properties:x.get(n?o(l.legend):l.properties.measureUniqueId)??l.properties})).filter(l=>l.data[0].value!==0)}catch{return t}}const sr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let L=0,u=!1;const S=le.ColumnChart,g=Ce.useRef(),W=Ce.useRef(r);W.current=r;const A=Ce.useRef(c);A.current=c;const E=Ce.useRef(p);E.current=p;const b=mt(n.ChartData,n.DimensionList),U=n.DimensionList,Y=!1;let H=!1;const I=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,w=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,K=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue=[],ve=0,Pe=0,Ye=[];const We=new Map;let be={dimensionList:U,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{ze()}catch(ee){me("Columnchart","createColumnChart",ee)}},[e]);const ze=()=>{({formatOptions:e,svg:f,width:i,height:y}=Ft(g,e)),{formatOptions:e,dataTableLegendsList:Ye}=ea(e,b,n.DataTableData??[]),ke(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:w,secondaryCustomYaxisMaxValue:K}=Rt(e,be.yMinLeft,be.yMaxLeft,be.yMinRight,be.yMaxRight),{margin:ye,yLabel:se,xLabel:te,yTitle:xe,xTitle:ge,dimensionHeightWidthArray:pe,chartTitleHeight:he,secondaryAxisTitleWidth:O,legendMargin:X,secondaryYLabel:M,visibleBars:Pe,columnWidth:L,scrollbarVisible:u}=Mt(i,y,h,k,be.yMaxLeft,e,be.legendList,be.dimensionList,be.yMaxRight,H,I,t,!1,be,Ye),_(ye),{dataTable:T,dataTableHeight:a}=ia(e,se,xe,b,be.dimensionList,n),St(f,i,y,e),N=wt(f,ye),kt(N,e,a,s,d,S,m),Se(),$(),Zt(N,e,a,se,Me,d),H&&bi(N,e,a,M,Ee,d,s),Dt(e,Y,f,ye,te,y,ge,be.chartType,se,s,d),Vt(d,e,a,Y,f,ye,xe,se),Gt(f,H,ye,e,a,d,s,M,O),Nt(f,e,i,he),It(y,f,pe,he,i,X,e,b,m,a,ye,ct.rectangle,S,l),_t(b,y,i,f,ye,s,u,Pe,be,ve,!1,G)},ke=()=>{const ee=[],F=[];let q=[],ue=-1/0,B=1/0,V=-1/0,P=1/0,C=1/0,re=-1/0;b.forEach(j=>{F.push(j.properties.legendUniqueId),re=-1/0,C=1/0,j.data.forEach(ie=>{ee.push(ie),j.properties.axis==="Secondary"?(H=!0,V=Math.max(V,ie.value),P=Math.min(P,ie.value)):(ue=Math.max(ue,ie.value),B=Math.min(B,ie.value)),re=Math.max(re,ie.value),C=Math.min(C,ie.value)}),j.properties.setColorScale&&We.set(j.properties.legendUniqueId,v.scaleSequential().domain([C,re]).interpolator(yi.interpolateRgb(j.properties.startColor,j.properties.endColor)))}),be.chartData=ee,be.legendList=F,be.yMaxLeft=ue,be.yMinLeft=B>0?0:B,be.yMaxRight=V,be.yMinRight=P>0?0:P,q=t?Tt(e.xAxisLabel.xAxisNumberFormat,be.dimensionList).map(j=>j):be.dimensionList,be.dimensionList.forEach((j,ie)=>{be.formattedDimensionListMap.set(j,q[ie])}),Ue=JSON.parse(JSON.stringify(b)),Le=be.dimensionList,e.plotArea.hideZeroValues&&(be.hideZeroValues=!0)},Se=()=>{let ee=yt(w||be.yMaxLeft,be.yMinLeft,d,e,be,D,w).yAxisLabelArray;if(be.yMaxLeft=ee[ee.length-1],be.yMinLeft=ee[0],ne=v.scaleLinear().domain([be.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:be.yMinLeft<0?be.yMinLeft*1.1:be.yMinLeft*.9,be.yMaxLeft<=0?0:w!==void 0&&!Number.isNaN(w)?w:be.yMaxLeft*1.1]).range([a>0?d-a:d,0]),H){let F=yt(K||be.yMaxRight,be.yMinRight,d,e,be,z,K).yAxisLabelArray;be.yMaxRight=F[F.length-1],be.yMinRight=F[0],Z=v.scaleLinear().domain([be.yMinRight>=0?(z||z==0)&&!Number.isNaN(z)?z:0:(z||z==0)&&!Number.isNaN(z)?z:be.yMinRight*1.1,be.yMaxRight<=0?K||0:K||be.yMaxRight*1.1]).range([a>0?d-a:d,0])}Te=[0,s],oe()},oe=()=>{Re=v.scaleBand().domain(be.legendList).range([0,L]).paddingInner(be.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),fe=v.scalePoint().domain(Le).range(Te).padding(.5)},$=()=>{{let ee=yt(w||be.yMaxLeft,be.yMinLeft,d,e,be,D,w);Me=v.axisLeft(ne).tickFormat(F=>Xe(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,s)).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(H){let ee=yt(K||be.yMaxRight,z||be.yMinRight,d,e,be,z,K);Ee=v.axisRight(Z).tickFormat(F=>Xe(F,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue??d/30).tickSize(zt(e,s)).tickPadding(8).tickSizeOuter(0)}},R=()=>{J=(parseInt(e.xAxisLabel.xAxisPosition)==1?v.axisTop(fe):v.axisBottom(fe)).tickSize(sa(e,d,a)).tickSizeOuter(0).tickValues(gt(Le,s,e))},ae=ee=>{ee.forEach(F=>{F.data.forEach(q=>{q.hideZero=F.properties.hideZeroValues,q.axis=F.properties.axis,q.legendUniqueId=F.properties.legendUniqueId})}),Le.forEach(F=>{N.append("rect").attr("id",`dim-background-${F}`).attr("class","dimension-background").attr("x",fe(F)-fe.step()/2).attr("width",fe.step()).attr("y",0).attr("height",d).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),ee.forEach(F=>{let q=N.selectAll(".parentGroup").data([F],C=>C.properties.legendUniqueId);q=q.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(q);let ue=q.selectAll(".column-group").data(F.data,C=>C.legend+C.dimension),B=ue.enter().append("g").attr("class","column-group").attr("hoverId",(F.properties.alias||F.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",C=>`translate(${fe(C.dimension)-L/2}, 0)`);ue.attr("transform",C=>`translate(${fe(C.dimension)-L/2}, 0)`),B.merge(ue).attr("transform",C=>`translate(${fe(C.dimension)-L/2}, 0)`);const V=B.append("rect").attr("x",C=>Re(C.legendUniqueId)).attr("width",Re.bandwidth()).attr("y",C=>(F.properties.axis===Qe.primary?ne:Z)(0)).attr("height",0).attr("fill",C=>We.get(F.properties.legendUniqueId)?.(C.value)??F.properties.color).attr("stroke-dasharray",C=>F.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",C=>`${F.properties.stackBorderWidth}px`).attr("stroke",C=>F.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?F.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",C=>C.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>F.properties.legendUniqueId).attr(lt.DimValue,C=>Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension));(e.animation.animationEnabled?V.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):V).attr("y",C=>{const re=F.properties.axis===Qe.primary?ne:Z;return C.value>0?re(C.value):re(0)}).attr("height",C=>{const re=F.properties.axis===Qe.primary?ne:Z;return Math.abs(re(C.value)-re(0))}),B.merge(ue).on("mousemove",(C,re)=>{(F.properties.alias||F.properties.name||"Legend").replace(/ /g,"-");const j=Array.isArray(re.dimension)?re.dimension[0]:re.dimension,ie=String(be.formattedDimensionListMap.get(j)??j??""),we=At(W.current,String(j??""),{...F.properties,formattedDimensionValue:ie});ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ie},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():re.properties?.currentMeasure?re.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||re.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(S)?re[1]-re[0]:re.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:F.properties.alias}],e,C,F.properties,we)}).on("mouseout",(C,re)=>{(F.properties.alias||F.properties.name||"Legend").replace(/ /g,"-"),ot()}),B.merge(ue).on("click",vt(E,A,(C,re)=>({seriesId:F.properties.legendUniqueId,dimValue:Array.isArray(re.dimension)?String(re.dimension[0]):String(re.dimension),legendUniqueId:F.properties.legendUniqueId,seriesDisplayName:F.properties.alias||F.properties.name||""}))),ue.exit().remove()}),N.selectAll(".parentGroup").raise()},_=ee=>{s=i-ee.left-ee.right,d=y-ee.bottom-ee.top},G=(ee,F,q)=>{Ue=F,Le=ee,Pe=q,Q()},Q=()=>{oe(),R(),ta(N,be,te,e,a,ne,J,pe,y,L,t,s,d,Le,fe),ae(Ue),$a(b,fe,ne,Z,ye,pt,[],[],e,S,y,i,s,Le,d,m,f,x,Re,L,o),ua(e.plotArea.fitChart,f,N,T,L,ne,fe,Re,void 0,void 0,a,S,e,se,xe,be.dimensionList,s,Te,be.formattedDimensionListMap,m,ye,d)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:g,id:m,style:{width:"100%",height:"100%"}})})},or=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0,u=!1,S=[];const g=le.CustomColumnChart,W=Ce.useRef(),A=Ce.useRef(r);A.current=r;const E=Ce.useRef(c);E.current=c;const b=mt(n.ChartData,n.DimensionList),U=n.DimensionList,Y=!!e.swapAxis?.swapAxisEnabled;let H=!1;const I=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,w=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,K=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me=[],J=[],Ee=[],Le=[],Ue=[],ve=[],Pe=[],Ye=[],We,be,ze,ke=new Map,Se,oe,$,R,ae,_,G,Q=[],ee=[],F=0,q,ue=[],B={dimensionList:U,chartType:g,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{V()}catch(Be){me("CustomColumnchart","createCustomColumnChart",Be)}},[e]);const V=()=>{({formatOptions:e,svg:f,width:i,height:y}=Ft(W,e)),P(),{formatOptions:e,dataTableLegendsList:ue}=ea(e,b,n.DataTableData??[]),vi(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:w,secondaryCustomYaxisMaxValue:K}=Rt(e,B.yMinLeft,B.yMaxLeft,B.yMinRight,B.yMaxRight),{margin:ye,yLabel:se,xLabel:te,yTitle:xe,xTitle:ge,dimensionHeightWidthArray:pe,chartTitleHeight:he,secondaryAxisTitleWidth:O,legendMargin:X,secondaryYLabel:M,visibleBars:q,columnWidth:L,scrollbarVisible:u}=Mt(i,y,h,k,B.yMaxLeft,e,B.legendList,B.dimensionList,B.yMaxRight,H,I,t,Y,B,ue),it(ye),{dataTable:T,dataTableHeight:a}=ia(e,se,xe,b,B.dimensionList,n),Y&&(T=[],a=0),St(f,i,y,e),N=wt(f,ye),kt(N,e,a,s,d,g,m),re(),ie(),Y?(ra(e,N,se,d,s,R),H&&Ai(e,N,M,ae,s)):(Zt(N,e,a,se,We,d),H&&bi(N,e,a,M,ze,d,s)),Dt(e,Y,f,ye,te,y,ge,B.chartType,se,s,d),Vt(d,e,a,Y,f,ye,xe,se,s),Gt(f,H,ye,e,a,d,s,M,O,Y),Nt(f,e,i,he),It(y,f,pe,he,i,X,e,b,m,a,ye,null,g,l),_t(b,y,i,f,ye,s,u,q,B,F,!1,nt,Y)},P=()=>{const Be=[];let qe=[],dt=-1/0,Oe=1/0,at=-1/0,je=1/0,Ne=[];b.forEach((Ve,He)=>{[le.StackColumnChart,le.StackAreaChart].includes(Ve.properties.type)?le.StackColumnChart===Ve.properties.type&&(Be.includes(le.StackColumnChart)||Be.push(le.StackColumnChart)):(Ne.push(Ve),Ve.properties.type!==le.LineChart&&Ve.properties.type!==le.AreaChart&&Be.push(Ve.properties.legendUniqueId)),Ve.properties.axis==="Secondary"&&(J.push(Ve),Ve.properties.type==le.StackColumnChart&&ve.push(Ve),Ve.properties.type==le.StackAreaChart&&Ue.push(Ve)),Ve.properties.axis===Qe.primary&&(Me.push(Ve),Ve.properties.type==le.StackColumnChart&&Le.push(Ve),Ve.properties.type==le.StackAreaChart&&Ee.push(Ve)),Ve.data=Ve.data.map(ht=>{const st={...ht,type:Ve.properties.type,axis:Ve.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ve.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ve.properties.labelColor,legendUniqueId:Ve.properties.legendUniqueId};return st.axis==="Secondary"?(H=!0,at=Math.max(at,st.value),je=Math.min(je,st.value)):(dt=Math.max(dt,st.value),Oe=Math.min(Oe,st.value)),st})}),Q=JSON.parse(JSON.stringify(b)),B.chartData=Ne,B.legendList=Be,B.yMaxLeft=dt,B.yMinLeft=Oe>0?0:Oe,B.yMaxRight=at,B.yMinRight=je>0?0:je,qe=t?Tt(e.xAxisLabel.xAxisNumberFormat,B.dimensionList).map(Ve=>Ve):B.dimensionList,B.dimensionList.forEach((Ve,He)=>{B.formattedDimensionListMap.set(Ve,qe[He])}),e.plotArea.fitChart?G=B.dimensionList:G=B.dimensionList.slice(F,F+q),e.plotArea.hideZeroValues&&(B.hideZeroValues=!0),C(Ee,Le,Ue,ve,b)},C=(Be,qe,dt,Oe,at)=>{const je=Lt(G,Be,!1),Ne=Lt(G,dt,!1),Ve=Lt(G,qe,!1),He=Lt(G,Oe,!1);ee=[];const ht=[];if(Be.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:je,data:Be})}),dt.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:Ne,data:dt})}),qe.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:Ve,data:qe})}),Oe.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:He,data:Oe})}),ht.push(...B.chartData),at.length){const st=[];at.forEach(ki=>{st.push(...ht.filter(Al=>Al.properties?.type===ki.properties.type&&Al.properties.legend===ki.legend))}),ee.push(...st)}else ee.push(...ht)},re=()=>{const Be=Y?[0,a>0?s-a:s]:[a>0?d-a:d,0];{const qe=v.scaleLinear().domain([B.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:B.yMinLeft<0?B.yMinLeft*1.1:B.yMinLeft*.9,B.yMaxLeft<=0?0:w!==void 0&&!Number.isNaN(w)?w:B.yMaxLeft*1.1]).range(Be);Y?oe=qe:ne=qe}if(H){const qe=v.scaleLinear().domain([B.yMinRight>=0?(z||z==0)&&!Number.isNaN(z)?z:0:(z||z==0)&&!Number.isNaN(z)?z:B.yMinRight*1.1,B.yMaxRight<=0?(K||K==0)&&!Number.isNaN(K)?K:0:(K||K==0)&&!Number.isNaN(K)?K:B.yMaxRight*1.1]).range(Be);Y?$=qe:Z=qe}Te=Y?[d,0]:[0,s]},j=()=>{Re=v.scaleBand().domain(B.legendList).range([0,L]).paddingInner(B.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0);const Be=v.scalePoint().domain(G).range(Te).padding(.5);Y?Se=Be:fe=Be},ie=()=>{{let Be=yt(w||B.yMaxLeft,B.yMinLeft,d,e,B,D,w,Y,s);Y?R=v.axisBottom(oe).tickFormat(qe=>Xe(qe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??s/50).tickPadding(8).tickSizeOuter(0):We=v.axisLeft(ne).tickFormat(qe=>Xe(qe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,s)).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(H){let Be=yt(w||B.yMaxRight,B.yMinRight,d,e,B,D,w);Y?ae=v.axisTop($).tickFormat(qe=>Xe(qe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??s/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0):ze=v.axisRight(Z).tickFormat(qe=>Xe(qe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??d/30).tickSize(zt(e,s)).tickPadding(8).tickSizeOuter(0)}},we=()=>{Y?_=v.axisLeft(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*s*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(G,d,e)):be=v.axisBottom(fe).tickSize(sa(e,d,a,!0)).tickSizeOuter(0).tickValues(gt(G,s,e))},de=Be=>{Be.forEach(Oe=>{switch(Oe.properties.type){default:case le.ColumnChart:Ae(Oe);break;case le.LineChart:break;case le.AreaChart:break;case le.StackColumnChart:Pe=Ia(Oe),_e();break;case le.StackAreaChart:Ye=Ia(Oe),Fe(Oe);break}});const qe=Q.filter(Oe=>Oe.properties.type===le.LineChart);qe.length&&De(qe);const dt=Q.filter(Oe=>Oe.properties.type===le.AreaChart);dt.length&&$e(dt),N.selectAll(".parentGroup").raise()},Ae=Be=>{let qe=N.selectAll(".parentGroup").data([Be],Ne=>Ne.properties?.legendUniqueId);qe=qe.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(qe);let dt=qe.selectAll(".column-group").data(Be.data,Ne=>Ne.legendUniqueId),Oe=dt.enter().append("g").attr("class","column-group").attr("hoverId",Ne=>(Be.properties.alias||Be.properties.name).includes("-")?(Be.properties.alias||Be.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(Be.properties.alias||Be.properties.name).replace(/ /g,"-")).attr("transform",Ne=>Y?`translate(0, ${Se(Ne.dimension)})`:`translate(${fe(Ne.dimension)}, 0)`);Oe.merge(dt).attr("transform",Ne=>Y?`translate(0, ${Se(Ne.dimension)-L/2})`:`translate(${fe(Ne.dimension)-L/2}, 0)`);const at=(Y?Oe.append("rect").attr("y",Ne=>Re(Ne.legendUniqueId)).attr("height",Re.bandwidth()).attr("x",()=>(Be.properties.axis===Qe.primary?oe:$)(0)).attr("width",0):Oe.append("rect").attr("x",Ne=>Re(Ne.legendUniqueId)).attr("width",Re.bandwidth()).attr("y",()=>(Be.properties.axis===Qe.primary?ne:Z)(0)).attr("height",0)).attr("fill",Be.properties.color).attr("stroke-dasharray",Ne=>Be.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ne=>`${Be.properties.stackBorderWidth}px`).attr("stroke",Ne=>Be.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Be.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",Ne=>Ne.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>Be.properties.legendUniqueId).attr(lt.DimValue,Ne=>Array.isArray(Ne.dimension)?String(Ne.dimension[0]):String(Ne.dimension)).on("mousemove",(Ne,Ve)=>{ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:B.formattedDimensionListMap.get(Array.isArray(Ve.dimension)?Ve.dimension[0]:Ve.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ve.properties?.currentMeasure?Ve.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ve.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(g)?Ve[1]-Ve[0]:Ve.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ve.legend.includes("~$~")?Ve.legend.split("~$~")[1]:Ve.legend}],e,Ne,b.filter(He=>He.legend===Ve.legend)[0].properties,(()=>{const He=Array.isArray(Ve.dimension)?Ve.dimension[0]:Ve.dimension,ht=b.filter(st=>st.legend===Ve.legend)[0].properties;return At(p,String(He??""),{...ht,formattedDimensionValue:String(B.formattedDimensionListMap.get(He)??He??"")})})())}).on("mouseout",ot).on("click",vt(E,A,(Ne,Ve)=>({seriesId:Be.properties.legendUniqueId,dimValue:Array.isArray(Ve.dimension)?String(Ve.dimension[0]):String(Ve.dimension),legendUniqueId:Be.properties.legendUniqueId,seriesDisplayName:Be.properties.alias||Be.properties.name||""}))),je=e.animation.animationEnabled?at.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):at;Y?je.attr("x",Ne=>{const Ve=Be.properties.axis===Qe.primary?oe:$;return Ne.value>0?Ve(0):Ve(Ne.value)}).attr("width",Ne=>{const Ve=Be.properties.axis===Qe.primary?oe:$;return Math.abs(Ve(Ne.value)-Ve(0))}):je.attr("y",Ne=>{const Ve=Be.properties.axis===Qe.primary?ne:Z;return Ne.value>0?Ve(Ne.value):Ve(0)}).attr("height",Ne=>{const Ve=Be.properties.axis===Qe.primary?ne:Z;return Math.abs(Ve(Ne.value)-Ve(0))}),dt.exit().remove()},De=Be=>{Be.forEach(je=>{je.data.forEach(Ne=>{Ne.hideZero=je.properties.hideZeroValues,Ne.axis=je.properties.axis,Ne.legendUniqueId=je.properties.legendUniqueId})});const qe=Y?v.line().y(je=>{const Ne=Se(je.dimension);return Ne??0}).x(je=>je.axis==Qe.primary?oe(je.value):$(je.value)).defined(je=>e?.plotArea?.hideZeroValues?!!je.value:!0).curve(ft(e)):v.line().x(je=>fe(je.dimension)?fe(je.dimension):null).y(je=>je.axis==Qe.primary?ne(je.value):Z(je.value)).defined(je=>e?.plotArea?.hideZeroValues?!!je.value:!0).curve(ft(e));let dt=N.selectAll(".lines.parentGroup").data([1]);dt=dt.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(dt);let Oe=dt.selectAll(".line-group").data(Be,je=>je.properties.legendUniqueId),at=Oe.enter().append("g").attr("class","line-group");at.attr("hoverId",je=>(je.properties.alias||je.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),at.merge(Oe).select("path").attr("d",je=>qe(je.data)).attr("stroke",je=>je.properties.color!==Ie.white?je.properties.color:"none").attr("stroke-dasharray",je=>{switch(je.properties.lineStyle){case bt.dotted:return"0,3";case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",je=>je.properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",je=>je.properties.lineStyle!=="None"?je.properties.lineWidth:"0"),e.animation.animationEnabled&&at.merge(Oe).select("path").each(function(){const je=v.select(this),Ne=this.getTotalLength();je.attr("stroke-dasharray",Ne+" "+Ne).attr("stroke-dashoffset",Ne),je.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),Oe.exit().remove(),Va(dt,Be,le.CombinationLine,Y?Se:fe,Y?oe:ne,Y?$:Z,null,e,B,K,z,D,w,!1,p,Y)},$e=Be=>{Be.forEach(He=>{He.data.forEach(ht=>{ht.hideZero=He.properties.hideZeroValues,ht.axis=He.properties.axis,ht.legendUniqueId=He.properties.legendUniqueId})});const qe=Y?v.area().y(He=>{const ht=Se(He.dimension);return ht??0}).x0(()=>oe(0)).x1(He=>oe(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)):v.area().x(He=>fe(He.dimension)?fe(He.dimension):null).y0(()=>ne(0)).y1(He=>ne(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)),dt=Y?v.area().y(He=>{const ht=Se(He.dimension);return ht??0}).x0(()=>oe(0)).x1(()=>oe(0)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)):v.area().x(He=>fe(He.dimension)?fe(He.dimension):null).y0(()=>ne(0)).y1(()=>ne(0)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)),Oe=e.animation.animationEnabled;let at=N.selectAll(".areas.parentGroup").data([1]),je=N.append("g").attr("class","focusClass");at=at.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(at);let Ne=at.selectAll(".area-group").data(Be,He=>He.legend),Ve=Ne.enter().append("g").attr("class","area-group");Ve.append("path").attr("hoverId",He=>(He.properties.alias||He.properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",He=>He.properties.color!==Ie.white?He.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",He=>Oe?dt(He.data):qe(He.data)).each(function(He){Oe&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",qe(He.data))}),Ne.select("path").attr("d",He=>qe(He.data)),Ve.merge(Ne).select("path").attr("stroke",He=>He.properties.areaBorderColor!==Ie.white?He.properties.areaBorderColor:"none").attr("stroke-dasharray",He=>{switch(He.properties.lineStyle){case"dotted":return"0,3";case"dashed":return fa;default:return""}}).attr("stroke-linecap",He=>He.properties.lineStyle==="dotted"?ya.round:"").attr("stroke-width",He=>He.properties.lineStyle!=="None"&&e.plotArea.plotAreaHideLineAndMarkers?He.properties.lineWidth:"0"),Li(e,at,je,G,Be,Y?Se:fe,Y?oe:ne,g,!1,Y),Ne.exit().remove(),Va(at,Be,le.CombinationArea,Y?Se:fe,Y?oe:ne,Y?$:Z,null,e,B,K,z,D,w,!1,void 0,Y)},Fe=Be=>{Be.data.forEach(Ve=>{Ve.data.forEach(He=>{He.hideZero=Ve.properties.hideZeroValues,He.axis=Ve.properties.axis,He.legendUniqueId=Ve.properties.legendUniqueId})});const qe=Y?v.area().y(Ve=>{const He=Se(Ve.data.dimension);return He??0}).x0(Ve=>Ve.data.axis===Qe.primary?oe(Ve[0]):$(Ve[0])).x1(Ve=>Ve.data.axis===Qe.primary?oe(Ve[1]):$(Ve[1])).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)):v.area().x(Ve=>fe(Ve.data.dimension)?fe(Ve.data.dimension):null).y0(Ve=>Ve.data.axis===Qe.primary?ne(Ve[0]):Z(Ve[0])).y1(Ve=>Ve.data.axis===Qe.primary?ne(Ve[1]):Z(Ve[1])).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)),dt=Y?v.area().y(Ve=>{const He=Se(Ve.data.dimension);return He??0}).x0(()=>oe(0)).x1(()=>oe(0)).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)):v.area().x(Ve=>fe(Ve.data.dimension)?fe(Ve.data.dimension):null).y0(()=>ne(0)).y1(()=>ne(0)).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)),Oe=e.animation.animationEnabled;let at=N.selectAll(".parentGroup").data([Ye]);N.append("g").attr("class","focusClass"),at=at.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(at);let je=at.selectAll(".area-group").data(Ve=>Ve),Ne=je.enter().append("g").attr("class",Ve=>"area-group "+Ve.key.replace(/ /g,"-"));Ne.append("path").attr("hoverId",Ve=>(Be.data.filter(He=>He.legend===Ve.key)[0].properties.alias||Be.data.filter(He=>He.legend===Ve.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ve=>Ve.color!==Ie.white?Ve.color:"none").attr("d",Ve=>Oe?dt(Ve):qe(Ve)).each(function(Ve){Oe&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",qe(Ve))}),je.select("path").attr("d",Ve=>qe(Ve)),Ne.merge(je).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ve=>Ve.color!==Ie.white?Ve.color:"none").attr("stroke-dasharray",(Ve,He)=>b[He].properties.lineStyle==="dotted"?"0,3":b[He].properties.lineStyle==="dashed"?fa:"").attr("stroke-linecap",(Ve,He)=>b[He].properties.lineStyle==="dotted"?ya.round:"").attr("stroke-width",(Ve,He)=>b[He].properties.lineStyle!=="None"?b[He].properties.lineWidth:"0"),je.exit().remove(),Va(at,Be.data,le.CombinationStackArea,Y?Se:fe,Y?oe:ne,Y?$:Z,null,e,B,K,z,D,w,!1,void 0,Y)},_e=()=>{let Be=N.selectAll(".parentGroup").data([Pe]);Be=Be.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(Be);let qe=Be.selectAll(".stackcolumns-group").data(Ne=>Ne);qe=qe.enter().append("g").attr("class",Ne=>"stackcolumns-group ").merge(qe);let Oe=qe.selectAll("rect").data(Ne=>Ne);Y?Oe.attr("x",Ne=>Ne.data.axis===Qe.primary?oe(Ne[0]):$(Ne[0])).attr("width",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?oe(w)-oe(Ne[0]):oe(Ne[1])-oe(Ne[0]):K&&Ne[1]>K?$(K)-$(Ne[0]):$(Ne[1])-$(Ne[0])):Oe.attr("y",Ne=>Ne.data.axis===Qe.primary?ne(Ne[1]):Z(Ne[1])).attr("height",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?ne(Ne[0])-ne(w):ne(Ne[0])-ne(Ne[1]):K&&Ne[1]>K?Z(Ne[0])-Z(K):Z(Ne[0])-Z(Ne[1]));const at=Y?Oe.enter().append("rect").attr("transform",Ne=>`translate(0, ${Se(Ne.data.dimension)-L/2})`).attr("x",Ne=>Ne.data.axis===Qe.primary?oe(0):$(0)).attr("width",0):Oe.enter().append("rect").attr("transform",Ne=>`translate(${fe(Ne.data.dimension)-L/2},0)`).attr("y",Ne=>Ne.data.axis===Qe.primary?ne(0):Z(0)).attr("height",0);at.merge(Oe).attr("hoverId",Ne=>Ne.alias.includes("~$~")?Ne.alias.split("~$~")[1].replace(/ /g,"-"):Ne.alias.replace(/ /g,"-")).attr(Y?"y":"x",Ne=>Re(le.StackColumnChart)).attr(Y?"height":"width",Re.bandwidth()).attr("fill",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(st=>st.legend===Ne.key);return b[ht]?.properties?.color||"gray"}).attr("stroke",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(ki=>ki.legend===Ne.key),st=b[ht]?.properties;return st?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?st.stackBorderColor:"none"}).attr("stroke-dasharray",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(st=>st.legend===Ne.key);return b[ht]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(st=>st.legend===Ne.key);return(b[ht]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ne,Ve)=>{ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:B.formattedDimensionListMap.get(Ve.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ve.properties?.currentMeasure?Ve.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ve.value,value:Xe(Ve.data[Ve.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ve.key.includes("~$~")?Ve.key.split("~$~")[1]:Ve.key}],e,Ne,b.filter(He=>He.legend===Ve.key)[0].properties,(()=>{const He=b.filter(ht=>ht.legend===Ve.key)[0].properties;return At(p,String(Ve.data.dimension??""),{...He,formattedDimensionValue:String(B.formattedDimensionListMap.get(Ve.data.dimension)??Ve.data.dimension??"")})})())}).on("mouseout",ot).attr(lt.SeriesId,Ne=>Ne.key??"").attr(lt.DimValue,Ne=>Array.isArray(Ne.data.dimension)?String(Ne.data.dimension[0]):String(Ne.data.dimension)).on("click",vt(E,A,(Ne,Ve)=>({seriesId:Ve.key??"",dimValue:Array.isArray(Ve.data.dimension)?String(Ve.data.dimension[0]):String(Ve.data.dimension),legendUniqueId:Ve.key??"",seriesDisplayName:Ve.alias||Ve.key||""})));const je=e.animation.animationEnabled?at.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):at;Y?je.attr("x",Ne=>Ne.data.axis===Qe.primary?oe(Ne[0]):$(Ne[0])).attr("width",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?oe(w)-oe(Ne[0]):oe(Ne[1])-oe(Ne[0]):K&&Ne[1]>K?$(K)-$(Ne[0]):$(Ne[1])-$(Ne[0])):je.attr("y",Ne=>Ne.data.axis===Qe.primary?ne(Ne[1]):Z(Ne[1])).attr("height",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?ne(Ne[0])-ne(w):ne(Ne[0])-ne(Ne[1]):K&&Ne[1]>K?Z(Ne[0])-Z(K):Z(Ne[0])-Z(Ne[1])),qe.exit().remove()},it=Be=>{s=i-Be.left-Be.right,d=y-Be.bottom-Be.top},nt=(Be,qe,dt)=>{Q=qe,G=Be,q=dt,Ba(n,ke,G),C(Ee,Le,Ue,ve,qe),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((Oe,at)=>{Oe.properties.type===le.StackColumnChart||Oe.properties.type===le.StackAreaChart?Oe.data.forEach((je,Ne)=>Q[at].data[Ne].data=je.data.filter(Ve=>G.includes(Ve.dimension))):Q[at].data=Oe.data.filter(je=>G.includes(je.dimension))}),di()};function Ba(Be,qe,dt){qe.clear(),dt&&dt.length>0&&dt.forEach(Oe=>{qe.set(Oe,0)}),Be.ChartData&&Be.ChartData.length>0&&Be.ChartData.forEach(Oe=>{Oe.properties.type.includes("Stack")&&Oe.data.forEach((at,je)=>{if(qe.has(at.dimension)){let Ne=qe.get(at.dimension)||0;Ne+=at.value||0,qe.set(at.dimension,Ne)}})})}const di=()=>{j(),we(),de(Q),Y?na(e,N,te,d,s,_,ae,oe,B.yMaxLeft,G,g,t,i,pe,L,Se):ta(N,B,te,e,a,ne,be,pe,y,L,t,s,d,G,fe);const Be=()=>{Y||jl(Q,fe,ne,Z,ye,pt,Pe,Ye,[],[],L,e,y,i,s,G,d,m,f,x,Re,o),ii(ke,Y?Se:fe,Y?oe:ne,ye,pt,[],e,g,y,i,f,o,Y)};Y||ua(e.plotArea.fitChart,f,N,T,L,ne,fe,Re,void 0,void 0,a,g,e,se,xe,B.dimensionList,s,Te,B.formattedDimensionListMap,m,ye,d),f.selectAll(".annotation-group").remove(),Be()},Ia=Be=>{let qe=Be.data.map(Oe=>Oe.legend);S=v.stack().keys(qe).offset(v.stackOffsetNone)(Be.stackData),Be.data.forEach((Oe,at)=>Oe.data.forEach((je,Ne)=>{je[0]=S[at][Ne][0],je[1]=S[at][Ne][1]}));let dt=e.annotation.annotationSetLabelColor;return S.forEach((Oe,at)=>{Oe.forEach(je=>{je.key=Oe.key,je.alias=Be.data[at].properties.alias,Oe.alias=Be.data[at].properties.alias,Oe.color=JSON.parse(JSON.stringify(Be.data[at].properties.color)),Oe.individualAnnotationVisibility=JSON.parse(JSON.stringify(Be.data[at].properties.annotation)),je.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?Be.data[at].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),je.data.labelColor=dt=="2"?JSON.parse(JSON.stringify(Be.data[at].properties.color)):JSON.parse(JSON.stringify(Be.data[at].properties.labelColor)),je.hideZero=JSON.parse(JSON.stringify(Be.data[at].properties.hideZeroValues)),je.data.axis=JSON.parse(JSON.stringify(Be.data[at].properties.axis)),je.data.color=JSON.parse(JSON.stringify(Be.data[at].properties.color)),je.data.legend=Be.properties.type,je.data.type=JSON.parse(JSON.stringify(Be.data[at].properties.type))})}),S},vi=()=>{if(Me.length>0){const qe=(Le.length>0?Lt(G,Le,!1):Lt(G,Ee,!1)).map(dt=>dt.total);B.yMaxLeft=Math.max(B.yMaxLeft,...qe),B.yMinLeft=Math.min(B.yMinLeft,...qe)}if(J.length>0){const qe=(ve.length>0?Lt(G,ve,!1):Lt(G,Ue,!1)).map(dt=>dt.total);B.yMaxRight=Math.max(B.yMaxRight,...qe),B.yMinRight=Math.min(B.yMinRight,...qe)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:W,id:m,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.LayeredColumnChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!1,U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText);let D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te=[];const Me=new Map;let J=0,Ee=2,Le=!1,Ue=[],ve={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Pe()}catch(ae){me("LayeredColumnchart","createLayeredColumnChart",ae)}},[e]);const Pe=()=>{({formatOptions:e,svg:y,width:k,height:s}=Ft(S,e)),Ye(),{formatOptions:e,dataTableLegendsList:Ue}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:X,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:D}=Rt(e,ve.yMinLeft,ve.yMaxLeft,ve.yMinRight,ve.yMaxRight),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:Ee,columnWidth:L,scrollbarVisible:Le}=Mt(k,s,O,X,ve.yMaxLeft,e,ve.legendList,ve.dimensionList,ve.yMaxRight,U,Y,t,!1,ve,Ue),oe(w),{dataTable:d,dataTableHeight:i}=ia(e,z,ye,A,ve.dimensionList,n),St(y,k,s,e),T=wt(y,w),kt(T,e,i,M,h,u,m),We(),ze(),Zt(T,e,i,z,Z,h),Dt(e,b,y,w,K,s,se,ve.chartType,z,M,h),Vt(h,e,i,b,y,w,ye,z),Gt(y,U,w,e,i,h,M,he,ge),Nt(y,e,k,xe),It(s,y,te,xe,k,pe,e,A,m,i,w,ct.rectangle,u,l),_t(A,s,k,y,w,M,Le,Ee,ve,J,!1,R)},Ye=()=>{const ae=[],_=[];let G=[],Q=-1/0,ee=1/0,F=-1/0,q=1/0,ue=-1/0,B=1/0;A.forEach(V=>{_.push(V.properties.legendUniqueId),ue=-1/0,B=1/0,V.data.forEach(P=>{ae.push(P),ue=Math.max(ue,P.value),B=Math.min(B,P.value),Q=Math.max(Q,P.value),ee=Math.min(ee,P.value)}),V.properties.setColorScale&&Me.set(V.properties.legendUniqueId,v.scaleSequential().domain([B,ue]).interpolator(v.interpolateRgb(V.properties.startColor,V.properties.endColor)))}),ve.chartData=ae,ve.legendList=_,ve.yMaxLeft=Q,ve.yMinLeft=ee>0?0:ee,ve.yMaxRight=F,ve.yMinRight=q>0?0:q,G=t?Tt(e.xAxisLabel.xAxisNumberFormat,ve.dimensionList).map(V=>V):ve.dimensionList,ve.dimensionList.forEach((V,P)=>{ve.formattedDimensionListMap.set(V,G[P])}),Te=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Re=ve.dimensionList:Re=ve.dimensionList.slice(J,J+Ee),e.plotArea.hideZeroValues&&(ve.hideZeroValues=!0)},We=()=>{let ae=yt(I||ve.yMaxLeft,ve.yMinLeft,h,e,ve,H,I).yAxisLabelArray;ve.yMaxLeft=ae[ae.length-1],ve.yMinLeft=ae[0],a=v.scaleLinear().domain([ve.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:ve.yMinLeft<0?ve.yMinLeft*1.1:ve.yMinLeft*.9,ve.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:ve.yMaxLeft*1.1]).range([i>0?h-i:h,0]),ne=[0,M]},be=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(ve.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(Re).range(ne).padding(.5)},ze=()=>{ke();{let ae=yt(I||ve.yMaxLeft,ve.yMinLeft,h,e,ve,H,I);Z=v.axisLeft(a).tickFormat(_=>Xe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,M)).tickValues(ae.autoLabelFlag?void 0:ae.yAxisLabelArray).ticks(ae.customTickValue).tickPadding(8).tickSizeOuter(0)}},ke=()=>{fe=v.axisBottom(N).tickSize(sa(e,h,i)).tickSizeOuter(0).tickValues(gt(Re,M,e))},Se=ae=>{ae.forEach(_=>{_.data.forEach(G=>{G.hideZero=_.properties.hideZeroValues,G.properties=_.properties,G.axis=_.properties.axis})}),ae.forEach((_,G)=>{let Q=T.selectAll(".parentGroup").filter(B=>B?.properties?.legendUniqueId===_.properties.legendUniqueId).data([_],B=>B.properties.legendUniqueId);Q=Q.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",_.properties.legendUniqueId).attr("clip-path",`url(#${m}-clip)`).merge(Q);let ee=Q.selectAll(".column-group").data(_.data,B=>B.dimension+"_"+_.properties.legendUniqueId),F=ee.enter().append("g").attr("class","column-group").attr("hoverId",(_.properties.alias||_.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",B=>G===0?`translate(${N(B.dimension)-L/2}, 0)`:`translate(${N(B.dimension)-L/(2+G*2)}, 0)`);ee.attr("transform",B=>G===0?`translate(${N(B.dimension)-L/2}, 0)`:`translate(${N(B.dimension)-L/(2+G*2)}, 0)`),F.merge(ee).attr("transform",B=>G===0?`translate(${N(B.dimension)-L/2}, 0)`:`translate(${N(B.dimension)-L/(2+G*2)}, 0)`);const q=F.append("rect").attr("x",()=>0).attr("width",G===0?L:L/2+G*2).attr("y",B=>(_.properties.axis===Qe.primary?a:f)(0)).attr("height",0).attr("fill",B=>Me.get(_.properties.legendUniqueId)?.(B.value)??_.properties.color).attr("stroke-dasharray",()=>_.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${_.properties.stackBorderWidth}px`).attr("stroke",()=>_.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?_.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",B=>B.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>_.properties.legendUniqueId).attr(lt.DimValue,B=>Array.isArray(B.dimension)?String(B.dimension[0]):String(B.dimension));(e.animation.animationEnabled?q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):q).attr("y",B=>{const V=_.properties.axis===Qe.primary?a:f;return B.value>0?V(B.value):V(0)}).attr("height",B=>{const V=_.properties.axis===Qe.primary?a:f;return Math.abs(V(B.value)-V(0))}),ee.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("y",B=>{const V=_.properties.axis===Qe.primary?a:f;return B.value>0?V(B.value):V(0)}).attr("height",B=>{const V=_.properties.axis===Qe.primary?a:f;return Math.abs(V(B.value)-V(0))}),F.merge(ee).on("mousemove",(B,V)=>{ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ve.formattedDimensionListMap.get(Array.isArray(V.dimension)?V.dimension[0]:V.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():V.properties?.currentMeasure?V.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||V.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?V[1]-V[0]:V.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:V.properties.alias}],e,B,V.properties,(()=>{const C=Array.isArray(V.dimension)?V.dimension[0]:V.dimension;return At(p,String(C??""),{...V.properties,formattedDimensionValue:String(ve.formattedDimensionListMap.get(C)??C??"")})})());let P=(_.properties.alias||_.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),v.selectAll('[hoverId="'+P+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(B,V)=>{let P=(_.properties.alias||_.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+P+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}),F.merge(ee).on("click",vt(W,g,(B,V)=>({seriesId:_.properties.legendUniqueId,dimValue:Array.isArray(V.dimension)?String(V.dimension[0]):String(V.dimension),legendUniqueId:_.properties.legendUniqueId,seriesDisplayName:_.properties.alias||_.properties.name||""}))),ee.exit().remove()}),T.selectAll(".parentGroup").raise()},oe=ae=>{M=k-ae.left-ae.right,h=s-ae.bottom-ae.top},$=()=>{be(),ke(),ta(T,ve,K,e,i,a,fe,te,s,L,t,M,h,Re,N),Se(Te),$a(A,N,a,void 0,w,pt,[],[],e,u,s,k,M,Re,h,m,y,x,void 0,L,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,le.ColumnChart,e,z,ye,ve.dimensionList,M,ne,ve.formattedDimensionListMap,m,w,h))},R=(ae,_,G)=>{Te=_,Re=ae,Ee=G,$()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let L=0,u=!1;const S=le.StackColumnChart,g=Ce.useRef(),W=Ce.useRef(c);W.current=c;const A=Ce.useRef(p);A.current=p;const E=n.DimensionList,b=(mt(n.ChartData,n.DimensionList)||[]).reverse(),U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText),e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText);let D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N;const ne=new Map;let Z,fe,Re,Te=[],Me=0,J,Ee=[],Le=[],Ue=new Map;const ve=!1;let Pe={dimensionList:E,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ye()}catch(F){me("StackStackColumnchart","createStackColumnChart",F)}},[e]);const Ye=()=>{({formatOptions:e,svg:i,width:h,height:k}=Ft(g,e)),We(),{formatOptions:e,dataTableLegendsList:Ee}=ea(e,b,n.DataTableData??[]),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,Pe.yMinLeft,Pe.yMaxLeft,Pe.yMinRight,Pe.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe,visibleBars:J,columnWidth:L,scrollbarVisible:u}=Mt(h,k,he,O,Pe.yMaxLeft,e,Pe.legendList,Pe.dimensionList,Pe.yMaxRight,Y,ve,t,!1,Pe,Ee),$(D),{dataTable:s,dataTableHeight:d}=ia(e,w,K,b,Pe.dimensionList,n),St(i,h,k,e),y=wt(i,D),kt(y,e,d,X,M,S,m),be(),ke(),Zt(y,e,d,w,Z,M),Dt(e,U,i,D,z,k,ye,Pe.chartType,w,X,M),Vt(M,e,d,U,i,D,K,w),Gt(i,Y,D,e,d,M,X,pe,xe),Nt(i,e,h,te),It(k,i,se,te,h,ge,e,[...b].reverse(),m,d,D,ct.rectangle,S,l),_t(b,k,h,i,D,X,u,J,Pe,Me,!1,R)},We=()=>{const F=[],q=[];let ue=-1/0,B=1/0;b.forEach((ie,we)=>{const de=`${we}~$~${ie.properties.legend}`;ie.properties.legend=de,q.push(de),ue=-1/0,B=1/0;for(const Ae of ie.data)ue=Math.max(ue,Ae.value),B=Math.min(B,Ae.value),F.push(Ae);ie.properties.setColorScale&&ne.set(ie.properties.legendUniqueId,v.scaleSequential().domain([B,ue]).interpolator(yi.interpolateRgb(ie.properties.startColor,ie.properties.endColor)))}),Pe.chartData=F,Pe.legendList=q,Te=JSON.parse(JSON.stringify(b));let V=Lt(Pe.dimensionList,b,ve);Re=Pe.dimensionList;const P=v.stack().keys(Pe.legendList).offset(v.stackOffsetDiverging)(V);_();let C=1/0,re=-1/0;for(const ie of P)for(const[we,de]of ie)C=Math.min(C,we),re=Math.max(re,de);Pe.yMinLeft=C>0?0:C,Pe.yMaxLeft=re;let j=t?Tt(e.xAxisLabel.xAxisNumberFormat,Pe.dimensionList).map(ie=>ie):Pe.dimensionList;Pe.dimensionList.forEach((ie,we)=>{Pe.formattedDimensionListMap.set(ie,j[we])}),e.plotArea.hideZeroValues&&(Pe.hideZeroValues=!0)},be=()=>{T=v.scaleLinear().domain([Pe.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:Pe.yMinLeft<0?Pe.yMinLeft*1.1:Pe.yMinLeft*.9,Pe.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:Pe.yMaxLeft*1.1]).range([d>0?M-d:M,0]),N=[0,X]},ze=()=>{f=v.scalePoint().domain(Re).range([0,X]).padding(.5)},ke=()=>{{const F=yt(I||Pe.yMaxLeft,Pe.yMinLeft,M,e,Pe,H,I);Z=v.axisLeft(T).tickFormat(q=>Xe(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,X)).tickValues(F.autoLabelFlag?void 0:F.yAxisLabelArray).ticks(F.customTickValue).tickPadding(8).tickSizeOuter(0)}},Se=()=>{fe=v.axisBottom(f).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(gt(Re,X,e))},oe=F=>{F.forEach(j=>{j.data.forEach(ie=>{ie.hideZero=j.properties.hideZeroValues,ie.axis=j.properties.axis})}),Re.forEach(j=>{y.append("rect").attr("id",`dim-background-${j}`).attr("class","dimension-background").attr("x",f(j)-f.step()/2).attr("width",f.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let q=y.selectAll(".parentGroup").data([Le]);q=q.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(q);let ue=q.selectAll(".column-group").data(j=>j);ue=ue.enter().append("g").attr("class",j=>"column-group "+j.key.replace(/ /g,"-")).attr("hoverId",j=>j[0]?.properties.alias?Xa(j[0]?.properties.alias):Xa(j.key)).merge(ue);let V=ue.selectAll("rect").data(j=>j);const P=(j,ie)=>{const we=Array.from(ue.nodes()).indexOf(j[ie].parentNode);return{props:b[we]?.properties,groupIndex:we}},C=V.enter().append("rect").merge(V).attr("x",j=>f(j.data.dimension)-L/2).attr("width",L).attr("y",j=>T(0)).attr("height",0).attr("fill",(j,ie,we)=>{const{props:de}=P(we,ie);return ne.get(de.legendUniqueId)?.(j.data[j.key])??de?.color??"gray"}).attr("stroke",(j,ie,we)=>{const{props:de}=P(we,ie);return de?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?de.stackBorderColor:"none"}).attr("stroke-dasharray",(j,ie,we)=>{const{props:de}=P(we,ie);return de?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(j,ie,we)=>{const{props:de}=P(we,ie);return(de?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(j,ie,we)=>{const{props:de}=P(we,ie);return j.data[j.key]==0&&de?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,j=>j.key??"").attr(lt.DimValue,j=>Array.isArray(j.data.dimension)?String(j.data.dimension[0]):String(j.data.dimension)).on("mousemove",(j,ie)=>{const we=String(Pe.formattedDimensionListMap.get(ie.data.dimension)??ie.data.dimension??""),de=At(r,String(ie.data.dimension??""),{...ie.properties,formattedDimensionValue:we});ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Pe.formattedDimensionListMap.get(ie.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ie.properties?.currentMeasure?ie.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||ie.value,value:Xe(ie.data[ie.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ie.properties.alias}],e,j,ie.properties,de)}).on("mouseout",(j,ie)=>{ot()}).on("click",vt(A,W,(j,ie)=>({seriesId:ie.key??"",dimValue:Array.isArray(ie.data.dimension)?String(ie.data.dimension[0]):String(ie.data.dimension),legendUniqueId:ie.key??"",seriesDisplayName:ie.properties?.alias||ie.key||""})));(e.animation.animationEnabled?C.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):C).attr("y",j=>j[1]>=j[0]?T(j[1]):T(j[0])).attr("height",j=>Math.abs(T(j[0])-T(j[1]))),ue.exit().remove(),y.selectAll(".parentGroup").raise()},$=F=>{X=h-F.left-F.right,M=k-F.bottom-F.top},R=(F,q,ue)=>{Te=q,Re=F,J=ue,li(n,Ue,Re),ae()},ae=()=>{ze(),Se(),ta(y,Pe,z,e,d,T,fe,se,k,L,t,X,M,Re,f),_();const F=new Map;Re.forEach((q,ue)=>{let B=0;Le.forEach(V=>{const P=V[ue]?.[0]??0;P<B&&(B=P)}),F.set(q,B)}),oe(Te),Ya(Le,f,T,a,D,pt,[],[],e,S,k,h,X,Re,M,m,i,x,d,o),ii(Ue,f,T,D,pt,[],e,S,k,h,i,o,!1,F),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,i,y,s,L,T,f,void 0,void 0,void 0,d,S,e,w,K,Re,X,N,Pe.formattedDimensionListMap,m,D,M)),G()},_=()=>{let F=Lt(Re,Te,ve);Le=v.stack().keys(Pe.legendList).offset(v.stackOffsetDiverging)(F),Te.forEach((ue,B)=>ue.data.forEach((V,P)=>{V[0]=Le[B][P][0],V[1]=Le[B][P][1]}));let q=e.annotation.annotationSetLabelColor;Le.forEach((ue,B)=>ue.forEach(V=>{V.key=ue.key,ue.color=JSON.parse(JSON.stringify(b[B].properties.color)),V.data.labelPosition=b[B].properties.dataLabelPosition,V.data.labelColor=q=="2"?JSON.parse(JSON.stringify(b[B].properties.color)):b[B].properties.labelColor,V.hideZero=JSON.parse(JSON.stringify(b[B].properties.hideZeroValues)),V.properties=b[B].properties}))},G=()=>{try{const F=e?.connector,q=Number(F?.connectorVisibility);if(!F||q===2)return;let ue,B=[];q===1?ue=1:q===3&&(Number(F.connectorFollow)===1?ue=Number(F.connectorStepSize)||void 0:Number(F.connectorFollow)===2&&(B=F.connectorExclude??[],ue=1));const V=(B||[]).map(ie=>String(ie).split("-")[0]),P=(Le[0]??[]).map((ie,we)=>({Dimension:ie.data.dimension,Total:ie.data.total,CustomTotal:ie.data.total,Index:we})),C=[],re=[];let j=[];if(ue){if(ue===1)C.push(...P);else for(const ie of P)ie.Index%ue===0&&C.push(ie);for(let ie=ue;ie<P.length;ie+=ue){const we=Math.min(ie+ue,P.length);let de=P[ie]?.Total??Number.NEGATIVE_INFINITY;for(let Ae=ie;Ae<we;Ae++)P[Ae].Total>de&&(de=P[Ae].Total);Number.isFinite(de)&&re.push(de)}j=C.slice(1)}else{const ie=F.connectorCustomRange??[],we=new Map;P.forEach(de=>we.set(String(de.Dimension),de.Index));for(const de of ie){if(!de?.from||!de?.to)continue;const Ae=we.get(String(de.from)),De=we.get(String(de.to));if(Ae!=null&&De!=null){C.push(P[Ae]);const $e=Math.min(Ae,De),Fe=Math.max(Ae,De);let _e=P[$e]?.Total??Number.NEGATIVE_INFINITY;for(let it=$e;it<=Fe;it++)P[it].Total>_e&&(_e=P[it].Total);Number.isFinite(_e)&&re.push(_e)}}for(const de of ie){if(!de?.from||!de?.to)continue;const Ae=we.get(String(de.to));Ae!=null&&j.push(P[Ae])}}y.selectAll("defs > #arrow").remove(),y.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",F.connectorMarkerColor!==Ie.white?F.connectorMarkerColor:"none"),Q(C,re,j,ue,V),ee(C,re,j,ue,V)}catch{}},Q=(F,q,ue,B,V)=>{try{const P=F.filter((ie,we)=>B!=null?we<F.length-1:we<F.length);let C=y.selectAll("path.connector-path").data(P,ie=>String(ie.Dimension));C.exit().remove(),C.enter().append("path").attr("class","connector-path").style("shape-rendering","crispEdges").attr("fill","none").attr("marker-end","url(#arrow)").merge(C).attr("d",(ie,we)=>e.total.totalVisibility?`M ${f(ie.Dimension)+f.bandwidth()/2+5}, ${T(ie.Total)-25} V ${-35+Math.min(T(q[we]),T(ue[we].Total),T(ie.Total))} H ${f(ue[we].Dimension)+f.bandwidth()/2-10} V ${-27+T(ue[we].Total)}`:`M ${f(ie.Dimension)+f.bandwidth()/2+5}, ${T(ie.Total)-5} V ${-30+Math.min(T(ue[we].Total),T(ie.Total))} H ${f(ue[we].Dimension)+f.bandwidth()/2-10} V ${-10+T(ue[we].Total)}`).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",ie=>V.includes(ie.Dimension)||ie.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},ee=(F,q,ue,B,V)=>{try{let P,C=e.connector.connectorFontStyle,re=e.connector.connectorNumberFormat,j=X/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(re=".2s");const ie=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,we=Di(ie,L),de=we*(typeof f.padding=="function"?f.padding():0),Ae=F.map((_e,it)=>({d:_e,i:it})).filter(_e=>B!=null?_e.i<F.length-1:_e.i<F.length);let De=y.selectAll("text.connector-text").data(Ae,_e=>String(_e.d.Dimension));De.exit().remove(),De.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(De).attr("x",_e=>{const it=_e.d,nt=_e.i,Ba=ue[nt];return f(Ba.Dimension)-we*B/2}).attr("y",_e=>{const it=_e.d,nt=_e.i,Ba=q[nt],di=ue[nt],Ia=Math.min(T(di?.Total??0),T(it.Total));return e.total.totalVisibility?j<8?-40+Ia:-41+Ia:j<8?-35+Ia:-40+Ia}).style("text-anchor","middle").text(_e=>{const it=_e.d,nt=_e.i;return ue[nt]?(it.CustomTotal==0&&ue[nt].CustomTotal!=0&&(it.CustomTotal=1),fi(ue[nt].Total,it.Total,parseInt(e.connector.connectorDecimalPrecision),re,parseInt(it.Dimension),parseInt(ue[nt].Dimension),e)):""}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Ie.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",C.includes("Italic")?"Italic":"").style("text-decoration",C.includes("Underline")?"Underline":"").style("font-weight",C.includes("Bold")?"Bold":"").style("visibility",_e=>{const it=_e.d;return V.includes(it.Dimension)||it.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible"}).raise()}catch{}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:g,id:m,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.NormalizedStackColumnChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList).reverse(),E=n.DimensionList,b=!1,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,w,z,K,ye,se,te,xe,ge,pe,he,O=!1,X,M,h,k,s,d,i,y,T,a,f,N;const ne=new Map;let Z,fe,Re,Te=[],Me=0,J=0,Ee=[],Le=[];const Ue=!0;let ve={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Pe()}catch(_){me("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",_)}},[e]);const Pe=()=>{({formatOptions:e,svg:i,width:h,height:k}=Ft(S,e)),Ye(),{formatOptions:e,dataTableLegendsList:Ee}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:he}=Rt(e,ve.yMinLeft,ve.yMaxLeft,ve.yMinRight,ve.yMaxRight),{margin:I,yLabel:D,xLabel:w,yTitle:z,xTitle:K,dimensionHeightWidthArray:ye,chartTitleHeight:se,secondaryAxisTitleWidth:te,legendMargin:xe,secondaryYLabel:ge,visibleBars:J,columnWidth:L,scrollbarVisible:O}=Mt(h,k,pe,he,ve.yMaxLeft,e,ve.legendList,ve.dimensionList,ve.yMaxRight,U,Ue,t,!1,ve,Ee),oe(I),{dataTable:s,dataTableHeight:d}=ia(e,D,z,A,ve.dimensionList,n),St(i,h,k,e),y=wt(i,I),kt(y,e,d,X,M,u),We(),ze(),Zt(y,e,d,D,Z,M),Dt(e,b,i,I,w,k,K,ve.chartType,D,X,M),Vt(M,e,d,b,i,I,z,D),Gt(i,U,I,e,d,M,X,ge,te),Nt(i,e,h,se),It(k,i,ye,se,h,xe,e,[...A].reverse(),m,d,I,ct.rectangle,u,l),_t(A,k,h,i,I,X,O,J,ve,Me,!1,$)},Ye=()=>{const _=[],G=[];let Q=-1/0,ee=1/0;A.forEach((V,P)=>{const C=`${P}~$~${V.properties.legend}`;V.properties.legend=C,G.push(C),Q=-1/0,ee=1/0;for(const re of V.data)Q=Math.max(Q,re.value),ee=Math.min(ee,re.value),_.push(re);V.properties.setColorScale&&ne.set(V.properties.legendUniqueId,v.scaleSequential().domain([ee,Q]).interpolator(v.interpolateRgb(V.properties.startColor,V.properties.endColor)))}),ve.chartData=_,ve.legendList=G,Te=JSON.parse(JSON.stringify(A));let F=Lt(ve.dimensionList,A,Ue);Re=ve.dimensionList;const q=v.stack().keys(ve.legendList).offset(v.stackOffsetDiverging)(F);ae();let ue=1/0;for(const V of q)for(const[P]of V)ue=Math.min(ue,P);ve.yMinLeft=ue>0?0:ue,ve.yMaxLeft=1;let B=t?Tt(e.xAxisLabel.xAxisNumberFormat,ve.dimensionList).map(V=>V):ve.dimensionList;ve.dimensionList.forEach((V,P)=>{ve.formattedDimensionListMap.set(V,B[P])}),e.plotArea.hideZeroValues&&(ve.hideZeroValues=!0)},We=()=>{let _=yt(H||ve.yMaxLeft,ve.yMinLeft,M,e,ve,Y,H).yAxisLabelArray;if(ve.yMaxLeft=_[_.length-1],ve.yMinLeft=_[0],T=v.scaleLinear().domain([ve.yMinLeft<0?-1:0,1]).range([d>0?M-d:M,0]),N=[0,X],e.seriesLabel.seriesLabelVisibility){let G=la(X,T,e,Te,void 0,U,M,!0);G.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&G.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?N=[0,X-G.heightWidth[0]]:N=[G.heightWidth[0],X]}},be=()=>{f=v.scalePoint().domain(Re).range(N).padding(.5)},ze=()=>{{const _=e.yAxisLabel.yAxisTicksMode===wa.custom,G=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0;Z=v.axisLeft(T).tickFormat(v.format(`.${G}%`)).tickSize(zt(e,X)).tickValues(_?za(ve.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null).ticks(d>0?(M-d)/80:M/80).tickPadding(8).tickSizeOuter(0)}},ke=()=>{fe=v.axisBottom(f).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(gt(Re,X,e))},Se=_=>{Le.forEach((P,C)=>P.forEach((re,j)=>{_[C].data[j]&&_[C].data[j][0]!==void 0&&_[C].data[j][1]!==void 0&&(_[C].data[j][0]=re[0]=re.data.total===0?0:re[0]/re.data.total,_[C].data[j][1]=re[1]=re.data.total===0?0:re[1]/re.data.total)})),_.forEach(P=>{P.data.forEach(C=>{C.hideZero=P.properties.hideZeroValues,C.axis=P.properties.axis})}),Re.forEach(P=>{y.append("rect").attr("id",`dim-background-${P}`).attr("class","dimension-background").attr("x",f(P)-f.step()/2).attr("width",f.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let G=y.selectAll(".parentGroup").data([Le]);G=G.enter().append("g").attr("class","columns parentGroup").merge(G);let Q=G.selectAll(".column-group").data(P=>P);Q=Q.enter().append("g").attr("class",P=>"column-group "+P.key.replace(/ /g,"-")).attr("hoverId",P=>(_[P.index].properties.alias||_[P.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(Q);let F=Q.selectAll("rect").data(P=>P);const q=(P,C)=>{const re=Array.from(Q.nodes()).indexOf(P[C].parentNode);return{props:A[re]?.properties,groupIndex:re}},ue=F.enter().append("rect").attr("x",P=>f(P.data.dimension)-L/2).attr("width",L).attr("y",T(0)).attr("height",0).attr("fill",(P,C,re)=>{const{props:j}=q(re,C);return ne.get(j.legendUniqueId)?.(P.data[P.key])??j?.color??"gray"}).attr("stroke",(P,C,re)=>{const{props:j}=q(re,C);return j?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?j.stackBorderColor:"none"}).attr("stroke-dasharray",(P,C,re)=>{const{props:j}=q(re,C);return j?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(P,C,re)=>{const{props:j}=q(re,C);return(j?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(P,C,re)=>{const{props:j}=q(re,C);return P.data[P.key]===0&&j?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,P=>P.key??"").attr(lt.DimValue,P=>Array.isArray(P.data.dimension)?String(P.data.dimension[0]):String(P.data.dimension)),B=e.animation.animationEnabled;(P=>B?P.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):P)(ue).attr("y",P=>P[1]>=P[0]?T(P[1]):T(P[0])).attr("height",P=>Math.abs(T(P[0])-T(P[1]))),ue.merge(F).on("mousemove",(P,C)=>{ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ve.formattedDimensionListMap.get(C.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||C.value,value:Xe(C[1]-C[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,P,C.properties,At(p,String(C.data.dimension??""),{...C.properties,formattedDimensionValue:String(ve.formattedDimensionListMap.get(C.data.dimension)??C.data.dimension??"")}))}).on("mouseout",(P,C)=>{ot()}).on("click",vt(W,g,(P,C)=>({seriesId:C.key??"",dimValue:Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension),legendUniqueId:C.key??"",seriesDisplayName:C.properties?.alias||C.key||""}))),Q.exit().remove(),y.selectAll(".parentGroup").raise()},oe=_=>{X=h-_.left-_.right,M=k-_.bottom-_.top},$=(_,G,Q)=>{Te=G,Re=_,J=Q,R()},R=()=>{be(),ke(),ae(),ta(y,ve,w,e,d,T,fe,ye,k,L,t,X,M,Re,f),Se(Te),Ya(Le,f,T,a,I,pt,[],[],e,u,k,h,X,Re,M,m,i,x,d,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,i,y,s,f.bandwidth(),T,f,void 0,void 0,void 0,d,u,e,D,z,ve.dimensionList,X,N,ve.formattedDimensionListMap,m,I,M))},ae=()=>{let _=Lt(Re,Te,Ue);Le=v.stack().keys(ve.legendList).offset(v.stackOffsetDiverging)(_),Te.forEach((Q,ee)=>Q.data.forEach((F,q)=>{F[0]=Le[ee][q][0],F[1]=Le[ee][q][1]}));let G=e.annotation.annotationSetLabelColor;Le.forEach((Q,ee)=>Q.forEach(F=>{F.key=Q.key,Q.color=JSON.parse(JSON.stringify(A[ee].properties.color)),Q.individualAnnotationVisibility=JSON.parse(JSON.stringify(A[ee].properties.individualAnnotationVisibility)),F.data.labelPosition=A[ee].properties.dataLabelPosition,F.data.labelColor=G=="2"?JSON.parse(JSON.stringify(A[ee].properties.color)):A[ee].properties.labelColor,F.hideZero=JSON.parse(JSON.stringify(A[ee].properties.hideZeroValues)),F.properties=A[ee].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Ca="ChartsWithoutAxisFunctions.ts";function Oi(t,e,n){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:o,minVal:x,maxVal:l}=e.plotArea.plotAreaRangeFilter;return t.filter(r=>{const c=n(r);switch(o){case"lt":return c<=l;case"gt":return c>=x;case"in":return c>=x&&c<=l;case"not-in":return c<x||c>l;default:return!0}})}function el(t,e,n,o,x,l){try{o.xAxisLabel.xAxisDateFormat=o.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":o.xAxisLabel.xAxisDateFormat;let r={top:0,left:0,right:0,bottom:0},c=t*.15*.8,p=l[0],m=c<p+10?c:p+10,L=o.plotArea.numberOfBubbles?20:0;const u=Ke(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString();let g=Pt(u,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,o.xAxisLabel.xAxisLabelRotation)[3]+10,W=o.xAxisTitle.xAxisTitleVisibility?o.xAxisTitle.xAxisDynamicTitleText.length!==0?$t(o.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:$t(o.xAxisTitle.xAxisTitleText,13,tt).height:0;W=W>e*.1?e*.1:W;let A=o.xAxisLabel.xAxisLabelVisibility?g:0,E=o.yAxisTitle.yAxisTitleVisibility?o.yAxisTitle.yAxisDynamicTitleText.length!==0?$t(o.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:$t(o.yAxisTitle.yAxisTitleText,13,tt).height:0;E=E>t*.1?t*.1:E;let b=o.yAxisLabel.yAxisLabelVisibility?$t(Ke(o.yAxisLabel.yAxisDisplayUnits,o.yAxisLabel.yAxisNumberFormat,o.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString(),rt(o.yAxisLabel.yAxisLabelFontSize),o.yAxisLabel.yAxisLabelFontFamily,o.yAxisLabel.yAxisLabelRotation).width+10:0,U=o.chartTitle.chartTitleVisibility?o.chartTitle.dynamicTitleText.length!==0?$t(o.chartTitle.chartTitleHTML,void 0,void 0).height:$t(o.chartTitle.chartTitleText,16,tt).height:0;U=U>e*.1?e*.1:U;let Y=o.legends.legendPosition,H=o.legends.legendVisibility,I=!1;switch(H||(Y="None"),Y){case Je.none:r.top=U+5,r.bottom=W+A+5+L,r.right=15,r.left=E+b+5;break;case Je.top:r.top=40+U,r.bottom=W+A+5+L,r.right=15,r.left=E+b+5;break;case Je.right:r.right=m+35,r.top=U+5,r.bottom=W+A+5+L,r.left=E+b+5;break;case Je.bottom:r.bottom=40+A+W+L,r.top=U+5,r.right=15,r.left=E+b+5;break;case Je.left:r.left=m+E+b+33,r.top=U+5,r.bottom=W+A+5+L,r.right=15}o.xAxisLabel.xAxisPosition&&o.xAxisLabel.xAxisPosition=="1"&&(r.bottom=r.bottom-A,r.top=r.top+A);let D=o.chartPadding.paddingArrayLTRB;D&&(r.top+=D[1],r.bottom+=D[3],r.right+=D[2],r.left+=D[0]);let w=e-r.top-r.bottom,z=t-r.left-r.right;return{margins:r,yLabel:b,xLabel:A,yTitle:E,xTitle:W,chartTitleHeight:U,legendMargin:m,innerHeight:w,innerWidth:z}}catch(r){Ma(Ca,"marginCalculationForBubbleScatter",r)}}function tl(t,e,n){try{let o=parseFloat(t.yAxisLabel.yAxisIntervalText),x=parseFloat(t.yAxisLabel.yAxisMaxText),l=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){l=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let u=t.yAxisLabel.yAxisMaxText;x=u.length>0?parseFloat(u):n,x&&(n=x)}else x=n,l=e,o=void 0;let r=e?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,c=n?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString().length:0,p=x?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(x).toString().length:0,m=l?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(l).toString().length:0,L=r<c?n:e;if(l){let u=m<c?n:l;L=L<u?u:L}if(x){let u=p>r?x:e;L=L<u?u:L}return x&&l&&(L=p>m?x:l),{longestMeasure:L,customYaxisIntervalValue:o,customYaxisMaxValue:x,customYaxisMinValue:l}}catch(o){Ma(Ca,"customYscaleLabelFormatting",o)}}function al(t,e,n){try{let o=parseFloat(t.xAxisLabel.xAxisIntervalText),x=parseFloat(t.xAxisLabel.xAxisMaxText),l=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){l=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let u=t.xAxisLabel.xAxisMaxText.toString();x=u.length>0?parseFloat(u):n,x&&(n=x)}else x=n,l=e,o=void 0;let r=e?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,c=n?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n).toString().length:0,p=x?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString().length:0,m=l?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(l).toString().length:0,L=r<c?n:e;if(l){let u=m<c?n:l;L=L<u?u:L}if(x){let u=p>r?x:e;L=L<u?u:L}return x&&l&&(L=p>m?x:l),{longestDimension:L,customXaxisIntervalValue:o,customXaxisMaxValue:x,customXaxisMinValue:l}}catch(o){Ma(Ca,"customXscaleLabelFormatting",o)}}function il(t,e,n,o,x,l,r,c,p,m,L){try{let u=t.xAxisLabel.xAxisPosition,S=!0,W=n.append("foreignObject").attr("visibility",e?t.yAxisTitle.yAxisTitleVisibility?"visible":"hidden":t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",!t.plotArea.fitChart&&S?`translate(${o.left},${o.top+L+(t?.xAxisLabel?.xAxisPosition=="1"?0:x)})`:!t.plotArea.fitChart&&!1?`translate(${o.left},${l-r-5})`:`translate(${o.left},${o.top+L+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:x:c=="tornado"?x+5:p+5)})`).attr("class","xAxisTitle").attr("width",m).attr("height",r+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?W.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):W.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","5px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){Ma(Ca,"setXaxistitle",u)}}function ll(t,e,n,o,x,l,r,c){try{let p=n>0?t-n:t,m=x.append("foreignObject").attr("visibility",o?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${l.top+p}`).attr("y",l.left-r-c+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",p).attr("height",r+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?m.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):m.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),x}catch(p){Ma(Ca,"yAxistitle",p)}}function rl(t,e,n,o,x,l){try{let r=parseFloat(o.yAxisLabel.yAxisIntervalText),c=[],p;if(r&&r!==0&&r!==void 0){let m=x||x==0?x:e,L=l||l==0?l:t;m<0?p=Math.floor((L-m)/r):p=Math.floor(L/r);let u=18;(l||l==0)&&(t=l);let S=x||x==0?x:e<0?Math.round(e):0;if(c.push(S),p>100){let g="Tick count cannot exceed more than 100.";m<0?r=(L-S)/100:r=L/100}if(p=p<100?p:100,p>u)for(let g=0;g<parseInt(p)&&(S+=r,parseFloat(S.toFixed(5))<=t);g++)c.push(S);else for(let g=0;g<u&&(S+=r,S<=t);g++)c.push(S)}else if(o.yAxisLabel.yAxisTicksMode===wa.custom){let m=x||x==0?x:e;c=za(m,t,o.yAxisLabel.yAxisTicksCount),p=c.length}else p=n/60;return{yAxisLabelArray:c,customTickValue:p}}catch(r){Ma(Ca,"responsiveYaxisLabel",r)}}function Ti(t,e,n,o,x,l,r,c){try{let p=!0,m=parseFloat(o.xAxisLabel.xAxisIntervalText),L=[],u;if(m&&m!==0&&m!==void 0){let S=x||x==0?x:e,g=l||l==0?l:t;S<0?u=Math.floor((g-S)/m):u=Math.floor(g/m);let W=18;(l||l==0)&&(t=l);let A=x||x==0?x:e<0?Math.round(e):0;if(L.push(A),p=!1,u>100){let E="Tick count cannot exceed more than 100.";S<0?m=(g-A)/100:m=g/100}if(u=u<100?u:100,u>W)for(let E=0;E<parseInt(u)&&(A+=m,parseFloat(A.toFixed(5))<=t);E++)L.push(A);else for(let E=0;E<W&&(A+=m,A<=t);E++)L.push(A)}else if(o.xAxisLabel.xAxisTicksMode===wa.custom){let S=x||x==0?x:e,g=l||l==0?l:t;L=za(S,g,o.xAxisLabel.xAxisTicksCount),p=!1,u=L.length}else{const S=Ke(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisDateFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(l||t).toString();let g=Pt(S,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,0);L=Bi(x||e,l||t,c?r:n,g[0]),u=n/30}return{xAxisLabelArray:L,customTickValue:u,autoLabelFlag:p}}catch(p){Ma(Ca,"responsiveXaxisLabel",p)}}function nl(t,e,n,o,x,l){try{let r=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",n>0?l-n:l).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Ie.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const c=t.append("g").call(x);c.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),c.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Ie.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",r.includes(ce.italic)?ce.italic:"").style("text-decoration",r.includes(ce.underline)?ce.underline:"").style("font-weight",r.includes(ce.bold)?ce.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),c.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(r){Ma(Ca,"initYaxis",r)}}function sl(t,e,n,o,x,l,r,c,p){try{let m=e.xAxisLabel.xAxisLabelFontStyle,L=e.xAxisLabel.xAxisPosition,u=e.xAxisLabel.xAxisLabelRotation;u=parseInt(u),t.append("rect").attr("transform",`translate(1,${L==="0"?n>0?l-n:l:L==="1"?-o:p(0)})`).attr("height",o).attr("width",r).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==Ie.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${L==="0"?l:L==="1"?0:p(0)})`).call(x);let g=L==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(o)).style("height","20px").attr("transform",(A,E)=>`rotate(${L==="1"?-u:u!=0?180-u:0}) translate (${u!=0?g+", -5":-o/2+" , "+(L==="1"?"-15":"8")})`).append("xhtml:h3").style("transform",L==="1"?"":u!=0?"rotate(180deg)":"0").style("white-space","pre").style("text-overflow","ellipsis").style("text-align",u!=0?"start":"center").style("user-select","none").style("margin",0).style("padding",0).style("overflow","hidden").style("font-family",e.xAxisLabel.xAxisLabelFontFamily).style("color",e.xAxisLabel.xAxisLabelColor).style("font-size",e.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",m.includes(ce.italic)?ce.italic:"").style("text-decoration",m.includes(ce.underline)?ce.underline:"").style("font-weight",m.includes(ce.bold)?ce.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(A,E)=>Ke(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(A)).html((A,E)=>Ke(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(A)),S.selectAll("text").style("visibility",(e.xAxisLabel.xAxisLabelVisibility,"hidden")),S.selectAll("line").style("stroke",e.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",e.xAxisLabel.xAxisLabelVisibility||e.plotArea.gridLinesVertical?"visible":"hidden"),S.select(".domain").style("stroke",e.xAxisLabel.xAxisColor).attr("stroke-width",e.xAxisLabel.xAxisWidth?e.xAxisLabel.xAxisWidth:e.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges")}catch(m){Ma(Ca,"initXaxis",m)}}function ol(t,e,n,o,x,l,r,c,p,m,L){try{if(!n.annotation.annotationVisibility)return;const u=n.plotArea.annotationType??"1",S=[u==="1"?"connector":""],g=n.plotArea.connectorType?.toLowerCase()??"none",W=u==="5",A=n.plotArea.rotation??0,E=x===le.PieChart?1.06:1.1,b={1:"",2:v.curveLinear,3:v.curveStep},U=(O,X)=>[[0,0],[O/2,X/2],[O,X]],Y={solid:"unset",dotted:"2,2",dashed:"6,4"};let H=t.annotation(),I=JSON.parse(JSON.stringify(n.plotArea.dataLabelsCoordinates||[]));I=I.map(O=>({dx:O.dx??0,dy:O.dy??0,ratioDistance:O.ratioDistance,ratioAngle:O.ratioAngle,connectorPoints:O.connectorPoints||O.connector?.points||[],radius:O.radius??p,data:O.data,width:l,height:r}));const D=e.reduce((O,X)=>O+(X?.data?.data?.[0]?.value??0),0),w=D===0?1:D,z=(O,X)=>{const M=O.data.data[0].value,h=(O.x0+O.x1)/2,k=O.x1-O.x0;return{note:{title:n.plotArea.dataLabelName?O.data.legend:"",label:n.plotArea.dataLabelValue&&M!==0?n.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(M/w)*100).toFixed(rt(n.plotArea.dataLabelDecimalPrecision))+"%":Ke(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(M):"",align:"middle",wrap:1e3},data:{x:{legend:O.data.legend},y:{value:M},midAngle:h,isVisible:!0,hoverId:O?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:O.data.legend,dx:0,dy:0,connector:{end:g,curve:b[n.plotArea.connectorCurve],points:W?U(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:ur(t,u),color:n.plotArea.connectorColor??"#ccc",width:l,height:r,index:X}};let K=e.filter(O=>O.x1-O.x0>1e-4).map(z);const ye=O=>(O.data.y?.value??0)!==0;K=K.filter(ye),K=Ut(K,n,O=>O.data.y.value);let se=new Map(I.map(O=>[O.data?.x?.legend,O])),te=[];K.forEach(O=>{const X=O.data.x.legend,M=se.get(X);if(M){if(M.ratioDistance!=null&&M.ratioAngle!=null){const h=M.ratioDistance*p;O.dx=Math.cos(M.ratioAngle)*h,O.dy=Math.sin(M.ratioAngle)*h}else{const h=p/(M.radius||p);O.dx=M.dx*h,O.dy=M.dy*h}O.data.isVisible=M.data?.isVisible??!0,M.connectorPoints?.length>=(W?3:2)?O.connector.points=M.connectorPoints:O.connector.points=W?U(O.dx,O.dy):[[0,0],[0,0]]}te.push(O)}),H.editMode(n.plotArea.annotationDraggable&&m).accessors({x(O){return Math.cos(O.midAngle-Math.PI/2)*(p-p*.35)},y(O){return Math.sin(O.midAngle-Math.PI/2)*(p-p*.35)}}).on("dragend",function(O){te.forEach(M=>{if(M.data.x.legend===O.data.x.legend){const h=O._dx,k=O._dy,s=Math.sqrt(h*h+k*k),d=Math.atan2(k,h);M.dx=h,M.dy=k,M.ratioDistance=s/p,M.ratioAngle=d,M.width=l,M.height=r,M.connectorPoints=O.connector?.points||[]}});const X=te.map(M=>({data:{x:M.data.x,isVisible:M.data.isVisible??!0},dx:M.dx,dy:M.dy,ratioDistance:M.ratioDistance,ratioAngle:M.ratioAngle,connectorPoints:M.connectorPoints||[],width:l,height:r,radius:p}));L&&L(X)}).annotations(te);const xe=c.append("g").attr("class","annotation-group parentGroup").attr("transform",o).call(H),ge=n.plotArea.dataLabelNameFontStyle??[];xe.selectAll(".annotation-note-title").style("font-family",n.plotArea.dataLabelNameFontFamily).style("font-size",`${n.plotArea.dataLabelNameFontSize}px`).style("font-style",ge.includes("Italic")?"italic":"").style("text-decoration",ge.includes("Underline")?"underline":"").style("font-weight",ge.includes("Bold")?"bold":"").style("fill",n.plotArea.dataLabelNameColor??"#000");const pe=n.plotArea.dataLabelValueFontStyle??[];if(xe.selectAll(".annotation-note-label").style("font-family",n.plotArea.dataLabelValueFontFamily).style("font-size",`${n.plotArea.dataLabelValueFontSize}px`).style("font-style",pe.includes("Italic")?"italic":"").style("text-decoration",pe.includes("Underline")?"underline":"").style("font-weight",pe.includes("Bold")?"bold":"").style("fill",n.plotArea.dataLabelValueColor??"#000"),n.plotArea.plotAreaAbsoluteValue&&xe.selectAll(".annotation-note-label").each(function(O){const X=v.select(this),M=v.format(".2s")(Math.abs(O.data.y.value));X.append("tspan").attr("x",X.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",n.plotArea.dataLabelValueFontFamily).style("font-size",`${n.plotArea.dataLabelValueFontSize}px`).style("fill",n.plotArea.dataLabelValueColor??"#000").text(M)}),g==="diamond"){const O=n.plotArea.connectorColor??"#ccc",X=5;xe.selectAll(".annotation-connector").each(function(){v.select(this).select("path.connector").empty()||v.select(this).append("polygon").attr("class","connector-end connector-diamond").attr("points",`0,${-X} ${X},0 0,${X} ${-X},0`).style("fill",O).style("stroke",O)})}if(xe.selectAll("rect,.annotation-subject").remove(),n.animation?.animationEnabled){const O=n.animation.animationDuration,X=et[n.animation.animationEffect],M=xe.selectAll(".annotation-note-label");M.interrupt().style("opacity",0),setTimeout(()=>{M.transition().delay((h,k)=>k*30).duration(O).ease(X).style("opacity",1)},50)}const he=n.plotArea.connectorColor??"#ccc";xe.selectAll(".connector").style("stroke",he).attr("hoverId",O=>O.data.hoverId).attr("stroke-dasharray",Y[n.plotArea.connectorStyle?.toLowerCase()]),xe.selectAll(".connector-end").attr("hoverId",O=>O.data.hoverId).style("fill",he).style("stroke",he),xe.selectAll(".annotation-note-title").attr("hoverId",O=>O.data.hoverId),xe.selectAll(".annotation-note-label").attr("hoverId",O=>O.data.hoverId).filter(O=>!O.data.isVisible).style("display","none"),xe.selectAll(".annotation-note-label").filter(O=>n.plotArea.hideInsignificantValue&&O.data.x1-O.data.x0<.09).style("visibility","hidden")}catch(u){throw u}}const ur=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(n){throw n}},cl=(t,e,n,o,x,l,r,c,p,m)=>{try{if(n.plotArea.numberOfBubbles){let L=e=="Bottom"?o-55:o-25;t.append("foreignObject").attr("transform",`translate(${l.left},${L})`).attr("width",x).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",Ie.black).style("font-size","12px ").style("text-overflow","ellipsis").html((n.plotArea.totalAlias?n.plotArea.totalAliasText:"Total count : ")+m)}}catch(L){Ma(Ca,"setnumberOfBubbles",L)}};function Ma(t,e,n){console.error(`[${t}] [${e}]`,n)}const xr=({isDateType:t,formatOptions:e,data:n})=>{const o=crypto.randomUUID(),x=0,l=le.ColumnHistogramChart,r=Ce.useRef(),c=n.ChartData,p=n.DimensionList,m=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,g=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,W=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,E,b,U,Y,H,I,D,w,z,K,ye,se,te,xe,ge,pe=[],he=[],O,X,M,h,k,s,d,i,y,T,a,f,N,ne=[],Z=0;const fe=2;let Re=[],Te={dimensionList:p,chartType:l,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Me()}catch(ke){me("Columnchart","createColumnChart",ke)}},[e]);const Me=()=>{({formatOptions:e,svg:k,width:O,height:X}=Ft(r,e)),{formatOptions:e,dataTableLegendsList:Re}=ea(e,c,n.DataTableData??[]),J(),{maxNumberForPrimaryAxis:ye,maxNumberForSecondaryAxis:se}=Rt(e,Te.yMinLeft,Te.yMaxLeft,Te.yMinRight,Te.yMaxRight),{margin:E,yLabel:b,xLabel:U,yTitle:Y,xTitle:H,dimensionHeightWidthArray:I,chartTitleHeight:D,secondaryAxisTitleWidth:w,legendMargin:z,secondaryYLabel:K}=Mt(O,X,ye,se,Te.yMaxLeft,e,Te.legendList,Te.dimensionList,Te.yMaxRight,L,u,t,m,Te,Re),We(E),{dataTable:M,dataTableHeight:h}=ia(e,b,Y,c,Te.dimensionList),St(k,O,X,e),s=wt(k,E),kt(s,e,h,te,xe,l),Ee(),Ue(),ve(),Zt(s,e,h,b,a,xe),be(c,X,k,E,te),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,k,s,M,x,d,i,y,void 0,void 0,h,l,e,b,Y,Te.dimensionList,te,T,Te.formattedDimensionListMap,o,E,xe)),Dt(e,m,k,E,U,X,H,Te.chartType,b,te,xe),Vt(xe,e,h,m,k,E,Y,b),Gt(k,L,E,e,h,xe,te,K,w),Nt(k,e,O,D),It(X,k,I,D,O,z,e,c,o,h,E,ct.rectangle)},J=()=>{const ke=[],Se=[];let oe=[],$=-1/0,R=1/0;c.forEach(G=>{Se.push(G.legend),G.data.forEach(Q=>{ke.push(Q),$=Math.max($,Q.value),R=Math.min(R,Q.value)})}),Te.chartData=ke,Te.legendList=Se,Te.yMaxLeft=$,Te.yMinLeft=R>0?0:R,ne=JSON.parse(JSON.stringify(c)),ne.forEach(G=>G.data.forEach(Q=>oe.push(Q.value)));let ae=S||S==0?S:0,_=g||g==0?g:ne[0]?.data?.length;if(Te.yMaxLeft=parseFloat((ae+"").length>(_+"").length?ae+"":_+""),Te.xMax=v.max(oe),Te.xMin=v.min(oe),Te.xMin===Te.xMax){const G=Te.xMax===0?1:Math.abs(Te.xMax*.1);Te.xMin-=G,Te.xMax+=G}},Ee=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=te/50;break;case"Number of Bins":Le(!1);break;case"Bin Width":Le(!0)}},Le=ke=>{ne.forEach(R=>R.data.sort(function(ae,_){return ae.value-_.value}));let Se=Te.xMax-Te.xMin,oe;ke?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),oe=Se/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),oe=Se/parseFloat(e.bins.binsCalculationValue));let $=Te.xMin;if(ke)for(pe=[$];$<Te.xMax;)$+=oe,pe.push($);else for(pe=[$];Math.round($)<Math.round(Te.xMax);)$+=oe,pe.push(Math.round($))},Ue=()=>{i=v.scaleLinear().domain([Te.xMin,Te.xMax]).range([0,te]);const ke=pe.length>0?pe:i.ticks(ge);let Se=v.bin().value($=>$).domain(i.domain()).thresholds(ke);ne.forEach($=>{let R=Se($.data.map(ae=>ae.value));he.push(R)}),ne.forEach(($,R)=>he[R].forEach(ae=>{ae.name=$.properties.legend,ae.color=$.properties.color,ae.opacity=$.properties.opacity}));let oe=[];he.forEach($=>$.forEach(R=>oe.push(R.length))),Te.yMaxLeft=v.max(oe),Te.yMinLeft=v.min(oe),d=v.scaleLinear().range([xe,0]).domain([S||S==0?S:0,g||g==0?g:Te.yMaxLeft+.2*Te.yMaxLeft])},ve=()=>{Pe();{let ke=yt(Te.yMaxLeft,Te.yMinLeft,xe,e,Te,S,g,!1,te);a=v.axisLeft(d).tickFormat(Se=>Xe(Se,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,te)).tickValues(ke.autoLabelFlag?void 0:ke.yAxisLabelArray).ticks(ke.customTickValue).tickPadding(8).tickSizeOuter(0)}},Pe=()=>{let ke=parseInt(e.xAxisLabel.xAxisPosition);Ti(Te.xMax,Te.xMin,te,e,W,A,xe,!1).xAxisLabelArray.shift(),f=(ke==1?v.axisTop(i):v.axisBottom(i)).tickFormat(oe=>Xe(oe,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(sa(e,xe,h)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?f.ticks(ge):f.tickValues(pe).ticks(te/50)},Ye=ke=>{const Se=e.animation.animationEnabled,oe=s.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(he).enter().append("g").selectAll("rect").data(R=>R).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",1).attr("transform",function(R){return"translate("+i(R.x0)+","+xe+")"}).attr("width",function(R){return i(R.x1)-i(R.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(R.x1)-i(R.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",R=>R.color!==Ie.white?R.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(R,ae)=>{ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:`${ae.x0}-${ae.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ae.properties?.currentMeasure?ae.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:Xe(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(ae.length/ne[0].data.length):ae.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,R)}).on("mouseout",ot);(Se?oe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):oe).attr("transform",function(R){return"translate("+i(R.x0)+","+(d(R.length)>0?d(R.length):0)+")"}).attr("height",function(R){return xe-d(R.length)}),s.selectAll(".parentGroup").raise()},We=ke=>{te=O-ke.left-ke.right,xe=X-ke.bottom-ke.top},be=(ke,Se,oe,$,R)=>{if(!e.plotArea.fitChart){const ae=ke[0].data.length-fe,_=Se-20;N=Te.dimensionList.slice(Z,Z+fe),ne=JSON.parse(JSON.stringify(ke)),ne.forEach((ee,F)=>ne[F].data=ee.data.filter(q=>N.includes(q.dimension))),oe.append("rect").attr("x",$.left).attr("y",_).attr("width",R).attr("height",8).attr("fill","#ddd").attr("rx",4);const G=R*fe/Te.dimensionList.length,Q=oe.append("rect").attr("x",$.left).attr("y",_).attr("width",G).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",ee=>{let F=Math.min(Math.max(ee.x,$.left),$.left+R-G);Q.attr("x",F),Z=Math.round((F-$.left)/(R-G)*ae),N=Te.dimensionList.slice(Z,Z+fe),ne=JSON.parse(JSON.stringify(ke)),ne.forEach((q,ue)=>ne[ue].data=q.data.filter(B=>N.includes(B.dimension))),Pe(),ze()}));oe.on("wheel",ee=>{ee.preventDefault();const F=Math.abs(ee.deltaX)>Math.abs(ee.deltaY)?ee.deltaX:ee.deltaY;Z+=F>0?1:-1,Z=Math.max(0,Math.min(Z,ae));const q=$.left+(R-G)*Z/ae;Q.attr("x",q),ne=JSON.parse(JSON.stringify(ke)),ne.forEach((ue,B)=>ne[B].data=ue.data.filter(V=>N.includes(V.dimension))),Pe(),ze()})}ze()},ze=()=>{ta(s,Te,U,e,h,d,f,I,X,x,t,te,xe,N,i),Ye()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:r,id:o,style:{width:"100%",height:"100%"}})})},hr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID(),L=0,u=le.LineChart,S=Ce.useRef(),g=Ce.useRef(c);g.current=c;const W=Ce.useRef(p);W.current=p;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled;let U=!1;const Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h=!1,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye,We,be=[],ze=0,ke=0,Se=0,oe=[],$={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(V){me("Linechart","createLineChart",V)}},[e]);const R=()=>{({formatOptions:e,svg:a,width:d,height:i}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:oe}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:X,maxNumberForSecondaryAxis:M,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:w}=Rt(e,$.yMinLeft,$.yMaxLeft,$.yMinRight,$.yMaxRight),{margin:z,yLabel:K,xLabel:ye,yTitle:se,xTitle:te,dimensionHeightWidthArray:xe,chartTitleHeight:ge,secondaryAxisTitleWidth:pe,legendMargin:he,secondaryYLabel:O,visibleBars:ke,columnWidth:Se,scrollbarVisible:h}=Mt(d,i,X,M,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,Y,t,b,$,oe),ue(z),{dataTable:y,dataTableHeight:T}=ia(e,K,se,A,$.dimensionList,n),b&&(y=[],T=0),St(a,d,i,e),f=wt(a,z),kt(f,e,T,k,s,u,m),_(),ee(),b?(ra(e,f,K,s,k,ve),U&&Ai(e,f,O,Pe,k)):(Zt(f,e,T,K,Te,s),U&&bi(f,e,T,O,J,s,k)),Dt(e,b,a,z,ye,i,te,$.chartType,K,k,s),Vt(s,e,T,b,a,z,se,K,k),U&&Gt(a,U,z,e,T,s,k,O,pe,b),Nt(a,e,d,ge),It(i,a,xe,ge,d,he,e,A,m,T,z,ct.line,u,l),_t(A,i,d,a,z,k,h,ke,$,ze,!1,G,b)},ae=()=>{const V=[],P=[];let C=[],re=-1/0,j=1/0,ie=-1/0,we=1/0;e.plotArea.hideZeroValues&&($.hideZeroValues=!0),A.forEach(de=>{P.push(de.properties.alias?de.properties.alias:de.legend),de.data.forEach(Ae=>{V.push(Ae),de.properties.axis==="Secondary"?(U=!0,ie=Math.max(ie,Ae.value),we=Math.min(we,Ae.value)):(re=Math.max(re,Ae.value),j=Math.min(j,Ae.value))})}),$.chartData=V,$.legendList=P,$.yMaxLeft=re,$.yMinLeft=j,$.yMaxRight=ie,$.yMinRight=we,C=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(de=>de):$.dimensionList,$.dimensionList.forEach((de,Ae)=>{$.formattedDimensionListMap.set(de,C[Ae])}),be=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?We=$.dimensionList:We=$.dimensionList.slice(ze,ze+ke)},_=()=>{let V=yt(I||$.yMaxLeft,$.yMinLeft,s,e,$,H,I,b,k).yAxisLabelArray;$.yMaxLeft=V[V.length-1],$.yMinLeft=V[0];const P=b?[0,T>0?k-T:k]:[T>0?s-T:s,0];{const C=v.scaleLinear().domain([$.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:$.yMinLeft*.9:$.yMinLeft<0?$.yMinLeft*1.1:$.yMinLeft*.9,$.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:$.yMaxLeft*1.1]).range(P);b?Le=C:N=C}if(U){const C=v.scaleLinear().domain([$.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:$.yMinRight*1.1,$.yMaxRight<=0?w||0:w||$.yMaxRight*1.1]).range(P);b?Ue=C:ne=C}if(fe=b?[s,0]:[0,k],!b&&e.seriesLabel.seriesLabelVisibility){let C=la(k,N,e,be,ne,U,s,!1);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Re=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?fe=[0,k-C.heightWidth[0]]:fe=[C.heightWidth[0],k]}},G=(V,P,C)=>{be=P,We=V,ke=C,B()},Q=()=>{const V=v.scalePoint().domain(We).range(fe).padding(.5);b?Ee=V:Z=V},ee=()=>{{let V=yt(I||$.yMaxLeft,$.yMinLeft,s,e,$,H,I,b,k);b?ve=v.axisBottom(Le).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-s:0).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/50).tickPadding(8).tickSizeOuter(0):Te=v.axisLeft(N).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,k,Re)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue).tickPadding(8).tickSizeOuter(0)}if(U){let V=yt(w||$.yMaxRight,D||$.yMinRight,s,e,$,D,w);b?Pe=v.axisTop(Ue).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/50).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-s:0).tickPadding(8).tickSizeOuter(0):J=v.axisRight(ne).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue).tickSize(zt(e,k,Re)).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?Ye=v.axisLeft(Ee).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*k*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(We,s,e)):Me=v.axisBottom(Z).tickSize(sa(e,s,T,!0)).tickSizeOuter(0).tickValues(gt(We,k,e))},q=V=>{const P=[...V].reverse();P.forEach(Ae=>{Ae.data.forEach(De=>{De.hideZero=Ae.properties.hideZeroValues,De.axis=Ae.properties.axis})});const C=b?v.line().y(Ae=>{const De=Ee(Ae.dimension);return De??0}).x(Ae=>Ae.axis===Qe.primary?Le(Ae.value):Ue(Ae.value)).defined(Ae=>Ae.hideZero||$.hideZeroValues?!!Ae.value:!0).curve(ft(e)):v.line().x(Ae=>{const De=Z(Ae.dimension);return De??0}).y(Ae=>Ae.axis===Qe.primary?N(Ae.value):ne(Ae.value)).defined(Ae=>Ae.hideZero||$.hideZeroValues?!!Ae.value:!0).curve(ft(e)),re=e.animation.animationEnabled,j=Ae=>re?Ae.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Ae;let ie=f.selectAll(".parentGroup").data([P]);ie=ie.enter().append("g").attr("class","lines parentGroup").merge(ie);let we=ie.selectAll(".line-group").data(Ae=>Ae),de=we.enter().append("g").attr("class","line-group");de.append("path").attr("class","visibleLine").attr("fill","none"),de.merge(we).each(function(Ae){const $e=v.select(this).selectAll("path.visibleLine").data([Ae]).join("path").attr("class","visibleLine").attr("d",Fe=>C(Fe.data)).attr("stroke",Fe=>Fe.properties.color!==Ie.white?Fe.properties.color:"none").attr("stroke-dasharray",Fe=>{const _e=parseInt(Fe.properties.lineWidth);switch(Fe.properties.lineStyle){case bt.dotted:return`0,${_e+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",Fe=>Fe.properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",Fe=>Fe.properties.lineStyle!=="None"?Fe.properties.lineWidth:0).attr("hoverId",(Ae.properties.alias||Ae.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${m}-clip)`).attr("d",Fe=>C(Fe.data)).attr(lt.SeriesId,Fe=>Fe.properties.legendUniqueId).attr(lt.DimValue,Fe=>Fe.properties.alias||Fe.properties.name||"").on("click",vt(W,g,(Fe,_e)=>({seriesId:_e.properties.legendUniqueId,dimValue:_e.properties.alias||_e.properties.name||"",legendUniqueId:_e.properties.legendUniqueId,seriesDisplayName:_e.properties.alias||_e.properties.name||""})));re&&$e.each(function(){const Fe=v.select(this),_e=this.getTotalLength();Fe.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",_e),j(Fe).attr("stroke-dashoffset",0)})}),we.exit().remove(),Va(ie,P,"None",b?Ee:Z,b?Le:N,b?Ue:ne,null,e,$,w,D,H,I,!1,r,b),f.selectAll(".parentGroup").raise()},ue=V=>{k=d-V.left-V.right,s=i-V.bottom-V.top},B=()=>{if(Q(),F(),b?na(e,f,ye,s,k,Ye,Pe,Le,$.yMaxLeft,We,u,t,d,xe,Se,Ee):ta(f,$,ye,e,T,N,Me,xe,i,k/We.length,t,k,s,We,Z),q(be),$a(A,b?Ee:Z,b?Le:N,b?Ue:ne,z,pt,[],[],e,u,i,d,k,We,s,m,a,x,void 0,void 0,o,!1,b),!b){let V=la(k,N,e,be,ne,U,s,!1).labelArray;ja(e,f,V),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,a,f,y,L,N,Z,void 0,void 0,void 0,T,u,e,K,se,$.dimensionList,k,fe,$.formattedDimensionListMap,m,z,s))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},pr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.StackLineChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=n.DimensionList,E=(mt(n.ChartData,n.DimensionList)||[]).reverse(),b=!!e.swapAxis?.swapAxisEnabled,U=new Map,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye=[],We=0,be=2,ze=!1,ke=0,Se=[],oe=[];const $=!1;let R={dimensionList:A,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{ae()}catch(C){me("StackLinechart","createStackLineChart",C)}},[e]);const ae=()=>{({formatOptions:e,svg:T,width:s,height:d}=Ft(S,e)),_(),{formatOptions:e,dataTableLegendsList:Se}=ea(e,E,n.DataTableData??[]),{maxNumberForPrimaryAxis:X,maxNumberForSecondaryAxis:M}=Rt(e,R.yMinLeft,R.yMaxLeft,R.yMinRight,R.yMaxRight),{margin:z,yLabel:K,xLabel:ye,yTitle:se,xTitle:te,dimensionHeightWidthArray:xe,chartTitleHeight:ge,secondaryAxisTitleWidth:pe,legendMargin:he,secondaryYLabel:O,visibleBars:be,columnWidth:ke,scrollbarVisible:ze}=Mt(s,d,X,M,R.yMaxLeft,e,R.legendList,R.dimensionList,R.yMaxRight,Y,$,t,b,R,Se),ue(z),{dataTable:i,dataTableHeight:y}=ia(e,K,se,E,R.dimensionList,n),b&&(i=[],y=0),St(T,s,d,e),a=wt(T,z),kt(a,e,y,h,k,u,m),G(),ee(),b?ra(e,a,K,k,h,Le):Zt(a,e,y,K,Re,k),Dt(e,b,T,z,ye,d,te,R.chartType,K,h,k),Vt(k,e,y,b,T,z,se,K,h),Gt(T,Y,z,e,y,k,h,O,pe,b),Nt(T,e,s,ge),It(d,T,xe,ge,s,he,e,[...E].reverse(),m,y,z,ct.line,u,l),_t(E,d,s,T,z,h,ze,be,R,We,!1,P,b),ii(U,b?Me:ne,b?J:f,z,pt,[],e,u,d,s,T,o,b)},_=()=>{const C=[],re=[];e.plotArea.hideZeroValues&&(R.hideZeroValues=!0),E.forEach((De,$e)=>{const Fe=`${$e}~$~${De.properties.alias?De.properties.alias:De.legend}`;De.properties.legend=Fe,re.push(Fe);for(const _e of De.data)C.push(_e)}),R.chartData=C,R.legendList=re,Ye=JSON.parse(JSON.stringify(E));let j=Lt(R.dimensionList,E,$);e.plotArea.fitChart?Pe=R.dimensionList:(Pe=R.dimensionList.slice(We,We+be),Ye.forEach((De,$e)=>Ye[$e].data=De.data.filter(Fe=>Pe.includes(Fe.dimension))));const ie=v.stack().keys(R.legendList).offset(v.stackOffsetDiverging)(j);V();let we=1/0,de=-1/0;for(const De of ie)for(const[$e,Fe]of De)we=Math.min(we,$e),de=Math.max(de,Fe);R.yMinLeft=we>0?0:we,R.yMaxLeft=de;let Ae=t?Tt(e.xAxisLabel.xAxisNumberFormat,R.dimensionList).map(De=>De):R.dimensionList;R.dimensionList.forEach((De,$e)=>{R.formattedDimensionListMap.set(De,Ae[$e])})},G=()=>{let C=yt(I||R.yMaxLeft,R.yMinLeft,k,e,R,H,I,b,h).yAxisLabelArray;R.yMaxLeft=C[C.length-1],R.yMinLeft=C[0];const re=b?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const j=v.scaleLinear().domain([R.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:R.yMinLeft<0?R.yMinLeft*1.1:R.yMinLeft*.9,R.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:R.yMaxLeft*1.1]).range(re);b?J=j:f=j}if(Z=b?[k,0]:[0,h],!b&&e.seriesLabel.seriesLabelVisibility){let j=la(h,f,e,Ye,void 0,Y,k,!0);j.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(fe=j.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Z=[0,h-j.heightWidth[0]]:Z=[j.heightWidth[0],h]}Q()},Q=()=>{const C=v.scalePoint().domain(Pe).range(Z).padding(.5);b?Me=C:ne=C},ee=()=>{F();{let C=yt(I||R.yMaxLeft,R.yMinLeft,k,e,R,H,I,b,h);b?Le=v.axisBottom(J).tickFormat(re=>Xe(re,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Re=v.axisLeft(f).tickFormat(re=>Xe(re,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,h,fe)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?ve=v.axisLeft(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Pe,k,e)):Te=v.axisBottom(ne).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(gt(Pe,h,e))},q=C=>{C.forEach(de=>{de.data.forEach(Ae=>{Ae.hideZero=de.properties.hideZeroValues,Ae.axis=de.properties.axis})});const re=b?v.line().y(de=>{const Ae=Me(de.data.dimension);return Ae??0}).x(de=>de[1]>0?J(de[1]):J(de[0])).defined(de=>{const Ae=de;return Ae.hideZero||R.hideZeroValues?Ae.data[Ae.key]:!0}).curve(ft(e)):v.line().x(de=>{const Ae=ne(de.data.dimension);return Ae??0}).y(de=>de[1]>0?f(de[1]):f(de[0])).defined(de=>{const Ae=de;return Ae.hideZero||R.hideZeroValues?Ae.data[Ae.key]:!0}).curve(ft(e));let j=a.selectAll(".parentGroup").data([oe]);j=j.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(j);let ie=j.selectAll(".line-group").data(de=>de);const we=ie.enter().append("g").attr("class",de=>"line-group "+de.key.replace(/ /g,"-"));we.append("path").attr("class","line").attr("fill","none"),we.merge(ie).each(function(de,Ae){const De=v.select(this),$e=De.selectAll("path.visibleLine").data([de]).join("path").attr("class","visibleLine").attr("hoverId",it=>(E[Ae]?.properties?.alias||E[Ae]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",re(de)).attr("stroke",de.color!==Ie.white?de.color:"none").attr("stroke-dasharray",it=>{const nt=parseInt(E[Ae].properties.lineWidth.toString());switch(E[Ae].properties.lineStyle){case bt.dotted:return`0,${nt+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",E[Ae].properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",E[Ae].properties.lineStyle!==bt.none?E[Ae].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,E[Ae].properties.legendUniqueId).attr(lt.DimValue,E[Ae].properties.alias||E[Ae].properties.name||"").on("click",vt(W,g,()=>({seriesId:E[Ae].properties.legendUniqueId,dimValue:E[Ae].properties.alias||E[Ae].properties.name||"",legendUniqueId:E[Ae].properties.legendUniqueId,seriesDisplayName:E[Ae].properties.alias||E[Ae].properties.name||""}))),Fe=e.animation.animationEnabled,_e=$e.node().getTotalLength();Fe?$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",_e).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",0),De.selectAll("path.hoverLine").data([de]).join("path").attr("class","hoverLine").attr("d",re(de)).attr("stroke",Ie.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(){T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),T.selectAll('[hoverId="'+mi(E[Ae].properties.alias||E[Ae].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),ie.exit().remove(),Va(j,C,u,b?Me:ne,b?J:f,b?Ee:N,null,e,R,w,D,H,I,!1,p,b)},ue=C=>{h=s-C.left-C.right,k=d-C.bottom-C.top},B=()=>{if(Q(),F(),b?na(e,a,ye,k,h,ve,Ue,J,R.yMaxLeft,Pe,u,t,s,xe,ke,Me):ta(a,R,ye,e,y,f,Te,xe,d,L,t,h,k,Pe,ne),V(),q(Ye),Ya(oe,b?Me:ne,b?J:f,b?Ee:N,z,pt,[],[],e,u,d,s,h,Pe,k,m,T,x,y,o,b),!b){let C=la(h,f,e,Ye,void 0,Y,k,!0).labelArray;ja(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,T,a,i,L,f,ne,void 0,void 0,void 0,y,le.LineChart,e,K,se,R.dimensionList,h,Z,R.formattedDimensionListMap,m,z,k))}},V=()=>{let C=Lt(Pe,Ye,$);oe=v.stack().keys(R.legendList).offset(v.stackOffsetDiverging)(C),Ye.forEach((j,ie)=>j.data.forEach((we,de)=>{we[0]=oe[ie][de][0],we[1]=oe[ie][de][1]}));let re=e.annotation.annotationSetLabelColor;oe.forEach((j,ie)=>j.forEach(we=>{we.key=j.key,j.color=JSON.parse(JSON.stringify(E[ie].properties.color)),j.individualAnnotationVisibility=JSON.parse(JSON.stringify(E[ie].properties.individualAnnotationVisibility)),we.data.labelPosition=E[ie].properties.dataLabelPosition,we.data.labelColor=re=="2"?JSON.parse(JSON.stringify(E[ie].properties.color)):E[ie].properties.labelColor,we.hideZero=JSON.parse(JSON.stringify(E[ie].properties.hideZeroValues)),we.properties=E[ie].properties}))},P=(C,re,j)=>{Ye=re,Pe=C,be=j,li(n,U,Pe),B()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},br=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.NormalizedStackLineChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse()||[],E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe=[],Ye=0,We,be=0,ze=!1,ke=[],Se=[];const oe=!0;let $={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(C){me("NormalizedLinechart","createNormalizedLinechart",C)}},[e]);const R=()=>{({formatOptions:e,svg:y,width:k,height:s}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:ke}=ea(e,A,n.DataTableData??[]),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:We,columnWidth:be,scrollbarVisible:ze}=Mt(k,s,O,X,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,oe,t,b,$,ke),ue(w),{dataTable:d,dataTableHeight:i}=ia(e,z,ye,A,$.dimensionList,n),b&&(d=[],i=0),St(y,k,s,e),T=wt(y,w),kt(T,e,i,M,h,u,m),_(),ee(),b?ra(e,T,z,h,M,Ee):Zt(T,e,i,z,fe,h),Dt(e,b,y,w,K,s,se,$.chartType,z,M,h),Vt(h,e,i,b,y,w,ye,z,M),Gt(y,U,w,e,i,h,M,he,ge,b),Nt(y,e,k,xe),It(s,y,te,xe,k,pe,e,[...A].reverse(),m,i,w,ct.line,u,l),_t(A,s,k,y,w,M,ze,We,$,Ye,!1,B,b)},ae=()=>{const C=[],re=[];e.plotArea.hideZeroValues&&($.hideZeroValues=!0,A.forEach(Ae=>{Ae.data=Ae.data.filter(De=>De.value!==0)})),A.forEach((Ae,De)=>{const $e=`${De}~$~${Ae.properties.legend}`;Ae.properties.legend=$e,re.push($e);for(const Fe of Ae.data)C.push(Fe)}),$.chartData=C,$.legendList=re,Pe=JSON.parse(JSON.stringify(A)),ve=$.dimensionList;const j=Lt($.dimensionList,A,oe),ie=v.stack().keys($.legendList).offset(v.stackOffsetDiverging)(j);P();let we=1/0;for(const Ae of ie)for(const[De]of Ae)we=Math.min(we,De);$.yMinLeft=we>0?0:we,$.yMaxLeft=1;const de=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(Ae=>Ae):$.dimensionList;$.formattedDimensionListMap=new Map($.dimensionList.map((Ae,De)=>[Ae,de[De]]))},_=()=>{const C=b?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const re=v.scaleLinear().domain([$.yMinLeft<0?-1:0,1]).range(C);b?Me=re:a=re}if(ne=b?[h,0]:[0,M],!b&&e.seriesLabel.seriesLabelVisibility){Q(Se,Pe);let re=la(M,a,e,Pe,void 0,U,h,!0);re.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Z=re.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ne=[0,M-re.heightWidth[0]]:ne=[re.heightWidth[0],M]}},G=()=>{const C=v.scalePoint().domain(ve).range(ne).padding(.5);b?Te=C:N=C};function Q(C,re){C.forEach((j,ie)=>j.forEach((we,de)=>{re[ie]&&re[ie].data[de]&&(re[ie].data[de][0]=we[0]=we.data.total===0?0:we[0]/we.data.total,re[ie].data[de][1]=we[1]=we.data.total===0?0:we[1]/we.data.total)}))}const ee=()=>{{const C=e.yAxisLabel.yAxisTicksMode===wa.custom,re=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0,j=C?za($.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null;b?Ee=v.axisBottom(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).tickValues(j).tickFormat(v.format(`.${re}%`)).ticks(i>0?(M-i)/80:M/80).tickPadding(8).tickSizeOuter(0):fe=v.axisLeft(a).tickSize(zt(e,M,Z)).tickValues(j).tickFormat(v.format(`.${re}%`)).ticks(i>0?(h-i)/80:h/80).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?Ue=v.axisLeft(Te).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(ve,h,e)):Re=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(gt(ve,M,e))},q=C=>{Q(Se,Pe),C.forEach(de=>{de.data.forEach(Ae=>{Ae.hideZero=de.properties.hideZeroValues,Ae.axis=de.properties.axis})});const re=b?v.line().y(de=>{const Ae=Te(de.data.dimension);return Ae??0}).x(de=>de[1]>0?Me(de[1]):Me(de[0])).curve(ft(e)):v.line().x(de=>N(de.data.dimension)?N(de.data.dimension):null).y(de=>de[1]>0?a(de[1]):a(de[0])).curve(ft(e));let j=T.selectAll(".parentGroup").data([Se]);j=j.enter().append("g").attr("class","lines parentGroup").merge(j);let ie=j.selectAll(".line-group").data(de=>de),we=ie.enter().append("g").attr("class",de=>"line-group "+de.key.replace(/ /g,"-"));we.attr("hoverId",de=>(C[de.index]?.properties?.alias||C[de.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),we.merge(ie).each(function(de,Ae){const De=v.select(this),$e=De.selectAll("path.visibleLine").data([de]).join("path").attr("class","visibleLine").attr("d",re(de)).attr("stroke",de.color!==Ie.white?de.color:"none").attr("stroke-dasharray",it=>{const nt=parseInt(A[Ae].properties.lineWidth.toString());switch(A[Ae].properties.lineStyle){case bt.dotted:return`0,${nt+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",A[Ae].properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",A[Ae].properties.lineStyle!==bt.none?A[Ae].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,A[Ae].properties.legendUniqueId).attr(lt.DimValue,A[Ae].properties.alias||A[Ae].properties.name||"").on("click",vt(W,g,()=>({seriesId:A[Ae].properties.legendUniqueId,dimValue:A[Ae].properties.alias||A[Ae].properties.name||"",legendUniqueId:A[Ae].properties.legendUniqueId,seriesDisplayName:A[Ae].properties.alias||A[Ae].properties.name||""}))),Fe=e.animation.animationEnabled,_e=$e.node().getTotalLength();Fe?$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",_e).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",0),De.selectAll("path.hoverLine").data([de]).join("path").attr("class","hoverLine").attr("d",re(de)).attr("stroke",Ie.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(it,nt){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),y.selectAll('[hoverId="'+mi(C[nt.index]?.properties?.alias||C[nt.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(it,nt){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),y.selectAll('[hoverId="'+mi(C[nt.index]?.properties?.alias||nt[nt.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),ie.exit().remove(),Va(j,C,u,b?Te:N,b?Me:a,b?J:f,null,e,$,D,I,Y,H,!0,p,b)},ue=C=>{M=k-C.left-C.right,h=s-C.bottom-C.top},B=(C,re,j)=>{Pe=re,ve=C,We=j,V()},V=()=>{if(G(),P(),F(),b?na(e,T,K,h,M,Ue,Le,Me,$.yMaxLeft,ve,u,t,k,te,be,Te):ta(T,$,K,e,i,a,Re,te,s,L,t,M,h,ve,N),q(Pe),Ya(Se,b?Te:N,b?Me:a,b?J:f,w,pt,[],[],e,u,s,k,M,ve,h,m,y,x,i,o,b),!b){let C=la(M,a,e,Pe,void 0,U,h,!0).labelArray;ja(e,T,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,le.LineChart,e,z,ye,$.dimensionList,M,ne,$.formattedDimensionListMap,m,w,h))}},P=()=>{let C=Lt(ve,Pe,oe);Se=v.stack().keys($.legendList).offset(v.stackOffsetDiverging)(C),Pe.forEach((j,ie)=>j.data.forEach((we,de)=>{we[0]=Se[ie][de][0],we[1]=Se[ie][de][1]}));let re=e.annotation.annotationSetLabelColor;Se.forEach((j,ie)=>j.forEach(we=>{we.key=j.key,j.color=JSON.parse(JSON.stringify(A[ie].properties.color)),we.data.labelPosition=A[ie].properties.dataLabelPosition,we.data.labelColor=re=="2"?JSON.parse(JSON.stringify(A[ie].properties.color)):A[ie].properties.labelColor,we.hideZero=JSON.parse(JSON.stringify(A[ie].properties.hideZeroValues)),we.properties=A[ie].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},gr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let L=0;const u=le.HorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(c);g.current=c;const W=Ce.useRef(p);W.current=p;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!0;let U=!1;const Y=!1,H=new Map;let I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k=new Map,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le=[],Ue=0,ve=2,Pe=!1,Ye={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{We()}catch(G){me("HorizontalBarchart","createHorizontalBarChart",G)}},[e]);const We=()=>{({formatOptions:e,svg:a,width:i,height:y}=Ft(S,e)),be(),{maxNumberForPrimaryAxis:M,maxNumberForSecondaryAxis:h,customYaxisMaxValue:D,secondaryCustomYaxisMaxValue:z}=Rt(e,Ye.yMinLeft,Ye.yMaxLeft,Ye.yMinRight,Ye.yMaxRight),{margin:K,yLabel:ye,xLabel:se,yTitle:te,xTitle:xe,dimensionHeightWidthArray:ge,chartTitleHeight:pe,secondaryAxisTitleWidth:he,legendMargin:O,secondaryYLabel:X,visibleBars:ve,columnWidth:L,scrollbarVisible:Pe}=Mt(i,y,M,h,Ye.yMaxLeft,e,Ye.legendList,Ye.dimensionList,Ye.yMaxRight,U,Y,t,b,Ye),R(K),St(a,i,y,e),f=wt(a,K),kt(f,e,T,s,d,u,m),ze(),Se(),ra(e,f,ye,d,s,Te),U&&Ai(e,f,X,Me,s),Dt(e,b,a,K,se,y,xe,Ye.chartType,ye,s,d),Vt(d,e,T,b,a,K,te,ye,s),Gt(a,U,K,e,T,d,s,X,he,b),Nt(a,e,i,pe),It(y,a,ge,pe,i,O,e,A,m,T,K,ct.rectangle,u,l),_t(A,y,i,a,K,s,Pe,ve,Ye,Ue,!1,ae,b)},be=()=>{const G=[],Q=[];let ee=[],F=-1/0,q=1/0,ue=-1/0,B=1/0,V=1/0,P=-1/0;A.forEach(C=>{Q.push(C.properties.legendUniqueId),P=-1/0,V=1/0,C.data.forEach(re=>{G.push(re),C.properties.axis==="Secondary"?(U=!0,ue=Math.max(ue,re.value),B=Math.min(B,re.value)):(F=Math.max(F,re.value),q=Math.min(q,re.value)),P=Math.max(P,re.value),V=Math.min(V,re.value)}),C.properties.setColorScale&&H.set(C.properties.legendUniqueId,v.scaleSequential().domain([V,P]).interpolator(yi.interpolateRgb(C.properties.startColor,C.properties.endColor)))}),Ye.chartData=G,Ye.legendList=Q,Ye.yMaxLeft=F,Ye.yMinLeft=q>0?0:q,Ye.yMaxRight=ue,Ye.yMinRight=B>0?0:B,ee=t?Tt(e.xAxisLabel.xAxisNumberFormat,Ye.dimensionList).map(C=>C):Ye.dimensionList,Ye.dimensionList.forEach((C,re)=>{Ye.formattedDimensionListMap.set(C,ee[re])}),Le=JSON.parse(JSON.stringify(A)),Ee=Ye.dimensionList,e.plotArea.hideZeroValues&&(Ye.hideZeroValues=!0)},ze=()=>{let G=yt(Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,I,D,b,s).yAxisLabelArray;Ye.yMaxLeft=G[G.length-1],Ye.yMinLeft=G[0],Z=v.scaleLinear().domain([Ye.yMinLeft>=0?I!==void 0&&!Number.isNaN(I)?I:0:Ye.yMinLeft<0?Ye.yMinLeft*1.1:Ye.yMinLeft*.9,Ye.yMaxLeft<=0?0:D!==void 0&&!Number.isNaN(D)?D:Ye.yMaxLeft*1.1]).range([0,s]),U&&(fe=v.scaleLinear().domain([Ye.yMinRight>=0?(w||w==0)&&!Number.isNaN(w)?w:0:(w||w==0)&&!Number.isNaN(w)?w:Ye.yMinRight*1.1,Ye.yMaxRight<=0?z||0:z||Ye.yMaxRight*1.1]).range([0,s])),Re=[d,0]},ke=()=>{ne=v.scaleBand().domain(Ye.legendList).range([0,L]).paddingInner(Ye.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(Ee).range(Re).padding(.5)},Se=()=>{{let G=yt(D||Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,I,D,b,s);Te=v.axisBottom(Z).tickFormat(Q=>Xe(Q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(G.autoLabelFlag?void 0:G.yAxisLabelArray).ticks(G.customTickValue).tickPadding(8).tickSizeOuter(0)}if(U){let G=yt(z||Ye.yMaxRight,w||Ye.yMinRight,d,e,Ye,w,z);Me=v.axisTop(fe).tickFormat(Q=>Xe(Q,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(G.autoLabelFlag?void 0:G.yAxisLabelArray).ticks(G.customTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0)}},oe=()=>{J=v.axisLeft(N).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*s*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Ee,d,e))},$=G=>{G.forEach(Q=>{Q.data.forEach(ee=>{ee.hideZero=Q.properties.hideZeroValues,ee.axis=Q.properties.axis,ee.legendUniqueId=Q.properties.legendUniqueId})}),Ee.forEach(Q=>{f.append("rect").attr("id",`dim-background-${Q}`).attr("class","dimension-background").attr("y",N(Q)-L/2).attr("height",L).attr("x",0).attr("width",s).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),G.forEach(Q=>{let ee=f.selectAll(".parentGroup").data([Q],V=>V.properties.legendUniqueId);ee=ee.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(ee);let F=ee.selectAll(".column-group").data(Q.data.map(V=>({...V,properties:Q.properties})),V=>V.legend+V.dimension),q=F.enter().append("g").attr("class","column-group").attr("hoverId",(Q.properties.alias||Q.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",V=>`translate(0, ${N(V.dimension)-L/2})`);F.attr("transform",V=>`translate(0, ${N(V.dimension)-L/2})`),q.merge(F).attr("transform",V=>`translate(0, ${N(V.dimension)-L/2})`);const ue=q.append("rect").attr("y",V=>ne(V.legendUniqueId)).attr("height",ne.bandwidth()).attr("x",V=>{const P=Q.properties.axis===Qe.primary?Z:fe;return V.value>=0,P(0)}).attr("width",0).attr("fill",V=>H.get(Q.properties.legendUniqueId)?.(V.value)??Q.properties.color).attr("stroke-dasharray",V=>V.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",V=>`${V.properties.stackBorderWidth}px`).attr("stroke",V=>Q.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Q.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",V=>V.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>Q.properties.legendUniqueId).attr(lt.DimValue,V=>Array.isArray(V.dimension)?String(V.dimension[0]):String(V.dimension));(e.animation.animationEnabled?ue.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ue).attr("x",V=>{const P=Q.properties.axis===Qe.primary?Z:fe;return V.value>=0?P(0):P(V.value)}).attr("width",V=>{const P=Q.properties.axis===Qe.primary?Z:fe,C=Q.properties.axis===Qe.primary?D:z;return V.value>=0?C&&V.value>C?P(C)-P(0):P(V.value)-P(0):Math.abs(P(0)-P(V.value))}),q.merge(F).on("mousemove",(V,P)=>{(Q.properties.alias||Q.properties.name||"Legend").replace(/ /g,"-");const C=Array.isArray(P.dimension)?P.dimension[0]:P.dimension,re=String(Ye.formattedDimensionListMap.get(C)??C??""),j=At(r,String(C??""),{...Q.properties,formattedDimensionValue:re});ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Ye.formattedDimensionListMap.get(Array.isArray(P.dimension)?P.dimension[0]:P.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():P.properties?.currentMeasure?P.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||P.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?P[1]-P[0]:P.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:P.properties.alias}],e,V,Q.properties,j)}).on("mouseout",(V,P)=>{(Q.properties.alias||Q.properties.name||"Legend").replace(/ /g,"-"),ot()}).on("click",vt(W,g,(V,P)=>({seriesId:Q.properties.legendUniqueId,dimValue:Array.isArray(P.dimension)?String(P.dimension[0]):String(P.dimension),legendUniqueId:Q.properties.legendUniqueId,seriesDisplayName:Q.properties.alias||Q.properties.name||""}))),F.exit().remove()}),f.selectAll(".parentGroup").raise()},R=G=>{s=i-G.left-G.right,d=y-G.bottom-G.top},ae=(G,Q,ee)=>{Le=Q,Ee=G,ve=ee,li(n,k,Ee),e.xAxisLabel.hideZeroValues&&(Ee=Ee.filter(F=>k.get(F)!==0)),_()},_=()=>{ke(),oe(),na(e,f,se,d,s,J,Me,Z,Ye.yMaxLeft,Ee,u,t,i,ge,L,N),$(Le),$a(Le,N,Z,fe,K,pt,[],[],e,u,y,i,s,Ee,d,m,a,x,ne,L,o,!1,b)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Ar=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.StackHorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse(),E=n.DimensionList,b=!0,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,w,z,K,ye,se,te,xe,ge,pe,he;const O=new Map;let X,M,h,k,s,d,i,y,T,a,f,N,ne=[],Z=0,fe=2,Re=!1,Te=[];const Me=!1;let J=new Map,Ee={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Le()}catch(_){me("StackStackHorizontalBarchart","createStackHorizontalBarChart",_)}},[e]);const Le=()=>{({formatOptions:e,svg:s,width:h,height:k}=Ft(S,e)),Ue(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:he}=Rt(e,Ee.yMinLeft,Ee.yMaxLeft,Ee.yMinRight,Ee.yMaxRight),{margin:I,yLabel:D,xLabel:w,yTitle:z,xTitle:K,dimensionHeightWidthArray:ye,chartTitleHeight:se,secondaryAxisTitleWidth:te,legendMargin:xe,secondaryYLabel:ge,visibleBars:fe,columnWidth:L,scrollbarVisible:Re}=Mt(h,k,pe,he,Ee.yMaxLeft,e,Ee.legendList,Ee.dimensionList,Ee.yMaxRight,U,Me,t,b,Ee),ze(I),St(s,h,k,e),d=wt(s,I),kt(d,e,0,X,M,u,m),ve(),Ye(),ra(e,d,D,M,X,a),Dt(e,b,s,I,w,k,K,Ee.chartType,D,X,M),Vt(M,e,0,b,s,I,z,D,h),Nt(s,e,h,se),It(k,s,ye,se,h,xe,e,[...A].reverse(),m,0,I,ct.rectangle,u,l),_t(A,k,h,s,I,X,Re,fe,Ee,Z,!1,ke,b)},Ue=()=>{const _=[],G=[];let Q=-1/0,ee=1/0;A.forEach((P,C)=>{const re=`${C}~$~${P.properties.legend}`;P.properties.legend=re,G.push(re),Q=-1/0,ee=1/0;for(const j of P.data)Q=Math.max(Q,j.value),ee=Math.min(ee,j.value),_.push(j);P.properties.setColorScale&&O.set(P.properties.legendUniqueId,v.scaleSequential().domain([ee,Q]).interpolator(v.interpolateRgb(P.properties.startColor,P.properties.endColor)))}),Ee.chartData=_,Ee.legendList=G,ne=JSON.parse(JSON.stringify(A));let F=Lt(Ee.dimensionList,A,Me);e.plotArea.fitChart?N=Ee.dimensionList:(N=Ee.dimensionList.slice(Z,Z+fe),ne.forEach((P,C)=>ne[C].data=P.data.filter(re=>N.includes(re.dimension))));const q=v.stack().keys(Ee.legendList).offset(v.stackOffsetDiverging)(F);oe();let ue=1/0,B=-1/0;for(const P of q)for(const[C,re]of P)ue=Math.min(ue,C),B=Math.max(B,re);Ee.yMinLeft=ue>0?0:ue,Ee.yMaxLeft=B;let V=t?Tt(e.xAxisLabel.xAxisNumberFormat,Ee.dimensionList).map(P=>P):Ee.dimensionList;Ee.dimensionList.forEach((P,C)=>{Ee.formattedDimensionListMap.set(P,V[C])}),e.plotArea.hideZeroValues&&(Ee.hideZeroValues=!0)},ve=()=>{let _=yt(Ee.yMaxLeft,Ee.yMinLeft,M,e,Ee,Y,H,b,X).yAxisLabelArray;Ee.yMaxLeft=_[_.length-1],Ee.yMinLeft=_[0],i=v.scaleLinear().domain([Ee.yMinLeft>=0?Y!==void 0&&!Number.isNaN(Y)?Y:0:Ee.yMinLeft<0?Ee.yMinLeft*1.1:Ee.yMinLeft*.9,Ee.yMaxLeft<=0?0:H!==void 0&&!Number.isNaN(H)?H:Ee.yMaxLeft*1.1]).range([0,X]),T=[M,0]},Pe=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Ye=()=>{{let _=yt(H||Ee.yMaxLeft,Ee.yMinLeft,M,e,Ee,Y,H,b,X);a=v.axisBottom(i).tickFormat(G=>Xe(G,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-M:0).tickValues(_.autoLabelFlag?void 0:_.yAxisLabelArray).ticks(_.customTickValue).tickPadding(8).tickSizeOuter(0)}},We=()=>{f=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*X*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(N,M,e))},be=_=>{_.forEach(V=>{V.data.forEach(P=>{P.hideZero=V.properties.hideZeroValues,P.axis=V.properties.axis})}),N.forEach(V=>{d.append("rect").attr("id",`dim-background-${V}`).attr("class","dimension-background").attr("y",y(V)-L/2).attr("height",L).attr("x",0).attr("width",X).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let G=d.selectAll(".parentGroup").data([Te]);G=G.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(G);let Q=G.selectAll(".column-group").data(V=>V);Q=Q.enter().append("g").attr("class",V=>"column-group "+V.key.replace(/ /g,"-")).attr("hoverId",V=>(_[V.index].properties.alias||_[V.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(Q);let F=Q.selectAll("rect").data(V=>V);const q=(V,P)=>{const C=Array.from(Q.nodes()).indexOf(V[P].parentNode);return{props:A[C]?.properties,groupIndex:C}},ue=F.enter().append("rect").merge(F).attr("y",V=>y(V.data.dimension)-L/2).attr("height",L).attr("fill",(V,P,C)=>{const{props:re}=q(C,P);return O.get(re.legendUniqueId)?.(V.data[V.key])??re?.color??"gray"}).attr("stroke",(V,P,C)=>{const re=q(C,P).props;return re?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?re.stackBorderColor:"none"}).attr("stroke-dasharray",(V,P,C)=>q(C,P).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(V,P,C)=>(q(C,P).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",V=>Math.min(i(V[0]),i(V[1]))).attr("width",0).attr("visibility",(V,P,C)=>{const re=q(C,P).props;return V.data[V.key]===0&&re?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,V=>V.key??"").attr(lt.DimValue,V=>Array.isArray(V.data.dimension)?String(V.data.dimension[0]):String(V.data.dimension)).on("mousemove",(V,P)=>{const C=P.data.dimension;ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Ee.formattedDimensionListMap.get(C)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():P.properties?.currentMeasure?P.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||P.value,value:Xe(P.data[P.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:P.properties.alias}],e,V,P.properties,At(p,String(C??""),{...P.properties,formattedDimensionValue:String(Ee.formattedDimensionListMap.get(C)??C??"")}))}).on("mouseout",(V,P)=>{P.data.dimension,ot()}).on("click",vt(W,g,(V,P)=>({seriesId:P.key,dimValue:Array.isArray(P.data.dimension)?String(P.data.dimension[0]):String(P.data.dimension),legendUniqueId:P.key,seriesDisplayName:P.properties?.alias||P.properties?.name||""})));ue.attr("x",V=>i(0)),(e.animation.animationEnabled?ue.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ue).attr("x",V=>Math.min(i(V[0]),i(V[1]))).attr("width",V=>Math.abs(i(V[1])-i(V[0]))),Q.exit().remove(),d.selectAll(".parentGroup").raise()},ze=_=>{X=h-_.left-_.right,M=k-_.bottom-_.top},ke=(_,G,Q)=>{ne=G,N=_,fe=Q,li(n,J,N),oe(),Se()},Se=()=>{Pe(),We(),na(e,d,w,M,X,f,void 0,i,Ee.yMaxLeft,N,u,t,h,ye,L,y);const _=new Map;N.forEach((G,Q)=>{let ee=0;Te.forEach(F=>{const q=F[Q]?.[0]??0;q<ee&&(ee=q)}),_.set(G,ee)}),be(ne),Ya(Te,y,i,void 0,I,pt,[],[],e,u,k,h,X,N,M,m,s,x,0,o,b),ii(J,y,i,I,pt,[],e,u,k,h,s,o,b,_),$(),d.selectAll(".connectors").raise()},oe=()=>{let _=Lt(N,ne,Me);Te=v.stack().keys(Ee.legendList).offset(v.stackOffsetDiverging)(_),ne.forEach((Q,ee)=>Q.data.forEach((F,q)=>{F[0]=Te[ee][q][0],F[1]=Te[ee][q][1]}));let G=e.annotation.annotationSetLabelColor;Te.forEach((Q,ee)=>Q.forEach(F=>{F.key=Q.key,Q.color=JSON.parse(JSON.stringify(A[ee].properties.color)),F.data.labelPosition=A[ee].properties.dataLabelPosition,F.data.labelColor=G=="2"?JSON.parse(JSON.stringify(A[ee].properties.color)):A[ee].properties.labelColor,F.hideZero=JSON.parse(JSON.stringify(A[ee].properties.hideZeroValues)),F.properties=A[ee].properties}))},$=()=>{try{const _=Number(e.connector?.connectorVisibility);if(!e.connector||_===2)return;const G=[],Q=[],ee=[];let F;const q=[];if(_===1)F=1;else if(_===3){const j=Number(e.connector.connectorFollow);j===1?F=Number(e.connector.connectorStepSize):j===2&&((e.connector.connectorExclude||[]).forEach(ie=>ee.push(ie)),F=1)}const ue=[],B=[],V=[],P=e.connector?.connectorCustomRange||[];ee.forEach(j=>{const ie=j.split("-");ie.length&&ue.push(ie[0])});const re=(Te?.[0]||[]).map((j,ie)=>({Dimension:j.data.dimension,Total:j.data.total,CustomTotal:j.data.total-(V[ie]??0),Index:ie}));if(F!=null){for(let j=0;j<re.length;j++)(F===1||j%F===0&&F!==1)&&G.push(re[j]);for(let j=F;j<re.length;j+=F){const ie=Math.min(j+F,re.length);let we=-1/0;for(let de=j;de<ie;de++)re[de].Total>we&&(we=re[de].Total);we!==-1/0&&q.push(we)}for(let j=1;j<G.length;j++)Q.push(G[j])}else{const j=[];(P||[]).forEach(ie=>{if(ie?.from&&ie?.to){const we=re.some(Ae=>Ae.Dimension===ie.from),de=re.some(Ae=>Ae.Dimension===ie.to);we&&de&&j.push({from:ie.from,to:ie.to})}}),j.forEach(ie=>{const we=re.findIndex(Ae=>Ae.Dimension===ie.from),de=re.findIndex(Ae=>Ae.Dimension===ie.to);if(we>=0&&de>=0){const Ae=Math.min(we,de),De=Math.max(we,de);G.push(re[Ae]);let $e=re[Ae]?.Total??-1/0;for(let Fe=Ae;Fe<=De;Fe++)re[Fe].Total>$e&&($e=re[Fe].Total);$e!==-1/0&&q.push($e),Q.push(re[De])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Ie.white?e.connector.connectorMarkerColor:"none"),R(G,q,Q,F,ue),ae(G,q,Q,F,ue)}catch(_){console.error(_)}},R=(_,G,Q,ee,F)=>{try{const q=y.bandwidth()??0,ue=d.selectAll(".connector-paths").data([0]),B=ue.enter().append("g").attr("class","connector-paths connectors").merge(ue),V=_.filter((re,j)=>ee!=null?j<_.length-1:j<_.length),P=B.selectAll("path.connector-path").data(V,(re,j)=>re?.Dimension??j);P.exit().remove(),P.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(P).attr("d",(re,j)=>{const ie=Q?.[j]??{Total:0,Dimension:re.Dimension},we=re?.Total??0,de=typeof ie.Total=="number"?i(ie.Total):0,Ae=typeof we=="number"?i(we):0,De=Math.max(de,Ae);return e.total.totalVisibility?`M ${Ae+50},
74
+ ${y(re.Dimension)+q/2-5}
75
+ H ${60+De}
76
+ V ${y(ie.Dimension)+q/2+5}
77
+ H ${30+de}`:`M ${Ae+30},
78
+ ${y(re.Dimension)+q/2-5}
79
+ H ${45+De}
80
+ V ${y(ie.Dimension)+q/2+5}
81
+ H ${10+de}`}).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(re,j)=>F.includes(re.Dimension)||re.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(q){console.error(q)}},ae=(_,G,Q,ee,F)=>{try{const q=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,ue=Di(q,L);let B=e.connector.connectorFontStyle,V=e.connector.connectorNumberFormat,P=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(V=".2s");const C=_.filter((de,Ae)=>ee!=null?Ae<_.length-1:Ae<_.length),re=d.selectAll(".connector-texts").data([0]),ie=re.enter().append("g").attr("class","connector-texts connectors").merge(re).selectAll("text.connector-text").data(C,de=>de?.Dimension??de);ie.exit().remove(),ie.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(ie).attr("y",(de,Ae)=>{const De=Q?.[Ae]??{Dimension:de.Dimension,Total:0},$e=y(de.Dimension)??0;return(y(De.Dimension)??$e)+ee*ue/2}).attr("x",(de,Ae)=>{const De=Q?.[Ae]??{Total:0},$e=de?.Total??0,Fe=Math.max(i(De.Total),i($e));return e.total.totalVisibility?70+Fe:50+Fe}).text((de,Ae)=>{const De=Q?.[Ae]??{Total:0,CustomTotal:0,Dimension:de.Dimension};return de.CustomTotal==0&&De.CustomTotal!=0&&(de.CustomTotal=1),fi(De.Total,de.Total,parseInt(e.connector.connectorDecimalPrecision),V,parseInt(de.Dimension),parseInt(De.Dimension),e)}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Ie.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",B.includes("Italic")?"Italic":"").style("text-decoration",B.includes("Underline")?"Underline":"").style("font-weight",B.includes("Bold")?"Bold":"").style("visibility",(de,Ae)=>F.includes(de.Dimension)||de.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(q){console.error(q)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Lr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.NormalizedStackHorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse(),E=n.DimensionList,b=!0,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h;const k=new Map;let s,d,i,y,T,a,f,N,ne=[],Z=0,fe,Re=!1,Te=[];const Me=!0;let J={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(oe){me("StackNormalizedStackBarchart","createNormalizedStackBarChart",oe)}},[e]);const Ee=()=>{({formatOptions:e,svg:s,width:M,height:h}=Ft(S,e)),Le(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:he}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:I,yLabel:D,xLabel:w,yTitle:z,xTitle:K,dimensionHeightWidthArray:ye,chartTitleHeight:se,secondaryAxisTitleWidth:te,legendMargin:xe,secondaryYLabel:ge,visibleBars:fe,columnWidth:L,scrollbarVisible:Re}=Mt(M,h,pe,he,J.yMaxLeft,e,J.legendList,J.dimensionList,J.yMaxRight,U,Me,t,b,J),be(I),St(s,M,h,e),d=wt(s,I),kt(d,e,0,O,X,u),Ue(),Pe(),ra(e,d,D,X,O,a),Dt(e,b,s,I,w,h,K,J.chartType,D,O,X),Vt(X,e,0,b,s,I,z,D,O),Nt(s,e,M,se),It(h,s,ye,se,M,xe,e,[...A].reverse(),m,0,I,ct.rectangle,u,l),_t(A,h,M,s,I,O,Re,fe,J,Z,!1,Se,b)},Le=()=>{const oe=[],$=[];let R=-1/0,ae=1/0;A.forEach((F,q)=>{const ue=`${q}~$~${F.properties.legend}`;F.properties.legend=ue,$.push(ue),R=-1/0,ae=1/0;for(const B of F.data)R=Math.max(R,B.value),ae=Math.min(ae,B.value),oe.push(B);F.properties.setColorScale&&k.set(F.properties.legendUniqueId,v.scaleSequential().domain([ae,R]).interpolator(v.interpolateRgb(F.properties.startColor,F.properties.endColor)))}),J.chartData=oe,J.legendList=$,ne=JSON.parse(JSON.stringify(A));let _=Lt(J.dimensionList,A,Me);e.plotArea.fitChart?N=J.dimensionList:(N=J.dimensionList.slice(Z,Z+fe),ne.forEach((F,q)=>ne[q].data=F.data.filter(ue=>N.includes(ue.dimension))));const G=v.stack().keys(J.legendList).offset(v.stackOffsetDiverging)(_);ke();let Q=1/0;for(const F of G)for(const[q,ue]of F)Q=Math.min(Q,q);J.yMinLeft=Q>0?0:Q,J.yMaxLeft=1;let ee=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(F=>F):J.dimensionList;J.dimensionList.forEach((F,q)=>{J.formattedDimensionListMap.set(F,ee[q])}),e.plotArea.hideZeroValues&&(J.hideZeroValues=!0)},Ue=()=>{let oe=yt(H||J.yMaxLeft,J.yMinLeft,X,e,J,Y,H,b,O).yAxisLabelArray;J.yMaxLeft=oe[oe.length-1],J.yMinLeft=oe[0],i=v.scaleLinear().domain([J.yMinLeft<0?-1:0,1]).range([0,O]),T=[X,0]},ve=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Pe=()=>{{const oe=e.yAxisLabel.yAxisTicksMode===wa.custom,$=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0;a=v.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-X:0).tickValues(oe?za(J.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null).tickFormat(v.format(`.${$}%`)).ticks(O/80).tickPadding(8).tickSizeOuter(0)}},Ye=()=>{f=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*O*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(N,X,e))},We=oe=>{Te.forEach((F,q)=>F.forEach((ue,B)=>{oe[q].data[B][0]=ue[0]=ue.data.total===0?0:ue[0]/ue.data.total,oe[q].data[B][1]=ue[1]=ue.data.total===0?0:ue[1]/ue.data.total})),oe.forEach(F=>{F.data.forEach(q=>{q.hideZero=F.properties.hideZeroValues,q.axis=F.properties.axis})}),N.forEach(F=>{d.append("rect").attr("id",`dim-background-${F}`).attr("class","dimension-background").attr("y",y(F)-y.bandwidth()/2).attr("height",y.bandwidth()).attr("x",0).attr("width",O).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let $=d.selectAll(".parentGroup").data([Te]);$=$.enter().append("g").attr("class","columns parentGroup").merge($);let R=$.selectAll(".column-group").data(F=>F);R=R.enter().append("g").attr("class",F=>"column-group "+F.key.replace(/ /g,"-")).attr("hoverId",F=>(oe[F.index].properties.alias||oe[F.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(R);let _=R.selectAll("rect").data(F=>F);const G=(F,q)=>{const ue=Array.from(R.nodes()).indexOf(F[q].parentNode);return{props:A[ue]?.properties,groupIndex:ue}},Q=_.enter().append("rect").merge(_).attr("y",F=>y(F.data.dimension)-L/2).attr("height",L).attr("fill",(F,q,ue)=>{const{props:B}=G(ue,q);return k.get(B.legendUniqueId)?.(F.data[F.key])??B?.color??"gray"}).attr("stroke",(F,q,ue)=>{const B=G(ue,q).props;return B?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?B.stackBorderColor:"none"}).attr("stroke-dasharray",(F,q,ue)=>G(ue,q).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(F,q,ue)=>(G(ue,q).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",F=>i(0)).attr("width",0).attr("visibility",(F,q,ue)=>{const B=G(ue,q).props;return F.data[F.key]===0&&B?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,F=>F.key??"").attr(lt.DimValue,F=>Array.isArray(F.data.dimension)?String(F.data.dimension[0]):String(F.data.dimension)).on("mousemove",(F,q)=>{const ue=q.data.dimension;ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:J.formattedDimensionListMap.get(ue)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():q.properties?.currentMeasure?q.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||q.value,value:Xe(q[1]-q[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:q.properties.alias}],e,F,q.properties,At(p,String(ue??""),{...q.properties,formattedDimensionValue:String(J.formattedDimensionListMap.get(ue)??ue??"")}))}).on("mouseout",(F,q)=>{let ue=(q.properties.alias||q.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+ue+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}).on("click",vt(W,g,(F,q)=>({seriesId:q.key,dimValue:Array.isArray(q.data.dimension)?String(q.data.dimension[0]):String(q.data.dimension),legendUniqueId:q.key,seriesDisplayName:q.properties?.alias||q.properties?.name||""})));(e.animation.animationEnabled?Q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Q).attr("x",F=>Math.min(i(F[0]),i(F[1]))).attr("width",F=>Math.abs(i(F[1])-i(F[0]))),R.exit().remove(),d.selectAll(".parentGroup").raise()},be=oe=>{O=M-oe.left-oe.right,X=h-oe.bottom-oe.top},ze=()=>{ve(),Ye(),na(e,d,w,X,O,f,void 0,i,J.yMaxLeft,N,u,t,M,ye,L,y),We(ne),Ya(Te,y,i,void 0,I,pt,[],[],e,u,h,M,O,N,X,m,s,x,0,o,b)},ke=()=>{let oe=Lt(N,ne,Me);Te=v.stack().keys(J.legendList).offset(v.stackOffsetDiverging)(oe),ne.forEach((R,ae)=>R.data.forEach((_,G)=>{_[0]=Te[ae][G][0],_[1]=Te[ae][G][1]}));let $=e.annotation.annotationSetLabelColor;Te.forEach((R,ae)=>R.forEach(_=>{_.key=R.key,R.color=JSON.parse(JSON.stringify(A[ae].properties.color)),_.data.labelPosition=A[ae].properties.dataLabelPosition,_.data.labelColor=$=="2"?JSON.parse(JSON.stringify(A[ae].properties.color)):A[ae].properties.labelColor,_.hideZero=JSON.parse(JSON.stringify(A[ae].properties.hideZeroValues)),_.properties=A[ae].properties}))},Se=(oe,$,R)=>{ne=$,N=oe,fe=R,ke(),ze()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},mr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.LayeredHorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!0,U=!1,Y=new Map;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne=[],Z=0,fe=2,Re=!1,Te=[];const Me=!1;let J={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(ae){me("StackStackHorizontalBarchart","createStackHorizontalBarChart",ae)}},[e]);const Ee=()=>{({formatOptions:e,svg:s,width:h,height:k}=Ft(S,e)),Le(),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe,visibleBars:fe,columnWidth:L,scrollbarVisible:Re}=Mt(h,k,he,O,J.yMaxLeft,e,J.legendList,J.dimensionList,J.yMaxRight,U,Me,t,b,J),be(D),St(s,h,k,e),d=wt(s,D),kt(d,e,0,X,M,u,m),Ue(),Pe(),ra(e,d,w,M,X,a),Dt(e,b,s,D,z,k,ye,J.chartType,w,X,M),Vt(M,e,0,b,s,D,K,w),Nt(s,e,h,te),It(k,s,se,te,h,ge,e,A,m,0,D,ct.rectangle,u,l),_t(A,k,h,s,D,X,Re,fe,J,Z,!1,ze,b)},Le=()=>{const ae=[],_=[];let G=[],Q=-1/0,ee=1/0,F=-1/0,q=1/0,ue=-1/0,B=1/0;A.forEach(V=>{_.push(V.properties.legendUniqueId),ue=-1/0,B=1/0,V.data.forEach(P=>{ae.push(P),ue=Math.max(ue,P.value),B=Math.min(B,P.value),Q=Math.max(Q,P.value),ee=Math.min(ee,P.value)}),V.properties.setColorScale&&Y.set(V.properties.legendUniqueId,v.scaleSequential().domain([B,ue]).interpolator(v.interpolateRgb(V.properties.startColor,V.properties.endColor)))}),J.chartData=ae,J.legendList=_,J.yMaxLeft=Q,J.yMinLeft=ee>0?0:ee,J.yMaxRight=F,J.yMinRight=q,G=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(V=>V):J.dimensionList,G=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(V=>V):J.dimensionList,J.dimensionList.forEach((V,P)=>{J.formattedDimensionListMap.set(V,G[P]),J.formattedDimensionListMap.set(V,G[P])}),ne=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?N=J.dimensionList:N=J.dimensionList.slice(Z,Z+fe),e.plotArea.hideZeroValues&&(J.hideZeroValues=!0)},Ue=()=>{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I,b,X).yAxisLabelArray;J.yMaxLeft=ae[ae.length-1],J.yMinLeft=ae[0],i=v.scaleLinear().domain([J.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:J.yMinLeft<0?J.yMinLeft*1.1:J.yMinLeft*.9,J.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:J.yMaxLeft*1.1]).range([0,X]),T=[M,0],ve()},ve=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(J.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=v.scalePoint().domain(N).range(T).padding(.5)},Pe=()=>{Ye();{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I,b,X);a=v.axisBottom(i).tickFormat(_=>Xe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-M:0).tickValues(ae.autoLabelFlag?void 0:ae.yAxisLabelArray).ticks(ae.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ye=()=>{f=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*X*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(N,M,e))},We=ae=>{ae.forEach(_=>{_.data.forEach(G=>{G.hideZero=_.properties.hideZeroValues,G.axis=_.properties.axis,G.properties=_.properties})}),ae.forEach((_,G)=>{let Q=d.selectAll(".parentGroup").filter(B=>B?.properties?.legendUniqueId===_.properties.legendUniqueId).data([_],B=>B.properties.legendUniqueId);Q=Q.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",_.properties.legendUniqueId).attr("clip-path",`url(#${m}-clip)`).merge(Q);let ee=Q.selectAll(".column-group").data(_.data,B=>B.dimension+"_"+_.properties.legendUniqueId),F=ee.enter().append("g").attr("class","column-group").attr("hoverId",(_.properties.alias||_.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",B=>G===0?`translate(0, ${y(B.dimension)-L/2})`:`translate(0, ${y(B.dimension)-L/(2+G*2)})`);ee.attr("transform",B=>G===0?`translate(0, ${y(B.dimension)-L/2})`:`translate(0, ${y(B.dimension)-L/(2+G*2)})`),F.merge(ee).attr("transform",B=>G===0?`translate(0, ${y(B.dimension)-L/2})`:`translate(0, ${y(B.dimension)-L/(2+G*2)})`);const q=F.append("rect").attr("y",0).attr("height",G===0?L:L/2).attr("x",()=>i(0)).attr("width",0).attr("fill",B=>Y.get(_.properties.legendUniqueId)?.(B.value)??_.properties.color).attr("stroke-dasharray",()=>_.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${_.properties.stackBorderWidth}px`).attr("stroke",()=>_.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?_.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",B=>B.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>_.properties.legendUniqueId).attr(lt.DimValue,B=>Array.isArray(B.dimension)?String(B.dimension[0]):String(B.dimension));(e.animation.animationEnabled?q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):q).attr("x",B=>B.value>0?i(0):i(B.value)).attr("width",B=>B.value>0?i(B.value)-i(0):Math.abs(i(0)-i(B.value))),ee.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("x",B=>B.value>0?i(0):i(B.value)).attr("width",B=>B.value>0?i(B.value)-i(0):Math.abs(i(0)-i(B.value))),F.merge(ee).on("mousemove",(B,V)=>{ut([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:J.formattedDimensionListMap.get(V.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():V.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||V.value,value:Xe(V.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:_.properties.alias}],e,B,_.properties,At(p,String(V.dimension??""),{..._.properties,formattedDimensionValue:String(J.formattedDimensionListMap.get(V.dimension)??V.dimension??"")}))}).on("mouseout",()=>{ot()}).on("click",vt(W,g,(B,V)=>({seriesId:_.properties.legendUniqueId,dimValue:Array.isArray(V.dimension)?String(V.dimension[0]):String(V.dimension),legendUniqueId:_.properties.legendUniqueId,seriesDisplayName:_.properties.alias||_.properties.name||""}))),ee.exit().remove()}),d.selectAll(".parentGroup").raise()},be=ae=>{X=h-ae.left-ae.right,M=k-ae.bottom-ae.top},ze=(ae,_,G)=>{ne=_,N=ae,fe=G,ke()},ke=()=>{ve(),Ye(),na(e,d,z,M,X,f,void 0,i,J.yMaxLeft,N,u,t,h,se,L,y),Se(),We(ne),$a(ne,y,i,void 0,D,pt,[],[],e,u,k,h,X,N,M,m,s,x,void 0,L,o,!1,b),oe()},Se=()=>{let ae=Lt(N,ne,Me);Te=v.stack().keys(J.legendList).offset(v.stackOffsetDiverging)(ae),ne.forEach((G,Q)=>G.data.forEach((ee,F)=>{ee[0]=Te[Q][F][0],ee[1]=Te[Q][F][1]}));let _=e.annotation.annotationSetLabelColor;Te.forEach((G,Q)=>G.forEach(ee=>{ee.key=G.key,G.color=JSON.parse(JSON.stringify(A[Q].properties.color)),ee.data.labelPosition=A[Q].properties.dataLabelPosition,ee.data.labelColor=_=="2"?JSON.parse(JSON.stringify(A[Q].properties.color)):A[Q].properties.labelColor,ee.hideZero=JSON.parse(JSON.stringify(A[Q].properties.hideZeroValues))}))},oe=()=>{try{const ae=Number(e.connector?.connectorVisibility);if(!e.connector||ae===2)return;const _=[],G=[],Q=[];let ee;const F=[];if(ae===1)ee=1;else if(ae===3){const re=Number(e.connector.connectorFollow);re===1?ee=Number(e.connector.connectorStepSize):re===2&&((e.connector.connectorExclude||[]).forEach(j=>Q.push(j)),ee=1)}const q=[],ue=[],B=[],V=e.connector?.connectorCustomRange||[];Q.forEach(re=>{const j=re.split("-");j.length&&q.push(j[0])});const C=(Te?.[0]||[]).map((re,j)=>({Dimension:re.data.Dimension,Total:re.data.Total,CustomTotal:re.data.Total-(B[j]??0),Index:j}));if(ee!=null){for(let re=0;re<C.length;re++)(ee===1||re%ee===0&&ee!==1)&&_.push(C[re]);for(let re=ee;re<C.length;re+=ee){const j=Math.min(re+ee,C.length);let ie=-1/0;for(let we=re;we<j;we++)C[we].Total>ie&&(ie=C[we].Total);ie!==-1/0&&F.push(ie)}for(let re=1;re<_.length;re++)G.push(_[re])}else{const re=[];(V||[]).forEach(j=>{if(j?.from&&j?.to){const ie=C.some(de=>de.Dimension===j.from),we=C.some(de=>de.Dimension===j.to);ie&&we&&re.push({from:j.from,to:j.to})}}),re.forEach(j=>{const ie=C.findIndex(de=>de.Dimension===j.from),we=C.findIndex(de=>de.Dimension===j.to);if(ie>=0&&we>=0){const de=Math.min(ie,we),Ae=Math.max(ie,we);_.push(C[de]);let De=C[de]?.Total??-1/0;for(let $e=de;$e<=Ae;$e++)C[$e].Total>De&&(De=C[$e].Total);De!==-1/0&&F.push(De),G.push(C[Ae])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Ie.white?e.connector.connectorMarkerColor:"none"),$(_,F,G,ee,q),R(_,F,G,ee,q)}catch(ae){console.error(ae)}},$=(ae,_,G,Q,ee)=>{try{d.append("g").selectAll("path").data(ae).enter().filter((F,q)=>Q!=null?q<ae.length-1:q<ae.length).append("path").attr("d",(F,q)=>e.total.totalVisibility?`M ${i(F.Total)+50},
82
+ ${y(F.Dimension)+y.bandwidth()/2-5}
83
+ H ${60+Math.max(i(_[q]),i(G[q].Total),i(F.Total))}
84
+ V ${y(G[q].Dimension)+y.bandwidth()/2+5}
85
+ H ${30+i(G[q].Total)}`:`M ${i(F.Total)+30},
86
+ ${y(F.Dimension)+y.bandwidth()/2-5}
87
+ H ${45+Math.max(i(_[q]),i(G[q].Total),i(F.Total))}
88
+ V ${y(G[q].Dimension)+y.bandwidth()/2+5}
89
+ H ${10+i(G[q].Total)}
90
+ `).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",F=>ee.includes(F.Dimension)||F.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}},R=(ae,_,G,Q,ee)=>{try{let F=e.connector.connectorFontStyle,q=e.connector.connectorNumberFormat,ue=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(q=".2s"),d.append("g").selectAll("text1").data(ae).enter().filter((B,V)=>Q!=null?V<ae.length-1:V<ae.length).append("text").attr("y",(B,V)=>Q==null?y(G[V].Dimension)/2+y(B.Dimension)/2+15:Q==1?ue<6&&y.bandwidth()>40?y(G[V].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(G[V].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(G[V].Dimension)+y.bandwidth()/2+y.bandwidth()/2*Q+12).attr("x",(B,V)=>e.total.totalVisibility?70+Math.max(i(_[V]),i(G[V].Total),i(B.Total)):50+Math.max(i(_[V]),i(G[V].Total),i(B.Total))).text((B,V)=>(B.CustomTotal==0&&G[V].CustomTotal!=0&&(B.CustomTotal=1),fi(G[V].Total,B.Total,parseInt(e.connector.connectorDecimalPrecision),q,parseInt(B.Dimension),parseInt(G[V].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Ie.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",F.includes("Italic")?"Italic":"").style("text-decoration",F.includes("Underline")?"Underline":"").style("font-weight",F.includes("Bold")?"Bold":"").style("visibility",B=>ee.includes(B.Dimension)||B.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},fr=({isDateType:t,formatOptions:e,data:n})=>{const o=crypto.randomUUID(),x=0,l=le.ColumnHistogramChart,r=Ce.useRef(),c=n.ChartData,p=n.DimensionList,m=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,g=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,W=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,E,b,U,Y,H,I,D,w,z,K,ye,se,te,xe,ge,pe=[],he=[],O,X,M,h,k,s,d,i,y,T,a,f=[],N=0;const ne=2;let Z={dimensionList:p,chartType:l,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{fe()}catch(We){me("HorizontalHistogramChart","createHorizontalChart",We)}},[e]);const fe=()=>{({formatOptions:e,svg:k,width:O,height:X}=Ft(r,e)),Re(),{formatOptions:e}=ea(e,c,n.DataTableData??[]),{maxNumberForPrimaryAxis:ye,maxNumberForSecondaryAxis:se}=Rt(e,Z.yMinLeft,Z.yMaxLeft,Z.yMinRight,Z.yMaxRight),{margin:E,yLabel:b,xLabel:U,yTitle:Y,xTitle:H,dimensionHeightWidthArray:I,chartTitleHeight:D,secondaryAxisTitleWidth:w,legendMargin:z,secondaryYLabel:K}=Mt(O,X,ye,se,Z.yMaxLeft,e,Z.legendList,Z.dimensionList,Z.yMaxRight,L,u,t),ve(E),{dataTable:M,dataTableHeight:h}=ia(e,b,Y,c,Z.dimensionList),St(k,O,X,e),s=wt(k,E),kt(s,e,h,te,xe,l),Te(),J(),Ee(),ta(s,Z,U,e,h,d,T,I,X,x,t,te,xe,a,d),Zt(s,e,h,b,y,xe),Pe(c,X,k,E,te),Dt(e,m,k,E,U,X,H,Z.chartType,b,te,xe),Vt(xe,e,h,m,k,E,Y,b),Gt(k,L,E,e,h,xe,te,K,w),Nt(k,e,O,D),It(X,k,I,D,O,z,e,c,o,h,E,ct.rectangle)},Re=()=>{const We=[],be=[];let ze=[],ke=-1/0,Se=1/0;c.forEach(R=>{be.push(R.legend),R.data.forEach(ae=>{We.push(ae),ke=Math.max(ke,ae.value),Se=Math.min(Se,ae.value)})}),Z.chartData=We,Z.legendList=be,Z.yMaxLeft=ke,Z.yMinLeft=Se>0?0:Se,f=JSON.parse(JSON.stringify(c)),f.forEach(R=>R.data.forEach(ae=>ze.push(ae.value)));let oe=S||S==0?S:0,$=g||g==0?g:f[0]?.data?.length;if(Z.yMaxLeft=parseFloat((oe+"").length>($+"").length?oe+"":$+""),Z.xMax=v.max(ze),Z.xMin=v.min(ze),Z.xMin===Z.xMax){const R=Z.xMax===0?1:Math.abs(Z.xMax*.1);Z.xMin-=R,Z.xMax+=R}},Te=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=xe/50;break;case"Number of Bins":Me(!1);break;case"Bin Width":Me(!0)}},Me=We=>{f.forEach(Se=>Se.data.sort((oe,$)=>oe.value-$.value));let be=Z.xMax-Z.xMin,ze;We?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ze=be/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ze=be/parseFloat(e.bins.binsCalculationValue));let ke=Z.xMin;if(We)for(pe=[ke];ke<Z.xMax;)ke+=ze,pe.push(ke);else for(pe=[ke];Math.round(ke)<Math.round(Z.xMax);)ke+=ze,pe.push(Math.round(ke))},J=()=>{d=v.scaleLinear().domain([Z.xMin,Z.xMax]).range([xe,0]);const We=pe.length>0?pe:d.ticks(ge);let be=v.bin().value(ke=>ke).domain(d.domain()).thresholds(We);f.forEach(ke=>{let Se=be(ke.data.map(oe=>oe.value));he.push(Se)}),f.forEach((ke,Se)=>he[Se].forEach(oe=>{oe.name=ke.properties.legend,oe.color=ke.properties.color,oe.opacity=ke.properties.opacity}));let ze=[];he.forEach(ke=>ke.forEach(Se=>ze.push(Se.length))),Z.yMaxLeft=v.max(ze),Z.yMinLeft=v.min(ze),i=v.scaleLinear().domain([W||W==0?W:0,A||A==0?A:Z.yMaxLeft+.2*Z.yMaxLeft]).range([0,te])},Ee=()=>{Le();{let We=yt(Z.yMaxLeft,Z.yMinLeft,te,e,Z,S,g,!1,xe);T=v.axisBottom(i).tickFormat(be=>Xe(be,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-xe+0:0).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue).tickPadding(8).tickSizeOuter(0)}},Le=()=>{Ti(Z.xMax,Z.xMin,xe,e,W,A,te,!1).xAxisLabelArray.shift(),y=v.axisLeft(d).tickFormat(be=>Xe(be,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-te:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(ge):y.tickValues(pe).ticks(xe/50)},Ue=We=>{const be=e.animation.animationEnabled,ze=s.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(he).enter().append("g").selectAll("rect").data(Se=>Se).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",0).attr("y",Se=>{const oe=d(Se.x0),$=d(Se.x1);return Math.min(oe,$)}).attr("height",Se=>{const oe=d(Se.x0),$=d(Se.x1),R=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs($-oe)-R)}).attr("width",0).style("fill",Se=>Se.color!==Ie.white?Se.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(Se,oe)=>{ut([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():oe.properties?.currentMeasure?oe.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${oe.x0}-${oe.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:Xe(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(oe.length/f[0].data.length):oe.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,Se)}).on("mouseout",ot);(be?ze.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ze).attr("width",Se=>i(Se.length)),s.selectAll(".parentGroup").raise()},ve=We=>{te=O-We.left-We.right,xe=X-We.bottom-We.top},Pe=(We,be,ze,ke,Se)=>{if(!e.plotArea.fitChart){const oe=We[0].data.length-ne,$=be-20;a=Z.dimensionList.slice(N,N+ne),f=JSON.parse(JSON.stringify(We)),f.forEach((_,G)=>f[G].data=_.data.filter(Q=>a.includes(Q.dimension))),ze.append("rect").attr("x",ke.left).attr("y",$).attr("width",Se).attr("height",8).attr("fill","#ddd").attr("rx",4);const R=Se*ne/Z.dimensionList.length,ae=ze.append("rect").attr("x",ke.left).attr("y",$).attr("width",R).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",_=>{let G=Math.min(Math.max(_.x,ke.left),ke.left+Se-R);ae.attr("x",G),N=Math.round((G-ke.left)/(Se-R)*oe),a=Z.dimensionList.slice(N,N+ne),f=JSON.parse(JSON.stringify(We)),f.forEach((Q,ee)=>f[ee].data=Q.data.filter(F=>a.includes(F.dimension))),Le(),Ye()}));ze.on("wheel",_=>{_.preventDefault();const G=Math.abs(_.deltaX)>Math.abs(_.deltaY)?_.deltaX:_.deltaY;N+=G>0?1:-1,N=Math.max(0,Math.min(N,oe));const Q=ke.left+(Se-R)*N/oe;ae.attr("x",Q),f=JSON.parse(JSON.stringify(We)),f.forEach((ee,F)=>f[F].data=ee.data.filter(q=>a.includes(q.dimension))),Le(),Ye()})}Ye()},Ye=()=>{Zt(s,e,h,b,y,xe),Ue()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"className",ref:r,id:o,style:{width:"100%",height:"100%"}})})},Tr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID(),L=0,u=le.AreaChart,S=Ce.useRef(),g=Ce.useRef(c);g.current=c;const W=Ce.useRef(p);W.current=p;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled;let U=!1;const Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye,We=[],be=0,ze,ke,Se,oe=[],$={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(V){me("Linechart","createLineChart",V)}},[e]);const R=()=>{({formatOptions:e,svg:T,width:s,height:d}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:oe}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:X,maxNumberForSecondaryAxis:M,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:w}=Rt(e,$.yMinLeft,$.yMaxLeft,$.yMinRight,$.yMaxRight),{margin:z,yLabel:K,xLabel:ye,yTitle:se,xTitle:te,dimensionHeightWidthArray:xe,chartTitleHeight:ge,secondaryAxisTitleWidth:pe,legendMargin:he,secondaryYLabel:O,visibleBars:ze,columnWidth:ke,scrollbarVisible:Se}=Mt(s,d,X,M,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,Y,t,b,$,oe),q(z),{dataTable:i,dataTableHeight:y}=ia(e,K,se,A,$.dimensionList,n),b&&(i=[],y=0),St(T,s,d,e),a=wt(T,z),kt(a,e,y,h,k,u,m),_(),Q(),b?(ra(e,a,K,k,h,Ue),U&&Ai(e,a,O,ve,h)):(Zt(a,e,y,K,Re,k),U&&bi(a,e,y,O,Me,k,h)),Dt(e,b,T,z,ye,d,te,$.chartType,K,h,k),Vt(k,e,y,b,T,z,se,K,h),Gt(T,U,z,e,y,k,h,O,pe,b),Nt(T,e,s,ge),It(d,T,xe,ge,s,he,e,A,m,y,z,ct.areaWithLine,u,l),_t(A,d,s,T,z,h,Se,ze,$,be,!1,ue,b)},ae=()=>{const V=[],P=[];let C=[],re=-1/0,j=1/0,ie=-1/0,we=1/0;e.plotArea.hideZeroValues&&($.hideZeroValues=!0,A.forEach(de=>{de.data=de.data.filter(Ae=>Ae.value!==0)})),A.forEach(de=>{P.push(de.properties.alias?de.properties.alias:de.legend),de.data.forEach(Ae=>{V.push(Ae),de.properties.axis==="Secondary"?(U=!0,ie=Math.max(ie,Ae.value),we=Math.min(we,Ae.value)):(re=Math.max(re,Ae.value),j=Math.min(j,Ae.value))})}),$.chartData=V,$.legendList=P,$.yMaxLeft=re,$.yMinLeft=j>0?0:j,$.yMaxRight=ie,$.yMinRight=we>0?0:we,C=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(de=>de):$.dimensionList,$.dimensionList.forEach((de,Ae)=>{$.formattedDimensionListMap.set(de,C[Ae])}),We=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Ye=$.dimensionList:Ye=$.dimensionList.slice(be,be+ze)},_=()=>{let V=yt(I||$.yMaxLeft,$.yMinLeft,k,e,$,H,I,b,h).yAxisLabelArray;$.yMaxLeft=V[V.length-1],$.yMinLeft=V[0];const P=b?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const C=v.scaleLinear().domain([$.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:$.yMinLeft<0?$.yMinLeft*1.1:$.yMinLeft*.9,$.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:$.yMaxLeft*1.1]).range(P);b?Ee=C:f=C}if(U){const C=v.scaleLinear().domain([$.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:$.yMinRight*1.1,$.yMaxRight<=0?w||0:w||$.yMaxRight*1.1]).range(P);b?Le=C:N=C}if(Z=b?[k,0]:[0,h],!b&&e.seriesLabel.seriesLabelVisibility){let C=la(h,f,e,We,void 0,U,k);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(fe=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Z=[0,h-C.heightWidth[0]]:Z=[C.heightWidth[0],h]}},G=()=>{const V=v.scalePoint().domain(Ye).range(Z).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?J=V:ne=V},Q=()=>{ee();{let V=yt(I||$.yMaxLeft,$.yMinLeft,k,e,$,H,I,b,h);b?Ue=v.axisBottom(Ee).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Re=v.axisLeft(f).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,h,fe)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/30).tickPadding(8).tickSizeOuter(0)}if(U){let V=yt(w||$.yMaxRight,D||$.yMinRight,k,e,$,D,w);b?ve=v.axisTop(Le).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??h/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-k:0).tickSizeOuter(0):Me=v.axisRight(N).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-h:0).tickSizeOuter(0)}},ee=()=>{b?Pe=v.axisLeft(J).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Ye,k,e)):Te=v.axisBottom(ne).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(gt(Ye,h,e))},F=V=>{const P=e.plotArea.plotAreaHideLineAndMarkers;V.forEach(De=>{De.data.forEach($e=>{$e.hideZero=De.properties.hideZeroValues,$e.axis=De.properties.axis})});const C=b?v.area().y(De=>{const $e=J(De.dimension);return $e??0}).x0(De=>De.axis===Qe.primary?Ee(0):Le(0)).x1(De=>De.axis===Qe.primary?Ee(De.value):Le(De.value)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)):v.area().x(De=>ne(De.dimension)?ne(De.dimension):null).y0(De=>De.axis===Qe.primary?f(0):N(0)).y1(De=>De.axis===Qe.primary?f(De.value):N(De.value)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)),re=b?v.area().y(De=>{const $e=J(De.dimension);return $e??0}).x0(()=>Ee(0)).x1(()=>Ee(0)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)):v.area().x(De=>ne(De.dimension)?ne(De.dimension):null).y0(()=>f(0)).y1(()=>f(0)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)),j=e.animation.animationEnabled;let ie=a.selectAll(".parentGroup").data([V]),we=a.append("g").attr("class","focusClass");ie=ie.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(ie);let de=ie.selectAll(".area-group").data(De=>De),Ae=de.enter().append("g").attr("class","area-group");Ae.append("path").attr("class","area parentGroup").attr("fill",De=>De.properties.color!==Ie.white?De.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",De=>(De.properties?.alias||De.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",De=>re(De.data)).attr(lt.SeriesId,De=>De.properties.legendUniqueId).attr(lt.DimValue,De=>De.properties.alias||De.properties.name||"").on("click",vt(W,g,(De,$e)=>({seriesId:$e.properties.legendUniqueId,dimValue:$e.properties.alias||$e.properties.name||"",legendUniqueId:$e.properties.legendUniqueId,seriesDisplayName:$e.properties.alias||$e.properties.name||""}))).each(function(De){j?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(De.data)):v.select(this).attr("d",C(De.data))}),Ae.merge(de).each(function(De){const $e=v.select(this);$e.selectAll("path.visibleLine").data([De]).join("path").attr("class","visibleLine parentGroup").attr("d",Fe=>j?re(Fe.data):C(Fe.data)).attr("stroke",Fe=>Fe.properties.areaBorderColor!==Ie.white?Fe.properties.areaBorderColor:"none").attr("stroke-dasharray",Fe=>{const _e=parseInt(Fe.properties.lineWidth);switch(Fe.properties.lineStyle){case bt.dotted:return`0,${_e+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",Fe=>Fe.properties.lineStyle===bt.dotted?ya.round:ya.butt).attr("stroke-width",Fe=>P?Fe.properties.lineStyle!==bt.none&&e.plotArea.plotAreaHideLineAndMarkers?Fe.properties.lineWidth:"0":0).attr("fill","none").each(function(Fe){j&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(Fe.data))}),$e.selectAll("path.hoverLine").data([De]).join("path").attr("class","hoverLine").attr("d",Fe=>C(Fe.data)).attr("fill",Ie.transparent).attr("stroke","none").style("pointer-events","all").raise(),Li(e,ie,we,Ye,V,b?J:ne,b?Ee:f,u,!1,b)}),de.exit().remove(),Va(ie,V,u,b?J:ne,b?Ee:f,b?Le:N,null,e,$,w,D,H,I,!1,r,b),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},q=V=>{h=s-V.left-V.right,k=d-V.bottom-V.top},ue=(V,P,C)=>{We=P,Ye=V,ze=C,B()},B=()=>{if(G(),ee(),$a(A,b?J:ne,b?Ee:f,b?Le:N,z,pt,[],[],e,u,d,s,h,Ye,k,m,T,x,void 0,void 0,o,!1,b),b?na(e,a,ye,k,h,Pe,ve,Ee,$.yMaxLeft,Ye,u,t,s,xe,ke,J):ta(a,$,ye,e,y,f,Te,xe,d,L,t,h,k,Ye,ne),F(We),!b){let V=la(h,f,e,We,void 0,U,k).labelArray;ja(e,a,V),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,T,a,i,L,f,ne,void 0,void 0,void 0,y,u,e,K,se,Ye,h,Z,$.formattedDimensionListMap,m,z,k))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},vr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.StackAreaChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse()||[],E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M=new Map,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye=[],We=0,be,ze,ke,Se=[],oe=[];const $=!1;let R={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{ae()}catch(C){me("StackAreaChart","createAreaChart",C)}},[e]);const ae=()=>{({formatOptions:e,svg:T,width:s,height:d}=Ft(S,e)),_(),{formatOptions:e,dataTableLegendsList:Se}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:X}=Rt(e,R.yMinLeft,R.yMaxLeft,R.yMinRight,R.yMaxRight),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:be,columnWidth:ze,scrollbarVisible:ke}=Mt(s,d,O,X,R.yMaxLeft,e,R.legendList,R.dimensionList,R.yMaxRight,U,$,t,b,R,Se),ue(w),{dataTable:i,dataTableHeight:y}=ia(e,z,ye,A,R.dimensionList,n),b&&(i=[],y=0),St(T,s,d,e),a=wt(T,w),kt(a,e,y,h,k,u,m),G(),ee(),b?ra(e,a,z,k,h,Le):Zt(a,e,y,z,Re,k),Dt(e,b,T,w,K,d,se,R.chartType,z,h,k),Vt(k,e,y,b,T,w,ye,z,h),Gt(T,U,w,e,y,k,h,he,ge,b),Nt(T,e,s,xe),It(d,T,te,xe,s,pe,e,[...A].reverse(),m,y,w,ct.areaWithLine,u,l),_t(A,d,s,T,w,h,ke,be,R,We,!1,B,b)},_=()=>{const C=[],re=[];e.plotArea.hideZeroValues&&(R.hideZeroValues=!0,A.forEach(De=>{De.data=De.data.filter($e=>$e.value!==0)})),A.forEach((De,$e)=>{const Fe=`${$e}~$~${De.properties.alias}`;De.properties.legend=Fe,re.push(Fe);for(const _e of De.data)C.push(_e)}),R.chartData=C,R.legendList=re,Ye=JSON.parse(JSON.stringify(A));let j=Lt(R.dimensionList,A,$);e.plotArea.fitChart?Pe=R.dimensionList:(Pe=R.dimensionList.slice(We,We+be),Ye.forEach((De,$e)=>Ye[$e].data=De.data.filter(Fe=>Pe.includes(Fe.dimension))));const ie=v.stack().keys(R.legendList).offset(v.stackOffsetNone)(j);P();let we=1/0,de=-1/0;for(const De of ie)for(const[$e,Fe]of De)we=Math.min(we,$e),de=Math.max(de,Fe);R.yMinLeft=we>0?0:we,R.yMaxLeft=de;let Ae=t?Tt(e.xAxisLabel.xAxisNumberFormat,R.dimensionList).map(De=>De):R.dimensionList;R.dimensionList.forEach((De,$e)=>{R.formattedDimensionListMap.set(De,Ae[$e])})},G=()=>{let C=yt(H||R.yMaxLeft,R.yMinLeft,k,e,R,Y,H,b,h).yAxisLabelArray;R.yMaxLeft=C[C.length-1],R.yMinLeft=C[0];const re=b?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const j=v.scaleLinear().domain([R.yMinLeft>=0?Y!==void 0&&!Number.isNaN(Y)?Y:0:R.yMinLeft<0?R.yMinLeft*1.1:R.yMinLeft*.9,R.yMaxLeft<=0?0:H!==void 0&&!Number.isNaN(H)?H:R.yMaxLeft*1.1]).range(re);b?J=j:f=j}if(Z=b?[k,0]:[0,h],!b&&e.seriesLabel.seriesLabelVisibility){let j=la(h,f,e,A,void 0,U,k,!0);j.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(fe=j.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Z=[0,h-j.heightWidth[0]]:Z=[j.heightWidth[0],h]}},Q=()=>{const C=v.scalePoint().domain(Pe).range(Z).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?Me=C:ne=C},ee=()=>{{let C=yt(H||R.yMaxLeft,R.yMinLeft,k,e,R,Y,H,b,h);b?Le=v.axisBottom(J).tickFormat(re=>Xe(re,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Re=v.axisLeft(f).tickFormat(re=>Xe(re,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,h,fe)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?ve=v.axisLeft(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Pe,k,e)):Te=v.axisBottom(ne).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(gt(Pe,h,e))},q=C=>{const re=e.animation.animationEnabled,j=e.plotArea.plotAreaHideLineAndMarkers;C.forEach(Fe=>{Fe.data.forEach(_e=>{_e.hideZero=Fe.properties.hideZeroValues,_e.axis=Fe.properties.axis})});const ie=b?v.area().y(Fe=>{const _e=Me(Fe.data.dimension);return _e??0}).x0(Fe=>J(Fe[0])).x1(Fe=>J(Fe[1])).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e)):v.area().x(Fe=>ne(Fe.data.dimension)?ne(Fe.data.dimension):null).y0(Fe=>f(Fe[0])).y1(Fe=>f(Fe[1])).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e)),we=b?v.area().y(Fe=>{const _e=Me(Fe.data.dimension);return _e??0}).x0(()=>J(0)).x1(()=>J(0)).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e)):v.area().x(Fe=>ne(Fe.data.dimension)?ne(Fe.data.dimension):null).y0(()=>f(0)).y1(()=>f(0)).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e));let de=a.selectAll(".lineGroup").data([oe]),Ae=a.append("g").attr("class","focusClass");de=de.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(de);let De=de.selectAll(".area-group").data(Fe=>Fe),$e=De.enter().append("g").attr("class",Fe=>"area-group "+Fe.key.replace(/ /g,"-"));$e.append("path").attr("hoverId",Fe=>(C[Fe.index].properties.alias||C[Fe.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Fe=>Fe.color!==Ie.white?Fe.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",Fe=>we(Fe)).attr(lt.SeriesId,Fe=>A[Fe.index]?.properties?.legendUniqueId??Fe.key).attr(lt.DimValue,Fe=>A[Fe.index]?.properties?.alias||A[Fe.index]?.properties?.name||"").on("click",vt(W,g,(Fe,_e)=>{const it=A[_e.index]?.properties?.legendUniqueId??_e.key,nt=A[_e.index]?.properties?.alias||A[_e.index]?.properties?.name||"";return{seriesId:it,dimValue:nt,legendUniqueId:it,seriesDisplayName:nt}})).each(function(Fe){re?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",ie(Fe)):v.select(this).attr("d",ie(Fe))}),$e.merge(De).each(function(Fe,_e){const it=v.select(this);it.selectAll("path.visibleLine").data([Fe]).join("path").attr("class","visibleLine parentGroup").attr("d",nt=>re?we(nt):ie(nt)).attr("stroke",nt=>nt.color!==Ie.white?A[_e].properties.areaBorderColor:"none").attr("stroke-dasharray",nt=>{const Ba=parseInt(A[_e].properties.lineWidth.toString());switch(A[_e].properties.lineStyle){case bt.dotted:return`0,${Ba+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[_e]?.properties?.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",()=>j?A[_e].properties.lineStyle!==bt.none?A[_e].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(nt){re&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",ie(nt))}),it.selectAll("path.hoverLine").data([Fe]).join("path").attr("class","hoverLine").attr("d",nt=>ie(nt)).attr("fill",Ie.transparent).attr("stroke","none").style("pointer-events","all").raise(),T.selectAll('[hoverId="'+(A[Fe.index].properties.alias||A[Fe.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),De.exit().remove(),Li(e,de,Ae,Pe,C,b?Me:ne,b?J:f,u,!0,b),Va(de,C,u,b?Me:ne,b?J:f,b?Ee:N,null,e,R,D,I,Y,H,!1,p,b),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ue=C=>{h=s-C.left-C.right,k=d-C.bottom-C.top},B=(C,re,j)=>{Ye=re,Pe=C,be=j,li(n,M,Pe),P(),V()},V=()=>{if(Q(),F(),b?na(e,a,K,k,h,ve,Ue,J,R.yMaxLeft,Pe,u,t,s,te,ze,Me):ta(a,R,K,e,y,f,Te,te,d,L,t,h,k,Pe,ne),q(Ye),Ya(oe,b?Me:ne,b?J:f,b?Ee:N,w,pt,[],[],e,u,d,s,h,Pe,k,m,T,x,y,o,b),ii(M,b?Me:ne,b?J:f,w,pt,[],e,u,d,s,T,o,b),!b){let C=la(h,f,e,Ye,void 0,U,k,!0).labelArray;ja(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,T,a,i,L,f,ne,void 0,void 0,void 0,y,u,e,z,ye,R.dimensionList,h,Z,R.formattedDimensionListMap,m,w,k))}},P=()=>{let C=Lt(Pe,Ye,$);oe=v.stack().keys(R.legendList).offset(v.stackOffsetNone)(C),Ye.forEach((j,ie)=>j.data.forEach((we,de)=>{we[0]=oe[ie][de][0],we[1]=oe[ie][de][1]}));let re=e.annotation.annotationSetLabelColor;oe.forEach((j,ie)=>j.forEach(we=>{we.key=j.key,j.color=JSON.parse(JSON.stringify(A[ie].properties.color)),we.data.labelPosition=A[ie].properties.dataLabelPosition,we.data.labelColor=re=="2"?JSON.parse(JSON.stringify(A[ie].properties.color)):A[ie].properties.labelColor,we.hideZero=JSON.parse(JSON.stringify(A[ie].properties.hideZeroValues)),we.properties=A[ie].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},kr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.NormalizedStackAreaChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse()||[],E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe=[],Ye=0,We,be,ze,ke=[],Se=[];const oe=!0;let $={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(P){me("NormalizedLinechart","createLineChart",P)}},[e]);const R=()=>{({formatOptions:e,svg:y,width:k,height:s}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:ke}=ea(e,A,n.DataTableData??[]),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:We,columnWidth:ze,scrollbarVisible:be}=Mt(k,s,O,X,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,oe,t,b,$,ke),q(w),{dataTable:d,dataTableHeight:i}=ia(e,z,ye,A,$.dimensionList,n),b&&(d=[],i=0),St(y,k,s,e),T=wt(y,w),kt(T,e,i,M,h,u),_(),Q(),b?ra(e,T,z,h,M,Ee):Zt(T,e,i,z,fe,h),Dt(e,b,y,w,K,s,se,$.chartType,z,M,h),Vt(h,e,i,b,y,w,ye,z,M),Gt(y,U,w,e,i,h,M,he,ge,b),Nt(y,e,k,xe),It(s,y,te,xe,k,pe,e,[...A].reverse(),m,i,w,ct.areaWithLine,u,l),_t(A,s,k,y,w,M,be,We,$,Ye,!1,ue,b)},ae=()=>{const P=[],C=[];e.plotArea.hideZeroValues&&($.hideZeroValues=!0,A.forEach(de=>{de.data=de.data.filter(Ae=>Ae.value!==0)})),A.forEach((de,Ae)=>{const De=`${Ae}~$~${de.properties.alias}`;de.properties.legend=De,C.push(De);for(const $e of de.data)P.push($e)}),$.chartData=P,$.legendList=C,Pe=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?ve=$.dimensionList:(ve=$.dimensionList.slice(Ye,Ye+We),Pe.forEach(de=>{de.data=de.data.filter(Ae=>ve.includes(Ae.dimension))}));const re=Lt($.dimensionList,A,oe),j=v.stack().keys($.legendList).offset(v.stackOffsetNone)(re);V();let ie=1/0;for(const de of j)for(const[Ae]of de)ie=Math.min(ie,Ae);$.yMinLeft=ie>0?0:ie,$.yMaxLeft=1;const we=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(de=>de):$.dimensionList;$.formattedDimensionListMap=new Map($.dimensionList.map((de,Ae)=>[de,we[Ae]]))},_=()=>{const P=b?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const C=v.scaleLinear().domain([$.yMinLeft<0?-1:0,1]).range(P);b?Me=C:a=C}if(ne=b?[h,0]:[0,M],!b&&e.seriesLabel.seriesLabelVisibility){let C=la(M,a,e,A,void 0,U,h,!0);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Z=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ne=[0,M-C.heightWidth[0]]:ne=[C.heightWidth[0],M]}},G=()=>{const P=v.scalePoint().domain(ve).range(ne).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?Te=P:N=P},Q=()=>{{const P=e.yAxisLabel.yAxisTicksMode===wa.custom,C=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0,re=P?za($.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null;b?Ee=v.axisBottom(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).tickValues(re).tickFormat(v.format(`.${C}%`)).ticks(i>0?(M-i)/80:M/80).tickPadding(8).tickSizeOuter(0):fe=v.axisLeft(a).tickSize(zt(e,M,Z)).tickValues(re).tickFormat(v.format(`.${C}%`)).ticks(i>0?(h-i)/80:h/80).tickPadding(8).tickSizeOuter(0)}},ee=()=>{b?Ue=v.axisLeft(Te).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(ve,h,e)):Re=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(gt(ve,M,e))},F=P=>{const C=e.animation.animationEnabled,re=e.plotArea.plotAreaHideLineAndMarkers;Se.forEach(($e,Fe)=>$e.forEach((_e,it)=>{const nt=_e.data.total;P[Fe].data[it]&&(P[Fe].data[it][0]=_e[0]=nt===0?0:_e[0]/nt,P[Fe].data[it][1]=_e[1]=nt===0?0:_e[1]/nt)})),P.forEach($e=>{$e.data.forEach(Fe=>{Fe.hideZero=$e.properties.hideZeroValues,Fe.axis=$e.properties.axis})});const j=b?v.area().y($e=>{const Fe=Te($e.data.dimension);return Fe??0}).x0($e=>Me($e[0])).x1($e=>Me($e[1])).defined($e=>$e.data.hideZero?!!$e[0]:!0).curve(v.curveLinear):v.area().x($e=>N($e.data.dimension)?N($e.data.dimension):null).y0($e=>a($e[0])).y1($e=>a($e[1])).defined($e=>$e.data.hideZero?!!$e[0]:!0).curve(v.curveLinear),ie=b?v.area().y($e=>{const Fe=Te($e.data.dimension);return Fe??0}).x0(()=>Me(0)).x1(()=>Me(0)).defined($e=>$e.data.hideZero?!!$e.data.key:!0).curve(ft(e)):v.area().x($e=>N($e.data.dimension)?N($e.data.dimension):null).y0(()=>a(0)).y1(()=>a(0)).defined($e=>$e.data.hideZero?!!$e.data.key:!0).curve(ft(e));let we=T.selectAll(".lineGroup").data([Se]),de=T.append("g").attr("class","focusClass");we=we.enter().append("g").attr("class","areas lineGroup").merge(we);let Ae=we.selectAll(".area-group").data($e=>$e),De=Ae.enter().append("g").attr("class",$e=>"area-group "+$e.key.replace(/ /g,"-"));De.append("path").attr("hoverId",$e=>(P[$e.index]?.properties?.alias||P[$e.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",$e=>$e.color!==Ie.white?$e.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",$e=>ie($e)).attr(lt.SeriesId,$e=>A[$e.index]?.properties?.legendUniqueId??$e.key).attr(lt.DimValue,$e=>A[$e.index]?.properties?.alias||A[$e.index]?.properties?.name||"").on("click",vt(W,g,($e,Fe)=>{const _e=A[Fe.index]?.properties?.legendUniqueId??Fe.key,it=A[Fe.index]?.properties?.alias||A[Fe.index]?.properties?.name||"";return{seriesId:_e,dimValue:it,legendUniqueId:_e,seriesDisplayName:it}})).each(function($e){const Fe=v.select(this);C?Fe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j($e)):Fe.attr("d",j($e))}),De.merge(Ae).each(function($e,Fe){const _e=v.select(this);_e.selectAll("path.visibleLine").data([$e]).join("path").attr("class","visibleLine parentGroup").attr("d",it=>C?ie(it):j(it)).attr("stroke",it=>it.color!==Ie.white?A[Fe].properties.areaBorderColor:"none").attr("stroke-dasharray",it=>{const nt=parseInt(A[Fe].properties.lineWidth.toString());switch(A[Fe].properties.lineStyle){case bt.dotted:return`0,${nt+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[Fe]?.properties?.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",()=>re?A[Fe].properties.lineStyle!==bt.none?A[Fe].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(it){C&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j(it))}),_e.selectAll("path.hoverLine").data([$e]).join("path").attr("class","hoverLine").attr("d",it=>j(it)).attr("fill",Ie.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+mi((P[$e.index]?.properties?.alias||P[$e.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),Ae.exit().remove(),Li(e,we,de,ve,P,b?Te:N,b?Me:a,u,!0,b),T.selectAll(".parentGroup").raise(),T.selectAll(".hoverLine").raise(),Va(we,P,u,b?Te:N,b?Me:a,b?J:f,null,e,$,D,I,Y,H,!0,p,b),!b&&e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,u,e,z,ye,$.dimensionList,M,ne,$.formattedDimensionListMap,m,w,h))},q=P=>{M=k-P.left-P.right,h=s-P.bottom-P.top},ue=(P,C,re)=>{Pe=C,ve=P,We=re,V(),B()},B=()=>{if(G(),ee(),b?na(e,T,K,h,M,Ue,Le,Me,$.yMaxLeft,ve,u,t,k,te,ze,Te):ta(T,$,K,e,i,a,Re,te,s,L,t,M,h,ve,N),F(Pe),Ya(Se,b?Te:N,b?Me:a,b?J:f,w,pt,[],[],e,u,s,k,M,ve,h,m,y,x,i,o,b),!b){let P=la(M,a,e,Pe,void 0,U,h,!0).labelArray;ja(e,T,P)}},V=()=>{let P=Lt(ve,Pe,oe);Se=v.stack().keys($.legendList).offset(v.stackOffsetNone)(P),Pe.forEach((re,j)=>re.data.forEach((ie,we)=>{Se[j][we]&&(ie[0]=Se[j][we][0],ie[1]=Se[j][we][1])}));let C=e.annotation.annotationSetLabelColor;Se.forEach((re,j)=>re.forEach(ie=>{ie.key=re.key,re.color=JSON.parse(JSON.stringify(A[j].properties.color)),ie.data.labelPosition=A[j].properties.dataLabelPosition,ie.data.labelColor=C=="2"?JSON.parse(JSON.stringify(A[j].properties.color)):A[j].properties.labelColor,ie.hideZero=JSON.parse(JSON.stringify(A[j].properties.hideZeroValues)),ie.properties=A[j].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},ni={left:"Left",right:"Right",center:"Center"},Bt={left:"left",right:"right",top:"top",bottom:"bottom"},qa={solid:"solid",dashed:"Dashed",dotted:"Dotted"},si={rounded:"rounded",pill:"pill",extra_rounded:"extra_rounded",squircle:"squircle",rectangle:"rectangle"},ha={curve:"curve",elbow:"elbow",diagonal:"diagonal",s_curve:"s-curve",arc:"arc",reverse_elbow:"reverse-elbow",zigzag:"zigzag"},dl="PieFamilyCommonFunctions.ts",Cr=(t,e,n,o)=>{try{let x=t.total.totalPosition,l=t.total.totalAlignment,r=t.legends.legendPosition,c=0;switch(x){case Fa.top:switch(c=r=="Top"?35:0,l){case Wt.start:return{x:5,y:e+c+10};case Wt.middle:return{x:n/2,y:e+c+10};case Wt.end:return{x:n-20,y:e+c+10}}break;case Fa.bottom:switch(c=r=="Bottom"?30:0,l){case Wt.start:return{x:10,y:o-c-10};case Wt.middle:return{x:n/2,y:o-c-10};case Wt.end:return{x:n-20,y:o-c-10}}break}}catch(x){me(dl,"getTotalValueCords",x)}},Vi=(t,e,n,o,x,l)=>{try{if(t.total&&t.total.totalVisibility){let r=t.total.totalFontStyle,c=t.total.totalAlignment,p=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":Ke(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),m=Cr(t,n,x,l);const L=o.append("g").attr("transform",`translate(${m.x}, ${m.y})`).style("user-select","none");L.append("text").text(t.total.showTotalLabel!==!1?`${t.total.editTotalTextToggle?t.total.editTotalText:"Total"} : ${p}`:p).style("fill",t.total.totalColor!==Ie.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",r.includes(ce.italic)?ce.italic:"").style("text-decoration",r.includes(ce.underline)?ce.underline:"").style("font-weight",r.includes(ce.bold)?ce.bold:"").attr("text-anchor",c===Wt.start?"start":c===Wt.middle?"middle":c===Wt.end?"end":""),t.animation?.animationEnabled&&L.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(et[t.animation.animationEffect]).attr("opacity",1)}}catch(r){me(dl,"drawTotalValue",r)}},Ga="PieChart.tsx",Mr=({data:t,formatOptions:e,chartId:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=Ce.useRef(),L=Ce.useRef(r);L.current=r;const u=Ce.useRef(c);u.current=c;const S=mt(t.ChartData);let g,W,A,E=40,b=Jt,U=[0,0],Y,H,I,D,w,z,K,ye,se=!1;Ce.useEffect(()=>{te()},[e]);const te=()=>{({chartFormatOptions:g,svg:w,width:A,height:W}=Kt(m,e)),xe(),U=Ha(g,S),{margins:b,innerHeight:Y,innerWidth:H,legendListWidth:ye,chartTitleHeight:E}=Ua(g,A,W,U,b),ge(),qt(m,A,W,g),D=oa(w,b),Xt(m,E,A,g),Wa(g,w,S,A,W,ye,E,n,b,ct.circle,void 0,l),pe(),he(),g.plotArea.annotationDraggable&&g.plotArea.dataLabels?ol(pt,z,g,O(),le.PieChart,A,W,D,Math.min(Y*.5,H*.5),o,x):M(),Vi(g,K,E,w,A,W)},xe=()=>{try{K=0,t.ChartData.forEach(h=>{h.properties.dataLabelPosition=="2"&&(se=!0),K+=h.data[0].value})}catch(h){me(Ga,"loopOverSeriesData",h)}},ge=()=>{try{I=Math.min(Y*.5,H*.5),se&&(I=I*.9)}catch(h){me(Ga,"defineChartRadius",h)}},pe=()=>{try{let h=rt(g.plotArea.rotation);const k=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;z=v.pie().value(i=>Math.abs(k?100:i.data[0].value)).startAngle((h??0)*(Math.PI/180)%360).endAngle(((h??0)+360)*(Math.PI/180)%360)(t.ChartData).map((i,y)=>({...i,x0:i.startAngle,x1:i.endAngle,y0:0,y1:I,depth:2}))}catch(h){me(Ga,"initPieChartData",h)}},he=()=>{try{const h=v.arc().innerRadius(0).outerRadius(I),k=v.arc().innerRadius(0).outerRadius(I+10),s=D.append("g").attr("class","parentGroup").attr("fill-opacity",g.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data(z).enter().append("path").attr("class",d=>"path").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",d=>d.data.properties.color!==Ie.white?d.data.properties.color:"none").attr(lt.SeriesId,d=>d.data.properties.legendUniqueId??d.data.properties.name??"").attr(lt.DimValue,d=>d.data.properties.alias||d.data.legend||"").on("click",vt(u,L,(d,i)=>({seriesId:i.data.properties.legendUniqueId??i.data.properties.name??"",dimValue:i.data.properties.alias||i.data.legend||"",legendUniqueId:i.data.properties.legendUniqueId??i.data.properties.name??"",seriesDisplayName:i.data.properties.alias||i.data.properties.name||""}))).on("mouseover.arc",function(d){v.select(this).transition().duration(100).attr("d",k)}).on("mousemove. ",d=>{ut([{key:g.yAxisTitle.yAxisTitleText,value:g.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(d.currentTarget.__data__.data.data[0].value/K)*100).toFixed(rt(g.toolTip.toolTipDecimalPrecision))+"%":Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)(d.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:d.currentTarget.__data__.data.properties.alias}],g,void 0,d.currentTarget.__data__.data.properties,At(p,String(d.currentTarget.__data__.data.legend??""),d.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(d){v.select(this).transition().duration(100).attr("d",h),ot()});g.animation.animationEnabled?s.transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attrTween("d",function(d){const i=v.interpolate({startAngle:d.startAngle,endAngle:d.startAngle},d);return y=>h(i(y))}):s.attr("d",d=>h(d))}catch(h){me(Ga,"drawPieChart",h)}},O=()=>{try{return`translate(${H/2},${Y/2})`}catch(h){return me(Ga,"getPiePosition",h),""}},X=(h,k)=>{try{if(k)return"translate(0 0)";{const s=(h.startAngle+h.endAngle)/2,d=Math.cos(s-Math.PI/2)*(I*.65),i=Math.sin(s-Math.PI/2)*(I*.65);let y=s*180/Math.PI%360,T=0;return y>180&&y<360?T=90:T=-90,y+=T,`translate(${d},${i}) rotate(${y})`}}catch(s){return me(Ga,"getDataLabelTransformString",s),""}},M=()=>{try{if(g.plotArea.dataLabels){const h=z&&z.length===1;D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="1"),g,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.labelFontSize??11).attr("fill",d=>d.data.properties?.labelFontColor??Ie.black).attr("font-style",d=>d.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",d=>d.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",d=>d.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",d=>d.data.properties?.labelFont??tt).attr("transform",d=>X(d,h)).attr("visibility",d=>d.endAngle-d.startAngle<.09&&e.plotArea.hideInsignificantValue?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(d=>{const{plotArea:i}=g;return i.dataLabelName?d.data.properties?.alias||d.data.legend:""}),D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="1"),g,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.valueFontSize??11).attr("fill",d=>d.data.properties?.valueFontColor??Ie.black).attr("font-style",d=>d.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",d=>d.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",d=>d.data.properties?.valueFont??tt).attr("transform",d=>X(d,h)).attr("visibility",d=>d.endAngle-d.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",g.plotArea.dataLabelName?"1.00em":"0em").text(d=>{if(g.plotArea.dataLabelValue){const i=d.data.data[0].value;return g.plotArea.dataLabelValue&&i!==void 0?g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/K)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",g.plotArea.dataLabelValue?g.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("fill-opacity",.5).text(d=>{const i=Math.abs(d.data.data[0].value);return g.plotArea.plotAreaAbsoluteValue&&i!==void 0?v.format(".2s")(i):""});let k=v.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>1?d.y1-1+I/7:0).outerRadius(d=>d.depth>1?d.y1-1+I/7:0),s=v.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>2?d.y0:0).outerRadius(d=>d.y1+I/1.5);D.selectAll("polyline.pie-label-connector").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="2"),g,d=>d.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",O()).style("stroke",d=>g.connector.connectorColorOption=="Uniform"?g.connector.connectorUniformLineColor:d.data.properties.color).style("fill","none").style("stroke-dasharray",g.connector.connectorStyle===qa.solid?0:g.connector.connectorStyle===qa.dotted?1:4).style("stroke-width",g.connector.connectorLineThickness).attr("points",d=>{const i=s.centroid(d),y=k.centroid(d);let T=d.x0+(d.x1-d.x0)/2;T=T%(2*Math.PI);const a=I*1.1*(T<Math.PI?1:-1),f=y[1];return[i,y,[a,f]].map(N=>N.join(",")).join(" ")}),D.append("g").attr("class","pie-label-group").attr("transform",O()).selectAll("foreignObject").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="2"),g,d=>d.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",d=>{let i=d.x0+(d.x1-d.x0)/2;i=i%(2*Math.PI);const T=i<Math.PI?0:-80;return I*1.1*(i<Math.PI?1:-1)+T}).attr("y",d=>k.centroid(d)[1]-30).append("xhtml:div").attr("hoverId",d=>(d.data.properties.alias||d.data.properties.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(d=>{let i=d.data.data[0].value.toString();d.data.data[0].value!==void 0&&(i=g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(d.data[0].value/K)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision))+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(d.data.data[0].value));let y="";return g.plotArea.dataLabelName&&(y+=`<span style="
91
91
  font-size: ${d.data.properties.labelFontSize}px;
92
92
  color: ${d.data.properties.labelFontColor};
93
- font-style: ${d.data.properties.labelFontStyle.includes(oe.italic)?oe.italic:""};
94
- text-decoration: ${d.data.properties.labelFontStyle.includes(oe.underline)?oe.underline:""};
95
- font-weight: ${d.data.properties.labelFontStyle.includes(oe.bold)?oe.bold:""};
93
+ font-style: ${d.data.properties.labelFontStyle.includes(ce.italic)?ce.italic:""};
94
+ text-decoration: ${d.data.properties.labelFontStyle.includes(ce.underline)?ce.underline:""};
95
+ font-weight: ${d.data.properties.labelFontStyle.includes(ce.bold)?ce.bold:""};
96
96
  font-family: ${d.data.properties.labelFont};
97
97
  display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
98
98
  ${d.data.legend}
99
- </span>`),b.plotArea.dataLabelValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
99
+ </span>`),g.plotArea.dataLabelValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
100
100
  font-size: ${d.data.properties.valueFontSize}px;
101
101
  color: ${d.data.properties.valueFontColor};
102
- font-style: ${d.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
103
- text-decoration: ${d.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
104
- font-weight: ${d.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
102
+ font-style: ${d.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:""};
103
+ text-decoration: ${d.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
104
+ font-weight: ${d.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
105
105
  font-family: ${d.data.properties.valueFont};
106
106
  display: block;">
107
107
  ${i}
108
- </span>`),b.plotArea.plotAreaAbsoluteValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
108
+ </span>`),g.plotArea.plotAreaAbsoluteValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
109
109
  font-size: ${d.data.properties.valueFontSize}px;
110
110
  color: ${d.data.properties.valueFontColor};
111
- font-style: ${d.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
112
- text-decoration: ${d.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
113
- font-weight: ${d.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
111
+ font-style: ${d.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:""};
112
+ text-decoration: ${d.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
113
+ font-weight: ${d.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
114
114
  font-family: ${d.data.properties.valueFont};
115
115
  display: block;">
116
116
  ${v.format(".2s")(d.data.data[0].value)}
117
- </span>`),y}),b.animation.animationEnabled&&D.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",1)}}catch(h){Ae(Ba,"drawPieDataLabels",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:f,id:r,style:{width:"100%",height:"100%"}})})},Va="DonutChart.tsx",fr=({data:t,formatOptions:e,chartId:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=Me.useRef(),L=Me.useRef(l);L.current=l;const u=Me.useRef(s);u.current=s;const S=Lt(t.ChartData);let b,_,A,R=40,g=jt,B=[0,0],U,W,P,D,V,$,Z,ce,ne=!1,ae;Me.useEffect(()=>{ue()},[e]);const ue=()=>{({chartFormatOptions:b,svg:ae,width:_,height:A}=qt(f,e)),ge(),B=Ua(b,S),{margins:g,innerHeight:U,innerWidth:W,legendListWidth:V,chartTitleHeight:R}=$a(b,_,A,B,g),be(),Xt(f,_,A,b),$=oa(ae,g),Zt(f,R,_,b),Ya(b,ae,S,_,A,V,R,r,g,ct.hollowCircle,!1,n),pe(),Q(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?rl(xt,Z,b,G(),se.DonutChart,_,A,$,Math.min(U*.5,W*.5),c,x):h(),k()},ge=()=>{try{ce=0,S.forEach(o=>{o.properties.dataLabelPosition=="2"&&(ne=!0),ce+=o.data[0].value})}catch(o){Ae(Va,"loopOverSeriesData",o)}},be=()=>{try{P=Math.min(U*.4,W*.4),ne&&(P=P*.9),D=Math.min(rt(b.plotArea.innerRadius)/100*P,P)}catch(o){Ae(Va,"defineChartRadius",o)}},pe=()=>{try{let o=rt(b.plotArea.rotation);const d=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;Z=v.pie().value(T=>Math.abs(d?100:T.data[0].value)).startAngle((o??0)*(Math.PI/180)%360).endAngle(((o??0)+360)*(Math.PI/180)%360)(S)?.map((T,a)=>({...T,x0:T.startAngle,x1:T.endAngle,y0:0,y1:P,depth:2}))}catch(o){Ae(Va,"initPieChartData",o)}},Q=()=>{try{const o=b.animation.animationEnabled,d=v.arc().innerRadius(D).outerRadius(P),i=v.arc().innerRadius(D).outerRadius(P+10),T=$.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${G()}`).selectAll("path").data(Z).enter().append("path").attr("class",a=>"path").attr("hoverId",a=>(a.data?.properties?.alias||a.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",a=>a.data.properties.color!==Re.white?a.data.properties.color:"none").attr(lt.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(lt.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",Tt(u,L,(a,m)=>({seriesId:m.data.properties.legendUniqueId??m.data.properties.name??"",dimValue:m.data.properties.alias||m.data.legend||"",legendUniqueId:m.data.properties.legendUniqueId??m.data.properties.name??"",seriesDisplayName:m.data.properties.alias||m.data.properties.name||""}))).each(function(a){const m=a;m._current={startAngle:0,endAngle:0}}).on("mouseover.arc",function(){o?v.select(this).transition().duration(150).attr("d",i):v.select(this).attr("d",i)}).on("mousemove.text",a=>{yt([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/ce)*100).toFixed(rt(b.toolTip.toolTipDecimalPrecision))+"%":qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],b,void 0,a.currentTarget.__data__.data.properties,gt(p,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>ot()).on("mouseout.arc",function(){o?v.select(this).transition().duration(150).attr("d",d):v.select(this).attr("d",d)});o?T.transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attrTween("d",function(a){const m=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(N){return d(m(N))}}):T.attr("d",a=>d(a))}catch(o){Ae(Va,"drawDonutChart",o)}},G=()=>{try{return`translate(${W/2},${U/2})`}catch(o){return Ae(Va,"getPiePosition",o),""}},M=(o,d)=>{try{if(d)return"translate(0 0)";{const i=(o.startAngle+o.endAngle)/2,y=(D+P)/2,T=Math.cos(i-Math.PI/2)*y,a=Math.sin(i-Math.PI/2)*y;let m=i*180/Math.PI%360,N=0;return m>180&&m<360?N=90:N=-90,m+=N,`translate(${T},${a}) rotate(${m})`}}catch(i){return Ae(Va,"getDataLabelTransformString",i),""}},h=()=>{try{if(b.plotArea.dataLabels){const o=Z&&Z.length===1;$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??Re.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,o)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:T}=b;return T.dataLabelName?y.data?.properties?.alias||y.data.legend:""}),$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.lableFontColor??Re.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("fill",y=>y.data.properties?.valueFontColor??Re.black).attr("transform",y=>M(y,o)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(y=>{if(b.plotArea.dataLabelValue){const T=y.data.data[0].value;return b.plotArea.dataLabelValue&&T!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/ce)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(T):T}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??Re.black).attr("fill-opacity",.5).text(y=>{const T=Math.abs(y.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&T!==void 0?v.format(".2s")(T):""});let d=v.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>1?y.y1-1+P/7:0).outerRadius(y=>y.depth>1?y.y1-1+P/7:0),i=v.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>2?y.y0:0).outerRadius(y=>y.y1+P/1.5);$.selectAll("polyline.pie-label-connector").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",G()).style("stroke",y=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:y.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Za.solid?0:b.connector.connectorStyle===Za.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",y=>{const T=i.centroid(y),a=d.centroid(y);let m=y.x0+(y.x1-y.x0)/2;m=m%(2*Math.PI);const N=P*1.1*(m<Math.PI?1:-1),re=a[1];return[T,a,[N,re]].map(K=>K.join(",")).join(" ")}),$.append("g").attr("class","pie-label-group").attr("transform",G()).selectAll("foreignObject").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",y=>{let T=y.x0+(y.x1-y.x0)/2;T=T%(2*Math.PI);const m=T<Math.PI?0:-80;return P*1.1*(T<Math.PI?1:-1)+m}).attr("y",y=>d.centroid(y)[1]-30).append("xhtml:div").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(y=>{try{let T=y.data.data[0].value.toString();y.data.data[0].value!==void 0&&(T=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y.data.data[0].value/ce)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision))+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(y.data.data[0].value));let a="";return b.plotArea.dataLabelName&&(a+=`<span style="
117
+ </span>`),y}),g.animation.animationEnabled&&D.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",1)}}catch(h){me(Ga,"drawPieDataLabels",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:m,id:n,style:{width:"100%",height:"100%"}})})},Na="DonutChart.tsx",Sr=({data:t,formatOptions:e,chartId:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=Ce.useRef(),L=Ce.useRef(r);L.current=r;const u=Ce.useRef(c);u.current=c;const S=mt(t.ChartData);let g,W,A,E=40,b=Jt,U=[0,0],Y,H,I,D,w,z,K,ye,se=!1,te;Ce.useEffect(()=>{xe()},[e]);const xe=()=>{({chartFormatOptions:g,svg:te,width:W,height:A}=Kt(m,e)),ge(),U=Ha(g,S),{margins:b,innerHeight:Y,innerWidth:H,legendListWidth:w,chartTitleHeight:E}=Ua(g,W,A,U,b),pe(),qt(m,W,A,g),z=oa(te,b),Xt(m,E,W,g),Wa(g,te,S,W,A,w,E,n,b,ct.hollowCircle,!1,l),he(),O(),g.plotArea.annotationDraggable&&g.plotArea.dataLabels?ol(pt,K,g,X(),le.DonutChart,W,A,z,Math.min(Y*.5,H*.5),o,x):h(),k()},ge=()=>{try{ye=0,S.forEach(s=>{s.properties.dataLabelPosition=="2"&&(se=!0),ye+=s.data[0].value})}catch(s){me(Na,"loopOverSeriesData",s)}},pe=()=>{try{I=Math.min(Y*.4,H*.4),se&&(I=I*.9),D=Math.min(rt(g.plotArea.innerRadius)/100*I,I)}catch(s){me(Na,"defineChartRadius",s)}},he=()=>{try{let s=rt(g.plotArea.rotation);const d=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;K=v.pie().value(T=>Math.abs(d?100:T.data[0].value)).startAngle((s??0)*(Math.PI/180)%360).endAngle(((s??0)+360)*(Math.PI/180)%360)(S)?.map((T,a)=>({...T,x0:T.startAngle,x1:T.endAngle,y0:0,y1:I,depth:2}))}catch(s){me(Na,"initPieChartData",s)}},O=()=>{try{const s=g.animation.animationEnabled,d=v.arc().innerRadius(D).outerRadius(I),i=v.arc().innerRadius(D).outerRadius(I+10),T=z.append("g").attr("class","parentGroup").attr("fill-opacity",g.plotArea.opacity).attr("transform",`${X()}`).selectAll("path").data(K).enter().append("path").attr("class",a=>"path").attr("hoverId",a=>(a.data?.properties?.alias||a.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",a=>a.data.properties.color!==Ie.white?a.data.properties.color:"none").attr(lt.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(lt.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",vt(u,L,(a,f)=>({seriesId:f.data.properties.legendUniqueId??f.data.properties.name??"",dimValue:f.data.properties.alias||f.data.legend||"",legendUniqueId:f.data.properties.legendUniqueId??f.data.properties.name??"",seriesDisplayName:f.data.properties.alias||f.data.properties.name||""}))).each(function(a){const f=a;f._current={startAngle:0,endAngle:0}}).on("mouseover.arc",function(){s?v.select(this).transition().duration(150).attr("d",i):v.select(this).attr("d",i)}).on("mousemove.text",a=>{ut([{key:g.yAxisTitle.yAxisTitleText,value:g.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/ye)*100).toFixed(rt(g.toolTip.toolTipDecimalPrecision))+"%":Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],g,void 0,a.currentTarget.__data__.data.properties,At(p,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>ot()).on("mouseout.arc",function(){s?v.select(this).transition().duration(150).attr("d",d):v.select(this).attr("d",d)});s?T.transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attrTween("d",function(a){const f=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(N){return d(f(N))}}):T.attr("d",a=>d(a))}catch(s){me(Na,"drawDonutChart",s)}},X=()=>{try{return`translate(${H/2},${Y/2})`}catch(s){return me(Na,"getPiePosition",s),""}},M=(s,d)=>{try{if(d)return"translate(0 0)";{const i=(s.startAngle+s.endAngle)/2,y=(D+I)/2,T=Math.cos(i-Math.PI/2)*y,a=Math.sin(i-Math.PI/2)*y;let f=i*180/Math.PI%360,N=0;return f>180&&f<360?N=90:N=-90,f+=N,`translate(${T},${a}) rotate(${f})`}}catch(i){return me(Na,"getDataLabelTransformString",i),""}},h=()=>{try{if(g.plotArea.dataLabels){const s=K&&K.length===1;z.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="1"),g,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??Ie.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,s)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:T}=g;return T.dataLabelName?y.data?.properties?.alias||y.data.legend:""}),z.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="1"),g,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.lableFontColor??Ie.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("fill",y=>y.data.properties?.valueFontColor??Ie.black).attr("transform",y=>M(y,s)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",g.plotArea.dataLabelName?"1.00em":"0em").text(y=>{if(g.plotArea.dataLabelValue){const T=y.data.data[0].value;return g.plotArea.dataLabelValue&&T!==void 0?g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/ye)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(T):T}}).append("tspan").attr("x",0).attr("y",g.plotArea.dataLabelValue?g.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??Ie.black).attr("fill-opacity",.5).text(y=>{const T=Math.abs(y.data.data[0].value);return g.plotArea.plotAreaAbsoluteValue&&T!==void 0?v.format(".2s")(T):""});let d=v.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>1?y.y1-1+I/7:0).outerRadius(y=>y.depth>1?y.y1-1+I/7:0),i=v.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>2?y.y0:0).outerRadius(y=>y.y1+I/1.5);z.selectAll("polyline.pie-label-connector").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="2"),g,y=>y.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",X()).style("stroke",y=>g.connector.connectorColorOption=="Uniform"?g.connector.connectorUniformLineColor:y.data.properties.color).style("fill","none").style("stroke-dasharray",g.connector.connectorStyle===qa.solid?0:g.connector.connectorStyle===qa.dotted?1:4).style("stroke-width",g.connector.connectorLineThickness).attr("points",y=>{const T=i.centroid(y),a=d.centroid(y);let f=y.x0+(y.x1-y.x0)/2;f=f%(2*Math.PI);const N=I*1.1*(f<Math.PI?1:-1),ne=a[1];return[T,a,[N,ne]].map(Z=>Z.join(",")).join(" ")}),z.append("g").attr("class","pie-label-group").attr("transform",X()).selectAll("foreignObject").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="2"),g,y=>y.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",y=>{let T=y.x0+(y.x1-y.x0)/2;T=T%(2*Math.PI);const f=T<Math.PI?0:-80;return I*1.1*(T<Math.PI?1:-1)+f}).attr("y",y=>d.centroid(y)[1]-30).append("xhtml:div").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(y=>{try{let T=y.data.data[0].value.toString();y.data.data[0].value!==void 0&&(T=g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y.data.data[0].value/ye)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision))+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(y.data.data[0].value));let a="";return g.plotArea.dataLabelName&&(a+=`<span style="
118
118
  font-size: ${y.data.properties.labelFontSize}px;
119
119
  color: ${y.data.properties.labelFontColor};
120
- font-style: ${y.data.properties.labelFontStyle.includes(oe.italic)?oe.italic:""};
121
- text-decoration: ${y.data.properties.labelFontStyle.includes(oe.underline)?oe.underline:""};
122
- font-weight: ${y.data.properties.labelFontStyle.includes(oe.bold)?oe.bold:""};
120
+ font-style: ${y.data.properties.labelFontStyle.includes(ce.italic)?ce.italic:""};
121
+ text-decoration: ${y.data.properties.labelFontStyle.includes(ce.underline)?ce.underline:""};
122
+ font-weight: ${y.data.properties.labelFontStyle.includes(ce.bold)?ce.bold:""};
123
123
  font-family: ${y.data.properties.labelFont};
124
124
  display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
125
125
  ${y.data.legend}
126
- </span>`),b.plotArea.dataLabelValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
126
+ </span>`),g.plotArea.dataLabelValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
127
127
  font-size: ${y.data.properties.valueFontSize}px;
128
128
  color: ${y.data.properties.valueFontColor};
129
- font-style: ${y.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
130
- text-decoration: ${y.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
131
- font-weight: ${y.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
129
+ font-style: ${y.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:""};
130
+ text-decoration: ${y.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
131
+ font-weight: ${y.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
132
132
  font-family: ${y.data.properties.valueFont};
133
133
  display: block;">
134
134
  ${T}
135
- </span>`),b.plotArea.plotAreaAbsoluteValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
135
+ </span>`),g.plotArea.plotAreaAbsoluteValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
136
136
  font-size: ${y.data.properties.valueFontSize}px;
137
137
  color: ${y.data.properties.valueFontColor};
138
- font-style: ${y.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
139
- text-decoration: ${y.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
140
- font-weight: ${y.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
138
+ font-style: ${y.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:""};
139
+ text-decoration: ${y.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
140
+ font-weight: ${y.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
141
141
  font-family: ${y.data.properties.valueFont};
142
142
  display: block;">
143
143
  ${v.format(".2s")(y.data.data[0].value)}
144
- </span>`),a}catch(T){return Ae(Va,"drawDonutDataLabels",T),""}}),b.animation.animationEnabled&&$.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",1)}}catch(o){Ae(Va,"drawDonutDataLabels",o)}},k=()=>{try{if(b.total&&b.total.totalVisibility){let o=ce,d=b.total.totalFontStyle;const i=$.append("g").attr("transform",G()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",b.total.totalColor!==Re.white?b.total.totalColor:"none").style("font-family",b.total.totalFontFamily).style("font-size",b.total.totalFontSize).style("font-style",d.includes(oe.italic)?oe.italic:"").style("text-decoration",d.includes(oe.underline)?oe.underline:"").style("font-weight",d.includes(oe.bold)?oe.bold:"").attr("text-anchor","middle").attr("visibility",b.plotArea.dataLabelValue?"visible":"hidden").text(b.total.showTotalLabel!==!1?b.total.editTotalText:"").append("tspan").attr("x",0).attr("y",b.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",d.includes(oe.bold)?oe.bold:300).text(b.total.totalNumberFormat===",.0%"||b.total.totalNumberFormat==="Percentage"?"100%":qe(b.total.totalDisplayUnits,b.total.totalNumberFormat,b.total.totalDecimalPrecision)(o)),b.animation.animationEnabled&&i.attr("opacity",0).transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",1)}}catch(o){Ae(Va,"drawTotalValue",o)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:f,id:r,style:{width:"100%",height:"100%"}})})},Xa="TreemapChart.tsx",Tr=({data:t,formatOptions:e,chartId:r,onElementClick:c,vfxPickModeActive:x,tooltipFormatter:n})=>{const l=Me.useRef(),s=Me.useRef(c);s.current=c;const p=Me.useRef(x);p.current=x;let f,L,u,S=40,b=jt,_,A,R,g,B,U;Me.useEffect(()=>{W()},[e]);const W=()=>{({chartFormatOptions:f,svg:U,width:L,height:u}=qt(l,e)),{margins:b,chartTitleHeight:S,innerHeight:_,innerWidth:A}=ii(f,u,L,!0),Xt(l,L,u,f),R=oa(U,b),Zt(l,S,L,f),P(),D(),ce()},P=()=>{try{const ne={name:"root",children:t.ChartData},ae=v.hierarchy(ne).sum(ue=>ue.data&&ue.data[0].value).sort((ue,ge)=>(ge.data.data[0].value??0)-(ue.data.data[0].value??0));g=v.treemap().tile(v.treemapSquarify).size([A,_]).padding(1).round(!0)(ae).leaves(),B=g[0].data.properties.color}catch(ne){Ae(Xa,"initChartData",ne)}},D=()=>{try{if(f.colorScale.showColor===Ta.colorTheme){let ae=g[0].data.data.length>1?1:0,ue=f.colorScale.startColor,ge=f.colorScale.endColor,be=new Set(g.map(M=>M.data.data[ae].value)),pe=Array.from(be).sort((M,h)=>M-h),Q=pe.length,G;if(Q===1)G=()=>ue;else{const M=v.interpolateLab(ue,ge);G=v.scaleOrdinal().domain(pe.map(String)).range(pe.map((h,k)=>M(k/(Q-1))))}g=g.map(M=>{let h=M.data.data[ae].value;return{...M,data:{...M.data,properties:{...M.data.properties,themeColor:G(h.toString())}}}}),V(ue,ge,Q,pe)}}catch(ne){Ae(Xa,"prepareTreeColors",ne)}},V=(ne,ae,ue,ge)=>{try{let be=v.scalePow().exponent(1).domain([0,ue-1]).range([ne,ae]),Q=U.append("foreignObject").attr("class","parentGroup").attr("x",L-130).attr("y",u-30).attr("width",115).attr("height",10).selectAll(null).data(ge).enter().append("xhtml:div").style("width",`${100/ue}%`).style("height","100%").style("flex-direction","row").style("display","inline-block").attr("width","20px").attr("height","10px").style("background-color",(M,h)=>be(h)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const G=U.append("g").attr("transform",`translate(${L-120},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",f.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",f.yAxisTitle.yAxisTitleFontFamily).text("min");U.append("g").attr("transform",`translate(${L-10},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",f.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",f.yAxisTitle.yAxisTitleFontFamily).text("max")}catch(be){Ae(Xa,"appendColorScale",be)}},$=ne=>{try{switch(f.colorScale.showColor){case Ta.none:return B;case Ta.discrete:return ne.properties.color;case Ta.colorTheme:return ne.properties.themeColor;default:return}}catch(ae){Ae(Xa,"getColor",ae)}},Z=ne=>{try{const ae=ne?.currentTarget?.__data__?.data?.properties;if(!ae)return;switch(f.colorScale.showColor){case Ta.none:return{...ae,markerColor:B};case Ta.colorTheme:return{...ae,markerColor:ae.themeColor};case Ta.discrete:default:return ae}}catch(ae){Ae(Xa,"getMarkerColorForTooltip",ae)}},ce=()=>{try{const ne=f.animation.animationEnabled,ae=R.selectAll("g").data(g).enter().append("g").attr("transform",ge=>`translate(${ge.x0},${ge.y0})`),ue=ae.append("rect").attr("fill",ge=>$(ge.data)).attr("fill-opacity",ne?0:.7).attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0).on("mousemove",(ge,be)=>{yt([{key:f.yAxisTitle.yAxisTitleText,value:qe(f.toolTip.toolTipDisplayUnits,f.toolTip.toolTipNumberFormat,f.toolTip.toolTipDecimalPrecision)(be.data.data[0].value)},{key:"Legend",value:be.data.data[0].legend}],f,void 0,Z(ge),gt(n,String(be.data.data[0]?.legend??""),Z(ge)))}).on("mouseout",()=>ot()).attr(lt.SeriesId,ge=>String(ge.data.properties?.legendUniqueId??ge.data.legend??"")).attr(lt.DimValue,ge=>String(ge.data.data[0].legend??"")).on("click",Tt(p,s,(ge,be)=>{const pe=String(be.data.properties?.legendUniqueId??be.data.legend??""),Q=String(be.data.data[0].legend??"");return{seriesId:pe,dimValue:Q,legendUniqueId:pe,seriesDisplayName:String(be.data.properties?.alias||be.data.properties?.name||Q)}}));if(ne&&ue.transition().duration(f.animation.animationDuration).ease(et[f.animation.animationEffect]).attr("fill-opacity",.7),ae.append("clipPath").attr("id",(ge,be)=>`clip-${be}-${r}`).append("rect").attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0),f.plotArea.dataLabels){const ge=f.annotation.annotationRangeFilter;ae.filter(be=>{if(!ge?.enabled)return!0;const pe=be.data.data[0].value;switch(ge.condition){case"lt":return pe<ge.maxVal;case"gt":return pe>ge.minVal;case"in":return pe>=ge.minVal&&pe<=ge.maxVal;case"not-in":return pe<ge.minVal||pe>ge.maxVal;default:return!0}}).append("text").style("fill",be=>be.data.properties.labelFontColor).style("font-family",be=>be.data.properties.fontFamily).style("font-size",be=>be.data.properties.fontSize).style("font-style",be=>be.data.properties.fontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",be=>be.data.properties.fontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",be=>be.data.properties.fontStyle.includes(oe.bold)?oe.bold:"").attr("clip-path",(be,pe)=>`url(#clip-${pe}-${r})`),f.plotArea.dataLabelName&&ae.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(be=>be.data.legend),f.plotArea.dataLabelValue&&ae.selectAll("text").append("tspan").attr("x",5).attr("y",f.plotArea.dataLabelName?"2.1em":"1.1em").text(be=>qe(f.plotArea.plotAreaDisplayUnits,f.plotArea.dataLabelNumberFormat,f.plotArea.dataLabelDecimalPrecision)(be.data.data[0].value)),ne&&ae.selectAll("text").attr("opacity",0).transition().duration(f.animation.animationDuration).ease(et[f.animation.animationEffect]).attr("opacity",1)}}catch(ne){Ae(Xa,"initChartRect",ne)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},ca="PieofPieChart.tsx",vr=({data:t,formatOptions:e,chartId:r,legendProperties:c,tooltipFormatter:x})=>{const n=Me.useRef();let l,s,p,f=40,L=jt,u,S,b,_,A,R,g,B,U,W,P,D,V,$=[0,0],Z,ce;Me.useEffect(()=>{ne()},[e]);const ne=()=>{({chartFormatOptions:l,svg:_,width:s,height:p}=qt(n,e)),{plotArea:ce}=l,ae(),{margins:L,innerHeight:u,innerWidth:S,legendListWidth:Z,chartTitleHeight:f}=$a(l,s,p,$,L),ue(),Xt(n,s,p,l),b=oa(_,L),Zt(n,f,s,l),ge(),be(),h(),Si(l,B,f,_,s,p),d()},ae=()=>{try{let i=zt(Ji(c,"name"),rt(l.legends.legendFontSize),l.legends.legendFontFamily);$=[i.width,i.height]}catch(i){Ae(ca,"calculateMaxPossibleWidth",i)}},ue=()=>{try{R=Math.min(u*.4,S*.4),g=l.pieofPie.pieOfPieRadius}catch(i){Ae(ca,"calculatePieRadius",i)}},ge=()=>{try{let i=new Map;c.forEach(a=>{i.set(a.name,a)}),B=0,t.forEach(a=>{a.properties=i.get(a.legend),B+=a.data[0].value,a.children&&a.children.forEach(m=>m.properties=i.get(m.legend))}),A=v.pie().value(a=>a.data[0].value)(t).map((a,m)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:R,depth:2}))}catch(i){Ae(ca,"initChartData",i)}},be=()=>{try{const i=v.arc().innerRadius(0).outerRadius(R),y=v.arc().innerRadius(0).outerRadius(R+10),T=b.append("g").attr("class","parentGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${Q()}`).selectAll("path").data(A).enter().append("path").attr("class",a=>"path "+a.data.legend).attr("hoverId",a=>a.data.legend.replace(/ /g,"-")).attr("fill",a=>a.data.properties.color!==Re.white?a.data.properties.color:"none").on("mouseover.arc",function(a){v.select(this).transition().duration(100).attr("d",y)}).on("mousemove.text",a=>{yt([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/B)*100).toFixed(rt(l.toolTip.toolTipDecimalPrecision)??0)+"%":qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],l,void 0,a.currentTarget.__data__.data.properties,gt(x,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(a){v.select(this).transition().duration(100).attr("d",i),ot()}).on("click",(a,m)=>{try{let N=m;if(N.data.children&&N.data.children.length>1){b.selectAll(".childGroup").remove(),b.selectAll(".childLabels").remove(),b.selectAll("line").remove(),U=N.data.legend;let re=90-(m.x0+m.x1)/2/Math.PI*180;pe(N.data.children,re,m)}}catch(N){Ae(ca,"drawPieChart_onClick",N)}});l.animation.animationEnabled?T.transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attrTween("d",function(a){const m=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return N=>i(m(N))}):T.attr("d",a=>i(a))}catch(i){Ae(ca,"drawPieChart",i)}},pe=(i,y,T)=>{try{b.select(".parentGroup").transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`${Q()} rotate(${y})`),b.selectAll(".parentLabels").transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`${Q()} rotate(${y})`);let m=v.pie().value(K=>K.data[0].value)(i).map((K,me)=>({...K,x0:K.startAngle,x1:K.endAngle,y0:0,y1:g,depth:2}));const N=v.arc().innerRadius(0).outerRadius(g),re=v.arc().innerRadius(0).outerRadius(g+10);b.append("g").attr("class","childGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${G()}`).selectAll("path").data(m).enter().append("path").attr("class",K=>"path "+K.data.legend).attr("hoverId",K=>K.data.legend.replace(/ /g,"-")).attr("fill",K=>K.data.properties.color!==Re.white?K.data.properties.color:"none").attr("d",K=>N(K)).on("mouseover.arc",function(K){v.select(this).transition().duration(100).attr("d",re)}).on("mousemove.text",K=>{yt([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(K.currentTarget.__data__.data.data[0].value/B)*100).toFixed(rt(l.toolTip.toolTipDecimalPrecision))+"%":qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(K.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:K.currentTarget.__data__.data.legend}],l,void 0,K.currentTarget.__data__.data.properties,gt(x,String(K.currentTarget.__data__.data.legend??""),K.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(K){v.select(this).transition().duration(100).attr("d",N),ot()}),k(m),o(T,i)}catch(a){Ae(ca,"drawChildPie",a)}},Q=()=>{try{return W=U?3*S/8:S/2,P=u/2,`translate(${W},${P})`}catch(i){Ae(ca,"getParentPiePosition",i)}},G=()=>{try{return D=3*S/4,V=u/2,`translate(${D},${V})`}catch(i){Ae(ca,"getChildPiePosition",i)}},M=(i,y)=>{try{const T=(i.startAngle+i.endAngle)/2,a=Math.cos(T-Math.PI/2)*(y*.65),m=Math.sin(T-Math.PI/2)*(y*.65);let N=T*180/Math.PI-90;return`translate(${a},${m}) rotate(${N})`}catch(T){Ae(ca,"getDataLabelTransformString",T)}},h=()=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(A,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.labelFontSize??11).attr("fill",i=>i.data.properties?.labelFontColor??Re.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",i=>i.data.properties?.labelFont??tt).attr("transform",i=>M(i,R)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:y}=l;return y.dataLabelName?i.data.legend:""}),b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(A,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.valueFontSize??11).attr("fill",i=>i.data.properties?.valueFontColor??Re.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??tt).attr("transform",i=>M(i,R)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(l.plotArea.dataLabelValue){const y=i.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&y!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y/B)*100).toFixed(rt(l.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(y):y}}))}catch(i){Ae(ca,"drawParentPieDataLabels",i)}},k=i=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","childLabels parentGroup").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??Re.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,g)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:T}=l;return T.dataLabelName?y.data.legend:""}),b.append("g").attr("class","childLabels parentGroup").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.valueFontColor??Re.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("transform",y=>M(y,g)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(y=>{if(l.plotArea.dataLabelValue){const T=y.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&T!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/B)*100).toFixed(rt(l.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(T):T}}))}catch(y){Ae(ca,"drawChildPieDataLabels",y)}},o=(i,y)=>{try{let T=Math.abs(i.x0-i.x1)/2,m=i.y1*Math.sin(T),N=m/Math.tan(T);b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",W+N).attr("y1",P-m).attr("x2",D).attr("y2",V-g),b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",W+N).attr("y1",P+m).attr("x2",D).attr("y2",V+g)}catch(T){Ae(ca,"drawLines",T)}},d=()=>{try{let i=c.map(y=>({legend:y.name,properties:y,data:[]}))}catch(i){Ae(ca,"initLegendList",i)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},xa="PyramidChart.tsx",kr=({data:t,formatOptions:e,chartId:r,onDataLabelCoordinatesChange:c,addLocalFilterFromLib:x,tooltipFormatter:n})=>{const l=Me.useRef();let s=Lt(t.ChartData),p,f,L,u,S=40,b=jt,_=[0,0],A,R,g,B,U=[0],W,P,D,V;Me.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:p,svg:f,width:L,height:u}=qt(l,e)),_=Ua(p,s),{margins:b,innerHeight:A,innerWidth:R,legendListWidth:D,chartTitleHeight:S}=$a(p,L,u,_,b),Z(),Xt(l,L,u,p),W=ce(),Zt(l,S,L,p),Ya(p,f,s,L,u,D,S,r,b,ct.rectangle,!1,x),ne(),ae(),ge(),ue()},Z=()=>{try{g=Math.min(A,R),B=.866*g}catch(pe){Ae(xa,"initPyramidSideCalculations",pe)}},ce=()=>{try{return f.append("g").attr("transform",`translate(${b.left},${b.top+(A-B)/2})`)}catch(pe){return Ae(xa,"initChartArea",pe),null}},ne=()=>{try{s=s.sort((pe,Q)=>{const G=pe.data[0].value,M=Q.data[0].value;return p.plotArea.flipPyramid?M-G:G-M}),P=v.sum(s,pe=>Math.abs(pe.data[0].value)),U=[0],s.forEach((pe,Q)=>{const G=Math.abs(pe.data[0].value)/P*B;U.push(U[Q]+G)})}catch(pe){Ae(xa,"initPyramidData",pe)}},ae=()=>{try{s.forEach((pe,Q)=>{try{const G=U[Q],M=U[Q+1];let h=p.plotArea.flipPyramid?1:0;const k=g*(h-U[Q]/B),o=g*(h-U[Q+1]/B),d=R/2,i=W.append("g").attr("id","PyramidChart").attr("class","parentGroup"),y=p.animation.animationEnabled,T=i.append("polygon").attr("class","segment").attr("hoverId",pe.legend.replace(/\s+/g,"-")).attr("data-series-id",pe.legendUniqueId??pe.legend).attr("data-dim-value",pe.legend).attr("points",`
145
- ${d-k/2},${G}
146
- ${d+k/2},${G}
147
- ${d+o/2},${M}
148
- ${d-o/2},${M}
149
- `).attr("fill",pe.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{yt([{key:pe.legend,value:p.toolTip.toolTipNumberFormat==",.0%"?pe.data[0].value?(Math.abs(pe.data[0].value/P)*100).toFixed(rt(p.toolTip.toolTipDecimalPrecision))+"%":"":qe(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(pe.data[0].value)}],p,void 0,pe.properties,gt(n,String(pe.legend??""),pe.properties)),v.select(this).style("opacity",.8).style("stroke",p.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){Ae(xa,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{ot(),v.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){Ae(xa,"drawPyramidChart.onMouseOut",a)}});y&&T.transition().duration(p.animation.animationDuration).ease(et[p.animation.animationEffect]).attr("opacity",1)}catch(G){Ae(xa,"drawPyramidChart.forEach",G)}})}catch(pe){Ae(xa,"drawPyramidChart",pe)}},ue=pe=>{try{if(p.annotation.annotationVisibility){let Q=xt.annotation(),G=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None",M=Yt(V,p,o=>o.data.measure);const h=p.annotation.connectorStyle?.toLowerCase();Q.editMode(p.annotation.annotationDraggable).accessors({x:function(){return R*.5},y:function(o,d){return o.y}}).on("dragend",function(o){try{M.forEach(d=>{d.data.legend===o.data.legend&&(d.dx=o._dx,d.dy=o._dy,d.width=L,d.height=u)}),c&&c(M.map(d=>({data:{legend:d.data.legend,isVisible:d.data.isVisible??!0},dx:d.dx,dy:d.dy,width:L,height:u}))),k.selectAll(".connector").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]),k.selectAll(`.connector-${G}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend.replace(/\s+/g,"-")).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]).filter(d=>d._dx==0&&d._dy==0).remove(),k.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block"),k.selectAll(".annotation-note-title").filter(d=>d.data&&d.data.isVisible).style("display","block")}catch(d){Ae(xa,"pyramidAnnotations.onDragEnd",d)}}).notePadding(0).annotations(M);let k=W.append("g").attr("class","annotation-group parentGroup").call(Q);p.animation.animationEnabled&&k.attr("opacity",0).transition().duration(p.animation.animationDuration).ease(et[p.animation.animationEffect]).attr("opacity",1),k.selectAll("rect").style("visibility","hidden"),k.selectAll(".annotation-subject").remove(),k.selectAll(".connector").style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]),k.selectAll(`.connector-${G}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]).filter(o=>o._dx==0&&o._dy==0).remove(),k.selectAll(".connector-end").filter(o=>o.connector.end=="dot"&&o._dx==0&&o._dy==0).remove(),k.selectAll(".annotation-note-label").filter(o=>o.data&&!o.data.isVisible).style("display","none"),k.selectAll(".annotation-note-title").filter(o=>o.data&&!o.data.isVisible).style("display","none"),p.annotation.annotationType==_t.automatic&&k.selectAll(".annotation-note-content").attr("transform",function(){const d=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(d)return`translate(${parseFloat(d[1])}, 0)`}),k.selectAll(".annotation-note-label").attr("y","15").attr("text-anchor","middle"),k.selectAll(".annotation-note-title").attr("text-anchor","middle"),k.selectAll(".annotation-note-content").attr("transform","translate(0,-28)"),!p.plotArea.dataLabelName&&k.selectAll("tspan").attr("dy","0"),p.plotArea.dataLabelName&&k.selectAll(".annotation-note-title").attr("hoverId",o=>o.data.legend.replace(/\s+/g,"-")).style("font-size",o=>o.data.labelFontSize).attr("font-family",o=>o.data.labelFontFamily).style("font-style",o=>o.data.labelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",o=>o.data.labelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",o=>o.data.labelFontStyle.includes(oe.bold)?oe.bold:"300").style("fill",o=>o.data.labelFontColor),p.plotArea.dataLabelValue&&k.selectAll(".annotation-note-label").attr("hoverId",o=>o.data.legend.replace(/\s+/g,"-")).style("font-size",o=>o.data.valueFontSize).attr("font-family",o=>o.data.valueFontFamily).style("font-style",o=>o.data.valueFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",o=>o.data.valueFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",o=>o.data.valueFontStyle.includes(oe.bold)?oe.bold:"300").style("fill",o=>o.data.valueFontColor)}}catch(Q){Ae(xa,"pyramidAnnotations",Q)}},ge=()=>{try{let pe=p.annotation.annotationType??"1",Q=[pe=="1"?"connector":""],G=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"none";const M=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates||[])),h=new Map(M.map(k=>[k.data?.legend,k]));V=[],s.forEach((k,o)=>{try{const d=p.annotation.annotationVisibility,i=s.length-1;if(d===_t.none||d===_t.startOnly&&o!==0||d===_t.endOnly&&o!==i||d===_t.startAndEndBoth&&o!==0&&o!==i)return;let y={note:{title:p.plotArea.dataLabelName?k.properties.alias:"",label:p.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(k.data[0].value/P)*100).toFixed(rt(p.plotArea.dataLabelDecimalPrecision))+"%":p.plotArea.dataLabelValue?k.data[0].value>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(k.data[0].value/1e9)+"B":qe(p.annotation.annotationDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(k.data[0].value):"",align:"middle"},data:{x:R/2,y:be(k,o,k.properties.dataLabelPosition),isVisible:!0,dimension:k.legend,legend:k.legend,measure:k.data[0].value,labelFontFamily:k.properties.labelFont,labelFontSize:k.properties.labelFontSize,labelFontColor:k.properties.labelFontColor,labelFontStyle:k.properties.labelFontStyle,valueFontFamily:k.properties.valueFont,valueFontSize:k.properties.valueFontSize,valueFontColor:k.properties.valueFontColor,valueFontStyle:k.properties.valueFontStyle},dx:0,dy:0,connector:{end:G,curve:Ml[p.annotation.connectorCurve]},disable:Q,subject:{height:15,width:15},type:Sl[pe],color:p.plotArea.dataLabelNameColor!=Re.black?p.plotArea.dataLabelNameColor:Re.black,height:L,width:L,index:o};const T=h.get(k.legend);T&&(y.dx=T.dx*L/(T.width||L),y.dy=T.dy*u/(T.height||u),y.data.isVisible=T.data?.isVisible??!0),V.push(y)}catch(d){Ae(xa,"prepareNewAnnotationsList.forEach",d)}})}catch(pe){Ae(xa,"prepareNewAnnotationsList",pe)}},be=(pe,Q,G)=>{try{switch(G){case yi.top:return U[Q]+30;case yi.middle:return(U[Q]+U[Q+1])/2+15;case yi.bottom:return U[Q+1];default:return U[Q]+30}}catch(M){return Ae(xa,"getYCordinate",M),0}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},Sa="ProgressChart.tsx",Cr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:c,tooltipFormatter:x})=>{const n=Me.useRef();let l=Lt(t),s,p,f,L=40,u=jt,S=[0,0],b,_,A,R,g,B,U,W;const P=1,D=0;Me.useEffect(()=>{V()},[e]);const V=()=>{({chartFormatOptions:s,svg:g,width:p,height:f}=qt(n,e)),S=Ua(s,l),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:B,chartTitleHeight:L}=$a(s,p,f,S,u),$(),Xt(n,p,f,s),R=oa(g,u),Zt(n,L,p,s),Ya(s,g,l,p,f,B,L,r,u,ct.hollowCircle,!0,c),Z(),ce(),Si(s,A,L,g,p,f)},$=()=>{try{U=Math.min(b*.45,_*.45),W=Math.min(rt(s.plotArea.innerRadius)/100*U,U)}catch(ae){Ae(Sa,"setRadiusAndInnerRadius",ae)}},Z=()=>{try{A=t[P].data[0].value+t[D].data[0].value}catch(ae){Ae(Sa,"initProgressChartData",ae)}},ce=()=>{try{let ae=t[P].data[0].value,ue=t[D].data[0].value,ge=Math.PI*2,be=ue/ae*Math.PI*2,pe=s.plotArea.dataLabelValueFontStyle;const Q=v.arc().innerRadius(W).outerRadius(U).startAngle(0).cornerRadius(rt(s.plotArea.cornerRadius));R.append("path").attr("class","secondary-circle").attr("fill",t[P].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressScale).attr("hoverId",M=>(t[P]?.properties?.alias||t[P]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[P].properties.legendUniqueId??t[P].properties.alias??"*").attr("data-dim-value",t[P].properties.alias??"*").attr("d",Q({endAngle:ge})).on("mousemove",M=>{try{yt([{key:t[P].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ae)}],s,void 0,t[P].properties,gt(x,String(t[P].properties?.alias??""),t[P].properties))}catch(h){Ae(Sa,"drawProgressChart.onMouseMove.secondary-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){Ae(Sa,"drawProgressChart.onMouseOut.secondary-circle",M)}}).attr("transform",ne()),R.append("path").attr("class","progress-circle").attr("fill",t[D].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressGoal).attr("hoverId",M=>(t[D]?.properties?.alias||t[D]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[D].properties.legendUniqueId??t[D].properties.alias??"*").attr("data-dim-value",t[D].properties.alias??"*").attr("d",Q({endAngle:be})).on("mousemove",M=>{try{yt([{key:t[D].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(ue/ae*100)+"%":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ae)},{key:t[P].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ue)}],s,void 0,t[D].properties,gt(x,String(t[D].properties?.alias??""),t[D].properties))}catch(h){Ae(Sa,"drawProgressChart.onMouseMove.progress-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){Ae(Sa,"drawProgressChart.onMouseOut.progress-circle",M)}}).attr("transform","translate("+_/2+","+b/2+")").transition().duration(s.animation.animationEnabled?s.animation.animationDuration:0).ease(et[s.animation.animationEffect]).attrTween("d",function(M){try{const h=v.interpolate(0,be);return function(k){try{return Q({endAngle:h(k)})}catch(o){return Ae(Sa,"drawProgressChart.attrTween.inner",o),""}}}catch(h){return Ae(Sa,"drawProgressChart.attrTween",h),()=>""}});const G=R.append("text").attr("transform",ne()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>s.plotArea.dataLabels&&qi([{value:ue}],s,h=>h?.value??0).length>0?"visible":"hidden").attr("fill",s.plotArea.dataLabelValueColor!==Re.white?s.plotArea.dataLabelValueColor:s.toolTip.toolTipDisplayUnits).attr("font-style",pe.includes(oe.italic)?oe.italic:"").attr("text-decoration",pe.includes(oe.underline)?oe.underline:"").attr("font-weight",pe.includes(oe.bold)?oe.bold:"").attr("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-size",s.plotArea.dataLabelValueFontSize).text(()=>s.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(ue/ae*100)+"%":qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormatProgress,s.plotArea.dataLabelDecimalPrecision)(ue));s.animation.animationEnabled&&G.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(et[s.animation.animationEffect]).attr("opacity",1)}catch(ae){Ae(Sa,"drawProgressChart",ae)}},ne=()=>{try{return"translate("+_/2+","+b/2+")"}catch(ae){return Ae(Sa,"getTransformString",ae),""}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},Mr=({data:{ChartData:t},formatOptions:e,chartId:r})=>{const c=Me.useRef(),x=Lt(t);let n,l,s,p=40,f=jt,L,u,S,b,_,A,R,g,B,U,W,P={},D;const V="Speedometer.tsx";Me.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:n,svg:b,width:l,height:s}=qt(c,e)),{margins:f,chartTitleHeight:p,innerHeight:L,innerWidth:u}=ii(n,s,l),Z(),Xt(c,l,s,n),S=oa(b,f),Zt(c,p,l,n),ne(),ae(),ge(),pe()},Z=()=>{try{let h;L*.8<u*.45?(_=L*.8,h="width"):(_=u*.45,h="height"),D=ce(h),A=rt(n.plotArea.innerRadiusForSpeedometer)/100*_}catch(h){Ae(V,"initChartRadius",h)}};function ce(h){try{return h=="height"?`translate(${u/2},${L/2+_/2})`:`translate(${u/2},${s-60})`}catch(k){return Ae(V,"centerTranslation",k),""}}const ne=()=>{try{let h=t[0].data[0].value;h<0?(R=0,g=h):(R=h,g=0),n.customScaling.customScalingtoggle?U=100:U=rt(n.plotArea.ticks)}catch(h){Ae(V,"initSpeedometerData",h)}},ae=()=>{try{B=[];let h=rt(n.plotArea.ticks);if(n.customScaling.customScalingtoggle){for(let k=1;k<=h;k++){let o=n.customScaling[`share${k}`];if(B.length<100)for(let d=0;d<o;d++)B.push(n.customScaling[`division${k}`])}if(B.length<101)for(let k=B.length;k<100;k++)B.push(Re.black)}else if(n.colorScale.showColor==Ta.none){const k=t[0].properties?.color??"#bac8de";for(let o=1;o<=h;o++)B.push(k)}else if(n.colorScale.showColor==Ta.discrete)for(let k=1;k<=h;k++)B.push(n.colorScale["division"+k]);else{let k=n.colorScale.startColor,o=n.colorScale.endColor;const d=v.scaleLinear().domain([0,h]).range([k,o]);for(let i=0;i<h;i++)B.push(d(i))}}catch(h){Ae(V,"initColorTheme",h)}},ue=(h,k,o)=>{try{let d=[],i=Math.abs(h)-Math.abs(k),y=Math.abs(i)/o,T=k>0?0:k;d.push(T);for(let a=0;a<o-1;a++)T+=parseFloat(y.toFixed(5)),T.toFixed(5)<=Math.abs(h)&&d.push(T);return d.push(d.includes(h)?0:h),d}catch(d){return Ae(V,"setTickValues",d),[]}},ge=()=>{try{switch(n.plotArea.dataLabelsOptions){case _t.automatic:W=be();break;case _t.startOnly:W=[g];break;case _t.endOnly:let k=Array(U).fill("");k[U]=R,W=k;break;case _t.startAndEndBoth:let o=Array(U).fill("");o[U]=R,o[0]=g,W=o;break;case _t.none:W=[];break}}catch(h){Ae(V,"setDataLabelsOptions",h)}},be=()=>{try{let h,k=rt(n.plotArea.ticks),o=ue(R,g,U);if(n.customScaling.customScalingtoggle){let d=Array(100).fill("");d[0]=g;let i=0;for(let y=1;y<=k;y++){let T=parseInt(n.customScaling[`share${y}`]);if(i+=T,i>=100)break;d[i]=o[i]}d[99]=R,h=d}else h=o;return h}catch(h){return Ae(V,"initTicksValues",h),[]}},pe=()=>{try{let k=function(o,d){try{let i=function(fe){try{return fe*Math.PI/180}catch($e){return Ae(V,"deg2rad",$e),0}},y=function(fe){try{let $e;for($e in fe)ye[$e]=fe[$e];m=ye.maxAngle-ye.minAngle,re=Math.round(_*ye.pointerHeadLengthPercent),Le=v.scaleLinear().range([0,1]).domain([ye.minValue,ye.maxValue]),me=v.arc().innerRadius(A).outerRadius(_).startAngle((Ue,Ye)=>{let Pe=1/ye.majorTicks*Ye;return i(ye.minAngle+Pe*m)}).endAngle((Ue,Ye)=>{let Pe=1/ye.majorTicks*(Ye+1);return i(ye.minAngle+Pe*m)})}catch($e){Ae(V,"configure",$e)}},T=function(fe,$e){try{if($e===0){S.append("g").attr("class","arc").attr("transform",D).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(B).enter().append("path").attr("fill",ve=>ve).attr("stroke",ve=>ve).attr("d",me);let we=R,Ce=S.append("g").attr("class","label").attr("transform",D);if(Ce.selectAll("text").data(W).enter().append("text").attr("transform",function(ve,F){let le=m/ye.majorTicks*F;return"rotate("+(ye.minAngle+le)+") translate(0,"+(ye.labelInset-_)+")"}).attr("text-anchor","middle").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==Re.white?n.plotArea.dataLabelValueColor:"none").attr("font-style",n.plotArea.dataLabelValueFontStyle.includes(oe.italic)?oe.italic:"").attr("text-decoration",n.plotArea.dataLabelValueFontStyle.includes(oe.underline)?oe.underline:"").attr("font-weight",n.plotArea.dataLabelValueFontStyle.includes(oe.bold)?oe.bold:"").attr("font-family",n.plotArea.dataLabelValueFontFamily).text(ve=>n.plotArea.dataLabelNumberFormat==",.0%"?K=Math.round(ve/we*100)+"%":qe(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(ve)).attr("visibility",ve=>ve===""?"hidden":"visible"),n.animation.animationEnabled){const ve=n.animation.animationDuration,F=et[n.animation.animationEffect];Ce.selectAll("text").attr("opacity",0).attr("transform",function(le,he){const te=m/ye.majorTicks*he;return`rotate(${ye.minAngle+te}) translate(0, ${ye.labelInset-_+20})`}).transition().duration(ve).ease(F).attr("opacity",1).attr("transform",function(le,he){const te=m/ye.majorTicks*he;return`rotate(${ye.minAngle+te}) translate(0, ${ye.labelInset-_})`})}}n.pointerValue.showPointerValue&&x.length===2&&G(D);let Ue=[[ye.pointerWidth/2,0],[0,-re],[-(ye.pointerWidth/2),0],[0,ye.pointerTailLength],[ye.pointerWidth/2,0]],Ye=v.line().curve(v.curveLinear);ie=S.append("g").data([Ue]).attr("class","pointer").attr("transform",D).append("path").attr("d",$e>0?Ye:null).attr("transform","rotate("+ye.minAngle+")").attr("fill",n.plotArea.pointerColor).on("mousemove",(Ee,we)=>{yt([{key:`${t[$e].data[0].legend}`,value:n.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[$e].data[0].value/ze[ze.length-1]*100)+"%":qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(t[$e].data[0].value)}],n,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{ot()}),ie.selectAll("text").append("text").text(ye.maxValue),a(fe===void 0?0:fe)}catch(Ue){Ae(V,"gauge.render",Ue)}},a=function(fe,$e){try{$e!==void 0&&y($e);let Ue=Le(fe),Ye=ye.minAngle+Ue*m;ie.transition().duration(n.animation.animationEnabled?n.animation.animationDuration:0).ease(et[n.animation.animationEffect]).attr("transform","rotate("+Ye+")")}catch(Ue){Ae(V,"gauge.update",Ue)}},m,N,re,K,me,Le,ze,Se,ie,De,ye={clipWidth:u,clipHeight:L,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:rt(n.plotArea.pointerHeadLength)/10,minValue:g,maxValue:R,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:U,labelFormat:fe=>qe(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(fe),labelInset:-5};return P.configure=y,P.render=T,P.update=a,y(d),P}catch(i){Ae(V,"gauge",i)}}("#power-gauge",{clipWidth:u,clipHeight:L,ringWidth:2.75*rt(n.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:R,transitionMs:0});if(x.length>0)for(let o=0;o<x.length;o++)k.render(Q(x[o],o),o)}catch(h){Ae(V,"initSpeedometer",h)}};function Q(h,k){try{let o=R,d=h.data[0].value;return o<0&&d>0||o>0&&d<0?0:o<0&&d<0&&o>d?o:o<0&&d<0&&o<d||o>d?d:o}catch(o){return Ae(V,"setPointerofSpeedometer",o),0}}function G(h){try{let k="";if(n.pointerValue.kpiAlias)k=n.pointerValue.kpiAliasText;else switch(n.pointerValue.connectorKPIforSpeedometer){case Oa.PointerValue:k="Pointer Value";break;case Oa.Absolute:k="Absolute Value";break;case Oa.CAGR:k="CAGR";break;case Oa.PercentageGrowth:k="Percentage Growth";break}let o=n.pointerValue.pointerValueFontStyle;S.selectAll(".pointerValueText").remove(),S.append("g").attr("class","pointerValueText").attr("transform",h).selectAll("text").data(["chartData.dataArray[1].maximumMeasure"]).enter().append("text").attr("dy","24").attr("text-anchor","middle").attr("font-size",n.pointerValue.pointerValueFontSize).attr("fill",n.pointerValue.pointerValueColor!==Re.white?n.pointerValue.pointerValueColor:"none").attr("font-style",o.includes(oe.italic)?oe.italic:"").attr("text-decoration",o.includes(oe.underline)?oe.underline:"").attr("font-weight",o.includes(oe.bold)?oe.bold:"").attr("font-family",n.pointerValue.pointerValueFontFamily).text(i=>`${k}: ${!n.pointerValue.pointerValueAlias&&i!=0?M(t[0].data[0].value,t[1].data[0].value):n.pointerValue.pointerValueAliasText}`).attr("visibility",n.plotArea.dataLabels?"visible":"hidden")}catch(k){Ae(V,"setPointerValueText",k)}}function M(h,k){try{let o=h-k,d=1,i=parseInt(n.pointerValue.connectorKPIforSpeedometer),y,T;const a=n.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:o=k;break;case 2:o=Math.abs(o);break;case 3:return y=`.${a}%`,o=Math.pow(k/h,1/d)-1,T=v.format(y)(o),T;case 4:return y=`.${a}%`,o=Math.round(k/h*100-100)/100,T=v.format(y)(o),T}return isNaN(o)&&(o=0),qe(n.pointerValue.pointerValueDisplayUnits,n.pointerValue.pointerValueNumberFormat,a)(o)}catch(o){return Ae(V,"connectorNumberFormat",o),""}}return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:c,id:r,style:{width:"100%",height:"100%"}})})};function Na(t,e,r){console.error(`[${t}][${e}]`,r)}const Sr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:c,tooltipFormatter:x})=>{const n=Me.useRef(),l=Lt(t);let s,p,f,L=40,u=jt,S=[0,0],b,_,A,R,g,B;Me.useEffect(()=>{U()},[e]);const U=()=>{({chartFormatOptions:s,svg:R,width:p,height:f}=qt(n,e)),W(),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:B,chartTitleHeight:L}=$a(s,p,f,S,u),S=Ua(s,l),Xt(n,p,f,s),A=oa(R,u),Zt(n,L,p,s),Ya(s,R,l,p,f,B,L,r,u,ct.hollowCircle,!1,c),D()},W=()=>{try{g=0,l.forEach($=>{g+=$.data[0].value})}catch($){Na("RadialBarChart.tsx","loopOverChartData",$)}},P=$=>{try{switch(s.plotArea.dataLabelsOptions){case _t.automatic:return $.map((ce,ne)=>({...ce,index:ne}));case _t.startOnly:return[{...$[0],index:0}];case _t.endOnly:return[{...$[$.length-1],index:$.length-1}];case _t.startAndEndBoth:return[{...$[0],index:0},{...$[$.length-1],index:$.length-1}];case _t.none:return[]}}catch(Z){return Na("RadialBarChart.tsx","getModifiedDataForLabels",Z),$}},D=()=>{try{let $=function(Se,ie){try{const De=v.interpolate(0,d(Math.abs(Se.data[0].value)));return ye=>re({...Se,endAngle:De(ye)},ie)}catch(De){Na("RadialBarChart.tsx","arcTween",De)}},Z=function(Se){try{return Se*180/M}catch(ie){Na("RadialBarChart.tsx","radTodeg",ie)}},ce=function(Se){try{return Se*Math.PI/180}catch(ie){Na("RadialBarChart.tsx","degToRad",ie)}},ne=function(Se){try{return h+(m-(Se+1))*(N+k)}catch(ie){Na("RadialBarChart.tsx","getInnerRadius",ie)}},ae=function(Se){try{return ne(Se)+N}catch(ie){Na("RadialBarChart.tsx","getOuterRadius",ie)}},ue=l.length>1?v.max(l,Se=>Se.data[0].value)*1.1:t[0].data[0].value*1.1,ge=s.plotArea.dataLabelValueFontStyle,be=qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(ue),pe=s.plotArea.axialAxis?zt(be,rt(s.plotArea.axialAxisDataLabelFontSize),s.plotArea.axialAxisDataLabelFontFamily).width+10:20;const Q=Math.min(b*.5,_*.5)-pe;let G=A.append("g").attr("transform",V()).attr("width",_).attr("height",b);const M=Math.PI,h=l.length>1?10:70,k=rt(s.plotArea.arcPadding),o=rt(s.plotArea.axialTicks);let d=v.scaleLinear().domain([0,ue]).range([0,ce(360)]),i=d.ticks(o);i[i.length-1]==ue&&i.pop();let y=i,T=l.map((Se,ie)=>Se.data[0].legend),a=l.reduce((Se,ie)=>Se+ie.data[0].value,0);const m=T.length,N=(Q-h-m*k)/m;let re=v.arc().innerRadius((Se,ie)=>ne(ie)).outerRadius((Se,ie)=>ae(ie)).startAngle(0).endAngle(Se=>Se.endAngle),K=v.arc().innerRadius((Se,ie)=>ne(ie)).outerRadius((Se,ie)=>ae(ie)).startAngle(0).endAngle(ce(360)),me=G.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");s.plotArea.axialGrid&&me.append("circle").attr("r",(Se,ie)=>ae(ie)+k).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let Le=G.append("g").attr("class","a axis").selectAll("g").data(y).enter().append("g").attr("transform",Se=>"rotate("+(Z(d(Se))-90)+")");s.plotArea.axialGrid&&Le.append("line").attr("x2",Q).attr("stroke","#a9a9a9").attr("stroke-width",1),Le.append("text").attr("x",Q+10).attr("class","text-xs text-gray-600").style("text-anchor",Se=>d(Se)>=M&&d(Se)<2*M?"end":null).attr("transform",Se=>"rotate("+(90-Z(d(Se)))+","+(Q+10)+",0)").text(Se=>qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(Se)).attr("fill",s.plotArea.axialAxisDataLabelColor!==Re.white?s.plotArea.axialAxisDataLabelColor:"none").style("font-size",s.plotArea.axialAxisDataLabelFontSize).style("font-family",s.plotArea.axialAxisDataLabelFontFamily).attr("font-style",s.plotArea.axialAxisDataLabelFontStyle.includes(oe.italic)?oe.italic:"").attr("text-decoration",s.plotArea.axialAxisDataLabelFontStyle.includes(oe.underline)?oe.underline:"").attr("font-weight",s.plotArea.axialAxisDataLabelFontStyle.includes(oe.bold)?oe.bold:"").attr("visibility",s.plotArea.axialAxis?"visible":"hidden");let ze=G.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",Se=>Se.data[0].legend.replaceAll(" ","-")).attr("data-series-id",Se=>Se.properties.legendUniqueId??Se.data[0].legend).attr("data-dim-value",Se=>Se.data[0].legend).attr("fill",Se=>Se.properties.color).attr("d",(Se,ie)=>re({...Se,endAngle:0},ie)).on("mousemove",(Se,ie)=>{yt([{key:s.yAxisTitle.yAxisTitleText,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(ie.data[0].value/a)*100).toFixed(rt(s.toolTip.toolTipDecimalPrecision))+"%":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ie.data[0].value)},{key:"Legend",value:ie.properties.alias}],s,void 0,ie.properties,gt(x,String(ie.data[0]?.legend??""),ie.properties))}).on("mouseout",()=>{ot()});if(s.animation.animationEnabled?ze.transition().duration(s.animation.animationDuration).ease(et[s.animation.animationEffect]).attrTween("d",$):ze.attr("d",(Se,ie)=>re({...Se,endAngle:d(Math.abs(Se.data[0].value))},ie)),s.plotArea.dataLabels){const Se=qi(P(t),s,De=>De?.data?.[0]?.value??0),ie=G.selectAll(".arc-label-"+r).data(Se).enter().append("text").attr("class","arc-label-"+r).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(De,ye)=>(ae(De.index??ye)-ne(De.index??ye))/1.75);ie.append("textPath").attr("xlink:href",(De,ye)=>`#arc-path-${De.index??ye}-`+r).style("startOffset","50%").attr("hoverId",De=>De.legend.replaceAll(" ","-")).text(De=>`  ${De.properties.alias}
150
-  ${s.plotArea.dataLabelValue?qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormat,s.plotArea.dataLabelDecimalPrecision)(De.data[0].value):""}`).attr("fill",s.plotArea.dataLabelValueColor!==Re.white?s.plotArea.dataLabelValueColor:"none").style("font-size",s.plotArea.dataLabelValueFontSize).style("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-style",ge.includes(oe.italic)?oe.italic:"").attr("text-decoration",ge.includes(oe.underline)?oe.underline:"").attr("font-weight",ge.includes(oe.bold)?oe.bold:"").on("mousemove",(De,ye)=>{yt([{key:s.yAxisTitle.yAxisTitleText,value:qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)(ye.data[0].value)},{key:"Legend",value:ye.properties.alias}],s,De,ye.properties,gt(x,String(ye.data[0]?.legend??""),ye.properties))}).on("mouseout",()=>{ot()}),s.animation.animationEnabled&&ie.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(et[s.animation.animationEffect]).attr("opacity",1),ze.each((De,ye)=>{G.append("path").attr("id",`arc-path-${ye}-`+r).attr("d",K(De,ye)).attr("fill","none").attr("stroke","none")})}}catch($){Na("RadialBarChart.tsx","initRadialBarChart",$)}},V=()=>{try{return`translate(${_/2},${b/2})`}catch($){Na("RadialBarChart.tsx","getPiePosition",$)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},pa="WordCloud.tsx",Fr=({data:{ChartData:t},formatOptions:e,chartId:r,tooltipFormatter:c})=>{const x=Me.useRef();let n=Lt(t),l,s,p,f=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=jt,b,_,A,R,g,B=0;Me.useEffect(()=>{U()},[e]);const U=()=>{({chartFormatOptions:l,svg:R,width:s,height:p}=qt(x,e)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=ii(l,p,s),Xt(x,s,p,l),A=oa(R,S),Zt(x,u,s,l),W(),P()},W=()=>{try{B=0,n=n.map(D=>{let V=D.data[0].value;return B+=V,l.plotArea.hideZeroValues&&V==0?null:(V<f&&(f=V),V>L&&(L=V),D)}),n=n.filter(D=>D!==null),g=v.scaleLinear().domain([f,L]).range([12,70])}catch(D){Ae(pa,"calculateWordCloudData",D)}},P=()=>{try{let D=function(ce){try{A.append("g").attr("transform","translate("+Z.size()[0]/2+","+Z.size()[1]/2+")").selectAll("text").data(ce).enter().append("text").attr("font-size",function(ne){try{return g(ne.data[0].value)+"px"}catch(ae){return Ae(pa,"draw-font-size",ae),"12px"}}).attr("text-anchor","middle").style("font-family",l.text.textFontFamily).attr("fill",function(ne){try{return ne.properties.color!==Re.white?ne.properties.color:"none"}catch(ae){return Ae(pa,"draw-fill",ae),"none"}}).attr("transform",function(ne){try{return"translate("+[ne.x,ne.y]+")rotate("+ne.rotate+")"}catch(ae){return Ae(pa,"draw-transform",ae),""}}).text(function(ne){try{return ne.properties.alias}catch(ae){return Ae(pa,"draw-text",ae),""}}).attr("data-series-id",ne=>ne.properties.legendUniqueId??ne.properties.alias).attr("data-dim-value",ne=>ne.properties.alias).on("mousemove.text",(ne,ae)=>{try{yt([{key:ae.properties.alias,value:qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(ae.data[0].value)},{key:ae.properties.measureUniqueId,value:B}],l,void 0,ae.properties,gt(c,String(ae.properties.alias??""),ae.properties))}catch(ue){Ae(pa,"draw-mousemove",ue)}}).on("mouseout.text",()=>{try{ot()}catch(ne){Ae(pa,"draw-mouseout",ne)}})}catch(ne){Ae(pa,"draw",ne)}},V=l.text.textSpacing,$=l.text.textRotation,Z=gl().size([_,b]).words(n).padding(V).rotate(function(){try{return Math.round(Math.random())*$}catch(ce){return Ae(pa,"rotate",ce),0}}).random(()=>.5).font(l.text.textFontFamily).fontWeight("bolder").fontSize(function(ce){try{return g(ce.data[0].value)}catch(ne){return Ae(pa,"fontSize",ne),12}}).text(function(ce){try{return ce.properties.alias}catch(ne){return Ae(pa,"text",ne),""}}).on("end",D);Z.start()}catch(D){Ae(pa,"drawWordCloudChart",D)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:x,id:r,style:{width:"100%",height:"100%"}})})},wr=({data:t,formatOptions:e,chartId:r})=>{const c=Me.useRef();let x=Lt(t),n,l,s,p=40,f=jt,L,u,S,b=[0,0],_,A;Me.useEffect(()=>{R()},[e]);const R=()=>{({chartFormatOptions:n,svg:A,width:l,height:s}=qt(c,e)),b=B(),{margins:f,innerHeight:L,innerWidth:u,legendListWidth:S,chartTitleHeight:p}=$a(n,l,s,b,f,!0),Xt(c,l,s,n),_=oa(A,f),Zt(c,p,l,n),g(),U()},g=()=>{try{let W=n.plotArea.dataLabelNameFontStyle,P=n.plotArea.dataLabelValueFontStyle,D=_.attr("class","vennContainer");D&&D.datum(t).call(Tl.VennDiagram().width(u).height(L)),D&&D.selectAll(".venn-circle path").style("fill-opacity",n.plotArea.opacity),n.plotArea.dataLabelName?(D&&D.selectAll(".venn-circle text").html(""),D&&D.selectAll(".venn-circle text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",W.includes(oe.italic)?oe.italic:"").attr("text-decoration",W.includes(oe.underline)?oe.underline:"").style("font-weight",W.includes(oe.bold)?oe.bold:"").html(V=>V.label).attr("visibility",n.plotArea.dataLabelName?"visible":"hidden")):(D&&D.selectAll(".venn-circle text").style("visibility","hidden"),D&&D.selectAll(".venn-circle text").html("")),n.plotArea.dataLabelValue&&D&&D.selectAll(".venn-circle text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==Re.white?n.plotArea.dataLabelValueColor:"none").style("font-style",P.includes(oe.italic)?oe.italic:"normal").attr("text-decoration",P.includes(oe.underline)?oe.underline:"none").style("font-weight",P.includes(oe.bold)?oe.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(V=>V.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+v.format(n.plotArea.dataLabelNumberFormat)(V.actualValue):"").attr("visibility",n.plotArea.dataLabelValue?"visible":"hidden"),n.plotArea.intersectionLabelVisibility?(D&&D.selectAll(".venn-intersection text").html(""),D&&D.selectAll(".venn-intersection text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",W.includes(oe.italic)?oe.italic:"").attr("text-decoration",W.includes(oe.underline)?oe.underline:"").style("font-weight",W.includes(oe.bold)?oe.bold:"").html(V=>V.label).attr("visibility",n.plotArea.intersectionLabelVisibility?"visible":"hidden")):(D&&D.selectAll(".venn-intersection text").style("visibility","hidden"),D&&D.selectAll(".venn-intersection text").html("")),n.plotArea.intersectionValueVisibility&&D&&D.selectAll(".venn-intersection text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==Re.white?n.plotArea.dataLabelValueColor:"none").style("font-style",P.includes(oe.italic)?oe.italic:"normal").attr("text-decoration",P.includes(oe.underline)?oe.underline:"none").style("font-weight",P.includes(oe.bold)?oe.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(V=>V.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+v.format(n.plotArea.dataLabelNumberFormat)(V.actualValue):"").attr("visibility",n.plotArea.intersectionValueVisibility?"visible":"hidden"),D&&D.selectAll(".venn-circle path").style("fill",V=>V.properties?V.properties.color:null),D&&D.selectAll("g").on("mousemove",function(V,$){yt([{key:$.label,value:qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)($.size)}],n,void 0,$.properties),v.select(this).transition("tooltip").duration(10).selectAll("path").style("stroke-dasharray","5,5").style("stroke-opacity",1).style("stroke","black")}).on("mouseout",function(V,$){ot();var Z=v.select(this).transition("tooltip").duration(400);Z.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(W){Ae("VennChart.tsx","drawVennDiagramChart",W)}},B=()=>{try{let W=0,P=0;return x.forEach(D=>{if(D.legendDisplay){let V=zt(D.legendDisplay+" : "+D.actualValue,rt(n.legends.legendFontSize),n.legends.legendFontFamily);W=Math.max(W,V.width),P=Math.max(P,V.height)}}),[W,P]}catch(W){return Ae("VennChart.tsx","calculateLegendsMaxPossibleWidth",W),[0,0]}},U=()=>{try{let W=n.legends.legendPosition,P=n.legends.legendAlignmentTopBottom,D=n.legends.legendAlignment;switch(W){case je.none:break;case je.right:ua(A,x,l-S-25,p+5,S+15,s-p-10,W,D,ct.none,n,r,!0);break;case je.top:ua(A,x,5,p+5,l-10,30,W,P,ct.none,n,r,!0);break;case je.left:ua(A,x,5,f.top,S+15,s-p-10,W,D,ct.none,n,r,!0);break;case je.bottom:ua(A,x,5,s-35,l-10,30,W,P,ct.none,n,r,!0);break}}catch(W){Ae("VennChart.tsx","initLegendListWithTotalValueAllowance",W)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:c,id:r,style:{width:"100%",height:"100%"}})})},Dr=({formatOptions:t,data:e,chartId:r,onElementClick:c,vfxPickModeActive:x,tooltipFormatter:n})=>{if(!e)return null;let l=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],s=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const p=Me.useRef(),f=Me.useRef(c);f.current=c;const L=Me.useRef(x);L.current=x;let u,S,b,_=40,A=jt,R,g,B,U,W=li.left,P=0,D=!1,V=new Map,$=new Map,Z=.8,ce=.8;Me.useEffect(()=>{ne()},[t]);const ne=()=>{({chartFormatOptions:u,svg:U,width:S,height:b}=qt(p,t)),{margins:A,chartTitleHeight:_,innerHeight:R,innerWidth:g}=ii(u,b,S),ae(),Xt(p,S,b,u),B=oa(U,A),Zt(p,_,S,u),be()},ae=()=>{try{Z=rt(u.nodes.nodesFillOpacity),ce=rt(u.links.linksFillOpacity),s.forEach(h=>{h.totalValue=0}),s.forEach(h=>l.forEach(k=>(h.name==k.source||h.name==k.target)&&(h.totalValue=(h.totalValue||0)+k.value))),s=s.filter(h=>h.totalValue!=0),l=l.filter(h=>h.value!=0);let G=pe(l),M=new Map;G.forEach(h=>{h.nodes.forEach(k=>{M.set(k,h.layer)})}),s.forEach(h=>{let k=M.get(h.name);V.set(k,(V.get(k)||0)+h.totalValue)}),s.forEach(h=>{$.set(h.name,h.totalValue/V.get(M.get(h.name))*100)}),ue(G)}catch(G){Ae("SankeyChart.tsx","prepareDataForSankey",G)}},ue=G=>{try{D=u.nodes.nodesLabelWrap,W=u.nodes.nodesLabelVisibility?u.nodes.sankeyChartType:"None";let M="",h=0;s.forEach(d=>{M=d.name.length>M.length?d.name:M,h=d.totalValue.toString().length>h.toString().length?d.totalValue:h});let k=zt(M,rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily),o=zt(qe(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(h),rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily);P=Math.max(k.width,o.width)+6,D&&(P=Math.min(g*.1,P))}catch(M){Ae("SankeyChart.tsx","calculateMaxNodeValueWidth",M)}},ge=(G,M)=>{try{let h=u.nodes.spacing!==void 0?rt(u.nodes.spacing)*1.5:15,k=u.nodes.sankeyNodeWidth!==void 0?u.nodes.sankeyNodeWidth:10,o=[],d=[];switch(W){case li.center:o=[1,5],d=[g,R];break;case li.right:o=[1,5],d=[g-P,R];break;case li.left:o=[P,5],d=[g,R];break;default:o=[1,5],d=[g,R];break}return wi.sankey().nodeId(y=>y.name).nodeAlign(wi.sankeyJustify).nodeWidth(k).nodePadding(h).extent([o,d]).nodeSort(null)({nodes:G.map(y=>Object.assign({},y)),links:M.map(y=>Object.assign({},y))})}catch(h){return Ae("SankeyChart.tsx","getsankey",h),{nodes:[],links:[]}}},be=()=>{try{let G=function(){try{const T={};o.forEach(a=>{const m=a.x0;T[m]||(T[m]=[]),T[m].push(a)}),Object.keys(T).forEach(a=>{const m=T[a];if(m.length===0)return;m.sort((Le,ze)=>Le.y0-ze.y0);const N=m[0],re=m[m.length-1],K=N.y1-N.y0,me=re.y1-re.y0;if(N.y0=0,N.y1=K,re.y1=R,re.y0=R-me,m.length>2){const Le=m.slice(1,m.length-1),ze=re.y0-N.y1,Se=v.sum(Le,ye=>ye.y1-ye.y0),ie=(ze-Se)/(Le.length+1);let De=N.y1+ie;Le.forEach(ye=>{const fe=ye.y1-ye.y0;ye.y0=De,ye.y1=De+fe,De+=fe+ie})}})}catch(T){Ae("SankeyChart.tsx","centerAlignNodesByLayer",T)}},M=function(){try{o.forEach(T=>{let a=0,m=0;T.sourceLinks.forEach(N=>{N.sy=a,a+=N.width}),T.targetLinks.forEach(N=>{N.ty=m,m+=N.width})})}catch(T){Ae("SankeyChart.tsx","arrangeFlows",T)}},h=function(T){return function(a){try{const m=a.source.x1,N=a.source.y0+a.sy+a.width/2,re=a.target.x0,K=a.target.y0+a.ty+a.width/2,me=re-m,Le=m+me*T,ze=re-me*T;return`M${m},${N} C${Le},${N} ${ze},${K} ${re},${K}`}catch(m){return Ae("SankeyChart.tsx","sankeyLinkCustom",m),""}}},k=u.nodes.curviness!==void 0?u.nodes.curviness!=="0"?u.nodes.curviness:.1:.5;const{nodes:o,links:d}=ge(s,l);M(),G(),M(),M();const i=B.append("g").selectAll("rect").data(o).enter().append("rect").style("fill-opacity",Z).attr("id",T=>"Node"+T.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none").attr("stroke-width",u.nodes.nodesBorderVisibility?u.nodes.nodesBorderThickness:0).attr("x",T=>T.x0).attr("y",T=>T.y0).attr("height",T=>T.y1-T.y0).attr("width",T=>T.x1-T.x0).attr("fill",T=>T.color?T.color:Re.white).on("mousemove",function(T,a){try{u.toolTip.toolTipVisibility&&yt([{key:a.name.split("~$~")[1],value:u.toolTip.toolTipNumberFormat==",.0%"?$.get(a.name)+"%":qe(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerShape:"square",markerColor:a.color},gt(n,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),B.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),B.selectAll(".sankey-nodes-texts").style("opacity","0"),B.selectAll(".sankey-links").style("stroke-opacity",.1),B.select(`#Node${a.index}`).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",Z).style("cursor","pointer"),B.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(m=>{B.select(`#Node${m.target.index}`).style("fill-opacity",Z).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Link${m.index}`).style("stroke-opacity",ce),B.select(`#Label${m.target.index}`).style("opacity",1)}),a.targetLinks.forEach(m=>{B.select(`#Node${m.source.index}`).style("fill-opacity",Z).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Link${m.index}`).style("stroke-opacity",ce),B.select(`#Label${m.source.index}`).style("opacity",1)})}catch(m){Ae("SankeyChart.tsx","Nodes.onMouseMove",m)}}).on("mouseout",function(T){try{B.selectAll(".sankey-nodes").style("fill-opacity",Z).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.selectAll(".sankey-links").style("stroke-opacity",ce),B.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&ot()}catch(a){Ae("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(lt.SeriesId,T=>String(T.name??"")).attr(lt.DimValue,T=>String(T.name??"")).on("click",Tt(L,f,(T,a)=>{const m=String(a.name??"");return{seriesId:m,dimValue:m,legendUniqueId:m,seriesDisplayName:m.includes("~$~")?m.split("~$~")[1]:m}}));if(B.append("g").attr("fill","none").selectAll("g").data(d).enter().append("g").style("mix-blend-mode","multiply").append("path").attr("class","sankey-links").attr("stroke-opacity",ce).attr("id",T=>"Link"+T.index).attr("d",h(k)).attr("stroke",T=>u.links.linksColor==="Source"?T.source.color:T.target.color).attr("stroke-width",T=>Math.max(1,T.width)).on("mousemove",function(T,a){try{B.selectAll(".sankey-links").style("stroke-opacity",.1),B.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),B.selectAll(".sankey-nodes-texts").style("opacity","0"),B.select(`#Link${a.index}`).style("stroke-opacity",ce).style("cursor","pointer"),B.select(`#Node${a.target.index}`).style("fill-opacity",Z).style("Stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Node${a.source.index}`).style("fill-opacity",Z).style("Stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Label${a.target.index}`).style("opacity",1),B.select(`#Label${a.source.index}`).style("opacity",1),u.toolTip.toolTipVisibility&&yt([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:qe(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerColor:a.source.color,markerShape:"circle"},gt(n,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(m){Ae("SankeyChart.tsx","link.onMouseMove",m)}}).on("mouseout",function(T){try{u.toolTip.toolTipVisibility&&ot(),B.selectAll(".sankey-nodes").style("fill-opacity",Z),B.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.selectAll(".sankey-links").style("stroke-opacity",ce),B.selectAll(".sankey-nodes-texts").style("opacity","1"),v.select(this).select("rect").style("pointer-events","all"),v.select(this).style("cursor","none")}catch(a){Ae("SankeyChart.tsx","link.onMouseOut",a)}}),u.nodes.nodesLabelVisibility)try{const T=B.append("g").attr("font-family",u.nodes.nodesLabelFontFamily).attr("font-size",u.nodes.nodesLabelFontSize).style("font-style",u.nodes.nodesLabelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(oe.bold)?oe.bold:"").attr("display",u.nodes.nodesLabelVisibility?"visible":"none").selectAll("text").data(o).enter().append("g").attr("class","sankey-nodes-texts").attr("id",a=>"Label"+a.index).each(function(a){try{if(u.nodes.sankeyChartType!=="None"){const m=u.nodes.sankeyNodeWidth,N=W===li.center;v.select(this).append("foreignObject").attr("x",Q(a).x).attr("y",Q(a).y-16).attr("width",me=>N?m:P).attr("height",20).append("xhtml:div").style("white-space",N||D?"nowrap":"normal").style("overflow",N||D?"hidden":"visible").style("text-overflow",N||D?"ellipsis":"clip").style("display","block").style("max-width",me=>N?"100px":P+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(oe.bold)?oe.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",me=>$.get(me.name)>0?me.alias?me.alias.includes("~$~")?me.alias.split("~$~")[1]:me.alias:me.name.includes("~$~")?me.name.split("~$~")[1]:me.name:"").text(me=>$.get(me.name)>0?me.alias?me.alias.includes("~$~")?me.alias.split("~$~")[1]:me.alias:me.name.includes("~$~")?me.name.split("~$~")[1]:me.name:""),v.select(this).append("foreignObject").attr("x",Q(a).x).attr("y",Q(a).y).attr("width",me=>N?m:P).attr("height",20).append("xhtml:div").style("white-space",N||D?"nowrap":"normal").style("overflow",N||D?"hidden":"visible").style("text-overflow",N||D?"ellipsis":"clip").style("display","block").style("max-width",me=>N?"100px":P+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(oe.bold)?oe.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",me=>$.get(me.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(me.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":qe(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(me.totalValue):"").text(me=>$.get(me.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(me.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":qe(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(me.totalValue):"")}}catch(m){Ae("SankeyChart.tsx","texts.each",m)}})}catch(T){Ae("SankeyChart.tsx","inittree.texts",T)}}catch(G){Ae("SankeyChart.tsx","inittree",G)}};function pe(G){try{const M=new Map,h=new Map,k=new Set;for(const{source:T,target:a}of G)k.add(T),k.add(a),M.has(a)||M.set(a,new Set),h.has(T)||h.set(T,new Set),M.get(a).add(T),h.get(T).add(a);const o=new Map,d=[];for(const T of k)M.has(T)||(o.set(T,0),d.push(T));for(;d.length>0;){const T=d.shift(),a=o.get(T),m=h.get(T)||[];for(const N of m){const re=a+1;(!o.has(N)||o.get(N)<re)&&(o.set(N,re),d.push(N))}}const i=new Map;for(const[T,a]of o.entries())i.has(a)||i.set(a,[]),i.get(a).push(T);return[...i.entries()].sort((T,a)=>T[0]-a[0]).map(([T,a])=>({layer:T,nodes:a}))}catch(M){return Ae("SankeyChart.tsx","assignNodeLayers",M),[]}}const Q=G=>{try{let M={};const h=Number(u.nodes.sankeyNodeWidth),k=h/2;switch(W){case"Right":M.x=G.x1+6;break;default:case"Left":M.x=G.x0-P;break;case"Center":M.x=G.x0+k-h/2;break}return M.y=(G.y1+G.y0)/2,M}catch(M){return Ae("SankeyChart.tsx","getXandYPositionOfLables",M),{x:0,y:0}}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:p,id:r,style:{width:"100%",height:"100%"}})})},Vr={type:"FeatureCollection",features:[{type:"Feature",id:"AL",properties:{name:"Alabama",value:55},geometry:{type:"Polygon",coordinates:[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],[-85.069935,32.580372],[-84.960397,32.421541],[-85.004212,32.322956],[-84.889196,32.262709],[-85.058981,32.13674],[-85.053504,32.01077],[-85.141136,31.840985],[-85.042551,31.539753],[-85.113751,31.27686],[-85.004212,31.003013],[-85.497137,30.997536],[-87.600282,30.997536],[-87.633143,30.86609],[-87.408589,30.674397],[-87.446927,30.510088],[-87.37025,30.427934],[-87.518128,30.280057],[-87.655051,30.247195],[-87.90699,30.411504],[-87.934375,30.657966],[-88.011052,30.685351],[-88.10416,30.499135],[-88.137022,30.318396],[-88.394438,30.367688],[-88.471115,31.895754],[-88.241084,33.796253],[-88.098683,34.891641],[-88.202745,34.995703],[-87.359296,35.00118]]]}},{type:"Feature",id:"AK",properties:{name:"Alaska",value:87},geometry:{type:"MultiPolygon",coordinates:[[[[-131.602021,55.117982],[-131.569159,55.28229],[-131.355558,55.183705],[-131.38842,55.01392],[-131.645836,55.035827],[-131.602021,55.117982]]],[[[-131.832052,55.42469],[-131.645836,55.304197],[-131.749898,55.128935],[-131.832052,55.189182],[-131.832052,55.42469]]],[[[-132.976733,56.437924],[-132.735747,56.459832],[-132.631685,56.421493],[-132.664547,56.273616],[-132.878148,56.240754],[-133.069841,56.333862],[-132.976733,56.437924]]],[[[-133.595627,56.350293],[-133.162949,56.317431],[-133.05341,56.125739],[-132.620732,55.912138],[-132.472854,55.780691],[-132.4619,55.671152],[-132.357838,55.649245],[-132.341408,55.506844],[-132.166146,55.364444],[-132.144238,55.238474],[-132.029222,55.276813],[-131.97993,55.178228],[-131.958022,54.789365],[-132.029222,54.701734],[-132.308546,54.718165],[-132.385223,54.915335],[-132.483808,54.898904],[-132.686455,55.046781],[-132.746701,54.997489],[-132.916486,55.046781],[-132.889102,54.898904],[-132.73027,54.937242],[-132.626209,54.882473],[-132.675501,54.679826],[-132.867194,54.701734],[-133.157472,54.95915],[-133.239626,55.090597],[-133.223195,55.22752],[-133.453227,55.216566],[-133.453227,55.320628],[-133.277964,55.331582],[-133.102702,55.42469],[-133.17938,55.588998],[-133.387503,55.62186],[-133.420365,55.884753],[-133.497042,56.0162],[-133.639442,55.923092],[-133.694212,56.070969],[-133.546335,56.142169],[-133.666827,56.311955],[-133.595627,56.350293]]],[[[-133.738027,55.556137],[-133.546335,55.490413],[-133.414888,55.572568],[-133.283441,55.534229],[-133.420365,55.386352],[-133.633966,55.430167],[-133.738027,55.556137]]],[[[-133.907813,56.930849],[-134.050213,57.029434],[-133.885905,57.095157],[-133.343688,57.002049],[-133.102702,57.007526],[-132.932917,56.82131],[-132.620732,56.667956],[-132.653593,56.55294],[-132.817901,56.492694],[-133.042456,56.520078],[-133.201287,56.448878],[-133.420365,56.492694],[-133.66135,56.448878],[-133.710643,56.684386],[-133.688735,56.837741],[-133.869474,56.843218],[-133.907813,56.930849]]],[[[-134.115936,56.48174],[-134.25286,56.558417],[-134.400737,56.722725],[-134.417168,56.848695],[-134.296675,56.908941],[-134.170706,56.848695],[-134.143321,56.952757],[-133.748981,56.772017],[-133.710643,56.596755],[-133.847566,56.574848],[-133.935197,56.377678],[-133.836612,56.322908],[-133.957105,56.092877],[-134.110459,56.142169],[-134.132367,55.999769],[-134.230952,56.070969],[-134.291198,56.350293],[-134.115936,56.48174]]],[[[-134.636246,56.28457],[-134.669107,56.169554],[-134.806031,56.235277],[-135.178463,56.67891],[-135.413971,56.810356],[-135.331817,56.914418],[-135.424925,57.166357],[-135.687818,57.369004],[-135.419448,57.566174],[-135.298955,57.48402],[-135.063447,57.418296],[-134.849846,57.407343],[-134.844369,57.248511],[-134.636246,56.728202],[-134.636246,56.28457]]],[[[-134.712923,58.223407],[-134.373353,58.14673],[-134.176183,58.157683],[-134.187137,58.081006],[-133.902336,57.807159],[-134.099505,57.850975],[-134.148798,57.757867],[-133.935197,57.615466],[-133.869474,57.363527],[-134.083075,57.297804],[-134.154275,57.210173],[-134.499322,57.029434],[-134.603384,57.034911],[-134.6472,57.226604],[-134.575999,57.341619],[-134.608861,57.511404],[-134.729354,57.719528],[-134.707446,57.829067],[-134.784123,58.097437],[-134.91557,58.212453],[-134.953908,58.409623],[-134.712923,58.223407]]],[[[-135.857603,57.330665],[-135.715203,57.330665],[-135.567326,57.149926],[-135.633049,57.023957],[-135.857603,56.996572],[-135.824742,57.193742],[-135.857603,57.330665]]],[[[-136.279328,58.206976],[-135.978096,58.201499],[-135.780926,58.28913],[-135.496125,58.168637],[-135.64948,58.037191],[-135.59471,57.987898],[-135.45231,58.135776],[-135.107263,58.086483],[-134.91557,57.976944],[-135.025108,57.779775],[-134.937477,57.763344],[-134.822462,57.500451],[-135.085355,57.462112],[-135.572802,57.675713],[-135.556372,57.456635],[-135.709726,57.369004],[-135.890465,57.407343],[-136.000004,57.544266],[-136.208128,57.637374],[-136.366959,57.829067],[-136.569606,57.916698],[-136.558652,58.075529],[-136.421728,58.130299],[-136.377913,58.267222],[-136.279328,58.206976]]],[[[-147.079854,60.200582],[-147.501579,59.948643],[-147.53444,59.850058],[-147.874011,59.784335],[-147.80281,59.937689],[-147.435855,60.09652],[-147.205824,60.271782],[-147.079854,60.200582]]],[[[-147.561825,60.578491],[-147.616594,60.370367],[-147.758995,60.156767],[-147.956165,60.227967],[-147.791856,60.474429],[-147.561825,60.578491]]],[[[-147.786379,70.245291],[-147.682318,70.201475],[-147.162008,70.15766],[-146.888161,70.185044],[-146.510252,70.185044],[-146.099482,70.146706],[-145.858496,70.168614],[-145.622988,70.08646],[-145.195787,69.993352],[-144.620708,69.971444],[-144.461877,70.026213],[-144.078491,70.059075],[-143.914183,70.130275],[-143.497935,70.141229],[-143.503412,70.091936],[-143.25695,70.119321],[-142.747594,70.042644],[-142.402547,69.916674],[-142.079408,69.856428],[-142.008207,69.801659],[-141.712453,69.790705],[-141.433129,69.697597],[-141.378359,69.63735],[-141.208574,69.686643],[-141.00045,69.648304],[-141.00045,60.304644],[-140.53491,60.22249],[-140.474664,60.310121],[-139.987216,60.184151],[-139.696939,60.342983],[-139.088998,60.359413],[-139.198537,60.091043],[-139.045183,59.997935],[-138.700135,59.910304],[-138.623458,59.767904],[-137.604747,59.242118],[-137.445916,58.908024],[-137.265177,59.001132],[-136.827022,59.159963],[-136.580559,59.16544],[-136.465544,59.285933],[-136.476498,59.466672],[-136.301236,59.466672],[-136.25742,59.625503],[-135.945234,59.663842],[-135.479694,59.800766],[-135.025108,59.565257],[-135.068924,59.422857],[-134.959385,59.280456],[-134.701969,59.247595],[-134.378829,59.033994],[-134.400737,58.973748],[-134.25286,58.858732],[-133.842089,58.727285],[-133.173903,58.152206],[-133.075318,57.998852],[-132.867194,57.845498],[-132.560485,57.505928],[-132.253777,57.21565],[-132.368792,57.095157],[-132.05113,57.051341],[-132.127807,56.876079],[-131.870391,56.804879],[-131.837529,56.602232],[-131.580113,56.613186],[-131.087188,56.405062],[-130.78048,56.366724],[-130.621648,56.268139],[-130.468294,56.240754],[-130.424478,56.142169],[-130.101339,56.114785],[-130.002754,55.994292],[-130.150631,55.769737],[-130.128724,55.583521],[-129.986323,55.276813],[-130.095862,55.200136],[-130.336847,54.920812],[-130.687372,54.718165],[-130.785957,54.822227],[-130.917403,54.789365],[-131.010511,54.997489],[-130.983126,55.08512],[-131.092665,55.189182],[-130.862634,55.298721],[-130.928357,55.337059],[-131.158389,55.200136],[-131.284358,55.287767],[-131.426759,55.238474],[-131.843006,55.457552],[-131.700606,55.698537],[-131.963499,55.616383],[-131.974453,55.49589],[-132.182576,55.588998],[-132.226392,55.704014],[-132.083991,55.829984],[-132.127807,55.955953],[-132.324977,55.851892],[-132.522147,56.076446],[-132.642639,56.032631],[-132.719317,56.218847],[-132.527624,56.339339],[-132.341408,56.339339],[-132.396177,56.487217],[-132.297592,56.67891],[-132.450946,56.673433],[-132.768609,56.837741],[-132.993164,57.034911],[-133.51895,57.177311],[-133.507996,57.577128],[-133.677781,57.62642],[-133.639442,57.790728],[-133.814705,57.834544],[-134.072121,58.053622],[-134.143321,58.168637],[-134.586953,58.206976],[-135.074401,58.502731],[-135.282525,59.192825],[-135.38111,59.033994],[-135.337294,58.891593],[-135.140124,58.617746],[-135.189417,58.573931],[-135.05797,58.349376],[-135.085355,58.201499],[-135.277048,58.234361],[-135.430402,58.398669],[-135.633049,58.426053],[-135.91785,58.382238],[-135.912373,58.617746],[-136.087635,58.814916],[-136.246466,58.75467],[-136.876314,58.962794],[-136.931084,58.902547],[-136.586036,58.836824],[-136.317666,58.672516],[-136.213604,58.667039],[-136.180743,58.535592],[-136.043819,58.382238],[-136.388867,58.294607],[-136.591513,58.349376],[-136.59699,58.212453],[-136.859883,58.316515],[-136.947514,58.393192],[-137.111823,58.393192],[-137.566409,58.590362],[-137.900502,58.765624],[-137.933364,58.869686],[-138.11958,59.02304],[-138.634412,59.132579],[-138.919213,59.247595],[-139.417615,59.379041],[-139.746231,59.505011],[-139.718846,59.641934],[-139.625738,59.598119],[-139.5162,59.68575],[-139.625738,59.88292],[-139.488815,59.992458],[-139.554538,60.041751],[-139.801,59.833627],[-140.315833,59.696704],[-140.92925,59.745996],[-141.444083,59.871966],[-141.46599,59.970551],[-141.706976,59.948643],[-141.964392,60.019843],[-142.539471,60.085566],[-142.873564,60.091043],[-143.623905,60.036274],[-143.892275,59.997935],[-144.231845,60.140336],[-144.65357,60.206059],[-144.785016,60.29369],[-144.834309,60.441568],[-145.124586,60.430614],[-145.223171,60.299167],[-145.738004,60.474429],[-145.820158,60.551106],[-146.351421,60.408706],[-146.608837,60.238921],[-146.718376,60.397752],[-146.608837,60.485383],[-146.455483,60.463475],[-145.951604,60.578491],[-146.017328,60.666122],[-146.252836,60.622307],[-146.345944,60.737322],[-146.565022,60.753753],[-146.784099,61.044031],[-146.866253,60.972831],[-147.172962,60.934492],[-147.271547,60.972831],[-147.375609,60.879723],[-147.758995,60.912584],[-147.775426,60.808523],[-148.032842,60.781138],[-148.153334,60.819476],[-148.065703,61.005692],[-148.175242,61.000215],[-148.350504,60.803046],[-148.109519,60.737322],[-148.087611,60.594922],[-147.939734,60.441568],[-148.027365,60.277259],[-148.219058,60.332029],[-148.273827,60.249875],[-148.087611,60.217013],[-147.983549,59.997935],[-148.251919,59.95412],[-148.399797,59.997935],[-148.635305,59.937689],[-148.755798,59.986981],[-149.067984,59.981505],[-149.05703,60.063659],[-149.204907,60.008889],[-149.287061,59.904827],[-149.418508,59.997935],[-149.582816,59.866489],[-149.511616,59.806242],[-149.741647,59.729565],[-149.949771,59.718611],[-150.031925,59.61455],[-150.25648,59.521442],[-150.409834,59.554303],[-150.579619,59.444764],[-150.716543,59.450241],[-151.001343,59.225687],[-151.308052,59.209256],[-151.406637,59.280456],[-151.592853,59.159963],[-151.976239,59.253071],[-151.888608,59.422857],[-151.636669,59.483103],[-151.47236,59.472149],[-151.423068,59.537872],[-151.127313,59.669319],[-151.116359,59.778858],[-151.505222,59.63098],[-151.828361,59.718611],[-151.8667,59.778858],[-151.702392,60.030797],[-151.423068,60.211536],[-151.379252,60.359413],[-151.297098,60.386798],[-151.264237,60.545629],[-151.406637,60.720892],[-151.06159,60.786615],[-150.404357,61.038554],[-150.245526,60.939969],[-150.042879,60.912584],[-149.741647,61.016646],[-150.075741,61.15357],[-150.207187,61.257632],[-150.47008,61.246678],[-150.656296,61.29597],[-150.711066,61.252155],[-151.023251,61.180954],[-151.165652,61.044031],[-151.477837,61.011169],[-151.800977,60.852338],[-151.833838,60.748276],[-152.080301,60.693507],[-152.13507,60.578491],[-152.310332,60.507291],[-152.392486,60.304644],[-152.732057,60.173197],[-152.567748,60.069136],[-152.704672,59.915781],[-153.022334,59.888397],[-153.049719,59.691227],[-153.345474,59.620026],[-153.438582,59.702181],[-153.586459,59.548826],[-153.761721,59.543349],[-153.72886,59.433811],[-154.117723,59.368087],[-154.1944,59.066856],[-153.750768,59.050425],[-153.400243,58.968271],[-153.301658,58.869686],[-153.444059,58.710854],[-153.679567,58.612269],[-153.898645,58.606793],[-153.920553,58.519161],[-154.062953,58.4863],[-153.99723,58.376761],[-154.145107,58.212453],[-154.46277,58.059098],[-154.643509,58.059098],[-154.818771,58.004329],[-154.988556,58.015283],[-155.120003,57.955037],[-155.081664,57.872883],[-155.328126,57.829067],[-155.377419,57.708574],[-155.547204,57.785251],[-155.73342,57.549743],[-156.045606,57.566174],[-156.023698,57.440204],[-156.209914,57.473066],[-156.34136,57.418296],[-156.34136,57.248511],[-156.549484,56.985618],[-156.883577,56.952757],[-157.157424,56.832264],[-157.20124,56.766541],[-157.376502,56.859649],[-157.672257,56.607709],[-157.754411,56.67891],[-157.918719,56.657002],[-157.957058,56.514601],[-158.126843,56.459832],[-158.32949,56.48174],[-158.488321,56.339339],[-158.208997,56.295524],[-158.510229,55.977861],[-159.375585,55.873799],[-159.616571,55.594475],[-159.676817,55.654722],[-159.643955,55.829984],[-159.813741,55.857368],[-160.027341,55.791645],[-160.060203,55.720445],[-160.394296,55.605429],[-160.536697,55.473983],[-160.580512,55.567091],[-160.668143,55.457552],[-160.865313,55.528752],[-161.232268,55.358967],[-161.506115,55.364444],[-161.467776,55.49589],[-161.588269,55.62186],[-161.697808,55.517798],[-161.686854,55.408259],[-162.053809,55.074166],[-162.179779,55.15632],[-162.218117,55.03035],[-162.470057,55.052258],[-162.508395,55.249428],[-162.661749,55.293244],[-162.716519,55.222043],[-162.579595,55.134412],[-162.645319,54.997489],[-162.847965,54.926289],[-163.00132,55.079643],[-163.187536,55.090597],[-163.220397,55.03035],[-163.034181,54.942719],[-163.373752,54.800319],[-163.14372,54.76198],[-163.138243,54.696257],[-163.329936,54.74555],[-163.587352,54.614103],[-164.085754,54.61958],[-164.332216,54.531949],[-164.354124,54.466226],[-164.638925,54.389548],[-164.847049,54.416933],[-164.918249,54.603149],[-164.710125,54.663395],[-164.551294,54.88795],[-164.34317,54.893427],[-163.894061,55.041304],[-163.532583,55.046781],[-163.39566,54.904381],[-163.291598,55.008443],[-163.313505,55.128935],[-163.105382,55.183705],[-162.880827,55.183705],[-162.579595,55.446598],[-162.245502,55.682106],[-161.807347,55.89023],[-161.292514,55.983338],[-161.078914,55.939523],[-160.87079,55.999769],[-160.816021,55.912138],[-160.931036,55.813553],[-160.805067,55.736876],[-160.766728,55.857368],[-160.509312,55.868322],[-160.438112,55.791645],[-160.27928,55.76426],[-160.273803,55.857368],[-160.536697,55.939523],[-160.558604,55.994292],[-160.383342,56.251708],[-160.147834,56.399586],[-159.830171,56.541986],[-159.326293,56.667956],[-158.959338,56.848695],[-158.784076,56.782971],[-158.641675,56.810356],[-158.701922,56.925372],[-158.658106,57.034911],[-158.378782,57.264942],[-157.995396,57.41282],[-157.688688,57.609989],[-157.705118,57.719528],[-157.458656,58.497254],[-157.07527,58.705377],[-157.119086,58.869686],[-158.039212,58.634177],[-158.32949,58.661562],[-158.40069,58.760147],[-158.564998,58.803962],[-158.619768,58.913501],[-158.767645,58.864209],[-158.860753,58.694424],[-158.701922,58.480823],[-158.893615,58.387715],[-159.0634,58.420577],[-159.392016,58.760147],[-159.616571,58.929932],[-159.731586,58.929932],[-159.808264,58.803962],[-159.906848,58.782055],[-160.054726,58.886116],[-160.235465,58.902547],[-160.317619,59.072332],[-160.854359,58.88064],[-161.33633,58.743716],[-161.374669,58.667039],[-161.752577,58.552023],[-161.938793,58.656085],[-161.769008,58.776578],[-161.829255,59.061379],[-161.955224,59.36261],[-161.703285,59.48858],[-161.911409,59.740519],[-162.092148,59.88292],[-162.234548,60.091043],[-162.448149,60.178674],[-162.502918,59.997935],[-162.760334,59.959597],[-163.171105,59.844581],[-163.66403,59.795289],[-163.9324,59.806242],[-164.162431,59.866489],[-164.189816,60.02532],[-164.386986,60.074613],[-164.699171,60.29369],[-164.962064,60.337506],[-165.268773,60.578491],[-165.060649,60.68803],[-165.016834,60.890677],[-165.175665,60.846861],[-165.197573,60.972831],[-165.120896,61.076893],[-165.323543,61.170001],[-165.34545,61.071416],[-165.591913,61.109754],[-165.624774,61.279539],[-165.816467,61.301447],[-165.920529,61.416463],[-165.915052,61.558863],[-166.106745,61.49314],[-166.139607,61.630064],[-165.904098,61.662925],[-166.095791,61.81628],[-165.756221,61.827233],[-165.756221,62.013449],[-165.674067,62.139419],[-165.044219,62.539236],[-164.912772,62.659728],[-164.819664,62.637821],[-164.874433,62.807606],[-164.633448,63.097884],[-164.425324,63.212899],[-164.036462,63.262192],[-163.73523,63.212899],[-163.313505,63.037637],[-163.039658,63.059545],[-162.661749,63.22933],[-162.272887,63.486746],[-162.075717,63.514131],[-162.026424,63.448408],[-161.555408,63.448408],[-161.13916,63.503177],[-160.766728,63.771547],[-160.766728,63.837271],[-160.952944,64.08921],[-160.974852,64.237087],[-161.26513,64.395918],[-161.374669,64.532842],[-161.078914,64.494503],[-160.79959,64.609519],[-160.783159,64.719058],[-161.144637,64.921705],[-161.413007,64.762873],[-161.664946,64.790258],[-161.900455,64.702627],[-162.168825,64.680719],[-162.234548,64.620473],[-162.541257,64.532842],[-162.634365,64.384965],[-162.787719,64.324718],[-162.858919,64.49998],[-163.045135,64.538319],[-163.176582,64.401395],[-163.253259,64.467119],[-163.598306,64.565704],[-164.304832,64.560227],[-164.80871,64.450688],[-165.000403,64.434257],[-165.411174,64.49998],[-166.188899,64.576658],[-166.391546,64.636904],[-166.484654,64.735489],[-166.413454,64.872412],[-166.692778,64.987428],[-166.638008,65.113398],[-166.462746,65.179121],[-166.517516,65.337952],[-166.796839,65.337952],[-167.026871,65.381768],[-167.47598,65.414629],[-167.711489,65.496784],[-168.072967,65.578938],[-168.105828,65.682999],[-167.541703,65.819923],[-166.829701,66.049954],[-166.3313,66.186878],[-166.046499,66.110201],[-165.756221,66.09377],[-165.690498,66.203309],[-165.86576,66.21974],[-165.88219,66.312848],[-165.186619,66.466202],[-164.403417,66.581218],[-163.981692,66.592172],[-163.751661,66.553833],[-163.872153,66.389525],[-163.828338,66.274509],[-163.915969,66.192355],[-163.768091,66.060908],[-163.494244,66.082816],[-163.149197,66.060908],[-162.749381,66.088293],[-162.634365,66.039001],[-162.371472,66.028047],[-162.14144,66.077339],[-161.840208,66.02257],[-161.549931,66.241647],[-161.341807,66.252601],[-161.199406,66.208786],[-161.128206,66.334755],[-161.528023,66.395002],[-161.911409,66.345709],[-161.87307,66.510017],[-162.174302,66.68528],[-162.502918,66.740049],[-162.601503,66.89888],[-162.344087,66.937219],[-162.015471,66.778388],[-162.075717,66.652418],[-161.916886,66.553833],[-161.571838,66.438817],[-161.489684,66.55931],[-161.884024,66.718141],[-161.714239,67.002942],[-161.851162,67.052235],[-162.240025,66.991988],[-162.639842,67.008419],[-162.700088,67.057712],[-162.902735,67.008419],[-163.740707,67.128912],[-163.757138,67.254881],[-164.009077,67.534205],[-164.211724,67.638267],[-164.534863,67.725898],[-165.192096,67.966884],[-165.493328,68.059992],[-165.794559,68.081899],[-166.243668,68.246208],[-166.681824,68.339316],[-166.703731,68.372177],[-166.375115,68.42147],[-166.227238,68.574824],[-166.216284,68.881533],[-165.329019,68.859625],[-164.255539,68.930825],[-163.976215,68.985595],[-163.532583,69.138949],[-163.110859,69.374457],[-163.023228,69.609966],[-162.842489,69.812613],[-162.470057,69.982398],[-162.311225,70.108367],[-161.851162,70.311014],[-161.779962,70.256245],[-161.396576,70.239814],[-160.837928,70.343876],[-160.487404,70.453415],[-159.649432,70.792985],[-159.33177,70.809416],[-159.298908,70.760123],[-158.975769,70.798462],[-158.658106,70.787508],[-158.033735,70.831323],[-157.420318,70.979201],[-156.812377,71.285909],[-156.565915,71.351633],[-156.522099,71.296863],[-155.585543,71.170894],[-155.508865,71.083263],[-155.832005,70.968247],[-155.979882,70.96277],[-155.974405,70.809416],[-155.503388,70.858708],[-155.476004,70.940862],[-155.262403,71.017539],[-155.191203,70.973724],[-155.032372,71.148986],[-154.566832,70.990155],[-154.643509,70.869662],[-154.353231,70.8368],[-154.183446,70.7656],[-153.931507,70.880616],[-153.487874,70.886093],[-153.235935,70.924431],[-152.589656,70.886093],[-152.26104,70.842277],[-152.419871,70.606769],[-151.817408,70.546523],[-151.773592,70.486276],[-151.187559,70.382214],[-151.182082,70.431507],[-150.760358,70.49723],[-150.355064,70.491753],[-150.349588,70.436984],[-150.114079,70.431507],[-149.867617,70.508184],[-149.462323,70.519138],[-149.177522,70.486276],[-148.78866,70.404122],[-148.607921,70.420553],[-148.350504,70.305537],[-148.202627,70.349353],[-147.961642,70.316491],[-147.786379,70.245291]]],[[[-152.94018,58.026237],[-152.945657,57.982421],[-153.290705,58.048145],[-153.044242,58.305561],[-152.819688,58.327469],[-152.666333,58.562977],[-152.496548,58.354853],[-152.354148,58.426053],[-152.080301,58.311038],[-152.080301,58.152206],[-152.480117,58.130299],[-152.655379,58.059098],[-152.94018,58.026237]]],[[[-153.958891,57.538789],[-153.67409,57.670236],[-153.931507,57.69762],[-153.936983,57.812636],[-153.723383,57.889313],[-153.570028,57.834544],[-153.548121,57.719528],[-153.46049,57.796205],[-153.455013,57.96599],[-153.268797,57.889313],[-153.235935,57.998852],[-153.071627,57.933129],[-152.874457,57.933129],[-152.721103,57.993375],[-152.469163,57.889313],[-152.469163,57.599035],[-152.151501,57.620943],[-152.359625,57.42925],[-152.74301,57.505928],[-152.60061,57.379958],[-152.710149,57.275896],[-152.907319,57.325188],[-152.912796,57.128019],[-153.214027,57.073249],[-153.312612,56.991095],[-153.498828,57.067772],[-153.695998,56.859649],[-153.849352,56.837741],[-154.013661,56.744633],[-154.073907,56.969187],[-154.303938,56.848695],[-154.314892,56.919895],[-154.523016,56.991095],[-154.539447,57.193742],[-154.742094,57.275896],[-154.627078,57.511404],[-154.227261,57.659282],[-153.980799,57.648328],[-153.958891,57.538789]]],[[[-154.53397,56.602232],[-154.742094,56.399586],[-154.807817,56.432447],[-154.53397,56.602232]]],[[[-155.634835,55.923092],[-155.476004,55.912138],[-155.530773,55.704014],[-155.793666,55.731399],[-155.837482,55.802599],[-155.634835,55.923092]]],[[[-159.890418,55.28229],[-159.950664,55.068689],[-160.257373,54.893427],[-160.109495,55.161797],[-160.005433,55.134412],[-159.890418,55.28229]]],[[[-160.520266,55.358967],[-160.33405,55.358967],[-160.339527,55.249428],[-160.525743,55.128935],[-160.690051,55.211089],[-160.794113,55.134412],[-160.854359,55.320628],[-160.79959,55.380875],[-160.520266,55.358967]]],[[[-162.256456,54.981058],[-162.234548,54.893427],[-162.349564,54.838658],[-162.437195,54.931766],[-162.256456,54.981058]]],[[[-162.415287,63.634624],[-162.563165,63.536039],[-162.612457,63.62367],[-162.415287,63.634624]]],[[[-162.80415,54.488133],[-162.590549,54.449795],[-162.612457,54.367641],[-162.782242,54.373118],[-162.80415,54.488133]]],[[[-165.548097,54.29644],[-165.476897,54.181425],[-165.630251,54.132132],[-165.685021,54.252625],[-165.548097,54.29644]]],[[[-165.73979,54.15404],[-166.046499,54.044501],[-166.112222,54.121178],[-165.980775,54.219763],[-165.73979,54.15404]]],[[[-166.364161,60.359413],[-166.13413,60.397752],[-166.084837,60.326552],[-165.88219,60.342983],[-165.685021,60.277259],[-165.646682,59.992458],[-165.750744,59.89935],[-166.00816,59.844581],[-166.062929,59.745996],[-166.440838,59.855535],[-166.6161,59.850058],[-166.994009,59.992458],[-167.125456,59.992458],[-167.344534,60.074613],[-167.421211,60.206059],[-167.311672,60.238921],[-166.93924,60.206059],[-166.763978,60.310121],[-166.577762,60.321075],[-166.495608,60.392275],[-166.364161,60.359413]]],[[[-166.375115,54.01164],[-166.210807,53.934962],[-166.5449,53.748746],[-166.539423,53.715885],[-166.117699,53.852808],[-166.112222,53.776131],[-166.282007,53.683023],[-166.555854,53.622777],[-166.583239,53.529669],[-166.878994,53.431084],[-167.13641,53.425607],[-167.306195,53.332499],[-167.623857,53.250345],[-167.793643,53.337976],[-167.459549,53.442038],[-167.355487,53.425607],[-167.103548,53.513238],[-167.163794,53.611823],[-167.021394,53.715885],[-166.807793,53.666592],[-166.785886,53.732316],[-167.015917,53.754223],[-167.141887,53.825424],[-167.032348,53.945916],[-166.643485,54.017116],[-166.561331,53.880193],[-166.375115,54.01164]]],[[[-168.790446,53.157237],[-168.40706,53.34893],[-168.385152,53.431084],[-168.237275,53.524192],[-168.007243,53.568007],[-167.886751,53.518715],[-167.842935,53.387268],[-168.270136,53.244868],[-168.500168,53.036744],[-168.686384,52.965544],[-168.790446,53.157237]]],[[[-169.74891,52.894344],[-169.705095,52.795759],[-169.962511,52.790282],[-169.989896,52.856005],[-169.74891,52.894344]]],[[[-170.148727,57.221127],[-170.28565,57.128019],[-170.313035,57.221127],[-170.148727,57.221127]]],[[[-170.669036,52.697174],[-170.603313,52.604066],[-170.789529,52.538343],[-170.816914,52.636928],[-170.669036,52.697174]]],[[[-171.742517,63.716778],[-170.94836,63.5689],[-170.488297,63.69487],[-170.280174,63.683916],[-170.093958,63.612716],[-170.044665,63.492223],[-169.644848,63.4265],[-169.518879,63.366254],[-168.99857,63.338869],[-168.686384,63.295053],[-168.856169,63.147176],[-169.108108,63.180038],[-169.376478,63.152653],[-169.513402,63.08693],[-169.639372,62.939052],[-169.831064,63.075976],[-170.055619,63.169084],[-170.263743,63.180038],[-170.362328,63.2841],[-170.866206,63.415546],[-171.101715,63.421023],[-171.463193,63.306007],[-171.73704,63.366254],[-171.852055,63.486746],[-171.742517,63.716778]]],[[[-172.432611,52.390465],[-172.41618,52.275449],[-172.607873,52.253542],[-172.569535,52.352127],[-172.432611,52.390465]]],[[[-173.626584,52.14948],[-173.495138,52.105664],[-173.122706,52.111141],[-173.106275,52.07828],[-173.549907,52.028987],[-173.626584,52.14948]]],[[[-174.322156,52.280926],[-174.327632,52.379511],[-174.185232,52.41785],[-173.982585,52.319265],[-174.059262,52.226157],[-174.179755,52.231634],[-174.141417,52.127572],[-174.333109,52.116618],[-174.738403,52.007079],[-174.968435,52.039941],[-174.902711,52.116618],[-174.656249,52.105664],[-174.322156,52.280926]]],[[[-176.469116,51.853725],[-176.288377,51.870156],[-176.288377,51.744186],[-176.518409,51.760617],[-176.80321,51.61274],[-176.912748,51.80991],[-176.792256,51.815386],[-176.775825,51.963264],[-176.627947,51.968741],[-176.627947,51.859202],[-176.469116,51.853725]]],[[[-177.153734,51.946833],[-177.044195,51.897541],[-177.120872,51.727755],[-177.274226,51.678463],[-177.279703,51.782525],[-177.153734,51.946833]]],[[[-178.123152,51.919448],[-177.953367,51.913971],[-177.800013,51.793479],[-177.964321,51.651078],[-178.123152,51.919448]]],[[[173.107557,52.992929],[173.293773,52.927205],[173.304726,52.823143],[172.90491,52.762897],[172.642017,52.927205],[172.642017,53.003883],[173.107557,52.992929]]]]}},{type:"Feature",id:"AZ",properties:{name:"Arizona",value:98},geometry:{type:"Polygon",coordinates:[[[-109.042503,37.000263],[-109.04798,31.331629],[-111.074448,31.331629],[-112.246513,31.704061],[-114.815198,32.492741],[-114.72209,32.717295],[-114.524921,32.755634],[-114.470151,32.843265],[-114.524921,33.029481],[-114.661844,33.034958],[-114.727567,33.40739],[-114.524921,33.54979],[-114.497536,33.697668],[-114.535874,33.933176],[-114.415382,34.108438],[-114.256551,34.174162],[-114.136058,34.305608],[-114.333228,34.448009],[-114.470151,34.710902],[-114.634459,34.87521],[-114.634459,35.00118],[-114.574213,35.138103],[-114.596121,35.324319],[-114.678275,35.516012],[-114.738521,36.102045],[-114.371566,36.140383],[-114.251074,36.01989],[-114.152489,36.025367],[-114.048427,36.195153],[-114.048427,37.000263],[-110.499369,37.00574],[-109.042503,37.000263]]]}},{type:"Feature",id:"AR",properties:{name:"Arkansas",value:5},geometry:{type:"Polygon",coordinates:[[[-94.473842,36.501861],[-90.152536,36.496384],[-90.064905,36.304691],[-90.218259,36.184199],[-90.377091,35.997983],[-89.730812,35.997983],[-89.763673,35.811767],[-89.911551,35.756997],[-89.944412,35.603643],[-90.130628,35.439335],[-90.114197,35.198349],[-90.212782,35.023087],[-90.311367,34.995703],[-90.251121,34.908072],[-90.409952,34.831394],[-90.481152,34.661609],[-90.585214,34.617794],[-90.568783,34.420624],[-90.749522,34.365854],[-90.744046,34.300131],[-90.952169,34.135823],[-90.891923,34.026284],[-91.072662,33.867453],[-91.231493,33.560744],[-91.056231,33.429298],[-91.143862,33.347144],[-91.089093,33.13902],[-91.16577,33.002096],[-93.608485,33.018527],[-94.041164,33.018527],[-94.041164,33.54979],[-94.183564,33.593606],[-94.380734,33.544313],[-94.484796,33.637421],[-94.430026,35.395519],[-94.616242,36.501861],[-94.473842,36.501861]]]}},{type:"Feature",id:"CA",properties:{name:"California",value:38},geometry:{type:"Polygon",coordinates:[[[-123.233256,42.006186],[-122.378853,42.011663],[-121.037003,41.995232],[-120.001861,41.995232],[-119.996384,40.264519],[-120.001861,38.999346],[-118.71478,38.101128],[-117.498899,37.21934],[-116.540435,36.501861],[-115.85034,35.970598],[-114.634459,35.00118],[-114.634459,34.87521],[-114.470151,34.710902],[-114.333228,34.448009],[-114.136058,34.305608],[-114.256551,34.174162],[-114.415382,34.108438],[-114.535874,33.933176],[-114.497536,33.697668],[-114.524921,33.54979],[-114.727567,33.40739],[-114.661844,33.034958],[-114.524921,33.029481],[-114.470151,32.843265],[-114.524921,32.755634],[-114.72209,32.717295],[-116.04751,32.624187],[-117.126467,32.536556],[-117.24696,32.668003],[-117.252437,32.876127],[-117.329114,33.122589],[-117.471515,33.297851],[-117.7837,33.538836],[-118.183517,33.763391],[-118.260194,33.703145],[-118.413548,33.741483],[-118.391641,33.840068],[-118.566903,34.042715],[-118.802411,33.998899],[-119.218659,34.146777],[-119.278905,34.26727],[-119.558229,34.415147],[-119.875891,34.40967],[-120.138784,34.475393],[-120.472878,34.448009],[-120.64814,34.579455],[-120.609801,34.858779],[-120.670048,34.902595],[-120.631709,35.099764],[-120.894602,35.247642],[-120.905556,35.450289],[-121.004141,35.461243],[-121.168449,35.636505],[-121.283465,35.674843],[-121.332757,35.784382],[-121.716143,36.195153],[-121.896882,36.315645],[-121.935221,36.638785],[-121.858544,36.6114],[-121.787344,36.803093],[-121.929744,36.978355],[-122.105006,36.956447],[-122.335038,37.115279],[-122.417192,37.241248],[-122.400761,37.361741],[-122.515777,37.520572],[-122.515777,37.783465],[-122.329561,37.783465],[-122.406238,38.15042],[-122.488392,38.112082],[-122.504823,37.931343],[-122.701993,37.893004],[-122.937501,38.029928],[-122.97584,38.265436],[-123.129194,38.451652],[-123.331841,38.566668],[-123.44138,38.698114],[-123.737134,38.95553],[-123.687842,39.032208],[-123.824765,39.366301],[-123.764519,39.552517],[-123.85215,39.831841],[-124.109566,40.105688],[-124.361506,40.259042],[-124.410798,40.439781],[-124.158859,40.877937],[-124.109566,41.025814],[-124.158859,41.14083],[-124.065751,41.442061],[-124.147905,41.715908],[-124.257444,41.781632],[-124.213628,42.000709],[-123.233256,42.006186]]]}},{type:"Feature",id:"CO",properties:{name:"Colorado",value:59},geometry:{type:"Polygon",coordinates:[[[-107.919731,41.003906],[-105.728954,40.998429],[-104.053011,41.003906],[-102.053927,41.003906],[-102.053927,40.001626],[-102.042974,36.994786],[-103.001438,37.000263],[-104.337812,36.994786],[-106.868158,36.994786],[-107.421329,37.000263],[-109.042503,37.000263],[-109.042503,38.166851],[-109.058934,38.27639],[-109.053457,39.125316],[-109.04798,40.998429],[-107.919731,41.003906]]]}},{type:"Feature",id:"CT",properties:{name:"Connecticut",value:45},geometry:{type:"Polygon",coordinates:[[[-73.053528,42.039048],[-71.799309,42.022617],[-71.799309,42.006186],[-71.799309,41.414677],[-71.859555,41.321569],[-71.947186,41.338],[-72.385341,41.261322],[-72.905651,41.28323],[-73.130205,41.146307],[-73.371191,41.102491],[-73.655992,40.987475],[-73.727192,41.102491],[-73.48073,41.21203],[-73.55193,41.294184],[-73.486206,42.050002],[-73.053528,42.039048]]]}},{type:"Feature",id:"DE",properties:{name:"Delaware",value:76},geometry:{type:"Polygon",coordinates:[[[-75.414089,39.804456],[-75.507197,39.683964],[-75.611259,39.61824],[-75.589352,39.459409],[-75.441474,39.311532],[-75.403136,39.065069],[-75.189535,38.807653],[-75.09095,38.796699],[-75.047134,38.451652],[-75.693413,38.462606],[-75.786521,39.722302],[-75.616736,39.831841],[-75.414089,39.804456]]]}},{type:"Feature",id:"FL",properties:{name:"Florida",value:3},geometry:{type:"Polygon",coordinates:[[[-85.497137,30.997536],[-85.004212,31.003013],[-84.867289,30.712735],[-83.498053,30.647012],[-82.216449,30.570335],[-82.167157,30.356734],[-82.046664,30.362211],[-82.002849,30.564858],[-82.041187,30.751074],[-81.948079,30.827751],[-81.718048,30.745597],[-81.444201,30.707258],[-81.383954,30.27458],[-81.257985,29.787132],[-80.967707,29.14633],[-80.524075,28.461713],[-80.589798,28.41242],[-80.56789,28.094758],[-80.381674,27.738757],[-80.091397,27.021277],[-80.03115,26.796723],[-80.036627,26.566691],[-80.146166,25.739673],[-80.239274,25.723243],[-80.337859,25.465826],[-80.304997,25.383672],[-80.49669,25.197456],[-80.573367,25.241272],[-80.759583,25.164595],[-81.077246,25.120779],[-81.170354,25.224841],[-81.126538,25.378195],[-81.351093,25.821827],[-81.526355,25.903982],[-81.679709,25.843735],[-81.800202,26.090198],[-81.833064,26.292844],[-82.041187,26.517399],[-82.09048,26.665276],[-82.057618,26.878877],[-82.172634,26.917216],[-82.145249,26.791246],[-82.249311,26.758384],[-82.566974,27.300601],[-82.692943,27.437525],[-82.391711,27.837342],[-82.588881,27.815434],[-82.720328,27.689464],[-82.851774,27.886634],[-82.676512,28.434328],[-82.643651,28.888914],[-82.764143,28.998453],[-82.802482,29.14633],[-82.994175,29.179192],[-83.218729,29.420177],[-83.399469,29.518762],[-83.410422,29.66664],[-83.536392,29.721409],[-83.640454,29.885717],[-84.02384,30.104795],[-84.357933,30.055502],[-84.341502,29.902148],[-84.451041,29.929533],[-84.867289,29.743317],[-85.310921,29.699501],[-85.299967,29.80904],[-85.404029,29.940487],[-85.924338,30.236241],[-86.29677,30.362211],[-86.630863,30.395073],[-86.910187,30.373165],[-87.518128,30.280057],[-87.37025,30.427934],[-87.446927,30.510088],[-87.408589,30.674397],[-87.633143,30.86609],[-87.600282,30.997536],[-85.497137,30.997536]]]}},{type:"Feature",id:"GA",properties:{name:"Georgia",value:77},geometry:{type:"Polygon",coordinates:[[[-83.109191,35.00118],[-83.322791,34.787579],[-83.339222,34.683517],[-83.005129,34.469916],[-82.901067,34.486347],[-82.747713,34.26727],[-82.714851,34.152254],[-82.55602,33.94413],[-82.325988,33.81816],[-82.194542,33.631944],[-81.926172,33.462159],[-81.937125,33.347144],[-81.761863,33.160928],[-81.493493,33.007573],[-81.42777,32.843265],[-81.416816,32.629664],[-81.279893,32.558464],[-81.121061,32.290094],[-81.115584,32.120309],[-80.885553,32.032678],[-81.132015,31.693108],[-81.175831,31.517845],[-81.279893,31.364491],[-81.290846,31.20566],[-81.400385,31.13446],[-81.444201,30.707258],[-81.718048,30.745597],[-81.948079,30.827751],[-82.041187,30.751074],[-82.002849,30.564858],[-82.046664,30.362211],[-82.167157,30.356734],[-82.216449,30.570335],[-83.498053,30.647012],[-84.867289,30.712735],[-85.004212,31.003013],[-85.113751,31.27686],[-85.042551,31.539753],[-85.141136,31.840985],[-85.053504,32.01077],[-85.058981,32.13674],[-84.889196,32.262709],[-85.004212,32.322956],[-84.960397,32.421541],[-85.069935,32.580372],[-85.184951,32.859696],[-85.431413,34.124869],[-85.606675,34.984749],[-84.319594,34.990226],[-83.618546,34.984749],[-83.109191,35.00118]]]}},{type:"Feature",id:"HI",properties:{name:"Hawaii",value:88},geometry:{type:"MultiPolygon",coordinates:[[[[-155.634835,18.948267],[-155.881297,19.035898],[-155.919636,19.123529],[-155.886774,19.348084],[-156.062036,19.73147],[-155.925113,19.857439],[-155.826528,20.032702],[-155.897728,20.147717],[-155.87582,20.26821],[-155.596496,20.12581],[-155.284311,20.021748],[-155.092618,19.868393],[-155.092618,19.736947],[-154.807817,19.523346],[-154.983079,19.348084],[-155.295265,19.26593],[-155.514342,19.134483],[-155.634835,18.948267]]],[[[-156.587823,21.029505],[-156.472807,20.892581],[-156.324929,20.952827],[-156.00179,20.793996],[-156.051082,20.651596],[-156.379699,20.580396],[-156.445422,20.60778],[-156.461853,20.783042],[-156.631638,20.821381],[-156.697361,20.919966],[-156.587823,21.029505]]],[[[-156.982162,21.210244],[-157.080747,21.106182],[-157.310779,21.106182],[-157.239579,21.221198],[-156.982162,21.210244]]],[[[-157.951581,21.697691],[-157.842042,21.462183],[-157.896811,21.325259],[-158.110412,21.303352],[-158.252813,21.582676],[-158.126843,21.588153],[-157.951581,21.697691]]],[[[-159.468693,22.228955],[-159.353678,22.218001],[-159.298908,22.113939],[-159.33177,21.966061],[-159.446786,21.872953],[-159.764448,21.987969],[-159.726109,22.152277],[-159.468693,22.228955]]]]}},{type:"Feature",id:"ID",properties:{name:"Idaho",value:22},geometry:{type:"Polygon",coordinates:[[[-116.04751,49.000239],[-116.04751,47.976051],[-115.724371,47.696727],[-115.718894,47.42288],[-115.527201,47.302388],[-115.324554,47.258572],[-115.302646,47.187372],[-114.930214,46.919002],[-114.886399,46.809463],[-114.623506,46.705401],[-114.612552,46.639678],[-114.322274,46.645155],[-114.464674,46.272723],[-114.492059,46.037214],[-114.387997,45.88386],[-114.568736,45.774321],[-114.497536,45.670259],[-114.546828,45.560721],[-114.333228,45.456659],[-114.086765,45.593582],[-113.98818,45.703121],[-113.807441,45.604536],[-113.834826,45.522382],[-113.736241,45.330689],[-113.571933,45.128042],[-113.45144,45.056842],[-113.456917,44.865149],[-113.341901,44.782995],[-113.133778,44.772041],[-113.002331,44.448902],[-112.887315,44.394132],[-112.783254,44.48724],[-112.471068,44.481763],[-112.241036,44.569394],[-112.104113,44.520102],[-111.868605,44.563917],[-111.819312,44.509148],[-111.616665,44.547487],[-111.386634,44.75561],[-111.227803,44.580348],[-111.047063,44.476286],[-111.047063,42.000709],[-112.164359,41.995232],[-114.04295,41.995232],[-117.027882,42.000709],[-117.027882,43.830007],[-116.896436,44.158624],[-116.97859,44.240778],[-117.170283,44.257209],[-117.241483,44.394132],[-117.038836,44.750133],[-116.934774,44.782995],[-116.830713,44.930872],[-116.847143,45.02398],[-116.732128,45.144473],[-116.671881,45.319735],[-116.463758,45.61549],[-116.545912,45.752413],[-116.78142,45.823614],[-116.918344,45.993399],[-116.92382,46.168661],[-117.055267,46.343923],[-117.038836,46.426077],[-117.044313,47.762451],[-117.033359,49.000239],[-116.04751,49.000239]]]}},{type:"Feature",id:"IL",properties:{name:"Illinois",value:83},geometry:{type:"Polygon",coordinates:[[[-90.639984,42.510065],[-88.788778,42.493634],[-87.802929,42.493634],[-87.83579,42.301941],[-87.682436,42.077386],[-87.523605,41.710431],[-87.529082,39.34987],[-87.63862,39.169131],[-87.512651,38.95553],[-87.49622,38.780268],[-87.62219,38.637868],[-87.655051,38.506421],[-87.83579,38.292821],[-87.950806,38.27639],[-87.923421,38.15042],[-88.000098,38.101128],[-88.060345,37.865619],[-88.027483,37.799896],[-88.15893,37.657496],[-88.065822,37.482234],[-88.476592,37.389126],[-88.514931,37.285064],[-88.421823,37.153617],[-88.547792,37.071463],[-88.914747,37.224817],[-89.029763,37.213863],[-89.183118,37.038601],[-89.133825,36.983832],[-89.292656,36.994786],[-89.517211,37.279587],[-89.435057,37.34531],[-89.517211,37.537003],[-89.517211,37.690357],[-89.84035,37.903958],[-89.949889,37.88205],[-90.059428,38.013497],[-90.355183,38.216144],[-90.349706,38.374975],[-90.179921,38.632391],[-90.207305,38.725499],[-90.10872,38.845992],[-90.251121,38.917192],[-90.470199,38.961007],[-90.585214,38.867899],[-90.661891,38.928146],[-90.727615,39.256762],[-91.061708,39.470363],[-91.368417,39.727779],[-91.494386,40.034488],[-91.50534,40.237135],[-91.417709,40.379535],[-91.401278,40.560274],[-91.121954,40.669813],[-91.09457,40.823167],[-90.963123,40.921752],[-90.946692,41.097014],[-91.111001,41.239415],[-91.045277,41.414677],[-90.656414,41.463969],[-90.344229,41.589939],[-90.311367,41.743293],[-90.179921,41.809016],[-90.141582,42.000709],[-90.168967,42.126679],[-90.393521,42.225264],[-90.420906,42.329326],[-90.639984,42.510065]]]}},{type:"Feature",id:"IN",properties:{name:"Indiana",value:100},geometry:{type:"Polygon",coordinates:[[[-85.990061,41.759724],[-84.807042,41.759724],[-84.807042,41.694001],[-84.801565,40.500028],[-84.817996,39.103408],[-84.894673,39.059592],[-84.812519,38.785745],[-84.987781,38.780268],[-85.173997,38.68716],[-85.431413,38.730976],[-85.42046,38.533806],[-85.590245,38.451652],[-85.655968,38.325682],[-85.83123,38.27639],[-85.924338,38.024451],[-86.039354,37.958727],[-86.263908,38.051835],[-86.302247,38.166851],[-86.521325,38.040881],[-86.504894,37.931343],[-86.729448,37.893004],[-86.795172,37.991589],[-87.047111,37.893004],[-87.129265,37.788942],[-87.381204,37.93682],[-87.512651,37.903958],[-87.600282,37.975158],[-87.682436,37.903958],[-87.934375,37.893004],[-88.027483,37.799896],[-88.060345,37.865619],[-88.000098,38.101128],[-87.923421,38.15042],[-87.950806,38.27639],[-87.83579,38.292821],[-87.655051,38.506421],[-87.62219,38.637868],[-87.49622,38.780268],[-87.512651,38.95553],[-87.63862,39.169131],[-87.529082,39.34987],[-87.523605,41.710431],[-87.42502,41.644708],[-87.118311,41.644708],[-86.822556,41.759724],[-85.990061,41.759724]]]}},{type:"Feature",id:"IA",properties:{name:"Iowa",value:44},geometry:{type:"Polygon",coordinates:[[[-91.368417,43.501391],[-91.215062,43.501391],[-91.204109,43.353514],[-91.056231,43.254929],[-91.176724,43.134436],[-91.143862,42.909881],[-91.067185,42.75105],[-90.711184,42.636034],[-90.639984,42.510065],[-90.420906,42.329326],[-90.393521,42.225264],[-90.168967,42.126679],[-90.141582,42.000709],[-90.179921,41.809016],[-90.311367,41.743293],[-90.344229,41.589939],[-90.656414,41.463969],[-91.045277,41.414677],[-91.111001,41.239415],[-90.946692,41.097014],[-90.963123,40.921752],[-91.09457,40.823167],[-91.121954,40.669813],[-91.401278,40.560274],[-91.417709,40.379535],[-91.527248,40.412397],[-91.729895,40.615043],[-91.833957,40.609566],[-93.257961,40.582182],[-94.632673,40.571228],[-95.7664,40.587659],[-95.881416,40.719105],[-95.826646,40.976521],[-95.925231,41.201076],[-95.919754,41.453015],[-96.095016,41.540646],[-96.122401,41.67757],[-96.062155,41.798063],[-96.127878,41.973325],[-96.264801,42.039048],[-96.44554,42.488157],[-96.631756,42.707235],[-96.544125,42.855112],[-96.511264,43.052282],[-96.434587,43.123482],[-96.560556,43.222067],[-96.527695,43.397329],[-96.582464,43.479483],[-96.451017,43.501391],[-91.368417,43.501391]]]}},{type:"Feature",id:"KS",properties:{name:"Kansas",value:76},geometry:{type:"Polygon",coordinates:[[[-101.90605,40.001626],[-95.306337,40.001626],[-95.207752,39.908518],[-94.884612,39.831841],[-95.109167,39.541563],[-94.983197,39.442978],[-94.824366,39.20747],[-94.610765,39.158177],[-94.616242,37.000263],[-100.087706,37.000263],[-102.042974,36.994786],[-102.053927,40.001626],[-101.90605,40.001626]]]}},{type:"Feature",id:"KY",properties:{name:"Kentucky",value:29},geometry:{type:"Polygon",coordinates:[[[-83.903347,38.769315],[-83.678792,38.632391],[-83.519961,38.703591],[-83.142052,38.626914],[-83.032514,38.725499],[-82.890113,38.758361],[-82.846298,38.588575],[-82.731282,38.561191],[-82.594358,38.424267],[-82.621743,38.123036],[-82.50125,37.931343],[-82.342419,37.783465],[-82.293127,37.668449],[-82.101434,37.553434],[-81.969987,37.537003],[-82.353373,37.268633],[-82.720328,37.120755],[-82.720328,37.044078],[-82.868205,36.978355],[-82.879159,36.890724],[-83.070852,36.852385],[-83.136575,36.742847],[-83.673316,36.600446],[-83.689746,36.584015],[-84.544149,36.594969],[-85.289013,36.627831],[-85.486183,36.616877],[-86.592525,36.655216],[-87.852221,36.633308],[-88.071299,36.677123],[-88.054868,36.496384],[-89.298133,36.507338],[-89.418626,36.496384],[-89.363857,36.622354],[-89.215979,36.578538],[-89.133825,36.983832],[-89.183118,37.038601],[-89.029763,37.213863],[-88.914747,37.224817],[-88.547792,37.071463],[-88.421823,37.153617],[-88.514931,37.285064],[-88.476592,37.389126],[-88.065822,37.482234],[-88.15893,37.657496],[-88.027483,37.799896],[-87.934375,37.893004],[-87.682436,37.903958],[-87.600282,37.975158],[-87.512651,37.903958],[-87.381204,37.93682],[-87.129265,37.788942],[-87.047111,37.893004],[-86.795172,37.991589],[-86.729448,37.893004],[-86.504894,37.931343],[-86.521325,38.040881],[-86.302247,38.166851],[-86.263908,38.051835],[-86.039354,37.958727],[-85.924338,38.024451],[-85.83123,38.27639],[-85.655968,38.325682],[-85.590245,38.451652],[-85.42046,38.533806],[-85.431413,38.730976],[-85.173997,38.68716],[-84.987781,38.780268],[-84.812519,38.785745],[-84.894673,39.059592],[-84.817996,39.103408],[-84.43461,39.103408],[-84.231963,38.895284],[-84.215533,38.807653],[-83.903347,38.769315]]]}},{type:"Feature",id:"LA",properties:{name:"Louisiana",value:94},geometry:{type:"Polygon",coordinates:[[[-93.608485,33.018527],[-91.16577,33.002096],[-91.072662,32.887081],[-91.143862,32.843265],[-91.154816,32.640618],[-91.006939,32.514649],[-90.985031,32.218894],[-91.105524,31.988862],[-91.341032,31.846462],[-91.401278,31.621907],[-91.499863,31.643815],[-91.516294,31.27686],[-91.636787,31.265906],[-91.565587,31.068736],[-91.636787,30.997536],[-89.747242,30.997536],[-89.845827,30.66892],[-89.681519,30.449842],[-89.643181,30.285534],[-89.522688,30.181472],[-89.818443,30.044549],[-89.84035,29.945964],[-89.599365,29.88024],[-89.495303,30.039072],[-89.287179,29.88024],[-89.30361,29.754271],[-89.424103,29.699501],[-89.648657,29.748794],[-89.621273,29.655686],[-89.69795,29.513285],[-89.506257,29.387316],[-89.199548,29.348977],[-89.09001,29.2011],[-89.002379,29.179192],[-89.16121,29.009407],[-89.336472,29.042268],[-89.484349,29.217531],[-89.851304,29.310638],[-89.851304,29.480424],[-90.032043,29.425654],[-90.021089,29.283254],[-90.103244,29.151807],[-90.23469,29.129899],[-90.333275,29.277777],[-90.563307,29.283254],[-90.645461,29.129899],[-90.798815,29.086084],[-90.963123,29.179192],[-91.09457,29.190146],[-91.220539,29.436608],[-91.445094,29.546147],[-91.532725,29.529716],[-91.620356,29.73784],[-91.883249,29.710455],[-91.888726,29.836425],[-92.146142,29.715932],[-92.113281,29.622824],[-92.31045,29.535193],[-92.617159,29.579009],[-92.97316,29.715932],[-93.2251,29.776178],[-93.767317,29.726886],[-93.838517,29.688547],[-93.926148,29.787132],[-93.690639,30.143133],[-93.767317,30.334826],[-93.696116,30.438888],[-93.728978,30.575812],[-93.630393,30.679874],[-93.526331,30.93729],[-93.542762,31.15089],[-93.816609,31.556184],[-93.822086,31.775262],[-94.041164,31.994339],[-94.041164,33.018527],[-93.608485,33.018527]]]}},{type:"Feature",id:"ME",properties:{name:"Maine",value:44},geometry:{type:"Polygon",coordinates:[[[-70.703921,43.057759],[-70.824413,43.128959],[-70.807983,43.227544],[-70.966814,43.34256],[-71.032537,44.657025],[-71.08183,45.303304],[-70.649151,45.440228],[-70.720352,45.511428],[-70.556043,45.664782],[-70.386258,45.735983],[-70.41912,45.796229],[-70.260289,45.889337],[-70.309581,46.064599],[-70.210996,46.327492],[-70.057642,46.415123],[-69.997395,46.694447],[-69.225147,47.461219],[-69.044408,47.428357],[-69.033454,47.242141],[-68.902007,47.176418],[-68.578868,47.285957],[-68.376221,47.285957],[-68.233821,47.357157],[-67.954497,47.198326],[-67.790188,47.066879],[-67.779235,45.944106],[-67.801142,45.675736],[-67.456095,45.604536],[-67.505388,45.48952],[-67.417757,45.379982],[-67.488957,45.281397],[-67.346556,45.128042],[-67.16034,45.160904],[-66.979601,44.804903],[-67.187725,44.646072],[-67.308218,44.706318],[-67.406803,44.596779],[-67.549203,44.624164],[-67.565634,44.531056],[-67.75185,44.54201],[-68.047605,44.328409],[-68.118805,44.476286],[-68.222867,44.48724],[-68.173574,44.328409],[-68.403606,44.251732],[-68.458375,44.377701],[-68.567914,44.311978],[-68.82533,44.311978],[-68.830807,44.459856],[-68.984161,44.426994],[-68.956777,44.322932],[-69.099177,44.103854],[-69.071793,44.043608],[-69.258008,43.923115],[-69.444224,43.966931],[-69.553763,43.840961],[-69.707118,43.82453],[-69.833087,43.720469],[-69.986442,43.742376],[-70.030257,43.851915],[-70.254812,43.676653],[-70.194565,43.567114],[-70.358873,43.528776],[-70.369827,43.435668],[-70.556043,43.320652],[-70.703921,43.057759]]]}},{type:"Feature",id:"MD",properties:{name:"Maryland",value:66},geometry:{type:"MultiPolygon",coordinates:[[[[-75.994645,37.95325],[-76.016553,37.95325],[-76.043938,37.95325],[-75.994645,37.95325]]],[[[-79.477979,39.722302],[-75.786521,39.722302],[-75.693413,38.462606],[-75.047134,38.451652],[-75.244304,38.029928],[-75.397659,38.013497],[-75.671506,37.95325],[-75.885106,37.909435],[-75.879629,38.073743],[-75.961783,38.139466],[-75.846768,38.210667],[-76.000122,38.374975],[-76.049415,38.303775],[-76.257538,38.320205],[-76.328738,38.500944],[-76.263015,38.500944],[-76.257538,38.736453],[-76.191815,38.829561],[-76.279446,39.147223],[-76.169907,39.333439],[-76.000122,39.366301],[-75.972737,39.557994],[-76.098707,39.536086],[-76.104184,39.437501],[-76.367077,39.311532],[-76.443754,39.196516],[-76.460185,38.906238],[-76.55877,38.769315],[-76.514954,38.539283],[-76.383508,38.380452],[-76.399939,38.259959],[-76.317785,38.139466],[-76.3616,38.057312],[-76.591632,38.216144],[-76.920248,38.292821],[-77.018833,38.446175],[-77.205049,38.358544],[-77.276249,38.479037],[-77.128372,38.632391],[-77.040741,38.791222],[-76.909294,38.895284],[-77.035264,38.993869],[-77.117418,38.933623],[-77.248864,39.026731],[-77.456988,39.076023],[-77.456988,39.223901],[-77.566527,39.306055],[-77.719881,39.322485],[-77.834897,39.601809],[-78.004682,39.601809],[-78.174467,39.694917],[-78.267575,39.61824],[-78.431884,39.623717],[-78.470222,39.514178],[-78.765977,39.585379],[-78.963147,39.437501],[-79.094593,39.470363],[-79.291763,39.300578],[-79.488933,39.20747],[-79.477979,39.722302]]]]}},{type:"Feature",id:"MA",properties:{name:"Massachusetts",value:39},geometry:{type:"Polygon",coordinates:[[[-70.917521,42.887974],[-70.818936,42.871543],[-70.780598,42.696281],[-70.824413,42.55388],[-70.983245,42.422434],[-70.988722,42.269079],[-70.769644,42.247172],[-70.638197,42.08834],[-70.660105,41.962371],[-70.550566,41.929509],[-70.539613,41.814493],[-70.260289,41.715908],[-69.937149,41.809016],[-70.008349,41.672093],[-70.484843,41.5516],[-70.660105,41.546123],[-70.764167,41.639231],[-70.928475,41.611847],[-70.933952,41.540646],[-71.120168,41.496831],[-71.196845,41.67757],[-71.22423,41.710431],[-71.328292,41.781632],[-71.383061,42.01714],[-71.530939,42.01714],[-71.799309,42.006186],[-71.799309,42.022617],[-73.053528,42.039048],[-73.486206,42.050002],[-73.508114,42.08834],[-73.267129,42.745573],[-72.456542,42.729142],[-71.29543,42.696281],[-71.185891,42.789389],[-70.917521,42.887974]]]}},{type:"Feature",id:"MI",properties:{name:"Michigan",value:70},geometry:{type:"MultiPolygon",coordinates:[[[[-83.454238,41.732339],[-84.807042,41.694001],[-84.807042,41.759724],[-85.990061,41.759724],[-86.822556,41.759724],[-86.619909,41.891171],[-86.482986,42.115725],[-86.357016,42.252649],[-86.263908,42.444341],[-86.209139,42.718189],[-86.231047,43.013943],[-86.526801,43.594499],[-86.433693,43.813577],[-86.499417,44.07647],[-86.269385,44.34484],[-86.220093,44.569394],[-86.252954,44.689887],[-86.088646,44.73918],[-86.066738,44.903488],[-85.809322,44.947303],[-85.612152,45.128042],[-85.628583,44.766564],[-85.524521,44.750133],[-85.393075,44.930872],[-85.387598,45.237581],[-85.305444,45.314258],[-85.031597,45.363551],[-85.119228,45.577151],[-84.938489,45.75789],[-84.713934,45.768844],[-84.461995,45.653829],[-84.215533,45.637398],[-84.09504,45.494997],[-83.908824,45.484043],[-83.596638,45.352597],[-83.4871,45.358074],[-83.317314,45.144473],[-83.454238,45.029457],[-83.322791,44.88158],[-83.273499,44.711795],[-83.333745,44.339363],[-83.536392,44.246255],[-83.585684,44.054562],[-83.82667,43.988839],[-83.958116,43.758807],[-83.908824,43.671176],[-83.667839,43.589022],[-83.481623,43.714992],[-83.262545,43.972408],[-82.917498,44.070993],[-82.747713,43.994316],[-82.643651,43.851915],[-82.539589,43.435668],[-82.523158,43.227544],[-82.413619,42.975605],[-82.517681,42.614127],[-82.681989,42.559357],[-82.687466,42.690804],[-82.797005,42.652465],[-82.922975,42.351234],[-83.125621,42.236218],[-83.185868,42.006186],[-83.437807,41.814493],[-83.454238,41.732339]]],[[[-85.508091,45.730506],[-85.49166,45.610013],[-85.623106,45.588105],[-85.568337,45.75789],[-85.508091,45.730506]]],[[[-87.589328,45.095181],[-87.742682,45.199243],[-87.649574,45.341643],[-87.885083,45.363551],[-87.791975,45.500474],[-87.781021,45.675736],[-87.989145,45.796229],[-88.10416,45.922199],[-88.531362,46.020784],[-88.662808,45.987922],[-89.09001,46.135799],[-90.119674,46.338446],[-90.229213,46.508231],[-90.415429,46.568478],[-90.026566,46.672539],[-89.851304,46.793032],[-89.413149,46.842325],[-89.128348,46.990202],[-88.996902,46.995679],[-88.887363,47.099741],[-88.575177,47.247618],[-88.416346,47.373588],[-88.180837,47.455742],[-87.956283,47.384542],[-88.350623,47.077833],[-88.443731,46.973771],[-88.438254,46.787555],[-88.246561,46.929956],[-87.901513,46.908048],[-87.633143,46.809463],[-87.392158,46.535616],[-87.260711,46.486323],[-87.008772,46.530139],[-86.948526,46.469893],[-86.696587,46.437031],[-86.159846,46.667063],[-85.880522,46.68897],[-85.508091,46.678016],[-85.256151,46.754694],[-85.064458,46.760171],[-85.02612,46.480847],[-84.82895,46.442508],[-84.63178,46.486323],[-84.549626,46.4206],[-84.418179,46.502754],[-84.127902,46.530139],[-84.122425,46.179615],[-83.990978,46.031737],[-83.793808,45.993399],[-83.7719,46.091984],[-83.580208,46.091984],[-83.476146,45.987922],[-83.563777,45.911245],[-84.111471,45.976968],[-84.374364,45.933153],[-84.659165,46.053645],[-84.741319,45.944106],[-84.70298,45.850998],[-84.82895,45.872906],[-85.015166,46.00983],[-85.338305,46.091984],[-85.502614,46.097461],[-85.661445,45.966014],[-85.924338,45.933153],[-86.209139,45.960537],[-86.324155,45.905768],[-86.351539,45.796229],[-86.663725,45.703121],[-86.647294,45.834568],[-86.784218,45.861952],[-86.838987,45.725029],[-87.069019,45.719552],[-87.17308,45.659305],[-87.326435,45.423797],[-87.611236,45.122565],[-87.589328,45.095181]]],[[[-88.805209,47.976051],[-89.057148,47.850082],[-89.188594,47.833651],[-89.177641,47.937713],[-88.547792,48.173221],[-88.668285,48.008913],[-88.805209,47.976051]]]]}},{type:"Feature",id:"MN",properties:{name:"Minnesota",value:11},geometry:{type:"Polygon",coordinates:[[[-92.014696,46.705401],[-92.091373,46.749217],[-92.29402,46.667063],[-92.29402,46.075553],[-92.354266,46.015307],[-92.639067,45.933153],[-92.869098,45.719552],[-92.885529,45.577151],[-92.770513,45.566198],[-92.644544,45.440228],[-92.75956,45.286874],[-92.737652,45.117088],[-92.808852,44.750133],[-92.545959,44.569394],[-92.337835,44.552964],[-92.233773,44.443425],[-91.927065,44.333886],[-91.877772,44.202439],[-91.592971,44.032654],[-91.43414,43.994316],[-91.242447,43.775238],[-91.269832,43.616407],[-91.215062,43.501391],[-91.368417,43.501391],[-96.451017,43.501391],[-96.451017,45.297827],[-96.681049,45.412843],[-96.856311,45.604536],[-96.582464,45.818137],[-96.560556,45.933153],[-96.598895,46.332969],[-96.719387,46.437031],[-96.801542,46.656109],[-96.785111,46.924479],[-96.823449,46.968294],[-96.856311,47.609096],[-97.053481,47.948667],[-97.130158,48.140359],[-97.16302,48.545653],[-97.097296,48.682577],[-97.228743,49.000239],[-95.152983,49.000239],[-95.152983,49.383625],[-94.955813,49.372671],[-94.824366,49.295994],[-94.69292,48.775685],[-94.588858,48.715438],[-94.260241,48.699007],[-94.221903,48.649715],[-93.838517,48.627807],[-93.794701,48.518268],[-93.466085,48.545653],[-93.466085,48.589469],[-93.208669,48.644238],[-92.984114,48.62233],[-92.726698,48.540176],[-92.655498,48.436114],[-92.50762,48.447068],[-92.370697,48.222514],[-92.304974,48.315622],[-92.053034,48.359437],[-92.009219,48.266329],[-91.713464,48.200606],[-91.713464,48.112975],[-91.565587,48.041775],[-91.264355,48.080113],[-91.083616,48.178698],[-90.837154,48.238944],[-90.749522,48.091067],[-90.579737,48.123929],[-90.377091,48.091067],[-90.141582,48.112975],[-89.873212,47.987005],[-89.615796,48.008913],[-89.637704,47.954144],[-89.971797,47.828174],[-90.437337,47.729589],[-90.738569,47.625527],[-91.171247,47.368111],[-91.357463,47.20928],[-91.642264,47.028541],[-92.091373,46.787555],[-92.014696,46.705401]]]}},{type:"Feature",id:"MS",properties:{name:"Mississippi",value:66},geometry:{type:"Polygon",coordinates:[[[-88.471115,34.995703],[-88.202745,34.995703],[-88.098683,34.891641],[-88.241084,33.796253],[-88.471115,31.895754],[-88.394438,30.367688],[-88.503977,30.323872],[-88.744962,30.34578],[-88.843547,30.411504],[-89.084533,30.367688],[-89.418626,30.252672],[-89.522688,30.181472],[-89.643181,30.285534],[-89.681519,30.449842],[-89.845827,30.66892],[-89.747242,30.997536],[-91.636787,30.997536],[-91.565587,31.068736],[-91.636787,31.265906],[-91.516294,31.27686],[-91.499863,31.643815],[-91.401278,31.621907],[-91.341032,31.846462],[-91.105524,31.988862],[-90.985031,32.218894],[-91.006939,32.514649],[-91.154816,32.640618],[-91.143862,32.843265],[-91.072662,32.887081],[-91.16577,33.002096],[-91.089093,33.13902],[-91.143862,33.347144],[-91.056231,33.429298],[-91.231493,33.560744],[-91.072662,33.867453],[-90.891923,34.026284],[-90.952169,34.135823],[-90.744046,34.300131],[-90.749522,34.365854],[-90.568783,34.420624],[-90.585214,34.617794],[-90.481152,34.661609],[-90.409952,34.831394],[-90.251121,34.908072],[-90.311367,34.995703],[-88.471115,34.995703]]]}},{type:"Feature",id:"MO",properties:{name:"Missouri",value:36},geometry:{type:"Polygon",coordinates:[[[-91.833957,40.609566],[-91.729895,40.615043],[-91.527248,40.412397],[-91.417709,40.379535],[-91.50534,40.237135],[-91.494386,40.034488],[-91.368417,39.727779],[-91.061708,39.470363],[-90.727615,39.256762],[-90.661891,38.928146],[-90.585214,38.867899],[-90.470199,38.961007],[-90.251121,38.917192],[-90.10872,38.845992],[-90.207305,38.725499],[-90.179921,38.632391],[-90.349706,38.374975],[-90.355183,38.216144],[-90.059428,38.013497],[-89.949889,37.88205],[-89.84035,37.903958],[-89.517211,37.690357],[-89.517211,37.537003],[-89.435057,37.34531],[-89.517211,37.279587],[-89.292656,36.994786],[-89.133825,36.983832],[-89.215979,36.578538],[-89.363857,36.622354],[-89.418626,36.496384],[-89.484349,36.496384],[-89.539119,36.496384],[-89.533642,36.249922],[-89.730812,35.997983],[-90.377091,35.997983],[-90.218259,36.184199],[-90.064905,36.304691],[-90.152536,36.496384],[-94.473842,36.501861],[-94.616242,36.501861],[-94.616242,37.000263],[-94.610765,39.158177],[-94.824366,39.20747],[-94.983197,39.442978],[-95.109167,39.541563],[-94.884612,39.831841],[-95.207752,39.908518],[-95.306337,40.001626],[-95.552799,40.264519],[-95.7664,40.587659],[-94.632673,40.571228],[-93.257961,40.582182],[-91.833957,40.609566]]]}},{type:"Feature",id:"MT",properties:{name:"Montana",value:99},geometry:{type:"Polygon",coordinates:[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}},{type:"Feature",id:"NE",properties:{name:"Nebraska",value:55},geometry:{type:"Polygon",coordinates:[[[-103.324578,43.002989],[-101.626726,42.997512],[-98.499393,42.997512],[-98.466531,42.94822],[-97.951699,42.767481],[-97.831206,42.866066],[-97.688806,42.844158],[-97.217789,42.844158],[-96.692003,42.657942],[-96.626279,42.515542],[-96.44554,42.488157],[-96.264801,42.039048],[-96.127878,41.973325],[-96.062155,41.798063],[-96.122401,41.67757],[-96.095016,41.540646],[-95.919754,41.453015],[-95.925231,41.201076],[-95.826646,40.976521],[-95.881416,40.719105],[-95.7664,40.587659],[-95.552799,40.264519],[-95.306337,40.001626],[-101.90605,40.001626],[-102.053927,40.001626],[-102.053927,41.003906],[-104.053011,41.003906],[-104.053011,43.002989],[-103.324578,43.002989]]]}},{type:"Feature",id:"NV",properties:{name:"Nevada",value:65},geometry:{type:"Polygon",coordinates:[[[-117.027882,42.000709],[-114.04295,41.995232],[-114.048427,37.000263],[-114.048427,36.195153],[-114.152489,36.025367],[-114.251074,36.01989],[-114.371566,36.140383],[-114.738521,36.102045],[-114.678275,35.516012],[-114.596121,35.324319],[-114.574213,35.138103],[-114.634459,35.00118],[-115.85034,35.970598],[-116.540435,36.501861],[-117.498899,37.21934],[-118.71478,38.101128],[-120.001861,38.999346],[-119.996384,40.264519],[-120.001861,41.995232],[-118.698349,41.989755],[-117.027882,42.000709]]]}},{type:"Feature",id:"NH",properties:{name:"New Hampshire",value:32},geometry:{type:"Polygon",coordinates:[[[-71.08183,45.303304],[-71.032537,44.657025],[-70.966814,43.34256],[-70.807983,43.227544],[-70.824413,43.128959],[-70.703921,43.057759],[-70.818936,42.871543],[-70.917521,42.887974],[-71.185891,42.789389],[-71.29543,42.696281],[-72.456542,42.729142],[-72.544173,42.80582],[-72.533219,42.953697],[-72.445588,43.008466],[-72.456542,43.150867],[-72.379864,43.572591],[-72.204602,43.769761],[-72.116971,43.994316],[-72.02934,44.07647],[-72.034817,44.322932],[-71.700724,44.41604],[-71.536416,44.585825],[-71.629524,44.750133],[-71.4926,44.914442],[-71.503554,45.013027],[-71.361154,45.270443],[-71.131122,45.243058],[-71.08183,45.303304]]]}},{type:"Feature",id:"NJ",properties:{name:"New Jersey",value:50},geometry:{type:"Polygon",coordinates:[[[-74.236547,41.14083],[-73.902454,40.998429],[-74.022947,40.708151],[-74.187255,40.642428],[-74.274886,40.489074],[-74.001039,40.412397],[-73.979131,40.297381],[-74.099624,39.760641],[-74.411809,39.360824],[-74.614456,39.245808],[-74.795195,38.993869],[-74.888303,39.158177],[-75.178581,39.240331],[-75.534582,39.459409],[-75.55649,39.607286],[-75.561967,39.629194],[-75.507197,39.683964],[-75.414089,39.804456],[-75.145719,39.88661],[-75.129289,39.963288],[-74.82258,40.127596],[-74.773287,40.215227],[-75.058088,40.417874],[-75.069042,40.543843],[-75.195012,40.576705],[-75.205966,40.691721],[-75.052611,40.866983],[-75.134765,40.971045],[-74.882826,41.179168],[-74.828057,41.288707],[-74.69661,41.359907],[-74.236547,41.14083]]]}},{type:"Feature",id:"NM",properties:{name:"New Mexico",value:79},geometry:{type:"Polygon",coordinates:[[[-107.421329,37.000263],[-106.868158,36.994786],[-104.337812,36.994786],[-103.001438,37.000263],[-103.001438,36.501861],[-103.039777,36.501861],[-103.045254,34.01533],[-103.067161,33.002096],[-103.067161,31.999816],[-106.616219,31.999816],[-106.643603,31.901231],[-106.528588,31.786216],[-108.210008,31.786216],[-108.210008,31.331629],[-109.04798,31.331629],[-109.042503,37.000263],[-107.421329,37.000263]]]}},{type:"Feature",id:"NY",properties:{name:"New York",value:55},geometry:{type:"Polygon",coordinates:[[[-73.343806,45.013027],[-73.332852,44.804903],[-73.387622,44.618687],[-73.294514,44.437948],[-73.321898,44.246255],[-73.436914,44.043608],[-73.349283,43.769761],[-73.404052,43.687607],[-73.245221,43.523299],[-73.278083,42.833204],[-73.267129,42.745573],[-73.508114,42.08834],[-73.486206,42.050002],[-73.55193,41.294184],[-73.48073,41.21203],[-73.727192,41.102491],[-73.655992,40.987475],[-73.22879,40.905321],[-73.141159,40.965568],[-72.774204,40.965568],[-72.587988,40.998429],[-72.28128,41.157261],[-72.259372,41.042245],[-72.100541,40.992952],[-72.467496,40.845075],[-73.239744,40.625997],[-73.562884,40.582182],[-73.776484,40.593136],[-73.935316,40.543843],[-74.022947,40.708151],[-73.902454,40.998429],[-74.236547,41.14083],[-74.69661,41.359907],[-74.740426,41.431108],[-74.89378,41.436584],[-75.074519,41.60637],[-75.052611,41.754247],[-75.173104,41.869263],[-75.249781,41.863786],[-75.35932,42.000709],[-79.76278,42.000709],[-79.76278,42.252649],[-79.76278,42.269079],[-79.149363,42.55388],[-79.050778,42.690804],[-78.853608,42.783912],[-78.930285,42.953697],[-79.012439,42.986559],[-79.072686,43.260406],[-78.486653,43.375421],[-77.966344,43.369944],[-77.75822,43.34256],[-77.533665,43.233021],[-77.391265,43.276836],[-76.958587,43.271359],[-76.695693,43.34256],[-76.41637,43.523299],[-76.235631,43.528776],[-76.230154,43.802623],[-76.137046,43.961454],[-76.3616,44.070993],[-76.312308,44.196962],[-75.912491,44.366748],[-75.764614,44.514625],[-75.282643,44.848718],[-74.828057,45.018503],[-74.148916,44.991119],[-73.343806,45.013027]]]}},{type:"Feature",id:"NC",properties:{name:"North Carolina",value:78},geometry:{type:"Polygon",coordinates:[[[-80.978661,36.562108],[-80.294043,36.545677],[-79.510841,36.5402],[-75.868676,36.551154],[-75.75366,36.151337],[-76.032984,36.189676],[-76.071322,36.140383],[-76.410893,36.080137],[-76.460185,36.025367],[-76.68474,36.008937],[-76.673786,35.937736],[-76.399939,35.987029],[-76.3616,35.943213],[-76.060368,35.992506],[-75.961783,35.899398],[-75.781044,35.937736],[-75.715321,35.696751],[-75.775568,35.581735],[-75.89606,35.570781],[-76.147999,35.324319],[-76.482093,35.313365],[-76.536862,35.14358],[-76.394462,34.973795],[-76.279446,34.940933],[-76.493047,34.661609],[-76.673786,34.694471],[-76.991448,34.667086],[-77.210526,34.60684],[-77.555573,34.415147],[-77.82942,34.163208],[-77.971821,33.845545],[-78.179944,33.916745],[-78.541422,33.851022],[-79.675149,34.80401],[-80.797922,34.820441],[-80.781491,34.935456],[-80.934845,35.105241],[-81.038907,35.044995],[-81.044384,35.149057],[-82.276696,35.198349],[-82.550543,35.160011],[-82.764143,35.066903],[-83.109191,35.00118],[-83.618546,34.984749],[-84.319594,34.990226],[-84.29221,35.225734],[-84.09504,35.247642],[-84.018363,35.41195],[-83.7719,35.559827],[-83.498053,35.565304],[-83.251591,35.718659],[-82.994175,35.773428],[-82.775097,35.997983],[-82.638174,36.063706],[-82.610789,35.965121],[-82.216449,36.156814],[-82.03571,36.118475],[-81.909741,36.304691],[-81.723525,36.353984],[-81.679709,36.589492],[-80.978661,36.562108]]]}},{type:"Feature",id:"ND",properties:{name:"North Dakota",value:98},geometry:{type:"Polygon",coordinates:[[[-97.228743,49.000239],[-97.097296,48.682577],[-97.16302,48.545653],[-97.130158,48.140359],[-97.053481,47.948667],[-96.856311,47.609096],[-96.823449,46.968294],[-96.785111,46.924479],[-96.801542,46.656109],[-96.719387,46.437031],[-96.598895,46.332969],[-96.560556,45.933153],[-104.047534,45.944106],[-104.042057,47.861036],[-104.047534,49.000239],[-97.228743,49.000239]]]}},{type:"Feature",id:"OH",properties:{name:"Ohio",value:22},geometry:{type:"Polygon",coordinates:[[[-80.518598,41.978802],[-80.518598,40.636951],[-80.666475,40.582182],[-80.595275,40.472643],[-80.600752,40.319289],[-80.737675,40.078303],[-80.830783,39.711348],[-81.219646,39.388209],[-81.345616,39.344393],[-81.455155,39.410117],[-81.57017,39.267716],[-81.685186,39.273193],[-81.811156,39.0815],[-81.783771,38.966484],[-81.887833,38.873376],[-82.03571,39.026731],[-82.221926,38.785745],[-82.172634,38.632391],[-82.293127,38.577622],[-82.331465,38.446175],[-82.594358,38.424267],[-82.731282,38.561191],[-82.846298,38.588575],[-82.890113,38.758361],[-83.032514,38.725499],[-83.142052,38.626914],[-83.519961,38.703591],[-83.678792,38.632391],[-83.903347,38.769315],[-84.215533,38.807653],[-84.231963,38.895284],[-84.43461,39.103408],[-84.817996,39.103408],[-84.801565,40.500028],[-84.807042,41.694001],[-83.454238,41.732339],[-83.065375,41.595416],[-82.933929,41.513262],[-82.835344,41.589939],[-82.616266,41.431108],[-82.479343,41.381815],[-82.013803,41.513262],[-81.739956,41.485877],[-81.444201,41.672093],[-81.011523,41.852832],[-80.518598,41.978802],[-80.518598,41.978802]]]}},{type:"Feature",id:"OK",properties:{name:"Oklahoma",value:1},geometry:{type:"Polygon",coordinates:[[[-100.087706,37.000263],[-94.616242,37.000263],[-94.616242,36.501861],[-94.430026,35.395519],[-94.484796,33.637421],[-94.868182,33.74696],[-94.966767,33.861976],[-95.224183,33.960561],[-95.289906,33.87293],[-95.547322,33.878407],[-95.602092,33.933176],[-95.8376,33.834591],[-95.936185,33.889361],[-96.149786,33.840068],[-96.346956,33.686714],[-96.423633,33.774345],[-96.631756,33.845545],[-96.850834,33.845545],[-96.922034,33.960561],[-97.173974,33.736006],[-97.256128,33.861976],[-97.371143,33.823637],[-97.458774,33.905791],[-97.694283,33.982469],[-97.869545,33.851022],[-97.946222,33.987946],[-98.088623,34.004376],[-98.170777,34.113915],[-98.36247,34.157731],[-98.488439,34.064623],[-98.570593,34.146777],[-98.767763,34.135823],[-98.986841,34.223454],[-99.189488,34.2125],[-99.260688,34.404193],[-99.57835,34.415147],[-99.698843,34.382285],[-99.923398,34.573978],[-100.000075,34.563024],[-100.000075,36.501861],[-101.812942,36.501861],[-103.001438,36.501861],[-103.001438,37.000263],[-102.042974,36.994786],[-100.087706,37.000263]]]}},{type:"Feature",id:"OR",properties:{name:"Oregon",value:87},geometry:{type:"Polygon",coordinates:[[[-123.211348,46.174138],[-123.11824,46.185092],[-122.904639,46.08103],[-122.811531,45.960537],[-122.762239,45.659305],[-122.247407,45.549767],[-121.809251,45.708598],[-121.535404,45.725029],[-121.217742,45.670259],[-121.18488,45.604536],[-120.637186,45.746937],[-120.505739,45.697644],[-120.209985,45.725029],[-119.963522,45.823614],[-119.525367,45.911245],[-119.125551,45.933153],[-118.988627,45.998876],[-116.918344,45.993399],[-116.78142,45.823614],[-116.545912,45.752413],[-116.463758,45.61549],[-116.671881,45.319735],[-116.732128,45.144473],[-116.847143,45.02398],[-116.830713,44.930872],[-116.934774,44.782995],[-117.038836,44.750133],[-117.241483,44.394132],[-117.170283,44.257209],[-116.97859,44.240778],[-116.896436,44.158624],[-117.027882,43.830007],[-117.027882,42.000709],[-118.698349,41.989755],[-120.001861,41.995232],[-121.037003,41.995232],[-122.378853,42.011663],[-123.233256,42.006186],[-124.213628,42.000709],[-124.356029,42.115725],[-124.432706,42.438865],[-124.416275,42.663419],[-124.553198,42.838681],[-124.454613,43.002989],[-124.383413,43.271359],[-124.235536,43.55616],[-124.169813,43.8081],[-124.060274,44.657025],[-124.076705,44.772041],[-123.97812,45.144473],[-123.939781,45.659305],[-123.994551,45.944106],[-123.945258,46.113892],[-123.545441,46.261769],[-123.370179,46.146753],[-123.211348,46.174138]]]}},{type:"Feature",id:"PA",properties:{name:"Pennsylvania",value:37},geometry:{type:"Polygon",coordinates:[[[-79.76278,42.252649],[-79.76278,42.000709],[-75.35932,42.000709],[-75.249781,41.863786],[-75.173104,41.869263],[-75.052611,41.754247],[-75.074519,41.60637],[-74.89378,41.436584],[-74.740426,41.431108],[-74.69661,41.359907],[-74.828057,41.288707],[-74.882826,41.179168],[-75.134765,40.971045],[-75.052611,40.866983],[-75.205966,40.691721],[-75.195012,40.576705],[-75.069042,40.543843],[-75.058088,40.417874],[-74.773287,40.215227],[-74.82258,40.127596],[-75.129289,39.963288],[-75.145719,39.88661],[-75.414089,39.804456],[-75.616736,39.831841],[-75.786521,39.722302],[-79.477979,39.722302],[-80.518598,39.722302],[-80.518598,40.636951],[-80.518598,41.978802],[-80.518598,41.978802],[-80.332382,42.033571],[-79.76278,42.269079],[-79.76278,42.252649]]]}},{type:"Feature",id:"RI",properties:{name:"Rhode Island",value:78},geometry:{type:"MultiPolygon",coordinates:[[[[-71.196845,41.67757],[-71.120168,41.496831],[-71.317338,41.474923],[-71.196845,41.67757]]],[[[-71.530939,42.01714],[-71.383061,42.01714],[-71.328292,41.781632],[-71.22423,41.710431],[-71.344723,41.726862],[-71.448785,41.578985],[-71.481646,41.370861],[-71.859555,41.321569],[-71.799309,41.414677],[-71.799309,42.006186],[-71.530939,42.01714]]]]}},{type:"Feature",id:"SC",properties:{name:"South Carolina",value:54},geometry:{type:"Polygon",coordinates:[[[-82.764143,35.066903],[-82.550543,35.160011],[-82.276696,35.198349],[-81.044384,35.149057],[-81.038907,35.044995],[-80.934845,35.105241],[-80.781491,34.935456],[-80.797922,34.820441],[-79.675149,34.80401],[-78.541422,33.851022],[-78.716684,33.80173],[-78.935762,33.637421],[-79.149363,33.380005],[-79.187701,33.171881],[-79.357487,33.007573],[-79.582041,33.007573],[-79.631334,32.887081],[-79.866842,32.755634],[-79.998289,32.613234],[-80.206412,32.552987],[-80.430967,32.399633],[-80.452875,32.328433],[-80.660998,32.246279],[-80.885553,32.032678],[-81.115584,32.120309],[-81.121061,32.290094],[-81.279893,32.558464],[-81.416816,32.629664],[-81.42777,32.843265],[-81.493493,33.007573],[-81.761863,33.160928],[-81.937125,33.347144],[-81.926172,33.462159],[-82.194542,33.631944],[-82.325988,33.81816],[-82.55602,33.94413],[-82.714851,34.152254],[-82.747713,34.26727],[-82.901067,34.486347],[-83.005129,34.469916],[-83.339222,34.683517],[-83.322791,34.787579],[-83.109191,35.00118],[-82.764143,35.066903]]]}},{type:"Feature",id:"SD",properties:{name:"South Dakota",value:0},geometry:{type:"Polygon",coordinates:[[[-104.047534,45.944106],[-96.560556,45.933153],[-96.582464,45.818137],[-96.856311,45.604536],[-96.681049,45.412843],[-96.451017,45.297827],[-96.451017,43.501391],[-96.582464,43.479483],[-96.527695,43.397329],[-96.560556,43.222067],[-96.434587,43.123482],[-96.511264,43.052282],[-96.544125,42.855112],[-96.631756,42.707235],[-96.44554,42.488157],[-96.626279,42.515542],[-96.692003,42.657942],[-97.217789,42.844158],[-97.688806,42.844158],[-97.831206,42.866066],[-97.951699,42.767481],[-98.466531,42.94822],[-98.499393,42.997512],[-101.626726,42.997512],[-103.324578,43.002989],[-104.053011,43.002989],[-104.058488,44.996596],[-104.042057,44.996596],[-104.047534,45.944106]]]}},{type:"Feature",id:"TN",properties:{name:"Tennessee",value:66},geometry:{type:"Polygon",coordinates:[[[-88.054868,36.496384],[-88.071299,36.677123],[-87.852221,36.633308],[-86.592525,36.655216],[-85.486183,36.616877],[-85.289013,36.627831],[-84.544149,36.594969],[-83.689746,36.584015],[-83.673316,36.600446],[-81.679709,36.589492],[-81.723525,36.353984],[-81.909741,36.304691],[-82.03571,36.118475],[-82.216449,36.156814],[-82.610789,35.965121],[-82.638174,36.063706],[-82.775097,35.997983],[-82.994175,35.773428],[-83.251591,35.718659],[-83.498053,35.565304],[-83.7719,35.559827],[-84.018363,35.41195],[-84.09504,35.247642],[-84.29221,35.225734],[-84.319594,34.990226],[-85.606675,34.984749],[-87.359296,35.00118],[-88.202745,34.995703],[-88.471115,34.995703],[-90.311367,34.995703],[-90.212782,35.023087],[-90.114197,35.198349],[-90.130628,35.439335],[-89.944412,35.603643],[-89.911551,35.756997],[-89.763673,35.811767],[-89.730812,35.997983],[-89.533642,36.249922],[-89.539119,36.496384],[-89.484349,36.496384],[-89.418626,36.496384],[-89.298133,36.507338],[-88.054868,36.496384]]]}},{type:"Feature",id:"TX",properties:{name:"Texas",value:29},geometry:{type:"Polygon",coordinates:[[[-101.812942,36.501861],[-100.000075,36.501861],[-100.000075,34.563024],[-99.923398,34.573978],[-99.698843,34.382285],[-99.57835,34.415147],[-99.260688,34.404193],[-99.189488,34.2125],[-98.986841,34.223454],[-98.767763,34.135823],[-98.570593,34.146777],[-98.488439,34.064623],[-98.36247,34.157731],[-98.170777,34.113915],[-98.088623,34.004376],[-97.946222,33.987946],[-97.869545,33.851022],[-97.694283,33.982469],[-97.458774,33.905791],[-97.371143,33.823637],[-97.256128,33.861976],[-97.173974,33.736006],[-96.922034,33.960561],[-96.850834,33.845545],[-96.631756,33.845545],[-96.423633,33.774345],[-96.346956,33.686714],[-96.149786,33.840068],[-95.936185,33.889361],[-95.8376,33.834591],[-95.602092,33.933176],[-95.547322,33.878407],[-95.289906,33.87293],[-95.224183,33.960561],[-94.966767,33.861976],[-94.868182,33.74696],[-94.484796,33.637421],[-94.380734,33.544313],[-94.183564,33.593606],[-94.041164,33.54979],[-94.041164,33.018527],[-94.041164,31.994339],[-93.822086,31.775262],[-93.816609,31.556184],[-93.542762,31.15089],[-93.526331,30.93729],[-93.630393,30.679874],[-93.728978,30.575812],[-93.696116,30.438888],[-93.767317,30.334826],[-93.690639,30.143133],[-93.926148,29.787132],[-93.838517,29.688547],[-94.002825,29.68307],[-94.523134,29.546147],[-94.70935,29.622824],[-94.742212,29.787132],[-94.873659,29.672117],[-94.966767,29.699501],[-95.016059,29.557101],[-94.911997,29.496854],[-94.895566,29.310638],[-95.081782,29.113469],[-95.383014,28.867006],[-95.985477,28.604113],[-96.045724,28.647929],[-96.226463,28.582205],[-96.23194,28.642452],[-96.478402,28.598636],[-96.593418,28.724606],[-96.664618,28.697221],[-96.401725,28.439805],[-96.593418,28.357651],[-96.774157,28.406943],[-96.801542,28.226204],[-97.026096,28.039988],[-97.256128,27.694941],[-97.404005,27.333463],[-97.513544,27.360848],[-97.540929,27.229401],[-97.425913,27.262263],[-97.480682,26.99937],[-97.557359,26.988416],[-97.562836,26.840538],[-97.469728,26.758384],[-97.442344,26.457153],[-97.332805,26.353091],[-97.30542,26.161398],[-97.217789,25.991613],[-97.524498,25.887551],[-97.650467,26.018997],[-97.885976,26.06829],[-98.198161,26.057336],[-98.466531,26.221644],[-98.669178,26.238075],[-98.822533,26.369522],[-99.030656,26.413337],[-99.173057,26.539307],[-99.266165,26.840538],[-99.446904,27.021277],[-99.424996,27.174632],[-99.50715,27.33894],[-99.479765,27.48134],[-99.605735,27.640172],[-99.709797,27.656603],[-99.879582,27.799003],[-99.934351,27.979742],[-100.082229,28.14405],[-100.29583,28.280974],[-100.399891,28.582205],[-100.498476,28.66436],[-100.629923,28.905345],[-100.673738,29.102515],[-100.799708,29.244915],[-101.013309,29.370885],[-101.062601,29.458516],[-101.259771,29.535193],[-101.413125,29.754271],[-101.851281,29.803563],[-102.114174,29.792609],[-102.338728,29.869286],[-102.388021,29.765225],[-102.629006,29.732363],[-102.809745,29.524239],[-102.919284,29.190146],[-102.97953,29.184669],[-103.116454,28.987499],[-103.280762,28.982022],[-103.527224,29.135376],[-104.146119,29.381839],[-104.266611,29.513285],[-104.507597,29.639255],[-104.677382,29.924056],[-104.688336,30.181472],[-104.858121,30.389596],[-104.896459,30.570335],[-105.005998,30.685351],[-105.394861,30.855136],[-105.602985,31.085167],[-105.77277,31.167321],[-105.953509,31.364491],[-106.205448,31.468553],[-106.38071,31.731446],[-106.528588,31.786216],[-106.643603,31.901231],[-106.616219,31.999816],[-103.067161,31.999816],[-103.067161,33.002096],[-103.045254,34.01533],[-103.039777,36.501861],[-103.001438,36.501861],[-101.812942,36.501861]]]}},{type:"Feature",id:"UT",properties:{name:"Utah",value:87},geometry:{type:"Polygon",coordinates:[[[-112.164359,41.995232],[-111.047063,42.000709],[-111.047063,40.998429],[-109.04798,40.998429],[-109.053457,39.125316],[-109.058934,38.27639],[-109.042503,38.166851],[-109.042503,37.000263],[-110.499369,37.00574],[-114.048427,37.000263],[-114.04295,41.995232],[-112.164359,41.995232]]]}},{type:"Feature",id:"VT",properties:{name:"Vermont",value:55},geometry:{type:"Polygon",coordinates:[[[-71.503554,45.013027],[-71.4926,44.914442],[-71.629524,44.750133],[-71.536416,44.585825],[-71.700724,44.41604],[-72.034817,44.322932],[-72.02934,44.07647],[-72.116971,43.994316],[-72.204602,43.769761],[-72.379864,43.572591],[-72.456542,43.150867],[-72.445588,43.008466],[-72.533219,42.953697],[-72.544173,42.80582],[-72.456542,42.729142],[-73.267129,42.745573],[-73.278083,42.833204],[-73.245221,43.523299],[-73.404052,43.687607],[-73.349283,43.769761],[-73.436914,44.043608],[-73.321898,44.246255],[-73.294514,44.437948],[-73.387622,44.618687],[-73.332852,44.804903],[-73.343806,45.013027],[-72.308664,45.002073],[-71.503554,45.013027]]]}},{type:"Feature",id:"VA",properties:{name:"Virginia",value:55},geometry:{type:"MultiPolygon",coordinates:[[[[-75.397659,38.013497],[-75.244304,38.029928],[-75.375751,37.860142],[-75.512674,37.799896],[-75.594828,37.569865],[-75.802952,37.197433],[-75.972737,37.120755],[-76.027507,37.257679],[-75.939876,37.564388],[-75.671506,37.95325],[-75.397659,38.013497]]],[[[-78.349729,39.464886],[-77.82942,39.130793],[-77.719881,39.322485],[-77.566527,39.306055],[-77.456988,39.223901],[-77.456988,39.076023],[-77.248864,39.026731],[-77.117418,38.933623],[-77.040741,38.791222],[-77.128372,38.632391],[-77.248864,38.588575],[-77.325542,38.446175],[-77.281726,38.342113],[-77.013356,38.374975],[-76.964064,38.216144],[-76.613539,38.15042],[-76.514954,38.024451],[-76.235631,37.887527],[-76.3616,37.608203],[-76.246584,37.389126],[-76.383508,37.285064],[-76.399939,37.159094],[-76.273969,37.082417],[-76.410893,36.961924],[-76.619016,37.120755],[-76.668309,37.065986],[-76.48757,36.95097],[-75.994645,36.923586],[-75.868676,36.551154],[-79.510841,36.5402],[-80.294043,36.545677],[-80.978661,36.562108],[-81.679709,36.589492],[-83.673316,36.600446],[-83.136575,36.742847],[-83.070852,36.852385],[-82.879159,36.890724],[-82.868205,36.978355],[-82.720328,37.044078],[-82.720328,37.120755],[-82.353373,37.268633],[-81.969987,37.537003],[-81.986418,37.454849],[-81.849494,37.285064],[-81.679709,37.20291],[-81.55374,37.208387],[-81.362047,37.339833],[-81.225123,37.235771],[-80.967707,37.290541],[-80.513121,37.482234],[-80.474782,37.421987],[-80.29952,37.509618],[-80.294043,37.690357],[-80.184505,37.849189],[-79.998289,37.997066],[-79.921611,38.177805],[-79.724442,38.364021],[-79.647764,38.594052],[-79.477979,38.457129],[-79.313671,38.413313],[-79.209609,38.495467],[-78.996008,38.851469],[-78.870039,38.763838],[-78.404499,39.169131],[-78.349729,39.464886]]]]}},{type:"Feature",id:"WA",properties:{name:"Washington",value:77},geometry:{type:"MultiPolygon",coordinates:[[[[-117.033359,49.000239],[-117.044313,47.762451],[-117.038836,46.426077],[-117.055267,46.343923],[-116.92382,46.168661],[-116.918344,45.993399],[-118.988627,45.998876],[-119.125551,45.933153],[-119.525367,45.911245],[-119.963522,45.823614],[-120.209985,45.725029],[-120.505739,45.697644],[-120.637186,45.746937],[-121.18488,45.604536],[-121.217742,45.670259],[-121.535404,45.725029],[-121.809251,45.708598],[-122.247407,45.549767],[-122.762239,45.659305],[-122.811531,45.960537],[-122.904639,46.08103],[-123.11824,46.185092],[-123.211348,46.174138],[-123.370179,46.146753],[-123.545441,46.261769],[-123.72618,46.300108],[-123.874058,46.239861],[-124.065751,46.327492],[-124.027412,46.464416],[-123.895966,46.535616],[-124.098612,46.74374],[-124.235536,47.285957],[-124.31769,47.357157],[-124.427229,47.740543],[-124.624399,47.88842],[-124.706553,48.184175],[-124.597014,48.381345],[-124.394367,48.288237],[-123.983597,48.162267],[-123.704273,48.167744],[-123.424949,48.118452],[-123.162056,48.167744],[-123.036086,48.080113],[-122.800578,48.08559],[-122.636269,47.866512],[-122.515777,47.882943],[-122.493869,47.587189],[-122.422669,47.318818],[-122.324084,47.346203],[-122.422669,47.576235],[-122.395284,47.800789],[-122.230976,48.030821],[-122.362422,48.123929],[-122.373376,48.288237],[-122.471961,48.468976],[-122.422669,48.600422],[-122.488392,48.753777],[-122.647223,48.775685],[-122.795101,48.8907],[-122.756762,49.000239],[-117.033359,49.000239]]],[[[-122.718423,48.310145],[-122.586977,48.35396],[-122.608885,48.151313],[-122.767716,48.227991],[-122.718423,48.310145]]],[[[-123.025132,48.583992],[-122.915593,48.715438],[-122.767716,48.556607],[-122.811531,48.419683],[-123.041563,48.458022],[-123.025132,48.583992]]]]}},{type:"Feature",id:"WV",properties:{name:"West Virginia",value:57},geometry:{type:"Polygon",coordinates:[[[-80.518598,40.636951],[-80.518598,39.722302],[-79.477979,39.722302],[-79.488933,39.20747],[-79.291763,39.300578],[-79.094593,39.470363],[-78.963147,39.437501],[-78.765977,39.585379],[-78.470222,39.514178],[-78.431884,39.623717],[-78.267575,39.61824],[-78.174467,39.694917],[-78.004682,39.601809],[-77.834897,39.601809],[-77.719881,39.322485],[-77.82942,39.130793],[-78.349729,39.464886],[-78.404499,39.169131],[-78.870039,38.763838],[-78.996008,38.851469],[-79.209609,38.495467],[-79.313671,38.413313],[-79.477979,38.457129],[-79.647764,38.594052],[-79.724442,38.364021],[-79.921611,38.177805],[-79.998289,37.997066],[-80.184505,37.849189],[-80.294043,37.690357],[-80.29952,37.509618],[-80.474782,37.421987],[-80.513121,37.482234],[-80.967707,37.290541],[-81.225123,37.235771],[-81.362047,37.339833],[-81.55374,37.208387],[-81.679709,37.20291],[-81.849494,37.285064],[-81.986418,37.454849],[-81.969987,37.537003],[-82.101434,37.553434],[-82.293127,37.668449],[-82.342419,37.783465],[-82.50125,37.931343],[-82.621743,38.123036],[-82.594358,38.424267],[-82.331465,38.446175],[-82.293127,38.577622],[-82.172634,38.632391],[-82.221926,38.785745],[-82.03571,39.026731],[-81.887833,38.873376],[-81.783771,38.966484],[-81.811156,39.0815],[-81.685186,39.273193],[-81.57017,39.267716],[-81.455155,39.410117],[-81.345616,39.344393],[-81.219646,39.388209],[-80.830783,39.711348],[-80.737675,40.078303],[-80.600752,40.319289],[-80.595275,40.472643],[-80.666475,40.582182],[-80.518598,40.636951]]]}},{type:"Feature",id:"WI",properties:{name:"Wisconsin",value:99},geometry:{type:"Polygon",coordinates:[[[-90.415429,46.568478],[-90.229213,46.508231],[-90.119674,46.338446],[-89.09001,46.135799],[-88.662808,45.987922],[-88.531362,46.020784],[-88.10416,45.922199],[-87.989145,45.796229],[-87.781021,45.675736],[-87.791975,45.500474],[-87.885083,45.363551],[-87.649574,45.341643],[-87.742682,45.199243],[-87.589328,45.095181],[-87.627666,44.974688],[-87.819359,44.95278],[-87.983668,44.722749],[-88.043914,44.563917],[-87.928898,44.536533],[-87.775544,44.640595],[-87.611236,44.837764],[-87.403112,44.914442],[-87.238804,45.166381],[-87.03068,45.22115],[-87.047111,45.089704],[-87.189511,44.969211],[-87.468835,44.552964],[-87.545512,44.322932],[-87.540035,44.158624],[-87.644097,44.103854],[-87.737205,43.8793],[-87.704344,43.687607],[-87.791975,43.561637],[-87.912467,43.249452],[-87.885083,43.002989],[-87.76459,42.783912],[-87.802929,42.493634],[-88.788778,42.493634],[-90.639984,42.510065],[-90.711184,42.636034],[-91.067185,42.75105],[-91.143862,42.909881],[-91.176724,43.134436],[-91.056231,43.254929],[-91.204109,43.353514],[-91.215062,43.501391],[-91.269832,43.616407],[-91.242447,43.775238],[-91.43414,43.994316],[-91.592971,44.032654],[-91.877772,44.202439],[-91.927065,44.333886],[-92.233773,44.443425],[-92.337835,44.552964],[-92.545959,44.569394],[-92.808852,44.750133],[-92.737652,45.117088],[-92.75956,45.286874],[-92.644544,45.440228],[-92.770513,45.566198],[-92.885529,45.577151],[-92.869098,45.719552],[-92.639067,45.933153],[-92.354266,46.015307],[-92.29402,46.075553],[-92.29402,46.667063],[-92.091373,46.749217],[-92.014696,46.705401],[-91.790141,46.694447],[-91.09457,46.864232],[-90.837154,46.95734],[-90.749522,46.88614],[-90.886446,46.754694],[-90.55783,46.584908],[-90.415429,46.568478]]]}},{type:"Feature",id:"WY",properties:{name:"Wyoming",value:5},geometry:{type:"Polygon",coordinates:[[[-109.080842,45.002073],[-105.91517,45.002073],[-104.058488,44.996596],[-104.053011,43.002989],[-104.053011,41.003906],[-105.728954,40.998429],[-107.919731,41.003906],[-109.04798,40.998429],[-111.047063,40.998429],[-111.047063,42.000709],[-111.047063,44.476286],[-111.05254,45.002073],[-109.080842,45.002073]]]}}]},Nr=({data:t,geoJsonNode:e,formatOptions:r,chartId:c})=>{const x=Me.useRef();let n=Lt(t),l,s,p,f=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=jt,b,_,A,R,g=0,B=1,U,W=new Map,P=new Map,D=new Map,V=Number.MAX_VALUE,$=Number.MIN_VALUE,Z=0,ce=0,ne,ae;Me.useEffect(()=>{ue()},[r,c]);const ue=()=>{({chartFormatOptions:l,svg:R,width:s,height:p}=qt(x,r)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=ii(l,p,s),Xt(x,s,p,l),A=oa(R,S),Zt(x,u,s,l),ge(t),be(),pe(),Q()},ge=M=>{try{let h=new Set,k=new Set;M.forEach(i=>{i.data.forEach((y,T)=>{T===g&&(h.add(y.value.toString()),Z+=y.value),T===B&&(k.add(y.value.toString()),ce+=y.value)})});let o=l.colorScaleForMaps&&l.colorScaleForMaps.startColorForMaps?l.colorScaleForMaps.startColorForMaps:"#c1d8f3",d=l.colorScaleForMaps&&l.colorScaleForMaps.endColorForMaps?l.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(h.size===1)ne=()=>o;else{const i=v.interpolateLab(o,d);ne=v.scaleOrdinal().domain(Array.from(h)).range(Array.from(h).map((y,T)=>i(T/(h.size-1))))}if(k.size===1)ae=()=>o;else{const i=v.interpolateLab(l.colorScaleForMapsBubble.startColorForMapsBubble,l.colorScaleForMapsBubble.endColorForMapsBubble);ae=v.scaleOrdinal().domain(Array.from(k)).range(Array.from(k).map((y,T)=>i(T/(k.size-1))))}}catch(h){Ae("Maps.tsx","dataPreparation",h)}},be=M=>{U=Vr},pe=()=>{try{n?.forEach(M=>{D.set(M.legend,M)}),e.mappings.forEach(M=>{P.set(M.actualName,M.mappedName)}),e.groups.forEach(M=>{M.groupedRegions.forEach(h=>{W.set(h,M.groupName)})}),U.features.forEach(M=>{const h=M.properties.name;let k;if(P.has(h)){const o=P.get(h);M.properties.displayName=o,k=o}if(W.has(h)){const o=W.get(h);M.properties.displayName=o,k=o}else k=h;if(D.has(k)){const o=D.get(k);M.properties.data=o;let d;o.data&&o.data[1]&&(d=o.data[1]?o.data[1].value:0,V=Math.min(V,d),$=Math.max($,d)),o.data&&o.data[0]&&(d=o.data[0].value,f=Math.min(f,d),L=Math.max(L,d))}else M.properties.data=void 0})}catch(M){Ae("Maps.tsx","generateDataForMaps",M)}},Q=()=>{try{let M=0;const h=v.geoAlbersUsa().fitSize([_,b],U),k=v.geoPath().projection(h),o=A.append("g").attr("class","paths");if(o.selectAll(c+" .path-group").data(U.features).enter().append("path").attr("id",d=>d.properties.name).attr("fill",(d,i)=>G(d)).attr("stroke",d=>d.properties.data?"unset":"#CCCCCC").attr("fill-opacity",l.plotArea.opacity).attr("stroke-width","0.4px").attr("d",d=>(M+=k.area(d),k(d))).on("mousemove",(d,i)=>{let y=i.properties.data;if(y){let T=y.data.map(a=>({key:a.dimension,value:qe("None",l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.value)}));yt([{key:"Region",value:y.properties.alias},...T],l,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(d,i)=>{ot()}),l.plotArea.dataLabels){const d=M/U.features.length,i=l.plotArea.dataLabelName,y=l.plotArea.dataLabelValue,T=a=>l.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?k.area(a)<d*.25:!1;o.selectAll(".text-container").data(U.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>k.centroid(a)[0]-50).attr("y",a=>{const m=k.centroid(a);return i&&y?m[1]-15:m[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let m=a.properties.data;if((i||y)&&m&&!T(a)){if(T(a))return null;const N=m?.properties.alias||a.properties.displayName,re=l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/Z*100)+"%":qe(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let K="";return l.plotArea.dataLabelName&&(K+=`<div style=
144
+ </span>`),a}catch(T){return me(Na,"drawDonutDataLabels",T),""}}),g.animation.animationEnabled&&z.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",1)}}catch(s){me(Na,"drawDonutDataLabels",s)}},k=()=>{try{if(g.total&&g.total.totalVisibility){let s=ye,d=g.total.totalFontStyle;const i=z.append("g").attr("transform",X()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",g.total.totalColor!==Ie.white?g.total.totalColor:"none").style("font-family",g.total.totalFontFamily).style("font-size",g.total.totalFontSize).style("font-style",d.includes(ce.italic)?ce.italic:"").style("text-decoration",d.includes(ce.underline)?ce.underline:"").style("font-weight",d.includes(ce.bold)?ce.bold:"").attr("text-anchor","middle").attr("visibility",g.plotArea.dataLabelValue?"visible":"hidden").text(g.total.showTotalLabel!==!1?g.total.editTotalText:"").append("tspan").attr("x",0).attr("y",g.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",d.includes(ce.bold)?ce.bold:300).text(g.total.totalNumberFormat===",.0%"||g.total.totalNumberFormat==="Percentage"?"100%":Ke(g.total.totalDisplayUnits,g.total.totalNumberFormat,g.total.totalDecimalPrecision)(s)),g.animation.animationEnabled&&i.attr("opacity",0).transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",1)}}catch(s){me(Na,"drawTotalValue",s)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:m,id:n,style:{width:"100%",height:"100%"}})})},Ka="TreemapChart.tsx",Fr=({data:t,formatOptions:e,chartId:n,onElementClick:o,vfxPickModeActive:x,tooltipFormatter:l})=>{const r=Ce.useRef(),c=Ce.useRef(o);c.current=o;const p=Ce.useRef(x);p.current=x;let m,L,u,S=40,g=Jt,W,A,E,b,U,Y;Ce.useEffect(()=>{H()},[e]);const H=()=>{({chartFormatOptions:m,svg:Y,width:L,height:u}=Kt(r,e)),{margins:g,chartTitleHeight:S,innerHeight:W,innerWidth:A}=ri(m,u,L,!0),qt(r,L,u,m),E=oa(Y,g),Xt(r,S,L,m),I(),D(),ye()},I=()=>{try{const se={name:"root",children:t.ChartData},te=v.hierarchy(se).sum(xe=>xe.data&&xe.data[0].value).sort((xe,ge)=>(ge.data.data[0].value??0)-(xe.data.data[0].value??0));b=v.treemap().tile(v.treemapSquarify).size([A,W]).padding(1).round(!0)(te).leaves(),U=b[0].data.properties.color}catch(se){me(Ka,"initChartData",se)}},D=()=>{try{if(m.colorScale.showColor===Ta.colorTheme){let te=b[0].data.data.length>1?1:0,xe=m.colorScale.startColor,ge=m.colorScale.endColor,pe=new Set(b.map(M=>M.data.data[te].value)),he=Array.from(pe).sort((M,h)=>M-h),O=he.length,X;if(O===1)X=()=>xe;else{const M=v.interpolateLab(xe,ge);X=v.scaleOrdinal().domain(he.map(String)).range(he.map((h,k)=>M(k/(O-1))))}b=b.map(M=>{let h=M.data.data[te].value;return{...M,data:{...M.data,properties:{...M.data.properties,themeColor:X(h.toString())}}}}),w(xe,ge,O,he)}}catch(se){me(Ka,"prepareTreeColors",se)}},w=(se,te,xe,ge)=>{try{let pe=v.scalePow().exponent(1).domain([0,xe-1]).range([se,te]),O=Y.append("foreignObject").attr("class","parentGroup").attr("x",L-130).attr("y",u-30).attr("width",115).attr("height",10).selectAll(null).data(ge).enter().append("xhtml:div").style("width",`${100/xe}%`).style("height","100%").style("flex-direction","row").style("display","inline-block").attr("width","20px").attr("height","10px").style("background-color",(M,h)=>pe(h)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const X=Y.append("g").attr("transform",`translate(${L-120},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",m.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",m.yAxisTitle.yAxisTitleFontFamily).text("min");Y.append("g").attr("transform",`translate(${L-10},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",m.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",m.yAxisTitle.yAxisTitleFontFamily).text("max")}catch(pe){me(Ka,"appendColorScale",pe)}},z=se=>{try{switch(m.colorScale.showColor){case Ta.none:return U;case Ta.discrete:return se.properties.color;case Ta.colorTheme:return se.properties.themeColor;default:return}}catch(te){me(Ka,"getColor",te)}},K=se=>{try{const te=se?.currentTarget?.__data__?.data?.properties;if(!te)return;switch(m.colorScale.showColor){case Ta.none:return{...te,markerColor:U};case Ta.colorTheme:return{...te,markerColor:te.themeColor};case Ta.discrete:default:return te}}catch(te){me(Ka,"getMarkerColorForTooltip",te)}},ye=()=>{try{const se=m.animation.animationEnabled,te=E.selectAll("g").data(b).enter().append("g").attr("transform",ge=>`translate(${ge.x0},${ge.y0})`),xe=te.append("rect").attr("fill",ge=>z(ge.data)).attr("fill-opacity",se?0:.7).attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0).on("mousemove",(ge,pe)=>{ut([{key:m.yAxisTitle.yAxisTitleText,value:Ke(m.toolTip.toolTipDisplayUnits,m.toolTip.toolTipNumberFormat,m.toolTip.toolTipDecimalPrecision)(pe.data.data[0].value)},{key:"Legend",value:pe.data.data[0].legend}],m,void 0,K(ge),At(l,String(pe.data.data[0]?.legend??""),K(ge)))}).on("mouseout",()=>ot()).attr(lt.SeriesId,ge=>String(ge.data.properties?.legendUniqueId??ge.data.legend??"")).attr(lt.DimValue,ge=>String(ge.data.data[0].legend??"")).on("click",vt(p,c,(ge,pe)=>{const he=String(pe.data.properties?.legendUniqueId??pe.data.legend??""),O=String(pe.data.data[0].legend??"");return{seriesId:he,dimValue:O,legendUniqueId:he,seriesDisplayName:String(pe.data.properties?.alias||pe.data.properties?.name||O)}}));if(se&&xe.transition().duration(m.animation.animationDuration).ease(et[m.animation.animationEffect]).attr("fill-opacity",.7),te.append("clipPath").attr("id",(ge,pe)=>`clip-${pe}-${n}`).append("rect").attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0),m.plotArea.dataLabels){const ge=m.annotation.annotationRangeFilter;te.filter(pe=>{if(!ge?.enabled)return!0;const he=pe.data.data[0].value;switch(ge.condition){case"lt":return he<ge.maxVal;case"gt":return he>ge.minVal;case"in":return he>=ge.minVal&&he<=ge.maxVal;case"not-in":return he<ge.minVal||he>ge.maxVal;default:return!0}}).append("text").style("fill",pe=>pe.data.properties.labelFontColor).style("font-family",pe=>pe.data.properties.fontFamily).style("font-size",pe=>pe.data.properties.fontSize).style("font-style",pe=>pe.data.properties.fontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",pe=>pe.data.properties.fontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",pe=>pe.data.properties.fontStyle.includes(ce.bold)?ce.bold:"").attr("clip-path",(pe,he)=>`url(#clip-${he}-${n})`),m.plotArea.dataLabelName&&te.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(pe=>pe.data.legend),m.plotArea.dataLabelValue&&te.selectAll("text").append("tspan").attr("x",5).attr("y",m.plotArea.dataLabelName?"2.1em":"1.1em").text(pe=>Ke(m.plotArea.plotAreaDisplayUnits,m.plotArea.dataLabelNumberFormat,m.plotArea.dataLabelDecimalPrecision)(pe.data.data[0].value)),se&&te.selectAll("text").attr("opacity",0).transition().duration(m.animation.animationDuration).ease(et[m.animation.animationEffect]).attr("opacity",1)}}catch(se){me(Ka,"initChartRect",se)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:r,id:n,style:{width:"100%",height:"100%"}})})},ca="PieofPieChart.tsx",wr=({data:t,formatOptions:e,chartId:n,legendProperties:o,tooltipFormatter:x})=>{const l=Ce.useRef();let r,c,p,m=40,L=Jt,u,S,g,W,A,E,b,U,Y,H,I,D,w,z=[0,0],K,ye;Ce.useEffect(()=>{se()},[e]);const se=()=>{({chartFormatOptions:r,svg:W,width:c,height:p}=Kt(l,e)),{plotArea:ye}=r,te(),{margins:L,innerHeight:u,innerWidth:S,legendListWidth:K,chartTitleHeight:m}=Ua(r,c,p,z,L),xe(),qt(l,c,p,r),g=oa(W,L),Xt(l,m,c,r),ge(),pe(),h(),Vi(r,U,m,W,c,p),d()},te=()=>{try{let i=$t(qi(o,"name"),rt(r.legends.legendFontSize),r.legends.legendFontFamily);z=[i.width,i.height]}catch(i){me(ca,"calculateMaxPossibleWidth",i)}},xe=()=>{try{E=Math.min(u*.4,S*.4),b=r.pieofPie.pieOfPieRadius}catch(i){me(ca,"calculatePieRadius",i)}},ge=()=>{try{let i=new Map;o.forEach(a=>{i.set(a.name,a)}),U=0,t.forEach(a=>{a.properties=i.get(a.legend),U+=a.data[0].value,a.children&&a.children.forEach(f=>f.properties=i.get(f.legend))}),A=v.pie().value(a=>a.data[0].value)(t).map((a,f)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:E,depth:2}))}catch(i){me(ca,"initChartData",i)}},pe=()=>{try{const i=v.arc().innerRadius(0).outerRadius(E),y=v.arc().innerRadius(0).outerRadius(E+10),T=g.append("g").attr("class","parentGroup").attr("fill-opacity",r.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data(A).enter().append("path").attr("class",a=>"path "+a.data.legend).attr("hoverId",a=>a.data.legend.replace(/ /g,"-")).attr("fill",a=>a.data.properties.color!==Ie.white?a.data.properties.color:"none").on("mouseover.arc",function(a){v.select(this).transition().duration(100).attr("d",y)}).on("mousemove.text",a=>{ut([{key:r.yAxisTitle.yAxisTitleText,value:r.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/U)*100).toFixed(rt(r.toolTip.toolTipDecimalPrecision)??0)+"%":Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],r,void 0,a.currentTarget.__data__.data.properties,At(x,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(a){v.select(this).transition().duration(100).attr("d",i),ot()}).on("click",(a,f)=>{try{let N=f;if(N.data.children&&N.data.children.length>1){g.selectAll(".childGroup").remove(),g.selectAll(".childLabels").remove(),g.selectAll("line").remove(),Y=N.data.legend;let ne=90-(f.x0+f.x1)/2/Math.PI*180;he(N.data.children,ne,f)}}catch(N){me(ca,"drawPieChart_onClick",N)}});r.animation.animationEnabled?T.transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attrTween("d",function(a){const f=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return N=>i(f(N))}):T.attr("d",a=>i(a))}catch(i){me(ca,"drawPieChart",i)}},he=(i,y,T)=>{try{g.select(".parentGroup").transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`),g.selectAll(".parentLabels").transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`);let f=v.pie().value(Z=>Z.data[0].value)(i).map((Z,fe)=>({...Z,x0:Z.startAngle,x1:Z.endAngle,y0:0,y1:b,depth:2}));const N=v.arc().innerRadius(0).outerRadius(b),ne=v.arc().innerRadius(0).outerRadius(b+10);g.append("g").attr("class","childGroup").attr("fill-opacity",r.plotArea.opacity).attr("transform",`${X()}`).selectAll("path").data(f).enter().append("path").attr("class",Z=>"path "+Z.data.legend).attr("hoverId",Z=>Z.data.legend.replace(/ /g,"-")).attr("fill",Z=>Z.data.properties.color!==Ie.white?Z.data.properties.color:"none").attr("d",Z=>N(Z)).on("mouseover.arc",function(Z){v.select(this).transition().duration(100).attr("d",ne)}).on("mousemove.text",Z=>{ut([{key:r.yAxisTitle.yAxisTitleText,value:r.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(Z.currentTarget.__data__.data.data[0].value/U)*100).toFixed(rt(r.toolTip.toolTipDecimalPrecision))+"%":Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(Z.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:Z.currentTarget.__data__.data.legend}],r,void 0,Z.currentTarget.__data__.data.properties,At(x,String(Z.currentTarget.__data__.data.legend??""),Z.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(Z){v.select(this).transition().duration(100).attr("d",N),ot()}),k(f),s(T,i)}catch(a){me(ca,"drawChildPie",a)}},O=()=>{try{return H=Y?3*S/8:S/2,I=u/2,`translate(${H},${I})`}catch(i){me(ca,"getParentPiePosition",i)}},X=()=>{try{return D=3*S/4,w=u/2,`translate(${D},${w})`}catch(i){me(ca,"getChildPiePosition",i)}},M=(i,y)=>{try{const T=(i.startAngle+i.endAngle)/2,a=Math.cos(T-Math.PI/2)*(y*.65),f=Math.sin(T-Math.PI/2)*(y*.65);let N=T*180/Math.PI-90;return`translate(${a},${f}) rotate(${N})`}catch(T){me(ca,"getDataLabelTransformString",T)}},h=()=>{try{r.plotArea.dataLabels&&(g.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(A,r,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.labelFontSize??11).attr("fill",i=>i.data.properties?.labelFontColor??Ie.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",i=>i.data.properties?.labelFont??tt).attr("transform",i=>M(i,E)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:y}=r;return y.dataLabelName?i.data.legend:""}),g.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(A,r,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.valueFontSize??11).attr("fill",i=>i.data.properties?.valueFontColor??Ie.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??tt).attr("transform",i=>M(i,E)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(r.plotArea.dataLabelValue){const y=i.data.data[0].value;return r.plotArea.dataLabelName&&r.plotArea.dataLabelValue&&y!==void 0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y/U)*100).toFixed(rt(r.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(y):y}}))}catch(i){me(ca,"drawParentPieDataLabels",i)}},k=i=>{try{r.plotArea.dataLabels&&(g.append("g").attr("class","childLabels parentGroup").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(i,r,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??Ie.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,b)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:T}=r;return T.dataLabelName?y.data.legend:""}),g.append("g").attr("class","childLabels parentGroup").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(i,r,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.valueFontColor??Ie.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("transform",y=>M(y,b)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(y=>{if(r.plotArea.dataLabelValue){const T=y.data.data[0].value;return r.plotArea.dataLabelName&&r.plotArea.dataLabelValue&&T!==void 0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/U)*100).toFixed(rt(r.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(T):T}}))}catch(y){me(ca,"drawChildPieDataLabels",y)}},s=(i,y)=>{try{let T=Math.abs(i.x0-i.x1)/2,f=i.y1*Math.sin(T),N=f/Math.tan(T);g.append("line").style("stroke",r.pieofPie.pieOfPieLineColor).style("stroke-width",r.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",H+N).attr("y1",I-f).attr("x2",D).attr("y2",w-b),g.append("line").style("stroke",r.pieofPie.pieOfPieLineColor).style("stroke-width",r.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",H+N).attr("y1",I+f).attr("x2",D).attr("y2",w+b)}catch(T){me(ca,"drawLines",T)}},d=()=>{try{let i=o.map(y=>({legend:y.name,properties:y,data:[]}))}catch(i){me(ca,"initLegendList",i)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:n,style:{width:"100%",height:"100%"}})})},pa="PyramidChart.tsx",Dr=({data:t,formatOptions:e,chartId:n,onDataLabelCoordinatesChange:o,addLocalFilterFromLib:x,tooltipFormatter:l})=>{const r=Ce.useRef();let c=mt(t.ChartData),p,m,L,u,S=40,g=Jt,W=[0,0],A,E,b,U,Y=[0],H,I,D,w;Ce.useEffect(()=>{z()},[e]);const z=()=>{({chartFormatOptions:p,svg:m,width:L,height:u}=Kt(r,e)),W=Ha(p,c),{margins:g,innerHeight:A,innerWidth:E,legendListWidth:D,chartTitleHeight:S}=Ua(p,L,u,W,g),K(),qt(r,L,u,p),H=ye(),Xt(r,S,L,p),Wa(p,m,c,L,u,D,S,n,g,ct.rectangle,!1,x),se(),te(),ge(),xe()},K=()=>{try{b=Math.min(A,E),U=.866*b}catch(he){me(pa,"initPyramidSideCalculations",he)}},ye=()=>{try{return m.append("g").attr("transform",`translate(${g.left},${g.top+(A-U)/2})`)}catch(he){return me(pa,"initChartArea",he),null}},se=()=>{try{c=c.sort((he,O)=>{const X=he.data[0].value,M=O.data[0].value;return p.plotArea.flipPyramid?M-X:X-M}),I=v.sum(c,he=>Math.abs(he.data[0].value)),Y=[0],c.forEach((he,O)=>{const X=Math.abs(he.data[0].value)/I*U;Y.push(Y[O]+X)})}catch(he){me(pa,"initPyramidData",he)}},te=()=>{try{c.forEach((he,O)=>{try{const X=Y[O],M=Y[O+1];let h=p.plotArea.flipPyramid?1:0;const k=b*(h-Y[O]/U),s=b*(h-Y[O+1]/U),d=E/2,i=H.append("g").attr("id","PyramidChart").attr("class","parentGroup"),y=p.animation.animationEnabled,T=i.append("polygon").attr("class","segment").attr("hoverId",he.legend.replace(/\s+/g,"-")).attr("data-series-id",he.legendUniqueId??he.legend).attr("data-dim-value",he.legend).attr("points",`
145
+ ${d-k/2},${X}
146
+ ${d+k/2},${X}
147
+ ${d+s/2},${M}
148
+ ${d-s/2},${M}
149
+ `).attr("fill",he.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{ut([{key:he.legend,value:p.toolTip.toolTipNumberFormat==",.0%"?he.data[0].value?(Math.abs(he.data[0].value/I)*100).toFixed(rt(p.toolTip.toolTipDecimalPrecision))+"%":"":Ke(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(he.data[0].value)}],p,void 0,he.properties,At(l,String(he.legend??""),he.properties)),v.select(this).style("opacity",.8).style("stroke",p.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){me(pa,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{ot(),v.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){me(pa,"drawPyramidChart.onMouseOut",a)}});y&&T.transition().duration(p.animation.animationDuration).ease(et[p.animation.animationEffect]).attr("opacity",1)}catch(X){me(pa,"drawPyramidChart.forEach",X)}})}catch(he){me(pa,"drawPyramidChart",he)}},xe=he=>{try{if(p.annotation.annotationVisibility){let O=pt.annotation(),X=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None",M=Ut(w,p,s=>s.data.measure);const h=p.annotation.connectorStyle?.toLowerCase();O.editMode(p.annotation.annotationDraggable).accessors({x:function(){return E*.5},y:function(s,d){return s.y}}).on("dragend",function(s){try{M.forEach(d=>{d.data.legend===s.data.legend&&(d.dx=s._dx,d.dy=s._dy,d.width=L,d.height=u)}),o&&o(M.map(d=>({data:{legend:d.data.legend,isVisible:d.data.isVisible??!0},dx:d.dx,dy:d.dy,width:L,height:u}))),k.selectAll(".connector").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[h]),k.selectAll(`.connector-${X}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend.replace(/\s+/g,"-")).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[h]).filter(d=>d._dx==0&&d._dy==0).remove(),k.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block"),k.selectAll(".annotation-note-title").filter(d=>d.data&&d.data.isVisible).style("display","block")}catch(d){me(pa,"pyramidAnnotations.onDragEnd",d)}}).notePadding(0).annotations(M);let k=H.append("g").attr("class","annotation-group parentGroup").call(O);p.animation.animationEnabled&&k.attr("opacity",0).transition().duration(p.animation.animationDuration).ease(et[p.animation.animationEffect]).attr("opacity",1),k.selectAll("rect").style("visibility","hidden"),k.selectAll(".annotation-subject").remove(),k.selectAll(".connector").style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[h]),k.selectAll(`.connector-${X}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[h]).filter(s=>s._dx==0&&s._dy==0).remove(),k.selectAll(".connector-end").filter(s=>s.connector.end=="dot"&&s._dx==0&&s._dy==0).remove(),k.selectAll(".annotation-note-label").filter(s=>s.data&&!s.data.isVisible).style("display","none"),k.selectAll(".annotation-note-title").filter(s=>s.data&&!s.data.isVisible).style("display","none"),p.annotation.annotationType==jt.automatic&&k.selectAll(".annotation-note-content").attr("transform",function(){const d=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(d)return`translate(${parseFloat(d[1])}, 0)`}),k.selectAll(".annotation-note-label").attr("y","15").attr("text-anchor","middle"),k.selectAll(".annotation-note-title").attr("text-anchor","middle"),k.selectAll(".annotation-note-content").attr("transform","translate(0,-28)"),!p.plotArea.dataLabelName&&k.selectAll("tspan").attr("dy","0"),p.plotArea.dataLabelName&&k.selectAll(".annotation-note-title").attr("hoverId",s=>s.data.legend.replace(/\s+/g,"-")).style("font-size",s=>s.data.labelFontSize).attr("font-family",s=>s.data.labelFontFamily).style("font-style",s=>s.data.labelFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",s=>s.data.labelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",s=>s.data.labelFontStyle.includes(ce.bold)?ce.bold:"300").style("fill",s=>s.data.labelFontColor),p.plotArea.dataLabelValue&&k.selectAll(".annotation-note-label").attr("hoverId",s=>s.data.legend.replace(/\s+/g,"-")).style("font-size",s=>s.data.valueFontSize).attr("font-family",s=>s.data.valueFontFamily).style("font-style",s=>s.data.valueFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",s=>s.data.valueFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",s=>s.data.valueFontStyle.includes(ce.bold)?ce.bold:"300").style("fill",s=>s.data.valueFontColor)}}catch(O){me(pa,"pyramidAnnotations",O)}},ge=()=>{try{let he=p.annotation.annotationType??"1",O=[he=="1"?"connector":""],X=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"none";const M=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates||[])),h=new Map(M.map(k=>[k.data?.legend,k]));w=[],c.forEach((k,s)=>{try{const d=p.annotation.annotationVisibility,i=c.length-1;if(d===jt.none||d===jt.startOnly&&s!==0||d===jt.endOnly&&s!==i||d===jt.startAndEndBoth&&s!==0&&s!==i)return;let y={note:{title:p.plotArea.dataLabelName?k.properties.alias:"",label:p.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(k.data[0].value/I)*100).toFixed(rt(p.plotArea.dataLabelDecimalPrecision))+"%":p.plotArea.dataLabelValue?k.data[0].value>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(k.data[0].value/1e9)+"B":Ke(p.annotation.annotationDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(k.data[0].value):"",align:"middle"},data:{x:E/2,y:pe(k,s,k.properties.dataLabelPosition),isVisible:!0,dimension:k.legend,legend:k.legend,measure:k.data[0].value,labelFontFamily:k.properties.labelFont,labelFontSize:k.properties.labelFontSize,labelFontColor:k.properties.labelFontColor,labelFontStyle:k.properties.labelFontStyle,valueFontFamily:k.properties.valueFont,valueFontSize:k.properties.valueFontSize,valueFontColor:k.properties.valueFontColor,valueFontStyle:k.properties.valueFontStyle},dx:0,dy:0,connector:{end:X,curve:wl[p.annotation.connectorCurve]},disable:O,subject:{height:15,width:15},type:Dl[he],color:p.plotArea.dataLabelNameColor!=Ie.black?p.plotArea.dataLabelNameColor:Ie.black,height:L,width:L,index:s};const T=h.get(k.legend);T&&(y.dx=T.dx*L/(T.width||L),y.dy=T.dy*u/(T.height||u),y.data.isVisible=T.data?.isVisible??!0),w.push(y)}catch(d){me(pa,"prepareNewAnnotationsList.forEach",d)}})}catch(he){me(pa,"prepareNewAnnotationsList",he)}},pe=(he,O,X)=>{try{switch(X){case hi.top:return Y[O]+30;case hi.middle:return(Y[O]+Y[O+1])/2+15;case hi.bottom:return Y[O+1];default:return Y[O]+30}}catch(M){return me(pa,"getYCordinate",M),0}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:r,id:n,style:{width:"100%",height:"100%"}})})},Sa="ProgressChart.tsx",Vr=({data:{ChartData:t},formatOptions:e,chartId:n,addLocalFilterFromLib:o,tooltipFormatter:x})=>{const l=Ce.useRef();let r=mt(t),c,p,m,L=40,u=Jt,S=[0,0],g,W,A,E,b,U,Y,H;const I=1,D=0;Ce.useEffect(()=>{w()},[e]);const w=()=>{({chartFormatOptions:c,svg:b,width:p,height:m}=Kt(l,e)),S=Ha(c,r),{margins:u,innerHeight:g,innerWidth:W,legendListWidth:U,chartTitleHeight:L}=Ua(c,p,m,S,u),z(),qt(l,p,m,c),E=oa(b,u),Xt(l,L,p,c),Wa(c,b,r,p,m,U,L,n,u,ct.hollowCircle,!0,o),K(),ye(),Vi(c,A,L,b,p,m)},z=()=>{try{Y=Math.min(g*.45,W*.45),H=Math.min(rt(c.plotArea.innerRadius)/100*Y,Y)}catch(te){me(Sa,"setRadiusAndInnerRadius",te)}},K=()=>{try{A=t[I].data[0].value+t[D].data[0].value}catch(te){me(Sa,"initProgressChartData",te)}},ye=()=>{try{let te=t[I].data[0].value,xe=t[D].data[0].value,ge=Math.PI*2,pe=xe/te*Math.PI*2,he=c.plotArea.dataLabelValueFontStyle;const O=v.arc().innerRadius(H).outerRadius(Y).startAngle(0).cornerRadius(rt(c.plotArea.cornerRadius));E.append("path").attr("class","secondary-circle").attr("fill",t[I].properties.color).attr("fill-opacity",c.plotArea.opacityforProgressScale).attr("hoverId",M=>(t[I]?.properties?.alias||t[I]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[I].properties.legendUniqueId??t[I].properties.alias??"*").attr("data-dim-value",t[I].properties.alias??"*").attr("d",O({endAngle:ge})).on("mousemove",M=>{try{ut([{key:t[I].properties.alias,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(te)}],c,void 0,t[I].properties,At(x,String(t[I].properties?.alias??""),t[I].properties))}catch(h){me(Sa,"drawProgressChart.onMouseMove.secondary-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){me(Sa,"drawProgressChart.onMouseOut.secondary-circle",M)}}).attr("transform",se()),E.append("path").attr("class","progress-circle").attr("fill",t[D].properties.color).attr("fill-opacity",c.plotArea.opacityforProgressGoal).attr("hoverId",M=>(t[D]?.properties?.alias||t[D]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[D].properties.legendUniqueId??t[D].properties.alias??"*").attr("data-dim-value",t[D].properties.alias??"*").attr("d",O({endAngle:pe})).on("mousemove",M=>{try{ut([{key:t[D].properties.alias,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(xe/te*100)+"%":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(te)},{key:t[I].properties.alias,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(xe)}],c,void 0,t[D].properties,At(x,String(t[D].properties?.alias??""),t[D].properties))}catch(h){me(Sa,"drawProgressChart.onMouseMove.progress-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){me(Sa,"drawProgressChart.onMouseOut.progress-circle",M)}}).attr("transform","translate("+W/2+","+g/2+")").transition().duration(c.animation.animationEnabled?c.animation.animationDuration:0).ease(et[c.animation.animationEffect]).attrTween("d",function(M){try{const h=v.interpolate(0,pe);return function(k){try{return O({endAngle:h(k)})}catch(s){return me(Sa,"drawProgressChart.attrTween.inner",s),""}}}catch(h){return me(Sa,"drawProgressChart.attrTween",h),()=>""}});const X=E.append("text").attr("transform",se()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>c.plotArea.dataLabels&&Oi([{value:xe}],c,h=>h?.value??0).length>0?"visible":"hidden").attr("fill",c.plotArea.dataLabelValueColor!==Ie.white?c.plotArea.dataLabelValueColor:c.toolTip.toolTipDisplayUnits).attr("font-style",he.includes(ce.italic)?ce.italic:"").attr("text-decoration",he.includes(ce.underline)?ce.underline:"").attr("font-weight",he.includes(ce.bold)?ce.bold:"").attr("font-family",c.plotArea.dataLabelValueFontFamily).attr("font-size",c.plotArea.dataLabelValueFontSize).text(()=>c.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(xe/te*100)+"%":Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.dataLabelNumberFormatProgress,c.plotArea.dataLabelDecimalPrecision)(xe));c.animation.animationEnabled&&X.attr("opacity",0).transition().duration(c.animation.animationDuration).ease(et[c.animation.animationEffect]).attr("opacity",1)}catch(te){me(Sa,"drawProgressChart",te)}},se=()=>{try{return"translate("+W/2+","+g/2+")"}catch(te){return me(Sa,"getTransformString",te),""}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:n,style:{width:"100%",height:"100%"}})})},Nr=({data:{ChartData:t},formatOptions:e,chartId:n})=>{const o=Ce.useRef(),x=mt(t);let l,r,c,p=40,m=Jt,L,u,S,g,W,A,E,b,U,Y,H,I={},D;const w="Speedometer.tsx";Ce.useEffect(()=>{z()},[e]);const z=()=>{({chartFormatOptions:l,svg:g,width:r,height:c}=Kt(o,e)),{margins:m,chartTitleHeight:p,innerHeight:L,innerWidth:u}=ri(l,c,r),K(),qt(o,r,c,l),S=oa(g,m),Xt(o,p,r,l),se(),te(),ge(),he()},K=()=>{try{let h;L*.8<u*.45?(W=L*.8,h="width"):(W=u*.45,h="height"),D=ye(h),A=rt(l.plotArea.innerRadiusForSpeedometer)/100*W}catch(h){me(w,"initChartRadius",h)}};function ye(h){try{return h=="height"?`translate(${u/2},${L/2+W/2})`:`translate(${u/2},${c-60})`}catch(k){return me(w,"centerTranslation",k),""}}const se=()=>{try{let h=t[0].data[0].value;h<0?(E=0,b=h):(E=h,b=0),l.customScaling.customScalingtoggle?Y=100:Y=rt(l.plotArea.ticks)}catch(h){me(w,"initSpeedometerData",h)}},te=()=>{try{U=[];let h=rt(l.plotArea.ticks);if(l.customScaling.customScalingtoggle){for(let k=1;k<=h;k++){let s=l.customScaling[`share${k}`];if(U.length<100)for(let d=0;d<s;d++)U.push(l.customScaling[`division${k}`])}if(U.length<101)for(let k=U.length;k<100;k++)U.push(Ie.black)}else if(l.colorScale.showColor==Ta.none){const k=t[0].properties?.color??"#bac8de";for(let s=1;s<=h;s++)U.push(k)}else if(l.colorScale.showColor==Ta.discrete)for(let k=1;k<=h;k++)U.push(l.colorScale["division"+k]);else{let k=l.colorScale.startColor,s=l.colorScale.endColor;const d=v.scaleLinear().domain([0,h]).range([k,s]);for(let i=0;i<h;i++)U.push(d(i))}}catch(h){me(w,"initColorTheme",h)}},xe=(h,k,s)=>{try{let d=[],i=Math.abs(h)-Math.abs(k),y=Math.abs(i)/s,T=k>0?0:k;d.push(T);for(let a=0;a<s-1;a++)T+=parseFloat(y.toFixed(5)),T.toFixed(5)<=Math.abs(h)&&d.push(T);return d.push(d.includes(h)?0:h),d}catch(d){return me(w,"setTickValues",d),[]}},ge=()=>{try{switch(l.plotArea.dataLabelsOptions){case jt.automatic:H=pe();break;case jt.startOnly:H=[b];break;case jt.endOnly:let k=Array(Y).fill("");k[Y]=E,H=k;break;case jt.startAndEndBoth:let s=Array(Y).fill("");s[Y]=E,s[0]=b,H=s;break;case jt.none:H=[];break}}catch(h){me(w,"setDataLabelsOptions",h)}},pe=()=>{try{let h,k=rt(l.plotArea.ticks),s=xe(E,b,Y);if(l.customScaling.customScalingtoggle){let d=Array(100).fill("");d[0]=b;let i=0;for(let y=1;y<=k;y++){let T=parseInt(l.customScaling[`share${y}`]);if(i+=T,i>=100)break;d[i]=s[i]}d[99]=E,h=d}else h=s;return h}catch(h){return me(w,"initTicksValues",h),[]}},he=()=>{try{let k=function(s,d){try{let i=function(Ue){try{return Ue*Math.PI/180}catch(ve){return me(w,"deg2rad",ve),0}},y=function(Ue){try{let ve;for(ve in Ue)Le[ve]=Ue[ve];f=Le.maxAngle-Le.minAngle,ne=Math.round(W*Le.pointerHeadLengthPercent),Re=v.scaleLinear().range([0,1]).domain([Le.minValue,Le.maxValue]),fe=v.arc().innerRadius(A).outerRadius(W).startAngle((Pe,Ye)=>{let We=1/Le.majorTicks*Ye;return i(Le.minAngle+We*f)}).endAngle((Pe,Ye)=>{let We=1/Le.majorTicks*(Ye+1);return i(Le.minAngle+We*f)})}catch(ve){me(w,"configure",ve)}},T=function(Ue,ve){try{if(ve===0){S.append("g").attr("class","arc").attr("transform",D).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(U).enter().append("path").attr("fill",Se=>Se).attr("stroke",Se=>Se).attr("d",fe);let ze=E,ke=S.append("g").attr("class","label").attr("transform",D);if(ke.selectAll("text").data(H).enter().append("text").attr("transform",function(Se,oe){let $=f/Le.majorTicks*oe;return"rotate("+(Le.minAngle+$)+") translate(0,"+(Le.labelInset-W)+")"}).attr("text-anchor","middle").attr("font-size",l.plotArea.dataLabelValueFontSize).attr("fill",l.plotArea.dataLabelValueColor!==Ie.white?l.plotArea.dataLabelValueColor:"none").attr("font-style",l.plotArea.dataLabelValueFontStyle.includes(ce.italic)?ce.italic:"").attr("text-decoration",l.plotArea.dataLabelValueFontStyle.includes(ce.underline)?ce.underline:"").attr("font-weight",l.plotArea.dataLabelValueFontStyle.includes(ce.bold)?ce.bold:"").attr("font-family",l.plotArea.dataLabelValueFontFamily).text(Se=>l.plotArea.dataLabelNumberFormat==",.0%"?Z=Math.round(Se/ze*100)+"%":Ke(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(Se)).attr("visibility",Se=>Se===""?"hidden":"visible"),l.animation.animationEnabled){const Se=l.animation.animationDuration,oe=et[l.animation.animationEffect];ke.selectAll("text").attr("opacity",0).attr("transform",function($,R){const ae=f/Le.majorTicks*R;return`rotate(${Le.minAngle+ae}) translate(0, ${Le.labelInset-W+20})`}).transition().duration(Se).ease(oe).attr("opacity",1).attr("transform",function($,R){const ae=f/Le.majorTicks*R;return`rotate(${Le.minAngle+ae}) translate(0, ${Le.labelInset-W})`})}}l.pointerValue.showPointerValue&&x.length===2&&X(D);let Pe=[[Le.pointerWidth/2,0],[0,-ne],[-(Le.pointerWidth/2),0],[0,Le.pointerTailLength],[Le.pointerWidth/2,0]],Ye=v.line().curve(v.curveLinear);J=S.append("g").data([Pe]).attr("class","pointer").attr("transform",D).append("path").attr("d",ve>0?Ye:null).attr("transform","rotate("+Le.minAngle+")").attr("fill",l.plotArea.pointerColor).on("mousemove",(be,ze)=>{ut([{key:`${t[ve].data[0].legend}`,value:l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[ve].data[0].value/Te[Te.length-1]*100)+"%":Ke(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(t[ve].data[0].value)}],l,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{ot()}),J.selectAll("text").append("text").text(Le.maxValue),a(Ue===void 0?0:Ue)}catch(Pe){me(w,"gauge.render",Pe)}},a=function(Ue,ve){try{ve!==void 0&&y(ve);let Pe=Re(Ue),Ye=Le.minAngle+Pe*f;J.transition().duration(l.animation.animationEnabled?l.animation.animationDuration:0).ease(et[l.animation.animationEffect]).attr("transform","rotate("+Ye+")")}catch(Pe){me(w,"gauge.update",Pe)}},f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le={clipWidth:u,clipHeight:L,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:rt(l.plotArea.pointerHeadLength)/10,minValue:b,maxValue:E,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:Y,labelFormat:Ue=>Ke(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(Ue),labelInset:-5};return I.configure=y,I.render=T,I.update=a,y(d),I}catch(i){me(w,"gauge",i)}}("#power-gauge",{clipWidth:u,clipHeight:L,ringWidth:2.75*rt(l.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:E,transitionMs:0});if(x.length>0)for(let s=0;s<x.length;s++)k.render(O(x[s],s),s)}catch(h){me(w,"initSpeedometer",h)}};function O(h,k){try{let s=E,d=h.data[0].value;return s<0&&d>0||s>0&&d<0?0:s<0&&d<0&&s>d?s:s<0&&d<0&&s<d||s>d?d:s}catch(s){return me(w,"setPointerofSpeedometer",s),0}}function X(h){try{let k="";if(l.pointerValue.kpiAlias)k=l.pointerValue.kpiAliasText;else switch(l.pointerValue.connectorKPIforSpeedometer){case ti.PointerValue:k="Pointer Value";break;case ti.Absolute:k="Absolute Value";break;case ti.CAGR:k="CAGR";break;case ti.PercentageGrowth:k="Percentage Growth";break}let s=l.pointerValue.pointerValueFontStyle;S.selectAll(".pointerValueText").remove(),S.append("g").attr("class","pointerValueText").attr("transform",h).selectAll("text").data(["chartData.dataArray[1].maximumMeasure"]).enter().append("text").attr("dy","24").attr("text-anchor","middle").attr("font-size",l.pointerValue.pointerValueFontSize).attr("fill",l.pointerValue.pointerValueColor!==Ie.white?l.pointerValue.pointerValueColor:"none").attr("font-style",s.includes(ce.italic)?ce.italic:"").attr("text-decoration",s.includes(ce.underline)?ce.underline:"").attr("font-weight",s.includes(ce.bold)?ce.bold:"").attr("font-family",l.pointerValue.pointerValueFontFamily).text(i=>`${k}: ${!l.pointerValue.pointerValueAlias&&i!=0?M(t[0].data[0].value,t[1].data[0].value):l.pointerValue.pointerValueAliasText}`).attr("visibility",l.plotArea.dataLabels?"visible":"hidden")}catch(k){me(w,"setPointerValueText",k)}}function M(h,k){try{let s=h-k,d=1,i=parseInt(l.pointerValue.connectorKPIforSpeedometer),y,T;const a=l.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:s=k;break;case 2:s=Math.abs(s);break;case 3:return y=`.${a}%`,s=Math.pow(k/h,1/d)-1,T=v.format(y)(s),T;case 4:return y=`.${a}%`,s=Math.round(k/h*100-100)/100,T=v.format(y)(s),T}return isNaN(s)&&(s=0),Ke(l.pointerValue.pointerValueDisplayUnits,l.pointerValue.pointerValueNumberFormat,a)(s)}catch(s){return me(w,"connectorNumberFormat",s),""}}return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:o,id:n,style:{width:"100%",height:"100%"}})})};function Pa(t,e,n){console.error(`[${t}][${e}]`,n)}const Pr=({data:{ChartData:t},formatOptions:e,chartId:n,addLocalFilterFromLib:o,tooltipFormatter:x})=>{const l=Ce.useRef(),r=mt(t);let c,p,m,L=40,u=Jt,S=[0,0],g,W,A,E,b,U;Ce.useEffect(()=>{Y()},[e]);const Y=()=>{({chartFormatOptions:c,svg:E,width:p,height:m}=Kt(l,e)),H(),{margins:u,innerHeight:g,innerWidth:W,legendListWidth:U,chartTitleHeight:L}=Ua(c,p,m,S,u),S=Ha(c,r),qt(l,p,m,c),A=oa(E,u),Xt(l,L,p,c),Wa(c,E,r,p,m,U,L,n,u,ct.hollowCircle,!1,o),D()},H=()=>{try{b=0,r.forEach(z=>{b+=z.data[0].value})}catch(z){Pa("RadialBarChart.tsx","loopOverChartData",z)}},I=z=>{try{switch(c.plotArea.dataLabelsOptions){case jt.automatic:return z.map((ye,se)=>({...ye,index:se}));case jt.startOnly:return[{...z[0],index:0}];case jt.endOnly:return[{...z[z.length-1],index:z.length-1}];case jt.startAndEndBoth:return[{...z[0],index:0},{...z[z.length-1],index:z.length-1}];case jt.none:return[]}}catch(K){return Pa("RadialBarChart.tsx","getModifiedDataForLabels",K),z}},D=()=>{try{let z=function(Me,J){try{const Ee=v.interpolate(0,d(Math.abs(Me.data[0].value)));return Le=>ne({...Me,endAngle:Ee(Le)},J)}catch(Ee){Pa("RadialBarChart.tsx","arcTween",Ee)}},K=function(Me){try{return Me*180/M}catch(J){Pa("RadialBarChart.tsx","radTodeg",J)}},ye=function(Me){try{return Me*Math.PI/180}catch(J){Pa("RadialBarChart.tsx","degToRad",J)}},se=function(Me){try{return h+(f-(Me+1))*(N+k)}catch(J){Pa("RadialBarChart.tsx","getInnerRadius",J)}},te=function(Me){try{return se(Me)+N}catch(J){Pa("RadialBarChart.tsx","getOuterRadius",J)}},xe=r.length>1?v.max(r,Me=>Me.data[0].value)*1.1:t[0].data[0].value*1.1,ge=c.plotArea.dataLabelValueFontStyle,pe=Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.axialAxisDataLabelNumberFormat,c.plotArea.axialAxisDataLabelDecimalPrecision)(xe),he=c.plotArea.axialAxis?$t(pe,rt(c.plotArea.axialAxisDataLabelFontSize),c.plotArea.axialAxisDataLabelFontFamily).width+10:20;const O=Math.min(g*.5,W*.5)-he;let X=A.append("g").attr("transform",w()).attr("width",W).attr("height",g);const M=Math.PI,h=r.length>1?10:70,k=rt(c.plotArea.arcPadding),s=rt(c.plotArea.axialTicks);let d=v.scaleLinear().domain([0,xe]).range([0,ye(360)]),i=d.ticks(s);i[i.length-1]==xe&&i.pop();let y=i,T=r.map((Me,J)=>Me.data[0].legend),a=r.reduce((Me,J)=>Me+J.data[0].value,0);const f=T.length,N=(O-h-f*k)/f;let ne=v.arc().innerRadius((Me,J)=>se(J)).outerRadius((Me,J)=>te(J)).startAngle(0).endAngle(Me=>Me.endAngle),Z=v.arc().innerRadius((Me,J)=>se(J)).outerRadius((Me,J)=>te(J)).startAngle(0).endAngle(ye(360)),fe=X.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");c.plotArea.axialGrid&&fe.append("circle").attr("r",(Me,J)=>te(J)+k).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let Re=X.append("g").attr("class","a axis").selectAll("g").data(y).enter().append("g").attr("transform",Me=>"rotate("+(K(d(Me))-90)+")");c.plotArea.axialGrid&&Re.append("line").attr("x2",O).attr("stroke","#a9a9a9").attr("stroke-width",1),Re.append("text").attr("x",O+10).attr("class","text-xs text-gray-600").style("text-anchor",Me=>d(Me)>=M&&d(Me)<2*M?"end":null).attr("transform",Me=>"rotate("+(90-K(d(Me)))+","+(O+10)+",0)").text(Me=>Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.axialAxisDataLabelNumberFormat,c.plotArea.axialAxisDataLabelDecimalPrecision)(Me)).attr("fill",c.plotArea.axialAxisDataLabelColor!==Ie.white?c.plotArea.axialAxisDataLabelColor:"none").style("font-size",c.plotArea.axialAxisDataLabelFontSize).style("font-family",c.plotArea.axialAxisDataLabelFontFamily).attr("font-style",c.plotArea.axialAxisDataLabelFontStyle.includes(ce.italic)?ce.italic:"").attr("text-decoration",c.plotArea.axialAxisDataLabelFontStyle.includes(ce.underline)?ce.underline:"").attr("font-weight",c.plotArea.axialAxisDataLabelFontStyle.includes(ce.bold)?ce.bold:"").attr("visibility",c.plotArea.axialAxis?"visible":"hidden");let Te=X.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",Me=>Me.data[0].legend.replaceAll(" ","-")).attr("data-series-id",Me=>Me.properties.legendUniqueId??Me.data[0].legend).attr("data-dim-value",Me=>Me.data[0].legend).attr("fill",Me=>Me.properties.color).attr("d",(Me,J)=>ne({...Me,endAngle:0},J)).on("mousemove",(Me,J)=>{ut([{key:c.yAxisTitle.yAxisTitleText,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(J.data[0].value/a)*100).toFixed(rt(c.toolTip.toolTipDecimalPrecision))+"%":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(J.data[0].value)},{key:"Legend",value:J.properties.alias}],c,void 0,J.properties,At(x,String(J.data[0]?.legend??""),J.properties))}).on("mouseout",()=>{ot()});if(c.animation.animationEnabled?Te.transition().duration(c.animation.animationDuration).ease(et[c.animation.animationEffect]).attrTween("d",z):Te.attr("d",(Me,J)=>ne({...Me,endAngle:d(Math.abs(Me.data[0].value))},J)),c.plotArea.dataLabels){const Me=Oi(I(t),c,Ee=>Ee?.data?.[0]?.value??0),J=X.selectAll(".arc-label-"+n).data(Me).enter().append("text").attr("class","arc-label-"+n).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(Ee,Le)=>(te(Ee.index??Le)-se(Ee.index??Le))/1.75);J.append("textPath").attr("xlink:href",(Ee,Le)=>`#arc-path-${Ee.index??Le}-`+n).style("startOffset","50%").attr("hoverId",Ee=>Ee.legend.replaceAll(" ","-")).text(Ee=>`  ${Ee.properties.alias}
150
+  ${c.plotArea.dataLabelValue?Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.dataLabelNumberFormat,c.plotArea.dataLabelDecimalPrecision)(Ee.data[0].value):""}`).attr("fill",c.plotArea.dataLabelValueColor!==Ie.white?c.plotArea.dataLabelValueColor:"none").style("font-size",c.plotArea.dataLabelValueFontSize).style("font-family",c.plotArea.dataLabelValueFontFamily).attr("font-style",ge.includes(ce.italic)?ce.italic:"").attr("text-decoration",ge.includes(ce.underline)?ce.underline:"").attr("font-weight",ge.includes(ce.bold)?ce.bold:"").on("mousemove",(Ee,Le)=>{ut([{key:c.yAxisTitle.yAxisTitleText,value:Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormat,c.toolTip.toolTipDecimalPrecision)(Le.data[0].value)},{key:"Legend",value:Le.properties.alias}],c,Ee,Le.properties,At(x,String(Le.data[0]?.legend??""),Le.properties))}).on("mouseout",()=>{ot()}),c.animation.animationEnabled&&J.attr("opacity",0).transition().duration(c.animation.animationDuration).ease(et[c.animation.animationEffect]).attr("opacity",1),Te.each((Ee,Le)=>{X.append("path").attr("id",`arc-path-${Le}-`+n).attr("d",Z(Ee,Le)).attr("fill","none").attr("stroke","none")})}}catch(z){Pa("RadialBarChart.tsx","initRadialBarChart",z)}},w=()=>{try{return`translate(${W/2},${g/2})`}catch(z){Pa("RadialBarChart.tsx","getPiePosition",z)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:n,style:{width:"100%",height:"100%"}})})},ba="WordCloud.tsx",Ir=({data:{ChartData:t},formatOptions:e,chartId:n,tooltipFormatter:o})=>{const x=Ce.useRef();let l=mt(t),r,c,p,m=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=Jt,g,W,A,E,b,U=0;Ce.useEffect(()=>{Y()},[e]);const Y=()=>{({chartFormatOptions:r,svg:E,width:c,height:p}=Kt(x,e)),{margins:S,chartTitleHeight:u,innerHeight:g,innerWidth:W}=ri(r,p,c),qt(x,c,p,r),A=oa(E,S),Xt(x,u,c,r),H(),I()},H=()=>{try{U=0,l=l.map(D=>{let w=D.data[0].value;return U+=w,r.plotArea.hideZeroValues&&w==0?null:(w<m&&(m=w),w>L&&(L=w),D)}),l=l.filter(D=>D!==null),b=v.scaleLinear().domain([m,L]).range([12,70])}catch(D){me(ba,"calculateWordCloudData",D)}},I=()=>{try{let D=function(ye){try{A.append("g").attr("transform","translate("+K.size()[0]/2+","+K.size()[1]/2+")").selectAll("text").data(ye).enter().append("text").attr("font-size",function(se){try{return b(se.data[0].value)+"px"}catch(te){return me(ba,"draw-font-size",te),"12px"}}).attr("text-anchor","middle").style("font-family",r.text.textFontFamily).attr("fill",function(se){try{return se.properties.color!==Ie.white?se.properties.color:"none"}catch(te){return me(ba,"draw-fill",te),"none"}}).attr("transform",function(se){try{return"translate("+[se.x,se.y]+")rotate("+se.rotate+")"}catch(te){return me(ba,"draw-transform",te),""}}).text(function(se){try{return se.properties.alias}catch(te){return me(ba,"draw-text",te),""}}).attr("data-series-id",se=>se.properties.legendUniqueId??se.properties.alias).attr("data-dim-value",se=>se.properties.alias).on("mousemove.text",(se,te)=>{try{ut([{key:te.properties.alias,value:Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(te.data[0].value)},{key:te.properties.measureUniqueId,value:U}],r,void 0,te.properties,At(o,String(te.properties.alias??""),te.properties))}catch(xe){me(ba,"draw-mousemove",xe)}}).on("mouseout.text",()=>{try{ot()}catch(se){me(ba,"draw-mouseout",se)}})}catch(se){me(ba,"draw",se)}},w=r.text.textSpacing,z=r.text.textRotation,K=ml().size([W,g]).words(l).padding(w).rotate(function(){try{return Math.round(Math.random())*z}catch(ye){return me(ba,"rotate",ye),0}}).random(()=>.5).font(r.text.textFontFamily).fontWeight("bolder").fontSize(function(ye){try{return b(ye.data[0].value)}catch(se){return me(ba,"fontSize",se),12}}).text(function(ye){try{return ye.properties.alias}catch(se){return me(ba,"text",se),""}}).on("end",D);K.start()}catch(D){me(ba,"drawWordCloudChart",D)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:x,id:n,style:{width:"100%",height:"100%"}})})},Er=({data:t,formatOptions:e,chartId:n})=>{const o=Ce.useRef();let x=mt(t),l,r,c,p=40,m=Jt,L,u,S,g=[0,0],W,A;Ce.useEffect(()=>{E()},[e]);const E=()=>{({chartFormatOptions:l,svg:A,width:r,height:c}=Kt(o,e)),g=U(),{margins:m,innerHeight:L,innerWidth:u,legendListWidth:S,chartTitleHeight:p}=Ua(l,r,c,g,m,!0),qt(o,r,c,l),W=oa(A,m),Xt(o,p,r,l),b(),Y()},b=()=>{try{let H=l.plotArea.dataLabelNameFontStyle,I=l.plotArea.dataLabelValueFontStyle,D=W.attr("class","vennContainer");D&&D.datum(t).call(Cl.VennDiagram().width(u).height(L)),D&&D.selectAll(".venn-circle path").style("fill-opacity",l.plotArea.opacity),l.plotArea.dataLabelName?(D&&D.selectAll(".venn-circle text").html(""),D&&D.selectAll(".venn-circle text").append("tspan").style("font-family",l.plotArea.dataLabelNameFontFamily).style("fill",l.plotArea.dataLabelNameColor).style("font-size",l.plotArea.dataLabelNameFontSize+"px").style("font-style",H.includes(ce.italic)?ce.italic:"").attr("text-decoration",H.includes(ce.underline)?ce.underline:"").style("font-weight",H.includes(ce.bold)?ce.bold:"").html(w=>w.label).attr("visibility",l.plotArea.dataLabelName?"visible":"hidden")):(D&&D.selectAll(".venn-circle text").style("visibility","hidden"),D&&D.selectAll(".venn-circle text").html("")),l.plotArea.dataLabelValue&&D&&D.selectAll(".venn-circle text").append("tspan").attr("font-size",l.plotArea.dataLabelValueFontSize).attr("fill",l.plotArea.dataLabelValueColor!==Ie.white?l.plotArea.dataLabelValueColor:"none").style("font-style",I.includes(ce.italic)?ce.italic:"normal").attr("text-decoration",I.includes(ce.underline)?ce.underline:"none").style("font-weight",I.includes(ce.bold)?ce.bold:"normal").attr("font-family",l.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(w=>w.actualValue!==void 0?(l.plotArea.dataLabelName?" : ":"")+v.format(l.plotArea.dataLabelNumberFormat)(w.actualValue):"").attr("visibility",l.plotArea.dataLabelValue?"visible":"hidden"),l.plotArea.intersectionLabelVisibility?(D&&D.selectAll(".venn-intersection text").html(""),D&&D.selectAll(".venn-intersection text").append("tspan").style("font-family",l.plotArea.dataLabelNameFontFamily).style("fill",l.plotArea.dataLabelNameColor).style("font-size",l.plotArea.dataLabelNameFontSize+"px").style("font-style",H.includes(ce.italic)?ce.italic:"").attr("text-decoration",H.includes(ce.underline)?ce.underline:"").style("font-weight",H.includes(ce.bold)?ce.bold:"").html(w=>w.label).attr("visibility",l.plotArea.intersectionLabelVisibility?"visible":"hidden")):(D&&D.selectAll(".venn-intersection text").style("visibility","hidden"),D&&D.selectAll(".venn-intersection text").html("")),l.plotArea.intersectionValueVisibility&&D&&D.selectAll(".venn-intersection text").append("tspan").attr("font-size",l.plotArea.dataLabelValueFontSize).attr("fill",l.plotArea.dataLabelValueColor!==Ie.white?l.plotArea.dataLabelValueColor:"none").style("font-style",I.includes(ce.italic)?ce.italic:"normal").attr("text-decoration",I.includes(ce.underline)?ce.underline:"none").style("font-weight",I.includes(ce.bold)?ce.bold:"normal").attr("font-family",l.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(w=>w.actualValue!==void 0?(l.plotArea.dataLabelName?" : ":"")+v.format(l.plotArea.dataLabelNumberFormat)(w.actualValue):"").attr("visibility",l.plotArea.intersectionValueVisibility?"visible":"hidden"),D&&D.selectAll(".venn-circle path").style("fill",w=>w.properties?w.properties.color:null),D&&D.selectAll("g").on("mousemove",function(w,z){ut([{key:z.label,value:Ke(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(z.size)}],l,void 0,z.properties),v.select(this).transition("tooltip").duration(10).selectAll("path").style("stroke-dasharray","5,5").style("stroke-opacity",1).style("stroke","black")}).on("mouseout",function(w,z){ot();var K=v.select(this).transition("tooltip").duration(400);K.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(H){me("VennChart.tsx","drawVennDiagramChart",H)}},U=()=>{try{let H=0,I=0;return x.forEach(D=>{if(D.legendDisplay){let w=$t(D.legendDisplay+" : "+D.actualValue,rt(l.legends.legendFontSize),l.legends.legendFontFamily);H=Math.max(H,w.width),I=Math.max(I,w.height)}}),[H,I]}catch(H){return me("VennChart.tsx","calculateLegendsMaxPossibleWidth",H),[0,0]}},Y=()=>{try{let H=l.legends.legendPosition,I=l.legends.legendAlignmentTopBottom,D=l.legends.legendAlignment;switch(H){case Je.none:break;case Je.right:xa(A,x,r-S-25,p+5,S+15,c-p-10,H,D,ct.none,l,n,!0);break;case Je.top:xa(A,x,5,p+5,r-10,30,H,I,ct.none,l,n,!0);break;case Je.left:xa(A,x,5,m.top,S+15,c-p-10,H,D,ct.none,l,n,!0);break;case Je.bottom:xa(A,x,5,c-35,r-10,30,H,I,ct.none,l,n,!0);break}}catch(H){me("VennChart.tsx","initLegendListWithTotalValueAllowance",H)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:o,id:n,style:{width:"100%",height:"100%"}})})},Rr=({formatOptions:t,data:e,chartId:n,onElementClick:o,vfxPickModeActive:x,tooltipFormatter:l})=>{if(!e)return null;let r=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],c=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const p=Ce.useRef(),m=Ce.useRef(o);m.current=o;const L=Ce.useRef(x);L.current=x;let u,S,g,W=40,A=Jt,E,b,U,Y,H=ni.left,I=0,D=!1,w=new Map,z=new Map,K=.8,ye=.8;Ce.useEffect(()=>{se()},[t]);const se=()=>{({chartFormatOptions:u,svg:Y,width:S,height:g}=Kt(p,t)),{margins:A,chartTitleHeight:W,innerHeight:E,innerWidth:b}=ri(u,g,S),te(),qt(p,S,g,u),U=oa(Y,A),Xt(p,W,S,u),pe()},te=()=>{try{K=rt(u.nodes.nodesFillOpacity),ye=rt(u.links.linksFillOpacity),c.forEach(h=>{h.totalValue=0}),c.forEach(h=>r.forEach(k=>(h.name==k.source||h.name==k.target)&&(h.totalValue=(h.totalValue||0)+k.value))),c=c.filter(h=>h.totalValue!=0),r=r.filter(h=>h.value!=0);let X=he(r),M=new Map;X.forEach(h=>{h.nodes.forEach(k=>{M.set(k,h.layer)})}),c.forEach(h=>{let k=M.get(h.name);w.set(k,(w.get(k)||0)+h.totalValue)}),c.forEach(h=>{z.set(h.name,h.totalValue/w.get(M.get(h.name))*100)}),xe(X)}catch(X){me("SankeyChart.tsx","prepareDataForSankey",X)}},xe=X=>{try{D=u.nodes.nodesLabelWrap,H=u.nodes.nodesLabelVisibility?u.nodes.sankeyChartType:"None";let M="",h=0;c.forEach(d=>{M=d.name.length>M.length?d.name:M,h=d.totalValue.toString().length>h.toString().length?d.totalValue:h});let k=$t(M,rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily),s=$t(Ke(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(h),rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily);I=Math.max(k.width,s.width)+6,D&&(I=Math.min(b*.1,I))}catch(M){me("SankeyChart.tsx","calculateMaxNodeValueWidth",M)}},ge=(X,M)=>{try{let h=u.nodes.spacing!==void 0?rt(u.nodes.spacing)*1.5:15,k=u.nodes.sankeyNodeWidth!==void 0?u.nodes.sankeyNodeWidth:10,s=[],d=[];switch(H){case ni.center:s=[1,5],d=[b,E];break;case ni.right:s=[1,5],d=[b-I,E];break;case ni.left:s=[I,5],d=[b,E];break;default:s=[1,5],d=[b,E];break}return Ni.sankey().nodeId(y=>y.name).nodeAlign(Ni.sankeyJustify).nodeWidth(k).nodePadding(h).extent([s,d]).nodeSort(null)({nodes:X.map(y=>Object.assign({},y)),links:M.map(y=>Object.assign({},y))})}catch(h){return me("SankeyChart.tsx","getsankey",h),{nodes:[],links:[]}}},pe=()=>{try{let X=function(){try{const T={};s.forEach(a=>{const f=a.x0;T[f]||(T[f]=[]),T[f].push(a)}),Object.keys(T).forEach(a=>{const f=T[a];if(f.length===0)return;f.sort((Re,Te)=>Re.y0-Te.y0);const N=f[0],ne=f[f.length-1],Z=N.y1-N.y0,fe=ne.y1-ne.y0;if(N.y0=0,N.y1=Z,ne.y1=E,ne.y0=E-fe,f.length>2){const Re=f.slice(1,f.length-1),Te=ne.y0-N.y1,Me=v.sum(Re,Le=>Le.y1-Le.y0),J=(Te-Me)/(Re.length+1);let Ee=N.y1+J;Re.forEach(Le=>{const Ue=Le.y1-Le.y0;Le.y0=Ee,Le.y1=Ee+Ue,Ee+=Ue+J})}})}catch(T){me("SankeyChart.tsx","centerAlignNodesByLayer",T)}},M=function(){try{s.forEach(T=>{let a=0,f=0;T.sourceLinks.forEach(N=>{N.sy=a,a+=N.width}),T.targetLinks.forEach(N=>{N.ty=f,f+=N.width})})}catch(T){me("SankeyChart.tsx","arrangeFlows",T)}},h=function(T){return function(a){try{const f=a.source.x1,N=a.source.y0+a.sy+a.width/2,ne=a.target.x0,Z=a.target.y0+a.ty+a.width/2,fe=ne-f,Re=f+fe*T,Te=ne-fe*T;return`M${f},${N} C${Re},${N} ${Te},${Z} ${ne},${Z}`}catch(f){return me("SankeyChart.tsx","sankeyLinkCustom",f),""}}},k=u.nodes.curviness!==void 0?u.nodes.curviness!=="0"?u.nodes.curviness:.1:.5;const{nodes:s,links:d}=ge(c,r);M(),X(),M(),M();const i=U.append("g").selectAll("rect").data(s).enter().append("rect").style("fill-opacity",K).attr("id",T=>"Node"+T.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none").attr("stroke-width",u.nodes.nodesBorderVisibility?u.nodes.nodesBorderThickness:0).attr("x",T=>T.x0).attr("y",T=>T.y0).attr("height",T=>T.y1-T.y0).attr("width",T=>T.x1-T.x0).attr("fill",T=>T.color?T.color:Ie.white).on("mousemove",function(T,a){try{u.toolTip.toolTipVisibility&&ut([{key:a.name.split("~$~")[1],value:u.toolTip.toolTipNumberFormat==",.0%"?z.get(a.name)+"%":Ke(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerShape:"square",markerColor:a.color},At(l,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),U.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),U.selectAll(".sankey-nodes-texts").style("opacity","0"),U.selectAll(".sankey-links").style("stroke-opacity",.1),U.select(`#Node${a.index}`).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",K).style("cursor","pointer"),U.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(f=>{U.select(`#Node${f.target.index}`).style("fill-opacity",K).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Link${f.index}`).style("stroke-opacity",ye),U.select(`#Label${f.target.index}`).style("opacity",1)}),a.targetLinks.forEach(f=>{U.select(`#Node${f.source.index}`).style("fill-opacity",K).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Link${f.index}`).style("stroke-opacity",ye),U.select(`#Label${f.source.index}`).style("opacity",1)})}catch(f){me("SankeyChart.tsx","Nodes.onMouseMove",f)}}).on("mouseout",function(T){try{U.selectAll(".sankey-nodes").style("fill-opacity",K).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.selectAll(".sankey-links").style("stroke-opacity",ye),U.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&ot()}catch(a){me("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(lt.SeriesId,T=>String(T.name??"")).attr(lt.DimValue,T=>String(T.name??"")).on("click",vt(L,m,(T,a)=>{const f=String(a.name??"");return{seriesId:f,dimValue:f,legendUniqueId:f,seriesDisplayName:f.includes("~$~")?f.split("~$~")[1]:f}}));if(U.append("g").attr("fill","none").selectAll("g").data(d).enter().append("g").style("mix-blend-mode","multiply").append("path").attr("class","sankey-links").attr("stroke-opacity",ye).attr("id",T=>"Link"+T.index).attr("d",h(k)).attr("stroke",T=>u.links.linksColor==="Source"?T.source.color:T.target.color).attr("stroke-width",T=>Math.max(1,T.width)).on("mousemove",function(T,a){try{U.selectAll(".sankey-links").style("stroke-opacity",.1),U.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),U.selectAll(".sankey-nodes-texts").style("opacity","0"),U.select(`#Link${a.index}`).style("stroke-opacity",ye).style("cursor","pointer"),U.select(`#Node${a.target.index}`).style("fill-opacity",K).style("Stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Node${a.source.index}`).style("fill-opacity",K).style("Stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Label${a.target.index}`).style("opacity",1),U.select(`#Label${a.source.index}`).style("opacity",1),u.toolTip.toolTipVisibility&&ut([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:Ke(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerColor:a.source.color,markerShape:"circle"},At(l,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(f){me("SankeyChart.tsx","link.onMouseMove",f)}}).on("mouseout",function(T){try{u.toolTip.toolTipVisibility&&ot(),U.selectAll(".sankey-nodes").style("fill-opacity",K),U.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.selectAll(".sankey-links").style("stroke-opacity",ye),U.selectAll(".sankey-nodes-texts").style("opacity","1"),v.select(this).select("rect").style("pointer-events","all"),v.select(this).style("cursor","none")}catch(a){me("SankeyChart.tsx","link.onMouseOut",a)}}),u.nodes.nodesLabelVisibility)try{const T=U.append("g").attr("font-family",u.nodes.nodesLabelFontFamily).attr("font-size",u.nodes.nodesLabelFontSize).style("font-style",u.nodes.nodesLabelFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ce.bold)?ce.bold:"").attr("display",u.nodes.nodesLabelVisibility?"visible":"none").selectAll("text").data(s).enter().append("g").attr("class","sankey-nodes-texts").attr("id",a=>"Label"+a.index).each(function(a){try{if(u.nodes.sankeyChartType!=="None"){const f=u.nodes.sankeyNodeWidth,N=H===ni.center;v.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y-16).attr("width",fe=>N?f:I).attr("height",20).append("xhtml:div").style("white-space",N||D?"nowrap":"normal").style("overflow",N||D?"hidden":"visible").style("text-overflow",N||D?"ellipsis":"clip").style("display","block").style("max-width",fe=>N?"100px":I+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ce.bold)?ce.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",fe=>z.get(fe.name)>0?fe.alias?fe.alias.includes("~$~")?fe.alias.split("~$~")[1]:fe.alias:fe.name.includes("~$~")?fe.name.split("~$~")[1]:fe.name:"").text(fe=>z.get(fe.name)>0?fe.alias?fe.alias.includes("~$~")?fe.alias.split("~$~")[1]:fe.alias:fe.name.includes("~$~")?fe.name.split("~$~")[1]:fe.name:""),v.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y).attr("width",fe=>N?f:I).attr("height",20).append("xhtml:div").style("white-space",N||D?"nowrap":"normal").style("overflow",N||D?"hidden":"visible").style("text-overflow",N||D?"ellipsis":"clip").style("display","block").style("max-width",fe=>N?"100px":I+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ce.bold)?ce.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",fe=>z.get(fe.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?z.get(fe.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":Ke(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(fe.totalValue):"").text(fe=>z.get(fe.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?z.get(fe.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":Ke(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(fe.totalValue):"")}}catch(f){me("SankeyChart.tsx","texts.each",f)}})}catch(T){me("SankeyChart.tsx","inittree.texts",T)}}catch(X){me("SankeyChart.tsx","inittree",X)}};function he(X){try{const M=new Map,h=new Map,k=new Set;for(const{source:T,target:a}of X)k.add(T),k.add(a),M.has(a)||M.set(a,new Set),h.has(T)||h.set(T,new Set),M.get(a).add(T),h.get(T).add(a);const s=new Map,d=[];for(const T of k)M.has(T)||(s.set(T,0),d.push(T));for(;d.length>0;){const T=d.shift(),a=s.get(T),f=h.get(T)||[];for(const N of f){const ne=a+1;(!s.has(N)||s.get(N)<ne)&&(s.set(N,ne),d.push(N))}}const i=new Map;for(const[T,a]of s.entries())i.has(a)||i.set(a,[]),i.get(a).push(T);return[...i.entries()].sort((T,a)=>T[0]-a[0]).map(([T,a])=>({layer:T,nodes:a}))}catch(M){return me("SankeyChart.tsx","assignNodeLayers",M),[]}}const O=X=>{try{let M={};const h=Number(u.nodes.sankeyNodeWidth),k=h/2;switch(H){case"Right":M.x=X.x1+6;break;default:case"Left":M.x=X.x0-I;break;case"Center":M.x=X.x0+k-h/2;break}return M.y=(X.y1+X.y0)/2,M}catch(M){return me("SankeyChart.tsx","getXandYPositionOfLables",M),{x:0,y:0}}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:p,id:n,style:{width:"100%",height:"100%"}})})},zr={type:"FeatureCollection",features:[{type:"Feature",id:"AL",properties:{name:"Alabama",value:55},geometry:{type:"Polygon",coordinates:[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],[-85.069935,32.580372],[-84.960397,32.421541],[-85.004212,32.322956],[-84.889196,32.262709],[-85.058981,32.13674],[-85.053504,32.01077],[-85.141136,31.840985],[-85.042551,31.539753],[-85.113751,31.27686],[-85.004212,31.003013],[-85.497137,30.997536],[-87.600282,30.997536],[-87.633143,30.86609],[-87.408589,30.674397],[-87.446927,30.510088],[-87.37025,30.427934],[-87.518128,30.280057],[-87.655051,30.247195],[-87.90699,30.411504],[-87.934375,30.657966],[-88.011052,30.685351],[-88.10416,30.499135],[-88.137022,30.318396],[-88.394438,30.367688],[-88.471115,31.895754],[-88.241084,33.796253],[-88.098683,34.891641],[-88.202745,34.995703],[-87.359296,35.00118]]]}},{type:"Feature",id:"AK",properties:{name:"Alaska",value:87},geometry:{type:"MultiPolygon",coordinates:[[[[-131.602021,55.117982],[-131.569159,55.28229],[-131.355558,55.183705],[-131.38842,55.01392],[-131.645836,55.035827],[-131.602021,55.117982]]],[[[-131.832052,55.42469],[-131.645836,55.304197],[-131.749898,55.128935],[-131.832052,55.189182],[-131.832052,55.42469]]],[[[-132.976733,56.437924],[-132.735747,56.459832],[-132.631685,56.421493],[-132.664547,56.273616],[-132.878148,56.240754],[-133.069841,56.333862],[-132.976733,56.437924]]],[[[-133.595627,56.350293],[-133.162949,56.317431],[-133.05341,56.125739],[-132.620732,55.912138],[-132.472854,55.780691],[-132.4619,55.671152],[-132.357838,55.649245],[-132.341408,55.506844],[-132.166146,55.364444],[-132.144238,55.238474],[-132.029222,55.276813],[-131.97993,55.178228],[-131.958022,54.789365],[-132.029222,54.701734],[-132.308546,54.718165],[-132.385223,54.915335],[-132.483808,54.898904],[-132.686455,55.046781],[-132.746701,54.997489],[-132.916486,55.046781],[-132.889102,54.898904],[-132.73027,54.937242],[-132.626209,54.882473],[-132.675501,54.679826],[-132.867194,54.701734],[-133.157472,54.95915],[-133.239626,55.090597],[-133.223195,55.22752],[-133.453227,55.216566],[-133.453227,55.320628],[-133.277964,55.331582],[-133.102702,55.42469],[-133.17938,55.588998],[-133.387503,55.62186],[-133.420365,55.884753],[-133.497042,56.0162],[-133.639442,55.923092],[-133.694212,56.070969],[-133.546335,56.142169],[-133.666827,56.311955],[-133.595627,56.350293]]],[[[-133.738027,55.556137],[-133.546335,55.490413],[-133.414888,55.572568],[-133.283441,55.534229],[-133.420365,55.386352],[-133.633966,55.430167],[-133.738027,55.556137]]],[[[-133.907813,56.930849],[-134.050213,57.029434],[-133.885905,57.095157],[-133.343688,57.002049],[-133.102702,57.007526],[-132.932917,56.82131],[-132.620732,56.667956],[-132.653593,56.55294],[-132.817901,56.492694],[-133.042456,56.520078],[-133.201287,56.448878],[-133.420365,56.492694],[-133.66135,56.448878],[-133.710643,56.684386],[-133.688735,56.837741],[-133.869474,56.843218],[-133.907813,56.930849]]],[[[-134.115936,56.48174],[-134.25286,56.558417],[-134.400737,56.722725],[-134.417168,56.848695],[-134.296675,56.908941],[-134.170706,56.848695],[-134.143321,56.952757],[-133.748981,56.772017],[-133.710643,56.596755],[-133.847566,56.574848],[-133.935197,56.377678],[-133.836612,56.322908],[-133.957105,56.092877],[-134.110459,56.142169],[-134.132367,55.999769],[-134.230952,56.070969],[-134.291198,56.350293],[-134.115936,56.48174]]],[[[-134.636246,56.28457],[-134.669107,56.169554],[-134.806031,56.235277],[-135.178463,56.67891],[-135.413971,56.810356],[-135.331817,56.914418],[-135.424925,57.166357],[-135.687818,57.369004],[-135.419448,57.566174],[-135.298955,57.48402],[-135.063447,57.418296],[-134.849846,57.407343],[-134.844369,57.248511],[-134.636246,56.728202],[-134.636246,56.28457]]],[[[-134.712923,58.223407],[-134.373353,58.14673],[-134.176183,58.157683],[-134.187137,58.081006],[-133.902336,57.807159],[-134.099505,57.850975],[-134.148798,57.757867],[-133.935197,57.615466],[-133.869474,57.363527],[-134.083075,57.297804],[-134.154275,57.210173],[-134.499322,57.029434],[-134.603384,57.034911],[-134.6472,57.226604],[-134.575999,57.341619],[-134.608861,57.511404],[-134.729354,57.719528],[-134.707446,57.829067],[-134.784123,58.097437],[-134.91557,58.212453],[-134.953908,58.409623],[-134.712923,58.223407]]],[[[-135.857603,57.330665],[-135.715203,57.330665],[-135.567326,57.149926],[-135.633049,57.023957],[-135.857603,56.996572],[-135.824742,57.193742],[-135.857603,57.330665]]],[[[-136.279328,58.206976],[-135.978096,58.201499],[-135.780926,58.28913],[-135.496125,58.168637],[-135.64948,58.037191],[-135.59471,57.987898],[-135.45231,58.135776],[-135.107263,58.086483],[-134.91557,57.976944],[-135.025108,57.779775],[-134.937477,57.763344],[-134.822462,57.500451],[-135.085355,57.462112],[-135.572802,57.675713],[-135.556372,57.456635],[-135.709726,57.369004],[-135.890465,57.407343],[-136.000004,57.544266],[-136.208128,57.637374],[-136.366959,57.829067],[-136.569606,57.916698],[-136.558652,58.075529],[-136.421728,58.130299],[-136.377913,58.267222],[-136.279328,58.206976]]],[[[-147.079854,60.200582],[-147.501579,59.948643],[-147.53444,59.850058],[-147.874011,59.784335],[-147.80281,59.937689],[-147.435855,60.09652],[-147.205824,60.271782],[-147.079854,60.200582]]],[[[-147.561825,60.578491],[-147.616594,60.370367],[-147.758995,60.156767],[-147.956165,60.227967],[-147.791856,60.474429],[-147.561825,60.578491]]],[[[-147.786379,70.245291],[-147.682318,70.201475],[-147.162008,70.15766],[-146.888161,70.185044],[-146.510252,70.185044],[-146.099482,70.146706],[-145.858496,70.168614],[-145.622988,70.08646],[-145.195787,69.993352],[-144.620708,69.971444],[-144.461877,70.026213],[-144.078491,70.059075],[-143.914183,70.130275],[-143.497935,70.141229],[-143.503412,70.091936],[-143.25695,70.119321],[-142.747594,70.042644],[-142.402547,69.916674],[-142.079408,69.856428],[-142.008207,69.801659],[-141.712453,69.790705],[-141.433129,69.697597],[-141.378359,69.63735],[-141.208574,69.686643],[-141.00045,69.648304],[-141.00045,60.304644],[-140.53491,60.22249],[-140.474664,60.310121],[-139.987216,60.184151],[-139.696939,60.342983],[-139.088998,60.359413],[-139.198537,60.091043],[-139.045183,59.997935],[-138.700135,59.910304],[-138.623458,59.767904],[-137.604747,59.242118],[-137.445916,58.908024],[-137.265177,59.001132],[-136.827022,59.159963],[-136.580559,59.16544],[-136.465544,59.285933],[-136.476498,59.466672],[-136.301236,59.466672],[-136.25742,59.625503],[-135.945234,59.663842],[-135.479694,59.800766],[-135.025108,59.565257],[-135.068924,59.422857],[-134.959385,59.280456],[-134.701969,59.247595],[-134.378829,59.033994],[-134.400737,58.973748],[-134.25286,58.858732],[-133.842089,58.727285],[-133.173903,58.152206],[-133.075318,57.998852],[-132.867194,57.845498],[-132.560485,57.505928],[-132.253777,57.21565],[-132.368792,57.095157],[-132.05113,57.051341],[-132.127807,56.876079],[-131.870391,56.804879],[-131.837529,56.602232],[-131.580113,56.613186],[-131.087188,56.405062],[-130.78048,56.366724],[-130.621648,56.268139],[-130.468294,56.240754],[-130.424478,56.142169],[-130.101339,56.114785],[-130.002754,55.994292],[-130.150631,55.769737],[-130.128724,55.583521],[-129.986323,55.276813],[-130.095862,55.200136],[-130.336847,54.920812],[-130.687372,54.718165],[-130.785957,54.822227],[-130.917403,54.789365],[-131.010511,54.997489],[-130.983126,55.08512],[-131.092665,55.189182],[-130.862634,55.298721],[-130.928357,55.337059],[-131.158389,55.200136],[-131.284358,55.287767],[-131.426759,55.238474],[-131.843006,55.457552],[-131.700606,55.698537],[-131.963499,55.616383],[-131.974453,55.49589],[-132.182576,55.588998],[-132.226392,55.704014],[-132.083991,55.829984],[-132.127807,55.955953],[-132.324977,55.851892],[-132.522147,56.076446],[-132.642639,56.032631],[-132.719317,56.218847],[-132.527624,56.339339],[-132.341408,56.339339],[-132.396177,56.487217],[-132.297592,56.67891],[-132.450946,56.673433],[-132.768609,56.837741],[-132.993164,57.034911],[-133.51895,57.177311],[-133.507996,57.577128],[-133.677781,57.62642],[-133.639442,57.790728],[-133.814705,57.834544],[-134.072121,58.053622],[-134.143321,58.168637],[-134.586953,58.206976],[-135.074401,58.502731],[-135.282525,59.192825],[-135.38111,59.033994],[-135.337294,58.891593],[-135.140124,58.617746],[-135.189417,58.573931],[-135.05797,58.349376],[-135.085355,58.201499],[-135.277048,58.234361],[-135.430402,58.398669],[-135.633049,58.426053],[-135.91785,58.382238],[-135.912373,58.617746],[-136.087635,58.814916],[-136.246466,58.75467],[-136.876314,58.962794],[-136.931084,58.902547],[-136.586036,58.836824],[-136.317666,58.672516],[-136.213604,58.667039],[-136.180743,58.535592],[-136.043819,58.382238],[-136.388867,58.294607],[-136.591513,58.349376],[-136.59699,58.212453],[-136.859883,58.316515],[-136.947514,58.393192],[-137.111823,58.393192],[-137.566409,58.590362],[-137.900502,58.765624],[-137.933364,58.869686],[-138.11958,59.02304],[-138.634412,59.132579],[-138.919213,59.247595],[-139.417615,59.379041],[-139.746231,59.505011],[-139.718846,59.641934],[-139.625738,59.598119],[-139.5162,59.68575],[-139.625738,59.88292],[-139.488815,59.992458],[-139.554538,60.041751],[-139.801,59.833627],[-140.315833,59.696704],[-140.92925,59.745996],[-141.444083,59.871966],[-141.46599,59.970551],[-141.706976,59.948643],[-141.964392,60.019843],[-142.539471,60.085566],[-142.873564,60.091043],[-143.623905,60.036274],[-143.892275,59.997935],[-144.231845,60.140336],[-144.65357,60.206059],[-144.785016,60.29369],[-144.834309,60.441568],[-145.124586,60.430614],[-145.223171,60.299167],[-145.738004,60.474429],[-145.820158,60.551106],[-146.351421,60.408706],[-146.608837,60.238921],[-146.718376,60.397752],[-146.608837,60.485383],[-146.455483,60.463475],[-145.951604,60.578491],[-146.017328,60.666122],[-146.252836,60.622307],[-146.345944,60.737322],[-146.565022,60.753753],[-146.784099,61.044031],[-146.866253,60.972831],[-147.172962,60.934492],[-147.271547,60.972831],[-147.375609,60.879723],[-147.758995,60.912584],[-147.775426,60.808523],[-148.032842,60.781138],[-148.153334,60.819476],[-148.065703,61.005692],[-148.175242,61.000215],[-148.350504,60.803046],[-148.109519,60.737322],[-148.087611,60.594922],[-147.939734,60.441568],[-148.027365,60.277259],[-148.219058,60.332029],[-148.273827,60.249875],[-148.087611,60.217013],[-147.983549,59.997935],[-148.251919,59.95412],[-148.399797,59.997935],[-148.635305,59.937689],[-148.755798,59.986981],[-149.067984,59.981505],[-149.05703,60.063659],[-149.204907,60.008889],[-149.287061,59.904827],[-149.418508,59.997935],[-149.582816,59.866489],[-149.511616,59.806242],[-149.741647,59.729565],[-149.949771,59.718611],[-150.031925,59.61455],[-150.25648,59.521442],[-150.409834,59.554303],[-150.579619,59.444764],[-150.716543,59.450241],[-151.001343,59.225687],[-151.308052,59.209256],[-151.406637,59.280456],[-151.592853,59.159963],[-151.976239,59.253071],[-151.888608,59.422857],[-151.636669,59.483103],[-151.47236,59.472149],[-151.423068,59.537872],[-151.127313,59.669319],[-151.116359,59.778858],[-151.505222,59.63098],[-151.828361,59.718611],[-151.8667,59.778858],[-151.702392,60.030797],[-151.423068,60.211536],[-151.379252,60.359413],[-151.297098,60.386798],[-151.264237,60.545629],[-151.406637,60.720892],[-151.06159,60.786615],[-150.404357,61.038554],[-150.245526,60.939969],[-150.042879,60.912584],[-149.741647,61.016646],[-150.075741,61.15357],[-150.207187,61.257632],[-150.47008,61.246678],[-150.656296,61.29597],[-150.711066,61.252155],[-151.023251,61.180954],[-151.165652,61.044031],[-151.477837,61.011169],[-151.800977,60.852338],[-151.833838,60.748276],[-152.080301,60.693507],[-152.13507,60.578491],[-152.310332,60.507291],[-152.392486,60.304644],[-152.732057,60.173197],[-152.567748,60.069136],[-152.704672,59.915781],[-153.022334,59.888397],[-153.049719,59.691227],[-153.345474,59.620026],[-153.438582,59.702181],[-153.586459,59.548826],[-153.761721,59.543349],[-153.72886,59.433811],[-154.117723,59.368087],[-154.1944,59.066856],[-153.750768,59.050425],[-153.400243,58.968271],[-153.301658,58.869686],[-153.444059,58.710854],[-153.679567,58.612269],[-153.898645,58.606793],[-153.920553,58.519161],[-154.062953,58.4863],[-153.99723,58.376761],[-154.145107,58.212453],[-154.46277,58.059098],[-154.643509,58.059098],[-154.818771,58.004329],[-154.988556,58.015283],[-155.120003,57.955037],[-155.081664,57.872883],[-155.328126,57.829067],[-155.377419,57.708574],[-155.547204,57.785251],[-155.73342,57.549743],[-156.045606,57.566174],[-156.023698,57.440204],[-156.209914,57.473066],[-156.34136,57.418296],[-156.34136,57.248511],[-156.549484,56.985618],[-156.883577,56.952757],[-157.157424,56.832264],[-157.20124,56.766541],[-157.376502,56.859649],[-157.672257,56.607709],[-157.754411,56.67891],[-157.918719,56.657002],[-157.957058,56.514601],[-158.126843,56.459832],[-158.32949,56.48174],[-158.488321,56.339339],[-158.208997,56.295524],[-158.510229,55.977861],[-159.375585,55.873799],[-159.616571,55.594475],[-159.676817,55.654722],[-159.643955,55.829984],[-159.813741,55.857368],[-160.027341,55.791645],[-160.060203,55.720445],[-160.394296,55.605429],[-160.536697,55.473983],[-160.580512,55.567091],[-160.668143,55.457552],[-160.865313,55.528752],[-161.232268,55.358967],[-161.506115,55.364444],[-161.467776,55.49589],[-161.588269,55.62186],[-161.697808,55.517798],[-161.686854,55.408259],[-162.053809,55.074166],[-162.179779,55.15632],[-162.218117,55.03035],[-162.470057,55.052258],[-162.508395,55.249428],[-162.661749,55.293244],[-162.716519,55.222043],[-162.579595,55.134412],[-162.645319,54.997489],[-162.847965,54.926289],[-163.00132,55.079643],[-163.187536,55.090597],[-163.220397,55.03035],[-163.034181,54.942719],[-163.373752,54.800319],[-163.14372,54.76198],[-163.138243,54.696257],[-163.329936,54.74555],[-163.587352,54.614103],[-164.085754,54.61958],[-164.332216,54.531949],[-164.354124,54.466226],[-164.638925,54.389548],[-164.847049,54.416933],[-164.918249,54.603149],[-164.710125,54.663395],[-164.551294,54.88795],[-164.34317,54.893427],[-163.894061,55.041304],[-163.532583,55.046781],[-163.39566,54.904381],[-163.291598,55.008443],[-163.313505,55.128935],[-163.105382,55.183705],[-162.880827,55.183705],[-162.579595,55.446598],[-162.245502,55.682106],[-161.807347,55.89023],[-161.292514,55.983338],[-161.078914,55.939523],[-160.87079,55.999769],[-160.816021,55.912138],[-160.931036,55.813553],[-160.805067,55.736876],[-160.766728,55.857368],[-160.509312,55.868322],[-160.438112,55.791645],[-160.27928,55.76426],[-160.273803,55.857368],[-160.536697,55.939523],[-160.558604,55.994292],[-160.383342,56.251708],[-160.147834,56.399586],[-159.830171,56.541986],[-159.326293,56.667956],[-158.959338,56.848695],[-158.784076,56.782971],[-158.641675,56.810356],[-158.701922,56.925372],[-158.658106,57.034911],[-158.378782,57.264942],[-157.995396,57.41282],[-157.688688,57.609989],[-157.705118,57.719528],[-157.458656,58.497254],[-157.07527,58.705377],[-157.119086,58.869686],[-158.039212,58.634177],[-158.32949,58.661562],[-158.40069,58.760147],[-158.564998,58.803962],[-158.619768,58.913501],[-158.767645,58.864209],[-158.860753,58.694424],[-158.701922,58.480823],[-158.893615,58.387715],[-159.0634,58.420577],[-159.392016,58.760147],[-159.616571,58.929932],[-159.731586,58.929932],[-159.808264,58.803962],[-159.906848,58.782055],[-160.054726,58.886116],[-160.235465,58.902547],[-160.317619,59.072332],[-160.854359,58.88064],[-161.33633,58.743716],[-161.374669,58.667039],[-161.752577,58.552023],[-161.938793,58.656085],[-161.769008,58.776578],[-161.829255,59.061379],[-161.955224,59.36261],[-161.703285,59.48858],[-161.911409,59.740519],[-162.092148,59.88292],[-162.234548,60.091043],[-162.448149,60.178674],[-162.502918,59.997935],[-162.760334,59.959597],[-163.171105,59.844581],[-163.66403,59.795289],[-163.9324,59.806242],[-164.162431,59.866489],[-164.189816,60.02532],[-164.386986,60.074613],[-164.699171,60.29369],[-164.962064,60.337506],[-165.268773,60.578491],[-165.060649,60.68803],[-165.016834,60.890677],[-165.175665,60.846861],[-165.197573,60.972831],[-165.120896,61.076893],[-165.323543,61.170001],[-165.34545,61.071416],[-165.591913,61.109754],[-165.624774,61.279539],[-165.816467,61.301447],[-165.920529,61.416463],[-165.915052,61.558863],[-166.106745,61.49314],[-166.139607,61.630064],[-165.904098,61.662925],[-166.095791,61.81628],[-165.756221,61.827233],[-165.756221,62.013449],[-165.674067,62.139419],[-165.044219,62.539236],[-164.912772,62.659728],[-164.819664,62.637821],[-164.874433,62.807606],[-164.633448,63.097884],[-164.425324,63.212899],[-164.036462,63.262192],[-163.73523,63.212899],[-163.313505,63.037637],[-163.039658,63.059545],[-162.661749,63.22933],[-162.272887,63.486746],[-162.075717,63.514131],[-162.026424,63.448408],[-161.555408,63.448408],[-161.13916,63.503177],[-160.766728,63.771547],[-160.766728,63.837271],[-160.952944,64.08921],[-160.974852,64.237087],[-161.26513,64.395918],[-161.374669,64.532842],[-161.078914,64.494503],[-160.79959,64.609519],[-160.783159,64.719058],[-161.144637,64.921705],[-161.413007,64.762873],[-161.664946,64.790258],[-161.900455,64.702627],[-162.168825,64.680719],[-162.234548,64.620473],[-162.541257,64.532842],[-162.634365,64.384965],[-162.787719,64.324718],[-162.858919,64.49998],[-163.045135,64.538319],[-163.176582,64.401395],[-163.253259,64.467119],[-163.598306,64.565704],[-164.304832,64.560227],[-164.80871,64.450688],[-165.000403,64.434257],[-165.411174,64.49998],[-166.188899,64.576658],[-166.391546,64.636904],[-166.484654,64.735489],[-166.413454,64.872412],[-166.692778,64.987428],[-166.638008,65.113398],[-166.462746,65.179121],[-166.517516,65.337952],[-166.796839,65.337952],[-167.026871,65.381768],[-167.47598,65.414629],[-167.711489,65.496784],[-168.072967,65.578938],[-168.105828,65.682999],[-167.541703,65.819923],[-166.829701,66.049954],[-166.3313,66.186878],[-166.046499,66.110201],[-165.756221,66.09377],[-165.690498,66.203309],[-165.86576,66.21974],[-165.88219,66.312848],[-165.186619,66.466202],[-164.403417,66.581218],[-163.981692,66.592172],[-163.751661,66.553833],[-163.872153,66.389525],[-163.828338,66.274509],[-163.915969,66.192355],[-163.768091,66.060908],[-163.494244,66.082816],[-163.149197,66.060908],[-162.749381,66.088293],[-162.634365,66.039001],[-162.371472,66.028047],[-162.14144,66.077339],[-161.840208,66.02257],[-161.549931,66.241647],[-161.341807,66.252601],[-161.199406,66.208786],[-161.128206,66.334755],[-161.528023,66.395002],[-161.911409,66.345709],[-161.87307,66.510017],[-162.174302,66.68528],[-162.502918,66.740049],[-162.601503,66.89888],[-162.344087,66.937219],[-162.015471,66.778388],[-162.075717,66.652418],[-161.916886,66.553833],[-161.571838,66.438817],[-161.489684,66.55931],[-161.884024,66.718141],[-161.714239,67.002942],[-161.851162,67.052235],[-162.240025,66.991988],[-162.639842,67.008419],[-162.700088,67.057712],[-162.902735,67.008419],[-163.740707,67.128912],[-163.757138,67.254881],[-164.009077,67.534205],[-164.211724,67.638267],[-164.534863,67.725898],[-165.192096,67.966884],[-165.493328,68.059992],[-165.794559,68.081899],[-166.243668,68.246208],[-166.681824,68.339316],[-166.703731,68.372177],[-166.375115,68.42147],[-166.227238,68.574824],[-166.216284,68.881533],[-165.329019,68.859625],[-164.255539,68.930825],[-163.976215,68.985595],[-163.532583,69.138949],[-163.110859,69.374457],[-163.023228,69.609966],[-162.842489,69.812613],[-162.470057,69.982398],[-162.311225,70.108367],[-161.851162,70.311014],[-161.779962,70.256245],[-161.396576,70.239814],[-160.837928,70.343876],[-160.487404,70.453415],[-159.649432,70.792985],[-159.33177,70.809416],[-159.298908,70.760123],[-158.975769,70.798462],[-158.658106,70.787508],[-158.033735,70.831323],[-157.420318,70.979201],[-156.812377,71.285909],[-156.565915,71.351633],[-156.522099,71.296863],[-155.585543,71.170894],[-155.508865,71.083263],[-155.832005,70.968247],[-155.979882,70.96277],[-155.974405,70.809416],[-155.503388,70.858708],[-155.476004,70.940862],[-155.262403,71.017539],[-155.191203,70.973724],[-155.032372,71.148986],[-154.566832,70.990155],[-154.643509,70.869662],[-154.353231,70.8368],[-154.183446,70.7656],[-153.931507,70.880616],[-153.487874,70.886093],[-153.235935,70.924431],[-152.589656,70.886093],[-152.26104,70.842277],[-152.419871,70.606769],[-151.817408,70.546523],[-151.773592,70.486276],[-151.187559,70.382214],[-151.182082,70.431507],[-150.760358,70.49723],[-150.355064,70.491753],[-150.349588,70.436984],[-150.114079,70.431507],[-149.867617,70.508184],[-149.462323,70.519138],[-149.177522,70.486276],[-148.78866,70.404122],[-148.607921,70.420553],[-148.350504,70.305537],[-148.202627,70.349353],[-147.961642,70.316491],[-147.786379,70.245291]]],[[[-152.94018,58.026237],[-152.945657,57.982421],[-153.290705,58.048145],[-153.044242,58.305561],[-152.819688,58.327469],[-152.666333,58.562977],[-152.496548,58.354853],[-152.354148,58.426053],[-152.080301,58.311038],[-152.080301,58.152206],[-152.480117,58.130299],[-152.655379,58.059098],[-152.94018,58.026237]]],[[[-153.958891,57.538789],[-153.67409,57.670236],[-153.931507,57.69762],[-153.936983,57.812636],[-153.723383,57.889313],[-153.570028,57.834544],[-153.548121,57.719528],[-153.46049,57.796205],[-153.455013,57.96599],[-153.268797,57.889313],[-153.235935,57.998852],[-153.071627,57.933129],[-152.874457,57.933129],[-152.721103,57.993375],[-152.469163,57.889313],[-152.469163,57.599035],[-152.151501,57.620943],[-152.359625,57.42925],[-152.74301,57.505928],[-152.60061,57.379958],[-152.710149,57.275896],[-152.907319,57.325188],[-152.912796,57.128019],[-153.214027,57.073249],[-153.312612,56.991095],[-153.498828,57.067772],[-153.695998,56.859649],[-153.849352,56.837741],[-154.013661,56.744633],[-154.073907,56.969187],[-154.303938,56.848695],[-154.314892,56.919895],[-154.523016,56.991095],[-154.539447,57.193742],[-154.742094,57.275896],[-154.627078,57.511404],[-154.227261,57.659282],[-153.980799,57.648328],[-153.958891,57.538789]]],[[[-154.53397,56.602232],[-154.742094,56.399586],[-154.807817,56.432447],[-154.53397,56.602232]]],[[[-155.634835,55.923092],[-155.476004,55.912138],[-155.530773,55.704014],[-155.793666,55.731399],[-155.837482,55.802599],[-155.634835,55.923092]]],[[[-159.890418,55.28229],[-159.950664,55.068689],[-160.257373,54.893427],[-160.109495,55.161797],[-160.005433,55.134412],[-159.890418,55.28229]]],[[[-160.520266,55.358967],[-160.33405,55.358967],[-160.339527,55.249428],[-160.525743,55.128935],[-160.690051,55.211089],[-160.794113,55.134412],[-160.854359,55.320628],[-160.79959,55.380875],[-160.520266,55.358967]]],[[[-162.256456,54.981058],[-162.234548,54.893427],[-162.349564,54.838658],[-162.437195,54.931766],[-162.256456,54.981058]]],[[[-162.415287,63.634624],[-162.563165,63.536039],[-162.612457,63.62367],[-162.415287,63.634624]]],[[[-162.80415,54.488133],[-162.590549,54.449795],[-162.612457,54.367641],[-162.782242,54.373118],[-162.80415,54.488133]]],[[[-165.548097,54.29644],[-165.476897,54.181425],[-165.630251,54.132132],[-165.685021,54.252625],[-165.548097,54.29644]]],[[[-165.73979,54.15404],[-166.046499,54.044501],[-166.112222,54.121178],[-165.980775,54.219763],[-165.73979,54.15404]]],[[[-166.364161,60.359413],[-166.13413,60.397752],[-166.084837,60.326552],[-165.88219,60.342983],[-165.685021,60.277259],[-165.646682,59.992458],[-165.750744,59.89935],[-166.00816,59.844581],[-166.062929,59.745996],[-166.440838,59.855535],[-166.6161,59.850058],[-166.994009,59.992458],[-167.125456,59.992458],[-167.344534,60.074613],[-167.421211,60.206059],[-167.311672,60.238921],[-166.93924,60.206059],[-166.763978,60.310121],[-166.577762,60.321075],[-166.495608,60.392275],[-166.364161,60.359413]]],[[[-166.375115,54.01164],[-166.210807,53.934962],[-166.5449,53.748746],[-166.539423,53.715885],[-166.117699,53.852808],[-166.112222,53.776131],[-166.282007,53.683023],[-166.555854,53.622777],[-166.583239,53.529669],[-166.878994,53.431084],[-167.13641,53.425607],[-167.306195,53.332499],[-167.623857,53.250345],[-167.793643,53.337976],[-167.459549,53.442038],[-167.355487,53.425607],[-167.103548,53.513238],[-167.163794,53.611823],[-167.021394,53.715885],[-166.807793,53.666592],[-166.785886,53.732316],[-167.015917,53.754223],[-167.141887,53.825424],[-167.032348,53.945916],[-166.643485,54.017116],[-166.561331,53.880193],[-166.375115,54.01164]]],[[[-168.790446,53.157237],[-168.40706,53.34893],[-168.385152,53.431084],[-168.237275,53.524192],[-168.007243,53.568007],[-167.886751,53.518715],[-167.842935,53.387268],[-168.270136,53.244868],[-168.500168,53.036744],[-168.686384,52.965544],[-168.790446,53.157237]]],[[[-169.74891,52.894344],[-169.705095,52.795759],[-169.962511,52.790282],[-169.989896,52.856005],[-169.74891,52.894344]]],[[[-170.148727,57.221127],[-170.28565,57.128019],[-170.313035,57.221127],[-170.148727,57.221127]]],[[[-170.669036,52.697174],[-170.603313,52.604066],[-170.789529,52.538343],[-170.816914,52.636928],[-170.669036,52.697174]]],[[[-171.742517,63.716778],[-170.94836,63.5689],[-170.488297,63.69487],[-170.280174,63.683916],[-170.093958,63.612716],[-170.044665,63.492223],[-169.644848,63.4265],[-169.518879,63.366254],[-168.99857,63.338869],[-168.686384,63.295053],[-168.856169,63.147176],[-169.108108,63.180038],[-169.376478,63.152653],[-169.513402,63.08693],[-169.639372,62.939052],[-169.831064,63.075976],[-170.055619,63.169084],[-170.263743,63.180038],[-170.362328,63.2841],[-170.866206,63.415546],[-171.101715,63.421023],[-171.463193,63.306007],[-171.73704,63.366254],[-171.852055,63.486746],[-171.742517,63.716778]]],[[[-172.432611,52.390465],[-172.41618,52.275449],[-172.607873,52.253542],[-172.569535,52.352127],[-172.432611,52.390465]]],[[[-173.626584,52.14948],[-173.495138,52.105664],[-173.122706,52.111141],[-173.106275,52.07828],[-173.549907,52.028987],[-173.626584,52.14948]]],[[[-174.322156,52.280926],[-174.327632,52.379511],[-174.185232,52.41785],[-173.982585,52.319265],[-174.059262,52.226157],[-174.179755,52.231634],[-174.141417,52.127572],[-174.333109,52.116618],[-174.738403,52.007079],[-174.968435,52.039941],[-174.902711,52.116618],[-174.656249,52.105664],[-174.322156,52.280926]]],[[[-176.469116,51.853725],[-176.288377,51.870156],[-176.288377,51.744186],[-176.518409,51.760617],[-176.80321,51.61274],[-176.912748,51.80991],[-176.792256,51.815386],[-176.775825,51.963264],[-176.627947,51.968741],[-176.627947,51.859202],[-176.469116,51.853725]]],[[[-177.153734,51.946833],[-177.044195,51.897541],[-177.120872,51.727755],[-177.274226,51.678463],[-177.279703,51.782525],[-177.153734,51.946833]]],[[[-178.123152,51.919448],[-177.953367,51.913971],[-177.800013,51.793479],[-177.964321,51.651078],[-178.123152,51.919448]]],[[[173.107557,52.992929],[173.293773,52.927205],[173.304726,52.823143],[172.90491,52.762897],[172.642017,52.927205],[172.642017,53.003883],[173.107557,52.992929]]]]}},{type:"Feature",id:"AZ",properties:{name:"Arizona",value:98},geometry:{type:"Polygon",coordinates:[[[-109.042503,37.000263],[-109.04798,31.331629],[-111.074448,31.331629],[-112.246513,31.704061],[-114.815198,32.492741],[-114.72209,32.717295],[-114.524921,32.755634],[-114.470151,32.843265],[-114.524921,33.029481],[-114.661844,33.034958],[-114.727567,33.40739],[-114.524921,33.54979],[-114.497536,33.697668],[-114.535874,33.933176],[-114.415382,34.108438],[-114.256551,34.174162],[-114.136058,34.305608],[-114.333228,34.448009],[-114.470151,34.710902],[-114.634459,34.87521],[-114.634459,35.00118],[-114.574213,35.138103],[-114.596121,35.324319],[-114.678275,35.516012],[-114.738521,36.102045],[-114.371566,36.140383],[-114.251074,36.01989],[-114.152489,36.025367],[-114.048427,36.195153],[-114.048427,37.000263],[-110.499369,37.00574],[-109.042503,37.000263]]]}},{type:"Feature",id:"AR",properties:{name:"Arkansas",value:5},geometry:{type:"Polygon",coordinates:[[[-94.473842,36.501861],[-90.152536,36.496384],[-90.064905,36.304691],[-90.218259,36.184199],[-90.377091,35.997983],[-89.730812,35.997983],[-89.763673,35.811767],[-89.911551,35.756997],[-89.944412,35.603643],[-90.130628,35.439335],[-90.114197,35.198349],[-90.212782,35.023087],[-90.311367,34.995703],[-90.251121,34.908072],[-90.409952,34.831394],[-90.481152,34.661609],[-90.585214,34.617794],[-90.568783,34.420624],[-90.749522,34.365854],[-90.744046,34.300131],[-90.952169,34.135823],[-90.891923,34.026284],[-91.072662,33.867453],[-91.231493,33.560744],[-91.056231,33.429298],[-91.143862,33.347144],[-91.089093,33.13902],[-91.16577,33.002096],[-93.608485,33.018527],[-94.041164,33.018527],[-94.041164,33.54979],[-94.183564,33.593606],[-94.380734,33.544313],[-94.484796,33.637421],[-94.430026,35.395519],[-94.616242,36.501861],[-94.473842,36.501861]]]}},{type:"Feature",id:"CA",properties:{name:"California",value:38},geometry:{type:"Polygon",coordinates:[[[-123.233256,42.006186],[-122.378853,42.011663],[-121.037003,41.995232],[-120.001861,41.995232],[-119.996384,40.264519],[-120.001861,38.999346],[-118.71478,38.101128],[-117.498899,37.21934],[-116.540435,36.501861],[-115.85034,35.970598],[-114.634459,35.00118],[-114.634459,34.87521],[-114.470151,34.710902],[-114.333228,34.448009],[-114.136058,34.305608],[-114.256551,34.174162],[-114.415382,34.108438],[-114.535874,33.933176],[-114.497536,33.697668],[-114.524921,33.54979],[-114.727567,33.40739],[-114.661844,33.034958],[-114.524921,33.029481],[-114.470151,32.843265],[-114.524921,32.755634],[-114.72209,32.717295],[-116.04751,32.624187],[-117.126467,32.536556],[-117.24696,32.668003],[-117.252437,32.876127],[-117.329114,33.122589],[-117.471515,33.297851],[-117.7837,33.538836],[-118.183517,33.763391],[-118.260194,33.703145],[-118.413548,33.741483],[-118.391641,33.840068],[-118.566903,34.042715],[-118.802411,33.998899],[-119.218659,34.146777],[-119.278905,34.26727],[-119.558229,34.415147],[-119.875891,34.40967],[-120.138784,34.475393],[-120.472878,34.448009],[-120.64814,34.579455],[-120.609801,34.858779],[-120.670048,34.902595],[-120.631709,35.099764],[-120.894602,35.247642],[-120.905556,35.450289],[-121.004141,35.461243],[-121.168449,35.636505],[-121.283465,35.674843],[-121.332757,35.784382],[-121.716143,36.195153],[-121.896882,36.315645],[-121.935221,36.638785],[-121.858544,36.6114],[-121.787344,36.803093],[-121.929744,36.978355],[-122.105006,36.956447],[-122.335038,37.115279],[-122.417192,37.241248],[-122.400761,37.361741],[-122.515777,37.520572],[-122.515777,37.783465],[-122.329561,37.783465],[-122.406238,38.15042],[-122.488392,38.112082],[-122.504823,37.931343],[-122.701993,37.893004],[-122.937501,38.029928],[-122.97584,38.265436],[-123.129194,38.451652],[-123.331841,38.566668],[-123.44138,38.698114],[-123.737134,38.95553],[-123.687842,39.032208],[-123.824765,39.366301],[-123.764519,39.552517],[-123.85215,39.831841],[-124.109566,40.105688],[-124.361506,40.259042],[-124.410798,40.439781],[-124.158859,40.877937],[-124.109566,41.025814],[-124.158859,41.14083],[-124.065751,41.442061],[-124.147905,41.715908],[-124.257444,41.781632],[-124.213628,42.000709],[-123.233256,42.006186]]]}},{type:"Feature",id:"CO",properties:{name:"Colorado",value:59},geometry:{type:"Polygon",coordinates:[[[-107.919731,41.003906],[-105.728954,40.998429],[-104.053011,41.003906],[-102.053927,41.003906],[-102.053927,40.001626],[-102.042974,36.994786],[-103.001438,37.000263],[-104.337812,36.994786],[-106.868158,36.994786],[-107.421329,37.000263],[-109.042503,37.000263],[-109.042503,38.166851],[-109.058934,38.27639],[-109.053457,39.125316],[-109.04798,40.998429],[-107.919731,41.003906]]]}},{type:"Feature",id:"CT",properties:{name:"Connecticut",value:45},geometry:{type:"Polygon",coordinates:[[[-73.053528,42.039048],[-71.799309,42.022617],[-71.799309,42.006186],[-71.799309,41.414677],[-71.859555,41.321569],[-71.947186,41.338],[-72.385341,41.261322],[-72.905651,41.28323],[-73.130205,41.146307],[-73.371191,41.102491],[-73.655992,40.987475],[-73.727192,41.102491],[-73.48073,41.21203],[-73.55193,41.294184],[-73.486206,42.050002],[-73.053528,42.039048]]]}},{type:"Feature",id:"DE",properties:{name:"Delaware",value:76},geometry:{type:"Polygon",coordinates:[[[-75.414089,39.804456],[-75.507197,39.683964],[-75.611259,39.61824],[-75.589352,39.459409],[-75.441474,39.311532],[-75.403136,39.065069],[-75.189535,38.807653],[-75.09095,38.796699],[-75.047134,38.451652],[-75.693413,38.462606],[-75.786521,39.722302],[-75.616736,39.831841],[-75.414089,39.804456]]]}},{type:"Feature",id:"FL",properties:{name:"Florida",value:3},geometry:{type:"Polygon",coordinates:[[[-85.497137,30.997536],[-85.004212,31.003013],[-84.867289,30.712735],[-83.498053,30.647012],[-82.216449,30.570335],[-82.167157,30.356734],[-82.046664,30.362211],[-82.002849,30.564858],[-82.041187,30.751074],[-81.948079,30.827751],[-81.718048,30.745597],[-81.444201,30.707258],[-81.383954,30.27458],[-81.257985,29.787132],[-80.967707,29.14633],[-80.524075,28.461713],[-80.589798,28.41242],[-80.56789,28.094758],[-80.381674,27.738757],[-80.091397,27.021277],[-80.03115,26.796723],[-80.036627,26.566691],[-80.146166,25.739673],[-80.239274,25.723243],[-80.337859,25.465826],[-80.304997,25.383672],[-80.49669,25.197456],[-80.573367,25.241272],[-80.759583,25.164595],[-81.077246,25.120779],[-81.170354,25.224841],[-81.126538,25.378195],[-81.351093,25.821827],[-81.526355,25.903982],[-81.679709,25.843735],[-81.800202,26.090198],[-81.833064,26.292844],[-82.041187,26.517399],[-82.09048,26.665276],[-82.057618,26.878877],[-82.172634,26.917216],[-82.145249,26.791246],[-82.249311,26.758384],[-82.566974,27.300601],[-82.692943,27.437525],[-82.391711,27.837342],[-82.588881,27.815434],[-82.720328,27.689464],[-82.851774,27.886634],[-82.676512,28.434328],[-82.643651,28.888914],[-82.764143,28.998453],[-82.802482,29.14633],[-82.994175,29.179192],[-83.218729,29.420177],[-83.399469,29.518762],[-83.410422,29.66664],[-83.536392,29.721409],[-83.640454,29.885717],[-84.02384,30.104795],[-84.357933,30.055502],[-84.341502,29.902148],[-84.451041,29.929533],[-84.867289,29.743317],[-85.310921,29.699501],[-85.299967,29.80904],[-85.404029,29.940487],[-85.924338,30.236241],[-86.29677,30.362211],[-86.630863,30.395073],[-86.910187,30.373165],[-87.518128,30.280057],[-87.37025,30.427934],[-87.446927,30.510088],[-87.408589,30.674397],[-87.633143,30.86609],[-87.600282,30.997536],[-85.497137,30.997536]]]}},{type:"Feature",id:"GA",properties:{name:"Georgia",value:77},geometry:{type:"Polygon",coordinates:[[[-83.109191,35.00118],[-83.322791,34.787579],[-83.339222,34.683517],[-83.005129,34.469916],[-82.901067,34.486347],[-82.747713,34.26727],[-82.714851,34.152254],[-82.55602,33.94413],[-82.325988,33.81816],[-82.194542,33.631944],[-81.926172,33.462159],[-81.937125,33.347144],[-81.761863,33.160928],[-81.493493,33.007573],[-81.42777,32.843265],[-81.416816,32.629664],[-81.279893,32.558464],[-81.121061,32.290094],[-81.115584,32.120309],[-80.885553,32.032678],[-81.132015,31.693108],[-81.175831,31.517845],[-81.279893,31.364491],[-81.290846,31.20566],[-81.400385,31.13446],[-81.444201,30.707258],[-81.718048,30.745597],[-81.948079,30.827751],[-82.041187,30.751074],[-82.002849,30.564858],[-82.046664,30.362211],[-82.167157,30.356734],[-82.216449,30.570335],[-83.498053,30.647012],[-84.867289,30.712735],[-85.004212,31.003013],[-85.113751,31.27686],[-85.042551,31.539753],[-85.141136,31.840985],[-85.053504,32.01077],[-85.058981,32.13674],[-84.889196,32.262709],[-85.004212,32.322956],[-84.960397,32.421541],[-85.069935,32.580372],[-85.184951,32.859696],[-85.431413,34.124869],[-85.606675,34.984749],[-84.319594,34.990226],[-83.618546,34.984749],[-83.109191,35.00118]]]}},{type:"Feature",id:"HI",properties:{name:"Hawaii",value:88},geometry:{type:"MultiPolygon",coordinates:[[[[-155.634835,18.948267],[-155.881297,19.035898],[-155.919636,19.123529],[-155.886774,19.348084],[-156.062036,19.73147],[-155.925113,19.857439],[-155.826528,20.032702],[-155.897728,20.147717],[-155.87582,20.26821],[-155.596496,20.12581],[-155.284311,20.021748],[-155.092618,19.868393],[-155.092618,19.736947],[-154.807817,19.523346],[-154.983079,19.348084],[-155.295265,19.26593],[-155.514342,19.134483],[-155.634835,18.948267]]],[[[-156.587823,21.029505],[-156.472807,20.892581],[-156.324929,20.952827],[-156.00179,20.793996],[-156.051082,20.651596],[-156.379699,20.580396],[-156.445422,20.60778],[-156.461853,20.783042],[-156.631638,20.821381],[-156.697361,20.919966],[-156.587823,21.029505]]],[[[-156.982162,21.210244],[-157.080747,21.106182],[-157.310779,21.106182],[-157.239579,21.221198],[-156.982162,21.210244]]],[[[-157.951581,21.697691],[-157.842042,21.462183],[-157.896811,21.325259],[-158.110412,21.303352],[-158.252813,21.582676],[-158.126843,21.588153],[-157.951581,21.697691]]],[[[-159.468693,22.228955],[-159.353678,22.218001],[-159.298908,22.113939],[-159.33177,21.966061],[-159.446786,21.872953],[-159.764448,21.987969],[-159.726109,22.152277],[-159.468693,22.228955]]]]}},{type:"Feature",id:"ID",properties:{name:"Idaho",value:22},geometry:{type:"Polygon",coordinates:[[[-116.04751,49.000239],[-116.04751,47.976051],[-115.724371,47.696727],[-115.718894,47.42288],[-115.527201,47.302388],[-115.324554,47.258572],[-115.302646,47.187372],[-114.930214,46.919002],[-114.886399,46.809463],[-114.623506,46.705401],[-114.612552,46.639678],[-114.322274,46.645155],[-114.464674,46.272723],[-114.492059,46.037214],[-114.387997,45.88386],[-114.568736,45.774321],[-114.497536,45.670259],[-114.546828,45.560721],[-114.333228,45.456659],[-114.086765,45.593582],[-113.98818,45.703121],[-113.807441,45.604536],[-113.834826,45.522382],[-113.736241,45.330689],[-113.571933,45.128042],[-113.45144,45.056842],[-113.456917,44.865149],[-113.341901,44.782995],[-113.133778,44.772041],[-113.002331,44.448902],[-112.887315,44.394132],[-112.783254,44.48724],[-112.471068,44.481763],[-112.241036,44.569394],[-112.104113,44.520102],[-111.868605,44.563917],[-111.819312,44.509148],[-111.616665,44.547487],[-111.386634,44.75561],[-111.227803,44.580348],[-111.047063,44.476286],[-111.047063,42.000709],[-112.164359,41.995232],[-114.04295,41.995232],[-117.027882,42.000709],[-117.027882,43.830007],[-116.896436,44.158624],[-116.97859,44.240778],[-117.170283,44.257209],[-117.241483,44.394132],[-117.038836,44.750133],[-116.934774,44.782995],[-116.830713,44.930872],[-116.847143,45.02398],[-116.732128,45.144473],[-116.671881,45.319735],[-116.463758,45.61549],[-116.545912,45.752413],[-116.78142,45.823614],[-116.918344,45.993399],[-116.92382,46.168661],[-117.055267,46.343923],[-117.038836,46.426077],[-117.044313,47.762451],[-117.033359,49.000239],[-116.04751,49.000239]]]}},{type:"Feature",id:"IL",properties:{name:"Illinois",value:83},geometry:{type:"Polygon",coordinates:[[[-90.639984,42.510065],[-88.788778,42.493634],[-87.802929,42.493634],[-87.83579,42.301941],[-87.682436,42.077386],[-87.523605,41.710431],[-87.529082,39.34987],[-87.63862,39.169131],[-87.512651,38.95553],[-87.49622,38.780268],[-87.62219,38.637868],[-87.655051,38.506421],[-87.83579,38.292821],[-87.950806,38.27639],[-87.923421,38.15042],[-88.000098,38.101128],[-88.060345,37.865619],[-88.027483,37.799896],[-88.15893,37.657496],[-88.065822,37.482234],[-88.476592,37.389126],[-88.514931,37.285064],[-88.421823,37.153617],[-88.547792,37.071463],[-88.914747,37.224817],[-89.029763,37.213863],[-89.183118,37.038601],[-89.133825,36.983832],[-89.292656,36.994786],[-89.517211,37.279587],[-89.435057,37.34531],[-89.517211,37.537003],[-89.517211,37.690357],[-89.84035,37.903958],[-89.949889,37.88205],[-90.059428,38.013497],[-90.355183,38.216144],[-90.349706,38.374975],[-90.179921,38.632391],[-90.207305,38.725499],[-90.10872,38.845992],[-90.251121,38.917192],[-90.470199,38.961007],[-90.585214,38.867899],[-90.661891,38.928146],[-90.727615,39.256762],[-91.061708,39.470363],[-91.368417,39.727779],[-91.494386,40.034488],[-91.50534,40.237135],[-91.417709,40.379535],[-91.401278,40.560274],[-91.121954,40.669813],[-91.09457,40.823167],[-90.963123,40.921752],[-90.946692,41.097014],[-91.111001,41.239415],[-91.045277,41.414677],[-90.656414,41.463969],[-90.344229,41.589939],[-90.311367,41.743293],[-90.179921,41.809016],[-90.141582,42.000709],[-90.168967,42.126679],[-90.393521,42.225264],[-90.420906,42.329326],[-90.639984,42.510065]]]}},{type:"Feature",id:"IN",properties:{name:"Indiana",value:100},geometry:{type:"Polygon",coordinates:[[[-85.990061,41.759724],[-84.807042,41.759724],[-84.807042,41.694001],[-84.801565,40.500028],[-84.817996,39.103408],[-84.894673,39.059592],[-84.812519,38.785745],[-84.987781,38.780268],[-85.173997,38.68716],[-85.431413,38.730976],[-85.42046,38.533806],[-85.590245,38.451652],[-85.655968,38.325682],[-85.83123,38.27639],[-85.924338,38.024451],[-86.039354,37.958727],[-86.263908,38.051835],[-86.302247,38.166851],[-86.521325,38.040881],[-86.504894,37.931343],[-86.729448,37.893004],[-86.795172,37.991589],[-87.047111,37.893004],[-87.129265,37.788942],[-87.381204,37.93682],[-87.512651,37.903958],[-87.600282,37.975158],[-87.682436,37.903958],[-87.934375,37.893004],[-88.027483,37.799896],[-88.060345,37.865619],[-88.000098,38.101128],[-87.923421,38.15042],[-87.950806,38.27639],[-87.83579,38.292821],[-87.655051,38.506421],[-87.62219,38.637868],[-87.49622,38.780268],[-87.512651,38.95553],[-87.63862,39.169131],[-87.529082,39.34987],[-87.523605,41.710431],[-87.42502,41.644708],[-87.118311,41.644708],[-86.822556,41.759724],[-85.990061,41.759724]]]}},{type:"Feature",id:"IA",properties:{name:"Iowa",value:44},geometry:{type:"Polygon",coordinates:[[[-91.368417,43.501391],[-91.215062,43.501391],[-91.204109,43.353514],[-91.056231,43.254929],[-91.176724,43.134436],[-91.143862,42.909881],[-91.067185,42.75105],[-90.711184,42.636034],[-90.639984,42.510065],[-90.420906,42.329326],[-90.393521,42.225264],[-90.168967,42.126679],[-90.141582,42.000709],[-90.179921,41.809016],[-90.311367,41.743293],[-90.344229,41.589939],[-90.656414,41.463969],[-91.045277,41.414677],[-91.111001,41.239415],[-90.946692,41.097014],[-90.963123,40.921752],[-91.09457,40.823167],[-91.121954,40.669813],[-91.401278,40.560274],[-91.417709,40.379535],[-91.527248,40.412397],[-91.729895,40.615043],[-91.833957,40.609566],[-93.257961,40.582182],[-94.632673,40.571228],[-95.7664,40.587659],[-95.881416,40.719105],[-95.826646,40.976521],[-95.925231,41.201076],[-95.919754,41.453015],[-96.095016,41.540646],[-96.122401,41.67757],[-96.062155,41.798063],[-96.127878,41.973325],[-96.264801,42.039048],[-96.44554,42.488157],[-96.631756,42.707235],[-96.544125,42.855112],[-96.511264,43.052282],[-96.434587,43.123482],[-96.560556,43.222067],[-96.527695,43.397329],[-96.582464,43.479483],[-96.451017,43.501391],[-91.368417,43.501391]]]}},{type:"Feature",id:"KS",properties:{name:"Kansas",value:76},geometry:{type:"Polygon",coordinates:[[[-101.90605,40.001626],[-95.306337,40.001626],[-95.207752,39.908518],[-94.884612,39.831841],[-95.109167,39.541563],[-94.983197,39.442978],[-94.824366,39.20747],[-94.610765,39.158177],[-94.616242,37.000263],[-100.087706,37.000263],[-102.042974,36.994786],[-102.053927,40.001626],[-101.90605,40.001626]]]}},{type:"Feature",id:"KY",properties:{name:"Kentucky",value:29},geometry:{type:"Polygon",coordinates:[[[-83.903347,38.769315],[-83.678792,38.632391],[-83.519961,38.703591],[-83.142052,38.626914],[-83.032514,38.725499],[-82.890113,38.758361],[-82.846298,38.588575],[-82.731282,38.561191],[-82.594358,38.424267],[-82.621743,38.123036],[-82.50125,37.931343],[-82.342419,37.783465],[-82.293127,37.668449],[-82.101434,37.553434],[-81.969987,37.537003],[-82.353373,37.268633],[-82.720328,37.120755],[-82.720328,37.044078],[-82.868205,36.978355],[-82.879159,36.890724],[-83.070852,36.852385],[-83.136575,36.742847],[-83.673316,36.600446],[-83.689746,36.584015],[-84.544149,36.594969],[-85.289013,36.627831],[-85.486183,36.616877],[-86.592525,36.655216],[-87.852221,36.633308],[-88.071299,36.677123],[-88.054868,36.496384],[-89.298133,36.507338],[-89.418626,36.496384],[-89.363857,36.622354],[-89.215979,36.578538],[-89.133825,36.983832],[-89.183118,37.038601],[-89.029763,37.213863],[-88.914747,37.224817],[-88.547792,37.071463],[-88.421823,37.153617],[-88.514931,37.285064],[-88.476592,37.389126],[-88.065822,37.482234],[-88.15893,37.657496],[-88.027483,37.799896],[-87.934375,37.893004],[-87.682436,37.903958],[-87.600282,37.975158],[-87.512651,37.903958],[-87.381204,37.93682],[-87.129265,37.788942],[-87.047111,37.893004],[-86.795172,37.991589],[-86.729448,37.893004],[-86.504894,37.931343],[-86.521325,38.040881],[-86.302247,38.166851],[-86.263908,38.051835],[-86.039354,37.958727],[-85.924338,38.024451],[-85.83123,38.27639],[-85.655968,38.325682],[-85.590245,38.451652],[-85.42046,38.533806],[-85.431413,38.730976],[-85.173997,38.68716],[-84.987781,38.780268],[-84.812519,38.785745],[-84.894673,39.059592],[-84.817996,39.103408],[-84.43461,39.103408],[-84.231963,38.895284],[-84.215533,38.807653],[-83.903347,38.769315]]]}},{type:"Feature",id:"LA",properties:{name:"Louisiana",value:94},geometry:{type:"Polygon",coordinates:[[[-93.608485,33.018527],[-91.16577,33.002096],[-91.072662,32.887081],[-91.143862,32.843265],[-91.154816,32.640618],[-91.006939,32.514649],[-90.985031,32.218894],[-91.105524,31.988862],[-91.341032,31.846462],[-91.401278,31.621907],[-91.499863,31.643815],[-91.516294,31.27686],[-91.636787,31.265906],[-91.565587,31.068736],[-91.636787,30.997536],[-89.747242,30.997536],[-89.845827,30.66892],[-89.681519,30.449842],[-89.643181,30.285534],[-89.522688,30.181472],[-89.818443,30.044549],[-89.84035,29.945964],[-89.599365,29.88024],[-89.495303,30.039072],[-89.287179,29.88024],[-89.30361,29.754271],[-89.424103,29.699501],[-89.648657,29.748794],[-89.621273,29.655686],[-89.69795,29.513285],[-89.506257,29.387316],[-89.199548,29.348977],[-89.09001,29.2011],[-89.002379,29.179192],[-89.16121,29.009407],[-89.336472,29.042268],[-89.484349,29.217531],[-89.851304,29.310638],[-89.851304,29.480424],[-90.032043,29.425654],[-90.021089,29.283254],[-90.103244,29.151807],[-90.23469,29.129899],[-90.333275,29.277777],[-90.563307,29.283254],[-90.645461,29.129899],[-90.798815,29.086084],[-90.963123,29.179192],[-91.09457,29.190146],[-91.220539,29.436608],[-91.445094,29.546147],[-91.532725,29.529716],[-91.620356,29.73784],[-91.883249,29.710455],[-91.888726,29.836425],[-92.146142,29.715932],[-92.113281,29.622824],[-92.31045,29.535193],[-92.617159,29.579009],[-92.97316,29.715932],[-93.2251,29.776178],[-93.767317,29.726886],[-93.838517,29.688547],[-93.926148,29.787132],[-93.690639,30.143133],[-93.767317,30.334826],[-93.696116,30.438888],[-93.728978,30.575812],[-93.630393,30.679874],[-93.526331,30.93729],[-93.542762,31.15089],[-93.816609,31.556184],[-93.822086,31.775262],[-94.041164,31.994339],[-94.041164,33.018527],[-93.608485,33.018527]]]}},{type:"Feature",id:"ME",properties:{name:"Maine",value:44},geometry:{type:"Polygon",coordinates:[[[-70.703921,43.057759],[-70.824413,43.128959],[-70.807983,43.227544],[-70.966814,43.34256],[-71.032537,44.657025],[-71.08183,45.303304],[-70.649151,45.440228],[-70.720352,45.511428],[-70.556043,45.664782],[-70.386258,45.735983],[-70.41912,45.796229],[-70.260289,45.889337],[-70.309581,46.064599],[-70.210996,46.327492],[-70.057642,46.415123],[-69.997395,46.694447],[-69.225147,47.461219],[-69.044408,47.428357],[-69.033454,47.242141],[-68.902007,47.176418],[-68.578868,47.285957],[-68.376221,47.285957],[-68.233821,47.357157],[-67.954497,47.198326],[-67.790188,47.066879],[-67.779235,45.944106],[-67.801142,45.675736],[-67.456095,45.604536],[-67.505388,45.48952],[-67.417757,45.379982],[-67.488957,45.281397],[-67.346556,45.128042],[-67.16034,45.160904],[-66.979601,44.804903],[-67.187725,44.646072],[-67.308218,44.706318],[-67.406803,44.596779],[-67.549203,44.624164],[-67.565634,44.531056],[-67.75185,44.54201],[-68.047605,44.328409],[-68.118805,44.476286],[-68.222867,44.48724],[-68.173574,44.328409],[-68.403606,44.251732],[-68.458375,44.377701],[-68.567914,44.311978],[-68.82533,44.311978],[-68.830807,44.459856],[-68.984161,44.426994],[-68.956777,44.322932],[-69.099177,44.103854],[-69.071793,44.043608],[-69.258008,43.923115],[-69.444224,43.966931],[-69.553763,43.840961],[-69.707118,43.82453],[-69.833087,43.720469],[-69.986442,43.742376],[-70.030257,43.851915],[-70.254812,43.676653],[-70.194565,43.567114],[-70.358873,43.528776],[-70.369827,43.435668],[-70.556043,43.320652],[-70.703921,43.057759]]]}},{type:"Feature",id:"MD",properties:{name:"Maryland",value:66},geometry:{type:"MultiPolygon",coordinates:[[[[-75.994645,37.95325],[-76.016553,37.95325],[-76.043938,37.95325],[-75.994645,37.95325]]],[[[-79.477979,39.722302],[-75.786521,39.722302],[-75.693413,38.462606],[-75.047134,38.451652],[-75.244304,38.029928],[-75.397659,38.013497],[-75.671506,37.95325],[-75.885106,37.909435],[-75.879629,38.073743],[-75.961783,38.139466],[-75.846768,38.210667],[-76.000122,38.374975],[-76.049415,38.303775],[-76.257538,38.320205],[-76.328738,38.500944],[-76.263015,38.500944],[-76.257538,38.736453],[-76.191815,38.829561],[-76.279446,39.147223],[-76.169907,39.333439],[-76.000122,39.366301],[-75.972737,39.557994],[-76.098707,39.536086],[-76.104184,39.437501],[-76.367077,39.311532],[-76.443754,39.196516],[-76.460185,38.906238],[-76.55877,38.769315],[-76.514954,38.539283],[-76.383508,38.380452],[-76.399939,38.259959],[-76.317785,38.139466],[-76.3616,38.057312],[-76.591632,38.216144],[-76.920248,38.292821],[-77.018833,38.446175],[-77.205049,38.358544],[-77.276249,38.479037],[-77.128372,38.632391],[-77.040741,38.791222],[-76.909294,38.895284],[-77.035264,38.993869],[-77.117418,38.933623],[-77.248864,39.026731],[-77.456988,39.076023],[-77.456988,39.223901],[-77.566527,39.306055],[-77.719881,39.322485],[-77.834897,39.601809],[-78.004682,39.601809],[-78.174467,39.694917],[-78.267575,39.61824],[-78.431884,39.623717],[-78.470222,39.514178],[-78.765977,39.585379],[-78.963147,39.437501],[-79.094593,39.470363],[-79.291763,39.300578],[-79.488933,39.20747],[-79.477979,39.722302]]]]}},{type:"Feature",id:"MA",properties:{name:"Massachusetts",value:39},geometry:{type:"Polygon",coordinates:[[[-70.917521,42.887974],[-70.818936,42.871543],[-70.780598,42.696281],[-70.824413,42.55388],[-70.983245,42.422434],[-70.988722,42.269079],[-70.769644,42.247172],[-70.638197,42.08834],[-70.660105,41.962371],[-70.550566,41.929509],[-70.539613,41.814493],[-70.260289,41.715908],[-69.937149,41.809016],[-70.008349,41.672093],[-70.484843,41.5516],[-70.660105,41.546123],[-70.764167,41.639231],[-70.928475,41.611847],[-70.933952,41.540646],[-71.120168,41.496831],[-71.196845,41.67757],[-71.22423,41.710431],[-71.328292,41.781632],[-71.383061,42.01714],[-71.530939,42.01714],[-71.799309,42.006186],[-71.799309,42.022617],[-73.053528,42.039048],[-73.486206,42.050002],[-73.508114,42.08834],[-73.267129,42.745573],[-72.456542,42.729142],[-71.29543,42.696281],[-71.185891,42.789389],[-70.917521,42.887974]]]}},{type:"Feature",id:"MI",properties:{name:"Michigan",value:70},geometry:{type:"MultiPolygon",coordinates:[[[[-83.454238,41.732339],[-84.807042,41.694001],[-84.807042,41.759724],[-85.990061,41.759724],[-86.822556,41.759724],[-86.619909,41.891171],[-86.482986,42.115725],[-86.357016,42.252649],[-86.263908,42.444341],[-86.209139,42.718189],[-86.231047,43.013943],[-86.526801,43.594499],[-86.433693,43.813577],[-86.499417,44.07647],[-86.269385,44.34484],[-86.220093,44.569394],[-86.252954,44.689887],[-86.088646,44.73918],[-86.066738,44.903488],[-85.809322,44.947303],[-85.612152,45.128042],[-85.628583,44.766564],[-85.524521,44.750133],[-85.393075,44.930872],[-85.387598,45.237581],[-85.305444,45.314258],[-85.031597,45.363551],[-85.119228,45.577151],[-84.938489,45.75789],[-84.713934,45.768844],[-84.461995,45.653829],[-84.215533,45.637398],[-84.09504,45.494997],[-83.908824,45.484043],[-83.596638,45.352597],[-83.4871,45.358074],[-83.317314,45.144473],[-83.454238,45.029457],[-83.322791,44.88158],[-83.273499,44.711795],[-83.333745,44.339363],[-83.536392,44.246255],[-83.585684,44.054562],[-83.82667,43.988839],[-83.958116,43.758807],[-83.908824,43.671176],[-83.667839,43.589022],[-83.481623,43.714992],[-83.262545,43.972408],[-82.917498,44.070993],[-82.747713,43.994316],[-82.643651,43.851915],[-82.539589,43.435668],[-82.523158,43.227544],[-82.413619,42.975605],[-82.517681,42.614127],[-82.681989,42.559357],[-82.687466,42.690804],[-82.797005,42.652465],[-82.922975,42.351234],[-83.125621,42.236218],[-83.185868,42.006186],[-83.437807,41.814493],[-83.454238,41.732339]]],[[[-85.508091,45.730506],[-85.49166,45.610013],[-85.623106,45.588105],[-85.568337,45.75789],[-85.508091,45.730506]]],[[[-87.589328,45.095181],[-87.742682,45.199243],[-87.649574,45.341643],[-87.885083,45.363551],[-87.791975,45.500474],[-87.781021,45.675736],[-87.989145,45.796229],[-88.10416,45.922199],[-88.531362,46.020784],[-88.662808,45.987922],[-89.09001,46.135799],[-90.119674,46.338446],[-90.229213,46.508231],[-90.415429,46.568478],[-90.026566,46.672539],[-89.851304,46.793032],[-89.413149,46.842325],[-89.128348,46.990202],[-88.996902,46.995679],[-88.887363,47.099741],[-88.575177,47.247618],[-88.416346,47.373588],[-88.180837,47.455742],[-87.956283,47.384542],[-88.350623,47.077833],[-88.443731,46.973771],[-88.438254,46.787555],[-88.246561,46.929956],[-87.901513,46.908048],[-87.633143,46.809463],[-87.392158,46.535616],[-87.260711,46.486323],[-87.008772,46.530139],[-86.948526,46.469893],[-86.696587,46.437031],[-86.159846,46.667063],[-85.880522,46.68897],[-85.508091,46.678016],[-85.256151,46.754694],[-85.064458,46.760171],[-85.02612,46.480847],[-84.82895,46.442508],[-84.63178,46.486323],[-84.549626,46.4206],[-84.418179,46.502754],[-84.127902,46.530139],[-84.122425,46.179615],[-83.990978,46.031737],[-83.793808,45.993399],[-83.7719,46.091984],[-83.580208,46.091984],[-83.476146,45.987922],[-83.563777,45.911245],[-84.111471,45.976968],[-84.374364,45.933153],[-84.659165,46.053645],[-84.741319,45.944106],[-84.70298,45.850998],[-84.82895,45.872906],[-85.015166,46.00983],[-85.338305,46.091984],[-85.502614,46.097461],[-85.661445,45.966014],[-85.924338,45.933153],[-86.209139,45.960537],[-86.324155,45.905768],[-86.351539,45.796229],[-86.663725,45.703121],[-86.647294,45.834568],[-86.784218,45.861952],[-86.838987,45.725029],[-87.069019,45.719552],[-87.17308,45.659305],[-87.326435,45.423797],[-87.611236,45.122565],[-87.589328,45.095181]]],[[[-88.805209,47.976051],[-89.057148,47.850082],[-89.188594,47.833651],[-89.177641,47.937713],[-88.547792,48.173221],[-88.668285,48.008913],[-88.805209,47.976051]]]]}},{type:"Feature",id:"MN",properties:{name:"Minnesota",value:11},geometry:{type:"Polygon",coordinates:[[[-92.014696,46.705401],[-92.091373,46.749217],[-92.29402,46.667063],[-92.29402,46.075553],[-92.354266,46.015307],[-92.639067,45.933153],[-92.869098,45.719552],[-92.885529,45.577151],[-92.770513,45.566198],[-92.644544,45.440228],[-92.75956,45.286874],[-92.737652,45.117088],[-92.808852,44.750133],[-92.545959,44.569394],[-92.337835,44.552964],[-92.233773,44.443425],[-91.927065,44.333886],[-91.877772,44.202439],[-91.592971,44.032654],[-91.43414,43.994316],[-91.242447,43.775238],[-91.269832,43.616407],[-91.215062,43.501391],[-91.368417,43.501391],[-96.451017,43.501391],[-96.451017,45.297827],[-96.681049,45.412843],[-96.856311,45.604536],[-96.582464,45.818137],[-96.560556,45.933153],[-96.598895,46.332969],[-96.719387,46.437031],[-96.801542,46.656109],[-96.785111,46.924479],[-96.823449,46.968294],[-96.856311,47.609096],[-97.053481,47.948667],[-97.130158,48.140359],[-97.16302,48.545653],[-97.097296,48.682577],[-97.228743,49.000239],[-95.152983,49.000239],[-95.152983,49.383625],[-94.955813,49.372671],[-94.824366,49.295994],[-94.69292,48.775685],[-94.588858,48.715438],[-94.260241,48.699007],[-94.221903,48.649715],[-93.838517,48.627807],[-93.794701,48.518268],[-93.466085,48.545653],[-93.466085,48.589469],[-93.208669,48.644238],[-92.984114,48.62233],[-92.726698,48.540176],[-92.655498,48.436114],[-92.50762,48.447068],[-92.370697,48.222514],[-92.304974,48.315622],[-92.053034,48.359437],[-92.009219,48.266329],[-91.713464,48.200606],[-91.713464,48.112975],[-91.565587,48.041775],[-91.264355,48.080113],[-91.083616,48.178698],[-90.837154,48.238944],[-90.749522,48.091067],[-90.579737,48.123929],[-90.377091,48.091067],[-90.141582,48.112975],[-89.873212,47.987005],[-89.615796,48.008913],[-89.637704,47.954144],[-89.971797,47.828174],[-90.437337,47.729589],[-90.738569,47.625527],[-91.171247,47.368111],[-91.357463,47.20928],[-91.642264,47.028541],[-92.091373,46.787555],[-92.014696,46.705401]]]}},{type:"Feature",id:"MS",properties:{name:"Mississippi",value:66},geometry:{type:"Polygon",coordinates:[[[-88.471115,34.995703],[-88.202745,34.995703],[-88.098683,34.891641],[-88.241084,33.796253],[-88.471115,31.895754],[-88.394438,30.367688],[-88.503977,30.323872],[-88.744962,30.34578],[-88.843547,30.411504],[-89.084533,30.367688],[-89.418626,30.252672],[-89.522688,30.181472],[-89.643181,30.285534],[-89.681519,30.449842],[-89.845827,30.66892],[-89.747242,30.997536],[-91.636787,30.997536],[-91.565587,31.068736],[-91.636787,31.265906],[-91.516294,31.27686],[-91.499863,31.643815],[-91.401278,31.621907],[-91.341032,31.846462],[-91.105524,31.988862],[-90.985031,32.218894],[-91.006939,32.514649],[-91.154816,32.640618],[-91.143862,32.843265],[-91.072662,32.887081],[-91.16577,33.002096],[-91.089093,33.13902],[-91.143862,33.347144],[-91.056231,33.429298],[-91.231493,33.560744],[-91.072662,33.867453],[-90.891923,34.026284],[-90.952169,34.135823],[-90.744046,34.300131],[-90.749522,34.365854],[-90.568783,34.420624],[-90.585214,34.617794],[-90.481152,34.661609],[-90.409952,34.831394],[-90.251121,34.908072],[-90.311367,34.995703],[-88.471115,34.995703]]]}},{type:"Feature",id:"MO",properties:{name:"Missouri",value:36},geometry:{type:"Polygon",coordinates:[[[-91.833957,40.609566],[-91.729895,40.615043],[-91.527248,40.412397],[-91.417709,40.379535],[-91.50534,40.237135],[-91.494386,40.034488],[-91.368417,39.727779],[-91.061708,39.470363],[-90.727615,39.256762],[-90.661891,38.928146],[-90.585214,38.867899],[-90.470199,38.961007],[-90.251121,38.917192],[-90.10872,38.845992],[-90.207305,38.725499],[-90.179921,38.632391],[-90.349706,38.374975],[-90.355183,38.216144],[-90.059428,38.013497],[-89.949889,37.88205],[-89.84035,37.903958],[-89.517211,37.690357],[-89.517211,37.537003],[-89.435057,37.34531],[-89.517211,37.279587],[-89.292656,36.994786],[-89.133825,36.983832],[-89.215979,36.578538],[-89.363857,36.622354],[-89.418626,36.496384],[-89.484349,36.496384],[-89.539119,36.496384],[-89.533642,36.249922],[-89.730812,35.997983],[-90.377091,35.997983],[-90.218259,36.184199],[-90.064905,36.304691],[-90.152536,36.496384],[-94.473842,36.501861],[-94.616242,36.501861],[-94.616242,37.000263],[-94.610765,39.158177],[-94.824366,39.20747],[-94.983197,39.442978],[-95.109167,39.541563],[-94.884612,39.831841],[-95.207752,39.908518],[-95.306337,40.001626],[-95.552799,40.264519],[-95.7664,40.587659],[-94.632673,40.571228],[-93.257961,40.582182],[-91.833957,40.609566]]]}},{type:"Feature",id:"MT",properties:{name:"Montana",value:99},geometry:{type:"Polygon",coordinates:[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}},{type:"Feature",id:"NE",properties:{name:"Nebraska",value:55},geometry:{type:"Polygon",coordinates:[[[-103.324578,43.002989],[-101.626726,42.997512],[-98.499393,42.997512],[-98.466531,42.94822],[-97.951699,42.767481],[-97.831206,42.866066],[-97.688806,42.844158],[-97.217789,42.844158],[-96.692003,42.657942],[-96.626279,42.515542],[-96.44554,42.488157],[-96.264801,42.039048],[-96.127878,41.973325],[-96.062155,41.798063],[-96.122401,41.67757],[-96.095016,41.540646],[-95.919754,41.453015],[-95.925231,41.201076],[-95.826646,40.976521],[-95.881416,40.719105],[-95.7664,40.587659],[-95.552799,40.264519],[-95.306337,40.001626],[-101.90605,40.001626],[-102.053927,40.001626],[-102.053927,41.003906],[-104.053011,41.003906],[-104.053011,43.002989],[-103.324578,43.002989]]]}},{type:"Feature",id:"NV",properties:{name:"Nevada",value:65},geometry:{type:"Polygon",coordinates:[[[-117.027882,42.000709],[-114.04295,41.995232],[-114.048427,37.000263],[-114.048427,36.195153],[-114.152489,36.025367],[-114.251074,36.01989],[-114.371566,36.140383],[-114.738521,36.102045],[-114.678275,35.516012],[-114.596121,35.324319],[-114.574213,35.138103],[-114.634459,35.00118],[-115.85034,35.970598],[-116.540435,36.501861],[-117.498899,37.21934],[-118.71478,38.101128],[-120.001861,38.999346],[-119.996384,40.264519],[-120.001861,41.995232],[-118.698349,41.989755],[-117.027882,42.000709]]]}},{type:"Feature",id:"NH",properties:{name:"New Hampshire",value:32},geometry:{type:"Polygon",coordinates:[[[-71.08183,45.303304],[-71.032537,44.657025],[-70.966814,43.34256],[-70.807983,43.227544],[-70.824413,43.128959],[-70.703921,43.057759],[-70.818936,42.871543],[-70.917521,42.887974],[-71.185891,42.789389],[-71.29543,42.696281],[-72.456542,42.729142],[-72.544173,42.80582],[-72.533219,42.953697],[-72.445588,43.008466],[-72.456542,43.150867],[-72.379864,43.572591],[-72.204602,43.769761],[-72.116971,43.994316],[-72.02934,44.07647],[-72.034817,44.322932],[-71.700724,44.41604],[-71.536416,44.585825],[-71.629524,44.750133],[-71.4926,44.914442],[-71.503554,45.013027],[-71.361154,45.270443],[-71.131122,45.243058],[-71.08183,45.303304]]]}},{type:"Feature",id:"NJ",properties:{name:"New Jersey",value:50},geometry:{type:"Polygon",coordinates:[[[-74.236547,41.14083],[-73.902454,40.998429],[-74.022947,40.708151],[-74.187255,40.642428],[-74.274886,40.489074],[-74.001039,40.412397],[-73.979131,40.297381],[-74.099624,39.760641],[-74.411809,39.360824],[-74.614456,39.245808],[-74.795195,38.993869],[-74.888303,39.158177],[-75.178581,39.240331],[-75.534582,39.459409],[-75.55649,39.607286],[-75.561967,39.629194],[-75.507197,39.683964],[-75.414089,39.804456],[-75.145719,39.88661],[-75.129289,39.963288],[-74.82258,40.127596],[-74.773287,40.215227],[-75.058088,40.417874],[-75.069042,40.543843],[-75.195012,40.576705],[-75.205966,40.691721],[-75.052611,40.866983],[-75.134765,40.971045],[-74.882826,41.179168],[-74.828057,41.288707],[-74.69661,41.359907],[-74.236547,41.14083]]]}},{type:"Feature",id:"NM",properties:{name:"New Mexico",value:79},geometry:{type:"Polygon",coordinates:[[[-107.421329,37.000263],[-106.868158,36.994786],[-104.337812,36.994786],[-103.001438,37.000263],[-103.001438,36.501861],[-103.039777,36.501861],[-103.045254,34.01533],[-103.067161,33.002096],[-103.067161,31.999816],[-106.616219,31.999816],[-106.643603,31.901231],[-106.528588,31.786216],[-108.210008,31.786216],[-108.210008,31.331629],[-109.04798,31.331629],[-109.042503,37.000263],[-107.421329,37.000263]]]}},{type:"Feature",id:"NY",properties:{name:"New York",value:55},geometry:{type:"Polygon",coordinates:[[[-73.343806,45.013027],[-73.332852,44.804903],[-73.387622,44.618687],[-73.294514,44.437948],[-73.321898,44.246255],[-73.436914,44.043608],[-73.349283,43.769761],[-73.404052,43.687607],[-73.245221,43.523299],[-73.278083,42.833204],[-73.267129,42.745573],[-73.508114,42.08834],[-73.486206,42.050002],[-73.55193,41.294184],[-73.48073,41.21203],[-73.727192,41.102491],[-73.655992,40.987475],[-73.22879,40.905321],[-73.141159,40.965568],[-72.774204,40.965568],[-72.587988,40.998429],[-72.28128,41.157261],[-72.259372,41.042245],[-72.100541,40.992952],[-72.467496,40.845075],[-73.239744,40.625997],[-73.562884,40.582182],[-73.776484,40.593136],[-73.935316,40.543843],[-74.022947,40.708151],[-73.902454,40.998429],[-74.236547,41.14083],[-74.69661,41.359907],[-74.740426,41.431108],[-74.89378,41.436584],[-75.074519,41.60637],[-75.052611,41.754247],[-75.173104,41.869263],[-75.249781,41.863786],[-75.35932,42.000709],[-79.76278,42.000709],[-79.76278,42.252649],[-79.76278,42.269079],[-79.149363,42.55388],[-79.050778,42.690804],[-78.853608,42.783912],[-78.930285,42.953697],[-79.012439,42.986559],[-79.072686,43.260406],[-78.486653,43.375421],[-77.966344,43.369944],[-77.75822,43.34256],[-77.533665,43.233021],[-77.391265,43.276836],[-76.958587,43.271359],[-76.695693,43.34256],[-76.41637,43.523299],[-76.235631,43.528776],[-76.230154,43.802623],[-76.137046,43.961454],[-76.3616,44.070993],[-76.312308,44.196962],[-75.912491,44.366748],[-75.764614,44.514625],[-75.282643,44.848718],[-74.828057,45.018503],[-74.148916,44.991119],[-73.343806,45.013027]]]}},{type:"Feature",id:"NC",properties:{name:"North Carolina",value:78},geometry:{type:"Polygon",coordinates:[[[-80.978661,36.562108],[-80.294043,36.545677],[-79.510841,36.5402],[-75.868676,36.551154],[-75.75366,36.151337],[-76.032984,36.189676],[-76.071322,36.140383],[-76.410893,36.080137],[-76.460185,36.025367],[-76.68474,36.008937],[-76.673786,35.937736],[-76.399939,35.987029],[-76.3616,35.943213],[-76.060368,35.992506],[-75.961783,35.899398],[-75.781044,35.937736],[-75.715321,35.696751],[-75.775568,35.581735],[-75.89606,35.570781],[-76.147999,35.324319],[-76.482093,35.313365],[-76.536862,35.14358],[-76.394462,34.973795],[-76.279446,34.940933],[-76.493047,34.661609],[-76.673786,34.694471],[-76.991448,34.667086],[-77.210526,34.60684],[-77.555573,34.415147],[-77.82942,34.163208],[-77.971821,33.845545],[-78.179944,33.916745],[-78.541422,33.851022],[-79.675149,34.80401],[-80.797922,34.820441],[-80.781491,34.935456],[-80.934845,35.105241],[-81.038907,35.044995],[-81.044384,35.149057],[-82.276696,35.198349],[-82.550543,35.160011],[-82.764143,35.066903],[-83.109191,35.00118],[-83.618546,34.984749],[-84.319594,34.990226],[-84.29221,35.225734],[-84.09504,35.247642],[-84.018363,35.41195],[-83.7719,35.559827],[-83.498053,35.565304],[-83.251591,35.718659],[-82.994175,35.773428],[-82.775097,35.997983],[-82.638174,36.063706],[-82.610789,35.965121],[-82.216449,36.156814],[-82.03571,36.118475],[-81.909741,36.304691],[-81.723525,36.353984],[-81.679709,36.589492],[-80.978661,36.562108]]]}},{type:"Feature",id:"ND",properties:{name:"North Dakota",value:98},geometry:{type:"Polygon",coordinates:[[[-97.228743,49.000239],[-97.097296,48.682577],[-97.16302,48.545653],[-97.130158,48.140359],[-97.053481,47.948667],[-96.856311,47.609096],[-96.823449,46.968294],[-96.785111,46.924479],[-96.801542,46.656109],[-96.719387,46.437031],[-96.598895,46.332969],[-96.560556,45.933153],[-104.047534,45.944106],[-104.042057,47.861036],[-104.047534,49.000239],[-97.228743,49.000239]]]}},{type:"Feature",id:"OH",properties:{name:"Ohio",value:22},geometry:{type:"Polygon",coordinates:[[[-80.518598,41.978802],[-80.518598,40.636951],[-80.666475,40.582182],[-80.595275,40.472643],[-80.600752,40.319289],[-80.737675,40.078303],[-80.830783,39.711348],[-81.219646,39.388209],[-81.345616,39.344393],[-81.455155,39.410117],[-81.57017,39.267716],[-81.685186,39.273193],[-81.811156,39.0815],[-81.783771,38.966484],[-81.887833,38.873376],[-82.03571,39.026731],[-82.221926,38.785745],[-82.172634,38.632391],[-82.293127,38.577622],[-82.331465,38.446175],[-82.594358,38.424267],[-82.731282,38.561191],[-82.846298,38.588575],[-82.890113,38.758361],[-83.032514,38.725499],[-83.142052,38.626914],[-83.519961,38.703591],[-83.678792,38.632391],[-83.903347,38.769315],[-84.215533,38.807653],[-84.231963,38.895284],[-84.43461,39.103408],[-84.817996,39.103408],[-84.801565,40.500028],[-84.807042,41.694001],[-83.454238,41.732339],[-83.065375,41.595416],[-82.933929,41.513262],[-82.835344,41.589939],[-82.616266,41.431108],[-82.479343,41.381815],[-82.013803,41.513262],[-81.739956,41.485877],[-81.444201,41.672093],[-81.011523,41.852832],[-80.518598,41.978802],[-80.518598,41.978802]]]}},{type:"Feature",id:"OK",properties:{name:"Oklahoma",value:1},geometry:{type:"Polygon",coordinates:[[[-100.087706,37.000263],[-94.616242,37.000263],[-94.616242,36.501861],[-94.430026,35.395519],[-94.484796,33.637421],[-94.868182,33.74696],[-94.966767,33.861976],[-95.224183,33.960561],[-95.289906,33.87293],[-95.547322,33.878407],[-95.602092,33.933176],[-95.8376,33.834591],[-95.936185,33.889361],[-96.149786,33.840068],[-96.346956,33.686714],[-96.423633,33.774345],[-96.631756,33.845545],[-96.850834,33.845545],[-96.922034,33.960561],[-97.173974,33.736006],[-97.256128,33.861976],[-97.371143,33.823637],[-97.458774,33.905791],[-97.694283,33.982469],[-97.869545,33.851022],[-97.946222,33.987946],[-98.088623,34.004376],[-98.170777,34.113915],[-98.36247,34.157731],[-98.488439,34.064623],[-98.570593,34.146777],[-98.767763,34.135823],[-98.986841,34.223454],[-99.189488,34.2125],[-99.260688,34.404193],[-99.57835,34.415147],[-99.698843,34.382285],[-99.923398,34.573978],[-100.000075,34.563024],[-100.000075,36.501861],[-101.812942,36.501861],[-103.001438,36.501861],[-103.001438,37.000263],[-102.042974,36.994786],[-100.087706,37.000263]]]}},{type:"Feature",id:"OR",properties:{name:"Oregon",value:87},geometry:{type:"Polygon",coordinates:[[[-123.211348,46.174138],[-123.11824,46.185092],[-122.904639,46.08103],[-122.811531,45.960537],[-122.762239,45.659305],[-122.247407,45.549767],[-121.809251,45.708598],[-121.535404,45.725029],[-121.217742,45.670259],[-121.18488,45.604536],[-120.637186,45.746937],[-120.505739,45.697644],[-120.209985,45.725029],[-119.963522,45.823614],[-119.525367,45.911245],[-119.125551,45.933153],[-118.988627,45.998876],[-116.918344,45.993399],[-116.78142,45.823614],[-116.545912,45.752413],[-116.463758,45.61549],[-116.671881,45.319735],[-116.732128,45.144473],[-116.847143,45.02398],[-116.830713,44.930872],[-116.934774,44.782995],[-117.038836,44.750133],[-117.241483,44.394132],[-117.170283,44.257209],[-116.97859,44.240778],[-116.896436,44.158624],[-117.027882,43.830007],[-117.027882,42.000709],[-118.698349,41.989755],[-120.001861,41.995232],[-121.037003,41.995232],[-122.378853,42.011663],[-123.233256,42.006186],[-124.213628,42.000709],[-124.356029,42.115725],[-124.432706,42.438865],[-124.416275,42.663419],[-124.553198,42.838681],[-124.454613,43.002989],[-124.383413,43.271359],[-124.235536,43.55616],[-124.169813,43.8081],[-124.060274,44.657025],[-124.076705,44.772041],[-123.97812,45.144473],[-123.939781,45.659305],[-123.994551,45.944106],[-123.945258,46.113892],[-123.545441,46.261769],[-123.370179,46.146753],[-123.211348,46.174138]]]}},{type:"Feature",id:"PA",properties:{name:"Pennsylvania",value:37},geometry:{type:"Polygon",coordinates:[[[-79.76278,42.252649],[-79.76278,42.000709],[-75.35932,42.000709],[-75.249781,41.863786],[-75.173104,41.869263],[-75.052611,41.754247],[-75.074519,41.60637],[-74.89378,41.436584],[-74.740426,41.431108],[-74.69661,41.359907],[-74.828057,41.288707],[-74.882826,41.179168],[-75.134765,40.971045],[-75.052611,40.866983],[-75.205966,40.691721],[-75.195012,40.576705],[-75.069042,40.543843],[-75.058088,40.417874],[-74.773287,40.215227],[-74.82258,40.127596],[-75.129289,39.963288],[-75.145719,39.88661],[-75.414089,39.804456],[-75.616736,39.831841],[-75.786521,39.722302],[-79.477979,39.722302],[-80.518598,39.722302],[-80.518598,40.636951],[-80.518598,41.978802],[-80.518598,41.978802],[-80.332382,42.033571],[-79.76278,42.269079],[-79.76278,42.252649]]]}},{type:"Feature",id:"RI",properties:{name:"Rhode Island",value:78},geometry:{type:"MultiPolygon",coordinates:[[[[-71.196845,41.67757],[-71.120168,41.496831],[-71.317338,41.474923],[-71.196845,41.67757]]],[[[-71.530939,42.01714],[-71.383061,42.01714],[-71.328292,41.781632],[-71.22423,41.710431],[-71.344723,41.726862],[-71.448785,41.578985],[-71.481646,41.370861],[-71.859555,41.321569],[-71.799309,41.414677],[-71.799309,42.006186],[-71.530939,42.01714]]]]}},{type:"Feature",id:"SC",properties:{name:"South Carolina",value:54},geometry:{type:"Polygon",coordinates:[[[-82.764143,35.066903],[-82.550543,35.160011],[-82.276696,35.198349],[-81.044384,35.149057],[-81.038907,35.044995],[-80.934845,35.105241],[-80.781491,34.935456],[-80.797922,34.820441],[-79.675149,34.80401],[-78.541422,33.851022],[-78.716684,33.80173],[-78.935762,33.637421],[-79.149363,33.380005],[-79.187701,33.171881],[-79.357487,33.007573],[-79.582041,33.007573],[-79.631334,32.887081],[-79.866842,32.755634],[-79.998289,32.613234],[-80.206412,32.552987],[-80.430967,32.399633],[-80.452875,32.328433],[-80.660998,32.246279],[-80.885553,32.032678],[-81.115584,32.120309],[-81.121061,32.290094],[-81.279893,32.558464],[-81.416816,32.629664],[-81.42777,32.843265],[-81.493493,33.007573],[-81.761863,33.160928],[-81.937125,33.347144],[-81.926172,33.462159],[-82.194542,33.631944],[-82.325988,33.81816],[-82.55602,33.94413],[-82.714851,34.152254],[-82.747713,34.26727],[-82.901067,34.486347],[-83.005129,34.469916],[-83.339222,34.683517],[-83.322791,34.787579],[-83.109191,35.00118],[-82.764143,35.066903]]]}},{type:"Feature",id:"SD",properties:{name:"South Dakota",value:0},geometry:{type:"Polygon",coordinates:[[[-104.047534,45.944106],[-96.560556,45.933153],[-96.582464,45.818137],[-96.856311,45.604536],[-96.681049,45.412843],[-96.451017,45.297827],[-96.451017,43.501391],[-96.582464,43.479483],[-96.527695,43.397329],[-96.560556,43.222067],[-96.434587,43.123482],[-96.511264,43.052282],[-96.544125,42.855112],[-96.631756,42.707235],[-96.44554,42.488157],[-96.626279,42.515542],[-96.692003,42.657942],[-97.217789,42.844158],[-97.688806,42.844158],[-97.831206,42.866066],[-97.951699,42.767481],[-98.466531,42.94822],[-98.499393,42.997512],[-101.626726,42.997512],[-103.324578,43.002989],[-104.053011,43.002989],[-104.058488,44.996596],[-104.042057,44.996596],[-104.047534,45.944106]]]}},{type:"Feature",id:"TN",properties:{name:"Tennessee",value:66},geometry:{type:"Polygon",coordinates:[[[-88.054868,36.496384],[-88.071299,36.677123],[-87.852221,36.633308],[-86.592525,36.655216],[-85.486183,36.616877],[-85.289013,36.627831],[-84.544149,36.594969],[-83.689746,36.584015],[-83.673316,36.600446],[-81.679709,36.589492],[-81.723525,36.353984],[-81.909741,36.304691],[-82.03571,36.118475],[-82.216449,36.156814],[-82.610789,35.965121],[-82.638174,36.063706],[-82.775097,35.997983],[-82.994175,35.773428],[-83.251591,35.718659],[-83.498053,35.565304],[-83.7719,35.559827],[-84.018363,35.41195],[-84.09504,35.247642],[-84.29221,35.225734],[-84.319594,34.990226],[-85.606675,34.984749],[-87.359296,35.00118],[-88.202745,34.995703],[-88.471115,34.995703],[-90.311367,34.995703],[-90.212782,35.023087],[-90.114197,35.198349],[-90.130628,35.439335],[-89.944412,35.603643],[-89.911551,35.756997],[-89.763673,35.811767],[-89.730812,35.997983],[-89.533642,36.249922],[-89.539119,36.496384],[-89.484349,36.496384],[-89.418626,36.496384],[-89.298133,36.507338],[-88.054868,36.496384]]]}},{type:"Feature",id:"TX",properties:{name:"Texas",value:29},geometry:{type:"Polygon",coordinates:[[[-101.812942,36.501861],[-100.000075,36.501861],[-100.000075,34.563024],[-99.923398,34.573978],[-99.698843,34.382285],[-99.57835,34.415147],[-99.260688,34.404193],[-99.189488,34.2125],[-98.986841,34.223454],[-98.767763,34.135823],[-98.570593,34.146777],[-98.488439,34.064623],[-98.36247,34.157731],[-98.170777,34.113915],[-98.088623,34.004376],[-97.946222,33.987946],[-97.869545,33.851022],[-97.694283,33.982469],[-97.458774,33.905791],[-97.371143,33.823637],[-97.256128,33.861976],[-97.173974,33.736006],[-96.922034,33.960561],[-96.850834,33.845545],[-96.631756,33.845545],[-96.423633,33.774345],[-96.346956,33.686714],[-96.149786,33.840068],[-95.936185,33.889361],[-95.8376,33.834591],[-95.602092,33.933176],[-95.547322,33.878407],[-95.289906,33.87293],[-95.224183,33.960561],[-94.966767,33.861976],[-94.868182,33.74696],[-94.484796,33.637421],[-94.380734,33.544313],[-94.183564,33.593606],[-94.041164,33.54979],[-94.041164,33.018527],[-94.041164,31.994339],[-93.822086,31.775262],[-93.816609,31.556184],[-93.542762,31.15089],[-93.526331,30.93729],[-93.630393,30.679874],[-93.728978,30.575812],[-93.696116,30.438888],[-93.767317,30.334826],[-93.690639,30.143133],[-93.926148,29.787132],[-93.838517,29.688547],[-94.002825,29.68307],[-94.523134,29.546147],[-94.70935,29.622824],[-94.742212,29.787132],[-94.873659,29.672117],[-94.966767,29.699501],[-95.016059,29.557101],[-94.911997,29.496854],[-94.895566,29.310638],[-95.081782,29.113469],[-95.383014,28.867006],[-95.985477,28.604113],[-96.045724,28.647929],[-96.226463,28.582205],[-96.23194,28.642452],[-96.478402,28.598636],[-96.593418,28.724606],[-96.664618,28.697221],[-96.401725,28.439805],[-96.593418,28.357651],[-96.774157,28.406943],[-96.801542,28.226204],[-97.026096,28.039988],[-97.256128,27.694941],[-97.404005,27.333463],[-97.513544,27.360848],[-97.540929,27.229401],[-97.425913,27.262263],[-97.480682,26.99937],[-97.557359,26.988416],[-97.562836,26.840538],[-97.469728,26.758384],[-97.442344,26.457153],[-97.332805,26.353091],[-97.30542,26.161398],[-97.217789,25.991613],[-97.524498,25.887551],[-97.650467,26.018997],[-97.885976,26.06829],[-98.198161,26.057336],[-98.466531,26.221644],[-98.669178,26.238075],[-98.822533,26.369522],[-99.030656,26.413337],[-99.173057,26.539307],[-99.266165,26.840538],[-99.446904,27.021277],[-99.424996,27.174632],[-99.50715,27.33894],[-99.479765,27.48134],[-99.605735,27.640172],[-99.709797,27.656603],[-99.879582,27.799003],[-99.934351,27.979742],[-100.082229,28.14405],[-100.29583,28.280974],[-100.399891,28.582205],[-100.498476,28.66436],[-100.629923,28.905345],[-100.673738,29.102515],[-100.799708,29.244915],[-101.013309,29.370885],[-101.062601,29.458516],[-101.259771,29.535193],[-101.413125,29.754271],[-101.851281,29.803563],[-102.114174,29.792609],[-102.338728,29.869286],[-102.388021,29.765225],[-102.629006,29.732363],[-102.809745,29.524239],[-102.919284,29.190146],[-102.97953,29.184669],[-103.116454,28.987499],[-103.280762,28.982022],[-103.527224,29.135376],[-104.146119,29.381839],[-104.266611,29.513285],[-104.507597,29.639255],[-104.677382,29.924056],[-104.688336,30.181472],[-104.858121,30.389596],[-104.896459,30.570335],[-105.005998,30.685351],[-105.394861,30.855136],[-105.602985,31.085167],[-105.77277,31.167321],[-105.953509,31.364491],[-106.205448,31.468553],[-106.38071,31.731446],[-106.528588,31.786216],[-106.643603,31.901231],[-106.616219,31.999816],[-103.067161,31.999816],[-103.067161,33.002096],[-103.045254,34.01533],[-103.039777,36.501861],[-103.001438,36.501861],[-101.812942,36.501861]]]}},{type:"Feature",id:"UT",properties:{name:"Utah",value:87},geometry:{type:"Polygon",coordinates:[[[-112.164359,41.995232],[-111.047063,42.000709],[-111.047063,40.998429],[-109.04798,40.998429],[-109.053457,39.125316],[-109.058934,38.27639],[-109.042503,38.166851],[-109.042503,37.000263],[-110.499369,37.00574],[-114.048427,37.000263],[-114.04295,41.995232],[-112.164359,41.995232]]]}},{type:"Feature",id:"VT",properties:{name:"Vermont",value:55},geometry:{type:"Polygon",coordinates:[[[-71.503554,45.013027],[-71.4926,44.914442],[-71.629524,44.750133],[-71.536416,44.585825],[-71.700724,44.41604],[-72.034817,44.322932],[-72.02934,44.07647],[-72.116971,43.994316],[-72.204602,43.769761],[-72.379864,43.572591],[-72.456542,43.150867],[-72.445588,43.008466],[-72.533219,42.953697],[-72.544173,42.80582],[-72.456542,42.729142],[-73.267129,42.745573],[-73.278083,42.833204],[-73.245221,43.523299],[-73.404052,43.687607],[-73.349283,43.769761],[-73.436914,44.043608],[-73.321898,44.246255],[-73.294514,44.437948],[-73.387622,44.618687],[-73.332852,44.804903],[-73.343806,45.013027],[-72.308664,45.002073],[-71.503554,45.013027]]]}},{type:"Feature",id:"VA",properties:{name:"Virginia",value:55},geometry:{type:"MultiPolygon",coordinates:[[[[-75.397659,38.013497],[-75.244304,38.029928],[-75.375751,37.860142],[-75.512674,37.799896],[-75.594828,37.569865],[-75.802952,37.197433],[-75.972737,37.120755],[-76.027507,37.257679],[-75.939876,37.564388],[-75.671506,37.95325],[-75.397659,38.013497]]],[[[-78.349729,39.464886],[-77.82942,39.130793],[-77.719881,39.322485],[-77.566527,39.306055],[-77.456988,39.223901],[-77.456988,39.076023],[-77.248864,39.026731],[-77.117418,38.933623],[-77.040741,38.791222],[-77.128372,38.632391],[-77.248864,38.588575],[-77.325542,38.446175],[-77.281726,38.342113],[-77.013356,38.374975],[-76.964064,38.216144],[-76.613539,38.15042],[-76.514954,38.024451],[-76.235631,37.887527],[-76.3616,37.608203],[-76.246584,37.389126],[-76.383508,37.285064],[-76.399939,37.159094],[-76.273969,37.082417],[-76.410893,36.961924],[-76.619016,37.120755],[-76.668309,37.065986],[-76.48757,36.95097],[-75.994645,36.923586],[-75.868676,36.551154],[-79.510841,36.5402],[-80.294043,36.545677],[-80.978661,36.562108],[-81.679709,36.589492],[-83.673316,36.600446],[-83.136575,36.742847],[-83.070852,36.852385],[-82.879159,36.890724],[-82.868205,36.978355],[-82.720328,37.044078],[-82.720328,37.120755],[-82.353373,37.268633],[-81.969987,37.537003],[-81.986418,37.454849],[-81.849494,37.285064],[-81.679709,37.20291],[-81.55374,37.208387],[-81.362047,37.339833],[-81.225123,37.235771],[-80.967707,37.290541],[-80.513121,37.482234],[-80.474782,37.421987],[-80.29952,37.509618],[-80.294043,37.690357],[-80.184505,37.849189],[-79.998289,37.997066],[-79.921611,38.177805],[-79.724442,38.364021],[-79.647764,38.594052],[-79.477979,38.457129],[-79.313671,38.413313],[-79.209609,38.495467],[-78.996008,38.851469],[-78.870039,38.763838],[-78.404499,39.169131],[-78.349729,39.464886]]]]}},{type:"Feature",id:"WA",properties:{name:"Washington",value:77},geometry:{type:"MultiPolygon",coordinates:[[[[-117.033359,49.000239],[-117.044313,47.762451],[-117.038836,46.426077],[-117.055267,46.343923],[-116.92382,46.168661],[-116.918344,45.993399],[-118.988627,45.998876],[-119.125551,45.933153],[-119.525367,45.911245],[-119.963522,45.823614],[-120.209985,45.725029],[-120.505739,45.697644],[-120.637186,45.746937],[-121.18488,45.604536],[-121.217742,45.670259],[-121.535404,45.725029],[-121.809251,45.708598],[-122.247407,45.549767],[-122.762239,45.659305],[-122.811531,45.960537],[-122.904639,46.08103],[-123.11824,46.185092],[-123.211348,46.174138],[-123.370179,46.146753],[-123.545441,46.261769],[-123.72618,46.300108],[-123.874058,46.239861],[-124.065751,46.327492],[-124.027412,46.464416],[-123.895966,46.535616],[-124.098612,46.74374],[-124.235536,47.285957],[-124.31769,47.357157],[-124.427229,47.740543],[-124.624399,47.88842],[-124.706553,48.184175],[-124.597014,48.381345],[-124.394367,48.288237],[-123.983597,48.162267],[-123.704273,48.167744],[-123.424949,48.118452],[-123.162056,48.167744],[-123.036086,48.080113],[-122.800578,48.08559],[-122.636269,47.866512],[-122.515777,47.882943],[-122.493869,47.587189],[-122.422669,47.318818],[-122.324084,47.346203],[-122.422669,47.576235],[-122.395284,47.800789],[-122.230976,48.030821],[-122.362422,48.123929],[-122.373376,48.288237],[-122.471961,48.468976],[-122.422669,48.600422],[-122.488392,48.753777],[-122.647223,48.775685],[-122.795101,48.8907],[-122.756762,49.000239],[-117.033359,49.000239]]],[[[-122.718423,48.310145],[-122.586977,48.35396],[-122.608885,48.151313],[-122.767716,48.227991],[-122.718423,48.310145]]],[[[-123.025132,48.583992],[-122.915593,48.715438],[-122.767716,48.556607],[-122.811531,48.419683],[-123.041563,48.458022],[-123.025132,48.583992]]]]}},{type:"Feature",id:"WV",properties:{name:"West Virginia",value:57},geometry:{type:"Polygon",coordinates:[[[-80.518598,40.636951],[-80.518598,39.722302],[-79.477979,39.722302],[-79.488933,39.20747],[-79.291763,39.300578],[-79.094593,39.470363],[-78.963147,39.437501],[-78.765977,39.585379],[-78.470222,39.514178],[-78.431884,39.623717],[-78.267575,39.61824],[-78.174467,39.694917],[-78.004682,39.601809],[-77.834897,39.601809],[-77.719881,39.322485],[-77.82942,39.130793],[-78.349729,39.464886],[-78.404499,39.169131],[-78.870039,38.763838],[-78.996008,38.851469],[-79.209609,38.495467],[-79.313671,38.413313],[-79.477979,38.457129],[-79.647764,38.594052],[-79.724442,38.364021],[-79.921611,38.177805],[-79.998289,37.997066],[-80.184505,37.849189],[-80.294043,37.690357],[-80.29952,37.509618],[-80.474782,37.421987],[-80.513121,37.482234],[-80.967707,37.290541],[-81.225123,37.235771],[-81.362047,37.339833],[-81.55374,37.208387],[-81.679709,37.20291],[-81.849494,37.285064],[-81.986418,37.454849],[-81.969987,37.537003],[-82.101434,37.553434],[-82.293127,37.668449],[-82.342419,37.783465],[-82.50125,37.931343],[-82.621743,38.123036],[-82.594358,38.424267],[-82.331465,38.446175],[-82.293127,38.577622],[-82.172634,38.632391],[-82.221926,38.785745],[-82.03571,39.026731],[-81.887833,38.873376],[-81.783771,38.966484],[-81.811156,39.0815],[-81.685186,39.273193],[-81.57017,39.267716],[-81.455155,39.410117],[-81.345616,39.344393],[-81.219646,39.388209],[-80.830783,39.711348],[-80.737675,40.078303],[-80.600752,40.319289],[-80.595275,40.472643],[-80.666475,40.582182],[-80.518598,40.636951]]]}},{type:"Feature",id:"WI",properties:{name:"Wisconsin",value:99},geometry:{type:"Polygon",coordinates:[[[-90.415429,46.568478],[-90.229213,46.508231],[-90.119674,46.338446],[-89.09001,46.135799],[-88.662808,45.987922],[-88.531362,46.020784],[-88.10416,45.922199],[-87.989145,45.796229],[-87.781021,45.675736],[-87.791975,45.500474],[-87.885083,45.363551],[-87.649574,45.341643],[-87.742682,45.199243],[-87.589328,45.095181],[-87.627666,44.974688],[-87.819359,44.95278],[-87.983668,44.722749],[-88.043914,44.563917],[-87.928898,44.536533],[-87.775544,44.640595],[-87.611236,44.837764],[-87.403112,44.914442],[-87.238804,45.166381],[-87.03068,45.22115],[-87.047111,45.089704],[-87.189511,44.969211],[-87.468835,44.552964],[-87.545512,44.322932],[-87.540035,44.158624],[-87.644097,44.103854],[-87.737205,43.8793],[-87.704344,43.687607],[-87.791975,43.561637],[-87.912467,43.249452],[-87.885083,43.002989],[-87.76459,42.783912],[-87.802929,42.493634],[-88.788778,42.493634],[-90.639984,42.510065],[-90.711184,42.636034],[-91.067185,42.75105],[-91.143862,42.909881],[-91.176724,43.134436],[-91.056231,43.254929],[-91.204109,43.353514],[-91.215062,43.501391],[-91.269832,43.616407],[-91.242447,43.775238],[-91.43414,43.994316],[-91.592971,44.032654],[-91.877772,44.202439],[-91.927065,44.333886],[-92.233773,44.443425],[-92.337835,44.552964],[-92.545959,44.569394],[-92.808852,44.750133],[-92.737652,45.117088],[-92.75956,45.286874],[-92.644544,45.440228],[-92.770513,45.566198],[-92.885529,45.577151],[-92.869098,45.719552],[-92.639067,45.933153],[-92.354266,46.015307],[-92.29402,46.075553],[-92.29402,46.667063],[-92.091373,46.749217],[-92.014696,46.705401],[-91.790141,46.694447],[-91.09457,46.864232],[-90.837154,46.95734],[-90.749522,46.88614],[-90.886446,46.754694],[-90.55783,46.584908],[-90.415429,46.568478]]]}},{type:"Feature",id:"WY",properties:{name:"Wyoming",value:5},geometry:{type:"Polygon",coordinates:[[[-109.080842,45.002073],[-105.91517,45.002073],[-104.058488,44.996596],[-104.053011,43.002989],[-104.053011,41.003906],[-105.728954,40.998429],[-107.919731,41.003906],[-109.04798,40.998429],[-111.047063,40.998429],[-111.047063,42.000709],[-111.047063,44.476286],[-111.05254,45.002073],[-109.080842,45.002073]]]}}]},$r=({data:t,geoJsonNode:e,formatOptions:n,chartId:o})=>{const x=Ce.useRef();let l=mt(t),r,c,p,m=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=Jt,g,W,A,E,b=0,U=1,Y,H=new Map,I=new Map,D=new Map,w=Number.MAX_VALUE,z=Number.MIN_VALUE,K=0,ye=0,se,te;Ce.useEffect(()=>{xe()},[n,o]);const xe=()=>{({chartFormatOptions:r,svg:E,width:c,height:p}=Kt(x,n)),{margins:S,chartTitleHeight:u,innerHeight:g,innerWidth:W}=ri(r,p,c),qt(x,c,p,r),A=oa(E,S),Xt(x,u,c,r),ge(t),pe(),he(),O()},ge=M=>{try{let h=new Set,k=new Set;M.forEach(i=>{i.data.forEach((y,T)=>{T===b&&(h.add(y.value.toString()),K+=y.value),T===U&&(k.add(y.value.toString()),ye+=y.value)})});let s=r.colorScaleForMaps&&r.colorScaleForMaps.startColorForMaps?r.colorScaleForMaps.startColorForMaps:"#c1d8f3",d=r.colorScaleForMaps&&r.colorScaleForMaps.endColorForMaps?r.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(h.size===1)se=()=>s;else{const i=v.interpolateLab(s,d);se=v.scaleOrdinal().domain(Array.from(h)).range(Array.from(h).map((y,T)=>i(T/(h.size-1))))}if(k.size===1)te=()=>s;else{const i=v.interpolateLab(r.colorScaleForMapsBubble.startColorForMapsBubble,r.colorScaleForMapsBubble.endColorForMapsBubble);te=v.scaleOrdinal().domain(Array.from(k)).range(Array.from(k).map((y,T)=>i(T/(k.size-1))))}}catch(h){me("Maps.tsx","dataPreparation",h)}},pe=M=>{Y=zr},he=()=>{try{l?.forEach(M=>{D.set(M.legend,M)}),e.mappings.forEach(M=>{I.set(M.actualName,M.mappedName)}),e.groups.forEach(M=>{M.groupedRegions.forEach(h=>{H.set(h,M.groupName)})}),Y.features.forEach(M=>{const h=M.properties.name;let k;if(I.has(h)){const s=I.get(h);M.properties.displayName=s,k=s}if(H.has(h)){const s=H.get(h);M.properties.displayName=s,k=s}else k=h;if(D.has(k)){const s=D.get(k);M.properties.data=s;let d;s.data&&s.data[1]&&(d=s.data[1]?s.data[1].value:0,w=Math.min(w,d),z=Math.max(z,d)),s.data&&s.data[0]&&(d=s.data[0].value,m=Math.min(m,d),L=Math.max(L,d))}else M.properties.data=void 0})}catch(M){me("Maps.tsx","generateDataForMaps",M)}},O=()=>{try{let M=0;const h=v.geoAlbersUsa().fitSize([W,g],Y),k=v.geoPath().projection(h),s=A.append("g").attr("class","paths");if(s.selectAll(o+" .path-group").data(Y.features).enter().append("path").attr("id",d=>d.properties.name).attr("fill",(d,i)=>X(d)).attr("stroke",d=>d.properties.data?"unset":"#CCCCCC").attr("fill-opacity",r.plotArea.opacity).attr("stroke-width","0.4px").attr("d",d=>(M+=k.area(d),k(d))).on("mousemove",(d,i)=>{let y=i.properties.data;if(y){let T=y.data.map(a=>({key:a.dimension,value:Ke("None",r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(a.value)}));ut([{key:"Region",value:y.properties.alias},...T],r,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(d,i)=>{ot()}),r.plotArea.dataLabels){const d=M/Y.features.length,i=r.plotArea.dataLabelName,y=r.plotArea.dataLabelValue,T=a=>r.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?k.area(a)<d*.25:!1;s.selectAll(".text-container").data(Y.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>k.centroid(a)[0]-50).attr("y",a=>{const f=k.centroid(a);return i&&y?f[1]-15:f[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let f=a.properties.data;if((i||y)&&f&&!T(a)){if(T(a))return null;const N=f?.properties.alias||a.properties.displayName,ne=r.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/K*100)+"%":Ke(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let Z="";return r.plotArea.dataLabelName&&(Z+=`<div style=
151
151
  "text-align:center;
152
152
  font-family:${a.properties.data.properties.labelFont};
153
153
  font-size:${a.properties.data.properties.labelFontSize}px;
154
- font-weight:${a.properties.data.properties.labelFontStyle.includes(oe.bold)?oe.bold:"normal"};
155
- font-style:${a.properties.data.properties.labelFontStyle.includes(oe.italic)?oe.italic:"normal"};
156
- text-decoration:${a.properties.data.properties.labelFontStyle.includes(oe.underline)?oe.underline:"none"};
154
+ font-weight:${a.properties.data.properties.labelFontStyle.includes(ce.bold)?ce.bold:"normal"};
155
+ font-style:${a.properties.data.properties.labelFontStyle.includes(ce.italic)?ce.italic:"normal"};
156
+ text-decoration:${a.properties.data.properties.labelFontStyle.includes(ce.underline)?ce.underline:"none"};
157
157
  color:${a.properties.data.properties.labelFontColor};">
158
158
  ${N??""}
159
- </div>`),l.plotArea.dataLabelValue&&(K+=`<div style=
159
+ </div>`),r.plotArea.dataLabelValue&&(Z+=`<div style=
160
160
  "text-align:center;
161
161
  font-family:${a.properties.data.properties.valueFont}; font-size:${a.properties.data.properties.valueFontSize}px;
162
- font-weight:${a.properties.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"normal"};
163
- font-style:${a.properties.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:"normal"};
164
- text-decoration:${a.properties.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:"none"};
162
+ font-weight:${a.properties.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"normal"};
163
+ font-style:${a.properties.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:"normal"};
164
+ text-decoration:${a.properties.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:"none"};
165
165
  color:${a.properties.data.properties.valueFontColor};">
166
- ${re??""}
167
- </div>`),K}return null})}if(l.bubbleformatting.showBubble){let d=Math.min(_,b);const i=v.scaleLinear().domain([V,$]).range([d*.01,d*.07]);A.selectAll("myCircles").data(U.features).join("circle").attr("cx",y=>k.centroid(y)[0]).attr("cy",y=>k.centroid(y)[1]).attr("r",y=>y.properties.data?i(y.properties.data?.data[1]?.value||0):0).attr("fill",(y,T)=>l.colorScaleForMapsBubble.showColorForMapsBubble=="2"?ae(y.properties.data&&y.properties.data.data[B]?.value||0):l.bubbleformatting.bubbleColor).attr("stroke",l.bubbleformatting&&l.bubbleformatting.bubbleBorderColor).attr("stroke-width",l.bubbleformatting&&l.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",l.bubbleformatting&&rt(l.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(y,T){yt([{key:"Region",value:T.properties?.data?.propeties?.Alias},{key:T.properties.data?.data[1]?.dimension,value:l.toolTip.toolTipNumberFormat==",.0%"?Math.round(T.properties.data?.data[1]?.value/ce*100)+"%":qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(T.properties.data?.data[1]?.value)}],l,void 0,T.currentTarget.__data__.data.properties),v.select(this).style("r",(T.properties.data?i(T.properties.data?.data[1]?.value||0):0)*1.2)}).on("mouseout",function(y,T){ot(),v.select(this).style("r",T.properties.data?i(T.properties.data?.data[1]?.value||0):0)})}}catch(M){Ae("Maps.tsx","drawMap",M)}},G=M=>{try{let h=M.properties.data;switch(parseInt(l.colorScaleForMaps.showColorForMaps)){case 1:return h?h.properties.color:"#E6E6E6";case 2:return l.colorScaleForMaps.defaultColor;case 3:return M.properties.data?ne(M.properties.data?.data[g]?.value):"#E6E6E6"}}catch(h){Ae("Maps.tsx","getMapColor",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{id:c,className:"chartSVG",style:{width:"100%",height:"100%"},ref:x})})},da="OrganizationChart.tsx",Pr=({data:t,formatOptions:e,legendSequence:r})=>{let c=t.LegendList??[];const x=crypto.randomUUID(),n=Me.useRef(),l=Me.useRef();let s,p,f,L=40,u=jt,S,b=new Map,_=new Map,A=Ut.left,R=[],g=0,B=0,U,W=new Map,P,D=Number.NEGATIVE_INFINITY,V=Number.POSITIVE_INFINITY,$;Me.useEffect(()=>{Z()},[x,t,e]);const Z=()=>{({chartFormatOptions:s,svg:S,width:p,height:f}=qt(n,e)),ae(),P=ce(W),{margins:u,innerHeight,innerWidth,legendListWidth:U,chartTitleHeight:L}=$a(s,p,f,P,u),Xt(n,p,f,s),Zt(n,L,p,s),ue(),G(R),ne()},ce=o=>{const d=[];o.forEach((T,a)=>{d.push(a)});const i=d.reduce((T,a)=>T.length>a.length?T:a,""),y=zt(i,rt(s.legends.legendFontSize),s.legends.legendFontFamily);return[y.width,y.height]},ne=()=>{let o=[];W.forEach((d,i)=>{const y=`linear-gradient(90deg, ${d.join(", ")})`;o.push({properties:{...c[0],name:i,alias:i,color:y}})}),Ya(s,S,o,p,f,U,L,x,u,ct.rectangle,void 0)},ae=()=>{try{const i=e?.plotArea?.sortBy??"default";A=s.plotArea.chartDirection||Ut.left;var o=0,d=0;const y={...t.ChartData,UID:void 0};let T=Q(y).filter(a=>a.value!==null);i!=="default"&&(T=T.sort((a,m)=>i==="asc"?a.value-m.value:m.value-a.value)),pe(T),ge(T),R=be(T),s.heatMap.showHeatMap&&($=v.scaleSequential().domain([V,D]).interpolator(v.interpolateRgb(s.heatMap.heatMapMinColor,s.heatMap.heatMapMaxColor)))}catch(i){Ae(da,"dataPreparation",i)}},ue=()=>{try{if(s.plotArea.fitChart)B=f,g=p,l.current.style.width="calc(100% - 10px)",l.current.style.height="calc(100% - 10px)";else{let o=function(){let d=this;var i=d.scrollLeft,y=d.scrollTop;v.select(`#clipPath${x}`).select("rect").attr("x",i).attr("y",y)};g=0,R.forEach(d=>{d.label==r[r.length-1]&&(g+=h(d,!1))}),B=(r.length+1)*rt(s.nodes.nodeHeight)*10+(r.length+1)*70,l.current.style.width=`${g}px`,l.current.style.height=`${B}px`,v.select(l.current).append("defs").attr("id",`defs${x}`).append("clipPath").attr("id",`clipPath${x}`).append("rect").attr("width",p-u.left-u.right).attr("height",f-u.top-u.bottom-15).attr("transform",`translate(${u.left},${u.top})`),document.querySelector("#floating-div"+x).addEventListener("scroll",o),v.select(l.current).attr("clip-path",`url(#clipPath${x})`)}}catch(o){Ae(da,"scrollWidthHeightCalculation",o)}},ge=o=>{try{o.forEach((d,i)=>{if(d.id!=0){let y=o[b.get(d.parentId)].UID;y===void 0?d.UID=d.nodeLabel:d.UID=y+"-"+d.nodeLabel}})}catch(d){Ae(da,"generateUID",d)}},be=o=>{try{return c.forEach(d=>{_.set(d.name,d)}),Object.keys(o).forEach(d=>{const i=o[d],y=_.get(i.UID??i.nodeLabel)??c[0];if(o[d]={...i,styleObject:y},i.label)if(W.has(i.label)){const T=W.get(i.label);W.set(i.label,[...T,y.color??"#eedddd"])}else W.set(i.label,[y.color??"#eedddd"]);D=Math.max(D,i.value),V=Math.min(V,i.value)}),o}catch(d){Ae(da,"addStyleObjectToChartData",d)}},pe=o=>{try{o.forEach((d,i)=>{b.set(d.id,i)})}catch(d){Ae(da,"createIdIndexMap",d)}},Q=o=>{try{const d=v.hierarchy(o).descendants();return d.forEach((i,y)=>{i.id=i.id||"id"+y}),d.map((i,y)=>{const T={...i.data};return delete T.children,i.parent&&(T.parentValue=i.parent.data.value||0),{...T,parentId:i.parent?.data?.id}})}catch(d){Ae(da,"getFlattenedData",d)}},G=o=>{try{let d=s.connector.lineType||"straight",i=s.nodes.nodeType||ri.rectangle,y=parseInt(s.connector.connectorLineThickness);v.select(l.current).selectAll("*").remove(),new ml.OrgChart().container(`#floating-${x}`).svgWidth(g).svgHeight(B).nodeHeight(a=>M(a)).nodeWidth(a=>h(a,!0)).layout(A).diagonal((a,m,N,re={sy:0})=>{if(A=="top"||A=="bottom"||!A)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ha.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${m.y} H ${m.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ha.s_curve:const K=(a.y+m.y)/2;return`M ${a.x},${a.y} C ${a.x},${K} ${m.x},${K} ${m.x},${m.y}`;case ha.arc:const me=m.x-a.x,Le=m.y-a.y,ze=Math.sqrt(me*me+Le*Le);return`M ${a.x},${a.y} A ${ze},${ze} 0 0,1 ${m.x},${m.y}`;case ha.reverse_elbow:if(A==Ut.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${m.x} V ${m.y}`;if(A==Ut.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${m.x} V ${m.y}`;case ha.zigzag:if(A==Ut.top){const Se=(a.y+m.y)/2;return`M ${a.x},${a.y} L ${a.x},${Se-10} L ${m.x},${Se+10} L ${m.x},${m.y}`}else if(A==Ut.bottom){const Se=(a.y+m.y)/2;return`
166
+ ${ne??""}
167
+ </div>`),Z}return null})}if(r.bubbleformatting.showBubble){let d=Math.min(W,g);const i=v.scaleLinear().domain([w,z]).range([d*.01,d*.07]);A.selectAll("myCircles").data(Y.features).join("circle").attr("cx",y=>k.centroid(y)[0]).attr("cy",y=>k.centroid(y)[1]).attr("r",y=>y.properties.data?i(y.properties.data?.data[1]?.value||0):0).attr("fill",(y,T)=>r.colorScaleForMapsBubble.showColorForMapsBubble=="2"?te(y.properties.data&&y.properties.data.data[U]?.value||0):r.bubbleformatting.bubbleColor).attr("stroke",r.bubbleformatting&&r.bubbleformatting.bubbleBorderColor).attr("stroke-width",r.bubbleformatting&&r.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",r.bubbleformatting&&rt(r.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(y,T){ut([{key:"Region",value:T.properties?.data?.propeties?.Alias},{key:T.properties.data?.data[1]?.dimension,value:r.toolTip.toolTipNumberFormat==",.0%"?Math.round(T.properties.data?.data[1]?.value/ye*100)+"%":Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(T.properties.data?.data[1]?.value)}],r,void 0,T.currentTarget.__data__.data.properties),v.select(this).style("r",(T.properties.data?i(T.properties.data?.data[1]?.value||0):0)*1.2)}).on("mouseout",function(y,T){ot(),v.select(this).style("r",T.properties.data?i(T.properties.data?.data[1]?.value||0):0)})}}catch(M){me("Maps.tsx","drawMap",M)}},X=M=>{try{let h=M.properties.data;switch(parseInt(r.colorScaleForMaps.showColorForMaps)){case 1:return h?h.properties.color:"#E6E6E6";case 2:return r.colorScaleForMaps.defaultColor;case 3:return M.properties.data?se(M.properties.data?.data[b]?.value):"#E6E6E6"}}catch(h){me("Maps.tsx","getMapColor",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{id:o,className:"chartSVG",style:{width:"100%",height:"100%"},ref:x})})},da="OrganizationChart.tsx",Yr=({data:t,formatOptions:e,legendSequence:n})=>{let o=t.LegendList??[];const x=crypto.randomUUID(),l=Ce.useRef(),r=Ce.useRef();let c,p,m,L=40,u=Jt,S,g=new Map,W=new Map,A=Bt.left,E=[],b=0,U=0,Y,H=new Map,I,D=Number.NEGATIVE_INFINITY,w=Number.POSITIVE_INFINITY,z;Ce.useEffect(()=>{K()},[x,t,e]);const K=()=>{({chartFormatOptions:c,svg:S,width:p,height:m}=Kt(l,e)),te(),I=ye(H),{margins:u,innerHeight,innerWidth,legendListWidth:Y,chartTitleHeight:L}=Ua(c,p,m,I,u),qt(l,p,m,c),Xt(l,L,p,c),xe(),X(E),se()},ye=s=>{const d=[];s.forEach((T,a)=>{d.push(a)});const i=d.reduce((T,a)=>T.length>a.length?T:a,""),y=$t(i,rt(c.legends.legendFontSize),c.legends.legendFontFamily);return[y.width,y.height]},se=()=>{let s=[];H.forEach((d,i)=>{const y=`linear-gradient(90deg, ${d.join(", ")})`;s.push({properties:{...o[0],name:i,alias:i,color:y}})}),Wa(c,S,s,p,m,Y,L,x,u,ct.rectangle,void 0)},te=()=>{try{const i=e?.plotArea?.sortBy??"default";A=c.plotArea.chartDirection||Bt.left;var s=0,d=0;const y={...t.ChartData,UID:void 0};let T=O(y).filter(a=>a.value!==null);i!=="default"&&(T=T.sort((a,f)=>i==="asc"?a.value-f.value:f.value-a.value)),he(T),ge(T),E=pe(T),c.heatMap.showHeatMap&&(z=v.scaleSequential().domain([w,D]).interpolator(v.interpolateRgb(c.heatMap.heatMapMinColor,c.heatMap.heatMapMaxColor)))}catch(i){me(da,"dataPreparation",i)}},xe=()=>{try{if(c.plotArea.fitChart)U=m,b=p,r.current.style.width="calc(100% - 10px)",r.current.style.height="calc(100% - 10px)";else{let s=function(){let d=this;var i=d.scrollLeft,y=d.scrollTop;v.select(`#clipPath${x}`).select("rect").attr("x",i).attr("y",y)};b=0,E.forEach(d=>{d.label==n[n.length-1]&&(b+=h(d,!1))}),U=(n.length+1)*rt(c.nodes.nodeHeight)*10+(n.length+1)*70,r.current.style.width=`${b}px`,r.current.style.height=`${U}px`,v.select(r.current).append("defs").attr("id",`defs${x}`).append("clipPath").attr("id",`clipPath${x}`).append("rect").attr("width",p-u.left-u.right).attr("height",m-u.top-u.bottom-15).attr("transform",`translate(${u.left},${u.top})`),document.querySelector("#floating-div"+x).addEventListener("scroll",s),v.select(r.current).attr("clip-path",`url(#clipPath${x})`)}}catch(s){me(da,"scrollWidthHeightCalculation",s)}},ge=s=>{try{s.forEach((d,i)=>{if(d.id!=0){let y=s[g.get(d.parentId)].UID;y===void 0?d.UID=d.nodeLabel:d.UID=y+"-"+d.nodeLabel}})}catch(d){me(da,"generateUID",d)}},pe=s=>{try{return o.forEach(d=>{W.set(d.name,d)}),Object.keys(s).forEach(d=>{const i=s[d],y=W.get(i.UID??i.nodeLabel)??o[0];if(s[d]={...i,styleObject:y},i.label)if(H.has(i.label)){const T=H.get(i.label);H.set(i.label,[...T,y.color??"#eedddd"])}else H.set(i.label,[y.color??"#eedddd"]);D=Math.max(D,i.value),w=Math.min(w,i.value)}),s}catch(d){me(da,"addStyleObjectToChartData",d)}},he=s=>{try{s.forEach((d,i)=>{g.set(d.id,i)})}catch(d){me(da,"createIdIndexMap",d)}},O=s=>{try{const d=v.hierarchy(s).descendants();return d.forEach((i,y)=>{i.id=i.id||"id"+y}),d.map((i,y)=>{const T={...i.data};return delete T.children,i.parent&&(T.parentValue=i.parent.data.value||0),{...T,parentId:i.parent?.data?.id}})}catch(d){me(da,"getFlattenedData",d)}},X=s=>{try{let d=c.connector.lineType||"straight",i=c.nodes.nodeType||si.rectangle,y=parseInt(c.connector.connectorLineThickness);v.select(r.current).selectAll("*").remove(),new vl.OrgChart().container(`#floating-${x}`).svgWidth(b).svgHeight(U).nodeHeight(a=>M(a)).nodeWidth(a=>h(a,!0)).layout(A).diagonal((a,f,N,ne={sy:0})=>{if(A=="top"||A=="bottom"||!A)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+f.x)/2} ${a.y}, ${(a.x+f.x)/2} ${f.y}, ${f.x} ${f.y}`;case ha.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${f.y} H ${f.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+f.x)/2} ${a.y} L ${(a.x+f.x)/2} ${f.y} L ${f.x} ${f.y}`;case ha.s_curve:const Z=(a.y+f.y)/2;return`M ${a.x},${a.y} C ${a.x},${Z} ${f.x},${Z} ${f.x},${f.y}`;case ha.arc:const fe=f.x-a.x,Re=f.y-a.y,Te=Math.sqrt(fe*fe+Re*Re);return`M ${a.x},${a.y} A ${Te},${Te} 0 0,1 ${f.x},${f.y}`;case ha.reverse_elbow:if(A==Bt.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${f.x} V ${f.y}`;if(A==Bt.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${f.x} V ${f.y}`;case ha.zigzag:if(A==Bt.top){const Me=(a.y+f.y)/2;return`M ${a.x},${a.y} L ${a.x},${Me-10} L ${f.x},${Me+10} L ${f.x},${f.y}`}else if(A==Bt.bottom){const Me=(a.y+f.y)/2;return`
168
168
  M ${a.x},${a.y}
169
- L ${a.x},${Se+10}
170
- L ${m.x},${Se-10}
171
- L ${m.x},${m.y}
172
- `}default:if(A==Ut.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${m.x} V ${m.y}`;if(A=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${m.x} V ${m.y}`}}).hdiagonal((a,m,N,re={sx:0})=>{if(A===Ut.left||A===Ut.right)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ha.elbow:if(A==Ut.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${m.y} H ${m.x}`;if(A==Ut.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${m.y} H ${m.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ha.s_curve:const K=(a.x+m.x)/2;return`M ${a.x},${a.y} C ${K},${a.y} ${K},${m.y} ${m.x},${m.y}`;case ha.arc:if(A==Ut.left){const me=m.x-a.x,Le=m.y-a.y,ze=Math.sqrt(me*me+Le*Le);return`M ${a.x},${a.y} A ${ze},${ze} 0 0,1 ${m.x},${m.y}`}else if(A==Ut.right){const me=a.x-m.x,Le=m.y-a.y,ze=Math.sqrt(me*me+Le*Le);return`M ${a.x},${a.y} A ${ze},${ze} 0 0,0 ${m.x},${m.y}`}case"reverse-elbow":if(A==Ut.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${m.y} H ${m.x}`;if(A==Ut.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${m.y} H ${m.x}`;case"zigzag":if(A==Ut.left){const me=(a.x+m.x)/2;return`
169
+ L ${a.x},${Me+10}
170
+ L ${f.x},${Me-10}
171
+ L ${f.x},${f.y}
172
+ `}default:if(A==Bt.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${f.x} V ${f.y}`;if(A=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${f.x} V ${f.y}`}}).hdiagonal((a,f,N,ne={sx:0})=>{if(A===Bt.left||A===Bt.right)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+f.x)/2} ${a.y}, ${(a.x+f.x)/2} ${f.y}, ${f.x} ${f.y}`;case ha.elbow:if(A==Bt.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${f.y} H ${f.x}`;if(A==Bt.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${f.y} H ${f.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+f.x)/2} ${a.y} L ${(a.x+f.x)/2} ${f.y} L ${f.x} ${f.y}`;case ha.s_curve:const Z=(a.x+f.x)/2;return`M ${a.x},${a.y} C ${Z},${a.y} ${Z},${f.y} ${f.x},${f.y}`;case ha.arc:if(A==Bt.left){const fe=f.x-a.x,Re=f.y-a.y,Te=Math.sqrt(fe*fe+Re*Re);return`M ${a.x},${a.y} A ${Te},${Te} 0 0,1 ${f.x},${f.y}`}else if(A==Bt.right){const fe=a.x-f.x,Re=f.y-a.y,Te=Math.sqrt(fe*fe+Re*Re);return`M ${a.x},${a.y} A ${Te},${Te} 0 0,0 ${f.x},${f.y}`}case"reverse-elbow":if(A==Bt.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${f.y} H ${f.x}`;if(A==Bt.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${f.y} H ${f.x}`;case"zigzag":if(A==Bt.left){const fe=(a.x+f.x)/2;return`
173
173
  M ${a.x},${a.y}
174
- L ${me-10},${a.y}
175
- L ${me+10},${m.y}
176
- L ${m.x},${m.y}
177
- `}else{const me=(a.x+m.x)/2;return`
174
+ L ${fe-10},${a.y}
175
+ L ${fe+10},${f.y}
176
+ L ${f.x},${f.y}
177
+ `}else{const fe=(a.x+f.x)/2;return`
178
178
  M ${a.x},${a.y}
179
- L ${me+10},${a.y}
180
- L ${me-10},${m.y}
181
- L ${m.x},${m.y}
182
- `}default:return A==Ut.left?`M ${a.x} ${a.y} H ${a.x-25} V ${m.y} H ${m.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${m.y} H ${m.x}`}else return`M ${a.x} ${a.y} L ${m.x} ${m.y}`}).linkUpdate(function(a){try{if(y){const m=s.plotArea.connectorType||"arrow",N=["arrow","diamond","dot"].includes(m)&&s.connector.lineType!=="reverse-elbow";v.select(this).attr("stroke-width",s.connector.connectorLineThickness).attr("stroke-dasharray",s.connector.connectorStyle===Za.solid?0:s.connector.connectorStyle===Za.dotted?1:4).style("stroke",s.connector.connectorLineColor).attr("marker-start",N?`url(#${m})`:null).attr("marker-end",null)}else v.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(m){Ae(da,"drawOrganizationChart.linkUpdate",m)}}).nodeContent((a,m)=>{try{let N=`${a.data.styleObject.borderRadius}px`,re="",K="",me="",Le="",ze="";switch(i){case ri.rounded:N="10px";break;case ri.pill:N="999px";break;case ri.extra_rounded:N="20px";break;case ri.squircle:N="25%";break;default:N="1px";break}return ze=`
179
+ L ${fe+10},${a.y}
180
+ L ${fe-10},${f.y}
181
+ L ${f.x},${f.y}
182
+ `}default:return A==Bt.left?`M ${a.x} ${a.y} H ${a.x-25} V ${f.y} H ${f.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${f.y} H ${f.x}`}else return`M ${a.x} ${a.y} L ${f.x} ${f.y}`}).linkUpdate(function(a){try{if(y){const f=c.plotArea.connectorType||"arrow",N=["arrow","diamond","dot"].includes(f)&&c.connector.lineType!=="reverse-elbow";v.select(this).attr("stroke-width",c.connector.connectorLineThickness).attr("stroke-dasharray",c.connector.connectorStyle===qa.solid?0:c.connector.connectorStyle===qa.dotted?1:4).style("stroke",c.connector.connectorLineColor).attr("marker-start",N?`url(#${f})`:null).attr("marker-end",null)}else v.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(f){me(da,"drawOrganizationChart.linkUpdate",f)}}).nodeContent((a,f)=>{try{let N=`${a.data.styleObject.borderRadius}px`,ne="",Z="",fe="",Re="",Te="";switch(i){case si.rounded:N="10px";break;case si.pill:N="999px";break;case si.extra_rounded:N="20px";break;case si.squircle:N="25%";break;default:N="1px";break}return Te=`
183
183
  border-width: ${a.data.styleObject.borderWidth}px
184
- border-style:${s.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"}
184
+ border-style:${c.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"}
185
185
  border-color:${a.data.styleObject.borderColor};
186
186
  border-radius: ${N};
187
187
  `,`<div hoverId="${a.data.label}" style="
188
188
  border-width: ${a.data.styleObject.borderWidth}px;
189
- border-style:${s.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"} ;
189
+ border-style:${c.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"} ;
190
190
  border-color:${a.data.styleObject.borderColor};
191
191
  border-radius: ${N};
192
192
  width: ${a.width}px;
@@ -197,40 +197,40 @@ let A=t<200?200:S?e:t,R=e<200?200:S?t:e,g=A*.15*.8,B=Jl(l,n),U=g<B[0]+10?g:B[0]+
197
197
  justify-content: center;
198
198
  align-items: center;
199
199
  text-align: center;
200
- background-color: ${s.heatMap.showHeatMap?$(a.data.value):s.nodes.nodesSingleColor?s.nodes.nodesColor:a.data.styleObject.color};
200
+ background-color: ${c.heatMap.showHeatMap?z(a.data.value):c.nodes.nodesSingleColor?c.nodes.nodesColor:a.data.styleObject.color};
201
201
  z-index: 99;
202
- transform: ${re};
202
+ transform: ${ne};
203
203
  transition: unset;">
204
204
 
205
- ${K}
205
+ ${Z}
206
206
 
207
207
  <div style="font-family:${a.data.styleObject.labelFont};
208
208
  color:${a.data.styleObject.labelFontColor};
209
209
  font-size:${a.data.styleObject.labelFontSize}px;
210
- font-weight:${a.data.styleObject.labelFontStyle.includes(oe.bold)?"Bolder":"normal"};
211
- font-style:${a.data.styleObject.labelFontStyle.includes(oe.italic)?oe.italic:"normal"};
212
- text-decoration:${a.data.styleObject.labelFontStyle.includes(oe.underline)?oe.underline:"none"};
210
+ font-weight:${a.data.styleObject.labelFontStyle.includes(ce.bold)?"Bolder":"normal"};
211
+ font-style:${a.data.styleObject.labelFontStyle.includes(ce.italic)?ce.italic:"normal"};
212
+ text-decoration:${a.data.styleObject.labelFontStyle.includes(ce.underline)?ce.underline:"none"};
213
213
  text-overflow: ellipsis;
214
214
  overflow: hidden;
215
215
  white-space: nowrap;
216
216
  max-width: ${a.width}px;
217
217
  padding: 5px;">
218
- ${m===0?a.data.styleObject.alias:s.nodes.nodesLabelVisibility?`${a.data.label} : ${k(a.data.styleObject.alias)}`:`${k(a.data.styleObject.alias)}`}
218
+ ${f===0?a.data.styleObject.alias:c.nodes.nodesLabelVisibility?`${a.data.label} : ${k(a.data.styleObject.alias)}`:`${k(a.data.styleObject.alias)}`}
219
219
  </div>
220
220
 
221
221
  <div style="font-family:${a.data.styleObject.valueFont};
222
222
  color:${a.data.styleObject.valueFontColor};
223
- font-weight:${a.data.styleObject.valueFontStyle.includes(oe.bold)?"Bolder":"normal"};
224
- font-style:${a.data.styleObject.valueFontStyle.includes(oe.italic)?oe.italic:"normal"};
225
- text-decoration:${a.data.styleObject.valueFontStyle.includes(oe.underline)?oe.underline:"none"};
223
+ font-weight:${a.data.styleObject.valueFontStyle.includes(ce.bold)?"Bolder":"normal"};
224
+ font-style:${a.data.styleObject.valueFontStyle.includes(ce.italic)?ce.italic:"normal"};
225
+ text-decoration:${a.data.styleObject.valueFontStyle.includes(ce.underline)?ce.underline:"none"};
226
226
  font-size:${a.data.styleObject.valueFontSize}px;">
227
- ${s.nodes.dataLabelNumberFormat==",.0%"?a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":qe(s.nodes.nodesDisplayUnits,s.nodes.dataLabelNumberFormat,s.nodes.dataLabelDecimalPrecision)(a.data.value)}
227
+ ${c.nodes.dataLabelNumberFormat==",.0%"?a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":Ke(c.nodes.nodesDisplayUnits,c.nodes.dataLabelNumberFormat,c.nodes.dataLabelDecimalPrecision)(a.data.value)}
228
228
  <br>
229
- ${s.nodes.percentageVisibility?+a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":""}
229
+ ${c.nodes.percentageVisibility?+a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":""}
230
230
  </div>
231
231
 
232
- ${me}
233
- </div>`}catch(N){return Ae(da,"drawOrganizationChart.nodeContent",N),""}}).buttonContent(({node:a,state:m})=>{try{if(y)return`
232
+ ${fe}
233
+ </div>`}catch(N){return me(da,"drawOrganizationChart.nodeContent",N),""}}).buttonContent(({node:a,state:f})=>{try{if(y)return`
234
234
  <div
235
235
  style="
236
236
  color: black;
@@ -256,14 +256,14 @@ let A=t<200?200:S?e:t,R=e<200?200:S?t:e,g=A*.15*.8,B=Jl(l,n),U=g<B[0]+10?g:B[0]+
256
256
  font-size: 7px;
257
257
  font-weight: bold;
258
258
  ">${a.data._directSubordinates}</span>`}
259
- </div>`}catch(N){return Ae(da,"drawOrganizationChart.buttonContent",N),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,m)=>20).duration(0).setActiveNodeCentered(!1).data(o).compact(!1).expandAll().fit(!1).render()}catch(d){Ae(da,"drawOrganizationChart",d)}},M=o=>{try{let d;if(o.data.styleObject)return s.nodes.percentageVisibility?d=o.data.styleObject.nodeHeight*10+10:d=o.data.styleObject.nodeHeight*10,d}catch(d){Ae(da,"calculateNodeHeight",d)}},h=(o,d)=>{try{let i={};d?i=o.data:i=o;let y,T;if(s.nodes.nodesLabelVisibility?T=50:T=20,i.styleObject)return s.nodes.nodesLabelOverflow?i.id==0?y=i.styleObject.nodeWidth*10+50:y=i.styleObject.nodeWidth*10:y=T+k(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,y}catch(i){Ae(da,"calculateNodeWidth",i)}},k=o=>{try{let d=o.split("-");return d[d.length-1]}catch(d){Ae(da,"getLabelText",d)}};return Ge.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[Ge.jsx("svg",{id:x,className:"chartSVG",style:{width:"100%",height:"100%"},ref:n}),Ge.jsx("div",{id:`floating-div${x}`,className:"floatingDiv",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"auto"},children:Ge.jsx("svg",{id:`floating-${x}`,className:"chartSVG",ref:l})})]})},Ir=({data:t,formatOptions:e,chartId:r,addLocalFilterFromLib:c,onElementClick:x,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=Me.useRef(x);s.current=x;const p=Me.useRef(n);p.current=n;const f=new Map((t.ChartData??[]).map((ye,fe)=>[ye.legend,fe]));let L=t.LegendList;const u=Me.useRef();let S,b=[0,0];const _=se.BubbleChart;let A,R,g=40,B=jt,U,W,P,D,V=[],$=[],Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a;Me.useEffect(()=>{m()},[e,t,r]);const m=()=>{({chartFormatOptions:S,svg:D,width:A,height:R}=qt(u,e)),b=Ua(S,L??[],"alias"),t=De(t),K(),{longestMeasure:o,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=Qi(S,ne,ae),{longestDimension:G,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=Oi(S,Z,ce),{margins:B,yLabel:ue,xLabel:ge,yTitle:be,xTitle:pe,chartTitleHeight:g,legendMargin:Q,innerHeight:U,innerWidth:W}=Ki(A,R,o,S,G,b),Xt(u,A,R,S),P=oa(D,B),vt(P,e,0,W,U,_),Zt(u,g,A,S),me(),Le(),ze(),el(e,!1,D,B,ge,R,pe,"Bubble",ue,W,U),tl(U,e,0,!1,D,B,be,ue),Se(),ie(),N(),nl(D,S.legends.legendPosition,S,R,A,B,U,pe,ge,t.length)},N=()=>{try{let ye=5,fe=30,$e={minimumValue:ne,maximumValue:ae};const Ue=P.append("g").attr("class","circles").attr("class","parentGroup"),Ye=S.animation.animationEnabled,Pe=Ue.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",Ee=>Ee.legendName.replace(/ /g,"-")).attr("fill",Ee=>Ee.legendColor!==Re.white?Ee.legendColor:"none").append("path").attr("class","path").attr("id",function(Ee,we){v.select(this).attr("d",v.symbol().type(v.symbolCircle).size(re(ye,fe,$e,Ee.measure,10)*rt(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(Ee){return`translate(${T(Ee.dimension)}, ${a(Ee.measure)})`}).attr(lt.SeriesId,Ee=>`${f.get(Ee.legendName)}_${Ee.legendName}`).attr(lt.DimValue,Ee=>String(Ee.dimension)).attr("opacity",Ye?0:S.plotArea.fillOpacity).style("visibility",(Ee,we)=>Ee.dimension[0]===0||Ee.measure===0&&S.plotArea.hideZeroValues||Ee.dimension<k||Ee.dimension>h||Ee.measure<y||Ee.measure>i?"hidden":"visible").on("click",Tt(p,s,(Ee,we)=>({seriesId:`${f.get(we.legendName)}_${we.legendName}`,dimValue:String(we.dimension),legendUniqueId:`${f.get(we.legendName)}_${we.legendName}`,seriesDisplayName:we.legendName}))).on("mousemove",(Ee,we)=>{yt([{key:S.xAxisTitle.xAxisTitleText,value:qe(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(we.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:qe(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(we.measure)},{key:"Legend",value:we.legendName}],S,Ee,{alias:we.legendName},gt(l,String(we.dimension),{alias:we.legendName}))}).on("mouseout",()=>{ot()});Ye&&Pe.transition().duration(S.animation.animationDuration).ease(et[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(ye){Ae("BubbleChart","initCircles",ye)}};function re(ye,fe,$e,Ue,Ye){try{if(Ue==null)return Ye;var Pe=$e.minimumValue,Ee=$e.maximumValue,we=fe*fe*2*Math.PI,Ce=ye*ye*2*Math.PI,ve=Ye;if(Pe==Ee)ve=fe;else{var F=Ue,le=(F-Pe)/(Ee-Pe)*(we-Ce)+Ce;le<Ce&&(le=Ce),ve=Math.sqrt(le/(Math.PI*2))}return ve}catch(he){return Ae("BubbleChart","getBubbleSize",he),Ye}}const K=()=>{try{V=[],$=[],ne=void 0,ae=void 0,Z=void 0,ce=void 0,t.forEach(ye=>{ye.measureName&&(V.push(ye.measure),(ye.measure<ne||ne===void 0)&&(ne=ye.measure),(ye.measure>ae||ae===void 0)&&(ae=ye.measure)),ye.dimensionName&&($.push(ye.dimension),(ye.dimension<Z||Z===void 0)&&(Z=ye.dimension),(ye.dimension>ce||ce===void 0)&&(ce=ye.dimension))})}catch(ye){Ae("BubbleChart","iterateOverChartData",ye)}},me=()=>{try{let ye=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):Z>0?0:Z*1.1,fe=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):ce*1.1,$e=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):ne>0?0:ne*1.1,Ue=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):ae*1.1;T=v.scaleLinear().domain([ye,fe]).range([0,W]),a=v.scaleLinear().domain([$e,Ue]).range([U,0])}catch(ye){Ae("BubbleChart","initScale",ye)}},Le=()=>{try{let{xAxisLabelArray:ye,customTickValue:fe,autoLabelFlag:$e}=Li(ce,Z,W,e,k,h,W,!1);const Ue=v.axisBottom(T).tickFormat(qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(sa(e,U,0,!0)).tickValues(ye.length>0?ye:null).ticks(fe).tickPadding(8).tickSizeOuter(0);ll(P,S,0,ge,Ue,U,W,B,a)}catch(ye){Ae("BubbleChart","drawXAxis",ye)}},ze=()=>{try{let{yAxisLabelArray:ye,customTickValue:fe}=al(ae,ne,U,e,y,i);const $e=v.axisLeft(a).tickFormat(qe(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(Rt(e,W)).tickValues(ye.length>0?ye:null).ticks(fe).tickPadding(8).tickSizeOuter(0);il(P,S,0,ue,$e,U)}catch(ye){Ae("BubbleChart","drawYAxis",ye)}},Se=()=>{try{if(S.plotArea.xCoordinate!=Wt.None){let ye;switch(S.plotArea.xCoordinate){case Wt.Mean:ye=v.mean(t,fe=>fe.dimension);break;case Wt.Median:ye=v.median(t,fe=>fe.dimension);break;case Wt.Custom:ye=rt(S.plotArea.xscaleposition);break}P.append("line").attr("x1",T(ye)).attr("y1",0).attr("x2",T(ye)).attr("y2",U).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Wt.None){let ye;switch(S.plotArea.yCoordinate){case Wt.Mean:ye=v.mean(t,fe=>fe.measure);break;case Wt.Median:ye=v.median(t,fe=>fe.measure);break;case Wt.Custom:ye=rt(S.plotArea.yscaleposition);break}P.append("line").attr("x1",0).attr("y1",a(ye)).attr("x2",W).attr("y2",a(ye)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(ye){Ae("BubbleChart","drawReferenceLines",ye)}},ie=()=>{try{let ye=L?.map(fe=>{let $e={...fe,legendFontStyle:fe.fontStyle,fontSize:fe.fontSize+"px",legendFontFamily:fe.fontFamily};return{legend:fe.name,properties:$e,data:{}}});Ya(S,D,ye||[],A,R,b[0],g,r,B,ct.circle,!1,c)}catch(ye){Ae("BubbleChart","initLegendList",ye)}},De=ye=>{try{if(!ye||!ye.ChartData||!ye.ChartData[0])return[];const fe=[];return ye.ChartData.forEach(Ue=>{Ue.data.forEach(Ye=>{fe.push({dimension:parseFloat(Ye.dimension),dimensionName:Ue.legend??"Dimension",measure:Ye.value,measureName:Ue.legend??"Measure",legendName:Ue.legend,legendColor:Ue.properties?.color??Re.black,tooltip:""})})}),fe}catch(fe){return console.error("BubbleChart - Data conversion failed",fe),[]}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:r,style:{width:"100%",height:"100%"}})})},ba="ScatterChart.tsx",Er=({data:t,formatOptions:e,chartId:r,onElementClick:c,vfxPickModeActive:x,tooltipFormatter:n})=>{const l=Me.useRef(c);l.current=c;const s=Me.useRef(x);s.current=x;const p=t.ColorElements??[],f=t.ShapeElements??[],L=new Map(p.map((Ee,we)=>[Ee.name,we]));let u=[];const S=Me.useRef();let b,_=[0,0],A,R,g=40,B=jt,U,W,P,D,V=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,Z=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,ne=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N=new Map,re=new Map;Me.useEffect(()=>{K()},[e,t,r]);const K=()=>{({chartFormatOptions:b,svg:D,width:A,height:R}=qt(S,e));let Ee=[...f,...p];_=Ua(b,Ee,"alias"),Le(),{longestMeasure:o,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=Qi(b,Z,ce),{longestDimension:G,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=Oi(b,V,$),{margins:B,yLabel:ue,xLabel:ge,yTitle:be,xTitle:pe,chartTitleHeight:g,legendMargin:Q,innerHeight:U,innerWidth:W}=Ki(A,R,o,b,G,_),Xt(S,A,R,b),P=oa(D,B),vt(P,e,0,W,U,"Scatter",r),Zt(S,g,A,b),ze(),Se(),ie(),el(e,!1,D,B,ge,R,pe,"Scatter",ue,W,U),tl(U,e,0,!1,D,B,be,ue),De(),me(),ye(),fe(),nl(D,b.legends.legendPosition,b,R,A,B,U,pe,ge,u.length)},me=()=>{try{let Ee=function(F){return F=="Square"?v.symbolSquare:F=="Circle"?v.symbolCircle:F=="Cross"?v.symbolCross:F=="Triangle"?v.symbolTriangle:F=="Star"?v.symbolStar:F=="Diamond"?v.symbolDiamond:F=="Wye"?v.symbolWye:v.symbolCircle};const we=P.append("g").attr("class","circles").attr("class","parentGroup"),Ce=b.animation.animationEnabled,ve=we.append("g").selectAll(".bubbleScatter").data(u).enter().append("g").attr("fill",F=>F.color).attr("colorId",F=>F.colorName.replace(/ /g,"-")).attr("shapeId",F=>F.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(F,le){v.select(this).attr("d",v.symbol().type(Ee(F.shape)).size((F.sizeValue?m(F.sizeValue):10)*2*rt(b.plotArea.scatterSizeIndex)))}).attr("transform",function(F){return`translate(${T(F.dimension)}, ${a(F.measure)})`}).attr(lt.SeriesId,F=>`${L.get(F.colorName)}_${F.colorName}`).attr(lt.DimValue,F=>String(F.dimension)).attr("opacity",Ce?0:b.plotArea.fillOpacity).style("visibility",(F,le)=>F.dimension[0]===0||F.measure===0&&b.plotArea.hideZeroValues||F.dimension<k||F.dimension>h||F.measure<y||F.measure>i?"hidden":"visible").on("click",Tt(s,l,(F,le)=>({seriesId:`${L.get(le.colorName)}_${le.colorName}`,dimValue:String(le.dimension),legendUniqueId:`${L.get(le.colorName)}_${le.colorName}`,seriesDisplayName:le.colorName}))).on("mousemove",(F,le)=>{yt([{key:b.xAxisTitle.xAxisTitleText,value:qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(le.dimension)},{key:b.yAxisTitle.yAxisTitleText,value:qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(le.measure)},{key:"Color",value:le.colorName},...le.shapeName?[{key:"Shape",value:le.shapeName}]:[]],b,F,{alias:le.colorName},gt(n,String(le.dimension),{alias:le.colorName}))}).on("mouseout",()=>{ot()});Ce&&ve.transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",b.plotArea.fillOpacity)}catch(Ee){Ae(ba,"initCircles",Ee)}},Le=()=>{try{let Ee=function(we,Ce,ve){Z=Math.min(Z,we.value),ce=Math.max(ce,we.value),V=Math.min(V,we.dimension),$=Math.max($,we.dimension),ne=Math.min(ne,we.value2??10),ae=Math.max(ae,we.value2??10),u.push({dimension:we.dimension,measure:we.value,sizeValue:we.value2,colorName:Ce,shapeName:ve,shape:re.get(ve)||"Circle",color:N.get(Ce)||"#6ba2b8ff"})};p.forEach(we=>{N.set(we.name,we.color)}),f.forEach(we=>{re.set(we.name,we.markerShape)}),t.ChartData.forEach(we=>{we.children&&we.children.length>0&&we.children.forEach(Ce=>{Ce.data.forEach(ve=>{Ee(ve,we.legend,Ce.legend)})}),we.data&&we.data.length>0&&we.data.forEach(Ce=>{Ee(Ce,we.legend)})})}catch(Ee){Ae(ba,"iterateOverChartData",Ee)}},ze=()=>{try{let Ee=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMinText!==""?parseFloat(b.yAxisLabel.yAxisMinText):Z>0?0:Z*1.1,we=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMaxText!==""?parseFloat(b.yAxisLabel.yAxisMaxText):ce*1.1;a=v.scaleLinear().domain([Ee,we]).range([U,0]),m=v.scaleLinear().domain([ne,ae]).range([1,10])}catch(Ee){Ae(ba,"initScale",Ee)}},Se=()=>{try{const we=(parseFloat(e.plotArea.ticksHeight)||100)/100*U;let{xAxisLabelArray:Ce,customTickValue:ve}=Li($,V,W,e,k,h,U,!1);Ce.length>0?T=v.scaleLinear().domain([Ce[0],Ce[Ce.length-1]]).range([0,W]):T=v.scaleLinear().domain([k,h]).range([0,W]);const F=v.axisBottom(T).tickFormat(qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesVertical?b.xAxisLabel.xAxisPosition==="0"?-we:b.xAxisLabel.xAxisPosition==="1"?we:0:0).tickValues(Ce.length>0?Ce:null).ticks(ve).tickPadding(8).tickSizeOuter(0);ll(P,b,0,ge,F,U,W,B,a)}catch(Ee){Ae(ba,"drawXAxis",Ee)}},ie=()=>{try{const we=(parseFloat(e.plotArea.ticksWidth)||100)/100*W;let{yAxisLabelArray:Ce,customTickValue:ve}=al(ce,Z,U,e,y,i);const F=v.axisLeft(a).tickFormat(qe(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesHorizontal?-we:0).tickValues(Ce.length>0?Ce:null).ticks(ve).tickPadding(8).tickSizeOuter(0);il(P,b,0,ue,F,U)}catch(Ee){Ae(ba,"drawYAxis",Ee)}},De=()=>{try{if(b.plotArea.xCoordinate!=Wt.None){let Ee;switch(b.plotArea.xCoordinate){case Wt.Mean:Ee=v.mean(u,we=>we.dimension);break;case Wt.Median:Ee=v.median(u,we=>we.dimension);break;case Wt.Custom:Ee=rt(b.plotArea.xscaleposition);break}P.append("line").attr("x1",T(Ee)).attr("y1",0).attr("x2",T(Ee)).attr("y2",U).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}if(b.plotArea.yCoordinate!=Wt.None){let Ee;switch(b.plotArea.yCoordinate){case Wt.Mean:Ee=v.mean(u,we=>we.value);break;case Wt.Median:Ee=v.median(u,we=>we.value);break;case Wt.Custom:Ee=rt(b.plotArea.yscaleposition);break}P.append("line").attr("x1",0).attr("y1",a(Ee)).attr("x2",W).attr("y2",a(Ee)).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}}catch(Ee){Ae(ba,"drawReferenceLines",Ee)}},ye=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment="Top"),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom="Start");let Ee=b.legends.legendPosition,we=b.legends.legendAlignment,Ce=b.legends.legendAlignmentTopBottom;switch(Ee){case je.none:break;case je.right:$e(p,A-Q-30,g+5,Q+25,R-g-10);break;case je.top:$e(p,5,g+5,A-10,30);break;case je.left:$e(p,5,g+5,Q+25,R-g-10);break;case je.bottom:$e(p,5,R-35,A-10,30);break}}catch(Ee){Ae(ba,"drawColors",Ee)}},fe=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment=Ia.top),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom=Ea.start);let Ee=b.legends.legendPosition;if(f.length>0)switch(Ee){case je.none:break;case je.right:Ue(f,A-Q-30,R/2+10,Q+25,R-g-10);break;case je.top:Ue(f,A/2+5,g+5,A-10,30);break;case je.left:Ue(f,5,R/2+10,Q+25,R-g-10);break;case je.bottom:Ue(f,A/2+5,R-35,A-10,30);break}}catch(Ee){Ae(ba,"drawShapes",Ee)}},$e=(Ee,we,Ce,ve,F)=>{try{let he=b.legends.legendPosition,te=b.legends.legendFontStyle,O=D.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",we).attr("y",Ce).attr("width",ve).attr("height",F).style("user-select","none"),X=(he==je.top||he==je.bottom)&&f.length>0?"50%":"100%";var le=O.append("xhtml:div").style("width",X).style("display","flex").style("height",he==je.top||he==je.bottom?F-1+"px":"calc(50% - 5px)").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+r).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",he==je.top||he==je.bottom?b.legends.legendAlignmentTopBottom==Ea.start?"flex-Start":b.legends.legendAlignmentTopBottom==Ea.middle?"center":"flex-end":b.legends.legendAlignment==Ia.top?"flex-Start":b.legends.legendAlignment==Ia.middle?"center":"flex-end").style("flex-direction",he==je.top||he==je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Ee.forEach((H,E)=>{let Y=le.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("width","fit-content").style("flex-wrap","nowrap").style("white-space","nowrap").style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).on("mousemove",function(z){b.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[colorId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(z){D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[colorId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(he==je.bottom||he==je.top)&&Y.style("margin-right","16px").style("white-space","nowrap"),Y.append("div").style("height","10px").style("width","10px").style("background",H.color).style("border-radius","1px");let ee=b.legends.legendColorMode=="1"?H.color?H.color:Re.black:b.legends.legendSelectedUnicolor;Y.append("div").style("margin-left","5px").style("color",ee).attr("title",H.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",te.includes(oe.italic)?oe.italic:"").style("text-decoration",te.includes(oe.underline)?oe.underline:"").style("font-weight",te.includes(oe.bold)?oe.bold:"").style("white-space","nowrap").html(H.name)})}catch(he){Ae(ba,"colorListWithScroll",he)}},Ue=(Ee,we,Ce,ve,F)=>{try{let he=b.legends.legendPosition,te=b.legends.legendFontStyle,O=D.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",we).attr("y",Ce).attr("width",ve).attr("height",F).style("user-select","none"),X=b.legends.legendPosition==je.top||b.legends.legendPosition==je.bottom?"calc(50% - 5px)":"calc(100%)";var le=O.append("xhtml:div").style("width",X).style("display","flex").style("height",he==je.top||he==je.bottom?F-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+r).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",he==je.top||he==je.bottom?b.legends.legendAlignmentTopBottom==Ea.start?"flex-Start":b.legends.legendAlignmentTopBottom==Ea.middle?"center":"flex-end":b.legends.legendAlignment==Ia.top?"flex-Start":b.legends.legendAlignment==Ia.middle?"center":"flex-end").style("flex-direction",he==je.top||he==je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Ee.forEach((H,E)=>{let Y=le.append("div").style("width","fit-content").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("mousemove",function(z){b.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[shapeId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(z){b.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[shapeId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(he==je.top||he==je.bottom)&&Y.style("margin-right","16px").style("white-space","nowrap"),Ye(Y,H.markerShape);let ee=b.legends.legendColorMode=="1"?Re.black:b.legends.legendSelectedUnicolor;Y.append("div").style("margin-left","5px").style("color",ee).attr("title",H.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",te.includes(oe.italic)?oe.italic:"").style("text-decoration",te.includes(oe.underline)?oe.underline:"").style("font-weight",te.includes(oe.bold)?oe.bold:"").style("white-space","nowrap").html(H.name)})}catch(he){Ae(ba,"shapeListWithScroll",he)}},Ye=(Ee,we)=>{try{const ve={none:v.symbolCircle,circle:v.symbolCircle,square:v.symbolSquare,triangle:v.symbolTriangle,cross:v.symbolCross,diamond:v.symbolDiamond,star:v.symbolStar,wye:v.symbolWye}[we?.toLowerCase()]||v.symbolCircle;Ee.append("svg").attr("width",14).attr("height",14).append("path").attr("d",v.symbol().type(ve).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(Ce){Ae(ba,"shapesForScatterPlot",Ce)}},Pe=(Ee="")=>{try{return Ee.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(we){Ae(ba,"getJQuerySelector",we)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:r,style:{width:"100%",height:"100%"}})})},Rr=({isDateType:t,formatOptions:e,data:r,isAdvancedAnalyticsWaterFall:c=!1,onElementClick:x,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=crypto.randomUUID?.();let p=0,f;const L=se.WaterfallChart,u=Me.useRef(),S=Me.useRef(x);S.current=x;const b=Me.useRef(n);b.current=n;const _=c??!1,A=_?[]:Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!1,B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K=[],me=[],Le,ze=0;const Se=2;let ie={dimensionList:R,chartType:L,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{De()}catch(te){Ae("WaterfallChart","createWaterfallChart",te)}},[e]);const De=()=>{({formatOptions:e,svg:d,width:h,height:k}=St(u,e)),ye(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be}=Ct(h,k,pe,Q,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,B,U,t),we(D),Mt(d,h,k,e),i=Ft(d,D),vt(i,e,o,G,M,L,s),$e(),Ye(),Jt(i,e,o,V,m,M),Ce(A,k,d,D,G),wt(e,g,d,D,$,k,ce,ie.chartType,V,G,M),Dt(M,e,o,g,d,D,Z,V),Ht(d,B,D,e,o,M,G,be,ue),Vt(d,e,h,ae)},ye=()=>{if(_){let E=he(r);E=E.filter(ee=>ee.up+ee.down+ee.base!=0),ie.dimensionList=E.map(ee=>ee.xKey),ie.legendList=ie.dimensionList,me=v.stack().keys(["base","dimensionTotal","up","down"])(E);const Y=[];me.forEach(ee=>ee.forEach(z=>Y.push(z[1]))),ie.yMaxLeft=v.max(Y)??0,ie.yMinLeft=v.min(Y)??0;return}A.forEach(E=>{E.data.forEach(Y=>{})}),K=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?re=ie.dimensionList:re=ie.dimensionList.slice(ze,ze+Se),e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0);let te=_?he(r):F(),O=JSON.parse(JSON.stringify(te));te.forEach(E=>{if(!E.Dimension&&(E.Up<1e-9&&E.Up!==0||E.Down<1e-9&&E.Down!==0)){let Y=O.findIndex(ee=>ee.Legend===E.Legend);Y!==-1&&O.splice(Y,1)}}),te=O,te.forEach(E=>E.dimension?ie.legendList.push(E.dimension):ie.legendList.push(E.legend)),me=v.stack().keys(["base","dimensionTotal","up","down"])(te);let X=[],H=[];me.forEach(E=>{E.key=="base"?E.opacity=0:E.opacity=1,E.forEach(Y=>X.push(Y)),!H.includes(E.dimension)&&E.dimensionTotal===0&&E.total===0&&H.push(E.dimension)}),ie.yMaxLeft=v.max(X,E=>E[1]),ie.yMinLeft=v.min(X,E=>E[1]),e.xAxisLabel.hideZeroValues&&(H.length>0&&H.forEach(E=>{ie.legendList=ie.legendList.filter(Y=>Y!==E)}),ie.dimensionList=ie.legendList),t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(E=>E):ie.dimensionList,fe(te)},fe=te=>{try{let O=[],X=[],H=[];te&&te.forEach((Y,ee)=>{Y.dimension&&(O.push(Y.dimension),X.push({dimension:Y.dimension,chartDataIndex:ee,selfIndex:X.length}))}),t?H=ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(Y=>Y):H=O;let E=JSON.parse(JSON.stringify(ie.legendList));X.forEach((Y,ee)=>{E[Y.chartDataIndex]=H[Y.selfIndex]}),ie.legendList.forEach((Y,ee)=>{ie.formattedDimensionListMap.set(Y,E[ee])})}catch(O){throw O}},$e=()=>{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P).yAxisLabelArray;ie.yMaxLeft=te[te.length-1],ie.yMinLeft=te[0],y=v.scaleLinear().domain([ie.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:ie.yMinLeft<0?ie.yMinLeft*1.1:ie.yMinLeft*.9,ie.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:ie.yMaxLeft*1.1]).range([M,0]),a=[0,G],Ue()},Ue=()=>{p=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(G/ie.legendList.length),T=v.scaleBand().domain(ie.legendList).range(a).padding(.4)},Ye=()=>{Pe();{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P);m=v.axisLeft(y).tickFormat(O=>Ze(O,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-G+0:0).tickValues(te.autoLabelFlag?void 0:te.yAxisLabelArray).ticks(te.customTickValue).tickPadding(8).tickSizeOuter(0)}f=v.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,_?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},Pe=()=>{N=v.axisBottom(T).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.gridLinesVertical?-M:parseFloat(e.plotArea.ticksHeight)*(M/100)*(e.xAxisLabel.xAxisPosition=="1"?1:-1):0).tickSizeOuter(0).tickValues(bt(ie.legendList,G))},Ee=te=>{let O;if(me.forEach((X,H)=>X.forEach(E=>E.key=X.key)),Le){let X=K.map(H=>H.legend);O=v.stack().keys(X)(Le),O.forEach((H,E)=>{O[E].color=K[E].properties.color})}O&&O.forEach(X=>{X.forEach(H=>{H.Key=X.key})}),[0,1].forEach(X=>{if(X===1&&(me=O),me){let H=i.selectAll(`.parentGroup-${X}`).data([null]);H=H.enter().append("g").attr("class",`parentGroup parentGroup-${X}`).merge(H);let E=H.selectAll(`.bar-group-${X}`).data(me);E=E.enter().append("g").attr("class",`bar-group-${X}`).attr("fill",C=>C.color?C.color:f(C.key)!==Re.white?f(C.key):"none").attr("opacity",C=>C.opacity).merge(E);let ee=E.selectAll("rect").data(C=>C,C=>C.key||C.Key);const z=e.animation.animationEnabled,I=ee.enter().append("rect").attr("class","rect").attr("class",C=>C.key?C.key.replace(/ /g,"-"):C.Key.replace(/ /g,"-")).attr("x",C=>T(_?C.data.xKey:C.data.dimension||C.data.legend)).attr("y",y(0)??0).attr("clip-path",`url(#${s}-clip)`).attr("height",0).attr("width",T.bandwidth()).attr("visibility",C=>X===0&&C.data.dimension&&Le?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(C,q)=>{const J=_?va.base:va.dimensionTotal,j={markerShape:"square",markerColor:q.key===J?e.plotArea.totalColor:q.key===va.down?e.plotArea.negativeColor:e.plotArea.positiveColor};yt([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():q.properties?.currentMeasure?q.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(q.key===va.up?"+":q.key===va.down?"-":"")+Ze(q.key===va.dimensionTotal?q.data.dimensionTotal:q[1]-q[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(_?q.key!==va.base?q.data.xKey:va.total:q.Key?q.Key.includes("~$~")?q.Key.split("~$~")[1]:q.Key:q.data.legend?q.data.legend.includes("~$~")?q.data.legend.split("~$~")[1]:q.data.legend:va.total).trim()||""}],e,void 0,j,gt(l,String(ie.formattedDimensionListMap.get(_?q.data.xKey:q.data.dimension||q.data.legend)??(_?q.data.xKey:q.data.dimension||q.data.legend)??""),{...j,alias:q.properties?.alias??q.properties?.currentMeasure??String(q.Key??q.key??"")}))}).on("mouseout",()=>{ot()}).attr(lt.SeriesId,C=>String(C.key??C.Key??"")).attr(lt.DimValue,C=>String(_?C.data.xKey||"":C.data.dimension||C.data.legend||"")).on("click",Tt(b,S,(C,q)=>{const J=String(q.key??q.Key??""),j=String(_?q.data.xKey||"":q.data.dimension||q.data.legend||"");return{seriesId:J,dimValue:j,legendUniqueId:J,seriesDisplayName:J}}));if((z?I.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):I).attr("y",C=>C[1]?y(C[1]):0).attr("height",C=>C[1]?y(C[0])-y(C[1]):0),ee.exit().remove(),ee=I.merge(ee),e.plotArea.plotAreaDataLabel=="2"&&X!=1){const C=E.selectAll("text").data(j=>j),q=C.enter().append("text").text(j=>Ze(j[1]-j[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",j=>T(_?j.data.xKey:j.data.dimension||j.data.legend)+T.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",j=>j[1]-j[0]!==0&&y(j[1])?"visible":"hidden");(z?q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):q).attr("y",j=>j[1]?y(j[1])-15:0),C.exit().remove()}}}),i.selectAll(".parentGroup").raise()},we=te=>{G=h-te.left-te.right,M=k-te.bottom-te.top},Ce=(te,O,X,H,E)=>{if(!e.plotArea.fitChart){const Y=te[0].data.length-Se,ee=O-20;re=ie.dimensionList.slice(ze,ze+Se),Ue(),K=JSON.parse(JSON.stringify(te)),K.forEach((w,C)=>K[C].data=w.data.filter(q=>re.includes(q.dimension))),Pe(),X.append("rect").attr("x",H.left).attr("y",ee).attr("width",E).attr("height",8).attr("fill","#ddd").attr("rx",4);const z=E*Se/ie.dimensionList.length,I=X.append("rect").attr("x",H.left).attr("y",ee).attr("width",z).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",w=>{let C=Math.min(Math.max(w.x,H.left),H.left+E-z);I.attr("x",C),ze=Math.round((C-H.left)/(E-z)*Y),re=ie.dimensionList.slice(ze,ze+Se),Ue(),K=JSON.parse(JSON.stringify(te)),K.forEach((q,J)=>K[J].data=q.data.filter(j=>re.includes(j.dimension))),Pe(),ve()}));X.on("wheel",w=>{w.preventDefault();const C=Math.abs(w.deltaX)>Math.abs(w.deltaY)?w.deltaX:w.deltaY;ze+=C>0?1:-1,ze=Math.max(0,Math.min(ze,Y));const q=H.left+(E-z)*ze/Y;I.attr("x",q),Ue(),K=JSON.parse(JSON.stringify(te)),K.forEach((J,j)=>K[j].data=J.data.filter(Te=>re.includes(Te.dimension))),Pe(),ve()})}ve()},ve=()=>{Ot(i,ie,$,e,o,y,N,ne,k,p,t,G,M,ie.legendList,T),Ee()},F=()=>{try{if(A.length<1)return[];if(ie.dimensionList.length<2)return[];let te=[],O=[],X=[],H="";if(H.length>1){let I=H;A.forEach(w=>{I===w.properties.currentLegend?O.push(w):X.push(w)})}O.length>0&&(K=O);let E=0,Y=0;for(let I=0;I<K.length;++I)E=E+K[I].data[0].value;let ee="";for(let I=1;I<re.length;++I){let w={};w.dimension=re[I-1],w.total=E,w.base=0,w.dimensionTotal=E,w.up=0,w.down=0,te.push(w);for(let C=0;C<K.length;++C){let q={};for(let J=0;J<C;J++)ee=ee+" ";Y=K[C].data[I].value-K[C].data[I-1].value,Y!==0&&(q.legend=ee+K[C].properties.legend,q.dimensionTotal=0,Y<0?(q.base=E+Y,q.down=-Y,q.up=0,q.total=E-Y):(q.base=E,q.down=0,q.up=Y,q.total=E+Y),E=E+Y,te.push(q))}}let z={};return z.dimension=re[re.length-1],z.dimensionTotal=E,z.base=0,z.total=E,z.up=0,z.down=0,te.push(z),X.length>0&&(K=X,Le=At(re,X,!1)),te}catch(te){throw te}},le=te=>te==null||te===""?0:Number(te),he=te=>(te[0]?.Column1==""?te.filter(X=>X.Column1&&X.Column1!=="*"):c?te.Data:te).map(X=>({xKey:X.Column1||X.Dimension||X.Legend,base:le(X.Column3||X.Total),up:le(X.Column4||X.Up),down:le(X.Column5||X.Down),total:le(X.Column6||X.total),dimensionTotal:le(X.Column2||X.Base)}));return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:s,style:{width:"100%",height:"100%"}})})},zr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,onElementClick:n,vfxPickModeActive:l,tooltipFormatter:s})=>{const p=crypto.randomUUID();let f=0;const L=se.TornadoChart,u=r.IsadvanceanalyticsChart??r.IsCalCSensitivity,S=Me.useRef(),b=Me.useRef(n);b.current=n;const _=Me.useRef(l);_.current=l;let A=Lt(r.ChartData,r.DimensionList,!0);A=er(A,r,u);const R=r.DimensionList,g=!0,B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze=[],Se=0,ie=2,De=!1,ye={dimensionList:R,chartType:L,chartData:[],formatOptions:e,legendList:r.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{fe()}catch(O){Ae("Tornadochart","createTornadoChart",O)}},[e]);const fe=()=>{({formatOptions:e,svg:i,width:h,height:k}=St(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ue(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,ye.yMinLeft,ye.yMaxLeft,ye.yMinRight,ye.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be,visibleBars:ie,columnWidth:f,scrollbarVisible:De}=Ct(h,k,pe,Q,ye.yMaxLeft,e,u?ye.legendList.map(O=>O.alias.split(" - ")[0]):ye.legendList.map(O=>O.alias),ye.dimensionList,ye.yMaxRight,B,U,t,!0,ye),ve(D),Mt(i,h,k,e),y=Ft(i,D),vt(y,e,d,G,M,L),Ye(),we(),ra(e,y,$,M,G,K),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,i,y,o,f,T,a,m,void 0,void 0,d,L,e,V,Z,ye.dimensionList,G,N,ye.formattedDimensionListMap,p,D,M)),wt(e,g,i,D,$,k,ce,ye.chartType,V,G,M),Dt(M,e,d,g,i,D,Z,V,G),Ht(i,B,D,e,d,M,G,be,ue),Vt(i,e,h,ae),Pt(k,i,ne,ae,h,ge,e,$e(A,ye.legendList,u,e),p,d,D,ct.rectangle),he(A,k,h,i,D,G,De,ie,ye,Se,!1,F,g)},$e=(O,X,H,E)=>O.map((Y,ee)=>{const z=X[ee];if(!z)return{...Y,properties:{}};let I=z.alias;H&&z.alias&&(I=z.alias.split(" - ")[0].trim());let w=z.color;return H&&I&&(I.includes("+ve")?w=E.plotArea.plotAreaCalculatedHigh:I.includes("-ve")&&(w=E.plotArea.plotAreaCalculatedLow)),{...Y,properties:{...z,alias:I,color:w}}}).filter(Y=>Y.properties&&Object.keys(Y.properties).length>0),Ue=()=>{let O;if(u)ye.chartData=A,ye.yMaxLeft=Math.min(...A.map(H=>H.data[0].value)),ye.yMaxRight=Math.max(...A.map(H=>H.data[0].value));else{const H=A[0]?.properties?.measureUniqueId;let E=0,Y=-1/0;O=A.map((ee,z)=>{const I=ee.properties.measureUniqueId===H,w=ee.data.map(q=>{const J=I?-Math.abs(q.value):Math.abs(q.value);return{...q,value:J}}),C=w.map(q=>q.value);return I?E=Math.min(E,Math.min(...C)):Y=Math.max(Y,Math.max(...C)),{...ee,data:w}}),ye.chartData=O,ye.yMaxLeft=E,ye.yMaxRight=Y}const X=t?ft(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList):ye.dimensionList;ye.dimensionList.forEach((H,E)=>{ye.formattedDimensionListMap.set(H,X[E])}),ze=JSON.parse(JSON.stringify(u?A:O)),A=ze,Le=ye.dimensionList,e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0)},Ye=()=>{let O=ye.yMaxLeft,X=ye.yMaxRight,H=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,E,Y=!1,ee=!1;O>X?(E=O,Y=!0):(E=X,ee=!0);let z=e.annotation.annotationVisibility!="5"?O/E!==1?Math.abs(O/E)*100<10?3:0:Math.abs(X/E)*100<10?3:0:0,I=0,w=0;O<0&&X>0?(I=O*(1.2+(ee?z:0)),w=X*(1.2+(Y?z:0))):O>=0&&X>=0?(I=0,w=X*(1.2+(Y?z:0))):O<=0&&X<=0?(I=O*(1.2+(ee?z:0)),w=0):(I=O*1.2,w=X*1.2),I=Math.floor(I),w=Math.ceil(w),m=v.scaleLinear().domain([I,w]).range([H,G-H]),a=m,N=[0,G],Pe()},Pe=()=>{T=v.scalePoint().domain(Le).range([M,0]).padding(.5)},Ee=()=>{re=v.axisLeft(T).tickSize(Rt(e,G-m(0),0)).tickSizeOuter(0).tickValues(bt(Le,M)),me=v.axisRight(T).tickSize(Rt(e,m(0),0)).tickSizeOuter(0).tickValues(bt(Le,G))},we=()=>{K=v.axisBottom(m).tickFormat(O=>Ze(O,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision,!0)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.ticksHeight=="100"?-M:-e.plotArea.ticksHeight*(M/100):0).tickValues(dt(ye.yMaxRight,ye.yMaxLeft,M,e,ye,W,P,g,G).yAxisLabelArray).ticks(dt(P||ye.yMaxLeft,ye.yMinLeft,M,e,ye,W,P,g,G).customTickValue??G/30).tickPadding(8).tickSizeOuter(0)},Ce=()=>{y.selectAll(".parentGroup").remove();const O=e.plotArea.plotAreaCalculatedHigh,X=e.plotArea.plotAreaCalculatedLow,H=y.append("g").attr("class","parentGroup"),E=e.animation.animationEnabled,Y=H.selectAll("rect").data(ze.flatMap(z=>z.data.map(I=>({...I,legendText:u?z.legend.split("ve) - ")[1]?.trim()??z.legend:ye.dimensionList[0]==se.TornadoDefaultEntry?fi.default:z.legend.split("-")[1]?.trim()??z.legend,properties:z.properties})))).enter().append("rect").attr("class","rect").attr("y",z=>(z.legendText?T(z.legendText):T(se.TornadoDefaultEntry))-f/2).attr("height",f).attr("x",a(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",z=>z.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",z=>`${z.properties.stackBorderWidth}px`).attr("hoverId",z=>((u?z.legend.split(" - ")[0]:z.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",z=>z.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?z.properties.stackBorderColor:"none").style("fill",z=>u?z.value>0?O!==Re.white?O:"none":X!==Re.white?X:"none":z.properties.color).on("mousemove",(z,I)=>{yt([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():r.IsCalCSensitivity?I.properties.currentMeasure.split("~$~")[1]:I.dimension},{key:"Legend",value:I.legendText},{key:"Value",value:Ze(Math.abs(I.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,z,r.IsCalCSensitivity?I.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:I.properties,gt(s,String(ye.formattedDimensionListMap.get(I.legend)??I.legend??""),I.properties))}).on("mouseout",ot).attr(lt.SeriesId,z=>String(z.properties?.legendUniqueId??"")).attr(lt.DimValue,z=>String(z.legend??z.legendText??"")).on("click",Tt(_,b,(z,I)=>({seriesId:String(I.properties?.legendUniqueId??""),dimValue:String(I.legend??I.legendText??""),legendUniqueId:String(I.properties?.legendUniqueId??""),seriesDisplayName:String(I.properties?.alias||I.properties?.name||I.legendText||"")})));(E?Y.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Y).attr("x",z=>z.value>=0?a(0):a(z.value)).attr("width",z=>Math.abs(a(z.value)-a(0)))},ve=O=>{G=h-O.left-O.right,M=k-O.bottom-O.top},F=(O,X,H)=>{ze=X,Le=O,ie=H,te()};function le(O){const X=new Map;return O.forEach(H=>{let E=X.get(H.properties.legendUniqueId);if(E){let Y=E.data??[];Y.push(H.data[0]),X.set(H.properties.legendUniqueId,{...E,data:Y})}else E={...H,data:[H.data[0]]},X.set(H.properties.legendUniqueId,E)}),X.size>0?Array.from(X.keys()).map(H=>X.get(H)):O}function he(O,X,H,E,Y,ee,z,I,w,C,q,J,j=!1){const Te=(xe,de,Fe,Ve,ke)=>{try{if(ke&&(xe=C+xe),!w||!Array.isArray(w.dimensionList)||!Array.isArray(O))return;xe=xe==null?0:Number(xe),de=de==null?0:Number(de),Fe=Fe==null?0:Number(Fe),C=ja(Math.round(xe),0,Math.max(0,de)),I=typeof I=="number"?I:0;const Be=C,at=Be+I;let it=w.dimensionList.slice(Be,at);const ga=it[0]==se.TornadoDefaultEntry;let Ha=JSON.parse(JSON.stringify(O||[]));Ha=Ha.filter(Oe=>ga?!0:it.includes(Oe.legend.split(" - ")[1]));const Pa=Y?.left??0,Fi=Y?.top??0,We=Number(ee)||0,Xe=Number(M)||0,st=Number(Fe)||0,Ke=de===0?1:de;if(j){const Oe=Fi+(Xe-st)*(de===0?0:C)/Ke;Ve&&typeof Ve.attr=="function"&&Ve.attr("y",Oe)}else{const Oe=Pa+(We-st)*(de===0?0:C)/Ke;Ve&&typeof Ve.attr=="function"&&Ve.attr("x",Oe)}J(it,Ha,I)}catch(Be){typeof Ae=="function"&&Ae("ColumnChart","updateFromScrollPosition",Be)}};if(z){const xe=X-Y.top-Y.bottom,de=Math.max(0,R.length-I),Fe=X-8;E.append("rect").attr("id","scrollbarTrack").attr("x",j?H-8:Y.left).attr("y",j?Y.top:Fe).attr("width",j?8:ee).attr("height",j?xe:8).attr("fill","#ccc");const Ve=(j?xe:ee)*I/w.dimensionList.length,ke=E.append("rect").attr("x",j?H-8:Y.left).attr("y",j?Y.top:Fe).attr("width",j?8:Ve).attr("height",j?Ve:8).attr("fill","#999").style("cursor",j?"ns-resize":"ew-resize");ke.call(v.drag().on("drag",Be=>{if(j){const it=(ja(Be.y,Y.top,Y.top+xe-Ve)-Y.top)/(xe-Ve)*(de||1);Te(it,de,Ve,ke,!1),ke.attr("y",Y.top+(xe-Ve)*(de===0?0:C)/(de===0?1:de))}else{const it=(ja(Be.x,Y.left,Y.left+ee-Ve)-Y.left)/(ee-Ve)*(de||1);Te(it,de,Ve,ke,!1),ke.attr("x",Y.left+(ee-Ve)*(de===0?0:C)/(de===0?1:de))}})),E.on("wheel",Be=>{Be.preventDefault();const it=(Math.abs(Be.deltaX)>Math.abs(Be.deltaY)?Be.deltaX:Be.deltaY)>0?1:-1;if(Te(it,de,Ve,ke,!0),j){const ga=Y.top+(xe-Ve)*(de===0?0:C)/(de===0?1:de);ke.attr("y",ga)}else{const ga=Y.left+(ee-Ve)*(de===0?0:C)/(de===0?1:de);ke.attr("x",ga)}})}else E.on("wheel",null);Te(0,0,0,null,!0)}const te=()=>{Pe(),Ee(),na(e,y,$,M,G,re,me,a,ye.yMaxLeft,Le,L,t,h,ne,f,T),Ce();const O=le(ze);Ra(O??[],T,a,null,D,xt,[],[],e,L,k,h,G,Le,M,p,i,x,T,f,c,u,g,u)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:p,style:{width:"100%",height:"100%"}})})},$r=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l})=>{const s=crypto.randomUUID();let p=0;const f=se.DotPlot,L=Me.useRef(),u=Lt(r.ChartData,r.DimensionList),S=r.DimensionList,b=!0,_=!1;let A=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,R=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,g,B,U,W,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y=[],T=0,a=2,m=!1,N=[];const re=!1;let K={dimensionList:S,chartType:f,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{me()}catch(Ce){Ae("StackStackHorizontalBarchart","createDotPlot",Ce)}},[e]);const me=()=>{({formatOptions:e,svg:Q,width:be,height:pe}=St(L,e)),Le(),{maxNumberForPrimaryAxis:ne,maxNumberForSecondaryAxis:ae}=Et(e,K.yMinLeft,K.yMaxLeft,K.yMinRight,K.yMaxRight),{margin:g,yLabel:B,xLabel:U,yTitle:W,xTitle:P,dimensionHeightWidthArray:D,chartTitleHeight:V,secondaryAxisTitleWidth:$,legendMargin:Z,secondaryYLabel:ce,visibleBars:a,columnWidth:p,scrollbarVisible:m}=Ct(be,pe,ne,ae,K.yMaxLeft,e,K.legendList,K.dimensionList,K.yMaxRight,_,re,t,b,K),fe(g),Mt(Q,be,pe,e),G=Ft(Q,g),vt(G,e,0,ue,ge,f),ze(),ie(),ra(e,G,B,ge,ue,o),wt(e,b,Q,g,U,pe,P,K.chartType,B,ue,ge),Dt(ge,e,0,b,Q,g,W,B),Vt(Q,e,be,V),Pt(pe,Q,D,V,be,Z,e,u,s,0,g,ct.rectangle,f,n),Gt(u,pe,be,Q,g,ue,m,a,K,T,!1,$e,b)},Le=()=>{const Ce=[],ve=[];let F=[],le=-1/0,he=1/0,te=-1/0,O=1/0;u.forEach(X=>{ve.push(X.properties.legendUniqueId),X.data.forEach(H=>{Ce.push(H),le=Math.max(le,H.value),he=Math.min(he,H.value)})}),K.chartData=Ce,K.legendList=ve,K.yMaxLeft=le,K.yMinLeft=he>0?0:he,K.yMaxRight=te,K.yMinRight=O,F=t?ft(e.xAxisLabel.xAxisNumberFormat,K.dimensionList).map(X=>X):K.dimensionList,F=t?ft(e.xAxisLabel.xAxisNumberFormat,K.dimensionList).map(X=>X):K.dimensionList,K.dimensionList.forEach((X,H)=>{K.formattedDimensionListMap.set(X,F[H]),K.formattedDimensionListMap.set(X,F[H])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=K.dimensionList:i=K.dimensionList.slice(T,T+a),e.plotArea.hideZeroValues&&(K.hideZeroValues=!0)},ze=()=>{let Ce=dt(R||K.yMaxLeft,K.yMinLeft,ge,e,K,A,R,b,ue).yAxisLabelArray;K.yMaxLeft=Ce[Ce.length-1],K.yMinLeft=Ce[0],M=v.scaleLinear().domain([K.yMinLeft>=0?A!==void 0&&!Number.isNaN(A)?A:0:K.yMinLeft<0?K.yMinLeft*1.1:K.yMinLeft*.9,K.yMaxLeft<=0?0:R!==void 0&&!Number.isNaN(R)?R:K.yMaxLeft*1.1]).range([0,ue]),k=[ge,0],Se()},Se=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,p]).paddingInner(K.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),h=v.scalePoint().domain(i).range(k).padding(.5)},ie=()=>{De();{let Ce=dt(R||K.yMaxLeft,K.yMinLeft,ge,e,K,A,R,b,ue);o=v.axisBottom(M).tickFormat(ve=>Ze(ve,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-ge:0).tickValues(Ce.autoLabelFlag?void 0:Ce.yAxisLabelArray).ticks(Ce.customTickValue).tickPadding(8).tickSizeOuter(0)}},De=()=>{d=v.axisLeft(h).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*ue*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(i,ge))},ye=Ce=>{Ce.forEach(he=>{he.data.forEach(te=>{te.markerShape=he.properties.markerShape||"Circle",te.markerSize=he.properties.markerSize||6,te.markerColor=he.properties.markerColor||he.properties.color,te.alias=he.properties.alias,te.lineStyle=he.properties.lineStyle,te.lineWidth=he.properties.lineWidth,te.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const ve=v.group(Ce.flatMap(he=>he.data.map(te=>({...te,color:he.properties.color}))),he=>he.dimension),F=G.selectAll(".cleveland-line-group").data(Array.from(ve),([he])=>he);F.enter().append("g").attr("class","cleveland-line-group").append("line").merge(F.select("line")).attr("y1",([he])=>h(he)).attr("y2",([he])=>h(he)).attr("x1",([,he])=>M(Math.min(he[0]?.value??0,he[1]?.value??0))).attr("x2",([,he])=>M(Math.max(he[0]?.value??0,he[1]?.value??0))).attr("stroke",he=>he[1][0].lineColor).attr("stroke-width",he=>he[1][0].lineStyle!=="None"?he[1][0].lineWidth:0).attr("stroke-dasharray",he=>{switch(he[1][0].lineStyle){case pt.dotted:return"1,4";case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",he=>he[1][0].lineStyle===pt.dotted?ya.round:""),F.exit().remove(),Ce.forEach(he=>{let te=G.selectAll(".parentGroup").data([he],Y=>Y.properties.legendUniqueId);te=te.enter().append("g").attr("class","parentGroup").attr("hoverId",(he.properties.alias||he.properties.name||"Legend").replace(/\s+/g,"-")).merge(te);let O=te.selectAll(".column-group").data(he.data,Y=>Y.dimension),X=O.enter().append("g").attr("class","column-group");const H=e.animation.animationEnabled,E=X.append("path").attr("class","cleveland-dot").attr("opacity",H?0:.9);E.merge(O.select("path")).attr("d",Y=>v.symbol().type(Gi(Y.markerShape)).size((Y.markerSize||6)*70)()).attr("transform",Y=>{const ee=M(Y.value),z=h(Y.dimension);return`translate(${ee},${z})`}).attr("fill",Y=>he.properties.color).attr("data-series-id",()=>he.properties.legendUniqueId??he.properties.alias).attr("data-dim-value",Y=>String(Y.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(Y,ee)=>{yt([{key:e.xAxisTitle.xAxisTitleText,value:K.formattedDimensionListMap.get(ee.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:Ze(ee.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ee.alias}],e,Y,he.properties,gt(l,String(ee.dimension??""),{...he.properties,formattedDimensionValue:String(K.formattedDimensionListMap.get(ee.dimension)??ee.dimension??"")}))}).on("mouseout",()=>{v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll(".halo").remove(),ot()}),H&&E.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("opacity",.9),O.exit().remove()}),G.selectAll(".parentGroup").raise()},fe=Ce=>{ue=be-Ce.left-Ce.right,ge=pe-Ce.bottom-Ce.top},$e=(Ce,ve,F)=>{y=ve,i=Ce,a=F,Ue()},Ue=()=>{Se(),De(),na(e,G,U,ge,ue,d,void 0,M,K.yMaxLeft,i,f,t,be,D,p,h),Ye(),ye(y),Ra(y,h,M,void 0,g,xt,[],[],e,f,pe,be,ue,i,ge,s,Q,x,h,p,c,!1,b),Pe()},Ye=()=>{let Ce=At(i,y,re);N=v.stack().keys(K.legendList).offset(v.stackOffsetDiverging)(Ce),y.forEach((F,le)=>F.data.forEach((he,te)=>{he[0]=N[le][te][0],he[1]=N[le][te][1]}));let ve=e.annotation.annotationSetLabelColor;N.forEach((F,le)=>F.forEach(he=>{he.key=F.key,F.color=JSON.parse(JSON.stringify(u[le].properties.color)),he.data.labelPosition=u[le].properties.dataLabelPosition,he.data.labelColor=ve=="2"?JSON.parse(JSON.stringify(u[le].properties.color)):u[le].properties.labelColor,he.hideZero=JSON.parse(JSON.stringify(u[le].properties.hideZeroValues))}))},Pe=()=>{try{const Ce=Number(e.connector?.connectorVisibility);if(!e.connector||Ce===2)return;const ve=[],F=[],le=[];let he;const te=[];if(Ce===1)he=1;else if(Ce===3){const z=Number(e.connector.connectorFollow);z===1?he=Number(e.connector.connectorStepSize):z===2&&((e.connector.connectorExclude||[]).forEach(I=>le.push(I)),he=1)}const O=[],X=[],H=[],E=e.connector?.connectorCustomRange||[];le.forEach(z=>{const I=z.split("-");I.length&&O.push(I[0])});const ee=(N?.[0]||[]).map((z,I)=>({Dimension:z.data.Dimension,Total:z.data.Total,CustomTotal:z.data.Total-(H[I]??0),Index:I}));if(he!=null){for(let z=0;z<ee.length;z++)(he===1||z%he===0&&he!==1)&&ve.push(ee[z]);for(let z=he;z<ee.length;z+=he){const I=Math.min(z+he,ee.length);let w=-1/0;for(let C=z;C<I;C++)ee[C].Total>w&&(w=ee[C].Total);w!==-1/0&&te.push(w)}for(let z=1;z<ve.length;z++)F.push(ve[z])}else{const z=[];(E||[]).forEach(I=>{if(I?.from&&I?.to){const w=ee.some(q=>q.Dimension===I.from),C=ee.some(q=>q.Dimension===I.to);w&&C&&z.push({from:I.from,to:I.to})}}),z.forEach(I=>{const w=ee.findIndex(q=>q.Dimension===I.from),C=ee.findIndex(q=>q.Dimension===I.to);if(w>=0&&C>=0){const q=Math.min(w,C),J=Math.max(w,C);ve.push(ee[q]);let j=ee[q]?.Total??-1/0;for(let Te=q;Te<=J;Te++)ee[Te].Total>j&&(j=ee[Te].Total);j!==-1/0&&te.push(j),F.push(ee[J])}})}G.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Re.white?e.connector.connectorMarkerColor:"none"),Ee(ve,te,F,he,O),we(ve,te,F,he,O)}catch(Ce){console.error(Ce)}},Ee=(Ce,ve,F,le,he)=>{try{G.append("g").selectAll("path").data(Ce).enter().filter((te,O)=>le!=null?O<Ce.length-1:O<Ce.length).append("path").attr("d",(te,O)=>e.total.totalVisibility?`M ${M(te.Total)+50},
260
- ${h(te.Dimension)+h.bandwidth()/2-5}
261
- H ${60+Math.max(M(ve[O]),M(F[O].Total),M(te.Total))}
262
- V ${h(F[O].Dimension)+h.bandwidth()/2+5}
263
- H ${30+M(F[O].Total)}`:`M ${M(te.Total)+30},
264
- ${h(te.Dimension)+h.bandwidth()/2-5}
265
- H ${45+Math.max(M(ve[O]),M(F[O].Total),M(te.Total))}
266
- V ${h(F[O].Dimension)+h.bandwidth()/2+5}
267
- H ${10+M(F[O].Total)}
268
- `).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",te=>he.includes(te.Dimension)||te.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(te){console.error(te)}},we=(Ce,ve,F,le,he)=>{try{let te=e.connector.connectorFontStyle,O=e.connector.connectorNumberFormat,X=ge/30<i.length?Math.round(ge/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(O=".2s"),G.append("g").selectAll("text1").data(Ce).enter().filter((H,E)=>le!=null?E<Ce.length-1:E<Ce.length).append("text").attr("y",(H,E)=>le==null?h(F[E].Dimension)/2+h(H.Dimension)/2+15:le==1?X<6&&h.bandwidth()>40?h(F[E].Dimension)+h.bandwidth()/2+h.bandwidth()/2+13:h(F[E].Dimension)+h.bandwidth()/2+h.bandwidth()/2+7:h(F[E].Dimension)+h.bandwidth()/2+h.bandwidth()/2*le+12).attr("x",(H,E)=>e.total.totalVisibility?70+Math.max(M(ve[E]),M(F[E].Total),M(H.Total)):50+Math.max(M(ve[E]),M(F[E].Total),M(H.Total))).text((H,E)=>(H.CustomTotal==0&&F[E].CustomTotal!=0&&(H.CustomTotal=1),Ai(F[E].Total,H.Total,parseInt(e.connector.connectorDecimalPrecision),O,parseInt(H.Dimension),parseInt(F[E].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",te.includes("Italic")?"Italic":"").style("text-decoration",te.includes("Underline")?"Underline":"").style("font-weight",te.includes("Bold")?"Bold":"").style("visibility",H=>he.includes(H.Dimension)||H.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(te){console.error(te)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:L,id:s,style:{width:"100%",height:"100%"}})})},ea=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function La(t,e=1){const r=t.replace("#",""),c=parseInt(r.substring(0,2),16),x=parseInt(r.substring(2,4),16),n=parseInt(r.substring(4,6),16);return isNaN(c)||isNaN(x)||isNaN(n)?t:`rgba(${c},${x},${n},${e})`}function ol(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function ma(t,e,r,c=ea){const{ChartData:x,DimensionList:n,LegendList:l}=t,s=n?.length?n:x[0]?.data?.map(f=>f.dimension)??[],p=Number(r.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?Ur(x,s,p,c,l):e==="scatter"?Br(x,c):e==="bubble"?Wr(x,c):Yr(x,s,e,r,p,c)}function Yr(t,e,r,c,x,n){const l=t.map((s,p)=>{const f=s.properties?.color??n[p%n.length],L=s.properties?.opacity??1,u=new Map;s.data?.forEach(R=>u.set(R.dimension,R.value));const S=e.map(R=>u.get(R)??0),b=s.Axis==="Secondary"||s.properties?.axis==="Secondary"?"y1":"y",_=Number(s.properties?.lineWidth??c.plotArea?.lineWidth??2);return r==="line"||r==="area"?{type:"line",label:s.properties.alias,data:S,borderColor:f,backgroundColor:r==="area"?La(f,x*L):La(f,.1),fill:r==="area",borderWidth:_,borderDash:ol(s.properties?.lineStyle),pointRadius:c.marker?.markerVisibility?Number(c.marker?.markerSize??4):3,tension:Number(c.cjsOptions?.cjsTension??.4),yAxisID:b}:r==="radar"?{label:s.properties.alias,data:S,borderColor:f,backgroundColor:La(f,x*L),fill:!0,borderWidth:_,pointRadius:c.marker?.markerVisibility?Number(c.marker?.markerSize??4):3}:{type:"bar",label:s.properties.alias,data:S,backgroundColor:La(f,x*L),borderColor:f,borderWidth:Number(s.properties?.stackBorderWidth??0),borderRadius:Number(c.cjsOptions?.cjsBorderRadius??c.plotArea?.cornerRadius??0),yAxisID:b}});return{labels:e,datasets:l}}function Ur(t,e,r,c,x){const l=(t.length?t:[]).map(s=>{const p=e.map(L=>s.data?.find(S=>S.dimension===L)?.value??0),f=e.map((L,u)=>{const S=x?.[u]?.color;return La(S??c[u%c.length],r)});return{label:s.properties.alias,data:p,backgroundColor:f,borderColor:f.map(L=>L.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:l}}function Br(t,e){return{datasets:t.map((c,x)=>{const n=c.properties?.color??e[x%e.length],l=c.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||x,y:s.value??0}))??[];return{label:c.properties.alias,data:l,backgroundColor:La(n,.7),borderColor:n,pointRadius:5}})}}function Wr(t,e){return{datasets:t.map((c,x)=>{const n=c.properties?.color??e[x%e.length],l=c.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||x,y:s.value??0,r:Number(s.markerSize??c.properties?.markerSize??8)}))??[];return{label:c.properties.alias,data:l,backgroundColor:La(n,.6),borderColor:n}})}}function ni(t,e,r,c=ea){const{ChartData:x,DimensionList:n}=t,l=n?.length?n:x[0]?.data?.map(L=>L.dimension)??[],s=new Map;l.forEach(L=>{const u=x.reduce((S,b)=>{const _=b.data?.find(A=>A.dimension===L);return S+Math.abs(_?.value??0)},0);s.set(L,u)});const p=Number(r.plotArea?.fillOpacity??.8),f=x.map((L,u)=>{const S=L.properties?.color??c[u%c.length],b=L.properties?.opacity??1,_=new Map;L.data?.forEach(g=>_.set(g.dimension,g.value));const A=l.map(g=>{const B=_.get(g)??0,U=s.get(g)??0;return U>0?parseFloat((B/U*100).toFixed(4)):0}),R=Number(L.properties?.lineWidth??r.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:L.properties.alias,data:A,borderColor:S,backgroundColor:e==="area"?La(S,p*b):La(S,.1),fill:e==="area",borderWidth:R,borderDash:ol(L.properties?.lineStyle),pointRadius:r.marker?.markerVisibility?Number(r.marker?.markerSize??4):3,tension:Number(r.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:L.properties.alias,data:A,backgroundColor:La(S,p*b),borderColor:S,borderWidth:Number(L.properties?.stackBorderWidth??0),borderRadius:Number(r.cjsOptions?.cjsBorderRadius??r.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:l,datasets:f}}function Wa(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function si(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function Hr(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function Gr(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function cl(t,e,r){const c=parseInt(r??"0",10);return e==="Thousands"?(t/1e3).toFixed(c)+"K":e==="Millions"?(t/1e6).toFixed(c)+"M":e==="Billions"?(t/1e9).toFixed(c)+"B":t.toFixed(c)}function _r(t,e){return t.find(r=>r.alias==e)}function Kt(t,e,r=!1,c,x){const n=e==="pie"||e==="doughnut"||e==="polarArea",l=e==="horizontalBar";let s=0;const p=300,f=t.plotArea?.gridLinesColor??"#e0e0e0",L=t.legends?.legendFontColor??"#333333",u={responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!1},legend:{display:t.legends?.legendVisibility!==!1&&t.legends?.legendPosition!=="None",position:Gr(t.legends?.legendPosition),labels:{color:L,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??tt,style:Wa(t.legends?.legendFontStyle),weight:si(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,b,_){if(c){const A=new Date().getTime();if(A-s<p){const g=_r(x,b.text);g&&c(g),s=0}else s=A}}},tooltip:{enabled:t.toolTip?.toolTipVisibility!==!1,backgroundColor:t.toolTip?.toolTipTheme==="Dark"?"#222222":"#ffffff",titleColor:t.toolTip?.toolTipTheme==="Dark"?"#ffffff":"#333333",bodyColor:t.toolTip?.toolTipTheme==="Dark"?"#cccccc":"#555555",borderColor:f,borderWidth:1,padding:10,callbacks:{label(S){const b=typeof S.raw=="number"?S.raw:S.raw?.y??0,_=Ze(b,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${_}`}}},datalabels:jr(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:Hr(t.animation?.animationEffect)}:!1};if(!n){const S={display:!0,title:{display:t.xAxisTitle?.xAxisTitleVisibility!==!1,text:t.xAxisTitle?.xAxisTitleText??"Dimension",color:t.xAxisTitle?.xAxisTitleColor??"#000000",font:{size:parseInt(t.xAxisTitle?.xAxisTitleFontSize??"11",10),family:t.xAxisTitle?.xAxisTitleFontFamily??tt,style:Wa(t.xAxisTitle?.xAxisTitleFontStyle)}},ticks:{display:t.xAxisLabel?.xAxisLabelVisibility!==!1,color:t.xAxisLabel?.xAxisLabelColor??"#000000",font:{size:parseInt(t.xAxisLabel?.xAxisLabelFontSize??"11",10),family:t.xAxisLabel?.xAxisLabelFontFamily??tt,style:Wa(t.xAxisLabel?.xAxisLabelFontStyle),weight:si(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:f},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")}},b={display:!0,position:"left",title:{display:t.yAxisTitle?.yAxisTitleVisibility!==!1,text:t.yAxisTitle?.yAxisTitleText??"Measure",color:t.yAxisTitle?.yAxisTitleColor??"#000000",font:{size:parseInt(t.yAxisTitle?.yAxisTitleFontSize??"11",10),family:t.yAxisTitle?.yAxisTitleFontFamily??tt,style:Wa(t.yAxisTitle?.yAxisTitleFontStyle)}},ticks:{display:t.yAxisLabel?.yAxisLabelVisibility!==!1,color:t.yAxisLabel?.yAxisLabelColor??"#000000",font:{size:parseInt(t.yAxisLabel?.yAxisLabelFontSize??"11",10),family:t.yAxisLabel?.yAxisLabelFontFamily??tt,style:Wa(t.yAxisLabel?.yAxisLabelFontStyle),weight:si(t.yAxisLabel?.yAxisLabelFontStyle)},callback(A){return cl(A,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesHorizontal!==!1,color:f},border:{color:t.yAxisLabel?.yAxisColor??"#cccccc",width:parseFloat(t.yAxisLabel?.yAxisWidth??"0.5")}};l?(u.scales={x:{...b,position:"bottom"},y:{...S,position:"left",reverse:!0}},u.scales.x.title&&(u.scales.x.title.text=t.yAxisTitle?.yAxisTitleText??"Measure"),u.scales.y.title&&(u.scales.y.title.text=t.xAxisTitle?.xAxisTitleText??"Dimension")):u.scales={x:S,y:b},r&&(u.scales.y1={display:!0,position:"right",title:{display:t.secondaryYAxisTitle?.secondaryYAxisTitleVisibility!==!1,text:t.secondaryYAxisTitle?.secondaryYAxisTitleText??"",color:t.secondaryYAxisTitle?.secondaryYAxisTitleColor??"#000000",font:{size:parseInt(t.secondaryYAxisTitle?.secondaryYAxisTitleFontSize??"11",10),family:t.secondaryYAxisTitle?.secondaryYAxisTitleFontFamily??tt}},ticks:{display:t.secondaryYAxisLabel?.secondaryYAxisLabelVisibility!==!1,color:t.secondaryYAxisLabel?.secondaryYAxisLabelColor??"#000000",font:{size:parseInt(t.secondaryYAxisLabel?.secondaryYAxisLabelFontSize??"11",10),family:t.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily??tt,style:Wa(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:si(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(A){return cl(A,t.secondaryYAxisLabel?.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel?.secondaryYAxisLabelDecimalPrecision)}},grid:{drawOnChartArea:!1},border:{color:t.secondaryYAxisLabel?.secondaryYAxisColor??"#000000",width:parseFloat(t.secondaryYAxisLabel?.secondaryYAxisWidth??"0.5")}}),e.toLowerCase().includes("stack")&&(u.scales?.x&&(u.scales.x.stacked=!0),u.scales?.y&&(u.scales.y.stacked=!0))}return u}function dl(t){if(typeof t=="number")return t;if(t!==null&&typeof t=="object"){if(typeof t.y=="number")return t.y;if(typeof t.x=="number")return t.x}return parseFloat(t)||0}function jr(t,e="bar"){const r=t.annotation,c=e==="pie"||e==="doughnut"||e==="polarArea",x=e==="horizontalBar",n=r?.annotationVisibility??"5";if(n==="5"||!n)return{display:!1};const l=r?.annotationPosition??"1",s=r?.annotationHideZeroValues!==!1,p=parseInt(r?.annotationFontSize??"9",10)||9,f=r?.annotationFontFamily??tt,L=Wa(r?.annotationFontStyle),u=si(r?.annotationFontStyle),S=r?.annotationColor??"#000000",b=r?.annotationSetLabelColor==="2",_=r?.annotationDecimalPrecision??"2",A=r?.annotationNumberFormat??",",R=r?.annotationDisplayUnits??"None";function g(D){const V=D.dataset?.data?.length??0,$=D.dataIndex??0;switch(n){case"1":return!0;case"2":return $===0;case"3":return $===V-1;case"4":return $===0||$===V-1;default:return!1}}function B(D){const V=D.dataset?.data?.[D.dataIndex];return dl(V)}function U(D){if(c)return l==="2"?"center":"end";const V=B(D);switch(l){case"2":return"center";case"3":return V<0?"end":"start";case"1":return V>0?"end":"start";case"4":default:return V>0?"end":"start"}}function W(D){if(c)return l==="2"?"center":"end";const V=B(D);if(x)switch(l){case"2":return"center";case"3":return"right";case"1":case"4":default:return V<0?"left":"right"}switch(l){case"2":return"center";case"3":return V>0?"top":"bottom";case"1":case"4":default:return V<0?"bottom":"top"}}function P(D,V){const $=dl(D);if(s&&$===0)return null;const Z=Ze($,R,A,_);if(c){const ce=V?.chart?.data?.labels?.[V.dataIndex]??"";return ce?`${ce}
269
- ${Z}`:Z}return Z}return{display:g,anchor:U,align:W,offset:c?l==="2"?0:8:l==="2"?0:4,color:b?D=>{const V=D.dataset?.backgroundColor,$=D.dataset?.borderColor,Z=Array.isArray(V)?V[D.dataIndex]:V;return typeof Z=="string"&&Z?Z:typeof $=="string"&&$?$:S}:S,font:{size:p,family:f,style:L,weight:u},formatter:P,clip:!1}}kt.Chart.register(kt.BarController,kt.LineController,kt.PieController,kt.DoughnutController,kt.ScatterController,kt.BubbleController,kt.RadarController,kt.PolarAreaController,kt.CategoryScale,kt.LinearScale,kt.RadialLinearScale,kt.PointElement,kt.BarElement,kt.LineElement,kt.ArcElement,kt.Title,kt.Tooltip,kt.Legend,kt.Filler,fl);const Qt=({chartType:t,data:e,options:r,formatOptions:c,clientWidth:x,clientHeight:n,className:l,isChartStacked:s})=>{const p=Me.useRef(null),f=Me.useRef(null),L=Me.useRef(!1);Me.useEffect(()=>{if(p.current)return f.current?.destroy(),f.current=new kt.Chart(p.current,{type:t,data:e,options:r}),L.current=!0,()=>{f.current?.destroy(),f.current=null}},[t,s]),Me.useEffect(()=>{if(L.current){L.current=!1;return}const B=f.current;B&&(B.data=e,B.options=r,B.update())},[e,r]);const u=c.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(c.chartTitle?.chartTitleFontStyle)?c.chartTitle.chartTitleFontStyle:[],b=c.chartTitle?.chartTitleColor&&c.chartTitle.chartTitleColor!=="#ffffff"&&c.chartTitle.chartTitleColor!=="#FFFFFF00"?c.chartTitle.chartTitleColor:"rgba(119,119,119)",_=c.chartTitle?.chartTitleFontSize?`${c.chartTitle.chartTitleFontSize}px`:"16px",A=c.chartTitle?.dynamicTitleText||c.chartTitle?.chartTitleText||"",R=c.chartTitle?.chartTitleHTML||A,g=c.chartTitle?.chartTitleVisibility!==!1;return Ge.jsxs("div",{className:l,style:{width:"100%",height:"100%",backgroundColor:u,position:"relative",display:"flex",flexDirection:"column"},children:[g&&A&&Ge.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:c.chartTitle?.chartTitleText,style:{color:b,fontSize:_,fontFamily:c.chartTitle?.chartTitleFontFamily,fontStyle:S.includes("Italic")?"italic":"normal",fontWeight:S.includes("Bold")?"bold":"normal",textDecoration:S.includes("Underline")?"underline":"none",whiteSpace:"pre",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"1.3em",userSelect:"none",padding:"2px 4px",flexShrink:0},dangerouslySetInnerHTML:{__html:R}}),Ge.jsx("div",{style:{flex:1,minHeight:0},children:Ge.jsx("canvas",{ref:p,style:{width:"100%",height:"100%"}})})]})},yl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"bar",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"bar",p,l,s);return x&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"bar",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},Jr=t=>Ge.jsx(yl,{...t,isChartStacked:!0}),ul=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n=ea,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"bar",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"horizontalBar",p,l,s);return u.indexAxis="y",x&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"bar",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},Zr=t=>Ge.jsx(ul,{...t,isChartStacked:!0}),hl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n=ea,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"line",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"line",p,l,s);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"line",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},Xr=t=>Ge.jsx(hl,{...t,isChartStacked:!0}),xl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"area",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"area",p,l,s);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"line",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},qr=t=>Ge.jsx(xl,{...t,isChartStacked:!0}),Kr=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.LegendList??[],[t]),s=Me.useMemo(()=>ma(t,"pie",e,x),[t,e,x]),p=Me.useMemo(()=>Kt(e,"pie",!1,n,l),[e]);return Ge.jsx(Qt,{chartType:"pie",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},Qr=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.LegendList??[],[t]),s=Me.useMemo(()=>ma(t,"doughnut",e,x),[t,e,x]),p=Me.useMemo(()=>{const f=Kt(e,"doughnut",!1,n,l),L=e.plotArea?.innerRadius;return L!=null&&(f.cutout=`${L}%`),f},[e]);return Ge.jsx(Qt,{chartType:"doughnut",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},Or=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea})=>{const n=Me.useMemo(()=>ma(t,"scatter",e,x),[t,e,x]),l=Me.useMemo(()=>Kt(e,"scatter",!1),[e]);return Ge.jsx(Qt,{chartType:"scatter",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:c})},en=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(f=>f.properties),[t]),s=Me.useMemo(()=>ma(t,"bubble",e,x),[t,e,x]),p=Me.useMemo(()=>Kt(e,"bubble",!1,n,l),[e]);return Ge.jsx(Qt,{chartType:"bubble",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},tn=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea})=>{const n=Me.useMemo(()=>ma(t,"radar",e,x),[t,e,x]),l=Me.useMemo(()=>{const s=Kt(e,"radar",!1);return delete s.scales,s.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0"},ticks:{color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt}},pointLabels:{color:e.xAxisLabel?.xAxisLabelColor??"#333333",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"11",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt}}}},s},[e]);return Ge.jsx(Qt,{chartType:"radar",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:c})},an=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.LegendList??[],[t]),s=Me.useMemo(()=>ma(t,"polarArea",e,x),[t,e,x]),p=Me.useMemo(()=>{const f=Kt(e,"polarArea",!1,n,l);delete f.scales;const L=e.xAxisLabel?.xAxisLabelFontStyle,u=Array.isArray(L)?L.includes("Italic")||L.includes("italic"):!1;return f.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0",display:e.plotArea?.gridLinesVisibility!==!1},ticks:{display:e.xAxisLabel?.xAxisLabelVisibility!==!1,color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt,style:u?"italic":"normal"}}}},f},[e]);return Ge.jsx(Qt,{chartType:"polarArea",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},ln=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"bar",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"bar",!1,n,l);return L.scales??={},L.scales.x??={},L.scales.y??={},L.scales.x.stacked=!0,L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"bar",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})},rn=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"horizontalBar",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"horizontalBar",!1,n,l);return L.indexAxis="y",L.scales??={},L.scales.x??={},L.scales.y??={},L.scales.x.stacked=!0,L.scales.y.stacked=!0,L.scales.x.min=p?-100:0,L.scales.x.max=100,L.scales.x.ticks={...L.scales.x.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"bar",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})},nn=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"line",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"line",!1,n,l);return L.scales??={},L.scales.y??={},L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"line",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})},sn=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"area",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"area",!1,n,l);return L.scales??={},L.scales.y??={},L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"line",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})};Je.AreaChart=br,Je.BubbleChart=Ir,Je.CJSAreaChart=xl,Je.CJSBubbleChart=en,Je.CJSColumnChart=yl,Je.CJSDonutChart=Qr,Je.CJSHorizontalBarChart=ul,Je.CJSLineChart=hl,Je.CJSNormalizedStackAreaChart=sn,Je.CJSNormalizedStackColumnChart=ln,Je.CJSNormalizedStackHorizontalBarChart=rn,Je.CJSNormalizedStackLineChart=nn,Je.CJSPieChart=Kr,Je.CJSPolarAreaChart=an,Je.CJSRadarChart=tn,Je.CJSScatterChart=Or,Je.CJSStackAreaChart=qr,Je.CJSStackColumnChart=Jr,Je.CJSStackHorizontalBarChart=Zr,Je.CJSStackLineChart=Xr,Je.CJS_DEFAULT_COLORS=ea,Je.ChartJSWrapper=Qt,Je.ColumnChart=tr,Je.ColumnHistogramChart=sr,Je.CustomColumnChart=ar,Je.DonutChart=fr,Je.DotPlot=$r,Je.HorizontalBarChart=yr,Je.HorizontalHistogramChart=pr,Je.LayeredColumnChart=ir,Je.LayeredHorizontalBarChart=xr,Je.LineChart=or,Je.Maps=Nr,Je.NormalizedStackAreaChart=Ar,Je.NormalizedStackColumnChart=rr,Je.NormalizedStackHorizontalBarChart=hr,Je.NormalizedStackLineChart=dr,Je.OrganizationChart=Pr,Je.PieChart=mr,Je.PieofPie=vr,Je.ProgressChart=Cr,Je.PyramidChart=kr,Je.RadialBarChart=Sr,Je.SankeyChart=Dr,Je.ScatterChart=Er,Je.Speedometer=Mr,Je.StackAreaChart=gr,Je.StackColumnChart=lr,Je.StackHorizontalBarChart=ur,Je.StackLineChart=cr,Je.TornadoChart=zr,Je.Treemap=Tr,Je.VennChart=wr,Je.WaterfallChart=Rr,Je.WordCloud=Fr,Je.hexToRgba=La,Je.mapFormatOptionsToChartJS=Kt,Je.transformToChartJSData=ma,Je.transformToNormalizedChartJSData=ni,Object.defineProperty(Je,Symbol.toStringTag,{value:"Module"})}));
259
+ </div>`}catch(N){return me(da,"drawOrganizationChart.buttonContent",N),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,f)=>20).duration(0).setActiveNodeCentered(!1).data(s).compact(!1).expandAll().fit(!1).render()}catch(d){me(da,"drawOrganizationChart",d)}},M=s=>{try{let d;if(s.data.styleObject)return c.nodes.percentageVisibility?d=s.data.styleObject.nodeHeight*10+10:d=s.data.styleObject.nodeHeight*10,d}catch(d){me(da,"calculateNodeHeight",d)}},h=(s,d)=>{try{let i={};d?i=s.data:i=s;let y,T;if(c.nodes.nodesLabelVisibility?T=50:T=20,i.styleObject)return c.nodes.nodesLabelOverflow?i.id==0?y=i.styleObject.nodeWidth*10+50:y=i.styleObject.nodeWidth*10:y=T+k(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,y}catch(i){me(da,"calculateNodeWidth",i)}},k=s=>{try{let d=s.split("-");return d[d.length-1]}catch(d){me(da,"getLabelText",d)}};return Ge.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[Ge.jsx("svg",{id:x,className:"chartSVG",style:{width:"100%",height:"100%"},ref:l}),Ge.jsx("div",{id:`floating-div${x}`,className:"floatingDiv",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"auto"},children:Ge.jsx("svg",{id:`floating-${x}`,className:"chartSVG",ref:r})})]})},Ur=({data:t,formatOptions:e,chartId:n,addLocalFilterFromLib:o,onElementClick:x,vfxPickModeActive:l,tooltipFormatter:r})=>{const c=Ce.useRef(x);c.current=x;const p=Ce.useRef(l);p.current=l;const m=new Map((t.ChartData??[]).map((Le,Ue)=>[Le.legend,Ue]));let L=t.LegendList;const u=Ce.useRef();let S,g=[0,0];const W=le.BubbleChart;let A,E,b=40,U=Jt,Y,H,I,D,w=[],z=[],K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a;Ce.useEffect(()=>{f()},[e,t,n]);const f=()=>{({chartFormatOptions:S,svg:D,width:A,height:E}=Kt(u,e)),g=Ha(S,L??[],"alias"),t=Ee(t),Z(),{longestMeasure:s,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=tl(S,se,te),{longestDimension:X,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=al(S,K,ye),{margins:U,yLabel:xe,xLabel:ge,yTitle:pe,xTitle:he,chartTitleHeight:b,legendMargin:O,innerHeight:Y,innerWidth:H}=el(A,E,s,S,X,g),qt(u,A,E,S),I=oa(D,U),kt(I,e,0,H,Y,W),Xt(u,b,A,S),fe(),Re(),Te(),il(e,!1,D,U,ge,E,he,"Bubble",xe,H,Y),ll(Y,e,0,!1,D,U,pe,xe),Me(),J(),N(),cl(D,S.legends.legendPosition,S,E,A,U,Y,he,ge,t.length)},N=()=>{try{let Le=5,Ue=30,ve={minimumValue:se,maximumValue:te};const Pe=I.append("g").attr("class","circles").attr("class","parentGroup"),Ye=S.animation.animationEnabled,We=Pe.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",be=>be.legendName.replace(/ /g,"-")).attr("fill",be=>be.legendColor!==Ie.white?be.legendColor:"none").append("path").attr("class","path").attr("id",function(be,ze){v.select(this).attr("d",v.symbol().type(v.symbolCircle).size(ne(Le,Ue,ve,be.measure,10)*rt(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(be){return`translate(${T(be.dimension)}, ${a(be.measure)})`}).attr(lt.SeriesId,be=>`${m.get(be.legendName)}_${be.legendName}`).attr(lt.DimValue,be=>String(be.dimension)).attr("opacity",Ye?0:S.plotArea.fillOpacity).style("visibility",(be,ze)=>be.dimension[0]===0||be.measure===0&&S.plotArea.hideZeroValues||be.dimension<k||be.dimension>h||be.measure<y||be.measure>i?"hidden":"visible").on("click",vt(p,c,(be,ze)=>({seriesId:`${m.get(ze.legendName)}_${ze.legendName}`,dimValue:String(ze.dimension),legendUniqueId:`${m.get(ze.legendName)}_${ze.legendName}`,seriesDisplayName:ze.legendName}))).on("mousemove",(be,ze)=>{ut([{key:S.xAxisTitle.xAxisTitleText,value:Ke(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(ze.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:Ke(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(ze.measure)},{key:"Legend",value:ze.legendName}],S,be,{alias:ze.legendName},At(r,String(ze.dimension),{alias:ze.legendName}))}).on("mouseout",()=>{ot()});Ye&&We.transition().duration(S.animation.animationDuration).ease(et[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(Le){me("BubbleChart","initCircles",Le)}};function ne(Le,Ue,ve,Pe,Ye){try{if(Pe==null)return Ye;var We=ve.minimumValue,be=ve.maximumValue,ze=Ue*Ue*2*Math.PI,ke=Le*Le*2*Math.PI,Se=Ye;if(We==be)Se=Ue;else{var oe=Pe,$=(oe-We)/(be-We)*(ze-ke)+ke;$<ke&&($=ke),Se=Math.sqrt($/(Math.PI*2))}return Se}catch(R){return me("BubbleChart","getBubbleSize",R),Ye}}const Z=()=>{try{w=[],z=[],se=void 0,te=void 0,K=void 0,ye=void 0,t.forEach(Le=>{Le.measureName&&(w.push(Le.measure),(Le.measure<se||se===void 0)&&(se=Le.measure),(Le.measure>te||te===void 0)&&(te=Le.measure)),Le.dimensionName&&(z.push(Le.dimension),(Le.dimension<K||K===void 0)&&(K=Le.dimension),(Le.dimension>ye||ye===void 0)&&(ye=Le.dimension))})}catch(Le){me("BubbleChart","iterateOverChartData",Le)}},fe=()=>{try{let Le=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):K>0?0:K*1.1,Ue=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):ye*1.1,ve=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):se>0?0:se*1.1,Pe=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):te*1.1;T=v.scaleLinear().domain([Le,Ue]).range([0,H]),a=v.scaleLinear().domain([ve,Pe]).range([Y,0])}catch(Le){me("BubbleChart","initScale",Le)}},Re=()=>{try{let{xAxisLabelArray:Le,customTickValue:Ue,autoLabelFlag:ve}=Ti(ye,K,H,e,k,h,H,!1);const Pe=v.axisBottom(T).tickFormat(Ke(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(sa(e,Y,0,!0)).tickValues(Le.length>0?Le:null).ticks(Ue).tickPadding(8).tickSizeOuter(0);sl(I,S,0,ge,Pe,Y,H,U,a)}catch(Le){me("BubbleChart","drawXAxis",Le)}},Te=()=>{try{let{yAxisLabelArray:Le,customTickValue:Ue}=rl(te,se,Y,e,y,i);const ve=v.axisLeft(a).tickFormat(Ke(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(zt(e,H)).tickValues(Le.length>0?Le:null).ticks(Ue).tickPadding(8).tickSizeOuter(0);nl(I,S,0,xe,ve,Y)}catch(Le){me("BubbleChart","drawYAxis",Le)}},Me=()=>{try{if(S.plotArea.xCoordinate!=Ht.None){let Le;switch(S.plotArea.xCoordinate){case Ht.Mean:Le=v.mean(t,Ue=>Ue.dimension);break;case Ht.Median:Le=v.median(t,Ue=>Ue.dimension);break;case Ht.Custom:Le=rt(S.plotArea.xscaleposition);break}I.append("line").attr("x1",T(Le)).attr("y1",0).attr("x2",T(Le)).attr("y2",Y).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Ht.None){let Le;switch(S.plotArea.yCoordinate){case Ht.Mean:Le=v.mean(t,Ue=>Ue.measure);break;case Ht.Median:Le=v.median(t,Ue=>Ue.measure);break;case Ht.Custom:Le=rt(S.plotArea.yscaleposition);break}I.append("line").attr("x1",0).attr("y1",a(Le)).attr("x2",H).attr("y2",a(Le)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(Le){me("BubbleChart","drawReferenceLines",Le)}},J=()=>{try{let Le=L?.map(Ue=>{let ve={...Ue,legendFontStyle:Ue.fontStyle,fontSize:Ue.fontSize+"px",legendFontFamily:Ue.fontFamily};return{legend:Ue.name,properties:ve,data:{}}});Wa(S,D,Le||[],A,E,g[0],b,n,U,ct.circle,!1,o)}catch(Le){me("BubbleChart","initLegendList",Le)}},Ee=Le=>{try{if(!Le||!Le.ChartData||!Le.ChartData[0])return[];const Ue=[];return Le.ChartData.forEach(Pe=>{Pe.data.forEach(Ye=>{Ue.push({dimension:parseFloat(Ye.dimension),dimensionName:Pe.legend??"Dimension",measure:Ye.value,measureName:Pe.legend??"Measure",legendName:Pe.legend,legendColor:Pe.properties?.color??Ie.black,tooltip:""})})}),Ue}catch(Ue){return console.error("BubbleChart - Data conversion failed",Ue),[]}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:n,style:{width:"100%",height:"100%"}})})},ga="ScatterChart.tsx",Br=({data:t,formatOptions:e,chartId:n,onElementClick:o,vfxPickModeActive:x,tooltipFormatter:l})=>{const r=Ce.useRef(o);r.current=o;const c=Ce.useRef(x);c.current=x;const p=t.ColorElements??[],m=t.ShapeElements??[],L=new Map(p.map((be,ze)=>[be.name,ze]));let u=[];const S=Ce.useRef();let g,W=[0,0],A,E,b=40,U=Jt,Y,H,I,D,w=Number.POSITIVE_INFINITY,z=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,ye=Number.NEGATIVE_INFINITY,se=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N=new Map,ne=new Map;Ce.useEffect(()=>{Z()},[e,t,n]);const Z=()=>{({chartFormatOptions:g,svg:D,width:A,height:E}=Kt(S,e));let be=[...m,...p];W=Ha(g,be,"alias"),Re(),{longestMeasure:s,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=tl(g,K,ye),{longestDimension:X,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=al(g,w,z),{margins:U,yLabel:xe,xLabel:ge,yTitle:pe,xTitle:he,chartTitleHeight:b,legendMargin:O,innerHeight:Y,innerWidth:H}=el(A,E,s,g,X,W),qt(S,A,E,g),I=oa(D,U),kt(I,e,0,H,Y,"Scatter",n),Xt(S,b,A,g),Te(),Me(),J(),il(e,!1,D,U,ge,E,he,"Scatter",xe,H,Y),ll(Y,e,0,!1,D,U,pe,xe),Ee(),fe(),Le(),Ue(),cl(D,g.legends.legendPosition,g,E,A,U,Y,he,ge,u.length)},fe=()=>{try{let be=function(oe){return oe=="Square"?v.symbolSquare:oe=="Circle"?v.symbolCircle:oe=="Cross"?v.symbolCross:oe=="Triangle"?v.symbolTriangle:oe=="Star"?v.symbolStar:oe=="Diamond"?v.symbolDiamond:oe=="Wye"?v.symbolWye:v.symbolCircle};const ze=I.append("g").attr("class","circles").attr("class","parentGroup"),ke=g.animation.animationEnabled,Se=ze.append("g").selectAll(".bubbleScatter").data(u).enter().append("g").attr("fill",oe=>oe.color).attr("colorId",oe=>oe.colorName.replace(/ /g,"-")).attr("shapeId",oe=>oe.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(oe,$){v.select(this).attr("d",v.symbol().type(be(oe.shape)).size((oe.sizeValue?f(oe.sizeValue):10)*2*rt(g.plotArea.scatterSizeIndex)))}).attr("transform",function(oe){return`translate(${T(oe.dimension)}, ${a(oe.measure)})`}).attr(lt.SeriesId,oe=>`${L.get(oe.colorName)}_${oe.colorName}`).attr(lt.DimValue,oe=>String(oe.dimension)).attr("opacity",ke?0:g.plotArea.fillOpacity).style("visibility",(oe,$)=>oe.dimension[0]===0||oe.measure===0&&g.plotArea.hideZeroValues||oe.dimension<k||oe.dimension>h||oe.measure<y||oe.measure>i?"hidden":"visible").on("click",vt(c,r,(oe,$)=>({seriesId:`${L.get($.colorName)}_${$.colorName}`,dimValue:String($.dimension),legendUniqueId:`${L.get($.colorName)}_${$.colorName}`,seriesDisplayName:$.colorName}))).on("mousemove",(oe,$)=>{ut([{key:g.xAxisTitle.xAxisTitleText,value:Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)($.dimension)},{key:g.yAxisTitle.yAxisTitleText,value:Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)($.measure)},{key:"Color",value:$.colorName},...$.shapeName?[{key:"Shape",value:$.shapeName}]:[]],g,oe,{alias:$.colorName},At(l,String($.dimension),{alias:$.colorName}))}).on("mouseout",()=>{ot()});ke&&Se.transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",g.plotArea.fillOpacity)}catch(be){me(ga,"initCircles",be)}},Re=()=>{try{let be=function(ze,ke,Se){K=Math.min(K,ze.value),ye=Math.max(ye,ze.value),w=Math.min(w,ze.dimension),z=Math.max(z,ze.dimension),se=Math.min(se,ze.value2??10),te=Math.max(te,ze.value2??10),u.push({dimension:ze.dimension,measure:ze.value,sizeValue:ze.value2,colorName:ke,shapeName:Se,shape:ne.get(Se)||"Circle",color:N.get(ke)||"#6ba2b8ff"})};p.forEach(ze=>{N.set(ze.name,ze.color)}),m.forEach(ze=>{ne.set(ze.name,ze.markerShape)}),t.ChartData.forEach(ze=>{ze.children&&ze.children.length>0&&ze.children.forEach(ke=>{ke.data.forEach(Se=>{be(Se,ze.legend,ke.legend)})}),ze.data&&ze.data.length>0&&ze.data.forEach(ke=>{be(ke,ze.legend)})})}catch(be){me(ga,"iterateOverChartData",be)}},Te=()=>{try{let be=g.yAxisLabel.yAxisIntervalsVisibility&&g.yAxisLabel.yAxisMinText!==""?parseFloat(g.yAxisLabel.yAxisMinText):K>0?0:K*1.1,ze=g.yAxisLabel.yAxisIntervalsVisibility&&g.yAxisLabel.yAxisMaxText!==""?parseFloat(g.yAxisLabel.yAxisMaxText):ye*1.1;a=v.scaleLinear().domain([be,ze]).range([Y,0]),f=v.scaleLinear().domain([se,te]).range([1,10])}catch(be){me(ga,"initScale",be)}},Me=()=>{try{const ze=(parseFloat(e.plotArea.ticksHeight)||100)/100*Y;let{xAxisLabelArray:ke,customTickValue:Se}=Ti(z,w,H,e,k,h,Y,!1);ke.length>0?T=v.scaleLinear().domain([ke[0],ke[ke.length-1]]).range([0,H]):T=v.scaleLinear().domain([k,h]).range([0,H]);const oe=v.axisBottom(T).tickFormat(Ke(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(g.plotArea.gridLinesVisibility&&g.plotArea.gridLinesVertical?g.xAxisLabel.xAxisPosition==="0"?-ze:g.xAxisLabel.xAxisPosition==="1"?ze:0:0).tickValues(ke.length>0?ke:null).ticks(Se).tickPadding(8).tickSizeOuter(0);sl(I,g,0,ge,oe,Y,H,U,a)}catch(be){me(ga,"drawXAxis",be)}},J=()=>{try{const ze=(parseFloat(e.plotArea.ticksWidth)||100)/100*H;let{yAxisLabelArray:ke,customTickValue:Se}=rl(ye,K,Y,e,y,i);const oe=v.axisLeft(a).tickFormat(Ke(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(g.plotArea.gridLinesVisibility&&g.plotArea.gridLinesHorizontal?-ze:0).tickValues(ke.length>0?ke:null).ticks(Se).tickPadding(8).tickSizeOuter(0);nl(I,g,0,xe,oe,Y)}catch(be){me(ga,"drawYAxis",be)}},Ee=()=>{try{if(g.plotArea.xCoordinate!=Ht.None){let be;switch(g.plotArea.xCoordinate){case Ht.Mean:be=v.mean(u,ze=>ze.dimension);break;case Ht.Median:be=v.median(u,ze=>ze.dimension);break;case Ht.Custom:be=rt(g.plotArea.xscaleposition);break}I.append("line").attr("x1",T(be)).attr("y1",0).attr("x2",T(be)).attr("y2",Y).attr("stroke",g.plotArea.refLineBorderColor).attr("stroke-width",g.plotArea.refLineBorderThickness)}if(g.plotArea.yCoordinate!=Ht.None){let be;switch(g.plotArea.yCoordinate){case Ht.Mean:be=v.mean(u,ze=>ze.value);break;case Ht.Median:be=v.median(u,ze=>ze.value);break;case Ht.Custom:be=rt(g.plotArea.yscaleposition);break}I.append("line").attr("x1",0).attr("y1",a(be)).attr("x2",H).attr("y2",a(be)).attr("stroke",g.plotArea.refLineBorderColor).attr("stroke-width",g.plotArea.refLineBorderThickness)}}catch(be){me(ga,"drawReferenceLines",be)}},Le=()=>{try{g.legends.legendAlignment===void 0&&(g.legends.legendAlignment="Top"),g.legends.legendAlignmentTopBottom===void 0&&(g.legends.legendAlignmentTopBottom="Start");let be=g.legends.legendPosition,ze=g.legends.legendAlignment,ke=g.legends.legendAlignmentTopBottom;switch(be){case Je.none:break;case Je.right:ve(p,A-O-30,b+5,O+25,E-b-10);break;case Je.top:ve(p,5,b+5,A-10,30);break;case Je.left:ve(p,5,b+5,O+25,E-b-10);break;case Je.bottom:ve(p,5,E-35,A-10,30);break}}catch(be){me(ga,"drawColors",be)}},Ue=()=>{try{g.legends.legendAlignment===void 0&&(g.legends.legendAlignment=Ea.top),g.legends.legendAlignmentTopBottom===void 0&&(g.legends.legendAlignmentTopBottom=Ra.start);let be=g.legends.legendPosition;if(m.length>0)switch(be){case Je.none:break;case Je.right:Pe(m,A-O-30,E/2+10,O+25,E-b-10);break;case Je.top:Pe(m,A/2+5,b+5,A-10,30);break;case Je.left:Pe(m,5,E/2+10,O+25,E-b-10);break;case Je.bottom:Pe(m,A/2+5,E-35,A-10,30);break}}catch(be){me(ga,"drawShapes",be)}},ve=(be,ze,ke,Se,oe)=>{try{let R=g.legends.legendPosition,ae=g.legends.legendFontStyle,_=D.append("foreignObject").attr("visibility",g.legends.legendVisibility?"visible":"hidden").attr("x",ze).attr("y",ke).attr("width",Se).attr("height",oe).style("user-select","none"),G=(R==Je.top||R==Je.bottom)&&m.length>0?"50%":"100%";var $=_.append("xhtml:div").style("width",G).style("display","flex").style("height",R==Je.top||R==Je.bottom?oe-1+"px":"calc(50% - 5px)").style("border",g.legends.legendBorder?`${g.legends.legendBorderThickness+"px solid"+g.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+n).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",R==Je.top||R==Je.bottom?g.legends.legendAlignmentTopBottom==Ra.start?"flex-Start":g.legends.legendAlignmentTopBottom==Ra.middle?"center":"flex-end":g.legends.legendAlignment==Ea.top?"flex-Start":g.legends.legendAlignment==Ea.middle?"center":"flex-end").style("flex-direction",R==Je.top||R==Je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");be.forEach((Q,ee)=>{let F=$.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("width","fit-content").style("flex-wrap","nowrap").style("white-space","nowrap").style("font-size",g.legends.legendFontSize+"px").style("font-family",g.legends.legendFontFamily).on("mousemove",function(ue){g.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[colorId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(ue){D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[colorId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(R==Je.bottom||R==Je.top)&&F.style("margin-right","16px").style("white-space","nowrap"),F.append("div").style("height","10px").style("width","10px").style("background",Q.color).style("border-radius","1px");let q=g.legends.legendColorMode=="1"?Q.color?Q.color:Ie.black:g.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",q).attr("title",Q.name).style("font-size",g.legends.legendFontSize+"px").style("font-family",g.legends.legendFontFamily).style("font-style",ae.includes(ce.italic)?ce.italic:"").style("text-decoration",ae.includes(ce.underline)?ce.underline:"").style("font-weight",ae.includes(ce.bold)?ce.bold:"").style("white-space","nowrap").html(Q.name)})}catch(R){me(ga,"colorListWithScroll",R)}},Pe=(be,ze,ke,Se,oe)=>{try{let R=g.legends.legendPosition,ae=g.legends.legendFontStyle,_=D.append("foreignObject").attr("visibility",g.legends.legendVisibility?"visible":"hidden").attr("x",ze).attr("y",ke).attr("width",Se).attr("height",oe).style("user-select","none"),G=g.legends.legendPosition==Je.top||g.legends.legendPosition==Je.bottom?"calc(50% - 5px)":"calc(100%)";var $=_.append("xhtml:div").style("width",G).style("display","flex").style("height",R==Je.top||R==Je.bottom?oe-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",g.legends.legendBorder?`${g.legends.legendBorderThickness+"px solid"+g.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+n).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",R==Je.top||R==Je.bottom?g.legends.legendAlignmentTopBottom==Ra.start?"flex-Start":g.legends.legendAlignmentTopBottom==Ra.middle?"center":"flex-end":g.legends.legendAlignment==Ea.top?"flex-Start":g.legends.legendAlignment==Ea.middle?"center":"flex-end").style("flex-direction",R==Je.top||R==Je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");be.forEach((Q,ee)=>{let F=$.append("div").style("width","fit-content").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("mousemove",function(ue){g.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[shapeId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(ue){g.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[shapeId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(R==Je.top||R==Je.bottom)&&F.style("margin-right","16px").style("white-space","nowrap"),Ye(F,Q.markerShape);let q=g.legends.legendColorMode=="1"?Ie.black:g.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",q).attr("title",Q.name).style("font-size",g.legends.legendFontSize+"px").style("font-family",g.legends.legendFontFamily).style("font-style",ae.includes(ce.italic)?ce.italic:"").style("text-decoration",ae.includes(ce.underline)?ce.underline:"").style("font-weight",ae.includes(ce.bold)?ce.bold:"").style("white-space","nowrap").html(Q.name)})}catch(R){me(ga,"shapeListWithScroll",R)}},Ye=(be,ze)=>{try{const Se={none:v.symbolCircle,circle:v.symbolCircle,square:v.symbolSquare,triangle:v.symbolTriangle,cross:v.symbolCross,diamond:v.symbolDiamond,star:v.symbolStar,wye:v.symbolWye}[ze?.toLowerCase()]||v.symbolCircle;be.append("svg").attr("width",14).attr("height",14).append("path").attr("d",v.symbol().type(Se).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(ke){me(ga,"shapesForScatterPlot",ke)}},We=(be="")=>{try{return be.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(ze){me(ga,"getJQuerySelector",ze)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:n,style:{width:"100%",height:"100%"}})})},Wr=({isDateType:t,formatOptions:e,data:n,isAdvancedAnalyticsWaterFall:o=!1,onElementClick:x,vfxPickModeActive:l,tooltipFormatter:r})=>{const c=crypto.randomUUID?.();let p=0,m;const L=le.WaterfallChart,u=Ce.useRef(),S=Ce.useRef(x);S.current=x;const g=Ce.useRef(l);g.current=l;const W=o??!1,A=W?[]:mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!1,U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z=[],fe=[],Re,Te=0;const Me=2;let J={dimensionList:E,chartType:L,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(ae){me("WaterfallChart","createWaterfallChart",ae)}},[e]);const Ee=()=>{({formatOptions:e,svg:d,width:h,height:k}=Ft(u,e)),Le(),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe}=Mt(h,k,he,O,J.yMaxLeft,e,J.legendList,J.dimensionList,J.yMaxRight,U,Y,t),ze(D),St(d,h,k,e),i=wt(d,D),kt(i,e,s,X,M,L,c),ve(),Ye(),Zt(i,e,s,w,f,M),ke(A,k,d,D,X),Dt(e,b,d,D,z,k,ye,J.chartType,w,X,M),Vt(M,e,s,b,d,D,K,w),Gt(d,U,D,e,s,M,X,pe,xe),Nt(d,e,h,te)},Le=()=>{if(W){let ee=R(n);ee=ee.filter(q=>q.up+q.down+q.base!=0),J.dimensionList=ee.map(q=>q.xKey),J.legendList=J.dimensionList,fe=v.stack().keys(["base","dimensionTotal","up","down"])(ee);const F=[];fe.forEach(q=>q.forEach(ue=>F.push(ue[1]))),J.yMaxLeft=v.max(F)??0,J.yMinLeft=v.min(F)??0;return}A.forEach(ee=>{ee.data.forEach(F=>{})}),Z=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?ne=J.dimensionList:ne=J.dimensionList.slice(Te,Te+Me),e.plotArea.hideZeroValues&&(J.hideZeroValues=!0);let ae=W?R(n):oe(),_=JSON.parse(JSON.stringify(ae));ae.forEach(ee=>{if(!ee.Dimension&&(ee.Up<1e-9&&ee.Up!==0||ee.Down<1e-9&&ee.Down!==0)){let F=_.findIndex(q=>q.Legend===ee.Legend);F!==-1&&_.splice(F,1)}}),ae=_,ae.forEach(ee=>ee.dimension?J.legendList.push(ee.dimension):J.legendList.push(ee.legend)),fe=v.stack().keys(["base","dimensionTotal","up","down"])(ae);let G=[],Q=[];fe.forEach(ee=>{ee.key=="base"?ee.opacity=0:ee.opacity=1,ee.forEach(F=>G.push(F)),!Q.includes(ee.dimension)&&ee.dimensionTotal===0&&ee.total===0&&Q.push(ee.dimension)}),J.yMaxLeft=v.max(G,ee=>ee[1]),J.yMinLeft=v.min(G,ee=>ee[1]),e.xAxisLabel.hideZeroValues&&(Q.length>0&&Q.forEach(ee=>{J.legendList=J.legendList.filter(F=>F!==ee)}),J.dimensionList=J.legendList),t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(ee=>ee):J.dimensionList,Ue(ae)},Ue=ae=>{try{let _=[],G=[],Q=[];ae&&ae.forEach((F,q)=>{F.dimension&&(_.push(F.dimension),G.push({dimension:F.dimension,chartDataIndex:q,selfIndex:G.length}))}),t?Q=Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(F=>F):Q=_;let ee=JSON.parse(JSON.stringify(J.legendList));G.forEach((F,q)=>{ee[F.chartDataIndex]=Q[F.selfIndex]}),J.legendList.forEach((F,q)=>{J.formattedDimensionListMap.set(F,ee[q])})}catch(_){throw _}},ve=()=>{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I).yAxisLabelArray;J.yMaxLeft=ae[ae.length-1],J.yMinLeft=ae[0],y=v.scaleLinear().domain([J.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:J.yMinLeft<0?J.yMinLeft*1.1:J.yMinLeft*.9,J.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:J.yMaxLeft*1.1]).range([M,0]),a=[0,X],Pe()},Pe=()=>{p=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(X/J.legendList.length),T=v.scaleBand().domain(J.legendList).range(a).padding(.4)},Ye=()=>{We();{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I);f=v.axisLeft(y).tickFormat(_=>Xe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-X+0:0).tickValues(ae.autoLabelFlag?void 0:ae.yAxisLabelArray).ticks(ae.customTickValue).tickPadding(8).tickSizeOuter(0)}m=v.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,W?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},We=()=>{N=v.axisBottom(T).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.gridLinesVertical?-M:parseFloat(e.plotArea.ticksHeight)*(M/100)*(e.xAxisLabel.xAxisPosition=="1"?1:-1):0).tickSizeOuter(0).tickValues(gt(J.legendList,X,e))},be=ae=>{let _;if(fe.forEach((G,Q)=>G.forEach(ee=>ee.key=G.key)),Re){let G=Z.map(Q=>Q.legend);_=v.stack().keys(G)(Re),_.forEach((Q,ee)=>{_[ee].color=Z[ee].properties.color})}_&&_.forEach(G=>{G.forEach(Q=>{Q.Key=G.key})}),[0,1].forEach(G=>{if(G===1&&(fe=_),fe){let Q=i.selectAll(`.parentGroup-${G}`).data([null]);Q=Q.enter().append("g").attr("class",`parentGroup parentGroup-${G}`).merge(Q);let ee=Q.selectAll(`.bar-group-${G}`).data(fe);ee=ee.enter().append("g").attr("class",`bar-group-${G}`).attr("fill",P=>P.color?P.color:m(P.key)!==Ie.white?m(P.key):"none").attr("opacity",P=>P.opacity).merge(ee);let q=ee.selectAll("rect").data(P=>P,P=>P.key||P.Key);const ue=e.animation.animationEnabled,B=q.enter().append("rect").attr("class","rect").attr("class",P=>P.key?P.key.replace(/ /g,"-"):P.Key.replace(/ /g,"-")).attr("x",P=>T(W?P.data.xKey:P.data.dimension||P.data.legend)).attr("y",y(0)??0).attr("clip-path",`url(#${c}-clip)`).attr("height",0).attr("width",T.bandwidth()).attr("visibility",P=>G===0&&P.data.dimension&&Re?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(P,C)=>{const re=W?va.base:va.dimensionTotal,j={markerShape:"square",markerColor:C.key===re?e.plotArea.totalColor:C.key===va.down?e.plotArea.negativeColor:e.plotArea.positiveColor};ut([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(C.key===va.up?"+":C.key===va.down?"-":"")+Xe(C.key===va.dimensionTotal?C.data.dimensionTotal:C[1]-C[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(W?C.key!==va.base?C.data.xKey:va.total:C.Key?C.Key.includes("~$~")?C.Key.split("~$~")[1]:C.Key:C.data.legend?C.data.legend.includes("~$~")?C.data.legend.split("~$~")[1]:C.data.legend:va.total).trim()||""}],e,void 0,j,At(r,String(J.formattedDimensionListMap.get(W?C.data.xKey:C.data.dimension||C.data.legend)??(W?C.data.xKey:C.data.dimension||C.data.legend)??""),{...j,alias:C.properties?.alias??C.properties?.currentMeasure??String(C.Key??C.key??"")}))}).on("mouseout",()=>{ot()}).attr(lt.SeriesId,P=>String(P.key??P.Key??"")).attr(lt.DimValue,P=>String(W?P.data.xKey||"":P.data.dimension||P.data.legend||"")).on("click",vt(g,S,(P,C)=>{const re=String(C.key??C.Key??""),j=String(W?C.data.xKey||"":C.data.dimension||C.data.legend||"");return{seriesId:re,dimValue:j,legendUniqueId:re,seriesDisplayName:re}}));if((ue?B.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):B).attr("y",P=>P[1]?y(P[1]):0).attr("height",P=>P[1]?y(P[0])-y(P[1]):0),q.exit().remove(),q=B.merge(q),e.plotArea.plotAreaDataLabel=="2"&&G!=1){const P=ee.selectAll("text").data(j=>j),C=P.enter().append("text").text(j=>Xe(j[1]-j[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",j=>T(W?j.data.xKey:j.data.dimension||j.data.legend)+T.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",j=>j[1]-j[0]!==0&&y(j[1])?"visible":"hidden");(ue?C.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):C).attr("y",j=>j[1]?y(j[1])-15:0),P.exit().remove()}}}),i.selectAll(".parentGroup").raise()},ze=ae=>{X=h-ae.left-ae.right,M=k-ae.bottom-ae.top},ke=(ae,_,G,Q,ee)=>{if(!e.plotArea.fitChart){const F=ae[0].data.length-Me,q=_-20;ne=J.dimensionList.slice(Te,Te+Me),Pe(),Z=JSON.parse(JSON.stringify(ae)),Z.forEach((V,P)=>Z[P].data=V.data.filter(C=>ne.includes(C.dimension))),We(),G.append("rect").attr("x",Q.left).attr("y",q).attr("width",ee).attr("height",8).attr("fill","#ddd").attr("rx",4);const ue=ee*Me/J.dimensionList.length,B=G.append("rect").attr("x",Q.left).attr("y",q).attr("width",ue).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",V=>{let P=Math.min(Math.max(V.x,Q.left),Q.left+ee-ue);B.attr("x",P),Te=Math.round((P-Q.left)/(ee-ue)*F),ne=J.dimensionList.slice(Te,Te+Me),Pe(),Z=JSON.parse(JSON.stringify(ae)),Z.forEach((C,re)=>Z[re].data=C.data.filter(j=>ne.includes(j.dimension))),We(),Se()}));G.on("wheel",V=>{V.preventDefault();const P=Math.abs(V.deltaX)>Math.abs(V.deltaY)?V.deltaX:V.deltaY;Te+=P>0?1:-1,Te=Math.max(0,Math.min(Te,F));const C=Q.left+(ee-ue)*Te/F;B.attr("x",C),Pe(),Z=JSON.parse(JSON.stringify(ae)),Z.forEach((re,j)=>Z[j].data=re.data.filter(ie=>ne.includes(ie.dimension))),We(),Se()})}Se()},Se=()=>{ta(i,J,z,e,s,y,N,se,k,p,t,X,M,J.legendList,T),be()},oe=()=>{try{if(A.length<1)return[];if(J.dimensionList.length<2)return[];let ae=[],_=[],G=[],Q="";if(Q.length>1){let B=Q;A.forEach(V=>{B===V.properties.currentLegend?_.push(V):G.push(V)})}_.length>0&&(Z=_);let ee=0,F=0;for(let B=0;B<Z.length;++B)ee=ee+Z[B].data[0].value;let q="";for(let B=1;B<ne.length;++B){let V={};V.dimension=ne[B-1],V.total=ee,V.base=0,V.dimensionTotal=ee,V.up=0,V.down=0,ae.push(V);for(let P=0;P<Z.length;++P){let C={};for(let re=0;re<P;re++)q=q+" ";F=Z[P].data[B].value-Z[P].data[B-1].value,F!==0&&(C.legend=q+Z[P].properties.legend,C.dimensionTotal=0,F<0?(C.base=ee+F,C.down=-F,C.up=0,C.total=ee-F):(C.base=ee,C.down=0,C.up=F,C.total=ee+F),ee=ee+F,ae.push(C))}}let ue={};return ue.dimension=ne[ne.length-1],ue.dimensionTotal=ee,ue.base=0,ue.total=ee,ue.up=0,ue.down=0,ae.push(ue),G.length>0&&(Z=G,Re=Lt(ne,G,!1)),ae}catch(ae){throw ae}},$=ae=>ae==null||ae===""?0:Number(ae),R=ae=>(ae[0]?.Column1==""?ae.filter(G=>G.Column1&&G.Column1!=="*"):o?ae.Data:ae).map(G=>({xKey:G.Column1||G.Dimension||G.Legend,base:$(G.Column3||G.Total),up:$(G.Column4||G.Up),down:$(G.Column5||G.Down),total:$(G.Column6||G.total),dimensionTotal:$(G.Column2||G.Base)}));return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:c,style:{width:"100%",height:"100%"}})})},Hr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,onElementClick:l,vfxPickModeActive:r,tooltipFormatter:c})=>{const p=crypto.randomUUID();let m=0;const L=le.TornadoChart,u=n.IsadvanceanalyticsChart??n.IsCalCSensitivity,S=Ce.useRef(),g=Ce.useRef(l);g.current=l;const W=Ce.useRef(r);W.current=r;let A=mt(n.ChartData,n.DimensionList,!0);A=nr(A,n,u);const E=n.DimensionList,b=!0,U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe=[],Re=0,Te=2,Me=!1,J={dimensionList:E,chartType:L,chartData:[],formatOptions:e,legendList:n.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(R){me("Tornadochart","createTornadoChart",R)}},[e]);const Ee=()=>{({formatOptions:e,svg:d,width:h,height:k}=Ft(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ue(),{formatOptions:e}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe,visibleBars:Te,columnWidth:m,scrollbarVisible:Me}=Mt(h,k,he,O,J.yMaxLeft,e,u?J.legendList.map(R=>R.alias.split(" - ")[0]):J.legendList.map(R=>R.alias),J.dimensionList,J.yMaxRight,U,Y,t,!0,J),ze(D),St(d,h,k,e),i=wt(d,D),kt(i,e,s,X,M,L),ve(),We(),ra(e,i,z,M,X,N),Dt(e,b,d,D,z,k,ye,J.chartType,w,X,M),Vt(M,e,s,b,d,D,K,w,X),Gt(d,U,D,e,s,M,X,pe,xe),Nt(d,e,h,te),It(k,d,se,te,h,ge,e,Le(A,J.legendList,u,e),p,s,D,ct.rectangle),oe(A,k,h,d,D,X,Me,Te,J,Re,!1,ke,b)},Le=(R,ae,_,G)=>R.map((Q,ee)=>{const F=ae[ee];if(!F)return{...Q,properties:{}};let q=F.alias;_&&F.alias&&(q=F.alias.split(" - ")[0].trim());let ue=F.color;return _&&q&&(q.includes("+ve")?ue=G.plotArea.plotAreaCalculatedHigh:q.includes("-ve")&&(ue=G.plotArea.plotAreaCalculatedLow)),{...Q,properties:{...F,alias:q,color:ue}}}).filter(Q=>Q.properties&&Object.keys(Q.properties).length>0),Ue=()=>{let R;if(u)J.chartData=A,J.yMaxLeft=Math.min(...A.map(_=>_.data[0].value)),J.yMaxRight=Math.max(...A.map(_=>_.data[0].value));else{const _=A[0]?.properties?.measureUniqueId;let G=0,Q=-1/0;R=A.map((ee,F)=>{const q=ee.properties.measureUniqueId===_,ue=ee.data.map(V=>{const P=q?-Math.abs(V.value):Math.abs(V.value);return{...V,value:P}}),B=ue.map(V=>V.value);return q?G=Math.min(G,Math.min(...B)):Q=Math.max(Q,Math.max(...B)),{...ee,data:ue}}),J.chartData=R,J.yMaxLeft=G,J.yMaxRight=Q}const ae=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList):J.dimensionList;J.dimensionList.forEach((_,G)=>{J.formattedDimensionListMap.set(_,ae[G])}),fe=JSON.parse(JSON.stringify(u?A:R)),A=fe,Z=J.dimensionList,e.plotArea.hideZeroValues&&(J.hideZeroValues=!0)},ve=()=>{let R=J.yMaxLeft,ae=J.yMaxRight,_=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,G,Q=!1,ee=!1;R>ae?(G=R,Q=!0):(G=ae,ee=!0);let F=e.annotation.annotationVisibility!="5"?R/G!==1?Math.abs(R/G)*100<10?3:0:Math.abs(ae/G)*100<10?3:0:0,q=0,ue=0;R<0&&ae>0?(q=R*(1.2+(ee?F:0)),ue=ae*(1.2+(Q?F:0))):R>=0&&ae>=0?(q=0,ue=ae*(1.2+(Q?F:0))):R<=0&&ae<=0?(q=R*(1.2+(ee?F:0)),ue=0):(q=R*1.2,ue=ae*1.2),q=Math.floor(q),ue=Math.ceil(ue),a=v.scaleLinear().domain([q,ue]).range([_,X-_]),T=a,Pe()},Pe=()=>{y=v.scalePoint().domain(Z).range([M,0]).padding(.5)},Ye=()=>{f=v.axisLeft(y).tickSize(zt(e,X-a(0),0)).tickSizeOuter(0).tickValues(gt(Z,M,e)),ne=v.axisRight(y).tickSize(zt(e,a(0),0)).tickSizeOuter(0).tickValues(gt(Z,X,e))},We=()=>{N=v.axisBottom(a).tickFormat(R=>Xe(R,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision,!0)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.ticksHeight=="100"?-M:-e.plotArea.ticksHeight*(M/100):0).tickValues(yt(J.yMaxRight,J.yMaxLeft,M,e,J,H,I,b,X).yAxisLabelArray).ticks(yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I,b,X).customTickValue??X/30).tickPadding(8).tickSizeOuter(0)},be=()=>{i.selectAll(".parentGroup").remove();const R=e.plotArea.plotAreaCalculatedHigh,ae=e.plotArea.plotAreaCalculatedLow,_=i.append("g").attr("class","parentGroup"),G=e.animation.animationEnabled,Q=_.selectAll("rect").data(fe.flatMap(F=>F.data.map(q=>({...q,legendText:u?F.legend.split("ve) - ")[1]?.trim()??F.legend:J.dimensionList[0]==le.TornadoDefaultEntry?Ci.default:F.legend.split("-")[1]?.trim()??F.legend,properties:F.properties})))).enter().append("rect").attr("class","rect").attr("y",F=>(F.legendText?y(F.legendText):y(le.TornadoDefaultEntry))-m/2).attr("height",m).attr("x",T(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",F=>F.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",F=>`${F.properties.stackBorderWidth}px`).attr("hoverId",F=>((u?F.legend.split(" - ")[0]:F.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",F=>F.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?F.properties.stackBorderColor:"none").style("fill",F=>u?F.value>0?R!==Ie.white?R:"none":ae!==Ie.white?ae:"none":F.properties.color).on("mousemove",(F,q)=>{ut([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():n.IsCalCSensitivity?q.properties.currentMeasure.split("~$~")[1]:q.dimension},{key:"Legend",value:q.legendText},{key:"Value",value:Xe(Math.abs(q.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,F,n.IsCalCSensitivity?q.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:q.properties,At(c,String(J.formattedDimensionListMap.get(q.legend)??q.legend??""),q.properties))}).on("mouseout",ot).attr(lt.SeriesId,F=>String(F.properties?.legendUniqueId??"")).attr(lt.DimValue,F=>String(F.legend??F.legendText??"")).on("click",vt(W,g,(F,q)=>({seriesId:String(q.properties?.legendUniqueId??""),dimValue:String(q.legend??q.legendText??""),legendUniqueId:String(q.properties?.legendUniqueId??""),seriesDisplayName:String(q.properties?.alias||q.properties?.name||q.legendText||"")})));(G?Q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Q).attr("x",F=>F.value>=0?T(0):T(F.value)).attr("width",F=>Math.abs(T(F.value)-T(0)))},ze=R=>{X=h-R.left-R.right,M=k-R.bottom-R.top},ke=(R,ae,_)=>{fe=ae,Z=R,Te=_,$()};function Se(R){const ae=new Map;return R.forEach(_=>{let G=ae.get(_.properties.legendUniqueId);if(G){let Q=G.data??[];Q.push(_.data[0]),ae.set(_.properties.legendUniqueId,{...G,data:Q})}else G={..._,data:[_.data[0]]},ae.set(_.properties.legendUniqueId,G)}),ae.size>0?Array.from(ae.keys()).map(_=>ae.get(_)):R}function oe(R,ae,_,G,Q,ee,F,q,ue,B,V,P,C=!1){const re=(j,ie,we,de,Ae)=>{try{if(Ae&&(j=B+j),!ue||!Array.isArray(ue.dimensionList)||!Array.isArray(R))return;j=j==null?0:Number(j),ie=ie==null?0:Number(ie),we=we==null?0:Number(we),B=Za(Math.round(j),0,Math.max(0,ie)),q=typeof q=="number"?q:0;const De=B,$e=De+q;let Fe=ue.dimensionList.slice(De,$e);const _e=Fe[0]==le.TornadoDefaultEntry;let it=JSON.parse(JSON.stringify(R||[]));it=it.filter(qe=>_e?!0:Fe.includes(qe.legend.split(" - ")[1]));const nt=Q?.left??0,Ba=Q?.top??0,di=Number(ee)||0,Ia=Number(M)||0,vi=Number(we)||0,Be=ie===0?1:ie;if(C){const qe=Ba+(Ia-vi)*(ie===0?0:B)/Be;de&&typeof de.attr=="function"&&de.attr("y",qe)}else{const qe=nt+(di-vi)*(ie===0?0:B)/Be;de&&typeof de.attr=="function"&&de.attr("x",qe)}P(Fe,it,q)}catch(De){typeof me=="function"&&me("ColumnChart","updateFromScrollPosition",De)}};if(F){const j=ae-Q.top-Q.bottom,ie=Math.max(0,E.length-q),we=ae-8;G.append("rect").attr("id","scrollbarTrack").attr("x",C?_-8:Q.left).attr("y",C?Q.top:we).attr("width",C?8:ee).attr("height",C?j:8).attr("fill","#ccc");const de=(C?j:ee)*q/ue.dimensionList.length,Ae=G.append("rect").attr("x",C?_-8:Q.left).attr("y",C?Q.top:we).attr("width",C?8:de).attr("height",C?de:8).attr("fill","#999").style("cursor",C?"ns-resize":"ew-resize");Ae.call(v.drag().on("drag",De=>{if(C){const Fe=(Za(De.y,Q.top,Q.top+j-de)-Q.top)/(j-de)*(ie||1);re(Fe,ie,de,Ae,!1),Ae.attr("y",Q.top+(j-de)*(ie===0?0:B)/(ie===0?1:ie))}else{const Fe=(Za(De.x,Q.left,Q.left+ee-de)-Q.left)/(ee-de)*(ie||1);re(Fe,ie,de,Ae,!1),Ae.attr("x",Q.left+(ee-de)*(ie===0?0:B)/(ie===0?1:ie))}})),G.on("wheel",De=>{De.preventDefault();const Fe=(Math.abs(De.deltaX)>Math.abs(De.deltaY)?De.deltaX:De.deltaY)>0?1:-1;if(re(Fe,ie,de,Ae,!0),C){const _e=Q.top+(j-de)*(ie===0?0:B)/(ie===0?1:ie);Ae.attr("y",_e)}else{const _e=Q.left+(ee-de)*(ie===0?0:B)/(ie===0?1:ie);Ae.attr("x",_e)}})}else G.on("wheel",null);re(0,0,0,null,!0)}const $=()=>{Pe(),Ye(),na(e,i,z,M,X,f,ne,T,J.yMaxLeft,Z,L,t,h,se,m,y),be();const R=Se(fe);$a(R??[],y,T,null,D,pt,[],[],e,L,k,h,X,Z,M,p,d,x,y,m,o,u,b,u)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:p,style:{width:"100%",height:"100%"}})})},Gr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r})=>{const c=crypto.randomUUID();let p=0;const m=le.DotPlot,L=Ce.useRef(),u=mt(n.ChartData,n.DimensionList),S=n.DimensionList,g=!0,W=!1;let A=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,E=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,b,U,Y,H,I,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y=[],T=0,a=2,f=!1,N=[];const ne=!1;let Z={dimensionList:S,chartType:m,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{fe()}catch(ke){me("StackStackHorizontalBarchart","createDotPlot",ke)}},[e]);const fe=()=>{({formatOptions:e,svg:O,width:pe,height:he}=Ft(L,e)),Re(),{maxNumberForPrimaryAxis:se,maxNumberForSecondaryAxis:te}=Rt(e,Z.yMinLeft,Z.yMaxLeft,Z.yMinRight,Z.yMaxRight),{margin:b,yLabel:U,xLabel:Y,yTitle:H,xTitle:I,dimensionHeightWidthArray:D,chartTitleHeight:w,secondaryAxisTitleWidth:z,legendMargin:K,secondaryYLabel:ye,visibleBars:a,columnWidth:p,scrollbarVisible:f}=Mt(pe,he,se,te,Z.yMaxLeft,e,Z.legendList,Z.dimensionList,Z.yMaxRight,W,ne,t,g,Z),Ue(b),St(O,pe,he,e),X=wt(O,b),kt(X,e,0,xe,ge,m),Te(),J(),ra(e,X,U,ge,xe,s),Dt(e,g,O,b,Y,he,I,Z.chartType,U,xe,ge),Vt(ge,e,0,g,O,b,H,U),Nt(O,e,pe,w),It(he,O,D,w,pe,K,e,u,c,0,b,ct.rectangle,m,l),_t(u,he,pe,O,b,xe,f,a,Z,T,!1,ve,g)},Re=()=>{const ke=[],Se=[];let oe=[],$=-1/0,R=1/0,ae=-1/0,_=1/0;u.forEach(G=>{Se.push(G.properties.legendUniqueId),G.data.forEach(Q=>{ke.push(Q),$=Math.max($,Q.value),R=Math.min(R,Q.value)})}),Z.chartData=ke,Z.legendList=Se,Z.yMaxLeft=$,Z.yMinLeft=R>0?0:R,Z.yMaxRight=ae,Z.yMinRight=_,oe=t?Tt(e.xAxisLabel.xAxisNumberFormat,Z.dimensionList).map(G=>G):Z.dimensionList,oe=t?Tt(e.xAxisLabel.xAxisNumberFormat,Z.dimensionList).map(G=>G):Z.dimensionList,Z.dimensionList.forEach((G,Q)=>{Z.formattedDimensionListMap.set(G,oe[Q]),Z.formattedDimensionListMap.set(G,oe[Q])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=Z.dimensionList:i=Z.dimensionList.slice(T,T+a),e.plotArea.hideZeroValues&&(Z.hideZeroValues=!0)},Te=()=>{let ke=yt(E||Z.yMaxLeft,Z.yMinLeft,ge,e,Z,A,E,g,xe).yAxisLabelArray;Z.yMaxLeft=ke[ke.length-1],Z.yMinLeft=ke[0],M=v.scaleLinear().domain([Z.yMinLeft>=0?A!==void 0&&!Number.isNaN(A)?A:0:Z.yMinLeft<0?Z.yMinLeft*1.1:Z.yMinLeft*.9,Z.yMaxLeft<=0?0:E!==void 0&&!Number.isNaN(E)?E:Z.yMaxLeft*1.1]).range([0,xe]),k=[ge,0],Me()},Me=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,p]).paddingInner(Z.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),h=v.scalePoint().domain(i).range(k).padding(.5)},J=()=>{Ee();{let ke=yt(E||Z.yMaxLeft,Z.yMinLeft,ge,e,Z,A,E,g,xe);s=v.axisBottom(M).tickFormat(Se=>Xe(Se,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-ge:0).tickValues(ke.autoLabelFlag?void 0:ke.yAxisLabelArray).ticks(ke.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ee=()=>{d=v.axisLeft(h).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*xe*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(i,ge,e))},Le=ke=>{ke.forEach(R=>{R.data.forEach(ae=>{ae.markerShape=R.properties.markerShape||"Circle",ae.markerSize=R.properties.markerSize||6,ae.markerColor=R.properties.markerColor||R.properties.color,ae.alias=R.properties.alias,ae.lineStyle=R.properties.lineStyle,ae.lineWidth=R.properties.lineWidth,ae.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const Se=v.group(ke.flatMap(R=>R.data.map(ae=>({...ae,color:R.properties.color}))),R=>R.dimension),oe=X.selectAll(".cleveland-line-group").data(Array.from(Se),([R])=>R);oe.enter().append("g").attr("class","cleveland-line-group").append("line").merge(oe.select("line")).attr("y1",([R])=>h(R)).attr("y2",([R])=>h(R)).attr("x1",([,R])=>M(Math.min(R[0]?.value??0,R[1]?.value??0))).attr("x2",([,R])=>M(Math.max(R[0]?.value??0,R[1]?.value??0))).attr("stroke",R=>R[1][0].lineColor).attr("stroke-width",R=>R[1][0].lineStyle!=="None"?R[1][0].lineWidth:0).attr("stroke-dasharray",R=>{switch(R[1][0].lineStyle){case bt.dotted:return"1,4";case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",R=>R[1][0].lineStyle===bt.dotted?ya.round:""),oe.exit().remove(),ke.forEach(R=>{let ae=X.selectAll(".parentGroup").data([R],F=>F.properties.legendUniqueId);ae=ae.enter().append("g").attr("class","parentGroup").attr("hoverId",(R.properties.alias||R.properties.name||"Legend").replace(/\s+/g,"-")).merge(ae);let _=ae.selectAll(".column-group").data(R.data,F=>F.dimension),G=_.enter().append("g").attr("class","column-group");const Q=e.animation.animationEnabled,ee=G.append("path").attr("class","cleveland-dot").attr("opacity",Q?0:.9);ee.merge(_.select("path")).attr("d",F=>v.symbol().type(Ji(F.markerShape)).size((F.markerSize||6)*70)()).attr("transform",F=>{const q=M(F.value),ue=h(F.dimension);return`translate(${q},${ue})`}).attr("fill",F=>R.properties.color).attr("data-series-id",()=>R.properties.legendUniqueId??R.properties.alias).attr("data-dim-value",F=>String(F.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(F,q)=>{ut([{key:e.xAxisTitle.xAxisTitleText,value:Z.formattedDimensionListMap.get(q.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:Xe(q.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:q.alias}],e,F,R.properties,At(r,String(q.dimension??""),{...R.properties,formattedDimensionValue:String(Z.formattedDimensionListMap.get(q.dimension)??q.dimension??"")}))}).on("mouseout",()=>{v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll(".halo").remove(),ot()}),Q&&ee.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("opacity",.9),_.exit().remove()}),X.selectAll(".parentGroup").raise()},Ue=ke=>{xe=pe-ke.left-ke.right,ge=he-ke.bottom-ke.top},ve=(ke,Se,oe)=>{y=Se,i=ke,a=oe,Pe()},Pe=()=>{Me(),Ee(),na(e,X,Y,ge,xe,d,void 0,M,Z.yMaxLeft,i,m,t,pe,D,p,h),Ye(),Le(y),$a(y,h,M,void 0,b,pt,[],[],e,m,he,pe,xe,i,ge,c,O,x,h,p,o,!1,g),We()},Ye=()=>{let ke=Lt(i,y,ne);N=v.stack().keys(Z.legendList).offset(v.stackOffsetDiverging)(ke),y.forEach((oe,$)=>oe.data.forEach((R,ae)=>{R[0]=N[$][ae][0],R[1]=N[$][ae][1]}));let Se=e.annotation.annotationSetLabelColor;N.forEach((oe,$)=>oe.forEach(R=>{R.key=oe.key,oe.color=JSON.parse(JSON.stringify(u[$].properties.color)),R.data.labelPosition=u[$].properties.dataLabelPosition,R.data.labelColor=Se=="2"?JSON.parse(JSON.stringify(u[$].properties.color)):u[$].properties.labelColor,R.hideZero=JSON.parse(JSON.stringify(u[$].properties.hideZeroValues))}))},We=()=>{try{const ke=Number(e.connector?.connectorVisibility);if(!e.connector||ke===2)return;const Se=[],oe=[],$=[];let R;const ae=[];if(ke===1)R=1;else if(ke===3){const ue=Number(e.connector.connectorFollow);ue===1?R=Number(e.connector.connectorStepSize):ue===2&&((e.connector.connectorExclude||[]).forEach(B=>$.push(B)),R=1)}const _=[],G=[],Q=[],ee=e.connector?.connectorCustomRange||[];$.forEach(ue=>{const B=ue.split("-");B.length&&_.push(B[0])});const q=(N?.[0]||[]).map((ue,B)=>({Dimension:ue.data.Dimension,Total:ue.data.Total,CustomTotal:ue.data.Total-(Q[B]??0),Index:B}));if(R!=null){for(let ue=0;ue<q.length;ue++)(R===1||ue%R===0&&R!==1)&&Se.push(q[ue]);for(let ue=R;ue<q.length;ue+=R){const B=Math.min(ue+R,q.length);let V=-1/0;for(let P=ue;P<B;P++)q[P].Total>V&&(V=q[P].Total);V!==-1/0&&ae.push(V)}for(let ue=1;ue<Se.length;ue++)oe.push(Se[ue])}else{const ue=[];(ee||[]).forEach(B=>{if(B?.from&&B?.to){const V=q.some(C=>C.Dimension===B.from),P=q.some(C=>C.Dimension===B.to);V&&P&&ue.push({from:B.from,to:B.to})}}),ue.forEach(B=>{const V=q.findIndex(C=>C.Dimension===B.from),P=q.findIndex(C=>C.Dimension===B.to);if(V>=0&&P>=0){const C=Math.min(V,P),re=Math.max(V,P);Se.push(q[C]);let j=q[C]?.Total??-1/0;for(let ie=C;ie<=re;ie++)q[ie].Total>j&&(j=q[ie].Total);j!==-1/0&&ae.push(j),oe.push(q[re])}})}X.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Ie.white?e.connector.connectorMarkerColor:"none"),be(Se,ae,oe,R,_),ze(Se,ae,oe,R,_)}catch(ke){console.error(ke)}},be=(ke,Se,oe,$,R)=>{try{X.append("g").selectAll("path").data(ke).enter().filter((ae,_)=>$!=null?_<ke.length-1:_<ke.length).append("path").attr("d",(ae,_)=>e.total.totalVisibility?`M ${M(ae.Total)+50},
260
+ ${h(ae.Dimension)+h.bandwidth()/2-5}
261
+ H ${60+Math.max(M(Se[_]),M(oe[_].Total),M(ae.Total))}
262
+ V ${h(oe[_].Dimension)+h.bandwidth()/2+5}
263
+ H ${30+M(oe[_].Total)}`:`M ${M(ae.Total)+30},
264
+ ${h(ae.Dimension)+h.bandwidth()/2-5}
265
+ H ${45+Math.max(M(Se[_]),M(oe[_].Total),M(ae.Total))}
266
+ V ${h(oe[_].Dimension)+h.bandwidth()/2+5}
267
+ H ${10+M(oe[_].Total)}
268
+ `).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",ae=>R.includes(ae.Dimension)||ae.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ae){console.error(ae)}},ze=(ke,Se,oe,$,R)=>{try{let ae=e.connector.connectorFontStyle,_=e.connector.connectorNumberFormat,G=ge/30<i.length?Math.round(ge/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(_=".2s"),X.append("g").selectAll("text1").data(ke).enter().filter((Q,ee)=>$!=null?ee<ke.length-1:ee<ke.length).append("text").attr("y",(Q,ee)=>$==null?h(oe[ee].Dimension)/2+h(Q.Dimension)/2+15:$==1?G<6&&h.bandwidth()>40?h(oe[ee].Dimension)+h.bandwidth()/2+h.bandwidth()/2+13:h(oe[ee].Dimension)+h.bandwidth()/2+h.bandwidth()/2+7:h(oe[ee].Dimension)+h.bandwidth()/2+h.bandwidth()/2*$+12).attr("x",(Q,ee)=>e.total.totalVisibility?70+Math.max(M(Se[ee]),M(oe[ee].Total),M(Q.Total)):50+Math.max(M(Se[ee]),M(oe[ee].Total),M(Q.Total))).text((Q,ee)=>(Q.CustomTotal==0&&oe[ee].CustomTotal!=0&&(Q.CustomTotal=1),fi(oe[ee].Total,Q.Total,parseInt(e.connector.connectorDecimalPrecision),_,parseInt(Q.Dimension),parseInt(oe[ee].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Ie.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",ae.includes("Italic")?"Italic":"").style("text-decoration",ae.includes("Underline")?"Underline":"").style("font-weight",ae.includes("Bold")?"Bold":"").style("visibility",Q=>R.includes(Q.Dimension)||Q.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ae){console.error(ae)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:L,id:c,style:{width:"100%",height:"100%"}})})},aa=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function La(t,e=1){const n=t.replace("#",""),o=parseInt(n.substring(0,2),16),x=parseInt(n.substring(2,4),16),l=parseInt(n.substring(4,6),16);return isNaN(o)||isNaN(x)||isNaN(l)?t:`rgba(${o},${x},${l},${e})`}function yl(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function ma(t,e,n,o=aa){const{ChartData:x,DimensionList:l,LegendList:r}=t,c=l?.length?l:x[0]?.data?.map(m=>m.dimension)??[],p=Number(n.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?jr(x,c,p,o,r):e==="scatter"?Jr(x,o):e==="bubble"?Zr(x,o):_r(x,c,e,n,p,o)}function _r(t,e,n,o,x,l){const r=t.map((c,p)=>{const m=c.properties?.color??l[p%l.length],L=c.properties?.opacity??1,u=new Map;c.data?.forEach(E=>u.set(E.dimension,E.value));const S=e.map(E=>u.get(E)??0),g=c.Axis==="Secondary"||c.properties?.axis==="Secondary"?"y1":"y",W=Number(c.properties?.lineWidth??o.plotArea?.lineWidth??2);return n==="line"||n==="area"?{type:"line",label:c.properties.alias,data:S,borderColor:m,backgroundColor:n==="area"?La(m,x*L):La(m,.1),fill:n==="area",borderWidth:W,borderDash:yl(c.properties?.lineStyle),pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3,tension:Number(o.cjsOptions?.cjsTension??.4),yAxisID:g}:n==="radar"?{label:c.properties.alias,data:S,borderColor:m,backgroundColor:La(m,x*L),fill:!0,borderWidth:W,pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3}:{type:"bar",label:c.properties.alias,data:S,backgroundColor:La(m,x*L),borderColor:m,borderWidth:Number(c.properties?.stackBorderWidth??0),borderRadius:Number(o.cjsOptions?.cjsBorderRadius??o.plotArea?.cornerRadius??0),yAxisID:g}});return{labels:e,datasets:r}}function jr(t,e,n,o,x){const r=(t.length?t:[]).map(c=>{const p=e.map(L=>c.data?.find(S=>S.dimension===L)?.value??0),m=e.map((L,u)=>{const S=x?.[u]?.color;return La(S??o[u%o.length],n)});return{label:c.properties.alias,data:p,backgroundColor:m,borderColor:m.map(L=>L.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:r}}function Jr(t,e){return{datasets:t.map((o,x)=>{const l=o.properties?.color??e[x%e.length],r=o.data?.map(c=>({x:typeof c[0]=="number"?c[0]:parseFloat(c.dimension)||x,y:c.value??0}))??[];return{label:o.properties.alias,data:r,backgroundColor:La(l,.7),borderColor:l,pointRadius:5}})}}function Zr(t,e){return{datasets:t.map((o,x)=>{const l=o.properties?.color??e[x%e.length],r=o.data?.map(c=>({x:typeof c[0]=="number"?c[0]:parseFloat(c.dimension)||x,y:c.value??0,r:Number(c.markerSize??o.properties?.markerSize??8)}))??[];return{label:o.properties.alias,data:r,backgroundColor:La(l,.6),borderColor:l}})}}function oi(t,e,n,o=aa){const{ChartData:x,DimensionList:l}=t,r=l?.length?l:x[0]?.data?.map(L=>L.dimension)??[],c=new Map;r.forEach(L=>{const u=x.reduce((S,g)=>{const W=g.data?.find(A=>A.dimension===L);return S+Math.abs(W?.value??0)},0);c.set(L,u)});const p=Number(n.plotArea?.fillOpacity??.8),m=x.map((L,u)=>{const S=L.properties?.color??o[u%o.length],g=L.properties?.opacity??1,W=new Map;L.data?.forEach(b=>W.set(b.dimension,b.value));const A=r.map(b=>{const U=W.get(b)??0,Y=c.get(b)??0;return Y>0?parseFloat((U/Y*100).toFixed(4)):0}),E=Number(L.properties?.lineWidth??n.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:L.properties.alias,data:A,borderColor:S,backgroundColor:e==="area"?La(S,p*g):La(S,.1),fill:e==="area",borderWidth:E,borderDash:yl(L.properties?.lineStyle),pointRadius:n.marker?.markerVisibility?Number(n.marker?.markerSize??4):3,tension:Number(n.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:L.properties.alias,data:A,backgroundColor:La(S,p*g),borderColor:S,borderWidth:Number(L.properties?.stackBorderWidth??0),borderRadius:Number(n.cjsOptions?.cjsBorderRadius??n.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:r,datasets:m}}function _a(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function ci(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function Xr(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function qr(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function ul(t,e,n){const o=parseInt(n??"0",10);return e==="Thousands"?(t/1e3).toFixed(o)+"K":e==="Millions"?(t/1e6).toFixed(o)+"M":e==="Billions"?(t/1e9).toFixed(o)+"B":t.toFixed(o)}function Kr(t,e){return t.find(n=>n.alias==e)}function Qr(t,e){const n=Math.max(2,e||3);if(n>=t)return new Set(Array.from({length:t},(l,r)=>r));const o=t-1,x=new Set;for(let l=0;l<n;l++)x.add(Math.round(l*o/(n-1)));return x}function Qt(t,e,n=!1,o,x){const l=e==="pie"||e==="doughnut"||e==="polarArea",r=e==="horizontalBar";let c=0;const p=300,m=t.plotArea?.gridLinesColor??"#e0e0e0",L=t.legends?.legendFontColor??"#333333",u={responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!1},legend:{display:t.legends?.legendVisibility!==!1&&t.legends?.legendPosition!=="None",position:qr(t.legends?.legendPosition),labels:{color:L,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??tt,style:_a(t.legends?.legendFontStyle),weight:ci(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,g,W){if(o){const A=new Date().getTime();if(A-c<p){const b=Kr(x,g.text);b&&o(b),c=0}else c=A}}},tooltip:{enabled:t.toolTip?.toolTipVisibility!==!1,backgroundColor:t.toolTip?.toolTipTheme==="Dark"?"#222222":"#ffffff",titleColor:t.toolTip?.toolTipTheme==="Dark"?"#ffffff":"#333333",bodyColor:t.toolTip?.toolTipTheme==="Dark"?"#cccccc":"#555555",borderColor:m,borderWidth:1,padding:10,callbacks:{label(S){const g=typeof S.raw=="number"?S.raw:S.raw?.y??0,W=Xe(g,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${W}`}}},datalabels:Or(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:Xr(t.animation?.animationEffect)}:!1};if(!l){const S=e==="scatter"||e==="bubble",g=t.xAxisLabel?.xAxisTicksMode==="Custom",W=Math.max(2,parseInt(t.xAxisLabel?.xAxisTicksCount)||3),A={display:!0,title:{display:t.xAxisTitle?.xAxisTitleVisibility!==!1,text:t.xAxisTitle?.xAxisTitleText??"Dimension",color:t.xAxisTitle?.xAxisTitleColor??"#000000",font:{size:parseInt(t.xAxisTitle?.xAxisTitleFontSize??"11",10),family:t.xAxisTitle?.xAxisTitleFontFamily??tt,style:_a(t.xAxisTitle?.xAxisTitleFontStyle)}},ticks:{display:t.xAxisLabel?.xAxisLabelVisibility!==!1,color:t.xAxisLabel?.xAxisLabelColor??"#000000",font:{size:parseInt(t.xAxisLabel?.xAxisLabelFontSize??"11",10),family:t.xAxisLabel?.xAxisLabelFontFamily??tt,style:_a(t.xAxisLabel?.xAxisLabelFontStyle),weight:ci(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0,...S&&g?{count:W}:{}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:m},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")},...!S&&g?{afterBuildTicks:U=>{const Y=Qr(U.ticks.length,W);U.ticks=U.ticks.filter((H,I)=>Y.has(I))}}:{}},E={display:!0,position:"left",title:{display:t.yAxisTitle?.yAxisTitleVisibility!==!1,text:t.yAxisTitle?.yAxisTitleText??"Measure",color:t.yAxisTitle?.yAxisTitleColor??"#000000",font:{size:parseInt(t.yAxisTitle?.yAxisTitleFontSize??"11",10),family:t.yAxisTitle?.yAxisTitleFontFamily??tt,style:_a(t.yAxisTitle?.yAxisTitleFontStyle)}},ticks:{display:t.yAxisLabel?.yAxisLabelVisibility!==!1,color:t.yAxisLabel?.yAxisLabelColor??"#000000",font:{size:parseInt(t.yAxisLabel?.yAxisLabelFontSize??"11",10),family:t.yAxisLabel?.yAxisLabelFontFamily??tt,style:_a(t.yAxisLabel?.yAxisLabelFontStyle),weight:ci(t.yAxisLabel?.yAxisLabelFontStyle)},callback(U){return ul(U,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)},...t.yAxisLabel?.yAxisTicksMode==="Custom"?{count:Math.max(2,parseInt(t.yAxisLabel?.yAxisTicksCount)||3)}:{}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesHorizontal!==!1,color:m},border:{color:t.yAxisLabel?.yAxisColor??"#cccccc",width:parseFloat(t.yAxisLabel?.yAxisWidth??"0.5")}};r?(u.scales={x:{...E,position:"bottom"},y:{...A,position:"left",reverse:!0}},u.scales.x.title&&(u.scales.x.title.text=t.yAxisTitle?.yAxisTitleText??"Measure"),u.scales.y.title&&(u.scales.y.title.text=t.xAxisTitle?.xAxisTitleText??"Dimension")):u.scales={x:A,y:E},n&&(u.scales.y1={display:!0,position:"right",title:{display:t.secondaryYAxisTitle?.secondaryYAxisTitleVisibility!==!1,text:t.secondaryYAxisTitle?.secondaryYAxisTitleText??"",color:t.secondaryYAxisTitle?.secondaryYAxisTitleColor??"#000000",font:{size:parseInt(t.secondaryYAxisTitle?.secondaryYAxisTitleFontSize??"11",10),family:t.secondaryYAxisTitle?.secondaryYAxisTitleFontFamily??tt}},ticks:{display:t.secondaryYAxisLabel?.secondaryYAxisLabelVisibility!==!1,color:t.secondaryYAxisLabel?.secondaryYAxisLabelColor??"#000000",font:{size:parseInt(t.secondaryYAxisLabel?.secondaryYAxisLabelFontSize??"11",10),family:t.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily??tt,style:_a(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:ci(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(U){return ul(U,t.secondaryYAxisLabel?.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel?.secondaryYAxisLabelDecimalPrecision)}},grid:{drawOnChartArea:!1},border:{color:t.secondaryYAxisLabel?.secondaryYAxisColor??"#000000",width:parseFloat(t.secondaryYAxisLabel?.secondaryYAxisWidth??"0.5")}}),e.toLowerCase().includes("stack")&&(u.scales?.x&&(u.scales.x.stacked=!0),u.scales?.y&&(u.scales.y.stacked=!0))}return u}function xl(t){if(typeof t=="number")return t;if(t!==null&&typeof t=="object"){if(typeof t.y=="number")return t.y;if(typeof t.x=="number")return t.x}return parseFloat(t)||0}function Or(t,e="bar"){const n=t.annotation,o=e==="pie"||e==="doughnut"||e==="polarArea",x=e==="horizontalBar",l=n?.annotationVisibility??"5";if(l==="5"||!l)return{display:!1};const r=n?.annotationPosition??"1",c=n?.annotationHideZeroValues!==!1,p=parseInt(n?.annotationFontSize??"9",10)||9,m=n?.annotationFontFamily??tt,L=_a(n?.annotationFontStyle),u=ci(n?.annotationFontStyle),S=n?.annotationColor??"#000000",g=n?.annotationSetLabelColor==="2",W=n?.annotationDecimalPrecision??"2",A=n?.annotationNumberFormat??",",E=n?.annotationDisplayUnits??"None";function b(D){const w=D.dataset?.data?.length??0,z=D.dataIndex??0;switch(l){case"1":return!0;case"2":return z===0;case"3":return z===w-1;case"4":return z===0||z===w-1;default:return!1}}function U(D){const w=D.dataset?.data?.[D.dataIndex];return xl(w)}function Y(D){if(o)return r==="2"?"center":"end";const w=U(D);switch(r){case"2":return"center";case"3":return w<0?"end":"start";case"1":return w>0?"end":"start";case"4":default:return w>0?"end":"start"}}function H(D){if(o)return r==="2"?"center":"end";const w=U(D);if(x)switch(r){case"2":return"center";case"3":return"right";case"1":case"4":default:return w<0?"left":"right"}switch(r){case"2":return"center";case"3":return w>0?"top":"bottom";case"1":case"4":default:return w<0?"bottom":"top"}}function I(D,w){const z=xl(D);if(c&&z===0)return null;const K=Xe(z,E,A,W);if(o){const ye=w?.chart?.data?.labels?.[w.dataIndex]??"";return ye?`${ye}
269
+ ${K}`:K}return K}return{display:b,anchor:Y,align:H,offset:o?r==="2"?0:8:r==="2"?0:4,color:g?D=>{const w=D.dataset?.backgroundColor,z=D.dataset?.borderColor,K=Array.isArray(w)?w[D.dataIndex]:w;return typeof K=="string"&&K?K:typeof z=="string"&&z?z:S}:S,font:{size:p,family:m,style:L,weight:u},formatter:I,clip:!1}}Ct.Chart.register(Ct.BarController,Ct.LineController,Ct.PieController,Ct.DoughnutController,Ct.ScatterController,Ct.BubbleController,Ct.RadarController,Ct.PolarAreaController,Ct.CategoryScale,Ct.LinearScale,Ct.RadialLinearScale,Ct.PointElement,Ct.BarElement,Ct.LineElement,Ct.ArcElement,Ct.Title,Ct.Tooltip,Ct.Legend,Ct.Filler,kl);const Ot=({chartType:t,data:e,options:n,formatOptions:o,clientWidth:x,clientHeight:l,className:r,isChartStacked:c})=>{const p=Ce.useRef(null),m=Ce.useRef(null),L=Ce.useRef(!1);Ce.useEffect(()=>{if(p.current)return m.current?.destroy(),m.current=new Ct.Chart(p.current,{type:t,data:e,options:n}),L.current=!0,()=>{m.current?.destroy(),m.current=null}},[t,c]),Ce.useEffect(()=>{if(L.current){L.current=!1;return}const U=m.current;U&&(U.data=e,U.options=n,U.update())},[e,n]);const u=o.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(o.chartTitle?.chartTitleFontStyle)?o.chartTitle.chartTitleFontStyle:[],g=o.chartTitle?.chartTitleColor&&o.chartTitle.chartTitleColor!=="#ffffff"&&o.chartTitle.chartTitleColor!=="#FFFFFF00"?o.chartTitle.chartTitleColor:"rgba(119,119,119)",W=o.chartTitle?.chartTitleFontSize?`${o.chartTitle.chartTitleFontSize}px`:"16px",A=o.chartTitle?.dynamicTitleText||o.chartTitle?.chartTitleText||"",E=o.chartTitle?.chartTitleHTML||A,b=o.chartTitle?.chartTitleVisibility!==!1;return Ge.jsxs("div",{className:r,style:{width:"100%",height:"100%",backgroundColor:u,position:"relative",display:"flex",flexDirection:"column"},children:[b&&A&&Ge.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:o.chartTitle?.chartTitleText,style:{color:g,fontSize:W,fontFamily:o.chartTitle?.chartTitleFontFamily,fontStyle:S.includes("Italic")?"italic":"normal",fontWeight:S.includes("Bold")?"bold":"normal",textDecoration:S.includes("Underline")?"underline":"none",whiteSpace:"pre",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"1.3em",userSelect:"none",padding:"2px 4px",flexShrink:0},dangerouslySetInnerHTML:{__html:E}}),Ge.jsx("div",{style:{flex:1,minHeight:0},children:Ge.jsx("canvas",{ref:p,style:{width:"100%",height:"100%"}})})]})},hl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"bar",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"bar",p,r,c);return x&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Ot,{chartType:"bar",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},en=t=>Ge.jsx(hl,{...t,isChartStacked:!0}),pl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l=aa,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"bar",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"horizontalBar",p,r,c);return u.indexAxis="y",x&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Ot,{chartType:"bar",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},tn=t=>Ge.jsx(pl,{...t,isChartStacked:!0}),bl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l=aa,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"line",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"line",p,r,c);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Ot,{chartType:"line",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},an=t=>Ge.jsx(bl,{...t,isChartStacked:!0}),gl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"area",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"area",p,r,c);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Ot,{chartType:"line",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},ln=t=>Ge.jsx(gl,{...t,isChartStacked:!0}),rn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.LegendList??[],[t]),c=Ce.useMemo(()=>ma(t,"pie",e,x),[t,e,x]),p=Ce.useMemo(()=>Qt(e,"pie",!1,l,r),[e]);return Ge.jsx(Ot,{chartType:"pie",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},nn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.LegendList??[],[t]),c=Ce.useMemo(()=>ma(t,"doughnut",e,x),[t,e,x]),p=Ce.useMemo(()=>{const m=Qt(e,"doughnut",!1,l,r),L=e.plotArea?.innerRadius;return L!=null&&(m.cutout=`${L}%`),m},[e]);return Ge.jsx(Ot,{chartType:"doughnut",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},sn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa})=>{const l=Ce.useMemo(()=>ma(t,"scatter",e,x),[t,e,x]),r=Ce.useMemo(()=>Qt(e,"scatter",!1),[e]);return Ge.jsx(Ot,{chartType:"scatter",data:l,options:r,formatOptions:e,clientWidth:n,clientHeight:o})},on=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(m=>m.properties),[t]),c=Ce.useMemo(()=>ma(t,"bubble",e,x),[t,e,x]),p=Ce.useMemo(()=>Qt(e,"bubble",!1,l,r),[e]);return Ge.jsx(Ot,{chartType:"bubble",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},cn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa})=>{const l=Ce.useMemo(()=>ma(t,"radar",e,x),[t,e,x]),r=Ce.useMemo(()=>{const c=Qt(e,"radar",!1);return delete c.scales,c.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0"},ticks:{color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt}},pointLabels:{color:e.xAxisLabel?.xAxisLabelColor??"#333333",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"11",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt}}}},c},[e]);return Ge.jsx(Ot,{chartType:"radar",data:l,options:r,formatOptions:e,clientWidth:n,clientHeight:o})},dn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.LegendList??[],[t]),c=Ce.useMemo(()=>ma(t,"polarArea",e,x),[t,e,x]),p=Ce.useMemo(()=>{const m=Qt(e,"polarArea",!1,l,r);delete m.scales;const L=e.xAxisLabel?.xAxisLabelFontStyle,u=Array.isArray(L)?L.includes("Italic")||L.includes("italic"):!1;return m.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0",display:e.plotArea?.gridLinesVisibility!==!1},ticks:{display:e.xAxisLabel?.xAxisLabelVisibility!==!1,color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt,style:u?"italic":"normal"}}}},m},[e]);return Ge.jsx(Ot,{chartType:"polarArea",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},yn=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"bar",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"bar",!1,l,r);return L.scales??={},L.scales.x??={},L.scales.y??={},L.scales.x.stacked=!0,L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Ot,{chartType:"bar",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})},un=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"horizontalBar",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"horizontalBar",!1,l,r);return L.indexAxis="y",L.scales??={},L.scales.x??={},L.scales.y??={},L.scales.x.stacked=!0,L.scales.y.stacked=!0,L.scales.x.min=p?-100:0,L.scales.x.max=100,L.scales.x.ticks={...L.scales.x.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Ot,{chartType:"bar",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})},xn=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"line",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"line",!1,l,r);return L.scales??={},L.scales.y??={},L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Ot,{chartType:"line",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})},hn=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"area",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"area",!1,l,r);return L.scales??={},L.scales.y??={},L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Ot,{chartType:"line",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})};Ze.AreaChart=Tr,Ze.BubbleChart=Ur,Ze.CJSAreaChart=gl,Ze.CJSBubbleChart=on,Ze.CJSColumnChart=hl,Ze.CJSDonutChart=nn,Ze.CJSHorizontalBarChart=pl,Ze.CJSLineChart=bl,Ze.CJSNormalizedStackAreaChart=hn,Ze.CJSNormalizedStackColumnChart=yn,Ze.CJSNormalizedStackHorizontalBarChart=un,Ze.CJSNormalizedStackLineChart=xn,Ze.CJSPieChart=rn,Ze.CJSPolarAreaChart=dn,Ze.CJSRadarChart=cn,Ze.CJSScatterChart=sn,Ze.CJSStackAreaChart=ln,Ze.CJSStackColumnChart=en,Ze.CJSStackHorizontalBarChart=tn,Ze.CJSStackLineChart=an,Ze.CJS_DEFAULT_COLORS=aa,Ze.ChartJSWrapper=Ot,Ze.ColumnChart=sr,Ze.ColumnHistogramChart=xr,Ze.CustomColumnChart=or,Ze.DonutChart=Sr,Ze.DotPlot=Gr,Ze.HorizontalBarChart=gr,Ze.HorizontalHistogramChart=fr,Ze.LayeredColumnChart=cr,Ze.LayeredHorizontalBarChart=mr,Ze.LineChart=hr,Ze.Maps=$r,Ze.NormalizedStackAreaChart=kr,Ze.NormalizedStackColumnChart=yr,Ze.NormalizedStackHorizontalBarChart=Lr,Ze.NormalizedStackLineChart=br,Ze.OrganizationChart=Yr,Ze.PieChart=Mr,Ze.PieofPie=wr,Ze.ProgressChart=Vr,Ze.PyramidChart=Dr,Ze.RadialBarChart=Pr,Ze.SankeyChart=Rr,Ze.ScatterChart=Br,Ze.Speedometer=Nr,Ze.StackAreaChart=vr,Ze.StackColumnChart=dr,Ze.StackHorizontalBarChart=Ar,Ze.StackLineChart=pr,Ze.TornadoChart=Hr,Ze.Treemap=Fr,Ze.VennChart=Er,Ze.WaterfallChart=Wr,Ze.WordCloud=Ir,Ze.hexToRgba=La,Ze.mapFormatOptionsToChartJS=Qt,Ze.transformToChartJSData=ma,Ze.transformToNormalizedChartJSData=oi,Object.defineProperty(Ze,Symbol.toStringTag,{value:"Module"})}));