react-semaphor 0.1.383 → 0.1.384
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/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +1165 -1067
- package/dist/types/data-app-sdk.d.ts +21 -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 qr, toSemaphorInputBinding as Ar, toSemaphorActiveInputSnapshots as U, toSemaphorMatrixIntent as Rr, toSemaphorSqlIntent as Er, toSemaphorInputOptionsIntent as Tr, toSemaphorRecordsIntent as kr, toSemaphorAnalysisQueryOptions as Cr, toSemaphorAnalysisIntent as Dr, toSemaphorMetricIntent as Or, hasSemaphorInputValue as re, normalizeSemaphorInputOptions as Ze, toSemaphorInputSpec as er } from "../data-app-sdk-adapters/index.js";
|
|
2
|
+
import { jsxs as p, Fragment as Lr, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as fe, useContext as z, useState as Q, useRef as k, useEffect as L, useMemo as b, useId as rr, useCallback as C, useReducer as Br } from "react";
|
|
4
|
+
import { M as Kr, a as $r, S as _r, E as Nr } from "../chunks/search-0LmWwZzW.js";
|
|
5
|
+
import { X as Fr, j as Mr } from "../chunks/x-IdR_js6f.js";
|
|
6
|
+
import { b as Wr } from "../chunks/validators-CHPH6ORs.js";
|
|
7
7
|
import "../chunks/analyze-result-contract-DuhlklhI.js";
|
|
8
|
-
function
|
|
8
|
+
function ie(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 Wn(e) {
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function zn(e) {
|
|
19
19
|
return e;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const jn = {
|
|
22
22
|
source: {
|
|
23
23
|
semantic(e) {
|
|
24
24
|
return {
|
|
@@ -34,17 +34,17 @@ const Dn = {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
field: {
|
|
37
|
-
measure(e,
|
|
38
|
-
return
|
|
37
|
+
measure(e, r) {
|
|
38
|
+
return ie(e, "measure", r);
|
|
39
39
|
},
|
|
40
|
-
dimension(e,
|
|
41
|
-
return
|
|
40
|
+
dimension(e, r) {
|
|
41
|
+
return ie(e, "dimension", r);
|
|
42
42
|
},
|
|
43
|
-
date(e,
|
|
44
|
-
return
|
|
43
|
+
date(e, r) {
|
|
44
|
+
return ie(e, "date", r);
|
|
45
45
|
},
|
|
46
|
-
id(e,
|
|
47
|
-
return
|
|
46
|
+
id(e, r) {
|
|
47
|
+
return ie(e, "id", r);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
filter(e) {
|
|
@@ -53,15 +53,15 @@ const Dn = {
|
|
|
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] = qr([e]), n = Ar({
|
|
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,158 +128,158 @@ const Dn = {
|
|
|
128
128
|
queryKind: "matrix"
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, ye = 10, he = 100, zr = 25, jr = 500, tr = {
|
|
132
132
|
enabled: !1,
|
|
133
133
|
queries: [],
|
|
134
134
|
getQuery: () => {
|
|
135
135
|
},
|
|
136
136
|
getQueries: () => []
|
|
137
|
-
},
|
|
137
|
+
}, Te = fe(null), ke = fe(null), Ce = fe(
|
|
138
138
|
void 0
|
|
139
|
-
),
|
|
140
|
-
function
|
|
139
|
+
), W = [];
|
|
140
|
+
function Hr({
|
|
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(() => Mt(e), [e]), [n, i] = Br(
|
|
145
|
+
Ct,
|
|
146
|
+
t,
|
|
147
|
+
fr
|
|
148
|
+
), l = k(n), u = rr(), [c, d] = Q({ open: !1 });
|
|
149
|
+
l.current = n, L(() => {
|
|
150
|
+
i({ type: "config", config: t });
|
|
151
|
+
}, [t]), L(() => {
|
|
152
152
|
if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
|
|
153
153
|
return;
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
ownerId:
|
|
157
|
-
bridge:
|
|
154
|
+
const S = $t(() => l.current);
|
|
155
|
+
return Pr({
|
|
156
|
+
ownerId: u,
|
|
157
|
+
bridge: S
|
|
158
158
|
}), () => {
|
|
159
|
-
|
|
159
|
+
Vr(u);
|
|
160
160
|
};
|
|
161
|
-
}, [
|
|
162
|
-
const f = b(() => ({ state: n, dispatch: i }), [n]),
|
|
163
|
-
|
|
164
|
-
}, []),
|
|
165
|
-
|
|
166
|
-
}, []),
|
|
167
|
-
|
|
161
|
+
}, [u, n.enabled, n.exposeWindowBridge]);
|
|
162
|
+
const f = b(() => ({ state: n, dispatch: i }), [n]), g = C((S) => {
|
|
163
|
+
d({ open: !0, focus: S });
|
|
164
|
+
}, []), y = C(() => {
|
|
165
|
+
d((S) => ({ ...S, open: !1 }));
|
|
166
|
+
}, []), h = C((S) => {
|
|
167
|
+
d({ open: !0, focus: S });
|
|
168
168
|
}, []), m = b(
|
|
169
169
|
() => ({
|
|
170
|
-
open:
|
|
171
|
-
focus:
|
|
172
|
-
openDevtools:
|
|
173
|
-
closeDevtools:
|
|
174
|
-
focusTrace:
|
|
170
|
+
open: c.open,
|
|
171
|
+
focus: c.focus,
|
|
172
|
+
openDevtools: g,
|
|
173
|
+
closeDevtools: y,
|
|
174
|
+
focusTrace: h
|
|
175
175
|
}),
|
|
176
176
|
[
|
|
177
|
-
g,
|
|
178
177
|
y,
|
|
179
178
|
h,
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
g,
|
|
180
|
+
c.focus,
|
|
181
|
+
c.open
|
|
182
182
|
]
|
|
183
183
|
);
|
|
184
|
-
return /* @__PURE__ */ s(
|
|
184
|
+
return /* @__PURE__ */ s(Te.Provider, { value: f, children: /* @__PURE__ */ s(ke.Provider, { value: m, children: r }) });
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const
|
|
188
|
-
(
|
|
186
|
+
function Pr(e) {
|
|
187
|
+
const r = W.findIndex(
|
|
188
|
+
(t) => t.ownerId === e.ownerId
|
|
189
189
|
);
|
|
190
|
-
|
|
190
|
+
r >= 0 && W.splice(r, 1), W.push(e), nr();
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
194
|
-
(
|
|
192
|
+
function Vr(e) {
|
|
193
|
+
const r = W.findIndex(
|
|
194
|
+
(t) => t.ownerId === e
|
|
195
195
|
);
|
|
196
|
-
|
|
196
|
+
r >= 0 && W.splice(r, 1), nr();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function nr() {
|
|
199
199
|
if (typeof window > "u")
|
|
200
200
|
return;
|
|
201
|
-
const e =
|
|
201
|
+
const e = W[W.length - 1];
|
|
202
202
|
e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Hn({
|
|
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__ */ s(
|
|
209
|
+
const n = b(() => ({ id: e, title: r }), [e, r]);
|
|
210
|
+
return /* @__PURE__ */ s(Ce.Provider, { value: n, children: t });
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Qr({
|
|
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 l = ir(), u = z(ke), [c, d] = Q(""), [f, g] = Q(!1), y = k(null), h = k(null), m = u == null ? void 0 : u.openDevtools, S = u == null ? void 0 : u.closeDevtools, R = (u == null ? void 0 : u.open) === !0;
|
|
220
|
+
L(() => {
|
|
221
|
+
cr();
|
|
222
|
+
}, []), L(() => {
|
|
223
|
+
r && l.enabled && (m == null || m());
|
|
224
|
+
}, [r, l.enabled, m]), L(() => {
|
|
225
|
+
if (!R || !S)
|
|
226
226
|
return;
|
|
227
|
-
const
|
|
228
|
-
var E,
|
|
229
|
-
const
|
|
230
|
-
|
|
227
|
+
const v = (I) => {
|
|
228
|
+
var E, O;
|
|
229
|
+
const D = I.target;
|
|
230
|
+
D instanceof Node && ((E = y.current) != null && E.contains(D) || (O = h.current) != null && O.contains(D) || S());
|
|
231
231
|
};
|
|
232
|
-
return document.addEventListener("pointerdown",
|
|
233
|
-
document.removeEventListener("pointerdown",
|
|
232
|
+
return document.addEventListener("pointerdown", v, !0), document.addEventListener("mousedown", v, !0), document.addEventListener("click", v, !0), () => {
|
|
233
|
+
document.removeEventListener("pointerdown", v, !0), document.removeEventListener("mousedown", v, !0), document.removeEventListener("click", v, !0);
|
|
234
234
|
};
|
|
235
|
-
}, [
|
|
235
|
+
}, [S, R]);
|
|
236
236
|
const o = b(
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
() =>
|
|
241
|
-
[
|
|
237
|
+
() => it(l.queries),
|
|
238
|
+
[l.queries]
|
|
239
|
+
), x = b(
|
|
240
|
+
() => ot(l.queries, c),
|
|
241
|
+
[l.queries, c]
|
|
242
|
+
), B = b(
|
|
243
|
+
() => st(x),
|
|
244
|
+
[x]
|
|
242
245
|
), T = b(
|
|
243
|
-
() =>
|
|
244
|
-
[
|
|
245
|
-
), k = b(
|
|
246
|
-
() => tt(S, l == null ? void 0 : l.focus) || S[0],
|
|
247
|
-
[S, l == null ? void 0 : l.focus]
|
|
246
|
+
() => or(x, u == null ? void 0 : u.focus) || x[0],
|
|
247
|
+
[x, u == null ? void 0 : u.focus]
|
|
248
248
|
);
|
|
249
|
-
return !
|
|
249
|
+
return !l.enabled || !u ? null : /* @__PURE__ */ p(Lr, { children: [
|
|
250
250
|
/* @__PURE__ */ p(
|
|
251
251
|
"button",
|
|
252
252
|
{
|
|
253
|
-
ref:
|
|
253
|
+
ref: y,
|
|
254
254
|
type: "button",
|
|
255
255
|
"aria-label": "Open Semaphor DevTools",
|
|
256
256
|
title: "Open Semaphor DevTools",
|
|
257
257
|
className: n ? `${$} ${n}` : $,
|
|
258
258
|
style: {
|
|
259
259
|
...a.launcher,
|
|
260
|
-
...
|
|
261
|
-
...
|
|
260
|
+
...It(e),
|
|
261
|
+
...qt(o.severity),
|
|
262
262
|
...i
|
|
263
263
|
},
|
|
264
|
-
onClick: () =>
|
|
264
|
+
onClick: () => u.openDevtools(),
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */ s(
|
|
266
|
+
/* @__PURE__ */ s(Gr, {}),
|
|
267
267
|
/* @__PURE__ */ s("span", { style: a.launcherText, children: o.total }),
|
|
268
268
|
o.issueCount > 0 ? /* @__PURE__ */ s("span", { style: a.launcherIssueCount, children: o.issueCount }) : null
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
|
-
|
|
272
|
+
u.open ? /* @__PURE__ */ p(
|
|
273
273
|
"div",
|
|
274
274
|
{
|
|
275
|
-
ref:
|
|
275
|
+
ref: h,
|
|
276
276
|
role: "dialog",
|
|
277
277
|
"aria-label": "Semaphor DevTools",
|
|
278
278
|
"aria-modal": "false",
|
|
279
279
|
className: $,
|
|
280
280
|
style: {
|
|
281
281
|
...a.panel,
|
|
282
|
-
...
|
|
282
|
+
...At(t),
|
|
283
283
|
...f ? a.panelFullscreen : null
|
|
284
284
|
},
|
|
285
285
|
children: [
|
|
@@ -304,8 +304,8 @@ function Ln({
|
|
|
304
304
|
"aria-label": f ? "Exit fullscreen Semaphor DevTools" : "Enter fullscreen Semaphor DevTools",
|
|
305
305
|
title: f ? "Exit fullscreen Semaphor DevTools" : "Enter fullscreen Semaphor DevTools",
|
|
306
306
|
style: a.iconButton,
|
|
307
|
-
onClick: () =>
|
|
308
|
-
children: f ? /* @__PURE__ */ s(
|
|
307
|
+
onClick: () => g((v) => !v),
|
|
308
|
+
children: f ? /* @__PURE__ */ s(Kr, { size: 15 }) : /* @__PURE__ */ s($r, { size: 15 })
|
|
309
309
|
}
|
|
310
310
|
),
|
|
311
311
|
/* @__PURE__ */ s(
|
|
@@ -314,20 +314,20 @@ function Ln({
|
|
|
314
314
|
type: "button",
|
|
315
315
|
"aria-label": "Close Semaphor DevTools",
|
|
316
316
|
style: a.iconButton,
|
|
317
|
-
onClick:
|
|
318
|
-
children: /* @__PURE__ */ s(
|
|
317
|
+
onClick: u.closeDevtools,
|
|
318
|
+
children: /* @__PURE__ */ s(Fr, { size: 15 })
|
|
319
319
|
}
|
|
320
320
|
)
|
|
321
321
|
] })
|
|
322
322
|
] }),
|
|
323
323
|
/* @__PURE__ */ p("label", { style: a.searchBox, children: [
|
|
324
|
-
/* @__PURE__ */ s(
|
|
324
|
+
/* @__PURE__ */ s(_r, { size: 14 }),
|
|
325
325
|
/* @__PURE__ */ s(
|
|
326
326
|
"input",
|
|
327
327
|
{
|
|
328
328
|
"aria-label": "Search Semaphor traces",
|
|
329
|
-
value:
|
|
330
|
-
onChange: (
|
|
329
|
+
value: c,
|
|
330
|
+
onChange: (v) => d(v.currentTarget.value),
|
|
331
331
|
placeholder: "Search traces",
|
|
332
332
|
style: a.searchInput
|
|
333
333
|
}
|
|
@@ -338,7 +338,7 @@ function Ln({
|
|
|
338
338
|
{
|
|
339
339
|
style: {
|
|
340
340
|
...a.panelBody,
|
|
341
|
-
...
|
|
341
|
+
...Rt(t)
|
|
342
342
|
},
|
|
343
343
|
children: [
|
|
344
344
|
/* @__PURE__ */ s(
|
|
@@ -346,55 +346,55 @@ function Ln({
|
|
|
346
346
|
{
|
|
347
347
|
style: {
|
|
348
348
|
...a.queryList,
|
|
349
|
-
...
|
|
349
|
+
...Et()
|
|
350
350
|
},
|
|
351
351
|
"aria-label": "Registered queries",
|
|
352
|
-
children:
|
|
352
|
+
children: x.length ? B.map((v) => /* @__PURE__ */ p("div", { style: a.queryGroup, children: [
|
|
353
353
|
/* @__PURE__ */ p("div", { style: a.queryGroupHeader, children: [
|
|
354
|
-
/* @__PURE__ */ s("span", { children:
|
|
355
|
-
/* @__PURE__ */ s("span", { style: a.queryGroupCount, children:
|
|
354
|
+
/* @__PURE__ */ s("span", { children: v.title }),
|
|
355
|
+
/* @__PURE__ */ s("span", { style: a.queryGroupCount, children: v.traces.length })
|
|
356
356
|
] }),
|
|
357
|
-
|
|
357
|
+
v.traces.length ? v.traces.map((I) => {
|
|
358
358
|
var K;
|
|
359
|
-
const
|
|
359
|
+
const D = lt(I, T), E = De(I), O = sr(I.queryKind), w = pe(I);
|
|
360
360
|
return /* @__PURE__ */ p(
|
|
361
361
|
"button",
|
|
362
362
|
{
|
|
363
363
|
type: "button",
|
|
364
|
-
title: `${E} · ${
|
|
364
|
+
title: `${E} · ${O} · ${w}`,
|
|
365
365
|
style: {
|
|
366
366
|
...a.queryListItem,
|
|
367
|
-
...
|
|
367
|
+
...D ? a.queryListItemSelected : null
|
|
368
368
|
},
|
|
369
|
-
onClick: () =>
|
|
370
|
-
traceId:
|
|
371
|
-
queryId:
|
|
372
|
-
viewId:
|
|
369
|
+
onClick: () => u.focusTrace({
|
|
370
|
+
traceId: I.traceId,
|
|
371
|
+
queryId: I.queryId,
|
|
372
|
+
viewId: I.viewId
|
|
373
373
|
}),
|
|
374
374
|
children: [
|
|
375
375
|
/* @__PURE__ */ p("span", { style: a.queryListItemHeader, children: [
|
|
376
|
-
/* @__PURE__ */ s(
|
|
376
|
+
/* @__PURE__ */ s(Yr, { status: (K = I.latestAttempt) == null ? void 0 : K.status }),
|
|
377
377
|
/* @__PURE__ */ s("span", { style: a.queryListTitle, title: E, children: E }),
|
|
378
|
-
/* @__PURE__ */ s("span", { style: a.queryListKindChip, children:
|
|
378
|
+
/* @__PURE__ */ s("span", { style: a.queryListKindChip, children: O })
|
|
379
379
|
] }),
|
|
380
380
|
/* @__PURE__ */ s(
|
|
381
381
|
"span",
|
|
382
382
|
{
|
|
383
383
|
className: `${$}-source`,
|
|
384
384
|
style: a.queryListSource,
|
|
385
|
-
title:
|
|
386
|
-
children:
|
|
385
|
+
title: w,
|
|
386
|
+
children: w
|
|
387
387
|
}
|
|
388
388
|
)
|
|
389
389
|
]
|
|
390
390
|
},
|
|
391
|
-
Re(
|
|
391
|
+
Re(I)
|
|
392
392
|
);
|
|
393
393
|
}) : /* @__PURE__ */ s("div", { style: a.queryGroupEmpty, children: "No input traces" })
|
|
394
|
-
] },
|
|
394
|
+
] }, v.title)) : /* @__PURE__ */ s("div", { style: a.emptyState, children: "No matching traces" })
|
|
395
395
|
}
|
|
396
396
|
),
|
|
397
|
-
/* @__PURE__ */ s(
|
|
397
|
+
/* @__PURE__ */ s(Jr, { trace: T })
|
|
398
398
|
]
|
|
399
399
|
}
|
|
400
400
|
)
|
|
@@ -403,145 +403,152 @@ function Ln({
|
|
|
403
403
|
) : null
|
|
404
404
|
] });
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Pn({
|
|
407
407
|
queryId: e,
|
|
408
|
-
viewId:
|
|
409
|
-
label:
|
|
408
|
+
viewId: r,
|
|
409
|
+
label: t,
|
|
410
410
|
className: n,
|
|
411
411
|
style: i
|
|
412
412
|
} = {}) {
|
|
413
|
-
var
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
413
|
+
var y, h;
|
|
414
|
+
const l = ir(), u = z(ke), c = z(Ce);
|
|
415
|
+
L(() => {
|
|
416
|
+
cr();
|
|
417
417
|
}, []);
|
|
418
|
-
const
|
|
419
|
-
() =>
|
|
418
|
+
const d = r || (c == null ? void 0 : c.id), f = b(
|
|
419
|
+
() => at(l.queries, {
|
|
420
420
|
queryId: e,
|
|
421
|
-
viewId:
|
|
421
|
+
viewId: d
|
|
422
422
|
}),
|
|
423
423
|
[
|
|
424
|
-
|
|
424
|
+
l.queries,
|
|
425
425
|
e,
|
|
426
|
-
|
|
426
|
+
d
|
|
427
427
|
]
|
|
428
428
|
);
|
|
429
|
-
if (!
|
|
429
|
+
if (!l.enabled || !u || !f)
|
|
430
430
|
return null;
|
|
431
|
-
const
|
|
431
|
+
const g = t || `Inspect ${De(f)}`;
|
|
432
432
|
return /* @__PURE__ */ p(
|
|
433
433
|
"button",
|
|
434
434
|
{
|
|
435
435
|
type: "button",
|
|
436
|
-
"aria-label":
|
|
437
|
-
title:
|
|
436
|
+
"aria-label": g,
|
|
437
|
+
title: g,
|
|
438
438
|
className: n ? `${$} ${n}` : $,
|
|
439
439
|
style: {
|
|
440
440
|
...a.inspectButton,
|
|
441
|
-
...
|
|
441
|
+
...Tt((y = f.latestAttempt) == null ? void 0 : y.status),
|
|
442
442
|
...i
|
|
443
443
|
},
|
|
444
|
-
onClick: () =>
|
|
444
|
+
onClick: () => u.openDevtools({
|
|
445
445
|
traceId: f.traceId,
|
|
446
446
|
queryId: f.queryId,
|
|
447
447
|
viewId: f.viewId
|
|
448
448
|
}),
|
|
449
449
|
children: [
|
|
450
|
-
/* @__PURE__ */ s(
|
|
451
|
-
/* @__PURE__ */ s("span", { style: a.inspectButtonText, children: ((
|
|
450
|
+
/* @__PURE__ */ s(Nr, { size: 13 }),
|
|
451
|
+
/* @__PURE__ */ s("span", { style: a.inspectButtonText, children: ((h = f.latestAttempt) == null ? void 0 : h.status) || "idle" })
|
|
452
452
|
]
|
|
453
453
|
}
|
|
454
454
|
);
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
const e = z(
|
|
458
|
-
return !e || !e.state.enabled ?
|
|
456
|
+
function ir() {
|
|
457
|
+
const e = z(Te);
|
|
458
|
+
return !e || !e.state.enabled ? tr : de(e.state);
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Ur({
|
|
461
461
|
spec: e,
|
|
462
|
-
queryKind:
|
|
463
|
-
queryKey:
|
|
462
|
+
queryKind: r,
|
|
463
|
+
queryKey: t,
|
|
464
464
|
intent: n,
|
|
465
465
|
activeInputs: i,
|
|
466
|
-
debug:
|
|
466
|
+
debug: l
|
|
467
467
|
}) {
|
|
468
|
-
const
|
|
468
|
+
const u = z(Te), c = z(Ce), d = !!(u != null && u.state.enabled), f = u == null ? void 0 : u.dispatch, g = Wt(e), y = e.label, h = b(
|
|
469
469
|
() => JSON.stringify(e),
|
|
470
470
|
[e]
|
|
471
471
|
), m = b(
|
|
472
472
|
() => JSON.stringify(i || []),
|
|
473
473
|
[i]
|
|
474
|
-
),
|
|
474
|
+
), S = b(
|
|
475
475
|
() => JSON.stringify(n || null),
|
|
476
476
|
[n]
|
|
477
|
-
),
|
|
478
|
-
o.current !==
|
|
479
|
-
const
|
|
480
|
-
() =>
|
|
481
|
-
[
|
|
482
|
-
), K = (
|
|
477
|
+
), R = k(e), o = k(h), x = k(n), B = k(S), T = k(i), v = k(m);
|
|
478
|
+
o.current !== h && (o.current = h, R.current = e), B.current !== S && (B.current = S, x.current = n), v.current !== m && (v.current = m, T.current = i);
|
|
479
|
+
const I = R.current, D = x.current, E = T.current, O = rr(), w = b(
|
|
480
|
+
() => g || `query_${hr(t)}`,
|
|
481
|
+
[t, g]
|
|
482
|
+
), K = (l == null ? void 0 : l.viewId) || (c == null ? void 0 : c.id), Ke = (l == null ? void 0 : l.title) || (c == null ? void 0 : c.title), wr = JSON.stringify(Pe(l) || []), $e = b(
|
|
483
|
+
() => Pe(l),
|
|
484
|
+
// Keep inline debug={{ sourceHint: ... }} objects from re-registering every render.
|
|
485
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
486
|
+
[wr]
|
|
487
|
+
), F = b(
|
|
483
488
|
() => [
|
|
484
489
|
K || "unscoped-view",
|
|
485
|
-
|
|
486
|
-
|
|
490
|
+
w,
|
|
491
|
+
O
|
|
487
492
|
].join("::"),
|
|
488
|
-
[
|
|
489
|
-
),
|
|
493
|
+
[w, O, K]
|
|
494
|
+
), _e = b(
|
|
490
495
|
() => ({
|
|
491
|
-
traceKey:
|
|
492
|
-
spec:
|
|
493
|
-
queryId:
|
|
494
|
-
queryLabel:
|
|
495
|
-
queryKind:
|
|
496
|
-
builder:
|
|
496
|
+
traceKey: F,
|
|
497
|
+
spec: I,
|
|
498
|
+
queryId: w,
|
|
499
|
+
queryLabel: y,
|
|
500
|
+
queryKind: r,
|
|
501
|
+
builder: zt(r),
|
|
497
502
|
viewId: K,
|
|
498
|
-
viewTitle:
|
|
499
|
-
|
|
503
|
+
viewTitle: Ke,
|
|
504
|
+
sourceHints: $e,
|
|
505
|
+
intent: D,
|
|
500
506
|
activeInputs: E,
|
|
501
|
-
clientWarnings:
|
|
507
|
+
clientWarnings: g ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
|
|
502
508
|
}),
|
|
503
509
|
[
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
h,
|
|
510
|
+
w,
|
|
511
|
+
r,
|
|
507
512
|
g,
|
|
508
|
-
|
|
513
|
+
y,
|
|
514
|
+
I,
|
|
509
515
|
E,
|
|
510
|
-
|
|
511
|
-
|
|
516
|
+
D,
|
|
517
|
+
$e,
|
|
518
|
+
F,
|
|
512
519
|
K,
|
|
513
|
-
|
|
520
|
+
Ke
|
|
514
521
|
]
|
|
515
522
|
);
|
|
516
|
-
|
|
517
|
-
if (!(!
|
|
518
|
-
return f({ type: "register", descriptor:
|
|
519
|
-
f({ type: "unregister", traceKey:
|
|
523
|
+
L(() => {
|
|
524
|
+
if (!(!d || !f))
|
|
525
|
+
return f({ type: "register", descriptor: _e }), () => {
|
|
526
|
+
f({ type: "unregister", traceKey: F });
|
|
520
527
|
};
|
|
521
|
-
}, [
|
|
522
|
-
const _ =
|
|
523
|
-
(
|
|
524
|
-
!
|
|
528
|
+
}, [_e, f, d, F]);
|
|
529
|
+
const _ = C(
|
|
530
|
+
(A, j) => {
|
|
531
|
+
!d || !f || f({ type: "event", traceKey: F, event: A, latestAttempt: j });
|
|
525
532
|
},
|
|
526
|
-
[f,
|
|
527
|
-
),
|
|
533
|
+
[f, d, F]
|
|
534
|
+
), Ne = C(() => {
|
|
528
535
|
_(
|
|
529
536
|
{
|
|
530
537
|
type: "query_started",
|
|
531
|
-
queryId:
|
|
532
|
-
at:
|
|
538
|
+
queryId: w,
|
|
539
|
+
at: le()
|
|
533
540
|
},
|
|
534
541
|
{ status: "loading" }
|
|
535
542
|
);
|
|
536
|
-
}, [_,
|
|
537
|
-
(
|
|
538
|
-
const J =
|
|
543
|
+
}, [_, w]), Fe = C(
|
|
544
|
+
(A, j) => {
|
|
545
|
+
const J = Je(A), Y = Jt(A), Ir = Yt(A);
|
|
539
546
|
_(
|
|
540
547
|
{
|
|
541
548
|
type: "query_succeeded",
|
|
542
|
-
queryId:
|
|
549
|
+
queryId: w,
|
|
543
550
|
requestId: J,
|
|
544
|
-
at:
|
|
551
|
+
at: le(),
|
|
545
552
|
rowCount: Y,
|
|
546
553
|
durationMs: j
|
|
547
554
|
},
|
|
@@ -550,21 +557,21 @@ function zt({
|
|
|
550
557
|
status: "success",
|
|
551
558
|
durationMs: j,
|
|
552
559
|
rowCount: Y,
|
|
553
|
-
columnCount:
|
|
554
|
-
executionResult:
|
|
560
|
+
columnCount: Ir,
|
|
561
|
+
executionResult: Ge(A)
|
|
555
562
|
}
|
|
556
563
|
);
|
|
557
564
|
},
|
|
558
|
-
[_,
|
|
559
|
-
),
|
|
560
|
-
(
|
|
561
|
-
const J =
|
|
565
|
+
[_, w]
|
|
566
|
+
), ne = C(
|
|
567
|
+
(A, j) => {
|
|
568
|
+
const J = Je(A), Y = A instanceof Error ? A.message : String(A);
|
|
562
569
|
_(
|
|
563
570
|
{
|
|
564
571
|
type: "query_failed",
|
|
565
|
-
queryId:
|
|
572
|
+
queryId: w,
|
|
566
573
|
requestId: J,
|
|
567
|
-
at:
|
|
574
|
+
at: le(),
|
|
568
575
|
errorMessage: Y
|
|
569
576
|
},
|
|
570
577
|
{
|
|
@@ -572,53 +579,53 @@ function zt({
|
|
|
572
579
|
status: "error",
|
|
573
580
|
durationMs: j,
|
|
574
581
|
errorMessage: Y,
|
|
575
|
-
executionResult:
|
|
582
|
+
executionResult: Ge(A)
|
|
576
583
|
}
|
|
577
584
|
);
|
|
578
585
|
},
|
|
579
|
-
[_,
|
|
580
|
-
),
|
|
581
|
-
(
|
|
586
|
+
[_, w]
|
|
587
|
+
), Me = C(
|
|
588
|
+
(A) => {
|
|
582
589
|
_(
|
|
583
590
|
{
|
|
584
591
|
type: "query_ignored_stale",
|
|
585
|
-
queryId:
|
|
586
|
-
at:
|
|
587
|
-
reason:
|
|
592
|
+
queryId: w,
|
|
593
|
+
at: le(),
|
|
594
|
+
reason: A
|
|
588
595
|
}
|
|
589
596
|
);
|
|
590
597
|
},
|
|
591
|
-
[_,
|
|
592
|
-
), We =
|
|
593
|
-
(
|
|
594
|
-
|
|
598
|
+
[_, w]
|
|
599
|
+
), We = C(
|
|
600
|
+
(A) => {
|
|
601
|
+
ne(A, 0);
|
|
595
602
|
},
|
|
596
|
-
[
|
|
597
|
-
),
|
|
603
|
+
[ne]
|
|
604
|
+
), ge = d ? u == null ? void 0 : u.state.entries[F] : void 0;
|
|
598
605
|
return b(
|
|
599
606
|
() => ({
|
|
600
|
-
enabled:
|
|
601
|
-
queryId:
|
|
602
|
-
trace:
|
|
603
|
-
start:
|
|
604
|
-
success:
|
|
605
|
-
failure:
|
|
606
|
-
ignored:
|
|
607
|
+
enabled: d,
|
|
608
|
+
queryId: w,
|
|
609
|
+
trace: ge ? ue(ge) : void 0,
|
|
610
|
+
start: Ne,
|
|
611
|
+
success: Fe,
|
|
612
|
+
failure: ne,
|
|
613
|
+
ignored: Me,
|
|
607
614
|
validationFailure: We
|
|
608
615
|
}),
|
|
609
616
|
[
|
|
610
|
-
|
|
611
|
-
|
|
617
|
+
d,
|
|
618
|
+
ne,
|
|
619
|
+
Me,
|
|
620
|
+
w,
|
|
621
|
+
Ne,
|
|
612
622
|
Fe,
|
|
613
|
-
|
|
614
|
-
$e,
|
|
615
|
-
_e,
|
|
616
|
-
me,
|
|
623
|
+
ge,
|
|
617
624
|
We
|
|
618
625
|
]
|
|
619
626
|
);
|
|
620
627
|
}
|
|
621
|
-
function
|
|
628
|
+
function Gr() {
|
|
622
629
|
return /* @__PURE__ */ s("span", { style: a.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
|
|
623
630
|
"svg",
|
|
624
631
|
{
|
|
@@ -636,22 +643,22 @@ function jt() {
|
|
|
636
643
|
}
|
|
637
644
|
) });
|
|
638
645
|
}
|
|
639
|
-
function
|
|
646
|
+
function Jr({
|
|
640
647
|
trace: e
|
|
641
648
|
}) {
|
|
642
|
-
var
|
|
649
|
+
var R, o, x, B, T;
|
|
643
650
|
if (!e)
|
|
644
651
|
return /* @__PURE__ */ s("div", { style: a.detailsPane, children: /* @__PURE__ */ s("div", { style: a.emptyState, children: "No traces registered yet" }) });
|
|
645
|
-
const
|
|
646
|
-
(
|
|
647
|
-
), i =
|
|
648
|
-
(
|
|
649
|
-
),
|
|
652
|
+
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = ve(
|
|
653
|
+
(R = t == null ? void 0 : t.validation) == null ? void 0 : R.warnings
|
|
654
|
+
), i = ve((o = t == null ? void 0 : t.validation) == null ? void 0 : o.errors), l = ve(
|
|
655
|
+
(x = t == null ? void 0 : t.coverage) == null ? void 0 : x.missingObligations
|
|
656
|
+
), u = t == null ? void 0 : t.compiledQuery, c = wt(t), d = ((B = e.server) == null ? void 0 : B.compiledSql) || c.compiledSql, f = r != null && r.errorMessage ? [r.errorMessage] : [], g = [
|
|
650
657
|
...e.clientWarnings,
|
|
651
658
|
...n,
|
|
652
659
|
...i,
|
|
653
|
-
...
|
|
654
|
-
],
|
|
660
|
+
...l
|
|
661
|
+
], y = pe(e), h = e.viewId ? `${e.viewId} - ${e.queryId}` : e.queryId, m = e.inputsApplied.length > 0, S = !!(u || d);
|
|
655
662
|
return /* @__PURE__ */ p("div", { style: a.detailsPane, children: [
|
|
656
663
|
/* @__PURE__ */ p("div", { style: a.detailsHeader, children: [
|
|
657
664
|
/* @__PURE__ */ p("div", { style: a.detailsHeaderTopRow, children: [
|
|
@@ -661,12 +668,12 @@ function Pt({
|
|
|
661
668
|
"aria-hidden": !0,
|
|
662
669
|
style: {
|
|
663
670
|
...a.detailsHeaderStatusDot,
|
|
664
|
-
...
|
|
671
|
+
...dr(r == null ? void 0 : r.status)
|
|
665
672
|
}
|
|
666
673
|
}
|
|
667
674
|
),
|
|
668
|
-
/* @__PURE__ */ s("span", { style: a.detailsTitle, children:
|
|
669
|
-
/* @__PURE__ */ s("span", { style: a.detailsKindChip, children:
|
|
675
|
+
/* @__PURE__ */ s("span", { style: a.detailsTitle, children: De(e) }),
|
|
676
|
+
/* @__PURE__ */ s("span", { style: a.detailsKindChip, children: sr(e.queryKind) })
|
|
670
677
|
] }),
|
|
671
678
|
/* @__PURE__ */ p("div", { style: a.detailsCaption, children: [
|
|
672
679
|
/* @__PURE__ */ s(
|
|
@@ -678,56 +685,57 @@ function Pt({
|
|
|
678
685
|
),
|
|
679
686
|
/* @__PURE__ */ p("span", { style: a.detailsCaptionItem, children: [
|
|
680
687
|
/* @__PURE__ */ s("span", { style: a.detailsCaptionLabel, children: "Source" }),
|
|
681
|
-
/* @__PURE__ */ s("span", { style: a.detailsCaptionValue, children:
|
|
688
|
+
/* @__PURE__ */ s("span", { style: a.detailsCaptionValue, children: y })
|
|
682
689
|
] }),
|
|
683
690
|
/* @__PURE__ */ p("span", { style: a.detailsCaptionItem, children: [
|
|
684
691
|
/* @__PURE__ */ s("span", { style: a.detailsCaptionLabel, children: "Rows" }),
|
|
685
|
-
/* @__PURE__ */ s("span", { style: a.detailsCaptionValue, children:
|
|
692
|
+
/* @__PURE__ */ s("span", { style: a.detailsCaptionValue, children: yt(r == null ? void 0 : r.rowCount) })
|
|
686
693
|
] }),
|
|
687
694
|
/* @__PURE__ */ p("span", { style: a.detailsCaptionItem, children: [
|
|
688
695
|
/* @__PURE__ */ s("span", { style: a.detailsCaptionLabel, children: "Duration" }),
|
|
689
|
-
/* @__PURE__ */ s("span", { style: a.detailsCaptionValue, children:
|
|
696
|
+
/* @__PURE__ */ s("span", { style: a.detailsCaptionValue, children: ht(r == null ? void 0 : r.durationMs) })
|
|
690
697
|
] })
|
|
691
698
|
] })
|
|
692
699
|
] }),
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
/* @__PURE__ */ s(
|
|
696
|
-
/* @__PURE__ */ s(
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
+
f.length ? /* @__PURE__ */ s(ze, { tone: "error", title: "Error", items: f }) : null,
|
|
701
|
+
g.length ? /* @__PURE__ */ s(ze, { tone: "warning", title: "Warnings", items: g }) : null,
|
|
702
|
+
/* @__PURE__ */ s(Xr, { trace: e }),
|
|
703
|
+
/* @__PURE__ */ s(Zr, { trace: e }),
|
|
704
|
+
(T = e.sourceHints) != null && T.length ? /* @__PURE__ */ s(et, { hints: e.sourceHints }) : null,
|
|
705
|
+
m ? /* @__PURE__ */ s(tt, { inputs: e.inputsApplied }) : null,
|
|
706
|
+
S ? /* @__PURE__ */ s(ee, { title: "Compiled query", children: /* @__PURE__ */ s(
|
|
707
|
+
nt,
|
|
700
708
|
{
|
|
701
|
-
compiledQuery:
|
|
702
|
-
compiledSql:
|
|
709
|
+
compiledQuery: u,
|
|
710
|
+
compiledSql: d
|
|
703
711
|
}
|
|
704
712
|
) }) : null,
|
|
705
|
-
/* @__PURE__ */ s(
|
|
713
|
+
/* @__PURE__ */ s(ee, { title: "Lifecycle events", children: e.recentEvents.length ? /* @__PURE__ */ s("div", { style: a.eventList, children: e.recentEvents.slice(-5).map((v, I) => /* @__PURE__ */ p(
|
|
706
714
|
"div",
|
|
707
715
|
{
|
|
708
716
|
style: a.eventRow,
|
|
709
717
|
children: [
|
|
710
|
-
/* @__PURE__ */ s("span", { style: a.eventType, children:
|
|
711
|
-
/* @__PURE__ */ s("span", { style: a.eventMeta, children:
|
|
718
|
+
/* @__PURE__ */ s("span", { style: a.eventType, children: bt(v) }),
|
|
719
|
+
/* @__PURE__ */ s("span", { style: a.eventMeta, children: St(v) })
|
|
712
720
|
]
|
|
713
721
|
},
|
|
714
|
-
`${
|
|
722
|
+
`${v.type}:${v.at}:${I}`
|
|
715
723
|
)) }) : /* @__PURE__ */ s("div", { style: a.mutedText, children: "No attempts recorded" }) }),
|
|
716
|
-
/* @__PURE__ */ s(
|
|
724
|
+
/* @__PURE__ */ s(ee, { title: "Raw trace JSON", children: /* @__PURE__ */ s("pre", { style: a.codeBlock, children: vt(e) }) })
|
|
717
725
|
] });
|
|
718
726
|
}
|
|
719
|
-
function
|
|
727
|
+
function ze({
|
|
720
728
|
tone: e,
|
|
721
|
-
title:
|
|
722
|
-
items:
|
|
729
|
+
title: r,
|
|
730
|
+
items: t
|
|
723
731
|
}) {
|
|
724
732
|
const n = e === "error" ? a.alertCardError : a.alertCardWarning;
|
|
725
733
|
return /* @__PURE__ */ p("div", { style: { ...a.alertCard, ...n }, children: [
|
|
726
|
-
/* @__PURE__ */ s("div", { style: a.alertCardTitle, children:
|
|
727
|
-
|
|
734
|
+
/* @__PURE__ */ s("div", { style: a.alertCardTitle, children: r }),
|
|
735
|
+
t.length > 1 ? /* @__PURE__ */ s("ul", { style: a.alertCardList, children: t.map((i, l) => /* @__PURE__ */ s("li", { children: i }, `${e}-${l}`)) }) : /* @__PURE__ */ s("div", { children: t[0] })
|
|
728
736
|
] });
|
|
729
737
|
}
|
|
730
|
-
function
|
|
738
|
+
function Yr({
|
|
731
739
|
status: e
|
|
732
740
|
}) {
|
|
733
741
|
return /* @__PURE__ */ s(
|
|
@@ -736,52 +744,52 @@ function Vt({
|
|
|
736
744
|
"aria-hidden": !0,
|
|
737
745
|
style: {
|
|
738
746
|
...a.statusDot,
|
|
739
|
-
...
|
|
747
|
+
...dr(e)
|
|
740
748
|
}
|
|
741
749
|
}
|
|
742
750
|
);
|
|
743
751
|
}
|
|
744
|
-
function
|
|
752
|
+
function ee({
|
|
745
753
|
title: e,
|
|
746
|
-
children:
|
|
754
|
+
children: r
|
|
747
755
|
}) {
|
|
748
756
|
return /* @__PURE__ */ p("details", { style: a.disclosure, children: [
|
|
749
757
|
/* @__PURE__ */ s("summary", { style: a.disclosureSummary, children: e }),
|
|
750
|
-
/* @__PURE__ */ s("div", { style: a.disclosureBody, children:
|
|
758
|
+
/* @__PURE__ */ s("div", { style: a.disclosureBody, children: r })
|
|
751
759
|
] });
|
|
752
760
|
}
|
|
753
|
-
function
|
|
761
|
+
function Xr({
|
|
754
762
|
trace: e
|
|
755
763
|
}) {
|
|
756
|
-
var
|
|
757
|
-
const
|
|
764
|
+
var l;
|
|
765
|
+
const r = (l = e.projectionFieldRefs) != null && l.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = ut(r), i = dt(e, n, r);
|
|
758
766
|
return /* @__PURE__ */ p("div", { style: a.recipe, children: [
|
|
759
|
-
/* @__PURE__ */ s("div", { style: a.recipeSummary, children: i.map((
|
|
760
|
-
/* @__PURE__ */ s("span", { style: a.recipeSummaryLabel, children:
|
|
761
|
-
/* @__PURE__ */ s("span", { style: a.recipeSummaryValue, title:
|
|
762
|
-
] },
|
|
763
|
-
/* @__PURE__ */ s(
|
|
764
|
-
/* @__PURE__ */ s(
|
|
767
|
+
/* @__PURE__ */ s("div", { style: a.recipeSummary, children: i.map((u) => /* @__PURE__ */ p("div", { style: a.recipeSummaryRow, children: [
|
|
768
|
+
/* @__PURE__ */ s("span", { style: a.recipeSummaryLabel, children: u.label }),
|
|
769
|
+
/* @__PURE__ */ s("span", { style: a.recipeSummaryValue, title: u.value, children: u.value })
|
|
770
|
+
] }, u.label)) }),
|
|
771
|
+
/* @__PURE__ */ s(M, { title: "Measures", fields: n.measures }),
|
|
772
|
+
/* @__PURE__ */ s(M, { title: "Time fields", fields: n.timeFields }),
|
|
765
773
|
/* @__PURE__ */ s(
|
|
766
|
-
|
|
774
|
+
M,
|
|
767
775
|
{
|
|
768
776
|
title: "Dimensions",
|
|
769
777
|
fields: n.dimensions,
|
|
770
778
|
emptyText: "No dimensions selected"
|
|
771
779
|
}
|
|
772
780
|
),
|
|
773
|
-
/* @__PURE__ */ s(
|
|
774
|
-
/* @__PURE__ */ s(
|
|
775
|
-
/* @__PURE__ */ s(
|
|
781
|
+
/* @__PURE__ */ s(M, { title: "Identifiers", fields: n.identifiers }),
|
|
782
|
+
/* @__PURE__ */ s(M, { title: "Other fields", fields: n.other }),
|
|
783
|
+
/* @__PURE__ */ s(M, { title: "Input bindings", fields: t })
|
|
776
784
|
] });
|
|
777
785
|
}
|
|
778
|
-
function
|
|
786
|
+
function Zr({
|
|
779
787
|
trace: e
|
|
780
788
|
}) {
|
|
781
|
-
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ s(
|
|
782
|
-
/* @__PURE__ */ s(
|
|
789
|
+
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ s(ee, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: a.traceLineage, children: [
|
|
790
|
+
/* @__PURE__ */ s(rt, { sources: e.sourceRefs }),
|
|
783
791
|
/* @__PURE__ */ s(
|
|
784
|
-
|
|
792
|
+
M,
|
|
785
793
|
{
|
|
786
794
|
title: "All field refs",
|
|
787
795
|
fields: e.fieldRefs,
|
|
@@ -790,7 +798,30 @@ function Ht({
|
|
|
790
798
|
)
|
|
791
799
|
] }) });
|
|
792
800
|
}
|
|
793
|
-
function
|
|
801
|
+
function et({
|
|
802
|
+
hints: e
|
|
803
|
+
}) {
|
|
804
|
+
return /* @__PURE__ */ s(ee, { title: "Source hints", children: /* @__PURE__ */ s("div", { style: a.recipeFieldList, children: e.map((r, t) => {
|
|
805
|
+
const n = gt(r), i = r.component || r.exportName || n || "Source hint", l = [
|
|
806
|
+
r.exportName && r.exportName !== i ? r.exportName : void 0,
|
|
807
|
+
n,
|
|
808
|
+
r.note
|
|
809
|
+
].filter(Boolean).join(" · ");
|
|
810
|
+
return /* @__PURE__ */ p(
|
|
811
|
+
"div",
|
|
812
|
+
{
|
|
813
|
+
style: a.recipeFieldRow,
|
|
814
|
+
title: l || i,
|
|
815
|
+
children: [
|
|
816
|
+
/* @__PURE__ */ s("span", { style: a.recipeFieldName, children: i }),
|
|
817
|
+
l ? /* @__PURE__ */ s("span", { style: a.recipeFieldMeta, children: l }) : null
|
|
818
|
+
]
|
|
819
|
+
},
|
|
820
|
+
`${i}:${n}:${t}`
|
|
821
|
+
);
|
|
822
|
+
}) }) });
|
|
823
|
+
}
|
|
824
|
+
function rt({
|
|
794
825
|
sources: e
|
|
795
826
|
}) {
|
|
796
827
|
return /* @__PURE__ */ p("div", { style: a.recipeGroup, children: [
|
|
@@ -798,52 +829,52 @@ function Ut({
|
|
|
798
829
|
/* @__PURE__ */ s("span", { style: a.recipeGroupTitle, children: "Sources" }),
|
|
799
830
|
/* @__PURE__ */ s("span", { style: a.recipeGroupCount, children: e.length })
|
|
800
831
|
] }),
|
|
801
|
-
e.length ? /* @__PURE__ */ s("div", { style: a.recipeFieldList, children: e.map((
|
|
832
|
+
e.length ? /* @__PURE__ */ s("div", { style: a.recipeFieldList, children: e.map((r, t) => /* @__PURE__ */ p(
|
|
802
833
|
"div",
|
|
803
834
|
{
|
|
804
835
|
style: a.recipeFieldRow,
|
|
805
|
-
title:
|
|
836
|
+
title: V(r),
|
|
806
837
|
children: [
|
|
807
|
-
/* @__PURE__ */ s("span", { style: a.recipeFieldName, children:
|
|
808
|
-
/* @__PURE__ */ s("span", { style: a.recipeFieldMeta, children:
|
|
838
|
+
/* @__PURE__ */ s("span", { style: a.recipeFieldName, children: V(r) }),
|
|
839
|
+
/* @__PURE__ */ s("span", { style: a.recipeFieldMeta, children: r.kind })
|
|
809
840
|
]
|
|
810
841
|
},
|
|
811
|
-
`${
|
|
842
|
+
`${V(r)}:${t}`
|
|
812
843
|
)) }) : /* @__PURE__ */ s("div", { style: a.recipeEmptyText, children: "No sources captured" })
|
|
813
844
|
] });
|
|
814
845
|
}
|
|
815
|
-
function
|
|
846
|
+
function M({
|
|
816
847
|
title: e,
|
|
817
|
-
fields:
|
|
818
|
-
emptyText:
|
|
848
|
+
fields: r,
|
|
849
|
+
emptyText: t
|
|
819
850
|
}) {
|
|
820
|
-
return !
|
|
851
|
+
return !r.length && !t ? null : /* @__PURE__ */ p("div", { style: a.recipeGroup, children: [
|
|
821
852
|
/* @__PURE__ */ p("div", { style: a.recipeGroupHeader, children: [
|
|
822
853
|
/* @__PURE__ */ s("span", { style: a.recipeGroupTitle, children: e }),
|
|
823
|
-
/* @__PURE__ */ s("span", { style: a.recipeGroupCount, children:
|
|
854
|
+
/* @__PURE__ */ s("span", { style: a.recipeGroupCount, children: r.length })
|
|
824
855
|
] }),
|
|
825
|
-
|
|
826
|
-
const
|
|
856
|
+
r.length ? /* @__PURE__ */ s("div", { style: a.recipeFieldList, children: r.map((n, i) => {
|
|
857
|
+
const l = lr(n), u = n.dataType && n.dataType !== "unknown" ? n.dataType : void 0, c = n.source ? V(n.source) : void 0, d = [l, u, c].filter(Boolean).join(" · ");
|
|
827
858
|
return /* @__PURE__ */ p(
|
|
828
859
|
"div",
|
|
829
860
|
{
|
|
830
861
|
style: a.recipeFieldRow,
|
|
831
|
-
title:
|
|
862
|
+
title: d,
|
|
832
863
|
children: [
|
|
833
|
-
/* @__PURE__ */ s("span", { style: a.recipeFieldName, children:
|
|
864
|
+
/* @__PURE__ */ s("span", { style: a.recipeFieldName, children: l }),
|
|
834
865
|
/* @__PURE__ */ p("span", { style: a.recipeFieldMeta, children: [
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
866
|
+
u ? /* @__PURE__ */ s("span", { children: u }) : null,
|
|
867
|
+
u && c ? /* @__PURE__ */ s("span", { style: a.recipeFieldMetaDivider, children: " · " }) : null,
|
|
868
|
+
c ? /* @__PURE__ */ s("span", { children: c }) : null
|
|
838
869
|
] })
|
|
839
870
|
]
|
|
840
871
|
},
|
|
841
|
-
`${
|
|
872
|
+
`${Oe(n)}:${i}`
|
|
842
873
|
);
|
|
843
|
-
}) }) : /* @__PURE__ */ s("div", { style: a.recipeEmptyText, children:
|
|
874
|
+
}) }) : /* @__PURE__ */ s("div", { style: a.recipeEmptyText, children: t })
|
|
844
875
|
] });
|
|
845
876
|
}
|
|
846
|
-
function
|
|
877
|
+
function tt({
|
|
847
878
|
inputs: e
|
|
848
879
|
}) {
|
|
849
880
|
return /* @__PURE__ */ p("div", { style: a.inputsAppliedBlock, children: [
|
|
@@ -851,30 +882,30 @@ function Gt({
|
|
|
851
882
|
/* @__PURE__ */ s("span", { style: a.inputsAppliedTitle, children: "Inputs applied" }),
|
|
852
883
|
/* @__PURE__ */ s("span", { style: a.inputsAppliedCount, children: e.length })
|
|
853
884
|
] }),
|
|
854
|
-
/* @__PURE__ */ s("div", { style: a.inputRecipeList, children: e.map((
|
|
855
|
-
const
|
|
885
|
+
/* @__PURE__ */ s("div", { style: a.inputRecipeList, children: e.map((r) => {
|
|
886
|
+
const t = ur(r);
|
|
856
887
|
return /* @__PURE__ */ p(
|
|
857
888
|
"div",
|
|
858
889
|
{
|
|
859
890
|
style: a.inputRecipeRow,
|
|
860
|
-
title:
|
|
891
|
+
title: t.title,
|
|
861
892
|
children: [
|
|
862
893
|
/* @__PURE__ */ p("div", { style: a.inputRecipeHeader, children: [
|
|
863
|
-
/* @__PURE__ */ s("span", { style: a.inputRecipeId, title:
|
|
864
|
-
|
|
865
|
-
/* @__PURE__ */ s("span", { style: a.inputValuePreview, title:
|
|
894
|
+
/* @__PURE__ */ s("span", { style: a.inputRecipeId, title: r.inputId, children: r.inputId }),
|
|
895
|
+
t.operator ? /* @__PURE__ */ s("span", { style: a.inputOperatorBadge, children: t.operator }) : null,
|
|
896
|
+
/* @__PURE__ */ s("span", { style: a.inputValuePreview, title: t.value, children: t.value })
|
|
866
897
|
] }),
|
|
867
|
-
|
|
898
|
+
t.binding ? /* @__PURE__ */ s("div", { style: a.inputRecipeBinding, title: t.binding, children: t.binding }) : null
|
|
868
899
|
]
|
|
869
900
|
},
|
|
870
|
-
|
|
901
|
+
r.inputId
|
|
871
902
|
);
|
|
872
903
|
}) })
|
|
873
904
|
] });
|
|
874
905
|
}
|
|
875
|
-
function
|
|
906
|
+
function nt({
|
|
876
907
|
compiledQuery: e,
|
|
877
|
-
compiledSql:
|
|
908
|
+
compiledSql: r
|
|
878
909
|
}) {
|
|
879
910
|
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: a.compiledQuery, children: [
|
|
880
911
|
/* @__PURE__ */ s(X, { label: "SQL", value: e.sql }),
|
|
@@ -883,85 +914,85 @@ function Jt({
|
|
|
883
914
|
X,
|
|
884
915
|
{
|
|
885
916
|
label: "Parameters",
|
|
886
|
-
value:
|
|
917
|
+
value: Ee(e.parameters)
|
|
887
918
|
}
|
|
888
919
|
) : null
|
|
889
|
-
] }) :
|
|
920
|
+
] }) : r ? /* @__PURE__ */ s(X, { label: "SQL", value: r }) : /* @__PURE__ */ s(X, { label: "Compiled query", value: Ee(e) });
|
|
890
921
|
}
|
|
891
922
|
function X({
|
|
892
923
|
label: e,
|
|
893
|
-
value:
|
|
924
|
+
value: r
|
|
894
925
|
}) {
|
|
895
926
|
return /* @__PURE__ */ p("div", { style: a.codeBlockGroup, children: [
|
|
896
927
|
/* @__PURE__ */ s("div", { style: a.codeBlockLabel, children: e }),
|
|
897
|
-
/* @__PURE__ */ s("pre", { style: a.codeBlock, children:
|
|
928
|
+
/* @__PURE__ */ s("pre", { style: a.codeBlock, children: r })
|
|
898
929
|
] });
|
|
899
930
|
}
|
|
900
|
-
function
|
|
901
|
-
const
|
|
931
|
+
function it(e) {
|
|
932
|
+
const r = e.filter(
|
|
902
933
|
(i) => {
|
|
903
|
-
var
|
|
904
|
-
return ((
|
|
934
|
+
var l;
|
|
935
|
+
return ((l = i.latestAttempt) == null ? void 0 : l.status) === "error";
|
|
905
936
|
}
|
|
906
|
-
).length,
|
|
937
|
+
).length, t = e.filter(
|
|
907
938
|
(i) => {
|
|
908
|
-
var
|
|
909
|
-
return ((
|
|
939
|
+
var l;
|
|
940
|
+
return ((l = i.latestAttempt) == null ? void 0 : l.status) === "loading";
|
|
910
941
|
}
|
|
911
942
|
).length, n = e.filter(
|
|
912
943
|
(i) => {
|
|
913
|
-
var
|
|
914
|
-
return i.clientWarnings.length > 0 || !!((
|
|
944
|
+
var l, u, c, d;
|
|
945
|
+
return i.clientWarnings.length > 0 || !!((d = (c = (u = (l = i.latestAttempt) == null ? void 0 : l.executionResult) == null ? void 0 : u.validation) == null ? void 0 : c.warnings) != null && d.length);
|
|
915
946
|
}
|
|
916
947
|
).length;
|
|
917
948
|
return {
|
|
918
949
|
total: e.length,
|
|
919
|
-
failed:
|
|
920
|
-
loading:
|
|
950
|
+
failed: r,
|
|
951
|
+
loading: t,
|
|
921
952
|
warningCount: n,
|
|
922
|
-
issueCount:
|
|
923
|
-
severity:
|
|
953
|
+
issueCount: r + n,
|
|
954
|
+
severity: r ? "error" : n ? "warning" : "ok"
|
|
924
955
|
};
|
|
925
956
|
}
|
|
926
|
-
function
|
|
927
|
-
const
|
|
928
|
-
return
|
|
957
|
+
function ot(e, r) {
|
|
958
|
+
const t = r.trim().toLowerCase();
|
|
959
|
+
return t ? e.filter(
|
|
929
960
|
(n) => [
|
|
930
961
|
n.queryId,
|
|
931
962
|
n.queryLabel,
|
|
932
963
|
n.viewId,
|
|
933
964
|
n.builder,
|
|
934
965
|
n.queryKind,
|
|
935
|
-
|
|
936
|
-
].filter(Boolean).join(" ").toLowerCase().includes(
|
|
966
|
+
pe(n)
|
|
967
|
+
].filter(Boolean).join(" ").toLowerCase().includes(t)
|
|
937
968
|
) : e;
|
|
938
969
|
}
|
|
939
|
-
function
|
|
940
|
-
const
|
|
970
|
+
function st(e) {
|
|
971
|
+
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Re));
|
|
941
972
|
return [
|
|
942
|
-
{ title: "Cards", traces: e.filter((i) => !
|
|
943
|
-
{ title: "Inputs", traces:
|
|
973
|
+
{ title: "Cards", traces: e.filter((i) => !t.has(Re(i))) },
|
|
974
|
+
{ title: "Inputs", traces: r }
|
|
944
975
|
];
|
|
945
976
|
}
|
|
946
|
-
function
|
|
947
|
-
if (!(!(
|
|
948
|
-
return
|
|
977
|
+
function or(e, r) {
|
|
978
|
+
if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
|
|
979
|
+
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));
|
|
949
980
|
}
|
|
950
|
-
function
|
|
951
|
-
if (
|
|
952
|
-
return
|
|
953
|
-
if (!
|
|
981
|
+
function at(e, r) {
|
|
982
|
+
if (r.queryId)
|
|
983
|
+
return or(e, r);
|
|
984
|
+
if (!r.viewId)
|
|
954
985
|
return;
|
|
955
|
-
const
|
|
956
|
-
return
|
|
986
|
+
const t = e.filter((n) => n.viewId === r.viewId);
|
|
987
|
+
return t.length === 1 ? t[0] : void 0;
|
|
957
988
|
}
|
|
958
|
-
function
|
|
959
|
-
return !!(e &&
|
|
989
|
+
function lt(e, r) {
|
|
990
|
+
return !!(e && r && e.traceId === r.traceId);
|
|
960
991
|
}
|
|
961
992
|
function Re(e) {
|
|
962
993
|
return e.traceId;
|
|
963
994
|
}
|
|
964
|
-
function
|
|
995
|
+
function sr(e) {
|
|
965
996
|
switch (e) {
|
|
966
997
|
case "metric":
|
|
967
998
|
return "metric";
|
|
@@ -976,19 +1007,19 @@ function rt(e) {
|
|
|
976
1007
|
case "sql":
|
|
977
1008
|
return "sql";
|
|
978
1009
|
default:
|
|
979
|
-
return
|
|
1010
|
+
return me(e);
|
|
980
1011
|
}
|
|
981
1012
|
}
|
|
982
|
-
function
|
|
1013
|
+
function De(e) {
|
|
983
1014
|
return e.queryLabel || e.viewId || e.queryId;
|
|
984
1015
|
}
|
|
985
|
-
function
|
|
986
|
-
const
|
|
987
|
-
return
|
|
1016
|
+
function pe(e) {
|
|
1017
|
+
const r = e.sourceRefs.map(V);
|
|
1018
|
+
return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
|
|
988
1019
|
}
|
|
989
|
-
function
|
|
1020
|
+
function ut(e) {
|
|
990
1021
|
return e.reduce(
|
|
991
|
-
(
|
|
1022
|
+
(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),
|
|
992
1023
|
{
|
|
993
1024
|
measures: [],
|
|
994
1025
|
timeFields: [],
|
|
@@ -998,31 +1029,31 @@ function rr(e) {
|
|
|
998
1029
|
}
|
|
999
1030
|
);
|
|
1000
1031
|
}
|
|
1001
|
-
function
|
|
1032
|
+
function dt(e, r, t) {
|
|
1002
1033
|
const n = [
|
|
1003
1034
|
{
|
|
1004
1035
|
label: "Operation",
|
|
1005
|
-
value:
|
|
1036
|
+
value: ct(e)
|
|
1006
1037
|
}
|
|
1007
|
-
], i =
|
|
1038
|
+
], i = ft(e, r, t);
|
|
1008
1039
|
i && n.push(i);
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1040
|
+
const l = pt(r);
|
|
1041
|
+
l && n.push({
|
|
1011
1042
|
label: "Grouped by",
|
|
1012
|
-
value:
|
|
1043
|
+
value: l
|
|
1013
1044
|
});
|
|
1014
|
-
const
|
|
1015
|
-
return
|
|
1045
|
+
const u = mt(e.inputsApplied);
|
|
1046
|
+
return u && n.push({
|
|
1016
1047
|
label: "Filtered by",
|
|
1017
|
-
value:
|
|
1048
|
+
value: u
|
|
1018
1049
|
}), n.push({
|
|
1019
1050
|
label: "Source",
|
|
1020
|
-
value:
|
|
1051
|
+
value: pe(e)
|
|
1021
1052
|
}), n;
|
|
1022
1053
|
}
|
|
1023
|
-
function
|
|
1024
|
-
var
|
|
1025
|
-
if (e.queryKind === "records" && ((
|
|
1054
|
+
function ct(e) {
|
|
1055
|
+
var r, t;
|
|
1056
|
+
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)
|
|
1026
1057
|
return "KPI query";
|
|
1027
1058
|
switch (e.queryKind) {
|
|
1028
1059
|
case "metric":
|
|
@@ -1038,29 +1069,29 @@ function ir(e) {
|
|
|
1038
1069
|
case "sql":
|
|
1039
1070
|
return "SQL query";
|
|
1040
1071
|
default:
|
|
1041
|
-
return
|
|
1072
|
+
return me(e.queryKind);
|
|
1042
1073
|
}
|
|
1043
1074
|
}
|
|
1044
|
-
function
|
|
1075
|
+
function ft(e, r, t) {
|
|
1045
1076
|
if (e.queryKind === "records")
|
|
1046
1077
|
return {
|
|
1047
|
-
label:
|
|
1048
|
-
value: Z(
|
|
1078
|
+
label: r.measures.length ? "Computes" : "Selects",
|
|
1079
|
+
value: Z(t)
|
|
1049
1080
|
};
|
|
1050
1081
|
if (e.queryKind === "inputOptions")
|
|
1051
1082
|
return {
|
|
1052
1083
|
label: "Options from",
|
|
1053
|
-
value: Z(
|
|
1084
|
+
value: Z(t)
|
|
1054
1085
|
};
|
|
1055
|
-
if (
|
|
1086
|
+
if (r.measures.length)
|
|
1056
1087
|
return {
|
|
1057
1088
|
label: "Computes",
|
|
1058
|
-
value: Z(
|
|
1089
|
+
value: Z(r.measures)
|
|
1059
1090
|
};
|
|
1060
|
-
if (
|
|
1091
|
+
if (t.length)
|
|
1061
1092
|
return {
|
|
1062
1093
|
label: "Uses",
|
|
1063
|
-
value: Z(
|
|
1094
|
+
value: Z(t)
|
|
1064
1095
|
};
|
|
1065
1096
|
if (e.queryKind === "sql")
|
|
1066
1097
|
return {
|
|
@@ -1068,70 +1099,74 @@ function or(e, t, r) {
|
|
|
1068
1099
|
value: "Open compiled query for SQL or Python."
|
|
1069
1100
|
};
|
|
1070
1101
|
}
|
|
1071
|
-
function
|
|
1072
|
-
const
|
|
1102
|
+
function pt(e) {
|
|
1103
|
+
const r = [
|
|
1073
1104
|
...e.dimensions,
|
|
1074
1105
|
...e.timeFields
|
|
1075
1106
|
];
|
|
1076
|
-
return
|
|
1107
|
+
return r.length ? Z(r) : void 0;
|
|
1077
1108
|
}
|
|
1078
|
-
function
|
|
1109
|
+
function mt(e) {
|
|
1079
1110
|
if (e.length)
|
|
1080
|
-
return
|
|
1081
|
-
e.map((
|
|
1082
|
-
const
|
|
1111
|
+
return ar(
|
|
1112
|
+
e.map((r) => {
|
|
1113
|
+
const t = ur(r);
|
|
1083
1114
|
return [
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1115
|
+
r.inputId,
|
|
1116
|
+
t.operator,
|
|
1117
|
+
t.value
|
|
1087
1118
|
].filter(Boolean).join(" ");
|
|
1088
1119
|
})
|
|
1089
1120
|
);
|
|
1090
1121
|
}
|
|
1091
1122
|
function Z(e) {
|
|
1092
|
-
return
|
|
1123
|
+
return ar(e.map(lr));
|
|
1093
1124
|
}
|
|
1094
|
-
function
|
|
1095
|
-
const
|
|
1096
|
-
return
|
|
1125
|
+
function ar(e) {
|
|
1126
|
+
const r = e.filter(Boolean);
|
|
1127
|
+
return r.length === 0 ? "-" : r.length === 1 ? r[0] : r.length === 2 ? `${r[0]} and ${r[1]}` : `${r.slice(0, -1).join(", ")}, and ${r[r.length - 1]}`;
|
|
1097
1128
|
}
|
|
1098
|
-
function
|
|
1129
|
+
function lr(e) {
|
|
1099
1130
|
return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
|
|
1100
1131
|
}
|
|
1101
|
-
function
|
|
1102
|
-
var
|
|
1103
|
-
const
|
|
1132
|
+
function ur(e) {
|
|
1133
|
+
var u, c, d;
|
|
1134
|
+
const r = e.valuePreview || "redacted", t = ((u = e.fieldRef) == null ? void 0 : u.label) || ((c = e.fieldRef) == null ? void 0 : c.name), n = (d = e.fieldRef) != null && d.source ? V(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "), l = [
|
|
1104
1135
|
e.inputId,
|
|
1105
1136
|
e.operator,
|
|
1106
|
-
|
|
1137
|
+
r,
|
|
1107
1138
|
i
|
|
1108
1139
|
].filter(Boolean).join(" - ");
|
|
1109
1140
|
return {
|
|
1110
1141
|
operator: e.operator,
|
|
1111
|
-
value:
|
|
1142
|
+
value: r,
|
|
1112
1143
|
binding: i,
|
|
1113
|
-
title:
|
|
1144
|
+
title: l
|
|
1114
1145
|
};
|
|
1115
1146
|
}
|
|
1116
|
-
function
|
|
1147
|
+
function V(e) {
|
|
1117
1148
|
return e.kind === "semantic" ? e.datasetName || e.datasetId || e.domainId : e.kind === "physical" ? [
|
|
1118
1149
|
e.schemaName,
|
|
1119
1150
|
e.tableName
|
|
1120
1151
|
].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
|
|
1121
1152
|
}
|
|
1122
|
-
function
|
|
1153
|
+
function gt(e) {
|
|
1154
|
+
if (e.file)
|
|
1155
|
+
return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
|
|
1156
|
+
}
|
|
1157
|
+
function yt(e) {
|
|
1123
1158
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
1124
1159
|
}
|
|
1125
|
-
function
|
|
1160
|
+
function ht(e) {
|
|
1126
1161
|
return typeof e == "number" ? `${Math.round(e)}ms` : "-";
|
|
1127
1162
|
}
|
|
1128
|
-
function
|
|
1129
|
-
return
|
|
1163
|
+
function vt(e) {
|
|
1164
|
+
return Ee(e);
|
|
1130
1165
|
}
|
|
1131
|
-
function
|
|
1166
|
+
function Ee(e) {
|
|
1132
1167
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
1133
1168
|
}
|
|
1134
|
-
function
|
|
1169
|
+
function bt(e) {
|
|
1135
1170
|
switch (e.type) {
|
|
1136
1171
|
case "query_started":
|
|
1137
1172
|
return "Started";
|
|
@@ -1144,10 +1179,10 @@ function cr(e) {
|
|
|
1144
1179
|
case "input_changed":
|
|
1145
1180
|
return "Input changed";
|
|
1146
1181
|
default:
|
|
1147
|
-
return
|
|
1182
|
+
return xt(e);
|
|
1148
1183
|
}
|
|
1149
1184
|
}
|
|
1150
|
-
function
|
|
1185
|
+
function St(e) {
|
|
1151
1186
|
return [
|
|
1152
1187
|
e.at,
|
|
1153
1188
|
"durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
|
|
@@ -1156,13 +1191,20 @@ function fr(e) {
|
|
|
1156
1191
|
"errorMessage" in e ? e.errorMessage : void 0
|
|
1157
1192
|
].filter(Boolean).join(" - ");
|
|
1158
1193
|
}
|
|
1159
|
-
function
|
|
1194
|
+
function xt(e) {
|
|
1160
1195
|
throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
|
|
1161
1196
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return Array.isArray(e) ? e.filter((
|
|
1197
|
+
function ve(e) {
|
|
1198
|
+
return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
|
|
1164
1199
|
}
|
|
1165
|
-
function
|
|
1200
|
+
function wt(e) {
|
|
1201
|
+
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;
|
|
1202
|
+
return {
|
|
1203
|
+
compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
|
|
1204
|
+
queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
function It(e) {
|
|
1166
1208
|
return e === "relative" ? {
|
|
1167
1209
|
position: "relative",
|
|
1168
1210
|
top: "auto",
|
|
@@ -1176,7 +1218,7 @@ function mr(e) {
|
|
|
1176
1218
|
left: e.endsWith("left") ? 20 : "auto"
|
|
1177
1219
|
};
|
|
1178
1220
|
}
|
|
1179
|
-
function
|
|
1221
|
+
function qt(e) {
|
|
1180
1222
|
return e === "error" ? {
|
|
1181
1223
|
borderColor: "var(--sd-error-border)",
|
|
1182
1224
|
background: "var(--sd-error-bg)",
|
|
@@ -1191,7 +1233,7 @@ function gr(e) {
|
|
|
1191
1233
|
color: "var(--sd-success-fg)"
|
|
1192
1234
|
};
|
|
1193
1235
|
}
|
|
1194
|
-
function
|
|
1236
|
+
function At(e) {
|
|
1195
1237
|
return e === "right" ? {
|
|
1196
1238
|
top: 16,
|
|
1197
1239
|
right: 16,
|
|
@@ -1210,23 +1252,23 @@ function hr(e) {
|
|
|
1210
1252
|
borderRadius: 6
|
|
1211
1253
|
};
|
|
1212
1254
|
}
|
|
1213
|
-
function
|
|
1255
|
+
function Rt(e) {
|
|
1214
1256
|
return e === "right" ? {
|
|
1215
1257
|
gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
|
|
1216
1258
|
} : {
|
|
1217
1259
|
gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
|
|
1218
1260
|
};
|
|
1219
1261
|
}
|
|
1220
|
-
function
|
|
1262
|
+
function Et(e) {
|
|
1221
1263
|
return {
|
|
1222
1264
|
borderRight: "1px solid var(--sd-border)",
|
|
1223
1265
|
borderBottom: 0
|
|
1224
1266
|
};
|
|
1225
1267
|
}
|
|
1226
|
-
function
|
|
1268
|
+
function dr(e) {
|
|
1227
1269
|
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)" };
|
|
1228
1270
|
}
|
|
1229
|
-
function
|
|
1271
|
+
function Tt(e) {
|
|
1230
1272
|
return e === "error" ? {
|
|
1231
1273
|
borderColor: "var(--sd-error-border)",
|
|
1232
1274
|
color: "var(--sd-error-fg)"
|
|
@@ -1241,7 +1283,7 @@ function br(e) {
|
|
|
1241
1283
|
color: "var(--sd-fg-muted)"
|
|
1242
1284
|
};
|
|
1243
1285
|
}
|
|
1244
|
-
const
|
|
1286
|
+
const je = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", kt = `
|
|
1245
1287
|
.${$} {
|
|
1246
1288
|
--sd-bg: #ffffff;
|
|
1247
1289
|
--sd-bg-muted: #fafafa;
|
|
@@ -1309,13 +1351,13 @@ const Me = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Sr = `
|
|
|
1309
1351
|
word-break: break-all;
|
|
1310
1352
|
}
|
|
1311
1353
|
`;
|
|
1312
|
-
function
|
|
1313
|
-
if (typeof document > "u" || document.getElementById(
|
|
1354
|
+
function cr() {
|
|
1355
|
+
if (typeof document > "u" || document.getElementById(je))
|
|
1314
1356
|
return;
|
|
1315
1357
|
const e = document.createElement("style");
|
|
1316
|
-
e.id =
|
|
1358
|
+
e.id = je, e.textContent = kt, document.head.appendChild(e);
|
|
1317
1359
|
}
|
|
1318
|
-
const
|
|
1360
|
+
const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', se = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", be = {
|
|
1319
1361
|
color: "var(--sd-fg-muted)",
|
|
1320
1362
|
fontSize: 10,
|
|
1321
1363
|
fontWeight: 600,
|
|
@@ -1336,7 +1378,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1336
1378
|
borderStyle: "solid",
|
|
1337
1379
|
borderRadius: 6,
|
|
1338
1380
|
boxShadow: "var(--sd-shadow)",
|
|
1339
|
-
font: `600 12px/1.2 ${
|
|
1381
|
+
font: `600 12px/1.2 ${oe}`,
|
|
1340
1382
|
cursor: "pointer"
|
|
1341
1383
|
},
|
|
1342
1384
|
launcherText: {
|
|
@@ -1378,7 +1420,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1378
1420
|
background: "var(--sd-bg)",
|
|
1379
1421
|
color: "var(--sd-fg)",
|
|
1380
1422
|
boxShadow: "var(--sd-shadow)",
|
|
1381
|
-
font: `13px/1.4 ${
|
|
1423
|
+
font: `13px/1.4 ${oe}`
|
|
1382
1424
|
},
|
|
1383
1425
|
panelFullscreen: {
|
|
1384
1426
|
top: 0,
|
|
@@ -1447,7 +1489,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1447
1489
|
outline: 0,
|
|
1448
1490
|
background: "transparent",
|
|
1449
1491
|
color: "var(--sd-fg)",
|
|
1450
|
-
font: `12px/1.4 ${
|
|
1492
|
+
font: `12px/1.4 ${oe}`
|
|
1451
1493
|
},
|
|
1452
1494
|
panelBody: {
|
|
1453
1495
|
display: "grid",
|
|
@@ -1473,7 +1515,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1473
1515
|
alignItems: "center",
|
|
1474
1516
|
justifyContent: "space-between",
|
|
1475
1517
|
padding: "4px 6px 3px",
|
|
1476
|
-
...
|
|
1518
|
+
...be
|
|
1477
1519
|
},
|
|
1478
1520
|
queryGroupCount: {
|
|
1479
1521
|
color: "var(--sd-fg-subtle)",
|
|
@@ -1597,7 +1639,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1597
1639
|
gap: 4
|
|
1598
1640
|
},
|
|
1599
1641
|
detailsCaptionItemMono: {
|
|
1600
|
-
fontFamily:
|
|
1642
|
+
fontFamily: se
|
|
1601
1643
|
},
|
|
1602
1644
|
detailsCaptionLabel: {
|
|
1603
1645
|
color: "var(--sd-fg-subtle)"
|
|
@@ -1611,7 +1653,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1611
1653
|
},
|
|
1612
1654
|
disclosureSummary: {
|
|
1613
1655
|
cursor: "pointer",
|
|
1614
|
-
...
|
|
1656
|
+
...be
|
|
1615
1657
|
},
|
|
1616
1658
|
disclosureBody: {
|
|
1617
1659
|
marginTop: 8
|
|
@@ -1803,7 +1845,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1803
1845
|
textOverflow: "ellipsis",
|
|
1804
1846
|
whiteSpace: "nowrap",
|
|
1805
1847
|
color: "var(--sd-fg)",
|
|
1806
|
-
fontFamily:
|
|
1848
|
+
fontFamily: se,
|
|
1807
1849
|
fontSize: 11,
|
|
1808
1850
|
fontWeight: 600
|
|
1809
1851
|
},
|
|
@@ -1816,7 +1858,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1816
1858
|
borderRadius: 3,
|
|
1817
1859
|
background: "var(--sd-bg-accent)",
|
|
1818
1860
|
color: "var(--sd-fg-muted)",
|
|
1819
|
-
fontFamily:
|
|
1861
|
+
fontFamily: se,
|
|
1820
1862
|
fontSize: 10,
|
|
1821
1863
|
textTransform: "uppercase",
|
|
1822
1864
|
letterSpacing: "0.06em"
|
|
@@ -1875,7 +1917,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1875
1917
|
gap: 5
|
|
1876
1918
|
},
|
|
1877
1919
|
codeBlockLabel: {
|
|
1878
|
-
...
|
|
1920
|
+
...be
|
|
1879
1921
|
},
|
|
1880
1922
|
codeBlock: {
|
|
1881
1923
|
maxHeight: 260,
|
|
@@ -1886,7 +1928,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1886
1928
|
borderRadius: 5,
|
|
1887
1929
|
background: "var(--sd-bg-muted)",
|
|
1888
1930
|
color: "var(--sd-fg)",
|
|
1889
|
-
fontFamily:
|
|
1931
|
+
fontFamily: se,
|
|
1890
1932
|
fontSize: 11,
|
|
1891
1933
|
lineHeight: 1.5,
|
|
1892
1934
|
whiteSpace: "pre-wrap"
|
|
@@ -1908,7 +1950,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1908
1950
|
borderStyle: "solid",
|
|
1909
1951
|
borderRadius: 5,
|
|
1910
1952
|
background: "var(--sd-bg)",
|
|
1911
|
-
font: `600 11px/1 ${
|
|
1953
|
+
font: `600 11px/1 ${oe}`,
|
|
1912
1954
|
cursor: "pointer"
|
|
1913
1955
|
},
|
|
1914
1956
|
inspectButtonText: {
|
|
@@ -1917,7 +1959,7 @@ const ie = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1917
1959
|
whiteSpace: "nowrap"
|
|
1918
1960
|
}
|
|
1919
1961
|
};
|
|
1920
|
-
function
|
|
1962
|
+
function fr(e) {
|
|
1921
1963
|
return {
|
|
1922
1964
|
...e,
|
|
1923
1965
|
order: [],
|
|
@@ -1925,88 +1967,88 @@ function dt(e) {
|
|
|
1925
1967
|
sequence: 0
|
|
1926
1968
|
};
|
|
1927
1969
|
}
|
|
1928
|
-
function
|
|
1929
|
-
if (
|
|
1930
|
-
return
|
|
1970
|
+
function Ct(e, r) {
|
|
1971
|
+
if (r.type === "config")
|
|
1972
|
+
return r.config.enabled ? {
|
|
1931
1973
|
...e,
|
|
1932
|
-
...
|
|
1933
|
-
} :
|
|
1974
|
+
...r.config
|
|
1975
|
+
} : fr(r.config);
|
|
1934
1976
|
if (!e.enabled)
|
|
1935
1977
|
return e;
|
|
1936
|
-
switch (
|
|
1978
|
+
switch (r.type) {
|
|
1937
1979
|
case "register":
|
|
1938
|
-
return
|
|
1980
|
+
return Bt(Dt(e, r.descriptor));
|
|
1939
1981
|
case "unregister":
|
|
1940
|
-
return
|
|
1982
|
+
return Ot(e, r.traceKey);
|
|
1941
1983
|
case "event":
|
|
1942
|
-
return
|
|
1984
|
+
return Lt(e, r);
|
|
1943
1985
|
default:
|
|
1944
1986
|
return e;
|
|
1945
1987
|
}
|
|
1946
1988
|
}
|
|
1947
|
-
function
|
|
1948
|
-
const
|
|
1949
|
-
...
|
|
1950
|
-
...
|
|
1951
|
-
traceKey:
|
|
1952
|
-
latestAttempt: (
|
|
1953
|
-
recentEvents: (
|
|
1989
|
+
function Dt(e, r) {
|
|
1990
|
+
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Le(), l = {
|
|
1991
|
+
...t || Kt(r),
|
|
1992
|
+
...pr(r),
|
|
1993
|
+
traceKey: r.traceKey,
|
|
1994
|
+
latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
|
|
1995
|
+
recentEvents: (t == null ? void 0 : t.recentEvents) || [],
|
|
1954
1996
|
mounted: !0,
|
|
1955
|
-
registeredAt: (
|
|
1956
|
-
lastEventAt: (
|
|
1997
|
+
registeredAt: (t == null ? void 0 : t.registeredAt) || n,
|
|
1998
|
+
lastEventAt: (t == null ? void 0 : t.lastEventAt) || i
|
|
1957
1999
|
};
|
|
1958
2000
|
return {
|
|
1959
2001
|
...e,
|
|
1960
2002
|
sequence: n,
|
|
1961
|
-
order:
|
|
2003
|
+
order: t ? e.order : [...e.order, r.traceKey],
|
|
1962
2004
|
entries: {
|
|
1963
2005
|
...e.entries,
|
|
1964
|
-
[
|
|
2006
|
+
[r.traceKey]: l
|
|
1965
2007
|
}
|
|
1966
2008
|
};
|
|
1967
2009
|
}
|
|
1968
|
-
function
|
|
1969
|
-
const
|
|
1970
|
-
return
|
|
2010
|
+
function Ot(e, r) {
|
|
2011
|
+
const t = e.entries[r];
|
|
2012
|
+
return t ? {
|
|
1971
2013
|
...e,
|
|
1972
2014
|
entries: {
|
|
1973
2015
|
...e.entries,
|
|
1974
|
-
[
|
|
1975
|
-
...
|
|
2016
|
+
[r]: {
|
|
2017
|
+
...t,
|
|
1976
2018
|
mounted: !1
|
|
1977
2019
|
}
|
|
1978
2020
|
}
|
|
1979
2021
|
} : e;
|
|
1980
2022
|
}
|
|
1981
|
-
function
|
|
1982
|
-
const
|
|
1983
|
-
if (!
|
|
2023
|
+
function Lt(e, r) {
|
|
2024
|
+
const t = e.entries[r.traceKey];
|
|
2025
|
+
if (!t)
|
|
1984
2026
|
return e;
|
|
1985
|
-
const n =
|
|
1986
|
-
...
|
|
1987
|
-
|
|
2027
|
+
const n = Le(), i = [
|
|
2028
|
+
...t.recentEvents,
|
|
2029
|
+
r.event
|
|
1988
2030
|
].slice(-e.maxEventsPerQuery);
|
|
1989
2031
|
return {
|
|
1990
2032
|
...e,
|
|
1991
2033
|
entries: {
|
|
1992
2034
|
...e.entries,
|
|
1993
|
-
[
|
|
1994
|
-
...
|
|
1995
|
-
latestAttempt:
|
|
1996
|
-
...
|
|
1997
|
-
...
|
|
1998
|
-
} :
|
|
2035
|
+
[r.traceKey]: {
|
|
2036
|
+
...t,
|
|
2037
|
+
latestAttempt: r.latestAttempt ? {
|
|
2038
|
+
...t.latestAttempt,
|
|
2039
|
+
...r.latestAttempt
|
|
2040
|
+
} : t.latestAttempt,
|
|
1999
2041
|
recentEvents: i,
|
|
2000
2042
|
lastEventAt: n
|
|
2001
2043
|
}
|
|
2002
2044
|
}
|
|
2003
2045
|
};
|
|
2004
2046
|
}
|
|
2005
|
-
function
|
|
2047
|
+
function Bt(e) {
|
|
2006
2048
|
if (e.order.length <= e.maxQueries)
|
|
2007
2049
|
return e;
|
|
2008
|
-
const
|
|
2009
|
-
|
|
2050
|
+
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, l) => i.mounted !== l.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - l.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
|
|
2051
|
+
r.slice(0, t).map((i) => i.traceKey)
|
|
2010
2052
|
);
|
|
2011
2053
|
return n.size ? {
|
|
2012
2054
|
...e,
|
|
@@ -2016,142 +2058,186 @@ function Rr(e) {
|
|
|
2016
2058
|
)
|
|
2017
2059
|
} : e;
|
|
2018
2060
|
}
|
|
2019
|
-
function
|
|
2020
|
-
const
|
|
2061
|
+
function Kt(e) {
|
|
2062
|
+
const r = Le();
|
|
2021
2063
|
return {
|
|
2022
|
-
...
|
|
2064
|
+
...pr(e),
|
|
2023
2065
|
traceKey: e.traceKey,
|
|
2024
2066
|
latestAttempt: { status: "idle" },
|
|
2025
2067
|
recentEvents: [],
|
|
2026
2068
|
mounted: !0,
|
|
2027
2069
|
registeredAt: 0,
|
|
2028
|
-
lastEventAt:
|
|
2070
|
+
lastEventAt: r
|
|
2029
2071
|
};
|
|
2030
2072
|
}
|
|
2031
|
-
function
|
|
2032
|
-
|
|
2073
|
+
function pr(e) {
|
|
2074
|
+
var n;
|
|
2075
|
+
const r = Vt(e.spec), t = Qt(
|
|
2033
2076
|
e.spec,
|
|
2034
2077
|
e.activeInputs
|
|
2035
2078
|
);
|
|
2036
2079
|
return {
|
|
2037
|
-
traceId:
|
|
2080
|
+
traceId: hr(e.traceKey),
|
|
2038
2081
|
viewId: e.viewId,
|
|
2039
2082
|
queryId: e.queryId,
|
|
2040
2083
|
queryLabel: e.queryLabel || e.viewTitle,
|
|
2041
2084
|
queryKind: e.queryKind,
|
|
2042
2085
|
builder: e.builder,
|
|
2043
|
-
sourceRefs:
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2086
|
+
sourceRefs: Pt(e.intent),
|
|
2087
|
+
sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
|
|
2088
|
+
projectionFieldRefs: r,
|
|
2089
|
+
inputFieldRefs: t,
|
|
2090
|
+
fieldRefs: Ut(e.intent),
|
|
2091
|
+
inputsApplied: (e.activeInputs || []).map((i) => ({
|
|
2092
|
+
inputId: i.inputId,
|
|
2093
|
+
fieldRef: i.field,
|
|
2094
|
+
operator: i.operator,
|
|
2095
|
+
valuePreview: jt(i)
|
|
2052
2096
|
})),
|
|
2053
2097
|
recentEvents: [],
|
|
2054
2098
|
clientWarnings: e.clientWarnings
|
|
2055
2099
|
};
|
|
2056
2100
|
}
|
|
2057
|
-
function
|
|
2101
|
+
function ue(e) {
|
|
2058
2102
|
const {
|
|
2059
|
-
traceKey:
|
|
2060
|
-
mounted:
|
|
2103
|
+
traceKey: r,
|
|
2104
|
+
mounted: t,
|
|
2061
2105
|
registeredAt: n,
|
|
2062
2106
|
lastEventAt: i,
|
|
2063
|
-
...
|
|
2107
|
+
...l
|
|
2064
2108
|
} = e;
|
|
2065
|
-
return
|
|
2109
|
+
return l;
|
|
2066
2110
|
}
|
|
2067
|
-
function
|
|
2111
|
+
function de(e) {
|
|
2068
2112
|
return e.enabled ? {
|
|
2069
2113
|
enabled: !0,
|
|
2070
|
-
queries: e.order.map((
|
|
2071
|
-
getQuery: (
|
|
2114
|
+
queries: e.order.map((t) => e.entries[t]).filter((t) => !!t).map(ue),
|
|
2115
|
+
getQuery: (t) => {
|
|
2072
2116
|
const n = Object.values(e.entries).find(
|
|
2073
|
-
(i) => i.queryId ===
|
|
2117
|
+
(i) => i.queryId === t
|
|
2074
2118
|
);
|
|
2075
|
-
return n ?
|
|
2119
|
+
return n ? ue(n) : void 0;
|
|
2076
2120
|
},
|
|
2077
|
-
getQueries: (
|
|
2078
|
-
} :
|
|
2121
|
+
getQueries: (t) => Object.values(e.entries).filter((n) => n.queryId === t).map(ue)
|
|
2122
|
+
} : tr;
|
|
2079
2123
|
}
|
|
2080
|
-
function
|
|
2124
|
+
function $t(e) {
|
|
2081
2125
|
return {
|
|
2082
|
-
snapshot: () =>
|
|
2083
|
-
getQuery: (
|
|
2084
|
-
getQueries: (
|
|
2126
|
+
snapshot: () => _t(de(e())),
|
|
2127
|
+
getQuery: (r) => He(de(e()).getQuery(r)),
|
|
2128
|
+
getQueries: (r) => de(e()).getQueries(r).map((t) => He(t)).filter((t) => !!t)
|
|
2085
2129
|
};
|
|
2086
2130
|
}
|
|
2087
|
-
function
|
|
2131
|
+
function _t(e) {
|
|
2088
2132
|
if (!e.enabled)
|
|
2089
2133
|
return e;
|
|
2090
|
-
const
|
|
2134
|
+
const r = e.queries.map(mr);
|
|
2091
2135
|
return {
|
|
2092
2136
|
enabled: e.enabled,
|
|
2093
|
-
queries:
|
|
2094
|
-
getQuery: (
|
|
2095
|
-
getQueries: (
|
|
2137
|
+
queries: r,
|
|
2138
|
+
getQuery: (t) => r.find((n) => n.queryId === t),
|
|
2139
|
+
getQueries: (t) => r.filter((n) => n.queryId === t)
|
|
2096
2140
|
};
|
|
2097
2141
|
}
|
|
2098
|
-
function
|
|
2099
|
-
return e ?
|
|
2142
|
+
function He(e) {
|
|
2143
|
+
return e ? mr(e) : void 0;
|
|
2100
2144
|
}
|
|
2101
|
-
function
|
|
2102
|
-
var
|
|
2103
|
-
return (
|
|
2145
|
+
function mr(e) {
|
|
2146
|
+
var r;
|
|
2147
|
+
return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
|
|
2104
2148
|
...e,
|
|
2105
2149
|
latestAttempt: {
|
|
2106
2150
|
...e.latestAttempt,
|
|
2107
|
-
executionResult:
|
|
2151
|
+
executionResult: Nt(
|
|
2108
2152
|
e.latestAttempt.executionResult
|
|
2109
2153
|
)
|
|
2110
2154
|
}
|
|
2111
2155
|
} : e;
|
|
2112
2156
|
}
|
|
2113
|
-
function
|
|
2157
|
+
function Nt(e) {
|
|
2114
2158
|
const {
|
|
2115
|
-
compiledQuery:
|
|
2116
|
-
intent:
|
|
2159
|
+
compiledQuery: r,
|
|
2160
|
+
intent: t,
|
|
2117
2161
|
result: n,
|
|
2118
2162
|
...i
|
|
2119
|
-
} = e
|
|
2120
|
-
|
|
2163
|
+
} = e, l = Ft(
|
|
2164
|
+
i.metadata
|
|
2165
|
+
);
|
|
2166
|
+
return {
|
|
2167
|
+
...i,
|
|
2168
|
+
...l ? { metadata: l } : {}
|
|
2169
|
+
};
|
|
2121
2170
|
}
|
|
2122
|
-
function
|
|
2171
|
+
function Ft(e) {
|
|
2172
|
+
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2173
|
+
return e;
|
|
2174
|
+
const r = e.dataAppDebug;
|
|
2175
|
+
if (!r || typeof r != "object" || Array.isArray(r))
|
|
2176
|
+
return e;
|
|
2177
|
+
const { compiledSql: t, ...n } = r;
|
|
2178
|
+
return {
|
|
2179
|
+
...e,
|
|
2180
|
+
dataAppDebug: n
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
function Mt(e) {
|
|
2123
2184
|
return e === void 0 || e === !1 ? {
|
|
2124
2185
|
enabled: !1,
|
|
2125
2186
|
exposeWindowBridge: !1,
|
|
2126
|
-
maxEventsPerQuery:
|
|
2187
|
+
maxEventsPerQuery: ye,
|
|
2127
2188
|
maxQueries: he
|
|
2128
2189
|
} : e === !0 ? {
|
|
2129
2190
|
enabled: !0,
|
|
2130
2191
|
exposeWindowBridge: !1,
|
|
2131
|
-
maxEventsPerQuery:
|
|
2192
|
+
maxEventsPerQuery: ye,
|
|
2132
2193
|
maxQueries: he
|
|
2133
2194
|
} : {
|
|
2134
2195
|
enabled: e.enabled !== !1,
|
|
2135
2196
|
exposeWindowBridge: e.exposeWindowBridge === !0,
|
|
2136
|
-
maxEventsPerQuery:
|
|
2197
|
+
maxEventsPerQuery: Qe(
|
|
2137
2198
|
e.maxEventsPerQuery,
|
|
2138
|
-
|
|
2139
|
-
|
|
2199
|
+
ye,
|
|
2200
|
+
zr
|
|
2140
2201
|
),
|
|
2141
|
-
maxQueries:
|
|
2202
|
+
maxQueries: Qe(
|
|
2142
2203
|
e.maxQueries,
|
|
2143
2204
|
he,
|
|
2144
|
-
|
|
2205
|
+
jr
|
|
2145
2206
|
)
|
|
2146
2207
|
};
|
|
2147
2208
|
}
|
|
2148
|
-
function
|
|
2149
|
-
|
|
2209
|
+
function Pe(e) {
|
|
2210
|
+
const t = [
|
|
2211
|
+
e == null ? void 0 : e.sourceHint,
|
|
2212
|
+
...(e == null ? void 0 : e.sourceHints) || []
|
|
2213
|
+
].filter((n) => !!n).map((n) => ({
|
|
2214
|
+
file: ae(n.file),
|
|
2215
|
+
line: Ve(n.line),
|
|
2216
|
+
column: Ve(n.column),
|
|
2217
|
+
exportName: ae(n.exportName),
|
|
2218
|
+
component: ae(n.component),
|
|
2219
|
+
note: ae(n.note)
|
|
2220
|
+
})).filter(
|
|
2221
|
+
(n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
|
|
2222
|
+
);
|
|
2223
|
+
return t.length ? t : void 0;
|
|
2224
|
+
}
|
|
2225
|
+
function ae(e) {
|
|
2226
|
+
if (typeof e != "string")
|
|
2227
|
+
return;
|
|
2228
|
+
const r = e.trim();
|
|
2229
|
+
return r || void 0;
|
|
2230
|
+
}
|
|
2231
|
+
function Ve(e) {
|
|
2232
|
+
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
2150
2233
|
}
|
|
2151
|
-
function
|
|
2234
|
+
function Qe(e, r, t) {
|
|
2235
|
+
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
|
|
2236
|
+
}
|
|
2237
|
+
function Wt(e) {
|
|
2152
2238
|
return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
|
|
2153
2239
|
}
|
|
2154
|
-
function
|
|
2240
|
+
function zt(e) {
|
|
2155
2241
|
switch (e) {
|
|
2156
2242
|
case "metric":
|
|
2157
2243
|
return "semaphor.metric";
|
|
@@ -2166,143 +2252,143 @@ function Or(e) {
|
|
|
2166
2252
|
case "sql":
|
|
2167
2253
|
return "semaphor.sql";
|
|
2168
2254
|
default:
|
|
2169
|
-
return
|
|
2255
|
+
return me(e);
|
|
2170
2256
|
}
|
|
2171
2257
|
}
|
|
2172
|
-
function
|
|
2258
|
+
function me(e) {
|
|
2173
2259
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
2174
2260
|
}
|
|
2175
|
-
function
|
|
2176
|
-
if (
|
|
2261
|
+
function jt(e) {
|
|
2262
|
+
if (Ht(e))
|
|
2177
2263
|
return;
|
|
2178
|
-
const
|
|
2179
|
-
if (
|
|
2180
|
-
if (Array.isArray(
|
|
2181
|
-
const
|
|
2264
|
+
const r = e.value;
|
|
2265
|
+
if (r !== void 0) {
|
|
2266
|
+
if (Array.isArray(r)) {
|
|
2267
|
+
const t = r.filter(
|
|
2182
2268
|
(n) => typeof n == "string" || typeof n == "number" || typeof n == "boolean"
|
|
2183
2269
|
).map((n) => String(n));
|
|
2184
|
-
if (
|
|
2185
|
-
const n =
|
|
2186
|
-
return
|
|
2270
|
+
if (t.length === r.length && t.length > 0) {
|
|
2271
|
+
const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
|
|
2272
|
+
return Ue(`${n}${i}`);
|
|
2187
2273
|
}
|
|
2188
|
-
return `${
|
|
2274
|
+
return `${r.length} selected`;
|
|
2189
2275
|
}
|
|
2190
|
-
return typeof
|
|
2276
|
+
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? Ue(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
|
|
2191
2277
|
}
|
|
2192
2278
|
}
|
|
2193
|
-
function
|
|
2279
|
+
function Ue(e) {
|
|
2194
2280
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
2195
2281
|
}
|
|
2196
|
-
function
|
|
2197
|
-
var
|
|
2198
|
-
const
|
|
2282
|
+
function Ht(e) {
|
|
2283
|
+
var t;
|
|
2284
|
+
const r = [
|
|
2199
2285
|
e.inputId,
|
|
2200
2286
|
e.label,
|
|
2201
|
-
(
|
|
2287
|
+
(t = e.field) == null ? void 0 : t.name
|
|
2202
2288
|
].filter(Boolean).join(" ").toLowerCase();
|
|
2203
2289
|
return ["token", "secret", "password", "email", "phone", "ssn"].some(
|
|
2204
|
-
(n) =>
|
|
2290
|
+
(n) => r.includes(n)
|
|
2205
2291
|
);
|
|
2206
2292
|
}
|
|
2207
|
-
function
|
|
2208
|
-
const
|
|
2209
|
-
return
|
|
2210
|
-
|
|
2211
|
-
}), [...
|
|
2293
|
+
function Pt(e) {
|
|
2294
|
+
const r = /* @__PURE__ */ new Map();
|
|
2295
|
+
return ce(e, (t) => {
|
|
2296
|
+
Gt(t) && r.set(yr(t), t);
|
|
2297
|
+
}), [...r.values()];
|
|
2212
2298
|
}
|
|
2213
|
-
function
|
|
2299
|
+
function Vt(e) {
|
|
2214
2300
|
switch (e.queryKind) {
|
|
2215
2301
|
case "metric":
|
|
2216
2302
|
case "analysis":
|
|
2217
|
-
return
|
|
2303
|
+
return P([
|
|
2218
2304
|
...e.measures || [],
|
|
2219
2305
|
e.primaryMeasure,
|
|
2220
2306
|
e.dateField,
|
|
2221
2307
|
...e.dimensions || []
|
|
2222
2308
|
]);
|
|
2223
2309
|
case "records":
|
|
2224
|
-
return
|
|
2310
|
+
return P(e.fields || []);
|
|
2225
2311
|
case "inputOptions":
|
|
2226
|
-
return
|
|
2312
|
+
return P([
|
|
2227
2313
|
e.labelField,
|
|
2228
2314
|
e.valueField,
|
|
2229
2315
|
e.searchField,
|
|
2230
2316
|
...e.disambiguationFields || []
|
|
2231
2317
|
]);
|
|
2232
2318
|
case "sql":
|
|
2233
|
-
return
|
|
2319
|
+
return P(e.fields || []);
|
|
2234
2320
|
case "matrix":
|
|
2235
|
-
return
|
|
2236
|
-
...(e.rows || []).map(
|
|
2237
|
-
...(e.columns || []).map(
|
|
2238
|
-
...(e.values || []).map(
|
|
2321
|
+
return P([
|
|
2322
|
+
...(e.rows || []).map(Se),
|
|
2323
|
+
...(e.columns || []).map(Se),
|
|
2324
|
+
...(e.values || []).map(Se)
|
|
2239
2325
|
]);
|
|
2240
2326
|
default:
|
|
2241
|
-
return
|
|
2327
|
+
return me(e);
|
|
2242
2328
|
}
|
|
2243
2329
|
}
|
|
2244
|
-
function
|
|
2245
|
-
const
|
|
2246
|
-
...(e.inputs || []).map(
|
|
2247
|
-
...(
|
|
2330
|
+
function Qt(e, r) {
|
|
2331
|
+
const t = [
|
|
2332
|
+
...(e.inputs || []).map(gr),
|
|
2333
|
+
...(r || []).map((n) => n.field)
|
|
2248
2334
|
];
|
|
2249
|
-
return
|
|
2335
|
+
return P(t);
|
|
2250
2336
|
}
|
|
2251
|
-
function
|
|
2252
|
-
const
|
|
2253
|
-
return e.forEach((
|
|
2254
|
-
|
|
2255
|
-
}), [...
|
|
2337
|
+
function P(e) {
|
|
2338
|
+
const r = /* @__PURE__ */ new Map();
|
|
2339
|
+
return e.forEach((t) => {
|
|
2340
|
+
t && te(t) && r.set(Oe(t), t);
|
|
2341
|
+
}), [...r.values()];
|
|
2256
2342
|
}
|
|
2257
|
-
function
|
|
2343
|
+
function gr(e) {
|
|
2258
2344
|
if (!e || typeof e != "object")
|
|
2259
2345
|
return;
|
|
2260
|
-
const
|
|
2261
|
-
if (typeof
|
|
2262
|
-
const n =
|
|
2263
|
-
return
|
|
2346
|
+
const r = e.toAnalyticsInput;
|
|
2347
|
+
if (typeof r == "function") {
|
|
2348
|
+
const n = r.call(e);
|
|
2349
|
+
return gr(n);
|
|
2264
2350
|
}
|
|
2265
|
-
const
|
|
2266
|
-
return te(
|
|
2351
|
+
const t = e.field;
|
|
2352
|
+
return te(t) ? t : void 0;
|
|
2267
2353
|
}
|
|
2268
|
-
function
|
|
2354
|
+
function Se(e) {
|
|
2269
2355
|
if (te(e))
|
|
2270
2356
|
return e;
|
|
2271
2357
|
if (!e || typeof e != "object")
|
|
2272
2358
|
return;
|
|
2273
|
-
const
|
|
2274
|
-
return te(
|
|
2359
|
+
const r = e.field;
|
|
2360
|
+
return te(r) ? r : void 0;
|
|
2275
2361
|
}
|
|
2276
|
-
function
|
|
2277
|
-
const
|
|
2278
|
-
return
|
|
2279
|
-
te(
|
|
2280
|
-
}), [...
|
|
2362
|
+
function Ut(e) {
|
|
2363
|
+
const r = /* @__PURE__ */ new Map();
|
|
2364
|
+
return ce(e, (t) => {
|
|
2365
|
+
te(t) && r.set(Oe(t), t);
|
|
2366
|
+
}), [...r.values()];
|
|
2281
2367
|
}
|
|
2282
|
-
function
|
|
2368
|
+
function ce(e, r) {
|
|
2283
2369
|
if (!(!e || typeof e != "object")) {
|
|
2284
|
-
if (
|
|
2285
|
-
e.forEach((
|
|
2370
|
+
if (r(e), Array.isArray(e)) {
|
|
2371
|
+
e.forEach((t) => ce(t, r));
|
|
2286
2372
|
return;
|
|
2287
2373
|
}
|
|
2288
2374
|
Object.values(e).forEach(
|
|
2289
|
-
(
|
|
2375
|
+
(t) => ce(t, r)
|
|
2290
2376
|
);
|
|
2291
2377
|
}
|
|
2292
2378
|
}
|
|
2293
|
-
function
|
|
2379
|
+
function Gt(e) {
|
|
2294
2380
|
if (!e || typeof e != "object")
|
|
2295
2381
|
return !1;
|
|
2296
|
-
const
|
|
2297
|
-
return
|
|
2382
|
+
const r = e;
|
|
2383
|
+
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;
|
|
2298
2384
|
}
|
|
2299
2385
|
function te(e) {
|
|
2300
2386
|
if (!e || typeof e != "object")
|
|
2301
2387
|
return !1;
|
|
2302
|
-
const
|
|
2303
|
-
return typeof
|
|
2388
|
+
const r = e;
|
|
2389
|
+
return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
|
|
2304
2390
|
}
|
|
2305
|
-
function
|
|
2391
|
+
function yr(e) {
|
|
2306
2392
|
return e.kind === "semantic" ? [
|
|
2307
2393
|
e.kind,
|
|
2308
2394
|
e.domainId,
|
|
@@ -2315,43 +2401,43 @@ function ft(e) {
|
|
|
2315
2401
|
e.tableName
|
|
2316
2402
|
].join(":") : [e.kind, e.connectionId].join(":");
|
|
2317
2403
|
}
|
|
2318
|
-
function
|
|
2404
|
+
function Oe(e) {
|
|
2319
2405
|
return [
|
|
2320
2406
|
e.name,
|
|
2321
2407
|
e.role,
|
|
2322
2408
|
e.aggregate,
|
|
2323
|
-
e.source ?
|
|
2409
|
+
e.source ? yr(e.source) : ""
|
|
2324
2410
|
].join(":");
|
|
2325
2411
|
}
|
|
2326
|
-
function
|
|
2327
|
-
const
|
|
2328
|
-
return typeof (
|
|
2412
|
+
function Jt(e) {
|
|
2413
|
+
const r = e;
|
|
2414
|
+
return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
|
|
2329
2415
|
}
|
|
2330
|
-
function
|
|
2331
|
-
const
|
|
2332
|
-
return Array.isArray(
|
|
2416
|
+
function Yt(e) {
|
|
2417
|
+
const r = e;
|
|
2418
|
+
return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
|
|
2333
2419
|
}
|
|
2334
|
-
function
|
|
2335
|
-
const
|
|
2336
|
-
return
|
|
2420
|
+
function Ge(e) {
|
|
2421
|
+
const r = e;
|
|
2422
|
+
return r == null ? void 0 : r.executionResult;
|
|
2337
2423
|
}
|
|
2338
|
-
function
|
|
2339
|
-
const
|
|
2340
|
-
return typeof (
|
|
2424
|
+
function Je(e) {
|
|
2425
|
+
const r = e;
|
|
2426
|
+
return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
|
|
2341
2427
|
}
|
|
2342
|
-
function
|
|
2343
|
-
let
|
|
2344
|
-
for (let
|
|
2345
|
-
|
|
2346
|
-
return (
|
|
2428
|
+
function hr(e) {
|
|
2429
|
+
let r = 2166136261;
|
|
2430
|
+
for (let t = 0; t < e.length; t += 1)
|
|
2431
|
+
r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
|
|
2432
|
+
return (r >>> 0).toString(36);
|
|
2347
2433
|
}
|
|
2348
|
-
function
|
|
2434
|
+
function le() {
|
|
2349
2435
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2350
2436
|
}
|
|
2351
|
-
function
|
|
2437
|
+
function Le() {
|
|
2352
2438
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
2353
2439
|
}
|
|
2354
|
-
const
|
|
2440
|
+
const Xt = [
|
|
2355
2441
|
"records",
|
|
2356
2442
|
"changes",
|
|
2357
2443
|
"drivers",
|
|
@@ -2359,7 +2445,7 @@ const zr = [
|
|
|
2359
2445
|
"largestPositiveChanges",
|
|
2360
2446
|
"largestNegativeDrivers",
|
|
2361
2447
|
"largestPositiveDrivers"
|
|
2362
|
-
],
|
|
2448
|
+
], Zt = [
|
|
2363
2449
|
"records",
|
|
2364
2450
|
"changes",
|
|
2365
2451
|
"drivers",
|
|
@@ -2368,13 +2454,13 @@ const zr = [
|
|
|
2368
2454
|
"largestNegativeDrivers",
|
|
2369
2455
|
"largestPositiveDrivers"
|
|
2370
2456
|
];
|
|
2371
|
-
function
|
|
2457
|
+
function vr(e) {
|
|
2372
2458
|
if (!e)
|
|
2373
2459
|
return {};
|
|
2374
|
-
const
|
|
2460
|
+
const r = on(e.executionResult), t = en(e, r), n = tn(t);
|
|
2375
2461
|
return {
|
|
2376
2462
|
...e,
|
|
2377
|
-
...Object.keys(
|
|
2463
|
+
...Object.keys(t).length ? { resultSets: t } : {},
|
|
2378
2464
|
...n ? {
|
|
2379
2465
|
columns: n.columns,
|
|
2380
2466
|
records: n.records,
|
|
@@ -2382,183 +2468,188 @@ function mt(e) {
|
|
|
2382
2468
|
} : {}
|
|
2383
2469
|
};
|
|
2384
2470
|
}
|
|
2385
|
-
function
|
|
2386
|
-
const
|
|
2387
|
-
for (const i of
|
|
2388
|
-
if (
|
|
2389
|
-
|
|
2471
|
+
function en(e, r) {
|
|
2472
|
+
const t = rn(e.resultSets);
|
|
2473
|
+
for (const i of Xt) {
|
|
2474
|
+
if (t[i]) {
|
|
2475
|
+
t[i] = br(t[i]);
|
|
2390
2476
|
continue;
|
|
2391
2477
|
}
|
|
2392
|
-
const
|
|
2393
|
-
if (!
|
|
2478
|
+
const l = sn(e[i]);
|
|
2479
|
+
if (!l.length)
|
|
2394
2480
|
continue;
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2397
|
-
records:
|
|
2398
|
-
columns:
|
|
2399
|
-
rowCount:
|
|
2481
|
+
const u = r.length ? r : an(l);
|
|
2482
|
+
t[i] = {
|
|
2483
|
+
records: Be(l, u),
|
|
2484
|
+
columns: u,
|
|
2485
|
+
rowCount: l.length
|
|
2400
2486
|
};
|
|
2401
2487
|
}
|
|
2402
|
-
const n =
|
|
2403
|
-
return n && n.records.length > 0 && !
|
|
2488
|
+
const n = nn(e.executionResult);
|
|
2489
|
+
return n && n.records.length > 0 && !t.records && (t.records = n), t;
|
|
2404
2490
|
}
|
|
2405
|
-
function
|
|
2491
|
+
function rn(e) {
|
|
2406
2492
|
return Object.fromEntries(
|
|
2407
|
-
Object.entries(e || {}).map(([
|
|
2408
|
-
|
|
2409
|
-
|
|
2493
|
+
Object.entries(e || {}).map(([r, t]) => [
|
|
2494
|
+
r,
|
|
2495
|
+
br(t)
|
|
2410
2496
|
])
|
|
2411
2497
|
);
|
|
2412
2498
|
}
|
|
2413
|
-
function
|
|
2414
|
-
var
|
|
2499
|
+
function br(e) {
|
|
2500
|
+
var r;
|
|
2415
2501
|
return {
|
|
2416
2502
|
...e,
|
|
2417
|
-
records:
|
|
2503
|
+
records: Be(
|
|
2418
2504
|
e.records || [],
|
|
2419
2505
|
e.columns || []
|
|
2420
2506
|
),
|
|
2421
|
-
rowCount: e.rowCount ?? ((
|
|
2507
|
+
rowCount: e.rowCount ?? ((r = e.records) == null ? void 0 : r.length) ?? 0
|
|
2422
2508
|
};
|
|
2423
2509
|
}
|
|
2424
|
-
function
|
|
2425
|
-
var
|
|
2426
|
-
for (const
|
|
2427
|
-
if ((
|
|
2428
|
-
return e[
|
|
2429
|
-
return Object.values(e).find((
|
|
2430
|
-
}
|
|
2431
|
-
function
|
|
2432
|
-
const
|
|
2433
|
-
if (!(!
|
|
2510
|
+
function tn(e) {
|
|
2511
|
+
var r;
|
|
2512
|
+
for (const t of Zt)
|
|
2513
|
+
if ((r = e[t]) != null && r.records.length)
|
|
2514
|
+
return e[t];
|
|
2515
|
+
return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
|
|
2516
|
+
}
|
|
2517
|
+
function nn(e) {
|
|
2518
|
+
const r = e == null ? void 0 : e.result;
|
|
2519
|
+
if (!(!r || r.kind !== "records" && r.kind !== "sql"))
|
|
2434
2520
|
return {
|
|
2435
|
-
records:
|
|
2436
|
-
columns:
|
|
2437
|
-
rowCount:
|
|
2521
|
+
records: Be(r.records, r.columns),
|
|
2522
|
+
columns: r.columns,
|
|
2523
|
+
rowCount: r.rowCount ?? r.records.length
|
|
2438
2524
|
};
|
|
2439
2525
|
}
|
|
2440
|
-
function
|
|
2441
|
-
const
|
|
2442
|
-
return !
|
|
2526
|
+
function on(e) {
|
|
2527
|
+
const r = e == null ? void 0 : e.result;
|
|
2528
|
+
return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
|
|
2443
2529
|
}
|
|
2444
|
-
function
|
|
2530
|
+
function sn(e) {
|
|
2445
2531
|
return Array.isArray(e) ? e.filter(
|
|
2446
|
-
(
|
|
2532
|
+
(r) => !!(r && typeof r == "object" && !Array.isArray(r))
|
|
2447
2533
|
) : [];
|
|
2448
2534
|
}
|
|
2449
|
-
function
|
|
2450
|
-
return
|
|
2535
|
+
function Be(e, r) {
|
|
2536
|
+
return r.length ? e.map((t) => {
|
|
2451
2537
|
const n = {};
|
|
2452
|
-
return
|
|
2453
|
-
const
|
|
2538
|
+
return r.forEach((i, l) => {
|
|
2539
|
+
const u = ln(t, {
|
|
2454
2540
|
name: i.key,
|
|
2455
2541
|
label: i.label,
|
|
2456
|
-
fallbackNames: [i.name, Object.keys(
|
|
2542
|
+
fallbackNames: [i.name, Object.keys(t)[l]]
|
|
2457
2543
|
});
|
|
2458
|
-
|
|
2459
|
-
}), Object.keys(n).length ? n :
|
|
2544
|
+
u !== void 0 && (n[i.key] = u);
|
|
2545
|
+
}), Object.keys(n).length ? n : t;
|
|
2460
2546
|
}) : e;
|
|
2461
2547
|
}
|
|
2462
|
-
function
|
|
2548
|
+
function an(e) {
|
|
2463
2549
|
return Array.from(
|
|
2464
|
-
new Set(e.flatMap((
|
|
2465
|
-
).map((
|
|
2466
|
-
key:
|
|
2467
|
-
name:
|
|
2468
|
-
label:
|
|
2550
|
+
new Set(e.flatMap((t) => Object.keys(t)))
|
|
2551
|
+
).map((t) => ({
|
|
2552
|
+
key: t,
|
|
2553
|
+
name: t,
|
|
2554
|
+
label: t
|
|
2469
2555
|
}));
|
|
2470
2556
|
}
|
|
2471
|
-
function
|
|
2472
|
-
const
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
...
|
|
2557
|
+
function ln(e, r) {
|
|
2558
|
+
const t = [
|
|
2559
|
+
r.name,
|
|
2560
|
+
r.label,
|
|
2561
|
+
...r.fallbackNames || []
|
|
2476
2562
|
].filter((n) => !!n);
|
|
2477
|
-
for (const n of
|
|
2563
|
+
for (const n of t)
|
|
2478
2564
|
if (Object.prototype.hasOwnProperty.call(e, n))
|
|
2479
2565
|
return e[n];
|
|
2480
2566
|
}
|
|
2481
|
-
function
|
|
2567
|
+
function un() {
|
|
2482
2568
|
return {
|
|
2483
|
-
executeAnalysis: (e,
|
|
2569
|
+
executeAnalysis: (e, r, t) => H(
|
|
2484
2570
|
e,
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
).then(
|
|
2488
|
-
executeMetric: (e,
|
|
2489
|
-
executeRecords: (e,
|
|
2490
|
-
executeInputOptions: (e,
|
|
2491
|
-
executeSql: (e,
|
|
2492
|
-
executeMatrix: (e,
|
|
2571
|
+
r,
|
|
2572
|
+
t ?? {}
|
|
2573
|
+
).then(vr),
|
|
2574
|
+
executeMetric: (e, r) => H(e, r),
|
|
2575
|
+
executeRecords: (e, r) => H(e, r),
|
|
2576
|
+
executeInputOptions: (e, r) => H(e, r),
|
|
2577
|
+
executeSql: (e, r) => H(e, r),
|
|
2578
|
+
executeMatrix: (e, r) => H(e, r)
|
|
2493
2579
|
};
|
|
2494
2580
|
}
|
|
2495
|
-
async function
|
|
2496
|
-
if (!
|
|
2581
|
+
async function H(e, r, t) {
|
|
2582
|
+
if (!r.token)
|
|
2497
2583
|
throw new Error(
|
|
2498
2584
|
"SemaphorDataAppProvider needs a token to execute queries."
|
|
2499
2585
|
);
|
|
2500
|
-
const n =
|
|
2501
|
-
let
|
|
2586
|
+
const n = hn(r), i = fn(e, n);
|
|
2587
|
+
let l;
|
|
2502
2588
|
try {
|
|
2503
|
-
|
|
2589
|
+
l = await fetch(n, {
|
|
2504
2590
|
method: "POST",
|
|
2505
2591
|
headers: {
|
|
2506
2592
|
"Content-Type": "application/json",
|
|
2507
|
-
Authorization: `Bearer ${
|
|
2593
|
+
Authorization: `Bearer ${r.token}`
|
|
2508
2594
|
},
|
|
2509
2595
|
body: JSON.stringify({
|
|
2510
2596
|
intent: e,
|
|
2511
|
-
activeInputs:
|
|
2512
|
-
...
|
|
2513
|
-
resultShape: e.kind
|
|
2597
|
+
activeInputs: r.activeInputs,
|
|
2598
|
+
...t ? { analysisOptions: t } : {},
|
|
2599
|
+
resultShape: e.kind,
|
|
2600
|
+
...cn(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
2514
2601
|
})
|
|
2515
2602
|
});
|
|
2516
|
-
} catch (
|
|
2603
|
+
} catch (c) {
|
|
2517
2604
|
throw new Error(
|
|
2518
|
-
`${i}: ${
|
|
2605
|
+
`${i}: ${c instanceof Error ? c.message : String(c)}`
|
|
2519
2606
|
);
|
|
2520
2607
|
}
|
|
2521
|
-
const
|
|
2522
|
-
if (!
|
|
2523
|
-
throw
|
|
2524
|
-
`${i}: ${
|
|
2525
|
-
|
|
2608
|
+
const u = await gn(l);
|
|
2609
|
+
if (!l.ok || u.error)
|
|
2610
|
+
throw dn(
|
|
2611
|
+
`${i}: ${u.error || `Semaphor Data App execution failed with status ${l.status}.`}`,
|
|
2612
|
+
u
|
|
2526
2613
|
);
|
|
2527
|
-
return
|
|
2614
|
+
return u;
|
|
2615
|
+
}
|
|
2616
|
+
function dn(e, r) {
|
|
2617
|
+
const t = new Error(e);
|
|
2618
|
+
return r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), t;
|
|
2528
2619
|
}
|
|
2529
|
-
function
|
|
2530
|
-
const r =
|
|
2531
|
-
return
|
|
2620
|
+
function cn(e) {
|
|
2621
|
+
const r = e.debug;
|
|
2622
|
+
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
2532
2623
|
}
|
|
2533
|
-
function
|
|
2624
|
+
function fn(e, r) {
|
|
2534
2625
|
return [
|
|
2535
2626
|
`Semaphor ${e.kind} query`,
|
|
2536
2627
|
e.id ? `id=${e.id}` : void 0,
|
|
2537
2628
|
e.label ? `label=${e.label}` : void 0,
|
|
2538
|
-
|
|
2539
|
-
`endpoint=${
|
|
2540
|
-
].filter((
|
|
2629
|
+
pn(e),
|
|
2630
|
+
`endpoint=${mn(r)}`
|
|
2631
|
+
].filter((t) => !!t).join(" ");
|
|
2541
2632
|
}
|
|
2542
|
-
function
|
|
2543
|
-
const
|
|
2544
|
-
if (!(!
|
|
2545
|
-
if (
|
|
2633
|
+
function pn(e) {
|
|
2634
|
+
const r = "source" in e ? e.source : void 0;
|
|
2635
|
+
if (!(!r || typeof r != "object")) {
|
|
2636
|
+
if (r.kind === "semantic")
|
|
2546
2637
|
return `source=${[
|
|
2547
|
-
|
|
2548
|
-
|
|
2638
|
+
r.domainId,
|
|
2639
|
+
r.datasetId || r.datasetName
|
|
2549
2640
|
].filter(Boolean).join("/")}`;
|
|
2550
|
-
if (
|
|
2641
|
+
if (r.kind === "physical")
|
|
2551
2642
|
return `source=${[
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2643
|
+
r.connectionId,
|
|
2644
|
+
r.databaseName,
|
|
2645
|
+
r.schemaName,
|
|
2646
|
+
r.tableName
|
|
2556
2647
|
].filter(Boolean).join("/")}`;
|
|
2557
|
-
if (
|
|
2558
|
-
return
|
|
2648
|
+
if (r.kind === "sql")
|
|
2649
|
+
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
2559
2650
|
}
|
|
2560
2651
|
}
|
|
2561
|
-
function
|
|
2652
|
+
function mn(e) {
|
|
2562
2653
|
if (!e)
|
|
2563
2654
|
return "/api/v1/data-app/execute";
|
|
2564
2655
|
try {
|
|
@@ -2567,289 +2658,289 @@ function rn(e) {
|
|
|
2567
2658
|
return e;
|
|
2568
2659
|
}
|
|
2569
2660
|
}
|
|
2570
|
-
async function
|
|
2571
|
-
const
|
|
2572
|
-
if (!
|
|
2661
|
+
async function gn(e) {
|
|
2662
|
+
const r = await e.text().catch(() => "");
|
|
2663
|
+
if (!r.trim())
|
|
2573
2664
|
return e.ok ? {
|
|
2574
2665
|
error: "Semaphor Data App execution returned an empty response."
|
|
2575
2666
|
} : {};
|
|
2576
2667
|
try {
|
|
2577
|
-
return JSON.parse(
|
|
2668
|
+
return JSON.parse(r);
|
|
2578
2669
|
} catch {
|
|
2579
2670
|
return e.ok ? {
|
|
2580
2671
|
error: "Semaphor Data App execution returned invalid JSON.",
|
|
2581
|
-
details:
|
|
2672
|
+
details: r
|
|
2582
2673
|
} : {
|
|
2583
|
-
error:
|
|
2584
|
-
details:
|
|
2674
|
+
error: yn(e, r),
|
|
2675
|
+
details: r
|
|
2585
2676
|
};
|
|
2586
2677
|
}
|
|
2587
2678
|
}
|
|
2588
|
-
function
|
|
2589
|
-
const
|
|
2590
|
-
return n ? `Semaphor Data App execution failed with status ${e.status}${
|
|
2679
|
+
function yn(e, r) {
|
|
2680
|
+
const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
|
|
2681
|
+
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}.`;
|
|
2591
2682
|
}
|
|
2592
|
-
function
|
|
2593
|
-
const
|
|
2594
|
-
return
|
|
2683
|
+
function hn(e) {
|
|
2684
|
+
const r = vn(e).replace(/\/+$/, "");
|
|
2685
|
+
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
2595
2686
|
}
|
|
2596
|
-
function
|
|
2687
|
+
function vn(e) {
|
|
2597
2688
|
if (e.apiBaseUrl)
|
|
2598
2689
|
return e.apiBaseUrl;
|
|
2599
2690
|
if (!e.token)
|
|
2600
2691
|
return "";
|
|
2601
2692
|
try {
|
|
2602
|
-
return
|
|
2693
|
+
return Mr(e.token).apiServiceUrl || "";
|
|
2603
2694
|
} catch {
|
|
2604
2695
|
return "";
|
|
2605
2696
|
}
|
|
2606
2697
|
}
|
|
2607
|
-
const
|
|
2608
|
-
function
|
|
2698
|
+
const Sr = fe({});
|
|
2699
|
+
function bn() {
|
|
2609
2700
|
if (!(typeof window > "u"))
|
|
2610
2701
|
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
2611
2702
|
}
|
|
2612
|
-
function
|
|
2613
|
-
return z(
|
|
2703
|
+
function Sn() {
|
|
2704
|
+
return z(Sr);
|
|
2614
2705
|
}
|
|
2615
|
-
const
|
|
2616
|
-
function
|
|
2617
|
-
const
|
|
2706
|
+
const xe = { value: null }, we = {}, xn = { records: [] }, Ie = { options: [] }, wn = { records: [] }, qe = {};
|
|
2707
|
+
function In(e) {
|
|
2708
|
+
const r = U(e.inputs), t = Cr(e);
|
|
2618
2709
|
try {
|
|
2619
|
-
const n =
|
|
2710
|
+
const n = Dr(e), i = G(n);
|
|
2620
2711
|
return i ? {
|
|
2621
2712
|
error: i,
|
|
2622
|
-
activeInputs:
|
|
2623
|
-
analysisOptions:
|
|
2624
|
-
queryKey:
|
|
2713
|
+
activeInputs: r,
|
|
2714
|
+
analysisOptions: t,
|
|
2715
|
+
queryKey: q(
|
|
2625
2716
|
void 0,
|
|
2626
|
-
|
|
2717
|
+
r,
|
|
2627
2718
|
i,
|
|
2628
|
-
|
|
2719
|
+
t
|
|
2629
2720
|
),
|
|
2630
|
-
idleData:
|
|
2721
|
+
idleData: we
|
|
2631
2722
|
} : {
|
|
2632
2723
|
intent: n,
|
|
2633
2724
|
error: null,
|
|
2634
|
-
activeInputs:
|
|
2635
|
-
analysisOptions:
|
|
2636
|
-
queryKey:
|
|
2637
|
-
idleData:
|
|
2725
|
+
activeInputs: r,
|
|
2726
|
+
analysisOptions: t,
|
|
2727
|
+
queryKey: q(n, r, void 0, t),
|
|
2728
|
+
idleData: we
|
|
2638
2729
|
};
|
|
2639
2730
|
} catch (n) {
|
|
2640
|
-
const i =
|
|
2731
|
+
const i = N(n);
|
|
2641
2732
|
return {
|
|
2642
2733
|
error: i,
|
|
2643
|
-
activeInputs:
|
|
2644
|
-
analysisOptions:
|
|
2645
|
-
queryKey:
|
|
2734
|
+
activeInputs: r,
|
|
2735
|
+
analysisOptions: t,
|
|
2736
|
+
queryKey: q(
|
|
2646
2737
|
void 0,
|
|
2647
|
-
|
|
2738
|
+
r,
|
|
2648
2739
|
i,
|
|
2649
|
-
|
|
2740
|
+
t
|
|
2650
2741
|
),
|
|
2651
|
-
idleData:
|
|
2742
|
+
idleData: we
|
|
2652
2743
|
};
|
|
2653
2744
|
}
|
|
2654
2745
|
}
|
|
2655
|
-
function
|
|
2656
|
-
const
|
|
2746
|
+
function qn(e) {
|
|
2747
|
+
const r = U(e.inputs);
|
|
2657
2748
|
try {
|
|
2658
|
-
const
|
|
2749
|
+
const t = Or(e), n = G(t);
|
|
2659
2750
|
return n ? {
|
|
2660
2751
|
error: n,
|
|
2661
|
-
activeInputs:
|
|
2662
|
-
queryKey:
|
|
2663
|
-
idleData:
|
|
2752
|
+
activeInputs: r,
|
|
2753
|
+
queryKey: q(void 0, r, n),
|
|
2754
|
+
idleData: xe
|
|
2664
2755
|
} : {
|
|
2665
|
-
intent:
|
|
2756
|
+
intent: t,
|
|
2666
2757
|
error: null,
|
|
2667
|
-
activeInputs:
|
|
2668
|
-
queryKey:
|
|
2669
|
-
idleData:
|
|
2758
|
+
activeInputs: r,
|
|
2759
|
+
queryKey: q(t, r),
|
|
2760
|
+
idleData: xe
|
|
2670
2761
|
};
|
|
2671
|
-
} catch (
|
|
2672
|
-
const n =
|
|
2762
|
+
} catch (t) {
|
|
2763
|
+
const n = N(t);
|
|
2673
2764
|
return {
|
|
2674
2765
|
error: n,
|
|
2675
|
-
activeInputs:
|
|
2676
|
-
queryKey:
|
|
2677
|
-
idleData:
|
|
2766
|
+
activeInputs: r,
|
|
2767
|
+
queryKey: q(void 0, r, n),
|
|
2768
|
+
idleData: xe
|
|
2678
2769
|
};
|
|
2679
2770
|
}
|
|
2680
2771
|
}
|
|
2681
|
-
function
|
|
2682
|
-
const
|
|
2772
|
+
function An(e) {
|
|
2773
|
+
const r = U(e.inputs), t = xn;
|
|
2683
2774
|
try {
|
|
2684
|
-
const n =
|
|
2775
|
+
const n = kr(e), i = G(n);
|
|
2685
2776
|
return i ? {
|
|
2686
2777
|
error: i,
|
|
2687
|
-
activeInputs:
|
|
2688
|
-
queryKey:
|
|
2689
|
-
idleData:
|
|
2778
|
+
activeInputs: r,
|
|
2779
|
+
queryKey: q(void 0, r, i),
|
|
2780
|
+
idleData: t
|
|
2690
2781
|
} : {
|
|
2691
2782
|
intent: n,
|
|
2692
2783
|
error: null,
|
|
2693
|
-
activeInputs:
|
|
2694
|
-
queryKey:
|
|
2695
|
-
idleData:
|
|
2784
|
+
activeInputs: r,
|
|
2785
|
+
queryKey: q(n, r),
|
|
2786
|
+
idleData: t
|
|
2696
2787
|
};
|
|
2697
2788
|
} catch (n) {
|
|
2698
|
-
const i =
|
|
2789
|
+
const i = N(n);
|
|
2699
2790
|
return {
|
|
2700
2791
|
error: i,
|
|
2701
|
-
activeInputs:
|
|
2702
|
-
queryKey:
|
|
2703
|
-
idleData:
|
|
2792
|
+
activeInputs: r,
|
|
2793
|
+
queryKey: q(void 0, r, i),
|
|
2794
|
+
idleData: t
|
|
2704
2795
|
};
|
|
2705
2796
|
}
|
|
2706
2797
|
}
|
|
2707
|
-
function
|
|
2708
|
-
const
|
|
2798
|
+
function Rn(e) {
|
|
2799
|
+
const r = U(e.inputs);
|
|
2709
2800
|
try {
|
|
2710
|
-
const
|
|
2801
|
+
const t = Tr(e), n = G(t);
|
|
2711
2802
|
return n ? {
|
|
2712
2803
|
error: n,
|
|
2713
|
-
activeInputs:
|
|
2714
|
-
queryKey:
|
|
2715
|
-
idleData:
|
|
2804
|
+
activeInputs: r,
|
|
2805
|
+
queryKey: q(void 0, r, n),
|
|
2806
|
+
idleData: Ie
|
|
2716
2807
|
} : {
|
|
2717
|
-
intent:
|
|
2808
|
+
intent: t,
|
|
2718
2809
|
error: null,
|
|
2719
|
-
activeInputs:
|
|
2720
|
-
queryKey:
|
|
2721
|
-
idleData:
|
|
2810
|
+
activeInputs: r,
|
|
2811
|
+
queryKey: q(t, r),
|
|
2812
|
+
idleData: Ie
|
|
2722
2813
|
};
|
|
2723
|
-
} catch (
|
|
2724
|
-
const n =
|
|
2814
|
+
} catch (t) {
|
|
2815
|
+
const n = N(t);
|
|
2725
2816
|
return {
|
|
2726
2817
|
error: n,
|
|
2727
|
-
activeInputs:
|
|
2728
|
-
queryKey:
|
|
2729
|
-
idleData:
|
|
2818
|
+
activeInputs: r,
|
|
2819
|
+
queryKey: q(void 0, r, n),
|
|
2820
|
+
idleData: Ie
|
|
2730
2821
|
};
|
|
2731
2822
|
}
|
|
2732
2823
|
}
|
|
2733
|
-
function
|
|
2734
|
-
const
|
|
2824
|
+
function En(e) {
|
|
2825
|
+
const r = U(e.inputs), t = wn;
|
|
2735
2826
|
try {
|
|
2736
|
-
const n =
|
|
2827
|
+
const n = Er(e), i = G(n);
|
|
2737
2828
|
return i ? {
|
|
2738
2829
|
error: i,
|
|
2739
|
-
activeInputs:
|
|
2740
|
-
queryKey:
|
|
2741
|
-
idleData:
|
|
2830
|
+
activeInputs: r,
|
|
2831
|
+
queryKey: q(void 0, r, i),
|
|
2832
|
+
idleData: t
|
|
2742
2833
|
} : {
|
|
2743
2834
|
intent: n,
|
|
2744
2835
|
error: null,
|
|
2745
|
-
activeInputs:
|
|
2746
|
-
queryKey:
|
|
2747
|
-
idleData:
|
|
2836
|
+
activeInputs: r,
|
|
2837
|
+
queryKey: q(n, r),
|
|
2838
|
+
idleData: t
|
|
2748
2839
|
};
|
|
2749
2840
|
} catch (n) {
|
|
2750
|
-
const i =
|
|
2841
|
+
const i = N(n);
|
|
2751
2842
|
return {
|
|
2752
2843
|
error: i,
|
|
2753
|
-
activeInputs:
|
|
2754
|
-
queryKey:
|
|
2755
|
-
idleData:
|
|
2844
|
+
activeInputs: r,
|
|
2845
|
+
queryKey: q(void 0, r, i),
|
|
2846
|
+
idleData: t
|
|
2756
2847
|
};
|
|
2757
2848
|
}
|
|
2758
2849
|
}
|
|
2759
|
-
function
|
|
2760
|
-
const
|
|
2850
|
+
function Tn(e) {
|
|
2851
|
+
const r = U(e.inputs);
|
|
2761
2852
|
try {
|
|
2762
|
-
const
|
|
2853
|
+
const t = Rr(e), n = G(t);
|
|
2763
2854
|
return n ? {
|
|
2764
2855
|
error: n,
|
|
2765
|
-
activeInputs:
|
|
2766
|
-
queryKey:
|
|
2767
|
-
idleData:
|
|
2856
|
+
activeInputs: r,
|
|
2857
|
+
queryKey: q(void 0, r, n),
|
|
2858
|
+
idleData: qe
|
|
2768
2859
|
} : {
|
|
2769
|
-
intent:
|
|
2860
|
+
intent: t,
|
|
2770
2861
|
error: null,
|
|
2771
|
-
activeInputs:
|
|
2772
|
-
queryKey:
|
|
2773
|
-
idleData:
|
|
2862
|
+
activeInputs: r,
|
|
2863
|
+
queryKey: q(t, r),
|
|
2864
|
+
idleData: qe
|
|
2774
2865
|
};
|
|
2775
|
-
} catch (
|
|
2776
|
-
const n =
|
|
2866
|
+
} catch (t) {
|
|
2867
|
+
const n = N(t);
|
|
2777
2868
|
return {
|
|
2778
2869
|
error: n,
|
|
2779
|
-
activeInputs:
|
|
2780
|
-
queryKey:
|
|
2781
|
-
idleData:
|
|
2870
|
+
activeInputs: r,
|
|
2871
|
+
queryKey: q(void 0, r, n),
|
|
2872
|
+
idleData: qe
|
|
2782
2873
|
};
|
|
2783
2874
|
}
|
|
2784
2875
|
}
|
|
2785
|
-
function
|
|
2876
|
+
function N(e) {
|
|
2786
2877
|
return e instanceof Error ? e : new Error(String(e));
|
|
2787
2878
|
}
|
|
2788
2879
|
function G(e) {
|
|
2789
|
-
const
|
|
2790
|
-
if (
|
|
2880
|
+
const r = Wr(e);
|
|
2881
|
+
if (r.ok)
|
|
2791
2882
|
return null;
|
|
2792
|
-
const
|
|
2883
|
+
const t = r.errors.map(
|
|
2793
2884
|
(n) => n.path ? `${n.code} at ${n.path}: ${n.message}` : `${n.code}: ${n.message}`
|
|
2794
2885
|
).join("; ");
|
|
2795
|
-
return new Error(`Invalid Semaphor analytics intent. ${
|
|
2886
|
+
return new Error(`Invalid Semaphor analytics intent. ${t}`);
|
|
2796
2887
|
}
|
|
2797
|
-
function
|
|
2888
|
+
function q(e, r, t, n) {
|
|
2798
2889
|
return JSON.stringify({
|
|
2799
2890
|
intent: e,
|
|
2800
|
-
activeInputs:
|
|
2891
|
+
activeInputs: r,
|
|
2801
2892
|
analysisOptions: n,
|
|
2802
|
-
error:
|
|
2893
|
+
error: t == null ? void 0 : t.message
|
|
2803
2894
|
});
|
|
2804
2895
|
}
|
|
2805
|
-
function
|
|
2806
|
-
const [
|
|
2807
|
-
() =>
|
|
2896
|
+
function Vn(e) {
|
|
2897
|
+
const [r, t] = Q(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, l = b(
|
|
2898
|
+
() => Ze(e.options),
|
|
2808
2899
|
[e.options]
|
|
2809
|
-
),
|
|
2810
|
-
(
|
|
2811
|
-
var
|
|
2812
|
-
const f =
|
|
2813
|
-
(
|
|
2900
|
+
), u = C(
|
|
2901
|
+
(d) => {
|
|
2902
|
+
var g;
|
|
2903
|
+
const f = d;
|
|
2904
|
+
(g = e.onValueChange) == null || g.call(e, f), n || t(f);
|
|
2814
2905
|
},
|
|
2815
2906
|
[n, e]
|
|
2816
|
-
),
|
|
2907
|
+
), c = C(() => u(void 0), [u]);
|
|
2817
2908
|
return b(() => {
|
|
2818
|
-
const
|
|
2909
|
+
const d = er(e);
|
|
2819
2910
|
return {
|
|
2820
2911
|
id: e.id,
|
|
2821
2912
|
kind: e.kind,
|
|
2822
2913
|
label: e.label,
|
|
2823
|
-
field:
|
|
2824
|
-
operator:
|
|
2825
|
-
relationshipHint:
|
|
2914
|
+
field: d.field,
|
|
2915
|
+
operator: d.operator,
|
|
2916
|
+
relationshipHint: d.relationshipHint,
|
|
2826
2917
|
controlRole: e.kind === "control" ? e.role : void 0,
|
|
2827
2918
|
value: i,
|
|
2828
|
-
options:
|
|
2829
|
-
isActive:
|
|
2830
|
-
setValue:
|
|
2831
|
-
clear:
|
|
2919
|
+
options: l,
|
|
2920
|
+
isActive: re(i),
|
|
2921
|
+
setValue: u,
|
|
2922
|
+
clear: c,
|
|
2832
2923
|
toAnalyticsInput: () => ({
|
|
2833
|
-
inputId:
|
|
2834
|
-
field:
|
|
2924
|
+
inputId: d.inputId,
|
|
2925
|
+
field: d.field,
|
|
2835
2926
|
kind: e.kind,
|
|
2836
2927
|
label: e.label,
|
|
2837
2928
|
value: i,
|
|
2838
|
-
isActive:
|
|
2839
|
-
operator:
|
|
2840
|
-
relationshipHint:
|
|
2929
|
+
isActive: re(i),
|
|
2930
|
+
operator: d.operator,
|
|
2931
|
+
relationshipHint: d.relationshipHint,
|
|
2841
2932
|
controlRole: e.kind === "control" ? e.role : void 0
|
|
2842
2933
|
})
|
|
2843
2934
|
};
|
|
2844
|
-
}, [
|
|
2935
|
+
}, [c, l, u, e, i]);
|
|
2845
2936
|
}
|
|
2846
|
-
function
|
|
2847
|
-
const [
|
|
2848
|
-
return
|
|
2849
|
-
|
|
2937
|
+
function Qn(e) {
|
|
2938
|
+
const [r, t] = Q(() => On(e));
|
|
2939
|
+
return L(() => {
|
|
2940
|
+
t((n) => {
|
|
2850
2941
|
let i = n;
|
|
2851
|
-
for (const
|
|
2852
|
-
!Object.prototype.hasOwnProperty.call(i,
|
|
2942
|
+
for (const l of e)
|
|
2943
|
+
!Object.prototype.hasOwnProperty.call(i, l.id) && l.defaultValue !== void 0 && (i = { ...i, [l.id]: l.defaultValue });
|
|
2853
2944
|
return i;
|
|
2854
2945
|
});
|
|
2855
2946
|
}, [e]), b(
|
|
@@ -2857,13 +2948,13 @@ function $n(e) {
|
|
|
2857
2948
|
const i = Object.prototype.hasOwnProperty.call(
|
|
2858
2949
|
n,
|
|
2859
2950
|
"value"
|
|
2860
|
-
),
|
|
2861
|
-
var
|
|
2862
|
-
(
|
|
2863
|
-
...
|
|
2864
|
-
[n.id]:
|
|
2951
|
+
), l = i ? n.value : r[n.id], u = Ze(n.options), c = (g) => {
|
|
2952
|
+
var y;
|
|
2953
|
+
(y = n.onValueChange) == null || y.call(n, g), i || t((h) => ({
|
|
2954
|
+
...h,
|
|
2955
|
+
[n.id]: g
|
|
2865
2956
|
}));
|
|
2866
|
-
},
|
|
2957
|
+
}, d = () => c(void 0), f = er(n);
|
|
2867
2958
|
return {
|
|
2868
2959
|
id: n.id,
|
|
2869
2960
|
kind: n.kind,
|
|
@@ -2872,99 +2963,99 @@ function $n(e) {
|
|
|
2872
2963
|
operator: f.operator,
|
|
2873
2964
|
relationshipHint: f.relationshipHint,
|
|
2874
2965
|
controlRole: n.kind === "control" ? n.role : void 0,
|
|
2875
|
-
value:
|
|
2876
|
-
options:
|
|
2877
|
-
isActive:
|
|
2878
|
-
setValue:
|
|
2879
|
-
clear:
|
|
2966
|
+
value: l,
|
|
2967
|
+
options: u,
|
|
2968
|
+
isActive: re(l),
|
|
2969
|
+
setValue: c,
|
|
2970
|
+
clear: d,
|
|
2880
2971
|
toAnalyticsInput: () => ({
|
|
2881
2972
|
inputId: f.inputId,
|
|
2882
2973
|
field: f.field,
|
|
2883
2974
|
kind: n.kind,
|
|
2884
2975
|
label: n.label,
|
|
2885
|
-
value:
|
|
2886
|
-
isActive:
|
|
2976
|
+
value: l,
|
|
2977
|
+
isActive: re(l),
|
|
2887
2978
|
operator: f.operator,
|
|
2888
2979
|
relationshipHint: f.relationshipHint,
|
|
2889
2980
|
controlRole: n.kind === "control" ? n.role : void 0
|
|
2890
2981
|
})
|
|
2891
2982
|
};
|
|
2892
2983
|
}),
|
|
2893
|
-
[e,
|
|
2984
|
+
[e, r]
|
|
2894
2985
|
);
|
|
2895
2986
|
}
|
|
2896
|
-
function
|
|
2897
|
-
const
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
}, [e, n,
|
|
2987
|
+
function Un(e, r) {
|
|
2988
|
+
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = b(() => Cn(t), [t]);
|
|
2989
|
+
L(() => {
|
|
2990
|
+
kn(e.value, t) || e.clear();
|
|
2991
|
+
}, [e, n, r == null ? void 0 : r.status, t]);
|
|
2901
2992
|
}
|
|
2902
|
-
function
|
|
2903
|
-
if (!
|
|
2993
|
+
function kn(e, r) {
|
|
2994
|
+
if (!re(e) || r === void 0)
|
|
2904
2995
|
return !0;
|
|
2905
|
-
const
|
|
2906
|
-
|
|
2996
|
+
const t = new Set(
|
|
2997
|
+
r.map((i) => Ye(i.value))
|
|
2907
2998
|
);
|
|
2908
2999
|
return (Array.isArray(e) ? e : [e]).every(
|
|
2909
|
-
(i) =>
|
|
3000
|
+
(i) => t.has(Ye(i))
|
|
2910
3001
|
);
|
|
2911
3002
|
}
|
|
2912
|
-
function
|
|
2913
|
-
return JSON.stringify((e || []).map((
|
|
3003
|
+
function Cn(e) {
|
|
3004
|
+
return JSON.stringify((e || []).map((r) => r.value));
|
|
2914
3005
|
}
|
|
2915
|
-
function
|
|
3006
|
+
function Ye(e) {
|
|
2916
3007
|
return `${typeof e}:${String(e)}`;
|
|
2917
3008
|
}
|
|
2918
|
-
function
|
|
2919
|
-
const
|
|
2920
|
-
() =>
|
|
3009
|
+
function Gn(e, r = {}) {
|
|
3010
|
+
const t = b(
|
|
3011
|
+
() => r.inputs ? {
|
|
2921
3012
|
...e,
|
|
2922
|
-
inputs:
|
|
3013
|
+
inputs: r.inputs
|
|
2923
3014
|
} : e,
|
|
2924
|
-
[
|
|
3015
|
+
[r.inputs, e]
|
|
2925
3016
|
), n = b(() => {
|
|
2926
|
-
switch (
|
|
3017
|
+
switch (t.queryKind) {
|
|
2927
3018
|
case "metric":
|
|
2928
3019
|
return {
|
|
2929
|
-
queryKind:
|
|
2930
|
-
request:
|
|
3020
|
+
queryKind: t.queryKind,
|
|
3021
|
+
request: qn(t)
|
|
2931
3022
|
};
|
|
2932
3023
|
case "analysis":
|
|
2933
3024
|
return {
|
|
2934
|
-
queryKind:
|
|
2935
|
-
request:
|
|
3025
|
+
queryKind: t.queryKind,
|
|
3026
|
+
request: In(t)
|
|
2936
3027
|
};
|
|
2937
3028
|
case "records":
|
|
2938
3029
|
return {
|
|
2939
|
-
queryKind:
|
|
2940
|
-
request:
|
|
3030
|
+
queryKind: t.queryKind,
|
|
3031
|
+
request: An(t)
|
|
2941
3032
|
};
|
|
2942
3033
|
case "inputOptions":
|
|
2943
3034
|
return {
|
|
2944
|
-
queryKind:
|
|
2945
|
-
request:
|
|
3035
|
+
queryKind: t.queryKind,
|
|
3036
|
+
request: Rn(t)
|
|
2946
3037
|
};
|
|
2947
3038
|
case "sql":
|
|
2948
3039
|
return {
|
|
2949
|
-
queryKind:
|
|
2950
|
-
request:
|
|
3040
|
+
queryKind: t.queryKind,
|
|
3041
|
+
request: En(t)
|
|
2951
3042
|
};
|
|
2952
3043
|
case "matrix":
|
|
2953
3044
|
return {
|
|
2954
|
-
queryKind:
|
|
2955
|
-
request:
|
|
3045
|
+
queryKind: t.queryKind,
|
|
3046
|
+
request: Tn(t)
|
|
2956
3047
|
};
|
|
2957
3048
|
default:
|
|
2958
|
-
return
|
|
3049
|
+
return Ae(t);
|
|
2959
3050
|
}
|
|
2960
|
-
}, [
|
|
2961
|
-
spec:
|
|
3051
|
+
}, [t]), i = Ur({
|
|
3052
|
+
spec: t,
|
|
2962
3053
|
queryKind: n.queryKind,
|
|
2963
3054
|
queryKey: n.request.queryKey,
|
|
2964
3055
|
intent: n.request.intent,
|
|
2965
3056
|
activeInputs: n.request.activeInputs,
|
|
2966
|
-
debug:
|
|
2967
|
-
}),
|
|
3057
|
+
debug: r.debug
|
|
3058
|
+
}), l = k(null), u = b(
|
|
2968
3059
|
() => ({
|
|
2969
3060
|
start: i.start,
|
|
2970
3061
|
success: i.success,
|
|
@@ -2977,78 +3068,78 @@ function Fn(e, t = {}) {
|
|
|
2977
3068
|
i.start,
|
|
2978
3069
|
i.success
|
|
2979
3070
|
]
|
|
2980
|
-
),
|
|
3071
|
+
), c = C(
|
|
2981
3072
|
(o) => {
|
|
2982
|
-
var
|
|
2983
|
-
const
|
|
2984
|
-
if (
|
|
3073
|
+
var B, T, v, I, D, E, O, w, K;
|
|
3074
|
+
const x = n.request;
|
|
3075
|
+
if (x.intent)
|
|
2985
3076
|
switch (n.queryKind) {
|
|
2986
3077
|
case "metric":
|
|
2987
|
-
return (
|
|
2988
|
-
|
|
3078
|
+
return (B = o.executor) == null ? void 0 : B.executeMetric(
|
|
3079
|
+
x.intent,
|
|
2989
3080
|
o
|
|
2990
3081
|
);
|
|
2991
3082
|
case "analysis":
|
|
2992
|
-
return (
|
|
2993
|
-
|
|
2994
|
-
|
|
3083
|
+
return (v = (T = o.executor) == null ? void 0 : T.executeAnalysis) == null ? void 0 : v.call(
|
|
3084
|
+
T,
|
|
3085
|
+
x.intent,
|
|
2995
3086
|
o,
|
|
2996
|
-
|
|
3087
|
+
x.analysisOptions
|
|
2997
3088
|
);
|
|
2998
3089
|
case "records":
|
|
2999
|
-
return (
|
|
3000
|
-
|
|
3090
|
+
return (I = o.executor) == null ? void 0 : I.executeRecords(
|
|
3091
|
+
x.intent,
|
|
3001
3092
|
o
|
|
3002
3093
|
);
|
|
3003
3094
|
case "inputOptions":
|
|
3004
|
-
return (
|
|
3005
|
-
|
|
3095
|
+
return (D = o.executor) == null ? void 0 : D.executeInputOptions(
|
|
3096
|
+
x.intent,
|
|
3006
3097
|
o
|
|
3007
3098
|
);
|
|
3008
3099
|
case "sql":
|
|
3009
|
-
return (
|
|
3100
|
+
return (O = (E = o.executor) == null ? void 0 : E.executeSql) == null ? void 0 : O.call(
|
|
3010
3101
|
E,
|
|
3011
|
-
|
|
3102
|
+
x.intent,
|
|
3012
3103
|
o
|
|
3013
3104
|
);
|
|
3014
3105
|
case "matrix":
|
|
3015
|
-
return (K = (
|
|
3016
|
-
|
|
3017
|
-
|
|
3106
|
+
return (K = (w = o.executor) == null ? void 0 : w.executeMatrix) == null ? void 0 : K.call(
|
|
3107
|
+
w,
|
|
3108
|
+
x.intent,
|
|
3018
3109
|
o
|
|
3019
3110
|
);
|
|
3020
3111
|
default:
|
|
3021
|
-
return
|
|
3112
|
+
return Ae(n);
|
|
3022
3113
|
}
|
|
3023
3114
|
},
|
|
3024
3115
|
[n]
|
|
3025
|
-
),
|
|
3116
|
+
), d = Dn(
|
|
3026
3117
|
n.request.queryKey,
|
|
3027
|
-
|
|
3118
|
+
c,
|
|
3028
3119
|
n.request.idleData,
|
|
3029
3120
|
n.request.activeInputs,
|
|
3030
|
-
|
|
3031
|
-
), f = i.queryId,
|
|
3032
|
-
|
|
3121
|
+
u
|
|
3122
|
+
), f = i.queryId, g = i.validationFailure;
|
|
3123
|
+
L(() => {
|
|
3033
3124
|
const o = n.request.error;
|
|
3034
3125
|
if (!o) {
|
|
3035
|
-
|
|
3126
|
+
l.current = null;
|
|
3036
3127
|
return;
|
|
3037
3128
|
}
|
|
3038
|
-
const
|
|
3039
|
-
|
|
3129
|
+
const x = `${f}:${o.message}`;
|
|
3130
|
+
l.current !== x && (l.current = x, g(o));
|
|
3040
3131
|
}, [
|
|
3041
3132
|
n.request.error,
|
|
3042
3133
|
n.request.queryKey,
|
|
3043
3134
|
f,
|
|
3044
|
-
|
|
3135
|
+
g
|
|
3045
3136
|
]);
|
|
3046
|
-
const
|
|
3137
|
+
const y = n.request.error ? n.request.idleData : d.data, h = n.request.error ? "error" : d.status, m = !n.request.error && d.status === "loading", S = n.request.error || d.error, R = i.trace;
|
|
3047
3138
|
switch (n.queryKind) {
|
|
3048
3139
|
case "metric": {
|
|
3049
|
-
const o =
|
|
3140
|
+
const o = y;
|
|
3050
3141
|
return {
|
|
3051
|
-
id:
|
|
3142
|
+
id: t.id,
|
|
3052
3143
|
intent: n.request.intent,
|
|
3053
3144
|
value: (o == null ? void 0 : o.value) ?? null,
|
|
3054
3145
|
measures: o == null ? void 0 : o.measures,
|
|
@@ -3057,57 +3148,57 @@ function Fn(e, t = {}) {
|
|
|
3057
3148
|
deltaPercent: o == null ? void 0 : o.deltaPercent,
|
|
3058
3149
|
records: o == null ? void 0 : o.records,
|
|
3059
3150
|
executionResult: o == null ? void 0 : o.executionResult,
|
|
3060
|
-
status:
|
|
3151
|
+
status: h,
|
|
3061
3152
|
isLoading: m,
|
|
3062
|
-
error:
|
|
3063
|
-
trace:
|
|
3153
|
+
error: S,
|
|
3154
|
+
trace: R
|
|
3064
3155
|
};
|
|
3065
3156
|
}
|
|
3066
3157
|
case "analysis": {
|
|
3067
|
-
const o =
|
|
3158
|
+
const o = vr(y);
|
|
3068
3159
|
return {
|
|
3069
|
-
id:
|
|
3160
|
+
id: t.id,
|
|
3070
3161
|
intent: n.request.intent,
|
|
3071
3162
|
...o || {},
|
|
3072
|
-
status:
|
|
3163
|
+
status: h,
|
|
3073
3164
|
isLoading: m,
|
|
3074
|
-
error:
|
|
3075
|
-
trace:
|
|
3165
|
+
error: S,
|
|
3166
|
+
trace: R
|
|
3076
3167
|
};
|
|
3077
3168
|
}
|
|
3078
3169
|
case "records": {
|
|
3079
|
-
const o =
|
|
3170
|
+
const o = y;
|
|
3080
3171
|
return {
|
|
3081
|
-
id:
|
|
3172
|
+
id: t.id,
|
|
3082
3173
|
intent: n.request.intent,
|
|
3083
3174
|
records: (o == null ? void 0 : o.records) || [],
|
|
3084
3175
|
columns: o == null ? void 0 : o.columns,
|
|
3085
3176
|
rowCount: o == null ? void 0 : o.rowCount,
|
|
3086
3177
|
pagination: o == null ? void 0 : o.pagination,
|
|
3087
3178
|
executionResult: o == null ? void 0 : o.executionResult,
|
|
3088
|
-
status:
|
|
3179
|
+
status: h,
|
|
3089
3180
|
isLoading: m,
|
|
3090
|
-
error:
|
|
3091
|
-
trace:
|
|
3181
|
+
error: S,
|
|
3182
|
+
trace: R
|
|
3092
3183
|
};
|
|
3093
3184
|
}
|
|
3094
3185
|
case "inputOptions": {
|
|
3095
|
-
const o =
|
|
3186
|
+
const o = y;
|
|
3096
3187
|
return {
|
|
3097
|
-
id:
|
|
3188
|
+
id: t.id,
|
|
3098
3189
|
intent: n.request.intent,
|
|
3099
3190
|
options: (o == null ? void 0 : o.options) || [],
|
|
3100
3191
|
executionResult: o == null ? void 0 : o.executionResult,
|
|
3101
|
-
status:
|
|
3192
|
+
status: h,
|
|
3102
3193
|
isLoading: m,
|
|
3103
|
-
error:
|
|
3104
|
-
trace:
|
|
3194
|
+
error: S,
|
|
3195
|
+
trace: R
|
|
3105
3196
|
};
|
|
3106
3197
|
}
|
|
3107
3198
|
case "sql": {
|
|
3108
|
-
const o =
|
|
3199
|
+
const o = y;
|
|
3109
3200
|
return {
|
|
3110
|
-
id:
|
|
3201
|
+
id: t.id,
|
|
3111
3202
|
intent: n.request.intent,
|
|
3112
3203
|
records: (o == null ? void 0 : o.records) || [],
|
|
3113
3204
|
columns: o == null ? void 0 : o.columns,
|
|
@@ -3116,120 +3207,127 @@ function Fn(e, t = {}) {
|
|
|
3116
3207
|
output: o == null ? void 0 : o.output,
|
|
3117
3208
|
rowLimitExceeded: o == null ? void 0 : o.rowLimitExceeded,
|
|
3118
3209
|
executionResult: o == null ? void 0 : o.executionResult,
|
|
3119
|
-
status:
|
|
3210
|
+
status: h,
|
|
3120
3211
|
isLoading: m,
|
|
3121
|
-
error:
|
|
3122
|
-
trace:
|
|
3212
|
+
error: S,
|
|
3213
|
+
trace: R
|
|
3123
3214
|
};
|
|
3124
3215
|
}
|
|
3125
3216
|
case "matrix": {
|
|
3126
|
-
const o =
|
|
3217
|
+
const o = y;
|
|
3127
3218
|
return {
|
|
3128
|
-
id:
|
|
3219
|
+
id: t.id,
|
|
3129
3220
|
intent: n.request.intent,
|
|
3130
3221
|
matrixResult: o == null ? void 0 : o.matrixResult,
|
|
3131
3222
|
grid: o == null ? void 0 : o.grid,
|
|
3132
3223
|
expansion: o == null ? void 0 : o.expansion,
|
|
3133
3224
|
executionResult: o == null ? void 0 : o.executionResult,
|
|
3134
|
-
status:
|
|
3225
|
+
status: h,
|
|
3135
3226
|
isLoading: m,
|
|
3136
|
-
error:
|
|
3137
|
-
trace:
|
|
3227
|
+
error: S,
|
|
3228
|
+
trace: R
|
|
3138
3229
|
};
|
|
3139
3230
|
}
|
|
3140
3231
|
default:
|
|
3141
|
-
return
|
|
3232
|
+
return Ae(n);
|
|
3142
3233
|
}
|
|
3143
3234
|
}
|
|
3144
|
-
function
|
|
3145
|
-
const
|
|
3235
|
+
function Dn(e, r, t, n, i) {
|
|
3236
|
+
const l = Sn(), u = k(r), c = k(n), [d, f] = Q({
|
|
3146
3237
|
status: "idle",
|
|
3147
|
-
data:
|
|
3238
|
+
data: t,
|
|
3148
3239
|
error: null
|
|
3149
3240
|
});
|
|
3150
|
-
return
|
|
3151
|
-
let
|
|
3241
|
+
return u.current = r, c.current = n, L(() => {
|
|
3242
|
+
let g;
|
|
3152
3243
|
try {
|
|
3153
|
-
|
|
3154
|
-
...
|
|
3155
|
-
activeInputs:
|
|
3244
|
+
g = u.current({
|
|
3245
|
+
...l,
|
|
3246
|
+
activeInputs: c.current
|
|
3156
3247
|
});
|
|
3157
3248
|
} catch (m) {
|
|
3158
3249
|
i == null || i.failure(m, 0), f({
|
|
3159
3250
|
status: "error",
|
|
3160
|
-
data:
|
|
3161
|
-
error:
|
|
3251
|
+
data: t,
|
|
3252
|
+
error: N(m)
|
|
3162
3253
|
});
|
|
3163
3254
|
return;
|
|
3164
3255
|
}
|
|
3165
|
-
if (!
|
|
3166
|
-
f({ status: "idle", data:
|
|
3256
|
+
if (!g) {
|
|
3257
|
+
f({ status: "idle", data: t, error: null });
|
|
3167
3258
|
return;
|
|
3168
3259
|
}
|
|
3169
|
-
let
|
|
3170
|
-
const
|
|
3260
|
+
let y = !1;
|
|
3261
|
+
const h = xr();
|
|
3171
3262
|
return i == null || i.start(), f((m) => ({
|
|
3172
3263
|
status: "loading",
|
|
3173
3264
|
data: m.data,
|
|
3174
3265
|
error: null
|
|
3175
|
-
})),
|
|
3176
|
-
|
|
3266
|
+
})), g.then((m) => {
|
|
3267
|
+
y ? i == null || i.ignored("superseded") : (i == null || i.success(m, Xe(h)), f({ status: "success", data: m, error: null }));
|
|
3177
3268
|
}).catch((m) => {
|
|
3178
|
-
|
|
3269
|
+
y ? i == null || i.ignored("superseded") : (i == null || i.failure(m, Xe(h)), f({
|
|
3179
3270
|
status: "error",
|
|
3180
|
-
data:
|
|
3181
|
-
error:
|
|
3271
|
+
data: t,
|
|
3272
|
+
error: N(m)
|
|
3182
3273
|
}));
|
|
3183
3274
|
}), () => {
|
|
3184
|
-
|
|
3275
|
+
y = !0;
|
|
3185
3276
|
};
|
|
3186
|
-
}, [
|
|
3277
|
+
}, [t, e, l, i]), d;
|
|
3187
3278
|
}
|
|
3188
|
-
function
|
|
3279
|
+
function xr() {
|
|
3189
3280
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
3190
3281
|
}
|
|
3191
|
-
function
|
|
3192
|
-
return Math.max(0, Math.round(
|
|
3282
|
+
function Xe(e) {
|
|
3283
|
+
return Math.max(0, Math.round(xr() - e));
|
|
3193
3284
|
}
|
|
3194
|
-
function
|
|
3285
|
+
function On(e) {
|
|
3195
3286
|
return Object.fromEntries(
|
|
3196
|
-
e.filter((
|
|
3287
|
+
e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
|
|
3197
3288
|
);
|
|
3198
3289
|
}
|
|
3199
|
-
function
|
|
3290
|
+
function Ae(e) {
|
|
3200
3291
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
3201
3292
|
}
|
|
3202
|
-
function
|
|
3293
|
+
function Ln(e) {
|
|
3294
|
+
return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
|
|
3295
|
+
}
|
|
3296
|
+
function Jn({
|
|
3203
3297
|
token: e,
|
|
3204
|
-
apiBaseUrl:
|
|
3205
|
-
executor:
|
|
3298
|
+
apiBaseUrl: r,
|
|
3299
|
+
executor: t,
|
|
3206
3300
|
debug: n,
|
|
3207
3301
|
children: i
|
|
3208
3302
|
}) {
|
|
3209
|
-
var
|
|
3210
|
-
const
|
|
3303
|
+
var m;
|
|
3304
|
+
const l = bn(), u = ((m = l == null ? void 0 : l.authToken) == null ? void 0 : m.accessToken) || e, c = (l == null ? void 0 : l.dataApiBaseUrl) || (l == null ? void 0 : l.apiBaseUrl) || r, d = (l == null ? void 0 : l.debug) ?? n, f = Ln(d), g = b(() => un(), []), y = t || g, h = b(
|
|
3211
3305
|
() => ({
|
|
3212
|
-
token:
|
|
3213
|
-
apiBaseUrl:
|
|
3214
|
-
executor:
|
|
3306
|
+
token: u,
|
|
3307
|
+
apiBaseUrl: c,
|
|
3308
|
+
executor: y,
|
|
3309
|
+
debug: d
|
|
3215
3310
|
}),
|
|
3216
|
-
[
|
|
3311
|
+
[c, d, y, u]
|
|
3217
3312
|
);
|
|
3218
|
-
return /* @__PURE__ */ s(
|
|
3313
|
+
return /* @__PURE__ */ s(Hr, { debug: d, children: /* @__PURE__ */ p(Sr.Provider, { value: h, children: [
|
|
3314
|
+
i,
|
|
3315
|
+
f ? /* @__PURE__ */ s(Qr, { ...f }) : null
|
|
3316
|
+
] }) });
|
|
3219
3317
|
}
|
|
3220
3318
|
export {
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3319
|
+
Jn as SemaphorDataAppProvider,
|
|
3320
|
+
Qr as SemaphorDevtools,
|
|
3321
|
+
Pn as SemaphorDevtoolsInspectButton,
|
|
3322
|
+
Hn as SemaphorViewBoundary,
|
|
3323
|
+
un as createSemaphorQueryExecutor,
|
|
3324
|
+
Wn as defineSemaphorDataApp,
|
|
3325
|
+
zn as defineSemaphorInput,
|
|
3326
|
+
kn as isSemaphorInputValueValidForOptions,
|
|
3327
|
+
jn as semaphor,
|
|
3328
|
+
Un as useClearInvalidSemaphorInputValue,
|
|
3329
|
+
ir as useSemaphorDevtools,
|
|
3330
|
+
Vn as useSemaphorInput,
|
|
3331
|
+
Qn as useSemaphorInputs,
|
|
3332
|
+
Gn as useSemaphorQuery
|
|
3235
3333
|
};
|