@cccsaurora/clue-ui 1.4.1-dev.451 → 1.4.1

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 (224) hide show
  1. package/ActionForm-DjyNwVzM.js +4403 -0
  2. package/AnnotationDetails-BvPv3_pR.js +160 -0
  3. package/AnnotationPreview-C0JN_lr0.js +140 -0
  4. package/ClueEnrichContext-CNbh-qiy.js +452 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_MapCache-DRK-s2eK.js +179 -0
  7. package/_Set-DrS_bbSV.js +6 -0
  8. package/_Uint8Array-D9R2N9Lp.js +98 -0
  9. package/_arrayIncludes-Dcl_29E6.js +25 -0
  10. package/_arrayPush-DBJIuK2V.js +8 -0
  11. package/_baseAssignValue-Bx1cxHj5.js +12 -0
  12. package/_baseClone-DRhywkxm.js +211 -0
  13. package/_baseExtremum-DodEaEyF.js +16 -0
  14. package/_baseFlatten-CD9NgrYE.js +72 -0
  15. package/_baseGet-bVwDaGrA.js +80 -0
  16. package/_baseGetTag-CxDaTem-.js +25 -0
  17. package/_baseIsEqual-C-FKsm1J.js +150 -0
  18. package/_baseIteratee-D0FhC5bC.js +95 -0
  19. package/_baseRest-D_eW2E0d.js +8 -0
  20. package/_baseSlice-M5RKzt1A.js +10 -0
  21. package/_baseSum-wEbgNeUs.js +10 -0
  22. package/_baseUniq-D3N8igOm.js +41 -0
  23. package/_cacheHas-Wgl-hw34.js +22 -0
  24. package/_commonjsHelpers-C6fGbg64.js +6 -0
  25. package/_createAggregator-BVj8IAuF.js +53 -0
  26. package/_defineProperty-BZU4WKA3.js +11 -0
  27. package/_getPrototype-BGBCg-aX.js +5 -0
  28. package/_getTag-B7R9qBo7.js +73 -0
  29. package/_isIterateeCall-Dm0VTAYy.js +13 -0
  30. package/_setToArray-Ck4YZu0Z.js +9 -0
  31. package/cloneDeep-fV59zwUf.js +8 -0
  32. package/components/AnnotationBody.js +35 -49
  33. package/components/AnnotationDetailPopover.js +30 -39
  34. package/components/AnnotationDetails.js +7 -7
  35. package/components/AnnotationEntry.js +35 -35
  36. package/components/AnnotationPreview.js +5 -5
  37. package/components/ClassificationChip.js +24 -46
  38. package/components/CountBadge.js +26 -31
  39. package/components/EnrichedCard.js +97 -110
  40. package/components/EnrichedChip.js +105 -130
  41. package/components/EnrichedTypography.js +107 -133
  42. package/components/ErrorBoundary.js +24 -28
  43. package/components/RetryFailedEnrichments.js +9 -10
  44. package/components/SourcePicker.js +49 -57
  45. package/components/actions/ActionForm.js +4 -4
  46. package/components/actions/ExecutePopover.js +59 -75
  47. package/components/actions/ResultModal.js +4 -4
  48. package/components/actions/form/schemaAdapter.js +23 -39
  49. package/components/actions/formats/FileResult.js +59 -86
  50. package/components/actions/formats/index.js +25 -29
  51. package/components/display/graph/ExpandMoreButton.js +10 -10
  52. package/components/display/graph/elements/NodeCard.js +91 -111
  53. package/components/display/graph/elements/NodeTag.js +13 -15
  54. package/components/display/graph/index.js +202 -261
  55. package/components/display/graph/visualizations/Leaf.js +70 -89
  56. package/components/display/graph/visualizations/cloud/index.js +81 -98
  57. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  58. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  59. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  60. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  61. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  62. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  63. package/components/display/graph/visualizations/icons/index.js +13 -14
  64. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  65. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  66. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  67. package/components/display/graph/visualizations/tree/index.js +306 -408
  68. package/components/display/icons/Iconified.js +12 -27
  69. package/components/display/json/index.js +4 -4
  70. package/components/display/markdown/index.js +5770 -8678
  71. package/components/enrichment/EnrichPopover.js +46 -54
  72. package/components/fetchers/Fetcher.js +123 -166
  73. package/components/fetchers/FetcherResultView.js +27 -31
  74. package/components/fetchers/PreviewModal.js +16 -17
  75. package/components/fetchers/StatusChip.js +17 -21
  76. package/components/group/Entry.js +11 -13
  77. package/components/group/Group.js +10 -13
  78. package/components/group/GroupControl.js +65 -76
  79. package/components/stats/QueryStatus.js +32 -45
  80. package/countBy-B3rNuG4T.js +8 -0
  81. package/data/event.js +4 -6
  82. package/database/globals.js +2 -2
  83. package/database/index.js +3 -3
  84. package/database/replication.js +4 -4
  85. package/get-Bil3mzRD.js +8 -0
  86. package/groupBy-CrJC7sGa.js +8 -0
  87. package/hooks/ClueActionContext.js +6 -6
  88. package/hooks/ClueComponentContext.js +23 -29
  89. package/hooks/ClueConfigProvider.js +12 -14
  90. package/hooks/ClueDatabaseContext.js +23 -35
  91. package/hooks/ClueEnrichContext.js +11 -11
  92. package/hooks/ClueFetcherContext.js +56 -83
  93. package/hooks/ClueGroupContext.js +14 -17
  94. package/hooks/CluePopupContext.js +5 -5
  95. package/hooks/ClueProvider.js +11 -13
  96. package/hooks/ClueUIPluginContext.js +36 -50
  97. package/hooks/selectors.js +7 -7
  98. package/hooks/useActionResult.js +3 -3
  99. package/hooks/useAnnotations.js +32 -48
  100. package/hooks/useClue.js +4 -6
  101. package/hooks/useClueActions.js +3 -3
  102. package/hooks/useClueConfig.js +4 -6
  103. package/hooks/useClueTypeConfig.js +24 -49
  104. package/hooks/useClueUIPlugins.js +7 -8
  105. package/hooks/useComparator.js +435 -722
  106. package/hooks/useErrors.js +18 -22
  107. package/hooks/useFetcherResult.js +24 -33
  108. package/hooks/useMyHighlights.js +36 -66
  109. package/hooks/useMyLocalStorage.js +37 -66
  110. package/iconify-Ptb5dTKy.js +1270 -0
  111. package/icons/Action.js +49 -66
  112. package/icons/Assessment.js +69 -85
  113. package/icons/Context.js +63 -77
  114. package/icons/Opinion.js +60 -76
  115. package/icons/iconMap.js +2 -2
  116. package/identity-ByMq8VxU.js +6 -0
  117. package/index-BH-gBhtO.js +2282 -0
  118. package/index-BM9Sve5T.js +571 -0
  119. package/index-Cj4d5cGz.js +357 -0
  120. package/index-D3Dwn-8x.js +6464 -0
  121. package/index-Dh2PP9h8.js +11747 -0
  122. package/index-DoFpWPHo.js +975 -0
  123. package/isArguments-BWcXOE6a.js +24 -0
  124. package/isArray-WzO_os3q.js +4 -0
  125. package/isEmpty-DKxrY-_M.js +22 -0
  126. package/isNil-CjWwlQS3.js +6 -0
  127. package/isObject-B53jY8Qg.js +7 -0
  128. package/isObjectLike-CYbdrIBr.js +6 -0
  129. package/isSymbol-DE1Kcy2M.js +9 -0
  130. package/last-7CdUxN0r.js +7 -0
  131. package/main.js +62 -62
  132. package/maxBy-BOWDkL_D.js +8 -0
  133. package/package.json +1 -1
  134. package/plugins/ClueUIPlugin.js +96 -163
  135. package/plugins/file/index.js +15 -15
  136. package/plugins/graph/index.js +26 -29
  137. package/plugins/image/index.js +24 -28
  138. package/plugins/json/index.js +21 -21
  139. package/plugins/markdown/index.js +18 -18
  140. package/plugins/registry.js +6 -6
  141. package/plugins/store.js +4 -4
  142. package/plugins/test/index.js +17 -17
  143. package/plugins/utils.js +12 -13
  144. package/replication-WkKbPdwG.js +8453 -0
  145. package/sessionStorage-DFMae61b.js +90 -0
  146. package/sortBy-BHe812lF.js +74 -0
  147. package/store-D4aFUWxi.js +1169 -0
  148. package/sumBy-B7f_bP_k.js +8 -0
  149. package/text/Frequency.js +23 -42
  150. package/toFinite-CBrE65MP.js +14 -0
  151. package/toNumber-CxmWey0f.js +31 -0
  152. package/uniq-B4UZ671_.js +7 -0
  153. package/utils/chain.js +65 -92
  154. package/utils/classificationParser.js +256 -519
  155. package/utils/constants.js +11 -37
  156. package/utils/graph.js +45 -72
  157. package/utils/hashUtil.js +7 -7
  158. package/utils/line.js +81 -131
  159. package/utils/loggerUtil.js +3 -5
  160. package/utils/sessionStorage.js +7 -7
  161. package/utils/time.js +427 -447
  162. package/utils/utils.js +10 -10
  163. package/utils/window.js +10 -21
  164. package/utils-SpTOhPYl.js +147 -0
  165. package/ActionForm-CbLz66Rk.js +0 -6099
  166. package/AnnotationDetails-CdNvyJl7.js +0 -176
  167. package/AnnotationPreview-C6a3qRFG.js +0 -188
  168. package/ClueEnrichContext-0eVIgvZp.js +0 -594
  169. package/FlexOne-BSYAhhtG.js +0 -9
  170. package/_MapCache-kuEY_iOH.js +0 -220
  171. package/_Set-BrSMTlHn.js +0 -6
  172. package/_Uint8Array-OPpgYQj7.js +0 -123
  173. package/_arrayIncludes-BNqL-9ZP.js +0 -31
  174. package/_arrayPush-CBkQqaE_.js +0 -10
  175. package/_baseAssignValue-CNUVPOBW.js +0 -16
  176. package/_baseClone-9FaRd1R2.js +0 -287
  177. package/_baseExtremum-wOGT4Dgw.js +0 -18
  178. package/_baseFlatten-Co6QHDlG.js +0 -92
  179. package/_baseGet-Cmp6FztG.js +0 -109
  180. package/_baseGetTag-Hj-0NTYF.js +0 -44
  181. package/_baseIsEqual-1CpU47TZ.js +0 -211
  182. package/_baseIteratee-BN7Vbe5g.js +0 -126
  183. package/_baseRest-BZ_hQ9PC.js +0 -8
  184. package/_baseSlice-GAv_YFTT.js +0 -20
  185. package/_baseSum-D0WC1dN0.js +0 -13
  186. package/_baseUniq-BnvS3JHL.js +0 -63
  187. package/_cacheHas-_aF2y2Xv.js +0 -25
  188. package/_commonjsHelpers-CUmg6egw.js +0 -6
  189. package/_createAggregator-BUZrP_is.js +0 -63
  190. package/_defineProperty-DolZLKmv.js +0 -12
  191. package/_getPrototype-Bb4gm-5m.js +0 -5
  192. package/_getTag-CML_cXiN.js +0 -105
  193. package/_isIterateeCall-B1IFEqVv.js +0 -17
  194. package/_setToArray-CqyqC8ib.js +0 -10
  195. package/cloneDeep-l3UkXG5M.js +0 -8
  196. package/countBy-Bqcp3VCs.js +0 -14
  197. package/get-CdMThM8x.js +0 -8
  198. package/groupBy-BVV07EGQ.js +0 -14
  199. package/iconify-DJxl6dC-.js +0 -1789
  200. package/identity-CPGTqrE4.js +0 -6
  201. package/index-CDrC9oSE.js +0 -1172
  202. package/index-CVUD9o3t.js +0 -15768
  203. package/index-DUEubgWN.js +0 -464
  204. package/index-DpJxD74E.js +0 -3272
  205. package/index-IKI1G5v-.js +0 -9314
  206. package/index-_gpzM2Px.js +0 -702
  207. package/isArguments-CuYlEuhP.js +0 -27
  208. package/isArray-RJPfgWqI.js +0 -4
  209. package/isEmpty-BE656RUK.js +0 -30
  210. package/isNil-CIubwp4T.js +0 -6
  211. package/isObject-FTY-5JQX.js +0 -7
  212. package/isObjectLike-CeENW9FN.js +0 -6
  213. package/isSymbol-D_H4HPZQ.js +0 -9
  214. package/last-CUCl67Im.js +0 -7
  215. package/maxBy-BjjQmX5t.js +0 -8
  216. package/replication-kdsH0l7f.js +0 -11779
  217. package/sessionStorage-B68y-wnE.js +0 -140
  218. package/sortBy-B8JVsLQY.js +0 -95
  219. package/store-DHP48fQB.js +0 -2165
  220. package/sumBy-D-HCzM2i.js +0 -8
  221. package/toFinite-meZTg4Su.js +0 -16
  222. package/toNumber-B5JaA1vX.js +0 -39
  223. package/uniq-CahZPAwp.js +0 -7
  224. package/utils-CEySTPtg.js +0 -224
@@ -0,0 +1,452 @@
1
+ import { jsx as Ct } from "react/jsx-runtime";
2
+ import { a as Ot } from "./iconify-Ptb5dTKy.js";
3
+ import { a as $t, p as ft } from "./index-BH-gBhtO.js";
4
+ import { REPLICATORS as F } from "./database/globals.js";
5
+ import { clueDebugLogger as G } from "./utils/loggerUtil.js";
6
+ import { c as H } from "./utils-SpTOhPYl.js";
7
+ import { b as gt } from "./_baseSlice-M5RKzt1A.js";
8
+ import { t as jt } from "./toFinite-CBrE65MP.js";
9
+ import { d as Pt } from "./sessionStorage-DFMae61b.js";
10
+ import { g as dt } from "./groupBy-CrJC7sGa.js";
11
+ import { u as pt } from "./uniq-B4UZ671_.js";
12
+ import { b as Mt } from "./_baseIteratee-D0FhC5bC.js";
13
+ import { b as Rt } from "./_baseUniq-D3N8igOm.js";
14
+ import { useContext as qt, useState as S, useMemo as K, useCallback as g, useRef as At, useEffect as j } from "react";
15
+ import { c as St } from "./index-BM9Sve5T.js";
16
+ import { ClueDatabaseContext as Bt } from "./hooks/ClueDatabaseContext.js";
17
+ import bt from "./hooks/useClueConfig.js";
18
+ import Vt from "./hooks/useClueTypeConfig.js";
19
+ import { i as Ut } from "./isEmpty-DKxrY-_M.js";
20
+ function Wt(n) {
21
+ var r = jt(n), m = r % 1;
22
+ return r === r ? m ? r - m : r : 0;
23
+ }
24
+ var Ft = Math.ceil, Ht = Math.max;
25
+ function Jt(n, r, m) {
26
+ r === void 0 ? r = 1 : r = Ht(Wt(r), 0);
27
+ var u = n == null ? 0 : n.length;
28
+ if (!u || r < 1)
29
+ return [];
30
+ for (var y = 0, D = 0, P = Array(Ft(u / r)); y < u; )
31
+ P[D++] = gt(n, y, y += r);
32
+ return P;
33
+ }
34
+ function Qt(n, r) {
35
+ return n && n.length ? Rt(n, Mt(r)) : [];
36
+ }
37
+ let J;
38
+ const _t = new Uint8Array(16);
39
+ function Gt() {
40
+ if (!J && (J = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !J))
41
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
42
+ return J(_t);
43
+ }
44
+ const p = [];
45
+ for (let n = 0; n < 256; ++n)
46
+ p.push((n + 256).toString(16).slice(1));
47
+ function Kt(n, r = 0) {
48
+ return p[n[r + 0]] + p[n[r + 1]] + p[n[r + 2]] + p[n[r + 3]] + "-" + p[n[r + 4]] + p[n[r + 5]] + "-" + p[n[r + 6]] + p[n[r + 7]] + "-" + p[n[r + 8]] + p[n[r + 9]] + "-" + p[n[r + 10]] + p[n[r + 11]] + p[n[r + 12]] + p[n[r + 13]] + p[n[r + 14]] + p[n[r + 15]];
49
+ }
50
+ const Xt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), mt = {
51
+ randomUUID: Xt
52
+ };
53
+ function X(n, r, m) {
54
+ if (mt.randomUUID && !n)
55
+ return mt.randomUUID();
56
+ n = n || {};
57
+ const u = n.random || (n.rng || Gt)();
58
+ return u[6] = u[6] & 15 | 64, u[8] = u[8] & 63 | 128, Kt(u);
59
+ }
60
+ const Yt = St(null), pe = ({
61
+ children: n,
62
+ classification: r,
63
+ baseURL: m,
64
+ getToken: u,
65
+ onNetworkCall: y,
66
+ pickSources: D,
67
+ chunkSize: P = 15,
68
+ maxRequestCount: Q = 4,
69
+ defaultTimeout: B = 5,
70
+ enabled: M = !0,
71
+ ready: yt = !1,
72
+ publicIconify: Y = !0,
73
+ skipConfigCall: Z = !1,
74
+ customIconify: b,
75
+ debugLogging: C = !0
76
+ }) => {
77
+ var ot, ct, at, ut, lt;
78
+ const $ = bt(), t = qt(Bt), [z, ht] = S(null), E = K(
79
+ () => {
80
+ var e, s;
81
+ return z ?? r ?? ((s = (e = $.config) == null ? void 0 : e.c12nDef) == null ? void 0 : s.RESTRICTED);
82
+ },
83
+ [r, (ct = (ot = $.config) == null ? void 0 : ot.c12nDef) == null ? void 0 : ct.RESTRICTED, z]
84
+ ), N = g(
85
+ (e) => {
86
+ var s;
87
+ return ht(e((s = $.config) == null ? void 0 : s.c12nDef));
88
+ },
89
+ [(at = $.config) == null ? void 0 : at.c12nDef]
90
+ ), [x, wt] = S(yt), R = At(0), [O, vt] = S([]), { availableSources: q, typesDetection: V, supportedTypes: T } = Vt(
91
+ M && x,
92
+ m,
93
+ C,
94
+ u,
95
+ y
96
+ );
97
+ j(() => {
98
+ if (Z || !M || !x)
99
+ return;
100
+ const e = {}, s = u == null ? void 0 : u();
101
+ s && (e.Authorization = `Bearer ${s}`);
102
+ let c = { baseURL: m, headers: e };
103
+ y && (c = y(c)), $t.configs.get(c).then($.setConfig);
104
+ }, [m, y, Z, x]);
105
+ const [L, k] = S(() => {
106
+ var e;
107
+ return !!((e = t == null ? void 0 : t.selectors) != null && e.synced);
108
+ });
109
+ j(() => {
110
+ var e;
111
+ k(!!((e = t == null ? void 0 : t.selectors) != null && e.synced));
112
+ }, [t]), j(() => {
113
+ if (x) {
114
+ const e = Object.values(F).map((s) => (s.reSync(), s.start(), s.active$.subscribe((c) => {
115
+ var i;
116
+ c || k(!!((i = t == null ? void 0 : t.selectors) != null && i.synced));
117
+ })));
118
+ return () => {
119
+ e.forEach((s) => s.unsubscribe()), Object.values(F).forEach((s) => {
120
+ s.pause();
121
+ });
122
+ };
123
+ }
124
+ return () => {
125
+ Object.values(F).forEach((e) => {
126
+ e.pause();
127
+ });
128
+ };
129
+ }, [t, x]);
130
+ const [tt, et] = S(b);
131
+ j(() => {
132
+ b && et(b);
133
+ }, [b]), j(() => {
134
+ if (Y)
135
+ return;
136
+ let e = tt ?? void 0 ?? (m == null ? void 0 : m.replace(/^[^.]+/, "icons"));
137
+ !e && typeof window < "u" && window && !window.location.origin.includes("localhost") && (e = window.location.protocol + "//" + window.location.origin.replace(/^[^.]+/, "icons")), e && (G(`Using ${e} for iconify`, C), Ot("", {
138
+ resources: [e]
139
+ }));
140
+ }, [m, tt, C, Y]);
141
+ const U = g(
142
+ async (e) => {
143
+ const s = [];
144
+ for (const i of e) {
145
+ const { latency: a, source: l, type: o, value: h, items: f, error: w } = i;
146
+ await t.selectors.find({ selector: { type: o, value: h, source: l } }).incrementalRemove(), w && s.push({
147
+ id: X(),
148
+ source: l,
149
+ type: o,
150
+ value: h,
151
+ annotations: [],
152
+ classification: E,
153
+ latency: a,
154
+ count: 0,
155
+ error: w
156
+ });
157
+ for (const d of f) {
158
+ const { classification: v, count: I, link: xt, annotations: Dt } = d, _ = {
159
+ id: X(),
160
+ source: l,
161
+ type: o,
162
+ value: h,
163
+ annotations: Dt,
164
+ classification: v,
165
+ latency: a,
166
+ count: I,
167
+ link: xt,
168
+ error: w
169
+ };
170
+ s.some((It) => It.id === _.id) && (_.id = X()), s.push(_);
171
+ }
172
+ }
173
+ const c = await t.selectors.bulkInsert(s);
174
+ c.error.length > 0 && (console.warn("Errors on upsert:"), c.error.forEach((i) => console.warn(i.documentId, i.validationErrors ?? i.status)));
175
+ },
176
+ [t, E]
177
+ ), st = g(
178
+ async (e, s, c = {}) => {
179
+ var d;
180
+ if (!e || !s)
181
+ return console.error(`Type (${e}) or value (${s}) is empty, returning empty response`), {};
182
+ const i = (D == null ? void 0 : D(O, q, [{ type: e, value: s, classification: c.classification }])) ?? O, a = {
183
+ timeout: B,
184
+ force: !1,
185
+ includeRaw: !1,
186
+ noCache: !1,
187
+ classification: E,
188
+ sources: i,
189
+ ...c
190
+ }, l = {}, o = u == null ? void 0 : u();
191
+ o && (l.Authorization = `Bearer ${o}`);
192
+ let h = { baseURL: m, headers: l };
193
+ y && (h = y(h));
194
+ const f = {
195
+ type: e,
196
+ value: s,
197
+ classification: a.classification
198
+ };
199
+ let w = await t.status.findOne({ selector: { ...f } }).exec();
200
+ w ? await w.incrementalPatch({ status: "in-progress" }) : w = await ((d = t.status) == null ? void 0 : d.insert({
201
+ id: await H(f.type, f.value, f.classification ?? E),
202
+ type: f.type,
203
+ value: f.value,
204
+ classification: f.classification ?? E,
205
+ status: "in-progress"
206
+ }));
207
+ try {
208
+ const v = await ft([f], a.sources, a, h), I = Object.values(Object.values(v)[0])[0];
209
+ return await U(Object.values(I)), I;
210
+ } catch (v) {
211
+ return console.error(v), {};
212
+ } finally {
213
+ await (w == null ? void 0 : w.incrementalPatch({ status: "complete" }));
214
+ }
215
+ },
216
+ [
217
+ U,
218
+ q,
219
+ m,
220
+ t,
221
+ E,
222
+ B,
223
+ u,
224
+ y,
225
+ D,
226
+ O
227
+ ]
228
+ ), W = g(
229
+ async (e, s) => {
230
+ var f, w;
231
+ const c = (D == null ? void 0 : D(O, q, e)) ?? O, i = {
232
+ timeout: B,
233
+ includeRaw: !1,
234
+ noCache: !1,
235
+ classification: E,
236
+ sources: c,
237
+ ...s
238
+ }, a = {}, l = u == null ? void 0 : u();
239
+ l && (a.Authorization = `Bearer ${l}`);
240
+ let o = { baseURL: m, headers: a };
241
+ y && (o = y(o));
242
+ const h = [];
243
+ for (const d of e) {
244
+ const v = { type: d.type, value: d.value, classification: i.classification };
245
+ let I = await ((f = t.status) == null ? void 0 : f.findOne({
246
+ selector: v
247
+ }).incrementalPatch({
248
+ status: "in-progress"
249
+ }));
250
+ I || (I = await ((w = t.status) == null ? void 0 : w.insert({
251
+ id: await H(v.type, v.value, v.classification),
252
+ ...v,
253
+ status: "in-progress",
254
+ sources: i.sources
255
+ }))), I && h.push(I.toMutableJSON());
256
+ }
257
+ try {
258
+ const d = await ft(e, i.sources, i, o), v = Object.values(d).flatMap(Object.values).flatMap(Object.values);
259
+ return await U(v), d;
260
+ } catch (d) {
261
+ return console.error(d), {};
262
+ } finally {
263
+ t.status.bulkUpsert(
264
+ Qt(h, (d) => d.id).map((d) => (d.status = "complete", d))
265
+ );
266
+ }
267
+ },
268
+ [
269
+ D,
270
+ O,
271
+ q,
272
+ B,
273
+ E,
274
+ u,
275
+ m,
276
+ y,
277
+ t,
278
+ U
279
+ ]
280
+ ), A = K(
281
+ () => Pt(
282
+ async () => {
283
+ if (t != null && t.status) {
284
+ if (t.status.closed) {
285
+ console.warn("Status database is closed, will not enrich");
286
+ return;
287
+ }
288
+ } else return;
289
+ const e = await t.status.find({ selector: { status: "pending" } }).update({ $set: { status: "in-progress" } });
290
+ if (e.length < 1)
291
+ return;
292
+ const s = Jt(e, P);
293
+ G(
294
+ `Enriching ${e.length} selectors in ${s.length} chunks of ${P}.`,
295
+ C
296
+ ), await Promise.all(
297
+ // For performance reasons, we chunk the requests. This will allow us to take advantage of parellelization in the
298
+ // backend, both on the pod level and kubernetes level
299
+ s.map(async (c) => {
300
+ let i = null;
301
+ if (R.current <= Q)
302
+ R.current += 1;
303
+ else {
304
+ let a = Date.now();
305
+ await new Promise((l) => {
306
+ i = setInterval(() => {
307
+ G(
308
+ `Waiting on ${R.current} existing requests to complete (total delay: ${Date.now() - a}ms)`,
309
+ C
310
+ ), R.current < Q && l();
311
+ }, 400);
312
+ }).finally(() => {
313
+ R.current += 1, clearInterval(i);
314
+ });
315
+ }
316
+ try {
317
+ const a = {}, l = pt(c.flatMap((o) => o.sources ?? []));
318
+ l.length > 0 && (a.sources = l), await W(
319
+ c.map((o) => o.toSelector()),
320
+ a
321
+ ), await t.status.findByIds(c.map((o) => o.id)).update({ $set: { status: "complete" } });
322
+ } catch (a) {
323
+ console.error(a);
324
+ } finally {
325
+ R.current -= 1, i && clearInterval(i);
326
+ }
327
+ })
328
+ );
329
+ },
330
+ 200,
331
+ { maxWait: 500, leading: !1 }
332
+ ),
333
+ [W, P, t, C, Q]
334
+ );
335
+ j(() => {
336
+ }, [t, C]), j(() => {
337
+ if (!M || !x || !(t != null && t.status))
338
+ return;
339
+ if (t != null && t.status.closed) {
340
+ console.warn("Status collection is closed");
341
+ return;
342
+ }
343
+ const e = t.status.find({
344
+ selector: {
345
+ status: "pending"
346
+ }
347
+ }).$.subscribe(() => A());
348
+ return () => {
349
+ try {
350
+ e == null || e.unsubscribe(), A.cancel();
351
+ } catch (s) {
352
+ console.warn(s);
353
+ }
354
+ };
355
+ }, [M, x, t, C, A, (ut = t == null ? void 0 : t.status) == null ? void 0 : ut.closed]);
356
+ const nt = g(
357
+ async (e, s, c) => {
358
+ var l, o;
359
+ if (!e)
360
+ throw new Error("Type cannot be null");
361
+ if (!s)
362
+ throw new Error("Value cannot be null");
363
+ if (!t.status || t.status.closed) {
364
+ console.warn("status collection is closed");
365
+ return;
366
+ }
367
+ const i = { type: e, value: s, classification: c ?? E };
368
+ let a = await ((l = t.status) == null ? void 0 : l.findOne({
369
+ selector: i
370
+ }).exec());
371
+ return a || (a = await ((o = t.status) == null ? void 0 : o.queueInsert({
372
+ id: await H(i.type, i.value, i.classification),
373
+ ...i,
374
+ status: "pending"
375
+ }))), a;
376
+ },
377
+ [E, t]
378
+ ), rt = g(async () => {
379
+ if (!(t != null && t.selectors) || t.selectors.closed)
380
+ return;
381
+ const e = await t.selectors.find({ selector: { error: { $exists: !0 } } }).exec(), s = dt(e, "classification"), c = [];
382
+ for (const [i, a] of Object.entries(s)) {
383
+ const l = dt(a, (o) => `${o.type}:${o.value}`);
384
+ for (const o of Object.values(l))
385
+ c.push({
386
+ id: await H(o[0].type, o[0].value, i),
387
+ type: o[0].type,
388
+ value: o[0].value,
389
+ classification: i,
390
+ sources: pt(o.map((h) => h.source)).sort(),
391
+ status: "pending"
392
+ });
393
+ }
394
+ c.length > 0 && (await t.status.bulkInsert(c), M && x && A()), await t.selectors.bulkRemove(e);
395
+ }, [t, M, A, x]), it = g(
396
+ (e) => {
397
+ var l, o;
398
+ if (!e)
399
+ return null;
400
+ const s = Object.entries(V), c = (l = s.find(([h, f]) => f.exec(e))) == null ? void 0 : l[0];
401
+ if (c)
402
+ return c;
403
+ const i = e.toLowerCase(), a = (o = s.find(([h, f]) => f.exec(i))) == null ? void 0 : o[0];
404
+ return a || null;
405
+ },
406
+ [V]
407
+ ), Et = K(
408
+ () => {
409
+ var e;
410
+ return {
411
+ bulkEnrich: W,
412
+ enrich: st,
413
+ enrichFailedEnrichments: rt,
414
+ sources: O,
415
+ setSources: vt,
416
+ typesDetection: V,
417
+ supportedTypes: T,
418
+ availableSources: q,
419
+ guessType: it,
420
+ queueEnrich: nt,
421
+ setCustomIconify: et,
422
+ setDefaultClassification: N,
423
+ setReady: wt,
424
+ defaultClassification: E,
425
+ ready: x && !!t && !!((e = $.config) != null && e.c12nDef) && (Ut(F) || L)
426
+ };
427
+ },
428
+ [
429
+ W,
430
+ st,
431
+ rt,
432
+ O,
433
+ V,
434
+ T,
435
+ q,
436
+ it,
437
+ nt,
438
+ N,
439
+ E,
440
+ x,
441
+ t,
442
+ (lt = $.config) == null ? void 0 : lt.c12nDef,
443
+ L
444
+ ]
445
+ );
446
+ return /* @__PURE__ */ Ct(Yt.Provider, { value: Et, children: n });
447
+ };
448
+ export {
449
+ Yt as C,
450
+ pe as a,
451
+ Qt as u
452
+ };
@@ -0,0 +1,6 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { memo as r } from "react";
3
+ const t = ({ children: e = null }) => /* @__PURE__ */ o("div", { style: { flex: 1 }, children: e }), n = r(t);
4
+ export {
5
+ n as F
6
+ };
@@ -0,0 +1,179 @@
1
+ import { b as d, r as _ } from "./_baseGetTag-CxDaTem-.js";
2
+ import { i as l } from "./isObject-B53jY8Qg.js";
3
+ var v = "[object AsyncFunction]", g = "[object Function]", y = "[object GeneratorFunction]", b = "[object Proxy]";
4
+ function C(t) {
5
+ if (!l(t))
6
+ return !1;
7
+ var e = d(t);
8
+ return e == g || e == y || e == v || e == b;
9
+ }
10
+ var u = _["__core-js_shared__"], p = (function() {
11
+ var t = /[^.]+$/.exec(u && u.keys && u.keys.IE_PROTO || "");
12
+ return t ? "Symbol(src)_1." + t : "";
13
+ })();
14
+ function m(t) {
15
+ return !!p && p in t;
16
+ }
17
+ var O = Function.prototype, P = O.toString;
18
+ function w(t) {
19
+ if (t != null) {
20
+ try {
21
+ return P.call(t);
22
+ } catch {
23
+ }
24
+ try {
25
+ return t + "";
26
+ } catch {
27
+ }
28
+ }
29
+ return "";
30
+ }
31
+ var x = /[\\^$.*+?()[\]{}|]/g, j = /^\[object .+?Constructor\]$/, $ = Function.prototype, z = Object.prototype, S = $.toString, D = z.hasOwnProperty, H = RegExp(
32
+ "^" + S.call(D).replace(x, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
33
+ );
34
+ function F(t) {
35
+ if (!l(t) || m(t))
36
+ return !1;
37
+ var e = C(t) ? H : j;
38
+ return e.test(w(t));
39
+ }
40
+ function I(t, e) {
41
+ return t == null ? void 0 : t[e];
42
+ }
43
+ function f(t, e) {
44
+ var a = I(t, e);
45
+ return F(a) ? a : void 0;
46
+ }
47
+ function T(t, e) {
48
+ return t === e || t !== t && e !== e;
49
+ }
50
+ var i = f(Object, "create");
51
+ function E() {
52
+ this.__data__ = i ? i(null) : {}, this.size = 0;
53
+ }
54
+ function N(t) {
55
+ var e = this.has(t) && delete this.__data__[t];
56
+ return this.size -= e ? 1 : 0, e;
57
+ }
58
+ var M = "__lodash_hash_undefined__", G = Object.prototype, A = G.hasOwnProperty;
59
+ function R(t) {
60
+ var e = this.__data__;
61
+ if (i) {
62
+ var a = e[t];
63
+ return a === M ? void 0 : a;
64
+ }
65
+ return A.call(e, t) ? e[t] : void 0;
66
+ }
67
+ var K = Object.prototype, L = K.hasOwnProperty;
68
+ function U(t) {
69
+ var e = this.__data__;
70
+ return i ? e[t] !== void 0 : L.call(e, t);
71
+ }
72
+ var q = "__lodash_hash_undefined__";
73
+ function J(t, e) {
74
+ var a = this.__data__;
75
+ return this.size += this.has(t) ? 0 : 1, a[t] = i && e === void 0 ? q : e, this;
76
+ }
77
+ function n(t) {
78
+ var e = -1, a = t == null ? 0 : t.length;
79
+ for (this.clear(); ++e < a; ) {
80
+ var r = t[e];
81
+ this.set(r[0], r[1]);
82
+ }
83
+ }
84
+ n.prototype.clear = E;
85
+ n.prototype.delete = N;
86
+ n.prototype.get = R;
87
+ n.prototype.has = U;
88
+ n.prototype.set = J;
89
+ function V() {
90
+ this.__data__ = [], this.size = 0;
91
+ }
92
+ function h(t, e) {
93
+ for (var a = t.length; a--; )
94
+ if (T(t[a][0], e))
95
+ return a;
96
+ return -1;
97
+ }
98
+ var B = Array.prototype, Q = B.splice;
99
+ function W(t) {
100
+ var e = this.__data__, a = h(e, t);
101
+ if (a < 0)
102
+ return !1;
103
+ var r = e.length - 1;
104
+ return a == r ? e.pop() : Q.call(e, a, 1), --this.size, !0;
105
+ }
106
+ function X(t) {
107
+ var e = this.__data__, a = h(e, t);
108
+ return a < 0 ? void 0 : e[a][1];
109
+ }
110
+ function Y(t) {
111
+ return h(this.__data__, t) > -1;
112
+ }
113
+ function Z(t, e) {
114
+ var a = this.__data__, r = h(a, t);
115
+ return r < 0 ? (++this.size, a.push([t, e])) : a[r][1] = e, this;
116
+ }
117
+ function o(t) {
118
+ var e = -1, a = t == null ? 0 : t.length;
119
+ for (this.clear(); ++e < a; ) {
120
+ var r = t[e];
121
+ this.set(r[0], r[1]);
122
+ }
123
+ }
124
+ o.prototype.clear = V;
125
+ o.prototype.delete = W;
126
+ o.prototype.get = X;
127
+ o.prototype.has = Y;
128
+ o.prototype.set = Z;
129
+ var k = f(_, "Map");
130
+ function tt() {
131
+ this.size = 0, this.__data__ = {
132
+ hash: new n(),
133
+ map: new (k || o)(),
134
+ string: new n()
135
+ };
136
+ }
137
+ function et(t) {
138
+ var e = typeof t;
139
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
140
+ }
141
+ function c(t, e) {
142
+ var a = t.__data__;
143
+ return et(e) ? a[typeof e == "string" ? "string" : "hash"] : a.map;
144
+ }
145
+ function at(t) {
146
+ var e = c(this, t).delete(t);
147
+ return this.size -= e ? 1 : 0, e;
148
+ }
149
+ function rt(t) {
150
+ return c(this, t).get(t);
151
+ }
152
+ function nt(t) {
153
+ return c(this, t).has(t);
154
+ }
155
+ function ot(t, e) {
156
+ var a = c(this, t), r = a.size;
157
+ return a.set(t, e), this.size += a.size == r ? 0 : 1, this;
158
+ }
159
+ function s(t) {
160
+ var e = -1, a = t == null ? 0 : t.length;
161
+ for (this.clear(); ++e < a; ) {
162
+ var r = t[e];
163
+ this.set(r[0], r[1]);
164
+ }
165
+ }
166
+ s.prototype.clear = tt;
167
+ s.prototype.delete = at;
168
+ s.prototype.get = rt;
169
+ s.prototype.has = nt;
170
+ s.prototype.set = ot;
171
+ export {
172
+ o as L,
173
+ k as M,
174
+ s as a,
175
+ T as e,
176
+ f as g,
177
+ C as i,
178
+ w as t
179
+ };
@@ -0,0 +1,6 @@
1
+ import { g as r } from "./_MapCache-DRK-s2eK.js";
2
+ import { r as t } from "./_baseGetTag-CxDaTem-.js";
3
+ var e = r(t, "Set");
4
+ export {
5
+ e as S
6
+ };