react-semaphor 0.1.387 → 0.1.389
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/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +260 -99
- package/dist/data-app-sdk/index.cjs +39 -5
- package/dist/data-app-sdk/index.js +1570 -1358
- package/dist/types/analytics-protocol.d.ts +125 -0
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { toSemaphorInputSnapshots as
|
|
2
|
-
import { jsxs as p, Fragment as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { M as
|
|
5
|
-
import { X as
|
|
6
|
-
import { b as
|
|
1
|
+
import { toSemaphorInputSnapshots as Tr, toSemaphorInputBinding as kr, toSemaphorActiveInputSnapshots as Y, toSemaphorMatrixIntent as Cr, toSemaphorSqlIntent as Dr, toSemaphorInputOptionsIntent as Lr, toSemaphorRecordsIntent as Or, toSemaphorAnalysisQueryOptions as Br, toSemaphorAnalysisIntent as Kr, toSemaphorMetricIntent as Nr, hasSemaphorInputValue as oe, normalizeSemaphorInputOptions as nr, toSemaphorInputSpec as ir } from "../data-app-sdk-adapters/index.js";
|
|
2
|
+
import { jsxs as p, Fragment as or, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as ye, useContext as Q, useState as V, useRef as D, useEffect as K, useMemo as b, Fragment as $r, useId as sr, useCallback as O, useReducer as Wr } from "react";
|
|
4
|
+
import { M as Fr, a as _r, S as zr, E as Hr } from "../chunks/search-0LmWwZzW.js";
|
|
5
|
+
import { X as Mr, j as jr } from "../chunks/x-IdR_js6f.js";
|
|
6
|
+
import { b as Pr } from "../chunks/validators-CHPH6ORs.js";
|
|
7
7
|
import "../chunks/analyze-result-contract-DuhlklhI.js";
|
|
8
|
-
function
|
|
8
|
+
function le(e, r, t = {}) {
|
|
9
9
|
return {
|
|
10
|
-
...
|
|
10
|
+
...t,
|
|
11
11
|
name: e,
|
|
12
|
-
role:
|
|
12
|
+
role: r
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ri(e) {
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function ti(e) {
|
|
19
19
|
return e;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const ni = {
|
|
22
22
|
source: {
|
|
23
23
|
semantic(e) {
|
|
24
24
|
return {
|
|
@@ -34,17 +34,17 @@ const Gn = {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
field: {
|
|
37
|
-
measure(e,
|
|
38
|
-
return
|
|
37
|
+
measure(e, r) {
|
|
38
|
+
return le(e, "measure", r);
|
|
39
39
|
},
|
|
40
|
-
dimension(e,
|
|
41
|
-
return
|
|
40
|
+
dimension(e, r) {
|
|
41
|
+
return le(e, "dimension", r);
|
|
42
42
|
},
|
|
43
|
-
date(e,
|
|
44
|
-
return
|
|
43
|
+
date(e, r) {
|
|
44
|
+
return le(e, "date", r);
|
|
45
45
|
},
|
|
46
|
-
id(e,
|
|
47
|
-
return
|
|
46
|
+
id(e, r) {
|
|
47
|
+
return le(e, "id", r);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
filter(e) {
|
|
@@ -53,15 +53,15 @@ const Gn = {
|
|
|
53
53
|
kind: "filter"
|
|
54
54
|
};
|
|
55
55
|
},
|
|
56
|
-
bindInput(e,
|
|
56
|
+
bindInput(e, r) {
|
|
57
57
|
return {
|
|
58
58
|
toAnalyticsInput() {
|
|
59
|
-
const [
|
|
60
|
-
...
|
|
61
|
-
inputId:
|
|
59
|
+
const [t] = Tr([e]), n = kr({
|
|
60
|
+
...r,
|
|
61
|
+
inputId: r.inputId || t.inputId
|
|
62
62
|
});
|
|
63
63
|
return {
|
|
64
|
-
...
|
|
64
|
+
...t,
|
|
65
65
|
inputId: n.inputId,
|
|
66
66
|
...n.kind ? { kind: n.kind } : {},
|
|
67
67
|
...n.controlRole ? { controlRole: n.controlRole } : {},
|
|
@@ -128,165 +128,169 @@ const Gn = {
|
|
|
128
128
|
queryKind: "matrix"
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, be = 10, Se = 100, Qr = 25, Vr = 500, ar = {
|
|
132
132
|
enabled: !1,
|
|
133
133
|
queries: [],
|
|
134
134
|
getQuery: () => {
|
|
135
135
|
},
|
|
136
136
|
getQueries: () => []
|
|
137
|
-
},
|
|
137
|
+
}, Le = ye(null), Oe = ye(null), Be = ye(
|
|
138
138
|
void 0
|
|
139
|
-
),
|
|
140
|
-
function
|
|
139
|
+
), P = [];
|
|
140
|
+
function Ur({
|
|
141
141
|
debug: e,
|
|
142
|
-
children:
|
|
142
|
+
children: r
|
|
143
143
|
}) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
),
|
|
149
|
-
|
|
150
|
-
i({ type: "config", config:
|
|
151
|
-
}, [
|
|
144
|
+
const t = b(() => Zt(e), [e]), [n, i] = Wr(
|
|
145
|
+
Mt,
|
|
146
|
+
t,
|
|
147
|
+
hr
|
|
148
|
+
), d = D(n), l = sr(), [c, u] = V({ open: !1 });
|
|
149
|
+
d.current = n, K(() => {
|
|
150
|
+
i({ type: "config", config: t });
|
|
151
|
+
}, [t]), K(() => {
|
|
152
152
|
if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
|
|
153
153
|
return;
|
|
154
|
-
const S =
|
|
155
|
-
return
|
|
156
|
-
ownerId:
|
|
154
|
+
const S = Gt(() => d.current);
|
|
155
|
+
return Gr({
|
|
156
|
+
ownerId: l,
|
|
157
157
|
bridge: S
|
|
158
158
|
}), () => {
|
|
159
|
-
|
|
159
|
+
Jr(l);
|
|
160
160
|
};
|
|
161
|
-
}, [
|
|
162
|
-
const f = b(() => ({ state: n, dispatch: i }), [n]),
|
|
163
|
-
|
|
164
|
-
}, []),
|
|
165
|
-
|
|
166
|
-
}, []), h =
|
|
167
|
-
|
|
168
|
-
}, []),
|
|
161
|
+
}, [l, n.enabled, n.exposeWindowBridge]);
|
|
162
|
+
const f = b(() => ({ state: n, dispatch: i }), [n]), m = O((S) => {
|
|
163
|
+
u({ open: !0, focus: S });
|
|
164
|
+
}, []), y = O(() => {
|
|
165
|
+
u((S) => ({ ...S, open: !1 }));
|
|
166
|
+
}, []), h = O((S) => {
|
|
167
|
+
u({ open: !0, focus: S });
|
|
168
|
+
}, []), g = b(
|
|
169
169
|
() => ({
|
|
170
170
|
open: c.open,
|
|
171
171
|
focus: c.focus,
|
|
172
|
-
openDevtools:
|
|
173
|
-
closeDevtools:
|
|
172
|
+
openDevtools: m,
|
|
173
|
+
closeDevtools: y,
|
|
174
174
|
focusTrace: h
|
|
175
175
|
}),
|
|
176
176
|
[
|
|
177
|
-
g,
|
|
178
|
-
h,
|
|
179
177
|
y,
|
|
178
|
+
h,
|
|
179
|
+
m,
|
|
180
180
|
c.focus,
|
|
181
181
|
c.open
|
|
182
182
|
]
|
|
183
183
|
);
|
|
184
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ o(Le.Provider, { value: f, children: /* @__PURE__ */ o(Oe.Provider, { value: g, children: r }) });
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const
|
|
188
|
-
(
|
|
186
|
+
function Gr(e) {
|
|
187
|
+
const r = P.findIndex(
|
|
188
|
+
(t) => t.ownerId === e.ownerId
|
|
189
189
|
);
|
|
190
|
-
|
|
190
|
+
r >= 0 && P.splice(r, 1), P.push(e), dr();
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
194
|
-
(
|
|
192
|
+
function Jr(e) {
|
|
193
|
+
const r = P.findIndex(
|
|
194
|
+
(t) => t.ownerId === e
|
|
195
195
|
);
|
|
196
|
-
|
|
196
|
+
r >= 0 && P.splice(r, 1), dr();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function dr() {
|
|
199
199
|
if (typeof window > "u")
|
|
200
200
|
return;
|
|
201
|
-
const e =
|
|
201
|
+
const e = P[P.length - 1];
|
|
202
202
|
e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ii({
|
|
205
205
|
id: e,
|
|
206
|
-
title:
|
|
207
|
-
children:
|
|
206
|
+
title: r,
|
|
207
|
+
children: t
|
|
208
208
|
}) {
|
|
209
|
-
const n = b(() => ({ id: e, title:
|
|
210
|
-
return /* @__PURE__ */
|
|
209
|
+
const n = b(() => ({ id: e, title: r }), [e, r]);
|
|
210
|
+
return /* @__PURE__ */ o(Be.Provider, { value: n, children: t });
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Yr({
|
|
213
213
|
buttonPosition: e = "bottom-right",
|
|
214
|
-
initialIsOpen:
|
|
215
|
-
panelPosition:
|
|
214
|
+
initialIsOpen: r = !1,
|
|
215
|
+
panelPosition: t = "right",
|
|
216
216
|
className: n,
|
|
217
217
|
style: i
|
|
218
218
|
} = {}) {
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}, []),
|
|
223
|
-
|
|
224
|
-
}, [
|
|
225
|
-
if (!
|
|
219
|
+
const d = lr(), l = Q(Oe), [c, u] = V(""), [f, m] = V(!1), y = D(null), h = D(null), g = l == null ? void 0 : l.openDevtools, S = l == null ? void 0 : l.closeDevtools, k = (l == null ? void 0 : l.open) === !0;
|
|
220
|
+
K(() => {
|
|
221
|
+
yr();
|
|
222
|
+
}, []), K(() => {
|
|
223
|
+
r && d.enabled && (g == null || g());
|
|
224
|
+
}, [r, d.enabled, g]), K(() => {
|
|
225
|
+
if (!k || !S)
|
|
226
226
|
return;
|
|
227
|
-
const v = (
|
|
228
|
-
var
|
|
229
|
-
const
|
|
230
|
-
|
|
227
|
+
const v = (w) => {
|
|
228
|
+
var I, E;
|
|
229
|
+
const A = w.target;
|
|
230
|
+
A instanceof Node && ((I = y.current) != null && I.contains(A) || (E = h.current) != null && E.contains(A) || S());
|
|
231
231
|
};
|
|
232
232
|
return document.addEventListener("pointerdown", v, !0), document.addEventListener("mousedown", v, !0), document.addEventListener("click", v, !0), () => {
|
|
233
233
|
document.removeEventListener("pointerdown", v, !0), document.removeEventListener("mousedown", v, !0), document.removeEventListener("click", v, !0);
|
|
234
234
|
};
|
|
235
|
-
}, [S,
|
|
235
|
+
}, [S, k]);
|
|
236
236
|
const a = b(
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
() =>
|
|
241
|
-
[
|
|
242
|
-
),
|
|
243
|
-
() =>
|
|
244
|
-
[
|
|
245
|
-
),
|
|
246
|
-
() =>
|
|
247
|
-
[
|
|
237
|
+
() => gt(d.queries),
|
|
238
|
+
[d.queries]
|
|
239
|
+
), x = mt(a), C = b(
|
|
240
|
+
() => yt(d.queries, c),
|
|
241
|
+
[d.queries, c]
|
|
242
|
+
), L = b(
|
|
243
|
+
() => ht(C),
|
|
244
|
+
[C]
|
|
245
|
+
), B = b(
|
|
246
|
+
() => ur(C, l == null ? void 0 : l.focus) || C[0],
|
|
247
|
+
[C, l == null ? void 0 : l.focus]
|
|
248
248
|
);
|
|
249
|
-
return !
|
|
249
|
+
return !d.enabled || !l ? null : /* @__PURE__ */ p(or, { children: [
|
|
250
250
|
/* @__PURE__ */ p(
|
|
251
251
|
"button",
|
|
252
252
|
{
|
|
253
|
-
ref:
|
|
253
|
+
ref: y,
|
|
254
254
|
type: "button",
|
|
255
|
-
"aria-label": "Open Semaphor
|
|
256
|
-
title:
|
|
255
|
+
"aria-label": "Open Semaphor Inspector",
|
|
256
|
+
title: x,
|
|
257
257
|
className: n ? `${$} ${n}` : $,
|
|
258
258
|
style: {
|
|
259
|
-
...
|
|
260
|
-
...
|
|
261
|
-
|
|
259
|
+
...s.launcher,
|
|
260
|
+
...Nt(e),
|
|
261
|
+
...$t(a.severity),
|
|
262
262
|
...i
|
|
263
263
|
},
|
|
264
|
-
onClick: () =>
|
|
264
|
+
onClick: () => l.openDevtools(),
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
a.issueCount > 0 ? /* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ o(Zr, {}),
|
|
267
|
+
/* @__PURE__ */ o("span", { style: s.launcherText, children: a.total }),
|
|
268
|
+
a.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
|
|
269
|
+
a.issueCount,
|
|
270
|
+
" issue",
|
|
271
|
+
a.issueCount === 1 ? "" : "s"
|
|
272
|
+
] }) : null
|
|
269
273
|
]
|
|
270
274
|
}
|
|
271
275
|
),
|
|
272
|
-
|
|
276
|
+
l.open ? /* @__PURE__ */ p(
|
|
273
277
|
"div",
|
|
274
278
|
{
|
|
275
279
|
ref: h,
|
|
276
280
|
role: "dialog",
|
|
277
|
-
"aria-label": "Semaphor
|
|
281
|
+
"aria-label": "Semaphor Inspector",
|
|
278
282
|
"aria-modal": "false",
|
|
279
283
|
className: $,
|
|
280
284
|
style: {
|
|
281
|
-
...
|
|
282
|
-
...
|
|
283
|
-
...f ?
|
|
285
|
+
...s.panel,
|
|
286
|
+
...Wt(t),
|
|
287
|
+
...f ? s.panelFullscreen : null
|
|
284
288
|
},
|
|
285
289
|
children: [
|
|
286
|
-
/* @__PURE__ */ p("div", { style:
|
|
287
|
-
/* @__PURE__ */ p("div", { style:
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */ p("div", { style:
|
|
290
|
+
/* @__PURE__ */ p("div", { style: s.panelHeader, children: [
|
|
291
|
+
/* @__PURE__ */ p("div", { style: s.panelTitleBlock, children: [
|
|
292
|
+
/* @__PURE__ */ o("div", { style: s.panelTitle, children: "Semaphor Inspector" }),
|
|
293
|
+
/* @__PURE__ */ p("div", { style: s.panelSubtitle, children: [
|
|
290
294
|
a.total,
|
|
291
295
|
" queries · ",
|
|
292
296
|
a.loading,
|
|
@@ -296,40 +300,40 @@ function Jt({
|
|
|
296
300
|
" failed"
|
|
297
301
|
] })
|
|
298
302
|
] }),
|
|
299
|
-
/* @__PURE__ */ p("div", { style:
|
|
300
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ p("div", { style: s.panelActions, children: [
|
|
304
|
+
/* @__PURE__ */ o(
|
|
301
305
|
"button",
|
|
302
306
|
{
|
|
303
307
|
type: "button",
|
|
304
|
-
"aria-label": f ? "Exit fullscreen Semaphor
|
|
305
|
-
title: f ? "Exit fullscreen Semaphor
|
|
306
|
-
style:
|
|
307
|
-
onClick: () =>
|
|
308
|
-
children: f ? /* @__PURE__ */
|
|
308
|
+
"aria-label": f ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
309
|
+
title: f ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
310
|
+
style: s.iconButton,
|
|
311
|
+
onClick: () => m((v) => !v),
|
|
312
|
+
children: f ? /* @__PURE__ */ o(Fr, { size: 15 }) : /* @__PURE__ */ o(_r, { size: 15 })
|
|
309
313
|
}
|
|
310
314
|
),
|
|
311
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ o(
|
|
312
316
|
"button",
|
|
313
317
|
{
|
|
314
318
|
type: "button",
|
|
315
|
-
"aria-label": "Close Semaphor
|
|
316
|
-
style:
|
|
317
|
-
onClick:
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
+
"aria-label": "Close Semaphor Inspector",
|
|
320
|
+
style: s.iconButton,
|
|
321
|
+
onClick: l.closeDevtools,
|
|
322
|
+
children: /* @__PURE__ */ o(Mr, { size: 15 })
|
|
319
323
|
}
|
|
320
324
|
)
|
|
321
325
|
] })
|
|
322
326
|
] }),
|
|
323
|
-
/* @__PURE__ */ p("label", { style:
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ p("label", { style: s.searchBox, children: [
|
|
328
|
+
/* @__PURE__ */ o(zr, { size: 14 }),
|
|
329
|
+
/* @__PURE__ */ o(
|
|
326
330
|
"input",
|
|
327
331
|
{
|
|
328
332
|
"aria-label": "Search Semaphor traces",
|
|
329
333
|
value: c,
|
|
330
|
-
onChange: (v) =>
|
|
334
|
+
onChange: (v) => u(v.currentTarget.value),
|
|
331
335
|
placeholder: "Search traces",
|
|
332
|
-
style:
|
|
336
|
+
style: s.searchInput
|
|
333
337
|
}
|
|
334
338
|
)
|
|
335
339
|
] }),
|
|
@@ -337,73 +341,76 @@ function Jt({
|
|
|
337
341
|
"div",
|
|
338
342
|
{
|
|
339
343
|
style: {
|
|
340
|
-
...
|
|
341
|
-
...
|
|
344
|
+
...s.panelBody,
|
|
345
|
+
...Ft(t)
|
|
342
346
|
},
|
|
343
347
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ o(
|
|
345
349
|
"div",
|
|
346
350
|
{
|
|
347
351
|
style: {
|
|
348
|
-
...
|
|
349
|
-
...
|
|
352
|
+
...s.queryList,
|
|
353
|
+
..._t()
|
|
350
354
|
},
|
|
351
355
|
"aria-label": "Registered queries",
|
|
352
|
-
children:
|
|
353
|
-
/* @__PURE__ */ p("div", { style:
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
+
children: C.length ? L.map((v) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
|
|
357
|
+
/* @__PURE__ */ p("div", { style: s.queryGroupHeader, children: [
|
|
358
|
+
/* @__PURE__ */ o("span", { children: v.title }),
|
|
359
|
+
/* @__PURE__ */ o("span", { style: s.queryGroupCount, children: v.traces.length })
|
|
356
360
|
] }),
|
|
357
|
-
v.traces.length ? v.traces.map((
|
|
358
|
-
var
|
|
359
|
-
const
|
|
361
|
+
v.traces.length ? v.traces.map((w) => {
|
|
362
|
+
var R;
|
|
363
|
+
const A = bt(w, B), I = Ke(w), E = pr(w), z = gr(w), Z = wt(w, I, z), ee = Z.join(" · "), ae = cr(E);
|
|
360
364
|
return /* @__PURE__ */ p(
|
|
361
365
|
"button",
|
|
362
366
|
{
|
|
363
367
|
type: "button",
|
|
364
|
-
title: `${
|
|
368
|
+
title: `${I} · ${E} · ${ee}`,
|
|
365
369
|
style: {
|
|
366
|
-
...
|
|
367
|
-
...
|
|
370
|
+
...s.queryListItem,
|
|
371
|
+
...A ? s.queryListItemSelected : null
|
|
368
372
|
},
|
|
369
|
-
onClick: () =>
|
|
370
|
-
traceId:
|
|
371
|
-
queryId:
|
|
372
|
-
viewId:
|
|
373
|
+
onClick: () => l.focusTrace({
|
|
374
|
+
traceId: w.traceId,
|
|
375
|
+
queryId: w.queryId,
|
|
376
|
+
viewId: w.viewId
|
|
373
377
|
}),
|
|
374
378
|
children: [
|
|
375
|
-
/* @__PURE__ */ p("span", { style:
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
|
|
380
|
+
/* @__PURE__ */ o(rt, { status: (R = w.latestAttempt) == null ? void 0 : R.status }),
|
|
381
|
+
/* @__PURE__ */ o("span", { style: s.queryListTitle, title: I, children: I }),
|
|
382
|
+
/* @__PURE__ */ o(
|
|
383
|
+
"span",
|
|
384
|
+
{
|
|
385
|
+
style: {
|
|
386
|
+
...s.queryListKindChip,
|
|
387
|
+
...fr(ae)
|
|
388
|
+
},
|
|
389
|
+
children: E
|
|
390
|
+
}
|
|
391
|
+
)
|
|
379
392
|
] }),
|
|
380
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ o(
|
|
381
394
|
"span",
|
|
382
395
|
{
|
|
383
396
|
className: `${$}-source`,
|
|
384
|
-
style:
|
|
385
|
-
title:
|
|
386
|
-
children:
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
"span",
|
|
391
|
-
{
|
|
392
|
-
className: `${$}-source`,
|
|
393
|
-
style: l.queryListSourceSecondary,
|
|
394
|
-
title: k,
|
|
395
|
-
children: k
|
|
397
|
+
style: s.queryListSource,
|
|
398
|
+
title: ee,
|
|
399
|
+
children: Z.map((H, re) => /* @__PURE__ */ p($r, { children: [
|
|
400
|
+
re > 0 ? /* @__PURE__ */ o("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
|
|
401
|
+
/* @__PURE__ */ o("span", { children: H })
|
|
402
|
+
] }, `${H}:${re}`))
|
|
396
403
|
}
|
|
397
404
|
)
|
|
398
405
|
]
|
|
399
406
|
},
|
|
400
|
-
|
|
407
|
+
Ce(w)
|
|
401
408
|
);
|
|
402
|
-
}) : /* @__PURE__ */
|
|
403
|
-
] }, v.title)) : /* @__PURE__ */
|
|
409
|
+
}) : /* @__PURE__ */ o("div", { style: s.queryGroupEmpty, children: "No input traces" })
|
|
410
|
+
] }, v.title)) : /* @__PURE__ */ o("div", { style: s.emptyState, children: "No matching traces" })
|
|
404
411
|
}
|
|
405
412
|
),
|
|
406
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ o(et, { trace: B })
|
|
407
414
|
]
|
|
408
415
|
}
|
|
409
416
|
)
|
|
@@ -412,234 +419,229 @@ function Jt({
|
|
|
412
419
|
) : null
|
|
413
420
|
] });
|
|
414
421
|
}
|
|
415
|
-
function
|
|
422
|
+
function oi({
|
|
416
423
|
queryId: e,
|
|
417
|
-
viewId:
|
|
418
|
-
label:
|
|
424
|
+
viewId: r,
|
|
425
|
+
label: t,
|
|
419
426
|
className: n,
|
|
420
427
|
style: i
|
|
421
428
|
} = {}) {
|
|
422
|
-
var
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
|
|
429
|
+
var y, h;
|
|
430
|
+
const d = lr(), l = Q(Oe), c = Q(Be);
|
|
431
|
+
K(() => {
|
|
432
|
+
yr();
|
|
426
433
|
}, []);
|
|
427
|
-
const
|
|
428
|
-
() =>
|
|
434
|
+
const u = r || (c == null ? void 0 : c.id), f = b(
|
|
435
|
+
() => vt(d.queries, {
|
|
429
436
|
queryId: e,
|
|
430
|
-
viewId:
|
|
437
|
+
viewId: u
|
|
431
438
|
}),
|
|
432
439
|
[
|
|
433
|
-
|
|
440
|
+
d.queries,
|
|
434
441
|
e,
|
|
435
|
-
|
|
442
|
+
u
|
|
436
443
|
]
|
|
437
444
|
);
|
|
438
|
-
if (!
|
|
445
|
+
if (!d.enabled || !l || !f)
|
|
439
446
|
return null;
|
|
440
|
-
const
|
|
447
|
+
const m = t || `Inspect ${xt(f, !!e)}`;
|
|
441
448
|
return /* @__PURE__ */ p(
|
|
442
449
|
"button",
|
|
443
450
|
{
|
|
444
451
|
type: "button",
|
|
445
|
-
"aria-label":
|
|
446
|
-
title:
|
|
452
|
+
"aria-label": m,
|
|
453
|
+
title: m,
|
|
447
454
|
className: n ? `${$} ${n}` : $,
|
|
448
455
|
style: {
|
|
449
|
-
...
|
|
450
|
-
...
|
|
456
|
+
...s.inspectButton,
|
|
457
|
+
...zt((y = f.latestAttempt) == null ? void 0 : y.status),
|
|
451
458
|
...i
|
|
452
459
|
},
|
|
453
|
-
onClick: () =>
|
|
460
|
+
onClick: () => l.openDevtools({
|
|
454
461
|
traceId: f.traceId,
|
|
455
462
|
queryId: f.queryId,
|
|
456
463
|
viewId: f.viewId
|
|
457
464
|
}),
|
|
458
465
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ o(Hr, { size: 13 }),
|
|
467
|
+
/* @__PURE__ */ o("span", { style: s.inspectButtonText, children: ((h = f.latestAttempt) == null ? void 0 : h.status) || "idle" })
|
|
461
468
|
]
|
|
462
469
|
}
|
|
463
470
|
);
|
|
464
471
|
}
|
|
465
|
-
function
|
|
466
|
-
const e =
|
|
467
|
-
return !e || !e.state.enabled ?
|
|
472
|
+
function lr() {
|
|
473
|
+
const e = Q(Le);
|
|
474
|
+
return !e || !e.state.enabled ? ar : ge(e.state);
|
|
468
475
|
}
|
|
469
|
-
function
|
|
476
|
+
function Xr({
|
|
470
477
|
spec: e,
|
|
471
|
-
queryKind:
|
|
472
|
-
queryKey:
|
|
478
|
+
queryKind: r,
|
|
479
|
+
queryKey: t,
|
|
473
480
|
intent: n,
|
|
474
481
|
activeInputs: i,
|
|
475
|
-
debug:
|
|
482
|
+
debug: d
|
|
476
483
|
}) {
|
|
477
|
-
const
|
|
484
|
+
const l = Q(Le), c = Q(Be), u = !!(l != null && l.state.enabled), f = l == null ? void 0 : l.dispatch, m = rn(e), y = e.label, h = b(
|
|
478
485
|
() => JSON.stringify(e),
|
|
479
486
|
[e]
|
|
480
|
-
),
|
|
487
|
+
), g = b(
|
|
481
488
|
() => JSON.stringify(i || []),
|
|
482
489
|
[i]
|
|
483
490
|
), S = b(
|
|
484
491
|
() => JSON.stringify(n || null),
|
|
485
492
|
[n]
|
|
486
|
-
),
|
|
487
|
-
a.current !== h && (a.current = h,
|
|
488
|
-
const
|
|
489
|
-
() =>
|
|
490
|
-
[
|
|
491
|
-
),
|
|
492
|
-
() => Qe(o),
|
|
493
|
-
// Keep inline debug={{ sourceHint: ... }} objects from re-registering every render.
|
|
494
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
495
|
-
[At]
|
|
496
|
-
), F = b(
|
|
493
|
+
), k = D(e), a = D(h), x = D(n), C = D(S), L = D(i), B = D(g), v = en(d), w = JSON.stringify(v || []), A = D(v), I = D(w);
|
|
494
|
+
a.current !== h && (a.current = h, k.current = e), C.current !== S && (C.current = S, x.current = n), B.current !== g && (B.current = g, L.current = i), I.current !== w && (I.current = w, A.current = v);
|
|
495
|
+
const E = k.current, z = x.current, Z = L.current, ee = A.current, ae = sr(), R = b(
|
|
496
|
+
() => m || `query_${xr(t)}`,
|
|
497
|
+
[t, m]
|
|
498
|
+
), H = (d == null ? void 0 : d.viewId) || (c == null ? void 0 : c.id), re = (d == null ? void 0 : d.viewTitle) || (d == null ? void 0 : d.title) || (c == null ? void 0 : c.title), Fe = d == null ? void 0 : d.visualType, _e = d == null ? void 0 : d.sectionTitle, M = b(
|
|
497
499
|
() => [
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
500
|
+
H || "unscoped-view",
|
|
501
|
+
R,
|
|
502
|
+
ae
|
|
501
503
|
].join("::"),
|
|
502
|
-
[
|
|
503
|
-
),
|
|
504
|
+
[R, ae, H]
|
|
505
|
+
), ze = b(
|
|
504
506
|
() => ({
|
|
505
|
-
traceKey:
|
|
506
|
-
spec:
|
|
507
|
-
queryId:
|
|
508
|
-
queryLabel:
|
|
509
|
-
queryKind:
|
|
510
|
-
builder:
|
|
511
|
-
viewId:
|
|
512
|
-
viewTitle:
|
|
513
|
-
visualType:
|
|
507
|
+
traceKey: M,
|
|
508
|
+
spec: E,
|
|
509
|
+
queryId: R,
|
|
510
|
+
queryLabel: y,
|
|
511
|
+
queryKind: r,
|
|
512
|
+
builder: tn(r),
|
|
513
|
+
viewId: H,
|
|
514
|
+
viewTitle: re,
|
|
515
|
+
visualType: Fe,
|
|
514
516
|
sectionTitle: _e,
|
|
515
|
-
sourceHints:
|
|
516
|
-
intent:
|
|
517
|
-
activeInputs:
|
|
518
|
-
clientWarnings:
|
|
517
|
+
sourceHints: ee,
|
|
518
|
+
intent: z,
|
|
519
|
+
activeInputs: Z,
|
|
520
|
+
clientWarnings: m ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
|
|
519
521
|
}),
|
|
520
522
|
[
|
|
521
|
-
x,
|
|
522
|
-
t,
|
|
523
|
-
y,
|
|
524
|
-
g,
|
|
525
|
-
I,
|
|
526
523
|
R,
|
|
527
|
-
|
|
528
|
-
|
|
524
|
+
r,
|
|
525
|
+
m,
|
|
526
|
+
y,
|
|
527
|
+
E,
|
|
528
|
+
Z,
|
|
529
|
+
z,
|
|
530
|
+
ee,
|
|
529
531
|
_e,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
532
|
+
M,
|
|
533
|
+
H,
|
|
534
|
+
re,
|
|
535
|
+
Fe
|
|
534
536
|
]
|
|
535
537
|
);
|
|
536
|
-
|
|
537
|
-
if (!(!
|
|
538
|
-
return f({ type: "register", descriptor:
|
|
539
|
-
f({ type: "unregister", traceKey:
|
|
538
|
+
K(() => {
|
|
539
|
+
if (!(!u || !f))
|
|
540
|
+
return f({ type: "register", descriptor: ze }), () => {
|
|
541
|
+
f({ type: "unregister", traceKey: M });
|
|
540
542
|
};
|
|
541
|
-
}, [
|
|
542
|
-
const
|
|
543
|
-
(
|
|
544
|
-
!
|
|
543
|
+
}, [ze, f, u, M]);
|
|
544
|
+
const W = O(
|
|
545
|
+
(T, U) => {
|
|
546
|
+
!u || !f || f({ type: "event", traceKey: M, event: T, latestAttempt: U });
|
|
545
547
|
},
|
|
546
|
-
[f,
|
|
547
|
-
),
|
|
548
|
-
|
|
548
|
+
[f, u, M]
|
|
549
|
+
), He = O(() => {
|
|
550
|
+
W(
|
|
549
551
|
{
|
|
550
552
|
type: "query_started",
|
|
551
|
-
queryId:
|
|
552
|
-
at:
|
|
553
|
+
queryId: R,
|
|
554
|
+
at: fe()
|
|
553
555
|
},
|
|
554
556
|
{ status: "loading" }
|
|
555
557
|
);
|
|
556
|
-
}, [
|
|
557
|
-
(
|
|
558
|
-
const
|
|
559
|
-
|
|
558
|
+
}, [W, R]), Me = O(
|
|
559
|
+
(T, U) => {
|
|
560
|
+
const te = er(T), ne = cn(T), Er = fn(T);
|
|
561
|
+
W(
|
|
560
562
|
{
|
|
561
563
|
type: "query_succeeded",
|
|
562
|
-
queryId:
|
|
563
|
-
requestId:
|
|
564
|
-
at:
|
|
565
|
-
rowCount:
|
|
566
|
-
durationMs:
|
|
564
|
+
queryId: R,
|
|
565
|
+
requestId: te,
|
|
566
|
+
at: fe(),
|
|
567
|
+
rowCount: ne,
|
|
568
|
+
durationMs: U
|
|
567
569
|
},
|
|
568
570
|
{
|
|
569
|
-
requestId:
|
|
571
|
+
requestId: te,
|
|
570
572
|
status: "success",
|
|
571
|
-
durationMs:
|
|
572
|
-
rowCount:
|
|
573
|
-
columnCount:
|
|
574
|
-
executionResult:
|
|
573
|
+
durationMs: U,
|
|
574
|
+
rowCount: ne,
|
|
575
|
+
columnCount: Er,
|
|
576
|
+
executionResult: Ze(T)
|
|
575
577
|
}
|
|
576
578
|
);
|
|
577
579
|
},
|
|
578
|
-
[
|
|
579
|
-
),
|
|
580
|
-
(
|
|
581
|
-
const
|
|
582
|
-
|
|
580
|
+
[W, R]
|
|
581
|
+
), de = O(
|
|
582
|
+
(T, U) => {
|
|
583
|
+
const te = er(T), ne = T instanceof Error ? T.message : String(T);
|
|
584
|
+
W(
|
|
583
585
|
{
|
|
584
586
|
type: "query_failed",
|
|
585
|
-
queryId:
|
|
586
|
-
requestId:
|
|
587
|
-
at:
|
|
588
|
-
errorMessage:
|
|
587
|
+
queryId: R,
|
|
588
|
+
requestId: te,
|
|
589
|
+
at: fe(),
|
|
590
|
+
errorMessage: ne
|
|
589
591
|
},
|
|
590
592
|
{
|
|
591
|
-
requestId:
|
|
593
|
+
requestId: te,
|
|
592
594
|
status: "error",
|
|
593
|
-
durationMs:
|
|
594
|
-
errorMessage:
|
|
595
|
-
executionResult:
|
|
595
|
+
durationMs: U,
|
|
596
|
+
errorMessage: ne,
|
|
597
|
+
executionResult: Ze(T)
|
|
596
598
|
}
|
|
597
599
|
);
|
|
598
600
|
},
|
|
599
|
-
[
|
|
600
|
-
),
|
|
601
|
-
(
|
|
602
|
-
|
|
601
|
+
[W, R]
|
|
602
|
+
), je = O(
|
|
603
|
+
(T) => {
|
|
604
|
+
W(
|
|
603
605
|
{
|
|
604
606
|
type: "query_ignored_stale",
|
|
605
|
-
queryId:
|
|
606
|
-
at:
|
|
607
|
-
reason:
|
|
607
|
+
queryId: R,
|
|
608
|
+
at: fe(),
|
|
609
|
+
reason: T
|
|
608
610
|
}
|
|
609
611
|
);
|
|
610
612
|
},
|
|
611
|
-
[
|
|
612
|
-
),
|
|
613
|
-
(
|
|
614
|
-
|
|
613
|
+
[W, R]
|
|
614
|
+
), Pe = O(
|
|
615
|
+
(T) => {
|
|
616
|
+
de(T, 0);
|
|
615
617
|
},
|
|
616
|
-
[
|
|
617
|
-
),
|
|
618
|
+
[de]
|
|
619
|
+
), ve = u ? l == null ? void 0 : l.state.entries[M] : void 0;
|
|
618
620
|
return b(
|
|
619
621
|
() => ({
|
|
620
|
-
enabled:
|
|
621
|
-
queryId:
|
|
622
|
-
trace:
|
|
623
|
-
start:
|
|
622
|
+
enabled: u,
|
|
623
|
+
queryId: R,
|
|
624
|
+
trace: ve ? pe(ve) : void 0,
|
|
625
|
+
start: He,
|
|
624
626
|
success: Me,
|
|
625
|
-
failure:
|
|
626
|
-
ignored:
|
|
627
|
-
validationFailure:
|
|
627
|
+
failure: de,
|
|
628
|
+
ignored: je,
|
|
629
|
+
validationFailure: Pe
|
|
628
630
|
}),
|
|
629
631
|
[
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
632
|
+
u,
|
|
633
|
+
de,
|
|
634
|
+
je,
|
|
635
|
+
R,
|
|
636
|
+
He,
|
|
635
637
|
Me,
|
|
636
|
-
|
|
637
|
-
|
|
638
|
+
ve,
|
|
639
|
+
Pe
|
|
638
640
|
]
|
|
639
641
|
);
|
|
640
642
|
}
|
|
641
|
-
function
|
|
642
|
-
return /* @__PURE__ */
|
|
643
|
+
function Zr() {
|
|
644
|
+
return /* @__PURE__ */ o("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
|
|
643
645
|
"svg",
|
|
644
646
|
{
|
|
645
647
|
viewBox: "0 0 100 100",
|
|
@@ -648,167 +650,194 @@ function Xt() {
|
|
|
648
650
|
height: "16",
|
|
649
651
|
focusable: "false",
|
|
650
652
|
children: [
|
|
651
|
-
/* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ o("rect", { x: "20", y: "15", width: "60", height: "12", rx: "6", fill: "currentColor" }),
|
|
654
|
+
/* @__PURE__ */ o("rect", { x: "20", y: "35", width: "40", height: "12", rx: "6", fill: "currentColor" }),
|
|
655
|
+
/* @__PURE__ */ o("rect", { x: "40", y: "55", width: "40", height: "12", rx: "6", fill: "currentColor" }),
|
|
656
|
+
/* @__PURE__ */ o("rect", { x: "20", y: "75", width: "60", height: "12", rx: "6", fill: "currentColor" })
|
|
655
657
|
]
|
|
656
658
|
}
|
|
657
659
|
) });
|
|
658
660
|
}
|
|
659
|
-
function
|
|
661
|
+
function et({
|
|
660
662
|
trace: e
|
|
661
663
|
}) {
|
|
662
|
-
var
|
|
664
|
+
var L, B, v, w, A;
|
|
663
665
|
if (!e)
|
|
664
|
-
return /* @__PURE__ */
|
|
665
|
-
const
|
|
666
|
-
(
|
|
667
|
-
), i =
|
|
668
|
-
(
|
|
669
|
-
),
|
|
666
|
+
return /* @__PURE__ */ o("div", { style: s.detailsPane, children: /* @__PURE__ */ o("div", { style: s.emptyState, children: "No traces registered yet" }) });
|
|
667
|
+
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = xe(
|
|
668
|
+
(L = t == null ? void 0 : t.validation) == null ? void 0 : L.warnings
|
|
669
|
+
), i = xe((B = t == null ? void 0 : t.validation) == null ? void 0 : B.errors), d = xe(
|
|
670
|
+
(v = t == null ? void 0 : t.coverage) == null ? void 0 : v.missingObligations
|
|
671
|
+
), l = t == null ? void 0 : t.compiledQuery, c = Kt(t), u = ((w = e.server) == null ? void 0 : w.compiledSql) || c.compiledSql, f = r != null && r.errorMessage ? [r.errorMessage] : [], m = [
|
|
670
672
|
...e.clientWarnings,
|
|
671
673
|
...n,
|
|
672
674
|
...i,
|
|
673
|
-
...
|
|
674
|
-
], g =
|
|
675
|
-
return /* @__PURE__ */ p("div", { style:
|
|
676
|
-
/* @__PURE__ */ p("div", { style:
|
|
677
|
-
/* @__PURE__ */ p("div", { style:
|
|
678
|
-
/* @__PURE__ */
|
|
675
|
+
...d
|
|
676
|
+
], y = e.inputsApplied.length > 0, h = !!(l || u), g = Rt(e), S = kt(r == null ? void 0 : r.rowCount), k = Ct(r == null ? void 0 : r.durationMs), a = e.sourceRefs.length, x = pr(e), C = cr(x);
|
|
677
|
+
return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
|
|
678
|
+
/* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
|
|
679
|
+
/* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
|
|
680
|
+
/* @__PURE__ */ o(
|
|
679
681
|
"span",
|
|
680
682
|
{
|
|
681
683
|
"aria-hidden": !0,
|
|
682
684
|
style: {
|
|
683
|
-
...
|
|
684
|
-
...
|
|
685
|
+
...s.detailsHeaderStatusDot,
|
|
686
|
+
...mr(r == null ? void 0 : r.status)
|
|
685
687
|
}
|
|
686
688
|
}
|
|
687
689
|
),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ o("span", { style: s.detailsTitle, children: Ke(e) }),
|
|
691
|
+
/* @__PURE__ */ o(
|
|
692
|
+
"span",
|
|
693
|
+
{
|
|
694
|
+
style: {
|
|
695
|
+
...s.detailsKindChip,
|
|
696
|
+
...fr(C)
|
|
697
|
+
},
|
|
698
|
+
children: x
|
|
699
|
+
}
|
|
700
|
+
)
|
|
690
701
|
] }),
|
|
691
|
-
/* @__PURE__ */ p("div", { style:
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
style: {
|
|
698
|
-
...l.detailsCaptionValue,
|
|
699
|
-
...l.detailsCaptionItemMono
|
|
700
|
-
},
|
|
701
|
-
children: h
|
|
702
|
-
}
|
|
703
|
-
)
|
|
704
|
-
] }),
|
|
705
|
-
/* @__PURE__ */ p("span", { style: l.detailsCaptionItem, children: [
|
|
706
|
-
/* @__PURE__ */ s("span", { style: l.detailsCaptionLabel, children: "Source" }),
|
|
707
|
-
/* @__PURE__ */ s("span", { style: l.detailsCaptionValue, children: g })
|
|
702
|
+
/* @__PURE__ */ p("div", { style: s.metaStrip, children: [
|
|
703
|
+
/* @__PURE__ */ o("span", { style: s.metaStripItem, children: g }),
|
|
704
|
+
/* @__PURE__ */ o("span", { style: s.metaStripDot, children: "·" }),
|
|
705
|
+
/* @__PURE__ */ p("span", { style: s.metaStripItem, children: [
|
|
706
|
+
S,
|
|
707
|
+
" rows"
|
|
708
708
|
] }),
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
/* @__PURE__ */ s("span", { style: l.detailsCaptionValue, children: Ir(t == null ? void 0 : t.durationMs) })
|
|
716
|
-
] })
|
|
709
|
+
/* @__PURE__ */ o("span", { style: s.metaStripDot, children: "·" }),
|
|
710
|
+
/* @__PURE__ */ o("span", { style: s.metaStripItem, children: k }),
|
|
711
|
+
a > 0 ? /* @__PURE__ */ p(or, { children: [
|
|
712
|
+
/* @__PURE__ */ o("span", { style: s.metaStripDot, children: "·" }),
|
|
713
|
+
/* @__PURE__ */ o("span", { style: s.metaStripItem, children: a === 1 ? "1 source" : `${a} sources` })
|
|
714
|
+
] }) : null
|
|
717
715
|
] })
|
|
718
716
|
] }),
|
|
719
|
-
f.length ? /* @__PURE__ */
|
|
720
|
-
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
(
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
717
|
+
f.length ? /* @__PURE__ */ o(Qe, { tone: "error", title: "Error", items: f }) : null,
|
|
718
|
+
m.length ? /* @__PURE__ */ o(Qe, { tone: "warning", title: "Warnings", items: m }) : null,
|
|
719
|
+
/* @__PURE__ */ o(tt, { trace: e }),
|
|
720
|
+
/* @__PURE__ */ o(ot, { trace: e }),
|
|
721
|
+
(A = e.sourceHints) != null && A.length ? /* @__PURE__ */ o(st, { hints: e.sourceHints }) : null,
|
|
722
|
+
y ? /* @__PURE__ */ o(ut, { inputs: e.inputsApplied }) : null,
|
|
723
|
+
h ? /* @__PURE__ */ o(ie, { title: "Compiled Query", defaultOpen: !0, children: /* @__PURE__ */ o(
|
|
724
|
+
ct,
|
|
727
725
|
{
|
|
728
|
-
compiledQuery:
|
|
729
|
-
compiledSql:
|
|
726
|
+
compiledQuery: l,
|
|
727
|
+
compiledSql: u
|
|
730
728
|
}
|
|
731
729
|
) }) : null,
|
|
732
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ o(ie, { title: "Lifecycle Events", children: e.recentEvents.length ? /* @__PURE__ */ o("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((I, E) => /* @__PURE__ */ p(
|
|
733
731
|
"div",
|
|
734
732
|
{
|
|
735
|
-
style:
|
|
733
|
+
style: s.eventRow,
|
|
736
734
|
children: [
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ o("span", { style: s.eventType, children: Lt(I) }),
|
|
736
|
+
/* @__PURE__ */ o("span", { style: s.eventMeta, children: Ot(I) })
|
|
739
737
|
]
|
|
740
738
|
},
|
|
741
|
-
`${
|
|
742
|
-
)) }) : /* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */
|
|
739
|
+
`${I.type}:${I.at}:${E}`
|
|
740
|
+
)) }) : /* @__PURE__ */ o("div", { style: s.mutedText, children: "No attempts recorded" }) }),
|
|
741
|
+
/* @__PURE__ */ o(ie, { title: "Raw Trace", children: /* @__PURE__ */ o("pre", { style: s.codeBlock, children: Dt(e) }) })
|
|
744
742
|
] });
|
|
745
743
|
}
|
|
746
|
-
function
|
|
744
|
+
function Qe({
|
|
747
745
|
tone: e,
|
|
748
|
-
title:
|
|
749
|
-
items:
|
|
746
|
+
title: r,
|
|
747
|
+
items: t
|
|
750
748
|
}) {
|
|
751
|
-
const n = e === "error" ?
|
|
752
|
-
return /* @__PURE__ */ p("div", { style: { ...
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
|
|
749
|
+
const n = e === "error" ? s.alertCardError : s.alertCardWarning;
|
|
750
|
+
return /* @__PURE__ */ p("div", { style: { ...s.alertCard, ...n }, children: [
|
|
751
|
+
/* @__PURE__ */ o("div", { style: s.alertCardTitle, children: r }),
|
|
752
|
+
t.length > 1 ? /* @__PURE__ */ o("ul", { style: s.alertCardList, children: t.map((i, d) => /* @__PURE__ */ o("li", { children: i }, `${e}-${d}`)) }) : /* @__PURE__ */ o("div", { children: t[0] })
|
|
755
753
|
] });
|
|
756
754
|
}
|
|
757
|
-
function
|
|
755
|
+
function rt({
|
|
758
756
|
status: e
|
|
759
757
|
}) {
|
|
760
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ o(
|
|
761
759
|
"span",
|
|
762
760
|
{
|
|
763
761
|
"aria-hidden": !0,
|
|
764
762
|
style: {
|
|
765
|
-
...
|
|
766
|
-
...
|
|
763
|
+
...s.statusDot,
|
|
764
|
+
...mr(e)
|
|
767
765
|
}
|
|
768
766
|
}
|
|
769
767
|
);
|
|
770
768
|
}
|
|
771
|
-
function
|
|
769
|
+
function ie({
|
|
772
770
|
title: e,
|
|
773
|
-
children:
|
|
771
|
+
children: r,
|
|
772
|
+
defaultOpen: t = !1
|
|
774
773
|
}) {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
774
|
+
const [n, i] = V(t);
|
|
775
|
+
return /* @__PURE__ */ p(
|
|
776
|
+
"details",
|
|
777
|
+
{
|
|
778
|
+
style: s.disclosure,
|
|
779
|
+
open: n,
|
|
780
|
+
onToggle: (d) => i(d.currentTarget.open),
|
|
781
|
+
children: [
|
|
782
|
+
/* @__PURE__ */ o("summary", { style: s.disclosureSummary, children: e }),
|
|
783
|
+
/* @__PURE__ */ o("div", { style: s.disclosureBody, children: r })
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
);
|
|
779
787
|
}
|
|
780
|
-
function
|
|
788
|
+
function tt({
|
|
781
789
|
trace: e
|
|
782
790
|
}) {
|
|
783
|
-
var
|
|
784
|
-
const
|
|
785
|
-
return /* @__PURE__ */ p("div", { style:
|
|
786
|
-
/* @__PURE__ */
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
/* @__PURE__ */ s(W, { title: "Time fields", fields: n.timeFields }),
|
|
792
|
-
/* @__PURE__ */ s(
|
|
793
|
-
W,
|
|
791
|
+
var i;
|
|
792
|
+
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = qt(r);
|
|
793
|
+
return /* @__PURE__ */ p("div", { style: s.recipe, children: [
|
|
794
|
+
/* @__PURE__ */ o(nt, { sources: e.sourceRefs }),
|
|
795
|
+
/* @__PURE__ */ o(j, { title: "Measures", fields: n.measures }),
|
|
796
|
+
/* @__PURE__ */ o(j, { title: "Time fields", fields: n.timeFields }),
|
|
797
|
+
/* @__PURE__ */ o(
|
|
798
|
+
j,
|
|
794
799
|
{
|
|
795
800
|
title: "Dimensions",
|
|
796
801
|
fields: n.dimensions,
|
|
797
802
|
emptyText: "No dimensions selected"
|
|
798
803
|
}
|
|
799
804
|
),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ o(j, { title: "Identifiers", fields: n.identifiers }),
|
|
806
|
+
/* @__PURE__ */ o(j, { title: "Other fields", fields: n.other }),
|
|
807
|
+
/* @__PURE__ */ o(j, { title: "Input bindings", fields: t })
|
|
808
|
+
] });
|
|
809
|
+
}
|
|
810
|
+
function nt({
|
|
811
|
+
sources: e
|
|
812
|
+
}) {
|
|
813
|
+
return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
814
|
+
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
815
|
+
/* @__PURE__ */ o("span", { style: s.recipeGroupTitle, children: "From" }),
|
|
816
|
+
/* @__PURE__ */ o("span", { style: s.recipeGroupCount, children: e.length })
|
|
817
|
+
] }),
|
|
818
|
+
/* @__PURE__ */ o("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ o(
|
|
819
|
+
it,
|
|
820
|
+
{
|
|
821
|
+
source: r
|
|
822
|
+
},
|
|
823
|
+
`${F(r)}:${t}`
|
|
824
|
+
)) })
|
|
825
|
+
] }) : null;
|
|
826
|
+
}
|
|
827
|
+
function it({ source: e }) {
|
|
828
|
+
const r = F(e);
|
|
829
|
+
return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
|
|
830
|
+
/* @__PURE__ */ o("span", { style: s.sourcePillLabel, children: r }),
|
|
831
|
+
/* @__PURE__ */ o("span", { style: s.sourcePillRole, children: e.kind })
|
|
803
832
|
] });
|
|
804
833
|
}
|
|
805
|
-
function
|
|
834
|
+
function ot({
|
|
806
835
|
trace: e
|
|
807
836
|
}) {
|
|
808
|
-
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
|
|
837
|
+
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ o(ie, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
|
|
838
|
+
/* @__PURE__ */ o(at, { sources: e.sourceRefs }),
|
|
839
|
+
/* @__PURE__ */ o(
|
|
840
|
+
j,
|
|
812
841
|
{
|
|
813
842
|
title: "All field refs",
|
|
814
843
|
fields: e.fieldRefs,
|
|
@@ -817,165 +846,269 @@ function rr({
|
|
|
817
846
|
)
|
|
818
847
|
] }) });
|
|
819
848
|
}
|
|
820
|
-
function
|
|
849
|
+
function st({
|
|
821
850
|
hints: e
|
|
822
851
|
}) {
|
|
823
|
-
return /* @__PURE__ */
|
|
824
|
-
const n =
|
|
825
|
-
|
|
852
|
+
return /* @__PURE__ */ o(ie, { title: "Source hints", children: /* @__PURE__ */ o("div", { style: s.recipeFieldList, children: e.map((r, t) => {
|
|
853
|
+
const n = Tt(r), i = r.component || r.exportName || n || "Source hint", d = [
|
|
854
|
+
r.exportName && r.exportName !== i ? r.exportName : void 0,
|
|
826
855
|
n,
|
|
827
|
-
|
|
856
|
+
r.note
|
|
828
857
|
].filter(Boolean).join(" · ");
|
|
829
858
|
return /* @__PURE__ */ p(
|
|
830
859
|
"div",
|
|
831
860
|
{
|
|
832
|
-
style:
|
|
833
|
-
title:
|
|
861
|
+
style: s.recipeFieldRow,
|
|
862
|
+
title: d || i,
|
|
834
863
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
|
|
864
|
+
/* @__PURE__ */ o("span", { style: s.recipeFieldName, children: i }),
|
|
865
|
+
d ? /* @__PURE__ */ o("span", { style: s.recipeFieldMeta, children: d }) : null
|
|
837
866
|
]
|
|
838
867
|
},
|
|
839
|
-
`${i}:${n}:${
|
|
868
|
+
`${i}:${n}:${t}`
|
|
840
869
|
);
|
|
841
870
|
}) }) });
|
|
842
871
|
}
|
|
843
|
-
function
|
|
872
|
+
function at({
|
|
844
873
|
sources: e
|
|
845
874
|
}) {
|
|
846
|
-
return /* @__PURE__ */ p("div", { style:
|
|
847
|
-
/* @__PURE__ */ p("div", { style:
|
|
848
|
-
/* @__PURE__ */
|
|
849
|
-
/* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
876
|
+
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
877
|
+
/* @__PURE__ */ o("span", { style: s.recipeGroupTitle, children: "Sources" }),
|
|
878
|
+
/* @__PURE__ */ o("span", { style: s.recipeGroupCount, children: e.length })
|
|
850
879
|
] }),
|
|
851
|
-
e.length ? /* @__PURE__ */
|
|
880
|
+
e.length ? /* @__PURE__ */ o("div", { style: s.recipeFieldList, children: e.map((r, t) => /* @__PURE__ */ p(
|
|
852
881
|
"div",
|
|
853
882
|
{
|
|
854
|
-
style:
|
|
855
|
-
title:
|
|
883
|
+
style: s.recipeFieldRow,
|
|
884
|
+
title: F(r),
|
|
856
885
|
children: [
|
|
857
|
-
/* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ o("span", { style: s.recipeFieldName, children: F(r) }),
|
|
887
|
+
/* @__PURE__ */ o("span", { style: s.recipeFieldMeta, children: r.kind })
|
|
859
888
|
]
|
|
860
889
|
},
|
|
861
|
-
`${
|
|
862
|
-
)) }) : /* @__PURE__ */
|
|
890
|
+
`${F(r)}:${t}`
|
|
891
|
+
)) }) : /* @__PURE__ */ o("div", { style: s.recipeEmptyText, children: "No sources captured" })
|
|
863
892
|
] });
|
|
864
893
|
}
|
|
865
|
-
function
|
|
894
|
+
function j({
|
|
866
895
|
title: e,
|
|
867
|
-
fields:
|
|
868
|
-
emptyText:
|
|
896
|
+
fields: r,
|
|
897
|
+
emptyText: t
|
|
869
898
|
}) {
|
|
870
|
-
return !
|
|
871
|
-
/* @__PURE__ */ p("div", { style:
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
899
|
+
return !r.length && !t ? null : /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
900
|
+
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
901
|
+
/* @__PURE__ */ o("span", { style: s.recipeGroupTitle, children: e }),
|
|
902
|
+
/* @__PURE__ */ o("span", { style: s.recipeGroupCount, children: r.length })
|
|
874
903
|
] }),
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
/* @__PURE__ */ s("span", { style: l.recipeFieldName, children: o }),
|
|
884
|
-
/* @__PURE__ */ p("span", { style: l.recipeFieldMeta, children: [
|
|
885
|
-
u ? /* @__PURE__ */ s("span", { children: u }) : null,
|
|
886
|
-
u && c ? /* @__PURE__ */ s("span", { style: l.recipeFieldMetaDivider, children: " · " }) : null,
|
|
887
|
-
c ? /* @__PURE__ */ s("span", { children: c }) : null
|
|
888
|
-
] })
|
|
889
|
-
]
|
|
890
|
-
},
|
|
891
|
-
`${Oe(n)}:${i}`
|
|
892
|
-
);
|
|
893
|
-
}) }) : /* @__PURE__ */ s("div", { style: l.recipeEmptyText, children: r })
|
|
904
|
+
r.length ? /* @__PURE__ */ o("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ o(
|
|
905
|
+
dt,
|
|
906
|
+
{
|
|
907
|
+
field: n,
|
|
908
|
+
groupTitle: e
|
|
909
|
+
},
|
|
910
|
+
`${Ne(n)}:${i}`
|
|
911
|
+
)) }) : /* @__PURE__ */ o("div", { style: s.recipeEmptyText, children: t })
|
|
894
912
|
] });
|
|
895
913
|
}
|
|
896
|
-
function
|
|
914
|
+
function dt({
|
|
915
|
+
field: e,
|
|
916
|
+
groupTitle: r
|
|
917
|
+
}) {
|
|
918
|
+
const t = At(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, d = e.source ? F(e.source) : void 0, l = [t, i, d].filter(Boolean).join(" · "), c = lt(e, r);
|
|
919
|
+
return /* @__PURE__ */ p("div", { style: s.fieldChip, title: l, children: [
|
|
920
|
+
/* @__PURE__ */ o("span", { style: { ...s.fieldGlyph, ...c.style }, children: c.text }),
|
|
921
|
+
e.aggregate ? /* @__PURE__ */ o("span", { style: s.fieldAggBadge, children: e.aggregate }) : null,
|
|
922
|
+
/* @__PURE__ */ o("span", { style: s.fieldChipName, children: n }),
|
|
923
|
+
i ? /* @__PURE__ */ o("span", { style: s.fieldChipMeta, children: i }) : null,
|
|
924
|
+
i && d ? /* @__PURE__ */ o("span", { style: s.fieldChipMetaDot, children: "·" }) : null,
|
|
925
|
+
d ? /* @__PURE__ */ o("span", { style: s.fieldChipMeta, children: d }) : null
|
|
926
|
+
] });
|
|
927
|
+
}
|
|
928
|
+
function lt(e, r) {
|
|
929
|
+
const t = e.dataType, n = e.role;
|
|
930
|
+
return !!e.aggregate || n === "measure" || r === "Measures" ? {
|
|
931
|
+
text: "Σ",
|
|
932
|
+
style: {
|
|
933
|
+
borderColor: "var(--sd-tone-metric-border)",
|
|
934
|
+
background: "var(--sd-tone-metric-bg)",
|
|
935
|
+
color: "var(--sd-tone-metric-fg)"
|
|
936
|
+
}
|
|
937
|
+
} : t === "date" || t === "datetime" || n === "date" || r === "Time fields" ? {
|
|
938
|
+
text: "◷",
|
|
939
|
+
style: {
|
|
940
|
+
borderColor: "var(--sd-tone-date-border)",
|
|
941
|
+
background: "var(--sd-tone-date-bg)",
|
|
942
|
+
color: "var(--sd-tone-date-fg)"
|
|
943
|
+
}
|
|
944
|
+
} : t === "number" ? {
|
|
945
|
+
text: "#",
|
|
946
|
+
style: {
|
|
947
|
+
borderColor: "var(--sd-tone-records-border)",
|
|
948
|
+
background: "var(--sd-tone-records-bg)",
|
|
949
|
+
color: "var(--sd-tone-records-fg)"
|
|
950
|
+
}
|
|
951
|
+
} : t === "boolean" ? {
|
|
952
|
+
text: "◐",
|
|
953
|
+
style: {
|
|
954
|
+
borderColor: "var(--sd-border)",
|
|
955
|
+
background: "var(--sd-bg-accent)",
|
|
956
|
+
color: "var(--sd-fg-muted)"
|
|
957
|
+
}
|
|
958
|
+
} : {
|
|
959
|
+
text: "A",
|
|
960
|
+
style: {
|
|
961
|
+
borderColor: "var(--sd-tone-string-border)",
|
|
962
|
+
background: "var(--sd-tone-string-bg)",
|
|
963
|
+
color: "var(--sd-tone-string-fg)"
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
function ut({
|
|
897
968
|
inputs: e
|
|
898
969
|
}) {
|
|
899
|
-
return /* @__PURE__ */ p("div", { style:
|
|
900
|
-
/* @__PURE__ */ p("div", { style:
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
|
|
971
|
+
/* @__PURE__ */ p("div", { style: s.inputsAppliedHeader, children: [
|
|
972
|
+
/* @__PURE__ */ o("span", { style: s.inputsAppliedTitle, children: "Active Inputs" }),
|
|
973
|
+
/* @__PURE__ */ o("span", { style: s.inputsAppliedCount, children: e.length })
|
|
903
974
|
] }),
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
const
|
|
975
|
+
/* @__PURE__ */ o("div", { style: s.inputRecipeList, children: e.map((r) => {
|
|
976
|
+
const t = Et(r);
|
|
906
977
|
return /* @__PURE__ */ p(
|
|
907
978
|
"div",
|
|
908
979
|
{
|
|
909
|
-
style:
|
|
910
|
-
title:
|
|
980
|
+
style: s.inputRecipeRow,
|
|
981
|
+
title: t.title,
|
|
911
982
|
children: [
|
|
912
|
-
/* @__PURE__ */ p("div", { style:
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
|
|
915
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ p("div", { style: s.inputRecipeHeader, children: [
|
|
984
|
+
/* @__PURE__ */ o("span", { style: s.inputRecipeId, title: r.inputId, children: r.inputId }),
|
|
985
|
+
t.operator ? /* @__PURE__ */ o("span", { style: s.inputOperatorBadge, children: t.operator }) : null,
|
|
986
|
+
/* @__PURE__ */ o("span", { style: s.inputValuePreview, title: t.value, children: t.value })
|
|
916
987
|
] }),
|
|
917
|
-
|
|
988
|
+
t.binding ? /* @__PURE__ */ o("div", { style: s.inputRecipeBinding, title: t.binding, children: t.binding }) : null
|
|
918
989
|
]
|
|
919
990
|
},
|
|
920
|
-
|
|
991
|
+
r.inputId
|
|
921
992
|
);
|
|
922
993
|
}) })
|
|
923
994
|
] });
|
|
924
995
|
}
|
|
925
|
-
function
|
|
996
|
+
function ct({
|
|
926
997
|
compiledQuery: e,
|
|
927
|
-
compiledSql:
|
|
998
|
+
compiledSql: r
|
|
928
999
|
}) {
|
|
929
|
-
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style:
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
e.pythonCode ? /* @__PURE__ */
|
|
932
|
-
e.parameters ? /* @__PURE__ */
|
|
933
|
-
|
|
1000
|
+
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
|
|
1001
|
+
/* @__PURE__ */ o(Ve, { label: "SQL", value: e.sql }),
|
|
1002
|
+
e.pythonCode ? /* @__PURE__ */ o(we, { label: "Python", value: e.pythonCode }) : null,
|
|
1003
|
+
e.parameters ? /* @__PURE__ */ o(
|
|
1004
|
+
we,
|
|
934
1005
|
{
|
|
935
1006
|
label: "Parameters",
|
|
936
|
-
value:
|
|
1007
|
+
value: De(e.parameters)
|
|
937
1008
|
}
|
|
938
1009
|
) : null
|
|
939
|
-
] }) :
|
|
1010
|
+
] }) : r ? /* @__PURE__ */ o(Ve, { label: "SQL", value: r }) : /* @__PURE__ */ o(we, { label: "Compiled Query", value: De(e) });
|
|
1011
|
+
}
|
|
1012
|
+
function we({
|
|
1013
|
+
label: e,
|
|
1014
|
+
value: r
|
|
1015
|
+
}) {
|
|
1016
|
+
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
1017
|
+
/* @__PURE__ */ o("div", { style: s.codeBlockLabel, children: e }),
|
|
1018
|
+
/* @__PURE__ */ o("pre", { style: s.codeBlock, children: r })
|
|
1019
|
+
] });
|
|
940
1020
|
}
|
|
941
|
-
function
|
|
1021
|
+
function Ve({
|
|
942
1022
|
label: e,
|
|
943
|
-
value:
|
|
1023
|
+
value: r
|
|
944
1024
|
}) {
|
|
945
|
-
return /* @__PURE__ */ p("div", { style:
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
1026
|
+
/* @__PURE__ */ o("div", { style: s.codeBlockLabel, children: e }),
|
|
1027
|
+
/* @__PURE__ */ o("pre", { style: s.codeBlock, children: pt(r) })
|
|
948
1028
|
] });
|
|
949
1029
|
}
|
|
950
|
-
|
|
951
|
-
|
|
1030
|
+
const ft = /* @__PURE__ */ new Set([
|
|
1031
|
+
"SELECT",
|
|
1032
|
+
"FROM",
|
|
1033
|
+
"JOIN",
|
|
1034
|
+
"LEFT",
|
|
1035
|
+
"RIGHT",
|
|
1036
|
+
"INNER",
|
|
1037
|
+
"OUTER",
|
|
1038
|
+
"CROSS",
|
|
1039
|
+
"ON",
|
|
1040
|
+
"USING",
|
|
1041
|
+
"WHERE",
|
|
1042
|
+
"AND",
|
|
1043
|
+
"OR",
|
|
1044
|
+
"GROUP",
|
|
1045
|
+
"BY",
|
|
1046
|
+
"HAVING",
|
|
1047
|
+
"ORDER",
|
|
1048
|
+
"ASC",
|
|
1049
|
+
"DESC",
|
|
1050
|
+
"LIMIT",
|
|
1051
|
+
"OFFSET",
|
|
1052
|
+
"AS",
|
|
1053
|
+
"BETWEEN",
|
|
1054
|
+
"IN",
|
|
1055
|
+
"NOT",
|
|
1056
|
+
"NULL",
|
|
1057
|
+
"IS",
|
|
1058
|
+
"CASE",
|
|
1059
|
+
"WHEN",
|
|
1060
|
+
"THEN",
|
|
1061
|
+
"ELSE",
|
|
1062
|
+
"END",
|
|
1063
|
+
"DISTINCT",
|
|
1064
|
+
"UNION",
|
|
1065
|
+
"ALL",
|
|
1066
|
+
"WITH"
|
|
1067
|
+
]);
|
|
1068
|
+
function pt(e) {
|
|
1069
|
+
return e.split(/(\s+|,|\(|\))/).map((t, n) => {
|
|
1070
|
+
if (!t) return null;
|
|
1071
|
+
const i = t.toUpperCase();
|
|
1072
|
+
return ft.has(i) ? /* @__PURE__ */ o("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ o("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ o("span", { children: t }, n);
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
function gt(e) {
|
|
1076
|
+
const r = e.filter(
|
|
952
1077
|
(i) => {
|
|
953
|
-
var
|
|
954
|
-
return ((
|
|
1078
|
+
var d;
|
|
1079
|
+
return ((d = i.latestAttempt) == null ? void 0 : d.status) === "error";
|
|
955
1080
|
}
|
|
956
|
-
).length,
|
|
1081
|
+
).length, t = e.filter(
|
|
957
1082
|
(i) => {
|
|
958
|
-
var
|
|
959
|
-
return ((
|
|
1083
|
+
var d;
|
|
1084
|
+
return ((d = i.latestAttempt) == null ? void 0 : d.status) === "loading";
|
|
960
1085
|
}
|
|
961
1086
|
).length, n = e.filter(
|
|
962
1087
|
(i) => {
|
|
963
|
-
var
|
|
964
|
-
return i.clientWarnings.length > 0 || !!((
|
|
1088
|
+
var d, l, c, u;
|
|
1089
|
+
return i.clientWarnings.length > 0 || !!((u = (c = (l = (d = i.latestAttempt) == null ? void 0 : d.executionResult) == null ? void 0 : l.validation) == null ? void 0 : c.warnings) != null && u.length);
|
|
965
1090
|
}
|
|
966
1091
|
).length;
|
|
967
1092
|
return {
|
|
968
1093
|
total: e.length,
|
|
969
|
-
failed:
|
|
970
|
-
loading:
|
|
1094
|
+
failed: r,
|
|
1095
|
+
loading: t,
|
|
971
1096
|
warningCount: n,
|
|
972
|
-
issueCount:
|
|
973
|
-
severity:
|
|
1097
|
+
issueCount: r + n,
|
|
1098
|
+
severity: r ? "error" : n ? "warning" : t ? "loading" : "ok"
|
|
974
1099
|
};
|
|
975
1100
|
}
|
|
976
|
-
function
|
|
977
|
-
|
|
978
|
-
|
|
1101
|
+
function mt(e) {
|
|
1102
|
+
return [
|
|
1103
|
+
`${e.total} ${e.total === 1 ? "trace" : "traces"}`,
|
|
1104
|
+
`${e.loading} loading`,
|
|
1105
|
+
`${e.failed} failed`,
|
|
1106
|
+
`${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
|
|
1107
|
+
].join(" · ");
|
|
1108
|
+
}
|
|
1109
|
+
function yt(e, r) {
|
|
1110
|
+
const t = r.trim().toLowerCase();
|
|
1111
|
+
return t ? e.filter(
|
|
979
1112
|
(n) => [
|
|
980
1113
|
n.queryId,
|
|
981
1114
|
n.queryLabel,
|
|
@@ -985,36 +1118,36 @@ function lr(e, t) {
|
|
|
985
1118
|
n.sectionTitle,
|
|
986
1119
|
n.builder,
|
|
987
1120
|
n.queryKind,
|
|
988
|
-
|
|
989
|
-
].filter(Boolean).join(" ").toLowerCase().includes(
|
|
1121
|
+
gr(n)
|
|
1122
|
+
].filter(Boolean).join(" ").toLowerCase().includes(t)
|
|
990
1123
|
) : e;
|
|
991
1124
|
}
|
|
992
|
-
function
|
|
993
|
-
const
|
|
1125
|
+
function ht(e) {
|
|
1126
|
+
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Ce));
|
|
994
1127
|
return [
|
|
995
|
-
{ title: "
|
|
996
|
-
{ title: "Inputs", traces:
|
|
1128
|
+
{ title: "Views", traces: e.filter((i) => !t.has(Ce(i))) },
|
|
1129
|
+
{ title: "Inputs", traces: r }
|
|
997
1130
|
];
|
|
998
1131
|
}
|
|
999
|
-
function
|
|
1000
|
-
if (!(!(
|
|
1001
|
-
return
|
|
1132
|
+
function ur(e, r) {
|
|
1133
|
+
if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
|
|
1134
|
+
return r.traceId ? e.find((t) => t.traceId === r.traceId) : e.find((t) => !(r.queryId && t.queryId !== r.queryId || r.viewId && t.viewId !== r.viewId));
|
|
1002
1135
|
}
|
|
1003
|
-
function
|
|
1004
|
-
if (
|
|
1005
|
-
return
|
|
1006
|
-
if (!
|
|
1136
|
+
function vt(e, r) {
|
|
1137
|
+
if (r.queryId)
|
|
1138
|
+
return ur(e, r);
|
|
1139
|
+
if (!r.viewId)
|
|
1007
1140
|
return;
|
|
1008
|
-
const
|
|
1009
|
-
return
|
|
1141
|
+
const t = e.filter((n) => n.viewId === r.viewId);
|
|
1142
|
+
return t.length === 1 ? t[0] : void 0;
|
|
1010
1143
|
}
|
|
1011
|
-
function
|
|
1012
|
-
return !!(e &&
|
|
1144
|
+
function bt(e, r) {
|
|
1145
|
+
return !!(e && r && e.traceId === r.traceId);
|
|
1013
1146
|
}
|
|
1014
|
-
function
|
|
1147
|
+
function Ce(e) {
|
|
1015
1148
|
return e.traceId;
|
|
1016
1149
|
}
|
|
1017
|
-
function
|
|
1150
|
+
function St(e) {
|
|
1018
1151
|
switch (e) {
|
|
1019
1152
|
case "metric":
|
|
1020
1153
|
return "metric";
|
|
@@ -1029,32 +1162,69 @@ function fr(e) {
|
|
|
1029
1162
|
case "sql":
|
|
1030
1163
|
return "sql";
|
|
1031
1164
|
default:
|
|
1032
|
-
return
|
|
1165
|
+
return he(e);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
function cr(e) {
|
|
1169
|
+
const r = e.trim().toLowerCase();
|
|
1170
|
+
return r === "metric" || r === "kpi" ? "metric" : r === "records" || r === "table" ? "records" : r === "matrix" || r === "pivot" ? "matrix" : r === "analysis" ? "analysis" : r === "inputs" || r === "input options" ? "inputs" : r === "sql" ? "sql" : "default";
|
|
1171
|
+
}
|
|
1172
|
+
function fr(e) {
|
|
1173
|
+
switch (e) {
|
|
1174
|
+
case "metric":
|
|
1175
|
+
return {
|
|
1176
|
+
borderColor: "var(--sd-tone-metric-border)",
|
|
1177
|
+
background: "var(--sd-tone-metric-bg)",
|
|
1178
|
+
color: "var(--sd-tone-metric-fg)"
|
|
1179
|
+
};
|
|
1180
|
+
case "records":
|
|
1181
|
+
return {
|
|
1182
|
+
borderColor: "var(--sd-tone-records-border)",
|
|
1183
|
+
background: "var(--sd-tone-records-bg)",
|
|
1184
|
+
color: "var(--sd-tone-records-fg)"
|
|
1185
|
+
};
|
|
1186
|
+
case "analysis":
|
|
1187
|
+
case "matrix":
|
|
1188
|
+
return {
|
|
1189
|
+
borderColor: "var(--sd-tone-analysis-border)",
|
|
1190
|
+
background: "var(--sd-tone-analysis-bg)",
|
|
1191
|
+
color: "var(--sd-tone-analysis-fg)"
|
|
1192
|
+
};
|
|
1193
|
+
case "inputs":
|
|
1194
|
+
case "sql":
|
|
1195
|
+
case "default":
|
|
1196
|
+
default:
|
|
1197
|
+
return {
|
|
1198
|
+
borderColor: "var(--sd-border)",
|
|
1199
|
+
background: "var(--sd-bg-accent)",
|
|
1200
|
+
color: "var(--sd-fg-muted)"
|
|
1201
|
+
};
|
|
1033
1202
|
}
|
|
1034
1203
|
}
|
|
1035
|
-
function
|
|
1204
|
+
function Ke(e) {
|
|
1036
1205
|
return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
|
|
1037
1206
|
}
|
|
1038
|
-
function
|
|
1039
|
-
|
|
1207
|
+
function wt(e, r, t) {
|
|
1208
|
+
const n = [];
|
|
1209
|
+
return e.queryLabel && e.queryLabel !== r && n.push(e.queryLabel), e.queryId && e.queryId !== r && e.queryId !== e.queryLabel ? n.push(e.queryId) : e.viewId && e.viewId !== r && e.viewId !== e.queryLabel && n.push(e.viewId), n.push(t), n;
|
|
1040
1210
|
}
|
|
1041
|
-
function
|
|
1042
|
-
return
|
|
1211
|
+
function pr(e) {
|
|
1212
|
+
return It(e.visualType) || St(e.queryKind);
|
|
1043
1213
|
}
|
|
1044
|
-
function
|
|
1045
|
-
return
|
|
1214
|
+
function xt(e, r) {
|
|
1215
|
+
return r ? e.queryLabel || e.queryId : Ke(e);
|
|
1046
1216
|
}
|
|
1047
|
-
function
|
|
1217
|
+
function It(e) {
|
|
1048
1218
|
if (e)
|
|
1049
|
-
return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (
|
|
1219
|
+
return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
|
|
1050
1220
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const
|
|
1053
|
-
return
|
|
1221
|
+
function gr(e) {
|
|
1222
|
+
const r = e.sourceRefs.map(F);
|
|
1223
|
+
return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
|
|
1054
1224
|
}
|
|
1055
|
-
function
|
|
1225
|
+
function qt(e) {
|
|
1056
1226
|
return e.reduce(
|
|
1057
|
-
(
|
|
1227
|
+
(r, t) => (t.role === "measure" ? r.measures.push(t) : t.role === "date" ? r.timeFields.push(t) : t.role === "dimension" ? r.dimensions.push(t) : t.role === "id" ? r.identifiers.push(t) : r.other.push(t), r),
|
|
1058
1228
|
{
|
|
1059
1229
|
measures: [],
|
|
1060
1230
|
timeFields: [],
|
|
@@ -1064,31 +1234,9 @@ function yr(e) {
|
|
|
1064
1234
|
}
|
|
1065
1235
|
);
|
|
1066
1236
|
}
|
|
1067
|
-
function
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
label: "Operation",
|
|
1071
|
-
value: hr(e)
|
|
1072
|
-
}
|
|
1073
|
-
], i = vr(e, t, r);
|
|
1074
|
-
i && n.push(i);
|
|
1075
|
-
const o = br(t);
|
|
1076
|
-
o && n.push({
|
|
1077
|
-
label: "Grouped by",
|
|
1078
|
-
value: o
|
|
1079
|
-
});
|
|
1080
|
-
const u = Sr(e.inputsApplied);
|
|
1081
|
-
return u && n.push({
|
|
1082
|
-
label: "Filtered by",
|
|
1083
|
-
value: u
|
|
1084
|
-
}), n.push({
|
|
1085
|
-
label: "Source",
|
|
1086
|
-
value: me(e)
|
|
1087
|
-
}), n;
|
|
1088
|
-
}
|
|
1089
|
-
function hr(e) {
|
|
1090
|
-
var t, r;
|
|
1091
|
-
if (e.queryKind === "records" && ((t = e.projectionFieldRefs) != null && t.length) && e.projectionFieldRefs.every((n) => n.role === "measure") && ((r = e.latestAttempt) == null ? void 0 : r.rowCount) === 1)
|
|
1237
|
+
function Rt(e) {
|
|
1238
|
+
var r, t;
|
|
1239
|
+
if (e.queryKind === "records" && ((r = e.projectionFieldRefs) != null && r.length) && e.projectionFieldRefs.every((n) => n.role === "measure") && ((t = e.latestAttempt) == null ? void 0 : t.rowCount) === 1)
|
|
1092
1240
|
return "KPI query";
|
|
1093
1241
|
switch (e.queryKind) {
|
|
1094
1242
|
case "metric":
|
|
@@ -1104,104 +1252,50 @@ function hr(e) {
|
|
|
1104
1252
|
case "sql":
|
|
1105
1253
|
return "SQL query";
|
|
1106
1254
|
default:
|
|
1107
|
-
return
|
|
1255
|
+
return he(e.queryKind);
|
|
1108
1256
|
}
|
|
1109
1257
|
}
|
|
1110
|
-
function
|
|
1111
|
-
if (e.queryKind === "records")
|
|
1112
|
-
return {
|
|
1113
|
-
label: t.measures.length ? "Computes" : "Selects",
|
|
1114
|
-
value: ee(r)
|
|
1115
|
-
};
|
|
1116
|
-
if (e.queryKind === "inputOptions")
|
|
1117
|
-
return {
|
|
1118
|
-
label: "Options from",
|
|
1119
|
-
value: ee(r)
|
|
1120
|
-
};
|
|
1121
|
-
if (t.measures.length)
|
|
1122
|
-
return {
|
|
1123
|
-
label: "Computes",
|
|
1124
|
-
value: ee(t.measures)
|
|
1125
|
-
};
|
|
1126
|
-
if (r.length)
|
|
1127
|
-
return {
|
|
1128
|
-
label: "Uses",
|
|
1129
|
-
value: ee(r)
|
|
1130
|
-
};
|
|
1131
|
-
if (e.queryKind === "sql")
|
|
1132
|
-
return {
|
|
1133
|
-
label: "Inspect",
|
|
1134
|
-
value: "Open compiled query for SQL or Python."
|
|
1135
|
-
};
|
|
1136
|
-
}
|
|
1137
|
-
function br(e) {
|
|
1138
|
-
const t = [
|
|
1139
|
-
...e.dimensions,
|
|
1140
|
-
...e.timeFields
|
|
1141
|
-
];
|
|
1142
|
-
return t.length ? ee(t) : void 0;
|
|
1143
|
-
}
|
|
1144
|
-
function Sr(e) {
|
|
1145
|
-
if (e.length)
|
|
1146
|
-
return dt(
|
|
1147
|
-
e.map((t) => {
|
|
1148
|
-
const r = ft(t);
|
|
1149
|
-
return [
|
|
1150
|
-
t.inputId,
|
|
1151
|
-
r.operator,
|
|
1152
|
-
r.value
|
|
1153
|
-
].filter(Boolean).join(" ");
|
|
1154
|
-
})
|
|
1155
|
-
);
|
|
1156
|
-
}
|
|
1157
|
-
function ee(e) {
|
|
1158
|
-
return dt(e.map(ct));
|
|
1159
|
-
}
|
|
1160
|
-
function dt(e) {
|
|
1161
|
-
const t = e.filter(Boolean);
|
|
1162
|
-
return t.length === 0 ? "-" : t.length === 1 ? t[0] : t.length === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[t.length - 1]}`;
|
|
1163
|
-
}
|
|
1164
|
-
function ct(e) {
|
|
1258
|
+
function At(e) {
|
|
1165
1259
|
return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
|
|
1166
1260
|
}
|
|
1167
|
-
function
|
|
1168
|
-
var
|
|
1169
|
-
const
|
|
1261
|
+
function Et(e) {
|
|
1262
|
+
var l, c, u;
|
|
1263
|
+
const r = e.valuePreview || "redacted", t = ((l = e.fieldRef) == null ? void 0 : l.label) || ((c = e.fieldRef) == null ? void 0 : c.name), n = (u = e.fieldRef) != null && u.source ? F(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "), d = [
|
|
1170
1264
|
e.inputId,
|
|
1171
1265
|
e.operator,
|
|
1172
|
-
|
|
1266
|
+
r,
|
|
1173
1267
|
i
|
|
1174
1268
|
].filter(Boolean).join(" - ");
|
|
1175
1269
|
return {
|
|
1176
1270
|
operator: e.operator,
|
|
1177
|
-
value:
|
|
1271
|
+
value: r,
|
|
1178
1272
|
binding: i,
|
|
1179
|
-
title:
|
|
1273
|
+
title: d
|
|
1180
1274
|
};
|
|
1181
1275
|
}
|
|
1182
|
-
function
|
|
1276
|
+
function F(e) {
|
|
1183
1277
|
return e.kind === "semantic" ? e.datasetName || e.datasetId || e.domainId : e.kind === "physical" ? [
|
|
1184
1278
|
e.schemaName,
|
|
1185
1279
|
e.tableName
|
|
1186
1280
|
].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
|
|
1187
1281
|
}
|
|
1188
|
-
function
|
|
1282
|
+
function Tt(e) {
|
|
1189
1283
|
if (e.file)
|
|
1190
1284
|
return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
|
|
1191
1285
|
}
|
|
1192
|
-
function
|
|
1286
|
+
function kt(e) {
|
|
1193
1287
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
1194
1288
|
}
|
|
1195
|
-
function
|
|
1289
|
+
function Ct(e) {
|
|
1196
1290
|
return typeof e == "number" ? `${Math.round(e)}ms` : "-";
|
|
1197
1291
|
}
|
|
1198
|
-
function
|
|
1199
|
-
return
|
|
1292
|
+
function Dt(e) {
|
|
1293
|
+
return De(e);
|
|
1200
1294
|
}
|
|
1201
|
-
function
|
|
1295
|
+
function De(e) {
|
|
1202
1296
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
1203
1297
|
}
|
|
1204
|
-
function
|
|
1298
|
+
function Lt(e) {
|
|
1205
1299
|
switch (e.type) {
|
|
1206
1300
|
case "query_started":
|
|
1207
1301
|
return "Started";
|
|
@@ -1214,10 +1308,10 @@ function Ar(e) {
|
|
|
1214
1308
|
case "input_changed":
|
|
1215
1309
|
return "Input changed";
|
|
1216
1310
|
default:
|
|
1217
|
-
return
|
|
1311
|
+
return Bt(e);
|
|
1218
1312
|
}
|
|
1219
1313
|
}
|
|
1220
|
-
function
|
|
1314
|
+
function Ot(e) {
|
|
1221
1315
|
return [
|
|
1222
1316
|
e.at,
|
|
1223
1317
|
"durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
|
|
@@ -1226,20 +1320,20 @@ function Tr(e) {
|
|
|
1226
1320
|
"errorMessage" in e ? e.errorMessage : void 0
|
|
1227
1321
|
].filter(Boolean).join(" - ");
|
|
1228
1322
|
}
|
|
1229
|
-
function
|
|
1323
|
+
function Bt(e) {
|
|
1230
1324
|
throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
|
|
1231
1325
|
}
|
|
1232
|
-
function
|
|
1233
|
-
return Array.isArray(e) ? e.filter((
|
|
1326
|
+
function xe(e) {
|
|
1327
|
+
return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
|
|
1234
1328
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const
|
|
1329
|
+
function Kt(e) {
|
|
1330
|
+
const r = e == null ? void 0 : e.metadata, t = r && typeof r == "object" && !Array.isArray(r) && "dataAppDebug" in r && r.dataAppDebug && typeof r.dataAppDebug == "object" && !Array.isArray(r.dataAppDebug) ? r.dataAppDebug : void 0;
|
|
1237
1331
|
return {
|
|
1238
|
-
compiledSql: typeof (
|
|
1239
|
-
queryHash: typeof (
|
|
1332
|
+
compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
|
|
1333
|
+
queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
|
|
1240
1334
|
};
|
|
1241
1335
|
}
|
|
1242
|
-
function
|
|
1336
|
+
function Nt(e) {
|
|
1243
1337
|
return e === "relative" ? {
|
|
1244
1338
|
position: "relative",
|
|
1245
1339
|
top: "auto",
|
|
@@ -1253,7 +1347,7 @@ function kr(e) {
|
|
|
1253
1347
|
left: e.endsWith("left") ? 20 : "auto"
|
|
1254
1348
|
};
|
|
1255
1349
|
}
|
|
1256
|
-
function
|
|
1350
|
+
function $t(e) {
|
|
1257
1351
|
return e === "error" ? {
|
|
1258
1352
|
borderColor: "var(--sd-error-border)",
|
|
1259
1353
|
background: "var(--sd-error-bg)",
|
|
@@ -1262,13 +1356,17 @@ function Cr(e) {
|
|
|
1262
1356
|
borderColor: "var(--sd-warning-border)",
|
|
1263
1357
|
background: "var(--sd-warning-bg)",
|
|
1264
1358
|
color: "var(--sd-warning-fg)"
|
|
1359
|
+
} : e === "loading" ? {
|
|
1360
|
+
borderColor: "var(--sd-loading-border)",
|
|
1361
|
+
background: "var(--sd-loading-bg)",
|
|
1362
|
+
color: "var(--sd-loading-fg)"
|
|
1265
1363
|
} : {
|
|
1266
1364
|
borderColor: "var(--sd-success-border)",
|
|
1267
1365
|
background: "var(--sd-success-bg)",
|
|
1268
1366
|
color: "var(--sd-success-fg)"
|
|
1269
1367
|
};
|
|
1270
1368
|
}
|
|
1271
|
-
function
|
|
1369
|
+
function Wt(e) {
|
|
1272
1370
|
return e === "right" ? {
|
|
1273
1371
|
top: 16,
|
|
1274
1372
|
right: 16,
|
|
@@ -1287,23 +1385,23 @@ function Dr(e) {
|
|
|
1287
1385
|
borderRadius: 6
|
|
1288
1386
|
};
|
|
1289
1387
|
}
|
|
1290
|
-
function
|
|
1388
|
+
function Ft(e) {
|
|
1291
1389
|
return e === "right" ? {
|
|
1292
1390
|
gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
|
|
1293
1391
|
} : {
|
|
1294
1392
|
gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
|
|
1295
1393
|
};
|
|
1296
1394
|
}
|
|
1297
|
-
function
|
|
1395
|
+
function _t(e) {
|
|
1298
1396
|
return {
|
|
1299
1397
|
borderRight: "1px solid var(--sd-border)",
|
|
1300
1398
|
borderBottom: 0
|
|
1301
1399
|
};
|
|
1302
1400
|
}
|
|
1303
|
-
function
|
|
1401
|
+
function mr(e) {
|
|
1304
1402
|
return e === "error" ? { background: "var(--sd-error-dot)" } : e === "success" ? { background: "var(--sd-success-dot)" } : e === "loading" ? { background: "var(--sd-loading-dot)" } : { background: "var(--sd-idle-dot)" };
|
|
1305
1403
|
}
|
|
1306
|
-
function
|
|
1404
|
+
function zt(e) {
|
|
1307
1405
|
return e === "error" ? {
|
|
1308
1406
|
borderColor: "var(--sd-error-border)",
|
|
1309
1407
|
color: "var(--sd-error-fg)"
|
|
@@ -1318,7 +1416,7 @@ function Br(e) {
|
|
|
1318
1416
|
color: "var(--sd-fg-muted)"
|
|
1319
1417
|
};
|
|
1320
1418
|
}
|
|
1321
|
-
const
|
|
1419
|
+
const Ue = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Ht = `
|
|
1322
1420
|
.${$} {
|
|
1323
1421
|
--sd-bg: #ffffff;
|
|
1324
1422
|
--sd-bg-muted: #fafafa;
|
|
@@ -1348,6 +1446,23 @@ const Pe = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Kr = `
|
|
|
1348
1446
|
--sd-loading-border: #bfdbfe;
|
|
1349
1447
|
--sd-loading-dot: #2563eb;
|
|
1350
1448
|
--sd-idle-dot: #94a3b8;
|
|
1449
|
+
--sd-tone-metric-bg: #f5f3ff;
|
|
1450
|
+
--sd-tone-metric-fg: #6d28d9;
|
|
1451
|
+
--sd-tone-metric-border: #ddd6fe;
|
|
1452
|
+
--sd-tone-records-bg: #f0f9ff;
|
|
1453
|
+
--sd-tone-records-fg: #0369a1;
|
|
1454
|
+
--sd-tone-records-border: #bae6fd;
|
|
1455
|
+
--sd-tone-analysis-bg: #fffbeb;
|
|
1456
|
+
--sd-tone-analysis-fg: #b45309;
|
|
1457
|
+
--sd-tone-analysis-border: #fde68a;
|
|
1458
|
+
--sd-tone-date-bg: #fff7ed;
|
|
1459
|
+
--sd-tone-date-fg: #c2410c;
|
|
1460
|
+
--sd-tone-date-border: #fed7aa;
|
|
1461
|
+
--sd-tone-string-bg: #ecfdf5;
|
|
1462
|
+
--sd-tone-string-fg: #047857;
|
|
1463
|
+
--sd-tone-string-border: #a7f3d0;
|
|
1464
|
+
--sd-sql-keyword: #6d28d9;
|
|
1465
|
+
--sd-sql-bind: #b45309;
|
|
1351
1466
|
}
|
|
1352
1467
|
|
|
1353
1468
|
@media (prefers-color-scheme: dark) {
|
|
@@ -1375,6 +1490,23 @@ const Pe = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Kr = `
|
|
|
1375
1490
|
--sd-loading-bg: rgba(59, 130, 246, 0.12);
|
|
1376
1491
|
--sd-loading-fg: #93c5fd;
|
|
1377
1492
|
--sd-loading-border: rgba(59, 130, 246, 0.35);
|
|
1493
|
+
--sd-tone-metric-bg: rgba(139, 92, 246, 0.14);
|
|
1494
|
+
--sd-tone-metric-fg: #c4b5fd;
|
|
1495
|
+
--sd-tone-metric-border: rgba(139, 92, 246, 0.4);
|
|
1496
|
+
--sd-tone-records-bg: rgba(14, 165, 233, 0.14);
|
|
1497
|
+
--sd-tone-records-fg: #7dd3fc;
|
|
1498
|
+
--sd-tone-records-border: rgba(14, 165, 233, 0.4);
|
|
1499
|
+
--sd-tone-analysis-bg: rgba(245, 158, 11, 0.14);
|
|
1500
|
+
--sd-tone-analysis-fg: #fcd34d;
|
|
1501
|
+
--sd-tone-analysis-border: rgba(245, 158, 11, 0.4);
|
|
1502
|
+
--sd-tone-date-bg: rgba(249, 115, 22, 0.14);
|
|
1503
|
+
--sd-tone-date-fg: #fdba74;
|
|
1504
|
+
--sd-tone-date-border: rgba(249, 115, 22, 0.4);
|
|
1505
|
+
--sd-tone-string-bg: rgba(16, 185, 129, 0.14);
|
|
1506
|
+
--sd-tone-string-fg: #6ee7b7;
|
|
1507
|
+
--sd-tone-string-border: rgba(16, 185, 129, 0.4);
|
|
1508
|
+
--sd-sql-keyword: #c4b5fd;
|
|
1509
|
+
--sd-sql-bind: #fcd34d;
|
|
1378
1510
|
}
|
|
1379
1511
|
}
|
|
1380
1512
|
|
|
@@ -1386,19 +1518,19 @@ const Pe = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Kr = `
|
|
|
1386
1518
|
word-break: break-all;
|
|
1387
1519
|
}
|
|
1388
1520
|
`;
|
|
1389
|
-
function
|
|
1390
|
-
if (typeof document > "u" || document.getElementById(
|
|
1521
|
+
function yr() {
|
|
1522
|
+
if (typeof document > "u" || document.getElementById(Ue))
|
|
1391
1523
|
return;
|
|
1392
1524
|
const e = document.createElement("style");
|
|
1393
|
-
e.id =
|
|
1525
|
+
e.id = Ue, e.textContent = Ht, document.head.appendChild(e);
|
|
1394
1526
|
}
|
|
1395
|
-
const
|
|
1527
|
+
const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', N = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Ie = {
|
|
1396
1528
|
color: "var(--sd-fg-muted)",
|
|
1397
1529
|
fontSize: 10,
|
|
1398
1530
|
fontWeight: 600,
|
|
1399
1531
|
textTransform: "uppercase",
|
|
1400
1532
|
letterSpacing: "0.08em"
|
|
1401
|
-
},
|
|
1533
|
+
}, s = {
|
|
1402
1534
|
launcher: {
|
|
1403
1535
|
position: "fixed",
|
|
1404
1536
|
bottom: 20,
|
|
@@ -1413,7 +1545,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1413
1545
|
borderStyle: "solid",
|
|
1414
1546
|
borderRadius: 6,
|
|
1415
1547
|
boxShadow: "var(--sd-shadow)",
|
|
1416
|
-
font: `600 12px/1.2 ${
|
|
1548
|
+
font: `600 12px/1.2 ${ue}`,
|
|
1417
1549
|
cursor: "pointer"
|
|
1418
1550
|
},
|
|
1419
1551
|
launcherText: {
|
|
@@ -1421,14 +1553,17 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1421
1553
|
},
|
|
1422
1554
|
launcherIssueCount: {
|
|
1423
1555
|
display: "grid",
|
|
1424
|
-
minWidth:
|
|
1425
|
-
height:
|
|
1556
|
+
minWidth: 18,
|
|
1557
|
+
height: 18,
|
|
1558
|
+
padding: "0 6px",
|
|
1426
1559
|
placeItems: "center",
|
|
1427
|
-
borderRadius:
|
|
1428
|
-
|
|
1429
|
-
|
|
1560
|
+
borderRadius: 999,
|
|
1561
|
+
border: "1px solid currentColor",
|
|
1562
|
+
background: "var(--sd-bg)",
|
|
1563
|
+
color: "currentColor",
|
|
1430
1564
|
fontSize: 10,
|
|
1431
|
-
lineHeight: "
|
|
1565
|
+
lineHeight: "18px",
|
|
1566
|
+
whiteSpace: "nowrap"
|
|
1432
1567
|
},
|
|
1433
1568
|
logoMark: {
|
|
1434
1569
|
display: "grid",
|
|
@@ -1455,7 +1590,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1455
1590
|
background: "var(--sd-bg)",
|
|
1456
1591
|
color: "var(--sd-fg)",
|
|
1457
1592
|
boxShadow: "var(--sd-shadow)",
|
|
1458
|
-
font: `13px/1.4 ${
|
|
1593
|
+
font: `13px/1.4 ${ue}`
|
|
1459
1594
|
},
|
|
1460
1595
|
panelFullscreen: {
|
|
1461
1596
|
top: 0,
|
|
@@ -1524,7 +1659,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1524
1659
|
outline: 0,
|
|
1525
1660
|
background: "transparent",
|
|
1526
1661
|
color: "var(--sd-fg)",
|
|
1527
|
-
font: `12px/1.4 ${
|
|
1662
|
+
font: `12px/1.4 ${ue}`
|
|
1528
1663
|
},
|
|
1529
1664
|
panelBody: {
|
|
1530
1665
|
display: "grid",
|
|
@@ -1550,7 +1685,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1550
1685
|
alignItems: "center",
|
|
1551
1686
|
justifyContent: "space-between",
|
|
1552
1687
|
padding: "4px 6px 3px",
|
|
1553
|
-
...
|
|
1688
|
+
...Ie
|
|
1554
1689
|
},
|
|
1555
1690
|
queryGroupCount: {
|
|
1556
1691
|
color: "var(--sd-fg-subtle)",
|
|
@@ -1603,25 +1738,34 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1603
1738
|
},
|
|
1604
1739
|
queryListKindChip: {
|
|
1605
1740
|
flex: "0 0 auto",
|
|
1606
|
-
|
|
1741
|
+
display: "inline-flex",
|
|
1742
|
+
alignItems: "center",
|
|
1743
|
+
height: 15,
|
|
1744
|
+
padding: "0 5px",
|
|
1745
|
+
borderWidth: 1,
|
|
1746
|
+
borderStyle: "solid",
|
|
1747
|
+
borderColor: "var(--sd-border)",
|
|
1748
|
+
borderRadius: 3,
|
|
1749
|
+
background: "var(--sd-bg-accent)",
|
|
1750
|
+
color: "var(--sd-fg-muted)",
|
|
1751
|
+
fontFamily: N,
|
|
1607
1752
|
fontSize: 9,
|
|
1608
1753
|
fontWeight: 600,
|
|
1609
1754
|
textTransform: "uppercase",
|
|
1610
|
-
letterSpacing: "0.
|
|
1755
|
+
letterSpacing: "0.06em"
|
|
1611
1756
|
},
|
|
1612
1757
|
queryListSource: {
|
|
1613
1758
|
minWidth: 0,
|
|
1614
1759
|
paddingLeft: 14,
|
|
1615
1760
|
color: "var(--sd-fg-muted)",
|
|
1616
1761
|
fontSize: 11,
|
|
1617
|
-
lineHeight: 1.35
|
|
1762
|
+
lineHeight: 1.35,
|
|
1763
|
+
overflow: "hidden",
|
|
1764
|
+
textOverflow: "ellipsis",
|
|
1765
|
+
whiteSpace: "nowrap"
|
|
1618
1766
|
},
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
paddingLeft: 14,
|
|
1622
|
-
color: "var(--sd-fg-subtle)",
|
|
1623
|
-
fontSize: 10,
|
|
1624
|
-
lineHeight: 1.3
|
|
1767
|
+
queryListSubtitleSep: {
|
|
1768
|
+
color: "var(--sd-fg-subtle)"
|
|
1625
1769
|
},
|
|
1626
1770
|
detailsPane: {
|
|
1627
1771
|
minHeight: 0,
|
|
@@ -1658,44 +1802,148 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1658
1802
|
detailsKindChip: {
|
|
1659
1803
|
flex: "0 0 auto",
|
|
1660
1804
|
padding: "2px 6px",
|
|
1805
|
+
borderWidth: 1,
|
|
1806
|
+
borderStyle: "solid",
|
|
1807
|
+
borderColor: "var(--sd-border)",
|
|
1661
1808
|
borderRadius: 3,
|
|
1662
1809
|
background: "var(--sd-bg-accent)",
|
|
1663
1810
|
color: "var(--sd-fg-muted)",
|
|
1811
|
+
fontFamily: N,
|
|
1664
1812
|
fontSize: 10,
|
|
1665
1813
|
fontWeight: 600,
|
|
1666
1814
|
textTransform: "uppercase",
|
|
1667
|
-
letterSpacing: "0.
|
|
1815
|
+
letterSpacing: "0.06em"
|
|
1668
1816
|
},
|
|
1669
|
-
|
|
1817
|
+
metaStrip: {
|
|
1670
1818
|
display: "flex",
|
|
1671
1819
|
flexWrap: "wrap",
|
|
1672
1820
|
alignItems: "center",
|
|
1673
|
-
columnGap:
|
|
1821
|
+
columnGap: 6,
|
|
1674
1822
|
rowGap: 2,
|
|
1823
|
+
paddingLeft: 16,
|
|
1675
1824
|
color: "var(--sd-fg-muted)",
|
|
1676
1825
|
fontSize: 11
|
|
1677
1826
|
},
|
|
1678
|
-
|
|
1827
|
+
metaStripItem: {
|
|
1828
|
+
color: "var(--sd-fg-muted)",
|
|
1829
|
+
fontVariantNumeric: "tabular-nums"
|
|
1830
|
+
},
|
|
1831
|
+
metaStripDot: {
|
|
1832
|
+
color: "var(--sd-fg-subtle)"
|
|
1833
|
+
},
|
|
1834
|
+
sourcePillRow: {
|
|
1835
|
+
display: "flex",
|
|
1836
|
+
flexWrap: "wrap",
|
|
1837
|
+
gap: 6
|
|
1838
|
+
},
|
|
1839
|
+
sourcePill: {
|
|
1679
1840
|
display: "inline-flex",
|
|
1680
1841
|
alignItems: "center",
|
|
1681
|
-
gap:
|
|
1842
|
+
gap: 6,
|
|
1843
|
+
padding: "4px 7px",
|
|
1844
|
+
borderWidth: 1,
|
|
1845
|
+
borderStyle: "solid",
|
|
1846
|
+
borderColor: "var(--sd-border)",
|
|
1847
|
+
borderRadius: 5,
|
|
1848
|
+
background: "var(--sd-bg)",
|
|
1849
|
+
color: "var(--sd-fg)"
|
|
1682
1850
|
},
|
|
1683
|
-
|
|
1684
|
-
fontFamily:
|
|
1851
|
+
sourcePillLabel: {
|
|
1852
|
+
fontFamily: N,
|
|
1853
|
+
fontSize: 11,
|
|
1854
|
+
color: "var(--sd-fg)"
|
|
1685
1855
|
},
|
|
1686
|
-
|
|
1687
|
-
|
|
1856
|
+
sourcePillRole: {
|
|
1857
|
+
display: "inline-flex",
|
|
1858
|
+
alignItems: "center",
|
|
1859
|
+
height: 14,
|
|
1860
|
+
padding: "0 4px",
|
|
1861
|
+
borderRadius: 3,
|
|
1862
|
+
background: "var(--sd-bg-accent)",
|
|
1863
|
+
color: "var(--sd-fg-subtle)",
|
|
1864
|
+
fontFamily: N,
|
|
1865
|
+
fontSize: 9,
|
|
1866
|
+
textTransform: "uppercase",
|
|
1867
|
+
letterSpacing: "0.06em"
|
|
1868
|
+
},
|
|
1869
|
+
fieldChipList: {
|
|
1870
|
+
display: "grid",
|
|
1871
|
+
gap: 5,
|
|
1872
|
+
paddingTop: 6
|
|
1873
|
+
},
|
|
1874
|
+
fieldChip: {
|
|
1875
|
+
display: "flex",
|
|
1876
|
+
alignItems: "center",
|
|
1877
|
+
gap: 8,
|
|
1878
|
+
minWidth: 0,
|
|
1879
|
+
padding: "6px 9px",
|
|
1880
|
+
borderWidth: 1,
|
|
1881
|
+
borderStyle: "solid",
|
|
1882
|
+
borderColor: "var(--sd-border)",
|
|
1883
|
+
borderRadius: 5,
|
|
1884
|
+
background: "var(--sd-bg)"
|
|
1688
1885
|
},
|
|
1689
|
-
|
|
1886
|
+
fieldGlyph: {
|
|
1887
|
+
display: "inline-flex",
|
|
1888
|
+
flex: "0 0 auto",
|
|
1889
|
+
alignItems: "center",
|
|
1890
|
+
justifyContent: "center",
|
|
1891
|
+
width: 18,
|
|
1892
|
+
height: 18,
|
|
1893
|
+
borderWidth: 1,
|
|
1894
|
+
borderStyle: "solid",
|
|
1895
|
+
borderRadius: 4,
|
|
1896
|
+
fontFamily: N,
|
|
1897
|
+
fontSize: 11,
|
|
1898
|
+
fontWeight: 700,
|
|
1899
|
+
lineHeight: 1
|
|
1900
|
+
},
|
|
1901
|
+
fieldAggBadge: {
|
|
1902
|
+
display: "inline-flex",
|
|
1903
|
+
alignItems: "center",
|
|
1904
|
+
height: 16,
|
|
1905
|
+
padding: "0 5px",
|
|
1906
|
+
borderRadius: 3,
|
|
1907
|
+
background: "var(--sd-bg-accent)",
|
|
1690
1908
|
color: "var(--sd-fg)",
|
|
1691
|
-
|
|
1909
|
+
fontFamily: N,
|
|
1910
|
+
fontSize: 10,
|
|
1911
|
+
fontWeight: 600,
|
|
1912
|
+
letterSpacing: "0.04em"
|
|
1913
|
+
},
|
|
1914
|
+
fieldChipName: {
|
|
1915
|
+
flex: 1,
|
|
1916
|
+
minWidth: 0,
|
|
1917
|
+
overflow: "hidden",
|
|
1918
|
+
textOverflow: "ellipsis",
|
|
1919
|
+
whiteSpace: "nowrap",
|
|
1920
|
+
color: "var(--sd-fg)",
|
|
1921
|
+
fontSize: 12,
|
|
1922
|
+
fontWeight: 500
|
|
1923
|
+
},
|
|
1924
|
+
fieldChipMeta: {
|
|
1925
|
+
flex: "0 0 auto",
|
|
1926
|
+
fontFamily: N,
|
|
1927
|
+
fontSize: 10,
|
|
1928
|
+
color: "var(--sd-fg-subtle)"
|
|
1929
|
+
},
|
|
1930
|
+
fieldChipMetaDot: {
|
|
1931
|
+
color: "var(--sd-fg-subtle)",
|
|
1932
|
+
fontSize: 10
|
|
1933
|
+
},
|
|
1934
|
+
sqlKeyword: {
|
|
1935
|
+
color: "var(--sd-sql-keyword)",
|
|
1936
|
+
fontWeight: 600
|
|
1937
|
+
},
|
|
1938
|
+
sqlBindParam: {
|
|
1939
|
+
color: "var(--sd-sql-bind)"
|
|
1692
1940
|
},
|
|
1693
1941
|
disclosure: {
|
|
1694
1942
|
marginTop: 16
|
|
1695
1943
|
},
|
|
1696
1944
|
disclosureSummary: {
|
|
1697
1945
|
cursor: "pointer",
|
|
1698
|
-
...
|
|
1946
|
+
...Ie
|
|
1699
1947
|
},
|
|
1700
1948
|
disclosureBody: {
|
|
1701
1949
|
marginTop: 8
|
|
@@ -1740,38 +1988,6 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1740
1988
|
display: "grid",
|
|
1741
1989
|
gap: 12
|
|
1742
1990
|
},
|
|
1743
|
-
recipeSummary: {
|
|
1744
|
-
display: "grid",
|
|
1745
|
-
gap: 4,
|
|
1746
|
-
padding: "8px 10px",
|
|
1747
|
-
border: "1px solid var(--sd-border)",
|
|
1748
|
-
borderRadius: 5,
|
|
1749
|
-
background: "var(--sd-bg-muted)",
|
|
1750
|
-
color: "var(--sd-fg)",
|
|
1751
|
-
fontSize: 12
|
|
1752
|
-
},
|
|
1753
|
-
recipeSummaryRow: {
|
|
1754
|
-
display: "grid",
|
|
1755
|
-
gridTemplateColumns: "76px minmax(0, 1fr)",
|
|
1756
|
-
gap: 8,
|
|
1757
|
-
minWidth: 0,
|
|
1758
|
-
alignItems: "baseline"
|
|
1759
|
-
},
|
|
1760
|
-
recipeSummaryLabel: {
|
|
1761
|
-
color: "var(--sd-fg-subtle)",
|
|
1762
|
-
fontSize: 10,
|
|
1763
|
-
fontWeight: 600,
|
|
1764
|
-
textTransform: "uppercase",
|
|
1765
|
-
letterSpacing: "0.08em"
|
|
1766
|
-
},
|
|
1767
|
-
recipeSummaryValue: {
|
|
1768
|
-
minWidth: 0,
|
|
1769
|
-
overflow: "hidden",
|
|
1770
|
-
textOverflow: "ellipsis",
|
|
1771
|
-
whiteSpace: "nowrap",
|
|
1772
|
-
color: "var(--sd-fg)",
|
|
1773
|
-
fontSize: 12
|
|
1774
|
-
},
|
|
1775
1991
|
recipeGroup: {
|
|
1776
1992
|
display: "grid",
|
|
1777
1993
|
gap: 4
|
|
@@ -1833,10 +2049,6 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1833
2049
|
fontSize: 11,
|
|
1834
2050
|
textAlign: "right"
|
|
1835
2051
|
},
|
|
1836
|
-
recipeFieldMetaDivider: {
|
|
1837
|
-
color: "var(--sd-fg-subtle)",
|
|
1838
|
-
margin: "0 4px"
|
|
1839
|
-
},
|
|
1840
2052
|
inputsAppliedBlock: {
|
|
1841
2053
|
marginTop: 16,
|
|
1842
2054
|
padding: "10px 12px",
|
|
@@ -1887,7 +2099,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1887
2099
|
textOverflow: "ellipsis",
|
|
1888
2100
|
whiteSpace: "nowrap",
|
|
1889
2101
|
color: "var(--sd-fg)",
|
|
1890
|
-
fontFamily:
|
|
2102
|
+
fontFamily: N,
|
|
1891
2103
|
fontSize: 11,
|
|
1892
2104
|
fontWeight: 600
|
|
1893
2105
|
},
|
|
@@ -1900,7 +2112,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1900
2112
|
borderRadius: 3,
|
|
1901
2113
|
background: "var(--sd-bg-accent)",
|
|
1902
2114
|
color: "var(--sd-fg-muted)",
|
|
1903
|
-
fontFamily:
|
|
2115
|
+
fontFamily: N,
|
|
1904
2116
|
fontSize: 10,
|
|
1905
2117
|
textTransform: "uppercase",
|
|
1906
2118
|
letterSpacing: "0.06em"
|
|
@@ -1959,7 +2171,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1959
2171
|
gap: 5
|
|
1960
2172
|
},
|
|
1961
2173
|
codeBlockLabel: {
|
|
1962
|
-
...
|
|
2174
|
+
...Ie
|
|
1963
2175
|
},
|
|
1964
2176
|
codeBlock: {
|
|
1965
2177
|
maxHeight: 260,
|
|
@@ -1970,7 +2182,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1970
2182
|
borderRadius: 5,
|
|
1971
2183
|
background: "var(--sd-bg-muted)",
|
|
1972
2184
|
color: "var(--sd-fg)",
|
|
1973
|
-
fontFamily:
|
|
2185
|
+
fontFamily: N,
|
|
1974
2186
|
fontSize: 11,
|
|
1975
2187
|
lineHeight: 1.5,
|
|
1976
2188
|
whiteSpace: "pre-wrap"
|
|
@@ -1992,7 +2204,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1992
2204
|
borderStyle: "solid",
|
|
1993
2205
|
borderRadius: 5,
|
|
1994
2206
|
background: "var(--sd-bg)",
|
|
1995
|
-
font: `600 11px/1 ${
|
|
2207
|
+
font: `600 11px/1 ${ue}`,
|
|
1996
2208
|
cursor: "pointer"
|
|
1997
2209
|
},
|
|
1998
2210
|
inspectButtonText: {
|
|
@@ -2001,7 +2213,7 @@ const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2001
2213
|
whiteSpace: "nowrap"
|
|
2002
2214
|
}
|
|
2003
2215
|
};
|
|
2004
|
-
function
|
|
2216
|
+
function hr(e) {
|
|
2005
2217
|
return {
|
|
2006
2218
|
...e,
|
|
2007
2219
|
order: [],
|
|
@@ -2009,88 +2221,88 @@ function yt(e) {
|
|
|
2009
2221
|
sequence: 0
|
|
2010
2222
|
};
|
|
2011
2223
|
}
|
|
2012
|
-
function
|
|
2013
|
-
if (
|
|
2014
|
-
return
|
|
2224
|
+
function Mt(e, r) {
|
|
2225
|
+
if (r.type === "config")
|
|
2226
|
+
return r.config.enabled ? {
|
|
2015
2227
|
...e,
|
|
2016
|
-
...
|
|
2017
|
-
} :
|
|
2228
|
+
...r.config
|
|
2229
|
+
} : hr(r.config);
|
|
2018
2230
|
if (!e.enabled)
|
|
2019
2231
|
return e;
|
|
2020
|
-
switch (
|
|
2232
|
+
switch (r.type) {
|
|
2021
2233
|
case "register":
|
|
2022
|
-
return
|
|
2234
|
+
return Vt(jt(e, r.descriptor));
|
|
2023
2235
|
case "unregister":
|
|
2024
|
-
return
|
|
2236
|
+
return Pt(e, r.traceKey);
|
|
2025
2237
|
case "event":
|
|
2026
|
-
return
|
|
2238
|
+
return Qt(e, r);
|
|
2027
2239
|
default:
|
|
2028
2240
|
return e;
|
|
2029
2241
|
}
|
|
2030
2242
|
}
|
|
2031
|
-
function
|
|
2032
|
-
const
|
|
2033
|
-
...
|
|
2034
|
-
...
|
|
2035
|
-
traceKey:
|
|
2036
|
-
latestAttempt: (
|
|
2037
|
-
recentEvents: (
|
|
2243
|
+
function jt(e, r) {
|
|
2244
|
+
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = $e(), d = {
|
|
2245
|
+
...t || Ut(r),
|
|
2246
|
+
...vr(r),
|
|
2247
|
+
traceKey: r.traceKey,
|
|
2248
|
+
latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
|
|
2249
|
+
recentEvents: (t == null ? void 0 : t.recentEvents) || [],
|
|
2038
2250
|
mounted: !0,
|
|
2039
|
-
registeredAt: (
|
|
2040
|
-
lastEventAt: (
|
|
2251
|
+
registeredAt: (t == null ? void 0 : t.registeredAt) || n,
|
|
2252
|
+
lastEventAt: (t == null ? void 0 : t.lastEventAt) || i
|
|
2041
2253
|
};
|
|
2042
2254
|
return {
|
|
2043
2255
|
...e,
|
|
2044
2256
|
sequence: n,
|
|
2045
|
-
order:
|
|
2257
|
+
order: t ? e.order : [...e.order, r.traceKey],
|
|
2046
2258
|
entries: {
|
|
2047
2259
|
...e.entries,
|
|
2048
|
-
[
|
|
2260
|
+
[r.traceKey]: d
|
|
2049
2261
|
}
|
|
2050
2262
|
};
|
|
2051
2263
|
}
|
|
2052
|
-
function
|
|
2053
|
-
const
|
|
2054
|
-
return
|
|
2264
|
+
function Pt(e, r) {
|
|
2265
|
+
const t = e.entries[r];
|
|
2266
|
+
return t ? {
|
|
2055
2267
|
...e,
|
|
2056
2268
|
entries: {
|
|
2057
2269
|
...e.entries,
|
|
2058
|
-
[
|
|
2059
|
-
...
|
|
2270
|
+
[r]: {
|
|
2271
|
+
...t,
|
|
2060
2272
|
mounted: !1
|
|
2061
2273
|
}
|
|
2062
2274
|
}
|
|
2063
2275
|
} : e;
|
|
2064
2276
|
}
|
|
2065
|
-
function
|
|
2066
|
-
const
|
|
2067
|
-
if (!
|
|
2277
|
+
function Qt(e, r) {
|
|
2278
|
+
const t = e.entries[r.traceKey];
|
|
2279
|
+
if (!t)
|
|
2068
2280
|
return e;
|
|
2069
|
-
const n =
|
|
2070
|
-
...
|
|
2071
|
-
|
|
2281
|
+
const n = $e(), i = [
|
|
2282
|
+
...t.recentEvents,
|
|
2283
|
+
r.event
|
|
2072
2284
|
].slice(-e.maxEventsPerQuery);
|
|
2073
2285
|
return {
|
|
2074
2286
|
...e,
|
|
2075
2287
|
entries: {
|
|
2076
2288
|
...e.entries,
|
|
2077
|
-
[
|
|
2078
|
-
...
|
|
2079
|
-
latestAttempt:
|
|
2080
|
-
...
|
|
2081
|
-
...
|
|
2082
|
-
} :
|
|
2289
|
+
[r.traceKey]: {
|
|
2290
|
+
...t,
|
|
2291
|
+
latestAttempt: r.latestAttempt ? {
|
|
2292
|
+
...t.latestAttempt,
|
|
2293
|
+
...r.latestAttempt
|
|
2294
|
+
} : t.latestAttempt,
|
|
2083
2295
|
recentEvents: i,
|
|
2084
2296
|
lastEventAt: n
|
|
2085
2297
|
}
|
|
2086
2298
|
}
|
|
2087
2299
|
};
|
|
2088
2300
|
}
|
|
2089
|
-
function
|
|
2301
|
+
function Vt(e) {
|
|
2090
2302
|
if (e.order.length <= e.maxQueries)
|
|
2091
2303
|
return e;
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2304
|
+
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, d) => i.mounted !== d.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - d.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
|
|
2305
|
+
r.slice(0, t).map((i) => i.traceKey)
|
|
2094
2306
|
);
|
|
2095
2307
|
return n.size ? {
|
|
2096
2308
|
...e,
|
|
@@ -2100,26 +2312,26 @@ function Wr(e) {
|
|
|
2100
2312
|
)
|
|
2101
2313
|
} : e;
|
|
2102
2314
|
}
|
|
2103
|
-
function
|
|
2104
|
-
const
|
|
2315
|
+
function Ut(e) {
|
|
2316
|
+
const r = $e();
|
|
2105
2317
|
return {
|
|
2106
|
-
...
|
|
2318
|
+
...vr(e),
|
|
2107
2319
|
traceKey: e.traceKey,
|
|
2108
2320
|
latestAttempt: { status: "idle" },
|
|
2109
2321
|
recentEvents: [],
|
|
2110
2322
|
mounted: !0,
|
|
2111
2323
|
registeredAt: 0,
|
|
2112
|
-
lastEventAt:
|
|
2324
|
+
lastEventAt: r
|
|
2113
2325
|
};
|
|
2114
2326
|
}
|
|
2115
|
-
function
|
|
2327
|
+
function vr(e) {
|
|
2116
2328
|
var n;
|
|
2117
|
-
const
|
|
2329
|
+
const r = an(e.spec), t = dn(
|
|
2118
2330
|
e.spec,
|
|
2119
2331
|
e.activeInputs
|
|
2120
2332
|
);
|
|
2121
2333
|
return {
|
|
2122
|
-
traceId:
|
|
2334
|
+
traceId: xr(e.traceKey),
|
|
2123
2335
|
viewId: e.viewId,
|
|
2124
2336
|
viewTitle: e.viewTitle,
|
|
2125
2337
|
visualType: e.visualType,
|
|
@@ -2128,161 +2340,161 @@ function gt(e) {
|
|
|
2128
2340
|
queryLabel: e.queryLabel,
|
|
2129
2341
|
queryKind: e.queryKind,
|
|
2130
2342
|
builder: e.builder,
|
|
2131
|
-
sourceRefs:
|
|
2343
|
+
sourceRefs: sn(e.intent),
|
|
2132
2344
|
sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
|
|
2133
|
-
projectionFieldRefs:
|
|
2134
|
-
inputFieldRefs:
|
|
2135
|
-
fieldRefs:
|
|
2345
|
+
projectionFieldRefs: r,
|
|
2346
|
+
inputFieldRefs: t,
|
|
2347
|
+
fieldRefs: ln(e.intent),
|
|
2136
2348
|
inputsApplied: (e.activeInputs || []).map((i) => ({
|
|
2137
2349
|
inputId: i.inputId,
|
|
2138
2350
|
fieldRef: i.field,
|
|
2139
2351
|
operator: i.operator,
|
|
2140
|
-
valuePreview:
|
|
2352
|
+
valuePreview: nn(i)
|
|
2141
2353
|
})),
|
|
2142
2354
|
recentEvents: [],
|
|
2143
2355
|
clientWarnings: e.clientWarnings
|
|
2144
2356
|
};
|
|
2145
2357
|
}
|
|
2146
|
-
function
|
|
2358
|
+
function pe(e) {
|
|
2147
2359
|
const {
|
|
2148
|
-
traceKey:
|
|
2149
|
-
mounted:
|
|
2360
|
+
traceKey: r,
|
|
2361
|
+
mounted: t,
|
|
2150
2362
|
registeredAt: n,
|
|
2151
2363
|
lastEventAt: i,
|
|
2152
|
-
...
|
|
2364
|
+
...d
|
|
2153
2365
|
} = e;
|
|
2154
|
-
return
|
|
2366
|
+
return d;
|
|
2155
2367
|
}
|
|
2156
|
-
function
|
|
2368
|
+
function ge(e) {
|
|
2157
2369
|
return e.enabled ? {
|
|
2158
2370
|
enabled: !0,
|
|
2159
|
-
queries: e.order.map((
|
|
2160
|
-
getQuery: (
|
|
2371
|
+
queries: e.order.map((t) => e.entries[t]).filter((t) => !!t).map(pe),
|
|
2372
|
+
getQuery: (t) => {
|
|
2161
2373
|
const n = Object.values(e.entries).find(
|
|
2162
|
-
(i) => i.queryId ===
|
|
2374
|
+
(i) => i.queryId === t
|
|
2163
2375
|
);
|
|
2164
|
-
return n ?
|
|
2376
|
+
return n ? pe(n) : void 0;
|
|
2165
2377
|
},
|
|
2166
|
-
getQueries: (
|
|
2167
|
-
} :
|
|
2378
|
+
getQueries: (t) => Object.values(e.entries).filter((n) => n.queryId === t).map(pe)
|
|
2379
|
+
} : ar;
|
|
2168
2380
|
}
|
|
2169
|
-
function
|
|
2381
|
+
function Gt(e) {
|
|
2170
2382
|
return {
|
|
2171
|
-
snapshot: () =>
|
|
2172
|
-
getQuery: (
|
|
2173
|
-
getQueries: (
|
|
2383
|
+
snapshot: () => Jt(ge(e())),
|
|
2384
|
+
getQuery: (r) => Ge(ge(e()).getQuery(r)),
|
|
2385
|
+
getQueries: (r) => ge(e()).getQueries(r).map((t) => Ge(t)).filter((t) => !!t)
|
|
2174
2386
|
};
|
|
2175
2387
|
}
|
|
2176
|
-
function
|
|
2388
|
+
function Jt(e) {
|
|
2177
2389
|
if (!e.enabled)
|
|
2178
2390
|
return e;
|
|
2179
|
-
const
|
|
2391
|
+
const r = e.queries.map(br);
|
|
2180
2392
|
return {
|
|
2181
2393
|
enabled: e.enabled,
|
|
2182
|
-
queries:
|
|
2183
|
-
getQuery: (
|
|
2184
|
-
getQueries: (
|
|
2394
|
+
queries: r,
|
|
2395
|
+
getQuery: (t) => r.find((n) => n.queryId === t),
|
|
2396
|
+
getQueries: (t) => r.filter((n) => n.queryId === t)
|
|
2185
2397
|
};
|
|
2186
2398
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return e ?
|
|
2399
|
+
function Ge(e) {
|
|
2400
|
+
return e ? br(e) : void 0;
|
|
2189
2401
|
}
|
|
2190
|
-
function
|
|
2191
|
-
var
|
|
2192
|
-
return (
|
|
2402
|
+
function br(e) {
|
|
2403
|
+
var r;
|
|
2404
|
+
return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
|
|
2193
2405
|
...e,
|
|
2194
2406
|
latestAttempt: {
|
|
2195
2407
|
...e.latestAttempt,
|
|
2196
|
-
executionResult:
|
|
2408
|
+
executionResult: Yt(
|
|
2197
2409
|
e.latestAttempt.executionResult
|
|
2198
2410
|
)
|
|
2199
2411
|
}
|
|
2200
2412
|
} : e;
|
|
2201
2413
|
}
|
|
2202
|
-
function
|
|
2414
|
+
function Yt(e) {
|
|
2203
2415
|
const {
|
|
2204
|
-
compiledQuery:
|
|
2205
|
-
intent:
|
|
2416
|
+
compiledQuery: r,
|
|
2417
|
+
intent: t,
|
|
2206
2418
|
result: n,
|
|
2207
2419
|
...i
|
|
2208
|
-
} = e,
|
|
2420
|
+
} = e, d = Xt(
|
|
2209
2421
|
i.metadata
|
|
2210
2422
|
);
|
|
2211
2423
|
return {
|
|
2212
2424
|
...i,
|
|
2213
|
-
...
|
|
2425
|
+
...d ? { metadata: d } : {}
|
|
2214
2426
|
};
|
|
2215
2427
|
}
|
|
2216
|
-
function
|
|
2428
|
+
function Xt(e) {
|
|
2217
2429
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2218
2430
|
return e;
|
|
2219
|
-
const
|
|
2220
|
-
if (!
|
|
2431
|
+
const r = e.dataAppDebug;
|
|
2432
|
+
if (!r || typeof r != "object" || Array.isArray(r))
|
|
2221
2433
|
return e;
|
|
2222
|
-
const { compiledSql:
|
|
2434
|
+
const { compiledSql: t, ...n } = r;
|
|
2223
2435
|
return {
|
|
2224
2436
|
...e,
|
|
2225
2437
|
dataAppDebug: n
|
|
2226
2438
|
};
|
|
2227
2439
|
}
|
|
2228
|
-
function
|
|
2440
|
+
function Zt(e) {
|
|
2229
2441
|
return e === void 0 || e === !1 ? {
|
|
2230
2442
|
enabled: !1,
|
|
2231
2443
|
exposeWindowBridge: !1,
|
|
2232
|
-
maxEventsPerQuery:
|
|
2233
|
-
maxQueries:
|
|
2444
|
+
maxEventsPerQuery: be,
|
|
2445
|
+
maxQueries: Se
|
|
2234
2446
|
} : e === !0 ? {
|
|
2235
2447
|
enabled: !0,
|
|
2236
2448
|
exposeWindowBridge: !1,
|
|
2237
|
-
maxEventsPerQuery:
|
|
2238
|
-
maxQueries:
|
|
2449
|
+
maxEventsPerQuery: be,
|
|
2450
|
+
maxQueries: Se
|
|
2239
2451
|
} : {
|
|
2240
2452
|
enabled: e.enabled !== !1,
|
|
2241
2453
|
exposeWindowBridge: e.exposeWindowBridge === !0,
|
|
2242
|
-
maxEventsPerQuery:
|
|
2454
|
+
maxEventsPerQuery: Ye(
|
|
2243
2455
|
e.maxEventsPerQuery,
|
|
2244
|
-
|
|
2245
|
-
|
|
2456
|
+
be,
|
|
2457
|
+
Qr
|
|
2246
2458
|
),
|
|
2247
|
-
maxQueries:
|
|
2459
|
+
maxQueries: Ye(
|
|
2248
2460
|
e.maxQueries,
|
|
2249
|
-
|
|
2250
|
-
|
|
2461
|
+
Se,
|
|
2462
|
+
Vr
|
|
2251
2463
|
)
|
|
2252
2464
|
};
|
|
2253
2465
|
}
|
|
2254
|
-
function
|
|
2255
|
-
const
|
|
2466
|
+
function en(e) {
|
|
2467
|
+
const t = [
|
|
2256
2468
|
e == null ? void 0 : e.sourceHint,
|
|
2257
2469
|
...(e == null ? void 0 : e.sourceHints) || []
|
|
2258
2470
|
].filter((n) => !!n).map((n) => ({
|
|
2259
|
-
file:
|
|
2260
|
-
line:
|
|
2261
|
-
column:
|
|
2262
|
-
exportName:
|
|
2263
|
-
component:
|
|
2264
|
-
note:
|
|
2471
|
+
file: ce(n.file),
|
|
2472
|
+
line: Je(n.line),
|
|
2473
|
+
column: Je(n.column),
|
|
2474
|
+
exportName: ce(n.exportName),
|
|
2475
|
+
component: ce(n.component),
|
|
2476
|
+
note: ce(n.note)
|
|
2265
2477
|
})).filter(
|
|
2266
2478
|
(n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
|
|
2267
2479
|
);
|
|
2268
|
-
return
|
|
2480
|
+
return t.length ? t : void 0;
|
|
2269
2481
|
}
|
|
2270
|
-
function
|
|
2482
|
+
function ce(e) {
|
|
2271
2483
|
if (typeof e != "string")
|
|
2272
2484
|
return;
|
|
2273
|
-
const
|
|
2274
|
-
return
|
|
2485
|
+
const r = e.trim();
|
|
2486
|
+
return r || void 0;
|
|
2275
2487
|
}
|
|
2276
|
-
function
|
|
2488
|
+
function Je(e) {
|
|
2277
2489
|
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
2278
2490
|
}
|
|
2279
|
-
function
|
|
2280
|
-
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ?
|
|
2491
|
+
function Ye(e, r, t) {
|
|
2492
|
+
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
|
|
2281
2493
|
}
|
|
2282
|
-
function
|
|
2494
|
+
function rn(e) {
|
|
2283
2495
|
return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
|
|
2284
2496
|
}
|
|
2285
|
-
function
|
|
2497
|
+
function tn(e) {
|
|
2286
2498
|
switch (e) {
|
|
2287
2499
|
case "metric":
|
|
2288
2500
|
return "semaphor.metric";
|
|
@@ -2297,143 +2509,143 @@ function Ur(e) {
|
|
|
2297
2509
|
case "sql":
|
|
2298
2510
|
return "semaphor.sql";
|
|
2299
2511
|
default:
|
|
2300
|
-
return
|
|
2512
|
+
return he(e);
|
|
2301
2513
|
}
|
|
2302
2514
|
}
|
|
2303
|
-
function
|
|
2515
|
+
function he(e) {
|
|
2304
2516
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
2305
2517
|
}
|
|
2306
|
-
function
|
|
2307
|
-
if (
|
|
2518
|
+
function nn(e) {
|
|
2519
|
+
if (on(e))
|
|
2308
2520
|
return;
|
|
2309
|
-
const
|
|
2310
|
-
if (
|
|
2311
|
-
if (Array.isArray(
|
|
2312
|
-
const
|
|
2521
|
+
const r = e.value;
|
|
2522
|
+
if (r !== void 0) {
|
|
2523
|
+
if (Array.isArray(r)) {
|
|
2524
|
+
const t = r.filter(
|
|
2313
2525
|
(n) => typeof n == "string" || typeof n == "number" || typeof n == "boolean"
|
|
2314
2526
|
).map((n) => String(n));
|
|
2315
|
-
if (
|
|
2316
|
-
const n =
|
|
2317
|
-
return
|
|
2527
|
+
if (t.length === r.length && t.length > 0) {
|
|
2528
|
+
const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
|
|
2529
|
+
return Xe(`${n}${i}`);
|
|
2318
2530
|
}
|
|
2319
|
-
return `${
|
|
2531
|
+
return `${r.length} selected`;
|
|
2320
2532
|
}
|
|
2321
|
-
return typeof
|
|
2533
|
+
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? Xe(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
|
|
2322
2534
|
}
|
|
2323
2535
|
}
|
|
2324
|
-
function
|
|
2536
|
+
function Xe(e) {
|
|
2325
2537
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
2326
2538
|
}
|
|
2327
|
-
function
|
|
2328
|
-
var
|
|
2329
|
-
const
|
|
2539
|
+
function on(e) {
|
|
2540
|
+
var t;
|
|
2541
|
+
const r = [
|
|
2330
2542
|
e.inputId,
|
|
2331
2543
|
e.label,
|
|
2332
|
-
(
|
|
2544
|
+
(t = e.field) == null ? void 0 : t.name
|
|
2333
2545
|
].filter(Boolean).join(" ").toLowerCase();
|
|
2334
2546
|
return ["token", "secret", "password", "email", "phone", "ssn"].some(
|
|
2335
|
-
(n) =>
|
|
2547
|
+
(n) => r.includes(n)
|
|
2336
2548
|
);
|
|
2337
2549
|
}
|
|
2338
|
-
function
|
|
2339
|
-
const
|
|
2340
|
-
return
|
|
2341
|
-
|
|
2342
|
-
}), [...
|
|
2550
|
+
function sn(e) {
|
|
2551
|
+
const r = /* @__PURE__ */ new Map();
|
|
2552
|
+
return me(e, (t) => {
|
|
2553
|
+
un(t) && r.set(wr(t), t);
|
|
2554
|
+
}), [...r.values()];
|
|
2343
2555
|
}
|
|
2344
|
-
function
|
|
2556
|
+
function an(e) {
|
|
2345
2557
|
switch (e.queryKind) {
|
|
2346
2558
|
case "metric":
|
|
2347
2559
|
case "analysis":
|
|
2348
|
-
return
|
|
2560
|
+
return J([
|
|
2349
2561
|
...e.measures || [],
|
|
2350
2562
|
e.primaryMeasure,
|
|
2351
2563
|
e.dateField,
|
|
2352
2564
|
...e.dimensions || []
|
|
2353
2565
|
]);
|
|
2354
2566
|
case "records":
|
|
2355
|
-
return
|
|
2567
|
+
return J(e.fields || []);
|
|
2356
2568
|
case "inputOptions":
|
|
2357
|
-
return
|
|
2569
|
+
return J([
|
|
2358
2570
|
e.labelField,
|
|
2359
2571
|
e.valueField,
|
|
2360
2572
|
e.searchField,
|
|
2361
2573
|
...e.disambiguationFields || []
|
|
2362
2574
|
]);
|
|
2363
2575
|
case "sql":
|
|
2364
|
-
return
|
|
2576
|
+
return J(e.fields || []);
|
|
2365
2577
|
case "matrix":
|
|
2366
|
-
return
|
|
2367
|
-
...(e.rows || []).map(
|
|
2368
|
-
...(e.columns || []).map(
|
|
2369
|
-
...(e.values || []).map(
|
|
2578
|
+
return J([
|
|
2579
|
+
...(e.rows || []).map(qe),
|
|
2580
|
+
...(e.columns || []).map(qe),
|
|
2581
|
+
...(e.values || []).map(qe)
|
|
2370
2582
|
]);
|
|
2371
2583
|
default:
|
|
2372
|
-
return
|
|
2584
|
+
return he(e);
|
|
2373
2585
|
}
|
|
2374
2586
|
}
|
|
2375
|
-
function
|
|
2376
|
-
const
|
|
2377
|
-
...(e.inputs || []).map(
|
|
2378
|
-
...(
|
|
2587
|
+
function dn(e, r) {
|
|
2588
|
+
const t = [
|
|
2589
|
+
...(e.inputs || []).map(Sr),
|
|
2590
|
+
...(r || []).map((n) => n.field)
|
|
2379
2591
|
];
|
|
2380
|
-
return
|
|
2592
|
+
return J(t);
|
|
2381
2593
|
}
|
|
2382
|
-
function
|
|
2383
|
-
const
|
|
2384
|
-
return e.forEach((
|
|
2385
|
-
|
|
2386
|
-
}), [...
|
|
2594
|
+
function J(e) {
|
|
2595
|
+
const r = /* @__PURE__ */ new Map();
|
|
2596
|
+
return e.forEach((t) => {
|
|
2597
|
+
t && se(t) && r.set(Ne(t), t);
|
|
2598
|
+
}), [...r.values()];
|
|
2387
2599
|
}
|
|
2388
|
-
function
|
|
2600
|
+
function Sr(e) {
|
|
2389
2601
|
if (!e || typeof e != "object")
|
|
2390
2602
|
return;
|
|
2391
|
-
const
|
|
2392
|
-
if (typeof
|
|
2393
|
-
const n =
|
|
2394
|
-
return
|
|
2603
|
+
const r = e.toAnalyticsInput;
|
|
2604
|
+
if (typeof r == "function") {
|
|
2605
|
+
const n = r.call(e);
|
|
2606
|
+
return Sr(n);
|
|
2395
2607
|
}
|
|
2396
|
-
const
|
|
2397
|
-
return
|
|
2608
|
+
const t = e.field;
|
|
2609
|
+
return se(t) ? t : void 0;
|
|
2398
2610
|
}
|
|
2399
|
-
function
|
|
2400
|
-
if (
|
|
2611
|
+
function qe(e) {
|
|
2612
|
+
if (se(e))
|
|
2401
2613
|
return e;
|
|
2402
2614
|
if (!e || typeof e != "object")
|
|
2403
2615
|
return;
|
|
2404
|
-
const
|
|
2405
|
-
return
|
|
2616
|
+
const r = e.field;
|
|
2617
|
+
return se(r) ? r : void 0;
|
|
2406
2618
|
}
|
|
2407
|
-
function
|
|
2408
|
-
const
|
|
2409
|
-
return
|
|
2410
|
-
|
|
2411
|
-
}), [...
|
|
2619
|
+
function ln(e) {
|
|
2620
|
+
const r = /* @__PURE__ */ new Map();
|
|
2621
|
+
return me(e, (t) => {
|
|
2622
|
+
se(t) && r.set(Ne(t), t);
|
|
2623
|
+
}), [...r.values()];
|
|
2412
2624
|
}
|
|
2413
|
-
function
|
|
2625
|
+
function me(e, r) {
|
|
2414
2626
|
if (!(!e || typeof e != "object")) {
|
|
2415
|
-
if (
|
|
2416
|
-
e.forEach((
|
|
2627
|
+
if (r(e), Array.isArray(e)) {
|
|
2628
|
+
e.forEach((t) => me(t, r));
|
|
2417
2629
|
return;
|
|
2418
2630
|
}
|
|
2419
2631
|
Object.values(e).forEach(
|
|
2420
|
-
(
|
|
2632
|
+
(t) => me(t, r)
|
|
2421
2633
|
);
|
|
2422
2634
|
}
|
|
2423
2635
|
}
|
|
2424
|
-
function
|
|
2636
|
+
function un(e) {
|
|
2425
2637
|
if (!e || typeof e != "object")
|
|
2426
2638
|
return !1;
|
|
2427
|
-
const
|
|
2428
|
-
return
|
|
2639
|
+
const r = e;
|
|
2640
|
+
return r.kind === "semantic" ? typeof r.domainId == "string" && typeof r.datasetName == "string" : r.kind === "physical" ? typeof r.connectionId == "string" && typeof r.tableName == "string" : r.kind === "sql" ? typeof r.connectionId == "string" : !1;
|
|
2429
2641
|
}
|
|
2430
|
-
function
|
|
2642
|
+
function se(e) {
|
|
2431
2643
|
if (!e || typeof e != "object")
|
|
2432
2644
|
return !1;
|
|
2433
|
-
const
|
|
2434
|
-
return typeof
|
|
2645
|
+
const r = e;
|
|
2646
|
+
return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
|
|
2435
2647
|
}
|
|
2436
|
-
function
|
|
2648
|
+
function wr(e) {
|
|
2437
2649
|
return e.kind === "semantic" ? [
|
|
2438
2650
|
e.kind,
|
|
2439
2651
|
e.domainId,
|
|
@@ -2446,43 +2658,43 @@ function bt(e) {
|
|
|
2446
2658
|
e.tableName
|
|
2447
2659
|
].join(":") : [e.kind, e.connectionId].join(":");
|
|
2448
2660
|
}
|
|
2449
|
-
function
|
|
2661
|
+
function Ne(e) {
|
|
2450
2662
|
return [
|
|
2451
2663
|
e.name,
|
|
2452
2664
|
e.role,
|
|
2453
2665
|
e.aggregate,
|
|
2454
|
-
e.source ?
|
|
2666
|
+
e.source ? wr(e.source) : ""
|
|
2455
2667
|
].join(":");
|
|
2456
2668
|
}
|
|
2457
|
-
function
|
|
2458
|
-
const
|
|
2459
|
-
return typeof (
|
|
2669
|
+
function cn(e) {
|
|
2670
|
+
const r = e;
|
|
2671
|
+
return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
|
|
2460
2672
|
}
|
|
2461
|
-
function
|
|
2462
|
-
const
|
|
2463
|
-
return Array.isArray(
|
|
2673
|
+
function fn(e) {
|
|
2674
|
+
const r = e;
|
|
2675
|
+
return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
|
|
2464
2676
|
}
|
|
2465
|
-
function
|
|
2466
|
-
const
|
|
2467
|
-
return
|
|
2677
|
+
function Ze(e) {
|
|
2678
|
+
const r = e;
|
|
2679
|
+
return r == null ? void 0 : r.executionResult;
|
|
2468
2680
|
}
|
|
2469
|
-
function
|
|
2470
|
-
const
|
|
2471
|
-
return typeof (
|
|
2681
|
+
function er(e) {
|
|
2682
|
+
const r = e;
|
|
2683
|
+
return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
|
|
2472
2684
|
}
|
|
2473
|
-
function
|
|
2474
|
-
let
|
|
2475
|
-
for (let
|
|
2476
|
-
|
|
2477
|
-
return (
|
|
2685
|
+
function xr(e) {
|
|
2686
|
+
let r = 2166136261;
|
|
2687
|
+
for (let t = 0; t < e.length; t += 1)
|
|
2688
|
+
r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
|
|
2689
|
+
return (r >>> 0).toString(36);
|
|
2478
2690
|
}
|
|
2479
|
-
function
|
|
2691
|
+
function fe() {
|
|
2480
2692
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2481
2693
|
}
|
|
2482
|
-
function
|
|
2694
|
+
function $e() {
|
|
2483
2695
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
2484
2696
|
}
|
|
2485
|
-
const
|
|
2697
|
+
const pn = [
|
|
2486
2698
|
"records",
|
|
2487
2699
|
"changes",
|
|
2488
2700
|
"drivers",
|
|
@@ -2490,7 +2702,7 @@ const on = [
|
|
|
2490
2702
|
"largestPositiveChanges",
|
|
2491
2703
|
"largestNegativeDrivers",
|
|
2492
2704
|
"largestPositiveDrivers"
|
|
2493
|
-
],
|
|
2705
|
+
], gn = [
|
|
2494
2706
|
"records",
|
|
2495
2707
|
"changes",
|
|
2496
2708
|
"drivers",
|
|
@@ -2499,13 +2711,13 @@ const on = [
|
|
|
2499
2711
|
"largestNegativeDrivers",
|
|
2500
2712
|
"largestPositiveDrivers"
|
|
2501
2713
|
];
|
|
2502
|
-
function
|
|
2714
|
+
function Ir(e) {
|
|
2503
2715
|
if (!e)
|
|
2504
2716
|
return {};
|
|
2505
|
-
const
|
|
2717
|
+
const r = bn(e.executionResult), t = mn(e, r), n = hn(t);
|
|
2506
2718
|
return {
|
|
2507
2719
|
...e,
|
|
2508
|
-
...Object.keys(
|
|
2720
|
+
...Object.keys(t).length ? { resultSets: t } : {},
|
|
2509
2721
|
...n ? {
|
|
2510
2722
|
columns: n.columns,
|
|
2511
2723
|
records: n.records,
|
|
@@ -2513,136 +2725,136 @@ function wt(e) {
|
|
|
2513
2725
|
} : {}
|
|
2514
2726
|
};
|
|
2515
2727
|
}
|
|
2516
|
-
function
|
|
2517
|
-
const
|
|
2518
|
-
for (const i of
|
|
2519
|
-
if (
|
|
2520
|
-
|
|
2728
|
+
function mn(e, r) {
|
|
2729
|
+
const t = yn(e.resultSets);
|
|
2730
|
+
for (const i of pn) {
|
|
2731
|
+
if (t[i]) {
|
|
2732
|
+
t[i] = qr(t[i]);
|
|
2521
2733
|
continue;
|
|
2522
2734
|
}
|
|
2523
|
-
const
|
|
2524
|
-
if (!
|
|
2735
|
+
const d = Sn(e[i]);
|
|
2736
|
+
if (!d.length)
|
|
2525
2737
|
continue;
|
|
2526
|
-
const
|
|
2527
|
-
|
|
2528
|
-
records:
|
|
2529
|
-
columns:
|
|
2530
|
-
rowCount:
|
|
2738
|
+
const l = r.length ? r : wn(d);
|
|
2739
|
+
t[i] = {
|
|
2740
|
+
records: We(d, l),
|
|
2741
|
+
columns: l,
|
|
2742
|
+
rowCount: d.length
|
|
2531
2743
|
};
|
|
2532
2744
|
}
|
|
2533
|
-
const n =
|
|
2534
|
-
return n && n.records.length > 0 && !
|
|
2745
|
+
const n = vn(e.executionResult);
|
|
2746
|
+
return n && n.records.length > 0 && !t.records && (t.records = n), t;
|
|
2535
2747
|
}
|
|
2536
|
-
function
|
|
2748
|
+
function yn(e) {
|
|
2537
2749
|
return Object.fromEntries(
|
|
2538
|
-
Object.entries(e || {}).map(([
|
|
2539
|
-
|
|
2540
|
-
|
|
2750
|
+
Object.entries(e || {}).map(([r, t]) => [
|
|
2751
|
+
r,
|
|
2752
|
+
qr(t)
|
|
2541
2753
|
])
|
|
2542
2754
|
);
|
|
2543
2755
|
}
|
|
2544
|
-
function
|
|
2545
|
-
var
|
|
2756
|
+
function qr(e) {
|
|
2757
|
+
var r;
|
|
2546
2758
|
return {
|
|
2547
2759
|
...e,
|
|
2548
|
-
records:
|
|
2760
|
+
records: We(
|
|
2549
2761
|
e.records || [],
|
|
2550
2762
|
e.columns || []
|
|
2551
2763
|
),
|
|
2552
|
-
rowCount: e.rowCount ?? ((
|
|
2764
|
+
rowCount: e.rowCount ?? ((r = e.records) == null ? void 0 : r.length) ?? 0
|
|
2553
2765
|
};
|
|
2554
2766
|
}
|
|
2555
|
-
function
|
|
2556
|
-
var
|
|
2557
|
-
for (const
|
|
2558
|
-
if ((
|
|
2559
|
-
return e[
|
|
2560
|
-
return Object.values(e).find((
|
|
2561
|
-
}
|
|
2562
|
-
function
|
|
2563
|
-
const
|
|
2564
|
-
if (!(!
|
|
2767
|
+
function hn(e) {
|
|
2768
|
+
var r;
|
|
2769
|
+
for (const t of gn)
|
|
2770
|
+
if ((r = e[t]) != null && r.records.length)
|
|
2771
|
+
return e[t];
|
|
2772
|
+
return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
|
|
2773
|
+
}
|
|
2774
|
+
function vn(e) {
|
|
2775
|
+
const r = e == null ? void 0 : e.result;
|
|
2776
|
+
if (!(!r || r.kind !== "records" && r.kind !== "sql"))
|
|
2565
2777
|
return {
|
|
2566
|
-
records:
|
|
2567
|
-
columns:
|
|
2568
|
-
rowCount:
|
|
2778
|
+
records: We(r.records, r.columns),
|
|
2779
|
+
columns: r.columns,
|
|
2780
|
+
rowCount: r.rowCount ?? r.records.length
|
|
2569
2781
|
};
|
|
2570
2782
|
}
|
|
2571
|
-
function
|
|
2572
|
-
const
|
|
2573
|
-
return !
|
|
2783
|
+
function bn(e) {
|
|
2784
|
+
const r = e == null ? void 0 : e.result;
|
|
2785
|
+
return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
|
|
2574
2786
|
}
|
|
2575
|
-
function
|
|
2787
|
+
function Sn(e) {
|
|
2576
2788
|
return Array.isArray(e) ? e.filter(
|
|
2577
|
-
(
|
|
2789
|
+
(r) => !!(r && typeof r == "object" && !Array.isArray(r))
|
|
2578
2790
|
) : [];
|
|
2579
2791
|
}
|
|
2580
|
-
function
|
|
2581
|
-
return
|
|
2792
|
+
function We(e, r) {
|
|
2793
|
+
return r.length ? e.map((t) => {
|
|
2582
2794
|
const n = {};
|
|
2583
|
-
return
|
|
2584
|
-
const
|
|
2795
|
+
return r.forEach((i, d) => {
|
|
2796
|
+
const l = xn(t, {
|
|
2585
2797
|
name: i.key,
|
|
2586
2798
|
label: i.label,
|
|
2587
|
-
fallbackNames: [i.name, Object.keys(
|
|
2799
|
+
fallbackNames: [i.name, Object.keys(t)[d]]
|
|
2588
2800
|
});
|
|
2589
|
-
|
|
2590
|
-
}), Object.keys(n).length ? n :
|
|
2801
|
+
l !== void 0 && (n[i.key] = l);
|
|
2802
|
+
}), Object.keys(n).length ? n : t;
|
|
2591
2803
|
}) : e;
|
|
2592
2804
|
}
|
|
2593
|
-
function
|
|
2805
|
+
function wn(e) {
|
|
2594
2806
|
return Array.from(
|
|
2595
|
-
new Set(e.flatMap((
|
|
2596
|
-
).map((
|
|
2597
|
-
key:
|
|
2598
|
-
name:
|
|
2599
|
-
label:
|
|
2807
|
+
new Set(e.flatMap((t) => Object.keys(t)))
|
|
2808
|
+
).map((t) => ({
|
|
2809
|
+
key: t,
|
|
2810
|
+
name: t,
|
|
2811
|
+
label: t
|
|
2600
2812
|
}));
|
|
2601
2813
|
}
|
|
2602
|
-
function
|
|
2603
|
-
const
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
...
|
|
2814
|
+
function xn(e, r) {
|
|
2815
|
+
const t = [
|
|
2816
|
+
r.name,
|
|
2817
|
+
r.label,
|
|
2818
|
+
...r.fallbackNames || []
|
|
2607
2819
|
].filter((n) => !!n);
|
|
2608
|
-
for (const n of
|
|
2820
|
+
for (const n of t)
|
|
2609
2821
|
if (Object.prototype.hasOwnProperty.call(e, n))
|
|
2610
2822
|
return e[n];
|
|
2611
2823
|
}
|
|
2612
|
-
function
|
|
2824
|
+
function In() {
|
|
2613
2825
|
return {
|
|
2614
|
-
executeAnalysis: (e,
|
|
2826
|
+
executeAnalysis: (e, r, t) => G(
|
|
2615
2827
|
e,
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
).then(
|
|
2619
|
-
executeMetric: (e,
|
|
2620
|
-
executeRecords: (e,
|
|
2621
|
-
executeInputOptions: (e,
|
|
2622
|
-
executeSql: (e,
|
|
2623
|
-
executeMatrix: (e,
|
|
2828
|
+
r,
|
|
2829
|
+
t ?? {}
|
|
2830
|
+
).then(Ir),
|
|
2831
|
+
executeMetric: (e, r) => G(e, r),
|
|
2832
|
+
executeRecords: (e, r) => G(e, r),
|
|
2833
|
+
executeInputOptions: (e, r) => G(e, r),
|
|
2834
|
+
executeSql: (e, r) => G(e, r),
|
|
2835
|
+
executeMatrix: (e, r) => G(e, r)
|
|
2624
2836
|
};
|
|
2625
2837
|
}
|
|
2626
|
-
async function
|
|
2627
|
-
if (!
|
|
2838
|
+
async function G(e, r, t) {
|
|
2839
|
+
if (!r.token)
|
|
2628
2840
|
throw new Error(
|
|
2629
2841
|
"SemaphorDataAppProvider needs a token to execute queries."
|
|
2630
2842
|
);
|
|
2631
|
-
const n =
|
|
2632
|
-
let
|
|
2843
|
+
const n = Dn(r), i = An(e, n);
|
|
2844
|
+
let d;
|
|
2633
2845
|
try {
|
|
2634
|
-
|
|
2846
|
+
d = await fetch(n, {
|
|
2635
2847
|
method: "POST",
|
|
2636
2848
|
headers: {
|
|
2637
2849
|
"Content-Type": "application/json",
|
|
2638
|
-
Authorization: `Bearer ${
|
|
2850
|
+
Authorization: `Bearer ${r.token}`
|
|
2639
2851
|
},
|
|
2640
2852
|
body: JSON.stringify({
|
|
2641
2853
|
intent: e,
|
|
2642
|
-
activeInputs:
|
|
2643
|
-
...
|
|
2854
|
+
activeInputs: r.activeInputs,
|
|
2855
|
+
...t ? { analysisOptions: t } : {},
|
|
2644
2856
|
resultShape: e.kind,
|
|
2645
|
-
...
|
|
2857
|
+
...Rn(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
2646
2858
|
})
|
|
2647
2859
|
});
|
|
2648
2860
|
} catch (c) {
|
|
@@ -2650,51 +2862,51 @@ async function H(e, t, r) {
|
|
|
2650
2862
|
`${i}: ${c instanceof Error ? c.message : String(c)}`
|
|
2651
2863
|
);
|
|
2652
2864
|
}
|
|
2653
|
-
const
|
|
2654
|
-
if (!
|
|
2655
|
-
throw
|
|
2656
|
-
`${i}: ${
|
|
2657
|
-
|
|
2865
|
+
const l = await kn(d);
|
|
2866
|
+
if (!d.ok || l.error)
|
|
2867
|
+
throw qn(
|
|
2868
|
+
`${i}: ${l.error || `Semaphor Data App execution failed with status ${d.status}.`}`,
|
|
2869
|
+
l
|
|
2658
2870
|
);
|
|
2659
|
-
return
|
|
2871
|
+
return l;
|
|
2660
2872
|
}
|
|
2661
|
-
function
|
|
2662
|
-
const
|
|
2663
|
-
return
|
|
2873
|
+
function qn(e, r) {
|
|
2874
|
+
const t = new Error(e);
|
|
2875
|
+
return r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), t;
|
|
2664
2876
|
}
|
|
2665
|
-
function
|
|
2666
|
-
const
|
|
2667
|
-
return
|
|
2877
|
+
function Rn(e) {
|
|
2878
|
+
const r = e.debug;
|
|
2879
|
+
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
2668
2880
|
}
|
|
2669
|
-
function
|
|
2881
|
+
function An(e, r) {
|
|
2670
2882
|
return [
|
|
2671
2883
|
`Semaphor ${e.kind} query`,
|
|
2672
2884
|
e.id ? `id=${e.id}` : void 0,
|
|
2673
2885
|
e.label ? `label=${e.label}` : void 0,
|
|
2674
|
-
|
|
2675
|
-
`endpoint=${
|
|
2676
|
-
].filter((
|
|
2677
|
-
}
|
|
2678
|
-
function
|
|
2679
|
-
const
|
|
2680
|
-
if (!(!
|
|
2681
|
-
if (
|
|
2886
|
+
En(e),
|
|
2887
|
+
`endpoint=${Tn(r)}`
|
|
2888
|
+
].filter((t) => !!t).join(" ");
|
|
2889
|
+
}
|
|
2890
|
+
function En(e) {
|
|
2891
|
+
const r = "source" in e ? e.source : void 0;
|
|
2892
|
+
if (!(!r || typeof r != "object")) {
|
|
2893
|
+
if (r.kind === "semantic")
|
|
2682
2894
|
return `source=${[
|
|
2683
|
-
|
|
2684
|
-
|
|
2895
|
+
r.domainId,
|
|
2896
|
+
r.datasetId || r.datasetName
|
|
2685
2897
|
].filter(Boolean).join("/")}`;
|
|
2686
|
-
if (
|
|
2898
|
+
if (r.kind === "physical")
|
|
2687
2899
|
return `source=${[
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2900
|
+
r.connectionId,
|
|
2901
|
+
r.databaseName,
|
|
2902
|
+
r.schemaName,
|
|
2903
|
+
r.tableName
|
|
2692
2904
|
].filter(Boolean).join("/")}`;
|
|
2693
|
-
if (
|
|
2694
|
-
return
|
|
2905
|
+
if (r.kind === "sql")
|
|
2906
|
+
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
2695
2907
|
}
|
|
2696
2908
|
}
|
|
2697
|
-
function
|
|
2909
|
+
function Tn(e) {
|
|
2698
2910
|
if (!e)
|
|
2699
2911
|
return "/api/v1/data-app/execute";
|
|
2700
2912
|
try {
|
|
@@ -2703,289 +2915,289 @@ function Sn(e) {
|
|
|
2703
2915
|
return e;
|
|
2704
2916
|
}
|
|
2705
2917
|
}
|
|
2706
|
-
async function
|
|
2707
|
-
const
|
|
2708
|
-
if (!
|
|
2918
|
+
async function kn(e) {
|
|
2919
|
+
const r = await e.text().catch(() => "");
|
|
2920
|
+
if (!r.trim())
|
|
2709
2921
|
return e.ok ? {
|
|
2710
2922
|
error: "Semaphor Data App execution returned an empty response."
|
|
2711
2923
|
} : {};
|
|
2712
2924
|
try {
|
|
2713
|
-
return JSON.parse(
|
|
2925
|
+
return JSON.parse(r);
|
|
2714
2926
|
} catch {
|
|
2715
2927
|
return e.ok ? {
|
|
2716
2928
|
error: "Semaphor Data App execution returned invalid JSON.",
|
|
2717
|
-
details:
|
|
2929
|
+
details: r
|
|
2718
2930
|
} : {
|
|
2719
|
-
error:
|
|
2720
|
-
details:
|
|
2931
|
+
error: Cn(e, r),
|
|
2932
|
+
details: r
|
|
2721
2933
|
};
|
|
2722
2934
|
}
|
|
2723
2935
|
}
|
|
2724
|
-
function
|
|
2725
|
-
const
|
|
2726
|
-
return n ? `Semaphor Data App execution failed with status ${e.status}${
|
|
2936
|
+
function Cn(e, r) {
|
|
2937
|
+
const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
|
|
2938
|
+
return n ? `Semaphor Data App execution failed with status ${e.status}${t}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${e.status}${t}.`;
|
|
2727
2939
|
}
|
|
2728
|
-
function
|
|
2729
|
-
const
|
|
2730
|
-
return
|
|
2940
|
+
function Dn(e) {
|
|
2941
|
+
const r = Ln(e).replace(/\/+$/, "");
|
|
2942
|
+
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
2731
2943
|
}
|
|
2732
|
-
function
|
|
2944
|
+
function Ln(e) {
|
|
2733
2945
|
if (e.apiBaseUrl)
|
|
2734
2946
|
return e.apiBaseUrl;
|
|
2735
2947
|
if (!e.token)
|
|
2736
2948
|
return "";
|
|
2737
2949
|
try {
|
|
2738
|
-
return
|
|
2950
|
+
return jr(e.token).apiServiceUrl || "";
|
|
2739
2951
|
} catch {
|
|
2740
2952
|
return "";
|
|
2741
2953
|
}
|
|
2742
2954
|
}
|
|
2743
|
-
const
|
|
2744
|
-
function
|
|
2955
|
+
const Rr = ye({});
|
|
2956
|
+
function On() {
|
|
2745
2957
|
if (!(typeof window > "u"))
|
|
2746
2958
|
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
2747
2959
|
}
|
|
2748
|
-
function
|
|
2749
|
-
return
|
|
2960
|
+
function Bn() {
|
|
2961
|
+
return Q(Rr);
|
|
2750
2962
|
}
|
|
2751
|
-
const
|
|
2752
|
-
function
|
|
2753
|
-
const
|
|
2963
|
+
const Re = { value: null }, Ae = {}, Kn = { records: [] }, Ee = { options: [] }, Nn = { records: [] }, Te = {};
|
|
2964
|
+
function $n(e) {
|
|
2965
|
+
const r = Y(e.inputs), t = Br(e);
|
|
2754
2966
|
try {
|
|
2755
|
-
const n =
|
|
2967
|
+
const n = Kr(e), i = X(n);
|
|
2756
2968
|
return i ? {
|
|
2757
2969
|
error: i,
|
|
2758
|
-
activeInputs:
|
|
2759
|
-
analysisOptions:
|
|
2970
|
+
activeInputs: r,
|
|
2971
|
+
analysisOptions: t,
|
|
2760
2972
|
queryKey: q(
|
|
2761
2973
|
void 0,
|
|
2762
|
-
|
|
2974
|
+
r,
|
|
2763
2975
|
i,
|
|
2764
|
-
|
|
2976
|
+
t
|
|
2765
2977
|
),
|
|
2766
|
-
idleData:
|
|
2978
|
+
idleData: Ae
|
|
2767
2979
|
} : {
|
|
2768
2980
|
intent: n,
|
|
2769
2981
|
error: null,
|
|
2770
|
-
activeInputs:
|
|
2771
|
-
analysisOptions:
|
|
2772
|
-
queryKey: q(n,
|
|
2773
|
-
idleData:
|
|
2982
|
+
activeInputs: r,
|
|
2983
|
+
analysisOptions: t,
|
|
2984
|
+
queryKey: q(n, r, void 0, t),
|
|
2985
|
+
idleData: Ae
|
|
2774
2986
|
};
|
|
2775
2987
|
} catch (n) {
|
|
2776
|
-
const i =
|
|
2988
|
+
const i = _(n);
|
|
2777
2989
|
return {
|
|
2778
2990
|
error: i,
|
|
2779
|
-
activeInputs:
|
|
2780
|
-
analysisOptions:
|
|
2991
|
+
activeInputs: r,
|
|
2992
|
+
analysisOptions: t,
|
|
2781
2993
|
queryKey: q(
|
|
2782
2994
|
void 0,
|
|
2783
|
-
|
|
2995
|
+
r,
|
|
2784
2996
|
i,
|
|
2785
|
-
|
|
2997
|
+
t
|
|
2786
2998
|
),
|
|
2787
|
-
idleData:
|
|
2999
|
+
idleData: Ae
|
|
2788
3000
|
};
|
|
2789
3001
|
}
|
|
2790
3002
|
}
|
|
2791
|
-
function
|
|
2792
|
-
const
|
|
3003
|
+
function Wn(e) {
|
|
3004
|
+
const r = Y(e.inputs);
|
|
2793
3005
|
try {
|
|
2794
|
-
const
|
|
3006
|
+
const t = Nr(e), n = X(t);
|
|
2795
3007
|
return n ? {
|
|
2796
3008
|
error: n,
|
|
2797
|
-
activeInputs:
|
|
2798
|
-
queryKey: q(void 0,
|
|
2799
|
-
idleData:
|
|
3009
|
+
activeInputs: r,
|
|
3010
|
+
queryKey: q(void 0, r, n),
|
|
3011
|
+
idleData: Re
|
|
2800
3012
|
} : {
|
|
2801
|
-
intent:
|
|
3013
|
+
intent: t,
|
|
2802
3014
|
error: null,
|
|
2803
|
-
activeInputs:
|
|
2804
|
-
queryKey: q(
|
|
2805
|
-
idleData:
|
|
3015
|
+
activeInputs: r,
|
|
3016
|
+
queryKey: q(t, r),
|
|
3017
|
+
idleData: Re
|
|
2806
3018
|
};
|
|
2807
|
-
} catch (
|
|
2808
|
-
const n =
|
|
3019
|
+
} catch (t) {
|
|
3020
|
+
const n = _(t);
|
|
2809
3021
|
return {
|
|
2810
3022
|
error: n,
|
|
2811
|
-
activeInputs:
|
|
2812
|
-
queryKey: q(void 0,
|
|
2813
|
-
idleData:
|
|
3023
|
+
activeInputs: r,
|
|
3024
|
+
queryKey: q(void 0, r, n),
|
|
3025
|
+
idleData: Re
|
|
2814
3026
|
};
|
|
2815
3027
|
}
|
|
2816
3028
|
}
|
|
2817
|
-
function
|
|
2818
|
-
const
|
|
3029
|
+
function Fn(e) {
|
|
3030
|
+
const r = Y(e.inputs), t = Kn;
|
|
2819
3031
|
try {
|
|
2820
|
-
const n =
|
|
3032
|
+
const n = Or(e), i = X(n);
|
|
2821
3033
|
return i ? {
|
|
2822
3034
|
error: i,
|
|
2823
|
-
activeInputs:
|
|
2824
|
-
queryKey: q(void 0,
|
|
2825
|
-
idleData:
|
|
3035
|
+
activeInputs: r,
|
|
3036
|
+
queryKey: q(void 0, r, i),
|
|
3037
|
+
idleData: t
|
|
2826
3038
|
} : {
|
|
2827
3039
|
intent: n,
|
|
2828
3040
|
error: null,
|
|
2829
|
-
activeInputs:
|
|
2830
|
-
queryKey: q(n,
|
|
2831
|
-
idleData:
|
|
3041
|
+
activeInputs: r,
|
|
3042
|
+
queryKey: q(n, r),
|
|
3043
|
+
idleData: t
|
|
2832
3044
|
};
|
|
2833
3045
|
} catch (n) {
|
|
2834
|
-
const i =
|
|
3046
|
+
const i = _(n);
|
|
2835
3047
|
return {
|
|
2836
3048
|
error: i,
|
|
2837
|
-
activeInputs:
|
|
2838
|
-
queryKey: q(void 0,
|
|
2839
|
-
idleData:
|
|
3049
|
+
activeInputs: r,
|
|
3050
|
+
queryKey: q(void 0, r, i),
|
|
3051
|
+
idleData: t
|
|
2840
3052
|
};
|
|
2841
3053
|
}
|
|
2842
3054
|
}
|
|
2843
|
-
function
|
|
2844
|
-
const
|
|
3055
|
+
function _n(e) {
|
|
3056
|
+
const r = Y(e.inputs);
|
|
2845
3057
|
try {
|
|
2846
|
-
const
|
|
3058
|
+
const t = Lr(e), n = X(t);
|
|
2847
3059
|
return n ? {
|
|
2848
3060
|
error: n,
|
|
2849
|
-
activeInputs:
|
|
2850
|
-
queryKey: q(void 0,
|
|
2851
|
-
idleData:
|
|
3061
|
+
activeInputs: r,
|
|
3062
|
+
queryKey: q(void 0, r, n),
|
|
3063
|
+
idleData: Ee
|
|
2852
3064
|
} : {
|
|
2853
|
-
intent:
|
|
3065
|
+
intent: t,
|
|
2854
3066
|
error: null,
|
|
2855
|
-
activeInputs:
|
|
2856
|
-
queryKey: q(
|
|
2857
|
-
idleData:
|
|
3067
|
+
activeInputs: r,
|
|
3068
|
+
queryKey: q(t, r),
|
|
3069
|
+
idleData: Ee
|
|
2858
3070
|
};
|
|
2859
|
-
} catch (
|
|
2860
|
-
const n =
|
|
3071
|
+
} catch (t) {
|
|
3072
|
+
const n = _(t);
|
|
2861
3073
|
return {
|
|
2862
3074
|
error: n,
|
|
2863
|
-
activeInputs:
|
|
2864
|
-
queryKey: q(void 0,
|
|
2865
|
-
idleData:
|
|
3075
|
+
activeInputs: r,
|
|
3076
|
+
queryKey: q(void 0, r, n),
|
|
3077
|
+
idleData: Ee
|
|
2866
3078
|
};
|
|
2867
3079
|
}
|
|
2868
3080
|
}
|
|
2869
|
-
function
|
|
2870
|
-
const
|
|
3081
|
+
function zn(e) {
|
|
3082
|
+
const r = Y(e.inputs), t = Nn;
|
|
2871
3083
|
try {
|
|
2872
|
-
const n =
|
|
3084
|
+
const n = Dr(e), i = X(n);
|
|
2873
3085
|
return i ? {
|
|
2874
3086
|
error: i,
|
|
2875
|
-
activeInputs:
|
|
2876
|
-
queryKey: q(void 0,
|
|
2877
|
-
idleData:
|
|
3087
|
+
activeInputs: r,
|
|
3088
|
+
queryKey: q(void 0, r, i),
|
|
3089
|
+
idleData: t
|
|
2878
3090
|
} : {
|
|
2879
3091
|
intent: n,
|
|
2880
3092
|
error: null,
|
|
2881
|
-
activeInputs:
|
|
2882
|
-
queryKey: q(n,
|
|
2883
|
-
idleData:
|
|
3093
|
+
activeInputs: r,
|
|
3094
|
+
queryKey: q(n, r),
|
|
3095
|
+
idleData: t
|
|
2884
3096
|
};
|
|
2885
3097
|
} catch (n) {
|
|
2886
|
-
const i =
|
|
3098
|
+
const i = _(n);
|
|
2887
3099
|
return {
|
|
2888
3100
|
error: i,
|
|
2889
|
-
activeInputs:
|
|
2890
|
-
queryKey: q(void 0,
|
|
2891
|
-
idleData:
|
|
3101
|
+
activeInputs: r,
|
|
3102
|
+
queryKey: q(void 0, r, i),
|
|
3103
|
+
idleData: t
|
|
2892
3104
|
};
|
|
2893
3105
|
}
|
|
2894
3106
|
}
|
|
2895
|
-
function
|
|
2896
|
-
const
|
|
3107
|
+
function Hn(e) {
|
|
3108
|
+
const r = Y(e.inputs);
|
|
2897
3109
|
try {
|
|
2898
|
-
const
|
|
3110
|
+
const t = Cr(e), n = X(t);
|
|
2899
3111
|
return n ? {
|
|
2900
3112
|
error: n,
|
|
2901
|
-
activeInputs:
|
|
2902
|
-
queryKey: q(void 0,
|
|
2903
|
-
idleData:
|
|
3113
|
+
activeInputs: r,
|
|
3114
|
+
queryKey: q(void 0, r, n),
|
|
3115
|
+
idleData: Te
|
|
2904
3116
|
} : {
|
|
2905
|
-
intent:
|
|
3117
|
+
intent: t,
|
|
2906
3118
|
error: null,
|
|
2907
|
-
activeInputs:
|
|
2908
|
-
queryKey: q(
|
|
2909
|
-
idleData:
|
|
3119
|
+
activeInputs: r,
|
|
3120
|
+
queryKey: q(t, r),
|
|
3121
|
+
idleData: Te
|
|
2910
3122
|
};
|
|
2911
|
-
} catch (
|
|
2912
|
-
const n =
|
|
3123
|
+
} catch (t) {
|
|
3124
|
+
const n = _(t);
|
|
2913
3125
|
return {
|
|
2914
3126
|
error: n,
|
|
2915
|
-
activeInputs:
|
|
2916
|
-
queryKey: q(void 0,
|
|
2917
|
-
idleData:
|
|
3127
|
+
activeInputs: r,
|
|
3128
|
+
queryKey: q(void 0, r, n),
|
|
3129
|
+
idleData: Te
|
|
2918
3130
|
};
|
|
2919
3131
|
}
|
|
2920
3132
|
}
|
|
2921
|
-
function
|
|
3133
|
+
function _(e) {
|
|
2922
3134
|
return e instanceof Error ? e : new Error(String(e));
|
|
2923
3135
|
}
|
|
2924
|
-
function
|
|
2925
|
-
const
|
|
2926
|
-
if (
|
|
3136
|
+
function X(e) {
|
|
3137
|
+
const r = Pr(e);
|
|
3138
|
+
if (r.ok)
|
|
2927
3139
|
return null;
|
|
2928
|
-
const
|
|
3140
|
+
const t = r.errors.map(
|
|
2929
3141
|
(n) => n.path ? `${n.code} at ${n.path}: ${n.message}` : `${n.code}: ${n.message}`
|
|
2930
3142
|
).join("; ");
|
|
2931
|
-
return new Error(`Invalid Semaphor analytics intent. ${
|
|
3143
|
+
return new Error(`Invalid Semaphor analytics intent. ${t}`);
|
|
2932
3144
|
}
|
|
2933
|
-
function q(e,
|
|
3145
|
+
function q(e, r, t, n) {
|
|
2934
3146
|
return JSON.stringify({
|
|
2935
3147
|
intent: e,
|
|
2936
|
-
activeInputs:
|
|
3148
|
+
activeInputs: r,
|
|
2937
3149
|
analysisOptions: n,
|
|
2938
|
-
error:
|
|
3150
|
+
error: t == null ? void 0 : t.message
|
|
2939
3151
|
});
|
|
2940
3152
|
}
|
|
2941
|
-
function
|
|
2942
|
-
const [
|
|
2943
|
-
() =>
|
|
3153
|
+
function si(e) {
|
|
3154
|
+
const [r, t] = V(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, d = b(
|
|
3155
|
+
() => nr(e.options),
|
|
2944
3156
|
[e.options]
|
|
2945
|
-
),
|
|
2946
|
-
(
|
|
2947
|
-
var
|
|
2948
|
-
const f =
|
|
2949
|
-
(
|
|
3157
|
+
), l = O(
|
|
3158
|
+
(u) => {
|
|
3159
|
+
var m;
|
|
3160
|
+
const f = u;
|
|
3161
|
+
(m = e.onValueChange) == null || m.call(e, f), n || t(f);
|
|
2950
3162
|
},
|
|
2951
3163
|
[n, e]
|
|
2952
|
-
), c =
|
|
3164
|
+
), c = O(() => l(void 0), [l]);
|
|
2953
3165
|
return b(() => {
|
|
2954
|
-
const
|
|
3166
|
+
const u = ir(e);
|
|
2955
3167
|
return {
|
|
2956
3168
|
id: e.id,
|
|
2957
3169
|
kind: e.kind,
|
|
2958
3170
|
label: e.label,
|
|
2959
|
-
field:
|
|
2960
|
-
operator:
|
|
2961
|
-
relationshipHint:
|
|
3171
|
+
field: u.field,
|
|
3172
|
+
operator: u.operator,
|
|
3173
|
+
relationshipHint: u.relationshipHint,
|
|
2962
3174
|
controlRole: e.kind === "control" ? e.role : void 0,
|
|
2963
3175
|
value: i,
|
|
2964
|
-
options:
|
|
2965
|
-
isActive:
|
|
2966
|
-
setValue:
|
|
3176
|
+
options: d,
|
|
3177
|
+
isActive: oe(i),
|
|
3178
|
+
setValue: l,
|
|
2967
3179
|
clear: c,
|
|
2968
3180
|
toAnalyticsInput: () => ({
|
|
2969
|
-
inputId:
|
|
2970
|
-
field:
|
|
3181
|
+
inputId: u.inputId,
|
|
3182
|
+
field: u.field,
|
|
2971
3183
|
kind: e.kind,
|
|
2972
3184
|
label: e.label,
|
|
2973
3185
|
value: i,
|
|
2974
|
-
isActive:
|
|
2975
|
-
operator:
|
|
2976
|
-
relationshipHint:
|
|
3186
|
+
isActive: oe(i),
|
|
3187
|
+
operator: u.operator,
|
|
3188
|
+
relationshipHint: u.relationshipHint,
|
|
2977
3189
|
controlRole: e.kind === "control" ? e.role : void 0
|
|
2978
3190
|
})
|
|
2979
3191
|
};
|
|
2980
|
-
}, [c,
|
|
3192
|
+
}, [c, d, l, e, i]);
|
|
2981
3193
|
}
|
|
2982
|
-
function
|
|
2983
|
-
const [
|
|
2984
|
-
return
|
|
2985
|
-
|
|
3194
|
+
function ai(e) {
|
|
3195
|
+
const [r, t] = V(() => Qn(e));
|
|
3196
|
+
return K(() => {
|
|
3197
|
+
t((n) => {
|
|
2986
3198
|
let i = n;
|
|
2987
|
-
for (const
|
|
2988
|
-
!Object.prototype.hasOwnProperty.call(i,
|
|
3199
|
+
for (const d of e)
|
|
3200
|
+
!Object.prototype.hasOwnProperty.call(i, d.id) && d.defaultValue !== void 0 && (i = { ...i, [d.id]: d.defaultValue });
|
|
2989
3201
|
return i;
|
|
2990
3202
|
});
|
|
2991
3203
|
}, [e]), b(
|
|
@@ -2993,13 +3205,13 @@ function Zn(e) {
|
|
|
2993
3205
|
const i = Object.prototype.hasOwnProperty.call(
|
|
2994
3206
|
n,
|
|
2995
3207
|
"value"
|
|
2996
|
-
),
|
|
2997
|
-
var
|
|
2998
|
-
(
|
|
3208
|
+
), d = i ? n.value : r[n.id], l = nr(n.options), c = (m) => {
|
|
3209
|
+
var y;
|
|
3210
|
+
(y = n.onValueChange) == null || y.call(n, m), i || t((h) => ({
|
|
2999
3211
|
...h,
|
|
3000
|
-
[n.id]:
|
|
3212
|
+
[n.id]: m
|
|
3001
3213
|
}));
|
|
3002
|
-
},
|
|
3214
|
+
}, u = () => c(void 0), f = ir(n);
|
|
3003
3215
|
return {
|
|
3004
3216
|
id: n.id,
|
|
3005
3217
|
kind: n.kind,
|
|
@@ -3008,99 +3220,99 @@ function Zn(e) {
|
|
|
3008
3220
|
operator: f.operator,
|
|
3009
3221
|
relationshipHint: f.relationshipHint,
|
|
3010
3222
|
controlRole: n.kind === "control" ? n.role : void 0,
|
|
3011
|
-
value:
|
|
3012
|
-
options:
|
|
3013
|
-
isActive:
|
|
3223
|
+
value: d,
|
|
3224
|
+
options: l,
|
|
3225
|
+
isActive: oe(d),
|
|
3014
3226
|
setValue: c,
|
|
3015
|
-
clear:
|
|
3227
|
+
clear: u,
|
|
3016
3228
|
toAnalyticsInput: () => ({
|
|
3017
3229
|
inputId: f.inputId,
|
|
3018
3230
|
field: f.field,
|
|
3019
3231
|
kind: n.kind,
|
|
3020
3232
|
label: n.label,
|
|
3021
|
-
value:
|
|
3022
|
-
isActive:
|
|
3233
|
+
value: d,
|
|
3234
|
+
isActive: oe(d),
|
|
3023
3235
|
operator: f.operator,
|
|
3024
3236
|
relationshipHint: f.relationshipHint,
|
|
3025
3237
|
controlRole: n.kind === "control" ? n.role : void 0
|
|
3026
3238
|
})
|
|
3027
3239
|
};
|
|
3028
3240
|
}),
|
|
3029
|
-
[e,
|
|
3241
|
+
[e, r]
|
|
3030
3242
|
);
|
|
3031
3243
|
}
|
|
3032
|
-
function
|
|
3033
|
-
const
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
}, [e, n,
|
|
3244
|
+
function di(e, r) {
|
|
3245
|
+
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = b(() => jn(t), [t]);
|
|
3246
|
+
K(() => {
|
|
3247
|
+
Mn(e.value, t) || e.clear();
|
|
3248
|
+
}, [e, n, r == null ? void 0 : r.status, t]);
|
|
3037
3249
|
}
|
|
3038
|
-
function
|
|
3039
|
-
if (!
|
|
3250
|
+
function Mn(e, r) {
|
|
3251
|
+
if (!oe(e) || r === void 0)
|
|
3040
3252
|
return !0;
|
|
3041
|
-
const
|
|
3042
|
-
|
|
3253
|
+
const t = new Set(
|
|
3254
|
+
r.map((i) => rr(i.value))
|
|
3043
3255
|
);
|
|
3044
3256
|
return (Array.isArray(e) ? e : [e]).every(
|
|
3045
|
-
(i) =>
|
|
3257
|
+
(i) => t.has(rr(i))
|
|
3046
3258
|
);
|
|
3047
3259
|
}
|
|
3048
|
-
function
|
|
3049
|
-
return JSON.stringify((e || []).map((
|
|
3260
|
+
function jn(e) {
|
|
3261
|
+
return JSON.stringify((e || []).map((r) => r.value));
|
|
3050
3262
|
}
|
|
3051
|
-
function
|
|
3263
|
+
function rr(e) {
|
|
3052
3264
|
return `${typeof e}:${String(e)}`;
|
|
3053
3265
|
}
|
|
3054
|
-
function
|
|
3055
|
-
const
|
|
3056
|
-
() =>
|
|
3266
|
+
function li(e, r = {}) {
|
|
3267
|
+
const t = b(
|
|
3268
|
+
() => r.inputs ? {
|
|
3057
3269
|
...e,
|
|
3058
|
-
inputs:
|
|
3270
|
+
inputs: r.inputs
|
|
3059
3271
|
} : e,
|
|
3060
|
-
[
|
|
3272
|
+
[r.inputs, e]
|
|
3061
3273
|
), n = b(() => {
|
|
3062
|
-
switch (
|
|
3274
|
+
switch (t.queryKind) {
|
|
3063
3275
|
case "metric":
|
|
3064
3276
|
return {
|
|
3065
|
-
queryKind:
|
|
3066
|
-
request:
|
|
3277
|
+
queryKind: t.queryKind,
|
|
3278
|
+
request: Wn(t)
|
|
3067
3279
|
};
|
|
3068
3280
|
case "analysis":
|
|
3069
3281
|
return {
|
|
3070
|
-
queryKind:
|
|
3071
|
-
request:
|
|
3282
|
+
queryKind: t.queryKind,
|
|
3283
|
+
request: $n(t)
|
|
3072
3284
|
};
|
|
3073
3285
|
case "records":
|
|
3074
3286
|
return {
|
|
3075
|
-
queryKind:
|
|
3076
|
-
request:
|
|
3287
|
+
queryKind: t.queryKind,
|
|
3288
|
+
request: Fn(t)
|
|
3077
3289
|
};
|
|
3078
3290
|
case "inputOptions":
|
|
3079
3291
|
return {
|
|
3080
|
-
queryKind:
|
|
3081
|
-
request:
|
|
3292
|
+
queryKind: t.queryKind,
|
|
3293
|
+
request: _n(t)
|
|
3082
3294
|
};
|
|
3083
3295
|
case "sql":
|
|
3084
3296
|
return {
|
|
3085
|
-
queryKind:
|
|
3086
|
-
request:
|
|
3297
|
+
queryKind: t.queryKind,
|
|
3298
|
+
request: zn(t)
|
|
3087
3299
|
};
|
|
3088
3300
|
case "matrix":
|
|
3089
3301
|
return {
|
|
3090
|
-
queryKind:
|
|
3091
|
-
request:
|
|
3302
|
+
queryKind: t.queryKind,
|
|
3303
|
+
request: Hn(t)
|
|
3092
3304
|
};
|
|
3093
3305
|
default:
|
|
3094
|
-
return
|
|
3306
|
+
return ke(t);
|
|
3095
3307
|
}
|
|
3096
|
-
}, [
|
|
3097
|
-
spec:
|
|
3308
|
+
}, [t]), i = Xr({
|
|
3309
|
+
spec: t,
|
|
3098
3310
|
queryKind: n.queryKind,
|
|
3099
3311
|
queryKey: n.request.queryKey,
|
|
3100
3312
|
intent: n.request.intent,
|
|
3101
3313
|
activeInputs: n.request.activeInputs,
|
|
3102
|
-
debug:
|
|
3103
|
-
}),
|
|
3314
|
+
debug: r.debug
|
|
3315
|
+
}), d = D(null), l = b(
|
|
3104
3316
|
() => ({
|
|
3105
3317
|
start: i.start,
|
|
3106
3318
|
success: i.success,
|
|
@@ -3113,78 +3325,78 @@ function ti(e, t = {}) {
|
|
|
3113
3325
|
i.start,
|
|
3114
3326
|
i.success
|
|
3115
3327
|
]
|
|
3116
|
-
), c =
|
|
3328
|
+
), c = O(
|
|
3117
3329
|
(a) => {
|
|
3118
|
-
var
|
|
3119
|
-
const
|
|
3120
|
-
if (
|
|
3330
|
+
var C, L, B, v, w, A, I, E, z;
|
|
3331
|
+
const x = n.request;
|
|
3332
|
+
if (x.intent)
|
|
3121
3333
|
switch (n.queryKind) {
|
|
3122
3334
|
case "metric":
|
|
3123
|
-
return (
|
|
3124
|
-
|
|
3335
|
+
return (C = a.executor) == null ? void 0 : C.executeMetric(
|
|
3336
|
+
x.intent,
|
|
3125
3337
|
a
|
|
3126
3338
|
);
|
|
3127
3339
|
case "analysis":
|
|
3128
|
-
return (
|
|
3129
|
-
|
|
3130
|
-
|
|
3340
|
+
return (B = (L = a.executor) == null ? void 0 : L.executeAnalysis) == null ? void 0 : B.call(
|
|
3341
|
+
L,
|
|
3342
|
+
x.intent,
|
|
3131
3343
|
a,
|
|
3132
|
-
|
|
3344
|
+
x.analysisOptions
|
|
3133
3345
|
);
|
|
3134
3346
|
case "records":
|
|
3135
|
-
return (
|
|
3136
|
-
|
|
3347
|
+
return (v = a.executor) == null ? void 0 : v.executeRecords(
|
|
3348
|
+
x.intent,
|
|
3137
3349
|
a
|
|
3138
3350
|
);
|
|
3139
3351
|
case "inputOptions":
|
|
3140
|
-
return (
|
|
3141
|
-
|
|
3352
|
+
return (w = a.executor) == null ? void 0 : w.executeInputOptions(
|
|
3353
|
+
x.intent,
|
|
3142
3354
|
a
|
|
3143
3355
|
);
|
|
3144
3356
|
case "sql":
|
|
3145
|
-
return (
|
|
3146
|
-
|
|
3147
|
-
|
|
3357
|
+
return (I = (A = a.executor) == null ? void 0 : A.executeSql) == null ? void 0 : I.call(
|
|
3358
|
+
A,
|
|
3359
|
+
x.intent,
|
|
3148
3360
|
a
|
|
3149
3361
|
);
|
|
3150
3362
|
case "matrix":
|
|
3151
|
-
return (
|
|
3152
|
-
|
|
3153
|
-
|
|
3363
|
+
return (z = (E = a.executor) == null ? void 0 : E.executeMatrix) == null ? void 0 : z.call(
|
|
3364
|
+
E,
|
|
3365
|
+
x.intent,
|
|
3154
3366
|
a
|
|
3155
3367
|
);
|
|
3156
3368
|
default:
|
|
3157
|
-
return
|
|
3369
|
+
return ke(n);
|
|
3158
3370
|
}
|
|
3159
3371
|
},
|
|
3160
3372
|
[n]
|
|
3161
|
-
),
|
|
3373
|
+
), u = Pn(
|
|
3162
3374
|
n.request.queryKey,
|
|
3163
3375
|
c,
|
|
3164
3376
|
n.request.idleData,
|
|
3165
3377
|
n.request.activeInputs,
|
|
3166
|
-
|
|
3167
|
-
), f = i.queryId,
|
|
3168
|
-
|
|
3378
|
+
l
|
|
3379
|
+
), f = i.queryId, m = i.validationFailure;
|
|
3380
|
+
K(() => {
|
|
3169
3381
|
const a = n.request.error;
|
|
3170
3382
|
if (!a) {
|
|
3171
|
-
|
|
3383
|
+
d.current = null;
|
|
3172
3384
|
return;
|
|
3173
3385
|
}
|
|
3174
|
-
const
|
|
3175
|
-
|
|
3386
|
+
const x = `${f}:${a.message}`;
|
|
3387
|
+
d.current !== x && (d.current = x, m(a));
|
|
3176
3388
|
}, [
|
|
3177
3389
|
n.request.error,
|
|
3178
3390
|
n.request.queryKey,
|
|
3179
3391
|
f,
|
|
3180
|
-
|
|
3392
|
+
m
|
|
3181
3393
|
]);
|
|
3182
|
-
const
|
|
3394
|
+
const y = n.request.error ? n.request.idleData : u.data, h = n.request.error ? "error" : u.status, g = !n.request.error && u.status === "loading", S = n.request.error || u.error, k = i.trace;
|
|
3183
3395
|
switch (n.queryKind) {
|
|
3184
3396
|
case "metric": {
|
|
3185
|
-
const a =
|
|
3397
|
+
const a = y;
|
|
3186
3398
|
return {
|
|
3187
|
-
id:
|
|
3399
|
+
id: t.id,
|
|
3188
3400
|
intent: n.request.intent,
|
|
3189
3401
|
value: (a == null ? void 0 : a.value) ?? null,
|
|
3190
3402
|
measures: a == null ? void 0 : a.measures,
|
|
@@ -3194,27 +3406,27 @@ function ti(e, t = {}) {
|
|
|
3194
3406
|
records: a == null ? void 0 : a.records,
|
|
3195
3407
|
executionResult: a == null ? void 0 : a.executionResult,
|
|
3196
3408
|
status: h,
|
|
3197
|
-
isLoading:
|
|
3409
|
+
isLoading: g,
|
|
3198
3410
|
error: S,
|
|
3199
|
-
trace:
|
|
3411
|
+
trace: k
|
|
3200
3412
|
};
|
|
3201
3413
|
}
|
|
3202
3414
|
case "analysis": {
|
|
3203
|
-
const a =
|
|
3415
|
+
const a = Ir(y);
|
|
3204
3416
|
return {
|
|
3205
|
-
id:
|
|
3417
|
+
id: t.id,
|
|
3206
3418
|
intent: n.request.intent,
|
|
3207
3419
|
...a || {},
|
|
3208
3420
|
status: h,
|
|
3209
|
-
isLoading:
|
|
3421
|
+
isLoading: g,
|
|
3210
3422
|
error: S,
|
|
3211
|
-
trace:
|
|
3423
|
+
trace: k
|
|
3212
3424
|
};
|
|
3213
3425
|
}
|
|
3214
3426
|
case "records": {
|
|
3215
|
-
const a =
|
|
3427
|
+
const a = y;
|
|
3216
3428
|
return {
|
|
3217
|
-
id:
|
|
3429
|
+
id: t.id,
|
|
3218
3430
|
intent: n.request.intent,
|
|
3219
3431
|
records: (a == null ? void 0 : a.records) || [],
|
|
3220
3432
|
columns: a == null ? void 0 : a.columns,
|
|
@@ -3222,28 +3434,28 @@ function ti(e, t = {}) {
|
|
|
3222
3434
|
pagination: a == null ? void 0 : a.pagination,
|
|
3223
3435
|
executionResult: a == null ? void 0 : a.executionResult,
|
|
3224
3436
|
status: h,
|
|
3225
|
-
isLoading:
|
|
3437
|
+
isLoading: g,
|
|
3226
3438
|
error: S,
|
|
3227
|
-
trace:
|
|
3439
|
+
trace: k
|
|
3228
3440
|
};
|
|
3229
3441
|
}
|
|
3230
3442
|
case "inputOptions": {
|
|
3231
|
-
const a =
|
|
3443
|
+
const a = y;
|
|
3232
3444
|
return {
|
|
3233
|
-
id:
|
|
3445
|
+
id: t.id,
|
|
3234
3446
|
intent: n.request.intent,
|
|
3235
3447
|
options: (a == null ? void 0 : a.options) || [],
|
|
3236
3448
|
executionResult: a == null ? void 0 : a.executionResult,
|
|
3237
3449
|
status: h,
|
|
3238
|
-
isLoading:
|
|
3450
|
+
isLoading: g,
|
|
3239
3451
|
error: S,
|
|
3240
|
-
trace:
|
|
3452
|
+
trace: k
|
|
3241
3453
|
};
|
|
3242
3454
|
}
|
|
3243
3455
|
case "sql": {
|
|
3244
|
-
const a =
|
|
3456
|
+
const a = y;
|
|
3245
3457
|
return {
|
|
3246
|
-
id:
|
|
3458
|
+
id: t.id,
|
|
3247
3459
|
intent: n.request.intent,
|
|
3248
3460
|
records: (a == null ? void 0 : a.records) || [],
|
|
3249
3461
|
columns: a == null ? void 0 : a.columns,
|
|
@@ -3253,126 +3465,126 @@ function ti(e, t = {}) {
|
|
|
3253
3465
|
rowLimitExceeded: a == null ? void 0 : a.rowLimitExceeded,
|
|
3254
3466
|
executionResult: a == null ? void 0 : a.executionResult,
|
|
3255
3467
|
status: h,
|
|
3256
|
-
isLoading:
|
|
3468
|
+
isLoading: g,
|
|
3257
3469
|
error: S,
|
|
3258
|
-
trace:
|
|
3470
|
+
trace: k
|
|
3259
3471
|
};
|
|
3260
3472
|
}
|
|
3261
3473
|
case "matrix": {
|
|
3262
|
-
const a =
|
|
3474
|
+
const a = y;
|
|
3263
3475
|
return {
|
|
3264
|
-
id:
|
|
3476
|
+
id: t.id,
|
|
3265
3477
|
intent: n.request.intent,
|
|
3266
3478
|
matrixResult: a == null ? void 0 : a.matrixResult,
|
|
3267
3479
|
grid: a == null ? void 0 : a.grid,
|
|
3268
3480
|
expansion: a == null ? void 0 : a.expansion,
|
|
3269
3481
|
executionResult: a == null ? void 0 : a.executionResult,
|
|
3270
3482
|
status: h,
|
|
3271
|
-
isLoading:
|
|
3483
|
+
isLoading: g,
|
|
3272
3484
|
error: S,
|
|
3273
|
-
trace:
|
|
3485
|
+
trace: k
|
|
3274
3486
|
};
|
|
3275
3487
|
}
|
|
3276
3488
|
default:
|
|
3277
|
-
return
|
|
3489
|
+
return ke(n);
|
|
3278
3490
|
}
|
|
3279
3491
|
}
|
|
3280
|
-
function
|
|
3281
|
-
const
|
|
3492
|
+
function Pn(e, r, t, n, i) {
|
|
3493
|
+
const d = Bn(), l = D(r), c = D(n), [u, f] = V({
|
|
3282
3494
|
status: "idle",
|
|
3283
|
-
data:
|
|
3495
|
+
data: t,
|
|
3284
3496
|
error: null
|
|
3285
3497
|
});
|
|
3286
|
-
return
|
|
3287
|
-
let
|
|
3498
|
+
return l.current = r, c.current = n, K(() => {
|
|
3499
|
+
let m;
|
|
3288
3500
|
try {
|
|
3289
|
-
|
|
3290
|
-
...
|
|
3501
|
+
m = l.current({
|
|
3502
|
+
...d,
|
|
3291
3503
|
activeInputs: c.current
|
|
3292
3504
|
});
|
|
3293
|
-
} catch (
|
|
3294
|
-
i == null || i.failure(
|
|
3505
|
+
} catch (g) {
|
|
3506
|
+
i == null || i.failure(g, 0), f({
|
|
3295
3507
|
status: "error",
|
|
3296
|
-
data:
|
|
3297
|
-
error:
|
|
3508
|
+
data: t,
|
|
3509
|
+
error: _(g)
|
|
3298
3510
|
});
|
|
3299
3511
|
return;
|
|
3300
3512
|
}
|
|
3301
|
-
if (!
|
|
3302
|
-
f({ status: "idle", data:
|
|
3513
|
+
if (!m) {
|
|
3514
|
+
f({ status: "idle", data: t, error: null });
|
|
3303
3515
|
return;
|
|
3304
3516
|
}
|
|
3305
|
-
let
|
|
3306
|
-
const h =
|
|
3307
|
-
return i == null || i.start(), f((
|
|
3517
|
+
let y = !1;
|
|
3518
|
+
const h = Ar();
|
|
3519
|
+
return i == null || i.start(), f((g) => ({
|
|
3308
3520
|
status: "loading",
|
|
3309
|
-
data:
|
|
3521
|
+
data: g.data,
|
|
3310
3522
|
error: null
|
|
3311
|
-
})),
|
|
3312
|
-
|
|
3313
|
-
}).catch((
|
|
3314
|
-
|
|
3523
|
+
})), m.then((g) => {
|
|
3524
|
+
y ? i == null || i.ignored("superseded") : (i == null || i.success(g, tr(h)), f({ status: "success", data: g, error: null }));
|
|
3525
|
+
}).catch((g) => {
|
|
3526
|
+
y ? i == null || i.ignored("superseded") : (i == null || i.failure(g, tr(h)), f({
|
|
3315
3527
|
status: "error",
|
|
3316
|
-
data:
|
|
3317
|
-
error:
|
|
3528
|
+
data: t,
|
|
3529
|
+
error: _(g)
|
|
3318
3530
|
}));
|
|
3319
3531
|
}), () => {
|
|
3320
|
-
|
|
3532
|
+
y = !0;
|
|
3321
3533
|
};
|
|
3322
|
-
}, [
|
|
3534
|
+
}, [t, e, d, i]), u;
|
|
3323
3535
|
}
|
|
3324
|
-
function
|
|
3536
|
+
function Ar() {
|
|
3325
3537
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
3326
3538
|
}
|
|
3327
|
-
function
|
|
3328
|
-
return Math.max(0, Math.round(
|
|
3539
|
+
function tr(e) {
|
|
3540
|
+
return Math.max(0, Math.round(Ar() - e));
|
|
3329
3541
|
}
|
|
3330
|
-
function
|
|
3542
|
+
function Qn(e) {
|
|
3331
3543
|
return Object.fromEntries(
|
|
3332
|
-
e.filter((
|
|
3544
|
+
e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
|
|
3333
3545
|
);
|
|
3334
3546
|
}
|
|
3335
|
-
function
|
|
3547
|
+
function ke(e) {
|
|
3336
3548
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
3337
3549
|
}
|
|
3338
|
-
function
|
|
3550
|
+
function Vn(e) {
|
|
3339
3551
|
return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
|
|
3340
3552
|
}
|
|
3341
|
-
function
|
|
3553
|
+
function ui({
|
|
3342
3554
|
token: e,
|
|
3343
|
-
apiBaseUrl:
|
|
3344
|
-
executor:
|
|
3555
|
+
apiBaseUrl: r,
|
|
3556
|
+
executor: t,
|
|
3345
3557
|
debug: n,
|
|
3346
3558
|
children: i
|
|
3347
3559
|
}) {
|
|
3348
|
-
var
|
|
3349
|
-
const
|
|
3560
|
+
var g;
|
|
3561
|
+
const d = On(), l = ((g = d == null ? void 0 : d.authToken) == null ? void 0 : g.accessToken) || e, c = (d == null ? void 0 : d.dataApiBaseUrl) || (d == null ? void 0 : d.apiBaseUrl) || r, u = (d == null ? void 0 : d.debug) ?? n, f = Vn(u), m = b(() => In(), []), y = t || m, h = b(
|
|
3350
3562
|
() => ({
|
|
3351
|
-
token:
|
|
3563
|
+
token: l,
|
|
3352
3564
|
apiBaseUrl: c,
|
|
3353
|
-
executor:
|
|
3354
|
-
debug:
|
|
3565
|
+
executor: y,
|
|
3566
|
+
debug: u
|
|
3355
3567
|
}),
|
|
3356
|
-
[c,
|
|
3568
|
+
[c, u, y, l]
|
|
3357
3569
|
);
|
|
3358
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ o(Ur, { debug: u, children: /* @__PURE__ */ p(Rr.Provider, { value: h, children: [
|
|
3359
3571
|
i,
|
|
3360
|
-
f ? /* @__PURE__ */
|
|
3572
|
+
f ? /* @__PURE__ */ o(Yr, { ...f }) : null
|
|
3361
3573
|
] }) });
|
|
3362
3574
|
}
|
|
3363
3575
|
export {
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3576
|
+
ui as SemaphorDataAppProvider,
|
|
3577
|
+
Yr as SemaphorDevtools,
|
|
3578
|
+
oi as SemaphorDevtoolsInspectButton,
|
|
3579
|
+
ii as SemaphorViewBoundary,
|
|
3580
|
+
In as createSemaphorQueryExecutor,
|
|
3581
|
+
ri as defineSemaphorDataApp,
|
|
3582
|
+
ti as defineSemaphorInput,
|
|
3583
|
+
Mn as isSemaphorInputValueValidForOptions,
|
|
3584
|
+
ni as semaphor,
|
|
3585
|
+
di as useClearInvalidSemaphorInputValue,
|
|
3586
|
+
lr as useSemaphorDevtools,
|
|
3587
|
+
si as useSemaphorInput,
|
|
3588
|
+
ai as useSemaphorInputs,
|
|
3589
|
+
li as useSemaphorQuery
|
|
3378
3590
|
};
|