@cccsaurora/clue-ui 1.0.1-dev.70 → 1.0.2-patch.38

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 (184) hide show
  1. package/ActionForm-Sw7D-KOE.js +340 -0
  2. package/AnnotationDetails-BoX61_IF.js +160 -0
  3. package/AnnotationPreview-dYinoSA9.js +140 -0
  4. package/ClueEnrichContext-CvCIPOMC.js +412 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_Map-DXNg_Z-q.js +54 -0
  7. package/_MapCache-Cu25RRDU.js +129 -0
  8. package/_Uint8Array-DlJCtTvG.js +102 -0
  9. package/_baseAssignValue-CUmzp727.js +20 -0
  10. package/_baseClone-BlMmRXeX.js +208 -0
  11. package/_baseExtremum-P_0akmCi.js +27 -0
  12. package/_baseFlatten-CN7vDNEQ.js +72 -0
  13. package/_baseGet-Dgf6_xCm.js +80 -0
  14. package/_baseIsEqual-Cpjtfb3Q.js +173 -0
  15. package/_baseIteratee-CP1bocOX.js +95 -0
  16. package/_baseSlice-M5RKzt1A.js +10 -0
  17. package/_baseSum-wEbgNeUs.js +10 -0
  18. package/_baseUniq-tMFmk80M.js +61 -0
  19. package/_commonjsHelpers-C6fGbg64.js +6 -0
  20. package/_createAggregator-B4Cav8ZM.js +53 -0
  21. package/_getPrototype-CHAFQYL_.js +5 -0
  22. package/_getTag-BV_UoLYG.js +90 -0
  23. package/cloneDeep-BPVpFBzJ.js +8 -0
  24. package/components/AnnotationBody.js +34 -49
  25. package/components/AnnotationDetailPopover.js +30 -36
  26. package/components/AnnotationDetails.js +6 -6
  27. package/components/AnnotationEntry.js +47 -50
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.js +23 -44
  30. package/components/CountBadge.js +26 -31
  31. package/components/EnrichedCard.js +92 -104
  32. package/components/EnrichedChip.js +109 -134
  33. package/components/EnrichedTypography.js +110 -136
  34. package/components/ErrorBoundary.js +24 -28
  35. package/components/RetryFailedEnrichments.js +9 -10
  36. package/components/SourcePicker.js +49 -57
  37. package/components/actions/ActionForm.js +4 -4
  38. package/components/actions/ExecutePopover.js +50 -64
  39. package/components/actions/ResultModal.js +34 -37
  40. package/components/actions/form/schemaAdapter.js +20 -39
  41. package/components/display/graph/ExpandMoreButton.js +10 -10
  42. package/components/display/graph/elements/NodeCard.js +76 -92
  43. package/components/display/graph/elements/NodeTag.js +13 -15
  44. package/components/display/graph/index.js +200 -258
  45. package/components/display/graph/visualizations/Leaf.js +69 -88
  46. package/components/display/graph/visualizations/cloud/index.js +81 -98
  47. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  48. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  53. package/components/display/graph/visualizations/icons/index.js +13 -14
  54. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  55. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  56. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  57. package/components/display/graph/visualizations/tree/index.js +305 -407
  58. package/components/display/icons/Iconified.js +12 -27
  59. package/components/display/json/index.js +4 -4
  60. package/components/display/markdown/DynamicTabs.js +17 -22
  61. package/components/display/markdown/index.js +5674 -8531
  62. package/components/display/markdown/markdownPlugins/tabs.js +1 -1
  63. package/components/enrichment/EnrichPopover.js +47 -55
  64. package/components/fetchers/Fetcher.js +95 -123
  65. package/components/fetchers/PreviewModal.js +17 -20
  66. package/components/fetchers/StatusChip.js +18 -22
  67. package/components/group/Entry.js +11 -13
  68. package/components/group/Group.js +10 -13
  69. package/components/group/GroupControl.js +65 -76
  70. package/components/stats/QueryStatus.js +28 -37
  71. package/countBy-DOutsa_w.js +8 -0
  72. package/data/event.js +4 -6
  73. package/database/index.js +2 -2
  74. package/debounce-DryYcbJ4.js +56 -0
  75. package/get-Bow1vKwx.js +8 -0
  76. package/groupBy-BheQYl6f.js +8 -0
  77. package/hooks/ClueActionContext.js +6 -6
  78. package/hooks/ClueComponentContext.js +23 -29
  79. package/hooks/ClueConfigProvider.js +12 -14
  80. package/hooks/ClueDatabaseContext.js +13 -19
  81. package/hooks/ClueEnrichContext.js +8 -8
  82. package/hooks/ClueEnrichContextType.d.ts +7 -0
  83. package/hooks/ClueFetcherContext.js +46 -74
  84. package/hooks/ClueGroupContext.js +14 -17
  85. package/hooks/CluePopupContext.js +5 -5
  86. package/hooks/ClueProvider.js +10 -12
  87. package/hooks/selectors.js +11 -22
  88. package/hooks/useAnnotations.js +29 -45
  89. package/hooks/useClue.js +4 -6
  90. package/hooks/useClueActions.js +3 -3
  91. package/hooks/useClueConfig.js +5 -5
  92. package/hooks/useClueTypeConfig.js +3 -3
  93. package/hooks/useComparator.js +435 -722
  94. package/hooks/useErrors.js +18 -22
  95. package/hooks/useMyHighlights.js +36 -66
  96. package/hooks/useMyLocalStorage.js +43 -63
  97. package/iconify-BBckr5AQ.js +1263 -0
  98. package/icons/Action.js +49 -66
  99. package/icons/Assessment.js +68 -84
  100. package/icons/Context.js +61 -75
  101. package/icons/Opinion.js +65 -77
  102. package/icons/iconMap.js +2 -2
  103. package/identity-ByMq8VxU.js +6 -0
  104. package/index-CnaCBNrd.js +358 -0
  105. package/index-E7g8cRyW.js +568 -0
  106. package/index-V7wwd05F.js +975 -0
  107. package/index-p5_wX7q1.js +11729 -0
  108. package/index-pQg5VUAZ.js +12734 -0
  109. package/isEmpty-g47Qir2A.js +21 -0
  110. package/isNil-CjWwlQS3.js +6 -0
  111. package/isObject-B53jY8Qg.js +7 -0
  112. package/isObjectLike-BatpeCIi.js +29 -0
  113. package/isSymbol-C3_SC0Qp.js +8 -0
  114. package/last-7CdUxN0r.js +7 -0
  115. package/main.d.ts +3 -2
  116. package/main.js +62 -58
  117. package/package.json +1 -1
  118. package/sortBy-ITdmD17L.js +79 -0
  119. package/sumBy-DxJUU2E8.js +8 -0
  120. package/tabs-CgADNA57.js +195 -0
  121. package/text/Frequency.js +23 -42
  122. package/toFinite-BMy6GObD.js +14 -0
  123. package/toNumber-YVhnnJv4.js +31 -0
  124. package/types/config.d.ts +4 -1
  125. package/useClueTypeConfig-CneP98N_.js +2260 -0
  126. package/utils/chain.js +64 -91
  127. package/utils/classificationParser.d.ts +8 -8
  128. package/utils/classificationParser.js +257 -520
  129. package/utils/constants.js +10 -35
  130. package/utils/graph.js +45 -72
  131. package/utils/hashUtil.js +7 -7
  132. package/utils/line.js +81 -131
  133. package/utils/loggerUtil.js +3 -5
  134. package/utils/sessionStorage.js +29 -41
  135. package/utils/utils.js +9 -9
  136. package/utils/window.js +10 -21
  137. package/utils-CD0rFIFU.js +2704 -0
  138. package/ActionForm-D4ryHO0M.js +0 -436
  139. package/AnnotationDetails-YAPoqw3R.js +0 -175
  140. package/AnnotationPreview-DiQDjt9s.js +0 -188
  141. package/ClueEnrichContext-DIn6g8tw.js +0 -522
  142. package/FlexOne-BSYAhhtG.js +0 -9
  143. package/_Map-kgDsDYxq.js +0 -64
  144. package/_MapCache-DabaaWfq.js +0 -161
  145. package/_Uint8Array-BlVVH1tp.js +0 -129
  146. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  147. package/_baseClone-D3a8Pa4T.js +0 -284
  148. package/_baseExtremum-B1o1zHjR.js +0 -33
  149. package/_baseFlatten-D4huXoEI.js +0 -92
  150. package/_baseGet-BSK_nnoz.js +0 -109
  151. package/_baseIsEqual-B5xLoweL.js +0 -238
  152. package/_baseIteratee-p6Nj07-n.js +0 -126
  153. package/_baseSlice-GAv_YFTT.js +0 -20
  154. package/_baseSum-D0WC1dN0.js +0 -13
  155. package/_baseUniq-CpupKWcL.js +0 -89
  156. package/_commonjsHelpers-CUmg6egw.js +0 -6
  157. package/_createAggregator-BpVy5xMi.js +0 -63
  158. package/_getPrototype-D1LAdQKO.js +0 -5
  159. package/_getTag-D3ToyefI.js +0 -126
  160. package/cloneDeep-CjP5k9zW.js +0 -8
  161. package/countBy-C69WslUA.js +0 -14
  162. package/debounce-bV0h5FC5.js +0 -92
  163. package/get-D3C3lEU3.js +0 -8
  164. package/groupBy-DC2oOuBN.js +0 -14
  165. package/iconify-CXMreGTg.js +0 -1782
  166. package/identity-CPGTqrE4.js +0 -6
  167. package/index-BDVjGvMI.js +0 -696
  168. package/index-BHPT3qoB.js +0 -1172
  169. package/index-BMxyILVD.js +0 -465
  170. package/index-BbPn6-Mw.js +0 -15750
  171. package/index-Dz1kF2MU.js +0 -17654
  172. package/isEmpty-BQkZubqU.js +0 -29
  173. package/isNil-CIubwp4T.js +0 -6
  174. package/isObject-FTY-5JQX.js +0 -7
  175. package/isObjectLike-OAgjjZye.js +0 -48
  176. package/isSymbol-Xd2FsJyp.js +0 -8
  177. package/last-CUCl67Im.js +0 -7
  178. package/sortBy-B-UKp4GT.js +0 -100
  179. package/sumBy-MYkDPHZL.js +0 -8
  180. package/tabs-xGuUGsJd.js +0 -254
  181. package/toFinite-Bc55msYj.js +0 -16
  182. package/toNumber-DPxy1FBy.js +0 -39
  183. package/useClueTypeConfig-CH-nGq6a.js +0 -3184
  184. package/utils-Dr4wbKBZ.js +0 -4182
@@ -0,0 +1,340 @@
1
+ import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
+ import { materialRenderers as be, materialCells as Re } from "@jsonforms/material-renderers";
3
+ import { JsonForms as Ee } from "@jsonforms/react";
4
+ import { Stack as x, Typography as q, IconButton as Me, Modal as Se, Paper as je, Box as F, Button as G, Divider as oe, CircularProgress as Fe, Collapse as $e } from "@mui/material";
5
+ import le from "./components/display/icons/Iconified.js";
6
+ import { J as Je } from "./index-CnaCBNrd.js";
7
+ import { ClueComponentContext as ie } from "./hooks/ClueComponentContext.js";
8
+ import { c as Oe, u as ce, a as Pe } from "./index-E7g8cRyW.js";
9
+ import { A as ze } from "./index-pQg5VUAZ.js";
10
+ import { a as te } from "./useClueTypeConfig-CneP98N_.js";
11
+ import { d as de } from "./_baseGet-Dgf6_xCm.js";
12
+ import { b as We } from "./_baseSlice-M5RKzt1A.js";
13
+ import { i as qe } from "./utils-CD0rFIFU.js";
14
+ import { useState as v, useCallback as R, useEffect as Be, useMemo as L, memo as Ve } from "react";
15
+ import U from "./components/ErrorBoundary.js";
16
+ import { adaptSchema as ke } from "./components/actions/form/schemaAdapter.js";
17
+ import He from "./components/actions/ResultModal.js";
18
+ import { SNACKBAR_EVENT_ID as I } from "./data/event.js";
19
+ import { safeDispatchEvent as K } from "./utils/window.js";
20
+ import _e from "./hooks/useClue.js";
21
+ function Ge(e, l, i) {
22
+ var o = e.length;
23
+ return i = i === void 0 ? o : i, !l && i >= o ? e : We(e, l, i);
24
+ }
25
+ var Ie = "\\ud800-\\udfff", Ke = "\\u0300-\\u036f", Le = "\\ufe20-\\ufe2f", Ne = "\\u20d0-\\u20ff", Ze = Ke + Le + Ne, Ue = "\\ufe0e\\ufe0f", Qe = "\\u200d", Xe = RegExp("[" + Qe + Ie + Ze + Ue + "]");
26
+ function fe(e) {
27
+ return Xe.test(e);
28
+ }
29
+ function Ye(e) {
30
+ return e.split("");
31
+ }
32
+ var me = "\\ud800-\\udfff", ne = "\\u0300-\\u036f", Te = "\\ufe20-\\ufe2f", ge = "\\u20d0-\\u20ff", Ae = ne + Te + ge, De = "\\ufe0e\\ufe0f", es = "[" + me + "]", N = "[" + Ae + "]", Z = "\\ud83c[\\udffb-\\udfff]", ss = "(?:" + N + "|" + Z + ")", pe = "[^" + me + "]", ae = "(?:\\ud83c[\\udde6-\\uddff]){2}", ue = "[\\ud800-\\udbff][\\udc00-\\udfff]", rs = "\\u200d", he = ss + "?", ve = "[" + De + "]?", os = "(?:" + rs + "(?:" + [pe, ae, ue].join("|") + ")" + ve + he + ")*", ts = ve + he + os, ls = "(?:" + [pe + N + "?", N, ae, ue, es].join("|") + ")", is = RegExp(Z + "(?=" + Z + ")|" + ls + ts, "g");
33
+ function cs(e) {
34
+ return e.match(is) || [];
35
+ }
36
+ function ds(e) {
37
+ return fe(e) ? cs(e) : Ye(e);
38
+ }
39
+ function fs(e) {
40
+ return function(l) {
41
+ l = de(l);
42
+ var i = fe(l) ? ds(l) : void 0, o = i ? i[0] : l.charAt(0), m = i ? Ge(i, 1).join("") : l.slice(1);
43
+ return o[e]() + m;
44
+ };
45
+ }
46
+ var ms = fs("toUpperCase");
47
+ function ps(e) {
48
+ return ms(de(e).toLowerCase());
49
+ }
50
+ const as = new ze({ removeAdditional: !0, coerceTypes: !0, strict: !1 }), Ce = Oe(null), Hs = ({
51
+ baseURL: e,
52
+ children: l,
53
+ classification: i,
54
+ getToken: o,
55
+ onNetworkCall: m
56
+ }) => {
57
+ const { t: E } = ce(ie, (c) => c.i18next), { ready: w } = _e(), [a, C] = v(null), [$, M] = v({}), [B, t] = v(!1), [J, V] = v(null), [r, d] = v(!1), [b, O] = v({}), k = R(async () => {
58
+ if (!w)
59
+ return;
60
+ const c = {}, u = o == null ? void 0 : o();
61
+ u && (c.Authorization = `Bearer ${u}`);
62
+ let y = { baseURL: e, headers: c };
63
+ m && (y = m(y));
64
+ const S = await te.actions.get(y);
65
+ return S && O(S), S;
66
+ }, [e, o, m, w]);
67
+ Be(() => {
68
+ k();
69
+ }, [e, w]);
70
+ const P = R(
71
+ (c, u, y) => JSON.stringify({ type: c, value: u, classification: y ?? i }),
72
+ [i]
73
+ ), Q = R(
74
+ async (c, u, y, S) => {
75
+ const { forceMenu: n, onComplete: z, skipMenu: xe, timeout: T } = {
76
+ forceMenu: !1,
77
+ skipMenu: !1,
78
+ onComplete: null,
79
+ timeout: null,
80
+ ...S
81
+ }, g = {}, A = o == null ? void 0 : o();
82
+ if (A && (g.Authorization = `Bearer ${A}`), !Object.keys(b).includes(c))
83
+ throw new Error("Invalid action id");
84
+ const D = u.map(
85
+ (h) => h.type === "telemetry" ? { ...h, value: JSON.stringify(h.value) } : h
86
+ ), W = b[c], H = as.compile(W.params), _ = { selectors: D, ...y };
87
+ if (d(!0), !H(_) || n) {
88
+ if (xe && !n)
89
+ throw console.error(`Form is not valid (${H.errors.length} errors)`), new Error("Form is not completed");
90
+ (a == null ? void 0 : a.id) === c && (console.error(`Form is not valid (${H.errors.length} errors)`), K(
91
+ new CustomEvent(I, {
92
+ detail: {
93
+ message: E("action.error.validation"),
94
+ level: "error"
95
+ }
96
+ })
97
+ )), C({
98
+ id: c,
99
+ action: W,
100
+ selectors: u,
101
+ params: _ ?? {},
102
+ onComplete: z,
103
+ timeout: T
104
+ });
105
+ return;
106
+ }
107
+ try {
108
+ let h = { baseURL: e, headers: g };
109
+ m && (h = m(h));
110
+ const p = await te.actions.post(
111
+ c,
112
+ D,
113
+ _ ?? {},
114
+ { timeout: T },
115
+ h
116
+ ), ee = { ...p, actionId: c, action: W };
117
+ z == null || z(ee), M((se) => {
118
+ const we = u.map((j) => P(j.type, j.value, j.classification));
119
+ return {
120
+ ...se,
121
+ ...we.reduce(
122
+ (j, re) => ({
123
+ ...j,
124
+ [re]: [...se[re] ?? [], ee]
125
+ }),
126
+ {}
127
+ )
128
+ };
129
+ }), K(
130
+ new CustomEvent(I, {
131
+ detail: {
132
+ message: /* @__PURE__ */ f(x, { direction: "row", alignItems: "center", spacing: 0.5, width: "100%", children: [
133
+ /* @__PURE__ */ s(q, { children: p.summary }),
134
+ p.link && /* @__PURE__ */ s(Me, { component: "a", href: p.link, size: "small", target: "_blank", children: /* @__PURE__ */ s(le, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
135
+ ] }),
136
+ timeout: p.link ? null : 5e3,
137
+ level: p.outcome === "success" ? "success" : "error",
138
+ options: {
139
+ style: {
140
+ minWidth: 0
141
+ },
142
+ SnackbarProps: {
143
+ style: {
144
+ minWidth: 0
145
+ }
146
+ }
147
+ }
148
+ }
149
+ })
150
+ ), p.outcome === "success" && C(null), p.format && (V({ ...p, actionId: c, action: W }), p.format !== "pivot" ? t(!0) : window.open(p.output, "_blank", "noreferrer"));
151
+ } catch (h) {
152
+ K(
153
+ new CustomEvent(I, {
154
+ detail: {
155
+ message: h.toString(),
156
+ level: "error"
157
+ }
158
+ })
159
+ );
160
+ } finally {
161
+ d(!1);
162
+ }
163
+ },
164
+ [b, e, P, o, m, a == null ? void 0 : a.id, E]
165
+ ), X = R(() => {
166
+ C(null), d(!1);
167
+ }, []), Y = R(
168
+ (c, u, y) => $[P(c, u, y)] ?? [],
169
+ [$, P]
170
+ ), ye = L(
171
+ () => ({
172
+ availableActions: b,
173
+ executeAction: Q,
174
+ cancelAction: X,
175
+ getActionResults: Y,
176
+ loading: r,
177
+ refreshActions: k
178
+ }),
179
+ [b, X, Q, Y, r, k]
180
+ );
181
+ return /* @__PURE__ */ f(Ce.Provider, { value: ye, children: [
182
+ l,
183
+ /* @__PURE__ */ f(U, { children: [
184
+ a && /* @__PURE__ */ s(Cs, { runningActionData: a }),
185
+ /* @__PURE__ */ s(
186
+ He,
187
+ {
188
+ show: B && !!J,
189
+ result: J,
190
+ onClose: () => t(!1)
191
+ }
192
+ )
193
+ ] })
194
+ ] });
195
+ }, us = () => Pe(Ce), hs = be.map((e) => ({
196
+ ...e,
197
+ renderer: ({ ...l }) => /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(e.renderer, { ...l }) })
198
+ })), vs = ({ runningActionData: e }) => {
199
+ const { executeAction: l, cancelAction: i } = us(), { t: o } = ce(ie, (r) => r.i18next), [m, E] = v(!1), [w, a] = v(null), [C, $] = v(e == null ? void 0 : e.params), [M, B] = v(!1), t = L(
200
+ () => e != null && e.action ? { ...ke(e.action.params), ...e.action.extra_schema ?? {} } : null,
201
+ [e == null ? void 0 : e.action]
202
+ ), J = L(
203
+ () => ({
204
+ type: "VerticalLayout",
205
+ elements: Object.entries((t == null ? void 0 : t.properties) ?? {}).sort(([r, d], [b, O]) => d.order || O.order ? d.order - O.order : +(t == null ? void 0 : t.required.includes(r)) - +(t == null ? void 0 : t.required.includes(b))).map(([r, d]) => ({
206
+ type: "Control",
207
+ scope: `#/properties/${r}`,
208
+ options: {
209
+ autocomplete: !!d.enum,
210
+ showUnfocusedDescription: !0,
211
+ ...d.options
212
+ },
213
+ rule: d.rule
214
+ }))
215
+ }),
216
+ [t == null ? void 0 : t.properties, t == null ? void 0 : t.required]
217
+ ), V = R(async () => {
218
+ try {
219
+ E(!0);
220
+ const r = {};
221
+ e != null && e.onComplete && (r.onComplete = e == null ? void 0 : e.onComplete), e != null && e.timeout && (r.timeout = e == null ? void 0 : e.timeout), await l(e == null ? void 0 : e.id, e == null ? void 0 : e.selectors, C, r);
222
+ } catch (r) {
223
+ console.error(r);
224
+ } finally {
225
+ E(!1);
226
+ }
227
+ }, [
228
+ l,
229
+ e == null ? void 0 : e.id,
230
+ e == null ? void 0 : e.selectors,
231
+ e == null ? void 0 : e.onComplete,
232
+ e == null ? void 0 : e.timeout,
233
+ C
234
+ ]);
235
+ if (e != null && e.action)
236
+ try {
237
+ return /* @__PURE__ */ s(Se, { open: !0, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: i, children: /* @__PURE__ */ s(
238
+ je,
239
+ {
240
+ sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", px: 2, pt: 2, minWidth: "750px", overflow: "auto" },
241
+ children: /* @__PURE__ */ f(
242
+ x,
243
+ {
244
+ spacing: 1,
245
+ height: "100%",
246
+ sx: {
247
+ ".MuiFormHelperText-root": {
248
+ marginLeft: "0 !important",
249
+ "&:last-of-type": { mb: 3 }
250
+ }
251
+ },
252
+ children: [
253
+ /* @__PURE__ */ f(x, { direction: "row", spacing: 1, children: [
254
+ /* @__PURE__ */ f(x, { direction: "column", spacing: 1, children: [
255
+ /* @__PURE__ */ f(q, { variant: "h5", children: [
256
+ o("actions.executing"),
257
+ " ",
258
+ e == null ? void 0 : e.action.id.replace(/_/g, " ").split(" ").map(ps).join(" ")
259
+ ] }),
260
+ (e == null ? void 0 : e.action.summary) && /* @__PURE__ */ s(q, { variant: "body1", color: "text.secondary", sx: { pb: 1.5 }, children: e == null ? void 0 : e.action.summary })
261
+ ] }),
262
+ /* @__PURE__ */ s(F, { flex: 1 }),
263
+ /* @__PURE__ */ s(F, { alignContent: "end", children: /* @__PURE__ */ s(
264
+ G,
265
+ {
266
+ variant: "outlined",
267
+ onClick: () => B((r) => !r),
268
+ startIcon: /* @__PURE__ */ s(
269
+ F,
270
+ {
271
+ component: "span",
272
+ sx: (r) => ({
273
+ transition: r.transitions.create("transform"),
274
+ transform: M ? "rotate(180deg)" : "rotate(0deg)"
275
+ }),
276
+ children: /* @__PURE__ */ s(le, { icon: "ic:baseline-keyboard-double-arrow-right" })
277
+ }
278
+ ),
279
+ children: o(M ? "actions.json.hide" : "actions.json.show")
280
+ }
281
+ ) })
282
+ ] }),
283
+ /* @__PURE__ */ s(oe, { orientation: "horizontal", variant: "middle" }),
284
+ /* @__PURE__ */ s(F, { pt: 1.5 }),
285
+ /* @__PURE__ */ f(x, { flexGrow: 1, direction: "row", spacing: 1, children: [
286
+ /* @__PURE__ */ f(x, { direction: "column", flexGrow: 1, children: [
287
+ /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(
288
+ Ee,
289
+ {
290
+ schema: t,
291
+ uischema: J,
292
+ renderers: hs,
293
+ cells: Re,
294
+ data: C,
295
+ onChange: ({ data: r, errors: d }) => {
296
+ qe(r, C) || $(r), a(d);
297
+ },
298
+ config: {}
299
+ }
300
+ ) }),
301
+ /* @__PURE__ */ f(x, { direction: "row", spacing: 1, pb: 1, children: [
302
+ /* @__PURE__ */ s("div", { style: { flex: 1 } }),
303
+ /* @__PURE__ */ s(G, { color: "error", variant: "outlined", onClick: i, children: o("cancel") }),
304
+ /* @__PURE__ */ s(
305
+ G,
306
+ {
307
+ color: "success",
308
+ variant: "outlined",
309
+ disabled: m || (w == null ? void 0 : w.length) > 0,
310
+ onClick: V,
311
+ endIcon: m && /* @__PURE__ */ s(Fe, { color: "inherit", size: 18 }),
312
+ children: o("actions.execute")
313
+ }
314
+ )
315
+ ] })
316
+ ] }),
317
+ /* @__PURE__ */ s($e, { orientation: "horizontal", in: M, unmountOnExit: !0, mountOnEnter: !0, children: /* @__PURE__ */ f(x, { direction: "row", height: "100%", spacing: 1, children: [
318
+ /* @__PURE__ */ s(oe, { orientation: "vertical" }),
319
+ /* @__PURE__ */ f(x, { children: [
320
+ /* @__PURE__ */ s(q, { variant: "h5", children: o("action.data") }),
321
+ /* @__PURE__ */ s(F, { width: 600, height: "100%", children: /* @__PURE__ */ s(Je, { data: C, slotProps: { stack: { height: "100%" }, json: { name: !1 } } }) })
322
+ ] })
323
+ ] }) })
324
+ ] })
325
+ ]
326
+ }
327
+ )
328
+ }
329
+ ) });
330
+ } catch (r) {
331
+ return console.warn(r), null;
332
+ }
333
+ }, Cs = Ve(vs);
334
+ export {
335
+ Cs as A,
336
+ Hs as C,
337
+ Ce as a,
338
+ ps as c,
339
+ us as u
340
+ };
@@ -0,0 +1,160 @@
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
+ import { I as u } from "./iconify-BBckr5AQ.js";
3
+ import { useTheme as M, Stack as l, Typography as s, Tooltip as x, Box as A, IconButton as E, CircularProgress as N, Chip as z, Accordion as $, AccordionSummary as j, AccordionDetails as _, Divider as S } from "@mui/material";
4
+ import g from "./components/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 { g as V } from "./groupBy-BheQYl6f.js";
13
+ import { u as W } from "./ClueEnrichContext-CvCIPOMC.js";
14
+ import { memo as G, useState as J, useMemo as k, useCallback as P, useEffect as Q } from "react";
15
+ import { u as X } from "./index-E7g8cRyW.js";
16
+ import Y from "./components/actions/ExecutePopover.js";
17
+ import Z from "./components/AnnotationEntry.js";
18
+ import q from "./components/ClassificationChip.js";
19
+ import R from "./components/enrichment/EnrichPopover.js";
20
+ function w(i) {
21
+ return i === null;
22
+ }
23
+ const ii = ({ enrichRequest: i, setReady: d, updatePosition: p }) => {
24
+ const v = M(), { t: c } = X(F, (n) => n.i18next), [r, I] = J("all"), y = H((n) => n.enrich), [t, C] = K(
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 = L(i == null ? void 0 : i.value), B = k(
30
+ () => ["all", ...W((t ?? []).map((n) => n.type))],
31
+ [t]
32
+ ), b = k(() => V(t ?? [], "type"), [t]), h = P(async () => {
33
+ await y(i.type, i.value, {
34
+ classification: i.classification,
35
+ timeout: 15,
36
+ force: !0
37
+ });
38
+ }, [i, y]);
39
+ return Q(() => {
40
+ d && (d(i && !w(t)), p == null || p());
41
+ }, [t, i, d, p]), i && !w(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(q, { 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(A, { sx: { alignSelf: "center", m: -1 }, children: /* @__PURE__ */ o(E, { onClick: () => h(), disabled: C, children: C ? /* @__PURE__ */ o(N, { variant: "indeterminate", size: 20 }) : /* @__PURE__ */ o(g, { icon: "ic:baseline-replay", fontSize: "small" }) }) }) }),
57
+ /* @__PURE__ */ o(x, { title: c("clipboard"), children: /* @__PURE__ */ o(
58
+ E,
59
+ {
60
+ sx: { alignSelf: "center", m: -1 },
61
+ onClick: () => {
62
+ navigator.clipboard.writeText(i.value), U(
63
+ new CustomEvent(O, {
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(R, { selector: i }),
75
+ /* @__PURE__ */ o(Y, { selectors: [i] })
76
+ ] }),
77
+ /* @__PURE__ */ a(l, { direction: "row", spacing: 0.5, children: [
78
+ B.map((n, e) => /* @__PURE__ */ o(
79
+ z,
80
+ {
81
+ size: "small",
82
+ variant: n === r ? "filled" : "outlined",
83
+ icon: T[n] && /* @__PURE__ */ o(u, { icon: T[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: () => I(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(u, { 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(A, {}),
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
+ j,
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(_, { 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, D) => /* @__PURE__ */ o(Z, { annotation: f }, D)) })
150
+ ] })
151
+ ]
152
+ },
153
+ e
154
+ ))
155
+ ] });
156
+ }, hi = G(ii);
157
+ export {
158
+ hi as A,
159
+ w 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-BBckr5AQ.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-CD0rFIFU.js";
7
+ import { useState as v, useRef as Y, useCallback as x, useEffect as Z, useMemo as _ } from "react";
8
+ import { c as B, u as G } from "./index-E7g8cRyW.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-BoX61_IF.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
+ };