@gen3/frontend 0.12.27 → 0.12.28

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 (65) hide show
  1. package/LICENSE +201 -0
  2. package/dist/dts/components/Login/LoginPanel.d.ts.map +1 -1
  3. package/dist/dts/components/Login/LoginPanel.js +6 -5
  4. package/dist/dts/components/Login/LoginPanel.js.map +1 -1
  5. package/dist/dts/components/Modals/FirstTimeModal/FirstTimeModal.d.ts +8 -0
  6. package/dist/dts/components/Modals/FirstTimeModal/FirstTimeModal.d.ts.map +1 -0
  7. package/dist/dts/components/Modals/FirstTimeModal/FirstTimeModal.js +18 -0
  8. package/dist/dts/components/Modals/FirstTimeModal/FirstTimeModal.js.map +1 -0
  9. package/dist/dts/components/Modals/FirstTimeModal/constants.d.ts +4 -0
  10. package/dist/dts/components/Modals/FirstTimeModal/constants.d.ts.map +1 -0
  11. package/dist/dts/components/Modals/FirstTimeModal/constants.js +4 -0
  12. package/dist/dts/components/Modals/FirstTimeModal/constants.js.map +1 -0
  13. package/dist/dts/components/Modals/FirstTimeModal/hooks.d.ts +6 -0
  14. package/dist/dts/components/Modals/FirstTimeModal/hooks.d.ts.map +1 -0
  15. package/dist/dts/components/Modals/FirstTimeModal/hooks.js +147 -0
  16. package/dist/dts/components/Modals/FirstTimeModal/hooks.js.map +1 -0
  17. package/dist/dts/components/Modals/Gen3ModalsProvider.d.ts.map +1 -1
  18. package/dist/dts/components/Modals/Gen3ModalsProvider.js +8 -5
  19. package/dist/dts/components/Modals/Gen3ModalsProvider.js.map +1 -1
  20. package/dist/dts/components/Modals/index.d.ts +1 -1
  21. package/dist/dts/components/Modals/index.d.ts.map +1 -1
  22. package/dist/dts/components/Modals/index.js +1 -1
  23. package/dist/dts/components/Modals/index.js.map +1 -1
  24. package/dist/dts/components/Modals/registerModals.d.ts +1 -1
  25. package/dist/dts/components/Modals/registerModals.js +1 -1
  26. package/dist/dts/components/Modals/registerModals.js.map +1 -1
  27. package/dist/dts/components/Protected/ProtectedContent.js +2 -2
  28. package/dist/dts/components/Protected/ProtectedContent.js.map +1 -1
  29. package/dist/dts/components/Providers/Gen3Provider.d.ts +8 -8
  30. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts.map +1 -1
  31. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js +0 -1
  32. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js.map +1 -1
  33. package/dist/dts/lib/session/session.d.ts.map +1 -1
  34. package/dist/dts/lib/session/session.js +0 -2
  35. package/dist/dts/lib/session/session.js.map +1 -1
  36. package/dist/index/cjs/QueryPanel-BkjrKzYj.js +24 -0
  37. package/dist/index/cjs/QueryPanel-BkjrKzYj.js.map +1 -0
  38. package/dist/index/cjs/QueryPanel-D0Ze-1lh.js +24 -0
  39. package/dist/index/cjs/QueryPanel-D0Ze-1lh.js.map +1 -0
  40. package/dist/index/cjs/index-B-xVuOyw.js +36150 -0
  41. package/dist/index/cjs/index-B-xVuOyw.js.map +1 -0
  42. package/dist/index/cjs/index-FptoXtMf.js +36152 -0
  43. package/dist/index/cjs/index-FptoXtMf.js.map +1 -0
  44. package/dist/index/cjs/index.js +1 -1
  45. package/dist/index/esm/QueryPanel-C0fpUSiO.js +22 -0
  46. package/dist/index/esm/QueryPanel-C0fpUSiO.js.map +1 -0
  47. package/dist/index/esm/QueryPanel-DPNOy5Cx.js +22 -0
  48. package/dist/index/esm/QueryPanel-DPNOy5Cx.js.map +1 -0
  49. package/dist/index/esm/index-MA9TBlCn.js +35908 -0
  50. package/dist/index/esm/index-MA9TBlCn.js.map +1 -0
  51. package/dist/index/esm/index-NeTIv_GG.js +35906 -0
  52. package/dist/index/esm/index-NeTIv_GG.js.map +1 -0
  53. package/dist/index/esm/index.js +1 -1
  54. package/dist/index.d.ts +9 -8
  55. package/dist/pages/cjs/CohortBuilder-BKL8oxQu.js +491 -0
  56. package/dist/pages/cjs/CohortBuilder-BKL8oxQu.js.map +1 -0
  57. package/dist/pages/cjs/index-DT5WB6Rc.js +27687 -0
  58. package/dist/pages/cjs/index-DT5WB6Rc.js.map +1 -0
  59. package/dist/pages/cjs/index.js +1 -1
  60. package/dist/pages/esm/CohortBuilder-CS38B1lp.js +488 -0
  61. package/dist/pages/esm/CohortBuilder-CS38B1lp.js.map +1 -0
  62. package/dist/pages/esm/index-BcDMox-y.js +27604 -0
  63. package/dist/pages/esm/index-BcDMox-y.js.map +1 -0
  64. package/dist/pages/esm/index.js +1 -1
  65. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- export { A as AISearchPageGetServerSideProps, a as AccessLevel, b as AccordionPanel, c as ActionBar, d as ActionButton, e as AdminAuthZPageGetServerSideProps, f as AiSearch, g as AiSearchPage, h as AnalysisCenter, i as AnalysisCenterWithSections, j as AnalysisEditorPage, k as AnalysisEditorPageGetServerSideProps, l as AnalysisPage, m as AnalysisPageGetServerSideProps, n as AuthzPage, B as BAD_DATA_MESSAGE, o as Banner, p as BaseModal, C as CardContainer, q as Charts, r as ClinicalDataAnalysisPage, s as ClinicalDataAnalysisServerSideProps, t as CohortActionButton, u as CohortBuilder, v as CohortDropdownActionButton, w as CohortManager, x as CohortManagerAndExpression, y as CollapsableCharts, z as CollapsableSidebar, D as ColorThemePage, E as ColorThemePageGetServerSideProps, F as ContentSource, G as CountsValue, H as CreateCredentialsAPIKeyModal, I as CrosswalkPage, J as CrosswalkPageGetServerSideProps, K as Custom403Page, L as Custom404Page, M as DAYS_IN_YEAR, N as DEFAULT_MAXIMUM, O as DEFAULT_MINIMUM, P as DEFAULT_VISIBLE_ITEMS, Q as DataDictionaryPage, R as DataLibraryPage, S as DataLibraryPageGetServerSideProps, T as DefaultAuthorizedRoutesConfig, U as DictionaryPageGetServerSideProps, V as DictionaryWithContext, W as DiscoveryCellRendererFactory, X as DiscoveryConfigProvider, Y as DiscoveryIndexPanel, Z as DiscoveryPage, _ as DiscoveryPageGetServerSideProps, $ as DownloadButton, a0 as DownloadsPanel, a1 as DropdownButton, a2 as DropdownPanel, a3 as DropdownWithIcon, a4 as EmptyTableMessage, a5 as EnumFacet, a6 as EnumFacetChart, a7 as ErrorCard, a8 as ExactValueFacet, a9 as ExplorerPage, aa as ExplorerPageGetServerSideProps, ab as ExplorerPageGetServerSidePropsForConfigId, ac as ExplorerTable, ad as ExplorerTableCellRendererFactory, ae as ExplorerTableDetailsPanelFactory, af as FacetControlsHeader, ag as FacetExpander, ah as FacetSelector, ai as FacetSortPanel, aj as FacetTabs, ak as FiltersPanel, al as FirstTimeModal, am as Footer, an as Gen3Button, ao as Gen3ButtonReverse, ap as Gen3Link, aq as Gen3ModalsProvider, ar as Gen3Provider, as as GqlQueryEditor, at as Header, au as HoverLink, av as IconButton, aw as JSONObjectDownloadButton, ax as LandingPage, ay as LandingPageGetServerSideProps, az as LoginButton, aA as LoginPage, aB as LoginPageGetServerSideProps, aC as LoginPanel, aD as LoginProvidersPanel, aE as MessageCard, aF as MessagePage, aG as MetadataDictionary, aH as MinutesToMilliseconds, aI as MultiSelectValueFacet, aJ as NavPageLayout, aK as NavigationBar, aL as NavigationButton, aM as NoAccessModal, aN as NotebookLitePage, aO as NotebookLitePageGetStaticProps, aP as Profile, aQ as ProfilePage, aR as ProfilePageGetServerSideProps, aS as ProfileProvider, aT as ProtectedContent, aU as ProtectedContentUI, aV as QueryExpression, aW as QueryExpressionContext, aX as QueryExpressionSection, aY as QueryPage, aZ as QueryPageGetServerSideProps, a_ as RangeFacet, a$ as ReactECharts, b0 as Repository, b1 as RepositoryPage, b2 as RepositoryPageGetServerSideProps, b3 as ResourcesFilters, b4 as SPECIAL_CASE_FIELDS, b5 as SegmentedControl, b6 as SessionExpiredModal, b7 as SinglePageStudyDetailsPanel, b8 as StaticNotebookIFrame, b9 as StudyDetailsPanel, ba as StudyGroup, bb as StudyGroupPanel, bc as StudyProvider, bd as SubmissionPage, be as SubmissionPageGetServerSideProps, bf as TabbedCohortBuilder, bg as TabbedCohortBuilderPage, bh as TabbedCohortBuilderPageGetServerSideProps, bi as TabbedPanel, bj as TableXPositionContext, bk as TagCloud, bl as TailwindConfig, bm as TopBar, bn as UploadJSONButton, bo as User, bp as WarningCard, bq as Workspace, br as WorkspaceNoAccessPage, bs as WorkspaceNoAccessPageServerSideProps, bt as WorkspacePage, bu as WorkspacePageGetServerSideProps, bv as accessibleFieldName, bw as addIntersectionToIncludes, bx as addUnion, by as analysisApiCohortDiscovery, bz as capitalize, bA as classifyFacets, bB as compareKeysAscending, bC as compareKeysDescending, bD as computeRowSpan, bE as convertMinutesToMilliseconds, bF as convertPathsToTree, bG as convertSecondsToMilliseconds, bH as convertToStringArray, bI as createCSSVariables, bJ as createLabelFromHistogramData, bK as createMantineTheme, bL as credentialsLogin, bM as credentialsLogout, bN as extractObjectKey, bO as extractRangeValues, bP as filterAggregationsDataKeys, bQ as focusStyles, bR as gen3Modals, bS as getAllFieldsFromFilterConfigs, bT as getByPath, bU as getCurrentUnixTimestamp, bV as getFormattedTimestamp, bW as getHighResolutionTimestamp, bX as getNavPageLayoutPropsFromConfig, bY as getParamsValueAsString, bZ as getTagInfo, b_ as hasOwnProperty, b$ as isArrayOfString, c0 as isEnumFacetResponse, c1 as isHeaderMetadata, c2 as isPropertyKey, c3 as isTextTransform, c4 as isTimeGreaterThan, c5 as itemsInCart, c6 as mapFacetSortToSortType, c7 as measureExecutionTime, c8 as processBucketData, c9 as processDefinedRangeData, ca as processLabel, cb as processRangeData, cc as processRangeKeyLabel, cd as registerCohortBuilderDefaultPreviewRenderers, ce as registerCohortDiscoveryApp, cf as registerCohortSimilarityApp, cg as registerDefaultDiscoveryDataLoaders, ch as registerDiscoveryDefaultCellRenderers, ci as registerExplorerDefaultCellRenderers, cj as registerMetadataSchemaApp, ck as removeIntersectionFromEnum, cl as removeKey, cm as removeUnion, cn as resourcePathFromProjectID, co as sessionLogout, cp as sessionToken, cq as stripTrailingSlash, cr as toDisplayName, cs as truncateString, ct as unixTimeToString, cu as updateFacetEnum, cv as useClearFilters, cw as useDiscoveryContext, cx as useExtractEnumFilterValues, cy as useExtractRangeFilterValues, cz as useFieldNameToLabel, cA as useGetFacetFilters, cB as useGuppyActionButton, cC as useUpdateFilters, cD as useUpdateFiltersFlat, cE as userHasMethodForServiceOnResource, cF as validateObjectHasRequiredFields } from './index-BA2pm07t.js';
1
+ export { A as AISearchPageGetServerSideProps, a as AccessLevel, b as AccordionPanel, c as ActionBar, d as ActionButton, e as AdminAuthZPageGetServerSideProps, f as AiSearch, g as AiSearchPage, h as AnalysisCenter, i as AnalysisCenterWithSections, j as AnalysisEditorPage, k as AnalysisEditorPageGetServerSideProps, l as AnalysisPage, m as AnalysisPageGetServerSideProps, n as AuthzPage, B as BAD_DATA_MESSAGE, o as Banner, p as BaseModal, C as CardContainer, q as Charts, r as ClinicalDataAnalysisPage, s as ClinicalDataAnalysisServerSideProps, t as CohortActionButton, u as CohortBuilder, v as CohortDropdownActionButton, w as CohortManager, x as CohortManagerAndExpression, y as CollapsableCharts, z as CollapsableSidebar, D as ColorThemePage, E as ColorThemePageGetServerSideProps, F as ContentSource, G as CountsValue, H as CreateCredentialsAPIKeyModal, I as CrosswalkPage, J as CrosswalkPageGetServerSideProps, K as Custom403Page, L as Custom404Page, M as DAYS_IN_YEAR, N as DEFAULT_MAXIMUM, O as DEFAULT_MINIMUM, P as DEFAULT_VISIBLE_ITEMS, Q as DataDictionaryPage, R as DataLibraryPage, S as DataLibraryPageGetServerSideProps, T as DefaultAuthorizedRoutesConfig, U as DictionaryPageGetServerSideProps, V as DictionaryWithContext, W as DiscoveryCellRendererFactory, X as DiscoveryConfigProvider, Y as DiscoveryIndexPanel, Z as DiscoveryPage, _ as DiscoveryPageGetServerSideProps, $ as DownloadButton, a0 as DownloadsPanel, a1 as DropdownButton, a2 as DropdownPanel, a3 as DropdownWithIcon, a4 as EmptyTableMessage, a5 as EnumFacet, a6 as EnumFacetChart, a7 as ErrorCard, a8 as ExactValueFacet, a9 as ExplorerPage, aa as ExplorerPageGetServerSideProps, ab as ExplorerPageGetServerSidePropsForConfigId, ac as ExplorerTable, ad as ExplorerTableCellRendererFactory, ae as ExplorerTableDetailsPanelFactory, af as FacetControlsHeader, ag as FacetExpander, ah as FacetSelector, ai as FacetSortPanel, aj as FacetTabs, ak as FiltersPanel, al as FirstTimeModal, am as Footer, an as Gen3Button, ao as Gen3ButtonReverse, ap as Gen3Link, aq as Gen3ModalsProvider, ar as Gen3Provider, as as GqlQueryEditor, at as Header, au as HoverLink, av as IconButton, aw as JSONObjectDownloadButton, ax as LandingPage, ay as LandingPageGetServerSideProps, az as LoginButton, aA as LoginPage, aB as LoginPageGetServerSideProps, aC as LoginPanel, aD as LoginProvidersPanel, aE as MessageCard, aF as MessagePage, aG as MetadataDictionary, aH as MinutesToMilliseconds, aI as MultiSelectValueFacet, aJ as NavPageLayout, aK as NavigationBar, aL as NavigationButton, aM as NoAccessModal, aN as NotebookLitePage, aO as NotebookLitePageGetStaticProps, aP as Profile, aQ as ProfilePage, aR as ProfilePageGetServerSideProps, aS as ProfileProvider, aT as ProtectedContent, aU as ProtectedContentUI, aV as QueryExpression, aW as QueryExpressionContext, aX as QueryExpressionSection, aY as QueryPage, aZ as QueryPageGetServerSideProps, a_ as RangeFacet, a$ as ReactECharts, b0 as Repository, b1 as RepositoryPage, b2 as RepositoryPageGetServerSideProps, b3 as ResourcesFilters, b4 as SPECIAL_CASE_FIELDS, b5 as SegmentedControl, b6 as SessionExpiredModal, b7 as SinglePageStudyDetailsPanel, b8 as StaticNotebookIFrame, b9 as StudyDetailsPanel, ba as StudyGroup, bb as StudyGroupPanel, bc as StudyProvider, bd as SubmissionPage, be as SubmissionPageGetServerSideProps, bf as TabbedCohortBuilder, bg as TabbedCohortBuilderPage, bh as TabbedCohortBuilderPageGetServerSideProps, bi as TabbedPanel, bj as TableXPositionContext, bk as TagCloud, bl as TailwindConfig, bm as TopBar, bn as UploadJSONButton, bo as User, bp as WarningCard, bq as Workspace, br as WorkspaceNoAccessPage, bs as WorkspaceNoAccessPageServerSideProps, bt as WorkspacePage, bu as WorkspacePageGetServerSideProps, bv as accessibleFieldName, bw as addIntersectionToIncludes, bx as addUnion, by as analysisApiCohortDiscovery, bz as capitalize, bA as classifyFacets, bB as compareKeysAscending, bC as compareKeysDescending, bD as computeRowSpan, bE as convertMinutesToMilliseconds, bF as convertPathsToTree, bG as convertSecondsToMilliseconds, bH as convertToStringArray, bI as createCSSVariables, bJ as createLabelFromHistogramData, bK as createMantineTheme, bL as credentialsLogin, bM as credentialsLogout, bN as extractObjectKey, bO as extractRangeValues, bP as filterAggregationsDataKeys, bQ as focusStyles, bR as gen3Modals, bS as getAllFieldsFromFilterConfigs, bT as getByPath, bU as getCurrentUnixTimestamp, bV as getFormattedTimestamp, bW as getHighResolutionTimestamp, bX as getNavPageLayoutPropsFromConfig, bY as getParamsValueAsString, bZ as getTagInfo, b_ as hasOwnProperty, b$ as isArrayOfString, c0 as isEnumFacetResponse, c1 as isHeaderMetadata, c2 as isPropertyKey, c3 as isTextTransform, c4 as isTimeGreaterThan, c5 as itemsInCart, c6 as mapFacetSortToSortType, c7 as measureExecutionTime, c8 as processBucketData, c9 as processDefinedRangeData, ca as processLabel, cb as processRangeData, cc as processRangeKeyLabel, cd as registerCohortBuilderDefaultPreviewRenderers, ce as registerCohortDiscoveryApp, cf as registerCohortSimilarityApp, cg as registerDefaultDiscoveryDataLoaders, ch as registerDiscoveryDefaultCellRenderers, ci as registerExplorerDefaultCellRenderers, cj as registerMetadataSchemaApp, ck as removeIntersectionFromEnum, cl as removeKey, cm as removeUnion, cn as resourcePathFromProjectID, co as sessionLogout, cp as sessionToken, cq as stripTrailingSlash, cr as toDisplayName, cs as truncateString, ct as unixTimeToString, cu as updateFacetEnum, cv as useClearFilters, cw as useDiscoveryContext, cx as useExtractEnumFilterValues, cy as useExtractRangeFilterValues, cz as useFieldNameToLabel, cA as useGetFacetFilters, cB as useGuppyActionButton, cC as useUpdateFilters, cD as useUpdateFiltersFlat, cE as userHasMethodForServiceOnResource, cF as validateObjectHasRequiredFields } from './index-NeTIv_GG.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@mantine/core';
package/dist/index.d.ts CHANGED
@@ -381,6 +381,7 @@ interface ModalsConfig {
381
381
 
382
382
  interface FirstTimeModalProps {
383
383
  config: FirstTimeModalConfig;
384
+ markSeen: (_arg: number) => void;
384
385
  }
385
386
  declare const FirstTimeModal: ({ context, id, innerProps, }: ContextModalProps<FirstTimeModalProps>) => react_jsx_runtime.JSX.Element;
386
387
 
@@ -2656,9 +2657,8 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2656
2657
  black?: string | undefined;
2657
2658
  colors?: {
2658
2659
  [x: string & {}]: _mantine_core.MantineColorsTuple | undefined;
2659
- green?: _mantine_core.MantineColorsTuple | undefined;
2660
- gray?: _mantine_core.MantineColorsTuple | undefined;
2661
2660
  dark?: _mantine_core.MantineColorsTuple | undefined;
2661
+ gray?: _mantine_core.MantineColorsTuple | undefined;
2662
2662
  red?: _mantine_core.MantineColorsTuple | undefined;
2663
2663
  pink?: _mantine_core.MantineColorsTuple | undefined;
2664
2664
  grape?: _mantine_core.MantineColorsTuple | undefined;
@@ -2666,6 +2666,7 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2666
2666
  indigo?: _mantine_core.MantineColorsTuple | undefined;
2667
2667
  blue?: _mantine_core.MantineColorsTuple | undefined;
2668
2668
  cyan?: _mantine_core.MantineColorsTuple | undefined;
2669
+ green?: _mantine_core.MantineColorsTuple | undefined;
2669
2670
  lime?: _mantine_core.MantineColorsTuple | undefined;
2670
2671
  yellow?: _mantine_core.MantineColorsTuple | undefined;
2671
2672
  orange?: _mantine_core.MantineColorsTuple | undefined;
@@ -2720,8 +2721,8 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2720
2721
  } | undefined;
2721
2722
  radius?: {
2722
2723
  [x: string & {}]: string | undefined;
2723
- sm?: string | undefined;
2724
2724
  xs?: string | undefined;
2725
+ sm?: string | undefined;
2725
2726
  md?: string | undefined;
2726
2727
  lg?: string | undefined;
2727
2728
  xl?: string | undefined;
@@ -2730,40 +2731,40 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2730
2731
  spacing?: {
2731
2732
  [x: number]: string | undefined;
2732
2733
  [x: string & {}]: string | undefined;
2733
- sm?: string | undefined;
2734
2734
  xs?: string | undefined;
2735
+ sm?: string | undefined;
2735
2736
  md?: string | undefined;
2736
2737
  lg?: string | undefined;
2737
2738
  xl?: string | undefined;
2738
2739
  } | undefined;
2739
2740
  fontSizes?: {
2740
2741
  [x: string & {}]: string | undefined;
2741
- sm?: string | undefined;
2742
2742
  xs?: string | undefined;
2743
+ sm?: string | undefined;
2743
2744
  md?: string | undefined;
2744
2745
  lg?: string | undefined;
2745
2746
  xl?: string | undefined;
2746
2747
  } | undefined;
2747
2748
  lineHeights?: {
2748
2749
  [x: string & {}]: string | undefined;
2749
- sm?: string | undefined;
2750
2750
  xs?: string | undefined;
2751
+ sm?: string | undefined;
2751
2752
  md?: string | undefined;
2752
2753
  lg?: string | undefined;
2753
2754
  xl?: string | undefined;
2754
2755
  } | undefined;
2755
2756
  breakpoints?: {
2756
2757
  [x: string & {}]: string | undefined;
2757
- sm?: string | undefined;
2758
2758
  xs?: string | undefined;
2759
+ sm?: string | undefined;
2759
2760
  md?: string | undefined;
2760
2761
  lg?: string | undefined;
2761
2762
  xl?: string | undefined;
2762
2763
  } | undefined;
2763
2764
  shadows?: {
2764
2765
  [x: string & {}]: string | undefined;
2765
- sm?: string | undefined;
2766
2766
  xs?: string | undefined;
2767
+ sm?: string | undefined;
2767
2768
  md?: string | undefined;
2768
2769
  lg?: string | undefined;
2769
2770
  xl?: string | undefined;
@@ -0,0 +1,491 @@
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 _ = require('lodash');
8
+ var core = require('@gen3/core');
9
+ var index = require('./index-DT5WB6Rc.js');
10
+ var hooks = require('@mantine/hooks');
11
+ require('victory');
12
+ require('react-icons/bs');
13
+ require('react-icons/io');
14
+ require('@mantine/form');
15
+ require('react-icons/md');
16
+ require('react-icons/ri');
17
+ require('react-icons/fa');
18
+ require('react-icons/pi');
19
+ require('@iconify-icon/react');
20
+ require('@mantine/modals');
21
+ require('tailwind-merge');
22
+ require('next/head');
23
+ require('next/link');
24
+ require('next/image');
25
+ require('next/router');
26
+ require('next/navigation');
27
+ require('cookies-next');
28
+ require('swr');
29
+ require('jose');
30
+ require('cookie');
31
+ require('@gen3/core/server');
32
+ require('@mantine/notifications');
33
+ require('react-markdown');
34
+ require('react-icons/ai');
35
+ require('remark-gfm');
36
+ require('fs');
37
+ require('path');
38
+ require('mantine-react-table');
39
+ require('react-icons/ti');
40
+ require('react-icons/fi');
41
+ require('react-minisearch');
42
+ require('minisearch');
43
+ require('echarts');
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('@tanstack/react-table');
52
+ require('typescript-pluralize');
53
+ require('next/dynamic');
54
+ require('rehype-sanitize');
55
+ require('react-cookie');
56
+ require('default-composer');
57
+ require('filesize');
58
+ require('@dnd-kit/core');
59
+ require('@dnd-kit/sortable');
60
+ require('@dnd-kit/utilities');
61
+ require('@dnd-kit/modifiers');
62
+ require('universal-cookie');
63
+
64
+ const toDisplayName = (field)=>{
65
+ const parsed = field.split('.');
66
+ const fieldName = parsed.at(-1);
67
+ if (!fieldName) return 'NotSet';
68
+ return fieldName.split('_').map((w)=>_.capitalize(w)).join(' ');
69
+ };
70
+
71
+ const EmptyData = {};
72
+ /**
73
+ * CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
74
+ * It integrates with data services and facilitates visualization, filtering, and analysis tasks.
75
+ *
76
+ * @param {Object} props The properties required to configure the CohortPanel component.
77
+ * @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
78
+ * @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
79
+ * @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
80
+ * @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
81
+ * @param {Object} props.table Reference to the table configuration or component for displaying data.
82
+ * @param {string} props.tabTitle Title for the filter tab section.
83
+ * @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
84
+ * @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
85
+ * @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
86
+ * @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
87
+ *
88
+ * @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
89
+ * summary charts, cohort manager, and data display components.
90
+ */ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
91
+ const isSm = hooks.useMediaQuery('(min-width: 639px)');
92
+ const isMd = hooks.useMediaQuery('(min-width: 1373px)');
93
+ const isXl = hooks.useMediaQuery('(min-width: 1600px)');
94
+ const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
95
+ const sharedFiltersMap = core.useCoreSelector((state)=>core.selectSharedFilters(state));
96
+ const defaultDropdowns = React.useMemo(()=>dropdowns ?? {}, [
97
+ dropdowns
98
+ ]);
99
+ const defaultButtons = React.useMemo(()=>buttons ?? [], [
100
+ buttons
101
+ ]);
102
+ const numCols = React.useMemo(()=>{
103
+ if (isSm) return 1;
104
+ if (isMd) return 2;
105
+ if (isXl) return 4;
106
+ return 3;
107
+ }, [
108
+ isSm,
109
+ isMd,
110
+ isXl
111
+ ]);
112
+ const index$1 = guppyConfig.dataType;
113
+ const indexPrefix = guppyConfig?.indexPrefix ?? '';
114
+ const fields = React.useMemo(()=>index.getAllFieldsFromFilterConfigs(filters?.tabs ?? []), [
115
+ filters?.tabs
116
+ ]);
117
+ const coreDispatch = core.useCoreDispatch();
118
+ const [facetDefinitions, setFacetDefinitions] = React.useState({});
119
+ const [summaryCharts, setSummaryCharts] = React.useState({});
120
+ const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index$1));
121
+ const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
122
+ const allFiltersCollapsed = core.useCoreSelector((state)=>core.selectAllCohortFiltersCollapsed(state, index$1));
123
+ const toggleAllFiltersExpanded = (expand)=>{
124
+ coreDispatch(core.toggleCohortBuilderAllFilters({
125
+ expand,
126
+ index: index$1
127
+ }));
128
+ };
129
+ const clearAllFilters = React.useCallback(()=>{
130
+ coreDispatch(core.clearCohortFilters({
131
+ index: index$1
132
+ }));
133
+ }, [
134
+ coreDispatch,
135
+ index$1
136
+ ]);
137
+ const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
138
+ type: index$1,
139
+ fields: fields,
140
+ filters: cohortFilters,
141
+ accessibility: accessLevel,
142
+ queryId: cohortId,
143
+ indexPrefix: indexPrefix
144
+ });
145
+ const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
146
+ ...Object.keys(chartsSection?.charts ?? {}),
147
+ ...Object.keys(charts)
148
+ ], [
149
+ chartsSection?.charts,
150
+ charts
151
+ ]);
152
+ const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
153
+ type: index$1,
154
+ fields: chartKeys,
155
+ filters: cohortFilters,
156
+ accessibility: accessLevel,
157
+ filterSelf: true,
158
+ queryId: cohortId,
159
+ indexPrefix: indexPrefix
160
+ }, {
161
+ skip: chartKeys.length === 0
162
+ });
163
+ const cleanChartData = useDeepCompare.useDeepCompareMemo(()=>{
164
+ if (isChartSuccess && chartData) {
165
+ const cleanedData = {};
166
+ const totalCount = chartData._totalCount[0]?.count;
167
+ Object.keys(summaryCharts).forEach((key)=>{
168
+ if (!(key in chartData)) {
169
+ return;
170
+ } // handle missing key in data
171
+ // remove empty keys
172
+ cleanedData[key] = chartData[key].filter((x)=>typeof x.key !== 'string' ? true : x.key !== '');
173
+ const facetDef = facetDefinitions?.[key];
174
+ if (facetDef?.excludeValues) {
175
+ cleanedData[key] = cleanedData[key].filter((x)=>typeof x.key !== 'string' ? true : facetDef?.excludeValues?.includes(String(x.key)) === false);
176
+ }
177
+ if (cleanedData[key].length === 0 && totalCount) {
178
+ // if no keys adds back no data
179
+ cleanedData[key] = [
180
+ {
181
+ key: 'no data',
182
+ count: totalCount
183
+ }
184
+ ];
185
+ }
186
+ });
187
+ return cleanedData;
188
+ }
189
+ return chartData;
190
+ }, [
191
+ chartData,
192
+ isChartSuccess,
193
+ summaryCharts
194
+ ]);
195
+ const getEnumFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
196
+ let filters = undefined;
197
+ let combineMode = 'or';
198
+ if (field in cohortFilters.root) {
199
+ if (core.isIntersection(cohortFilters.root[field])) {
200
+ const intersectionFilters = index.removeIntersectionFromEnum(cohortFilters.root[field]);
201
+ if (intersectionFilters) {
202
+ filters = core.extractEnumFilterValue(intersectionFilters);
203
+ combineMode = 'and';
204
+ }
205
+ } else {
206
+ filters = core.extractEnumFilterValue(cohortFilters.root[field]);
207
+ }
208
+ }
209
+ return {
210
+ data: index.processBucketData(data?.[field]),
211
+ enumFilters: filters,
212
+ combineMode: combineMode,
213
+ isSuccess: isSuccess
214
+ };
215
+ }, [
216
+ cohortFilters.root,
217
+ data,
218
+ isSuccess
219
+ ]);
220
+ const getRangeFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
221
+ return {
222
+ data: index.processRangeData(data?.[field]),
223
+ filters: index.extractRangeValues(cohortFilters.root[field]),
224
+ isSuccess: isSuccess
225
+ };
226
+ }, [
227
+ data,
228
+ cohortFilters.root,
229
+ isSuccess
230
+ ]);
231
+ // Set up the hooks for the facet components to use based on the required index
232
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
233
+ // @ts-ignore
234
+ const facetDataHooks = useDeepCompare.useDeepCompareMemo(()=>{
235
+ return {
236
+ // TODO: see if there a better way to do this
237
+ enum: {
238
+ useGetFacetData: getEnumFacetData,
239
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
240
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
241
+ useClearFilter: _.partial(index.useClearFilters, index$1),
242
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
243
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
244
+ useGetCombineMode: _.partial(index.useCohortFilterCombineState, index$1),
245
+ useSetCombineMode: _.partial(index.useSetCohortFilterCombineState, index$1),
246
+ useFieldNameToLabel: index.useFieldNameToLabel,
247
+ useTotalCounts: undefined
248
+ },
249
+ exact: {
250
+ useGetFacetData: getEnumFacetData,
251
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
252
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
253
+ useClearFilter: _.partial(index.useClearFilters, index$1),
254
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
255
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
256
+ useFieldNameToLabel: index.useFieldNameToLabel,
257
+ useTotalCounts: undefined
258
+ },
259
+ multiselect: {
260
+ useGetFacetData: getEnumFacetData,
261
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
262
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
263
+ useClearFilter: _.partial(index.useClearFilters, index$1),
264
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
265
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
266
+ useFieldNameToLabel: index.useFieldNameToLabel,
267
+ useTotalCounts: undefined
268
+ },
269
+ range: {
270
+ useGetFacetData: getRangeFacetData,
271
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
272
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
273
+ useClearFilter: _.partial(index.useClearFilters, index$1),
274
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
275
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
276
+ useFieldNameToLabel: index.useFieldNameToLabel,
277
+ useTotalCounts: undefined
278
+ }
279
+ };
280
+ }, [
281
+ getEnumFacetData,
282
+ getRangeFacetData,
283
+ index$1
284
+ ]);
285
+ // Set the facet definitions based on the data only the first time the data is loaded
286
+ useDeepCompare.useDeepCompareEffect(()=>{
287
+ if (isSuccess && Object.keys(facetDefinitions).length === 0) {
288
+ const configFacetDefs = filters?.tabs.reduce((acc, tab)=>{
289
+ return {
290
+ ...tab.fieldsConfig,
291
+ ...acc
292
+ };
293
+ }, {});
294
+ const facetDefs = index.classifyFacets(data, index$1, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
295
+ setFacetDefinitions(facetDefs);
296
+ // setup summary charts since nested fields can be listed by the split field name
297
+ const chartDefinitions = chartsSection?.charts ?? charts;
298
+ const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
299
+ let chartField = field;
300
+ if (facetDefs?.[field] === undefined) {
301
+ const res = Object.values(facetDefs).filter((def)=>{
302
+ return def.dataField === field;
303
+ });
304
+ if (res.length > 0) {
305
+ chartField = res[0].field;
306
+ }
307
+ }
308
+ return {
309
+ ...acc,
310
+ [chartField]: chartDefinitions[field]
311
+ };
312
+ }, {});
313
+ setSummaryCharts(summaryCharts);
314
+ }
315
+ }, [
316
+ isSuccess,
317
+ data,
318
+ facetDefinitions,
319
+ index$1,
320
+ guppyConfig.fieldMapping,
321
+ charts,
322
+ chartsSection
323
+ ]);
324
+ const { data: counts, isFetching: isCountsFetching, isError: isCountsError } = core.useGetCountsQuery({
325
+ type: index$1,
326
+ filters: cohortFilters,
327
+ accessibility: accessLevel,
328
+ queryId: cohortId
329
+ });
330
+ if (isCountsError || isAggsQueryError) {
331
+ return /*#__PURE__*/ jsxRuntime.jsx(index.ErrorCard, {
332
+ message: "Unable to fetch data from server"
333
+ }); // TODO: replace with configurable message
334
+ }
335
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
336
+ className: "flex flex-col mt-3 relative px-4 bg-base-lightest w-full",
337
+ children: [
338
+ /*#__PURE__*/ jsxRuntime.jsx(index.QueryExpression, {
339
+ index: index$1
340
+ }),
341
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
342
+ className: "flex w-full",
343
+ children: [
344
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
345
+ id: "cohort-builder-filters",
346
+ className: "flex-shrink-0 md:w-1/4 lg:w-1/5",
347
+ children: filters?.tabs && /*#__PURE__*/ jsxRuntime.jsx(index.DropdownPanel, {
348
+ filters: filters,
349
+ tabTitle: tabTitle,
350
+ facetDefinitions: facetDefinitions,
351
+ facetDataHooks: facetDataHooks,
352
+ onAccessChange: setAccessLevel,
353
+ accessLevel: accessLevel,
354
+ showAccessLevel: showAccessLevel,
355
+ allFiltersCollapsed: allFiltersCollapsed,
356
+ toggleAllFiltersExpanded: toggleAllFiltersExpanded,
357
+ clearAllFilters: clearAllFilters
358
+ })
359
+ }),
360
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
361
+ id: "cohort-builder-content",
362
+ className: "flex flex-col md:w-3/4 lg:w-4/5 pl-4",
363
+ children: [
364
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
365
+ className: "flex justify-between mb-2 ml-2",
366
+ children: [
367
+ /*#__PURE__*/ jsxRuntime.jsx(index.DownloadsPanel, {
368
+ dropdowns: defaultDropdowns,
369
+ buttons: defaultButtons,
370
+ loginForDownload: loginForDownload,
371
+ index: index$1,
372
+ totalCount: counts ?? 0,
373
+ fields: table?.fields ?? [],
374
+ filter: cohortFilters
375
+ }),
376
+ /*#__PURE__*/ jsxRuntime.jsx(index.CountsValue, {
377
+ label: guppyConfig?.nodeCountTitle || toDisplayName(index$1),
378
+ counts: counts,
379
+ isFetching: isCountsFetching,
380
+ isError: isCountsError
381
+ })
382
+ ]
383
+ }),
384
+ chartsSection?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(index.CollapsableCharts, {
385
+ config: {
386
+ ...chartsSection,
387
+ charts: summaryCharts
388
+ },
389
+ data: cleanChartData ?? EmptyData,
390
+ isSuccess: isChartSuccess,
391
+ isFetching: isChartFetching,
392
+ isError: isChartError
393
+ }) : /*#__PURE__*/ jsxRuntime.jsx(index.Charts, {
394
+ charts: summaryCharts,
395
+ data: cleanChartData ?? EmptyData,
396
+ counts: counts,
397
+ isSuccess: isChartSuccess,
398
+ isError: isChartError,
399
+ numCols: numCols
400
+ }),
401
+ table?.enabled && /*#__PURE__*/ jsxRuntime.jsx("div", {
402
+ className: "mt-2 flex flex-col",
403
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.ExplorerTable, {
404
+ index: index$1,
405
+ tableConfig: table,
406
+ accessibility: accessLevel
407
+ })
408
+ })
409
+ ]
410
+ })
411
+ ]
412
+ })
413
+ ]
414
+ });
415
+ };
416
+
417
+ const TabsLayoutToComponentProp = (tabsLayout)=>{
418
+ if (!tabsLayout) {
419
+ return 'flex-start';
420
+ }
421
+ switch(tabsLayout){
422
+ case 'left':
423
+ {
424
+ return 'flex-start';
425
+ }
426
+ case 'right':
427
+ {
428
+ return 'flex-end';
429
+ }
430
+ case 'center':
431
+ {
432
+ return 'center';
433
+ }
434
+ default:
435
+ {
436
+ return 'flex-start';
437
+ }
438
+ }
439
+ };
440
+
441
+ const useGetCurrentCohort = ()=>{
442
+ return core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
443
+ };
444
+ const CohortBuilder = ({ explorerConfig, sharedFiltersMap = null, tabsLayout = 'left', enableCohortManager = true })=>{
445
+ const dispatch = core.useCoreDispatch();
446
+ dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
447
+ const configuration = useDeepCompare.useDeepCompareMemo(()=>explorerConfig, [
448
+ explorerConfig
449
+ ]);
450
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
451
+ className: "flex flex-col w-full mt-2",
452
+ children: [
453
+ enableCohortManager ? /*#__PURE__*/ jsxRuntime.jsx(index.CohortManager, {}) : null,
454
+ /*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
455
+ color: "primary.5",
456
+ variant: explorerConfig[0]?.tabType,
457
+ keepMounted: true,
458
+ defaultValue: explorerConfig[0].tabTitle,
459
+ children: [
460
+ /*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
461
+ className: "w-full",
462
+ justify: TabsLayoutToComponentProp(tabsLayout),
463
+ children: configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
464
+ value: panelConfig.tabTitle,
465
+ children: panelConfig.tabTitle
466
+ }, `${panelConfig.tabTitle}-tabList`))
467
+ }),
468
+ configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
469
+ value: panelConfig.tabTitle,
470
+ children: /*#__PURE__*/ jsxRuntime.jsx(CohortPanel, {
471
+ guppyConfig: panelConfig.guppyConfig,
472
+ chartsSection: panelConfig?.chartsSection,
473
+ charts: panelConfig?.charts,
474
+ filters: panelConfig.filters,
475
+ tabTitle: panelConfig.tabTitle,
476
+ table: panelConfig.table,
477
+ dropdowns: panelConfig.dropdowns,
478
+ buttons: panelConfig.buttons,
479
+ loginForDownload: panelConfig.loginForDownload,
480
+ sharedFiltersMap: panelConfig.sharedFiltersMap
481
+ }, `${panelConfig.tabTitle}-CohortPanel`)
482
+ }, `${panelConfig.tabTitle}-tabPanel`))
483
+ ]
484
+ })
485
+ ]
486
+ });
487
+ };
488
+
489
+ exports.default = CohortBuilder;
490
+ exports.useGetCurrentCohort = useGetCurrentCohort;
491
+ //# sourceMappingURL=CohortBuilder-BKL8oxQu.js.map