{"version":3,"file":"DonutChart-IocJI9Ir.cjs","names":["identity","descending","constant","array"],"sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Utils/getArc.ts","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n  return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n  return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","export default function(a, b) {\n  return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n  return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n  var value = identity,\n      sortValues = descending,\n      sort = null,\n      startAngle = constant(0),\n      endAngle = constant(tau),\n      padAngle = constant(0);\n\n  function pie(data) {\n    var i,\n        n = (data = array(data)).length,\n        j,\n        k,\n        sum = 0,\n        index = new Array(n),\n        arcs = new Array(n),\n        a0 = +startAngle.apply(this, arguments),\n        da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n        a1,\n        p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n        pa = p * (da < 0 ? -1 : 1),\n        v;\n\n    for (i = 0; i < n; ++i) {\n      if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n        sum += v;\n      }\n    }\n\n    // Optionally sort the arcs by previously-computed values or by data.\n    if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n    else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n    // Compute the arcs! They are stored in the original data's order.\n    for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n      j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n        data: data[j],\n        index: i,\n        value: v,\n        startAngle: a0,\n        endAngle: a1,\n        padAngle: p\n      };\n    }\n\n    return arcs;\n  }\n\n  pie.value = function(_) {\n    return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n  };\n\n  pie.sortValues = function(_) {\n    return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n  };\n\n  pie.sort = function(_) {\n    return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n  };\n\n  pie.startAngle = function(_) {\n    return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n  };\n\n  pie.endAngle = function(_) {\n    return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n  };\n\n  pie.padAngle = function(_) {\n    return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n  };\n\n  return pie;\n}\n","const polarToCartesian = (\r\n  centerX: number,\r\n  centerY: number,\r\n  radius: number,\r\n  angleInRadians: number,\r\n) => {\r\n  return {\r\n    x: centerX + radius * Math.cos(angleInRadians),\r\n    y: centerY + radius * Math.sin(angleInRadians),\r\n  };\r\n};\r\n\r\nexport function getArc(\r\n  x: number,\r\n  y: number,\r\n  radius: number,\r\n  startAngleInRadians: number,\r\n  endAngleInRadians: number,\r\n) {\r\n  const start = polarToCartesian(x, y, radius, startAngleInRadians);\r\n  const end = polarToCartesian(\r\n    x,\r\n    y,\r\n    radius,\r\n    Math.abs(endAngleInRadians - startAngleInRadians) === 2 * Math.PI\r\n      ? 0.999999 * endAngleInRadians\r\n      : endAngleInRadians,\r\n  );\r\n  const largeArcFlag = endAngleInRadians - startAngleInRadians <= Math.PI ? '0' : '1';\r\n  const d = ['M', start.x, start.y, 'A', radius, radius, 0, largeArcFlag, 1, end.x, end.y].join(\r\n    ' ',\r\n  );\r\n  return d;\r\n}\r\n","import { H2, P } from '@undp/design-system-react/Typography';\r\nimport { pie } from 'd3-shape';\r\nimport isEqual from 'fast-deep-equal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { isValidElement, type ReactElement, useRef, useState } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  DonutChartDataType,\r\n  PadZerosTypes,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { getArc } from '@/Utils/getArc';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\n\r\ninterface Props {\r\n  mainText?:\r\n    | string\r\n    | {\r\n        label: string;\r\n        suffix?: string;\r\n        prefix?: string;\r\n        locale?: string;\r\n        padZeros?: PadZerosTypes;\r\n        precision?: number;\r\n      }\r\n    | ReactElement;\r\n  radius: number;\r\n  colors: string[];\r\n  subNote?: string;\r\n  strokeWidth: number;\r\n  data: DonutChartDataType[];\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  colorDomain: string[];\r\n  resetSelectionOnDoubleClick: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  animate: AnimateDataType;\r\n  trackColor: string;\r\n  naLabel: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n  const {\r\n    mainText,\r\n    data,\r\n    radius,\r\n    colors,\r\n    subNote,\r\n    strokeWidth,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    onSeriesMouseClick,\r\n    colorDomain,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    styles,\r\n    classNames,\r\n    animate,\r\n    trackColor,\r\n    naLabel,\r\n  } = props;\r\n  const svgRef = useRef(null);\r\n  const isInView = useInView(svgRef, {\r\n    once: animate.once,\r\n    amount: animate.amount,\r\n  });\r\n  const pieData = pie()\r\n    .sort(null)\r\n    .startAngle(0)\r\n    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n    .value((d: any) => d.size);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n  const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n  const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n  return (\r\n    <>\r\n      <motion.svg\r\n        ref={svgRef}\r\n        width={`${radius * 2}px`}\r\n        height={`${radius * 2}px`}\r\n        viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n        direction='ltr'\r\n        className='mx-auto'\r\n      >\r\n        <motion.g transform={`translate(${radius} ${radius})`}>\r\n          {mainText || subNote ? (\r\n            <foreignObject\r\n              y={0 - (radius - strokeWidth)}\r\n              x={0 - (radius - strokeWidth)}\r\n              width={2 * (radius - strokeWidth)}\r\n              height={2 * (radius - strokeWidth)}\r\n            >\r\n              <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n                {mainText ? (\r\n                  isValidElement(mainText) ? (\r\n                    mainText\r\n                  ) : (\r\n                    <H2\r\n                      marginBottom='none'\r\n                      className='donut-main-text text-content-primary leading-xs text-center'\r\n                    >\r\n                      {typeof mainText === 'string'\r\n                        ? mainText\r\n                        : data.findIndex((d) => d.label === mainText.label) !== -1\r\n                          ? numberFormattingFunction(\r\n                              data[data.findIndex((d) => d.label === mainText.label)].size,\r\n                              naLabel,\r\n                              mainText.precision,\r\n                              mainText.prefix,\r\n                              mainText.suffix,\r\n                              mainText.locale,\r\n                              mainText.padZeros,\r\n                            )\r\n                          : naLabel}\r\n                    </H2>\r\n                  )\r\n                ) : null}\r\n                {subNote ? (\r\n                  <P\r\n                    marginBottom='none'\r\n                    size='base'\r\n                    leading='xs'\r\n                    className='donut-sub-note text-content-primary text-center font-bold'\r\n                  >\r\n                    {subNote}\r\n                  </P>\r\n                ) : typeof mainText === 'string' || !mainText || isValidElement(mainText) ? null : (\r\n                  <P\r\n                    size='base'\r\n                    marginBottom='none'\r\n                    leading='xs'\r\n                    className='donut-label text-content-primary text-center font-bold'\r\n                  >\r\n                    {mainText.label}\r\n                  </P>\r\n                )}\r\n              </div>\r\n            </foreignObject>\r\n          ) : null}\r\n          <circle\r\n            cx={0}\r\n            cy={0}\r\n            r={radius - strokeWidth / 2}\r\n            fill='none'\r\n            stroke={trackColor}\r\n            strokeWidth={strokeWidth}\r\n          />\r\n          <AnimatePresence>\r\n            {/* biome-ignore lint/suspicious/noExplicitAny: undefined data type */}\r\n            {pieData(data as any).map((d, i) => (\r\n              <motion.path\r\n                // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\r\n                key={i}\r\n                variants={{\r\n                  initial: {\r\n                    pathLength: 0,\r\n                    d: getArc(\r\n                      0,\r\n                      0,\r\n                      radius - strokeWidth / 2,\r\n                      d.startAngle - Math.PI / 2,\r\n                      d.endAngle - Math.PI / 2,\r\n                    ),\r\n                    opacity: mouseOverData\r\n                      ? // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n                        mouseOverData.label === (d.data as any).label\r\n                        ? 1\r\n                        : 0.3\r\n                      : 1,\r\n                  },\r\n                  whileInView: {\r\n                    pathLength: 1,\r\n                    d: getArc(\r\n                      0,\r\n                      0,\r\n                      radius - strokeWidth / 2,\r\n                      d.startAngle - Math.PI / 2,\r\n                      d.endAngle - Math.PI / 2,\r\n                    ),\r\n                    opacity: mouseOverData\r\n                      ? // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n                        mouseOverData.label === (d.data as any).label\r\n                        ? 1\r\n                        : 0.3\r\n                      : 1,\r\n                    transition: { duration: animate.duration },\r\n                  },\r\n                }}\r\n                initial='initial'\r\n                animate={isInView ? 'whileInView' : 'initial'}\r\n                exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                style={{\r\n                  stroke:\r\n                    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n                    colorDomain.indexOf((d.data as any).label) !== -1\r\n                      ? // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n                        colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n                      : Colors.gray,\r\n                  strokeWidth,\r\n                  fill: 'none',\r\n                }}\r\n                onMouseEnter={(event) => {\r\n                  setMouseOverData(d.data);\r\n                  setEventY(event.clientY);\r\n                  setEventX(event.clientX);\r\n                  onSeriesMouseOver?.(d);\r\n                }}\r\n                onClick={() => {\r\n                  if (onSeriesMouseClick || detailsOnClick) {\r\n                    if (isEqual(mouseClickData, d.data) && resetSelectionOnDoubleClick) {\r\n                      setMouseClickData(undefined);\r\n                      onSeriesMouseClick?.(undefined);\r\n                    } else {\r\n                      setMouseClickData(d.data);\r\n                      if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n                    }\r\n                  }\r\n                }}\r\n                onMouseMove={(event) => {\r\n                  setMouseOverData(d.data);\r\n                  setEventY(event.clientY);\r\n                  setEventX(event.clientX);\r\n                }}\r\n                onMouseLeave={() => {\r\n                  setMouseOverData(undefined);\r\n                  setEventX(undefined);\r\n                  setEventY(undefined);\r\n                  onSeriesMouseOver?.(undefined);\r\n                }}\r\n              />\r\n            ))}\r\n          </AnimatePresence>\r\n        </motion.g>\r\n      </motion.svg>\r\n      {mouseOverData && tooltip && eventX && eventY ? (\r\n        <Tooltip\r\n          data={mouseOverData}\r\n          body={tooltip}\r\n          xPos={eventX}\r\n          yPos={eventY}\r\n          backgroundStyle={styles?.tooltip}\r\n          className={classNames?.tooltip}\r\n        />\r\n      ) : null}\r\n      {detailsOnClick && mouseClickData !== undefined ? (\r\n        <DetailsModal\r\n          body={detailsOnClick}\r\n          data={mouseClickData}\r\n          setData={setMouseClickData}\r\n          className={classNames?.modal}\r\n        />\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n","import { cn } from '@undp/design-system-react/cn';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { type ReactElement, useRef } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { useElementSize } from '@/hooks/useElementSize';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  DonutChartDataType,\r\n  Languages,\r\n  NumberFormatOptions,\r\n  PadZerosTypes,\r\n  SourcesDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Graph } from './Graph';\r\n\r\ninterface Props {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: DonutChartDataType[];\r\n\r\n  // Titles, Labels, and Sources\r\n  /** Title of the graph */\r\n  graphTitle?: string | React.ReactNode;\r\n  /** Description of the graph */\r\n  graphDescription?: string | React.ReactNode;\r\n  /** Footnote for the graph */\r\n  footNote?: string | React.ReactNode;\r\n  /** Source data for the graph */\r\n  sources?: SourcesDataType[];\r\n  /** Accessibility label */\r\n  ariaLabel?: string;\r\n\r\n  // Colors and Styling\r\n  /** Array of colors for each segment */\r\n  colors?: string[];\r\n  /** Domain of colors for the graph */\r\n  colorDomain?: string[];\r\n  /** Background color of the graph */\r\n  backgroundColor?: string | boolean;\r\n  /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n  styles?: StyleObject;\r\n  /** Custom class names */\r\n  classNames?: ClassNameObject;\r\n\r\n  // Size and Spacing\r\n  /** Width of the graph */\r\n  width?: number;\r\n  /** Height of the graph */\r\n  height?: number;\r\n  /** Minimum height of the graph */\r\n  minHeight?: number;\r\n  /** Relative height scaling factor. This overwrites the height props */\r\n  relativeHeight?: number;\r\n  /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n  padding?: string;\r\n  /** Radius of the donut chart */\r\n  radius?: number;\r\n\r\n  // Graph Parameters\r\n  /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n  showColorScale?: boolean;\r\n  /** Max width of the color scale as a css property */\r\n  colorScaleMaxWidth?: string;\r\n  /** Stroke width of the arcs and circle of the donut  */\r\n  strokeWidth?: number;\r\n  /** Sorting order for data. This is overwritten by labelOrder prop */\r\n  sortData?: 'asc' | 'desc';\r\n  /** Toggles if the graph animates in when loaded.  */\r\n  animate?: boolean | AnimateDataType;\r\n  /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n  mainText?:\r\n    | string\r\n    | {\r\n        label: string;\r\n        suffix?: string;\r\n        prefix?: string;\r\n        locale?: string;\r\n        padZeros?: PadZerosTypes;\r\n        precision?: number;\r\n      }\r\n    | ReactElement;\r\n  /** Small text at the center of the donut chart */\r\n  subNote?: string;\r\n  /** Track color (i.e. the color of the donut chart's background) of the donut chart */\r\n  trackColor?: string;\r\n  /** Enable graph download option as png */\r\n  graphDownload?: boolean;\r\n  /** Enable data download option as a csv */\r\n  dataDownload?: boolean;\r\n  /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n  resetSelectionOnDoubleClick?: boolean;\r\n  /** Configuration options for controlling number formatting, localization, prefixes/suffixes, precision, and zero padding. */\r\n  numberDisplayOptions?: NumberFormatOptions;\r\n  /** Defines how “NA” values should be displayed/labelled in the graph */\r\n  naLabel?: string;\r\n\r\n  // Interactions and Callbacks\r\n  /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  /** Callback for mouse over event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  /** Callback for mouse click event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n\r\n  // Configuration and Options\r\n  /** Language setting  */\r\n  language?: Languages;\r\n  /** Color theme */\r\n  theme?: 'light' | 'dark';\r\n  /** Unique ID for the graph */\r\n  graphID?: string;\r\n}\r\n\r\nexport function DonutChart(props: Props) {\r\n  const {\r\n    mainText,\r\n    graphTitle,\r\n    colors = Colors.light.categoricalColors.colors,\r\n    sources,\r\n    strokeWidth = 50,\r\n    graphDescription,\r\n    subNote,\r\n    footNote,\r\n    radius,\r\n    data,\r\n    showColorScale = true,\r\n    padding,\r\n    backgroundColor = false,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    graphID,\r\n    onSeriesMouseClick,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    colorDomain,\r\n    sortData,\r\n    language = 'en',\r\n    theme = 'light',\r\n    width,\r\n    height,\r\n    minHeight = 0,\r\n    relativeHeight,\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick = true,\r\n    colorScaleMaxWidth,\r\n    detailsOnClick,\r\n    styles,\r\n    classNames,\r\n    animate = false,\r\n    trackColor = Colors.light.grays['gray-200'],\r\n    naLabel = 'NA',\r\n    numberDisplayOptions,\r\n  } = props;\r\n\r\n  const { graphDiv, graphRadius } = useElementSize<HTMLDivElement>();\r\n  const graphParentDiv = useRef<HTMLDivElement>(null);\r\n  const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\r\n  return (\r\n    <GraphContainer\r\n      className={classNames?.graphContainer}\r\n      style={styles?.graphContainer}\r\n      id={graphID}\r\n      ref={graphParentDiv}\r\n      aria-label={ariaLabel}\r\n      backgroundColor={backgroundColor}\r\n      theme={theme}\r\n      language={language}\r\n      minHeight={minHeight}\r\n      width={width}\r\n      height={height}\r\n      relativeHeight={relativeHeight}\r\n      padding={padding}\r\n    >\r\n      {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n        <GraphHeader\r\n          styles={{\r\n            title: styles?.title,\r\n            description: styles?.description,\r\n          }}\r\n          classNames={{\r\n            title: classNames?.title,\r\n            description: classNames?.description,\r\n          }}\r\n          graphTitle={graphTitle}\r\n          graphDescription={graphDescription}\r\n          width={width}\r\n          graphDownload={graphDownload ? graphParentDiv : undefined}\r\n          dataDownload={\r\n            dataDownload\r\n              ? data.map((d) => d.data).filter((d) => d !== undefined).length > 0\r\n                ? data.map((d) => d.data).filter((d) => d !== undefined)\r\n                : data.filter((d) => d !== undefined)\r\n              : null\r\n          }\r\n        />\r\n      ) : null}\r\n      {showColorScale && data.length > 0 ? (\r\n        <>\r\n          <div\r\n            className={cn(\r\n              'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n              classNames?.colorLegend,\r\n            )}\r\n            style={{ maxWidth: colorScaleMaxWidth }}\r\n          >\r\n            {sortedData.map((d) => (\r\n              <div className='flex gap-2 items-center pb-3' key={d.label}>\r\n                <div\r\n                  className='w-3 h-3 rounded-full'\r\n                  style={{\r\n                    backgroundColor:\r\n                      (colorDomain || sortedData.map((el) => el.label)).indexOf(d.label) !== -1\r\n                        ? (colors || Colors[theme].categoricalColors.colors)[\r\n                            (colorDomain || sortedData.map((el) => el.label)).indexOf(d.label) %\r\n                              (colors || Colors[theme].categoricalColors.colors).length\r\n                          ]\r\n                        : Colors.gray,\r\n                  }}\r\n                />\r\n                <P marginBottom='none' size='sm' className='text-content-primary'>\r\n                  {d.label}:{' '}\r\n                  <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n                    {numberFormattingFunction(\r\n                      d.size,\r\n                      naLabel,\r\n                      numberDisplayOptions?.precision,\r\n                      numberDisplayOptions?.prefix,\r\n                      numberDisplayOptions?.suffix,\r\n                      numberDisplayOptions?.locale,\r\n                      numberDisplayOptions?.padZeros,\r\n                    )}\r\n                  </span>\r\n                </P>\r\n              </div>\r\n            ))}\r\n          </div>\r\n          <Spacer size='lg' />\r\n        </>\r\n      ) : null}\r\n      <GraphArea ref={graphDiv}>\r\n        {data.length === 0 && <EmptyState />}\r\n        {graphRadius && data.length > 0 ? (\r\n          <Graph\r\n            mainText={mainText}\r\n            data={sortedData}\r\n            colors={colors}\r\n            radius={Math.min(graphRadius, radius ?? Infinity)}\r\n            subNote={subNote}\r\n            strokeWidth={strokeWidth}\r\n            tooltip={tooltip}\r\n            colorDomain={colorDomain || sortedData.map((d) => d.label)}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            onSeriesMouseClick={onSeriesMouseClick}\r\n            resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n            styles={styles}\r\n            detailsOnClick={detailsOnClick}\r\n            animate={\r\n              animate === true\r\n                ? { duration: 0.5, once: true, amount: 0.5 }\r\n                : animate || { duration: 0, once: true, amount: 0 }\r\n            }\r\n            trackColor={trackColor}\r\n            naLabel={naLabel}\r\n          />\r\n        ) : null}\r\n      </GraphArea>\r\n      {sources || footNote ? (\r\n        <GraphFooter\r\n          styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n          classNames={{\r\n            footnote: classNames?.footnote,\r\n            source: classNames?.source,\r\n          }}\r\n          sources={sources}\r\n          footNote={footNote}\r\n          width={width}\r\n        />\r\n      ) : null}\r\n    </GraphContainer>\r\n  );\r\n}\r\n"],"x_google_ignoreList":[0,1,2,3],"mappings":"mwBASA,IAAa,EAAK,KAAK,GACD,EAAK,EAC3B,IAAa,EAAM,EAAI,ECXvB,SAAA,EAAwB,EAAG,EAAG,CAC5B,OAAO,EAAI,EAAI,GAAK,EAAI,EAAI,EAAI,GAAK,EAAI,EAAI,GAC/C,CCFA,SAAA,EAAwB,EAAG,CACzB,OAAO,CACT,CCIA,SAAA,GAA0B,CACxB,IAAI,EAAQA,EACR,EAAaC,EACb,EAAO,KACP,EAAaC,EAAAA,EAAS,CAAC,EACvB,EAAWA,EAAAA,EAAS,CAAG,EACvB,EAAWA,EAAAA,EAAS,CAAC,EAEzB,SAAS,EAAI,EAAM,CACjB,IAAI,EACA,GAAK,EAAOC,EAAAA,EAAM,CAAI,GAAG,OACzB,EACA,EACA,EAAM,EACN,EAAY,MAAM,CAAC,EACnB,EAAW,MAAM,CAAC,EAClB,EAAK,CAAC,EAAW,MAAM,KAAM,SAAS,EACtC,EAAK,KAAK,IAAI,EAAK,KAAK,IAAI,CAAC,EAAK,EAAS,MAAM,KAAM,SAAS,EAAI,CAAE,CAAC,EACvE,EACA,EAAI,KAAK,IAAI,KAAK,IAAI,CAAE,EAAI,EAAG,EAAS,MAAM,KAAM,SAAS,CAAC,EAC9D,EAAK,GAAK,EAAK,EAAI,GAAK,GACxB,EAEJ,IAAK,EAAI,EAAG,EAAI,EAAG,EAAE,GACd,EAAI,EAAK,EAAM,GAAK,GAAK,CAAC,EAAM,EAAK,GAAI,EAAG,CAAI,GAAK,IACxD,GAAO,GASX,IAJI,GAAc,KACT,GAAQ,MAAM,EAAM,KAAK,SAAS,EAAG,EAAG,CAAE,OAAO,EAAK,EAAK,GAAI,EAAK,EAAE,CAAG,CAAC,EAD3D,EAAM,KAA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