@cccsaurora/clue-ui 1.3.0-dev.404 → 1.3.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-CHOSKfvu.js +4403 -0
- package/AnnotationDetails-Bqq6Ymmg.js +160 -0
- package/AnnotationPreview-CqXmC-j8.js +140 -0
- package/ClueEnrichContext-DL6aGe1k.js +432 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-DRK-s2eK.js +179 -0
- package/_Set-DrS_bbSV.js +6 -0
- package/_Uint8Array-D9R2N9Lp.js +98 -0
- package/_arrayIncludes-Dcl_29E6.js +25 -0
- package/_arrayPush-DBJIuK2V.js +8 -0
- package/_baseAssignValue-Bx1cxHj5.js +12 -0
- package/_baseClone-DRhywkxm.js +211 -0
- package/_baseExtremum-DodEaEyF.js +16 -0
- package/_baseFlatten-CD9NgrYE.js +72 -0
- package/_baseGet-bVwDaGrA.js +80 -0
- package/_baseGetTag-CxDaTem-.js +25 -0
- package/_baseIsEqual-C-FKsm1J.js +150 -0
- package/_baseIteratee-D0FhC5bC.js +95 -0
- package/_baseRest-D_eW2E0d.js +8 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-D3N8igOm.js +41 -0
- package/_cacheHas-Wgl-hw34.js +22 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-BVj8IAuF.js +53 -0
- package/_defineProperty-BZU4WKA3.js +11 -0
- package/_getPrototype-BGBCg-aX.js +5 -0
- package/_getTag-B7R9qBo7.js +73 -0
- package/_isIterateeCall-Dm0VTAYy.js +13 -0
- package/_setToArray-Ck4YZu0Z.js +9 -0
- package/cloneDeep-fV59zwUf.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- 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 +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +25 -29
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +70 -89
- 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 +306 -408
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5770 -8678
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +123 -166
- package/components/fetchers/FetcherResultView.js +27 -31
- package/components/fetchers/PreviewModal.js +16 -17
- 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 +65 -76
- package/components/stats/QueryStatus.js +32 -45
- package/countBy-B3rNuG4T.js +8 -0
- package/data/event.js +4 -6
- package/database/globals.js +2 -2
- package/database/index.js +3 -3
- package/database/replication.js +4 -4
- package/get-Bil3mzRD.js +8 -0
- package/groupBy-CrJC7sGa.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +23 -35
- package/hooks/ClueEnrichContext.js +11 -11
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +11 -13
- package/hooks/ClueUIPluginContext.js +35 -49
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +32 -48
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +24 -49
- package/hooks/useClueUIPlugins.js +7 -8
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-Ptb5dTKy.js +1270 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +69 -85
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +60 -76
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BH-gBhtO.js +2282 -0
- package/index-BM9Sve5T.js +571 -0
- package/index-Cj4d5cGz.js +357 -0
- package/index-Dh2PP9h8.js +11747 -0
- package/index-DoFpWPHo.js +975 -0
- package/index-DzVIklWY.js +6464 -0
- package/isArguments-BWcXOE6a.js +24 -0
- package/isArray-WzO_os3q.js +4 -0
- package/isEmpty-DKxrY-_M.js +22 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-CYbdrIBr.js +6 -0
- package/isSymbol-DE1Kcy2M.js +9 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +62 -62
- package/maxBy-BOWDkL_D.js +8 -0
- package/package.json +1 -1
- package/plugins/ClueUIPlugin.js +96 -163
- package/plugins/file/index.js +15 -15
- package/plugins/graph/index.js +26 -29
- package/plugins/image/index.js +24 -28
- package/plugins/json/index.js +21 -21
- package/plugins/markdown/index.js +18 -18
- package/plugins/registry.js +6 -6
- package/plugins/store.js +4 -4
- package/plugins/test/index.js +17 -17
- package/plugins/utils.js +12 -13
- package/replication-WkKbPdwG.js +8453 -0
- package/sessionStorage-DFMae61b.js +90 -0
- package/sortBy-BHe812lF.js +74 -0
- package/store-DClHBq7r.js +1169 -0
- package/sumBy-B7f_bP_k.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-CBrE65MP.js +14 -0
- package/toNumber-CxmWey0f.js +31 -0
- package/uniq-B4UZ671_.js +7 -0
- package/utils/chain.js +65 -92
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +11 -37
- 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 +7 -7
- package/utils/time.js +427 -447
- package/utils/utils.js +10 -10
- package/utils/window.js +10 -21
- package/utils-SpTOhPYl.js +147 -0
- package/ActionForm-CqKcnDWC.js +0 -6099
- package/AnnotationDetails-BlPd3T8k.js +0 -176
- package/AnnotationPreview-Bl447SKT.js +0 -188
- package/ClueEnrichContext-B3YrTCaJ.js +0 -567
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-kuEY_iOH.js +0 -220
- package/_Set-BrSMTlHn.js +0 -6
- package/_Uint8Array-OPpgYQj7.js +0 -123
- package/_arrayIncludes-BNqL-9ZP.js +0 -31
- package/_arrayPush-CBkQqaE_.js +0 -10
- package/_baseAssignValue-CNUVPOBW.js +0 -16
- package/_baseClone-9FaRd1R2.js +0 -287
- package/_baseExtremum-wOGT4Dgw.js +0 -18
- package/_baseFlatten-Co6QHDlG.js +0 -92
- package/_baseGet-Cmp6FztG.js +0 -109
- package/_baseGetTag-Hj-0NTYF.js +0 -44
- package/_baseIsEqual-1CpU47TZ.js +0 -211
- package/_baseIteratee-BN7Vbe5g.js +0 -126
- package/_baseRest-BZ_hQ9PC.js +0 -8
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-BnvS3JHL.js +0 -63
- package/_cacheHas-_aF2y2Xv.js +0 -25
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BUZrP_is.js +0 -63
- package/_defineProperty-DolZLKmv.js +0 -12
- package/_getPrototype-Bb4gm-5m.js +0 -5
- package/_getTag-CML_cXiN.js +0 -105
- package/_isIterateeCall-B1IFEqVv.js +0 -17
- package/_setToArray-CqyqC8ib.js +0 -10
- package/cloneDeep-l3UkXG5M.js +0 -8
- package/countBy-Bqcp3VCs.js +0 -14
- package/get-CdMThM8x.js +0 -8
- package/groupBy-BVV07EGQ.js +0 -14
- package/iconify-DJxl6dC-.js +0 -1789
- package/identity-CPGTqrE4.js +0 -6
- package/index-CAvu7vwt.js +0 -1172
- package/index-CVUD9o3t.js +0 -15768
- package/index-DUEubgWN.js +0 -464
- package/index-Dj1N4IQP.js +0 -9314
- package/index-DpJxD74E.js +0 -3272
- package/index-_gpzM2Px.js +0 -702
- package/isArguments-CuYlEuhP.js +0 -27
- package/isArray-RJPfgWqI.js +0 -4
- package/isEmpty-BE656RUK.js +0 -30
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-CeENW9FN.js +0 -6
- package/isSymbol-D_H4HPZQ.js +0 -9
- package/last-CUCl67Im.js +0 -7
- package/maxBy-BjjQmX5t.js +0 -8
- package/replication--gLEZw8a.js +0 -11777
- package/sessionStorage-B68y-wnE.js +0 -140
- package/sortBy-B8JVsLQY.js +0 -95
- package/store-B9sjQbcS.js +0 -2163
- package/sumBy-D-HCzM2i.js +0 -8
- package/toFinite-meZTg4Su.js +0 -16
- package/toNumber-B5JaA1vX.js +0 -39
- package/uniq-CahZPAwp.js +0 -7
- package/utils-CEySTPtg.js +0 -224
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { I as A } from "./iconify-Ptb5dTKy.js";
|
|
3
|
+
import { useTheme as $, Stack as l, Typography as s, Tooltip as x, Box as E, IconButton as u, CircularProgress as j, Chip as z, Accordion as _, AccordionSummary as O, AccordionDetails as F, Divider as S } from "@mui/material";
|
|
4
|
+
import g from "./components/display/icons/Iconified.js";
|
|
5
|
+
import { SNACKBAR_EVENT_ID as H } from "./data/event.js";
|
|
6
|
+
import { ClueComponentContext as K } from "./hooks/ClueComponentContext.js";
|
|
7
|
+
import { f as T } from "./ActionForm-CHOSKfvu.js";
|
|
8
|
+
import L from "./hooks/useAnnotations.js";
|
|
9
|
+
import U from "./hooks/useErrors.js";
|
|
10
|
+
import { ICON_MAP as k } from "./icons/iconMap.js";
|
|
11
|
+
import { safeDispatchEvent as V } from "./utils/window.js";
|
|
12
|
+
import { g as W } from "./groupBy-CrJC7sGa.js";
|
|
13
|
+
import { u as G } from "./uniq-B4UZ671_.js";
|
|
14
|
+
import { memo as J, useState as P, useMemo as w, useCallback as Q, useEffect as X } from "react";
|
|
15
|
+
import { a as Y } from "./index-BM9Sve5T.js";
|
|
16
|
+
import Z from "./components/actions/ExecutePopover.js";
|
|
17
|
+
import q from "./components/AnnotationEntry.js";
|
|
18
|
+
import R from "./components/ClassificationChip.js";
|
|
19
|
+
import ii from "./components/enrichment/EnrichPopover.js";
|
|
20
|
+
function I(i) {
|
|
21
|
+
return i === null;
|
|
22
|
+
}
|
|
23
|
+
const oi = ({ enrichRequest: i, setReady: d, updatePosition: p }) => {
|
|
24
|
+
const v = $(), { t: c } = Y(K, (n) => n.i18next), [r, B] = P("all"), y = T((n) => n.enrich), D = T((n) => n.ready), [t, C] = L(
|
|
25
|
+
i == null ? void 0 : i.type,
|
|
26
|
+
i == null ? void 0 : i.value,
|
|
27
|
+
i == null ? void 0 : i.classification,
|
|
28
|
+
{ skipEnrichment: !0 }
|
|
29
|
+
), m = U(i == null ? void 0 : i.value), M = w(
|
|
30
|
+
() => ["all", ...G((t ?? []).map((n) => n.type))],
|
|
31
|
+
[t]
|
|
32
|
+
), b = w(() => W(t ?? [], "type"), [t]), h = Q(async () => {
|
|
33
|
+
await y(i.type, i.value, {
|
|
34
|
+
classification: i.classification,
|
|
35
|
+
timeout: 15,
|
|
36
|
+
force: !0
|
|
37
|
+
});
|
|
38
|
+
}, [i, y]);
|
|
39
|
+
return X(() => {
|
|
40
|
+
d && (d(i && !I(t)), p == null || p());
|
|
41
|
+
}, [t, i, d, p]), i && !I(t) && /* @__PURE__ */ a(l, { direction: "column", sx: { p: 1, width: "100%" }, spacing: 1, children: [
|
|
42
|
+
/* @__PURE__ */ a(l, { spacing: 1, children: [
|
|
43
|
+
/* @__PURE__ */ a(l, { direction: "row", spacing: 1, children: [
|
|
44
|
+
/* @__PURE__ */ a(l, { children: [
|
|
45
|
+
/* @__PURE__ */ a(l, { direction: "row", spacing: 1, children: [
|
|
46
|
+
/* @__PURE__ */ o(s, { variant: "body1", fontWeight: "bold", children: "Clue" }),
|
|
47
|
+
i.classification && /* @__PURE__ */ o(R, { size: "small", classification: i.classification })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ a(s, { variant: "caption", color: "text.secondary", children: [
|
|
50
|
+
i.type.toLocaleUpperCase(),
|
|
51
|
+
" ",
|
|
52
|
+
c("enrichment")
|
|
53
|
+
] })
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ o("div", { style: { flex: 1 } }),
|
|
56
|
+
/* @__PURE__ */ o(x, { title: c("refresh"), children: /* @__PURE__ */ o(E, { sx: { alignSelf: "center", m: -1 }, children: /* @__PURE__ */ o(u, { onClick: () => h(), disabled: C || !D, children: C ? /* @__PURE__ */ o(j, { variant: "indeterminate", size: 20 }) : /* @__PURE__ */ o(g, { icon: "ic:baseline-replay", fontSize: "small" }) }) }) }),
|
|
57
|
+
/* @__PURE__ */ o(x, { title: c("clipboard"), children: /* @__PURE__ */ o(
|
|
58
|
+
u,
|
|
59
|
+
{
|
|
60
|
+
sx: { alignSelf: "center", m: -1 },
|
|
61
|
+
onClick: () => {
|
|
62
|
+
navigator.clipboard.writeText(i.value), V(
|
|
63
|
+
new CustomEvent(H, {
|
|
64
|
+
detail: {
|
|
65
|
+
message: `${i.value} ${c("clipboard.success")}`,
|
|
66
|
+
level: "success"
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
children: /* @__PURE__ */ o(g, { icon: "ic:outline-assignment", fontSize: "small" })
|
|
72
|
+
}
|
|
73
|
+
) }),
|
|
74
|
+
/* @__PURE__ */ o(ii, { selector: i }),
|
|
75
|
+
/* @__PURE__ */ o(Z, { selectors: [i] })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ a(l, { direction: "row", spacing: 0.5, children: [
|
|
78
|
+
M.map((n, e) => /* @__PURE__ */ o(
|
|
79
|
+
z,
|
|
80
|
+
{
|
|
81
|
+
size: "small",
|
|
82
|
+
variant: n === r ? "filled" : "outlined",
|
|
83
|
+
icon: k[n] && /* @__PURE__ */ o(A, { icon: k[n] }),
|
|
84
|
+
label: /* @__PURE__ */ a(s, { variant: "caption", textTransform: "capitalize", children: [
|
|
85
|
+
n,
|
|
86
|
+
":",
|
|
87
|
+
" ",
|
|
88
|
+
n === "all" ? t.length : t.filter((f) => f.type === n).length
|
|
89
|
+
] }),
|
|
90
|
+
onClick: () => B(n)
|
|
91
|
+
},
|
|
92
|
+
e
|
|
93
|
+
)),
|
|
94
|
+
(m == null ? void 0 : m.length) > 0 && /* @__PURE__ */ o(
|
|
95
|
+
x,
|
|
96
|
+
{
|
|
97
|
+
title: /* @__PURE__ */ o("div", { onClick: (n) => n.stopPropagation(), children: m.map((n, e) => /* @__PURE__ */ a("div", { children: [
|
|
98
|
+
/* @__PURE__ */ o("span", { style: { textTransform: "capitalize" }, children: n.source.replace(/-/g, " ") }),
|
|
99
|
+
":",
|
|
100
|
+
" ",
|
|
101
|
+
n.message
|
|
102
|
+
] }, e)) }),
|
|
103
|
+
children: /* @__PURE__ */ o(
|
|
104
|
+
z,
|
|
105
|
+
{
|
|
106
|
+
size: "small",
|
|
107
|
+
variant: "outlined",
|
|
108
|
+
icon: /* @__PURE__ */ o(A, { icon: "material-symbols:timer-outline", color: v.palette.error.main }),
|
|
109
|
+
label: /* @__PURE__ */ a(s, { variant: "caption", textTransform: "capitalize", children: [
|
|
110
|
+
c("annotation.failed"),
|
|
111
|
+
": ",
|
|
112
|
+
m.length
|
|
113
|
+
] }),
|
|
114
|
+
onClick: h
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ o(E, {}),
|
|
122
|
+
Object.keys(b).filter((n) => !r || r === "all" || n === r).map((n, e) => /* @__PURE__ */ a(
|
|
123
|
+
_,
|
|
124
|
+
{
|
|
125
|
+
defaultExpanded: !0,
|
|
126
|
+
sx: {
|
|
127
|
+
marginTop: `${v.spacing(1)} !important`,
|
|
128
|
+
marginBottom: "0 !important",
|
|
129
|
+
"&:before": { height: 0 }
|
|
130
|
+
},
|
|
131
|
+
children: [
|
|
132
|
+
r === "all" && /* @__PURE__ */ o(
|
|
133
|
+
O,
|
|
134
|
+
{
|
|
135
|
+
expandIcon: /* @__PURE__ */ o(g, { icon: "ic:baseline-arrow-drop-down" }),
|
|
136
|
+
sx: {
|
|
137
|
+
minHeight: "initial !important",
|
|
138
|
+
mt: 0.5,
|
|
139
|
+
mb: 0,
|
|
140
|
+
px: 1,
|
|
141
|
+
"& .MuiAccordionSummary-content": { my: 0.5, mx: 0 },
|
|
142
|
+
"& .MuiAccordionSummary-content.Mui-expanded": { my: 0.5, mx: 0 }
|
|
143
|
+
},
|
|
144
|
+
children: /* @__PURE__ */ o(s, { variant: "body1", textTransform: "capitalize", children: n }, n)
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ a(F, { sx: { px: 1 }, children: [
|
|
148
|
+
r === "all" && /* @__PURE__ */ o(S, { orientation: "horizontal", sx: { mb: 1 } }),
|
|
149
|
+
/* @__PURE__ */ o(l, { spacing: 1, divider: /* @__PURE__ */ o(S, { orientation: "horizontal", flexItem: !0 }), children: b[n].map((f, N) => /* @__PURE__ */ o(q, { annotation: f }, N)) })
|
|
150
|
+
] })
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
e
|
|
154
|
+
))
|
|
155
|
+
] });
|
|
156
|
+
}, Ai = J(oi);
|
|
157
|
+
export {
|
|
158
|
+
Ai as A,
|
|
159
|
+
I as i
|
|
160
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsxs as C, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { I as H } from "./iconify-Ptb5dTKy.js";
|
|
3
|
+
import { useTheme as k, Popper as V, Fade as j, Paper as O, Stack as w, Typography as y, Divider as W } from "@mui/material";
|
|
4
|
+
import F from "./components/AnnotationDetailPopover.js";
|
|
5
|
+
import L from "./hooks/useAnnotations.js";
|
|
6
|
+
import { t as M } from "./utils-SpTOhPYl.js";
|
|
7
|
+
import { useState as v, useRef as Y, useCallback as x, useEffect as Z, useMemo as _ } from "react";
|
|
8
|
+
import { c as B, a as G } from "./index-BM9Sve5T.js";
|
|
9
|
+
import { SHOW_EVENT_ID as g, HIDE_EVENT_ID as D } from "./data/event.js";
|
|
10
|
+
import { safeDispatchEvent as A, safeAddEventListener as S } from "./utils/window.js";
|
|
11
|
+
import { i as J } from "./AnnotationDetails-Bqq6Ymmg.js";
|
|
12
|
+
const b = B(null), rt = ({ children: c }) => {
|
|
13
|
+
const [l, e] = v(null), [p, i] = v(null), [r, d] = v(null), [u, m] = v(null), [f, t] = v({}), a = Y(null), P = x((s, o, z, N) => {
|
|
14
|
+
A(
|
|
15
|
+
new CustomEvent(g, {
|
|
16
|
+
detail: {
|
|
17
|
+
type: s,
|
|
18
|
+
anchorEl: o,
|
|
19
|
+
value: z,
|
|
20
|
+
options: N
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
}, []), h = x(
|
|
25
|
+
(s, o) => {
|
|
26
|
+
A(
|
|
27
|
+
new CustomEvent(D, {
|
|
28
|
+
detail: {
|
|
29
|
+
type: s,
|
|
30
|
+
value: o
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
[]
|
|
37
|
+
), E = x((s) => {
|
|
38
|
+
const { detail: o } = s;
|
|
39
|
+
e(o.type), d(o.value), o.options && (o.options.content && m(o.options.content), o.options.onClose && (a.current = o.options.onClose), o.options.popoverProps && t(o.options.popoverProps)), i(o.anchorEl);
|
|
40
|
+
}, []), I = x(
|
|
41
|
+
(s) => {
|
|
42
|
+
const { detail: o } = s;
|
|
43
|
+
r && (o.type !== l || r.type !== o.value.type || r.value !== o.value.value) || (e(null), i(null), d(null), m(null), t({}), a.current = null);
|
|
44
|
+
},
|
|
45
|
+
[r, l]
|
|
46
|
+
);
|
|
47
|
+
Z(() => {
|
|
48
|
+
const s = S(g, E), o = S(D, I);
|
|
49
|
+
return () => {
|
|
50
|
+
s(), o();
|
|
51
|
+
};
|
|
52
|
+
}, [E, I]);
|
|
53
|
+
const T = _(
|
|
54
|
+
() => ({
|
|
55
|
+
showInfo: P,
|
|
56
|
+
closeInfo: h,
|
|
57
|
+
__detailsContent: u
|
|
58
|
+
}),
|
|
59
|
+
[h, u, P]
|
|
60
|
+
);
|
|
61
|
+
return /* @__PURE__ */ C(b.Provider, { value: T, children: [
|
|
62
|
+
c,
|
|
63
|
+
/* @__PURE__ */ n(
|
|
64
|
+
F,
|
|
65
|
+
{
|
|
66
|
+
...f,
|
|
67
|
+
anchorEl: p,
|
|
68
|
+
open: !!p && l === "details",
|
|
69
|
+
enrichRequest: r,
|
|
70
|
+
onClose: () => {
|
|
71
|
+
a.current ? a.current() : h("details", r);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ n(
|
|
76
|
+
K,
|
|
77
|
+
{
|
|
78
|
+
...f,
|
|
79
|
+
anchorEl: p,
|
|
80
|
+
open: !!p && !J(l) && l !== "details",
|
|
81
|
+
annotationType: l,
|
|
82
|
+
enrichRequest: r
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
86
|
+
}, K = ({ annotationType: c, anchorEl: l, enrichRequest: e, open: p, ...i }) => {
|
|
87
|
+
const r = k(), d = G(b, (t) => t.__detailsContent), [u] = L(e == null ? void 0 : e.type, e == null ? void 0 : e.value, e == null ? void 0 : e.classification), m = _(
|
|
88
|
+
() => c === "actionResults" ? [] : u.filter((t) => t.type === c),
|
|
89
|
+
[c, u]
|
|
90
|
+
), f = x((t) => {
|
|
91
|
+
try {
|
|
92
|
+
const a = parseInt(window.getComputedStyle(t, null).getPropertyValue("z-index"));
|
|
93
|
+
return isNaN(a) ? f(t.parentElement) : (a + 2).toString();
|
|
94
|
+
} catch {
|
|
95
|
+
return "2";
|
|
96
|
+
}
|
|
97
|
+
}, []);
|
|
98
|
+
return !m.length && !d ? null : /* @__PURE__ */ n(
|
|
99
|
+
V,
|
|
100
|
+
{
|
|
101
|
+
...i,
|
|
102
|
+
open: p,
|
|
103
|
+
anchorEl: l,
|
|
104
|
+
placement: "bottom-start",
|
|
105
|
+
sx: [{ zIndex: f(l) }, ...Array.isArray(i.sx) ? i.sx : [i.sx]],
|
|
106
|
+
children: /* @__PURE__ */ n(j, { in: !!l, children: /* @__PURE__ */ n(O, { sx: { overflowY: "auto", maxWidth: "500px", boxShadow: r.shadows[2] }, children: /* @__PURE__ */ n(w, { direction: "column", sx: { p: 1 }, spacing: 1, divider: /* @__PURE__ */ n(W, { orientation: "horizontal" }), children: d ?? m.map((t) => /* @__PURE__ */ C(
|
|
107
|
+
w,
|
|
108
|
+
{
|
|
109
|
+
direction: "column",
|
|
110
|
+
spacing: 1,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ C(w, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
113
|
+
t.analytic_icon && /* @__PURE__ */ n(
|
|
114
|
+
H,
|
|
115
|
+
{
|
|
116
|
+
icon: t.analytic_icon,
|
|
117
|
+
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ n(y, { variant: "body1", sx: { textTransform: "capitalize" }, children: t.analytic ?? t.author }),
|
|
121
|
+
/* @__PURE__ */ C(y, { variant: "caption", color: "text.secondary", children: [
|
|
122
|
+
"(",
|
|
123
|
+
M(t.timestamp),
|
|
124
|
+
")"
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ n(y, { variant: "body2", children: t.summary }),
|
|
128
|
+
/* @__PURE__ */ n(y, { variant: "caption", color: "text.secondary", children: t.value })
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
t.analytic + t.author + t.value + t.link + t.summary + t.timestamp
|
|
132
|
+
)) }) }) })
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
K as A,
|
|
138
|
+
b as C,
|
|
139
|
+
rt as a
|
|
140
|
+
};
|