@gen3/frontend 0.12.9 → 0.12.11

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.
Files changed (69) hide show
  1. package/LICENSE +201 -0
  2. package/dist/dts/components/Providers/Gen3Provider.d.ts +6 -6
  3. package/dist/dts/components/SegmentedControl.stories.d.ts +15 -15
  4. package/dist/dts/components/facets/FacetEnumList.d.ts.map +1 -1
  5. package/dist/dts/components/facets/FacetEnumList.js +3 -5
  6. package/dist/dts/components/facets/FacetEnumList.js.map +1 -1
  7. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +20 -20
  8. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManagerSlice.d.ts +1 -13
  9. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManagerSlice.d.ts.map +1 -1
  10. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManagerSlice.js +1 -1
  11. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManagerSlice.js.map +1 -1
  12. package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts +30 -2
  13. package/dist/dts/features/CohortDiscovery/RequestManagerSlice.d.ts.map +1 -1
  14. package/dist/dts/features/CohortSimilarity/cohortSimilarityApi.d.ts +6 -6
  15. package/dist/dts/features/DataLibrary/SearchAndActions.js.map +1 -1
  16. package/dist/dts/features/DataLibrary/modals/SelectedItemsModal.js +1 -1
  17. package/dist/dts/features/DataLibrary/modals/SelectedItemsModal.js.map +1 -1
  18. package/dist/dts/features/DataLibrary/selection/exportActions.js +2 -2
  19. package/dist/dts/features/DataLibrary/selection/exportActions.js.map +1 -1
  20. package/dist/dts/pages/Jobs/Jobs.d.ts +1 -0
  21. package/dist/dts/pages/Jobs/Jobs.d.ts.map +1 -0
  22. package/dist/dts/pages/Jobs/Jobs.js +2 -0
  23. package/dist/dts/pages/Jobs/Jobs.js.map +1 -0
  24. package/dist/dts/utils/index.d.ts +1 -2
  25. package/dist/dts/utils/index.d.ts.map +1 -1
  26. package/dist/dts/utils/index.js +1 -2
  27. package/dist/dts/utils/index.js.map +1 -1
  28. package/dist/index/cjs/QueryPanel-C-ixwuTh.js +24 -0
  29. package/dist/index/cjs/QueryPanel-C-ixwuTh.js.map +1 -0
  30. package/dist/index/cjs/QueryPanel-Df-i2v74.js +24 -0
  31. package/dist/index/cjs/QueryPanel-Df-i2v74.js.map +1 -0
  32. package/dist/index/cjs/index-BMyKO6qD.js +30930 -0
  33. package/dist/index/cjs/index-BMyKO6qD.js.map +1 -0
  34. package/dist/index/cjs/index-Dia_4amP.js +30930 -0
  35. package/dist/index/cjs/index-Dia_4amP.js.map +1 -0
  36. package/dist/index/cjs/index.js +1 -4
  37. package/dist/index/cjs/index.js.map +1 -1
  38. package/dist/index/esm/QueryPanel-Bx_ECLYq.js +22 -0
  39. package/dist/index/esm/QueryPanel-Bx_ECLYq.js.map +1 -0
  40. package/dist/index/esm/QueryPanel-Dse925g6.js +22 -0
  41. package/dist/index/esm/QueryPanel-Dse925g6.js.map +1 -0
  42. package/dist/index/esm/index-B0GVp0DQ.js +30688 -0
  43. package/dist/index/esm/index-B0GVp0DQ.js.map +1 -0
  44. package/dist/index/esm/index-CgwayH-W.js +30688 -0
  45. package/dist/index/esm/index-CgwayH-W.js.map +1 -0
  46. package/dist/index/esm/index.js +1 -2
  47. package/dist/index/esm/index.js.map +1 -1
  48. package/dist/index.d.ts +7 -10
  49. package/dist/pages/cjs/CohortBuilder-B1t2vpbg.js +482 -0
  50. package/dist/pages/cjs/CohortBuilder-B1t2vpbg.js.map +1 -0
  51. package/dist/pages/cjs/CohortBuilder-vrahe-85.js +482 -0
  52. package/dist/pages/cjs/CohortBuilder-vrahe-85.js.map +1 -0
  53. package/dist/pages/cjs/index-BQb_IxiU.js +22726 -0
  54. package/dist/pages/cjs/index-BQb_IxiU.js.map +1 -0
  55. package/dist/pages/cjs/index-DcjJdonn.js +22726 -0
  56. package/dist/pages/cjs/index-DcjJdonn.js.map +1 -0
  57. package/dist/pages/cjs/index.js +1 -2
  58. package/dist/pages/cjs/index.js.map +1 -1
  59. package/dist/pages/esm/CohortBuilder-4bldHVrA.js +479 -0
  60. package/dist/pages/esm/CohortBuilder-4bldHVrA.js.map +1 -0
  61. package/dist/pages/esm/CohortBuilder-CW4ukIlv.js +479 -0
  62. package/dist/pages/esm/CohortBuilder-CW4ukIlv.js.map +1 -0
  63. package/dist/pages/esm/index-DqZnojQ4.js +22644 -0
  64. package/dist/pages/esm/index-DqZnojQ4.js.map +1 -0
  65. package/dist/pages/esm/index-tUeKw47Y.js +22644 -0
  66. package/dist/pages/esm/index-tUeKw47Y.js.map +1 -0
  67. package/dist/pages/esm/index.js +1 -2
  68. package/dist/pages/esm/index.js.map +1 -1
  69. package/package.json +8 -9
@@ -1,4 +1,4 @@
1
- export { Y as AISearchPageGetServerSideProps, cD as AccessLevel, bj as AccordionPanel, bI as ActionBar, A as ActionButton, x as AdminAuthZPageGetServerSideProps, bH as AiSearch, X as AiSearchPage, c9 as AnalysisCenter, ca as AnalysisCenterWithSections, a6 as AnalysisEditorPage, a7 as AnalysisEditorPageGetServerSideProps, F as AnalysisPage, H as AnalysisPageGetServerSideProps, w as AuthzPage, bh as BAD_DATA_MESSAGE, bv as Banner, am as BaseModal, as as CardContainer, ax as Charts, b$ as CohortActionButton, bR as CohortBuilder, c1 as CohortDropdownActionButton, bS as CohortManager, bT as CohortManagerAndExpression, ay as CollapsableCharts, a as CollapsableSidebar, j as ColorThemePage, k as ColorThemePageGetServerSideProps, C as ContentSource, e as CountsValue, ap as CreateCredentialsAPIKeyModal, Z as CrosswalkPage, _ as CrosswalkPageGetServerSideProps, I as Custom403Page, K as Custom404Page, bi as DAYS_IN_YEAR, bg as DEFAULT_MAXIMUM, bf as DEFAULT_MINIMUM, be as DEFAULT_VISIBLE_ITEMS, l as DataDictionaryPage, a1 as DataLibraryPage, a2 as DataLibraryPageGetServerSideProps, af as DefaultAuthorizedRoutesConfig, m as DictionaryPageGetServerSideProps, bJ as DictionaryWithContext, bD as DiscoveryCellRendererFactory, bF as DiscoveryConfigProvider, by as DiscoveryIndexPanel, f as DiscoveryPage, g as DiscoveryPageGetServerSideProps, bE as DiscoveryRowRendererFactory, D as DownloadButton, c3 as DownloadsPanel, b as DropdownButton, bk as DropdownPanel, c as DropdownWithIcon, aw as EmptyTableMessage, aJ as EnumFacet, az as EnumFacetChart, E as ErrorCard, aK as ExactValueFacet, n as ExplorerPage, o as ExplorerPageGetServerSideProps, p as ExplorerPageGetServerSidePropsForConfigId, c2 as ExplorerTable, bU as ExplorerTableCellRendererFactory, bV as ExplorerTableDetailsPanelFactory, aO as FacetControlsHeader, aQ as FacetExpander, aI as FacetSelector, aP as FacetSortPanel, aN as FacetTabs, aR as FiltersPanel, an as FirstTimeModal, bo as Footer, G as Gen3Button, d as Gen3ButtonReverse, bp as Gen3Link, ar as Gen3ModalsProvider, u as Gen3Provider, c7 as GqlQueryEditor, bq as Header, br as HoverLink, bx as IconButton, J as JSONObjectDownloadButton, L as LandingPage, i as LandingPageGetServerSideProps, aj as LoginButton, r as LoginPage, s as LoginPageGetServerSideProps, al as LoginPanel, ak as LoginProvidersPanel, au as MessageCard, av as MessagePage, bK as MetadataDictionary, cB as MinutesToMilliseconds, aM as MultiSelectValueFacet, bu as NavPageLayout, bs as NavigationBar, bt as NavigationButton, aq as NoAccessModal, a3 as NotebookLitePage, a4 as NotebookLitePageGetStaticProps, cc as Profile, P as ProfilePage, q as ProfilePageGetServerSideProps, ah as ProfileProvider, bm as ProtectedContent, bn as ProtectedContentUI, bY as QueryExpression, c4 as QueryExpressionContext, bZ as QueryExpressionSection, Q as QueryPage, h as QueryPageGetServerSideProps, aL as RangeFacet, aA as ReactECharts, c6 as Repository, aa as RepositoryPage, ab as RepositoryPageGetServerSideProps, ai as ResourcesFilters, cm as SPECIAL_CASE_FIELDS, S as SegmentedControl, ao as SessionExpiredModal, bO as SinglePageStudyDetailsPanel, cb as StaticNotebookIFrame, bP as StudyDetailsPanel, bM as StudyGroup, bN as StudyGroupPanel, bL as StudyProvider, $ as SubmissionPage, a0 as SubmissionPageGetServerSideProps, b_ as TabbedCohortBuilder, a8 as TabbedCohortBuilderPage, a9 as TabbedCohortBuilderPageGetServerSideProps, bl as TabbedPanel, c5 as TableXPositionContext, bz as TagCloud, t as TailwindConfig, T as TopBar, U as UploadJSONButton, ag as User, at as WarningCard, c8 as Workspace, z as WorkspaceNoAccessPage, B as WorkspaceNoAccessPageServerSideProps, W as WorkspacePage, y as WorkspacePageGetServerSideProps, cC as accessibleFieldName, b6 as addIntersectionToIncludes, b4 as addUnion, ae as analysisApiCohortDiscovery, aB as capitalize, a_ as classifyFacets, b9 as compareKeysAscending, ba as compareKeysDescending, aG as computeRowSpan, cv as convertMinutesToMilliseconds, ch as convertPathsToTree, cw as convertSecondsToMilliseconds, b3 as convertToStringArray, ce as create10ColorAccessibleContrast, cd as create10ColorPallet, V as createMantineTheme, O as credentialsLogin, R as credentialsLogout, cu as extractObjectKey, b2 as extractRangeValues, aH as filterAggregationsDataKeys, ck as focusStyles, aU as getAllFieldsFromFilterConfigs, aV as getByPath, cf as getCurrentUnixTimestamp, cx as getFormattedTimestamp, cA as getHighResolutionTimestamp, v as getNavPageLayoutPropsFromConfig, ct as getParamsValueAsString, bQ as getTagInfo, cs as hasOwnProperty, cp as isArrayOfString, aT as isEnumFacetResponse, bw as isHeaderMetadata, cr as isPropertyKey, cq as isTextTransform, cy as isTimeGreaterThan, cE as itemsInCart, b8 as mapFacetSortToSortType, cz as measureExecutionTime, aW as processBucketData, aY as processDefinedRangeData, aE as processLabel, aX as processRangeData, aF as processRangeKeyLabel, bX as registerCohortBuilderDefaultPreviewRenderers, ac as registerCohortDiscoveryApp, ad as registerCohortSimilarityApp, bC as registerDefaultDiscoveryDataLoaders, bA as registerDiscoveryDefaultCellRenderers, bB as registerDiscoveryDefaultStudyPreviewRenderers, bW as registerExplorerDefaultCellRenderers, a5 as registerMetadataSchemaApp, b7 as removeIntersectionFromEnum, aD as removeKey, b5 as removeUnion, ci as resourcePathFromProjectID, N as sessionLogout, M as sessionToken, cl as stripTrailingSlash, co as toCountsString, cn as toDisplayName, aC as truncateString, cg as unixTimeToString, aZ as updateFacetEnum, bb as useClearFilters, bG as useDiscoveryContext, bc as useExtractEnumFilterValues, bd as useExtractRangeFilterValues, aS as useFieldNameToTitle, b1 as useGetFacetFilters, c0 as useGuppyActionButton, a$ as useUpdateFilters, b0 as useUpdateFiltersFlat, cj as userHasMethodForServiceOnResource, cF as validateObjectHasRequiredFields } from './index-BY3rApNY.js';
1
+ export { Y as AISearchPageGetServerSideProps, cB as AccessLevel, bj as AccordionPanel, bI as ActionBar, A as ActionButton, x as AdminAuthZPageGetServerSideProps, bH as AiSearch, X as AiSearchPage, c9 as AnalysisCenter, ca as AnalysisCenterWithSections, a6 as AnalysisEditorPage, a7 as AnalysisEditorPageGetServerSideProps, F as AnalysisPage, H as AnalysisPageGetServerSideProps, w as AuthzPage, bh as BAD_DATA_MESSAGE, bv as Banner, am as BaseModal, as as CardContainer, ax as Charts, b$ as CohortActionButton, bR as CohortBuilder, c1 as CohortDropdownActionButton, bS as CohortManager, bT as CohortManagerAndExpression, ay as CollapsableCharts, a as CollapsableSidebar, j as ColorThemePage, k as ColorThemePageGetServerSideProps, C as ContentSource, e as CountsValue, ap as CreateCredentialsAPIKeyModal, Z as CrosswalkPage, _ as CrosswalkPageGetServerSideProps, I as Custom403Page, K as Custom404Page, bi as DAYS_IN_YEAR, bg as DEFAULT_MAXIMUM, bf as DEFAULT_MINIMUM, be as DEFAULT_VISIBLE_ITEMS, l as DataDictionaryPage, a1 as DataLibraryPage, a2 as DataLibraryPageGetServerSideProps, af as DefaultAuthorizedRoutesConfig, m as DictionaryPageGetServerSideProps, bJ as DictionaryWithContext, bD as DiscoveryCellRendererFactory, bF as DiscoveryConfigProvider, by as DiscoveryIndexPanel, f as DiscoveryPage, g as DiscoveryPageGetServerSideProps, bE as DiscoveryRowRendererFactory, D as DownloadButton, c3 as DownloadsPanel, b as DropdownButton, bk as DropdownPanel, c as DropdownWithIcon, aw as EmptyTableMessage, aJ as EnumFacet, az as EnumFacetChart, E as ErrorCard, aK as ExactValueFacet, n as ExplorerPage, o as ExplorerPageGetServerSideProps, p as ExplorerPageGetServerSidePropsForConfigId, c2 as ExplorerTable, bU as ExplorerTableCellRendererFactory, bV as ExplorerTableDetailsPanelFactory, aO as FacetControlsHeader, aQ as FacetExpander, aI as FacetSelector, aP as FacetSortPanel, aN as FacetTabs, aR as FiltersPanel, an as FirstTimeModal, bo as Footer, G as Gen3Button, d as Gen3ButtonReverse, bp as Gen3Link, ar as Gen3ModalsProvider, u as Gen3Provider, c7 as GqlQueryEditor, bq as Header, br as HoverLink, bx as IconButton, J as JSONObjectDownloadButton, L as LandingPage, i as LandingPageGetServerSideProps, aj as LoginButton, r as LoginPage, s as LoginPageGetServerSideProps, al as LoginPanel, ak as LoginProvidersPanel, au as MessageCard, av as MessagePage, bK as MetadataDictionary, cz as MinutesToMilliseconds, aM as MultiSelectValueFacet, bu as NavPageLayout, bs as NavigationBar, bt as NavigationButton, aq as NoAccessModal, a3 as NotebookLitePage, a4 as NotebookLitePageGetStaticProps, cc as Profile, P as ProfilePage, q as ProfilePageGetServerSideProps, ah as ProfileProvider, bm as ProtectedContent, bn as ProtectedContentUI, bY as QueryExpression, c4 as QueryExpressionContext, bZ as QueryExpressionSection, Q as QueryPage, h as QueryPageGetServerSideProps, aL as RangeFacet, aA as ReactECharts, c6 as Repository, aa as RepositoryPage, ab as RepositoryPageGetServerSideProps, ai as ResourcesFilters, ck as SPECIAL_CASE_FIELDS, S as SegmentedControl, ao as SessionExpiredModal, bO as SinglePageStudyDetailsPanel, cb as StaticNotebookIFrame, bP as StudyDetailsPanel, bM as StudyGroup, bN as StudyGroupPanel, bL as StudyProvider, $ as SubmissionPage, a0 as SubmissionPageGetServerSideProps, b_ as TabbedCohortBuilder, a8 as TabbedCohortBuilderPage, a9 as TabbedCohortBuilderPageGetServerSideProps, bl as TabbedPanel, c5 as TableXPositionContext, bz as TagCloud, t as TailwindConfig, T as TopBar, U as UploadJSONButton, ag as User, at as WarningCard, c8 as Workspace, z as WorkspaceNoAccessPage, B as WorkspaceNoAccessPageServerSideProps, W as WorkspacePage, y as WorkspacePageGetServerSideProps, cA as accessibleFieldName, b6 as addIntersectionToIncludes, b4 as addUnion, ae as analysisApiCohortDiscovery, aB as capitalize, a_ as classifyFacets, b9 as compareKeysAscending, ba as compareKeysDescending, aG as computeRowSpan, ct as convertMinutesToMilliseconds, cf as convertPathsToTree, cu as convertSecondsToMilliseconds, b3 as convertToStringArray, V as createMantineTheme, O as credentialsLogin, R as credentialsLogout, cs as extractObjectKey, b2 as extractRangeValues, aH as filterAggregationsDataKeys, ci as focusStyles, aU as getAllFieldsFromFilterConfigs, aV as getByPath, cd as getCurrentUnixTimestamp, cv as getFormattedTimestamp, cy as getHighResolutionTimestamp, v as getNavPageLayoutPropsFromConfig, cr as getParamsValueAsString, bQ as getTagInfo, cq as hasOwnProperty, cn as isArrayOfString, aT as isEnumFacetResponse, bw as isHeaderMetadata, cp as isPropertyKey, co as isTextTransform, cw as isTimeGreaterThan, cC as itemsInCart, b8 as mapFacetSortToSortType, cx as measureExecutionTime, aW as processBucketData, aY as processDefinedRangeData, aE as processLabel, aX as processRangeData, aF as processRangeKeyLabel, bX as registerCohortBuilderDefaultPreviewRenderers, ac as registerCohortDiscoveryApp, ad as registerCohortSimilarityApp, bC as registerDefaultDiscoveryDataLoaders, bA as registerDiscoveryDefaultCellRenderers, bB as registerDiscoveryDefaultStudyPreviewRenderers, bW as registerExplorerDefaultCellRenderers, a5 as registerMetadataSchemaApp, b7 as removeIntersectionFromEnum, aD as removeKey, b5 as removeUnion, cg as resourcePathFromProjectID, N as sessionLogout, M as sessionToken, cj as stripTrailingSlash, cm as toCountsString, cl as toDisplayName, aC as truncateString, ce as unixTimeToString, aZ as updateFacetEnum, bb as useClearFilters, bG as useDiscoveryContext, bc as useExtractEnumFilterValues, bd as useExtractRangeFilterValues, aS as useFieldNameToTitle, b1 as useGetFacetFilters, c0 as useGuppyActionButton, a$ as useUpdateFilters, b0 as useUpdateFiltersFlat, ch as userHasMethodForServiceOnResource, cD as validateObjectHasRequiredFields } from './index-CgwayH-W.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@mantine/core';
@@ -18,7 +18,6 @@ import 'cookie';
18
18
  import '@gen3/core/server';
19
19
  import '@mantine/notifications';
20
20
  import '@mantine/hooks';
21
- import 'tinycolor2';
22
21
  import 'lodash';
23
22
  import 'tailwind-merge';
24
23
  import 'react-icons/io';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -805,9 +805,6 @@ interface DetailsPanelComponentProps extends Record<string, unknown> {
805
805
  row?: MRT_Row<Record<string, any>>;
806
806
  }
807
807
 
808
- declare const create10ColorPallet: (mainColor: string) => Record<string, string>;
809
- declare const create10ColorAccessibleContrast: (pallet: Record<string, string>) => Record<string, string>;
810
-
811
808
  type TenStringArray = [
812
809
  string?,
813
810
  string?,
@@ -2650,8 +2647,8 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2650
2647
  radius?: {
2651
2648
  [x: string & {}]: string | undefined;
2652
2649
  sm?: string | undefined;
2653
- md?: string | undefined;
2654
2650
  xs?: string | undefined;
2651
+ md?: string | undefined;
2655
2652
  lg?: string | undefined;
2656
2653
  xl?: string | undefined;
2657
2654
  } | undefined;
@@ -2660,40 +2657,40 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2660
2657
  [x: number]: string | undefined;
2661
2658
  [x: string & {}]: string | undefined;
2662
2659
  sm?: string | undefined;
2663
- md?: string | undefined;
2664
2660
  xs?: string | undefined;
2661
+ md?: string | undefined;
2665
2662
  lg?: string | undefined;
2666
2663
  xl?: string | undefined;
2667
2664
  } | undefined;
2668
2665
  fontSizes?: {
2669
2666
  [x: string & {}]: string | undefined;
2670
2667
  sm?: string | undefined;
2671
- md?: string | undefined;
2672
2668
  xs?: string | undefined;
2669
+ md?: string | undefined;
2673
2670
  lg?: string | undefined;
2674
2671
  xl?: string | undefined;
2675
2672
  } | undefined;
2676
2673
  lineHeights?: {
2677
2674
  [x: string & {}]: string | undefined;
2678
2675
  sm?: string | undefined;
2679
- md?: string | undefined;
2680
2676
  xs?: string | undefined;
2677
+ md?: string | undefined;
2681
2678
  lg?: string | undefined;
2682
2679
  xl?: string | undefined;
2683
2680
  } | undefined;
2684
2681
  breakpoints?: {
2685
2682
  [x: string & {}]: string | undefined;
2686
2683
  sm?: string | undefined;
2687
- md?: string | undefined;
2688
2684
  xs?: string | undefined;
2685
+ md?: string | undefined;
2689
2686
  lg?: string | undefined;
2690
2687
  xl?: string | undefined;
2691
2688
  } | undefined;
2692
2689
  shadows?: {
2693
2690
  [x: string & {}]: string | undefined;
2694
2691
  sm?: string | undefined;
2695
- md?: string | undefined;
2696
2692
  xs?: string | undefined;
2693
+ md?: string | undefined;
2697
2694
  lg?: string | undefined;
2698
2695
  xl?: string | undefined;
2699
2696
  } | undefined;
@@ -3156,5 +3153,5 @@ declare function export_default$1(req: NextApiRequest, res: NextApiResponse): Pr
3156
3153
 
3157
3154
  declare function export_default(req: NextApiRequest, res: NextApiResponse): Promise<void>;
3158
3155
 
3159
- export { AISearchPageGetServerSideProps, AccessLevel, AccordionPanel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, CardContainer, Charts, CohortActionButton, CohortBuilder, CohortDropdownActionButton, CohortManager, CohortManagerAndExpression, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, _default as ContentSource, CountsValue, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom403Page, Custom404Page, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS, DictionaryPage as DataDictionaryPage, DataLibraryPage, DataLibraryPageGetServerSideProps, DefaultAuthorizedRoutesConfig, DictionaryPageGetServerSideProps, DictionaryWithContext, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DownloadButton, DownloadsPanel, DropdownButton, DropdownPanel, DropdownWithIcon, EmptyTableMessage, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTable, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FiltersPanel, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor, Header, HoverLink, IconButton, JSONObjectDownloadButton, LandingPage, LandingPageGetServerSideProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MessageCard, MessagePage, MetadataDictionary, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, Profile, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, ProtectedContentUI, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, Repository, RepositoryPage, RepositoryPageGetServerSideProps, ResourcesFilters, SPECIAL_CASE_FIELDS, SegmentedControl, SessionExpiredModal, SinglePageStudyDetailsPanel, StaticNotebookIFrame, StudyDetailsPanel, StudyGroup, StudyGroupPanel, StudyProvider, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TabbedPanel, TableXPositionContext, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User$1 as User, WarningCard, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, export_default as analysisApiCohortDiscovery, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, export_default$2 as credentialsLogin, export_default$1 as credentialsLogout, extractObjectKey, extractRangeValues, filterAggregationsDataKeys, focusStyles, getAllFieldsFromFilterConfigs, getByPath, getCurrentUnixTimestamp, getFormattedTimestamp, getHighResolutionTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform, isTimeGreaterThan, itemsInCart, mapFacetSortToSortType, measureExecutionTime, processBucketData, processDefinedRangeData, processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey, removeUnion, resourcePathFromProjectID, export_default$3 as sessionLogout, handler as sessionToken, stripTrailingSlash, toCountsString, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters, useGuppyActionButton, useUpdateFilters, useUpdateFiltersFlat, userHasMethodForServiceOnResource, validateObjectHasRequiredFields };
3156
+ export { AISearchPageGetServerSideProps, AccessLevel, AccordionPanel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, CardContainer, Charts, CohortActionButton, CohortBuilder, CohortDropdownActionButton, CohortManager, CohortManagerAndExpression, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, _default as ContentSource, CountsValue, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom403Page, Custom404Page, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS, DictionaryPage as DataDictionaryPage, DataLibraryPage, DataLibraryPageGetServerSideProps, DefaultAuthorizedRoutesConfig, DictionaryPageGetServerSideProps, DictionaryWithContext, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DownloadButton, DownloadsPanel, DropdownButton, DropdownPanel, DropdownWithIcon, EmptyTableMessage, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTable, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FiltersPanel, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor, Header, HoverLink, IconButton, JSONObjectDownloadButton, LandingPage, LandingPageGetServerSideProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MessageCard, MessagePage, MetadataDictionary, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, Profile, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, ProtectedContentUI, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, Repository, RepositoryPage, RepositoryPageGetServerSideProps, ResourcesFilters, SPECIAL_CASE_FIELDS, SegmentedControl, SessionExpiredModal, SinglePageStudyDetailsPanel, StaticNotebookIFrame, StudyDetailsPanel, StudyGroup, StudyGroupPanel, StudyProvider, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TabbedPanel, TableXPositionContext, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User$1 as User, WarningCard, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, export_default as analysisApiCohortDiscovery, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, createMantineTheme, export_default$2 as credentialsLogin, export_default$1 as credentialsLogout, extractObjectKey, extractRangeValues, filterAggregationsDataKeys, focusStyles, getAllFieldsFromFilterConfigs, getByPath, getCurrentUnixTimestamp, getFormattedTimestamp, getHighResolutionTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform, isTimeGreaterThan, itemsInCart, mapFacetSortToSortType, measureExecutionTime, processBucketData, processDefinedRangeData, processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey, removeUnion, resourcePathFromProjectID, export_default$3 as sessionLogout, handler as sessionToken, stripTrailingSlash, toCountsString, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters, useGuppyActionButton, useUpdateFilters, useUpdateFiltersFlat, userHasMethodForServiceOnResource, validateObjectHasRequiredFields };
3160
3157
  export type { AnalysisCenterSection, AnalysisCenterWithSectionsConfiguration, AnalysisPageLayoutProps, AnalysisToolConfiguration, AuthorizationValues, AuthorizedRoutesConfig, BannerLevelCategories, BannerProps, CellRenderFunctionProps, CellRendererFunctionProps, ChartProps, ClearFacetFunction, ClearFacetHook, ClearIndexedFacetFunction, CohortBuilderCategoryConfig, CohortBuilderConfiguration, CohortBuilderProps, CohortBuilderTabCategoryConfig, CohortPanelConfiguration, CollapsableChartsPanelConfiguration, ConfigVersionAndName, CustomFacetHooks, DataAuthorization, DataDictionary, DataTypeConfigWithManifest, DictionaryConfig, DictionaryNode, DictionaryProps, DiscoveryConfig, DownloadButtonConfig, DropdownsWithButtonsProps, EnumChartProps, EnumFacetData, EnumFacetDataChangedFunction, EnumFacetDataHooks, EnumFacetResponse, EnumOperandValue, ExplorerPageProps, FacetCardProps, FacetCommonHooks, FacetDataFunctionType, FacetDataHooks, FacetHooks, FacetRequiredHooks, FacetResponse, FacetSortType, FacetValueLabel, FieldNameToTitleFunction, FieldToName, Fonts, FooterProps, FromToRange, FromToRangeValues, Gen3AppConfigData, GetEnumFacetDataFunction, GetFacetCombineModeFunction, GetFacetDataFunction, GetNumericRangeFacetDataFunction, GetRangeFacetDataFunction, GetRangeFacetWithDefinedRangesDataFunction, GetTotalCountsFunction, HeaderMetadata, HeaderProps, LoginConfig, ModalsConfig, NavPageLayoutProps, NavigationProps, NumericFacetCardProps, NumericFacetProps, NumericRangeFacetHooks, NumericUnits, ProfileConfig, QueryOptions, QueryPageLayoutProps, QueryProps, RangeBucketElement, RangeFacetDataHooks, RangeFacetResponse, RangeFromOp, RangeToOp, ReactEChartsProps, RegisteredIcons, RepositoryConfiguration, RouteConfig, RowRenderFunctionParams, SelectFacetFilterFunction, SelectedFields$1 as SelectedFields, SessionConfiguration, SetFacetCombineModeFunction, SortBy, SortType, StudyDetailsField, StylingMergeMode, StylingOverride, StylingOverrideWithMergeControl, SummaryChart, SummaryTable, TabConfig, TabbedCohortBuilderConfiguration, TabbedCohortBuilderFacetConfig, TableDetailsPanelProps, TabsConfig, TagData, TagsConfig, TenStringArray, TitleAndDescription, ToggleFacetDataHooks, TopBarProps, TopIconButtonPropsWithLink, UpdateFacetFilterFunction, UpdateFacetFilterHook, UploadFacetDataHooks, UserAuthMapping, WorkspaceConfig };
@@ -0,0 +1,482 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var useDeepCompare = require('use-deep-compare');
6
+ var core$1 = require('@mantine/core');
7
+ var lodash = require('lodash');
8
+ var core = require('@gen3/core');
9
+ var index = require('./index-BQb_IxiU.js');
10
+ require('echarts');
11
+ var hooks = require('@mantine/hooks');
12
+ require('victory');
13
+ require('react-icons/bs');
14
+ require('react-icons/io');
15
+ require('@mantine/form');
16
+ require('react-icons/md');
17
+ require('react-icons/ri');
18
+ require('react-icons/fa');
19
+ require('react-icons/pi');
20
+ require('@iconify-icon/react');
21
+ require('@mantine/modals');
22
+ require('tailwind-merge');
23
+ require('next/head');
24
+ require('next/link');
25
+ require('next/image');
26
+ require('next/router');
27
+ require('next/navigation');
28
+ require('cookies-next');
29
+ require('swr');
30
+ require('jose');
31
+ require('cookie');
32
+ require('@gen3/core/server');
33
+ require('@mantine/notifications');
34
+ require('react-markdown');
35
+ require('react-icons/ai');
36
+ require('remark-gfm');
37
+ require('fs');
38
+ require('path');
39
+ require('mantine-react-table');
40
+ require('react-icons/ti');
41
+ require('react-icons/fi');
42
+ require('react-minisearch');
43
+ require('minisearch');
44
+ require('file-saver');
45
+ require('tailwind-styled-components');
46
+ require('jsonpath-plus');
47
+ require('react-dom');
48
+ require('lodash/uniq');
49
+ require('lodash/sum');
50
+ require('react-icons/lu');
51
+ require('next/dynamic');
52
+ require('react-cookie');
53
+ require('default-composer');
54
+ require('filesize');
55
+ require('@dnd-kit/core');
56
+ require('@dnd-kit/sortable');
57
+ require('@dnd-kit/utilities');
58
+ require('@dnd-kit/modifiers');
59
+ require('universal-cookie');
60
+
61
+ const EmptyData = {};
62
+ /**
63
+ * CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
64
+ * It integrates with data services and facilitates visualization, filtering, and analysis tasks.
65
+ *
66
+ * @param {Object} props The properties required to configure the CohortPanel component.
67
+ * @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
68
+ * @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
69
+ * @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
70
+ * @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
71
+ * @param {Object} props.table Reference to the table configuration or component for displaying data.
72
+ * @param {string} props.tabTitle Title for the filter tab section.
73
+ * @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
74
+ * @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
75
+ * @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
76
+ * @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
77
+ *
78
+ * @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
79
+ * summary charts, cohort manager, and data display components.
80
+ */ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
81
+ const isSm = hooks.useMediaQuery('(min-width: 639px)');
82
+ const isMd = hooks.useMediaQuery('(min-width: 1373px)');
83
+ const isXl = hooks.useMediaQuery('(min-width: 1600px)');
84
+ const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
85
+ const sharedFiltersMap = core.useCoreSelector((state)=>core.selectSharedFilters(state));
86
+ const defaultDropdowns = React.useMemo(()=>dropdowns ?? {}, [
87
+ dropdowns
88
+ ]);
89
+ const defaultButtons = React.useMemo(()=>buttons ?? [], [
90
+ buttons
91
+ ]);
92
+ const numCols = React.useMemo(()=>{
93
+ if (isSm) return 1;
94
+ if (isMd) return 2;
95
+ if (isXl) return 4;
96
+ return 3;
97
+ }, [
98
+ isSm,
99
+ isMd,
100
+ isXl
101
+ ]);
102
+ const index$1 = guppyConfig.dataType;
103
+ const indexPrefix = guppyConfig?.indexPrefix ?? '';
104
+ const fields = React.useMemo(()=>index.getAllFieldsFromFilterConfigs(filters?.tabs ?? []), [
105
+ filters?.tabs
106
+ ]);
107
+ const coreDispatch = core.useCoreDispatch();
108
+ const [facetDefinitions, setFacetDefinitions] = React.useState({});
109
+ const [summaryCharts, setSummaryCharts] = React.useState({});
110
+ const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index$1));
111
+ const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
112
+ const allFiltersCollapsed = core.useCoreSelector((state)=>core.selectAllCohortFiltersCollapsed(state, index$1));
113
+ const toggleAllFiltersExpanded = (expand)=>{
114
+ coreDispatch(core.toggleCohortBuilderAllFilters({
115
+ expand,
116
+ index: index$1
117
+ }));
118
+ };
119
+ const clearAllFilters = React.useCallback(()=>{
120
+ coreDispatch(core.clearCohortFilters({
121
+ index: index$1
122
+ }));
123
+ }, [
124
+ coreDispatch,
125
+ index$1
126
+ ]);
127
+ const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
128
+ type: index$1,
129
+ fields: fields,
130
+ filters: cohortFilters,
131
+ accessibility: accessLevel,
132
+ queryId: cohortId,
133
+ indexPrefix: indexPrefix
134
+ });
135
+ const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
136
+ ...Object.keys(chartsSection?.charts ?? {}),
137
+ ...Object.keys(charts)
138
+ ], [
139
+ chartsSection?.charts,
140
+ charts
141
+ ]);
142
+ const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
143
+ type: index$1,
144
+ fields: chartKeys,
145
+ filters: cohortFilters,
146
+ accessibility: accessLevel,
147
+ filterSelf: true,
148
+ queryId: cohortId,
149
+ indexPrefix: indexPrefix
150
+ }, {
151
+ skip: chartKeys.length === 0
152
+ });
153
+ const cleanChartData = useDeepCompare.useDeepCompareMemo(()=>{
154
+ if (isChartSuccess && chartData) {
155
+ const cleanedData = {};
156
+ const totalCount = chartData._totalCount[0]?.count;
157
+ Object.keys(summaryCharts).forEach((key)=>{
158
+ if (!(key in chartData)) {
159
+ return;
160
+ } // handle missing key in data
161
+ // remove empty keys
162
+ cleanedData[key] = chartData[key].filter((x)=>typeof x.key !== 'string' ? true : x.key !== '');
163
+ const facetDef = facetDefinitions?.[key];
164
+ if (facetDef?.excludeValues) {
165
+ cleanedData[key] = cleanedData[key].filter((x)=>typeof x.key !== 'string' ? true : facetDef?.excludeValues?.includes(String(x.key)) === false);
166
+ }
167
+ if (cleanedData[key].length === 0 && totalCount) {
168
+ // if no keys adds back no data
169
+ cleanedData[key] = [
170
+ {
171
+ key: 'no data',
172
+ count: totalCount
173
+ }
174
+ ];
175
+ }
176
+ });
177
+ return cleanedData;
178
+ }
179
+ return chartData;
180
+ }, [
181
+ chartData,
182
+ isChartSuccess,
183
+ summaryCharts
184
+ ]);
185
+ const getEnumFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
186
+ let filters = undefined;
187
+ let combineMode = 'or';
188
+ if (field in cohortFilters.root) {
189
+ if (core.isIntersection(cohortFilters.root[field])) {
190
+ const intersectionFilters = index.removeIntersectionFromEnum(cohortFilters.root[field]);
191
+ if (intersectionFilters) {
192
+ filters = core.extractEnumFilterValue(intersectionFilters);
193
+ combineMode = 'and';
194
+ }
195
+ } else {
196
+ filters = core.extractEnumFilterValue(cohortFilters.root[field]);
197
+ }
198
+ }
199
+ return {
200
+ data: index.processBucketData(data?.[field]),
201
+ enumFilters: filters,
202
+ combineMode: combineMode,
203
+ isSuccess: isSuccess
204
+ };
205
+ }, [
206
+ cohortFilters.root,
207
+ data,
208
+ isSuccess
209
+ ]);
210
+ const getRangeFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
211
+ return {
212
+ data: index.processRangeData(data?.[field]),
213
+ filters: index.extractRangeValues(cohortFilters.root[field]),
214
+ isSuccess: isSuccess
215
+ };
216
+ }, [
217
+ data,
218
+ cohortFilters.root,
219
+ isSuccess
220
+ ]);
221
+ // Set up the hooks for the facet components to use based on the required index
222
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
223
+ // @ts-ignore
224
+ const facetDataHooks = useDeepCompare.useDeepCompareMemo(()=>{
225
+ return {
226
+ // TODO: see if there a better way to do this
227
+ enum: {
228
+ useGetFacetData: getEnumFacetData,
229
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
230
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
231
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
232
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
233
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
234
+ useGetCombineMode: lodash.partial(index.useCohortFilterCombineState, index$1),
235
+ useSetCombineMode: lodash.partial(index.useSetCohortFilterCombineState, index$1),
236
+ useFieldNameToTitle: index.useFieldNameToTitle,
237
+ useTotalCounts: undefined
238
+ },
239
+ exact: {
240
+ useGetFacetData: getEnumFacetData,
241
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
242
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
243
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
244
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
245
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
246
+ useFieldNameToTitle: index.useFieldNameToTitle,
247
+ useTotalCounts: undefined
248
+ },
249
+ multiselect: {
250
+ useGetFacetData: getEnumFacetData,
251
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
252
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
253
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
254
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
255
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
256
+ useFieldNameToTitle: index.useFieldNameToTitle,
257
+ useTotalCounts: undefined
258
+ },
259
+ range: {
260
+ useGetFacetData: getRangeFacetData,
261
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
262
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
263
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
264
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
265
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
266
+ useFieldNameToTitle: index.useFieldNameToTitle,
267
+ useTotalCounts: undefined
268
+ }
269
+ };
270
+ }, [
271
+ getEnumFacetData,
272
+ getRangeFacetData,
273
+ index$1
274
+ ]);
275
+ // Set the facet definitions based on the data only the first time the data is loaded
276
+ useDeepCompare.useDeepCompareEffect(()=>{
277
+ if (isSuccess && Object.keys(facetDefinitions).length === 0) {
278
+ const configFacetDefs = filters?.tabs.reduce((acc, tab)=>{
279
+ return {
280
+ ...tab.fieldsConfig,
281
+ ...acc
282
+ };
283
+ }, {});
284
+ const facetDefs = index.classifyFacets(data, index$1, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
285
+ setFacetDefinitions(facetDefs);
286
+ // setup summary charts since nested fields can be listed by the split field name
287
+ const chartDefinitions = chartsSection?.charts ?? charts;
288
+ const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
289
+ let chartField = field;
290
+ if (facetDefs?.[field] === undefined) {
291
+ const res = Object.values(facetDefs).filter((def)=>{
292
+ return def.dataField === field;
293
+ });
294
+ if (res.length > 0) {
295
+ chartField = res[0].field;
296
+ }
297
+ }
298
+ return {
299
+ ...acc,
300
+ [chartField]: chartDefinitions[field]
301
+ };
302
+ }, {});
303
+ setSummaryCharts(summaryCharts);
304
+ }
305
+ }, [
306
+ isSuccess,
307
+ data,
308
+ facetDefinitions,
309
+ index$1,
310
+ guppyConfig.fieldMapping,
311
+ charts,
312
+ chartsSection
313
+ ]);
314
+ const { data: counts, isFetching: isCountsFetching, isError: isCountsError } = core.useGetCountsQuery({
315
+ type: index$1,
316
+ filters: cohortFilters,
317
+ accessibility: accessLevel,
318
+ queryId: cohortId
319
+ });
320
+ if (isCountsError || isAggsQueryError) {
321
+ return /*#__PURE__*/ jsxRuntime.jsx(index.ErrorCard, {
322
+ message: "Unable to fetch data from server"
323
+ }); // TODO: replace with configurable message
324
+ }
325
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
326
+ className: "flex flex-col mt-3 relative px-4 bg-base-lightest w-full",
327
+ children: [
328
+ /*#__PURE__*/ jsxRuntime.jsx(index.QueryExpression, {
329
+ index: index$1
330
+ }),
331
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
332
+ className: "flex w-full",
333
+ children: [
334
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
335
+ id: "cohort-builder-filters",
336
+ className: "flex-shrink-0 md:w-1/4 lg:w-1/5",
337
+ children: filters?.tabs && /*#__PURE__*/ jsxRuntime.jsx(index.DropdownPanel, {
338
+ filters: filters,
339
+ tabTitle: tabTitle,
340
+ facetDefinitions: facetDefinitions,
341
+ facetDataHooks: facetDataHooks,
342
+ onAccessChange: setAccessLevel,
343
+ accessLevel: accessLevel,
344
+ showAccessLevel: showAccessLevel,
345
+ allFiltersCollapsed: allFiltersCollapsed,
346
+ toggleAllFiltersExpanded: toggleAllFiltersExpanded,
347
+ clearAllFilters: clearAllFilters
348
+ })
349
+ }),
350
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
351
+ id: "cohort-builder-content",
352
+ className: "flex flex-col md:w-3/4 lg:w-4/5 pl-4",
353
+ children: [
354
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
355
+ className: "flex justify-between mb-2 ml-2",
356
+ children: [
357
+ /*#__PURE__*/ jsxRuntime.jsx(index.DownloadsPanel, {
358
+ dropdowns: defaultDropdowns,
359
+ buttons: defaultButtons,
360
+ loginForDownload: loginForDownload,
361
+ index: index$1,
362
+ totalCount: counts ?? 0,
363
+ fields: table?.fields ?? [],
364
+ filter: cohortFilters
365
+ }),
366
+ /*#__PURE__*/ jsxRuntime.jsx(index.CountsValue, {
367
+ label: guppyConfig?.nodeCountTitle || index.toDisplayName(index$1),
368
+ configuration: guppyConfig?.nodeCountConfiguration,
369
+ counts: counts,
370
+ isFetching: isCountsFetching,
371
+ isError: isCountsError
372
+ })
373
+ ]
374
+ }),
375
+ chartsSection?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(index.CollapsableCharts, {
376
+ config: {
377
+ ...chartsSection,
378
+ charts: summaryCharts
379
+ },
380
+ data: cleanChartData ?? EmptyData,
381
+ isSuccess: isChartSuccess,
382
+ isFetching: isChartFetching,
383
+ isError: isChartError
384
+ }) : /*#__PURE__*/ jsxRuntime.jsx(index.Charts, {
385
+ charts: summaryCharts,
386
+ data: cleanChartData ?? EmptyData,
387
+ counts: counts,
388
+ isSuccess: isChartSuccess,
389
+ isError: isChartError,
390
+ numCols: numCols
391
+ }),
392
+ table?.enabled && /*#__PURE__*/ jsxRuntime.jsx("div", {
393
+ className: "mt-2 flex flex-col",
394
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.ExplorerTable, {
395
+ index: index$1,
396
+ tableConfig: table,
397
+ accessibility: accessLevel
398
+ })
399
+ })
400
+ ]
401
+ })
402
+ ]
403
+ })
404
+ ]
405
+ });
406
+ };
407
+
408
+ const TabsLayoutToComponentProp = (tabsLayout)=>{
409
+ if (!tabsLayout) {
410
+ return 'flex-start';
411
+ }
412
+ switch(tabsLayout){
413
+ case 'left':
414
+ {
415
+ return 'flex-start';
416
+ }
417
+ case 'right':
418
+ {
419
+ return 'flex-end';
420
+ }
421
+ case 'center':
422
+ {
423
+ return 'center';
424
+ }
425
+ default:
426
+ {
427
+ return 'flex-start';
428
+ }
429
+ }
430
+ };
431
+
432
+ const useGetCurrentCohort = ()=>{
433
+ return core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
434
+ };
435
+ const CohortBuilder = ({ explorerConfig, sharedFiltersMap = null, tabsLayout = 'left', enableCohortManager = true })=>{
436
+ const dispatch = core.useCoreDispatch();
437
+ dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
438
+ const configuration = useDeepCompare.useDeepCompareMemo(()=>explorerConfig, [
439
+ explorerConfig
440
+ ]);
441
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
442
+ className: "flex flex-col w-full mt-2",
443
+ children: [
444
+ enableCohortManager ? /*#__PURE__*/ jsxRuntime.jsx(index.CohortManager, {}) : null,
445
+ /*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
446
+ color: "primary.5",
447
+ variant: explorerConfig[0]?.tabType,
448
+ keepMounted: true,
449
+ defaultValue: explorerConfig[0].tabTitle,
450
+ children: [
451
+ /*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
452
+ className: "w-full",
453
+ justify: TabsLayoutToComponentProp(tabsLayout),
454
+ children: configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
455
+ value: panelConfig.tabTitle,
456
+ children: panelConfig.tabTitle
457
+ }, `${panelConfig.tabTitle}-tabList`))
458
+ }),
459
+ configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
460
+ value: panelConfig.tabTitle,
461
+ children: /*#__PURE__*/ jsxRuntime.jsx(CohortPanel, {
462
+ guppyConfig: panelConfig.guppyConfig,
463
+ chartsSection: panelConfig?.chartsSection,
464
+ charts: panelConfig?.charts,
465
+ filters: panelConfig.filters,
466
+ tabTitle: panelConfig.tabTitle,
467
+ table: panelConfig.table,
468
+ dropdowns: panelConfig.dropdowns,
469
+ buttons: panelConfig.buttons,
470
+ loginForDownload: panelConfig.loginForDownload,
471
+ sharedFiltersMap: panelConfig.sharedFiltersMap
472
+ }, `${panelConfig.tabTitle}-CohortPanel`)
473
+ }, `${panelConfig.tabTitle}-tabPanel`))
474
+ ]
475
+ })
476
+ ]
477
+ });
478
+ };
479
+
480
+ exports.default = CohortBuilder;
481
+ exports.useGetCurrentCohort = useGetCurrentCohort;
482
+ //# sourceMappingURL=CohortBuilder-B1t2vpbg.js.map