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