@buoy-gg/events 7.0.41 → 7.0.42
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/README.md +11 -64
- package/lib/commonjs/components/EventsCopySettingsView.js +1 -581
- package/lib/commonjs/components/EventsModal.js +1 -378
- package/lib/commonjs/components/ReactQueryEventDetail.js +1 -433
- package/lib/commonjs/components/UnifiedEventDetail.js +1 -565
- package/lib/commonjs/components/UnifiedEventFilters.js +1 -160
- package/lib/commonjs/components/UnifiedEventItem.js +1 -416
- package/lib/commonjs/components/UnifiedEventList.js +1 -187
- package/lib/commonjs/components/UnifiedEventViewer.js +1 -130
- package/lib/commonjs/hooks/useUnifiedEvents.js +1 -419
- package/lib/commonjs/index.js +1 -282
- package/lib/commonjs/preset.js +1 -60
- package/lib/commonjs/sources/sourceIds.js +1 -30
- package/lib/commonjs/stores/unifiedEventStore.js +1 -712
- package/lib/commonjs/sync/eventsSyncAdapter.js +1 -358
- package/lib/commonjs/types/copySettings.js +1 -249
- package/lib/commonjs/types/index.js +1 -17
- package/lib/commonjs/utils/autoDiscoverEventSources.js +1 -1068
- package/lib/commonjs/utils/badgeSelectionStorage.js +1 -126
- package/lib/commonjs/utils/copySettingsStorage.js +1 -43
- package/lib/commonjs/utils/correlationUtils.js +1 -130
- package/lib/commonjs/utils/eventExportFormatter.js +1 -1912
- package/lib/commonjs/utils/eventTransformers.js +1 -496
- package/lib/commonjs/utils/eventVisibility.js +1 -76
- package/lib/commonjs/utils/testIDs.js +1 -91
- package/lib/module/components/EventsCopySettingsView.js +1 -577
- package/lib/module/components/EventsModal.js +1 -374
- package/lib/module/components/ReactQueryEventDetail.js +1 -429
- package/lib/module/components/UnifiedEventDetail.js +1 -561
- package/lib/module/components/UnifiedEventFilters.js +1 -156
- package/lib/module/components/UnifiedEventItem.js +1 -412
- package/lib/module/components/UnifiedEventList.js +1 -183
- package/lib/module/components/UnifiedEventViewer.js +1 -126
- package/lib/module/hooks/useUnifiedEvents.js +1 -416
- package/lib/module/index.js +1 -102
- package/lib/module/preset.js +1 -57
- package/lib/module/sources/sourceIds.js +1 -26
- package/lib/module/stores/unifiedEventStore.js +1 -678
- package/lib/module/sync/eventsSyncAdapter.js +1 -354
- package/lib/module/types/copySettings.js +1 -244
- package/lib/module/types/index.js +1 -37
- package/lib/module/utils/autoDiscoverEventSources.js +1 -1060
- package/lib/module/utils/badgeSelectionStorage.js +1 -116
- package/lib/module/utils/copySettingsStorage.js +1 -37
- package/lib/module/utils/correlationUtils.js +1 -120
- package/lib/module/utils/eventExportFormatter.js +1 -1901
- package/lib/module/utils/eventTransformers.js +1 -487
- package/lib/module/utils/eventVisibility.js +1 -70
- package/lib/module/utils/testIDs.js +1 -83
- package/lib/web/index.mjs +9 -10
- package/package.json +3 -3
- package/lib/commonjs/components/EventsCopySettingsView.js.map +0 -1
- package/lib/commonjs/components/EventsModal.js.map +0 -1
- package/lib/commonjs/components/ReactQueryEventDetail.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventDetail.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventFilters.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventItem.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventList.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventViewer.js.map +0 -1
- package/lib/commonjs/hooks/useUnifiedEvents.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/preset.js.map +0 -1
- package/lib/commonjs/sources/sourceIds.js.map +0 -1
- package/lib/commonjs/stores/unifiedEventStore.js.map +0 -1
- package/lib/commonjs/sync/eventsSyncAdapter.js.map +0 -1
- package/lib/commonjs/types/copySettings.js.map +0 -1
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/utils/autoDiscoverEventSources.js.map +0 -1
- package/lib/commonjs/utils/badgeSelectionStorage.js.map +0 -1
- package/lib/commonjs/utils/copySettingsStorage.js.map +0 -1
- package/lib/commonjs/utils/correlationUtils.js.map +0 -1
- package/lib/commonjs/utils/eventExportFormatter.js.map +0 -1
- package/lib/commonjs/utils/eventTransformers.js.map +0 -1
- package/lib/commonjs/utils/eventVisibility.js.map +0 -1
- package/lib/commonjs/utils/testIDs.js.map +0 -1
- package/lib/module/components/EventsCopySettingsView.js.map +0 -1
- package/lib/module/components/EventsModal.js.map +0 -1
- package/lib/module/components/ReactQueryEventDetail.js.map +0 -1
- package/lib/module/components/UnifiedEventDetail.js.map +0 -1
- package/lib/module/components/UnifiedEventFilters.js.map +0 -1
- package/lib/module/components/UnifiedEventItem.js.map +0 -1
- package/lib/module/components/UnifiedEventList.js.map +0 -1
- package/lib/module/components/UnifiedEventViewer.js.map +0 -1
- package/lib/module/hooks/useUnifiedEvents.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/preset.js.map +0 -1
- package/lib/module/sources/sourceIds.js.map +0 -1
- package/lib/module/stores/unifiedEventStore.js.map +0 -1
- package/lib/module/sync/eventsSyncAdapter.js.map +0 -1
- package/lib/module/types/copySettings.js.map +0 -1
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/utils/autoDiscoverEventSources.js.map +0 -1
- package/lib/module/utils/badgeSelectionStorage.js.map +0 -1
- package/lib/module/utils/copySettingsStorage.js.map +0 -1
- package/lib/module/utils/correlationUtils.js.map +0 -1
- package/lib/module/utils/eventExportFormatter.js.map +0 -1
- package/lib/module/utils/eventTransformers.js.map +0 -1
- package/lib/module/utils/eventVisibility.js.map +0 -1
- package/lib/module/utils/testIDs.js.map +0 -1
- package/lib/typescript/components/EventsCopySettingsView.d.ts.map +0 -1
- package/lib/typescript/components/EventsModal.d.ts.map +0 -1
- package/lib/typescript/components/ReactQueryEventDetail.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventDetail.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventFilters.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventItem.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventList.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventViewer.d.ts.map +0 -1
- package/lib/typescript/hooks/useUnifiedEvents.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/sources/sourceIds.d.ts.map +0 -1
- package/lib/typescript/stores/unifiedEventStore.d.ts.map +0 -1
- package/lib/typescript/sync/eventsSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/types/copySettings.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/utils/autoDiscoverEventSources.d.ts.map +0 -1
- package/lib/typescript/utils/badgeSelectionStorage.d.ts.map +0 -1
- package/lib/typescript/utils/copySettingsStorage.d.ts.map +0 -1
- package/lib/typescript/utils/correlationUtils.d.ts.map +0 -1
- package/lib/typescript/utils/eventExportFormatter.d.ts.map +0 -1
- package/lib/typescript/utils/eventTransformers.d.ts.map +0 -1
- package/lib/typescript/utils/eventVisibility.d.ts.map +0 -1
- package/lib/typescript/utils/testIDs.d.ts.map +0 -1
|
@@ -1,116 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Badge Selection Storage
|
|
5
|
-
*
|
|
6
|
-
* Utilities for persisting and restoring the enabled event source badges.
|
|
7
|
-
* Uses the same storage patterns as other packages (React Query, Network, etc.)
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { persistentStorage, devToolsStorageKeys } from "@buoy-gg/shared-ui";
|
|
11
|
-
/**
|
|
12
|
-
* Save the enabled sources to persistent storage
|
|
13
|
-
*/
|
|
14
|
-
export async function saveEnabledSources(sources) {
|
|
15
|
-
try {
|
|
16
|
-
const key = devToolsStorageKeys.events.enabledSources();
|
|
17
|
-
await persistentStorage.setItem(key, JSON.stringify(sources));
|
|
18
|
-
} catch {
|
|
19
|
-
// Silently fail - persistence is optional
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Load the enabled sources from persistent storage
|
|
25
|
-
* Returns null if no saved state exists
|
|
26
|
-
*/
|
|
27
|
-
export async function loadEnabledSources() {
|
|
28
|
-
try {
|
|
29
|
-
const key = devToolsStorageKeys.events.enabledSources();
|
|
30
|
-
const value = await persistentStorage.getItem(key);
|
|
31
|
-
if (value && value !== "") {
|
|
32
|
-
return JSON.parse(value);
|
|
33
|
-
}
|
|
34
|
-
return null;
|
|
35
|
-
} catch {
|
|
36
|
-
// Silently fail - return null to use defaults
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Clear the saved enabled sources
|
|
43
|
-
*/
|
|
44
|
-
export async function clearEnabledSources() {
|
|
45
|
-
try {
|
|
46
|
-
const key = devToolsStorageKeys.events.enabledSources();
|
|
47
|
-
await persistentStorage.removeItem(key);
|
|
48
|
-
} catch {
|
|
49
|
-
// Silently fail
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Save the capturing state to persistent storage
|
|
55
|
-
*/
|
|
56
|
-
export async function saveCapturingState(isCapturing) {
|
|
57
|
-
try {
|
|
58
|
-
const key = devToolsStorageKeys.events.isCapturing();
|
|
59
|
-
await persistentStorage.setItem(key, JSON.stringify(isCapturing));
|
|
60
|
-
} catch {
|
|
61
|
-
// Silently fail - persistence is optional
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Load the capturing state from persistent storage
|
|
67
|
-
* Returns null if no saved state exists (defaults to true on first load)
|
|
68
|
-
*/
|
|
69
|
-
export async function loadCapturingState() {
|
|
70
|
-
try {
|
|
71
|
-
const key = devToolsStorageKeys.events.isCapturing();
|
|
72
|
-
const value = await persistentStorage.getItem(key);
|
|
73
|
-
if (value !== null && value !== "") {
|
|
74
|
-
return JSON.parse(value);
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
} catch {
|
|
78
|
-
// Silently fail - return null to use defaults
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Persist the moment capture was switched off (ms epoch), or clear it on
|
|
85
|
-
* resume. Kept beside the capturing flag so a remount or relaunch while paused
|
|
86
|
-
* hides events captured into the shared store since the ORIGINAL pause press,
|
|
87
|
-
* not merely since the tool was reopened.
|
|
88
|
-
*/
|
|
89
|
-
export async function savePausedAt(pausedAt) {
|
|
90
|
-
try {
|
|
91
|
-
const key = devToolsStorageKeys.events.pausedAt();
|
|
92
|
-
if (pausedAt === null) {
|
|
93
|
-
await persistentStorage.removeItem(key);
|
|
94
|
-
} else {
|
|
95
|
-
await persistentStorage.setItem(key, JSON.stringify(pausedAt));
|
|
96
|
-
}
|
|
97
|
-
} catch {
|
|
98
|
-
// Silently fail - persistence is optional
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** The persisted pause moment, or null when capture is not paused. */
|
|
103
|
-
export async function loadPausedAt() {
|
|
104
|
-
try {
|
|
105
|
-
const key = devToolsStorageKeys.events.pausedAt();
|
|
106
|
-
const value = await persistentStorage.getItem(key);
|
|
107
|
-
if (value !== null && value !== "") {
|
|
108
|
-
const parsed = JSON.parse(value);
|
|
109
|
-
return typeof parsed === "number" ? parsed : null;
|
|
110
|
-
}
|
|
111
|
-
return null;
|
|
112
|
-
} catch {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=badgeSelectionStorage.js.map
|
|
1
|
+
"use strict";import{persistentStorage as n,devToolsStorageKeys as a}from"@buoy-gg/shared-ui";export async function saveEnabledSources(e){try{const t=a.events.enabledSources();await n.setItem(t,JSON.stringify(e))}catch{}}export async function loadEnabledSources(){try{const e=a.events.enabledSources();const t=await n.getItem(e);if(t&&t!==""){return JSON.parse(t)}return null}catch{return null}}export async function clearEnabledSources(){try{const e=a.events.enabledSources();await n.removeItem(e)}catch{}}export async function saveCapturingState(e){try{const t=a.events.isCapturing();await n.setItem(t,JSON.stringify(e))}catch{}}export async function loadCapturingState(){try{const e=a.events.isCapturing();const t=await n.getItem(e);if(t!==null&&t!==""){return JSON.parse(t)}return null}catch{return null}}export async function savePausedAt(e){try{const t=a.events.pausedAt();if(e===null){await n.removeItem(t)}else{await n.setItem(t,JSON.stringify(e))}}catch{}}export async function loadPausedAt(){try{const e=a.events.pausedAt();const t=await n.getItem(e);if(t!==null&&t!==""){const r=JSON.parse(t);return typeof r==="number"?r:null}return null}catch{return null}}
|
|
@@ -1,37 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Copy Settings Storage
|
|
5
|
-
*
|
|
6
|
-
* Persists the events copy/export settings through the shared
|
|
7
|
-
* `definePersistedSetting` (merge-over-defaults, best-effort save/clear).
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { definePersistedSetting, devToolsStorageKeys } from "@buoy-gg/shared-ui";
|
|
11
|
-
import { DEFAULT_COPY_SETTINGS } from "../types/copySettings";
|
|
12
|
-
const copySettings = definePersistedSetting(devToolsStorageKeys.events.copySettings(), DEFAULT_COPY_SETTINGS, {
|
|
13
|
-
// Ensure filterSources is always an array
|
|
14
|
-
sanitize: (merged, stored) => ({
|
|
15
|
-
...merged,
|
|
16
|
-
filterSources: stored?.filterSources ?? DEFAULT_COPY_SETTINGS.filterSources
|
|
17
|
-
})
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
/** Save the copy settings to persistent storage */
|
|
21
|
-
export async function saveCopySettings(settings) {
|
|
22
|
-
await copySettings.save(settings);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Load the copy settings from persistent storage
|
|
27
|
-
* Returns null if no saved state exists
|
|
28
|
-
*/
|
|
29
|
-
export async function loadCopySettings() {
|
|
30
|
-
return copySettings.loadOrNull();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Clear the saved copy settings */
|
|
34
|
-
export async function clearCopySettings() {
|
|
35
|
-
await copySettings.clear();
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=copySettingsStorage.js.map
|
|
1
|
+
"use strict";import{definePersistedSetting as i,devToolsStorageKeys as r}from"@buoy-gg/shared-ui";import{DEFAULT_COPY_SETTINGS as o}from"../types/copySettings";const e=i(r.events.copySettings(),o,{sanitize:(t,s)=>({...t,filterSources:s?.filterSources??o.filterSources})});export async function saveCopySettings(t){await e.save(t)}export async function loadCopySettings(){return e.loadOrNull()}export async function clearCopySettings(){await e.clear()}
|
|
@@ -1,120 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Correlation Utilities
|
|
5
|
-
*
|
|
6
|
-
* Functions for finding and grouping related events based on correlation IDs.
|
|
7
|
-
* Similar to Redux DevTools' async thunk linking feature.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Find all events related to the given event by correlation ID
|
|
12
|
-
*/
|
|
13
|
-
export function findRelatedEvents(event, allEvents) {
|
|
14
|
-
if (!event.correlationId) {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
return allEvents.filter(e => e.correlationId === event.correlationId && e.id !== event.id).sort((a, b) => a.timestamp - b.timestamp);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Check if an event has related events
|
|
22
|
-
*/
|
|
23
|
-
export function hasRelatedEvents(event, allEvents) {
|
|
24
|
-
if (!event.correlationId) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return allEvents.some(e => e.correlationId === event.correlationId && e.id !== event.id);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Get count of related events (including the current one)
|
|
32
|
-
*/
|
|
33
|
-
export function getRelatedEventsCount(event, allEvents) {
|
|
34
|
-
if (!event.correlationId) {
|
|
35
|
-
return 1;
|
|
36
|
-
}
|
|
37
|
-
return allEvents.filter(e => e.correlationId === event.correlationId).length;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Build a map of correlation ID -> count for efficient lookup
|
|
42
|
-
*/
|
|
43
|
-
export function buildCorrelationCountMap(events) {
|
|
44
|
-
const countMap = new Map();
|
|
45
|
-
for (const event of events) {
|
|
46
|
-
if (event.correlationId) {
|
|
47
|
-
const current = countMap.get(event.correlationId) || 0;
|
|
48
|
-
countMap.set(event.correlationId, current + 1);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return countMap;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Get all events in a correlation group, sorted by sequence
|
|
56
|
-
*/
|
|
57
|
-
export function getCorrelationGroup(correlationId, allEvents) {
|
|
58
|
-
return allEvents.filter(e => e.correlationId === correlationId).sort((a, b) => {
|
|
59
|
-
// Sort by sequence first, then by timestamp
|
|
60
|
-
const seqA = a.sequenceInGroup ?? 0;
|
|
61
|
-
const seqB = b.sequenceInGroup ?? 0;
|
|
62
|
-
if (seqA !== seqB) {
|
|
63
|
-
return seqA - seqB;
|
|
64
|
-
}
|
|
65
|
-
return a.timestamp - b.timestamp;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Generate a display label for correlated events (e.g., "1/2" for first of two)
|
|
71
|
-
*/
|
|
72
|
-
export function getCorrelationLabel(event, allEvents) {
|
|
73
|
-
if (!event.correlationId) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
const group = getCorrelationGroup(event.correlationId, allEvents);
|
|
77
|
-
if (group.length <= 1) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
const index = group.findIndex(e => e.id === event.id);
|
|
81
|
-
if (index === -1) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
return `${index + 1}/${group.length}`;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Color palette for correlation groups (cycles through for different groups)
|
|
89
|
-
*/
|
|
90
|
-
const CORRELATION_COLORS = ["#EC4899",
|
|
91
|
-
// Pink (React Query default)
|
|
92
|
-
"#8B5CF6",
|
|
93
|
-
// Purple
|
|
94
|
-
"#3B82F6",
|
|
95
|
-
// Blue
|
|
96
|
-
"#10B981",
|
|
97
|
-
// Green
|
|
98
|
-
"#F59E0B",
|
|
99
|
-
// Orange
|
|
100
|
-
"#EF4444",
|
|
101
|
-
// Red
|
|
102
|
-
"#06B6D4",
|
|
103
|
-
// Cyan
|
|
104
|
-
"#84CC16" // Lime
|
|
105
|
-
];
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Get a consistent color for a correlation group
|
|
109
|
-
*/
|
|
110
|
-
export function getCorrelationColor(correlationId) {
|
|
111
|
-
// Use a simple hash to get a consistent color for each correlation ID
|
|
112
|
-
let hash = 0;
|
|
113
|
-
for (let i = 0; i < correlationId.length; i++) {
|
|
114
|
-
hash = (hash << 5) - hash + correlationId.charCodeAt(i);
|
|
115
|
-
hash |= 0; // Convert to 32bit integer
|
|
116
|
-
}
|
|
117
|
-
const index = Math.abs(hash) % CORRELATION_COLORS.length;
|
|
118
|
-
return CORRELATION_COLORS[index];
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=correlationUtils.js.map
|
|
1
|
+
"use strict";export function findRelatedEvents(r,n){if(!r.correlationId){return[]}return n.filter(t=>t.correlationId===r.correlationId&&t.id!==r.id).sort((t,o)=>t.timestamp-o.timestamp)}export function hasRelatedEvents(r,n){if(!r.correlationId){return false}return n.some(t=>t.correlationId===r.correlationId&&t.id!==r.id)}export function getRelatedEventsCount(r,n){if(!r.correlationId){return 1}return n.filter(t=>t.correlationId===r.correlationId).length}export function buildCorrelationCountMap(r){const n=new Map;for(const t of r){if(t.correlationId){const o=n.get(t.correlationId)||0;n.set(t.correlationId,o+1)}}return n}export function getCorrelationGroup(r,n){return n.filter(t=>t.correlationId===r).sort((t,o)=>{const e=t.sequenceInGroup??0;const i=o.sequenceInGroup??0;if(e!==i){return e-i}return t.timestamp-o.timestamp})}export function getCorrelationLabel(r,n){if(!r.correlationId){return null}const t=getCorrelationGroup(r.correlationId,n);if(t.length<=1){return null}const o=t.findIndex(e=>e.id===r.id);if(o===-1){return null}return`${o+1}/${t.length}`}const l=["#EC4899","#8B5CF6","#3B82F6","#10B981","#F59E0B","#EF4444","#06B6D4","#84CC16"];export function getCorrelationColor(r){let n=0;for(let o=0;o<r.length;o++){n=(n<<5)-n+r.charCodeAt(o);n|=0}const t=Math.abs(n)%l.length;return l[t]}
|