@concavejs/devtools 0.0.1-alpha.10
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 +263 -0
- package/dist/client-CRYWrjNv.js +3590 -0
- package/dist/client.d.ts +7 -0
- package/dist/client.js +6 -0
- package/dist/extension/page-agent.d.ts +8 -0
- package/dist/extension/panel.d.ts +14 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +486 -0
- package/dist/interceptor/index.d.ts +5 -0
- package/dist/interceptor/websocket-interceptor.d.ts +68 -0
- package/dist/overlay/ActivityPanel.d.ts +18 -0
- package/dist/overlay/ContextMenu.d.ts +23 -0
- package/dist/overlay/DataInspector.d.ts +12 -0
- package/dist/overlay/DevToolbar.d.ts +19 -0
- package/dist/overlay/LogsPanel.d.ts +10 -0
- package/dist/overlay/NetworkPanel.d.ts +9 -0
- package/dist/overlay/PerformancePanel.d.ts +10 -0
- package/dist/overlay/SearchField.d.ts +9 -0
- package/dist/overlay/SettingsPanel.d.ts +9 -0
- package/dist/overlay/SubscriptionsPanel.d.ts +9 -0
- package/dist/overlay/TimelinePanel.d.ts +9 -0
- package/dist/overlay/TraceViewer.d.ts +7 -0
- package/dist/overlay/utils.d.ts +30 -0
- package/dist/standalone.d.ts +11 -0
- package/dist/store/event-store.d.ts +191 -0
- package/dist/store/safe-storage.d.ts +7 -0
- package/dist/types.d.ts +211 -0
- package/dist/version.d.ts +10 -0
- package/dist/vite-plugin/index.d.ts +16 -0
- package/dist/vite-plugin.js +668 -0
- package/package.json +62 -0
|
@@ -0,0 +1,3590 @@
|
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as et } from "react/jsx-runtime";
|
|
2
|
+
import { createRoot as he } from "react-dom/client";
|
|
3
|
+
import me, { useState as z, useMemo as V, useEffect as U, useRef as Ct, useCallback as J } from "react";
|
|
4
|
+
let kt = null;
|
|
5
|
+
function Wt() {
|
|
6
|
+
if (kt !== null) return kt;
|
|
7
|
+
try {
|
|
8
|
+
const e = "__concave_test__";
|
|
9
|
+
localStorage.setItem(e, "1"), localStorage.removeItem(e), kt = !0;
|
|
10
|
+
} catch {
|
|
11
|
+
kt = !1;
|
|
12
|
+
}
|
|
13
|
+
return kt;
|
|
14
|
+
}
|
|
15
|
+
function Vt(e) {
|
|
16
|
+
if (!Wt()) return null;
|
|
17
|
+
try {
|
|
18
|
+
return localStorage.getItem(e);
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function Jt(e, r) {
|
|
24
|
+
if (Wt())
|
|
25
|
+
try {
|
|
26
|
+
localStorage.setItem(e, r);
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function Yt(e) {
|
|
31
|
+
if (Wt())
|
|
32
|
+
try {
|
|
33
|
+
localStorage.removeItem(e);
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const be = "0.0.1-alpha.9", Zt = {
|
|
38
|
+
version: be
|
|
39
|
+
}, de = Zt.version.length > 0 ? Zt.version : "0.0.0", ce = de;
|
|
40
|
+
de.split("-")[0];
|
|
41
|
+
const ge = "concave-devtools-events", fe = "concave-devtools-settings", te = 200;
|
|
42
|
+
class Nt {
|
|
43
|
+
events = [];
|
|
44
|
+
maxEvents;
|
|
45
|
+
listeners = /* @__PURE__ */ new Set();
|
|
46
|
+
focusListeners = /* @__PURE__ */ new Set();
|
|
47
|
+
settingsListeners = /* @__PURE__ */ new Set();
|
|
48
|
+
subscriptions = /* @__PURE__ */ new Map();
|
|
49
|
+
snapshots = [];
|
|
50
|
+
maxSnapshots = 50;
|
|
51
|
+
isPaused = !1;
|
|
52
|
+
focusedEventId = null;
|
|
53
|
+
storageKey;
|
|
54
|
+
settingsKey;
|
|
55
|
+
persistenceEnabled;
|
|
56
|
+
recentEventIds = /* @__PURE__ */ new Set();
|
|
57
|
+
persistTimer = null;
|
|
58
|
+
settings = {
|
|
59
|
+
persistEvents: !0,
|
|
60
|
+
maxEvents: 1e3,
|
|
61
|
+
captureLogLines: !0,
|
|
62
|
+
autoPauseOnError: !1,
|
|
63
|
+
wsLatencyMs: 0,
|
|
64
|
+
wsJitterMs: 0
|
|
65
|
+
};
|
|
66
|
+
static MIN_EVENTS = 100;
|
|
67
|
+
static MAX_EVENTS = 1e4;
|
|
68
|
+
static MAX_SIMULATED_LATENCY_MS = 5e3;
|
|
69
|
+
constructor(r = 1e3, a = "global") {
|
|
70
|
+
const s = typeof r == "number" ? { maxEvents: r, storageScope: a } : r, d = (s.storageScope ?? "global").trim() || "global";
|
|
71
|
+
this.storageKey = `${ge}:${d}`, this.settingsKey = `${fe}:${d}`, this.persistenceEnabled = s.enablePersistence !== !1, this.maxEvents = s.maxEvents ?? 1e3, this.persistenceEnabled || (this.settings.persistEvents = !1), this.loadSettings(), this.persistenceEnabled || (this.settings.persistEvents = !1), this.loadPersistedEvents();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Add an event to the store
|
|
75
|
+
*/
|
|
76
|
+
addEvent(r) {
|
|
77
|
+
if (!this.isPaused && !(r.type === "log" && !this.settings.captureLogLines) && !this.recentEventIds.has(r.id)) {
|
|
78
|
+
if (this.recentEventIds.add(r.id), this.recentEventIds.size > te) {
|
|
79
|
+
const a = this.recentEventIds.size - te, s = this.recentEventIds.values();
|
|
80
|
+
for (let d = 0; d < a; d++)
|
|
81
|
+
this.recentEventIds.delete(s.next().value);
|
|
82
|
+
}
|
|
83
|
+
if (this.reconcilePendingOperation(r), this.events.push(r), this.events.length > this.maxEvents + 100 && (this.events = this.events.slice(-this.maxEvents)), r.type === "subscription")
|
|
84
|
+
this.updateSubscription(r);
|
|
85
|
+
else if (r.type === "query" && r.status === "success") {
|
|
86
|
+
const a = this.subscriptions.get(r.queryId);
|
|
87
|
+
a && (a.previousValue = a.currentValue, a.updateCount++, a.lastUpdate = r.timestamp, a.currentValue = r.result, a.status = "active");
|
|
88
|
+
} else if (r.type === "query" && r.status === "error") {
|
|
89
|
+
const a = this.subscriptions.get(r.queryId);
|
|
90
|
+
a && (a.status = "error", a.error = r.error);
|
|
91
|
+
}
|
|
92
|
+
this.settings.autoPauseOnError && !this.isPaused && ("status" in r && r.status === "error" || r.type === "log" && r.level === "error") && (this.isPaused = !0), this.persistenceEnabled && this.settings.persistEvents && !this.persistTimer && (this.persistTimer = setTimeout(() => {
|
|
93
|
+
this.persistTimer = null, this.persistEvents();
|
|
94
|
+
}, 500)), this.listeners.forEach((a) => {
|
|
95
|
+
a(r);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Subscribe to new events
|
|
101
|
+
*/
|
|
102
|
+
subscribe(r) {
|
|
103
|
+
return this.listeners.add(r), () => this.listeners.delete(r);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Subscribe to focus/navigation changes across panels
|
|
107
|
+
*/
|
|
108
|
+
subscribeFocus(r) {
|
|
109
|
+
return this.focusListeners.add(r), () => this.focusListeners.delete(r);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Subscribe to settings changes
|
|
113
|
+
*/
|
|
114
|
+
subscribeSettings(r) {
|
|
115
|
+
return this.settingsListeners.add(r), () => this.settingsListeners.delete(r);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Set the currently focused event (for cross-panel navigation)
|
|
119
|
+
*/
|
|
120
|
+
setFocusedEventId(r) {
|
|
121
|
+
this.focusedEventId = r, this.focusListeners.forEach((a) => {
|
|
122
|
+
a(r);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get focused event id
|
|
127
|
+
*/
|
|
128
|
+
getFocusedEventId() {
|
|
129
|
+
return this.focusedEventId;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get all events
|
|
133
|
+
*/
|
|
134
|
+
getAllEvents() {
|
|
135
|
+
return [...this.events];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get events by type
|
|
139
|
+
*/
|
|
140
|
+
getEventsByType(r) {
|
|
141
|
+
return this.events.filter((a) => a.type === r);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get recent events
|
|
145
|
+
*/
|
|
146
|
+
getRecentEvents(r) {
|
|
147
|
+
return this.events.slice(-r);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Get events for a specific function
|
|
151
|
+
*/
|
|
152
|
+
getEventsByFunction(r) {
|
|
153
|
+
return this.events.filter((a) => "udfPath" in a ? a.udfPath === r : !1);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Get active subscriptions
|
|
157
|
+
*/
|
|
158
|
+
getActiveSubscriptions() {
|
|
159
|
+
return Array.from(this.subscriptions.values()).filter((r) => r.status === "active" || r.status === "error");
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get subscription by query ID
|
|
163
|
+
*/
|
|
164
|
+
getSubscription(r) {
|
|
165
|
+
return this.subscriptions.get(r);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Calculate performance metrics
|
|
169
|
+
*/
|
|
170
|
+
getPerformanceMetrics() {
|
|
171
|
+
const r = (b) => {
|
|
172
|
+
const N = typeof b == "number" ? b : typeof b == "string" ? Number(b) : Number.NaN;
|
|
173
|
+
return !Number.isFinite(N) || N < 0 ? null : N;
|
|
174
|
+
}, a = (b) => {
|
|
175
|
+
const N = [];
|
|
176
|
+
for (const k of b) {
|
|
177
|
+
if (k.status !== "success") continue;
|
|
178
|
+
const y = r(k.endToEndDurationMs ?? k.duration);
|
|
179
|
+
y !== null && N.push({ event: k, duration: y });
|
|
180
|
+
}
|
|
181
|
+
return N;
|
|
182
|
+
}, s = a(this.getEventsByType("query")), d = a(this.getEventsByType("mutation")), x = a(this.getEventsByType("action")), c = (b) => b.length === 0 ? 0 : b.reduce((k, y) => k + y, 0) / b.length, m = (b, N) => {
|
|
183
|
+
if (b.length === 0) return 0;
|
|
184
|
+
const k = [...b].sort((S, $) => S - $), y = Math.floor(k.length * N);
|
|
185
|
+
return k[Math.min(y, k.length - 1)] || 0;
|
|
186
|
+
}, w = [
|
|
187
|
+
...s.map(({ event: b, duration: N }) => ({
|
|
188
|
+
type: "query",
|
|
189
|
+
eventId: b.id,
|
|
190
|
+
udfPath: b.udfPath,
|
|
191
|
+
duration: N,
|
|
192
|
+
timestamp: b.timestamp
|
|
193
|
+
})),
|
|
194
|
+
...d.map(({ event: b, duration: N }) => ({
|
|
195
|
+
type: "mutation",
|
|
196
|
+
eventId: b.id,
|
|
197
|
+
udfPath: b.udfPath,
|
|
198
|
+
duration: N,
|
|
199
|
+
timestamp: b.timestamp
|
|
200
|
+
})),
|
|
201
|
+
...x.map(({ event: b, duration: N }) => ({
|
|
202
|
+
type: "action",
|
|
203
|
+
eventId: b.id,
|
|
204
|
+
udfPath: b.udfPath,
|
|
205
|
+
duration: N,
|
|
206
|
+
timestamp: b.timestamp
|
|
207
|
+
}))
|
|
208
|
+
].sort((b, N) => N.duration - b.duration).slice(0, 10), v = s.map(({ duration: b }) => b), E = d.map(({ duration: b }) => b), f = x.map(({ duration: b }) => b);
|
|
209
|
+
return {
|
|
210
|
+
totalQueries: s.length,
|
|
211
|
+
totalMutations: d.length,
|
|
212
|
+
totalActions: x.length,
|
|
213
|
+
avgQueryDuration: c(v),
|
|
214
|
+
avgMutationDuration: c(E),
|
|
215
|
+
avgActionDuration: c(f),
|
|
216
|
+
p50QueryDuration: m(v, 0.5),
|
|
217
|
+
p50MutationDuration: m(E, 0.5),
|
|
218
|
+
p50ActionDuration: m(f, 0.5),
|
|
219
|
+
p90QueryDuration: m(v, 0.9),
|
|
220
|
+
p90MutationDuration: m(E, 0.9),
|
|
221
|
+
p90ActionDuration: m(f, 0.9),
|
|
222
|
+
p95QueryDuration: m(v, 0.95),
|
|
223
|
+
p95MutationDuration: m(E, 0.95),
|
|
224
|
+
p95ActionDuration: m(f, 0.95),
|
|
225
|
+
p99QueryDuration: m(v, 0.99),
|
|
226
|
+
p99MutationDuration: m(E, 0.99),
|
|
227
|
+
p99ActionDuration: m(f, 0.99),
|
|
228
|
+
slowestOperations: w
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Clear all events
|
|
233
|
+
*/
|
|
234
|
+
clear() {
|
|
235
|
+
this.events = [], this.subscriptions.clear(), this.snapshots = [], this.setFocusedEventId(null), this.recentEventIds.clear(), Yt(this.storageKey), this.listeners.forEach((r) => {
|
|
236
|
+
r({
|
|
237
|
+
id: "clear",
|
|
238
|
+
timestamp: Date.now(),
|
|
239
|
+
type: "log",
|
|
240
|
+
level: "info",
|
|
241
|
+
message: "DevTools cleared"
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Pause event capture
|
|
247
|
+
*/
|
|
248
|
+
pause() {
|
|
249
|
+
this.isPaused = !0;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Resume event capture
|
|
253
|
+
*/
|
|
254
|
+
resume() {
|
|
255
|
+
this.isPaused = !1;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Check if paused
|
|
259
|
+
*/
|
|
260
|
+
isPausedState() {
|
|
261
|
+
return this.isPaused;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Create a snapshot of current state (for time-travel)
|
|
265
|
+
*/
|
|
266
|
+
createSnapshot() {
|
|
267
|
+
const r = {
|
|
268
|
+
timestamp: Date.now(),
|
|
269
|
+
events: [...this.events],
|
|
270
|
+
subscriptions: Array.from(this.subscriptions.entries())
|
|
271
|
+
};
|
|
272
|
+
this.snapshots.push(r), this.snapshots.length > this.maxSnapshots && this.snapshots.shift();
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Restore from a snapshot
|
|
276
|
+
*/
|
|
277
|
+
restoreSnapshot(r) {
|
|
278
|
+
const a = this.snapshots.find((s) => s.timestamp === r);
|
|
279
|
+
return a ? (this.events = [...a.events], this.subscriptions = new Map(a.subscriptions), this.setFocusedEventId(null), this.listeners.forEach((s) => {
|
|
280
|
+
s({
|
|
281
|
+
id: "restore",
|
|
282
|
+
timestamp: Date.now(),
|
|
283
|
+
type: "log",
|
|
284
|
+
level: "info",
|
|
285
|
+
message: `Restored to snapshot from ${new Date(r).toLocaleTimeString()}`
|
|
286
|
+
});
|
|
287
|
+
}), !0) : !1;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Get all snapshots
|
|
291
|
+
*/
|
|
292
|
+
getSnapshots() {
|
|
293
|
+
return [...this.snapshots];
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Export session data
|
|
297
|
+
*/
|
|
298
|
+
exportSession() {
|
|
299
|
+
return {
|
|
300
|
+
version: ce,
|
|
301
|
+
exportedAt: Date.now(),
|
|
302
|
+
events: [...this.events],
|
|
303
|
+
subscriptions: Array.from(this.subscriptions.entries()),
|
|
304
|
+
metadata: {
|
|
305
|
+
userAgent: navigator.userAgent,
|
|
306
|
+
url: window.location.href
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Import session data
|
|
312
|
+
*/
|
|
313
|
+
importSession(r) {
|
|
314
|
+
try {
|
|
315
|
+
if (!r || typeof r != "object" || !r.version || !r.events)
|
|
316
|
+
throw new Error("Invalid session format");
|
|
317
|
+
if (this.events = [], this.subscriptions.clear(), this.setFocusedEventId(null), this.events = this.sanitizeEvents(r.events).slice(-this.maxEvents), Array.isArray(r.subscriptions)) {
|
|
318
|
+
const a = r.subscriptions.filter(
|
|
319
|
+
(s) => Array.isArray(s) && s.length === 2 && typeof s[0] == "number" && Number.isFinite(s[0]) && typeof s[1] == "object" && s[1] !== null
|
|
320
|
+
);
|
|
321
|
+
this.subscriptions = new Map(a);
|
|
322
|
+
}
|
|
323
|
+
return this.listeners.forEach((a) => {
|
|
324
|
+
a({
|
|
325
|
+
id: "import",
|
|
326
|
+
timestamp: Date.now(),
|
|
327
|
+
type: "log",
|
|
328
|
+
level: "info",
|
|
329
|
+
message: `Imported ${this.events.length} events`
|
|
330
|
+
});
|
|
331
|
+
}), !0;
|
|
332
|
+
} catch (a) {
|
|
333
|
+
return console.error("[DevTools] Failed to import session:", a), !1;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Save settings
|
|
338
|
+
*/
|
|
339
|
+
saveSettings(r) {
|
|
340
|
+
this.settings = { ...this.settings, ...r }, this.persistenceEnabled || (this.settings.persistEvents = !1);
|
|
341
|
+
const a = this.normalizeMaxEvents(this.settings.maxEvents);
|
|
342
|
+
this.settings.maxEvents !== a && (this.settings.maxEvents = a), a !== this.maxEvents && (this.maxEvents = a), this.events.length > this.maxEvents && (this.events = this.events.slice(-this.maxEvents)), this.normalizeLatencySettings(), this.syncLatencyConfig(), this.persistenceEnabled && Jt(this.settingsKey, JSON.stringify(this.settings)), this.notifySettingsChanged();
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Get settings
|
|
346
|
+
*/
|
|
347
|
+
getSettings() {
|
|
348
|
+
return { ...this.settings };
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Whether this store supports local persistence
|
|
352
|
+
*/
|
|
353
|
+
isPersistenceEnabled() {
|
|
354
|
+
return this.persistenceEnabled;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Load settings from localStorage
|
|
358
|
+
*/
|
|
359
|
+
loadSettings() {
|
|
360
|
+
if (this.persistenceEnabled) {
|
|
361
|
+
try {
|
|
362
|
+
const r = Vt(this.settingsKey);
|
|
363
|
+
r && (this.settings = { ...this.settings, ...JSON.parse(r) }, this.maxEvents = this.normalizeMaxEvents(this.settings.maxEvents), this.settings.maxEvents = this.maxEvents, this.normalizeLatencySettings());
|
|
364
|
+
} catch (r) {
|
|
365
|
+
console.warn("[DevTools] Failed to load settings:", r);
|
|
366
|
+
}
|
|
367
|
+
this.syncLatencyConfig();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Push latency settings to the shared window config object
|
|
372
|
+
* that the WebSocket interceptors read on every send/receive.
|
|
373
|
+
*/
|
|
374
|
+
syncLatencyConfig() {
|
|
375
|
+
try {
|
|
376
|
+
window.__concaveDevToolsLatencyConfig = {
|
|
377
|
+
latencyMs: this.settings.wsLatencyMs || 0,
|
|
378
|
+
jitterMs: this.settings.wsJitterMs || 0
|
|
379
|
+
};
|
|
380
|
+
} catch {
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
notifySettingsChanged() {
|
|
384
|
+
const r = this.getSettings();
|
|
385
|
+
this.settingsListeners.forEach((a) => {
|
|
386
|
+
a(r);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Persist events to localStorage
|
|
391
|
+
*/
|
|
392
|
+
persistEvents() {
|
|
393
|
+
if (!(!this.persistenceEnabled || !this.settings.persistEvents))
|
|
394
|
+
try {
|
|
395
|
+
const r = this.events.slice(-100);
|
|
396
|
+
Jt(this.storageKey, JSON.stringify(r));
|
|
397
|
+
} catch (r) {
|
|
398
|
+
console.warn("[DevTools] Failed to persist events:", r);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Load persisted events from localStorage
|
|
403
|
+
*/
|
|
404
|
+
loadPersistedEvents() {
|
|
405
|
+
if (!(!this.persistenceEnabled || !this.settings.persistEvents))
|
|
406
|
+
try {
|
|
407
|
+
const r = Vt(this.storageKey);
|
|
408
|
+
if (r) {
|
|
409
|
+
const a = this.sanitizeEvents(JSON.parse(r));
|
|
410
|
+
this.events = a.slice(-this.maxEvents);
|
|
411
|
+
}
|
|
412
|
+
} catch (r) {
|
|
413
|
+
console.warn("[DevTools] Failed to load persisted events:", r), Yt(this.storageKey);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Update subscription tracking
|
|
418
|
+
*/
|
|
419
|
+
updateSubscription(r) {
|
|
420
|
+
r.status === "added" ? this.subscriptions.set(r.queryId, {
|
|
421
|
+
queryId: r.queryId,
|
|
422
|
+
udfPath: r.udfPath,
|
|
423
|
+
args: r.args,
|
|
424
|
+
componentPath: r.componentPath,
|
|
425
|
+
addedAt: r.timestamp,
|
|
426
|
+
updateCount: 0,
|
|
427
|
+
lastUpdate: r.timestamp,
|
|
428
|
+
status: "active"
|
|
429
|
+
}) : r.status === "removed" && this.subscriptions.delete(r.queryId);
|
|
430
|
+
}
|
|
431
|
+
sanitizeEvents(r) {
|
|
432
|
+
return Array.isArray(r) ? r.filter((a) => this.isEventLike(a)) : [];
|
|
433
|
+
}
|
|
434
|
+
isEventLike(r) {
|
|
435
|
+
if (!r || typeof r != "object") return !1;
|
|
436
|
+
const a = r;
|
|
437
|
+
return !(typeof a.id != "string" || typeof a.type != "string" || typeof a.timestamp != "number" || !Number.isFinite(a.timestamp));
|
|
438
|
+
}
|
|
439
|
+
normalizeMaxEvents(r) {
|
|
440
|
+
const a = typeof r == "number" ? r : Number(r);
|
|
441
|
+
if (!Number.isFinite(a))
|
|
442
|
+
return 1e3;
|
|
443
|
+
const s = Math.round(a);
|
|
444
|
+
return Math.min(Nt.MAX_EVENTS, Math.max(Nt.MIN_EVENTS, s));
|
|
445
|
+
}
|
|
446
|
+
normalizeLatencySettings() {
|
|
447
|
+
const r = (d) => {
|
|
448
|
+
const x = typeof d == "number" ? d : Number(d);
|
|
449
|
+
if (!Number.isFinite(x))
|
|
450
|
+
return 0;
|
|
451
|
+
const c = Math.round(x);
|
|
452
|
+
return Math.min(Nt.MAX_SIMULATED_LATENCY_MS, Math.max(0, c));
|
|
453
|
+
}, a = r(this.settings.wsLatencyMs);
|
|
454
|
+
let s = r(this.settings.wsJitterMs);
|
|
455
|
+
a > 0 && s > a && (s = a), this.settings.wsLatencyMs = a, this.settings.wsJitterMs = s;
|
|
456
|
+
}
|
|
457
|
+
isOperationEvent(r) {
|
|
458
|
+
return r.type === "query" || r.type === "mutation" || r.type === "action";
|
|
459
|
+
}
|
|
460
|
+
isTerminalOperationEvent(r) {
|
|
461
|
+
return this.isOperationEvent(r) && (r.status === "success" || r.status === "error");
|
|
462
|
+
}
|
|
463
|
+
isMatchingPendingOperation(r, a) {
|
|
464
|
+
return !this.isOperationEvent(r) || r.type !== a.type || r.status !== "pending" ? !1 : a.type === "query" ? r.type === "query" && r.queryId === a.queryId : r.type !== "query" && r.requestId === a.requestId;
|
|
465
|
+
}
|
|
466
|
+
reconcilePendingOperation(r) {
|
|
467
|
+
this.isTerminalOperationEvent(r) && this.events.length !== 0 && (this.events = this.events.filter((a) => !this.isMatchingPendingOperation(a, r)));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
let Ot = null;
|
|
471
|
+
function we() {
|
|
472
|
+
return Ot || (Ot = new Nt()), Ot;
|
|
473
|
+
}
|
|
474
|
+
const ve = "#f97316", ye = 6, ke = "M16 6 Q 9.2 13.3 8 22 Q 16 19 24 22 Q 22.8 13.3 16 6 Z";
|
|
475
|
+
function F(e) {
|
|
476
|
+
const r = document.featurePolicy ?? document.permissionsPolicy;
|
|
477
|
+
(r ? r.allowsFeature("clipboard-write") : !0) && navigator.clipboard?.writeText ? navigator.clipboard.writeText(e).then(jt, () => {
|
|
478
|
+
ee(e), jt();
|
|
479
|
+
}) : (ee(e), jt());
|
|
480
|
+
}
|
|
481
|
+
function jt() {
|
|
482
|
+
const e = document.createElement("div");
|
|
483
|
+
e.textContent = "Copied!", e.style.cssText = "position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:99999999;padding:4px 12px;border-radius:6px;font:500 11px/1.4 system-ui,sans-serif;color:#e4e4e7;background:rgba(39,39,42,0.95);border:1px solid rgba(63,63,70,0.6);box-shadow:0 4px 12px rgba(0,0,0,0.4);pointer-events:none;animation:dt-fade-in 0.15s ease-out;opacity:1;transition:opacity 0.2s;", document.body.appendChild(e), setTimeout(() => {
|
|
484
|
+
e.style.opacity = "0";
|
|
485
|
+
}, 600), setTimeout(() => {
|
|
486
|
+
e.remove();
|
|
487
|
+
}, 800);
|
|
488
|
+
}
|
|
489
|
+
function ee(e) {
|
|
490
|
+
const r = document.createElement("textarea");
|
|
491
|
+
r.value = e, r.style.cssText = "position:fixed;opacity:0;pointer-events:none;", document.body.appendChild(r), r.select();
|
|
492
|
+
try {
|
|
493
|
+
document.execCommand("copy");
|
|
494
|
+
} catch {
|
|
495
|
+
}
|
|
496
|
+
document.body.removeChild(r);
|
|
497
|
+
}
|
|
498
|
+
function Pt() {
|
|
499
|
+
const e = document.getElementById("concave-devtools-host");
|
|
500
|
+
return e ? document.activeElement === e || e.contains(document.activeElement) : !1;
|
|
501
|
+
}
|
|
502
|
+
function pe() {
|
|
503
|
+
return document.getElementById("concave-devtools-host")?.shadowRoot?.activeElement ?? null;
|
|
504
|
+
}
|
|
505
|
+
function ct(e) {
|
|
506
|
+
return Array.isArray(e) && e.length === 1 ? e[0] : e;
|
|
507
|
+
}
|
|
508
|
+
const Ne = {
|
|
509
|
+
maxStringLength: 40,
|
|
510
|
+
stringTailLength: 10,
|
|
511
|
+
maxArrayItems: 2,
|
|
512
|
+
maxObjectEntries: 2,
|
|
513
|
+
maxDepth: 2
|
|
514
|
+
};
|
|
515
|
+
function Ee(e, r, a) {
|
|
516
|
+
if (e.length <= r)
|
|
517
|
+
return e;
|
|
518
|
+
const s = Math.max(12, r), d = Math.max(
|
|
519
|
+
4,
|
|
520
|
+
Math.min(a, Math.floor(s / 2))
|
|
521
|
+
), x = Math.max(6, s - d - 1);
|
|
522
|
+
return `${e.slice(0, x)}…${e.slice(-d)}`;
|
|
523
|
+
}
|
|
524
|
+
function Mt(e, r = {}, a = 0) {
|
|
525
|
+
const s = {
|
|
526
|
+
...Ne,
|
|
527
|
+
...r
|
|
528
|
+
};
|
|
529
|
+
if (e === null) return "null";
|
|
530
|
+
if (e === void 0) return "undefined";
|
|
531
|
+
if (typeof e == "string")
|
|
532
|
+
return `"${Ee(
|
|
533
|
+
e,
|
|
534
|
+
s.maxStringLength,
|
|
535
|
+
s.stringTailLength
|
|
536
|
+
)}"`;
|
|
537
|
+
if (typeof e == "number" || typeof e == "boolean")
|
|
538
|
+
return String(e);
|
|
539
|
+
if (Array.isArray(e)) {
|
|
540
|
+
if (e.length === 0) return "[]";
|
|
541
|
+
if (a >= s.maxDepth) return "[…]";
|
|
542
|
+
const d = e.slice(0, s.maxArrayItems).map((c) => Mt(c, s, a + 1)), x = e.length > s.maxArrayItems ? ", …" : "";
|
|
543
|
+
return `[${d.join(", ")}${x}]`;
|
|
544
|
+
}
|
|
545
|
+
if (typeof e == "object") {
|
|
546
|
+
const d = Object.entries(e);
|
|
547
|
+
if (d.length === 0) return "{}";
|
|
548
|
+
if (a >= s.maxDepth) return "{…}";
|
|
549
|
+
const x = d.slice(0, s.maxObjectEntries).map(([m, w]) => `${m}: ${Mt(w, s, a + 1)}`), c = d.length > s.maxObjectEntries ? ", …" : "";
|
|
550
|
+
return `{${x.join(", ")}${c}}`;
|
|
551
|
+
}
|
|
552
|
+
return String(e);
|
|
553
|
+
}
|
|
554
|
+
function at(e, r = 180) {
|
|
555
|
+
try {
|
|
556
|
+
const a = JSON.stringify(e, null, 2);
|
|
557
|
+
return a ? a.length <= r ? a : `${a.slice(0, r - 1)}…` : "";
|
|
558
|
+
} catch {
|
|
559
|
+
return String(e);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function Et({
|
|
563
|
+
data: e,
|
|
564
|
+
label: r,
|
|
565
|
+
onCopy: a,
|
|
566
|
+
maxHeight: s = 300
|
|
567
|
+
}) {
|
|
568
|
+
const [d, x] = z(!0), [c, m] = z("tree"), [w, v] = z(""), E = () => {
|
|
569
|
+
F(JSON.stringify(e, null, 2)), a?.();
|
|
570
|
+
}, f = V(() => JSON.stringify(e, null, 2), [e]), b = V(() => {
|
|
571
|
+
if (!w) return null;
|
|
572
|
+
const k = /* @__PURE__ */ new Set(), y = w.toLowerCase();
|
|
573
|
+
function S($, P) {
|
|
574
|
+
if ($ === null) {
|
|
575
|
+
"null".includes(y) && k.add(P);
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
if (typeof $ == "string" || typeof $ == "number" || typeof $ == "boolean") {
|
|
579
|
+
String($).toLowerCase().includes(y) && k.add(P);
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
if (Array.isArray($)) {
|
|
583
|
+
for (let M = 0; M < $.length; M++) {
|
|
584
|
+
const q = `${P}[${M}]`;
|
|
585
|
+
S($[M], q);
|
|
586
|
+
}
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
if (typeof $ == "object")
|
|
590
|
+
for (const [M, q] of Object.entries($)) {
|
|
591
|
+
const R = `${P}.${M}`;
|
|
592
|
+
M.toLowerCase().includes(y) && k.add(R), S(q, R);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return S(e, "$"), k;
|
|
596
|
+
}, [e, w]), N = b?.size ?? 0;
|
|
597
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-1 text-[12px]", role: "region", "aria-label": r || "Data Inspector", children: [
|
|
598
|
+
r && /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
599
|
+
/* @__PURE__ */ n(
|
|
600
|
+
"button",
|
|
601
|
+
{
|
|
602
|
+
className: "flex items-center gap-1 bg-transparent border-none text-dt-text-tertiary cursor-pointer text-[11px] font-semibold uppercase tracking-wider p-0 hover:text-dt-text-secondary transition-colors",
|
|
603
|
+
onClick: () => x(!d),
|
|
604
|
+
"aria-expanded": d,
|
|
605
|
+
"aria-controls": `inspector-content-${r}`,
|
|
606
|
+
"aria-label": `${d ? "Collapse" : "Expand"} ${r}`,
|
|
607
|
+
children: [
|
|
608
|
+
/* @__PURE__ */ t("span", { className: `text-[10px] transition-transform ${d ? "rotate-90" : ""}`, "aria-hidden": "true", children: "▶" }),
|
|
609
|
+
/* @__PURE__ */ t("span", { children: r })
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
),
|
|
613
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-0.5", role: "toolbar", "aria-label": "Inspector actions", children: [
|
|
614
|
+
/* @__PURE__ */ t(
|
|
615
|
+
"button",
|
|
616
|
+
{
|
|
617
|
+
className: `px-1.5 py-0.5 text-[10px] bg-transparent border border-transparent rounded cursor-pointer transition-all ${c === "tree" ? "bg-white/10 text-dt-text-secondary border-dt-border-light" : "text-dt-text-muted hover:text-dt-text-tertiary"}`,
|
|
618
|
+
onClick: () => m("tree"),
|
|
619
|
+
title: "Tree view",
|
|
620
|
+
"aria-label": "Tree view",
|
|
621
|
+
"aria-pressed": c === "tree",
|
|
622
|
+
children: "Tree"
|
|
623
|
+
}
|
|
624
|
+
),
|
|
625
|
+
/* @__PURE__ */ t(
|
|
626
|
+
"button",
|
|
627
|
+
{
|
|
628
|
+
className: `px-1.5 py-0.5 text-[10px] bg-transparent border border-transparent rounded cursor-pointer transition-all ${c === "raw" ? "bg-white/10 text-dt-text-secondary border-dt-border-light" : "text-dt-text-muted hover:text-dt-text-tertiary"}`,
|
|
629
|
+
onClick: () => m("raw"),
|
|
630
|
+
title: "Raw JSON",
|
|
631
|
+
"aria-label": "Raw JSON view",
|
|
632
|
+
"aria-pressed": c === "raw",
|
|
633
|
+
children: "Raw"
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
/* @__PURE__ */ t(
|
|
637
|
+
"button",
|
|
638
|
+
{
|
|
639
|
+
className: "p-0.5 bg-transparent border-none text-dt-text-muted cursor-pointer rounded hover:text-dt-text-tertiary transition-colors text-[12px]",
|
|
640
|
+
onClick: E,
|
|
641
|
+
title: "Copy JSON",
|
|
642
|
+
"aria-label": "Copy JSON to clipboard",
|
|
643
|
+
children: /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
644
|
+
/* @__PURE__ */ t("path", { d: "M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" }),
|
|
645
|
+
/* @__PURE__ */ t("path", { d: "M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" })
|
|
646
|
+
] })
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
] })
|
|
650
|
+
] }),
|
|
651
|
+
d && /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
652
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 px-2 py-1 bg-zinc-950/50 rounded-t border border-b-0 border-dt-border-light", children: [
|
|
653
|
+
/* @__PURE__ */ t(
|
|
654
|
+
"input",
|
|
655
|
+
{
|
|
656
|
+
type: "text",
|
|
657
|
+
className: "flex-1 bg-transparent border-none text-[10px] font-mono text-dt-text-secondary placeholder-dt-text-muted/40 outline-none",
|
|
658
|
+
placeholder: "Filter...",
|
|
659
|
+
value: w,
|
|
660
|
+
onChange: (k) => v(k.target.value)
|
|
661
|
+
}
|
|
662
|
+
),
|
|
663
|
+
w && /* @__PURE__ */ n(et, { children: [
|
|
664
|
+
/* @__PURE__ */ n("span", { className: "text-[9px] text-dt-text-muted/60 font-mono", children: [
|
|
665
|
+
N,
|
|
666
|
+
" match",
|
|
667
|
+
N !== 1 ? "es" : ""
|
|
668
|
+
] }),
|
|
669
|
+
/* @__PURE__ */ t(
|
|
670
|
+
"button",
|
|
671
|
+
{
|
|
672
|
+
className: "bg-transparent border-none text-dt-text-muted cursor-pointer text-[10px] p-0 hover:text-dt-text-secondary",
|
|
673
|
+
onClick: () => v(""),
|
|
674
|
+
"aria-label": "Clear search",
|
|
675
|
+
children: "×"
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
] })
|
|
679
|
+
] }),
|
|
680
|
+
/* @__PURE__ */ t(
|
|
681
|
+
"div",
|
|
682
|
+
{
|
|
683
|
+
className: "overflow-auto bg-zinc-950/50 rounded-b border border-dt-border-light p-2 font-mono text-[11px]",
|
|
684
|
+
id: r ? `inspector-content-${r}` : void 0,
|
|
685
|
+
style: { maxHeight: s },
|
|
686
|
+
role: "region",
|
|
687
|
+
"aria-label": `${r || "Data"} content`,
|
|
688
|
+
children: c === "tree" ? /* @__PURE__ */ t(Ut, { data: e, matchingPaths: b, searchTerm: w }) : /* @__PURE__ */ t("pre", { className: "text-dt-text-muted whitespace-pre-wrap break-all m-0", "aria-readonly": "true", children: w ? /* @__PURE__ */ t(Ce, { text: f, term: w }) : f })
|
|
689
|
+
}
|
|
690
|
+
)
|
|
691
|
+
] })
|
|
692
|
+
] });
|
|
693
|
+
}
|
|
694
|
+
function Ce({ text: e, term: r }) {
|
|
695
|
+
if (!r) return /* @__PURE__ */ t(et, { children: e });
|
|
696
|
+
const a = [], s = e.toLowerCase(), d = r.toLowerCase();
|
|
697
|
+
let x = 0, c = s.indexOf(d, x), m = 0;
|
|
698
|
+
for (; c !== -1; )
|
|
699
|
+
c > x && a.push(e.slice(x, c)), a.push(
|
|
700
|
+
/* @__PURE__ */ t("mark", { className: "bg-yellow-400/30 text-yellow-200 rounded-sm px-px", children: e.slice(c, c + r.length) }, m++)
|
|
701
|
+
), x = c + r.length, c = s.indexOf(d, x);
|
|
702
|
+
return x < e.length && a.push(e.slice(x)), /* @__PURE__ */ t(et, { children: a });
|
|
703
|
+
}
|
|
704
|
+
function Ut({ data: e, depth: r = 0, path: a = "$", matchingPaths: s, searchTerm: d }) {
|
|
705
|
+
const x = s ? Ft(a, s) : !1, [c, m] = z(r < 2), w = s?.has(a) ?? !1, v = c || !!s && x;
|
|
706
|
+
if (e === null)
|
|
707
|
+
return /* @__PURE__ */ t("span", { className: `italic ${w ? "bg-yellow-400/25 rounded-sm px-0.5 text-yellow-200" : "text-dt-text-muted"}`, children: "null" });
|
|
708
|
+
if (typeof e == "string")
|
|
709
|
+
return /* @__PURE__ */ n("span", { className: w ? "bg-yellow-400/25 rounded-sm px-0.5 text-yellow-200" : "text-dt-success", children: [
|
|
710
|
+
'"',
|
|
711
|
+
d ? /* @__PURE__ */ t(re, { text: e, term: d }) : e,
|
|
712
|
+
'"'
|
|
713
|
+
] });
|
|
714
|
+
if (typeof e == "number")
|
|
715
|
+
return /* @__PURE__ */ t("span", { className: w ? "bg-yellow-400/25 rounded-sm px-0.5 text-yellow-200" : "text-dt-query", children: e });
|
|
716
|
+
if (typeof e == "boolean")
|
|
717
|
+
return /* @__PURE__ */ t("span", { className: w ? "bg-yellow-400/25 rounded-sm px-0.5 text-yellow-200" : "text-dt-mutation", children: e.toString() });
|
|
718
|
+
if (Array.isArray(e))
|
|
719
|
+
return e.length === 0 ? /* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "[]" }) : /* @__PURE__ */ n("div", { className: "inline", children: [
|
|
720
|
+
/* @__PURE__ */ n(
|
|
721
|
+
"button",
|
|
722
|
+
{
|
|
723
|
+
type: "button",
|
|
724
|
+
className: "bg-transparent border-none cursor-pointer p-0 text-inherit font-inherit inline-flex items-center gap-0.5",
|
|
725
|
+
onClick: () => m(!v),
|
|
726
|
+
"aria-expanded": v,
|
|
727
|
+
"aria-label": `${v ? "Collapse" : "Expand"} array with ${e.length} items`,
|
|
728
|
+
children: [
|
|
729
|
+
/* @__PURE__ */ t("span", { className: `text-[10px] transition-transform inline-block ${v ? "rotate-90" : ""}`, "aria-hidden": "true", children: "▶" }),
|
|
730
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "[" }),
|
|
731
|
+
!v && /* @__PURE__ */ n("span", { className: "text-dt-text-muted/60 italic text-[10px]", children: [
|
|
732
|
+
e.length,
|
|
733
|
+
" items..."
|
|
734
|
+
] }),
|
|
735
|
+
!v && /* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "]" })
|
|
736
|
+
]
|
|
737
|
+
}
|
|
738
|
+
),
|
|
739
|
+
v && /* @__PURE__ */ n(et, { children: [
|
|
740
|
+
/* @__PURE__ */ t("div", { className: "pl-4 border-l border-dt-border-light/30 ml-1", children: e.map((E, f) => {
|
|
741
|
+
const b = `${a}[${f}]`;
|
|
742
|
+
return s && !Ft(b, s) && !s.has(b) ? null : /* @__PURE__ */ n("div", { className: "py-px", children: [
|
|
743
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-tertiary", children: [
|
|
744
|
+
f,
|
|
745
|
+
":"
|
|
746
|
+
] }),
|
|
747
|
+
" ",
|
|
748
|
+
/* @__PURE__ */ t(Ut, { data: E, depth: r + 1, path: b, matchingPaths: s, searchTerm: d })
|
|
749
|
+
] }, f);
|
|
750
|
+
}) }),
|
|
751
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "]" })
|
|
752
|
+
] })
|
|
753
|
+
] });
|
|
754
|
+
if (typeof e == "object") {
|
|
755
|
+
const E = Object.entries(e);
|
|
756
|
+
return E.length === 0 ? /* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "{}" }) : /* @__PURE__ */ n("div", { className: "inline", children: [
|
|
757
|
+
/* @__PURE__ */ n(
|
|
758
|
+
"button",
|
|
759
|
+
{
|
|
760
|
+
type: "button",
|
|
761
|
+
className: "bg-transparent border-none cursor-pointer p-0 text-inherit font-inherit inline-flex items-center gap-0.5",
|
|
762
|
+
onClick: () => m(!v),
|
|
763
|
+
"aria-expanded": v,
|
|
764
|
+
"aria-label": `${v ? "Collapse" : "Expand"} object with ${E.length} keys`,
|
|
765
|
+
children: [
|
|
766
|
+
/* @__PURE__ */ t("span", { className: `text-[10px] transition-transform inline-block ${v ? "rotate-90" : ""}`, "aria-hidden": "true", children: "▶" }),
|
|
767
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "{" }),
|
|
768
|
+
!v && /* @__PURE__ */ n("span", { className: "text-dt-text-muted/60 italic text-[10px]", children: [
|
|
769
|
+
E.length,
|
|
770
|
+
" keys..."
|
|
771
|
+
] }),
|
|
772
|
+
!v && /* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "}" })
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
),
|
|
776
|
+
v && /* @__PURE__ */ n(et, { children: [
|
|
777
|
+
/* @__PURE__ */ t("div", { className: "pl-4 border-l border-dt-border-light/30 ml-1", children: E.map(([f, b]) => {
|
|
778
|
+
const N = `${a}.${f}`, k = s?.has(N) && d && f.toLowerCase().includes(d.toLowerCase());
|
|
779
|
+
return s && !Ft(N, s) && !s.has(N) ? null : /* @__PURE__ */ n("div", { className: "py-px", children: [
|
|
780
|
+
/* @__PURE__ */ n("span", { className: k ? "bg-yellow-400/25 rounded-sm px-0.5 text-yellow-200" : "text-dt-text-tertiary", children: [
|
|
781
|
+
'"',
|
|
782
|
+
d ? /* @__PURE__ */ t(re, { text: f, term: d }) : f,
|
|
783
|
+
'":'
|
|
784
|
+
] }),
|
|
785
|
+
" ",
|
|
786
|
+
/* @__PURE__ */ t(Ut, { data: b, depth: r + 1, path: N, matchingPaths: s, searchTerm: d })
|
|
787
|
+
] }, f);
|
|
788
|
+
}) }),
|
|
789
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "}" })
|
|
790
|
+
] })
|
|
791
|
+
] });
|
|
792
|
+
}
|
|
793
|
+
return /* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: String(e) });
|
|
794
|
+
}
|
|
795
|
+
function Ft(e, r) {
|
|
796
|
+
for (const a of r)
|
|
797
|
+
if (a.startsWith(e) && a !== e) return !0;
|
|
798
|
+
return !1;
|
|
799
|
+
}
|
|
800
|
+
function re({ text: e, term: r }) {
|
|
801
|
+
if (!r) return /* @__PURE__ */ t(et, { children: e });
|
|
802
|
+
const a = e.toLowerCase(), s = r.toLowerCase(), d = [];
|
|
803
|
+
let x = 0, c = a.indexOf(s, x), m = 0;
|
|
804
|
+
for (; c !== -1; )
|
|
805
|
+
c > x && d.push(e.slice(x, c)), d.push(
|
|
806
|
+
/* @__PURE__ */ t("mark", { className: "bg-yellow-400/30 text-yellow-200 rounded-sm px-px", children: e.slice(c, c + r.length) }, m++)
|
|
807
|
+
), x = c + r.length, c = a.indexOf(s, x);
|
|
808
|
+
return x < e.length && d.push(e.slice(x)), /* @__PURE__ */ t(et, { children: d });
|
|
809
|
+
}
|
|
810
|
+
const oe = "minmax(0,1fr) 56px 56px 62px 34px minmax(150px,1fr)", Me = 140, Se = 1e-4;
|
|
811
|
+
function lt(e) {
|
|
812
|
+
return Number.isFinite(e) ? `${Math.max(0, e).toFixed(3).replace(/\.0+$/, "").replace(/(\.\d*?)0+$/, "$1")}ms` : "0ms";
|
|
813
|
+
}
|
|
814
|
+
function gt(e) {
|
|
815
|
+
return `+${lt(Math.max(0, e))}`;
|
|
816
|
+
}
|
|
817
|
+
function ue(e) {
|
|
818
|
+
return Number.isFinite(e) ? Math.max(0, Math.min(100, e)) : 0;
|
|
819
|
+
}
|
|
820
|
+
function It(e, r = 40) {
|
|
821
|
+
if (e.length <= r) return e;
|
|
822
|
+
const a = Math.max(6, Math.floor((r - 3) / 2));
|
|
823
|
+
return `${e.slice(0, a)}...${e.slice(-a)}`;
|
|
824
|
+
}
|
|
825
|
+
function ne(e) {
|
|
826
|
+
if (typeof e == "string") return e.length > 60 ? `${e.slice(0, 57)}...` : e;
|
|
827
|
+
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
828
|
+
if (e === null) return "null";
|
|
829
|
+
try {
|
|
830
|
+
const r = JSON.stringify(e);
|
|
831
|
+
return r ? r.length > 80 ? `${r.slice(0, 77)}...` : r : String(e);
|
|
832
|
+
} catch {
|
|
833
|
+
return String(e);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
function $e(e) {
|
|
837
|
+
const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
838
|
+
for (const m of e.spans) {
|
|
839
|
+
const w = m.parentId ?? null;
|
|
840
|
+
a.set(m.id, w);
|
|
841
|
+
const v = r.get(w) ?? [];
|
|
842
|
+
v.push(m), r.set(w, v);
|
|
843
|
+
}
|
|
844
|
+
for (const m of r.values())
|
|
845
|
+
m.sort((w, v) => w.startMs - v.startMs || w.name.localeCompare(v.name));
|
|
846
|
+
const s = [], d = /* @__PURE__ */ new Set(), x = (m, w) => {
|
|
847
|
+
if (d.has(m.id)) return;
|
|
848
|
+
d.add(m.id);
|
|
849
|
+
const v = r.get(m.id) ?? [], E = v.reduce((f, b) => !Number.isFinite(b.durationMs) || b.durationMs <= 0 ? f : f + b.durationMs, 0);
|
|
850
|
+
s.push({
|
|
851
|
+
span: m,
|
|
852
|
+
depth: w,
|
|
853
|
+
hasChildren: v.length > 0,
|
|
854
|
+
directChildDurationMs: E
|
|
855
|
+
});
|
|
856
|
+
for (const f of v) x(f, w + 1);
|
|
857
|
+
}, c = e.spans.find((m) => m.id === e.rootSpanId);
|
|
858
|
+
c && x(c, 0);
|
|
859
|
+
for (const m of r.get(null) ?? []) x(m, 0);
|
|
860
|
+
for (const m of e.spans) x(m, 0);
|
|
861
|
+
return { rows: s, parentById: a, childrenByParent: r };
|
|
862
|
+
}
|
|
863
|
+
function De(e) {
|
|
864
|
+
const r = e.attributes ? Object.keys(e.attributes).join(" ") : "", a = e.events?.map((s) => s.name).join(" ") ?? "";
|
|
865
|
+
return `${e.name} ${e.kind} ${e.status} ${r} ${a}`.toLowerCase();
|
|
866
|
+
}
|
|
867
|
+
function ae(e, r, a, s) {
|
|
868
|
+
const d = Number.isFinite(e) ? e : a, x = Number.isFinite(r) && r > 0 ? r : 0, c = (d - a) / s * 100, m = Math.min(99.8, ue(c)), w = x / s * 100, v = Math.max(0.3, 100 - m), E = Math.max(0.3, Math.min(w || 0.3, v));
|
|
869
|
+
return { leftPct: m, widthPct: E };
|
|
870
|
+
}
|
|
871
|
+
function Kt(e, r) {
|
|
872
|
+
const a = e.replace("#", "");
|
|
873
|
+
if (a.length !== 6) return `rgba(59,130,246,${r})`;
|
|
874
|
+
const s = parseInt(a.slice(0, 2), 16), d = parseInt(a.slice(2, 4), 16), x = parseInt(a.slice(4, 6), 16);
|
|
875
|
+
return `rgba(${s}, ${d}, ${x}, ${r})`;
|
|
876
|
+
}
|
|
877
|
+
function xe(e) {
|
|
878
|
+
if (e.status === "error") return "#ef4444";
|
|
879
|
+
const r = e.kind.toLowerCase();
|
|
880
|
+
return r.includes("query") || r.includes("db") || r.includes("scan") || r.includes("read") ? "#60a5fa" : r.includes("mutation") || r.includes("write") || r.includes("commit") ? "#a78bfa" : r.includes("action") || r.includes("http") || r.includes("fetch") || r.includes("network") ? "#34d399" : "#3b82f6";
|
|
881
|
+
}
|
|
882
|
+
function Ie(e, r) {
|
|
883
|
+
const a = xe(e);
|
|
884
|
+
return {
|
|
885
|
+
backgroundColor: Kt(a, r ? 1 : 0.86),
|
|
886
|
+
borderColor: Kt(a, r ? 1 : 0.65),
|
|
887
|
+
color: "#fff",
|
|
888
|
+
boxShadow: r ? "0 0 0 1px rgba(255,255,255,0.92), 0 0 0 2px rgba(0,0,0,0.45)" : "0 0 0 1px rgba(0,0,0,0.18)",
|
|
889
|
+
zIndex: r ? 6 : 2,
|
|
890
|
+
filter: r ? "brightness(1.06)" : "none"
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
function Le(e) {
|
|
894
|
+
const r = xe(e);
|
|
895
|
+
return {
|
|
896
|
+
backgroundColor: Kt(r, 0.95)
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
function Ae(e) {
|
|
900
|
+
const r = /* @__PURE__ */ new Map();
|
|
901
|
+
for (const s of e) {
|
|
902
|
+
const d = r.get(s.depth) ?? [];
|
|
903
|
+
d.push(s), r.set(s.depth, d);
|
|
904
|
+
}
|
|
905
|
+
const a = [];
|
|
906
|
+
for (const [s] of Array.from(r.entries()).sort((d, x) => d[0] - x[0])) {
|
|
907
|
+
const x = [...r.get(s) ?? []].sort(
|
|
908
|
+
(w, v) => w.span.startMs - v.span.startMs || v.span.durationMs - w.span.durationMs || w.span.name.localeCompare(v.span.name)
|
|
909
|
+
), c = [], m = [];
|
|
910
|
+
for (const w of x) {
|
|
911
|
+
const v = Number.isFinite(w.span.startMs) ? w.span.startMs : 0, E = v + Math.max(0, Number.isFinite(w.span.durationMs) ? w.span.durationMs : 0), f = Number.isFinite(w.span.endMs) ? Math.max(v, w.span.endMs) : E;
|
|
912
|
+
let b = -1;
|
|
913
|
+
for (let N = 0; N < c.length; N++)
|
|
914
|
+
if (v >= c[N] - Se) {
|
|
915
|
+
b = N;
|
|
916
|
+
break;
|
|
917
|
+
}
|
|
918
|
+
b === -1 ? (b = c.length, c.push(f), m.push([])) : c[b] = Math.max(c[b], f), m[b].push(w);
|
|
919
|
+
}
|
|
920
|
+
a.push(...m);
|
|
921
|
+
}
|
|
922
|
+
return a;
|
|
923
|
+
}
|
|
924
|
+
function Te({ trace: e, maxHeight: r = 680 }) {
|
|
925
|
+
const [a, s] = z(!0), [d, x] = z("waterfall"), [c, m] = z(e.rootSpanId || e.spans[0]?.id || null), [w, v] = z(""), [E, f] = z(!1), [b, N] = z(/* @__PURE__ */ new Set()), [k, y] = z(null), S = V(() => $e(e), [e]), $ = V(() => Math.min(...e.spans.map((l) => l.startMs), 0), [e.spans]), P = V(() => Math.max(...e.spans.map((l) => l.endMs), 0), [e.spans]), M = V(() => {
|
|
926
|
+
const l = Math.max(0, P - $);
|
|
927
|
+
return Math.max(e.summary.totalDurationMs, l, 1);
|
|
928
|
+
}, [P, $, e.summary.totalDurationMs]), q = V(() => Math.max(220, r - 180), [r]), R = V(
|
|
929
|
+
() => e.spans.reduce((l, h) => l + (h.status === "error" ? 1 : 0), 0),
|
|
930
|
+
[e.spans]
|
|
931
|
+
), p = w.trim().toLowerCase(), u = p.length > 0 || E, i = V(() => {
|
|
932
|
+
if (!u) return null;
|
|
933
|
+
const l = /* @__PURE__ */ new Set(), h = (g) => {
|
|
934
|
+
let T = S.parentById.get(g) ?? null;
|
|
935
|
+
for (; T && !l.has(T); )
|
|
936
|
+
l.add(T), T = S.parentById.get(T) ?? null;
|
|
937
|
+
}, _ = (g) => {
|
|
938
|
+
const T = [g];
|
|
939
|
+
for (; T.length > 0; ) {
|
|
940
|
+
const A = T.pop();
|
|
941
|
+
if (l.has(A)) continue;
|
|
942
|
+
l.add(A);
|
|
943
|
+
const O = S.childrenByParent.get(A) ?? [];
|
|
944
|
+
for (const j of O) T.push(j.id);
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
for (const g of e.spans)
|
|
948
|
+
E && g.status !== "error" || p.length > 0 && !De(g).includes(p) || (h(g.id), _(g.id));
|
|
949
|
+
return l;
|
|
950
|
+
}, [u, S.childrenByParent, S.parentById, p, E, e.spans]), C = V(() => {
|
|
951
|
+
const l = [], h = !u, _ = [];
|
|
952
|
+
for (const g of S.rows) {
|
|
953
|
+
for (; _.length > 0 && g.depth <= _[_.length - 1]; )
|
|
954
|
+
_.pop();
|
|
955
|
+
const T = h && _.length > 0, A = !i || i.has(g.span.id), O = !T && A;
|
|
956
|
+
O && l.push(g), h && O && g.hasChildren && b.has(g.span.id) && _.push(g.depth);
|
|
957
|
+
}
|
|
958
|
+
return l;
|
|
959
|
+
}, [S.rows, u, i, b]), I = V(() => Ae(C), [C]), L = V(() => {
|
|
960
|
+
const l = /* @__PURE__ */ new Map();
|
|
961
|
+
for (const h of e.spans) l.set(h.id, h);
|
|
962
|
+
return l;
|
|
963
|
+
}, [e.spans]), X = V(() => {
|
|
964
|
+
const l = /* @__PURE__ */ new Map();
|
|
965
|
+
for (const h of S.rows) l.set(h.span.id, h);
|
|
966
|
+
return l;
|
|
967
|
+
}, [S.rows]);
|
|
968
|
+
U(() => {
|
|
969
|
+
const l = e.rootSpanId || e.spans[0]?.id || null;
|
|
970
|
+
(!c || !e.spans.some((h) => h.id === c)) && m(l);
|
|
971
|
+
}, [c, e]), U(() => {
|
|
972
|
+
C.length !== 0 && (!c || !C.some((l) => l.span.id === c)) && m(C[0].span.id);
|
|
973
|
+
}, [c, C]), U(() => {
|
|
974
|
+
y(null);
|
|
975
|
+
}, [d, e]);
|
|
976
|
+
const rt = V(
|
|
977
|
+
() => S.rows.find((l) => l.span.id === c) ?? null,
|
|
978
|
+
[S.rows, c]
|
|
979
|
+
)?.span ?? null, D = (k ? L.get(k) ?? null : null) ?? rt, tt = D ? X.get(D.id) ?? null : null, ot = tt ? Math.max(0, tt.span.durationMs - tt.directChildDurationMs) : 0, it = D ? (() => {
|
|
980
|
+
const l = S.parentById.get(D.id) ?? null;
|
|
981
|
+
return l ? L.get(l) ?? null : null;
|
|
982
|
+
})() : null, pt = D ? D.startMs - $ : 0, mt = V(
|
|
983
|
+
() => D?.attributes ? Object.entries(D.attributes).slice(0, 20) : [],
|
|
984
|
+
[D]
|
|
985
|
+
), wt = V(() => D?.events?.slice(0, 40) ?? [], [D]), vt = (l) => {
|
|
986
|
+
N((h) => {
|
|
987
|
+
const _ = new Set(h);
|
|
988
|
+
return _.has(l) ? _.delete(l) : _.add(l), _;
|
|
989
|
+
});
|
|
990
|
+
}, bt = () => {
|
|
991
|
+
N(new Set(S.rows.filter((l) => l.hasChildren).map((l) => l.span.id)));
|
|
992
|
+
}, St = () => {
|
|
993
|
+
N(/* @__PURE__ */ new Set());
|
|
994
|
+
}, o = () => {
|
|
995
|
+
v(""), f(!1);
|
|
996
|
+
};
|
|
997
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-1 text-[12px]", role: "region", "aria-label": "Trace Viewer", children: [
|
|
998
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2", children: [
|
|
999
|
+
/* @__PURE__ */ n(
|
|
1000
|
+
"button",
|
|
1001
|
+
{
|
|
1002
|
+
className: "flex items-center gap-1 bg-transparent border-none text-dt-text-tertiary cursor-pointer text-[11px] font-semibold uppercase tracking-wider p-0 hover:text-dt-text-secondary",
|
|
1003
|
+
onClick: () => s((l) => !l),
|
|
1004
|
+
"aria-expanded": a,
|
|
1005
|
+
"aria-controls": "trace-viewer-content",
|
|
1006
|
+
children: [
|
|
1007
|
+
/* @__PURE__ */ t("span", { className: `text-[10px] ${a ? "rotate-90" : ""}`, "aria-hidden": "true", children: ">" }),
|
|
1008
|
+
/* @__PURE__ */ n("span", { children: [
|
|
1009
|
+
"Trace (",
|
|
1010
|
+
e.summary.spanCount,
|
|
1011
|
+
" spans, ",
|
|
1012
|
+
e.summary.eventCount,
|
|
1013
|
+
" events)"
|
|
1014
|
+
] })
|
|
1015
|
+
]
|
|
1016
|
+
}
|
|
1017
|
+
),
|
|
1018
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1019
|
+
/* @__PURE__ */ t("span", { className: "hidden sm:inline-flex px-1.5 py-0.5 rounded bg-dt-bg-tertiary text-[10px] font-mono text-dt-text-muted", children: lt(e.summary.totalDurationMs) }),
|
|
1020
|
+
/* @__PURE__ */ n("span", { className: "hidden sm:inline-flex px-1.5 py-0.5 rounded bg-dt-bg-tertiary text-[10px] font-mono text-dt-text-muted", children: [
|
|
1021
|
+
R,
|
|
1022
|
+
" err"
|
|
1023
|
+
] }),
|
|
1024
|
+
/* @__PURE__ */ t(
|
|
1025
|
+
"button",
|
|
1026
|
+
{
|
|
1027
|
+
className: "p-0.5 bg-transparent border-none text-dt-text-muted cursor-pointer rounded hover:text-dt-text-tertiary text-[12px]",
|
|
1028
|
+
onClick: () => F(JSON.stringify(e, null, 2)),
|
|
1029
|
+
title: "Copy trace JSON",
|
|
1030
|
+
"aria-label": "Copy trace JSON",
|
|
1031
|
+
children: /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
1032
|
+
/* @__PURE__ */ t("path", { d: "M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z" }),
|
|
1033
|
+
/* @__PURE__ */ t("path", { d: "M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z" })
|
|
1034
|
+
] })
|
|
1035
|
+
}
|
|
1036
|
+
)
|
|
1037
|
+
] })
|
|
1038
|
+
] }),
|
|
1039
|
+
a && /* @__PURE__ */ n(
|
|
1040
|
+
"div",
|
|
1041
|
+
{
|
|
1042
|
+
id: "trace-viewer-content",
|
|
1043
|
+
className: "flex flex-col min-h-0 rounded border border-dt-border bg-dt-bg-secondary overflow-hidden",
|
|
1044
|
+
style: { maxHeight: r },
|
|
1045
|
+
children: [
|
|
1046
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5 px-2 py-1.5 border-b border-dt-border bg-dt-bg-secondary", children: [
|
|
1047
|
+
/* @__PURE__ */ n("div", { className: "inline-flex rounded border border-dt-border-light overflow-hidden", children: [
|
|
1048
|
+
/* @__PURE__ */ t(
|
|
1049
|
+
"button",
|
|
1050
|
+
{
|
|
1051
|
+
type: "button",
|
|
1052
|
+
onClick: () => x("waterfall"),
|
|
1053
|
+
className: `h-6 px-2 text-[10px] font-semibold uppercase tracking-wide ${d === "waterfall" ? "bg-dt-info/15 text-dt-info" : "bg-transparent text-dt-text-muted hover:text-dt-text-secondary"}`,
|
|
1054
|
+
children: "Waterfall"
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
/* @__PURE__ */ t(
|
|
1058
|
+
"button",
|
|
1059
|
+
{
|
|
1060
|
+
type: "button",
|
|
1061
|
+
onClick: () => x("flamegraph"),
|
|
1062
|
+
className: `h-6 px-2 border-l border-dt-border-light text-[10px] font-semibold uppercase tracking-wide ${d === "flamegraph" ? "bg-dt-info/15 text-dt-info" : "bg-transparent text-dt-text-muted hover:text-dt-text-secondary"}`,
|
|
1063
|
+
children: "Flamegraph"
|
|
1064
|
+
}
|
|
1065
|
+
)
|
|
1066
|
+
] }),
|
|
1067
|
+
/* @__PURE__ */ t(
|
|
1068
|
+
"input",
|
|
1069
|
+
{
|
|
1070
|
+
type: "text",
|
|
1071
|
+
value: w,
|
|
1072
|
+
onChange: (l) => v(l.target.value),
|
|
1073
|
+
placeholder: "Filter spans",
|
|
1074
|
+
className: "h-6 flex-1 min-w-[120px] bg-dt-bg-tertiary border border-dt-border-light rounded px-2 text-[10px] font-mono text-dt-text-secondary placeholder:text-dt-text-muted/50 outline-none focus:border-dt-info/40"
|
|
1075
|
+
}
|
|
1076
|
+
),
|
|
1077
|
+
/* @__PURE__ */ t(
|
|
1078
|
+
"button",
|
|
1079
|
+
{
|
|
1080
|
+
type: "button",
|
|
1081
|
+
onClick: () => f((l) => !l),
|
|
1082
|
+
className: `h-6 px-2 rounded text-[10px] font-semibold uppercase tracking-wide border ${E ? "bg-dt-error/15 border-dt-error/40 text-dt-error" : "bg-transparent border-dt-border-light text-dt-text-muted hover:text-dt-text-secondary"}`,
|
|
1083
|
+
children: "Errors"
|
|
1084
|
+
}
|
|
1085
|
+
),
|
|
1086
|
+
u && /* @__PURE__ */ t(
|
|
1087
|
+
"button",
|
|
1088
|
+
{
|
|
1089
|
+
type: "button",
|
|
1090
|
+
onClick: o,
|
|
1091
|
+
className: "h-6 px-2 rounded text-[10px] font-semibold uppercase tracking-wide border border-dt-border-light text-dt-text-muted hover:text-dt-text-secondary",
|
|
1092
|
+
children: "Clear"
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
/* @__PURE__ */ n("span", { className: "ml-auto text-[9px] font-mono text-dt-text-muted/70", children: [
|
|
1096
|
+
C.length,
|
|
1097
|
+
"/",
|
|
1098
|
+
S.rows.length
|
|
1099
|
+
] }),
|
|
1100
|
+
/* @__PURE__ */ t(
|
|
1101
|
+
"button",
|
|
1102
|
+
{
|
|
1103
|
+
type: "button",
|
|
1104
|
+
onClick: bt,
|
|
1105
|
+
disabled: u,
|
|
1106
|
+
className: "text-[9px] uppercase text-dt-text-muted hover:text-dt-text-secondary disabled:opacity-40 disabled:cursor-not-allowed",
|
|
1107
|
+
children: "Collapse"
|
|
1108
|
+
}
|
|
1109
|
+
),
|
|
1110
|
+
/* @__PURE__ */ t(
|
|
1111
|
+
"button",
|
|
1112
|
+
{
|
|
1113
|
+
type: "button",
|
|
1114
|
+
onClick: St,
|
|
1115
|
+
disabled: u,
|
|
1116
|
+
className: "text-[9px] uppercase text-dt-text-muted hover:text-dt-text-secondary disabled:opacity-40 disabled:cursor-not-allowed",
|
|
1117
|
+
children: "Expand"
|
|
1118
|
+
}
|
|
1119
|
+
)
|
|
1120
|
+
] }),
|
|
1121
|
+
d === "waterfall" ? /* @__PURE__ */ n(et, { children: [
|
|
1122
|
+
/* @__PURE__ */ n(
|
|
1123
|
+
"div",
|
|
1124
|
+
{
|
|
1125
|
+
className: "grid gap-2 px-2 py-1 border-b border-dt-border-light bg-dt-bg-tertiary/30 text-[9px] uppercase tracking-wider text-dt-text-muted/70 font-mono",
|
|
1126
|
+
style: { gridTemplateColumns: oe },
|
|
1127
|
+
children: [
|
|
1128
|
+
/* @__PURE__ */ t("span", { children: "Span" }),
|
|
1129
|
+
/* @__PURE__ */ t("span", { className: "text-right", children: "Self" }),
|
|
1130
|
+
/* @__PURE__ */ t("span", { className: "text-right", children: "Total" }),
|
|
1131
|
+
/* @__PURE__ */ t("span", { className: "text-right", children: "Start" }),
|
|
1132
|
+
/* @__PURE__ */ t("span", { className: "text-right", children: "Evt" }),
|
|
1133
|
+
/* @__PURE__ */ t("span", { children: "Timeline" })
|
|
1134
|
+
]
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
/* @__PURE__ */ n("div", { className: "min-h-0 overflow-y-auto p-1 bg-dt-bg-secondary/30", style: { maxHeight: q }, children: [
|
|
1138
|
+
/* @__PURE__ */ t("div", { className: "space-y-0.5", children: C.map((l) => {
|
|
1139
|
+
const { span: h } = l, _ = Number.isFinite(h.durationMs) && h.durationMs > 0 ? h.durationMs : 0, g = Math.max(0, _ - l.directChildDurationMs), T = h.startMs - $, A = h.events?.length ?? 0, { leftPct: O, widthPct: j } = ae(
|
|
1140
|
+
h.startMs,
|
|
1141
|
+
_,
|
|
1142
|
+
$,
|
|
1143
|
+
M
|
|
1144
|
+
), Q = c === h.id, K = b.has(h.id);
|
|
1145
|
+
return /* @__PURE__ */ n(
|
|
1146
|
+
"div",
|
|
1147
|
+
{
|
|
1148
|
+
className: `grid gap-2 items-center rounded border px-1 py-[2px] select-none cursor-pointer ${Q ? "bg-dt-info/10 border-dt-info/30" : "border-transparent hover:bg-white/[0.03]"}`,
|
|
1149
|
+
style: { gridTemplateColumns: oe },
|
|
1150
|
+
onMouseDown: (Y) => Y.preventDefault(),
|
|
1151
|
+
onClick: () => {
|
|
1152
|
+
m(h.id), y(h.id);
|
|
1153
|
+
},
|
|
1154
|
+
children: [
|
|
1155
|
+
/* @__PURE__ */ n("div", { className: "min-w-0 flex items-center gap-1", style: { paddingLeft: `${l.depth * 8}px` }, children: [
|
|
1156
|
+
l.hasChildren ? /* @__PURE__ */ t(
|
|
1157
|
+
"button",
|
|
1158
|
+
{
|
|
1159
|
+
type: "button",
|
|
1160
|
+
onMouseDown: (Y) => Y.preventDefault(),
|
|
1161
|
+
onClick: (Y) => {
|
|
1162
|
+
Y.stopPropagation(), vt(h.id);
|
|
1163
|
+
},
|
|
1164
|
+
className: "w-3 h-3 flex items-center justify-center text-[9px] text-dt-text-muted hover:text-dt-text-secondary",
|
|
1165
|
+
title: K ? "Expand" : "Collapse",
|
|
1166
|
+
children: /* @__PURE__ */ t("span", { className: `inline-block ${K ? "" : "rotate-90"}`, children: ">" })
|
|
1167
|
+
}
|
|
1168
|
+
) : /* @__PURE__ */ t("span", { className: "w-3 h-3" }),
|
|
1169
|
+
/* @__PURE__ */ t(
|
|
1170
|
+
"span",
|
|
1171
|
+
{
|
|
1172
|
+
className: `w-1.5 h-1.5 rounded-full shrink-0 ${h.status === "error" ? "bg-dt-error" : "bg-dt-success"}`
|
|
1173
|
+
}
|
|
1174
|
+
),
|
|
1175
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-[9px] uppercase text-dt-text-muted/70 shrink-0", children: h.kind }),
|
|
1176
|
+
/* @__PURE__ */ t(
|
|
1177
|
+
"span",
|
|
1178
|
+
{
|
|
1179
|
+
className: "font-mono text-[10px] leading-tight text-dt-text-secondary truncate",
|
|
1180
|
+
title: h.name,
|
|
1181
|
+
children: h.name
|
|
1182
|
+
}
|
|
1183
|
+
)
|
|
1184
|
+
] }),
|
|
1185
|
+
/* @__PURE__ */ t("div", { className: "font-mono text-[10px] text-dt-text-muted text-right", children: lt(g) }),
|
|
1186
|
+
/* @__PURE__ */ t("div", { className: "font-mono text-[10px] text-dt-text-muted text-right", children: lt(_) }),
|
|
1187
|
+
/* @__PURE__ */ t("div", { className: "font-mono text-[10px] text-dt-text-muted text-right", children: gt(T) }),
|
|
1188
|
+
/* @__PURE__ */ t("div", { className: "font-mono text-[10px] text-dt-text-muted text-right", children: A }),
|
|
1189
|
+
/* @__PURE__ */ n("div", { className: "relative h-2 rounded bg-dt-bg-tertiary border border-dt-border-light/50 overflow-hidden", children: [
|
|
1190
|
+
Q && h.events?.slice(0, 80).map((Y, nt) => {
|
|
1191
|
+
const ut = Math.min(
|
|
1192
|
+
99.8,
|
|
1193
|
+
ue((Y.atMs - $) / M * 100)
|
|
1194
|
+
);
|
|
1195
|
+
return /* @__PURE__ */ t(
|
|
1196
|
+
"span",
|
|
1197
|
+
{
|
|
1198
|
+
className: "absolute top-0 bottom-0 w-px bg-white/55",
|
|
1199
|
+
style: { left: `${ut}%` }
|
|
1200
|
+
},
|
|
1201
|
+
`${h.id}:${nt}:${Y.name}`
|
|
1202
|
+
);
|
|
1203
|
+
}),
|
|
1204
|
+
/* @__PURE__ */ t(
|
|
1205
|
+
"div",
|
|
1206
|
+
{
|
|
1207
|
+
className: "absolute top-0 bottom-0 rounded",
|
|
1208
|
+
style: { left: `${O}%`, width: `${j}%`, ...Le(h) }
|
|
1209
|
+
}
|
|
1210
|
+
)
|
|
1211
|
+
] })
|
|
1212
|
+
]
|
|
1213
|
+
},
|
|
1214
|
+
h.id
|
|
1215
|
+
);
|
|
1216
|
+
}) }),
|
|
1217
|
+
C.length === 0 && /* @__PURE__ */ t("div", { className: "mt-2 px-2 py-4 text-[11px] text-dt-text-muted text-center border border-dt-border-light/40 rounded", children: "No spans match the current filter." })
|
|
1218
|
+
] })
|
|
1219
|
+
] }) : /* @__PURE__ */ t("div", { className: "flex-1 min-h-0 overflow-auto bg-dt-bg-secondary/30", style: { maxHeight: q }, children: /* @__PURE__ */ n("div", { className: "min-w-[820px] p-2", children: [
|
|
1220
|
+
/* @__PURE__ */ n("div", { className: "mb-2", children: [
|
|
1221
|
+
/* @__PURE__ */ t("div", { className: "relative h-4 text-[9px] font-mono text-dt-text-muted/70 mb-1", children: [0, 25, 50, 75, 100].map((l) => /* @__PURE__ */ t(
|
|
1222
|
+
"span",
|
|
1223
|
+
{
|
|
1224
|
+
className: "absolute top-0",
|
|
1225
|
+
style: {
|
|
1226
|
+
left: `${l}%`,
|
|
1227
|
+
transform: l === 0 ? "translateX(0)" : l === 100 ? "translateX(-100%)" : "translateX(-50%)"
|
|
1228
|
+
},
|
|
1229
|
+
children: l === 0 ? "0ms" : lt(M * l / 100)
|
|
1230
|
+
},
|
|
1231
|
+
`tick-${l}`
|
|
1232
|
+
)) }),
|
|
1233
|
+
/* @__PURE__ */ t("div", { className: "relative h-5 border border-dt-border-light/50 rounded bg-dt-bg-tertiary/40", children: [0, 25, 50, 75, 100].map((l) => /* @__PURE__ */ t("div", { className: "absolute inset-y-0", style: { left: `${l}%` }, children: /* @__PURE__ */ t("div", { className: "absolute inset-y-0 w-px bg-white/10" }) }, `line-${l}`)) })
|
|
1234
|
+
] }),
|
|
1235
|
+
/* @__PURE__ */ t("div", { className: "mb-2 h-7 rounded border border-dt-border-light/50 bg-dt-bg-tertiary/35 px-2 flex items-center gap-2 text-[10px] font-mono overflow-hidden", children: D ? /* @__PURE__ */ n(et, { children: [
|
|
1236
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary truncate max-w-[38%]", title: D.name, children: D.name }),
|
|
1237
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted uppercase", children: D.kind }),
|
|
1238
|
+
/* @__PURE__ */ t("span", { className: D.status === "error" ? "text-dt-error" : "text-dt-success", children: D.status }),
|
|
1239
|
+
it && /* @__PURE__ */ n("span", { className: "text-dt-text-muted/80 truncate max-w-[20%]", title: it.name, children: [
|
|
1240
|
+
"parent ",
|
|
1241
|
+
It(it.name, 24)
|
|
1242
|
+
] }),
|
|
1243
|
+
/* @__PURE__ */ n("span", { className: "ml-auto text-dt-text-muted", children: [
|
|
1244
|
+
"start ",
|
|
1245
|
+
gt(pt)
|
|
1246
|
+
] }),
|
|
1247
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted", children: [
|
|
1248
|
+
"self ",
|
|
1249
|
+
lt(ot)
|
|
1250
|
+
] }),
|
|
1251
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted", children: [
|
|
1252
|
+
"total ",
|
|
1253
|
+
lt(D.durationMs)
|
|
1254
|
+
] }),
|
|
1255
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted", children: [
|
|
1256
|
+
"evt ",
|
|
1257
|
+
D.events?.length ?? 0
|
|
1258
|
+
] })
|
|
1259
|
+
] }) : /* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "Hover a span for details" }) }),
|
|
1260
|
+
/* @__PURE__ */ t("div", { className: "space-y-[3px]", children: I.map((l, h) => /* @__PURE__ */ t(
|
|
1261
|
+
"div",
|
|
1262
|
+
{
|
|
1263
|
+
className: "relative h-5 rounded bg-dt-bg-tertiary/35 border border-dt-border-light/40 overflow-hidden",
|
|
1264
|
+
children: l.map((_) => {
|
|
1265
|
+
const g = _.span, T = Number.isFinite(g.durationMs) && g.durationMs > 0 ? g.durationMs : 0, { leftPct: A, widthPct: O } = ae(
|
|
1266
|
+
g.startMs,
|
|
1267
|
+
T,
|
|
1268
|
+
$,
|
|
1269
|
+
M
|
|
1270
|
+
), j = c === g.id, Q = O > 24 ? It(g.name, 28) : O > 14 ? g.kind : "";
|
|
1271
|
+
return /* @__PURE__ */ t(
|
|
1272
|
+
"button",
|
|
1273
|
+
{
|
|
1274
|
+
type: "button",
|
|
1275
|
+
onMouseDown: (K) => K.preventDefault(),
|
|
1276
|
+
onMouseEnter: () => y(g.id),
|
|
1277
|
+
onMouseLeave: () => y((K) => K === g.id ? null : K),
|
|
1278
|
+
onFocus: () => y(g.id),
|
|
1279
|
+
onBlur: () => y((K) => K === g.id ? null : K),
|
|
1280
|
+
onClick: () => {
|
|
1281
|
+
m(g.id), y(g.id);
|
|
1282
|
+
},
|
|
1283
|
+
className: "absolute top-0.5 h-[16px] rounded-sm border px-1 text-[9px] font-mono text-left overflow-hidden whitespace-nowrap text-ellipsis",
|
|
1284
|
+
style: { left: `${A}%`, width: `${O}%`, ...Ie(g, j) },
|
|
1285
|
+
title: `${g.name} (${g.kind}) ${lt(T)} @ ${gt(g.startMs - $)}`,
|
|
1286
|
+
children: Q
|
|
1287
|
+
},
|
|
1288
|
+
g.id
|
|
1289
|
+
);
|
|
1290
|
+
})
|
|
1291
|
+
},
|
|
1292
|
+
`lane-${h}`
|
|
1293
|
+
)) }),
|
|
1294
|
+
I.length === 0 && /* @__PURE__ */ t("div", { className: "mt-2 px-2 py-4 text-[11px] text-dt-text-muted text-center border border-dt-border-light/40 rounded", children: "No spans match the current filter." })
|
|
1295
|
+
] }) }),
|
|
1296
|
+
/* @__PURE__ */ t("div", { className: "border-t border-dt-border bg-dt-bg-secondary", children: /* @__PURE__ */ t("div", { className: "overflow-auto p-2 pr-1", style: { maxHeight: Me }, children: D ? /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
|
|
1297
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
1298
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-[9px] uppercase text-dt-text-muted/70", children: D.kind }),
|
|
1299
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-[11px] text-dt-text-secondary truncate", title: D.name, children: D.name }),
|
|
1300
|
+
/* @__PURE__ */ t(
|
|
1301
|
+
"span",
|
|
1302
|
+
{
|
|
1303
|
+
className: `ml-auto text-[9px] uppercase font-semibold ${D.status === "error" ? "text-dt-error" : "text-dt-success"}`,
|
|
1304
|
+
children: D.status
|
|
1305
|
+
}
|
|
1306
|
+
)
|
|
1307
|
+
] }),
|
|
1308
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-2 gap-1 text-[9px] font-mono text-dt-text-muted/80", children: [
|
|
1309
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 rounded bg-dt-bg-tertiary", children: [
|
|
1310
|
+
"start ",
|
|
1311
|
+
gt(D.startMs - $)
|
|
1312
|
+
] }),
|
|
1313
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 rounded bg-dt-bg-tertiary", children: [
|
|
1314
|
+
"end ",
|
|
1315
|
+
gt(D.endMs - $)
|
|
1316
|
+
] }),
|
|
1317
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 rounded bg-dt-bg-tertiary", children: [
|
|
1318
|
+
"self ",
|
|
1319
|
+
lt(ot)
|
|
1320
|
+
] }),
|
|
1321
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 rounded bg-dt-bg-tertiary", children: [
|
|
1322
|
+
"total ",
|
|
1323
|
+
lt(D.durationMs)
|
|
1324
|
+
] })
|
|
1325
|
+
] }),
|
|
1326
|
+
it && /* @__PURE__ */ n("div", { className: "text-[9px] font-mono text-dt-text-muted/70", title: it.name, children: [
|
|
1327
|
+
"parent ",
|
|
1328
|
+
It(it.name, 56)
|
|
1329
|
+
] }),
|
|
1330
|
+
e.requestId && /* @__PURE__ */ n("div", { className: "text-[9px] font-mono text-dt-text-muted/70", title: e.requestId, children: [
|
|
1331
|
+
"request ",
|
|
1332
|
+
It(e.requestId, 56)
|
|
1333
|
+
] }),
|
|
1334
|
+
mt.length > 0 && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: mt.map(([l, h]) => /* @__PURE__ */ n(
|
|
1335
|
+
"div",
|
|
1336
|
+
{
|
|
1337
|
+
className: "px-1.5 py-0.5 rounded bg-dt-bg-tertiary text-[9px] font-mono text-dt-text-muted/90 break-all",
|
|
1338
|
+
title: `${l}: ${ne(h)}`,
|
|
1339
|
+
children: [
|
|
1340
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted/70", children: [
|
|
1341
|
+
l,
|
|
1342
|
+
"="
|
|
1343
|
+
] }),
|
|
1344
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary", children: ne(h) })
|
|
1345
|
+
]
|
|
1346
|
+
},
|
|
1347
|
+
l
|
|
1348
|
+
)) }),
|
|
1349
|
+
wt.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-0.5", children: wt.map((l, h) => /* @__PURE__ */ n(
|
|
1350
|
+
"div",
|
|
1351
|
+
{
|
|
1352
|
+
className: "font-mono text-[10px] text-dt-text-muted/90",
|
|
1353
|
+
children: [
|
|
1354
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/70", children: gt(l.atMs - $) }),
|
|
1355
|
+
" ",
|
|
1356
|
+
/* @__PURE__ */ t("span", { className: "text-dt-info/90", children: l.name }),
|
|
1357
|
+
l.attributes ? ` ${JSON.stringify(l.attributes)}` : ""
|
|
1358
|
+
]
|
|
1359
|
+
},
|
|
1360
|
+
`${D.id}:${h}:${l.name}`
|
|
1361
|
+
)) })
|
|
1362
|
+
] }) : /* @__PURE__ */ t("div", { className: "flex items-center justify-center text-[11px] text-dt-text-muted min-h-14", children: "Select a span to inspect details." }) }) })
|
|
1363
|
+
]
|
|
1364
|
+
}
|
|
1365
|
+
)
|
|
1366
|
+
] });
|
|
1367
|
+
}
|
|
1368
|
+
const Xt = me.forwardRef(
|
|
1369
|
+
({ value: e, onValueChange: r, onClear: a, placeholder: s, className: d = "", ...x }, c) => {
|
|
1370
|
+
const m = () => {
|
|
1371
|
+
a ? a() : r("");
|
|
1372
|
+
};
|
|
1373
|
+
return /* @__PURE__ */ n("div", { className: `relative flex items-center ${d === "stretch" ? "flex-1" : ""}`, role: "search", children: [
|
|
1374
|
+
/* @__PURE__ */ t(
|
|
1375
|
+
"input",
|
|
1376
|
+
{
|
|
1377
|
+
...x,
|
|
1378
|
+
ref: c,
|
|
1379
|
+
type: "search",
|
|
1380
|
+
className: "w-full bg-dt-bg-tertiary/50 border border-dt-border-light rounded-md px-2.5 pr-7 py-1 text-[11px] text-dt-text-secondary placeholder:text-dt-text-muted/50 outline-none focus:border-dt-info/50 focus:bg-dt-bg-tertiary transition-colors font-sans [&::-webkit-search-cancel-button]:hidden",
|
|
1381
|
+
value: e,
|
|
1382
|
+
onChange: (w) => r(w.target.value),
|
|
1383
|
+
placeholder: s,
|
|
1384
|
+
spellCheck: x.spellCheck ?? !1,
|
|
1385
|
+
"aria-label": x["aria-label"] || s || "Search"
|
|
1386
|
+
}
|
|
1387
|
+
),
|
|
1388
|
+
e && /* @__PURE__ */ t(
|
|
1389
|
+
"button",
|
|
1390
|
+
{
|
|
1391
|
+
type: "button",
|
|
1392
|
+
className: "absolute right-1.5 p-0.5 bg-transparent border-none text-dt-text-muted cursor-pointer rounded hover:text-dt-text-tertiary transition-colors",
|
|
1393
|
+
onClick: m,
|
|
1394
|
+
"aria-label": "Clear search",
|
|
1395
|
+
title: "Clear search",
|
|
1396
|
+
children: /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ t("path", { d: "M3.646 3.646a.5.5 0 0 1 .708 0L8 7.293l3.646-3.647a.5.5 0 0 1 .708.708L8.707 8l3.647 3.646a.5.5 0 0 1-.708.708L8 8.707l-3.646 3.647a.5.5 0 0 1-.708-.708L7.293 8 3.646 4.354a.5.5 0 0 1 0-.708Z" }) })
|
|
1397
|
+
}
|
|
1398
|
+
)
|
|
1399
|
+
] });
|
|
1400
|
+
}
|
|
1401
|
+
);
|
|
1402
|
+
function Gt({ x: e, y: r, items: a, onClose: s }) {
|
|
1403
|
+
const [d, x] = z(-1), c = Ct(null), [m, w] = z({ x: e, y: r });
|
|
1404
|
+
U(() => {
|
|
1405
|
+
const f = c.current;
|
|
1406
|
+
if (!f) return;
|
|
1407
|
+
const b = 8, N = f.getBoundingClientRect(), k = window.innerWidth, y = window.innerHeight;
|
|
1408
|
+
let S = e, $ = r;
|
|
1409
|
+
e + N.width > k - b && (S = Math.max(b, k - N.width - b)), r + N.height > y - b && ($ = Math.max(b, y - N.height - b)), (S !== m.x || $ !== m.y) && w({ x: S, y: $ });
|
|
1410
|
+
}, [e, r]), U(() => {
|
|
1411
|
+
const f = (S) => {
|
|
1412
|
+
c.current && !c.current.contains(S.target) && s();
|
|
1413
|
+
}, b = (S) => {
|
|
1414
|
+
c.current && !c.current.contains(S.target) && s();
|
|
1415
|
+
}, N = () => s(), k = () => s(), y = setTimeout(() => {
|
|
1416
|
+
document.addEventListener("mousedown", f), document.addEventListener("contextmenu", b);
|
|
1417
|
+
}, 0);
|
|
1418
|
+
return window.addEventListener("scroll", N, !0), window.addEventListener("blur", k), () => {
|
|
1419
|
+
clearTimeout(y), document.removeEventListener("mousedown", f), document.removeEventListener("contextmenu", b), window.removeEventListener("scroll", N, !0), window.removeEventListener("blur", k);
|
|
1420
|
+
};
|
|
1421
|
+
}, [s]);
|
|
1422
|
+
const v = a.map((f, b) => ({ ...f, index: b })).filter((f) => !f.disabled), E = J(
|
|
1423
|
+
(f) => {
|
|
1424
|
+
if (f.key === "Escape") {
|
|
1425
|
+
f.preventDefault(), f.stopPropagation(), s();
|
|
1426
|
+
return;
|
|
1427
|
+
}
|
|
1428
|
+
if (f.key === "ArrowDown") {
|
|
1429
|
+
f.preventDefault(), x((b) => {
|
|
1430
|
+
const N = v.findIndex((y) => y.index === b), k = N < v.length - 1 ? N + 1 : 0;
|
|
1431
|
+
return v[k].index;
|
|
1432
|
+
});
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
if (f.key === "ArrowUp") {
|
|
1436
|
+
f.preventDefault(), x((b) => {
|
|
1437
|
+
const N = v.findIndex((y) => y.index === b), k = N > 0 ? N - 1 : v.length - 1;
|
|
1438
|
+
return v[k].index;
|
|
1439
|
+
});
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
if (f.key === "Enter") {
|
|
1443
|
+
f.preventDefault(), d >= 0 && !a[d].disabled && (a[d].action(), s());
|
|
1444
|
+
return;
|
|
1445
|
+
}
|
|
1446
|
+
},
|
|
1447
|
+
[s, d, a, v]
|
|
1448
|
+
);
|
|
1449
|
+
return U(() => (window.addEventListener("keydown", E, !0), () => window.removeEventListener("keydown", E, !0)), [E]), U(() => {
|
|
1450
|
+
v.length > 0 && d === -1 && x(v[0].index);
|
|
1451
|
+
}, []), /* @__PURE__ */ t(
|
|
1452
|
+
"div",
|
|
1453
|
+
{
|
|
1454
|
+
ref: c,
|
|
1455
|
+
className: "fixed z-[9999999] min-w-[180px] max-w-[280px] bg-zinc-900/[0.98] backdrop-blur-lg border border-dt-border rounded-lg shadow-2xl py-1 animate-[dt-fade-in_0.1s_ease-out]",
|
|
1456
|
+
style: { top: m.y, left: m.x },
|
|
1457
|
+
role: "menu",
|
|
1458
|
+
onContextMenu: (f) => f.preventDefault(),
|
|
1459
|
+
children: a.map((f, b) => /* @__PURE__ */ n("div", { children: [
|
|
1460
|
+
f.separator && b > 0 && /* @__PURE__ */ t("div", { className: "border-t border-dt-border-light/40 my-0.5", role: "separator" }),
|
|
1461
|
+
/* @__PURE__ */ n(
|
|
1462
|
+
"button",
|
|
1463
|
+
{
|
|
1464
|
+
className: `flex items-center w-full px-3 py-1.5 text-[12px] text-left bg-transparent border-none cursor-pointer transition-colors ${f.disabled ? "opacity-40 pointer-events-none text-dt-text-muted" : d === b ? "bg-white/[0.08] text-dt-text-secondary" : "text-dt-text-secondary hover:bg-white/[0.06]"}`,
|
|
1465
|
+
role: "menuitem",
|
|
1466
|
+
tabIndex: -1,
|
|
1467
|
+
disabled: f.disabled,
|
|
1468
|
+
onMouseEnter: () => {
|
|
1469
|
+
f.disabled || x(b);
|
|
1470
|
+
},
|
|
1471
|
+
onClick: (N) => {
|
|
1472
|
+
N.stopPropagation(), f.disabled || (f.action(), s());
|
|
1473
|
+
},
|
|
1474
|
+
children: [
|
|
1475
|
+
/* @__PURE__ */ t("span", { className: "flex-1 truncate", children: f.label }),
|
|
1476
|
+
f.shortcut && /* @__PURE__ */ t("span", { className: "text-dt-text-muted font-mono text-[11px] ml-4 shrink-0", children: f.shortcut })
|
|
1477
|
+
]
|
|
1478
|
+
}
|
|
1479
|
+
)
|
|
1480
|
+
] }, b))
|
|
1481
|
+
}
|
|
1482
|
+
);
|
|
1483
|
+
}
|
|
1484
|
+
function zt(e) {
|
|
1485
|
+
return e.type === "query" || e.type === "mutation" || e.type === "action";
|
|
1486
|
+
}
|
|
1487
|
+
function Ht(e) {
|
|
1488
|
+
return e.type === "auth";
|
|
1489
|
+
}
|
|
1490
|
+
function Lt(e) {
|
|
1491
|
+
return zt(e) || Ht(e);
|
|
1492
|
+
}
|
|
1493
|
+
const _e = `
|
|
1494
|
+
.cdv-json-key { color: var(--color-dt-text-tertiary); }
|
|
1495
|
+
.cdv-json-string { color: var(--color-dt-success); }
|
|
1496
|
+
.cdv-json-number { color: var(--color-dt-query); }
|
|
1497
|
+
.cdv-json-boolean { color: var(--color-dt-mutation); }
|
|
1498
|
+
.cdv-json-null { color: var(--color-dt-text-muted); }
|
|
1499
|
+
.cdv-json-value { color: var(--color-dt-text-secondary); }
|
|
1500
|
+
`, At = 100, ie = 100, ft = 4e3, ze = {
|
|
1501
|
+
maxStringLength: 128,
|
|
1502
|
+
stringTailLength: 24,
|
|
1503
|
+
maxArrayItems: 4,
|
|
1504
|
+
maxObjectEntries: 4,
|
|
1505
|
+
maxDepth: 3
|
|
1506
|
+
};
|
|
1507
|
+
function Rt(e) {
|
|
1508
|
+
if (e == null) return "";
|
|
1509
|
+
if (typeof e == "string")
|
|
1510
|
+
return e.length > ft ? e.slice(0, ft) : e;
|
|
1511
|
+
try {
|
|
1512
|
+
const r = JSON.stringify(e);
|
|
1513
|
+
return r ? r.length > ft ? r.slice(0, ft) : r : "";
|
|
1514
|
+
} catch {
|
|
1515
|
+
const r = String(e);
|
|
1516
|
+
return r.length > ft ? r.slice(0, ft) : r;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
function Pe(e) {
|
|
1520
|
+
const [r, a] = e.split("-", 3);
|
|
1521
|
+
return r === "query" && a ? `Q${a}` : r === "mutation" && a ? `M${a}` : r === "action" && a ? `A${a}` : e;
|
|
1522
|
+
}
|
|
1523
|
+
function qe({ eventStore: e, panelConnectionState: r }) {
|
|
1524
|
+
const [a, s] = z([]), [d, x] = z("all"), [c, m] = z(""), [w, v] = z(At), [E, f] = z(null), [b, N] = z(0), [k, y] = z(null), [S, $] = z(null), P = Ct(null), M = E && zt(E) ? E : null, q = E && Ht(E) ? E : null, R = J(() => {
|
|
1525
|
+
v(At), N(0);
|
|
1526
|
+
}, []), p = J(
|
|
1527
|
+
(o) => {
|
|
1528
|
+
x(o), R();
|
|
1529
|
+
},
|
|
1530
|
+
[R]
|
|
1531
|
+
), u = J(
|
|
1532
|
+
(o) => {
|
|
1533
|
+
m(o), R();
|
|
1534
|
+
},
|
|
1535
|
+
[R]
|
|
1536
|
+
);
|
|
1537
|
+
U(() => {
|
|
1538
|
+
const o = () => {
|
|
1539
|
+
s(e.getAllEvents());
|
|
1540
|
+
}, l = e.subscribe(o);
|
|
1541
|
+
return o(), l;
|
|
1542
|
+
}, [e]), U(() => {
|
|
1543
|
+
const o = (h) => {
|
|
1544
|
+
if (!h) return;
|
|
1545
|
+
const _ = e.getAllEvents().find((A) => A.id === h);
|
|
1546
|
+
if (!_ || !Lt(_)) return;
|
|
1547
|
+
x("all"), m(""), v(At), y(null), $(null), f(_), N(0);
|
|
1548
|
+
const T = e.getAllEvents().filter(Lt).sort((A, O) => O.timestamp - A.timestamp).findIndex((A) => A.id === h);
|
|
1549
|
+
T >= 0 && (v((A) => Math.max(A, At, T + 1)), N(T));
|
|
1550
|
+
}, l = e.subscribeFocus(o);
|
|
1551
|
+
return o(e.getFocusedEventId()), l;
|
|
1552
|
+
}, [e]);
|
|
1553
|
+
const i = J((o) => {
|
|
1554
|
+
const l = ct(o.args), h = [o.id, o.type, o.status, o.udfPath];
|
|
1555
|
+
if (o.componentPath && h.push(o.componentPath), o.type === "query")
|
|
1556
|
+
h.push(String(o.queryId), `q${o.queryId}`), o.triggeredBy && h.push(o.triggeredBy);
|
|
1557
|
+
else {
|
|
1558
|
+
const _ = o.type === "mutation" ? "m" : "a";
|
|
1559
|
+
h.push(String(o.requestId), `${_}${o.requestId}`);
|
|
1560
|
+
}
|
|
1561
|
+
return h.push(Rt(l)), o.result !== void 0 && h.push(Rt(o.result)), o.error && h.push(o.error), o.logLines && o.logLines.length > 0 && h.push(o.logLines.join(`
|
|
1562
|
+
`)), typeof o.duration == "number" && h.push(`${o.duration}`, `${o.duration}ms`), typeof o.simulatedDelayMs == "number" && o.simulatedDelayMs > 0 && h.push(`simulated ${o.simulatedDelayMs}`, `delay ${o.simulatedDelayMs}ms`), typeof o.endToEndDurationMs == "number" && h.push(`${o.endToEndDurationMs}`, `${o.endToEndDurationMs}ms`, "end-to-end"), h.join(`
|
|
1563
|
+
`).toLowerCase();
|
|
1564
|
+
}, []), C = J(
|
|
1565
|
+
(o) => {
|
|
1566
|
+
if (zt(o))
|
|
1567
|
+
return i(o);
|
|
1568
|
+
const l = [o.id, o.type, o.status, o.direction, o.messageType];
|
|
1569
|
+
return o.tokenType && l.push(o.tokenType), o.error && l.push(o.error), o.details !== void 0 && l.push(Rt(o.details)), l.join(`
|
|
1570
|
+
`).toLowerCase();
|
|
1571
|
+
},
|
|
1572
|
+
[i]
|
|
1573
|
+
), { filteredEvents: I, totalMatchCount: L, hasMoreResults: X } = V(() => {
|
|
1574
|
+
let o = a.filter(Lt);
|
|
1575
|
+
d !== "all" && (d === "error" ? o = o.filter((g) => g.status === "error") : o = o.filter((g) => g.type === d));
|
|
1576
|
+
const l = c.trim().toLowerCase().split(/\s+/).filter((g) => g.length > 0);
|
|
1577
|
+
l.length > 0 && (o = o.filter((g) => {
|
|
1578
|
+
const T = C(g);
|
|
1579
|
+
return l.every((A) => T.includes(A));
|
|
1580
|
+
}));
|
|
1581
|
+
const h = o.sort((g, T) => T.timestamp - g.timestamp), _ = h.slice(0, w);
|
|
1582
|
+
return {
|
|
1583
|
+
filteredEvents: _,
|
|
1584
|
+
totalMatchCount: h.length,
|
|
1585
|
+
hasMoreResults: h.length > _.length
|
|
1586
|
+
};
|
|
1587
|
+
}, [a, d, c, w, C]);
|
|
1588
|
+
U(() => {
|
|
1589
|
+
if (I.length === 0) {
|
|
1590
|
+
N(0);
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
N((o) => Math.min(o, I.length - 1));
|
|
1594
|
+
}, [I.length]);
|
|
1595
|
+
const B = V(() => {
|
|
1596
|
+
const o = a.filter(Lt), l = o.filter((A) => A.type === "query"), h = o.filter((A) => A.type === "mutation"), _ = o.filter((A) => A.type === "action"), g = o.filter((A) => A.type === "auth"), T = o.filter((A) => A.status === "error").length;
|
|
1597
|
+
return {
|
|
1598
|
+
queries: l.length,
|
|
1599
|
+
mutations: h.length,
|
|
1600
|
+
actions: _.length,
|
|
1601
|
+
auth: g.length,
|
|
1602
|
+
errors: T,
|
|
1603
|
+
total: l.length + h.length + _.length + g.length
|
|
1604
|
+
};
|
|
1605
|
+
}, [a]), rt = !!r?.waitingForConnection && d === "all" && !c;
|
|
1606
|
+
U(() => {
|
|
1607
|
+
const o = (l) => {
|
|
1608
|
+
if (Pt()) {
|
|
1609
|
+
if ((l.metaKey || l.ctrlKey) && l.key === "k") {
|
|
1610
|
+
l.preventDefault(), P.current?.focus();
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
if (l.key === "Escape") {
|
|
1614
|
+
l.preventDefault(), E ? f(null) : (d !== "all" || c) && (p("all"), u(""));
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
if (pe() !== P.current && I.length !== 0) {
|
|
1618
|
+
if (l.key === "ArrowDown")
|
|
1619
|
+
l.preventDefault(), N((h) => Math.min(h + 1, I.length - 1));
|
|
1620
|
+
else if (l.key === "ArrowUp")
|
|
1621
|
+
l.preventDefault(), N((h) => Math.max(h - 1, 0));
|
|
1622
|
+
else if (l.key === "Enter") {
|
|
1623
|
+
l.preventDefault();
|
|
1624
|
+
const h = I[b];
|
|
1625
|
+
h && f(E?.id === h.id ? null : h);
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
1631
|
+
}, [I, b, E, d, c, p, u]);
|
|
1632
|
+
const G = (o) => {
|
|
1633
|
+
if (o == null) return "0";
|
|
1634
|
+
const l = JSON.stringify(o), h = new Blob([l]).size;
|
|
1635
|
+
return h < 1024 ? `${h}B` : h < 1024 * 1024 ? `${(h / 1024).toFixed(1)}KB` : `${(h / (1024 * 1024)).toFixed(1)}MB`;
|
|
1636
|
+
}, D = (o) => !Number.isFinite(o) || o < 0 ? "—" : o < 1e3 ? `${o.toFixed(3)}ms` : o < 6e4 ? `${(o / 1e3).toFixed(3)}s` : o < 36e5 ? `${(o / 6e4).toFixed(1)}m` : `${(o / 36e5).toFixed(2)}h`, tt = (o) => typeof o.duration != "number" || !Number.isFinite(o.duration) || o.duration < 0 ? null : o.duration, ot = (o) => typeof o.simulatedDelayMs != "number" || !Number.isFinite(o.simulatedDelayMs) || o.simulatedDelayMs <= 0 ? 0 : o.simulatedDelayMs, it = (o) => {
|
|
1637
|
+
if (typeof o.endToEndDurationMs == "number" && Number.isFinite(o.endToEndDurationMs) && o.endToEndDurationMs >= 0)
|
|
1638
|
+
return o.endToEndDurationMs;
|
|
1639
|
+
const l = tt(o);
|
|
1640
|
+
return l === null ? null : l + ot(o);
|
|
1641
|
+
}, pt = (o) => {
|
|
1642
|
+
const l = Date.now() - o;
|
|
1643
|
+
return l < 2e3 ? "just now" : l < 6e4 ? `${Math.floor(l / 1e3)}s ago` : l < 36e5 ? `${Math.floor(l / 6e4)}m ago` : l < 864e5 ? `${Math.floor(l / 36e5)}h ago` : `${Math.floor(l / 864e5)}d ago`;
|
|
1644
|
+
}, mt = (o) => new Date(o).toLocaleTimeString([], {
|
|
1645
|
+
hour: "2-digit",
|
|
1646
|
+
minute: "2-digit",
|
|
1647
|
+
second: "2-digit",
|
|
1648
|
+
fractionalSecondDigits: 3
|
|
1649
|
+
}), wt = (o) => o.type === "query" ? `Q${o.queryId}` : o.type === "mutation" ? `M${o.requestId}` : o.type === "action" ? `A${o.requestId}` : null, vt = (o) => zt(o) ? wt(o) ?? o.id : `${o.direction === "client" ? "C" : "S"}:${o.messageType}`, bt = J((o, l) => {
|
|
1650
|
+
if (typeof window > "u") return null;
|
|
1651
|
+
const h = 8, _ = 300, g = window.innerWidth, T = window.innerHeight, A = Math.min(260, T - h * 2);
|
|
1652
|
+
let O = l.right + h;
|
|
1653
|
+
O + _ > g - h && (O = l.left - _ - h), O < h && (O = Math.max(h, g - _ - h));
|
|
1654
|
+
let j = l.top + l.height / 2 - A / 2;
|
|
1655
|
+
return j < h && (j = h), j + A > T - h && (j = Math.max(h, T - h - A)), { event: o, x: O, y: j };
|
|
1656
|
+
}, []), St = J(
|
|
1657
|
+
(o) => {
|
|
1658
|
+
if (Ht(o)) {
|
|
1659
|
+
const A = [
|
|
1660
|
+
{ label: "Copy Message Type", action: () => F(o.messageType), shortcut: "⌘C" }
|
|
1661
|
+
];
|
|
1662
|
+
return o.error && A.push({
|
|
1663
|
+
label: "Copy Error",
|
|
1664
|
+
action: () => F(o.error)
|
|
1665
|
+
}), o.details !== void 0 && A.push({
|
|
1666
|
+
label: "Copy Details",
|
|
1667
|
+
action: () => F(JSON.stringify(o.details, null, 2))
|
|
1668
|
+
}), A.push({
|
|
1669
|
+
label: "Filter by Type: auth",
|
|
1670
|
+
action: () => p("auth"),
|
|
1671
|
+
separator: !0
|
|
1672
|
+
}), A.push({
|
|
1673
|
+
label: "Copy Event ID",
|
|
1674
|
+
action: () => F(o.id),
|
|
1675
|
+
separator: !0
|
|
1676
|
+
}), A.push({
|
|
1677
|
+
label: "Copy as JSON",
|
|
1678
|
+
action: () => F(JSON.stringify(o, null, 2))
|
|
1679
|
+
}), A;
|
|
1680
|
+
}
|
|
1681
|
+
const l = ct(o.args), h = l != null, _ = o.status === "success" && o.result !== void 0, g = o.status === "error" && !!o.error, T = [
|
|
1682
|
+
{ label: "Copy Function Path", action: () => F(o.udfPath), shortcut: "⌘C" }
|
|
1683
|
+
];
|
|
1684
|
+
if (h) {
|
|
1685
|
+
const A = JSON.stringify(l);
|
|
1686
|
+
T.push({
|
|
1687
|
+
label: "Copy as convex run",
|
|
1688
|
+
action: () => F(`npx convex run ${o.udfPath} '${A}'`)
|
|
1689
|
+
}), T.push({
|
|
1690
|
+
label: "Copy Arguments",
|
|
1691
|
+
action: () => F(JSON.stringify(l, null, 2))
|
|
1692
|
+
});
|
|
1693
|
+
}
|
|
1694
|
+
return _ && T.push({
|
|
1695
|
+
label: "Copy Result",
|
|
1696
|
+
action: () => F(JSON.stringify(o.result, null, 2))
|
|
1697
|
+
}), g && T.push({
|
|
1698
|
+
label: "Copy Error",
|
|
1699
|
+
action: () => F(o.error)
|
|
1700
|
+
}), T.push({
|
|
1701
|
+
label: "Filter by Function",
|
|
1702
|
+
action: () => u(o.udfPath),
|
|
1703
|
+
separator: !0
|
|
1704
|
+
}), T.push({
|
|
1705
|
+
label: `Filter by Type: ${o.type}`,
|
|
1706
|
+
action: () => p(o.type)
|
|
1707
|
+
}), T.push({
|
|
1708
|
+
label: "Copy Event ID",
|
|
1709
|
+
action: () => F(o.id),
|
|
1710
|
+
separator: !0
|
|
1711
|
+
}), T.push({
|
|
1712
|
+
label: "Copy as JSON",
|
|
1713
|
+
action: () => F(JSON.stringify(o, null, 2))
|
|
1714
|
+
}), T;
|
|
1715
|
+
},
|
|
1716
|
+
[p, u]
|
|
1717
|
+
);
|
|
1718
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
1719
|
+
/* @__PURE__ */ t("style", { children: _e }),
|
|
1720
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-1.5 border-b border-dt-border-light", children: [
|
|
1721
|
+
/* @__PURE__ */ t("div", { className: "flex gap-[3px] bg-zinc-900/50 p-[3px] rounded-md border border-zinc-700/30", children: ["all", "query", "mutation", "action", "auth", "error"].map((o) => /* @__PURE__ */ t(
|
|
1722
|
+
"button",
|
|
1723
|
+
{
|
|
1724
|
+
className: `px-2 py-1 text-[11px] font-mono font-bold uppercase tracking-wide bg-transparent border-none rounded cursor-pointer transition-all ${d === o ? o === "query" ? "bg-dt-query/25 text-dt-query shadow-[0_0_0_1px_rgba(96,165,250,0.5)]" : o === "mutation" ? "bg-dt-mutation/25 text-dt-mutation shadow-[0_0_0_1px_rgba(167,139,250,0.5)]" : o === "action" ? "bg-dt-action/25 text-dt-action shadow-[0_0_0_1px_rgba(52,211,153,0.5)]" : o === "auth" ? "bg-dt-warning/20 text-dt-warning shadow-[0_0_0_1px_rgba(245,158,11,0.5)]" : o === "error" ? "bg-dt-error/25 text-dt-error shadow-[0_0_0_1px_rgba(239,68,68,0.5)]" : "bg-zinc-500/25 text-dt-text-tertiary shadow-[0_0_0_1px_rgba(161,161,170,0.4)]" : o === "query" ? "text-dt-text-muted hover:bg-dt-query/15 hover:text-dt-query" : o === "mutation" ? "text-dt-text-muted hover:bg-dt-mutation/15 hover:text-dt-mutation" : o === "action" ? "text-dt-text-muted hover:bg-dt-action/15 hover:text-dt-action" : o === "auth" ? "text-dt-text-muted hover:bg-dt-warning/15 hover:text-dt-warning" : o === "error" ? "text-dt-text-muted hover:bg-dt-error/15 hover:text-dt-error" : "text-dt-text-muted hover:bg-white/5 hover:text-dt-text-tertiary"}`,
|
|
1725
|
+
onClick: () => p(o),
|
|
1726
|
+
children: o === "all" ? `All ${B.total}` : `${o === "auth" ? "C" : o === "error" ? "E" : o.charAt(0).toUpperCase()} ${o === "query" ? B.queries : o === "mutation" ? B.mutations : o === "action" ? B.actions : o === "error" ? B.errors : B.auth}`
|
|
1727
|
+
},
|
|
1728
|
+
o
|
|
1729
|
+
)) }),
|
|
1730
|
+
/* @__PURE__ */ t(
|
|
1731
|
+
Xt,
|
|
1732
|
+
{
|
|
1733
|
+
ref: P,
|
|
1734
|
+
value: c,
|
|
1735
|
+
onValueChange: u,
|
|
1736
|
+
onClear: () => u(""),
|
|
1737
|
+
placeholder: "Search path/auth/error/details... (Cmd/Ctrl+K)",
|
|
1738
|
+
className: "stretch"
|
|
1739
|
+
}
|
|
1740
|
+
),
|
|
1741
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 ml-auto shrink-0", children: (d !== "all" || c) && /* @__PURE__ */ t(
|
|
1742
|
+
"button",
|
|
1743
|
+
{
|
|
1744
|
+
className: "p-1 bg-transparent border-none text-dt-text-muted cursor-pointer rounded transition-colors hover:text-dt-text-tertiary",
|
|
1745
|
+
onClick: () => {
|
|
1746
|
+
p("all"), u("");
|
|
1747
|
+
},
|
|
1748
|
+
title: "Clear filters (Esc)",
|
|
1749
|
+
children: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z" }) })
|
|
1750
|
+
}
|
|
1751
|
+
) })
|
|
1752
|
+
] }),
|
|
1753
|
+
I.length === 0 && /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-dt-text-muted gap-2", children: [
|
|
1754
|
+
/* @__PURE__ */ n("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: [
|
|
1755
|
+
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", strokeWidth: "1.5" }),
|
|
1756
|
+
/* @__PURE__ */ t("path", { d: "M12 6v6l4 2", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1757
|
+
] }),
|
|
1758
|
+
rt ? /* @__PURE__ */ n(et, { children: [
|
|
1759
|
+
/* @__PURE__ */ t("p", { children: "Waiting for Convex WebSocket activity" }),
|
|
1760
|
+
r.needsReload ? /* @__PURE__ */ n(et, { children: [
|
|
1761
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] text-dt-text-muted/60 max-w-[360px] text-center", children: "Page was already connected before DevTools attached. Reload to start capturing this connection." }),
|
|
1762
|
+
/* @__PURE__ */ t(
|
|
1763
|
+
"button",
|
|
1764
|
+
{
|
|
1765
|
+
type: "button",
|
|
1766
|
+
className: "mt-1 px-3 py-1.5 text-[11px] font-medium rounded-md bg-dt-bg-tertiary border border-dt-border text-dt-text-secondary hover:bg-white/10 hover:border-dt-border-light transition-colors cursor-pointer",
|
|
1767
|
+
onClick: r.onReload,
|
|
1768
|
+
children: "Reload Page"
|
|
1769
|
+
}
|
|
1770
|
+
)
|
|
1771
|
+
] }) : /* @__PURE__ */ t("p", { className: "text-[11px] text-dt-text-muted/60 max-w-[360px] text-center", children: "Events will appear here once the app establishes a Convex WebSocket connection." }),
|
|
1772
|
+
/* @__PURE__ */ n("p", { className: "text-[10px] text-dt-text-muted/60 font-mono", children: [
|
|
1773
|
+
"Agent ",
|
|
1774
|
+
r.agentAttached ? "attached" : "attaching",
|
|
1775
|
+
" · Socket",
|
|
1776
|
+
" ",
|
|
1777
|
+
r.socketSeen ? "seen" : "waiting",
|
|
1778
|
+
" · Capture",
|
|
1779
|
+
" ",
|
|
1780
|
+
r.captureLive ? "live" : r.needsReload ? "reload" : "waiting"
|
|
1781
|
+
] })
|
|
1782
|
+
] }) : /* @__PURE__ */ n(et, { children: [
|
|
1783
|
+
/* @__PURE__ */ t("p", { children: "No activity yet" }),
|
|
1784
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] text-dt-text-muted/60", children: d !== "all" || c ? "No activity matches your current filters" : "Execute operations or auth flows to see them here" })
|
|
1785
|
+
] })
|
|
1786
|
+
] }),
|
|
1787
|
+
I.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
1788
|
+
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto", children: [
|
|
1789
|
+
X && /* @__PURE__ */ n("div", { className: "text-center text-[10px] text-dt-text-muted/60 py-1 border-b border-dt-border-light/30", children: [
|
|
1790
|
+
"Showing ",
|
|
1791
|
+
I.length,
|
|
1792
|
+
" of ",
|
|
1793
|
+
L
|
|
1794
|
+
] }),
|
|
1795
|
+
I.map((o, l) => {
|
|
1796
|
+
const h = E?.id === o.id, _ = l === b;
|
|
1797
|
+
if (o.type === "auth") {
|
|
1798
|
+
const W = o.direction === "client" ? "cli" : "srv", dt = o.direction === "client" ? "→" : "←", st = o.details && typeof o.details == "object" && !Array.isArray(o.details) ? Object.keys(o.details).length : null;
|
|
1799
|
+
return /* @__PURE__ */ t(
|
|
1800
|
+
"div",
|
|
1801
|
+
{
|
|
1802
|
+
className: `flex flex-col px-3 py-1.5 border-b border-dt-border-light/50 cursor-pointer transition-colors hover:bg-white/[0.03] ${h ? "bg-white/[0.06]" : ""} ${_ ? "bg-white/[0.03] outline outline-1 outline-dt-info/30 -outline-offset-1" : ""} ${o.status === "error" ? "border-l-2 border-l-dt-error/40" : ""}`,
|
|
1803
|
+
onClick: () => {
|
|
1804
|
+
f(h ? null : o), N(l);
|
|
1805
|
+
},
|
|
1806
|
+
onKeyDown: (H) => {
|
|
1807
|
+
(H.key === "Enter" || H.key === " ") && (H.preventDefault(), f(h ? null : o), N(l));
|
|
1808
|
+
},
|
|
1809
|
+
onContextMenu: (H) => {
|
|
1810
|
+
H.preventDefault(), y(null), $({
|
|
1811
|
+
x: H.clientX,
|
|
1812
|
+
y: H.clientY,
|
|
1813
|
+
items: St(o)
|
|
1814
|
+
});
|
|
1815
|
+
},
|
|
1816
|
+
onMouseEnter: (H) => {
|
|
1817
|
+
const qt = H.currentTarget.getBoundingClientRect(), ht = bt(o, qt);
|
|
1818
|
+
ht && y(ht);
|
|
1819
|
+
},
|
|
1820
|
+
onMouseMove: (H) => {
|
|
1821
|
+
if (k?.event.id === o.id) {
|
|
1822
|
+
const qt = H.currentTarget.getBoundingClientRect(), ht = bt(o, qt);
|
|
1823
|
+
ht && y(
|
|
1824
|
+
(yt) => yt && yt.event.id === o.id && (yt.x !== ht.x || yt.y !== ht.y) ? ht : yt
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1828
|
+
onMouseLeave: () => {
|
|
1829
|
+
y((H) => H && H.event.id === o.id ? null : H);
|
|
1830
|
+
},
|
|
1831
|
+
role: "button",
|
|
1832
|
+
tabIndex: 0,
|
|
1833
|
+
"aria-label": `Connection ${o.messageType} ${o.status}`,
|
|
1834
|
+
"aria-selected": h,
|
|
1835
|
+
"aria-current": _ ? "true" : void 0,
|
|
1836
|
+
children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
1837
|
+
/* @__PURE__ */ t("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-[3px] text-[9px] font-bold shrink-0 bg-dt-warning/20 text-dt-warning shadow-[0_1px_2px_rgba(245,158,11,0.35)]", children: "C" }),
|
|
1838
|
+
/* @__PURE__ */ t(
|
|
1839
|
+
"span",
|
|
1840
|
+
{
|
|
1841
|
+
className: `w-1.5 h-1.5 rounded-full shrink-0 ${o.status === "success" ? "bg-dt-success" : o.status === "error" ? "bg-dt-error" : "bg-dt-warning animate-pulse"}`,
|
|
1842
|
+
title: o.status
|
|
1843
|
+
}
|
|
1844
|
+
),
|
|
1845
|
+
/* @__PURE__ */ n("span", { className: "font-mono text-[12px] text-dt-text-secondary truncate flex-1", children: [
|
|
1846
|
+
dt,
|
|
1847
|
+
" ",
|
|
1848
|
+
o.messageType
|
|
1849
|
+
] }),
|
|
1850
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 shrink-0 text-[11px] text-dt-text-muted ml-auto", children: [
|
|
1851
|
+
o.tokenType && /* @__PURE__ */ t("span", { className: "text-dt-text-muted/80 font-mono text-[10px]", children: o.tokenType }),
|
|
1852
|
+
st !== null && /* @__PURE__ */ n("span", { className: "text-dt-text-muted/70 font-mono text-[10px]", children: [
|
|
1853
|
+
st,
|
|
1854
|
+
"f"
|
|
1855
|
+
] }),
|
|
1856
|
+
o.error && /* @__PURE__ */ t("span", { className: "text-dt-error truncate max-w-[180px]", title: o.error, children: o.error }),
|
|
1857
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/70 font-mono text-[10px]", children: W }),
|
|
1858
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60 font-mono", children: mt(o.timestamp) })
|
|
1859
|
+
] })
|
|
1860
|
+
] })
|
|
1861
|
+
},
|
|
1862
|
+
o.id
|
|
1863
|
+
);
|
|
1864
|
+
}
|
|
1865
|
+
const g = o, T = ct(g.args), A = T !== void 0, O = g.type === "query" ? e.getSubscription(g.queryId) : null, j = O && O.updateCount > 0, Q = it(g), K = tt(g), Y = ot(g), nt = g.type === "query" ? "Query" : g.type === "mutation" ? "Mutation" : "Action", ut = g.status === "success" ? "succeeded" : g.status === "error" ? "failed" : "pending", xt = Y > 0 && K !== null, $t = `${nt} ${g.udfPath} ${ut}${Q !== null ? ` in ${xt ? `e2e ${D(Q)}` : `net ${D(Q)}`}` : ""}${xt ? ` (${D(K)} net + ${D(Y)} simulated)` : ""}`, Dt = j && g.type === "query";
|
|
1866
|
+
return /* @__PURE__ */ t(
|
|
1867
|
+
"div",
|
|
1868
|
+
{
|
|
1869
|
+
className: `flex flex-col px-3 py-1.5 border-b border-dt-border-light/50 cursor-pointer transition-colors hover:bg-white/[0.03] ${h ? "bg-white/[0.06]" : ""} ${_ ? "bg-white/[0.03] outline outline-1 outline-dt-info/30 -outline-offset-1" : ""} ${g.status === "error" ? "border-l-2 border-l-dt-error/40" : ""} ${Dt ? "border-l-2 border-l-dt-query/30 bg-dt-query/[0.02]" : ""}`,
|
|
1870
|
+
onClick: () => {
|
|
1871
|
+
f(h ? null : o), N(l);
|
|
1872
|
+
},
|
|
1873
|
+
onKeyDown: (W) => {
|
|
1874
|
+
(W.key === "Enter" || W.key === " ") && (W.preventDefault(), f(h ? null : o), N(l));
|
|
1875
|
+
},
|
|
1876
|
+
onContextMenu: (W) => {
|
|
1877
|
+
W.preventDefault(), y(null), $({
|
|
1878
|
+
x: W.clientX,
|
|
1879
|
+
y: W.clientY,
|
|
1880
|
+
items: St(g)
|
|
1881
|
+
});
|
|
1882
|
+
},
|
|
1883
|
+
onMouseEnter: (W) => {
|
|
1884
|
+
const dt = W.currentTarget.getBoundingClientRect(), st = bt(g, dt);
|
|
1885
|
+
st && y(st);
|
|
1886
|
+
},
|
|
1887
|
+
onMouseMove: (W) => {
|
|
1888
|
+
if (k?.event.id === g.id) {
|
|
1889
|
+
const dt = W.currentTarget.getBoundingClientRect(), st = bt(g, dt);
|
|
1890
|
+
st && y(
|
|
1891
|
+
(H) => H && H.event.id === g.id && (H.x !== st.x || H.y !== st.y) ? st : H
|
|
1892
|
+
);
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
onMouseLeave: () => {
|
|
1896
|
+
y((W) => W && W.event.id === g.id ? null : W);
|
|
1897
|
+
},
|
|
1898
|
+
role: "button",
|
|
1899
|
+
tabIndex: 0,
|
|
1900
|
+
"aria-label": $t,
|
|
1901
|
+
"aria-selected": h,
|
|
1902
|
+
"aria-current": _ ? "true" : void 0,
|
|
1903
|
+
children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
1904
|
+
/* @__PURE__ */ t(
|
|
1905
|
+
"span",
|
|
1906
|
+
{
|
|
1907
|
+
className: `inline-flex items-center justify-center w-4 h-4 rounded-[3px] text-[9px] font-bold shrink-0 ${g.type === "query" ? "bg-dt-query/20 text-dt-query shadow-[0_1px_2px_rgba(96,165,250,0.35)]" : g.type === "mutation" ? "bg-dt-mutation/20 text-dt-mutation shadow-[0_1px_2px_rgba(167,139,250,0.35)]" : "bg-dt-action/20 text-dt-action shadow-[0_1px_2px_rgba(52,211,153,0.35)]"}`,
|
|
1908
|
+
title: g.type,
|
|
1909
|
+
children: g.type === "query" ? "Q" : g.type === "mutation" ? "M" : "A"
|
|
1910
|
+
}
|
|
1911
|
+
),
|
|
1912
|
+
/* @__PURE__ */ t(
|
|
1913
|
+
"span",
|
|
1914
|
+
{
|
|
1915
|
+
className: `w-1.5 h-1.5 rounded-full shrink-0 ${g.status === "success" ? "bg-dt-success" : g.status === "error" ? "bg-dt-error" : "bg-dt-warning animate-pulse"}`,
|
|
1916
|
+
title: g.status
|
|
1917
|
+
}
|
|
1918
|
+
),
|
|
1919
|
+
/* @__PURE__ */ n("span", { className: "flex items-center gap-0 min-w-0 flex-1 overflow-hidden", children: [
|
|
1920
|
+
/* @__PURE__ */ t(
|
|
1921
|
+
"span",
|
|
1922
|
+
{
|
|
1923
|
+
className: `font-mono text-[12px] text-dt-text-secondary truncate min-w-0 ${A ? "max-w-[44%]" : ""}`,
|
|
1924
|
+
children: g.udfPath
|
|
1925
|
+
}
|
|
1926
|
+
),
|
|
1927
|
+
"args" in g && A && /* @__PURE__ */ n(
|
|
1928
|
+
"span",
|
|
1929
|
+
{
|
|
1930
|
+
className: "font-mono text-[11px] text-dt-text-muted min-w-0 flex-1 truncate max-w-[min(62vw,760px)]",
|
|
1931
|
+
title: at(T, 460),
|
|
1932
|
+
children: [
|
|
1933
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60", children: "(" }),
|
|
1934
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: Mt(T, ze) }),
|
|
1935
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60", children: ")" })
|
|
1936
|
+
]
|
|
1937
|
+
}
|
|
1938
|
+
)
|
|
1939
|
+
] }),
|
|
1940
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 shrink-0 text-[11px] text-dt-text-muted ml-auto", children: [
|
|
1941
|
+
j && /* @__PURE__ */ n("span", { className: "text-dt-info text-[10px]", title: "Subscription update", children: [
|
|
1942
|
+
"↻",
|
|
1943
|
+
O.updateCount
|
|
1944
|
+
] }),
|
|
1945
|
+
g.status === "success" && "result" in g && g.result !== void 0 && /* @__PURE__ */ n("span", { className: "text-dt-text-muted/80", title: at(g.result), children: [
|
|
1946
|
+
"↓",
|
|
1947
|
+
G(g.result)
|
|
1948
|
+
] }),
|
|
1949
|
+
Q !== null && (!j || Q > 100) && /* @__PURE__ */ n(
|
|
1950
|
+
"span",
|
|
1951
|
+
{
|
|
1952
|
+
className: "font-mono text-dt-text-muted",
|
|
1953
|
+
title: xt ? `E2E ${D(Q)} = Net ${D(K)} + Sim ${D(Y)}` : `Net ${D(Q)}`,
|
|
1954
|
+
children: [
|
|
1955
|
+
j && "Δ",
|
|
1956
|
+
xt ? `E2E ${D(Q)}` : `Net ${D(Q)}`
|
|
1957
|
+
]
|
|
1958
|
+
}
|
|
1959
|
+
),
|
|
1960
|
+
g.status === "pending" && /* @__PURE__ */ t("span", { className: "font-mono text-dt-warning/90 text-[10px] uppercase", children: "pending" }),
|
|
1961
|
+
xt && /* @__PURE__ */ n("span", { className: "font-mono text-dt-text-muted/85 text-[10px]", title: "Server/network round-trip", children: [
|
|
1962
|
+
"Net ",
|
|
1963
|
+
D(K)
|
|
1964
|
+
] }),
|
|
1965
|
+
Y > 0 && /* @__PURE__ */ n(
|
|
1966
|
+
"span",
|
|
1967
|
+
{
|
|
1968
|
+
className: "font-mono text-dt-warning/90 text-[10px]",
|
|
1969
|
+
title: "Devtools simulated client delivery delay",
|
|
1970
|
+
children: [
|
|
1971
|
+
"Sim +",
|
|
1972
|
+
D(Y)
|
|
1973
|
+
]
|
|
1974
|
+
}
|
|
1975
|
+
),
|
|
1976
|
+
g.trace && /* @__PURE__ */ n(
|
|
1977
|
+
"span",
|
|
1978
|
+
{
|
|
1979
|
+
className: "font-mono text-dt-info text-[10px]",
|
|
1980
|
+
title: `Trace: ${g.trace.summary.spanCount} spans`,
|
|
1981
|
+
children: [
|
|
1982
|
+
"T",
|
|
1983
|
+
g.trace.summary.spanCount
|
|
1984
|
+
]
|
|
1985
|
+
}
|
|
1986
|
+
),
|
|
1987
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60 font-mono", children: mt(g.timestamp) })
|
|
1988
|
+
] })
|
|
1989
|
+
] })
|
|
1990
|
+
},
|
|
1991
|
+
o.id
|
|
1992
|
+
);
|
|
1993
|
+
}),
|
|
1994
|
+
X && /* @__PURE__ */ n("div", { className: "sticky bottom-0 z-[2] px-3 py-2 border-t border-dt-border-light/40 bg-dt-bg-secondary/85 backdrop-blur-sm flex items-center justify-between gap-2", children: [
|
|
1995
|
+
/* @__PURE__ */ n("span", { className: "text-[10px] text-dt-text-muted", children: [
|
|
1996
|
+
"Showing ",
|
|
1997
|
+
I.length,
|
|
1998
|
+
" of ",
|
|
1999
|
+
L
|
|
2000
|
+
] }),
|
|
2001
|
+
/* @__PURE__ */ n(
|
|
2002
|
+
"button",
|
|
2003
|
+
{
|
|
2004
|
+
type: "button",
|
|
2005
|
+
className: "px-2 py-1 text-[10px] font-semibold rounded border border-dt-border-light text-dt-text-secondary bg-dt-bg-tertiary hover:bg-white/10 hover:border-dt-border transition-colors",
|
|
2006
|
+
onClick: () => v((o) => Math.min(o + ie, L)),
|
|
2007
|
+
children: [
|
|
2008
|
+
"Load ",
|
|
2009
|
+
Math.min(ie, L - I.length),
|
|
2010
|
+
" more"
|
|
2011
|
+
]
|
|
2012
|
+
}
|
|
2013
|
+
)
|
|
2014
|
+
] })
|
|
2015
|
+
] }),
|
|
2016
|
+
E && /* @__PURE__ */ n("div", { className: "w-[min(58vw,620px)] min-w-[420px] border-l border-dt-border overflow-y-auto bg-dt-bg-secondary/50 animate-[dt-slide-in_0.2s_ease-out] shrink-0", children: [
|
|
2017
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-3 py-2 border-b border-dt-border-light", children: [
|
|
2018
|
+
/* @__PURE__ */ t("h4", { className: "text-[12px] font-semibold text-dt-text-secondary m-0", children: "Details" }),
|
|
2019
|
+
/* @__PURE__ */ t(
|
|
2020
|
+
"button",
|
|
2021
|
+
{
|
|
2022
|
+
className: "p-1 bg-transparent border-none text-dt-text-muted cursor-pointer rounded hover:bg-white/5 hover:text-dt-text-tertiary",
|
|
2023
|
+
onClick: () => f(null),
|
|
2024
|
+
children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" }) })
|
|
2025
|
+
}
|
|
2026
|
+
)
|
|
2027
|
+
] }),
|
|
2028
|
+
/* @__PURE__ */ n("div", { className: "p-3 flex flex-col gap-3", children: [
|
|
2029
|
+
E.type === "query" && e.getSubscription(E.queryId) && (() => {
|
|
2030
|
+
const o = e.getSubscription(E.queryId);
|
|
2031
|
+
if (o.updateCount > 0) {
|
|
2032
|
+
const h = mt(o.addedAt);
|
|
2033
|
+
return /* @__PURE__ */ n("div", { className: "flex items-center gap-1 flex-wrap bg-dt-info/5 border border-dt-info/20 rounded-md px-2 py-1 text-[10px] font-mono", children: [
|
|
2034
|
+
/* @__PURE__ */ t("span", { className: "text-dt-info font-semibold uppercase tracking-wide", children: "Sub" }),
|
|
2035
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-secondary", children: [
|
|
2036
|
+
"↻",
|
|
2037
|
+
o.updateCount
|
|
2038
|
+
] }),
|
|
2039
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted/70", children: [
|
|
2040
|
+
"since ",
|
|
2041
|
+
pt(o.addedAt)
|
|
2042
|
+
] }),
|
|
2043
|
+
/* @__PURE__ */ t(
|
|
2044
|
+
"span",
|
|
2045
|
+
{
|
|
2046
|
+
className: "ml-auto text-dt-text-muted/60",
|
|
2047
|
+
title: new Date(o.addedAt).toLocaleString(),
|
|
2048
|
+
children: h
|
|
2049
|
+
}
|
|
2050
|
+
)
|
|
2051
|
+
] });
|
|
2052
|
+
}
|
|
2053
|
+
return null;
|
|
2054
|
+
})(),
|
|
2055
|
+
M && (() => {
|
|
2056
|
+
const o = M.udfPath, l = M.componentPath, h = new Date(M.timestamp), _ = wt(M), g = it(M), T = tt(M), A = ot(M), O = g !== null ? D(g) : null, j = T !== null ? D(T) : null, Q = A > 0 ? D(A) : null, K = ct(M.args), Y = M.status === "success" && "result" in M && M.result !== void 0 ? M.result : void 0;
|
|
2057
|
+
return /* @__PURE__ */ n(et, { children: [
|
|
2058
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
|
|
2059
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2060
|
+
/* @__PURE__ */ t(
|
|
2061
|
+
"span",
|
|
2062
|
+
{
|
|
2063
|
+
className: `text-[11px] font-bold uppercase tracking-wider ${M.type === "query" ? "text-dt-query" : M.type === "mutation" ? "text-dt-mutation" : "text-dt-action"}`,
|
|
2064
|
+
children: M.type === "query" ? "Query" : M.type === "mutation" ? "Mutation" : "Action"
|
|
2065
|
+
}
|
|
2066
|
+
),
|
|
2067
|
+
/* @__PURE__ */ n(
|
|
2068
|
+
"span",
|
|
2069
|
+
{
|
|
2070
|
+
className: `text-[10px] font-semibold uppercase flex items-center gap-1 ${M.status === "success" ? "text-dt-success" : M.status === "error" ? "text-dt-error" : "text-dt-warning"}`,
|
|
2071
|
+
children: [
|
|
2072
|
+
/* @__PURE__ */ t(Tt, { status: M.status }),
|
|
2073
|
+
M.status?.toUpperCase() ?? "PENDING"
|
|
2074
|
+
]
|
|
2075
|
+
}
|
|
2076
|
+
),
|
|
2077
|
+
/* @__PURE__ */ t(
|
|
2078
|
+
"span",
|
|
2079
|
+
{
|
|
2080
|
+
className: "text-[10px] text-dt-text-muted ml-auto",
|
|
2081
|
+
title: h.toLocaleString(),
|
|
2082
|
+
children: pt(M.timestamp)
|
|
2083
|
+
}
|
|
2084
|
+
)
|
|
2085
|
+
] }),
|
|
2086
|
+
/* @__PURE__ */ t("div", { className: "font-mono text-[12px] text-dt-text truncate", title: o, children: o || "Unknown function" }),
|
|
2087
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-1", children: [
|
|
2088
|
+
_ && /* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: _ }),
|
|
2089
|
+
O && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: [
|
|
2090
|
+
"E2E ",
|
|
2091
|
+
O
|
|
2092
|
+
] }),
|
|
2093
|
+
Q && j && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: [
|
|
2094
|
+
"Net ",
|
|
2095
|
+
j
|
|
2096
|
+
] }),
|
|
2097
|
+
Q && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-warning/15 border border-dt-warning/20 rounded text-[10px] text-dt-warning font-mono", children: [
|
|
2098
|
+
"Sim +",
|
|
2099
|
+
Q
|
|
2100
|
+
] })
|
|
2101
|
+
] }),
|
|
2102
|
+
l && /* @__PURE__ */ t("div", { className: "text-[10px] text-dt-text-muted/60 font-mono truncate", title: l, children: l }),
|
|
2103
|
+
M.type === "query" && M.triggeredBy && /* @__PURE__ */ n(
|
|
2104
|
+
"button",
|
|
2105
|
+
{
|
|
2106
|
+
type: "button",
|
|
2107
|
+
className: "flex items-center gap-1.5 px-2 py-1 bg-dt-mutation/10 border border-dt-mutation/20 rounded text-[10px] text-dt-mutation hover:bg-dt-mutation/20 transition-colors cursor-pointer",
|
|
2108
|
+
title: "Jump to triggering operation",
|
|
2109
|
+
onClick: () => e.setFocusedEventId(M.triggeredBy),
|
|
2110
|
+
children: [
|
|
2111
|
+
/* @__PURE__ */ n("span", { children: [
|
|
2112
|
+
"Triggered by ",
|
|
2113
|
+
Pe(M.triggeredBy)
|
|
2114
|
+
] }),
|
|
2115
|
+
/* @__PURE__ */ t("span", { className: "text-dt-mutation/70", children: "→" })
|
|
2116
|
+
]
|
|
2117
|
+
}
|
|
2118
|
+
)
|
|
2119
|
+
] }),
|
|
2120
|
+
"args" in M && K !== void 0 && /* @__PURE__ */ t(Et, { data: K, label: "Arguments", maxHeight: 200 }),
|
|
2121
|
+
Y !== void 0 && /* @__PURE__ */ t(Et, { data: Y, label: "Result", maxHeight: 200 }),
|
|
2122
|
+
M.status === "error" && "error" in M && M.error && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2123
|
+
/* @__PURE__ */ t("div", { className: "text-[11px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Error" }),
|
|
2124
|
+
/* @__PURE__ */ t("div", { className: "text-[12px] text-dt-error bg-dt-error/10 rounded px-2 py-1.5 font-mono break-words", children: M.error })
|
|
2125
|
+
] }),
|
|
2126
|
+
M.logLines && M.logLines.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2127
|
+
/* @__PURE__ */ t("div", { className: "text-[11px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Console Output" }),
|
|
2128
|
+
/* @__PURE__ */ t("div", { className: "bg-zinc-950/50 rounded border border-dt-border-light p-2 font-mono text-[11px] max-h-[150px] overflow-y-auto", children: M.logLines.map((nt, ut) => /* @__PURE__ */ t("div", { className: "text-dt-text-muted leading-relaxed", children: nt }, ut)) })
|
|
2129
|
+
] }),
|
|
2130
|
+
M.trace && /* @__PURE__ */ t(Te, { trace: M.trace, maxHeight: 680 })
|
|
2131
|
+
] });
|
|
2132
|
+
})(),
|
|
2133
|
+
q && /* @__PURE__ */ n(et, { children: [
|
|
2134
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
|
|
2135
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2136
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] font-bold uppercase tracking-wider text-dt-warning", children: "Connection" }),
|
|
2137
|
+
/* @__PURE__ */ n(
|
|
2138
|
+
"span",
|
|
2139
|
+
{
|
|
2140
|
+
className: `text-[10px] font-semibold uppercase flex items-center gap-1 ${q.status === "success" ? "text-dt-success" : q.status === "error" ? "text-dt-error" : "text-dt-warning"}`,
|
|
2141
|
+
children: [
|
|
2142
|
+
/* @__PURE__ */ t(Tt, { status: q.status }),
|
|
2143
|
+
q.status.toUpperCase()
|
|
2144
|
+
]
|
|
2145
|
+
}
|
|
2146
|
+
),
|
|
2147
|
+
/* @__PURE__ */ t(
|
|
2148
|
+
"span",
|
|
2149
|
+
{
|
|
2150
|
+
className: "text-[10px] text-dt-text-muted ml-auto",
|
|
2151
|
+
title: new Date(q.timestamp).toLocaleString(),
|
|
2152
|
+
children: pt(q.timestamp)
|
|
2153
|
+
}
|
|
2154
|
+
)
|
|
2155
|
+
] }),
|
|
2156
|
+
/* @__PURE__ */ n("div", { className: "font-mono text-[12px] text-dt-text truncate", children: [
|
|
2157
|
+
q.direction === "client" ? "→" : "←",
|
|
2158
|
+
" ",
|
|
2159
|
+
q.messageType
|
|
2160
|
+
] }),
|
|
2161
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-1", children: [
|
|
2162
|
+
/* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: vt(q) }),
|
|
2163
|
+
q.tokenType && /* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: q.tokenType })
|
|
2164
|
+
] })
|
|
2165
|
+
] }),
|
|
2166
|
+
q.details !== void 0 && /* @__PURE__ */ t(Et, { data: q.details, label: "Details", maxHeight: 220 }),
|
|
2167
|
+
q.error && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2168
|
+
/* @__PURE__ */ t("div", { className: "text-[11px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Error" }),
|
|
2169
|
+
/* @__PURE__ */ t("div", { className: "text-[12px] text-dt-error bg-dt-error/10 rounded px-2 py-1.5 font-mono break-words", children: q.error })
|
|
2170
|
+
] })
|
|
2171
|
+
] })
|
|
2172
|
+
] })
|
|
2173
|
+
] })
|
|
2174
|
+
] }),
|
|
2175
|
+
k && (() => {
|
|
2176
|
+
const o = k.event;
|
|
2177
|
+
if (o.type === "auth") {
|
|
2178
|
+
const W = o.details !== void 0 ? at(o.details, 200) : null, dt = o.error && o.error.length > 160 ? `${o.error.slice(0, 157)}…` : o.error;
|
|
2179
|
+
return /* @__PURE__ */ n(
|
|
2180
|
+
"div",
|
|
2181
|
+
{
|
|
2182
|
+
className: "fixed z-[9999999] w-[300px] bg-zinc-900/[0.98] border border-dt-border rounded-lg shadow-2xl p-3 flex flex-col gap-2 pointer-events-none animate-[dt-fade-in_0.15s_ease-out] backdrop-blur-lg",
|
|
2183
|
+
style: { top: k.y, left: k.x },
|
|
2184
|
+
role: "tooltip",
|
|
2185
|
+
children: [
|
|
2186
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2187
|
+
/* @__PURE__ */ t("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-[3px] text-[9px] font-bold shrink-0 bg-dt-warning/20 text-dt-warning", children: "C" }),
|
|
2188
|
+
/* @__PURE__ */ n("span", { className: "font-mono text-[12px] text-dt-text truncate flex-1", children: [
|
|
2189
|
+
o.direction === "client" ? "→" : "←",
|
|
2190
|
+
" ",
|
|
2191
|
+
o.messageType
|
|
2192
|
+
] }),
|
|
2193
|
+
/* @__PURE__ */ n(
|
|
2194
|
+
"span",
|
|
2195
|
+
{
|
|
2196
|
+
className: `text-[9px] font-bold uppercase flex items-center gap-0.5 px-1.5 py-0.5 rounded-full ${o.status === "success" ? "bg-dt-success/15 text-dt-success" : o.status === "error" ? "bg-dt-error/15 text-dt-error" : "bg-dt-warning/15 text-dt-warning"}`,
|
|
2197
|
+
children: [
|
|
2198
|
+
/* @__PURE__ */ t(Tt, { status: o.status }),
|
|
2199
|
+
o.status.toUpperCase()
|
|
2200
|
+
]
|
|
2201
|
+
}
|
|
2202
|
+
)
|
|
2203
|
+
] }),
|
|
2204
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 flex-wrap", children: [
|
|
2205
|
+
/* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: pt(o.timestamp) }),
|
|
2206
|
+
/* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: vt(o) }),
|
|
2207
|
+
o.tokenType && /* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: o.tokenType })
|
|
2208
|
+
] }),
|
|
2209
|
+
W && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2210
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Details" }),
|
|
2211
|
+
/* @__PURE__ */ t("pre", { className: "font-mono text-[10px] text-dt-text-muted bg-zinc-950/50 rounded p-1.5 overflow-hidden max-h-[100px] whitespace-pre-wrap break-all m-0", children: /* @__PURE__ */ t(Bt, { json: W }) })
|
|
2212
|
+
] }),
|
|
2213
|
+
dt && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2214
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Error" }),
|
|
2215
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-dt-error", title: o.error, children: dt })
|
|
2216
|
+
] })
|
|
2217
|
+
]
|
|
2218
|
+
}
|
|
2219
|
+
);
|
|
2220
|
+
}
|
|
2221
|
+
const l = vt(o), h = it(o), _ = tt(o), g = ot(o), T = h !== null ? D(h) : null, A = _ !== null ? D(_) : null, O = g > 0 ? D(g) : null, j = ct(o.args), Q = j !== void 0 ? at(j) : null, K = j !== void 0 ? G(j) : null, Y = j !== void 0 ? at(j) : "", nt = o.status === "success" && o.result !== void 0 ? o.result : void 0, ut = nt ? at(nt) : null, xt = nt ? at(nt) : "", $t = nt ? G(nt) : null, Dt = o.status === "error" && o.error ? o.error.length > 160 ? `${o.error.slice(0, 157)}…` : o.error : null;
|
|
2222
|
+
return /* @__PURE__ */ n(
|
|
2223
|
+
"div",
|
|
2224
|
+
{
|
|
2225
|
+
className: "fixed z-[9999999] w-[300px] bg-zinc-900/[0.98] border border-dt-border rounded-lg shadow-2xl p-3 flex flex-col gap-2 pointer-events-none animate-[dt-fade-in_0.15s_ease-out] backdrop-blur-lg",
|
|
2226
|
+
style: { top: k.y, left: k.x },
|
|
2227
|
+
role: "tooltip",
|
|
2228
|
+
children: [
|
|
2229
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2230
|
+
/* @__PURE__ */ t(
|
|
2231
|
+
"span",
|
|
2232
|
+
{
|
|
2233
|
+
className: `inline-flex items-center justify-center w-4 h-4 rounded-[3px] text-[9px] font-bold shrink-0 ${o.type === "query" ? "bg-dt-query/20 text-dt-query shadow-[0_1px_2px_rgba(96,165,250,0.35)]" : o.type === "mutation" ? "bg-dt-mutation/20 text-dt-mutation shadow-[0_1px_2px_rgba(167,139,250,0.35)]" : "bg-dt-action/20 text-dt-action shadow-[0_1px_2px_rgba(52,211,153,0.35)]"}`,
|
|
2234
|
+
children: o.type === "query" ? "Q" : o.type === "mutation" ? "M" : "A"
|
|
2235
|
+
}
|
|
2236
|
+
),
|
|
2237
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-[12px] text-dt-text truncate flex-1", title: o.udfPath, children: o.udfPath }),
|
|
2238
|
+
/* @__PURE__ */ n(
|
|
2239
|
+
"span",
|
|
2240
|
+
{
|
|
2241
|
+
className: `text-[9px] font-bold uppercase flex items-center gap-0.5 px-1.5 py-0.5 rounded-full ${o.status === "success" ? "bg-dt-success/15 text-dt-success" : o.status === "error" ? "bg-dt-error/15 text-dt-error" : "bg-dt-warning/15 text-dt-warning"}`,
|
|
2242
|
+
children: [
|
|
2243
|
+
/* @__PURE__ */ t(Tt, { status: o.status }),
|
|
2244
|
+
o.status?.toUpperCase() ?? "PENDING"
|
|
2245
|
+
]
|
|
2246
|
+
}
|
|
2247
|
+
)
|
|
2248
|
+
] }),
|
|
2249
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 flex-wrap", children: [
|
|
2250
|
+
/* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: pt(o.timestamp) }),
|
|
2251
|
+
T && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: [
|
|
2252
|
+
"E2E ",
|
|
2253
|
+
T
|
|
2254
|
+
] }),
|
|
2255
|
+
O && A && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: [
|
|
2256
|
+
"Net ",
|
|
2257
|
+
A
|
|
2258
|
+
] }),
|
|
2259
|
+
O && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-warning/15 border border-dt-warning/20 rounded text-[10px] text-dt-warning font-mono", children: [
|
|
2260
|
+
"Sim +",
|
|
2261
|
+
O
|
|
2262
|
+
] }),
|
|
2263
|
+
/* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: l }),
|
|
2264
|
+
o.trace && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-info/15 border border-dt-info/20 rounded text-[10px] text-dt-info font-mono", children: [
|
|
2265
|
+
"T",
|
|
2266
|
+
o.trace.summary.spanCount
|
|
2267
|
+
] }),
|
|
2268
|
+
o.logLines && o.logLines.length > 0 && /* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: [
|
|
2269
|
+
"Logs ",
|
|
2270
|
+
o.logLines.length
|
|
2271
|
+
] })
|
|
2272
|
+
] }),
|
|
2273
|
+
o.componentPath && /* @__PURE__ */ t("div", { className: "text-[10px] text-dt-text-muted/60 font-mono truncate", title: o.componentPath, children: o.componentPath }),
|
|
2274
|
+
j !== void 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2275
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
2276
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Args" }),
|
|
2277
|
+
K && /* @__PURE__ */ t("span", { className: "text-[9px] text-dt-text-muted/60 font-mono", children: K })
|
|
2278
|
+
] }),
|
|
2279
|
+
/* @__PURE__ */ t(
|
|
2280
|
+
"pre",
|
|
2281
|
+
{
|
|
2282
|
+
className: "font-mono text-[10px] text-dt-text-muted bg-zinc-950/50 rounded p-1.5 overflow-hidden max-h-[80px] whitespace-pre-wrap break-all m-0",
|
|
2283
|
+
title: Q ?? void 0,
|
|
2284
|
+
children: /* @__PURE__ */ t(Bt, { json: Y })
|
|
2285
|
+
}
|
|
2286
|
+
)
|
|
2287
|
+
] }),
|
|
2288
|
+
nt !== void 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2289
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
2290
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Result" }),
|
|
2291
|
+
$t && /* @__PURE__ */ t("span", { className: "text-[9px] text-dt-text-muted/60 font-mono", children: $t })
|
|
2292
|
+
] }),
|
|
2293
|
+
/* @__PURE__ */ t(
|
|
2294
|
+
"pre",
|
|
2295
|
+
{
|
|
2296
|
+
className: "font-mono text-[10px] text-dt-text-muted bg-zinc-950/50 rounded p-1.5 overflow-hidden max-h-[80px] whitespace-pre-wrap break-all m-0",
|
|
2297
|
+
title: ut ?? void 0,
|
|
2298
|
+
children: /* @__PURE__ */ t(Bt, { json: xt })
|
|
2299
|
+
}
|
|
2300
|
+
)
|
|
2301
|
+
] }),
|
|
2302
|
+
Dt && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2303
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Error" }),
|
|
2304
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-dt-error", title: o.error, children: Dt })
|
|
2305
|
+
] })
|
|
2306
|
+
]
|
|
2307
|
+
}
|
|
2308
|
+
);
|
|
2309
|
+
})(),
|
|
2310
|
+
S && /* @__PURE__ */ t(
|
|
2311
|
+
Gt,
|
|
2312
|
+
{
|
|
2313
|
+
x: S.x,
|
|
2314
|
+
y: S.y,
|
|
2315
|
+
items: S.items,
|
|
2316
|
+
onClose: () => $(null)
|
|
2317
|
+
}
|
|
2318
|
+
)
|
|
2319
|
+
] });
|
|
2320
|
+
}
|
|
2321
|
+
function Bt({ json: e }) {
|
|
2322
|
+
const r = V(() => e.replace(
|
|
2323
|
+
/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,
|
|
2324
|
+
(a) => {
|
|
2325
|
+
let s = "cdv-json-value";
|
|
2326
|
+
return /^"/.test(a) ? /:$/.test(a) ? s = "cdv-json-key" : s = "cdv-json-string" : /true|false/.test(a) ? s = "cdv-json-boolean" : /null/.test(a) ? s = "cdv-json-null" : s = "cdv-json-number", `<span class="${s}">${a}</span>`;
|
|
2327
|
+
}
|
|
2328
|
+
), [e]);
|
|
2329
|
+
return /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: r } });
|
|
2330
|
+
}
|
|
2331
|
+
function Tt({ status: e }) {
|
|
2332
|
+
return e === "success" ? /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", className: "text-dt-success", children: /* @__PURE__ */ t("path", { d: "M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" }) }) : e === "error" ? /* @__PURE__ */ n("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", className: "text-dt-error", children: [
|
|
2333
|
+
/* @__PURE__ */ t("path", { d: "M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" }),
|
|
2334
|
+
/* @__PURE__ */ t("path", { d: "M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z" })
|
|
2335
|
+
] }) : /* @__PURE__ */ n("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", className: "text-dt-warning", children: [
|
|
2336
|
+
/* @__PURE__ */ t("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1", fill: "none" }),
|
|
2337
|
+
/* @__PURE__ */ t("circle", { cx: "8", cy: "8", r: "2" })
|
|
2338
|
+
] });
|
|
2339
|
+
}
|
|
2340
|
+
const se = {
|
|
2341
|
+
maxStringLength: 96,
|
|
2342
|
+
stringTailLength: 20,
|
|
2343
|
+
maxArrayItems: 4,
|
|
2344
|
+
maxObjectEntries: 4,
|
|
2345
|
+
maxDepth: 3
|
|
2346
|
+
};
|
|
2347
|
+
function Oe({ eventStore: e }) {
|
|
2348
|
+
const [r, a] = z([]), [s, d] = z(null), [x, c] = z(0), [m, w] = z("all"), [v, E] = z(""), [f, b] = z(null), [N, k] = z(null), y = Ct(null);
|
|
2349
|
+
U(() => {
|
|
2350
|
+
const p = () => {
|
|
2351
|
+
a(e.getActiveSubscriptions());
|
|
2352
|
+
}, u = e.subscribe(p);
|
|
2353
|
+
return p(), u;
|
|
2354
|
+
}, [e]);
|
|
2355
|
+
const S = V(() => {
|
|
2356
|
+
let p = r;
|
|
2357
|
+
return m !== "all" && (p = p.filter((u) => u.status === m)), v && (p = p.filter(
|
|
2358
|
+
(u) => u.udfPath.toLowerCase().includes(v.toLowerCase()) || u.componentPath?.toLowerCase().includes(v.toLowerCase())
|
|
2359
|
+
)), [...p].sort((u, i) => u.lastUpdate !== i.lastUpdate ? i.lastUpdate - u.lastUpdate : u.addedAt !== i.addedAt ? i.addedAt - u.addedAt : i.queryId - u.queryId);
|
|
2360
|
+
}, [r, m, v]);
|
|
2361
|
+
U(() => {
|
|
2362
|
+
const p = (u) => {
|
|
2363
|
+
if (Pt()) {
|
|
2364
|
+
if ((u.metaKey || u.ctrlKey) && u.key === "k") {
|
|
2365
|
+
u.preventDefault(), y.current?.focus();
|
|
2366
|
+
return;
|
|
2367
|
+
}
|
|
2368
|
+
if (u.key === "Escape") {
|
|
2369
|
+
u.preventDefault(), s !== null ? d(null) : (m !== "all" || v) && (w("all"), E(""));
|
|
2370
|
+
return;
|
|
2371
|
+
}
|
|
2372
|
+
if (pe() !== y.current && S.length !== 0) {
|
|
2373
|
+
if (u.key === "ArrowDown")
|
|
2374
|
+
u.preventDefault(), c((i) => Math.min(i + 1, S.length - 1));
|
|
2375
|
+
else if (u.key === "ArrowUp")
|
|
2376
|
+
u.preventDefault(), c((i) => Math.max(i - 1, 0));
|
|
2377
|
+
else if (u.key === "Enter" || u.key === " ") {
|
|
2378
|
+
u.preventDefault();
|
|
2379
|
+
const i = S[x];
|
|
2380
|
+
i && d(s === i.queryId ? null : i.queryId);
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
};
|
|
2385
|
+
return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
|
|
2386
|
+
}, [S, x, s, m, v]), U(() => {
|
|
2387
|
+
c(0);
|
|
2388
|
+
}, [m, v]);
|
|
2389
|
+
const $ = J((p) => {
|
|
2390
|
+
F(p);
|
|
2391
|
+
}, []), P = J((p, u) => {
|
|
2392
|
+
if (typeof window > "u") return null;
|
|
2393
|
+
const i = 8, C = 300, I = window.innerWidth, L = window.innerHeight, X = Math.min(260, L - i * 2);
|
|
2394
|
+
let B = u.right + i;
|
|
2395
|
+
B + C > I - i && (B = u.left - C - i), B < i && (B = Math.max(i, I - C - i));
|
|
2396
|
+
let rt = u.top + u.height / 2 - X / 2;
|
|
2397
|
+
return rt < i && (rt = i), rt + X > L - i && (rt = Math.max(i, L - i - X)), { subscription: p, x: B, y: rt };
|
|
2398
|
+
}, []), M = J((p) => {
|
|
2399
|
+
if (p == null) return "0";
|
|
2400
|
+
const u = JSON.stringify(p), i = new Blob([u]).size;
|
|
2401
|
+
return i < 1024 ? `${i}B` : i < 1024 * 1024 ? `${(i / 1024).toFixed(1)}KB` : `${(i / (1024 * 1024)).toFixed(1)}MB`;
|
|
2402
|
+
}, []), q = J(
|
|
2403
|
+
(p) => {
|
|
2404
|
+
const u = ct(p.args), i = u != null, C = p.currentValue !== void 0, I = [
|
|
2405
|
+
{ label: "Copy Function Path", action: () => F(p.udfPath), shortcut: "⌘C" }
|
|
2406
|
+
];
|
|
2407
|
+
return i && I.push({
|
|
2408
|
+
label: "Copy Arguments",
|
|
2409
|
+
action: () => F(JSON.stringify(u, null, 2))
|
|
2410
|
+
}), C && I.push({
|
|
2411
|
+
label: "Copy Current Value",
|
|
2412
|
+
action: () => F(JSON.stringify(p.currentValue, null, 2))
|
|
2413
|
+
}), I.push({
|
|
2414
|
+
label: "Filter by Function",
|
|
2415
|
+
action: () => E(p.udfPath),
|
|
2416
|
+
separator: !0
|
|
2417
|
+
}), I.push({
|
|
2418
|
+
label: "Copy Query ID",
|
|
2419
|
+
action: () => F(String(p.queryId))
|
|
2420
|
+
}), I;
|
|
2421
|
+
},
|
|
2422
|
+
[]
|
|
2423
|
+
), R = (p) => {
|
|
2424
|
+
const u = Math.floor((Date.now() - p) / 1e3);
|
|
2425
|
+
if (u < 60) return `${u}s ago`;
|
|
2426
|
+
const i = Math.floor(u / 60);
|
|
2427
|
+
return i < 60 ? `${i}m ago` : `${Math.floor(i / 60)}h ago`;
|
|
2428
|
+
};
|
|
2429
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
2430
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-1.5 border-b border-dt-border-light", children: [
|
|
2431
|
+
/* @__PURE__ */ n("div", { className: "flex gap-[3px] bg-zinc-900/50 p-[3px] rounded-md border border-zinc-700/30", children: [
|
|
2432
|
+
/* @__PURE__ */ t(
|
|
2433
|
+
"button",
|
|
2434
|
+
{
|
|
2435
|
+
className: `px-2 py-1 text-[11px] font-mono font-bold uppercase tracking-wide bg-transparent border-none rounded cursor-pointer transition-all hover:bg-white/5 hover:text-dt-text-tertiary ${m === "all" ? "bg-zinc-500/25 text-dt-text-tertiary shadow-[0_0_0_1px_rgba(161,161,170,0.4)]" : "text-dt-text-muted"}`,
|
|
2436
|
+
onClick: () => w("all"),
|
|
2437
|
+
"aria-label": "Show all subscriptions",
|
|
2438
|
+
"aria-pressed": m === "all",
|
|
2439
|
+
children: "All"
|
|
2440
|
+
}
|
|
2441
|
+
),
|
|
2442
|
+
/* @__PURE__ */ t(
|
|
2443
|
+
"button",
|
|
2444
|
+
{
|
|
2445
|
+
className: `px-2 py-1 text-[11px] font-mono font-bold uppercase tracking-wide bg-transparent border-none rounded cursor-pointer transition-all ${m === "active" ? "bg-dt-query/25 text-dt-query shadow-[0_0_0_1px_rgba(96,165,250,0.5)]" : "text-dt-text-muted hover:bg-dt-query/15 hover:text-dt-query"}`,
|
|
2446
|
+
onClick: () => w("active"),
|
|
2447
|
+
"aria-label": "Show active subscriptions",
|
|
2448
|
+
"aria-pressed": m === "active",
|
|
2449
|
+
children: "Active"
|
|
2450
|
+
}
|
|
2451
|
+
),
|
|
2452
|
+
/* @__PURE__ */ t(
|
|
2453
|
+
"button",
|
|
2454
|
+
{
|
|
2455
|
+
className: `px-2 py-1 text-[11px] font-mono font-bold uppercase tracking-wide bg-transparent border-none rounded cursor-pointer transition-all ${m === "error" ? "bg-dt-error/25 text-dt-error shadow-[0_0_0_1px_rgba(239,68,68,0.5)]" : "text-dt-text-muted hover:bg-dt-error/15 hover:text-dt-error"}`,
|
|
2456
|
+
onClick: () => w("error"),
|
|
2457
|
+
"aria-label": "Show error subscriptions",
|
|
2458
|
+
"aria-pressed": m === "error",
|
|
2459
|
+
children: "Errors"
|
|
2460
|
+
}
|
|
2461
|
+
)
|
|
2462
|
+
] }),
|
|
2463
|
+
/* @__PURE__ */ t(
|
|
2464
|
+
Xt,
|
|
2465
|
+
{
|
|
2466
|
+
ref: y,
|
|
2467
|
+
value: v,
|
|
2468
|
+
onValueChange: E,
|
|
2469
|
+
onClear: () => E(""),
|
|
2470
|
+
placeholder: "Search subscriptions... (Cmd/Ctrl+K)",
|
|
2471
|
+
className: "stretch"
|
|
2472
|
+
}
|
|
2473
|
+
)
|
|
2474
|
+
] }),
|
|
2475
|
+
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2476
|
+
S.length === 0 && /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-dt-text-muted gap-2", children: [
|
|
2477
|
+
/* @__PURE__ */ t("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", strokeWidth: "1.5" }) }),
|
|
2478
|
+
/* @__PURE__ */ t("p", { children: r.length === 0 ? "No active subscriptions" : m !== "all" || v ? "No subscriptions match your filters" : "No active subscriptions" }),
|
|
2479
|
+
m !== "all" || v ? /* @__PURE__ */ t("p", { className: "text-[11px] text-dt-text-muted/60", children: "Try adjusting your filters or search" }) : null
|
|
2480
|
+
] }),
|
|
2481
|
+
S.map((p, u) => {
|
|
2482
|
+
const i = s === p.queryId, C = u === x, I = p.status === "error" ? "error" : "success", L = ct(p.args), X = L != null, B = JSON.stringify(L ?? null, null, 2), rt = `Subscription ${p.queryId} ${p.udfPath} ${p.status}${X ? ` with args ${Mt(L, se)}` : ""}`;
|
|
2483
|
+
return /* @__PURE__ */ n(
|
|
2484
|
+
"div",
|
|
2485
|
+
{
|
|
2486
|
+
className: `border-b border-dt-border-light/50 transition-colors ${p.status === "error" ? "border-l-2 border-l-dt-error/40" : ""} ${i ? "bg-white/[0.03]" : ""} ${C ? "bg-white/[0.03] outline outline-1 outline-dt-info/30 -outline-offset-1" : ""}`,
|
|
2487
|
+
children: [
|
|
2488
|
+
/* @__PURE__ */ n(
|
|
2489
|
+
"div",
|
|
2490
|
+
{
|
|
2491
|
+
className: "flex items-center gap-2 px-3 py-1.5 cursor-pointer hover:bg-white/[0.03]",
|
|
2492
|
+
onClick: () => {
|
|
2493
|
+
d(i ? null : p.queryId), c(u);
|
|
2494
|
+
},
|
|
2495
|
+
onKeyDown: (G) => {
|
|
2496
|
+
(G.key === "Enter" || G.key === " ") && (G.preventDefault(), d(i ? null : p.queryId), c(u));
|
|
2497
|
+
},
|
|
2498
|
+
onContextMenu: (G) => {
|
|
2499
|
+
G.preventDefault(), b(null), k({
|
|
2500
|
+
x: G.clientX,
|
|
2501
|
+
y: G.clientY,
|
|
2502
|
+
items: q(p)
|
|
2503
|
+
});
|
|
2504
|
+
},
|
|
2505
|
+
onMouseEnter: (G) => {
|
|
2506
|
+
const D = G.currentTarget.getBoundingClientRect(), tt = P(p, D);
|
|
2507
|
+
tt && b(tt);
|
|
2508
|
+
},
|
|
2509
|
+
onMouseMove: (G) => {
|
|
2510
|
+
if (f?.subscription.queryId === p.queryId) {
|
|
2511
|
+
const D = G.currentTarget.getBoundingClientRect(), tt = P(p, D);
|
|
2512
|
+
tt && b(
|
|
2513
|
+
(ot) => ot && ot.subscription.queryId === p.queryId && (ot.x !== tt.x || ot.y !== tt.y) ? tt : ot
|
|
2514
|
+
);
|
|
2515
|
+
}
|
|
2516
|
+
},
|
|
2517
|
+
onMouseLeave: () => {
|
|
2518
|
+
f?.subscription.queryId === p.queryId && b(null);
|
|
2519
|
+
},
|
|
2520
|
+
role: "button",
|
|
2521
|
+
tabIndex: 0,
|
|
2522
|
+
"aria-label": rt,
|
|
2523
|
+
"aria-expanded": i,
|
|
2524
|
+
"aria-current": C ? "true" : void 0,
|
|
2525
|
+
children: [
|
|
2526
|
+
/* @__PURE__ */ n("span", { className: "text-[10px] font-mono text-dt-text-muted font-semibold shrink-0", children: [
|
|
2527
|
+
"Q",
|
|
2528
|
+
p.queryId
|
|
2529
|
+
] }),
|
|
2530
|
+
/* @__PURE__ */ t("span", { className: `w-1.5 h-1.5 rounded-full shrink-0 ${I === "error" ? "bg-dt-error" : "bg-dt-success"}` }),
|
|
2531
|
+
/* @__PURE__ */ n("span", { className: "flex items-center gap-0 min-w-0 flex-1 overflow-hidden", children: [
|
|
2532
|
+
/* @__PURE__ */ t(
|
|
2533
|
+
"span",
|
|
2534
|
+
{
|
|
2535
|
+
className: `font-mono text-[12px] text-dt-text-secondary truncate min-w-0 ${X ? "max-w-[44%]" : ""}`,
|
|
2536
|
+
children: p.udfPath
|
|
2537
|
+
}
|
|
2538
|
+
),
|
|
2539
|
+
X && /* @__PURE__ */ n(
|
|
2540
|
+
"span",
|
|
2541
|
+
{
|
|
2542
|
+
className: "font-mono text-[11px] text-dt-text-muted min-w-0 flex-1 truncate max-w-[min(58vw,680px)]",
|
|
2543
|
+
title: at(L, 360),
|
|
2544
|
+
children: [
|
|
2545
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60", children: "(" }),
|
|
2546
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: Mt(L, se) }),
|
|
2547
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60", children: ")" })
|
|
2548
|
+
]
|
|
2549
|
+
}
|
|
2550
|
+
)
|
|
2551
|
+
] }),
|
|
2552
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 shrink-0 text-[11px] text-dt-text-muted ml-auto", children: [
|
|
2553
|
+
/* @__PURE__ */ n("span", { className: "text-dt-info font-mono", children: [
|
|
2554
|
+
"↻",
|
|
2555
|
+
p.updateCount
|
|
2556
|
+
] }),
|
|
2557
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60 font-mono", children: R(p.lastUpdate) }),
|
|
2558
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] text-dt-text-muted/40", children: i ? "▼" : "▶" })
|
|
2559
|
+
] })
|
|
2560
|
+
]
|
|
2561
|
+
}
|
|
2562
|
+
),
|
|
2563
|
+
i && /* @__PURE__ */ n("div", { className: "px-3 py-2 bg-dt-bg-secondary/30 border-t border-dt-border-light/30 flex flex-col gap-2 animate-[dt-fade-in_0.15s_ease-out]", children: [
|
|
2564
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 flex-wrap text-[10px] font-mono", children: [
|
|
2565
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-dt-text-muted", children: [
|
|
2566
|
+
"Started ",
|
|
2567
|
+
new Date(p.addedAt).toLocaleTimeString()
|
|
2568
|
+
] }),
|
|
2569
|
+
p.componentPath && /* @__PURE__ */ t(
|
|
2570
|
+
"span",
|
|
2571
|
+
{
|
|
2572
|
+
className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-dt-text-muted truncate max-w-[200px]",
|
|
2573
|
+
title: p.componentPath,
|
|
2574
|
+
children: p.componentPath
|
|
2575
|
+
}
|
|
2576
|
+
)
|
|
2577
|
+
] }),
|
|
2578
|
+
p.status === "error" && p.error && /* @__PURE__ */ t("div", { className: "text-dt-error font-mono text-[11px] bg-dt-error/10 rounded px-2 py-1 break-words", children: p.error }),
|
|
2579
|
+
/* @__PURE__ */ t(
|
|
2580
|
+
Et,
|
|
2581
|
+
{
|
|
2582
|
+
data: L ?? null,
|
|
2583
|
+
label: "Args",
|
|
2584
|
+
onCopy: () => $(B ?? "null"),
|
|
2585
|
+
maxHeight: 200
|
|
2586
|
+
}
|
|
2587
|
+
),
|
|
2588
|
+
p.currentValue !== void 0 && p.previousValue !== void 0 && /* @__PURE__ */ t(je, { previous: p.previousValue, current: p.currentValue }),
|
|
2589
|
+
p.currentValue !== void 0 && /* @__PURE__ */ t(
|
|
2590
|
+
Et,
|
|
2591
|
+
{
|
|
2592
|
+
data: p.currentValue,
|
|
2593
|
+
label: "Current Value",
|
|
2594
|
+
onCopy: () => $(JSON.stringify(p.currentValue, null, 2)),
|
|
2595
|
+
maxHeight: 300
|
|
2596
|
+
}
|
|
2597
|
+
)
|
|
2598
|
+
] })
|
|
2599
|
+
]
|
|
2600
|
+
},
|
|
2601
|
+
p.queryId
|
|
2602
|
+
);
|
|
2603
|
+
})
|
|
2604
|
+
] }),
|
|
2605
|
+
f && (() => {
|
|
2606
|
+
const p = f.subscription, u = ct(p.args), i = u !== void 0 ? at(u) : null, C = u !== void 0 ? M(u) : null, I = u !== void 0 ? at(u) : "", L = p.currentValue, X = L !== void 0 ? at(L) : null, B = L !== void 0 ? at(L) : "", rt = L !== void 0 ? M(L) : null, G = p.status === "error" && p.error ? p.error.length > 160 ? `${p.error.slice(0, 157)}…` : p.error : null;
|
|
2607
|
+
return /* @__PURE__ */ n("div", { className: "fixed z-[9999999] w-[300px] bg-zinc-900/[0.98] border border-dt-border rounded-lg shadow-2xl p-3 flex flex-col gap-2 pointer-events-none animate-[dt-fade-in_0.15s_ease-out] backdrop-blur-lg", style: { top: f.y, left: f.x }, role: "tooltip", children: [
|
|
2608
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2609
|
+
/* @__PURE__ */ t("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-[3px] bg-dt-query/20 text-dt-query text-[9px] font-bold shrink-0 shadow-[0_1px_2px_rgba(96,165,250,0.35)]", children: "Q" }),
|
|
2610
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-[12px] text-dt-text truncate flex-1", title: p.udfPath, children: p.udfPath }),
|
|
2611
|
+
/* @__PURE__ */ n("span", { className: `text-[9px] font-bold uppercase flex items-center gap-0.5 px-1.5 py-0.5 rounded-full ${p.status === "error" ? "bg-dt-error/15 text-dt-error" : "bg-dt-success/15 text-dt-success"}`, children: [
|
|
2612
|
+
p.status === "error" ? "❌" : "✓",
|
|
2613
|
+
p.status.toUpperCase()
|
|
2614
|
+
] })
|
|
2615
|
+
] }),
|
|
2616
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 flex-wrap", children: [
|
|
2617
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: [
|
|
2618
|
+
"Q",
|
|
2619
|
+
p.queryId
|
|
2620
|
+
] }),
|
|
2621
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: [
|
|
2622
|
+
"↻ ",
|
|
2623
|
+
p.updateCount,
|
|
2624
|
+
" updates"
|
|
2625
|
+
] }),
|
|
2626
|
+
/* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary rounded text-[10px] text-dt-text-muted font-mono", children: R(p.lastUpdate) })
|
|
2627
|
+
] }),
|
|
2628
|
+
p.componentPath && /* @__PURE__ */ t("div", { className: "text-[10px] text-dt-text-muted/60 font-mono truncate", title: p.componentPath, children: p.componentPath }),
|
|
2629
|
+
u !== void 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2630
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
2631
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Args" }),
|
|
2632
|
+
C && /* @__PURE__ */ t("span", { className: "text-[9px] text-dt-text-muted/60 font-mono", children: C })
|
|
2633
|
+
] }),
|
|
2634
|
+
/* @__PURE__ */ t("pre", { className: "font-mono text-[10px] text-dt-text-muted bg-zinc-950/50 rounded p-1.5 overflow-hidden max-h-[80px] whitespace-pre-wrap break-all m-0", title: i ?? void 0, children: I })
|
|
2635
|
+
] }),
|
|
2636
|
+
L !== void 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2637
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
2638
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Current Value" }),
|
|
2639
|
+
rt && /* @__PURE__ */ t("span", { className: "text-[9px] text-dt-text-muted/60 font-mono", children: rt })
|
|
2640
|
+
] }),
|
|
2641
|
+
/* @__PURE__ */ t("pre", { className: "font-mono text-[10px] text-dt-text-muted bg-zinc-950/50 rounded p-1.5 overflow-hidden max-h-[80px] whitespace-pre-wrap break-all m-0", title: X ?? void 0, children: B })
|
|
2642
|
+
] }),
|
|
2643
|
+
G && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
2644
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Error" }),
|
|
2645
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-dt-error", title: p.error, children: G })
|
|
2646
|
+
] })
|
|
2647
|
+
] });
|
|
2648
|
+
})(),
|
|
2649
|
+
N && /* @__PURE__ */ t(
|
|
2650
|
+
Gt,
|
|
2651
|
+
{
|
|
2652
|
+
x: N.x,
|
|
2653
|
+
y: N.y,
|
|
2654
|
+
items: N.items,
|
|
2655
|
+
onClose: () => k(null)
|
|
2656
|
+
}
|
|
2657
|
+
)
|
|
2658
|
+
] });
|
|
2659
|
+
}
|
|
2660
|
+
function je({ previous: e, current: r }) {
|
|
2661
|
+
const [a, s] = z(!0), d = V(() => Qt(e, r), [e, r]);
|
|
2662
|
+
return d.length === 0 ? null : /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2663
|
+
/* @__PURE__ */ n(
|
|
2664
|
+
"button",
|
|
2665
|
+
{
|
|
2666
|
+
className: "flex items-center gap-1 bg-transparent border-none text-dt-text-tertiary cursor-pointer text-[11px] font-semibold uppercase tracking-wider p-0 hover:text-dt-text-secondary transition-colors",
|
|
2667
|
+
onClick: () => s(!a),
|
|
2668
|
+
children: [
|
|
2669
|
+
/* @__PURE__ */ t("span", { className: `text-[10px] transition-transform ${a ? "rotate-90" : ""}`, children: "▶" }),
|
|
2670
|
+
/* @__PURE__ */ n("span", { children: [
|
|
2671
|
+
"Changes (",
|
|
2672
|
+
d.length,
|
|
2673
|
+
")"
|
|
2674
|
+
] })
|
|
2675
|
+
]
|
|
2676
|
+
}
|
|
2677
|
+
),
|
|
2678
|
+
a && /* @__PURE__ */ t("div", { className: "bg-zinc-950/50 rounded border border-dt-border-light p-2 font-mono text-[11px] max-h-[200px] overflow-y-auto", children: d.map((x, c) => /* @__PURE__ */ n("div", { className: `py-px ${x.type === "added" ? "text-dt-success bg-dt-success/5" : x.type === "removed" ? "text-dt-error bg-dt-error/5" : "text-dt-warning bg-dt-warning/5"}`, children: [
|
|
2679
|
+
/* @__PURE__ */ t("span", { className: "select-none opacity-60 mr-1", children: x.type === "added" ? "+" : x.type === "removed" ? "-" : "~" }),
|
|
2680
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted", children: [
|
|
2681
|
+
x.path,
|
|
2682
|
+
":"
|
|
2683
|
+
] }),
|
|
2684
|
+
" ",
|
|
2685
|
+
x.type === "changed" ? /* @__PURE__ */ n(et, { children: [
|
|
2686
|
+
/* @__PURE__ */ t("span", { className: "text-dt-error line-through opacity-70", children: x.oldVal }),
|
|
2687
|
+
" → ",
|
|
2688
|
+
/* @__PURE__ */ t("span", { className: "text-dt-success", children: x.newVal })
|
|
2689
|
+
] }) : /* @__PURE__ */ t("span", { children: x.value })
|
|
2690
|
+
] }, c)) })
|
|
2691
|
+
] });
|
|
2692
|
+
}
|
|
2693
|
+
function Qt(e, r, a = "$") {
|
|
2694
|
+
const s = [], d = (x) => {
|
|
2695
|
+
const c = JSON.stringify(x);
|
|
2696
|
+
return c && c.length > 80 ? c.slice(0, 77) + "…" : c;
|
|
2697
|
+
};
|
|
2698
|
+
if (e === r) return s;
|
|
2699
|
+
if (e === null || r === null || typeof e != typeof r || typeof e != "object" || typeof r != "object")
|
|
2700
|
+
return s.push({ type: "changed", path: a, oldVal: d(e), newVal: d(r) }), s;
|
|
2701
|
+
if (Array.isArray(e) && Array.isArray(r)) {
|
|
2702
|
+
const x = Math.max(e.length, r.length);
|
|
2703
|
+
for (let c = 0; c < x && s.length < 50; c++)
|
|
2704
|
+
c >= e.length ? s.push({ type: "added", path: `${a}[${c}]`, value: d(r[c]) }) : c >= r.length ? s.push({ type: "removed", path: `${a}[${c}]`, value: d(e[c]) }) : s.push(...Qt(e[c], r[c], `${a}[${c}]`));
|
|
2705
|
+
return s;
|
|
2706
|
+
}
|
|
2707
|
+
if (!Array.isArray(e) && !Array.isArray(r)) {
|
|
2708
|
+
const x = e, c = r, m = /* @__PURE__ */ new Set([...Object.keys(x), ...Object.keys(c)]);
|
|
2709
|
+
for (const w of m) {
|
|
2710
|
+
if (s.length >= 50) break;
|
|
2711
|
+
w in x ? w in c ? s.push(...Qt(x[w], c[w], `${a}.${w}`)) : s.push({ type: "removed", path: `${a}.${w}`, value: d(x[w]) }) : s.push({ type: "added", path: `${a}.${w}`, value: d(c[w]) });
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
return s;
|
|
2715
|
+
}
|
|
2716
|
+
function Fe({ eventStore: e, onNavigate: r }) {
|
|
2717
|
+
const [a, s] = z(null), [d, x] = z([]);
|
|
2718
|
+
U(() => {
|
|
2719
|
+
const y = () => {
|
|
2720
|
+
s(e.getPerformanceMetrics()), x(e.getAllEvents());
|
|
2721
|
+
}, S = e.subscribe(y);
|
|
2722
|
+
return y(), S;
|
|
2723
|
+
}, [e]);
|
|
2724
|
+
const c = V(() => {
|
|
2725
|
+
const y = (p) => {
|
|
2726
|
+
const u = typeof p == "number" ? p : typeof p == "string" ? Number(p) : Number.NaN;
|
|
2727
|
+
return !Number.isFinite(u) || u < 0 ? null : u;
|
|
2728
|
+
}, S = Date.now(), $ = 6e4, P = 60, M = $ / P, q = d.flatMap((p) => {
|
|
2729
|
+
if (p?.type !== "query" && p?.type !== "mutation" && p?.type !== "action")
|
|
2730
|
+
return [];
|
|
2731
|
+
const u = typeof p.timestamp == "number" && Number.isFinite(p.timestamp) ? p.timestamp : null, i = y(p.endToEndDurationMs ?? p.duration);
|
|
2732
|
+
return u === null || i === null ? [] : [{ type: p.type, timestamp: u, duration: i }];
|
|
2733
|
+
}), R = (p) => {
|
|
2734
|
+
const u = new Array(P).fill(0), i = new Array(P).fill(0);
|
|
2735
|
+
for (const C of q) {
|
|
2736
|
+
if (p && C.type !== p) continue;
|
|
2737
|
+
const I = S - C.timestamp;
|
|
2738
|
+
if (I > $ || I < 0) continue;
|
|
2739
|
+
const L = Math.min(P - 1, Math.floor(($ - I) / M));
|
|
2740
|
+
L < 0 || L >= P || (u[L] += C.duration, i[L]++);
|
|
2741
|
+
}
|
|
2742
|
+
return u.map((C, I) => i[I] > 0 ? C / i[I] : 0);
|
|
2743
|
+
};
|
|
2744
|
+
return {
|
|
2745
|
+
all: R(),
|
|
2746
|
+
query: R("query"),
|
|
2747
|
+
mutation: R("mutation"),
|
|
2748
|
+
action: R("action")
|
|
2749
|
+
};
|
|
2750
|
+
}, [d]), m = J((y) => {
|
|
2751
|
+
e.setFocusedEventId(y), r?.("activity");
|
|
2752
|
+
}, [e, r]);
|
|
2753
|
+
if (!a)
|
|
2754
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-col h-full overflow-hidden p-3 gap-3", children: "Loading..." });
|
|
2755
|
+
const w = a.totalQueries + a.totalMutations + a.totalActions > 0, v = d.some(
|
|
2756
|
+
(y) => (y?.type === "query" || y?.type === "mutation" || y?.type === "action") && typeof y?.simulatedDelayMs == "number" && y.simulatedDelayMs > 0
|
|
2757
|
+
), E = a.totalQueries + a.totalMutations + a.totalActions, f = E > 0 ? a.totalQueries / E * 100 : 0, b = E > 0 ? a.totalMutations / E * 100 : 0, N = E > 0 ? a.totalActions / E * 100 : 0, k = Math.max(a.slowestOperations[0]?.duration ?? 0, 1);
|
|
2758
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-col h-full overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex-1 min-h-0 overflow-y-auto p-3 flex flex-col gap-3", children: [
|
|
2759
|
+
!w && /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-dt-text-muted gap-2", children: [
|
|
2760
|
+
/* @__PURE__ */ t("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ t("path", { d: "M13 2L3 14h9l-1 8 10-12h-9l1-8z", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
2761
|
+
/* @__PURE__ */ t("p", { children: "No performance data yet" })
|
|
2762
|
+
] }),
|
|
2763
|
+
w && /* @__PURE__ */ n(et, { children: [
|
|
2764
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-[11px] font-mono flex-wrap px-1", children: [
|
|
2765
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "Total:" }),
|
|
2766
|
+
/* @__PURE__ */ t("span", { className: "font-semibold text-dt-text-secondary", children: E }),
|
|
2767
|
+
/* @__PURE__ */ t("span", { className: "text-dt-border mx-0.5", children: "|" }),
|
|
2768
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "Q:" }),
|
|
2769
|
+
/* @__PURE__ */ t("span", { className: "font-semibold text-dt-query", children: a.totalQueries }),
|
|
2770
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted/60 text-[10px]", children: [
|
|
2771
|
+
"(",
|
|
2772
|
+
f.toFixed(0),
|
|
2773
|
+
"%)"
|
|
2774
|
+
] }),
|
|
2775
|
+
/* @__PURE__ */ t("span", { className: "text-dt-border mx-0.5", children: "|" }),
|
|
2776
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "M:" }),
|
|
2777
|
+
/* @__PURE__ */ t("span", { className: "font-semibold text-dt-mutation", children: a.totalMutations }),
|
|
2778
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted/60 text-[10px]", children: [
|
|
2779
|
+
"(",
|
|
2780
|
+
b.toFixed(0),
|
|
2781
|
+
"%)"
|
|
2782
|
+
] }),
|
|
2783
|
+
/* @__PURE__ */ t("span", { className: "text-dt-border mx-0.5", children: "|" }),
|
|
2784
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "A:" }),
|
|
2785
|
+
/* @__PURE__ */ t("span", { className: "font-semibold text-dt-action", children: a.totalActions }),
|
|
2786
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted/60 text-[10px]", children: [
|
|
2787
|
+
"(",
|
|
2788
|
+
N.toFixed(0),
|
|
2789
|
+
"%)"
|
|
2790
|
+
] })
|
|
2791
|
+
] }),
|
|
2792
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
|
|
2793
|
+
/* @__PURE__ */ n("div", { className: "text-[11px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: [
|
|
2794
|
+
"Latency (60s window)",
|
|
2795
|
+
v && /* @__PURE__ */ t("span", { className: "ml-2 text-[10px] normal-case font-normal text-dt-warning/90", children: "includes simulated delay" })
|
|
2796
|
+
] }),
|
|
2797
|
+
/* @__PURE__ */ t(_t, { label: "All", data: c.all, color: "#e4e4e7" }),
|
|
2798
|
+
/* @__PURE__ */ t(_t, { label: "Query", data: c.query, color: "#60a5fa" }),
|
|
2799
|
+
/* @__PURE__ */ t(_t, { label: "Mutation", data: c.mutation, color: "#a78bfa" }),
|
|
2800
|
+
/* @__PURE__ */ t(_t, { label: "Action", data: c.action, color: "#34d399" })
|
|
2801
|
+
] }),
|
|
2802
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col border border-dt-border-light rounded-lg overflow-hidden", children: [
|
|
2803
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-6 gap-0 px-2 py-1.5 bg-dt-bg-tertiary/50 text-[10px] font-semibold text-dt-text-muted uppercase tracking-wider", children: [
|
|
2804
|
+
/* @__PURE__ */ t("span", { children: "Type" }),
|
|
2805
|
+
/* @__PURE__ */ t("span", { children: "Avg" }),
|
|
2806
|
+
/* @__PURE__ */ t("span", { children: "P50" }),
|
|
2807
|
+
/* @__PURE__ */ t("span", { children: "P90" }),
|
|
2808
|
+
/* @__PURE__ */ t("span", { children: "P95" }),
|
|
2809
|
+
/* @__PURE__ */ t("span", { children: "P99" })
|
|
2810
|
+
] }),
|
|
2811
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-6 gap-0 px-2 py-1.5 border-t border-dt-border-light/50 text-[11px] font-mono text-dt-text-secondary", children: [
|
|
2812
|
+
/* @__PURE__ */ t("span", { className: "text-dt-query font-bold", children: "Q" }),
|
|
2813
|
+
/* @__PURE__ */ t("span", { children: Z(a.avgQueryDuration) }),
|
|
2814
|
+
/* @__PURE__ */ t("span", { children: Z(a.p50QueryDuration) }),
|
|
2815
|
+
/* @__PURE__ */ t("span", { children: Z(a.p90QueryDuration) }),
|
|
2816
|
+
/* @__PURE__ */ t("span", { children: Z(a.p95QueryDuration) }),
|
|
2817
|
+
/* @__PURE__ */ t("span", { children: Z(a.p99QueryDuration) })
|
|
2818
|
+
] }),
|
|
2819
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-6 gap-0 px-2 py-1.5 border-t border-dt-border-light/50 text-[11px] font-mono text-dt-text-secondary", children: [
|
|
2820
|
+
/* @__PURE__ */ t("span", { className: "text-dt-mutation font-bold", children: "M" }),
|
|
2821
|
+
/* @__PURE__ */ t("span", { children: Z(a.avgMutationDuration) }),
|
|
2822
|
+
/* @__PURE__ */ t("span", { children: Z(a.p50MutationDuration) }),
|
|
2823
|
+
/* @__PURE__ */ t("span", { children: Z(a.p90MutationDuration) }),
|
|
2824
|
+
/* @__PURE__ */ t("span", { children: Z(a.p95MutationDuration) }),
|
|
2825
|
+
/* @__PURE__ */ t("span", { children: Z(a.p99MutationDuration) })
|
|
2826
|
+
] }),
|
|
2827
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-6 gap-0 px-2 py-1.5 border-t border-dt-border-light/50 text-[11px] font-mono text-dt-text-secondary", children: [
|
|
2828
|
+
/* @__PURE__ */ t("span", { className: "text-dt-action font-bold", children: "A" }),
|
|
2829
|
+
/* @__PURE__ */ t("span", { children: Z(a.avgActionDuration) }),
|
|
2830
|
+
/* @__PURE__ */ t("span", { children: Z(a.p50ActionDuration) }),
|
|
2831
|
+
/* @__PURE__ */ t("span", { children: Z(a.p90ActionDuration) }),
|
|
2832
|
+
/* @__PURE__ */ t("span", { children: Z(a.p95ActionDuration) }),
|
|
2833
|
+
/* @__PURE__ */ t("span", { children: Z(a.p99ActionDuration) })
|
|
2834
|
+
] })
|
|
2835
|
+
] }),
|
|
2836
|
+
a.slowestOperations.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2837
|
+
/* @__PURE__ */ t("div", { className: "text-[11px] font-semibold text-dt-text-tertiary uppercase tracking-wider", children: "Slowest Operations" }),
|
|
2838
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5", children: a.slowestOperations.map((y, S) => /* @__PURE__ */ n(
|
|
2839
|
+
"button",
|
|
2840
|
+
{
|
|
2841
|
+
className: "flex items-center gap-2 text-[11px] py-0.5 px-1 bg-transparent border-none text-left cursor-pointer rounded hover:bg-white/[0.04] focus:outline-none focus:ring-1 focus:ring-dt-info/40",
|
|
2842
|
+
onClick: () => m(y.eventId),
|
|
2843
|
+
title: "Open operation in Activity",
|
|
2844
|
+
type: "button",
|
|
2845
|
+
children: [
|
|
2846
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/40 w-4 text-right font-mono text-[10px]", children: S + 1 }),
|
|
2847
|
+
/* @__PURE__ */ t("span", { className: `inline-flex items-center justify-center w-4 h-4 rounded text-[9px] font-bold ${y.type === "query" ? "text-dt-query" : y.type === "mutation" ? "text-dt-mutation" : "text-dt-action"}`, children: y.type[0].toUpperCase() }),
|
|
2848
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-dt-text-secondary truncate flex-1", children: y.udfPath }),
|
|
2849
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-dt-text-muted shrink-0", children: Z(y.duration) }),
|
|
2850
|
+
/* @__PURE__ */ t("div", { className: "w-16 h-1.5 bg-dt-bg-tertiary rounded-full overflow-hidden shrink-0", children: /* @__PURE__ */ t(
|
|
2851
|
+
"div",
|
|
2852
|
+
{
|
|
2853
|
+
className: `h-full rounded-full ${y.type === "query" ? "bg-dt-query" : y.type === "mutation" ? "bg-dt-mutation" : "bg-dt-action"}`,
|
|
2854
|
+
style: { width: `${Math.min(100, Math.max(2, y.duration / k * 100))}%` }
|
|
2855
|
+
}
|
|
2856
|
+
) })
|
|
2857
|
+
]
|
|
2858
|
+
},
|
|
2859
|
+
y.eventId
|
|
2860
|
+
)) })
|
|
2861
|
+
] })
|
|
2862
|
+
] })
|
|
2863
|
+
] }) });
|
|
2864
|
+
}
|
|
2865
|
+
function _t({ label: e, data: r, color: a }) {
|
|
2866
|
+
const s = r.map(
|
|
2867
|
+
(c) => typeof c == "number" && Number.isFinite(c) && c > 0 ? c : 0
|
|
2868
|
+
), d = Math.max(...s, 1), x = s[s.length - 1] || 0;
|
|
2869
|
+
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2870
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-mono text-dt-text-muted w-14 shrink-0", children: e }),
|
|
2871
|
+
/* @__PURE__ */ t("div", { className: "flex-1 h-5 flex items-end gap-px", children: s.map((c, m) => /* @__PURE__ */ t(
|
|
2872
|
+
"div",
|
|
2873
|
+
{
|
|
2874
|
+
className: "flex-1 rounded-t-sm min-h-px",
|
|
2875
|
+
style: {
|
|
2876
|
+
height: `${Math.max(1, c / d * 100)}%`,
|
|
2877
|
+
backgroundColor: c > 0 ? a : "rgba(63,63,70,0.3)",
|
|
2878
|
+
opacity: c > 0 ? 0.5 + m / s.length * 0.5 : 0.2
|
|
2879
|
+
}
|
|
2880
|
+
},
|
|
2881
|
+
m
|
|
2882
|
+
)) }),
|
|
2883
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-mono text-dt-text-muted w-14 text-right shrink-0", children: x > 0 ? Z(x) : "—" })
|
|
2884
|
+
] });
|
|
2885
|
+
}
|
|
2886
|
+
function Z(e) {
|
|
2887
|
+
return !Number.isFinite(e) || e < 0 ? "—" : e < 1e3 ? `${e.toFixed(3)}ms` : `${(e / 1e3).toFixed(3)}s`;
|
|
2888
|
+
}
|
|
2889
|
+
function Re(e) {
|
|
2890
|
+
return e.type === "query" || e.type === "mutation" || e.type === "action";
|
|
2891
|
+
}
|
|
2892
|
+
function le(e) {
|
|
2893
|
+
return e.type === "query" ? `Q${e.queryId}` : e.type === "mutation" ? `M${e.requestId}` : `A${e.requestId}`;
|
|
2894
|
+
}
|
|
2895
|
+
function Be({ eventStore: e, onNavigate: r }) {
|
|
2896
|
+
const [a, s] = z([]), [d, x] = z(/* @__PURE__ */ new Map()), [c, m] = z(!0), [w, v] = z("all"), [E, f] = z(""), [b, N] = z(null), [k, y] = z(null), S = Ct(null), $ = Ct(null), P = J(
|
|
2897
|
+
(i) => {
|
|
2898
|
+
i && (e.setFocusedEventId(i), r?.("activity"));
|
|
2899
|
+
},
|
|
2900
|
+
[e, r]
|
|
2901
|
+
);
|
|
2902
|
+
U(() => {
|
|
2903
|
+
const i = () => {
|
|
2904
|
+
const I = e.getAllEvents(), L = /* @__PURE__ */ new Map(), X = [];
|
|
2905
|
+
for (const B of I) {
|
|
2906
|
+
if (B.type === "log") {
|
|
2907
|
+
X.push(B);
|
|
2908
|
+
continue;
|
|
2909
|
+
}
|
|
2910
|
+
Re(B) && L.set(B.id, B);
|
|
2911
|
+
}
|
|
2912
|
+
s(X), x(L);
|
|
2913
|
+
}, C = e.subscribe(i);
|
|
2914
|
+
return i(), C;
|
|
2915
|
+
}, [e]);
|
|
2916
|
+
const M = V(() => {
|
|
2917
|
+
const i = E.trim().toLowerCase().split(/\s+/).filter((C) => C.length > 0);
|
|
2918
|
+
return a.filter((C) => {
|
|
2919
|
+
if (w !== "all" && C.level !== w) return !1;
|
|
2920
|
+
if (i.length === 0) return !0;
|
|
2921
|
+
const I = C.relatedEventId ? d.get(C.relatedEventId) : void 0, L = [
|
|
2922
|
+
C.message,
|
|
2923
|
+
C.level,
|
|
2924
|
+
C.relatedEventId ?? "",
|
|
2925
|
+
I?.udfPath ?? "",
|
|
2926
|
+
I?.type ?? "",
|
|
2927
|
+
I ? le(I) : ""
|
|
2928
|
+
].join(`
|
|
2929
|
+
`).toLowerCase();
|
|
2930
|
+
return i.every((X) => L.includes(X));
|
|
2931
|
+
});
|
|
2932
|
+
}, [a, w, E, d]), q = J((i) => {
|
|
2933
|
+
F(i.message), y(i.id), setTimeout(() => y(null), 300);
|
|
2934
|
+
}, []), R = J((i) => `[${new Date(i.timestamp).toLocaleTimeString([], {
|
|
2935
|
+
hour: "2-digit",
|
|
2936
|
+
minute: "2-digit",
|
|
2937
|
+
second: "2-digit",
|
|
2938
|
+
fractionalSecondDigits: 3
|
|
2939
|
+
})}] [${i.level.toUpperCase()}] ${i.message}`, []), p = J(() => {
|
|
2940
|
+
const i = M.map(R).join(`
|
|
2941
|
+
`);
|
|
2942
|
+
F(i);
|
|
2943
|
+
}, [M, R]);
|
|
2944
|
+
U(() => {
|
|
2945
|
+
const i = (C) => {
|
|
2946
|
+
if (Pt()) {
|
|
2947
|
+
if ((C.metaKey || C.ctrlKey) && C.key === "k") {
|
|
2948
|
+
C.preventDefault(), S.current?.focus();
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2951
|
+
C.key === "Escape" && (w !== "all" || E) && (C.preventDefault(), v("all"), f(""));
|
|
2952
|
+
}
|
|
2953
|
+
};
|
|
2954
|
+
return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
|
|
2955
|
+
}, [w, E]), U(() => {
|
|
2956
|
+
c && $.current && $.current.scrollIntoView({ behavior: "smooth" });
|
|
2957
|
+
}, [M.length, c]);
|
|
2958
|
+
const u = J(
|
|
2959
|
+
(i) => {
|
|
2960
|
+
const C = i.relatedEventId ? d.get(i.relatedEventId) : void 0, I = new Date(i.timestamp).toLocaleTimeString([], {
|
|
2961
|
+
hour: "2-digit",
|
|
2962
|
+
minute: "2-digit",
|
|
2963
|
+
second: "2-digit",
|
|
2964
|
+
fractionalSecondDigits: 3
|
|
2965
|
+
}), L = [
|
|
2966
|
+
{ label: "Copy Message", action: () => F(i.message), shortcut: "⌘C" },
|
|
2967
|
+
{ label: "Copy Timestamp", action: () => F(I) }
|
|
2968
|
+
];
|
|
2969
|
+
return L.push({
|
|
2970
|
+
label: `Filter by Level: ${i.level}`,
|
|
2971
|
+
action: () => v(i.level),
|
|
2972
|
+
separator: !0
|
|
2973
|
+
}), i.relatedEventId && L.push({
|
|
2974
|
+
label: "Copy Related Event ID",
|
|
2975
|
+
action: () => F(i.relatedEventId)
|
|
2976
|
+
}), C && (L.push({
|
|
2977
|
+
label: "Copy Related Function Path",
|
|
2978
|
+
action: () => F(C.udfPath)
|
|
2979
|
+
}), L.push({
|
|
2980
|
+
label: "Filter by Related Function",
|
|
2981
|
+
action: () => f(C.udfPath)
|
|
2982
|
+
})), i.relatedEventId && r && L.push({
|
|
2983
|
+
label: "Go to Related Event",
|
|
2984
|
+
action: () => P(i.relatedEventId)
|
|
2985
|
+
}), L.push({
|
|
2986
|
+
label: "Copy as JSON",
|
|
2987
|
+
action: () => F(JSON.stringify(i, null, 2)),
|
|
2988
|
+
separator: !0
|
|
2989
|
+
}), L;
|
|
2990
|
+
},
|
|
2991
|
+
[P, r, d]
|
|
2992
|
+
);
|
|
2993
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col h-full overflow-hidden", children: [
|
|
2994
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-1.5 border-b border-dt-border-light", children: [
|
|
2995
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-0.5", children: ["all", "log", "info", "warn", "error"].map((i) => /* @__PURE__ */ t(
|
|
2996
|
+
"button",
|
|
2997
|
+
{
|
|
2998
|
+
className: `px-2 py-1 text-[11px] bg-transparent border rounded-md cursor-pointer transition-all ${w === i ? i === "info" ? "bg-dt-info/20 text-dt-info border-dt-info/30 font-medium" : i === "warn" ? "bg-dt-warning/20 text-dt-warning border-dt-warning/30 font-medium" : i === "error" ? "bg-dt-error/20 text-dt-error border-dt-error/30 font-medium" : "bg-white/10 text-dt-text-secondary border-dt-border-light font-medium" : i === "info" ? "border-transparent text-dt-text-muted hover:bg-dt-info/15 hover:text-dt-info" : i === "warn" ? "border-transparent text-dt-text-muted hover:bg-dt-warning/15 hover:text-dt-warning" : i === "error" ? "border-transparent text-dt-text-muted hover:bg-dt-error/15 hover:text-dt-error" : "border-transparent text-dt-text-muted hover:bg-white/5 hover:text-dt-text-tertiary"}`,
|
|
2999
|
+
onClick: () => v(i),
|
|
3000
|
+
children: i.charAt(0).toUpperCase() + i.slice(1)
|
|
3001
|
+
},
|
|
3002
|
+
i
|
|
3003
|
+
)) }),
|
|
3004
|
+
/* @__PURE__ */ t(
|
|
3005
|
+
Xt,
|
|
3006
|
+
{
|
|
3007
|
+
ref: S,
|
|
3008
|
+
value: E,
|
|
3009
|
+
onValueChange: f,
|
|
3010
|
+
onClear: () => f(""),
|
|
3011
|
+
placeholder: "Search msg/path/id... (Cmd/Ctrl+K)",
|
|
3012
|
+
className: "stretch"
|
|
3013
|
+
}
|
|
3014
|
+
),
|
|
3015
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 ml-auto", children: [
|
|
3016
|
+
/* @__PURE__ */ n(
|
|
3017
|
+
"button",
|
|
3018
|
+
{
|
|
3019
|
+
className: "px-2 py-1 text-[11px] bg-transparent border border-dt-border-light rounded-md cursor-pointer text-dt-text-muted hover:text-dt-text-secondary hover:bg-white/5 transition-colors disabled:opacity-30 disabled:cursor-default disabled:hover:bg-transparent disabled:hover:text-dt-text-muted",
|
|
3020
|
+
onClick: p,
|
|
3021
|
+
disabled: M.length === 0,
|
|
3022
|
+
title: "Copy all visible logs as plain text",
|
|
3023
|
+
children: [
|
|
3024
|
+
"Copy all (",
|
|
3025
|
+
M.length,
|
|
3026
|
+
")"
|
|
3027
|
+
]
|
|
3028
|
+
}
|
|
3029
|
+
),
|
|
3030
|
+
/* @__PURE__ */ n("label", { className: "flex items-center gap-1.5 text-[11px] text-dt-text-muted cursor-pointer select-none", children: [
|
|
3031
|
+
/* @__PURE__ */ t("input", { type: "checkbox", checked: c, onChange: (i) => m(i.target.checked) }),
|
|
3032
|
+
"Auto-scroll"
|
|
3033
|
+
] })
|
|
3034
|
+
] })
|
|
3035
|
+
] }),
|
|
3036
|
+
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto p-1", children: [
|
|
3037
|
+
M.length === 0 && /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-dt-text-muted gap-2", children: [
|
|
3038
|
+
/* @__PURE__ */ t("p", { children: "No logs yet" }),
|
|
3039
|
+
/* @__PURE__ */ t("p", { className: "text-[11px] text-dt-text-muted/60", children: "Console output from functions will appear here" })
|
|
3040
|
+
] }),
|
|
3041
|
+
M.map((i) => {
|
|
3042
|
+
const C = i.relatedEventId ? d.get(i.relatedEventId) : void 0, I = C ? le(C) : null;
|
|
3043
|
+
return /* @__PURE__ */ n(
|
|
3044
|
+
"div",
|
|
3045
|
+
{
|
|
3046
|
+
className: `flex items-start gap-2 px-2 py-1 text-[11px] font-mono border-b border-dt-border-light/30 cursor-pointer select-none transition-colors duration-300 ${k === i.id ? "bg-white/10" : `hover:bg-white/[0.02] ${i.level === "warn" ? "bg-dt-warning/5" : i.level === "error" ? "bg-dt-error/5" : ""}`}`,
|
|
3047
|
+
onClick: () => q(i),
|
|
3048
|
+
onContextMenu: (L) => {
|
|
3049
|
+
L.preventDefault(), N({
|
|
3050
|
+
x: L.clientX,
|
|
3051
|
+
y: L.clientY,
|
|
3052
|
+
items: u(i)
|
|
3053
|
+
});
|
|
3054
|
+
},
|
|
3055
|
+
children: [
|
|
3056
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted/60 shrink-0", children: new Date(i.timestamp).toLocaleTimeString([], {
|
|
3057
|
+
hour: "2-digit",
|
|
3058
|
+
minute: "2-digit",
|
|
3059
|
+
second: "2-digit",
|
|
3060
|
+
fractionalSecondDigits: 3
|
|
3061
|
+
}) }),
|
|
3062
|
+
/* @__PURE__ */ t("span", { className: `font-semibold shrink-0 w-10 uppercase text-[10px] ${i.level === "info" ? "text-dt-info" : i.level === "warn" ? "text-dt-warning" : i.level === "error" ? "text-dt-error" : "text-dt-text-muted"}`, children: i.level.toUpperCase() }),
|
|
3063
|
+
/* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
3064
|
+
/* @__PURE__ */ t("div", { className: "text-dt-text-secondary break-all", children: i.message }),
|
|
3065
|
+
C && /* @__PURE__ */ n("div", { className: "text-[10px] text-dt-text-muted/70 truncate", title: `${C.type} ${C.udfPath}`, children: [
|
|
3066
|
+
C.type,
|
|
3067
|
+
" ",
|
|
3068
|
+
C.udfPath
|
|
3069
|
+
] })
|
|
3070
|
+
] }),
|
|
3071
|
+
i.relatedEventId && /* @__PURE__ */ t(
|
|
3072
|
+
"button",
|
|
3073
|
+
{
|
|
3074
|
+
className: "shrink-0 px-1 py-0.5 bg-transparent border border-dt-border-light/50 rounded text-[9px] font-mono text-dt-text-muted cursor-pointer hover:text-dt-info hover:border-dt-info/30 transition-colors",
|
|
3075
|
+
onClick: (L) => {
|
|
3076
|
+
L.stopPropagation(), P(i.relatedEventId);
|
|
3077
|
+
},
|
|
3078
|
+
title: C ? `Open ${C.udfPath}` : `From: ${i.relatedEventId}`,
|
|
3079
|
+
children: I ?? i.relatedEventId.split("-")[0]
|
|
3080
|
+
}
|
|
3081
|
+
)
|
|
3082
|
+
]
|
|
3083
|
+
},
|
|
3084
|
+
i.id
|
|
3085
|
+
);
|
|
3086
|
+
}),
|
|
3087
|
+
/* @__PURE__ */ t("div", { ref: $ })
|
|
3088
|
+
] }),
|
|
3089
|
+
b && /* @__PURE__ */ t(
|
|
3090
|
+
Gt,
|
|
3091
|
+
{
|
|
3092
|
+
x: b.x,
|
|
3093
|
+
y: b.y,
|
|
3094
|
+
items: b.items,
|
|
3095
|
+
onClose: () => N(null)
|
|
3096
|
+
}
|
|
3097
|
+
)
|
|
3098
|
+
] });
|
|
3099
|
+
}
|
|
3100
|
+
function Ve({ eventStore: e }) {
|
|
3101
|
+
const [r, a] = z(e.getSettings()), [s, d] = z(e.getSnapshots()), x = e.isPausedState(), c = e.isPersistenceEnabled();
|
|
3102
|
+
U(() => (a(e.getSettings()), e.subscribeSettings((y) => {
|
|
3103
|
+
a(y);
|
|
3104
|
+
})), [e]);
|
|
3105
|
+
const m = (k, y) => {
|
|
3106
|
+
e.saveSettings({ [k]: y });
|
|
3107
|
+
}, w = () => {
|
|
3108
|
+
const k = e.exportSession(), y = new Blob([JSON.stringify(k, null, 2)], {
|
|
3109
|
+
type: "application/json"
|
|
3110
|
+
}), S = URL.createObjectURL(y), $ = document.createElement("a");
|
|
3111
|
+
$.href = S, $.download = `concave-devtools-${Date.now()}.json`, $.click(), URL.revokeObjectURL(S);
|
|
3112
|
+
}, v = () => {
|
|
3113
|
+
const k = document.createElement("input");
|
|
3114
|
+
k.type = "file", k.accept = ".json", k.onchange = async (y) => {
|
|
3115
|
+
const S = y.target.files?.[0];
|
|
3116
|
+
if (S)
|
|
3117
|
+
try {
|
|
3118
|
+
const $ = await S.text(), P = JSON.parse($), M = e.importSession(P);
|
|
3119
|
+
alert(M ? "Session imported successfully!" : "Failed to import session. Invalid format.");
|
|
3120
|
+
} catch ($) {
|
|
3121
|
+
alert(`Failed to import session: ${$}`);
|
|
3122
|
+
}
|
|
3123
|
+
}, k.click();
|
|
3124
|
+
}, E = () => {
|
|
3125
|
+
e.createSnapshot(), d(e.getSnapshots());
|
|
3126
|
+
}, f = (k) => {
|
|
3127
|
+
confirm("Restore to this snapshot? Current state will be replaced.") && e.restoreSnapshot(k) && d(e.getSnapshots());
|
|
3128
|
+
}, b = () => {
|
|
3129
|
+
x ? e.resume() : e.pause(), a({ ...e.getSettings() });
|
|
3130
|
+
}, N = () => {
|
|
3131
|
+
e.clear(), d([]);
|
|
3132
|
+
};
|
|
3133
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col h-full overflow-y-auto p-3 gap-3", children: [
|
|
3134
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
|
|
3135
|
+
/* @__PURE__ */ t("h4", { className: "text-[11px] font-semibold text-dt-text-secondary uppercase tracking-wider m-0 pb-1 border-b border-dt-border-light", children: "Recording" }),
|
|
3136
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-border-light/30 bg-dt-bg-secondary/30", children: [
|
|
3137
|
+
/* @__PURE__ */ t(
|
|
3138
|
+
"span",
|
|
3139
|
+
{
|
|
3140
|
+
className: `px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide ${x ? "bg-dt-warning/20 text-dt-warning" : "bg-dt-success/20 text-dt-success"}`,
|
|
3141
|
+
children: x ? "Paused" : "Live"
|
|
3142
|
+
}
|
|
3143
|
+
),
|
|
3144
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-dt-text-muted", children: x ? "No new events" : "Capturing events" }),
|
|
3145
|
+
/* @__PURE__ */ t(
|
|
3146
|
+
"button",
|
|
3147
|
+
{
|
|
3148
|
+
type: "button",
|
|
3149
|
+
className: `ml-auto px-2.5 py-1 rounded-md text-[11px] font-medium cursor-pointer border transition-all ${x ? "bg-dt-success/15 text-dt-success border-dt-success/30 hover:bg-dt-success/25" : "bg-dt-error/15 text-dt-error border-dt-error/30 hover:bg-dt-error/25"}`,
|
|
3150
|
+
onClick: b,
|
|
3151
|
+
children: x ? "Resume" : "Pause"
|
|
3152
|
+
}
|
|
3153
|
+
)
|
|
3154
|
+
] })
|
|
3155
|
+
] }),
|
|
3156
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
|
|
3157
|
+
/* @__PURE__ */ t("h4", { className: "text-[11px] font-semibold text-dt-text-secondary uppercase tracking-wider m-0 pb-1 border-b border-dt-border-light", children: "General" }),
|
|
3158
|
+
/* @__PURE__ */ n(
|
|
3159
|
+
"label",
|
|
3160
|
+
{
|
|
3161
|
+
className: `flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-border-light/30 text-[12px] ${c ? "cursor-pointer" : "cursor-not-allowed opacity-70"}`,
|
|
3162
|
+
children: [
|
|
3163
|
+
/* @__PURE__ */ t(
|
|
3164
|
+
"input",
|
|
3165
|
+
{
|
|
3166
|
+
type: "checkbox",
|
|
3167
|
+
checked: r.persistEvents,
|
|
3168
|
+
disabled: !c,
|
|
3169
|
+
onChange: (k) => m("persistEvents", k.target.checked)
|
|
3170
|
+
}
|
|
3171
|
+
),
|
|
3172
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary", children: "Persist events" }),
|
|
3173
|
+
/* @__PURE__ */ t("span", { className: "ml-auto text-[10px] text-dt-text-muted", children: c ? "localStorage" : "disabled in panel" })
|
|
3174
|
+
]
|
|
3175
|
+
}
|
|
3176
|
+
),
|
|
3177
|
+
/* @__PURE__ */ n("label", { className: "flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-border-light/30 text-[12px] cursor-pointer", children: [
|
|
3178
|
+
/* @__PURE__ */ t(
|
|
3179
|
+
"input",
|
|
3180
|
+
{
|
|
3181
|
+
type: "checkbox",
|
|
3182
|
+
checked: r.captureLogLines,
|
|
3183
|
+
onChange: (k) => m("captureLogLines", k.target.checked)
|
|
3184
|
+
}
|
|
3185
|
+
),
|
|
3186
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary", children: "Capture console logs" })
|
|
3187
|
+
] }),
|
|
3188
|
+
/* @__PURE__ */ n("label", { className: "flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-border-light/30 text-[12px] cursor-pointer", children: [
|
|
3189
|
+
/* @__PURE__ */ t(
|
|
3190
|
+
"input",
|
|
3191
|
+
{
|
|
3192
|
+
type: "checkbox",
|
|
3193
|
+
checked: r.autoPauseOnError,
|
|
3194
|
+
onChange: (k) => m("autoPauseOnError", k.target.checked)
|
|
3195
|
+
}
|
|
3196
|
+
),
|
|
3197
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary", children: "Auto-pause on error" })
|
|
3198
|
+
] }),
|
|
3199
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-border-light/30 text-[12px]", children: [
|
|
3200
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary", children: "Max events" }),
|
|
3201
|
+
/* @__PURE__ */ t(
|
|
3202
|
+
"input",
|
|
3203
|
+
{
|
|
3204
|
+
type: "number",
|
|
3205
|
+
className: "w-20 bg-dt-bg-tertiary border border-dt-border-light rounded px-2 py-1 text-[12px] text-dt-text-secondary font-mono outline-none focus:border-dt-info/50",
|
|
3206
|
+
value: r.maxEvents,
|
|
3207
|
+
onChange: (k) => m("maxEvents", parseInt(k.target.value, 10) || 1e3),
|
|
3208
|
+
min: "100",
|
|
3209
|
+
max: "10000",
|
|
3210
|
+
step: "100"
|
|
3211
|
+
}
|
|
3212
|
+
),
|
|
3213
|
+
/* @__PURE__ */ t("span", { className: "ml-auto text-[10px] text-dt-text-muted", children: "100-10000" })
|
|
3214
|
+
] })
|
|
3215
|
+
] }),
|
|
3216
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
|
|
3217
|
+
/* @__PURE__ */ t("h4", { className: "text-[11px] font-semibold text-dt-text-secondary uppercase tracking-wider m-0 pb-1 border-b border-dt-border-light", children: "Network Simulation" }),
|
|
3218
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-border-light/30 text-[12px]", children: [
|
|
3219
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary", children: "Latency" }),
|
|
3220
|
+
/* @__PURE__ */ t(
|
|
3221
|
+
"input",
|
|
3222
|
+
{
|
|
3223
|
+
type: "number",
|
|
3224
|
+
className: "w-20 bg-dt-bg-tertiary border border-dt-border-light rounded px-2 py-1 text-[12px] text-dt-text-secondary font-mono outline-none focus:border-dt-info/50",
|
|
3225
|
+
value: r.wsLatencyMs,
|
|
3226
|
+
onChange: (k) => m("wsLatencyMs", Math.max(0, parseInt(k.target.value, 10) || 0)),
|
|
3227
|
+
min: "0",
|
|
3228
|
+
max: "10000",
|
|
3229
|
+
step: "50"
|
|
3230
|
+
}
|
|
3231
|
+
),
|
|
3232
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] text-dt-text-muted", children: "ms" })
|
|
3233
|
+
] }),
|
|
3234
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-border-light/30 text-[12px]", children: [
|
|
3235
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary", children: "Jitter" }),
|
|
3236
|
+
/* @__PURE__ */ t(
|
|
3237
|
+
"input",
|
|
3238
|
+
{
|
|
3239
|
+
type: "number",
|
|
3240
|
+
className: "w-20 bg-dt-bg-tertiary border border-dt-border-light rounded px-2 py-1 text-[12px] text-dt-text-secondary font-mono outline-none focus:border-dt-info/50",
|
|
3241
|
+
value: r.wsJitterMs,
|
|
3242
|
+
onChange: (k) => m("wsJitterMs", Math.max(0, parseInt(k.target.value, 10) || 0)),
|
|
3243
|
+
min: "0",
|
|
3244
|
+
max: "5000",
|
|
3245
|
+
step: "25"
|
|
3246
|
+
}
|
|
3247
|
+
),
|
|
3248
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] text-dt-text-muted", children: "ms" })
|
|
3249
|
+
] }),
|
|
3250
|
+
(r.wsLatencyMs > 0 || r.wsJitterMs > 0) && /* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded-md border border-dt-warning/30 bg-dt-warning/5 text-[11px]", children: [
|
|
3251
|
+
/* @__PURE__ */ t("span", { className: "px-1.5 py-0.5 rounded bg-dt-warning/20 text-dt-warning text-[10px] font-semibold uppercase tracking-wide", children: "Active" }),
|
|
3252
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted", children: [
|
|
3253
|
+
r.wsLatencyMs,
|
|
3254
|
+
"ms",
|
|
3255
|
+
r.wsJitterMs > 0 ? ` ±${r.wsJitterMs}ms` : ""
|
|
3256
|
+
] }),
|
|
3257
|
+
/* @__PURE__ */ t(
|
|
3258
|
+
"button",
|
|
3259
|
+
{
|
|
3260
|
+
type: "button",
|
|
3261
|
+
className: "ml-auto px-2 py-0.5 rounded-md text-[10px] font-medium cursor-pointer border bg-dt-warning/15 text-dt-warning border-dt-warning/30 hover:bg-dt-warning/25",
|
|
3262
|
+
onClick: () => {
|
|
3263
|
+
e.saveSettings({ wsLatencyMs: 0, wsJitterMs: 0 });
|
|
3264
|
+
},
|
|
3265
|
+
children: "Reset"
|
|
3266
|
+
}
|
|
3267
|
+
)
|
|
3268
|
+
] })
|
|
3269
|
+
] }),
|
|
3270
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
|
|
3271
|
+
/* @__PURE__ */ t("h4", { className: "text-[11px] font-semibold text-dt-text-secondary uppercase tracking-wider m-0 pb-1 border-b border-dt-border-light", children: "Session" }),
|
|
3272
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
|
|
3273
|
+
/* @__PURE__ */ t(
|
|
3274
|
+
"button",
|
|
3275
|
+
{
|
|
3276
|
+
type: "button",
|
|
3277
|
+
className: "px-2.5 py-1 bg-dt-bg-tertiary border border-dt-border-light rounded-md text-[11px] text-dt-text-secondary cursor-pointer transition-all hover:bg-white/10 hover:border-dt-border",
|
|
3278
|
+
onClick: w,
|
|
3279
|
+
children: "Export"
|
|
3280
|
+
}
|
|
3281
|
+
),
|
|
3282
|
+
/* @__PURE__ */ t(
|
|
3283
|
+
"button",
|
|
3284
|
+
{
|
|
3285
|
+
type: "button",
|
|
3286
|
+
className: "px-2.5 py-1 bg-dt-bg-tertiary border border-dt-border-light rounded-md text-[11px] text-dt-text-secondary cursor-pointer transition-all hover:bg-white/10 hover:border-dt-border",
|
|
3287
|
+
onClick: v,
|
|
3288
|
+
children: "Import"
|
|
3289
|
+
}
|
|
3290
|
+
),
|
|
3291
|
+
/* @__PURE__ */ t(
|
|
3292
|
+
"button",
|
|
3293
|
+
{
|
|
3294
|
+
type: "button",
|
|
3295
|
+
className: "px-2.5 py-1 bg-dt-bg-tertiary border border-dt-border-light rounded-md text-[11px] text-dt-text-secondary cursor-pointer transition-all hover:bg-dt-error/15 hover:text-dt-error hover:border-dt-error/30",
|
|
3296
|
+
onClick: N,
|
|
3297
|
+
children: "Clear"
|
|
3298
|
+
}
|
|
3299
|
+
)
|
|
3300
|
+
] })
|
|
3301
|
+
] }),
|
|
3302
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
|
|
3303
|
+
/* @__PURE__ */ t("h4", { className: "text-[11px] font-semibold text-dt-text-secondary uppercase tracking-wider m-0 pb-1 border-b border-dt-border-light", children: "Time Travel" }),
|
|
3304
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
|
|
3305
|
+
/* @__PURE__ */ t(
|
|
3306
|
+
"button",
|
|
3307
|
+
{
|
|
3308
|
+
type: "button",
|
|
3309
|
+
className: "px-2.5 py-1 bg-dt-bg-tertiary border border-dt-border-light rounded-md text-[11px] text-dt-text-secondary cursor-pointer transition-all hover:bg-white/10 hover:border-dt-border",
|
|
3310
|
+
onClick: E,
|
|
3311
|
+
children: "Snapshot"
|
|
3312
|
+
}
|
|
3313
|
+
),
|
|
3314
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 py-0.5 rounded bg-dt-bg-tertiary text-[10px] text-dt-text-muted font-mono", children: [
|
|
3315
|
+
s.length,
|
|
3316
|
+
" saved"
|
|
3317
|
+
] })
|
|
3318
|
+
] }),
|
|
3319
|
+
s.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-col gap-1 max-h-[180px] overflow-y-auto pr-1", children: [...s].reverse().map((k) => /* @__PURE__ */ n(
|
|
3320
|
+
"div",
|
|
3321
|
+
{
|
|
3322
|
+
className: "flex items-center gap-2 px-2 py-1 bg-dt-bg-tertiary/50 rounded border border-dt-border-light/30 text-[11px]",
|
|
3323
|
+
children: [
|
|
3324
|
+
/* @__PURE__ */ t(
|
|
3325
|
+
"span",
|
|
3326
|
+
{
|
|
3327
|
+
className: "text-dt-text-secondary font-mono",
|
|
3328
|
+
title: new Date(k.timestamp).toLocaleString(),
|
|
3329
|
+
children: new Date(k.timestamp).toLocaleTimeString([], {
|
|
3330
|
+
hour: "2-digit",
|
|
3331
|
+
minute: "2-digit",
|
|
3332
|
+
second: "2-digit"
|
|
3333
|
+
})
|
|
3334
|
+
}
|
|
3335
|
+
),
|
|
3336
|
+
/* @__PURE__ */ n("span", { className: "text-dt-text-muted", children: [
|
|
3337
|
+
k.events.length,
|
|
3338
|
+
"e"
|
|
3339
|
+
] }),
|
|
3340
|
+
/* @__PURE__ */ t(
|
|
3341
|
+
"button",
|
|
3342
|
+
{
|
|
3343
|
+
type: "button",
|
|
3344
|
+
className: "ml-auto px-1.5 py-0.5 bg-dt-info/15 text-dt-info border border-dt-info/30 rounded text-[10px] font-medium cursor-pointer hover:bg-dt-info/25",
|
|
3345
|
+
onClick: () => f(k.timestamp),
|
|
3346
|
+
children: "Restore"
|
|
3347
|
+
}
|
|
3348
|
+
)
|
|
3349
|
+
]
|
|
3350
|
+
},
|
|
3351
|
+
k.timestamp
|
|
3352
|
+
)) }) : /* @__PURE__ */ t("p", { className: "text-[11px] text-dt-text-muted/60 m-0", children: "No snapshots" })
|
|
3353
|
+
] }),
|
|
3354
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
|
|
3355
|
+
/* @__PURE__ */ t("h4", { className: "text-[11px] font-semibold text-dt-text-secondary uppercase tracking-wider m-0 pb-1 border-b border-dt-border-light", children: "Shortcuts" }),
|
|
3356
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
3357
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
3358
|
+
/* @__PURE__ */ t("kbd", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary border border-dt-border-light rounded text-[10px] font-mono text-dt-text-tertiary", children: "Cmd/Ctrl + Shift + D" }),
|
|
3359
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "Toggle DevTools" })
|
|
3360
|
+
] }),
|
|
3361
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
3362
|
+
/* @__PURE__ */ t("kbd", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary border border-dt-border-light rounded text-[10px] font-mono text-dt-text-tertiary", children: "Cmd/Ctrl + K" }),
|
|
3363
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "Focus search" })
|
|
3364
|
+
] }),
|
|
3365
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
3366
|
+
/* @__PURE__ */ t("kbd", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary border border-dt-border-light rounded text-[10px] font-mono text-dt-text-tertiary", children: "Cmd/Ctrl + E" }),
|
|
3367
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "Export session" })
|
|
3368
|
+
] }),
|
|
3369
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
3370
|
+
/* @__PURE__ */ t("kbd", { className: "px-1.5 py-0.5 bg-dt-bg-tertiary border border-dt-border-light rounded text-[10px] font-mono text-dt-text-tertiary", children: "Cmd/Ctrl + P" }),
|
|
3371
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-muted", children: "Pause/resume" })
|
|
3372
|
+
] })
|
|
3373
|
+
] })
|
|
3374
|
+
] }),
|
|
3375
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5", children: [
|
|
3376
|
+
/* @__PURE__ */ t("h4", { className: "text-[11px] font-semibold text-dt-text-secondary uppercase tracking-wider m-0 pb-1 border-b border-dt-border-light", children: "About" }),
|
|
3377
|
+
/* @__PURE__ */ n("p", { className: "m-0 text-[11px] text-dt-text-muted", children: [
|
|
3378
|
+
/* @__PURE__ */ t("span", { className: "text-dt-text-secondary font-semibold", children: "Concave DevTools" }),
|
|
3379
|
+
" ",
|
|
3380
|
+
/* @__PURE__ */ n("span", { children: [
|
|
3381
|
+
"v",
|
|
3382
|
+
ce
|
|
3383
|
+
] })
|
|
3384
|
+
] })
|
|
3385
|
+
] })
|
|
3386
|
+
] });
|
|
3387
|
+
}
|
|
3388
|
+
function Je({
|
|
3389
|
+
eventStore: e,
|
|
3390
|
+
position: r = "bottom-right",
|
|
3391
|
+
mode: a = "overlay",
|
|
3392
|
+
panelConnectionState: s
|
|
3393
|
+
}) {
|
|
3394
|
+
const d = a === "panel", [x, c] = z(() => {
|
|
3395
|
+
if (d) return !0;
|
|
3396
|
+
const u = Vt("concave-devtools-open");
|
|
3397
|
+
return u ? JSON.parse(u) : !0;
|
|
3398
|
+
}), [m, w] = z("activity"), [v, E] = z([]), [f, b] = z(!1);
|
|
3399
|
+
U(() => {
|
|
3400
|
+
const u = e.subscribe((i) => {
|
|
3401
|
+
E(e.getAllEvents()), b(e.isPausedState());
|
|
3402
|
+
});
|
|
3403
|
+
return E(e.getAllEvents()), b(e.isPausedState()), u;
|
|
3404
|
+
}, [e]), U(() => {
|
|
3405
|
+
d || Jt("concave-devtools-open", JSON.stringify(x));
|
|
3406
|
+
}, [x, d]);
|
|
3407
|
+
const N = J(() => {
|
|
3408
|
+
e.clear(), E([]);
|
|
3409
|
+
}, [e]), k = J(() => {
|
|
3410
|
+
c(!1);
|
|
3411
|
+
}, []), y = J(() => {
|
|
3412
|
+
const u = e.exportSession(), i = new Blob([JSON.stringify(u, null, 2)], {
|
|
3413
|
+
type: "application/json"
|
|
3414
|
+
}), C = URL.createObjectURL(i), I = document.createElement("a");
|
|
3415
|
+
I.href = C, I.download = `concave-devtools-${Date.now()}.json`, I.click(), URL.revokeObjectURL(C);
|
|
3416
|
+
}, [e]), S = J(() => {
|
|
3417
|
+
e.isPausedState() ? (e.resume(), b(!1)) : (e.pause(), b(!0));
|
|
3418
|
+
}, [e]);
|
|
3419
|
+
U(() => {
|
|
3420
|
+
const u = (i) => {
|
|
3421
|
+
if ((i.metaKey || i.ctrlKey) && i.shiftKey && i.key === "D") {
|
|
3422
|
+
i.preventDefault(), c((C) => !C);
|
|
3423
|
+
return;
|
|
3424
|
+
}
|
|
3425
|
+
Pt() && ((i.metaKey || i.ctrlKey) && i.key === "e" && (i.preventDefault(), y()), (i.metaKey || i.ctrlKey) && i.key === "p" && (i.preventDefault(), S()));
|
|
3426
|
+
};
|
|
3427
|
+
return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
|
|
3428
|
+
}, [N, y, S]);
|
|
3429
|
+
const $ = {
|
|
3430
|
+
"bottom-right": "bottom-4 right-4",
|
|
3431
|
+
"bottom-left": "bottom-4 left-4",
|
|
3432
|
+
"top-right": "top-4 right-4",
|
|
3433
|
+
"top-left": "top-4 left-4"
|
|
3434
|
+
}[r], P = v.filter(
|
|
3435
|
+
(u) => u.type === "query" || u.type === "mutation" || u.type === "action" || u.type === "auth"
|
|
3436
|
+
), M = e.getActiveSubscriptions().length, q = v.filter((u) => u.type === "log"), R = P.filter((u) => "status" in u && u.status === "error"), p = [
|
|
3437
|
+
{ id: "activity", label: "Activity", count: P.length, hasError: R.length > 0 },
|
|
3438
|
+
{ id: "subscriptions", label: "Subscriptions", count: M, hasError: !1 },
|
|
3439
|
+
{ id: "performance", label: "Performance", count: 0, hasError: !1 },
|
|
3440
|
+
{ id: "logs", label: "Logs", count: q.length, hasError: !1 },
|
|
3441
|
+
{ id: "settings", label: "Settings", count: 0, hasError: !1 }
|
|
3442
|
+
];
|
|
3443
|
+
return /* @__PURE__ */ n("div", { className: d ? "w-full h-full bg-dt-bg font-sans text-[13px] leading-normal text-dt-text-secondary antialiased" : `fixed z-[999999] font-sans text-[13px] leading-normal text-dt-text-secondary antialiased ${$}`, children: [
|
|
3444
|
+
!d && !x && /* @__PURE__ */ n(
|
|
3445
|
+
"button",
|
|
3446
|
+
{
|
|
3447
|
+
className: "flex items-center gap-2.5 px-[18px] py-3 bg-gradient-to-br from-zinc-900/[0.98] to-zinc-800/95 backdrop-blur-[20px] border border-dt-border rounded-[14px] text-dt-text-tertiary cursor-pointer shadow-lg relative overflow-hidden hover:scale-[1.02] hover:-translate-y-0.5 transition-all",
|
|
3448
|
+
onClick: () => c(!0),
|
|
3449
|
+
title: "Open Concave DevTools (Cmd/Ctrl+Shift+D)",
|
|
3450
|
+
"aria-label": "Open Concave DevTools",
|
|
3451
|
+
"aria-expanded": "false",
|
|
3452
|
+
children: [
|
|
3453
|
+
/* @__PURE__ */ n("svg", { width: "20", height: "20", viewBox: "0 0 32 32", fill: "none", children: [
|
|
3454
|
+
/* @__PURE__ */ t("rect", { width: "32", height: "32", rx: ye, fill: ve }),
|
|
3455
|
+
/* @__PURE__ */ t("path", { d: ke, fill: "white" })
|
|
3456
|
+
] }),
|
|
3457
|
+
R.length > 0 ? /* @__PURE__ */ t("span", { className: "bg-gradient-to-br from-red-500 to-red-600 text-white px-2 py-0.5 rounded-full text-[10px] font-bold tracking-wide shadow-md min-w-5 text-center", children: R.length }) : P.length > 0 ? /* @__PURE__ */ t("span", { className: "bg-gradient-to-br from-blue-500 to-blue-600 text-white px-2 py-0.5 rounded-full text-[10px] font-bold tracking-wide shadow-md min-w-5 text-center", children: P.length }) : null
|
|
3458
|
+
]
|
|
3459
|
+
}
|
|
3460
|
+
),
|
|
3461
|
+
(d || x) && /* @__PURE__ */ n("div", { className: d ? "w-full h-full bg-dt-bg flex flex-col overflow-hidden outline-none" : "w-[min(860px,calc(100vw-32px))] min-w-[300px] max-w-[calc(100vw-24px)] h-[min(620px,calc(100vh-32px))] min-h-[360px] max-h-[calc(100vh-24px)] bg-zinc-950/98 border border-dt-border rounded-2xl shadow-2xl flex flex-col overflow-hidden outline-none", role: "dialog", "aria-label": "Concave DevTools", "aria-modal": "false", tabIndex: -1, children: [
|
|
3462
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b border-dt-border px-0 bg-dt-bg-secondary", children: [
|
|
3463
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-0 flex-1 overflow-x-auto", role: "tablist", "aria-label": "DevTools panels", children: p.map((u) => /* @__PURE__ */ n(
|
|
3464
|
+
"button",
|
|
3465
|
+
{
|
|
3466
|
+
id: `tab-${u.id}`,
|
|
3467
|
+
className: d ? `px-3 py-[7px] bg-transparent border-none text-[12px] cursor-pointer transition-colors whitespace-nowrap border-b-2 ${m === u.id ? "text-dt-info border-b-dt-info" : "text-dt-text-tertiary border-b-transparent hover:text-dt-text-secondary hover:bg-white/5"}` : `px-3 py-[7px] bg-transparent border-none text-[12px] cursor-pointer transition-colors whitespace-nowrap border-b-2 ${m === u.id ? "text-dt-info border-b-dt-info" : "text-dt-text-tertiary border-b-transparent hover:text-dt-text-secondary hover:bg-white/5"}`,
|
|
3468
|
+
onClick: () => w(u.id),
|
|
3469
|
+
"aria-label": `${u.label} panel`,
|
|
3470
|
+
"aria-selected": m === u.id,
|
|
3471
|
+
role: "tab",
|
|
3472
|
+
"aria-controls": `panel-${u.id}`,
|
|
3473
|
+
children: [
|
|
3474
|
+
/* @__PURE__ */ t("span", { children: u.label }),
|
|
3475
|
+
u.count > 0 && /* @__PURE__ */ t("span", { className: d ? `ml-1.5 px-1.5 py-0 rounded-full text-[10px] font-medium ${u.hasError ? "bg-dt-error/20 text-dt-error" : "bg-dt-bg-tertiary text-dt-text-tertiary"}` : `ml-1.5 px-1.5 py-0 rounded-full text-[10px] font-medium ${u.hasError ? "bg-dt-error/20 text-dt-error" : "bg-dt-bg-tertiary text-dt-text-tertiary"}`, children: u.count })
|
|
3476
|
+
]
|
|
3477
|
+
},
|
|
3478
|
+
u.id
|
|
3479
|
+
)) }),
|
|
3480
|
+
/* @__PURE__ */ n("div", { className: d ? "flex items-center gap-0.5 ml-auto pr-1" : "flex items-center gap-1.5 ml-auto", role: "toolbar", "aria-label": "DevTools quick actions", children: [
|
|
3481
|
+
/* @__PURE__ */ t(
|
|
3482
|
+
"button",
|
|
3483
|
+
{
|
|
3484
|
+
type: "button",
|
|
3485
|
+
className: d ? `flex items-center justify-center w-7 h-7 p-0 bg-transparent border-none rounded cursor-pointer transition-colors hover:bg-white/10 ${f ? "text-dt-text-muted hover:text-dt-text-secondary" : "text-dt-error hover:text-dt-error"}` : `flex items-center justify-center w-7 h-7 p-0 bg-transparent border-none rounded-md cursor-pointer transition-all relative hover:bg-zinc-600/20 active:scale-[0.94] ${f ? "text-dt-text-muted hover:text-dt-text-secondary" : "text-dt-error bg-dt-error/10 hover:bg-dt-error/15 hover:text-dt-error"}`,
|
|
3486
|
+
onClick: S,
|
|
3487
|
+
title: f ? "Start recording (Cmd/Ctrl+P)" : "Stop recording (Cmd/Ctrl+P)",
|
|
3488
|
+
"aria-label": f ? "Start recording" : "Stop recording",
|
|
3489
|
+
"aria-pressed": !f,
|
|
3490
|
+
children: f ? /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t("circle", { cx: "8", cy: "8", r: "4.75", stroke: "currentColor", strokeWidth: "1.5" }) }) : /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ t("circle", { cx: "8", cy: "8", r: "4.75" }) })
|
|
3491
|
+
}
|
|
3492
|
+
),
|
|
3493
|
+
/* @__PURE__ */ t(
|
|
3494
|
+
"button",
|
|
3495
|
+
{
|
|
3496
|
+
type: "button",
|
|
3497
|
+
className: d ? "flex items-center justify-center w-7 h-7 p-0 bg-transparent border-none rounded text-dt-text-tertiary cursor-pointer transition-colors hover:bg-white/10 hover:text-dt-text-secondary" : "flex items-center justify-center w-7 h-7 p-0 bg-transparent border-none rounded-md text-dt-text-muted cursor-pointer transition-all relative hover:bg-zinc-600/20 hover:text-dt-text-secondary active:scale-[0.94]",
|
|
3498
|
+
onClick: y,
|
|
3499
|
+
title: "Export Session (Cmd/Ctrl+E)",
|
|
3500
|
+
"aria-label": "Export session",
|
|
3501
|
+
children: /* @__PURE__ */ n("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", children: [
|
|
3502
|
+
/* @__PURE__ */ t("path", { d: "M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z" }),
|
|
3503
|
+
/* @__PURE__ */ t("path", { d: "M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z" })
|
|
3504
|
+
] })
|
|
3505
|
+
}
|
|
3506
|
+
),
|
|
3507
|
+
/* @__PURE__ */ t(
|
|
3508
|
+
"button",
|
|
3509
|
+
{
|
|
3510
|
+
type: "button",
|
|
3511
|
+
className: d ? "flex items-center justify-center w-7 h-7 p-0 bg-transparent border-none rounded text-dt-text-tertiary cursor-pointer transition-colors hover:bg-white/10 hover:text-dt-text-secondary" : "flex items-center justify-center w-7 h-7 p-0 bg-transparent border-none rounded-md text-dt-text-muted cursor-pointer transition-all relative hover:bg-zinc-600/20 hover:text-dt-text-secondary active:scale-[0.94]",
|
|
3512
|
+
onClick: N,
|
|
3513
|
+
title: "Clear all data",
|
|
3514
|
+
"aria-label": "Clear all data",
|
|
3515
|
+
children: /* @__PURE__ */ n("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
3516
|
+
/* @__PURE__ */ t("circle", { cx: "8", cy: "8", r: "5.5", stroke: "currentColor", strokeWidth: "1.2" }),
|
|
3517
|
+
/* @__PURE__ */ t("path", { d: "M4.5 11.5 11.5 4.5", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" })
|
|
3518
|
+
] })
|
|
3519
|
+
}
|
|
3520
|
+
),
|
|
3521
|
+
!d && /* @__PURE__ */ t(
|
|
3522
|
+
"button",
|
|
3523
|
+
{
|
|
3524
|
+
type: "button",
|
|
3525
|
+
className: "flex items-center justify-center w-7 h-7 p-0 bg-transparent border-none rounded-md text-dt-text-muted cursor-pointer transition-all relative hover:bg-red-500/15 hover:text-dt-error active:scale-[0.94]",
|
|
3526
|
+
onClick: k,
|
|
3527
|
+
title: "Close (Cmd/Ctrl+Shift+D)",
|
|
3528
|
+
"aria-label": "Close DevTools",
|
|
3529
|
+
children: /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" }) })
|
|
3530
|
+
}
|
|
3531
|
+
)
|
|
3532
|
+
] })
|
|
3533
|
+
] }),
|
|
3534
|
+
/* @__PURE__ */ n("div", { className: "flex-1 min-h-0 flex flex-col", children: [
|
|
3535
|
+
m === "activity" && /* @__PURE__ */ t("div", { id: "panel-activity", className: "flex-1 min-h-0 flex flex-col", role: "tabpanel", "aria-labelledby": "tab-activity", children: /* @__PURE__ */ t(qe, { eventStore: e, panelConnectionState: d ? s : void 0 }) }),
|
|
3536
|
+
m === "subscriptions" && /* @__PURE__ */ t("div", { id: "panel-subscriptions", className: "flex-1 min-h-0 flex flex-col", role: "tabpanel", "aria-labelledby": "tab-subscriptions", children: /* @__PURE__ */ t(Oe, { eventStore: e }) }),
|
|
3537
|
+
m === "performance" && /* @__PURE__ */ t("div", { id: "panel-performance", className: "flex-1 min-h-0 flex flex-col", role: "tabpanel", "aria-labelledby": "tab-performance", children: /* @__PURE__ */ t(Fe, { eventStore: e, onNavigate: w }) }),
|
|
3538
|
+
m === "logs" && /* @__PURE__ */ t("div", { id: "panel-logs", className: "flex-1 min-h-0 flex flex-col", role: "tabpanel", "aria-labelledby": "tab-logs", children: /* @__PURE__ */ t(Be, { eventStore: e, onNavigate: w }) }),
|
|
3539
|
+
m === "settings" && /* @__PURE__ */ t("div", { id: "panel-settings", className: "flex-1 min-h-0 flex flex-col", role: "tabpanel", "aria-labelledby": "tab-settings", children: /* @__PURE__ */ t(Ve, { eventStore: e }) })
|
|
3540
|
+
] })
|
|
3541
|
+
] })
|
|
3542
|
+
] });
|
|
3543
|
+
}
|
|
3544
|
+
const Ue = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:"Fira Code","Monaco","Consolas",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-400:oklch(85.2% .199 91.936);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-white:#fff;--spacing:.25rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-lg:16px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-dt-bg:#121214fa;--color-dt-bg-secondary:#18181bf2;--color-dt-bg-tertiary:#27272a99;--color-dt-border:#3f3f4699;--color-dt-border-light:#3f3f4666;--color-dt-text:#f4f4f5;--color-dt-text-secondary:#e4e4e7;--color-dt-text-tertiary:#a1a1aa;--color-dt-text-muted:#71717a;--color-dt-success:#22c55e;--color-dt-error:#ef4444;--color-dt-warning:#f59e0b;--color-dt-info:#3b82f6;--color-dt-query:#60a5fa;--color-dt-mutation:#a78bfa;--color-dt-action:#34d399}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-y-0{inset-block:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-0\\.5{top:calc(var(--spacing)*.5)}.top-1\\/2{top:50%}.top-4{top:calc(var(--spacing)*4)}.right-1\\.5{right:calc(var(--spacing)*1.5)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-4{left:calc(var(--spacing)*4)}.z-\\[2\\]{z-index:2}.z-\\[999999\\]{z-index:999999}.z-\\[9999999\\]{z-index:9999999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mx-0\\.5{margin-inline:calc(var(--spacing)*.5)}.my-0\\.5{margin-block:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mr-1{margin-right:calc(var(--spacing)*1)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-1\\.5{margin-left:calc(var(--spacing)*1.5)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-\\[16px\\]{height:16px}.h-\\[min\\(620px\\,calc\\(100vh-32px\\)\\)\\]{height:min(620px,100vh - 32px)}.h-full{height:100%}.max-h-\\[80px\\]{max-height:80px}.max-h-\\[100px\\]{max-height:100px}.max-h-\\[150px\\]{max-height:150px}.max-h-\\[180px\\]{max-height:180px}.max-h-\\[200px\\]{max-height:200px}.max-h-\\[calc\\(100vh-24px\\)\\]{max-height:calc(100vh - 24px)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\\[360px\\]{min-height:360px}.min-h-px{min-height:1px}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-7{width:calc(var(--spacing)*7)}.w-10{width:calc(var(--spacing)*10)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-\\[300px\\]{width:300px}.w-\\[min\\(58vw\\,620px\\)\\]{width:min(58vw,620px)}.w-\\[min\\(860px\\,calc\\(100vw-32px\\)\\)\\]{width:min(860px,100vw - 32px)}.w-full{width:100%}.w-px{width:1px}.max-w-\\[20\\%\\]{max-width:20%}.max-w-\\[38\\%\\]{max-width:38%}.max-w-\\[44\\%\\]{max-width:44%}.max-w-\\[150px\\]{max-width:150px}.max-w-\\[180px\\]{max-width:180px}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[360px\\]{max-width:360px}.max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.max-w-\\[min\\(58vw\\,680px\\)\\]{max-width:min(58vw,680px)}.max-w-\\[min\\(62vw\\,760px\\)\\]{max-width:min(62vw,760px)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-5{min-width:calc(var(--spacing)*5)}.min-w-\\[120px\\]{min-width:120px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[300px\\]{min-width:300px}.min-w-\\[420px\\]{min-width:420px}.min-w-\\[820px\\]{min-width:820px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-150{--tw-scale-x:150%;--tw-scale-y:150%;--tw-scale-z:150%;scale:var(--tw-scale-x)var(--tw-scale-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-\\[dt-fade-in_0\\.1s_ease-out\\]{animation:.1s ease-out dt-fade-in}.animate-\\[dt-fade-in_0\\.15s_ease-out\\]{animation:.15s ease-out dt-fade-in}.animate-\\[dt-slide-in_0\\.2s_ease-out\\]{animation:.2s ease-out dt-slide-in}.animate-pulse{animation:var(--animate-pulse)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-\\[3px\\]{gap:3px}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-\\[3px\\]>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(3px*var(--tw-space-y-reverse));margin-block-end:calc(3px*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-sm{border-top-left-radius:var(--radius-sm);border-top-right-radius:var(--radius-sm)}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-dt-border{border-color:var(--color-dt-border)}.border-dt-border-light{border-color:var(--color-dt-border-light)}.border-dt-border-light\\/30{border-color:#3f3f461f}@supports (color:color-mix(in lab,red,red)){.border-dt-border-light\\/30{border-color:color-mix(in oklab,var(--color-dt-border-light)30%,transparent)}}.border-dt-border-light\\/40{border-color:#3f3f4629}@supports (color:color-mix(in lab,red,red)){.border-dt-border-light\\/40{border-color:color-mix(in oklab,var(--color-dt-border-light)40%,transparent)}}.border-dt-border-light\\/50{border-color:#3f3f4633}@supports (color:color-mix(in lab,red,red)){.border-dt-border-light\\/50{border-color:color-mix(in oklab,var(--color-dt-border-light)50%,transparent)}}.border-dt-error\\/30{border-color:#ef44444d}@supports (color:color-mix(in lab,red,red)){.border-dt-error\\/30{border-color:color-mix(in oklab,var(--color-dt-error)30%,transparent)}}.border-dt-error\\/40{border-color:#ef444466}@supports (color:color-mix(in lab,red,red)){.border-dt-error\\/40{border-color:color-mix(in oklab,var(--color-dt-error)40%,transparent)}}.border-dt-info\\/20{border-color:#3b82f633}@supports (color:color-mix(in lab,red,red)){.border-dt-info\\/20{border-color:color-mix(in oklab,var(--color-dt-info)20%,transparent)}}.border-dt-info\\/30{border-color:#3b82f64d}@supports (color:color-mix(in lab,red,red)){.border-dt-info\\/30{border-color:color-mix(in oklab,var(--color-dt-info)30%,transparent)}}.border-dt-mutation\\/20{border-color:#a78bfa33}@supports (color:color-mix(in lab,red,red)){.border-dt-mutation\\/20{border-color:color-mix(in oklab,var(--color-dt-mutation)20%,transparent)}}.border-dt-success\\/30{border-color:#22c55e4d}@supports (color:color-mix(in lab,red,red)){.border-dt-success\\/30{border-color:color-mix(in oklab,var(--color-dt-success)30%,transparent)}}.border-dt-warning\\/20{border-color:#f59e0b33}@supports (color:color-mix(in lab,red,red)){.border-dt-warning\\/20{border-color:color-mix(in oklab,var(--color-dt-warning)20%,transparent)}}.border-dt-warning\\/30{border-color:#f59e0b4d}@supports (color:color-mix(in lab,red,red)){.border-dt-warning\\/30{border-color:color-mix(in oklab,var(--color-dt-warning)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700\\/30{border-color:#3f3f464d}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/30{border-color:color-mix(in oklab,var(--color-zinc-700)30%,transparent)}}.border-b-dt-info{border-bottom-color:var(--color-dt-info)}.border-b-transparent{border-bottom-color:#0000}.border-l-dt-error\\/40{border-left-color:#ef444466}@supports (color:color-mix(in lab,red,red)){.border-l-dt-error\\/40{border-left-color:color-mix(in oklab,var(--color-dt-error)40%,transparent)}}.border-l-dt-query\\/30{border-left-color:#60a5fa4d}@supports (color:color-mix(in lab,red,red)){.border-l-dt-query\\/30{border-left-color:color-mix(in oklab,var(--color-dt-query)30%,transparent)}}.bg-dt-action{background-color:var(--color-dt-action)}.bg-dt-action\\/20{background-color:#34d39933}@supports (color:color-mix(in lab,red,red)){.bg-dt-action\\/20{background-color:color-mix(in oklab,var(--color-dt-action)20%,transparent)}}.bg-dt-action\\/25{background-color:#34d39940}@supports (color:color-mix(in lab,red,red)){.bg-dt-action\\/25{background-color:color-mix(in oklab,var(--color-dt-action)25%,transparent)}}.bg-dt-bg{background-color:var(--color-dt-bg)}.bg-dt-bg-secondary{background-color:var(--color-dt-bg-secondary)}.bg-dt-bg-secondary\\/30{background-color:#18181b49}@supports (color:color-mix(in lab,red,red)){.bg-dt-bg-secondary\\/30{background-color:color-mix(in oklab,var(--color-dt-bg-secondary)30%,transparent)}}.bg-dt-bg-secondary\\/50{background-color:#18181b79}@supports (color:color-mix(in lab,red,red)){.bg-dt-bg-secondary\\/50{background-color:color-mix(in oklab,var(--color-dt-bg-secondary)50%,transparent)}}.bg-dt-bg-secondary\\/85{background-color:#18181bce}@supports (color:color-mix(in lab,red,red)){.bg-dt-bg-secondary\\/85{background-color:color-mix(in oklab,var(--color-dt-bg-secondary)85%,transparent)}}.bg-dt-bg-tertiary{background-color:var(--color-dt-bg-tertiary)}.bg-dt-bg-tertiary\\/30{background-color:#27272a2e}@supports (color:color-mix(in lab,red,red)){.bg-dt-bg-tertiary\\/30{background-color:color-mix(in oklab,var(--color-dt-bg-tertiary)30%,transparent)}}.bg-dt-bg-tertiary\\/35{background-color:#27272a36}@supports (color:color-mix(in lab,red,red)){.bg-dt-bg-tertiary\\/35{background-color:color-mix(in oklab,var(--color-dt-bg-tertiary)35%,transparent)}}.bg-dt-bg-tertiary\\/40{background-color:#27272a3d}@supports (color:color-mix(in lab,red,red)){.bg-dt-bg-tertiary\\/40{background-color:color-mix(in oklab,var(--color-dt-bg-tertiary)40%,transparent)}}.bg-dt-bg-tertiary\\/50{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-dt-bg-tertiary\\/50{background-color:color-mix(in oklab,var(--color-dt-bg-tertiary)50%,transparent)}}.bg-dt-error{background-color:var(--color-dt-error)}.bg-dt-error\\/5{background-color:#ef44440d}@supports (color:color-mix(in lab,red,red)){.bg-dt-error\\/5{background-color:color-mix(in oklab,var(--color-dt-error)5%,transparent)}}.bg-dt-error\\/10{background-color:#ef44441a}@supports (color:color-mix(in lab,red,red)){.bg-dt-error\\/10{background-color:color-mix(in oklab,var(--color-dt-error)10%,transparent)}}.bg-dt-error\\/15{background-color:#ef444426}@supports (color:color-mix(in lab,red,red)){.bg-dt-error\\/15{background-color:color-mix(in oklab,var(--color-dt-error)15%,transparent)}}.bg-dt-error\\/20{background-color:#ef444433}@supports (color:color-mix(in lab,red,red)){.bg-dt-error\\/20{background-color:color-mix(in oklab,var(--color-dt-error)20%,transparent)}}.bg-dt-error\\/25{background-color:#ef444440}@supports (color:color-mix(in lab,red,red)){.bg-dt-error\\/25{background-color:color-mix(in oklab,var(--color-dt-error)25%,transparent)}}.bg-dt-info\\/5{background-color:#3b82f60d}@supports (color:color-mix(in lab,red,red)){.bg-dt-info\\/5{background-color:color-mix(in oklab,var(--color-dt-info)5%,transparent)}}.bg-dt-info\\/10{background-color:#3b82f61a}@supports (color:color-mix(in lab,red,red)){.bg-dt-info\\/10{background-color:color-mix(in oklab,var(--color-dt-info)10%,transparent)}}.bg-dt-info\\/15{background-color:#3b82f626}@supports (color:color-mix(in lab,red,red)){.bg-dt-info\\/15{background-color:color-mix(in oklab,var(--color-dt-info)15%,transparent)}}.bg-dt-info\\/20{background-color:#3b82f633}@supports (color:color-mix(in lab,red,red)){.bg-dt-info\\/20{background-color:color-mix(in oklab,var(--color-dt-info)20%,transparent)}}.bg-dt-mutation{background-color:var(--color-dt-mutation)}.bg-dt-mutation\\/10{background-color:#a78bfa1a}@supports (color:color-mix(in lab,red,red)){.bg-dt-mutation\\/10{background-color:color-mix(in oklab,var(--color-dt-mutation)10%,transparent)}}.bg-dt-mutation\\/20{background-color:#a78bfa33}@supports (color:color-mix(in lab,red,red)){.bg-dt-mutation\\/20{background-color:color-mix(in oklab,var(--color-dt-mutation)20%,transparent)}}.bg-dt-mutation\\/25{background-color:#a78bfa40}@supports (color:color-mix(in lab,red,red)){.bg-dt-mutation\\/25{background-color:color-mix(in oklab,var(--color-dt-mutation)25%,transparent)}}.bg-dt-query{background-color:var(--color-dt-query)}.bg-dt-query\\/20{background-color:#60a5fa33}@supports (color:color-mix(in lab,red,red)){.bg-dt-query\\/20{background-color:color-mix(in oklab,var(--color-dt-query)20%,transparent)}}.bg-dt-query\\/25{background-color:#60a5fa40}@supports (color:color-mix(in lab,red,red)){.bg-dt-query\\/25{background-color:color-mix(in oklab,var(--color-dt-query)25%,transparent)}}.bg-dt-query\\/\\[0\\.02\\]{background-color:#60a5fa05}@supports (color:color-mix(in lab,red,red)){.bg-dt-query\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-dt-query)2%,transparent)}}.bg-dt-success{background-color:var(--color-dt-success)}.bg-dt-success\\/5{background-color:#22c55e0d}@supports (color:color-mix(in lab,red,red)){.bg-dt-success\\/5{background-color:color-mix(in oklab,var(--color-dt-success)5%,transparent)}}.bg-dt-success\\/15{background-color:#22c55e26}@supports (color:color-mix(in lab,red,red)){.bg-dt-success\\/15{background-color:color-mix(in oklab,var(--color-dt-success)15%,transparent)}}.bg-dt-success\\/20{background-color:#22c55e33}@supports (color:color-mix(in lab,red,red)){.bg-dt-success\\/20{background-color:color-mix(in oklab,var(--color-dt-success)20%,transparent)}}.bg-dt-warning{background-color:var(--color-dt-warning)}.bg-dt-warning\\/5{background-color:#f59e0b0d}@supports (color:color-mix(in lab,red,red)){.bg-dt-warning\\/5{background-color:color-mix(in oklab,var(--color-dt-warning)5%,transparent)}}.bg-dt-warning\\/15{background-color:#f59e0b26}@supports (color:color-mix(in lab,red,red)){.bg-dt-warning\\/15{background-color:color-mix(in oklab,var(--color-dt-warning)15%,transparent)}}.bg-dt-warning\\/20{background-color:#f59e0b33}@supports (color:color-mix(in lab,red,red)){.bg-dt-warning\\/20{background-color:color-mix(in oklab,var(--color-dt-warning)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white\\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\\/55{background-color:#ffffff8c}@supports (color:color-mix(in lab,red,red)){.bg-white\\/55{background-color:color-mix(in oklab,var(--color-white)55%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-white\\/\\[0\\.06\\]{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.06\\]{background-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.bg-white\\/\\[0\\.08\\]{background-color:#ffffff14}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-white)8%,transparent)}}.bg-yellow-400\\/25{background-color:#fac80040}@supports (color:color-mix(in lab,red,red)){.bg-yellow-400\\/25{background-color:color-mix(in oklab,var(--color-yellow-400)25%,transparent)}}.bg-yellow-400\\/30{background-color:#fac8004d}@supports (color:color-mix(in lab,red,red)){.bg-yellow-400\\/30{background-color:color-mix(in oklab,var(--color-yellow-400)30%,transparent)}}.bg-zinc-500\\/25{background-color:#71717b40}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\\/25{background-color:color-mix(in oklab,var(--color-zinc-500)25%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/\\[0\\.98\\]{background-color:#18181bfa}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/\\[0\\.98\\]{background-color:color-mix(in oklab,var(--color-zinc-900)98%,transparent)}}.bg-zinc-950\\/50{background-color:#09090b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/50{background-color:color-mix(in oklab,var(--color-zinc-950)50%,transparent)}}.bg-zinc-950\\/98{background-color:#09090bfa}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/98{background-color:color-mix(in oklab,var(--color-zinc-950)98%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-red-500{--tw-gradient-from:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-zinc-900\\/\\[0\\.98\\]{--tw-gradient-from:#18181bfa}@supports (color:color-mix(in lab,red,red)){.from-zinc-900\\/\\[0\\.98\\]{--tw-gradient-from:color-mix(in oklab,var(--color-zinc-900)98%,transparent)}}.from-zinc-900\\/\\[0\\.98\\]{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-blue-600{--tw-gradient-to:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-red-600{--tw-gradient-to:var(--color-red-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-zinc-800\\/95{--tw-gradient-to:#27272af2}@supports (color:color-mix(in lab,red,red)){.to-zinc-800\\/95{--tw-gradient-to:color-mix(in oklab,var(--color-zinc-800)95%,transparent)}}.to-zinc-800\\/95{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-0{padding:calc(var(--spacing)*0)}.p-0\\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-\\[3px\\]{padding:3px}.px-0{padding-inline:calc(var(--spacing)*0)}.px-0\\.5{padding-inline:calc(var(--spacing)*.5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-\\[18px\\]{padding-inline:18px}.px-px{padding-inline:1px}.py-0{padding-block:calc(var(--spacing)*0)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-12{padding-block:calc(var(--spacing)*12)}.py-\\[2px\\]{padding-block:2px}.py-\\[7px\\]{padding-block:7px}.py-px{padding-block:1px}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-7{padding-right:calc(var(--spacing)*7)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-dt-action{color:var(--color-dt-action)}.text-dt-border{color:var(--color-dt-border)}.text-dt-error{color:var(--color-dt-error)}.text-dt-info{color:var(--color-dt-info)}.text-dt-info\\/90{color:#3b82f6e6}@supports (color:color-mix(in lab,red,red)){.text-dt-info\\/90{color:color-mix(in oklab,var(--color-dt-info)90%,transparent)}}.text-dt-mutation{color:var(--color-dt-mutation)}.text-dt-mutation\\/70{color:#a78bfab3}@supports (color:color-mix(in lab,red,red)){.text-dt-mutation\\/70{color:color-mix(in oklab,var(--color-dt-mutation)70%,transparent)}}.text-dt-query{color:var(--color-dt-query)}.text-dt-success{color:var(--color-dt-success)}.text-dt-text{color:var(--color-dt-text)}.text-dt-text-muted{color:var(--color-dt-text-muted)}.text-dt-text-muted\\/40{color:#71717a66}@supports (color:color-mix(in lab,red,red)){.text-dt-text-muted\\/40{color:color-mix(in oklab,var(--color-dt-text-muted)40%,transparent)}}.text-dt-text-muted\\/60{color:#71717a99}@supports (color:color-mix(in lab,red,red)){.text-dt-text-muted\\/60{color:color-mix(in oklab,var(--color-dt-text-muted)60%,transparent)}}.text-dt-text-muted\\/70{color:#71717ab3}@supports (color:color-mix(in lab,red,red)){.text-dt-text-muted\\/70{color:color-mix(in oklab,var(--color-dt-text-muted)70%,transparent)}}.text-dt-text-muted\\/80{color:#71717acc}@supports (color:color-mix(in lab,red,red)){.text-dt-text-muted\\/80{color:color-mix(in oklab,var(--color-dt-text-muted)80%,transparent)}}.text-dt-text-muted\\/85{color:#71717ad9}@supports (color:color-mix(in lab,red,red)){.text-dt-text-muted\\/85{color:color-mix(in oklab,var(--color-dt-text-muted)85%,transparent)}}.text-dt-text-muted\\/90{color:#71717ae6}@supports (color:color-mix(in lab,red,red)){.text-dt-text-muted\\/90{color:color-mix(in oklab,var(--color-dt-text-muted)90%,transparent)}}.text-dt-text-secondary{color:var(--color-dt-text-secondary)}.text-dt-text-tertiary{color:var(--color-dt-text-tertiary)}.text-dt-warning{color:var(--color-dt-warning)}.text-dt-warning\\/90{color:#f59e0be6}@supports (color:color-mix(in lab,red,red)){.text-dt-warning\\/90{color:color-mix(in oklab,var(--color-dt-warning)90%,transparent)}}.text-inherit{color:inherit}.text-white{color:var(--color-white)}.text-yellow-200{color:var(--color-yellow-200)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-dt-text-muted\\/40::placeholder{color:#71717a66}@supports (color:color-mix(in lab,red,red)){.placeholder-dt-text-muted\\/40::placeholder{color:color-mix(in oklab,var(--color-dt-text-muted)40%,transparent)}}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(52\\,211\\,153\\,0\\.5\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#34d39980);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(96\\,165\\,250\\,0\\.5\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(161\\,161\\,170\\,0\\.4\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#a1a1aa66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(167\\,139\\,250\\,0\\.5\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#a78bfa80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(52\\,211\\,153\\,0\\.35\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#34d39959);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(96\\,165\\,250\\,0\\.35\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#60a5fa59);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(167\\,139\\,250\\,0\\.35\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#a78bfa59);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(245\\,158\\,11\\,0\\.35\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#f59e0b59);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-dt-info{--tw-ring-color:var(--color-dt-info)}.outline,.outline-1{outline-style:var(--tw-outline-style);outline-width:1px}.-outline-offset-1{outline-offset:-1px}.outline-dt-info\\/30{outline-color:#3b82f64d}@supports (color:color-mix(in lab,red,red)){.outline-dt-info\\/30{outline-color:color-mix(in oklab,var(--color-dt-info)30%,transparent)}}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-\\[20px\\]{--tw-backdrop-blur:blur(20px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.placeholder\\:text-dt-text-muted\\/50::placeholder{color:#71717a80}@supports (color:color-mix(in lab,red,red)){.placeholder\\:text-dt-text-muted\\/50::placeholder{color:color-mix(in oklab,var(--color-dt-text-muted)50%,transparent)}}@media(hover:hover){.hover\\:-translate-y-0\\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\\:scale-150:hover{--tw-scale-x:150%;--tw-scale-y:150%;--tw-scale-z:150%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-dt-border:hover{border-color:var(--color-dt-border)}.hover\\:border-dt-border-light:hover{border-color:var(--color-dt-border-light)}.hover\\:border-dt-error\\/30:hover{border-color:#ef44444d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-dt-error\\/30:hover{border-color:color-mix(in oklab,var(--color-dt-error)30%,transparent)}}.hover\\:border-dt-info\\/30:hover{border-color:#3b82f64d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-dt-info\\/30:hover{border-color:color-mix(in oklab,var(--color-dt-info)30%,transparent)}}.hover\\:bg-dt-action\\/15:hover{background-color:#34d39926}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-action\\/15:hover{background-color:color-mix(in oklab,var(--color-dt-action)15%,transparent)}}.hover\\:bg-dt-error\\/15:hover{background-color:#ef444426}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-error\\/15:hover{background-color:color-mix(in oklab,var(--color-dt-error)15%,transparent)}}.hover\\:bg-dt-error\\/25:hover{background-color:#ef444440}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-error\\/25:hover{background-color:color-mix(in oklab,var(--color-dt-error)25%,transparent)}}.hover\\:bg-dt-info\\/15:hover{background-color:#3b82f626}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-info\\/15:hover{background-color:color-mix(in oklab,var(--color-dt-info)15%,transparent)}}.hover\\:bg-dt-info\\/25:hover{background-color:#3b82f640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-info\\/25:hover{background-color:color-mix(in oklab,var(--color-dt-info)25%,transparent)}}.hover\\:bg-dt-mutation\\/15:hover{background-color:#a78bfa26}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-mutation\\/15:hover{background-color:color-mix(in oklab,var(--color-dt-mutation)15%,transparent)}}.hover\\:bg-dt-mutation\\/20:hover{background-color:#a78bfa33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-mutation\\/20:hover{background-color:color-mix(in oklab,var(--color-dt-mutation)20%,transparent)}}.hover\\:bg-dt-query\\/15:hover{background-color:#60a5fa26}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-query\\/15:hover{background-color:color-mix(in oklab,var(--color-dt-query)15%,transparent)}}.hover\\:bg-dt-success\\/25:hover{background-color:#22c55e40}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-success\\/25:hover{background-color:color-mix(in oklab,var(--color-dt-success)25%,transparent)}}.hover\\:bg-dt-warning\\/15:hover{background-color:#f59e0b26}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-warning\\/15:hover{background-color:color-mix(in oklab,var(--color-dt-warning)15%,transparent)}}.hover\\:bg-dt-warning\\/25:hover{background-color:#f59e0b40}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-dt-warning\\/25:hover{background-color:color-mix(in oklab,var(--color-dt-warning)25%,transparent)}}.hover\\:bg-red-500\\/15:hover{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/15:hover{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.hover\\:bg-white\\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\\:bg-white\\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/10:hover{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-white\\/\\[0\\.03\\]:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.hover\\:bg-white\\/\\[0\\.04\\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.04\\]:hover{background-color:color-mix(in oklab,var(--color-white)4%,transparent)}}.hover\\:bg-white\\/\\[0\\.06\\]:hover{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.06\\]:hover{background-color:color-mix(in oklab,var(--color-white)6%,transparent)}}.hover\\:bg-zinc-600\\/20:hover{background-color:#52525c33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-600\\/20:hover{background-color:color-mix(in oklab,var(--color-zinc-600)20%,transparent)}}.hover\\:text-dt-action:hover{color:var(--color-dt-action)}.hover\\:text-dt-error:hover{color:var(--color-dt-error)}.hover\\:text-dt-info:hover{color:var(--color-dt-info)}.hover\\:text-dt-mutation:hover{color:var(--color-dt-mutation)}.hover\\:text-dt-query:hover{color:var(--color-dt-query)}.hover\\:text-dt-text-secondary:hover{color:var(--color-dt-text-secondary)}.hover\\:text-dt-text-tertiary:hover{color:var(--color-dt-text-tertiary)}.hover\\:text-dt-warning:hover{color:var(--color-dt-warning)}}.focus\\:border-dt-info\\/40:focus{border-color:#3b82f666}@supports (color:color-mix(in lab,red,red)){.focus\\:border-dt-info\\/40:focus{border-color:color-mix(in oklab,var(--color-dt-info)40%,transparent)}}.focus\\:border-dt-info\\/50:focus{border-color:#3b82f680}@supports (color:color-mix(in lab,red,red)){.focus\\:border-dt-info\\/50:focus{border-color:color-mix(in oklab,var(--color-dt-info)50%,transparent)}}.focus\\:bg-dt-bg-tertiary:focus{background-color:var(--color-dt-bg-tertiary)}.focus\\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-dt-info\\/40:focus{--tw-ring-color:#3b82f666}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-dt-info\\/40:focus{--tw-ring-color:color-mix(in oklab,var(--color-dt-info)40%,transparent)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:scale-\\[0\\.94\\]:active{scale:.94}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-40:disabled{opacity:.4}@media(hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}.disabled\\:hover\\:text-dt-text-muted:disabled:hover{color:var(--color-dt-text-muted)}}@media(min-width:40rem){.sm\\:inline-flex{display:inline-flex}}.\\[\\&\\:\\:-webkit-search-cancel-button\\]\\:hidden::-webkit-search-cancel-button{display:none}}@keyframes dt-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes dt-slide-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}html{color-scheme:dark;background-color:#121214}:host{--sb-thumb:#71717a80;--sb-track:transparent}*{scrollbar-width:thin;scrollbar-color:var(--sb-thumb)var(--sb-track)}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--sb-track)}::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:3px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';
|
|
3545
|
+
function Ke(e = {}) {
|
|
3546
|
+
if (window.__concaveDevToolsInstalled) {
|
|
3547
|
+
console.warn("[DevTools] Already initialized");
|
|
3548
|
+
return;
|
|
3549
|
+
}
|
|
3550
|
+
window.__concaveDevToolsInstalled = !0, console.log("[DevTools] Initializing UI...");
|
|
3551
|
+
const r = we(), a = window.__concaveDevToolsEvents || [];
|
|
3552
|
+
console.log(`[DevTools] Loading ${a.length} captured events`), a.forEach((x) => {
|
|
3553
|
+
r.addEvent(x);
|
|
3554
|
+
});
|
|
3555
|
+
let s = a.length;
|
|
3556
|
+
setInterval(() => {
|
|
3557
|
+
const x = window.__concaveDevToolsEvents || [];
|
|
3558
|
+
x.length > s && (x.slice(s).forEach((m) => {
|
|
3559
|
+
r.addEvent(m);
|
|
3560
|
+
}), s = x.length);
|
|
3561
|
+
}, 100);
|
|
3562
|
+
const d = () => {
|
|
3563
|
+
const x = document.createElement("div");
|
|
3564
|
+
x.id = "concave-devtools-host", x.style.cssText = "position:fixed;z-index:999999;bottom:16px;right:16px;pointer-events:none;", document.body.appendChild(x);
|
|
3565
|
+
const c = x.attachShadow({ mode: "open" }), m = document.createElement("style");
|
|
3566
|
+
m.textContent = Ue, c.appendChild(m);
|
|
3567
|
+
const w = document.createElement("div");
|
|
3568
|
+
w.id = "concave-devtools-root", w.style.cssText = "pointer-events:auto;", c.appendChild(w), he(w).render(/* @__PURE__ */ t(Je, { eventStore: r, position: e.position })), console.log("[DevTools] UI mounted successfully");
|
|
3569
|
+
};
|
|
3570
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", d) : d(), window.__concaveDevTools = {
|
|
3571
|
+
eventStore: r
|
|
3572
|
+
};
|
|
3573
|
+
}
|
|
3574
|
+
if (typeof window < "u") {
|
|
3575
|
+
const e = window.__concaveDevToolsConfig || {};
|
|
3576
|
+
e.autoInit !== !1 && setTimeout(() => {
|
|
3577
|
+
Ke(e);
|
|
3578
|
+
}, 100);
|
|
3579
|
+
}
|
|
3580
|
+
export {
|
|
3581
|
+
Je as D,
|
|
3582
|
+
Nt as E,
|
|
3583
|
+
Be as L,
|
|
3584
|
+
Fe as P,
|
|
3585
|
+
Oe as S,
|
|
3586
|
+
Ve as a,
|
|
3587
|
+
Et as b,
|
|
3588
|
+
we as g,
|
|
3589
|
+
Ke as i
|
|
3590
|
+
};
|