{"version":3,"file":"SingleGraphDashboardGeoHubMaps-CZEffkvK.cjs","names":[],"sources":["../src/Components/Dashboard/PerformanceIntensive/GeoHubMapsEl.tsx","../src/Components/Dashboard/PerformanceIntensive/SingleGraphDashboardGeoHubMaps.tsx"],"sourcesContent":["import { P } from '@undp/design-system-react/Typography';\r\nimport type { GeoHubGraphType, GraphSettingsDataType } from '@/Types';\r\nimport { GeoHubCompareMaps } from '../../Graphs/Maps/GeoHubMaps/CompareMaps';\r\nimport { GeoHubMapWithLayerSelection } from '../../Graphs/Maps/GeoHubMaps/MapWithLayerSelection';\r\nimport { GeoHubMap } from '../../Graphs/Maps/GeoHubMaps/SimpleMap';\r\n\r\ninterface Props {\r\n  graph: GeoHubGraphType;\r\n  settings?: GraphSettingsDataType;\r\n  debugMode?: boolean;\r\n}\r\n\r\nfunction GeoHubMapsEl(props: Props) {\r\n  const { settings, graph, debugMode } = props;\r\n  if (debugMode) {\r\n    // biome-ignore lint/suspicious/noConsole: This is for debug mode\r\n    console.log(`Graph: ${graph}`);\r\n    // biome-ignore lint/suspicious/noConsole: This is for debug mode\r\n    console.log('Settings:', settings);\r\n  }\r\n  const graphComponents: Record<GeoHubGraphType, React.ElementType | null> = {\r\n    geoHubCompareMap: GeoHubCompareMaps,\r\n    geoHubMap: GeoHubMap,\r\n    geoHubMapWithLayerSelection: GeoHubMapWithLayerSelection,\r\n  };\r\n  const getGraphProps = (graphType: GeoHubGraphType) => {\r\n    switch (graphType) {\r\n      case 'geoHubCompareMap':\r\n        return {\r\n          theme: settings?.theme,\r\n          graphTitle: settings?.graphTitle,\r\n          sources: settings?.sources,\r\n          graphDescription: settings?.graphDescription,\r\n          footNote: settings?.footNote,\r\n          backgroundColor: settings?.backgroundColor,\r\n          padding: settings?.padding,\r\n          width: settings?.width,\r\n          height: settings?.height,\r\n          relativeHeight: settings?.relativeHeight,\r\n          graphID: settings?.graphID,\r\n          mapStyles: settings?.mapStyles as [string, string],\r\n          center: settings?.center,\r\n          zoomLevel: settings?.zoomLevel,\r\n          language: settings?.language,\r\n          minHeight: settings?.minHeight,\r\n          ariaLabel: settings?.ariaLabel,\r\n          styles: settings?.styles,\r\n          classNames: settings?.classNames,\r\n          mapLegend: settings?.mapLegend,\r\n        };\r\n      case 'geoHubMap':\r\n        return {\r\n          theme: settings?.theme,\r\n          mapStyle: settings?.mapStyle,\r\n          center: settings?.center,\r\n          zoomLevel: settings?.zoomLevel,\r\n          graphTitle: settings?.graphTitle,\r\n          sources: settings?.sources,\r\n          graphDescription: settings?.graphDescription,\r\n          footNote: settings?.footNote,\r\n          backgroundColor: settings?.backgroundColor,\r\n          padding: settings?.padding,\r\n          width: settings?.width,\r\n          height: settings?.height,\r\n          relativeHeight: settings?.relativeHeight,\r\n          graphID: settings?.graphID,\r\n          language: settings?.language,\r\n          minHeight: settings?.minHeight,\r\n          includeLayers: settings?.includeLayers,\r\n          excludeLayers: settings?.excludeLayers,\r\n          ariaLabel: settings?.ariaLabel,\r\n          uiMode: settings?.uiMode,\r\n          styles: settings?.styles,\r\n          classNames: settings?.classNames,\r\n          mapLegend: settings?.mapLegend,\r\n        };\r\n      case 'geoHubMapWithLayerSelection':\r\n        return {\r\n          theme: settings?.theme,\r\n          mapStyle: settings?.mapStyle,\r\n          center: settings?.center,\r\n          zoomLevel: settings?.zoomLevel,\r\n          graphTitle: settings?.graphTitle,\r\n          sources: settings?.sources,\r\n          graphDescription: settings?.graphDescription,\r\n          footNote: settings?.footNote,\r\n          backgroundColor: settings?.backgroundColor,\r\n          padding: settings?.padding,\r\n          width: settings?.width,\r\n          height: settings?.height,\r\n          relativeHeight: settings?.relativeHeight,\r\n          graphID: settings?.graphID,\r\n          language: settings?.language,\r\n          minHeight: settings?.minHeight,\r\n          layerSelection: settings?.layerSelection,\r\n          excludeLayers: settings?.excludeLayers,\r\n          ariaLabel: settings?.ariaLabel,\r\n          uiMode: settings?.uiMode,\r\n          mapLegend: settings?.mapLegend,\r\n        };\r\n      default:\r\n        return {};\r\n    }\r\n  };\r\n  const GraphComponent = graphComponents[graph];\r\n  const graphProps = getGraphProps(graph);\r\n  return (\r\n    <div\r\n      className={`grow my-0 mx-auto flex flex-col w-full justify-center ${settings?.theme || 'light'}`}\r\n      style={{ minHeight: 'inherit' }}\r\n    >\r\n      {GraphComponent ? (\r\n        <GraphComponent {...graphProps} />\r\n      ) : (\r\n        <P size='sm' marginBottom='none' className='p-2 text-center text-error'>\r\n          {`Invalid chart type: ${graph}`}\r\n        </P>\r\n      )}\r\n    </div>\r\n  );\r\n}\r\n\r\nexport default GeoHubMapsEl;\r\n","import { useRef } from 'react';\r\nimport { GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport type { GeoHubGraphType, GraphSettingsDataType } from '@/Types';\r\nimport GeoHubMapsEl from './GeoHubMapsEl';\r\n\r\ninterface Props {\r\n  graphSettings?: GraphSettingsDataType;\r\n  graphType: GeoHubGraphType;\r\n  debugMode?: boolean;\r\n  uiMode?: 'light' | 'normal';\r\n}\r\n\r\nexport function SingleGraphDashboardGeoHubMaps(props: Props) {\r\n  const { graphSettings, graphType, debugMode, uiMode = 'normal' } = props;\r\n  const graphParentDiv = useRef<HTMLDivElement>(null);\r\n  return (\r\n    <GraphContainer\r\n      className={graphSettings?.classNames?.graphContainer}\r\n      style={graphSettings?.styles?.graphContainer}\r\n      id={graphSettings?.graphID}\r\n      ref={graphParentDiv}\r\n      aria-label={graphSettings?.ariaLabel}\r\n      backgroundColor={graphSettings?.backgroundColor ?? false}\r\n      theme={graphSettings?.theme || 'light'}\r\n      language={graphSettings?.language || 'en'}\r\n      width={graphSettings?.width}\r\n      height={graphSettings?.height}\r\n      padding={graphSettings?.padding}\r\n      minHeight={graphSettings?.minHeight}\r\n      relativeHeight={graphSettings?.relativeHeight}\r\n    >\r\n      <GraphHeader\r\n        styles={{\r\n          title: graphSettings?.styles?.title,\r\n          description: graphSettings?.styles?.description,\r\n        }}\r\n        classNames={{\r\n          title: graphSettings?.classNames?.title,\r\n          description: graphSettings?.classNames?.description,\r\n        }}\r\n        graphTitle={graphSettings?.graphTitle}\r\n        graphDescription={graphSettings?.graphDescription}\r\n        width={graphSettings?.width}\r\n      />\r\n      <GeoHubMapsEl\r\n        graph={graphType}\r\n        debugMode={debugMode}\r\n        settings={{\r\n          ...(graphSettings || {}),\r\n          graphTitle: undefined,\r\n          graphDescription: undefined,\r\n          graphDownload: false,\r\n          dataDownload: false,\r\n          backgroundColor: undefined,\r\n          width: undefined,\r\n          height: undefined,\r\n          relativeHeight: undefined,\r\n          minHeight: undefined,\r\n          padding: '0',\r\n          uiMode,\r\n          theme: graphSettings?.theme,\r\n        }}\r\n      />\r\n    </GraphContainer>\r\n  );\r\n}\r\n"],"mappings":"wTAYA,SAAS,EAAa,EAAc,CAClC,GAAM,CAAE,WAAU,QAAO,aAAc,EACnC,IAEF,QAAQ,IAAI,UAAU,GAAO,EAE7B,QAAQ,IAAI,YAAa,CAAQ,GAEnC,IAAM,EAAqE,CACzE,iBAAkB,EAAA,EAClB,UAAW,EAAA,EACX,4BAA6B,EAAA,CAC/B,EACM,EAAiB,GAA+B,CACpD,OAAQ,EAAR,CACE,IAAK,mBACH,MAAO,CACL,MAAO,GAAU,MACjB,WAAY,GAAU,WACtB,QAAS,GAAU,QACnB,iBAAkB,GAAU,iBAC5B,SAAU,GAAU,SACpB,gBAAiB,GAAU,gBAC3B,QAAS,GAAU,QACnB,MAAO,GAAU,MACjB,OAAQ,GAAU,OAClB,eAAgB,GAAU,eAC1B,QAAS,GAAU,QACnB,UAAW,GAAU,UACrB,OAAQ,GAAU,OAClB,UAAW,GAAU,UACrB,SAAU,GAAU,SACpB,UAAW,GAAU,UACrB,UAAW,GAAU,UACrB,OAAQ,GAAU,OAClB,WAAY,GAAU,WACtB,UAAW,GAAU,SACvB,EACF,IAAK,YACH,MAAO,CACL,MAAO,GAAU,MACjB,SAAU,GAAU,SACpB,OAAQ,GAAU,OAClB,UAAW,GAAU,UACr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