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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/ActionForm-WIj7BfD5.js +340 -0
  2. package/AnnotationPreview-DWRDhxUB.js +140 -0
  3. package/ClueEnrichContext-CbJVBm4w.js +397 -0
  4. package/FlexOne-BXWFOd1T.js +6 -0
  5. package/_Map-DXNg_Z-q.js +54 -0
  6. package/_MapCache-Cu25RRDU.js +129 -0
  7. package/_Uint8Array-DlJCtTvG.js +102 -0
  8. package/_baseAssignValue-CUmzp727.js +20 -0
  9. package/_baseClone-BlMmRXeX.js +208 -0
  10. package/_baseExtremum-P_0akmCi.js +27 -0
  11. package/_baseFlatten-CN7vDNEQ.js +72 -0
  12. package/_baseGet-Dgf6_xCm.js +80 -0
  13. package/_baseIsEqual-Cpjtfb3Q.js +173 -0
  14. package/_baseIteratee-CP1bocOX.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-tMFmk80M.js +61 -0
  18. package/_commonjsHelpers-C6fGbg64.js +6 -0
  19. package/_createAggregator-B4Cav8ZM.js +53 -0
  20. package/_getPrototype-CHAFQYL_.js +5 -0
  21. package/_getTag-BV_UoLYG.js +90 -0
  22. package/cloneDeep-BPVpFBzJ.js +8 -0
  23. package/components/AnnotationBody.js +34 -49
  24. package/components/AnnotationDetailPopover.js +30 -36
  25. package/components/AnnotationDetails.js +94 -109
  26. package/components/AnnotationEntry.js +52 -55
  27. package/components/AnnotationPreview.js +5 -5
  28. package/components/ClassificationChip.js +23 -44
  29. package/components/CountBadge.js +26 -31
  30. package/components/EnrichedCard.js +92 -104
  31. package/components/EnrichedChip.js +109 -134
  32. package/components/EnrichedTypography.js +110 -136
  33. package/components/ErrorBoundary.js +24 -28
  34. package/components/RetryFailedEnrichments.js +9 -10
  35. package/components/SourcePicker.js +49 -57
  36. package/components/actions/ActionForm.js +4 -4
  37. package/components/actions/ExecutePopover.js +50 -64
  38. package/components/actions/ResultModal.js +34 -37
  39. package/components/actions/form/schemaAdapter.js +20 -39
  40. package/components/display/graph/ExpandMoreButton.js +10 -10
  41. package/components/display/graph/elements/NodeCard.js +76 -92
  42. package/components/display/graph/elements/NodeTag.js +13 -15
  43. package/components/display/graph/index.js +200 -258
  44. package/components/display/graph/visualizations/Leaf.js +69 -88
  45. package/components/display/graph/visualizations/cloud/index.js +81 -98
  46. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  47. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  48. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  52. package/components/display/graph/visualizations/icons/index.js +13 -14
  53. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  54. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  55. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  56. package/components/display/graph/visualizations/tree/index.js +305 -407
  57. package/components/display/icons/Iconified.js +12 -27
  58. package/components/display/json/index.js +4 -4
  59. package/components/display/markdown/DynamicTabs.js +17 -22
  60. package/components/display/markdown/index.js +5674 -8531
  61. package/components/display/markdown/markdownPlugins/tabs.js +1 -1
  62. package/components/enrichment/EnrichPopover.js +47 -55
  63. package/components/fetchers/Fetcher.js +95 -123
  64. package/components/fetchers/PreviewModal.js +17 -20
  65. package/components/fetchers/StatusChip.js +18 -22
  66. package/components/group/Entry.js +11 -13
  67. package/components/group/Group.js +10 -13
  68. package/components/group/GroupControl.js +65 -76
  69. package/components/stats/QueryStatus.js +28 -37
  70. package/countBy-DOutsa_w.js +8 -0
  71. package/data/event.js +4 -6
  72. package/database/index.js +2 -2
  73. package/debounce-DryYcbJ4.js +56 -0
  74. package/get-Bow1vKwx.js +8 -0
  75. package/groupBy-BheQYl6f.js +8 -0
  76. package/hooks/ClueActionContext.js +6 -6
  77. package/hooks/ClueComponentContext.js +23 -29
  78. package/hooks/ClueConfigProvider.js +12 -14
  79. package/hooks/ClueDatabaseContext.js +13 -19
  80. package/hooks/ClueEnrichContext.js +8 -8
  81. package/hooks/ClueFetcherContext.js +46 -74
  82. package/hooks/ClueGroupContext.js +14 -17
  83. package/hooks/CluePopupContext.js +5 -5
  84. package/hooks/ClueProvider.js +10 -12
  85. package/hooks/selectors.js +11 -22
  86. package/hooks/useAnnotations.js +32 -48
  87. package/hooks/useClue.js +4 -6
  88. package/hooks/useClueActions.js +3 -3
  89. package/hooks/useClueConfig.js +5 -5
  90. package/hooks/useClueTypeConfig.js +3 -3
  91. package/hooks/useComparator.js +435 -722
  92. package/hooks/useErrors.js +18 -22
  93. package/hooks/useMyHighlights.js +36 -66
  94. package/hooks/useMyLocalStorage.js +43 -63
  95. package/iconify-BBckr5AQ.js +1263 -0
  96. package/icons/Action.js +49 -66
  97. package/icons/Assessment.js +68 -84
  98. package/icons/Context.js +61 -75
  99. package/icons/Opinion.js +65 -77
  100. package/icons/iconMap.js +2 -2
  101. package/identity-ByMq8VxU.js +6 -0
  102. package/index-4YFAh_sa.js +358 -0
  103. package/index-E7g8cRyW.js +568 -0
  104. package/index-HuYhutsd.js +975 -0
  105. package/index-WvFmjbxF.js +12734 -0
  106. package/index-p5_wX7q1.js +11729 -0
  107. package/isEmpty-g47Qir2A.js +21 -0
  108. package/isNil-CjWwlQS3.js +6 -0
  109. package/isObject-B53jY8Qg.js +7 -0
  110. package/isObjectLike-BatpeCIi.js +29 -0
  111. package/isSymbol-C3_SC0Qp.js +8 -0
  112. package/isUndefined-DiNCDKoz.js +10 -0
  113. package/last-7CdUxN0r.js +7 -0
  114. package/main.js +68 -68
  115. package/package.json +1 -1
  116. package/sortBy-ITdmD17L.js +79 -0
  117. package/sumBy-DxJUU2E8.js +8 -0
  118. package/tabs-CgADNA57.js +195 -0
  119. package/text/Frequency.js +23 -42
  120. package/toFinite-BMy6GObD.js +14 -0
  121. package/toNumber-YVhnnJv4.js +31 -0
  122. package/useClueTypeConfig-BQ33EiyB.js +2273 -0
  123. package/utils/chain.js +64 -91
  124. package/utils/classificationParser.js +254 -504
  125. package/utils/constants.js +10 -35
  126. package/utils/graph.js +45 -72
  127. package/utils/hashUtil.js +7 -7
  128. package/utils/line.js +81 -131
  129. package/utils/loggerUtil.js +3 -5
  130. package/utils/sessionStorage.js +29 -41
  131. package/utils/utils.js +9 -9
  132. package/utils/window.js +10 -21
  133. package/utils-C_RX5uMP.js +2704 -0
  134. package/ActionForm-c5hLIfQ-.js +0 -436
  135. package/AnnotationPreview-BvNpZOP0.js +0 -188
  136. package/ClueEnrichContext-m-4vn9rz.js +0 -518
  137. package/FlexOne-BSYAhhtG.js +0 -9
  138. package/_Map-kgDsDYxq.js +0 -64
  139. package/_MapCache-DabaaWfq.js +0 -161
  140. package/_Uint8Array-BlVVH1tp.js +0 -129
  141. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  142. package/_baseClone-D3a8Pa4T.js +0 -284
  143. package/_baseExtremum-B1o1zHjR.js +0 -33
  144. package/_baseFlatten-D4huXoEI.js +0 -92
  145. package/_baseGet-BSK_nnoz.js +0 -109
  146. package/_baseIsEqual-B5xLoweL.js +0 -238
  147. package/_baseIteratee-p6Nj07-n.js +0 -126
  148. package/_baseSlice-GAv_YFTT.js +0 -20
  149. package/_baseSum-D0WC1dN0.js +0 -13
  150. package/_baseUniq-CpupKWcL.js +0 -89
  151. package/_commonjsHelpers-CUmg6egw.js +0 -6
  152. package/_createAggregator-BpVy5xMi.js +0 -63
  153. package/_getPrototype-D1LAdQKO.js +0 -5
  154. package/_getTag-D3ToyefI.js +0 -126
  155. package/cloneDeep-CjP5k9zW.js +0 -8
  156. package/countBy-C69WslUA.js +0 -14
  157. package/debounce-bV0h5FC5.js +0 -92
  158. package/get-D3C3lEU3.js +0 -8
  159. package/groupBy-DC2oOuBN.js +0 -14
  160. package/iconify-CXMreGTg.js +0 -1782
  161. package/identity-CPGTqrE4.js +0 -6
  162. package/index-BDVjGvMI.js +0 -696
  163. package/index-BDrtH5ec.js +0 -465
  164. package/index-BbPn6-Mw.js +0 -15750
  165. package/index-C9lySIVX.js +0 -1172
  166. package/index-Dn2NHyXg.js +0 -17654
  167. package/isEmpty-BQkZubqU.js +0 -29
  168. package/isNil-CIubwp4T.js +0 -6
  169. package/isObject-FTY-5JQX.js +0 -7
  170. package/isObjectLike-OAgjjZye.js +0 -48
  171. package/isSymbol-Xd2FsJyp.js +0 -8
  172. package/isUndefined-CE8h73dH.js +0 -10
  173. package/last-CUCl67Im.js +0 -7
  174. package/sortBy-B-UKp4GT.js +0 -100
  175. package/sumBy-MYkDPHZL.js +0 -8
  176. package/tabs-xGuUGsJd.js +0 -254
  177. package/toFinite-Bc55msYj.js +0 -16
  178. package/toNumber-DPxy1FBy.js +0 -39
  179. package/useClueTypeConfig-D4zcy8Gr.js +0 -3184
  180. package/utils-CxIhC2xH.js +0 -4182
@@ -1,252 +1,194 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useMemo, useRef, useState, useEffect, useCallback, createElement } from "react";
3
- import { useTheme, lighten, darken, Stack, Card, Typography, alpha, Autocomplete, TextField, FormControl, InputLabel, Select, MenuItem, IconButton, Collapse } from "@mui/material";
4
- import { p as parseEvent } from "../../../index-BDrtH5ec.js";
5
- import { z as zoom, i as identity, s as select, t as transform, p as pointer } from "../../../index-BbPn6-Mw.js";
6
- import useComparator from "../../../hooks/useComparator.js";
7
- import { useMyLocalStorageItem } from "../../../hooks/useMyLocalStorage.js";
8
- import { StorageKey } from "../../../utils/constants.js";
9
- import { g as get } from "../../../get-D3C3lEU3.js";
10
- import { cssImportant } from "../../../utils/graph.js";
11
- import Iconified from "../icons/Iconified.js";
12
- import ExpandMoreButton from "./ExpandMoreButton.js";
13
- import Cloud from "./visualizations/cloud/index.js";
14
- import NodePanel from "./visualizations/panels/NodePanel.js";
15
- import Tree from "./visualizations/tree/index.js";
16
- const Graph = ({ graph, sx = {} }) => {
17
- var _a, _b, _c, _d, _e;
18
- const theme = useTheme();
19
- const isDark = useMemo(() => theme.palette.mode === "dark", [theme]);
20
- const { runComparator } = useComparator();
21
- const svgRef = useRef();
22
- const pointRef = useRef();
23
- const [showMousePos] = useMyLocalStorageItem(StorageKey.SHOW_MOUSE_POS, false);
24
- const [showCoordinates] = useMyLocalStorageItem(StorageKey.SHOW_COORDINATES, false);
25
- const [panelLocation] = useMyLocalStorageItem(StorageKey.PANEL_LOCATION, "vertical");
26
- const [relativeMousePos, setRelativeMousePos] = useState(["0", "0"]);
27
- const [absoluteMousePos, setAbsoluteMousePos] = useState(["0", "0"]);
28
- const [showPanel, setShowPanel] = useState(false);
29
- const nodeIds = useMemo(() => ((graph == null ? void 0 : graph.data) ?? []).flat(2).map((node) => node.id), [graph == null ? void 0 : graph.data]);
30
- const zoom$1 = useMemo(() => zoom().scaleExtent([0.1, 6]), []);
31
- const [currentZoom, setCurrentZoom] = useState(identity);
32
- const [nodeId, setNodeId] = useState("");
33
- const [selectedNodeIds, setSelectedNodeIds] = useState([]);
34
- const [viz, setViz] = useState(
35
- ((_b = (_a = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a.visualization) == null ? void 0 : _b.type) ?? "tree"
36
- );
37
- const [hasError, setHasError] = useState(false);
38
- useEffect(() => {
39
- setShowPanel(selectedNodeIds.length > 0);
40
- }, [selectedNodeIds]);
41
- const labelKeys = useMemo(
1
+ import { jsx as i, jsxs as l, Fragment as ye } from "react/jsx-runtime";
2
+ import { useMemo as m, useRef as ee, useState as u, useEffect as z, useCallback as f, createElement as ke } from "react";
3
+ import { useTheme as we, lighten as te, darken as oe, Stack as x, Card as R, Typography as Ce, alpha as ne, Autocomplete as ze, TextField as he, FormControl as Se, InputLabel as Ee, Select as Ie, MenuItem as Ne, IconButton as Oe, Collapse as Me } from "@mui/material";
4
+ import { p as Pe } from "../../../index-4YFAh_sa.js";
5
+ import { z as Fe, i as M, s as p, t as Re, p as ie } from "../../../index-p5_wX7q1.js";
6
+ import Te from "../../../hooks/useComparator.js";
7
+ import { useMyLocalStorageItem as T } from "../../../hooks/useMyLocalStorage.js";
8
+ import { StorageKey as L } from "../../../utils/constants.js";
9
+ import { g as Le } from "../../../get-Bow1vKwx.js";
10
+ import { cssImportant as k } from "../../../utils/graph.js";
11
+ import ae from "../icons/Iconified.js";
12
+ import Ae from "./ExpandMoreButton.js";
13
+ import Be from "./visualizations/cloud/index.js";
14
+ import $e from "./visualizations/panels/NodePanel.js";
15
+ import je from "./visualizations/tree/index.js";
16
+ const et = ({ graph: t, sx: re = {} }) => {
17
+ var X, Z, U, Y, q;
18
+ const o = we(), h = m(() => o.palette.mode === "dark", [o]), { runComparator: A } = Te(), r = ee(), se = ee(), [P] = T(L.SHOW_MOUSE_POS, !1), [w] = T(L.SHOW_COORDINATES, !1), [S] = T(L.PANEL_LOCATION, "vertical"), [le, ce] = u(["0", "0"]), [de, me] = u(["0", "0"]), [E, B] = u(!1), $ = m(() => ((t == null ? void 0 : t.data) ?? []).flat(2).map((e) => e.id), [t == null ? void 0 : t.data]), v = m(() => Fe().scaleExtent([0.1, 6]), []), [s, I] = u(M), [N, ue] = u(""), [C, j] = u([]), [O, H] = u(
19
+ ((Z = (X = t == null ? void 0 : t.metadata.display) == null ? void 0 : X.visualization) == null ? void 0 : Z.type) ?? "tree"
20
+ ), [pe, F] = u(!1);
21
+ z(() => {
22
+ B(C.length > 0);
23
+ }, [C]);
24
+ const b = m(
42
25
  () => {
43
- var _a2, _b2;
44
- return (_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.displayField) == null ? void 0 : _b2.filter((entry) => (entry.zoom ?? Number.MAX_SAFE_INTEGER) > currentZoom.k);
26
+ var e, n;
27
+ return (n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.displayField) == null ? void 0 : n.filter((a) => (a.zoom ?? Number.MAX_SAFE_INTEGER) > s.k);
45
28
  },
46
- [(_c = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _c.displayField, currentZoom.k]
47
- );
48
- const onNodeChange = useCallback((node) => {
49
- setNodeId(node);
50
- }, []);
51
- const checkForNode = useCallback((_nodeId) => {
52
- const selector = _nodeId === "view" ? _nodeId : `node-${_nodeId ?? "will\\%never\\$ever\\*exist"}`;
53
- return select(`#${selector}`);
54
- }, []);
55
- const selectNode = useCallback(() => {
56
- if (!nodeId) {
57
- setHasError(true);
29
+ [(U = t == null ? void 0 : t.metadata.display) == null ? void 0 : U.displayField, s.k]
30
+ ), fe = f((e) => {
31
+ ue(e);
32
+ }, []), V = f((e) => {
33
+ const n = e === "view" ? e : `node-${e ?? "will\\%never\\$ever\\*exist"}`;
34
+ return p(`#${n}`);
35
+ }, []), _ = f(() => {
36
+ if (!N) {
37
+ F(!0);
58
38
  return;
59
39
  }
60
- const nodeToGet = checkForNode(nodeId.replace(/[^A-Za-z0-9]*/g, ""));
61
- if (nodeToGet.empty()) {
62
- setHasError(true);
40
+ const e = V(N.replace(/[^A-Za-z0-9]*/g, ""));
41
+ if (e.empty()) {
42
+ F(!0);
63
43
  return;
64
44
  }
65
- setHasError(false);
66
- setSelectedNodeIds([nodeId]);
67
- const clientRect = svgRef.current.getBoundingClientRect();
68
- const svg = select(svgRef.current);
69
- const box = nodeToGet.node().getBBox();
70
- svg.transition().duration(500).call(
71
- zoom$1.transform,
72
- identity.translate(clientRect.width / 2, clientRect.height / 2).scale(4).translate(-box.x, -box.y)
45
+ F(!1), j([N]);
46
+ const n = r.current.getBoundingClientRect(), a = p(r.current), d = e.node().getBBox();
47
+ a.transition().duration(500).call(
48
+ v.transform,
49
+ M.translate(n.width / 2, n.height / 2).scale(4).translate(-d.x, -d.y)
73
50
  );
74
- }, [checkForNode, nodeId, zoom$1.transform]);
75
- const onKeyPress = useCallback(
76
- (event) => {
77
- const parsedEvent = parseEvent(event);
78
- if (parsedEvent.isCtrl && parsedEvent.isEnter) {
79
- selectNode();
80
- }
51
+ }, [V, N, v.transform]), xe = f(
52
+ (e) => {
53
+ const n = Pe(e);
54
+ n.isCtrl && n.isEnter && _();
81
55
  },
82
- [selectNode]
83
- );
84
- const findNode = useCallback((id) => ((graph == null ? void 0 : graph.data) ?? []).flat().find((n) => n.id === id), [graph == null ? void 0 : graph.data]);
85
- const resetZoom = useCallback(
86
- (instant = false) => {
87
- if (!graph) {
56
+ [_]
57
+ ), ve = f((e) => ((t == null ? void 0 : t.data) ?? []).flat().find((n) => n.id === e), [t == null ? void 0 : t.data]), g = f(
58
+ (e = !1) => {
59
+ if (!t)
88
60
  return;
89
- }
90
- const box = select(svgRef.current).select("#view").node().getBBox();
91
- const clientRect = svgRef.current.getBoundingClientRect();
92
- const zoomLevel = Math.min(clientRect.width / (box.width + 25), (clientRect.height - 96) / box.height);
93
- let selection = select(svgRef.current);
94
- if (!instant) {
95
- selection = selection.transition().duration(500);
96
- }
97
- selection.call(
98
- zoom$1.transform,
99
- identity.translate(clientRect.width / 2, (clientRect.height + 96) / 2).scale(zoomLevel).translate(-box.width / 2, -box.height / 2 - 10)
61
+ const n = p(r.current).select("#view").node().getBBox(), a = r.current.getBoundingClientRect(), d = Math.min(a.width / (n.width + 25), (a.height - 96) / n.height);
62
+ let y = p(r.current);
63
+ e || (y = y.transition().duration(500)), y.call(
64
+ v.transform,
65
+ M.translate(a.width / 2, (a.height + 96) / 2).scale(d).translate(-n.width / 2, -n.height / 2 - 10)
100
66
  );
101
67
  },
102
- [zoom$1.transform, graph]
103
- );
104
- const onNodeSelectionChanged = useCallback((_nodeIds) => setSelectedNodeIds(_nodeIds), []);
105
- useEffect(() => {
106
- if (!graph) {
107
- return;
108
- }
109
- pointRef.current = svgRef.current.createSVGPoint();
110
- select(svgRef.current).call(
111
- zoom$1.on("zoom", (event) => {
112
- setCurrentZoom == null ? void 0 : setCurrentZoom(event.transform);
113
- select(svgRef.current).select("#view").attr("transform", event.transform);
68
+ [v.transform, t]
69
+ ), D = f((e) => j(e), []);
70
+ z(() => {
71
+ t && (se.current = r.current.createSVGPoint(), p(r.current).call(
72
+ v.on("zoom", (e) => {
73
+ I == null || I(e.transform), p(r.current).select("#view").attr("transform", e.transform);
114
74
  })
115
- );
116
- }, [setCurrentZoom, zoom$1, viz, graph]);
117
- useEffect(() => {
118
- if (showMousePos) {
119
- select(svgRef.current).on("mousemove", (event) => {
120
- const _zoom = transform(select(svgRef.current).select("#view").node());
121
- setAbsoluteMousePos(_zoom.invert(pointer(event)).map((n) => n.toFixed(0)));
122
- setRelativeMousePos(pointer(event).map((n) => n.toFixed(0)));
123
- });
124
- }
125
- }, [showMousePos, graph]);
126
- useEffect(() => {
127
- resetZoom();
128
- }, [viz, graph == null ? void 0 : graph.data]);
129
- useEffect(() => {
130
- var _a2, _b2, _c2, _d2;
131
- if ((_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.visualization) == null ? void 0 : _b2.type) {
132
- setViz((_d2 = (_c2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _c2.visualization) == null ? void 0 : _d2.type);
133
- }
134
- }, [(_e = (_d = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _d.visualization) == null ? void 0 : _e.type]);
135
- const treeOptions = useMemo(
75
+ ));
76
+ }, [I, v, O, t]), z(() => {
77
+ P && p(r.current).on("mousemove", (e) => {
78
+ const n = Re(p(r.current).select("#view").node());
79
+ me(n.invert(ie(e)).map((a) => a.toFixed(0))), ce(ie(e).map((a) => a.toFixed(0)));
80
+ });
81
+ }, [P, t]), z(() => {
82
+ g();
83
+ }, [O, t == null ? void 0 : t.data]), z(() => {
84
+ var e, n, a, d;
85
+ (n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.visualization) != null && n.type && H((d = (a = t == null ? void 0 : t.metadata.display) == null ? void 0 : a.visualization) == null ? void 0 : d.type);
86
+ }, [(q = (Y = t == null ? void 0 : t.metadata.display) == null ? void 0 : Y.visualization) == null ? void 0 : q.type]);
87
+ const G = m(
136
88
  () => ({
137
- textColor: theme.palette.text.primary,
138
- backgroundColor: theme.palette.background.paper,
89
+ textColor: o.palette.text.primary,
90
+ backgroundColor: o.palette.background.paper,
139
91
  nodeColor: {
140
- border: (isDark ? lighten : darken)(theme.palette.background.paper, 0.3),
92
+ border: (h ? te : oe)(o.palette.background.paper, 0.3),
141
93
  center: "white"
142
94
  }
143
95
  }),
144
- [isDark, theme.palette.background.paper, theme.palette.text.primary]
145
- );
146
- const cloudOptions = useMemo(
96
+ [h, o.palette.background.paper, o.palette.text.primary]
97
+ ), W = m(
147
98
  () => ({
148
- textColor: theme.palette.text.primary,
149
- backgroundColor: theme.palette.background.paper,
99
+ textColor: o.palette.text.primary,
100
+ backgroundColor: o.palette.background.paper,
150
101
  nodeColor: {
151
- border: (isDark ? lighten : darken)(theme.palette.background.paper, 0.3),
102
+ border: (h ? te : oe)(o.palette.background.paper, 0.3),
152
103
  center: "white"
153
104
  }
154
105
  }),
155
- [isDark, theme.palette.background.paper, theme.palette.text.primary]
156
- );
157
- const visualizations = useMemo(
106
+ [h, o.palette.background.paper, o.palette.text.primary]
107
+ ), K = m(
158
108
  () => ({
159
- tree: () => /* @__PURE__ */ jsx(
160
- Tree,
109
+ tree: () => /* @__PURE__ */ i(
110
+ je,
161
111
  {
162
- svgRef,
163
- graph,
164
- labelKeys,
165
- onNodeSelectionChanged,
166
- zoom: currentZoom,
167
- options: treeOptions
112
+ svgRef: r,
113
+ graph: t,
114
+ labelKeys: b,
115
+ onNodeSelectionChanged: D,
116
+ zoom: s,
117
+ options: G
168
118
  }
169
119
  ),
170
- cloud: () => /* @__PURE__ */ jsx(Cloud, { svgRef, graph, options: cloudOptions })
120
+ cloud: () => /* @__PURE__ */ i(Be, { svgRef: r, graph: t, options: W })
171
121
  }),
172
- [cloudOptions, currentZoom, graph, labelKeys, onNodeSelectionChanged, treeOptions]
173
- );
174
- const suggestions = useMemo(() => {
175
- return nodeIds.flatMap((id) => {
176
- var _a2, _b2;
177
- const node = (((_a2 = graph == null ? void 0 : graph.data) == null ? void 0 : _a2.flat()) ?? []).find((_node) => _node.id === id);
178
- if (!node) {
179
- return { id, value: id };
180
- }
181
- const key = ((_b2 = labelKeys == null ? void 0 : labelKeys.filter((comparator) => runComparator(comparator, node)).pop()) == null ? void 0 : _b2.label) ?? "id";
182
- const value = key.split(",").map((_key) => {
183
- var _a3;
184
- return (_a3 = get(node, _key)) == null ? void 0 : _a3.toString();
185
- }).filter((val) => !!val).map((_value) => ({ id, value: _value.trim() }));
186
- return value;
187
- });
188
- }, [graph == null ? void 0 : graph.data, labelKeys, nodeIds, runComparator]);
189
- return /* @__PURE__ */ jsxs(
190
- Stack,
122
+ [W, s, t, b, D, G]
123
+ ), be = m(() => $.flatMap((e) => {
124
+ var y, J;
125
+ const n = (((y = t == null ? void 0 : t.data) == null ? void 0 : y.flat()) ?? []).find((c) => c.id === e);
126
+ return n ? (((J = b == null ? void 0 : b.filter((c) => A(c, n)).pop()) == null ? void 0 : J.label) ?? "id").split(",").map((c) => {
127
+ var Q;
128
+ return (Q = Le(n, c)) == null ? void 0 : Q.toString();
129
+ }).filter((c) => !!c).map((c) => ({ id: e, value: c.trim() })) : { id: e, value: e };
130
+ }), [t == null ? void 0 : t.data, b, $, A]);
131
+ return /* @__PURE__ */ l(
132
+ x,
191
133
  {
192
- direction: panelLocation === "vertical" ? "row" : "column",
134
+ direction: S === "vertical" ? "row" : "column",
193
135
  spacing: 1,
194
136
  overflow: "hidden",
195
137
  height: "100%",
196
138
  width: "100%",
197
- sx,
139
+ sx: re,
198
140
  children: [
199
- /* @__PURE__ */ jsx(Stack, { direction: "column", spacing: 1, sx: { position: "relative", flex: 1 }, children: /* @__PURE__ */ jsxs(
200
- Card,
141
+ /* @__PURE__ */ i(x, { direction: "column", spacing: 1, sx: { position: "relative", flex: 1 }, children: /* @__PURE__ */ l(
142
+ R,
201
143
  {
202
144
  variant: "outlined",
203
145
  sx: {
204
146
  flex: 1,
205
147
  position: "relative",
206
- maxHeight: `calc(100vh - 64px - ${theme.spacing(1)})`,
148
+ maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
207
149
  "& #viz": {
208
- maxHeight: `calc(100vh - 64px - ${theme.spacing(1)})`,
150
+ maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
209
151
  width: "100%",
210
152
  height: "100%",
211
- backgroundColor: theme.palette.background.paper
153
+ backgroundColor: o.palette.background.paper
212
154
  },
213
155
  "& .path": {
214
- transition: theme.transitions.create(["opacity"], {
215
- duration: theme.transitions.duration.short
156
+ transition: o.transitions.create(["opacity"], {
157
+ duration: o.transitions.duration.short
216
158
  })
217
159
  },
218
160
  "& .node": {
219
161
  cursor: "pointer",
220
162
  "& > path, & > text, & > polygon, & circle": {
221
- transition: theme.transitions.create(["stroke", "fill", "fill-opacity", "stroke-opacity"], {
222
- duration: theme.transitions.duration.short
163
+ transition: o.transitions.create(["stroke", "fill", "fill-opacity", "stroke-opacity"], {
164
+ duration: o.transitions.duration.short
223
165
  })
224
166
  },
225
167
  "&.hover > .center": {
226
- stroke: cssImportant(theme.palette.primary.main)
168
+ stroke: k(o.palette.primary.main)
227
169
  },
228
170
  "&.hover > .border": {
229
- stroke: cssImportant(theme.palette.primary.dark)
171
+ stroke: k(o.palette.primary.dark)
230
172
  },
231
173
  "&.selected > .center": {
232
- stroke: cssImportant(theme.palette.success.main)
174
+ stroke: k(o.palette.success.main)
233
175
  },
234
176
  "&.selected > .border": {
235
- stroke: cssImportant(theme.palette.success.dark)
177
+ stroke: k(o.palette.success.dark)
236
178
  },
237
179
  "&.selected.hover > .center": {
238
- stroke: cssImportant(theme.palette.primary.main)
180
+ stroke: k(o.palette.primary.main)
239
181
  },
240
182
  "&.selected.hover > .border": {
241
- stroke: cssImportant(theme.palette.primary.dark)
183
+ stroke: k(o.palette.primary.dark)
242
184
  }
243
185
  }
244
186
  },
245
187
  children: [
246
- graph ? visualizations[viz]() : /* @__PURE__ */ jsxs(Fragment, { children: [
247
- /* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, children: /* @__PURE__ */ jsx("g", { id: "view" }) }),
248
- /* @__PURE__ */ jsx(
249
- Typography,
188
+ t ? K[O]() : /* @__PURE__ */ l(ye, { children: [
189
+ /* @__PURE__ */ i("svg", { id: "viz", ref: r, children: /* @__PURE__ */ i("g", { id: "view" }) }),
190
+ /* @__PURE__ */ i(
191
+ Ce,
250
192
  {
251
193
  variant: "h1",
252
194
  color: "text.secondary",
@@ -261,19 +203,19 @@ const Graph = ({ graph, sx = {} }) => {
261
203
  }
262
204
  )
263
205
  ] }),
264
- /* @__PURE__ */ jsx(
265
- Stack,
206
+ /* @__PURE__ */ i(
207
+ x,
266
208
  {
267
209
  direction: "column",
268
210
  spacing: 1,
269
211
  sx: {
270
212
  position: "absolute",
271
- top: theme.spacing(1),
272
- left: theme.spacing(1),
273
- right: theme.spacing(1)
213
+ top: o.spacing(1),
214
+ left: o.spacing(1),
215
+ right: o.spacing(1)
274
216
  },
275
- children: /* @__PURE__ */ jsxs(
276
- Stack,
217
+ children: /* @__PURE__ */ l(
218
+ x,
277
219
  {
278
220
  direction: "row",
279
221
  spacing: 1,
@@ -281,62 +223,62 @@ const Graph = ({ graph, sx = {} }) => {
281
223
  "& > div:first-of-type": {
282
224
  flex: 1,
283
225
  maxWidth: "775px",
284
- backgroundColor: alpha(theme.palette.background.paper, 0.8)
226
+ backgroundColor: ne(o.palette.background.paper, 0.8)
285
227
  }
286
228
  },
287
229
  children: [
288
- /* @__PURE__ */ jsx(
289
- Autocomplete,
230
+ /* @__PURE__ */ i(
231
+ ze,
290
232
  {
291
- disablePortal: true,
292
- onChange: (__, value) => onNodeChange(value.id),
293
- onKeyDown: onKeyPress,
294
- options: suggestions,
233
+ disablePortal: !0,
234
+ onChange: (e, n) => fe(n.id),
235
+ onKeyDown: xe,
236
+ options: be,
295
237
  sx: { width: "400px" },
296
- getOptionLabel: (option) => option.value,
297
- filterOptions: (options, state) => options.filter((opt) => opt.value.toLowerCase().includes(state.inputValue)),
298
- renderOption: (props, option) => /* @__PURE__ */ createElement("li", { ...props, key: option.id + option.value }, option.value),
299
- renderInput: (params) => /* @__PURE__ */ jsx(
300
- TextField,
238
+ getOptionLabel: (e) => e.value,
239
+ filterOptions: (e, n) => e.filter((a) => a.value.toLowerCase().includes(n.inputValue)),
240
+ renderOption: (e, n) => /* @__PURE__ */ ke("li", { ...e, key: n.id + n.value }, n.value),
241
+ renderInput: (e) => /* @__PURE__ */ i(
242
+ he,
301
243
  {
302
- ...params,
303
- error: hasError,
244
+ ...e,
245
+ error: pe,
304
246
  label: "Enter a node ID, and press [ctrl + enter] to select it. [ctrl + space] will open an autocomplete menu."
305
247
  }
306
248
  )
307
249
  }
308
250
  ),
309
- /* @__PURE__ */ jsxs(FormControl, { sx: { minWidth: "150px", backgroundColor: alpha(theme.palette.background.paper, 0.8) }, children: [
310
- /* @__PURE__ */ jsx(InputLabel, { id: "viz-label", children: "Visualization" }),
311
- /* @__PURE__ */ jsx(
312
- Select,
251
+ /* @__PURE__ */ l(Se, { sx: { minWidth: "150px", backgroundColor: ne(o.palette.background.paper, 0.8) }, children: [
252
+ /* @__PURE__ */ i(Ee, { id: "viz-label", children: "Visualization" }),
253
+ /* @__PURE__ */ i(
254
+ Ie,
313
255
  {
314
256
  label: "Visualization",
315
257
  labelId: "viz-label",
316
- value: viz,
317
- onChange: (event) => setViz(event.target.value),
258
+ value: O,
259
+ onChange: (e) => H(e.target.value),
318
260
  sx: { textTransform: "capitalize" },
319
- children: Object.keys(visualizations).map((_viz) => /* @__PURE__ */ jsx(MenuItem, { value: _viz, sx: { textTransform: "capitalize" }, children: _viz }, _viz))
261
+ children: Object.keys(K).map((e) => /* @__PURE__ */ i(Ne, { value: e, sx: { textTransform: "capitalize" }, children: e }, e))
320
262
  }
321
263
  )
322
264
  ] }),
323
- /* @__PURE__ */ jsx(
324
- ExpandMoreButton,
265
+ /* @__PURE__ */ i(
266
+ Ae,
325
267
  {
326
- disabled: selectedNodeIds.length < 1,
327
- expand: showPanel,
328
- onClick: () => setShowPanel(!showPanel),
329
- "aria-expanded": showPanel,
268
+ disabled: C.length < 1,
269
+ expand: E,
270
+ onClick: () => B(!E),
271
+ "aria-expanded": E,
330
272
  "aria-label": "show more",
331
273
  size: "small",
332
274
  sx: {
333
275
  marginLeft: "auto !important",
334
276
  alignSelf: "center"
335
277
  },
336
- children: /* @__PURE__ */ jsx(
337
- Iconified,
278
+ children: /* @__PURE__ */ i(
279
+ ae,
338
280
  {
339
- icon: panelLocation === "vertical" ? "ic:baseline-chevron-left" : "ic:baseline-expand-more",
281
+ icon: S === "vertical" ? "ic:baseline-chevron-left" : "ic:baseline-expand-more",
340
282
  fontSize: "medium"
341
283
  }
342
284
  )
@@ -347,61 +289,61 @@ const Graph = ({ graph, sx = {} }) => {
347
289
  )
348
290
  }
349
291
  ),
350
- /* @__PURE__ */ jsx(
351
- Card,
292
+ /* @__PURE__ */ i(
293
+ R,
352
294
  {
353
- variant: showCoordinates ? "elevation" : "outlined",
354
- elevation: showCoordinates ? 4 : 0,
295
+ variant: w ? "elevation" : "outlined",
296
+ elevation: w ? 4 : 0,
355
297
  sx: {
356
298
  position: "absolute",
357
- bottom: theme.spacing(0.5),
358
- right: theme.spacing(0.5),
299
+ bottom: o.spacing(0.5),
300
+ right: o.spacing(0.5),
359
301
  px: 1,
360
302
  py: 0.5,
361
303
  border: "none !important"
362
304
  },
363
- children: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 0.5, alignItems: "center", children: [
364
- showCoordinates && /* @__PURE__ */ jsxs("span", { children: [
365
- currentZoom.x.toFixed(0),
305
+ children: /* @__PURE__ */ l(x, { direction: "row", spacing: 0.5, alignItems: "center", children: [
306
+ w && /* @__PURE__ */ l("span", { children: [
307
+ s.x.toFixed(0),
366
308
  ", ",
367
- currentZoom.y.toFixed(0),
309
+ s.y.toFixed(0),
368
310
  " (",
369
- currentZoom.k.toFixed(2),
311
+ s.k.toFixed(2),
370
312
  "x)"
371
313
  ] }),
372
- /* @__PURE__ */ jsx(
373
- IconButton,
314
+ /* @__PURE__ */ i(
315
+ Oe,
374
316
  {
375
- size: showCoordinates ? "small" : "medium",
376
- onClick: () => resetZoom(),
377
- disabled: currentZoom.k === identity.k && currentZoom.x === 0 && currentZoom.y === 0,
378
- children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-refresh", fontSize: showCoordinates ? "small" : "medium" })
317
+ size: w ? "small" : "medium",
318
+ onClick: () => g(),
319
+ disabled: s.k === M.k && s.x === 0 && s.y === 0,
320
+ children: /* @__PURE__ */ i(ae, { icon: "ic:baseline-refresh", fontSize: w ? "small" : "medium" })
379
321
  }
380
322
  )
381
323
  ] })
382
324
  }
383
325
  ),
384
- showMousePos && /* @__PURE__ */ jsx(
385
- Card,
326
+ P && /* @__PURE__ */ i(
327
+ R,
386
328
  {
387
329
  variant: "elevation",
388
330
  elevation: 4,
389
331
  sx: {
390
332
  position: "absolute",
391
- bottom: theme.spacing(0.5),
392
- left: theme.spacing(0.5),
333
+ bottom: o.spacing(0.5),
334
+ left: o.spacing(0.5),
393
335
  px: 1,
394
336
  py: 0.5
395
337
  },
396
- children: /* @__PURE__ */ jsx("code", { children: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
397
- /* @__PURE__ */ jsxs("span", { children: [
338
+ children: /* @__PURE__ */ i("code", { children: /* @__PURE__ */ l(x, { direction: "row", spacing: 1, children: [
339
+ /* @__PURE__ */ l("span", { children: [
398
340
  "(abs: ",
399
- absoluteMousePos.join(", "),
341
+ de.join(", "),
400
342
  ")"
401
343
  ] }),
402
- /* @__PURE__ */ jsxs("span", { children: [
344
+ /* @__PURE__ */ l("span", { children: [
403
345
  "(rel: ",
404
- relativeMousePos.join(", "),
346
+ le.join(", "),
405
347
  ")"
406
348
  ] })
407
349
  ] }) })
@@ -410,21 +352,21 @@ const Graph = ({ graph, sx = {} }) => {
410
352
  ]
411
353
  }
412
354
  ) }),
413
- /* @__PURE__ */ jsx(
414
- Collapse,
355
+ /* @__PURE__ */ i(
356
+ Me,
415
357
  {
416
- in: showPanel && selectedNodeIds.length > 0,
417
- orientation: panelLocation === "vertical" ? "horizontal" : "vertical",
418
- appear: true,
419
- unmountOnExit: true,
420
- children: /* @__PURE__ */ jsx(
421
- Stack,
358
+ in: E && C.length > 0,
359
+ orientation: S === "vertical" ? "horizontal" : "vertical",
360
+ appear: !0,
361
+ unmountOnExit: !0,
362
+ children: /* @__PURE__ */ i(
363
+ x,
422
364
  {
423
365
  direction: "column",
424
366
  spacing: 1,
425
- sx: panelLocation === "vertical" ? { width: "450px", height: "100%" } : { width: "100%", height: "300px" },
367
+ sx: S === "vertical" ? { width: "450px", height: "100%" } : { width: "100%", height: "300px" },
426
368
  pb: 1,
427
- children: /* @__PURE__ */ jsx(NodePanel, { selectedNodeIds, findNode })
369
+ children: /* @__PURE__ */ i($e, { selectedNodeIds: C, findNode: ve })
428
370
  }
429
371
  )
430
372
  }
@@ -434,5 +376,5 @@ const Graph = ({ graph, sx = {} }) => {
434
376
  );
435
377
  };
436
378
  export {
437
- Graph as default
379
+ et as default
438
380
  };