@cccsaurora/clue-ui 1.1.0-dev.91 → 1.1.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.
- package/ActionForm-myEAs2UC.js +435 -0
- package/AnnotationDetails-BdfWMISw.js +160 -0
- package/AnnotationPreview-CKMGCoUH.js +140 -0
- package/ClueEnrichContext-CrFpdYhh.js +414 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_Map-DXNg_Z-q.js +54 -0
- package/_MapCache-Cu25RRDU.js +129 -0
- package/_Uint8Array-DlJCtTvG.js +102 -0
- package/_baseAssignValue-CUmzp727.js +20 -0
- package/_baseClone-BlMmRXeX.js +208 -0
- package/_baseExtremum-P_0akmCi.js +27 -0
- package/_baseFlatten-CN7vDNEQ.js +72 -0
- package/_baseGet-Dgf6_xCm.js +80 -0
- package/_baseIsEqual-Cpjtfb3Q.js +173 -0
- package/_baseIteratee-CP1bocOX.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-tMFmk80M.js +61 -0
- package/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/_createAggregator-B4Cav8ZM.js +53 -0
- package/_getPrototype-CHAFQYL_.js +5 -0
- package/_getTag-BV_UoLYG.js +90 -0
- package/cloneDeep-BPVpFBzJ.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +6 -6
- package/components/AnnotationEntry.js +47 -50
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.d.ts +2 -1
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +50 -64
- package/components/actions/ResultModal.js +5 -5
- package/components/actions/form/schemaAdapter.js +23 -38
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +94 -92
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +305 -407
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5761 -8662
- package/components/enrichment/EnrichPopover.js +47 -55
- package/components/fetchers/Fetcher.js +95 -123
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +66 -77
- package/components/stats/QueryStatus.js +31 -41
- package/countBy-DOutsa_w.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-Bow1vKwx.js +8 -0
- package/groupBy-BheQYl6f.js +8 -0
- package/hooks/ClueActionContext.js +7 -7
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +46 -74
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +10 -21
- package/hooks/useActionResult.js +2 -2
- package/hooks/useAnnotations.js +29 -45
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BXxfAxFt.js +12734 -0
- package/index-C15OYgRY.js +358 -0
- package/index-E7g8cRyW.js +568 -0
- package/index-p5_wX7q1.js +11729 -0
- package/index-vF6IyBhz.js +975 -0
- package/isEmpty-g47Qir2A.js +21 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +62 -62
- package/package.json +2 -2
- package/sortBy-ITdmD17L.js +79 -0
- package/sumBy-DxJUU2E8.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-DyeBcXQX.js +2214 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +27 -41
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-BnmI_6N8.js +130 -0
- package/ActionForm-ByeOzpc4.js +0 -555
- package/AnnotationDetails-DknbKDyl.js +0 -175
- package/AnnotationPreview-CQwKs8se.js +0 -188
- package/ClueEnrichContext-6NJfXpUB.js +0 -536
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/countBy-C69WslUA.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BbPn6-Mw.js +0 -15750
- package/index-Bi21Wb23.js +0 -465
- package/index-C3lkTD69.js +0 -1172
- package/index-CC12Ux-9.js +0 -17654
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/last-CUCl67Im.js +0 -7
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-XvGvIw2S.js +0 -3201
- package/utils-7OtvGnmf.js +0 -200
|
@@ -1,168 +1,155 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme, Card, CardHeader, Stack, CircularProgress
|
|
4
|
-
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
-
import { useClueEnrichSelector } from "../hooks/selectors.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { ICON_MAP } from "../icons/iconMap.js";
|
|
12
|
-
import
|
|
13
|
-
import { u as
|
|
14
|
-
import { memo, useState, useMemo, useCallback } from "react";
|
|
15
|
-
import { u as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
20
|
-
type,
|
|
21
|
-
value,
|
|
22
|
-
classification:
|
|
23
|
-
contextIcon =
|
|
24
|
-
counters =
|
|
25
|
-
hideLoading =
|
|
26
|
-
...
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { I as C } from "../iconify-BBckr5AQ.js";
|
|
3
|
+
import { useTheme as F, Card as M, CardHeader as O, Stack as W, CircularProgress as $, Divider as B, CardContent as D, Grid as c, Chip as g, Typography as b, Tooltip as G, Box as H } from "@mui/material";
|
|
4
|
+
import { ClueComponentContext as N } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { useClueEnrichSelector as v } from "../hooks/selectors.js";
|
|
6
|
+
import R from "../hooks/useAnnotations.js";
|
|
7
|
+
import J from "../hooks/useErrors.js";
|
|
8
|
+
import K from "../icons/Assessment.js";
|
|
9
|
+
import L from "../icons/Context.js";
|
|
10
|
+
import Q from "../icons/Opinion.js";
|
|
11
|
+
import { ICON_MAP as y } from "../icons/iconMap.js";
|
|
12
|
+
import U from "../text/Frequency.js";
|
|
13
|
+
import { u as V } from "../ClueEnrichContext-CrFpdYhh.js";
|
|
14
|
+
import { memo as X, useState as Y, useMemo as T, useCallback as Z } from "react";
|
|
15
|
+
import { u as _ } from "../index-E7g8cRyW.js";
|
|
16
|
+
import P from "./AnnotationEntry.js";
|
|
17
|
+
import ii from "./actions/ExecutePopover.js";
|
|
18
|
+
import ei from "./enrichment/EnrichPopover.js";
|
|
19
|
+
const ti = ({
|
|
20
|
+
type: s,
|
|
21
|
+
value: o,
|
|
22
|
+
classification: p,
|
|
23
|
+
contextIcon: z = !1,
|
|
24
|
+
counters: d = !1,
|
|
25
|
+
hideLoading: E = !1,
|
|
26
|
+
...t
|
|
27
27
|
}) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const errors = useErrors(value);
|
|
39
|
-
const enrichRequest = { type, value, classification };
|
|
40
|
-
const options = useMemo(() => ["all", ...uniq(annotations.map((annotation) => annotation.type))], [annotations]);
|
|
41
|
-
const forceEnrich = useCallback(() => {
|
|
42
|
-
return enrich(type, value, {
|
|
43
|
-
classification,
|
|
44
|
-
timeout: 15,
|
|
45
|
-
force: true
|
|
46
|
-
});
|
|
47
|
-
}, [classification, enrich, type, value]);
|
|
48
|
-
return /* @__PURE__ */ jsxs(
|
|
49
|
-
Card,
|
|
28
|
+
const u = F(), { t: I } = _(N, (i) => i.i18next), x = v((i) => i.defaultClassification), h = v((i) => i.enrich), [S, A] = Y("all"), m = T(
|
|
29
|
+
() => p ?? x,
|
|
30
|
+
[p, x]
|
|
31
|
+
), [n, k] = R(s, o, m), a = J(o), l = { type: s, value: o, classification: m }, q = T(() => ["all", ...V(n.map((i) => i.type))], [n]), w = Z(() => h(s, o, {
|
|
32
|
+
classification: m,
|
|
33
|
+
timeout: 15,
|
|
34
|
+
force: !0
|
|
35
|
+
}), [m, h, s, o]);
|
|
36
|
+
return /* @__PURE__ */ r(
|
|
37
|
+
M,
|
|
50
38
|
{
|
|
51
39
|
sx: [
|
|
52
40
|
{
|
|
53
41
|
maxWidth: "900px"
|
|
54
42
|
},
|
|
55
|
-
...Array.isArray(
|
|
43
|
+
...Array.isArray(t == null ? void 0 : t.sx) ? t == null ? void 0 : t.sx : [t == null ? void 0 : t.sx]
|
|
56
44
|
],
|
|
57
|
-
...
|
|
45
|
+
...t,
|
|
58
46
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
O,
|
|
61
49
|
{
|
|
62
|
-
title: /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
50
|
+
title: /* @__PURE__ */ r(W, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
51
|
+
/* @__PURE__ */ e(U, { annotations: n, value: o, variant: "h6" }),
|
|
52
|
+
/* @__PURE__ */ e(
|
|
53
|
+
K,
|
|
66
54
|
{
|
|
67
|
-
value:
|
|
68
|
-
annotations,
|
|
69
|
-
counters,
|
|
55
|
+
value: l,
|
|
56
|
+
annotations: n,
|
|
57
|
+
counters: d,
|
|
70
58
|
fontSize: "1em",
|
|
71
|
-
disableTooltip:
|
|
59
|
+
disableTooltip: !0
|
|
72
60
|
}
|
|
73
61
|
),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
62
|
+
/* @__PURE__ */ e(
|
|
63
|
+
Q,
|
|
76
64
|
{
|
|
77
|
-
value:
|
|
78
|
-
annotations,
|
|
79
|
-
counters,
|
|
65
|
+
value: l,
|
|
66
|
+
annotations: n,
|
|
67
|
+
counters: d,
|
|
80
68
|
fontSize: "1em",
|
|
81
|
-
disableTooltip:
|
|
69
|
+
disableTooltip: !0
|
|
82
70
|
}
|
|
83
71
|
),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
72
|
+
/* @__PURE__ */ e(
|
|
73
|
+
L,
|
|
86
74
|
{
|
|
87
|
-
value:
|
|
88
|
-
annotations,
|
|
89
|
-
counters,
|
|
90
|
-
showExtraIcon:
|
|
75
|
+
value: l,
|
|
76
|
+
annotations: n,
|
|
77
|
+
counters: d,
|
|
78
|
+
showExtraIcon: z,
|
|
91
79
|
fontSize: "inherit",
|
|
92
|
-
disableTooltip:
|
|
80
|
+
disableTooltip: !0
|
|
93
81
|
}
|
|
94
82
|
),
|
|
95
|
-
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
83
|
+
k && !E && /* @__PURE__ */ e($, { color: "primary", size: 18 }),
|
|
84
|
+
/* @__PURE__ */ e("div", { style: { flex: 1 } }),
|
|
85
|
+
/* @__PURE__ */ e(ei, { selector: l }),
|
|
86
|
+
/* @__PURE__ */ e(ii, { selectors: [l] })
|
|
99
87
|
] })
|
|
100
88
|
}
|
|
101
89
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
90
|
+
/* @__PURE__ */ e(B, { sx: { mx: 1 } }),
|
|
91
|
+
/* @__PURE__ */ r(D, { sx: { p: 1 }, children: [
|
|
92
|
+
/* @__PURE__ */ r(c, { container: !0, spacing: 0.5, sx: { mb: 1 }, children: [
|
|
93
|
+
q.map((i, f) => (
|
|
106
94
|
// eslint-disable-next-line react/no-array-index-key
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
95
|
+
/* @__PURE__ */ e(c, { item: !0, children: /* @__PURE__ */ e(
|
|
96
|
+
g,
|
|
109
97
|
{
|
|
110
98
|
size: "small",
|
|
111
|
-
variant:
|
|
112
|
-
icon:
|
|
113
|
-
label: /* @__PURE__ */
|
|
114
|
-
|
|
99
|
+
variant: i === S ? "filled" : "outlined",
|
|
100
|
+
icon: y[i] && /* @__PURE__ */ e(C, { icon: y[i] }),
|
|
101
|
+
label: /* @__PURE__ */ r(b, { variant: "caption", textTransform: "capitalize", children: [
|
|
102
|
+
i,
|
|
115
103
|
":",
|
|
116
104
|
" ",
|
|
117
|
-
|
|
105
|
+
i === "all" ? n.length : n.filter((j) => j.type === i).length
|
|
118
106
|
] }),
|
|
119
|
-
onClick: () =>
|
|
107
|
+
onClick: () => A(i)
|
|
120
108
|
}
|
|
121
|
-
) },
|
|
109
|
+
) }, f)
|
|
122
110
|
)),
|
|
123
|
-
(
|
|
124
|
-
|
|
111
|
+
(a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ e(c, { item: !0, children: /* @__PURE__ */ e(
|
|
112
|
+
G,
|
|
125
113
|
{
|
|
126
|
-
title: /* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
114
|
+
title: /* @__PURE__ */ e("div", { onClick: (i) => i.stopPropagation(), children: a.map((i) => /* @__PURE__ */ r("div", { children: [
|
|
115
|
+
/* @__PURE__ */ e("span", { style: { textTransform: "capitalize" }, children: i.source.replace(/-/g, " ") }),
|
|
128
116
|
":",
|
|
129
117
|
" ",
|
|
130
|
-
|
|
131
|
-
] },
|
|
132
|
-
children: /* @__PURE__ */
|
|
133
|
-
|
|
118
|
+
i.message
|
|
119
|
+
] }, i.source)) }),
|
|
120
|
+
children: /* @__PURE__ */ e(
|
|
121
|
+
g,
|
|
134
122
|
{
|
|
135
123
|
size: "small",
|
|
136
124
|
variant: "outlined",
|
|
137
|
-
icon: /* @__PURE__ */
|
|
138
|
-
|
|
125
|
+
icon: /* @__PURE__ */ e(
|
|
126
|
+
C,
|
|
139
127
|
{
|
|
140
128
|
icon: "material-symbols:timer-outline",
|
|
141
|
-
color:
|
|
129
|
+
color: u.palette.error.main,
|
|
142
130
|
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
|
|
143
131
|
}
|
|
144
132
|
),
|
|
145
|
-
label: /* @__PURE__ */
|
|
146
|
-
|
|
133
|
+
label: /* @__PURE__ */ r(b, { variant: "caption", textTransform: "capitalize", children: [
|
|
134
|
+
I("annotation.failed"),
|
|
147
135
|
": ",
|
|
148
|
-
|
|
136
|
+
a.length
|
|
149
137
|
] }),
|
|
150
|
-
onClick:
|
|
138
|
+
onClick: w
|
|
151
139
|
}
|
|
152
140
|
)
|
|
153
141
|
}
|
|
154
142
|
) })
|
|
155
143
|
] }),
|
|
156
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ e(c, { container: !0, spacing: 1, alignItems: "stretch", children: n.map((i, f) => (
|
|
157
145
|
// eslint-disable-next-line react/no-array-index-key
|
|
158
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ e(c, { item: !0, xs: 6, minWidth: "300px", children: /* @__PURE__ */ e(H, { sx: { border: `thin solid ${u.palette.divider}`, p: 1, height: "100%" }, children: /* @__PURE__ */ e(P, { annotation: i }) }) }, f)
|
|
159
147
|
)) })
|
|
160
148
|
] })
|
|
161
149
|
]
|
|
162
150
|
}
|
|
163
151
|
);
|
|
164
|
-
};
|
|
165
|
-
const EnrichedCard$1 = memo(EnrichedCard);
|
|
152
|
+
}, yi = X(ti);
|
|
166
153
|
export {
|
|
167
|
-
|
|
154
|
+
yi as default
|
|
168
155
|
};
|
|
@@ -1,170 +1,145 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Chip, Tooltip, Box
|
|
3
|
-
import
|
|
4
|
-
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
-
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
-
import { C as
|
|
7
|
-
import { useClueEnrichSelector } from "../hooks/selectors.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { u as
|
|
16
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { Chip as B, Tooltip as G, Box as $, Stack as H, CircularProgress as J } from "@mui/material";
|
|
3
|
+
import K from "./display/icons/Iconified.js";
|
|
4
|
+
import { ClueComponentContext as L } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { ClueGroupContext as N } from "../hooks/ClueGroupContext.js";
|
|
6
|
+
import { C as E } from "../AnnotationPreview-CKMGCoUH.js";
|
|
7
|
+
import { useClueEnrichSelector as Q } from "../hooks/selectors.js";
|
|
8
|
+
import U from "../hooks/useAnnotations.js";
|
|
9
|
+
import V from "../icons/Action.js";
|
|
10
|
+
import v from "../icons/Assessment.js";
|
|
11
|
+
import q from "../icons/Context.js";
|
|
12
|
+
import z from "../icons/Opinion.js";
|
|
13
|
+
import W from "../text/Frequency.js";
|
|
14
|
+
import X, { useRef as Y, useMemo as u, useCallback as Z, useEffect as _, memo as F } from "react";
|
|
15
|
+
import { u as m } from "../index-E7g8cRyW.js";
|
|
16
|
+
const D = X.memo(
|
|
17
17
|
({
|
|
18
|
-
type:
|
|
19
|
-
value,
|
|
20
|
-
classification:
|
|
21
|
-
contextIcon =
|
|
22
|
-
counters =
|
|
23
|
-
hideDetails =
|
|
24
|
-
hideLoading =
|
|
25
|
-
forceDetails =
|
|
26
|
-
setForceDetails = null,
|
|
27
|
-
useDetailsIcon =
|
|
28
|
-
skipEnrichment =
|
|
29
|
-
slotProps = {},
|
|
30
|
-
...
|
|
18
|
+
type: C,
|
|
19
|
+
value: i,
|
|
20
|
+
classification: x,
|
|
21
|
+
contextIcon: b = !1,
|
|
22
|
+
counters: p = !1,
|
|
23
|
+
hideDetails: h = !1,
|
|
24
|
+
hideLoading: A = !1,
|
|
25
|
+
forceDetails: r = !1,
|
|
26
|
+
setForceDetails: c = null,
|
|
27
|
+
useDetailsIcon: s = !1,
|
|
28
|
+
skipEnrichment: R = !1,
|
|
29
|
+
slotProps: a = {},
|
|
30
|
+
...l
|
|
31
31
|
}) => {
|
|
32
|
-
const { t } =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
|
|
36
|
-
const type = useMemo(() => _type ?? groupType, [_type, groupType]);
|
|
37
|
-
const classification = useMemo(
|
|
38
|
-
() => _classification ?? defaultClassification,
|
|
39
|
-
[_classification, defaultClassification]
|
|
32
|
+
const { t: j } = m(L, (o) => o.i18next), d = Y(), k = m(N, (o) => o == null ? void 0 : o.type), y = Q((o) => o.defaultClassification), n = u(() => C ?? k, [C, k]), t = u(
|
|
33
|
+
() => x ?? y,
|
|
34
|
+
[x, y]
|
|
40
35
|
);
|
|
41
|
-
if (!
|
|
36
|
+
if (!n)
|
|
42
37
|
throw new Error("Type was not provided as a prop, and component is not used in a group context.");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
if (slotProps == null ? void 0 : slotProps.popover) {
|
|
53
|
-
options.popoverProps = slotProps.popover;
|
|
54
|
-
}
|
|
55
|
-
return options;
|
|
56
|
-
}, [setForceDetails, slotProps.popover]);
|
|
57
|
-
const clicker = useMemo(
|
|
58
|
-
() => !hideDetails || useDetailsIcon ? (e) => {
|
|
59
|
-
var _a;
|
|
60
|
-
showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
|
|
61
|
-
(_a = otherProps.onClick) == null ? void 0 : _a.call(otherProps, e);
|
|
62
|
-
e.stopPropagation();
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
} : otherProps.onClick,
|
|
38
|
+
const [f, T] = U(n, i, t, { skipEnrichment: R }), S = m(E, (o) => o.showInfo), M = m(E, (o) => o.closeInfo), w = Z(() => {
|
|
39
|
+
const o = {};
|
|
40
|
+
return c && (o.onClose = () => c(!1)), a != null && a.popover && (o.popoverProps = a.popover), o;
|
|
41
|
+
}, [c, a.popover]), g = u(
|
|
42
|
+
() => !h || s ? (o) => {
|
|
43
|
+
var I;
|
|
44
|
+
S("details", d.current, { type: n, value: i, classification: t }, w()), (I = l.onClick) == null || I.call(l, o), o.stopPropagation(), o.preventDefault();
|
|
45
|
+
} : l.onClick,
|
|
65
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
-
[
|
|
47
|
+
[h, s, l, n, i, t]
|
|
67
48
|
);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}, [classification, forceDetails, type, value]);
|
|
79
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
-
Chip,
|
|
49
|
+
return _(() => {
|
|
50
|
+
r ? S("details", d.current, { type: n, value: i, classification: t }, w()) : M("details", {
|
|
51
|
+
type: n,
|
|
52
|
+
value: i,
|
|
53
|
+
classification: t
|
|
54
|
+
});
|
|
55
|
+
}, [t, r, n, i]), /* @__PURE__ */ e(
|
|
56
|
+
B,
|
|
81
57
|
{
|
|
82
|
-
...
|
|
83
|
-
ref:
|
|
84
|
-
variant:
|
|
58
|
+
...l,
|
|
59
|
+
ref: d,
|
|
60
|
+
variant: l.variant || "outlined",
|
|
85
61
|
sx: {
|
|
86
|
-
height:
|
|
62
|
+
height: l.size !== "small" ? "40px" : "unset",
|
|
87
63
|
"& .MuiChip-label": { overflow: "visible" },
|
|
88
|
-
...
|
|
64
|
+
...l.sx ?? {}
|
|
89
65
|
},
|
|
90
|
-
label: /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
66
|
+
label: /* @__PURE__ */ O(H, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
v,
|
|
93
69
|
{
|
|
94
|
-
ubiquitous:
|
|
95
|
-
value: { type, value, classification },
|
|
96
|
-
annotations,
|
|
97
|
-
counters,
|
|
98
|
-
disableTooltip:
|
|
70
|
+
ubiquitous: !0,
|
|
71
|
+
value: { type: n, value: i, classification: t },
|
|
72
|
+
annotations: f,
|
|
73
|
+
counters: p,
|
|
74
|
+
disableTooltip: r,
|
|
99
75
|
style: { flexShrink: 0 }
|
|
100
76
|
}
|
|
101
77
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
78
|
+
/* @__PURE__ */ e(
|
|
79
|
+
z,
|
|
104
80
|
{
|
|
105
|
-
ubiquitous:
|
|
106
|
-
value: { type, value, classification },
|
|
107
|
-
annotations,
|
|
108
|
-
counters,
|
|
109
|
-
disableTooltip:
|
|
81
|
+
ubiquitous: !0,
|
|
82
|
+
value: { type: n, value: i, classification: t },
|
|
83
|
+
annotations: f,
|
|
84
|
+
counters: p,
|
|
85
|
+
disableTooltip: r,
|
|
110
86
|
style: { flexShrink: 0 }
|
|
111
87
|
}
|
|
112
88
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
q,
|
|
115
91
|
{
|
|
116
|
-
ubiquitous:
|
|
117
|
-
value: { type, value, classification },
|
|
118
|
-
annotations,
|
|
119
|
-
counters,
|
|
120
|
-
showExtraIcon:
|
|
121
|
-
disableTooltip:
|
|
92
|
+
ubiquitous: !0,
|
|
93
|
+
value: { type: n, value: i, classification: t },
|
|
94
|
+
annotations: f,
|
|
95
|
+
counters: p,
|
|
96
|
+
showExtraIcon: b,
|
|
97
|
+
disableTooltip: r,
|
|
122
98
|
style: { flexShrink: 0 }
|
|
123
99
|
}
|
|
124
100
|
),
|
|
125
|
-
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
101
|
+
l.label ?? /* @__PURE__ */ e(W, { fontSize: "inherit", annotations: f, value: i }),
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
v,
|
|
128
104
|
{
|
|
129
|
-
value: { type, value, classification },
|
|
130
|
-
annotations,
|
|
131
|
-
counters,
|
|
132
|
-
disableTooltip:
|
|
105
|
+
value: { type: n, value: i, classification: t },
|
|
106
|
+
annotations: f,
|
|
107
|
+
counters: p,
|
|
108
|
+
disableTooltip: r,
|
|
133
109
|
style: { flexShrink: 0 }
|
|
134
110
|
}
|
|
135
111
|
),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
|
|
112
|
+
/* @__PURE__ */ e(
|
|
113
|
+
z,
|
|
138
114
|
{
|
|
139
|
-
value: { type, value, classification },
|
|
140
|
-
annotations,
|
|
141
|
-
counters,
|
|
142
|
-
disableTooltip:
|
|
115
|
+
value: { type: n, value: i, classification: t },
|
|
116
|
+
annotations: f,
|
|
117
|
+
counters: p,
|
|
118
|
+
disableTooltip: r,
|
|
143
119
|
style: { flexShrink: 0 }
|
|
144
120
|
}
|
|
145
121
|
),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
q,
|
|
148
124
|
{
|
|
149
|
-
value: { type, value, classification },
|
|
150
|
-
annotations,
|
|
151
|
-
counters,
|
|
152
|
-
showExtraIcon:
|
|
153
|
-
disableTooltip:
|
|
125
|
+
value: { type: n, value: i, classification: t },
|
|
126
|
+
annotations: f,
|
|
127
|
+
counters: p,
|
|
128
|
+
showExtraIcon: b,
|
|
129
|
+
disableTooltip: r,
|
|
154
130
|
style: { flexShrink: 0 }
|
|
155
131
|
}
|
|
156
132
|
),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
133
|
+
/* @__PURE__ */ e(V, { counters: p, value: { type: n, value: i, classification: t }, disableTooltip: r }),
|
|
134
|
+
T && !A && /* @__PURE__ */ e(J, { color: "primary", size: 16 })
|
|
159
135
|
] }),
|
|
160
|
-
onClick:
|
|
161
|
-
onDelete: !
|
|
162
|
-
deleteIcon:
|
|
136
|
+
onClick: s ? void 0 : g,
|
|
137
|
+
onDelete: !T && s ? g : void 0,
|
|
138
|
+
deleteIcon: s ? /* @__PURE__ */ e(G, { title: j("details.open"), children: /* @__PURE__ */ e($, { component: "span", sx: { pr: 1 }, children: /* @__PURE__ */ e(K, { icon: "ic:outline-info" }) }) }) : null
|
|
163
139
|
}
|
|
164
140
|
);
|
|
165
141
|
}
|
|
166
|
-
);
|
|
167
|
-
const EnrichedChip$1 = memo(EnrichedChip);
|
|
142
|
+
), Co = F(D);
|
|
168
143
|
export {
|
|
169
|
-
|
|
144
|
+
Co as default
|
|
170
145
|
};
|