@cccsaurora/clue-ui 1.2.3-dev.266 → 1.2.3-patch.269

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 (186) hide show
  1. package/ActionForm-Ch0DGVGr.js +4462 -0
  2. package/AnnotationDetails-C8E_Xvaf.js +160 -0
  3. package/AnnotationPreview-CLCms-Fm.js +140 -0
  4. package/ClueEnrichContext-KqRuuWNS.js +418 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_MapCache-BiTi0iqu.js +180 -0
  7. package/_Uint8Array-BQNOM9Rr.js +101 -0
  8. package/_baseAssignValue-CNMLQZco.js +20 -0
  9. package/_baseClone-BnT-6pyM.js +207 -0
  10. package/_baseExtremum-Ca2EHgy2.js +16 -0
  11. package/_baseFlatten-Bfr_Molw.js +72 -0
  12. package/_baseGet-DSZygzyq.js +79 -0
  13. package/_baseIsEqual-VgvaAFZG.js +147 -0
  14. package/_baseIteratee-Dbfsw5z8.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-BJcj69PL.js +79 -0
  18. package/_commonjsHelpers-DaMA6jEr.js +8 -0
  19. package/_createAggregator-k3TuAnxT.js +53 -0
  20. package/_getPrototype-Cr1Mk7BC.js +5 -0
  21. package/_getTag-CK2Sffaq.js +90 -0
  22. package/_isIterateeCall-DkJP7Rbx.js +13 -0
  23. package/_setToArray-C7yMOeww.js +29 -0
  24. package/cloneDeep-CF8TtLHr.js +8 -0
  25. package/components/AnnotationBody.js +35 -49
  26. package/components/AnnotationDetailPopover.js +30 -36
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +23 -44
  31. package/components/CountBadge.js +26 -31
  32. package/components/EnrichedCard.js +97 -110
  33. package/components/EnrichedChip.js +105 -130
  34. package/components/EnrichedTypography.js +107 -133
  35. package/components/ErrorBoundary.js +24 -28
  36. package/components/RetryFailedEnrichments.js +9 -10
  37. package/components/SourcePicker.js +49 -57
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +59 -75
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +23 -39
  42. package/components/actions/formats/FileResult.js +59 -86
  43. package/components/actions/formats/index.js +10 -21
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +91 -111
  46. package/components/display/graph/elements/NodeTag.js +13 -15
  47. package/components/display/graph/index.js +202 -261
  48. package/components/display/graph/visualizations/Leaf.js +69 -88
  49. package/components/display/graph/visualizations/cloud/index.js +81 -98
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +13 -14
  57. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  58. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +306 -408
  61. package/components/display/icons/Iconified.js +12 -27
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +5770 -8678
  64. package/components/enrichment/EnrichPopover.js +46 -54
  65. package/components/fetchers/Fetcher.js +119 -158
  66. package/components/fetchers/PreviewModal.js +17 -20
  67. package/components/fetchers/StatusChip.js +17 -21
  68. package/components/group/Entry.js +11 -13
  69. package/components/group/Group.js +10 -13
  70. package/components/group/GroupControl.js +65 -76
  71. package/components/stats/QueryStatus.js +33 -43
  72. package/countBy-CdYegFSu.js +8 -0
  73. package/data/event.js +4 -6
  74. package/database/index.js +2 -2
  75. package/debounce-DryYcbJ4.js +56 -0
  76. package/get-CH7kz5Ix.js +8 -0
  77. package/groupBy-br8xmD2R.js +8 -0
  78. package/hooks/ClueActionContext.js +6 -6
  79. package/hooks/ClueComponentContext.js +23 -29
  80. package/hooks/ClueConfigProvider.js +12 -14
  81. package/hooks/ClueDatabaseContext.js +13 -19
  82. package/hooks/ClueEnrichContext.js +8 -8
  83. package/hooks/ClueFetcherContext.js +56 -83
  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 +7 -7
  88. package/hooks/useActionResult.d.ts +1 -0
  89. package/hooks/useActionResult.js +2 -2
  90. package/hooks/useAnnotations.js +31 -47
  91. package/hooks/useClue.js +4 -6
  92. package/hooks/useClueActions.js +3 -3
  93. package/hooks/useClueConfig.js +4 -6
  94. package/hooks/useClueTypeConfig.js +3 -3
  95. package/hooks/useComparator.js +435 -722
  96. package/hooks/useErrors.js +18 -22
  97. package/hooks/useFetcherResult.d.ts +1 -0
  98. package/hooks/useFetcherResult.js +24 -33
  99. package/hooks/useMyHighlights.js +36 -66
  100. package/hooks/useMyLocalStorage.js +37 -66
  101. package/iconify-BBckr5AQ.js +1263 -0
  102. package/icons/Action.js +49 -66
  103. package/icons/Assessment.js +69 -85
  104. package/icons/Context.js +63 -77
  105. package/icons/Opinion.js +60 -76
  106. package/icons/iconMap.js +2 -2
  107. package/identity-ByMq8VxU.js +6 -0
  108. package/index-BHAe_V9n.js +12768 -0
  109. package/index-BK-zfYhR.js +358 -0
  110. package/index-CA5CUNZO.js +975 -0
  111. package/index-Dj5C04IX.js +568 -0
  112. package/index-p5_wX7q1.js +11729 -0
  113. package/isNil-CjWwlQS3.js +6 -0
  114. package/isObject-B53jY8Qg.js +7 -0
  115. package/isObjectLike-BatpeCIi.js +29 -0
  116. package/isSymbol-C3_SC0Qp.js +8 -0
  117. package/last-7CdUxN0r.js +7 -0
  118. package/main.js +60 -60
  119. package/maxBy-Bc0dYHcO.js +8 -0
  120. package/package.json +1 -1
  121. package/sortBy-DY2JBf9n.js +75 -0
  122. package/sumBy-DuMASLPd.js +8 -0
  123. package/text/Frequency.js +23 -42
  124. package/toFinite-BMy6GObD.js +14 -0
  125. package/toNumber-YVhnnJv4.js +31 -0
  126. package/types/WithActionData.d.ts +2 -1
  127. package/useClueTypeConfig-Ct9Ygter.js +2292 -0
  128. package/utils/chain.js +65 -92
  129. package/utils/classificationParser.js +256 -519
  130. package/utils/constants.js +10 -35
  131. package/utils/graph.js +45 -72
  132. package/utils/hashUtil.js +7 -7
  133. package/utils/line.js +81 -131
  134. package/utils/loggerUtil.js +3 -5
  135. package/utils/sessionStorage.js +27 -41
  136. package/utils/time.js +423 -423
  137. package/utils/utils.js +9 -9
  138. package/utils/window.js +10 -21
  139. package/utils-DmwSUrum.js +129 -0
  140. package/ActionForm-uDp92tN2.js +0 -5941
  141. package/AnnotationDetails-DGYfOiWm.js +0 -175
  142. package/AnnotationPreview-bHObsb3P.js +0 -188
  143. package/ClueEnrichContext-CJEJxrgs.js +0 -541
  144. package/FlexOne-BSYAhhtG.js +0 -9
  145. package/_MapCache-WmuDdwuH.js +0 -222
  146. package/_Uint8Array-B7JqpgFX.js +0 -128
  147. package/_baseAssignValue-CGTuELqU.js +0 -25
  148. package/_baseClone-CkNrTyhm.js +0 -283
  149. package/_baseExtremum-kob8QXyt.js +0 -18
  150. package/_baseFlatten-jIR_sN_-.js +0 -92
  151. package/_baseGet-Bx3A4Qfp.js +0 -108
  152. package/_baseIsEqual-C5OTWzTk.js +0 -208
  153. package/_baseIteratee-avi7MX2o.js +0 -126
  154. package/_baseSlice-GAv_YFTT.js +0 -20
  155. package/_baseSum-D0WC1dN0.js +0 -13
  156. package/_baseUniq-BI9GIHMF.js +0 -115
  157. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  158. package/_createAggregator-QD8MzKwe.js +0 -63
  159. package/_getPrototype-CU0j_POw.js +0 -5
  160. package/_getTag-Ckxxfr88.js +0 -126
  161. package/_isIterateeCall-Ds3sw2SF.js +0 -17
  162. package/_setToArray-CaPKQhcz.js +0 -33
  163. package/cloneDeep-DJrLSw8W.js +0 -8
  164. package/countBy-c6S3dvSW.js +0 -14
  165. package/debounce-bV0h5FC5.js +0 -92
  166. package/get-DSsNkRQs.js +0 -8
  167. package/groupBy-xqz-n0Vd.js +0 -14
  168. package/iconify-CXMreGTg.js +0 -1782
  169. package/identity-CPGTqrE4.js +0 -6
  170. package/index-AMfoEg_6.js +0 -696
  171. package/index-B6C2a_Lg.js +0 -1172
  172. package/index-C12gPw2W.js +0 -17698
  173. package/index-DCKkHTvx.js +0 -15750
  174. package/index-JcKyZeoY.js +0 -465
  175. package/isNil-CIubwp4T.js +0 -6
  176. package/isObject-FTY-5JQX.js +0 -7
  177. package/isObjectLike-OAgjjZye.js +0 -48
  178. package/isSymbol-Xd2FsJyp.js +0 -8
  179. package/last-CUCl67Im.js +0 -7
  180. package/maxBy-IKHzFrCS.js +0 -8
  181. package/sortBy-DfSj8IoJ.js +0 -96
  182. package/sumBy-D-hb_NY-.js +0 -8
  183. package/toFinite-Bc55msYj.js +0 -16
  184. package/toNumber-DPxy1FBy.js +0 -39
  185. package/useClueTypeConfig-Z1LFp01b.js +0 -3289
  186. package/utils-HmNPuoDB.js +0 -199
@@ -1,112 +1,85 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Stack, Typography, Divider, Table, TableBody, TableRow, TableCell, Button } from "@mui/material";
3
- import Iconified from "../../display/icons/Iconified.js";
4
- import { ClueComponentContext } from "../../../hooks/ClueComponentContext.js";
5
- import { useState, useMemo, useEffect } from "react";
6
- import { u as useContextSelector } from "../../../index-AMfoEg_6.js";
7
- const decodeBase64ToBytes = (base64Data) => {
8
- const byteCharacters = atob(base64Data);
9
- const byteArray = new Uint8Array(new ArrayBuffer(byteCharacters.length));
10
- for (let i = 0; i < byteCharacters.length; i++) {
11
- byteArray[i] = byteCharacters.charCodeAt(i);
12
- }
13
- return byteArray;
14
- };
15
- const formatBytes = (bytes) => {
16
- if (bytes === 0) {
1
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
+ import { Stack as v, Typography as u, Divider as A, Table as C, TableBody as S, TableRow as d, TableCell as l, Button as k } from "@mui/material";
3
+ import M from "../../display/icons/Iconified.js";
4
+ import { ClueComponentContext as R } from "../../../hooks/ClueComponentContext.js";
5
+ import { useState as T, useMemo as U, useEffect as _ } from "react";
6
+ import { u as j } from "../../../index-Dj5C04IX.js";
7
+ const b = (t) => {
8
+ const e = atob(t), o = new Uint8Array(new ArrayBuffer(e.length));
9
+ for (let a = 0; a < e.length; a++)
10
+ o[a] = e.charCodeAt(a);
11
+ return o;
12
+ }, H = (t) => {
13
+ if (t === 0)
17
14
  return "0 B";
18
- }
19
- const units = ["B", "KB", "MB", "GB"];
20
- const unitIndex = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);
21
- const value = bytes / 1024 ** unitIndex;
22
- return `${value.toFixed(unitIndex === 0 ? 0 : 2)} ${units[unitIndex]}`;
23
- };
24
- const saveFileFromServer = (output) => {
25
- const byteArray = decodeBase64ToBytes(output.data);
26
- const blob = new Blob([byteArray], { type: output.mime_type || "application/octet-stream" });
27
- const url = URL.createObjectURL(blob);
28
- const link = document.createElement("a");
29
- link.href = url;
30
- link.download = output.file_name || "result.txt";
31
- document.body.appendChild(link);
32
- link.click();
33
- document.body.removeChild(link);
34
- URL.revokeObjectURL(url);
35
- };
36
- const FileResult = ({ result }) => {
37
- var _a, _b, _c, _d, _e;
38
- const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.i18next);
39
- const [sha256Hash, setSha256Hash] = useState("");
40
- const actionName = ((_a = result.action) == null ? void 0 : _a.name) ?? t("actions.result.file.unknown");
41
- const outputBytes = useMemo(() => {
42
- var _a2;
43
- if (!((_a2 = result.output) == null ? void 0 : _a2.data)) {
15
+ const e = ["B", "KB", "MB", "GB"], o = Math.min(Math.floor(Math.log(t) / Math.log(1024)), e.length - 1);
16
+ return `${(t / 1024 ** o).toFixed(o === 0 ? 0 : 2)} ${e[o]}`;
17
+ }, F = (t) => {
18
+ const e = b(t.data), o = new Blob([e], { type: t.mime_type || "application/octet-stream" }), a = URL.createObjectURL(o), i = document.createElement("a");
19
+ i.href = a, i.download = t.file_name || "result.txt", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(a);
20
+ }, D = ({ result: t }) => {
21
+ var h, f, m, p, y;
22
+ const { t: e } = j(R, (r) => r == null ? void 0 : r.i18next), [o, a] = T(""), i = ((h = t.action) == null ? void 0 : h.name) ?? e("actions.result.file.unknown"), s = U(() => {
23
+ var r;
24
+ if (!((r = t.output) != null && r.data))
44
25
  return null;
45
- }
46
26
  try {
47
- return decodeBase64ToBytes(result.output.data);
27
+ return b(t.output.data);
48
28
  } catch {
49
29
  return null;
50
30
  }
51
- }, [(_b = result.output) == null ? void 0 : _b.data]);
52
- useEffect(() => {
53
- let cancelled = false;
54
- const generateHash = async () => {
55
- if (!outputBytes || typeof crypto === "undefined" || !crypto.subtle) {
56
- setSha256Hash("N/A");
31
+ }, [(f = t.output) == null ? void 0 : f.data]);
32
+ return _(() => {
33
+ let r = !1;
34
+ const g = async () => {
35
+ if (!s || typeof crypto > "u" || !crypto.subtle) {
36
+ a("N/A");
57
37
  return;
58
38
  }
59
- const digest = await crypto.subtle.digest("SHA-256", outputBytes);
60
- const digestArray = Array.from(new Uint8Array(digest));
61
- const digestHex = digestArray.map((value) => value.toString(16).padStart(2, "0")).join("");
62
- if (!cancelled) {
63
- setSha256Hash(digestHex);
64
- }
39
+ const w = await crypto.subtle.digest("SHA-256", s), x = Array.from(new Uint8Array(w)).map((B) => B.toString(16).padStart(2, "0")).join("");
40
+ r || a(x);
65
41
  };
66
- setSha256Hash("");
67
- generateHash();
68
- return () => {
69
- cancelled = true;
42
+ return a(""), g(), () => {
43
+ r = !0;
70
44
  };
71
- }, [outputBytes]);
72
- return /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, spacing: 3, children: [
73
- /* @__PURE__ */ jsx(Typography, { variant: "h5", children: t("actions.result.file.title", { actionName }) }),
74
- /* @__PURE__ */ jsx(Typography, { children: t("actions.result.file.description", { actionName }) }),
75
- /* @__PURE__ */ jsx(Divider, { flexItem: true }),
76
- /* @__PURE__ */ jsx(Typography, { variant: "h6", children: t("actions.result.file.stats.title") }),
77
- outputBytes && /* @__PURE__ */ jsx(Table, { sx: { maxWidth: 900 }, children: /* @__PURE__ */ jsxs(TableBody, { children: [
78
- /* @__PURE__ */ jsxs(TableRow, { children: [
79
- /* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.decoded_size") }),
80
- /* @__PURE__ */ jsx(TableCell, { children: formatBytes(outputBytes.length) || "n/a" })
45
+ }, [s]), /* @__PURE__ */ c(v, { sx: { overflowY: "auto" }, spacing: 3, children: [
46
+ /* @__PURE__ */ n(u, { variant: "h5", children: e("actions.result.file.title", { actionName: i }) }),
47
+ /* @__PURE__ */ n(u, { children: e("actions.result.file.description", { actionName: i }) }),
48
+ /* @__PURE__ */ n(A, { flexItem: !0 }),
49
+ /* @__PURE__ */ n(u, { variant: "h6", children: e("actions.result.file.stats.title") }),
50
+ s && /* @__PURE__ */ n(C, { sx: { maxWidth: 900 }, children: /* @__PURE__ */ c(S, { children: [
51
+ /* @__PURE__ */ c(d, { children: [
52
+ /* @__PURE__ */ n(l, { sx: { width: "35%" }, children: e("actions.result.file.stats.label.decoded_size") }),
53
+ /* @__PURE__ */ n(l, { children: H(s.length) || "n/a" })
81
54
  ] }),
82
- /* @__PURE__ */ jsxs(TableRow, { children: [
83
- /* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.decoded_bytes") }),
84
- /* @__PURE__ */ jsx(TableCell, { children: outputBytes.length || "n/a" })
55
+ /* @__PURE__ */ c(d, { children: [
56
+ /* @__PURE__ */ n(l, { sx: { width: "35%" }, children: e("actions.result.file.stats.label.decoded_bytes") }),
57
+ /* @__PURE__ */ n(l, { children: s.length || "n/a" })
85
58
  ] }),
86
- /* @__PURE__ */ jsxs(TableRow, { children: [
87
- /* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.base64_length") }),
88
- /* @__PURE__ */ jsx(TableCell, { children: ((_c = result.output) == null ? void 0 : _c.data.length) ?? "n/a" })
59
+ /* @__PURE__ */ c(d, { children: [
60
+ /* @__PURE__ */ n(l, { sx: { width: "35%" }, children: e("actions.result.file.stats.label.base64_length") }),
61
+ /* @__PURE__ */ n(l, { children: ((m = t.output) == null ? void 0 : m.data.length) ?? "n/a" })
89
62
  ] }),
90
- /* @__PURE__ */ jsxs(TableRow, { children: [
91
- /* @__PURE__ */ jsx(TableCell, { sx: { width: "35%" }, children: t("actions.result.file.stats.label.sha256") }),
92
- /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("code", { children: sha256Hash || t("actions.result.file.stats.calculating") }) })
63
+ /* @__PURE__ */ c(d, { children: [
64
+ /* @__PURE__ */ n(l, { sx: { width: "35%" }, children: e("actions.result.file.stats.label.sha256") }),
65
+ /* @__PURE__ */ n(l, { children: /* @__PURE__ */ n("code", { children: o || e("actions.result.file.stats.calculating") }) })
93
66
  ] })
94
67
  ] }) }),
95
- /* @__PURE__ */ jsx(
96
- Button,
68
+ /* @__PURE__ */ n(
69
+ k,
97
70
  {
98
- startIcon: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-download" }),
71
+ startIcon: /* @__PURE__ */ n(M, { icon: "ic:baseline-download" }),
99
72
  variant: "outlined",
100
73
  sx: { alignSelf: "center" },
101
- disabled: !((_d = result.output) == null ? void 0 : _d.data),
102
- onClick: () => result.output && saveFileFromServer(result.output),
74
+ disabled: !((p = t.output) != null && p.data),
75
+ onClick: () => t.output && F(t.output),
103
76
  name: "download",
104
77
  role: "button",
105
- children: t("download", { file: ((_e = result.output) == null ? void 0 : _e.file_name) ?? "result.txt" })
78
+ children: e("download", { file: ((y = t.output) == null ? void 0 : y.file_name) ?? "result.txt" })
106
79
  }
107
80
  )
108
81
  ] });
109
82
  };
110
83
  export {
111
- FileResult as default
84
+ D as default
112
85
  };
@@ -1,23 +1,12 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Stack } from "@mui/material";
3
- import { J as JSONViewer } from "../../../index-JcKyZeoY.js";
4
- import Markdown from "../../display/markdown/index.js";
5
- import FileResult from "./FileResult.js";
6
- const Result = ({ result }) => {
7
- if (result.format === "markdown") {
8
- return /* @__PURE__ */ jsx(Markdown, { md: result.output });
9
- }
10
- if (result.format === "json") {
11
- return /* @__PURE__ */ jsx(JSONViewer, { data: result.output, collapse: true, forceCompact: true });
12
- }
13
- if (result.format === "file") {
14
- return /* @__PURE__ */ jsx(FileResult, { result });
15
- }
16
- return /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, children: [
17
- /* @__PURE__ */ jsx(Markdown, { md: "`" + result.format + "` is not recognized as a format in this application." }),
18
- /* @__PURE__ */ jsx(JSONViewer, { data: result, collapse: true, forceCompact: true })
19
- ] });
20
- };
1
+ import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
+ import { Stack as f } from "@mui/material";
3
+ import { J as t } from "../../../index-BK-zfYhR.js";
4
+ import a from "../../display/markdown/index.js";
5
+ import i from "./FileResult.js";
6
+ const u = ({ result: o }) => o.format === "markdown" ? /* @__PURE__ */ r(a, { md: o.output }) : o.format === "json" ? /* @__PURE__ */ r(t, { data: o.output, collapse: !0, forceCompact: !0 }) : o.format === "file" ? /* @__PURE__ */ r(i, { result: o }) : /* @__PURE__ */ m(f, { sx: { overflowY: "auto" }, children: [
7
+ /* @__PURE__ */ r(a, { md: "`" + o.format + "` is not recognized as a format in this application." }),
8
+ /* @__PURE__ */ r(t, { data: o, collapse: !0, forceCompact: !0 })
9
+ ] });
21
10
  export {
22
- Result as default
11
+ u as default
23
12
  };
@@ -1,18 +1,18 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { IconButton } from "@mui/material";
3
- const ExpandMoreButton = (props) => {
4
- const { expand, ...other } = props;
5
- return /* @__PURE__ */ jsx(
6
- IconButton,
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { IconButton as a } from "@mui/material";
3
+ const m = (t) => {
4
+ const { expand: o, ...r } = t;
5
+ return /* @__PURE__ */ e(
6
+ a,
7
7
  {
8
- ...other,
8
+ ...r,
9
9
  sx: {
10
- transform: !expand ? "rotate(0deg)" : "rotate(180deg)",
11
- transition: (theme) => theme.transitions.create("transform")
10
+ transform: o ? "rotate(180deg)" : "rotate(0deg)",
11
+ transition: (n) => n.transitions.create("transform")
12
12
  }
13
13
  }
14
14
  );
15
15
  };
16
16
  export {
17
- ExpandMoreButton as default
17
+ m as default
18
18
  };
@@ -1,111 +1,91 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { Stack, Typography, Card, CardContent, Divider, Collapse } from "@mui/material";
3
- import { a as isPlainObject, f as flatten$1 } from "../../../../utils-HmNPuoDB.js";
4
- import { cssImportant } from "../../../../utils/graph.js";
5
- import { b as baseGet, c as castPath, t as toKey, a as arrayMap } from "../../../../_baseGet-Bx3A4Qfp.js";
6
- import { c as copyObject, g as getAllKeysIn, b as baseClone } from "../../../../_baseClone-CkNrTyhm.js";
7
- import { l as last } from "../../../../last-CUCl67Im.js";
8
- import { b as baseSlice } from "../../../../_baseSlice-GAv_YFTT.js";
9
- import { b as baseFlatten, s as setToString, o as overRest } from "../../../../_baseFlatten-jIR_sN_-.js";
10
- import { useState, useEffect, useCallback, Fragment as Fragment$1 } from "react";
11
- import Iconified from "../../icons/Iconified.js";
12
- import { J as JSONViewer } from "../../../../index-JcKyZeoY.js";
13
- import Markdown from "../../markdown/index.js";
14
- import ExpandMoreButton from "../ExpandMoreButton.js";
15
- import NodeTag from "./NodeTag.js";
16
- function flatten(array) {
17
- var length = array == null ? 0 : array.length;
18
- return length ? baseFlatten(array) : [];
1
+ import { jsxs as l, jsx as n, Fragment as b } from "react/jsx-runtime";
2
+ import { Stack as c, Typography as g, Card as C, CardContent as w, Divider as m, Collapse as _ } from "@mui/material";
3
+ import { a as E, f as O } from "../../../../utils-DmwSUrum.js";
4
+ import { cssImportant as d } from "../../../../utils/graph.js";
5
+ import { b as S, c as v, t as k, a as A } from "../../../../_baseGet-DSZygzyq.js";
6
+ import { c as I, g as L, b as F } from "../../../../_baseClone-BnT-6pyM.js";
7
+ import { l as N } from "../../../../last-7CdUxN0r.js";
8
+ import { b as P } from "../../../../_baseSlice-M5RKzt1A.js";
9
+ import { b as D, s as M, o as G } from "../../../../_baseFlatten-Bfr_Molw.js";
10
+ import { useState as x, useEffect as T, useCallback as z, Fragment as B } from "react";
11
+ import R from "../../icons/Iconified.js";
12
+ import { J } from "../../../../index-BK-zfYhR.js";
13
+ import K from "../../markdown/index.js";
14
+ import $ from "../ExpandMoreButton.js";
15
+ import h from "./NodeTag.js";
16
+ function U(e) {
17
+ var t = e == null ? 0 : e.length;
18
+ return t ? D(e) : [];
19
19
  }
20
- function flatRest(func) {
21
- return setToString(overRest(func, void 0, flatten), func + "");
20
+ function V(e) {
21
+ return M(G(e, void 0, U), e + "");
22
22
  }
23
- function parent(object, path) {
24
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
23
+ function Y(e, t) {
24
+ return t.length < 2 ? e : S(e, P(t, 0, -1));
25
25
  }
26
- var objectProto = Object.prototype;
27
- var hasOwnProperty = objectProto.hasOwnProperty;
28
- function baseUnset(object, path) {
29
- path = castPath(path, object);
30
- var index = -1, length = path.length;
31
- if (!length) {
32
- return true;
33
- }
34
- var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
35
- while (++index < length) {
36
- var key = path[index];
37
- if (typeof key !== "string") {
38
- continue;
39
- }
40
- if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) {
41
- return false;
42
- }
43
- if (key === "constructor" && index + 1 < length && typeof path[index + 1] === "string" && path[index + 1] === "prototype") {
44
- if (isRootPrimitive && index === 0) {
45
- continue;
26
+ var j = Object.prototype, q = j.hasOwnProperty;
27
+ function H(e, t) {
28
+ t = v(t, e);
29
+ var r = -1, i = t.length;
30
+ if (!i)
31
+ return !0;
32
+ for (var o = e == null || typeof e != "object" && typeof e != "function"; ++r < i; ) {
33
+ var a = t[r];
34
+ if (typeof a == "string") {
35
+ if (a === "__proto__" && !q.call(e, "__proto__"))
36
+ return !1;
37
+ if (a === "constructor" && r + 1 < i && typeof t[r + 1] == "string" && t[r + 1] === "prototype") {
38
+ if (o && r === 0)
39
+ continue;
40
+ return !1;
46
41
  }
47
- return false;
48
42
  }
49
43
  }
50
- var obj = parent(object, path);
51
- return obj == null || delete obj[toKey(last(path))];
44
+ var s = Y(e, t);
45
+ return s == null || delete s[k(N(t))];
52
46
  }
53
- function customOmitClone(value) {
54
- return isPlainObject(value) ? void 0 : value;
47
+ function Q(e) {
48
+ return E(e) ? void 0 : e;
55
49
  }
56
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
57
- var omit = flatRest(function(object, paths) {
58
- var result = {};
59
- if (object == null) {
60
- return result;
61
- }
62
- var isDeep = false;
63
- paths = arrayMap(paths, function(path) {
64
- path = castPath(path, object);
65
- isDeep || (isDeep = path.length > 1);
66
- return path;
67
- });
68
- copyObject(object, getAllKeysIn(object), result);
69
- if (isDeep) {
70
- result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
71
- }
72
- var length = paths.length;
73
- while (length--) {
74
- baseUnset(result, paths[length]);
75
- }
76
- return result;
50
+ var W = 1, X = 2, Z = 4, ee = V(function(e, t) {
51
+ var r = {};
52
+ if (e == null)
53
+ return r;
54
+ var i = !1;
55
+ t = A(t, function(a) {
56
+ return a = v(a, e), i || (i = a.length > 1), a;
57
+ }), I(e, L(e), r), i && (r = F(r, W | X | Z, Q));
58
+ for (var o = t.length; o--; )
59
+ H(r, t[o]);
60
+ return r;
77
61
  });
78
- const NodeCard = ({ node, sx = {} }) => {
79
- var _a;
80
- const [expanded, setExpanded] = useState(false);
81
- const [nodeExtraData, setNodeExtraData] = useState();
82
- const handleExpandClick = () => {
83
- setExpanded(!expanded);
62
+ const xe = ({ node: e, sx: t = {} }) => {
63
+ var u;
64
+ const [r, i] = x(!1), [o, a] = x(), s = () => {
65
+ i(!r);
84
66
  };
85
- useEffect(() => {
86
- setNodeExtraData(omit(node, ["id", "edges"]));
87
- }, [node]);
88
- const renderEdgeList = useCallback((edgeIds) => {
89
- return /* @__PURE__ */ jsxs(Stack, { alignSelf: "stretch", children: [
90
- /* @__PURE__ */ jsx(Typography, { textAlign: "left", variant: "body2", color: "text.secondary", children: "Edges" }),
91
- /* @__PURE__ */ jsx(Stack, { spacing: 0.25, children: edgeIds.map((edgeId) => /* @__PURE__ */ jsx(NodeTag, { nodeId: edgeId }, edgeId)) })
92
- ] });
93
- }, []);
94
- return /* @__PURE__ */ jsx(
95
- Card,
67
+ T(() => {
68
+ a(ee(e, ["id", "edges"]));
69
+ }, [e]);
70
+ const y = z((f) => /* @__PURE__ */ l(c, { alignSelf: "stretch", children: [
71
+ /* @__PURE__ */ n(g, { textAlign: "left", variant: "body2", color: "text.secondary", children: "Edges" }),
72
+ /* @__PURE__ */ n(c, { spacing: 0.25, children: f.map((p) => /* @__PURE__ */ n(h, { nodeId: p }, p)) })
73
+ ] }), []);
74
+ return /* @__PURE__ */ n(
75
+ C,
96
76
  {
97
77
  variant: "outlined",
98
78
  sx: {
99
79
  position: "relative",
100
80
  overflow: "auto",
101
- zIndex: expanded ? 100 : "initial",
81
+ zIndex: r ? 100 : "initial",
102
82
  "& *": {
103
83
  opacity: 1
104
84
  },
105
- ...sx
85
+ ...t
106
86
  },
107
- children: /* @__PURE__ */ jsx(CardContent, { sx: { p: 1 }, children: /* @__PURE__ */ jsxs(
108
- Stack,
87
+ children: /* @__PURE__ */ n(w, { sx: { p: 1 }, children: /* @__PURE__ */ l(
88
+ c,
109
89
  {
110
90
  spacing: 1,
111
91
  sx: {
@@ -116,44 +96,44 @@ const NodeCard = ({ node, sx = {} }) => {
116
96
  }
117
97
  },
118
98
  children: [
119
- /* @__PURE__ */ jsx(NodeTag, { nodeId: node.id, label: node.id, type: "header", children: /* @__PURE__ */ jsx(
120
- ExpandMoreButton,
99
+ /* @__PURE__ */ n(h, { nodeId: e.id, label: e.id, type: "header", children: /* @__PURE__ */ n(
100
+ $,
121
101
  {
122
- expand: expanded,
123
- onClick: handleExpandClick,
124
- "aria-expanded": expanded,
102
+ expand: r,
103
+ onClick: s,
104
+ "aria-expanded": r,
125
105
  "aria-label": "show more",
126
106
  size: "small",
127
- children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-expand-more", fontSize: "medium" })
107
+ children: /* @__PURE__ */ n(R, { icon: "ic:baseline-expand-more", fontSize: "medium" })
128
108
  }
129
109
  ) }),
130
- node.markdown && /* @__PURE__ */ jsxs(Fragment, { children: [
131
- /* @__PURE__ */ jsx(Divider, { flexItem: true }),
132
- /* @__PURE__ */ jsx(Markdown, { md: node.markdown, components: flatten$1(node) })
110
+ e.markdown && /* @__PURE__ */ l(b, { children: [
111
+ /* @__PURE__ */ n(m, { flexItem: !0 }),
112
+ /* @__PURE__ */ n(K, { md: e.markdown, components: O(e) })
133
113
  ] }),
134
- !!((_a = node == null ? void 0 : node.edges) == null ? void 0 : _a.length) && /* @__PURE__ */ jsxs(Fragment$1, { children: [
135
- /* @__PURE__ */ jsx(Divider, { flexItem: true }),
136
- renderEdgeList(node == null ? void 0 : node.edges)
114
+ !!((u = e == null ? void 0 : e.edges) != null && u.length) && /* @__PURE__ */ l(B, { children: [
115
+ /* @__PURE__ */ n(m, { flexItem: !0 }),
116
+ y(e == null ? void 0 : e.edges)
137
117
  ] }),
138
- /* @__PURE__ */ jsx(Collapse, { in: expanded, timeout: "auto", children: /* @__PURE__ */ jsxs(
139
- Stack,
118
+ /* @__PURE__ */ n(_, { in: r, timeout: "auto", children: /* @__PURE__ */ l(
119
+ c,
140
120
  {
141
121
  justifyContent: "start",
142
122
  alignItems: "start",
143
123
  spacing: 1,
144
- sx: (theme) => ({
124
+ sx: (f) => ({
145
125
  "& > ul": {
146
126
  width: "100%",
147
127
  textAlign: "left",
148
- p: cssImportant(theme.spacing(1)),
149
- mx: cssImportant("0"),
150
- backgroundColor: cssImportant(theme.palette.background.paper)
128
+ p: d(f.spacing(1)),
129
+ mx: d("0"),
130
+ backgroundColor: d(f.palette.background.paper)
151
131
  }
152
132
  }),
153
133
  children: [
154
- /* @__PURE__ */ jsx(Divider, { flexItem: true }),
155
- /* @__PURE__ */ jsx(Typography, { textAlign: "left", variant: "body1", children: "Metadata:" }),
156
- /* @__PURE__ */ jsx(JSONViewer, { data: nodeExtraData })
134
+ /* @__PURE__ */ n(m, { flexItem: !0 }),
135
+ /* @__PURE__ */ n(g, { textAlign: "left", variant: "body1", children: "Metadata:" }),
136
+ /* @__PURE__ */ n(J, { data: o })
157
137
  ]
158
138
  }
159
139
  ) })
@@ -164,5 +144,5 @@ const NodeCard = ({ node, sx = {} }) => {
164
144
  );
165
145
  };
166
146
  export {
167
- NodeCard as default
147
+ xe as default
168
148
  };
@@ -1,17 +1,15 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Stack, Typography, Tooltip } from "@mui/material";
3
- import { F as FlexOne } from "../../../../FlexOne-BSYAhhtG.js";
4
- import Iconified from "../../icons/Iconified.js";
5
- const NodeTag = ({ nodeId, label = nodeId, type = "content", children }) => {
6
- return /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", pr: 1, children: [
7
- type === "header" ? /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", sx: { overflow: "hidden" }, children: [
8
- /* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { wordWrap: "break-all" }, children: label.replace(" (TRUNCATED)", "") }),
9
- label.includes("TRUNCATED") && /* @__PURE__ */ jsx(Tooltip, { title: "Field is truncated.", children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-content-cut", fontSize: "small", style: { fontSize: "0.9em" } }) })
10
- ] }) : label,
11
- /* @__PURE__ */ jsx(FlexOne, {}),
12
- children
13
- ] });
14
- };
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { Stack as t, Typography as a, Tooltip as d } from "@mui/material";
3
+ import { F as s } from "../../../../FlexOne-BXWFOd1T.js";
4
+ import l from "../../icons/Iconified.js";
5
+ const T = ({ nodeId: n, label: r = n, type: o = "content", children: c }) => /* @__PURE__ */ i(t, { direction: "row", spacing: 1, alignItems: "center", pr: 1, children: [
6
+ o === "header" ? /* @__PURE__ */ i(t, { direction: "row", spacing: 1, alignItems: "center", sx: { overflow: "hidden" }, children: [
7
+ /* @__PURE__ */ e(a, { variant: "body1", sx: { wordWrap: "break-all" }, children: r.replace(" (TRUNCATED)", "") }),
8
+ r.includes("TRUNCATED") && /* @__PURE__ */ e(d, { title: "Field is truncated.", children: /* @__PURE__ */ e(l, { icon: "ic:baseline-content-cut", fontSize: "small", style: { fontSize: "0.9em" } }) })
9
+ ] }) : r,
10
+ /* @__PURE__ */ e(s, {}),
11
+ c
12
+ ] });
15
13
  export {
16
- NodeTag as default
14
+ T as default
17
15
  };