@cccsaurora/clue-ui 1.2.2-dev.263 → 1.2.2

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 (183) hide show
  1. package/ActionForm-DlOXqMUx.js +4460 -0
  2. package/AnnotationDetails-Bk-p0F6h.js +160 -0
  3. package/AnnotationPreview-jzZvkCxJ.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 +117 -155
  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.js +2 -2
  89. package/hooks/useAnnotations.js +31 -47
  90. package/hooks/useClue.js +4 -6
  91. package/hooks/useClueActions.js +3 -3
  92. package/hooks/useClueConfig.js +4 -6
  93. package/hooks/useClueTypeConfig.js +3 -3
  94. package/hooks/useComparator.js +435 -722
  95. package/hooks/useErrors.js +18 -22
  96. package/hooks/useFetcherResult.js +24 -33
  97. package/hooks/useMyHighlights.js +36 -66
  98. package/hooks/useMyLocalStorage.js +37 -66
  99. package/iconify-BBckr5AQ.js +1263 -0
  100. package/icons/Action.js +49 -66
  101. package/icons/Assessment.js +69 -85
  102. package/icons/Context.js +63 -77
  103. package/icons/Opinion.js +60 -76
  104. package/icons/iconMap.js +2 -2
  105. package/identity-ByMq8VxU.js +6 -0
  106. package/index-BHAe_V9n.js +12768 -0
  107. package/index-BK-zfYhR.js +358 -0
  108. package/index-CA5CUNZO.js +975 -0
  109. package/index-Dj5C04IX.js +568 -0
  110. package/index-p5_wX7q1.js +11729 -0
  111. package/isNil-CjWwlQS3.js +6 -0
  112. package/isObject-B53jY8Qg.js +7 -0
  113. package/isObjectLike-BatpeCIi.js +29 -0
  114. package/isSymbol-C3_SC0Qp.js +8 -0
  115. package/last-7CdUxN0r.js +7 -0
  116. package/main.js +60 -60
  117. package/maxBy-Bc0dYHcO.js +8 -0
  118. package/package.json +1 -1
  119. package/sortBy-DY2JBf9n.js +75 -0
  120. package/sumBy-DuMASLPd.js +8 -0
  121. package/text/Frequency.js +23 -42
  122. package/toFinite-BMy6GObD.js +14 -0
  123. package/toNumber-YVhnnJv4.js +31 -0
  124. package/useClueTypeConfig-Ct9Ygter.js +2292 -0
  125. package/utils/chain.js +65 -92
  126. package/utils/classificationParser.js +256 -519
  127. package/utils/constants.js +10 -35
  128. package/utils/graph.js +45 -72
  129. package/utils/hashUtil.js +7 -7
  130. package/utils/line.js +81 -131
  131. package/utils/loggerUtil.js +3 -5
  132. package/utils/sessionStorage.js +27 -41
  133. package/utils/time.js +423 -423
  134. package/utils/utils.js +9 -9
  135. package/utils/window.js +10 -21
  136. package/utils-DmwSUrum.js +129 -0
  137. package/ActionForm-uDp92tN2.js +0 -5941
  138. package/AnnotationDetails-DGYfOiWm.js +0 -175
  139. package/AnnotationPreview-bHObsb3P.js +0 -188
  140. package/ClueEnrichContext-CJEJxrgs.js +0 -541
  141. package/FlexOne-BSYAhhtG.js +0 -9
  142. package/_MapCache-WmuDdwuH.js +0 -222
  143. package/_Uint8Array-B7JqpgFX.js +0 -128
  144. package/_baseAssignValue-CGTuELqU.js +0 -25
  145. package/_baseClone-CkNrTyhm.js +0 -283
  146. package/_baseExtremum-kob8QXyt.js +0 -18
  147. package/_baseFlatten-jIR_sN_-.js +0 -92
  148. package/_baseGet-Bx3A4Qfp.js +0 -108
  149. package/_baseIsEqual-C5OTWzTk.js +0 -208
  150. package/_baseIteratee-avi7MX2o.js +0 -126
  151. package/_baseSlice-GAv_YFTT.js +0 -20
  152. package/_baseSum-D0WC1dN0.js +0 -13
  153. package/_baseUniq-BI9GIHMF.js +0 -115
  154. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  155. package/_createAggregator-QD8MzKwe.js +0 -63
  156. package/_getPrototype-CU0j_POw.js +0 -5
  157. package/_getTag-Ckxxfr88.js +0 -126
  158. package/_isIterateeCall-Ds3sw2SF.js +0 -17
  159. package/_setToArray-CaPKQhcz.js +0 -33
  160. package/cloneDeep-DJrLSw8W.js +0 -8
  161. package/countBy-c6S3dvSW.js +0 -14
  162. package/debounce-bV0h5FC5.js +0 -92
  163. package/get-DSsNkRQs.js +0 -8
  164. package/groupBy-xqz-n0Vd.js +0 -14
  165. package/iconify-CXMreGTg.js +0 -1782
  166. package/identity-CPGTqrE4.js +0 -6
  167. package/index-AMfoEg_6.js +0 -696
  168. package/index-B6C2a_Lg.js +0 -1172
  169. package/index-C12gPw2W.js +0 -17698
  170. package/index-DCKkHTvx.js +0 -15750
  171. package/index-JcKyZeoY.js +0 -465
  172. package/isNil-CIubwp4T.js +0 -6
  173. package/isObject-FTY-5JQX.js +0 -7
  174. package/isObjectLike-OAgjjZye.js +0 -48
  175. package/isSymbol-Xd2FsJyp.js +0 -8
  176. package/last-CUCl67Im.js +0 -7
  177. package/maxBy-IKHzFrCS.js +0 -8
  178. package/sortBy-DfSj8IoJ.js +0 -96
  179. package/sumBy-D-hb_NY-.js +0 -8
  180. package/toFinite-Bc55msYj.js +0 -16
  181. package/toNumber-DPxy1FBy.js +0 -39
  182. package/useClueTypeConfig-Z1LFp01b.js +0 -3289
  183. package/utils-HmNPuoDB.js +0 -199
@@ -1,125 +1,106 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { i as isObjectLike, b as baseGetTag } from "../../../../isObjectLike-OAgjjZye.js";
3
- import { useState, useMemo, useCallback, useEffect } from "react";
4
- var numberTag = "[object Number]";
5
- function isNumber(value) {
6
- return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
1
+ import { jsxs as U, jsx as b } from "react/jsx-runtime";
2
+ import { i as _, b as G } from "../../../../isObjectLike-BatpeCIi.js";
3
+ import { useState as N, useMemo as Z, useCallback as M, useEffect as d } from "react";
4
+ var g = "[object Number]";
5
+ function q(s) {
6
+ return typeof s == "number" || _(s) && G(s) == g;
7
7
  }
8
- const DEFAULT_NODE_RADIUS = 10;
9
- const Leaf = ({
10
- nodeId,
11
- label = nodeId,
12
- x,
13
- y,
14
- height,
15
- nodeRadius = DEFAULT_NODE_RADIUS,
16
- nodeColor,
17
- nodeOpacity = 1,
18
- letterSize,
19
- letterWidth,
20
- textColor,
21
- style = {},
22
- selected = false,
23
- alwaysShowText = false,
24
- onHoverChanged,
25
- onClick,
26
- children
8
+ const v = 10, J = ({
9
+ nodeId: s,
10
+ label: x = s,
11
+ x: r,
12
+ y: a,
13
+ height: h,
14
+ nodeRadius: k = v,
15
+ nodeColor: $,
16
+ nodeOpacity: m = 1,
17
+ letterSize: l,
18
+ letterWidth: O,
19
+ textColor: W,
20
+ style: t = {},
21
+ selected: p = !1,
22
+ alwaysShowText: j = !1,
23
+ onHoverChanged: i,
24
+ onClick: o,
25
+ children: A
27
26
  }) => {
28
- const [isSelected, setIsSelected] = useState(selected);
29
- const [isHovered, setIsHovered] = useState(false);
30
- const classNames = useMemo(() => {
31
- const _classNames = ["node"];
32
- if (isHovered) {
33
- _classNames.push("hover");
34
- }
35
- if (isSelected) {
36
- _classNames.push("selected");
37
- }
38
- return _classNames;
39
- }, [isHovered, isSelected]);
40
- const handleOnClick = useCallback(
41
- (event) => {
42
- onClick == null ? void 0 : onClick(nodeId, !isSelected, event);
43
- setIsSelected(!isSelected);
27
+ const [c, n] = N(p), [u, D] = N(!1), E = Z(() => {
28
+ const e = ["node"];
29
+ return u && e.push("hover"), c && e.push("selected"), e;
30
+ }, [u, c]), S = M(
31
+ (e) => {
32
+ o == null || o(s, !c, e), n(!c);
44
33
  },
45
- [nodeId, onClick, isSelected]
46
- );
47
- const handleOnHoverChanged = useCallback(
48
- (value) => {
49
- setIsHovered(value);
50
- onHoverChanged == null ? void 0 : onHoverChanged(nodeId, value);
34
+ [s, o, c]
35
+ ), L = M(
36
+ (e) => {
37
+ D(e), i == null || i(s, e);
51
38
  },
52
- [nodeId, onHoverChanged]
39
+ [s, i]
53
40
  );
54
- useEffect(() => setIsSelected(selected), [selected]);
55
- let strokeWidth = `${nodeRadius}px`;
56
- if (style.strokeWidth) {
57
- if (isNumber(style.strokeWidth)) {
58
- strokeWidth = `${nodeRadius * style.strokeWidth}px`;
59
- } else {
60
- strokeWidth = style.strokeWidth;
61
- }
62
- }
63
- return /* @__PURE__ */ jsxs(
41
+ d(() => n(p), [p]);
42
+ let f = `${k}px`;
43
+ return t.strokeWidth && (q(t.strokeWidth) ? f = `${k * t.strokeWidth}px` : f = t.strokeWidth), /* @__PURE__ */ U(
64
44
  "g",
65
45
  {
66
- id: "node-" + nodeId.replace(/[^A-Za-z0-9]*/g, ""),
46
+ id: "node-" + s.replace(/[^A-Za-z0-9]*/g, ""),
67
47
  style: { strokeLinecap: "round" },
68
- className: classNames.join(" "),
69
- onClick: handleOnClick,
70
- onMouseOver: () => handleOnHoverChanged(true),
71
- onMouseLeave: () => handleOnHoverChanged(false),
48
+ className: E.join(" "),
49
+ onClick: S,
50
+ onMouseOver: () => L(!0),
51
+ onMouseLeave: () => L(!1),
72
52
  children: [
73
- children,
74
- /* @__PURE__ */ jsx(
53
+ A,
54
+ /* @__PURE__ */ b(
75
55
  "path",
76
56
  {
77
57
  className: "border",
78
- d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
58
+ d: `M ${r} ${a} L ${r} ${a + Math.max(h, 0)}`,
79
59
  style: {
80
- strokeOpacity: nodeOpacity,
81
- ...style,
82
- strokeWidth: `calc(${strokeWidth} * 2)`,
83
- stroke: style.stroke ?? nodeColor.border
60
+ strokeOpacity: m,
61
+ ...t,
62
+ strokeWidth: `calc(${f} * 2)`,
63
+ stroke: t.stroke ?? $.border
84
64
  }
85
65
  },
86
- nodeId + "-border"
66
+ s + "-border"
87
67
  ),
88
- /* @__PURE__ */ jsx(
68
+ /* @__PURE__ */ b(
89
69
  "path",
90
70
  {
91
71
  className: "center",
92
- d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
72
+ d: `M ${r} ${a} L ${r} ${a + Math.max(h, 0)}`,
93
73
  style: {
94
- strokeOpacity: nodeOpacity,
95
- ...style,
96
- strokeWidth,
97
- stroke: style.fill ?? nodeColor.center
74
+ strokeOpacity: m,
75
+ ...t,
76
+ strokeWidth: f,
77
+ stroke: t.fill ?? $.center
98
78
  }
99
79
  },
100
- nodeId + "-middle"
80
+ s + "-middle"
101
81
  ),
102
- (isHovered || alwaysShowText) && label.split("\n").reverse().map((_label, index, arr) => /* @__PURE__ */ jsx(
82
+ (u || j) && x.split(`
83
+ `).reverse().map((e, T, F) => /* @__PURE__ */ b(
103
84
  "text",
104
85
  {
105
- x: x + letterWidth,
106
- y: y - letterSize / 2 + arr.length - index * letterSize,
107
- fill: textColor,
86
+ x: r + O,
87
+ y: a - l / 2 + F.length - T * l,
88
+ fill: W,
108
89
  style: {
109
90
  cursor: "default",
110
91
  fontFamily: '"Lucida Console", monospace',
111
- fontSize: letterSize + "px",
112
- fillOpacity: nodeOpacity
92
+ fontSize: l + "px",
93
+ fillOpacity: m
113
94
  },
114
- children: _label
95
+ children: e
115
96
  },
116
- nodeId + "-label-" + _label
97
+ s + "-label-" + e
117
98
  ))
118
99
  ]
119
100
  },
120
- nodeId
101
+ s
121
102
  );
122
103
  };
123
104
  export {
124
- Leaf as default
105
+ J as default
125
106
  };
@@ -1,14 +1,14 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { o as ordinal, d as d3, S as Spectral, a as index, h as hierarchy } from "../../../../../index-DCKkHTvx.js";
3
- import useMyHighlights from "../../../../../hooks/useMyHighlights.js";
4
- import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
5
- import { StorageKey } from "../../../../../utils/constants.js";
6
- import { cyrb53 } from "../../../../../utils/graph.js";
7
- import { c as countBy } from "../../../../../countBy-c6S3dvSW.js";
8
- import { s as sumBy } from "../../../../../sumBy-D-hb_NY-.js";
9
- import { memo, useRef, useMemo, useCallback } from "react";
10
- import Leaf from "../Leaf.js";
11
- const DEFAULT_OPTIONS = {
1
+ import { jsx as a, jsxs as x } from "react/jsx-runtime";
2
+ import { o as I, d as N, S as B, a as T, h as _ } from "../../../../../index-p5_wX7q1.js";
3
+ import A from "../../../../../hooks/useMyHighlights.js";
4
+ import { useMyLocalStorageItem as D } from "../../../../../hooks/useMyLocalStorage.js";
5
+ import { StorageKey as F } from "../../../../../utils/constants.js";
6
+ import { cyrb53 as K } from "../../../../../utils/graph.js";
7
+ import { c as U } from "../../../../../countBy-CdYegFSu.js";
8
+ import { s as X } from "../../../../../sumBy-DuMASLPd.js";
9
+ import { memo as Y, useRef as p, useMemo as c, useCallback as q } from "react";
10
+ import G from "../Leaf.js";
11
+ const u = {
12
12
  width: "100%",
13
13
  backgroundColor: "grey",
14
14
  textColor: "black",
@@ -23,119 +23,102 @@ const DEFAULT_OPTIONS = {
23
23
  circlePadding: null
24
24
  // We'll make this dynamic
25
25
  };
26
- DEFAULT_OPTIONS.circlePadding = 3 * DEFAULT_OPTIONS.nodeRadius;
27
- const Cloud = ({ svgRef, graph, options = {} }) => {
26
+ u.circlePadding = 3 * u.nodeRadius;
27
+ const J = ({ svgRef: S, graph: h, options: b = {} }) => {
28
28
  const {
29
- width,
30
- backgroundColor,
31
- textColor,
32
- letterSize,
33
- letterWidth,
34
- circlePadding,
35
- nodeRadius,
36
- nodeColor,
37
- lineWidth
29
+ width: M,
30
+ backgroundColor: O,
31
+ textColor: $,
32
+ letterSize: m,
33
+ letterWidth: v,
34
+ circlePadding: g,
35
+ nodeRadius: d,
36
+ nodeColor: L,
37
+ lineWidth: f
38
38
  } = {
39
- ...DEFAULT_OPTIONS,
40
- ...options
41
- };
42
- const { onNodeHoveredChanged, onNodeClicked, nodeOpacities, highlightedPath } = useMyHighlights(graph);
43
- const [colorScheme] = useMyLocalStorageItem(StorageKey.COLOR_SCHEME, "Spectral");
44
- const currentX = useRef(2 * nodeRadius);
45
- const currentY = useRef(letterSize + nodeRadius);
46
- const nodeLocations = useRef({});
47
- const nodes = useMemo(
48
- () => graph.data.flatMap(
49
- (cloud, cloudIndex) => cloud.map((node) => ({
50
- ...node,
51
- cloud: cloudIndex.toString()
39
+ ...u,
40
+ ...b
41
+ }, { onNodeHoveredChanged: W, onNodeClicked: w, nodeOpacities: z, highlightedPath: s } = A(h), [y] = D(F.COLOR_SCHEME, "Spectral"), P = p(2 * d), R = p(m + d), j = p({}), i = c(
42
+ () => h.data.flatMap(
43
+ (t, e) => t.map((r) => ({
44
+ ...r,
45
+ cloud: e.toString()
52
46
  }))
53
47
  ),
54
- [graph.data]
55
- );
56
- const clouds = useMemo(() => countBy(nodes, (node) => node.cloud), [nodes]);
57
- const colors = useMemo(
58
- () => ordinal(
59
- Object.keys(clouds).map((cloud) => (d3[`interpolate${colorScheme}`] ?? Spectral)(cyrb53(cloud)))
48
+ [h.data]
49
+ ), n = c(() => U(i, (t) => t.cloud), [i]), H = c(
50
+ () => I(
51
+ Object.keys(n).map((t) => (N[`interpolate${y}`] ?? B)(K(t)))
60
52
  ),
61
- [clouds, colorScheme]
62
- );
63
- const links = useMemo(
64
- () => nodes.flatMap(
65
- (node) => ((node == null ? void 0 : node.edges) ?? []).map((parent) => ({
66
- source: node.id,
67
- target: parent
53
+ [n, y]
54
+ ), E = c(
55
+ () => i.flatMap(
56
+ (t) => ((t == null ? void 0 : t.edges) ?? []).map((e) => ({
57
+ source: t.id,
58
+ target: e
68
59
  }))
69
60
  ),
70
- [nodes]
71
- );
72
- const pack = useMemo(() => index().size([600, 600]).padding(circlePadding), [circlePadding]);
73
- const cloudLocations = useMemo(() => {
74
- const data = Object.entries(clouds).map(([id]) => ({
75
- id,
76
- children: nodes.filter((node) => node.cloud === id).map((node) => ({
77
- ...node,
61
+ [i]
62
+ ), k = c(() => T().size([600, 600]).padding(g), [g]), l = c(() => {
63
+ const t = Object.entries(n).map(([e]) => ({
64
+ id: e,
65
+ children: i.filter((r) => r.cloud === e).map((r) => ({
66
+ ...r,
78
67
  value: 1
79
68
  }))
80
69
  }));
81
- return pack(
82
- hierarchy({ children: data }).sum((d) => d.children ? sumBy(d.children, (c) => c.value) : d.value)
70
+ return k(
71
+ _({ children: t }).sum((e) => e.children ? X(e.children, (r) => r.value) : e.value)
83
72
  ).children;
84
- }, [clouds, nodes, pack]);
85
- const opacities = useCallback(
86
- (link) => highlightedPath.size === 0 || highlightedPath.has(link.source) && highlightedPath.has(link.target) ? 1 : 0.2,
87
- [highlightedPath]
73
+ }, [n, i, k]), C = q(
74
+ (t) => s.size === 0 || s.has(t.source) && s.has(t.target) ? 1 : 0.2,
75
+ [s]
88
76
  );
89
- currentX.current = 2 * nodeRadius;
90
- currentY.current = letterSize + nodeRadius;
91
- nodeLocations.current = {};
92
- return /* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, width, height: 600, style: { backgroundColor }, children: /* @__PURE__ */ jsxs("g", { id: "view", children: [
93
- cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("circle", { cx: cloud.x, cy: cloud.y, r: cloud.r, strokeWidth: 4, stroke: colors(cloud.data.id), fill: "none" }) }, cloud.data.id)),
94
- links.map((link) => {
95
- const source = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.source);
96
- const target = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.target);
97
- return /* @__PURE__ */ jsxs("g", { children: [
98
- /* @__PURE__ */ jsx(
77
+ return P.current = 2 * d, R.current = m + d, j.current = {}, /* @__PURE__ */ a("svg", { id: "viz", ref: S, width: M, height: 600, style: { backgroundColor: O }, children: /* @__PURE__ */ x("g", { id: "view", children: [
78
+ l.map((t) => /* @__PURE__ */ a("g", { children: /* @__PURE__ */ a("circle", { cx: t.x, cy: t.y, r: t.r, strokeWidth: 4, stroke: H(t.data.id), fill: "none" }) }, t.data.id)),
79
+ E.map((t) => {
80
+ const e = l.flatMap((o) => o.children).find((o) => o.data.id === t.source), r = l.flatMap((o) => o.children).find((o) => o.data.id === t.target);
81
+ return /* @__PURE__ */ x("g", { children: [
82
+ /* @__PURE__ */ a(
99
83
  "path",
100
84
  {
101
- d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
85
+ d: `M ${e.x} ${e.y} L ${r.x} ${r.y}`,
102
86
  stroke: "black",
103
- strokeWidth: lineWidth + 3,
104
- strokeOpacity: opacities(link)
87
+ strokeWidth: f + 3,
88
+ strokeOpacity: C(t)
105
89
  }
106
90
  ),
107
- /* @__PURE__ */ jsx(
91
+ /* @__PURE__ */ a(
108
92
  "path",
109
93
  {
110
- d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
94
+ d: `M ${e.x} ${e.y} L ${r.x} ${r.y}`,
111
95
  stroke: "white",
112
- strokeWidth: lineWidth,
113
- strokeOpacity: opacities(link)
96
+ strokeWidth: f,
97
+ strokeOpacity: C(t)
114
98
  }
115
99
  )
116
- ] }, source.data.id + target.data.id);
100
+ ] }, e.data.id + r.data.id);
117
101
  }),
118
- cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: cloud.children.map((node) => /* @__PURE__ */ jsx(
119
- Leaf,
102
+ l.map((t) => /* @__PURE__ */ a("g", { children: t.children.map((e) => /* @__PURE__ */ a(
103
+ G,
120
104
  {
121
- nodeId: node.data.id,
105
+ nodeId: e.data.id,
122
106
  height: 0,
123
- x: node.x,
124
- y: node.y,
125
- nodeRadius,
126
- nodeColor,
127
- nodeOpacity: nodeOpacities(node.data.id),
128
- letterSize,
129
- letterWidth,
130
- textColor,
131
- onHoverChanged: onNodeHoveredChanged,
132
- onClick: onNodeClicked
107
+ x: e.x,
108
+ y: e.y,
109
+ nodeRadius: d,
110
+ nodeColor: L,
111
+ nodeOpacity: z(e.data.id),
112
+ letterSize: m,
113
+ letterWidth: v,
114
+ textColor: $,
115
+ onHoverChanged: W,
116
+ onClick: w
133
117
  },
134
- node.data.id
135
- )) }, cloud.id))
118
+ e.data.id
119
+ )) }, t.id))
136
120
  ] }) });
137
- };
138
- const Cloud$1 = memo(Cloud);
121
+ }, dt = Y(J);
139
122
  export {
140
- Cloud$1 as default
123
+ dt as default
141
124
  };
@@ -1,37 +1,32 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- const DEFAULTS = {
1
+ import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as x } from "react";
3
+ const d = {
4
4
  size: 20
5
- };
6
- const BaseIcon = (props) => {
7
- const { width, height, size } = {
8
- ...DEFAULTS,
9
- ...props
10
- };
11
- const x = (props.x ?? 0) - (width ?? size) / 2;
12
- const y = (props.y ?? 0) - (height ?? size) / 2;
13
- const trimmedProps = useMemo(() => {
14
- const _props = { ...props };
15
- delete _props.circleStyle;
16
- return _props;
17
- }, [props]);
18
- return /* @__PURE__ */ jsxs("g", { children: [
19
- /* @__PURE__ */ jsx("circle", { cx: props.x, cy: props.y, r: size / 2, style: props.circleStyle ?? {} }),
20
- /* @__PURE__ */ jsx(
5
+ }, y = (e) => {
6
+ const { width: c, height: i, size: t } = {
7
+ ...d,
8
+ ...e
9
+ }, l = (e.x ?? 0) - (c ?? t) / 2, r = (e.y ?? 0) - (i ?? t) / 2, h = x(() => {
10
+ const n = { ...e };
11
+ return delete n.circleStyle, n;
12
+ }, [e]);
13
+ return /* @__PURE__ */ o("g", { children: [
14
+ /* @__PURE__ */ s("circle", { cx: e.x, cy: e.y, r: t / 2, style: e.circleStyle ?? {} }),
15
+ /* @__PURE__ */ s(
21
16
  "svg",
22
17
  {
23
18
  xmlns: "http://www.w3.org/2000/svg",
24
19
  viewBox: "0 -960 960 960",
25
- width: width ?? size,
26
- height: height ?? size,
27
- ...trimmedProps,
28
- x,
29
- y,
30
- children: props.children
20
+ width: c ?? t,
21
+ height: i ?? t,
22
+ ...h,
23
+ x: l,
24
+ y: r,
25
+ children: e.children
31
26
  }
32
27
  )
33
28
  ] });
34
29
  };
35
30
  export {
36
- BaseIcon as default
31
+ y as default
37
32
  };
@@ -1,18 +1,18 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const BugIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useTheme as h } from "@mui/material";
3
+ import l from "./BaseIcon.js";
4
+ const v = (t) => {
5
+ const e = h();
6
+ return /* @__PURE__ */ r(
7
+ l,
8
8
  {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(theme.palette.error.dark), ...props.style },
11
- circleStyle: { fill: theme.palette.error.dark, ...props.style },
12
- children: /* @__PURE__ */ jsx("path", { d: "M480-200q66 0 113-47t47-113v-160q0-66-47-113t-113-47q-66 0-113 47t-47 113v160q0 66 47 113t113 47Zm-80-120h160v-80H400v80Zm0-160h160v-80H400v80Zm80 40Zm0 320q-65 0-120.5-32T272-240H160v-80h84q-3-20-3.5-40t-.5-40h-80v-80h80q0-20 .5-40t3.5-40h-84v-80h112q14-23 31.5-43t40.5-35l-64-66 56-56 86 86q28-9 57-9t57 9l88-86 56 56-66 66q23 15 41.5 34.5T688-640h112v80h-84q3 20 3.5 40t.5 40h80v80h-80q0 20-.5 40t-3.5 40h84v80H688q-32 56-87.5 88T480-120Z" })
9
+ ...t,
10
+ style: { fill: e.palette.getContrastText(e.palette.error.dark), ...t.style },
11
+ circleStyle: { fill: e.palette.error.dark, ...t.style },
12
+ children: /* @__PURE__ */ r("path", { d: "M480-200q66 0 113-47t47-113v-160q0-66-47-113t-113-47q-66 0-113 47t-47 113v160q0 66 47 113t113 47Zm-80-120h160v-80H400v80Zm0-160h160v-80H400v80Zm80 40Zm0 320q-65 0-120.5-32T272-240H160v-80h84q-3-20-3.5-40t-.5-40h-80v-80h80q0-20 .5-40t3.5-40h-84v-80h112q14-23 31.5-43t40.5-35l-64-66 56-56 86 86q28-9 57-9t57 9l88-86 56 56-66 66q23 15 41.5 34.5T688-640h112v80h-84q3 20 3.5 40t.5 40h80v80h-80q0 20-.5 40t-3.5 40h84v80H688q-32 56-87.5 88T480-120Z" })
13
13
  }
14
14
  );
15
15
  };
16
16
  export {
17
- BugIcon as default
17
+ v as default
18
18
  };
@@ -1,15 +1,15 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const HostIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useTheme as a } from "@mui/material";
3
+ import r from "./BaseIcon.js";
4
+ const n = (t) => {
5
+ const e = a();
6
+ return /* @__PURE__ */ l(
7
+ r,
8
8
  {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
11
- circleStyle: { fill: theme.palette.info.dark, ...props.style },
12
- children: /* @__PURE__ */ jsx(
9
+ ...t,
10
+ style: { fill: e.palette.getContrastText(e.palette.info.dark), ...t.style },
11
+ circleStyle: { fill: e.palette.info.dark, ...t.style },
12
+ children: /* @__PURE__ */ l(
13
13
  "path",
14
14
  {
15
15
  style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
@@ -20,5 +20,5 @@ const HostIcon = (props) => {
20
20
  );
21
21
  };
22
22
  export {
23
- HostIcon as default
23
+ n as default
24
24
  };
@@ -1,15 +1,15 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const NetworkIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useTheme as v } from "@mui/material";
3
+ import r from "./BaseIcon.js";
4
+ const s = (t) => {
5
+ const e = v();
6
+ return /* @__PURE__ */ l(
7
+ r,
8
8
  {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
11
- circleStyle: { fill: theme.palette.info.dark, ...props.style },
12
- children: /* @__PURE__ */ jsx(
9
+ ...t,
10
+ style: { fill: e.palette.getContrastText(e.palette.info.dark), ...t.style },
11
+ circleStyle: { fill: e.palette.info.dark, ...t.style },
12
+ children: /* @__PURE__ */ l(
13
13
  "path",
14
14
  {
15
15
  style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
@@ -20,5 +20,5 @@ const NetworkIcon = (props) => {
20
20
  );
21
21
  };
22
22
  export {
23
- NetworkIcon as default
23
+ s as default
24
24
  };
@@ -1,18 +1,18 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme, colors } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const ProcessIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { useTheme as r, colors as e } from "@mui/material";
3
+ import l from "./BaseIcon.js";
4
+ const c = (h) => {
5
+ const t = r();
6
+ return /* @__PURE__ */ v(
7
+ l,
8
8
  {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(colors.grey[500]), ...props.style },
11
- circleStyle: { fill: colors.grey[500], ...props.style },
12
- children: /* @__PURE__ */ jsx("path", { d: "M360-360v-240h240v240H360Zm80-80h80v-80h-80v80Zm-80 320v-80h-80q-33 0-56.5-23.5T200-280v-80h-80v-80h80v-80h-80v-80h80v-80q0-33 23.5-56.5T280-760h80v-80h80v80h80v-80h80v80h80q33 0 56.5 23.5T760-680v80h80v80h-80v80h80v80h-80v80q0 33-23.5 56.5T680-200h-80v80h-80v-80h-80v80h-80Zm320-160v-400H280v400h400ZM480-480Z" })
9
+ ...h,
10
+ style: { fill: t.palette.getContrastText(e.grey[500]), ...h.style },
11
+ circleStyle: { fill: e.grey[500], ...h.style },
12
+ children: /* @__PURE__ */ v("path", { d: "M360-360v-240h240v240H360Zm80-80h80v-80h-80v80Zm-80 320v-80h-80q-33 0-56.5-23.5T200-280v-80h-80v-80h80v-80h-80v-80h80v-80q0-33 23.5-56.5T280-760h80v-80h80v80h80v-80h80v80h80q33 0 56.5 23.5T760-680v80h80v80h-80v80h80v80h-80v80q0 33-23.5 56.5T680-200h-80v80h-80v-80h-80v80h-80Zm320-160v-400H280v400h400ZM480-480Z" })
13
13
  }
14
14
  );
15
15
  };
16
16
  export {
17
- ProcessIcon as default
17
+ c as default
18
18
  };
@@ -1,19 +1,19 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const TargetIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
1
+ import { jsx as q } from "react/jsx-runtime";
2
+ import { useTheme as T } from "@mui/material";
3
+ import l from "./BaseIcon.js";
4
+ const o = (t) => {
5
+ const e = T();
6
+ return /* @__PURE__ */ q(
7
+ l,
8
8
  {
9
- ...props,
10
- ...props,
11
- style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
12
- circleStyle: { fill: theme.palette.info.dark, ...props.style },
13
- children: /* @__PURE__ */ jsx("path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-80q-100 0-170-70t-70-170q0-100 70-170t170-70q100 0 170 70t70 170q0 100-70 170t-170 70Zm0-80q66 0 113-47t47-113q0-66-47-113t-113-47q-66 0-113 47t-47 113q0 66 47 113t113 47Zm0-80q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Z" })
9
+ ...t,
10
+ ...t,
11
+ style: { fill: e.palette.getContrastText(e.palette.info.dark), ...t.style },
12
+ circleStyle: { fill: e.palette.info.dark, ...t.style },
13
+ children: /* @__PURE__ */ q("path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-80q-100 0-170-70t-70-170q0-100 70-170t170-70q100 0 170 70t70 170q0 100-70 170t-170 70Zm0-80q66 0 113-47t47-113q0-66-47-113t-113-47q-66 0-113 47t-47 113q0 66 47 113t113 47Zm0-80q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Z" })
14
14
  }
15
15
  );
16
16
  };
17
17
  export {
18
- TargetIcon as default
18
+ o as default
19
19
  };