@cccsaurora/clue-ui 1.0.0-dev.48 → 1.0.0

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 (180) hide show
  1. package/ActionForm-WIj7BfD5.js +340 -0
  2. package/AnnotationPreview-DWRDhxUB.js +140 -0
  3. package/ClueEnrichContext-CbJVBm4w.js +397 -0
  4. package/FlexOne-BXWFOd1T.js +6 -0
  5. package/_Map-DXNg_Z-q.js +54 -0
  6. package/_MapCache-Cu25RRDU.js +129 -0
  7. package/_Uint8Array-DlJCtTvG.js +102 -0
  8. package/_baseAssignValue-CUmzp727.js +20 -0
  9. package/_baseClone-BlMmRXeX.js +208 -0
  10. package/_baseExtremum-P_0akmCi.js +27 -0
  11. package/_baseFlatten-CN7vDNEQ.js +72 -0
  12. package/_baseGet-Dgf6_xCm.js +80 -0
  13. package/_baseIsEqual-Cpjtfb3Q.js +173 -0
  14. package/_baseIteratee-CP1bocOX.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-tMFmk80M.js +61 -0
  18. package/_commonjsHelpers-C6fGbg64.js +6 -0
  19. package/_createAggregator-B4Cav8ZM.js +53 -0
  20. package/_getPrototype-CHAFQYL_.js +5 -0
  21. package/_getTag-BV_UoLYG.js +90 -0
  22. package/cloneDeep-BPVpFBzJ.js +8 -0
  23. package/components/AnnotationBody.js +34 -49
  24. package/components/AnnotationDetailPopover.js +30 -36
  25. package/components/AnnotationDetails.js +94 -109
  26. package/components/AnnotationEntry.js +52 -55
  27. package/components/AnnotationPreview.js +5 -5
  28. package/components/ClassificationChip.js +23 -44
  29. package/components/CountBadge.js +26 -31
  30. package/components/EnrichedCard.js +92 -104
  31. package/components/EnrichedChip.js +109 -134
  32. package/components/EnrichedTypography.js +110 -136
  33. package/components/ErrorBoundary.js +24 -28
  34. package/components/RetryFailedEnrichments.js +9 -10
  35. package/components/SourcePicker.js +49 -57
  36. package/components/actions/ActionForm.js +4 -4
  37. package/components/actions/ExecutePopover.js +50 -64
  38. package/components/actions/ResultModal.js +34 -37
  39. package/components/actions/form/schemaAdapter.js +20 -39
  40. package/components/display/graph/ExpandMoreButton.js +10 -10
  41. package/components/display/graph/elements/NodeCard.js +76 -92
  42. package/components/display/graph/elements/NodeTag.js +13 -15
  43. package/components/display/graph/index.js +200 -258
  44. package/components/display/graph/visualizations/Leaf.js +69 -88
  45. package/components/display/graph/visualizations/cloud/index.js +81 -98
  46. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  47. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  48. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  52. package/components/display/graph/visualizations/icons/index.js +13 -14
  53. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  54. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  55. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  56. package/components/display/graph/visualizations/tree/index.js +305 -407
  57. package/components/display/icons/Iconified.js +12 -27
  58. package/components/display/json/index.js +4 -4
  59. package/components/display/markdown/DynamicTabs.js +17 -22
  60. package/components/display/markdown/index.js +5674 -8531
  61. package/components/display/markdown/markdownPlugins/tabs.js +1 -1
  62. package/components/enrichment/EnrichPopover.js +47 -55
  63. package/components/fetchers/Fetcher.js +95 -123
  64. package/components/fetchers/PreviewModal.js +17 -20
  65. package/components/fetchers/StatusChip.js +18 -22
  66. package/components/group/Entry.js +11 -13
  67. package/components/group/Group.js +10 -13
  68. package/components/group/GroupControl.js +65 -76
  69. package/components/stats/QueryStatus.js +28 -37
  70. package/countBy-DOutsa_w.js +8 -0
  71. package/data/event.js +4 -6
  72. package/database/index.js +2 -2
  73. package/debounce-DryYcbJ4.js +56 -0
  74. package/get-Bow1vKwx.js +8 -0
  75. package/groupBy-BheQYl6f.js +8 -0
  76. package/hooks/ClueActionContext.js +6 -6
  77. package/hooks/ClueComponentContext.js +23 -29
  78. package/hooks/ClueConfigProvider.js +12 -14
  79. package/hooks/ClueDatabaseContext.js +13 -19
  80. package/hooks/ClueEnrichContext.js +8 -8
  81. package/hooks/ClueFetcherContext.js +46 -74
  82. package/hooks/ClueGroupContext.js +14 -17
  83. package/hooks/CluePopupContext.js +5 -5
  84. package/hooks/ClueProvider.js +10 -12
  85. package/hooks/selectors.js +11 -22
  86. package/hooks/useAnnotations.js +32 -48
  87. package/hooks/useClue.js +4 -6
  88. package/hooks/useClueActions.js +3 -3
  89. package/hooks/useClueConfig.js +5 -5
  90. package/hooks/useClueTypeConfig.js +3 -3
  91. package/hooks/useComparator.js +435 -722
  92. package/hooks/useErrors.js +18 -22
  93. package/hooks/useMyHighlights.js +36 -66
  94. package/hooks/useMyLocalStorage.js +43 -63
  95. package/iconify-BBckr5AQ.js +1263 -0
  96. package/icons/Action.js +49 -66
  97. package/icons/Assessment.js +68 -84
  98. package/icons/Context.js +61 -75
  99. package/icons/Opinion.js +65 -77
  100. package/icons/iconMap.js +2 -2
  101. package/identity-ByMq8VxU.js +6 -0
  102. package/index-4YFAh_sa.js +358 -0
  103. package/index-E7g8cRyW.js +568 -0
  104. package/index-HuYhutsd.js +975 -0
  105. package/index-WvFmjbxF.js +12734 -0
  106. package/index-p5_wX7q1.js +11729 -0
  107. package/isEmpty-g47Qir2A.js +21 -0
  108. package/isNil-CjWwlQS3.js +6 -0
  109. package/isObject-B53jY8Qg.js +7 -0
  110. package/isObjectLike-BatpeCIi.js +29 -0
  111. package/isSymbol-C3_SC0Qp.js +8 -0
  112. package/isUndefined-DiNCDKoz.js +10 -0
  113. package/last-7CdUxN0r.js +7 -0
  114. package/main.js +68 -68
  115. package/package.json +1 -1
  116. package/sortBy-ITdmD17L.js +79 -0
  117. package/sumBy-DxJUU2E8.js +8 -0
  118. package/tabs-CgADNA57.js +195 -0
  119. package/text/Frequency.js +23 -42
  120. package/toFinite-BMy6GObD.js +14 -0
  121. package/toNumber-YVhnnJv4.js +31 -0
  122. package/useClueTypeConfig-BQ33EiyB.js +2273 -0
  123. package/utils/chain.js +64 -91
  124. package/utils/classificationParser.js +254 -504
  125. package/utils/constants.js +10 -35
  126. package/utils/graph.js +45 -72
  127. package/utils/hashUtil.js +7 -7
  128. package/utils/line.js +81 -131
  129. package/utils/loggerUtil.js +3 -5
  130. package/utils/sessionStorage.js +29 -41
  131. package/utils/utils.js +9 -9
  132. package/utils/window.js +10 -21
  133. package/utils-C_RX5uMP.js +2704 -0
  134. package/ActionForm-c5hLIfQ-.js +0 -436
  135. package/AnnotationPreview-BvNpZOP0.js +0 -188
  136. package/ClueEnrichContext-m-4vn9rz.js +0 -518
  137. package/FlexOne-BSYAhhtG.js +0 -9
  138. package/_Map-kgDsDYxq.js +0 -64
  139. package/_MapCache-DabaaWfq.js +0 -161
  140. package/_Uint8Array-BlVVH1tp.js +0 -129
  141. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  142. package/_baseClone-D3a8Pa4T.js +0 -284
  143. package/_baseExtremum-B1o1zHjR.js +0 -33
  144. package/_baseFlatten-D4huXoEI.js +0 -92
  145. package/_baseGet-BSK_nnoz.js +0 -109
  146. package/_baseIsEqual-B5xLoweL.js +0 -238
  147. package/_baseIteratee-p6Nj07-n.js +0 -126
  148. package/_baseSlice-GAv_YFTT.js +0 -20
  149. package/_baseSum-D0WC1dN0.js +0 -13
  150. package/_baseUniq-CpupKWcL.js +0 -89
  151. package/_commonjsHelpers-CUmg6egw.js +0 -6
  152. package/_createAggregator-BpVy5xMi.js +0 -63
  153. package/_getPrototype-D1LAdQKO.js +0 -5
  154. package/_getTag-D3ToyefI.js +0 -126
  155. package/cloneDeep-CjP5k9zW.js +0 -8
  156. package/countBy-C69WslUA.js +0 -14
  157. package/debounce-bV0h5FC5.js +0 -92
  158. package/get-D3C3lEU3.js +0 -8
  159. package/groupBy-DC2oOuBN.js +0 -14
  160. package/iconify-CXMreGTg.js +0 -1782
  161. package/identity-CPGTqrE4.js +0 -6
  162. package/index-BDVjGvMI.js +0 -696
  163. package/index-BDrtH5ec.js +0 -465
  164. package/index-BbPn6-Mw.js +0 -15750
  165. package/index-C9lySIVX.js +0 -1172
  166. package/index-Dn2NHyXg.js +0 -17654
  167. package/isEmpty-BQkZubqU.js +0 -29
  168. package/isNil-CIubwp4T.js +0 -6
  169. package/isObject-FTY-5JQX.js +0 -7
  170. package/isObjectLike-OAgjjZye.js +0 -48
  171. package/isSymbol-Xd2FsJyp.js +0 -8
  172. package/isUndefined-CE8h73dH.js +0 -10
  173. package/last-CUCl67Im.js +0 -7
  174. package/sortBy-B-UKp4GT.js +0 -100
  175. package/sumBy-MYkDPHZL.js +0 -8
  176. package/tabs-xGuUGsJd.js +0 -254
  177. package/toFinite-Bc55msYj.js +0 -16
  178. package/toNumber-DPxy1FBy.js +0 -39
  179. package/useClueTypeConfig-D4zcy8Gr.js +0 -3184
  180. package/utils-CxIhC2xH.js +0 -4182
@@ -1,150 +1,136 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { I as Icon } from "../iconify-CXMreGTg.js";
3
- import { useTheme, Stack, Typography, Tooltip, Box, IconButton, CircularProgress, Chip, Accordion, AccordionSummary, AccordionDetails, Divider } from "@mui/material";
4
- import Iconified from "./display/icons/Iconified.js";
5
- import { SNACKBAR_EVENT_ID } from "../data/event.js";
6
- import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
7
- import { useClueEnrichSelector } from "../hooks/selectors.js";
8
- import useAnnotations from "../hooks/useAnnotations.js";
9
- import useErrors from "../hooks/useErrors.js";
10
- import { ICON_MAP } from "../icons/iconMap.js";
11
- import { safeDispatchEvent } from "../utils/window.js";
12
- import { memo, useState, useMemo, useCallback, useEffect } from "react";
13
- import { u as useContextSelector } from "../index-BDVjGvMI.js";
14
- import ExecutePopover from "./actions/ExecutePopover.js";
15
- import AnnotationEntry from "./AnnotationEntry.js";
16
- import ClassificationChip from "./ClassificationChip.js";
17
- import EnrichPopover from "./enrichment/EnrichPopover.js";
18
- import { u as uniq } from "../ClueEnrichContext-m-4vn9rz.js";
19
- import { g as groupBy } from "../groupBy-DC2oOuBN.js";
20
- import { i as isNull } from "../isUndefined-CE8h73dH.js";
21
- const AnnotationDetails = ({ enrichRequest, setReady, updatePosition }) => {
22
- const theme = useTheme();
23
- const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
24
- const [filter, setFilter] = useState("all");
25
- const enrich = useClueEnrichSelector((state) => state.enrich);
26
- const [annotations, loading] = useAnnotations(
27
- enrichRequest == null ? void 0 : enrichRequest.type,
28
- enrichRequest == null ? void 0 : enrichRequest.value,
29
- enrichRequest == null ? void 0 : enrichRequest.classification,
30
- { skipEnrichment: true }
31
- );
32
- const errors = useErrors(enrichRequest == null ? void 0 : enrichRequest.value);
33
- const options = useMemo(
34
- () => ["all", ...uniq((annotations ?? []).map((annotation) => annotation.type))],
35
- [annotations]
36
- );
37
- const annotationsByType = useMemo(() => groupBy(annotations ?? [], "type"), [annotations]);
38
- const forceEnrich = useCallback(async () => {
39
- await enrich(enrichRequest.type, enrichRequest.value, {
40
- classification: enrichRequest.classification,
1
+ import { jsxs as n, jsx as i } from "react/jsx-runtime";
2
+ import { I as E } from "../iconify-BBckr5AQ.js";
3
+ import { useTheme as M, Stack as l, Typography as s, Tooltip as x, Box as z, IconButton as A, CircularProgress as N, Chip as S, Accordion as $, AccordionSummary as j, AccordionDetails as _, Divider as u } from "@mui/material";
4
+ import g from "./display/icons/Iconified.js";
5
+ import { SNACKBAR_EVENT_ID as O } from "../data/event.js";
6
+ import { ClueComponentContext as F } from "../hooks/ClueComponentContext.js";
7
+ import { useClueEnrichSelector as H } from "../hooks/selectors.js";
8
+ import K from "../hooks/useAnnotations.js";
9
+ import L from "../hooks/useErrors.js";
10
+ import { ICON_MAP as T } from "../icons/iconMap.js";
11
+ import { safeDispatchEvent as U } from "../utils/window.js";
12
+ import { memo as V, useState as W, useMemo as k, useCallback as G, useEffect as J } from "react";
13
+ import { u as P } from "../index-E7g8cRyW.js";
14
+ import Q from "./actions/ExecutePopover.js";
15
+ import X from "./AnnotationEntry.js";
16
+ import Y from "./ClassificationChip.js";
17
+ import Z from "./enrichment/EnrichPopover.js";
18
+ import { u as q } from "../ClueEnrichContext-CbJVBm4w.js";
19
+ import { g as R } from "../groupBy-BheQYl6f.js";
20
+ import { i as w } from "../isUndefined-DiNCDKoz.js";
21
+ const ii = ({ enrichRequest: o, setReady: d, updatePosition: p }) => {
22
+ const v = M(), { t: c } = P(F, (a) => a.i18next), [r, I] = W("all"), y = H((a) => a.enrich), [t, C] = K(
23
+ o == null ? void 0 : o.type,
24
+ o == null ? void 0 : o.value,
25
+ o == null ? void 0 : o.classification,
26
+ { skipEnrichment: !0 }
27
+ ), m = L(o == null ? void 0 : o.value), B = k(
28
+ () => ["all", ...q((t ?? []).map((a) => a.type))],
29
+ [t]
30
+ ), b = k(() => R(t ?? [], "type"), [t]), h = G(async () => {
31
+ await y(o.type, o.value, {
32
+ classification: o.classification,
41
33
  timeout: 15,
42
- force: true
34
+ force: !0
43
35
  });
44
- }, [enrichRequest, enrich]);
45
- useEffect(() => {
46
- if (!setReady) {
47
- return;
48
- }
49
- setReady(enrichRequest && !isNull(annotations));
50
- updatePosition == null ? void 0 : updatePosition();
51
- }, [annotations, enrichRequest, setReady, updatePosition]);
52
- return enrichRequest && !isNull(annotations) && /* @__PURE__ */ jsxs(Stack, { direction: "column", sx: { p: 1, width: "100%" }, spacing: 1, children: [
53
- /* @__PURE__ */ jsxs(Stack, { spacing: 1, children: [
54
- /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
55
- /* @__PURE__ */ jsxs(Stack, { children: [
56
- /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
57
- /* @__PURE__ */ jsx(Typography, { variant: "body1", fontWeight: "bold", children: "Clue" }),
58
- enrichRequest.classification && /* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: enrichRequest.classification })
36
+ }, [o, y]);
37
+ return J(() => {
38
+ d && (d(o && !w(t)), p == null || p());
39
+ }, [t, o, d, p]), o && !w(t) && /* @__PURE__ */ n(l, { direction: "column", sx: { p: 1, width: "100%" }, spacing: 1, children: [
40
+ /* @__PURE__ */ n(l, { spacing: 1, children: [
41
+ /* @__PURE__ */ n(l, { direction: "row", spacing: 1, children: [
42
+ /* @__PURE__ */ n(l, { children: [
43
+ /* @__PURE__ */ n(l, { direction: "row", spacing: 1, children: [
44
+ /* @__PURE__ */ i(s, { variant: "body1", fontWeight: "bold", children: "Clue" }),
45
+ o.classification && /* @__PURE__ */ i(Y, { size: "small", classification: o.classification })
59
46
  ] }),
60
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", children: [
61
- enrichRequest.type.toLocaleUpperCase(),
47
+ /* @__PURE__ */ n(s, { variant: "caption", color: "text.secondary", children: [
48
+ o.type.toLocaleUpperCase(),
62
49
  " ",
63
- t("enrichment")
50
+ c("enrichment")
64
51
  ] })
65
52
  ] }),
66
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
67
- /* @__PURE__ */ jsx(Tooltip, { title: t("refresh"), children: /* @__PURE__ */ jsx(Box, { sx: { alignSelf: "center", m: -1 }, children: /* @__PURE__ */ jsx(IconButton, { onClick: () => forceEnrich(), disabled: loading, children: loading ? /* @__PURE__ */ jsx(CircularProgress, { variant: "indeterminate", size: 20 }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-replay", fontSize: "small" }) }) }) }),
68
- /* @__PURE__ */ jsx(Tooltip, { title: t("clipboard"), children: /* @__PURE__ */ jsx(
69
- IconButton,
53
+ /* @__PURE__ */ i("div", { style: { flex: 1 } }),
54
+ /* @__PURE__ */ i(x, { title: c("refresh"), children: /* @__PURE__ */ i(z, { sx: { alignSelf: "center", m: -1 }, children: /* @__PURE__ */ i(A, { onClick: () => h(), disabled: C, children: C ? /* @__PURE__ */ i(N, { variant: "indeterminate", size: 20 }) : /* @__PURE__ */ i(g, { icon: "ic:baseline-replay", fontSize: "small" }) }) }) }),
55
+ /* @__PURE__ */ i(x, { title: c("clipboard"), children: /* @__PURE__ */ i(
56
+ A,
70
57
  {
71
58
  sx: { alignSelf: "center", m: -1 },
72
59
  onClick: () => {
73
- navigator.clipboard.writeText(enrichRequest.value);
74
- safeDispatchEvent(
75
- new CustomEvent(SNACKBAR_EVENT_ID, {
60
+ navigator.clipboard.writeText(o.value), U(
61
+ new CustomEvent(O, {
76
62
  detail: {
77
- message: `${enrichRequest.value} ${t("clipboard.success")}`,
63
+ message: `${o.value} ${c("clipboard.success")}`,
78
64
  level: "success"
79
65
  }
80
66
  })
81
67
  );
82
68
  },
83
- children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-assignment", fontSize: "small" })
69
+ children: /* @__PURE__ */ i(g, { icon: "ic:outline-assignment", fontSize: "small" })
84
70
  }
85
71
  ) }),
86
- /* @__PURE__ */ jsx(EnrichPopover, { selector: enrichRequest }),
87
- /* @__PURE__ */ jsx(ExecutePopover, { selectors: [enrichRequest] })
72
+ /* @__PURE__ */ i(Z, { selector: o }),
73
+ /* @__PURE__ */ i(Q, { selectors: [o] })
88
74
  ] }),
89
- /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 0.5, children: [
90
- options.map((opt, id) => /* @__PURE__ */ jsx(
91
- Chip,
75
+ /* @__PURE__ */ n(l, { direction: "row", spacing: 0.5, children: [
76
+ B.map((a, e) => /* @__PURE__ */ i(
77
+ S,
92
78
  {
93
79
  size: "small",
94
- variant: opt === filter ? "filled" : "outlined",
95
- icon: ICON_MAP[opt] && /* @__PURE__ */ jsx(Icon, { icon: ICON_MAP[opt] }),
96
- label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
97
- opt,
80
+ variant: a === r ? "filled" : "outlined",
81
+ icon: T[a] && /* @__PURE__ */ i(E, { icon: T[a] }),
82
+ label: /* @__PURE__ */ n(s, { variant: "caption", textTransform: "capitalize", children: [
83
+ a,
98
84
  ":",
99
85
  " ",
100
- opt === "all" ? annotations.length : annotations.filter((annotation) => annotation.type === opt).length
86
+ a === "all" ? t.length : t.filter((f) => f.type === a).length
101
87
  ] }),
102
- onClick: () => setFilter(opt)
88
+ onClick: () => I(a)
103
89
  },
104
- id
90
+ e
105
91
  )),
106
- (errors == null ? void 0 : errors.length) > 0 && /* @__PURE__ */ jsx(
107
- Tooltip,
92
+ (m == null ? void 0 : m.length) > 0 && /* @__PURE__ */ i(
93
+ x,
108
94
  {
109
- title: /* @__PURE__ */ jsx("div", { onClick: (e) => e.stopPropagation(), children: errors.map((err, err_id) => /* @__PURE__ */ jsxs("div", { children: [
110
- /* @__PURE__ */ jsx("span", { style: { textTransform: "capitalize" }, children: err.source.replace(/-/g, " ") }),
95
+ title: /* @__PURE__ */ i("div", { onClick: (a) => a.stopPropagation(), children: m.map((a, e) => /* @__PURE__ */ n("div", { children: [
96
+ /* @__PURE__ */ i("span", { style: { textTransform: "capitalize" }, children: a.source.replace(/-/g, " ") }),
111
97
  ":",
112
98
  " ",
113
- err.message
114
- ] }, err_id)) }),
115
- children: /* @__PURE__ */ jsx(
116
- Chip,
99
+ a.message
100
+ ] }, e)) }),
101
+ children: /* @__PURE__ */ i(
102
+ S,
117
103
  {
118
104
  size: "small",
119
105
  variant: "outlined",
120
- icon: /* @__PURE__ */ jsx(Icon, { icon: "material-symbols:timer-outline", color: theme.palette.error.main }),
121
- label: /* @__PURE__ */ jsxs(Typography, { variant: "caption", textTransform: "capitalize", children: [
122
- t("annotation.failed"),
106
+ icon: /* @__PURE__ */ i(E, { icon: "material-symbols:timer-outline", color: v.palette.error.main }),
107
+ label: /* @__PURE__ */ n(s, { variant: "caption", textTransform: "capitalize", children: [
108
+ c("annotation.failed"),
123
109
  ": ",
124
- errors.length
110
+ m.length
125
111
  ] }),
126
- onClick: forceEnrich
112
+ onClick: h
127
113
  }
128
114
  )
129
115
  }
130
116
  )
131
117
  ] })
132
118
  ] }),
133
- /* @__PURE__ */ jsx(Box, {}),
134
- Object.keys(annotationsByType).filter((type) => !filter || filter === "all" || type === filter).map((type, id) => /* @__PURE__ */ jsxs(
135
- Accordion,
119
+ /* @__PURE__ */ i(z, {}),
120
+ Object.keys(b).filter((a) => !r || r === "all" || a === r).map((a, e) => /* @__PURE__ */ n(
121
+ $,
136
122
  {
137
- defaultExpanded: true,
123
+ defaultExpanded: !0,
138
124
  sx: {
139
- marginTop: `${theme.spacing(1)} !important`,
125
+ marginTop: `${v.spacing(1)} !important`,
140
126
  marginBottom: "0 !important",
141
127
  "&:before": { height: 0 }
142
128
  },
143
129
  children: [
144
- filter === "all" && /* @__PURE__ */ jsx(
145
- AccordionSummary,
130
+ r === "all" && /* @__PURE__ */ i(
131
+ j,
146
132
  {
147
- expandIcon: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-arrow-drop-down" }),
133
+ expandIcon: /* @__PURE__ */ i(g, { icon: "ic:baseline-arrow-drop-down" }),
148
134
  sx: {
149
135
  minHeight: "initial !important",
150
136
  mt: 0.5,
@@ -153,20 +139,19 @@ const AnnotationDetails = ({ enrichRequest, setReady, updatePosition }) => {
153
139
  "& .MuiAccordionSummary-content": { my: 0.5, mx: 0 },
154
140
  "& .MuiAccordionSummary-content.Mui-expanded": { my: 0.5, mx: 0 }
155
141
  },
156
- children: /* @__PURE__ */ jsx(Typography, { variant: "body1", textTransform: "capitalize", children: type }, type)
142
+ children: /* @__PURE__ */ i(s, { variant: "body1", textTransform: "capitalize", children: a }, a)
157
143
  }
158
144
  ),
159
- /* @__PURE__ */ jsxs(AccordionDetails, { sx: { px: 1 }, children: [
160
- filter === "all" && /* @__PURE__ */ jsx(Divider, { orientation: "horizontal", sx: { mb: 1 } }),
161
- /* @__PURE__ */ jsx(Stack, { spacing: 1, divider: /* @__PURE__ */ jsx(Divider, { orientation: "horizontal", flexItem: true }), children: annotationsByType[type].map((annotation, ann_id) => /* @__PURE__ */ jsx(AnnotationEntry, { annotation }, ann_id)) })
145
+ /* @__PURE__ */ n(_, { sx: { px: 1 }, children: [
146
+ r === "all" && /* @__PURE__ */ i(u, { orientation: "horizontal", sx: { mb: 1 } }),
147
+ /* @__PURE__ */ i(l, { spacing: 1, divider: /* @__PURE__ */ i(u, { orientation: "horizontal", flexItem: !0 }), children: b[a].map((f, D) => /* @__PURE__ */ i(X, { annotation: f }, D)) })
162
148
  ] })
163
149
  ]
164
150
  },
165
- id
151
+ e
166
152
  ))
167
153
  ] });
168
- };
169
- const AnnotationDetails$1 = memo(AnnotationDetails);
154
+ }, Ei = V(ii);
170
155
  export {
171
- AnnotationDetails$1 as default
156
+ Ei as default
172
157
  };
@@ -1,59 +1,56 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { I as Icon } from "../iconify-CXMreGTg.js";
3
- import { Stack, Typography, Chip, IconButton } from "@mui/material";
4
- import Iconified from "./display/icons/Iconified.js";
5
- import { t as twitterShort } from "../utils-CxIhC2xH.js";
6
- import { memo } from "react";
7
- import AnnotationBody from "./AnnotationBody.js";
8
- import ClassificationChip from "./ClassificationChip.js";
9
- const AnnotatonEntry = ({ annotation }) => {
10
- return /* @__PURE__ */ jsxs(Stack, { direction: "column", spacing: 1, children: [
11
- /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
12
- annotation.analytic_icon && /* @__PURE__ */ jsx(
13
- Icon,
14
- {
15
- style: { alignSelf: "center", filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" },
16
- icon: annotation.analytic_icon
17
- }
18
- ),
19
- /* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { textTransform: "capitalize", maxWidth: "275px" }, children: annotation.analytic ?? annotation.author }),
20
- annotation.quantity > 1 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", children: [
21
- "(x",
22
- annotation.quantity,
23
- ")"
24
- ] }),
25
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
26
- annotation.version && /* @__PURE__ */ jsx(Chip, { size: "small", label: /* @__PURE__ */ jsxs(Fragment, { children: [
27
- "v",
28
- annotation.version.replace(/^v/, "")
29
- ] }) }),
30
- annotation.link && /* @__PURE__ */ jsx(
31
- IconButton,
32
- {
33
- component: "a",
34
- href: annotation.link,
35
- onClick: () => window.open(annotation.link, "_blank", "noreferrer"),
36
- target: "_blank",
37
- rel: "noreferrer",
38
- size: "small",
39
- children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" })
40
- }
41
- ),
42
- annotation.classification && /* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: annotation.classification })
1
+ import { jsxs as i, jsx as e, Fragment as t } from "react/jsx-runtime";
2
+ import { I as o } from "../iconify-BBckr5AQ.js";
3
+ import { Stack as l, Typography as c, Chip as s, IconButton as n } from "@mui/material";
4
+ import a from "./display/icons/Iconified.js";
5
+ import { t as m } from "../utils-C_RX5uMP.js";
6
+ import { memo as p } from "react";
7
+ import d from "./AnnotationBody.js";
8
+ import f from "./ClassificationChip.js";
9
+ const y = ({ annotation: r }) => /* @__PURE__ */ i(l, { direction: "column", spacing: 1, children: [
10
+ /* @__PURE__ */ i(l, { direction: "row", spacing: 1, alignItems: "center", children: [
11
+ r.analytic_icon && /* @__PURE__ */ e(
12
+ o,
13
+ {
14
+ style: { alignSelf: "center", filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" },
15
+ icon: r.analytic_icon
16
+ }
17
+ ),
18
+ /* @__PURE__ */ e(c, { variant: "body1", sx: { textTransform: "capitalize", maxWidth: "275px" }, children: r.analytic ?? r.author }),
19
+ r.quantity > 1 && /* @__PURE__ */ i(c, { variant: "caption", color: "text.secondary", children: [
20
+ "(x",
21
+ r.quantity,
22
+ ")"
43
23
  ] }),
44
- /* @__PURE__ */ jsx(AnnotationBody, { annotation }),
45
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: annotation.summary }),
46
- /* @__PURE__ */ jsxs(Stack, { direction: "row", children: [
47
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", fontSize: "10px", children: twitterShort(annotation.timestamp) }),
48
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
49
- !!annotation.latency && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", fontSize: "10px", children: [
50
- Math.round(annotation.latency),
51
- "ms"
52
- ] })
24
+ /* @__PURE__ */ e("div", { style: { flex: 1 } }),
25
+ r.version && /* @__PURE__ */ e(s, { size: "small", label: /* @__PURE__ */ i(t, { children: [
26
+ "v",
27
+ r.version.replace(/^v/, "")
28
+ ] }) }),
29
+ r.link && /* @__PURE__ */ e(
30
+ n,
31
+ {
32
+ component: "a",
33
+ href: r.link,
34
+ onClick: () => window.open(r.link, "_blank", "noreferrer"),
35
+ target: "_blank",
36
+ rel: "noreferrer",
37
+ size: "small",
38
+ children: /* @__PURE__ */ e(a, { icon: "ic:baseline-open-in-new", fontSize: "small" })
39
+ }
40
+ ),
41
+ r.classification && /* @__PURE__ */ e(f, { size: "small", classification: r.classification })
42
+ ] }),
43
+ /* @__PURE__ */ e(d, { annotation: r }),
44
+ /* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", children: r.summary }),
45
+ /* @__PURE__ */ i(l, { direction: "row", children: [
46
+ /* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: m(r.timestamp) }),
47
+ /* @__PURE__ */ e("div", { style: { flex: 1 } }),
48
+ !!r.latency && /* @__PURE__ */ i(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: [
49
+ Math.round(r.latency),
50
+ "ms"
53
51
  ] })
54
- ] });
55
- };
56
- const AnnotationEntry = memo(AnnotatonEntry);
52
+ ] })
53
+ ] }), b = p(y);
57
54
  export {
58
- AnnotationEntry as default
55
+ b as default
59
56
  };
@@ -1,11 +1,11 @@
1
1
  import "react/jsx-runtime";
2
- import "../iconify-CXMreGTg.js";
2
+ import "../iconify-BBckr5AQ.js";
3
3
  import "@mui/material";
4
- import { A } from "../AnnotationPreview-BvNpZOP0.js";
4
+ import { A as d } from "../AnnotationPreview-DWRDhxUB.js";
5
5
  import "../hooks/useAnnotations.js";
6
- import "../utils-CxIhC2xH.js";
6
+ import "../utils-C_RX5uMP.js";
7
7
  import "react";
8
- import "../index-BDVjGvMI.js";
8
+ import "../index-E7g8cRyW.js";
9
9
  export {
10
- A as default
10
+ d as default
11
11
  };
@@ -1,52 +1,31 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Tooltip, Chip } from "@mui/material";
3
- import useClueConfig from "../hooks/useClueConfig.js";
4
- import { getParts, normalizedClassification } from "../utils/classificationParser.js";
5
- import React__default, { useMemo, memo } from "react";
6
- const THEME_TYPES = ["default", "primary", "secondary", "error", "info", "success", "warning"];
7
- const ClassificationChip = React__default.memo(
8
- ({ classification, ...otherProps }) => {
9
- var _a, _b;
10
- const { config } = useClueConfig();
11
- const parts = useMemo(() => {
12
- if (!config.c12nDef) {
13
- return null;
14
- }
15
- return getParts(classification, config.c12nDef, "short", true);
16
- }, [classification, config.c12nDef]);
17
- const normalized = useMemo(() => {
18
- if (!config.c12nDef || !parts) {
19
- return classification;
20
- }
21
- return normalizedClassification(parts, config.c12nDef, "short", true);
22
- }, [classification, config.c12nDef, parts]);
23
- const chipProps = useMemo(() => {
24
- var _a2, _b2, _c;
25
- const definedColor = (_c = (_b2 = config.c12nDef) == null ? void 0 : _b2.levels_styles_map[(_a2 = config.c12nDef) == null ? void 0 : _a2.levels_map[parts.lvlIdx]]) == null ? void 0 : _c.color;
26
- if (THEME_TYPES.includes(definedColor)) {
27
- return { color: definedColor };
28
- }
29
- if (definedColor) {
30
- return { sx: { color: definedColor } };
31
- }
32
- return { color: "default" };
33
- }, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts.lvlIdx]);
34
- return /* @__PURE__ */ jsx(Tooltip, { title: classification, children: /* @__PURE__ */ jsx(
35
- Chip,
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { Tooltip as p, Chip as x } from "@mui/material";
3
+ import D from "../hooks/useClueConfig.js";
4
+ import { getParts as C, normalizedClassification as _ } from "../utils/classificationParser.js";
5
+ import v, { useMemo as s, memo as y } from "react";
6
+ const g = ["default", "primary", "secondary", "error", "info", "success", "warning"], A = v.memo(
7
+ ({ classification: r, ...n }) => {
8
+ var i, f;
9
+ const { config: e } = D(), t = s(() => e.c12nDef ? C(r, e.c12nDef, "short", !0) : null, [r, e.c12nDef]), d = s(() => !e.c12nDef || !t ? r : _(t, e.c12nDef, "short", !0), [r, e.c12nDef, t]), o = s(() => {
10
+ var c, a, m;
11
+ const l = (m = (a = e.c12nDef) == null ? void 0 : a.levels_styles_map[(c = e.c12nDef) == null ? void 0 : c.levels_map[t.lvlIdx]]) == null ? void 0 : m.color;
12
+ return g.includes(l) ? { color: l } : l ? { sx: { color: l } } : { color: "default" };
13
+ }, [(i = e.c12nDef) == null ? void 0 : i.levels_map, (f = e.c12nDef) == null ? void 0 : f.levels_styles_map, t.lvlIdx]);
14
+ return /* @__PURE__ */ u(p, { title: r, children: /* @__PURE__ */ u(
15
+ x,
36
16
  {
37
- variant: otherProps.variant || "outlined",
38
- label: normalized,
39
- ...chipProps,
40
- ...otherProps,
17
+ variant: n.variant || "outlined",
18
+ label: d,
19
+ ...o,
20
+ ...n,
41
21
  sx: [
42
- ...Array.isArray(chipProps.sx) ? chipProps.sx : [chipProps.sx],
43
- ...Array.isArray(otherProps.sx) ? otherProps.sx : [otherProps.sx]
22
+ ...Array.isArray(o.sx) ? o.sx : [o.sx],
23
+ ...Array.isArray(n.sx) ? n.sx : [n.sx]
44
24
  ]
45
25
  }
46
26
  ) });
47
27
  }
48
- );
49
- const ClassificationChip$1 = memo(ClassificationChip);
28
+ ), M = y(A);
50
29
  export {
51
- ClassificationChip$1 as default
30
+ M as default
52
31
  };
@@ -1,34 +1,29 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Badge } from "@mui/material";
3
- import { forwardRef, cloneElement, Children } from "react";
4
- const CountBadge = forwardRef(({ children, color = "primary", count, disabled, ...props }, ref) => {
5
- if (disabled) {
6
- return cloneElement(Children.only(children), { ref, ...props });
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Badge as l } from "@mui/material";
3
+ import { forwardRef as d, cloneElement as f, Children as g } from "react";
4
+ const b = d(({ children: r, color: a = "primary", count: t, disabled: n, ...e }, o) => n ? f(g.only(r), { ref: o, ...e }) : /* @__PURE__ */ m(
5
+ l,
6
+ {
7
+ ref: o,
8
+ ...e,
9
+ badgeContent: t < 100 ? t : "99+",
10
+ color: a,
11
+ sx: (i) => ({
12
+ "& .MuiBadge-badge": {
13
+ backgroundColor: "transparent",
14
+ color: i.palette[a].main,
15
+ fontWeight: "bold",
16
+ right: 0,
17
+ top: 0,
18
+ transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(t)), 3) * 10}%)`,
19
+ px: 0,
20
+ fontSize: ".85rem"
21
+ },
22
+ pr: 1.5
23
+ }),
24
+ children: r
7
25
  }
8
- return /* @__PURE__ */ jsx(
9
- Badge,
10
- {
11
- ref,
12
- ...props,
13
- badgeContent: count < 100 ? count : "99+",
14
- color,
15
- sx: (theme) => ({
16
- "& .MuiBadge-badge": {
17
- backgroundColor: "transparent",
18
- color: theme.palette[color].main,
19
- fontWeight: "bold",
20
- right: 0,
21
- top: 0,
22
- transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(count)), 3) * 10}%)`,
23
- px: 0,
24
- fontSize: ".85rem"
25
- },
26
- pr: 1.5
27
- }),
28
- children
29
- }
30
- );
31
- });
26
+ ));
32
27
  export {
33
- CountBadge as default
28
+ b as default
34
29
  };