synapse-react-client 4.0.33 → 4.0.35

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 (179) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/assets/icons/curie-head.svg +21 -0
  3. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +29 -3
  4. package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
  5. package/dist/components/AccessRequirementList/AccessRequirementList.js +153 -84
  6. package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
  7. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js +1 -0
  8. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js.map +1 -1
  9. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.d.ts +1 -0
  10. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.d.ts.map +1 -1
  11. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.js +49 -42
  12. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.js.map +1 -1
  13. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts +6 -0
  14. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
  15. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +161 -155
  16. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
  17. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts +21 -0
  18. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -0
  19. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +164 -0
  20. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -0
  21. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts +22 -0
  22. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -0
  23. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +264 -0
  24. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -0
  25. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js +1 -0
  26. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js.map +1 -1
  27. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
  28. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +105 -96
  29. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
  30. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.d.ts +13 -0
  31. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.d.ts.map +1 -0
  32. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js +122 -0
  33. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js.map +1 -0
  34. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +17 -0
  35. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -0
  36. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +112 -0
  37. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -0
  38. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +27 -0
  39. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -0
  40. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +194 -0
  41. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -0
  42. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.d.ts +1 -0
  43. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.d.ts.map +1 -1
  44. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.js +7 -7
  45. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/UploadDocumentField.js.map +1 -1
  46. package/dist/components/DraggableDialog/DraggableDialog.d.ts +2 -1
  47. package/dist/components/DraggableDialog/DraggableDialog.d.ts.map +1 -1
  48. package/dist/components/DraggableDialog/DraggableDialog.js +42 -33
  49. package/dist/components/DraggableDialog/DraggableDialog.js.map +1 -1
  50. package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts.map +1 -1
  51. package/dist/components/EntityTreeTable/hooks/useTableColumns.js +12 -6
  52. package/dist/components/EntityTreeTable/hooks/useTableColumns.js.map +1 -1
  53. package/dist/components/ExperimentalMode/ExperimentalMode.js +2 -1
  54. package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
  55. package/dist/components/FilePreview/PdfPreview.d.ts.map +1 -1
  56. package/dist/components/FilePreview/PdfPreview.js +23 -20
  57. package/dist/components/FilePreview/PdfPreview.js.map +1 -1
  58. package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
  59. package/dist/components/GenericCard/SynapseCardLabel.js +100 -99
  60. package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
  61. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
  62. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +64 -55
  63. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
  64. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.d.ts.map +1 -1
  65. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js +4 -1
  66. package/dist/components/SetManagedAccessRequirementFields/SetManagedAccessRequirementFields.js.map +1 -1
  67. package/dist/components/StorybookComponentWrapper.d.ts.map +1 -1
  68. package/dist/components/StorybookComponentWrapper.js +16 -13
  69. package/dist/components/StorybookComponentWrapper.js.map +1 -1
  70. package/dist/components/SynapseChat/GridAgentChat.js +6 -6
  71. package/dist/components/SynapseChat/SynapseChat.d.ts +2 -1
  72. package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
  73. package/dist/components/SynapseChat/SynapseChat.js +118 -74
  74. package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
  75. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts +3 -1
  76. package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
  77. package/dist/components/SynapseChat/SynapseChatInteraction.js +21 -21
  78. package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
  79. package/dist/components/SynapseChat/SynapseChatMessage.d.ts +1 -0
  80. package/dist/components/SynapseChat/SynapseChatMessage.d.ts.map +1 -1
  81. package/dist/components/SynapseChat/SynapseChatMessage.js +9 -8
  82. package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
  83. package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -1
  84. package/dist/components/SynapseChat/SynapsePortalChatDialog.js +2 -1
  85. package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -1
  86. package/dist/components/TanStackTable/TanStackTableUtils.d.ts.map +1 -1
  87. package/dist/components/TanStackTable/TanStackTableUtils.js +6 -6
  88. package/dist/components/TanStackTable/TanStackTableUtils.js.map +1 -1
  89. package/dist/components/dataaccess/AccessRequirementDashboard.d.ts.map +1 -1
  90. package/dist/components/dataaccess/AccessRequirementDashboard.js +55 -55
  91. package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
  92. package/dist/components/dataaccess/EDucTemplateTable.d.ts +3 -0
  93. package/dist/components/dataaccess/EDucTemplateTable.d.ts.map +1 -0
  94. package/dist/components/dataaccess/EDucTemplateTable.js +213 -0
  95. package/dist/components/dataaccess/EDucTemplateTable.js.map +1 -0
  96. package/dist/components/dataaccess/ReviewerDashboard.d.ts.map +1 -1
  97. package/dist/components/dataaccess/ReviewerDashboard.js +44 -34
  98. package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
  99. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts +12 -0
  100. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -0
  101. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +84 -0
  102. package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -0
  103. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.d.ts.map +1 -1
  104. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js +20 -18
  105. package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js.map +1 -1
  106. package/dist/components/entity/page/CreatedByModifiedBy.d.ts.map +1 -1
  107. package/dist/components/entity/page/CreatedByModifiedBy.js +43 -61
  108. package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
  109. package/dist/components/entity/page/createdByModifiedByTooltips.d.ts +7 -0
  110. package/dist/components/entity/page/createdByModifiedByTooltips.d.ts.map +1 -0
  111. package/dist/components/entity/page/createdByModifiedByTooltips.js +36 -0
  112. package/dist/components/entity/page/createdByModifiedByTooltips.js.map +1 -0
  113. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
  114. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +130 -65
  115. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
  116. package/dist/components/widgets/Range.js +8 -2
  117. package/dist/components/widgets/Range.js.map +1 -1
  118. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts +2 -0
  119. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
  120. package/dist/components/widgets/facet-nav/FacetNavPanel.js +35 -40
  121. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  122. package/dist/components/widgets/query-filter/RangeFacetFilter.d.ts.map +1 -1
  123. package/dist/components/widgets/query-filter/RangeFacetFilter.js +2 -1
  124. package/dist/components/widgets/query-filter/RangeFacetFilter.js.map +1 -1
  125. package/dist/components/widgets/query-filter/RangeFacetFilterUI.d.ts.map +1 -1
  126. package/dist/components/widgets/query-filter/RangeFacetFilterUI.js +19 -19
  127. package/dist/components/widgets/query-filter/RangeFacetFilterUI.js.map +1 -1
  128. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
  129. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +48 -23
  130. package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
  131. package/dist/mocks/msw/handlers/eDucTemplateHandlers.d.ts.map +1 -1
  132. package/dist/mocks/msw/handlers/eDucTemplateHandlers.js +9 -9
  133. package/dist/mocks/msw/handlers/eDucTemplateHandlers.js.map +1 -1
  134. package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
  135. package/dist/mocks/msw/handlers/fileHandlers.js +22 -22
  136. package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
  137. package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
  138. package/dist/mocks/msw/handlers/userProfileHandlers.js +36 -36
  139. package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
  140. package/dist/mocks/user/mock_user_profile.d.ts +1 -0
  141. package/dist/mocks/user/mock_user_profile.d.ts.map +1 -1
  142. package/dist/mocks/user/mock_user_profile.js +45 -45
  143. package/dist/mocks/user/mock_user_profile.js.map +1 -1
  144. package/dist/style/components/facet_nav/_facet-nav-panel.scss +0 -6
  145. package/dist/synapse-queries/KeyFactory.d.ts +1 -0
  146. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  147. package/dist/synapse-queries/KeyFactory.js +3 -0
  148. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  149. package/dist/synapse-queries/dataaccess/index.js +4 -4
  150. package/dist/synapse-queries/dataaccess/useEDuc.d.ts +13 -1
  151. package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
  152. package/dist/synapse-queries/dataaccess/useEDuc.js +67 -49
  153. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
  154. package/dist/synapse-queries/index.js +185 -184
  155. package/dist/tsconfig.build.tsbuildinfo +1 -1
  156. package/dist/utils/APIConstants.d.ts +6 -0
  157. package/dist/utils/APIConstants.d.ts.map +1 -1
  158. package/dist/utils/APIConstants.js +2 -2
  159. package/dist/utils/APIConstants.js.map +1 -1
  160. package/dist/utils/AppUtils/session/ApplicationSessionManager.d.ts.map +1 -1
  161. package/dist/utils/AppUtils/session/ApplicationSessionManager.js +20 -19
  162. package/dist/utils/AppUtils/session/ApplicationSessionManager.js.map +1 -1
  163. package/dist/utils/featureflag/FeatureFlags.d.ts +1 -0
  164. package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
  165. package/dist/utils/featureflag/FeatureFlags.js +1 -1
  166. package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
  167. package/dist/utils/functions/RegularExpressions.d.ts +7 -0
  168. package/dist/utils/functions/RegularExpressions.d.ts.map +1 -1
  169. package/dist/utils/functions/RegularExpressions.js +5 -4
  170. package/dist/utils/functions/RegularExpressions.js.map +1 -1
  171. package/dist/utils/hooks/useFetchBlobUrl.d.ts +9 -0
  172. package/dist/utils/hooks/useFetchBlobUrl.d.ts.map +1 -0
  173. package/dist/utils/hooks/useFetchBlobUrl.js +19 -0
  174. package/dist/utils/hooks/useFetchBlobUrl.js.map +1 -0
  175. package/dist/utils/hooks/useIsHydrated.d.ts +9 -0
  176. package/dist/utils/hooks/useIsHydrated.d.ts.map +1 -0
  177. package/dist/utils/hooks/useIsHydrated.js +10 -0
  178. package/dist/utils/hooks/useIsHydrated.js.map +1 -0
  179. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"CreatedByModifiedBy.js","names":[],"sources":["../../../../src/components/entity/page/CreatedByModifiedBy.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport {\n useGetEntity,\n useGetQueryResultBundleWithAsyncStatus,\n} from '@/synapse-queries'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport {\n convertToEntityType,\n entityTypeToFriendlyName,\n isDataset,\n isTable,\n} from '@/utils/functions/EntityTypeUtils'\nimport { BUNDLE_MASK_LAST_UPDATED_ON } from '@/utils/SynapseConstants'\nimport { InfoTwoTone } from '@mui/icons-material'\nimport {\n Box,\n Breadcrumbs,\n Skeleton,\n SxProps,\n Tooltip,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport dayjs from 'dayjs'\nimport { UserBadge } from '../../UserCard/UserBadge'\n\nexport type CreatedByModifiedByProps = {\n entityId: string\n versionNumber?: number\n}\n\nfunction Separator() {\n const theme = useTheme()\n const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'))\n if (isSmallScreen) {\n return null\n }\n return (\n <Typography variant={'breadcrumb1'} sx={{ color: 'grey.700' }}>\n /\n </Typography>\n )\n}\n\nexport function CreatedByModifiedBy(props: CreatedByModifiedByProps) {\n const { entityId, versionNumber } = props\n const entityIdWithVersion = `${entityId}${\n versionNumber ? `.${versionNumber}` : ''\n }`\n\n const { data: entity } = useGetEntity(entityId, versionNumber)\n\n const { data: tableQueryResult } = useGetQueryResultBundleWithAsyncStatus(\n {\n entityId,\n query: {\n sql: `SELECT * FROM ${entityIdWithVersion} LIMIT 0`,\n },\n partMask: BUNDLE_MASK_LAST_UPDATED_ON,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n },\n { enabled: !!(entity && isTable(entity)) },\n )\n\n const tableLastRebuilt = tableQueryResult?.responseBody?.lastUpdatedOn\n const friendlyName = entity\n ? entityTypeToFriendlyName(convertToEntityType(entity.concreteType))\n : ''\n\n const datasetCreatedByTooltipText =\n 'This is the user who created this Dataset. ' +\n 'This may not be the same person who generated the files in this Dataset, or who originally uploaded these files to Synapse.'\n\n const tableModifiedOnTooltipText = (\n <>\n <p>\n This is when the configuration of this {friendlyName} was last changed.\n </p>\n <p>Configuration changes may be triggered by (for example):</p>\n <ul>\n <li>Editing the name of the {friendlyName}</li>\n <li>Updating the schema used by the {friendlyName}</li>\n </ul>\n <p>\n This does NOT reflect changes to the data displayed in the the{' '}\n {friendlyName}.\n </p>\n </>\n )\n /*\n If the tooltip text is a string, MUI automatically applies it to aria-label which is more accessible and testable.\n Since this tooltip text is a ReactNode, let's manually create a short string to use for the aria-label.\n */\n const tableModifiedOnAccessibleLabel = `This is when the configuration of this ${friendlyName} was last changed.`\n\n const tableLastUpdatedTooltipText =\n `When data changes, the ${friendlyName} is rebuilt to reflect those changes. ` +\n `This is the last time changes were made to the data.`\n\n const createdByTooltipId = `${entityIdWithVersion}-createdByTooltip`\n const modifiedByTooltipId = `${entityIdWithVersion}-modifiedByTooltip`\n const lastUpdatedTooltipId = `${entityIdWithVersion}-lastUpdatedTooltip`\n\n const iconSx: SxProps = {\n width: '16px',\n height: '16px',\n ml: '4px',\n verticalAlign: 'text-bottom',\n }\n\n return (\n <Box\n sx={theme => ({\n bgcolor: 'grey.100',\n py: '10px',\n [theme.breakpoints.down('sm')]: {\n p: '24px 40px',\n },\n })}\n >\n <Breadcrumbs\n separator={<Separator />}\n sx={theme => ({\n '& .MuiBreadcrumbs-ol': {\n justifyContent: 'center',\n [theme.breakpoints.down('sm')]: {\n gap: '4px',\n },\n },\n })}\n >\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={createdByTooltipId}\n >\n {friendlyName} created by <UserBadge userId={entity?.createdBy} />{' '}\n on {formatDate(dayjs(entity?.createdOn))}\n {entity && isDataset(entity) && (\n <Tooltip\n id={createdByTooltipId}\n title={datasetCreatedByTooltipText}\n >\n <InfoTwoTone sx={iconSx} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={modifiedByTooltipId}\n >\n {entity && isTable(entity) ? 'Configuration' : friendlyName} last\n modified by <UserBadge userId={entity?.modifiedBy} /> on{' '}\n {formatDate(dayjs(entity?.modifiedOn))}\n {entity && isTable(entity) && (\n <Tooltip\n id={modifiedByTooltipId}\n title={tableModifiedOnTooltipText}\n aria-label={tableModifiedOnAccessibleLabel}\n >\n <InfoTwoTone sx={iconSx} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n {tableLastRebuilt && (\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={lastUpdatedTooltipId}\n >\n {friendlyName} last rebuilt on {formatDate(dayjs(tableLastRebuilt))}\n <Tooltip\n title={tableLastUpdatedTooltipText}\n id={lastUpdatedTooltipId}\n >\n <InfoTwoTone sx={iconSx} />\n </Tooltip>\n </Typography>\n )}\n </Breadcrumbs>\n </Box>\n )\n}\n\nexport default CreatedByModifiedBy\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAS,IAAY;CAMnB,OAJsB,EADR,EACsB,EAAM,YAAY,KAAK,IAAI,CAC3D,IACK,OAGP,kBAAC,GAAD;EAAY,SAAS;EAAe,IAAI,EAAE,OAAO,WAAW;YAAG;CAEnD,CAAA;AAEhB;AAEA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,EAAE,aAAU,qBAAkB,GAC9B,IAAsB,GAAG,IAC7B,IAAgB,IAAI,MAAkB,MAGlC,EAAE,MAAM,MAAW,EAAa,GAAU,CAAa,GAEvD,EAAE,MAAM,MAAqB,EACjC;EACE;EACA,OAAO,EACL,KAAK,iBAAiB,EAAoB,UAC5C;EACA,UAAA;EACA,cAAc;CAChB,GACA,EAAE,SAAS,CAAC,EAAE,KAAU,EAAQ,CAAM,GAAG,CAC3C,GAEM,IAAmB,GAAkB,cAAc,eACnD,IAAe,IACjB,EAAyB,EAAoB,EAAO,YAAY,CAAC,IACjE,IAME,IACJ,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,KAAD,EAAA,UAAA;GAAG;GACuC;GAAa;EACpD,EAAA,CAAA;EACH,kBAAC,KAAD,EAAA,UAAG,2DAA2D,CAAA;EAC9D,kBAAC,MAAD,EAAA,UAAA,CACE,kBAAC,MAAD,EAAA,UAAA,CAAI,4BAAyB,CAAiB,EAAA,CAAA,GAC9C,kBA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;OAChD,kBAAC,GAAD,EAAW,QAAQ,GAAQ,WAAa,CAAA;OAAC;OAAI;OACxD,EAAW,EAAM,GAAQ,UAAU,CAAC;OACpC,KAAU,EAAQ,CAAM,KACvB,kBAAC,GAAD;QACE,IAAI;QACJ,OAAO;QACP,cAAY;kBAEZ,kBAAC,GAAD,EAAa,IAAI,EAAS,CAAA;OACnB,CAAA;MAED;;IACM,CAAA;IACnB,KACC,kBAAC,GAAD;KACE,IAAI,EAAE,OAAO,WAAW;KACxB,SAAS;KACT,oBAAkB;eAHpB;MAKG;MAAa;MAAkB,EAAW,EAAM,CAAgB,CAAC;MAClE,kBAAC,GAAD;OACE,OAAO;OACP,IAAI;iBAEJ,kBAAC,GAAD,EAAa,IAAI,EAAS,CAAA;MACnB,CAAA;KACC;;GAEH;;CACV,CAAA;AAET"}
1
+ {"version":3,"file":"CreatedByModifiedBy.js","names":[],"sources":["../../../../src/components/entity/page/CreatedByModifiedBy.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport {\n useGetEntity,\n useGetQueryResultBundleWithAsyncStatus,\n} from '@/synapse-queries'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport {\n convertToEntityType,\n entityTypeToFriendlyName,\n isDataset,\n isTable,\n} from '@/utils/functions/EntityTypeUtils'\nimport { BUNDLE_MASK_LAST_UPDATED_ON } from '@/utils/SynapseConstants'\nimport { InfoTwoTone } from '@mui/icons-material'\nimport {\n Box,\n Breadcrumbs,\n Skeleton,\n Tooltip,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport dayjs from 'dayjs'\nimport { UserBadge } from '../../UserCard/UserBadge'\nimport {\n DATASET_CREATED_BY_TOOLTIP,\n INFO_ICON_SX,\n getTableLastRebuiltTooltip,\n getTableModifiedOnAccessibleLabel,\n getTableModifiedOnTooltip,\n} from './createdByModifiedByTooltips'\n\nexport type CreatedByModifiedByProps = {\n entityId: string\n versionNumber?: number\n}\n\nfunction Separator() {\n const theme = useTheme()\n const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'))\n if (isSmallScreen) {\n return null\n }\n return (\n <Typography variant={'breadcrumb1'} sx={{ color: 'grey.700' }}>\n /\n </Typography>\n )\n}\n\nexport function CreatedByModifiedBy(props: CreatedByModifiedByProps) {\n const { entityId, versionNumber } = props\n const entityIdWithVersion = `${entityId}${\n versionNumber ? `.${versionNumber}` : ''\n }`\n\n const { data: entity } = useGetEntity(entityId, versionNumber)\n\n const { data: tableQueryResult } = useGetQueryResultBundleWithAsyncStatus(\n {\n entityId,\n query: {\n sql: `SELECT * FROM ${entityIdWithVersion} LIMIT 0`,\n },\n partMask: BUNDLE_MASK_LAST_UPDATED_ON,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n },\n { enabled: !!(entity && isTable(entity)) },\n )\n\n const tableLastRebuilt = tableQueryResult?.responseBody?.lastUpdatedOn\n const friendlyName = entity\n ? entityTypeToFriendlyName(convertToEntityType(entity.concreteType))\n : ''\n\n const createdByTooltipId = `${entityIdWithVersion}-createdByTooltip`\n const modifiedByTooltipId = `${entityIdWithVersion}-modifiedByTooltip`\n const lastUpdatedTooltipId = `${entityIdWithVersion}-lastUpdatedTooltip`\n\n return (\n <Box\n sx={theme => ({\n bgcolor: 'grey.100',\n p: '10px',\n [theme.breakpoints.down('sm')]: {\n p: '24px 40px',\n },\n })}\n >\n <Breadcrumbs\n separator={<Separator />}\n sx={theme => ({\n '& .MuiBreadcrumbs-ol': {\n justifyContent: 'center',\n [theme.breakpoints.down('sm')]: {\n gap: '4px',\n },\n },\n })}\n >\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={createdByTooltipId}\n >\n {friendlyName} created by <UserBadge userId={entity?.createdBy} />{' '}\n on {formatDate(dayjs(entity?.createdOn))}\n {entity && isDataset(entity) && (\n <Tooltip\n id={createdByTooltipId}\n title={DATASET_CREATED_BY_TOOLTIP}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n <ConditionalWrapper condition={!entity} wrapper={Skeleton}>\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={modifiedByTooltipId}\n >\n {entity && isTable(entity) ? 'Configuration' : friendlyName} last\n modified by <UserBadge userId={entity?.modifiedBy} /> on{' '}\n {formatDate(dayjs(entity?.modifiedOn))}\n {entity && isTable(entity) && (\n <Tooltip\n id={modifiedByTooltipId}\n title={getTableModifiedOnTooltip(friendlyName)}\n aria-label={getTableModifiedOnAccessibleLabel(friendlyName)}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Typography>\n </ConditionalWrapper>\n {tableLastRebuilt && (\n <Typography\n sx={{ color: 'grey.700' }}\n variant={'breadcrumb1'}\n aria-describedby={lastUpdatedTooltipId}\n >\n {friendlyName} last rebuilt on {formatDate(dayjs(tableLastRebuilt))}\n <Tooltip\n title={getTableLastRebuiltTooltip(friendlyName)}\n id={lastUpdatedTooltipId}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n </Typography>\n )}\n </Breadcrumbs>\n </Box>\n )\n}\n\nexport default CreatedByModifiedBy\n"],"mappings":";;;;;;;;;;;;;;AAsCA,SAAS,IAAY;CAMnB,OAJsB,EADR,EACsB,EAAM,YAAY,KAAK,IAAI,CAC3D,IACK,OAGP,kBAAC,GAAD;EAAY,SAAS;EAAe,IAAI,EAAE,OAAO,WAAW;YAAG;CAEnD,CAAA;AAEhB;AAEA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,EAAE,aAAU,qBAAkB,GAC9B,IAAsB,GAAG,IAC7B,IAAgB,IAAI,MAAkB,MAGlC,EAAE,MAAM,MAAW,EAAa,GAAU,CAAa,GAEvD,EAAE,MAAM,MAAqB,EACjC;EACE;EACA,OAAO,EACL,KAAK,iBAAiB,EAAoB,UAC5C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AAQ,CAAM,KACvB,kBAAC,GAAD;QACE,IAAI;QACJ,OAAO,EAA0B,CAAY;QAC7C,cAAY,EAAkC,CAAY;kBAE1D,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;OACzB,CAAA;MAED;;IACM,CAAA;IACnB,KACC,kBAAC,GAAD;KACE,IAAI,EAAE,OAAO,WAAW;KACxB,SAAS;KACT,oBAAkB;eAHpB;MAKG;MAAa;MAAkB,EAAW,EAAM,CAAgB,CAAC;MAClE,kBAAC,GAAD;OACE,OAAO,EAA2B,CAAY;OAC9C,IAAI;iBAEJ,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;MACzB,CAAA;KACC;;GAEH;;CACV,CAAA;AAET"}
@@ -0,0 +1,7 @@
1
+ import { SxProps } from '@mui/material';
2
+ export declare const DATASET_CREATED_BY_TOOLTIP: string;
3
+ export declare function getTableModifiedOnTooltip(friendlyName: string): import("react/jsx-runtime").JSX.Element;
4
+ export declare function getTableModifiedOnAccessibleLabel(friendlyName: string): string;
5
+ export declare function getTableLastRebuiltTooltip(friendlyName: string): string;
6
+ export declare const INFO_ICON_SX: SxProps;
7
+ //# sourceMappingURL=createdByModifiedByTooltips.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createdByModifiedByTooltips.d.ts","sourceRoot":"","sources":["../../../../src/components/entity/page/createdByModifiedByTooltips.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,eAAO,MAAM,0BAA0B,QAEwF,CAAA;AAE/H,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,2CAiB7D;AAID,wBAAgB,iCAAiC,CAAC,YAAY,EAAE,MAAM,UAErE;AAED,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,UAK9D;AAED,eAAO,MAAM,YAAY,EAAE,OAK1B,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ //#region src/components/entity/page/createdByModifiedByTooltips.tsx
3
+ var r = "This is the user who created this Dataset. This may not be the same person who generated the files in this Dataset, or who originally uploaded these files to Synapse.";
4
+ function i(r) {
5
+ return /* @__PURE__ */ n(e, { children: [
6
+ /* @__PURE__ */ n("p", { children: [
7
+ "This is when the configuration of this ",
8
+ r,
9
+ " was last changed."
10
+ ] }),
11
+ /* @__PURE__ */ t("p", { children: "Configuration changes may be triggered by (for example):" }),
12
+ /* @__PURE__ */ n("ul", { children: [/* @__PURE__ */ n("li", { children: ["Editing the name of the ", r] }), /* @__PURE__ */ n("li", { children: ["Updating the schema used by the ", r] })] }),
13
+ /* @__PURE__ */ n("p", { children: [
14
+ "This does NOT reflect changes to the data displayed in the the",
15
+ " ",
16
+ r,
17
+ "."
18
+ ] })
19
+ ] });
20
+ }
21
+ function a(e) {
22
+ return `This is when the configuration of this ${e} was last changed.`;
23
+ }
24
+ function o(e) {
25
+ return `When data changes, the ${e} is rebuilt to reflect those changes. This is the last time changes were made to the data.`;
26
+ }
27
+ var s = {
28
+ width: "16px",
29
+ height: "16px",
30
+ ml: "4px",
31
+ verticalAlign: "text-bottom"
32
+ };
33
+ //#endregion
34
+ export { r as DATASET_CREATED_BY_TOOLTIP, s as INFO_ICON_SX, o as getTableLastRebuiltTooltip, a as getTableModifiedOnAccessibleLabel, i as getTableModifiedOnTooltip };
35
+
36
+ //# sourceMappingURL=createdByModifiedByTooltips.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createdByModifiedByTooltips.js","names":[],"sources":["../../../../src/components/entity/page/createdByModifiedByTooltips.tsx"],"sourcesContent":["import { SxProps } from '@mui/material'\n\nexport const DATASET_CREATED_BY_TOOLTIP =\n 'This is the user who created this Dataset. ' +\n 'This may not be the same person who generated the files in this Dataset, or who originally uploaded these files to Synapse.'\n\nexport function getTableModifiedOnTooltip(friendlyName: string) {\n return (\n <>\n <p>\n This is when the configuration of this {friendlyName} was last changed.\n </p>\n <p>Configuration changes may be triggered by (for example):</p>\n <ul>\n <li>Editing the name of the {friendlyName}</li>\n <li>Updating the schema used by the {friendlyName}</li>\n </ul>\n <p>\n This does NOT reflect changes to the data displayed in the the{' '}\n {friendlyName}.\n </p>\n </>\n )\n}\n\n// The ReactNode tooltip title does not auto-populate aria-label, so MUI needs a\n// string handed to it explicitly.\nexport function getTableModifiedOnAccessibleLabel(friendlyName: string) {\n return `This is when the configuration of this ${friendlyName} was last changed.`\n}\n\nexport function getTableLastRebuiltTooltip(friendlyName: string) {\n return (\n `When data changes, the ${friendlyName} is rebuilt to reflect those changes. ` +\n `This is the last time changes were made to the data.`\n )\n}\n\nexport const INFO_ICON_SX: SxProps = {\n width: '16px',\n height: '16px',\n ml: '4px',\n verticalAlign: 'text-bottom',\n}\n"],"mappings":";;AAEA,IAAa,IACX;AAGF,SAAgB,EAA0B,GAAsB;CAC9D,OACE,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,KAAD,EAAA,UAAA;GAAG;GACuC;GAAa;EACpD,EAAA,CAAA;EACH,kBAAC,KAAD,EAAA,UAAG,2DAA2D,CAAA;EAC9D,kBAAC,MAAD,EAAA,UAAA,CACE,kBAAC,MAAD,EAAA,UAAA,CAAI,4BAAyB,CAAiB,EAAA,CAAA,GAC9C,kBAAC,MAAD,EAAA,UAAA,CAAI,oCAAiC,CAAiB,EAAA,CAAA,CACpD,EAAA,CAAA;EACJ,kBAAC,KAAD,EAAA,UAAA;GAAG;GAC8D;GAC9D;GAAa;EACb,EAAA,CAAA;CACH,EAAA,CAAA;AAEN;AAIA,SAAgB,EAAkC,GAAsB;CACtE,OAAO,0CAA0C,EAAa;AAChE;AAEA,SAAgB,EAA2B,GAAsB;CAC/D,OACE,0BAA0B,EAAa;AAG3C;AAEA,IAAa,IAAwB;CACnC,OAAO;CACP,QAAQ;CACR,IAAI;CACJ,eAAe;AACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityTitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAO3C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,cAAc,EAAE,CA8KlB"}
1
+ {"version":3,"file":"useGetEntityTitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAsB3C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,cAAc,EAAE,CA6OlB"}
@@ -1,133 +1,198 @@
1
+ import "../../../../utils/SynapseConstants.js";
1
2
  import { calculateFriendlyFileSize as e } from "../../../../utils/functions/calculateFriendlyFileSize.js";
2
- import { isEntityRefCollectionView as t, isVersionableEntity as n } from "../../../../utils/functions/EntityTypeUtils.js";
3
+ import { entityTypeToFriendlyName as ee, isDataset as te, isEntityRefCollectionView as t, isTable as n, isVersionableEntity as ne } from "../../../../utils/functions/EntityTypeUtils.js";
3
4
  import { useGetEntityChildren as r } from "../../../../synapse-queries/entity/useGetEntityChildren.js";
5
+ import { useGetQueryResultBundleWithAsyncStatus as i } from "../../../../synapse-queries/entity/useGetQueryResultBundle.js";
4
6
  import "../../../../synapse-queries/index.js";
5
- import { useGetDOIAssociation as i } from "../../../../synapse-queries/doi/useDOI.js";
6
- import a from "../../../GenericCard/Linkify.js";
7
- import o from "../../../../utils/hooks/useGetEntityMetadata.js";
8
- import { useDataCiteUsage as s } from "./useDataCiteUsage.js";
9
- import { useGetMentions as c } from "./useGetMentions.js";
10
- import { CitationsDialog as l } from "./CitationsDialog.js";
11
- import { CopyToClipboardString as u } from "../../../CopyToClipboardString/CopyToClipboardString.js";
12
- import { useState as d } from "react";
13
- import { Box as f, Link as p } from "@mui/material";
14
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
15
- import { DoiObjectType as _, EntityType as v } from "@sage-bionetworks/synapse-client";
7
+ import { useGetDOIAssociation as re } from "../../../../synapse-queries/doi/useDOI.js";
8
+ import { formatDate as a } from "../../../../utils/functions/DateFormatter.js";
9
+ import { UserBadge as o } from "../../../UserCard/UserBadge.js";
10
+ import s from "../../../GenericCard/Linkify.js";
11
+ import c from "../../../../utils/hooks/useGetEntityMetadata.js";
12
+ import { INFO_ICON_SX as l, getTableLastRebuiltTooltip as u, getTableModifiedOnAccessibleLabel as ie, getTableModifiedOnTooltip as ae } from "../createdByModifiedByTooltips.js";
13
+ import { useDataCiteUsage as oe } from "./useDataCiteUsage.js";
14
+ import { useGetMentions as d } from "./useGetMentions.js";
15
+ import { CitationsDialog as f } from "./CitationsDialog.js";
16
+ import { CopyToClipboardString as p } from "../../../CopyToClipboardString/CopyToClipboardString.js";
17
+ import { useState as m } from "react";
18
+ import { Box as h, Link as g, Tooltip as _ } from "@mui/material";
19
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
20
+ import { DoiObjectType as se, EntityType as x } from "@sage-bionetworks/synapse-client";
21
+ import { InfoTwoTone as S } from "@mui/icons-material";
22
+ import C from "dayjs";
16
23
  //#region src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx
17
- function y(y, b) {
18
- let { entityBundle: x, fileHandle: S, downloadAlias: C, isContainer: w, fileHandleStorageInfo: T, uploadDestinationString: E } = o(y, b), [D, O] = d(!1), [k, A] = d(!1), { data: j } = r({
19
- parentId: y,
20
- includeTypes: Object.values(v),
24
+ function w(w, T) {
25
+ let { entityBundle: E, fileHandle: D, downloadAlias: O, isContainer: k, fileHandleStorageInfo: A, uploadDestinationString: j } = c(w, T), [ce, M] = m(!1), [le, N] = m(!1), { data: ue } = r({
26
+ parentId: w,
27
+ includeTypes: Object.values(x),
21
28
  includeTotalChildCount: !0
22
- }, { enabled: w }), M = x && !x.doiAssociation && n(x.entity) && x.entity.isLatestVersion, { data: N } = i({
23
- id: y,
29
+ }, { enabled: k }), P = E?.entity, F = !!P && n(P), I = E ? ee(E.entityType) : "", { data: L } = i({
30
+ entityId: w,
31
+ query: { sql: `SELECT * FROM ${w}${T ? `.${T}` : ""} LIMIT 0` },
32
+ partMask: 128,
33
+ concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest"
34
+ }, { enabled: !!(P && n(P)) }), R = L?.responseBody?.lastUpdatedOn, z = E && !E.doiAssociation && ne(E.entity) && E.entity.isLatestVersion, { data: B } = re({
35
+ id: w,
24
36
  version: void 0,
25
- type: _.ENTITY
26
- }, { enabled: M }), P = S?.contentSize && e(S.contentSize), F = T && "location" in T && T.location, I = T && "endpoint" in T && T.endpoint, L = T && "bucket" in T && T.bucket, R = T && "fileKey" in T && T.fileKey, z = T && "url" in T && T.url, B = S?.contentMd5, V = M ? N : x?.doiAssociation, { data: H } = s(V?.doiUri), U = V && `https://doi.org/${V?.doiUri}`, W = !!H && H.citationCount > 0, G = j?.totalChildCount, K = x?.entity && t(x.entity) ? ((x?.entity).items ?? []).length : null, { data: q } = c(y), J = !!q && q.length > 0;
37
+ type: se.ENTITY
38
+ }, { enabled: z }), V = D?.contentSize && e(D.contentSize), H = A && "location" in A && A.location, U = A && "endpoint" in A && A.endpoint, W = A && "bucket" in A && A.bucket, G = A && "fileKey" in A && A.fileKey, K = A && "url" in A && A.url, q = D?.contentMd5, J = z ? B : E?.doiAssociation, { data: Y } = oe(J?.doiUri), X = J && `https://doi.org/${J?.doiUri}`, de = !!Y && Y.citationCount > 0, Z = ue?.totalChildCount, Q = E?.entity && t(E.entity) ? (E.entity.items ?? []).length : null, { data: $ } = d(w), fe = !!$ && $.length > 0;
27
39
  return [
28
40
  {
29
41
  key: "id",
30
42
  title: "SynID",
31
- value: /* @__PURE__ */ h(u, { value: y })
43
+ value: /* @__PURE__ */ y(p, { value: w })
32
44
  },
33
- P && {
45
+ V && {
34
46
  key: "fileSize",
35
47
  title: "Size",
36
- value: P
48
+ value: V
37
49
  },
38
- G != null && {
50
+ Z != null && {
39
51
  key: "containerItems",
40
52
  title: "Items",
41
- value: G.toLocaleString()
53
+ value: Z.toLocaleString()
42
54
  },
43
- K != null && {
55
+ Q != null && {
44
56
  key: "entityRefCollectionItems",
45
57
  title: "Items",
46
- value: K.toLocaleString()
58
+ value: Q.toLocaleString()
47
59
  },
48
- U && {
60
+ X && {
49
61
  key: "doi",
50
62
  title: "DOI",
51
- value: /* @__PURE__ */ h(u, {
52
- value: U,
53
- href: U,
63
+ value: /* @__PURE__ */ y(p, {
64
+ value: X,
65
+ href: X,
54
66
  icon: "rounded"
55
67
  })
56
68
  },
57
- W && {
69
+ de && {
58
70
  key: "citations",
59
71
  title: "Citations",
60
- value: /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(p, {
61
- onClick: () => O(!0),
62
- children: [H.citationCount.toLocaleString(), H.citationCount == 500 && "+"]
63
- }), /* @__PURE__ */ h(l, {
64
- open: D,
65
- onClose: () => O(!1),
66
- citations: H.citations
72
+ value: /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b(g, {
73
+ onClick: () => M(!0),
74
+ children: [Y.citationCount.toLocaleString(), Y.citationCount == 500 && "+"]
75
+ }), /* @__PURE__ */ y(f, {
76
+ open: ce,
77
+ onClose: () => M(!1),
78
+ citations: Y.citations
67
79
  })] })
68
80
  },
69
- J && {
81
+ fe && {
70
82
  key: "mentions",
71
83
  title: "Mentions",
72
- value: /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(p, {
73
- onClick: () => A(!0),
74
- children: q.length.toLocaleString()
75
- }), /* @__PURE__ */ h(l, {
76
- open: k,
77
- onClose: () => A(!1),
78
- citations: q,
84
+ value: /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(g, {
85
+ onClick: () => N(!0),
86
+ children: $.length.toLocaleString()
87
+ }), /* @__PURE__ */ y(f, {
88
+ open: le,
89
+ onClose: () => N(!1),
90
+ citations: $,
79
91
  title: "Mentioned in"
80
92
  })] })
81
93
  },
82
- B && {
94
+ q && {
83
95
  key: "fileMd5",
84
96
  title: "MD5",
85
- value: /* @__PURE__ */ h(u, { value: B })
97
+ value: /* @__PURE__ */ y(p, { value: q })
86
98
  },
87
- !w && F && {
99
+ !k && H && {
88
100
  key: "fileStorageLocation",
89
101
  title: "Storage Location",
90
- value: F
102
+ value: H
91
103
  },
92
- w && E && {
104
+ k && j && {
93
105
  key: "uploadDestination",
94
106
  title: "Upload Destination",
95
- value: E
107
+ value: j
96
108
  },
97
- I && {
109
+ U && {
98
110
  key: "externalFileEndpoint",
99
111
  title: "Endpoint",
100
- value: I
112
+ value: U
101
113
  },
102
- z && {
114
+ K && {
103
115
  key: "externalUrl",
104
116
  title: "URL",
105
- value: /* @__PURE__ */ h(a, { text: z })
117
+ value: /* @__PURE__ */ y(s, { text: K })
106
118
  },
107
- L && {
119
+ W && {
108
120
  key: "externalFileBucket",
109
121
  title: "Bucket",
110
- value: L
122
+ value: W
111
123
  },
112
- R && {
124
+ G && {
113
125
  key: "externalFileKey",
114
126
  title: "File Key",
115
- value: R
127
+ value: G
116
128
  },
117
- C && {
129
+ O && {
118
130
  key: "fileAlias",
119
131
  title: "Alias",
120
- value: /* @__PURE__ */ g(m, { children: ["Name when downloaded will be: ", /* @__PURE__ */ h(f, {
132
+ value: /* @__PURE__ */ b(v, { children: ["Name when downloaded will be: ", /* @__PURE__ */ y(h, {
121
133
  sx: {
122
134
  display: "inline",
123
135
  fontFamily: "monospace"
124
136
  },
125
- children: C
137
+ children: O
126
138
  })] })
139
+ },
140
+ P && {
141
+ key: "createdBy",
142
+ title: "Created By",
143
+ value: /* @__PURE__ */ b(h, {
144
+ sx: {
145
+ display: "flex",
146
+ alignItems: "center",
147
+ gap: "4px"
148
+ },
149
+ children: [
150
+ /* @__PURE__ */ y(o, { userId: P.createdBy }),
151
+ /* @__PURE__ */ b("span", { children: ["on ", a(C(P.createdOn))] }),
152
+ te(P) && /* @__PURE__ */ y(_, {
153
+ title: "This is the user who created this Dataset. This may not be the same person who generated the files in this Dataset, or who originally uploaded these files to Synapse.",
154
+ children: /* @__PURE__ */ y(S, { sx: l })
155
+ })
156
+ ]
157
+ })
158
+ },
159
+ P && {
160
+ key: "modifiedBy",
161
+ title: F ? "Configuration Last Modified" : "Modified By",
162
+ value: /* @__PURE__ */ b(h, {
163
+ sx: {
164
+ display: "flex",
165
+ alignItems: "center",
166
+ gap: "4px"
167
+ },
168
+ children: [
169
+ /* @__PURE__ */ y(o, { userId: P.modifiedBy }),
170
+ /* @__PURE__ */ b("span", { children: ["on ", a(C(P.modifiedOn))] }),
171
+ F && /* @__PURE__ */ y(_, {
172
+ title: ae(I),
173
+ "aria-label": ie(I),
174
+ children: /* @__PURE__ */ y(S, { sx: l })
175
+ })
176
+ ]
177
+ })
178
+ },
179
+ R && {
180
+ key: "lastRebuilt",
181
+ title: "Last Rebuilt On",
182
+ value: /* @__PURE__ */ b(h, {
183
+ sx: {
184
+ display: "flex",
185
+ alignItems: "center"
186
+ },
187
+ children: [a(C(R)), /* @__PURE__ */ y(_, {
188
+ title: u(I),
189
+ children: /* @__PURE__ */ y(S, { sx: l })
190
+ })]
191
+ })
127
192
  }
128
193
  ].filter((e) => !!e);
129
194
  }
130
195
  //#endregion
131
- export { y as useGetEntityTitleBarProperties };
196
+ export { w as useGetEntityTitleBarProperties };
132
197
 
133
198
  //# sourceMappingURL=useGetEntityTitleBarProperties.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle?.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value: <CopyToClipboardString value={doi} href={doi} icon=\"rounded\" />,\n },\n isDoiUsage && {\n key: 'citations',\n title: 'Citations',\n value: (\n <>\n <Link onClick={() => setDataCiteCitationsDialogOpen(true)}>\n {dataCiteUsage.citationCount.toLocaleString()}\n {dataCiteUsage.citationCount == maxCitationCount && '+'}\n </Link>\n <CitationsDialog\n open={dataCiteCitationsDialogOpen}\n onClose={() => setDataCiteCitationsDialogOpen(false)}\n citations={dataCiteUsage.citations}\n />\n </>\n ),\n },\n isMentions && {\n key: 'mentions',\n title: 'Mentions',\n value: (\n <>\n <Link onClick={() => setMentionsDialogOpen(true)}>\n {mentions.length.toLocaleString()}\n </Link>\n <CitationsDialog\n open={mentionsDialogOpen}\n onClose={() => setMentionsDialogOpen(false)}\n citations={mentions}\n title=\"Mentioned in\"\n />\n </>\n ),\n },\n md5 && {\n key: 'fileMd5',\n title: 'MD5',\n value: <CopyToClipboardString value={md5} />,\n },\n !isContainer &&\n storageLocation && {\n key: 'fileStorageLocation',\n title: 'Storage Location',\n value: storageLocation,\n },\n isContainer &&\n uploadDestinationString && {\n key: 'uploadDestination',\n title: 'Upload Destination',\n value: uploadDestinationString,\n },\n endpoint && {\n key: 'externalFileEndpoint',\n title: 'Endpoint',\n value: endpoint,\n },\n externalUrl && {\n key: 'externalUrl',\n title: 'URL',\n value: <Linkify text={externalUrl} />,\n },\n bucket && { key: 'externalFileBucket', title: 'Bucket', value: bucket },\n fileKey && { key: 'externalFileKey', title: 'File Key', value: fileKey },\n downloadAlias && {\n key: 'fileAlias',\n title: 'Alias',\n value: (\n <>\n {'Name when downloaded will be: '}\n <Box sx={{ display: 'inline', fontFamily: 'monospace' }}>\n {downloadAlias}\n </Box>\n </>\n ),\n },\n ].filter(item => !!item) as EntityProperty[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EACJ,cAAc,GACd,YAAY,GACZ,kB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kBAAA,GAAA,EAAA,UAAA,CACG,kCACD,kBAAC,GAAD;IAAK,IAAI;KAAE,SAAS;KAAU,YAAY;IAAY;cACnD;GACE,CAAA,CACL,EAAA,CAAA;EAEN;CACF,EAAE,QAAO,MAAQ,CAAC,CAAC,CAAI;AACzB"}
1
+ {"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isDataset,\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link, Tooltip } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\nimport { isTable } from '@/utils/functions/EntityTypeUtils'\nimport { BUNDLE_MASK_LAST_UPDATED_ON } from '@/utils/SynapseConstants'\nimport { useGetQueryResultBundleWithAsyncStatus } from '@/synapse-queries'\nimport { entityTypeToFriendlyName } from '@/utils/functions/EntityTypeUtils'\nimport { UserBadge } from '@/components/UserCard/UserBadge'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport { InfoTwoTone } from '@mui/icons-material'\nimport dayjs from 'dayjs'\nimport {\n DATASET_CREATED_BY_TOOLTIP,\n INFO_ICON_SX,\n getTableModifiedOnTooltip,\n getTableModifiedOnAccessibleLabel,\n getTableLastRebuiltTooltip,\n} from '../createdByModifiedByTooltips'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n const entity = bundle?.entity\n const isTableLike = !!entity && isTable(entity)\n const friendlyName = bundle ? entityTypeToFriendlyName(bundle.entityType) : ''\n\n const { data: tableQueryResult } = useGetQueryResultBundleWithAsyncStatus(\n {\n entityId,\n query: {\n sql: `SELECT * FROM ${entityId}${versionNumber ? `.${versionNumber}` : ''} LIMIT 0`,\n },\n partMask: BUNDLE_MASK_LAST_UPDATED_ON,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n },\n { enabled: !!(entity && isTable(entity)) },\n )\n\n const tableLastRebuilt = tableQueryResult?.responseBody?.lastUpdatedOn\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value: <CopyToClipboardString value={doi} href={doi} icon=\"rounded\" />,\n },\n isDoiUsage && {\n key: 'citations',\n title: 'Citations',\n value: (\n <>\n <Link onClick={() => setDataCiteCitationsDialogOpen(true)}>\n {dataCiteUsage.citationCount.toLocaleString()}\n {dataCiteUsage.citationCount == maxCitationCount && '+'}\n </Link>\n <CitationsDialog\n open={dataCiteCitationsDialogOpen}\n onClose={() => setDataCiteCitationsDialogOpen(false)}\n citations={dataCiteUsage.citations}\n />\n </>\n ),\n },\n isMentions && {\n key: 'mentions',\n title: 'Mentions',\n value: (\n <>\n <Link onClick={() => setMentionsDialogOpen(true)}>\n {mentions.length.toLocaleString()}\n </Link>\n <CitationsDialog\n open={mentionsDialogOpen}\n onClose={() => setMentionsDialogOpen(false)}\n citations={mentions}\n title=\"Mentioned in\"\n />\n </>\n ),\n },\n md5 && {\n key: 'fileMd5',\n title: 'MD5',\n value: <CopyToClipboardString value={md5} />,\n },\n !isContainer &&\n storageLocation && {\n key: 'fileStorageLocation',\n title: 'Storage Location',\n value: storageLocation,\n },\n isContainer &&\n uploadDestinationString && {\n key: 'uploadDestination',\n title: 'Upload Destination',\n value: uploadDestinationString,\n },\n endpoint && {\n key: 'externalFileEndpoint',\n title: 'Endpoint',\n value: endpoint,\n },\n externalUrl && {\n key: 'externalUrl',\n title: 'URL',\n value: <Linkify text={externalUrl} />,\n },\n bucket && { key: 'externalFileBucket', title: 'Bucket', value: bucket },\n fileKey && { key: 'externalFileKey', title: 'File Key', value: fileKey },\n downloadAlias && {\n key: 'fileAlias',\n title: 'Alias',\n value: (\n <>\n {'Name when downloaded will be: '}\n <Box sx={{ display: 'inline', fontFamily: 'monospace' }}>\n {downloadAlias}\n </Box>\n </>\n ),\n },\n entity && {\n key: 'createdBy',\n title: 'Created By',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: '4px' }}>\n <UserBadge userId={entity.createdBy} />\n <span>on {formatDate(dayjs(entity.createdOn))}</span>\n {isDataset(entity) && (\n <Tooltip title={DATASET_CREATED_BY_TOOLTIP}>\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Box>\n ),\n },\n entity && {\n key: 'modifiedBy',\n title: isTableLike ? 'Configuration Last Modified' : 'Modified By',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center', gap: '4px' }}>\n <UserBadge userId={entity.modifiedBy} />\n <span>on {formatDate(dayjs(entity.modifiedOn))}</span>\n {isTableLike && (\n <Tooltip\n title={getTableModifiedOnTooltip(friendlyName)}\n aria-label={getTableModifiedOnAccessibleLabel(friendlyName)}\n >\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n )}\n </Box>\n ),\n },\n tableLastRebuilt && {\n key: 'lastRebuilt',\n title: 'Last Rebuilt On',\n value: (\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n {formatDate(dayjs(tableLastRebuilt))}\n <Tooltip title={getTableLastRebuiltTooltip(friendlyName)}>\n <InfoTwoTone sx={INFO_ICON_SX} />\n </Tooltip>\n </Box>\n ),\n },\n ].filter(item => !!item) as EntityProperty[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EACJ,cAAc,GACd,YAAY,GACZ,kBACA,gBACA,0BACA,+BACE,EAAqB,GAAU,CAAa,GAC1C,CAAC,IAA6B,KAClC,EAAS,EAAK,GACV,CAAC,IAAoB,KAAyB,EAAS,EAAK,GAC5D,EAAE,MAAM,OAA2B,EACvC;EACE,UAAU;EACV,cAAc,OAAO,OAAO,CAAU;EACtC,wBAAwB;CAC1B,GACA,EAAE,SAAS,EAAY,CACzB,GAEM,IAAS,GAAQ,QACjB,IAAc,CAAC,CAAC,KAAU,EAAQ,CAAM,GACxC,IAAe,IAAS,GAAyB,EAAO,UAAU,IAAI,IAEtE,EAAE,MAAM,MAAqB,EACjC;EACE;EACA,OAAO,EACL,KAAK,iBAAiB,IAAW,IAAgB,IAAI,MAAkB,GAAG,UAC5E;EACA,UAAA;EACA,cAAc;CAChB,GACA,EAAE,SAAS,CAAC,EAAE,KAAU,EAAQ,CAAM,GAAG,CAC3C,GAEM,IAAmB,GAAkB,cAAc,eAGnD,IACJ,KACA,CAAC,EAAO,kBACR,GAAoB,EAAO,MAAM,KACjC,EA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kBAAC,QAAD,EAAA,UAAA,CAAM,OAAI,EAAW,EAAM,EAAO,SAAS,CAAC,CAAQ,EAAA,CAAA;KACnD,GAAU,CAAM,KACf,kBAAC,GAAD;MAAS,OAAA;gBACP,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;KACzB,CAAA;IAER;;EAET;EACA,KAAU;GACR,KAAK;GACL,OAAO,IAAc,gCAAgC;GACrD,OACE,kBAAC,GAAD;IAAK,IAAI;KAAE,SAAS;KAAQ,YAAY;KAAU,KAAK;IAAM;cAA7D;KACE,kBAAC,GAAD,EAAW,QAAQ,EAAO,WAAa,CAAA;KACvC,kBAAC,QAAD,EAAA,UAAA,CAAM,OAAI,EAAW,EAAM,EAAO,UAAU,CAAC,CAAQ,EAAA,CAAA;KACpD,KACC,kBAAC,GAAD;MACE,OAAO,GAA0B,CAAY;MAC7C,cAAY,GAAkC,CAAY;gBAE1D,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;KACzB,CAAA;IAER;;EAET;EACA,KAAoB;GAClB,KAAK;GACL,OAAO;GACP,OACE,kBAAC,GAAD;IAAK,IAAI;KAAE,SAAS;KAAQ,YAAY;IAAS;cAAjD,CACG,EAAW,EAAM,CAAgB,CAAC,GACnC,kBAAC,GAAD;KAAS,OAAO,EAA2B,CAAY;eACrD,kBAAC,GAAD,EAAa,IAAI,EAAe,CAAA;IACzB,CAAA,CACN;;EAET;CACF,EAAE,QAAO,MAAQ,CAAC,CAAC,CAAI;AACzB"}
@@ -81,7 +81,10 @@ function f(f) {
81
81
  min: e.target.value,
82
82
  max: h.max
83
83
  }),
84
- slotProps: { htmlInput: { "aria-label": "min" } }
84
+ slotProps: { htmlInput: {
85
+ "aria-label": "min",
86
+ autoComplete: "off"
87
+ } }
85
88
  }) }, "range_min"), /* @__PURE__ */ a(t, { children: /* @__PURE__ */ a(r, {
86
89
  label: "To",
87
90
  type: "number",
@@ -90,7 +93,10 @@ function f(f) {
90
93
  max: e.target.value,
91
94
  min: h.min
92
95
  }),
93
- slotProps: { htmlInput: { "aria-label": "max" } }
96
+ slotProps: { htmlInput: {
97
+ "aria-label": "max",
98
+ autoComplete: "off"
99
+ } }
94
100
  }) }, "range_max")] }),
95
101
  /* @__PURE__ */ a(n, {
96
102
  size: "small",
@@ -1 +1 @@
1
- {"version":3,"file":"Range.js","names":[],"sources":["../../../src/components/widgets/Range.tsx"],"sourcesContent":["import React, { useState } from 'react'\nimport dayjs from 'dayjs'\nimport { DatePicker } from '@mui/x-date-pickers'\nimport { Box, Button, TextField } from '@mui/material'\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'\nimport isEmpty from 'lodash-es/isEmpty'\n\ntype ControlType = 'number' | 'date'\n\nexport type RangeValues<T = string | number> = {\n min?: T\n max?: T\n}\n\nexport type RangeProps = {\n type: ControlType\n initialValues?: RangeValues\n className?: string\n errorText?: string\n onApplyClicked: (newValues: RangeValues) => void\n}\n\nexport function Range(props: RangeProps): React.ReactNode {\n const errorText = 'Min value should be less than max value'\n const [error, setError] = useState(false)\n const [values, setValues] = useState(() =>\n props.type === 'number' && props.initialValues\n ? props.initialValues\n : (props.initialValues && {\n min: props.initialValues.min\n ? dayjs(props.initialValues.min).format('YYYY-MM-DD')\n : undefined,\n max: props.initialValues.max\n ? dayjs(props.initialValues.max).format('YYYY-MM-DD')\n : undefined,\n }) || {\n min: undefined,\n max: undefined,\n },\n )\n\n const isValid = (\n { min, max }: RangeValues,\n\n type: ControlType = 'number',\n ) => {\n // Treat null, undefined, and empty string as \"no value\" — one-sided ranges are always valid\n if (isEmpty(min) || isEmpty(max)) {\n setError(false)\n return true\n }\n\n if (type === 'number') {\n if (Number(min) > Number(max)) {\n setError(true)\n return false\n }\n } else if (Date.parse(min as string) > Date.parse(max as string)) {\n setError(true)\n return false\n }\n setError(false)\n return true\n }\n\n const handleAppyChanges = (\n values: RangeValues,\n callBackFn: (newValues: RangeValues) => void,\n type: ControlType = 'number',\n ) => {\n if (isValid(values, type)) {\n // Normalize empty strings to undefined so downstream code receives clean absent values\n callBackFn({\n min: values.min === '' ? undefined : values.min,\n max: values.max === '' ? undefined : values.max,\n })\n }\n }\n\n return (\n <Box\n sx={{\n display: 'flex',\n flexWrap: 'wrap',\n flex: '1 0',\n marginRight: '10px',\n gap: '10px',\n '& .MuiInputBase-root': {\n minWidth: '150px',\n },\n '& .MuiInputBase-root,.MuiButton-root': {\n height: '38px',\n },\n '& .MuiInputLabel-root': {\n color: 'grey.700',\n fontWeight: 400,\n },\n }}\n >\n {props.type === 'date' ? (\n <>\n <Box key=\"range_min\">\n <LocalizationProvider dateAdapter={AdapterDayjs}>\n <DatePicker\n enableAccessibleFieldDOMStructure={false}\n label=\"From\"\n slots={{\n textField: TextField,\n }}\n slotProps={{\n textField: {\n error: false,\n inputProps: {\n 'aria-label': 'min',\n },\n },\n }}\n value={values.min ? dayjs(values.min) : null}\n onChange={date =>\n setValues({\n min: date ? dayjs(date).format('YYYY-MM-DD') : undefined,\n max: values.max,\n })\n }\n />\n </LocalizationProvider>\n </Box>\n <Box key=\"range_max\">\n <LocalizationProvider dateAdapter={AdapterDayjs}>\n <DatePicker\n enableAccessibleFieldDOMStructure={false}\n label=\"To\"\n slots={{\n textField: TextField,\n }}\n slotProps={{\n textField: {\n error: false,\n inputProps: {\n 'aria-label': 'max',\n },\n },\n }}\n value={values.max ? dayjs(values.max) : null}\n onChange={date =>\n setValues({\n max: date ? dayjs(date).format('YYYY-MM-DD') : undefined,\n min: values.min,\n })\n }\n />\n </LocalizationProvider>\n </Box>\n </>\n ) : (\n <>\n <Box key=\"range_min\">\n <TextField\n label=\"From\"\n type=\"number\"\n value={values.min ?? ''}\n onChange={e =>\n setValues({\n min: e.target.value,\n max: values.max,\n })\n }\n slotProps={{\n htmlInput: { 'aria-label': 'min' },\n }}\n />\n </Box>\n <Box key=\"range_max\">\n <TextField\n label=\"To\"\n type=\"number\"\n value={values.max ?? ''}\n onChange={e =>\n setValues({\n max: e.target.value,\n min: values.min,\n })\n }\n slotProps={{\n htmlInput: { 'aria-label': 'max' },\n }}\n />\n </Box>\n </>\n )}\n <Button\n size=\"small\"\n variant=\"outlined\"\n onClick={() =>\n handleAppyChanges(values, props.onApplyClicked, props.type)\n }\n sx={{\n alignSelf: 'flex-end',\n fontSize: 16,\n }}\n >\n Apply\n </Button>\n {error && (\n <div className=\"SRC-danger-color\">{props.errorText || errorText}</div>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,EAAM,GAAoC;CACxD,IACM,CAAC,GAAO,KAAY,EAAS,EAAK,GAClC,CAAC,GAAQ,KAAa,QAC1B,EAAM,SAAS,YAAY,EAAM,gBAC7B,EAAM,gBACL,EAAM,iBAAiB;EACtB,KAAK,EAAM,cAAc,MACrB,EAAM,EAAM,cAAc,GAAG,EAAE,OAAO,YAAY,IAClD,KAAA;EACJ,KAAK,EAAM,cAAc,MACrB,EAAM,EAAM,cAAc,GAAG,EAAE,OAAO,YAAY,IAClD,KAAA;CACN,KAAM;EACJ,KAAK,KAAA;EACL,KAAK,KAAA;CACP,CACN,GAEM,KACJ,EAAE,QAAK,UAEP,IAAoB,aACjB;EAEH,IAAI,EAAQ,CAAG,KAAK,EAAQ,CAAG,GAE7B,OADA,EAAS,EAAK,GACP;EAGT,IAAI,MAAS;OACP,OAAO,CAAG,IAAI,OAAO,CAAG,GAE1B,OADA,EAAS,EAAI,GACN;EACT,OACK,IAAI,KAAK,MAAM,CAAa,IAAI,KAAK,MAAM,CAAa,GAE7D,OADA,EAAS,EAAI,GACN;EAGT,OADA,EAAS,EAAK,GACP;CACT,GAEM,KACJ,GACA,GACA,IAAoB,aACjB;EACH,AAAI,EAAQ,GAAQ,CAAI,KAEtB,EAAW;GACT,KAAK,EAAO,QAAQ,KAAK,KAAA,IAAY,EAAO;GAC5C,KAAK,EAAO,QAAQ,KAAK,KAAA,IAAY,EAAO;EAC9C,CAAC;CAEL;CAEA,OACE,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KAAK,EAAO;IACd,CAAC;IAEH,WAAW,EACT,WAAW,EAAE,cAAc,MAAM,EACnC;GACD,CAAA,EACE,GAfI,WAeJ,GACL,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IACE,OAAM;IACN,MAAK;IACL,OAAO,EAAO,OAAO;IACrB,WAAU,MACR,EAAU;KACR,KAAK,EAAE,OAAO;KACd,KAAK,EAAO;IACd,CAAC;IAEH,WAAW,EACT,WAAW,EAAE,cAAc,MAAM,EACnC;GACD,CAAA,EACE,GAfI,WAeJ,CACL,EAAA,CAAA;GAEJ,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,eACE,EAAkB,GAAQ,EAAM,gBAAgB,EAAM,IAAI;IAE5D,IAAI;KACF,WAAW;KACX,UAAU;IACZ;cACD;GAEO,CAAA;GACP,KACC,kBAAC,OAAD;IAAK,WAAU;cAAoB,EAAM,aAAa;GAAe,CAAA;EAEpE;;AAET"}
1
+ {"version":3,"file":"Range.js","names":[],"sources":["../../../src/components/widgets/Range.tsx"],"sourcesContent":["import React, { useState } from 'react'\nimport dayjs from 'dayjs'\nimport { DatePicker } from '@mui/x-date-pickers'\nimport { Box, Button, TextField } from '@mui/material'\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'\nimport isEmpty from 'lodash-es/isEmpty'\n\ntype ControlType = 'number' | 'date'\n\nexport type RangeValues<T = string | number> = {\n min?: T\n max?: T\n}\n\nexport type RangeProps = {\n type: ControlType\n initialValues?: RangeValues\n className?: string\n errorText?: string\n onApplyClicked: (newValues: RangeValues) => void\n}\n\nexport function Range(props: RangeProps): React.ReactNode {\n const errorText = 'Min value should be less than max value'\n const [error, setError] = useState(false)\n const [values, setValues] = useState(() =>\n props.type === 'number' && props.initialValues\n ? props.initialValues\n : (props.initialValues && {\n min: props.initialValues.min\n ? dayjs(props.initialValues.min).format('YYYY-MM-DD')\n : undefined,\n max: props.initialValues.max\n ? dayjs(props.initialValues.max).format('YYYY-MM-DD')\n : undefined,\n }) || {\n min: undefined,\n max: undefined,\n },\n )\n\n const isValid = (\n { min, max }: RangeValues,\n\n type: ControlType = 'number',\n ) => {\n // Treat null, undefined, and empty string as \"no value\" — one-sided ranges are always valid\n if (isEmpty(min) || isEmpty(max)) {\n setError(false)\n return true\n }\n\n if (type === 'number') {\n if (Number(min) > Number(max)) {\n setError(true)\n return false\n }\n } else if (Date.parse(min as string) > Date.parse(max as string)) {\n setError(true)\n return false\n }\n setError(false)\n return true\n }\n\n const handleAppyChanges = (\n values: RangeValues,\n callBackFn: (newValues: RangeValues) => void,\n type: ControlType = 'number',\n ) => {\n if (isValid(values, type)) {\n // Normalize empty strings to undefined so downstream code receives clean absent values\n callBackFn({\n min: values.min === '' ? undefined : values.min,\n max: values.max === '' ? undefined : values.max,\n })\n }\n }\n\n return (\n <Box\n sx={{\n display: 'flex',\n flexWrap: 'wrap',\n flex: '1 0',\n marginRight: '10px',\n gap: '10px',\n '& .MuiInputBase-root': {\n minWidth: '150px',\n },\n '& .MuiInputBase-root,.MuiButton-root': {\n height: '38px',\n },\n '& .MuiInputLabel-root': {\n color: 'grey.700',\n fontWeight: 400,\n },\n }}\n >\n {props.type === 'date' ? (\n <>\n <Box key=\"range_min\">\n <LocalizationProvider dateAdapter={AdapterDayjs}>\n <DatePicker\n enableAccessibleFieldDOMStructure={false}\n label=\"From\"\n slots={{\n textField: TextField,\n }}\n slotProps={{\n textField: {\n error: false,\n inputProps: {\n 'aria-label': 'min',\n },\n },\n }}\n value={values.min ? dayjs(values.min) : null}\n onChange={date =>\n setValues({\n min: date ? dayjs(date).format('YYYY-MM-DD') : undefined,\n max: values.max,\n })\n }\n />\n </LocalizationProvider>\n </Box>\n <Box key=\"range_max\">\n <LocalizationProvider dateAdapter={AdapterDayjs}>\n <DatePicker\n enableAccessibleFieldDOMStructure={false}\n label=\"To\"\n slots={{\n textField: TextField,\n }}\n slotProps={{\n textField: {\n error: false,\n inputProps: {\n 'aria-label': 'max',\n },\n },\n }}\n value={values.max ? dayjs(values.max) : null}\n onChange={date =>\n setValues({\n max: date ? dayjs(date).format('YYYY-MM-DD') : undefined,\n min: values.min,\n })\n }\n />\n </LocalizationProvider>\n </Box>\n </>\n ) : (\n <>\n <Box key=\"range_min\">\n <TextField\n label=\"From\"\n type=\"number\"\n value={values.min ?? ''}\n onChange={e =>\n setValues({\n min: e.target.value,\n max: values.max,\n })\n }\n slotProps={{\n htmlInput: { 'aria-label': 'min', autoComplete: 'off' },\n }}\n />\n </Box>\n <Box key=\"range_max\">\n <TextField\n label=\"To\"\n type=\"number\"\n value={values.max ?? ''}\n onChange={e =>\n setValues({\n max: e.target.value,\n min: values.min,\n })\n }\n slotProps={{\n htmlInput: { 'aria-label': 'max', autoComplete: 'off' },\n }}\n />\n </Box>\n </>\n )}\n <Button\n size=\"small\"\n variant=\"outlined\"\n onClick={() =>\n handleAppyChanges(values, props.onApplyClicked, props.type)\n }\n sx={{\n alignSelf: 'flex-end',\n fontSize: 16,\n }}\n >\n Apply\n </Button>\n {error && (\n <div className=\"SRC-danger-color\">{props.errorText || errorText}</div>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,EAAM,GAAoC;CACxD,IACM,CAAC,GAAO,KAAY,EAAS,EAAK,GAClC,CAAC,GAAQ,KAAa,QAC1B,EAAM,SAAS,YAAY,EAAM,gBAC7B,EAAM,gBACL,EAAM,iBAAiB;EACtB,KAAK,EAAM,cAAc,MACrB,EAAM,EAAM,cAAc,GAAG,EAAE,OAAO,YAAY,IAClD,KAAA;EACJ,KAAK,EAAM,cAAc,MACrB,EAAM,EAAM,cAAc,GAAG,EAAE,OAAO,YAAY,IAClD,KAAA;CACN,KAAM;EACJ,KAAK,KAAA;EACL,KAAK,KAAA;CACP,CACN,GAEM,KACJ,EAAE,QAAK,UAEP,IAAoB,aACjB;EAEH,IAAI,EAAQ,CAAG,KAAK,EAAQ,CAAG,GAE7B,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O;MACP,YAAY,EACV,cAAc,MAChB;KACF,EACF;KACA,OAAO,EAAO,MAAM,EAAM,EAAO,GAAG,IAAI;KACxC,WAAU,MACR,EAAU;MACR,KAAK,IAAO,EAAM,CAAI,EAAE,OAAO,YAAY,IAAI,KAAA;MAC/C,KAAK,EAAO;KACd,CAAC;IAEJ,CAAA;GACmB,CAAA,EACnB,GAzBI,WAyBJ,CACL,EAAA,CAAA,IAEF,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IACE,OAAM;IACN,MAAK;IACL,OAAO,EAAO,OAAO;IACrB,WAAU,MACR,EAAU;KACR,KAAK,EAAE,OAAO;KACd,KAAK,EAAO;IACd,CAAC;IAEH,WAAW,EACT,WAAW;KAAE,cAAc;KAAO,cAAc;IAAM,EACxD;GACD,CAAA,EACE,GAfI,WAeJ,GACL,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IACE,OAAM;IACN,MAAK;IACL,OAAO,EAAO,OAAO;IACrB,WAAU,MACR,EAAU;KACR,KAAK,EAAE,OAAO;KACd,KAAK,EAAO;IACd,CAAC;IAEH,WAAW,EACT,WAAW;KAAE,cAAc;KAAO,cAAc;IAAM,EACxD;GACD,CAAA,EACE,GAfI,WAeJ,CACL,EAAA,CAAA;GAEJ,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,eACE,EAAkB,GAAQ,EAAM,gBAAgB,EAAM,IAAI;IAE5D,IAAI;KACF,WAAW;KACX,UAAU;IACZ;cACD;GAEO,CAAA;GACP,KACC,kBAAC,OAAD;IAAK,WAAU;cAAoB,EAAM,aAAa;GAAe,CAAA;EAEpE;;AAET"}
@@ -12,6 +12,8 @@ export type FacetNavPanelProps = {
12
12
  isModalView: boolean;
13
13
  onCloseModal?: () => void;
14
14
  };
15
+ export declare const MAX_PLOT_HEIGHT_PX = 150;
16
+ export declare const MAX_EXPANDED_PLOT_HEIGHT_PX = 300;
15
17
  export type PlotType = 'PIE' | 'BAR' | 'STACKED_HORIZONTAL_BAR';
16
18
  export type GraphData = {
17
19
  data: Plotly.Data[];
@@ -1 +1 @@
1
- {"version":3,"file":"FacetNavPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/widgets/facet-nav/FacetNavPanel.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAW9C,OAAO,EAAE,cAAc,EAAY,MAAM,wBAAwB,CAAA;AAGjE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wBAAwB,EAAE,CACxB,KAAK,EAAE,uBAAuB,EAC9B,KAAK,EAAE,2BAA2B,GAAG,SAAS,EAC9C,UAAU,EAAE,OAAO,KAChB,IAAI,CAAA;IACT,yBAAyB,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAA;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,uBAAuB,CAAA;IACpC,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAA;IAC3C,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAKD,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,wBAAwB,CAAA;AAE/D,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAA;IACnB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB,CAAA;AAED,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,uBAAuB,EACpC,UAAU,EAAE,cAAc,GAAG,SAAS,EACtC,KAAK,EAAE,MAAM,EACb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