react-semaphor 0.1.388 → 0.1.390

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.
@@ -1,24 +1,24 @@
1
- import { toSemaphorInputSnapshots as Tr, toSemaphorInputBinding as Er, toSemaphorActiveInputSnapshots as J, toSemaphorMatrixIntent as kr, toSemaphorSqlIntent as Cr, toSemaphorInputOptionsIntent as Lr, toSemaphorRecordsIntent as Dr, toSemaphorAnalysisQueryOptions as Or, toSemaphorAnalysisIntent as Br, toSemaphorMetricIntent as Kr, hasSemaphorInputValue as re, normalizeSemaphorInputOptions as nr, toSemaphorInputSpec as ir } from "../data-app-sdk-adapters/index.js";
2
- import { jsxs as p, Fragment as ke, jsx as o } from "react/jsx-runtime";
3
- import { createContext as ge, useContext as H, useState as j, useRef as L, useEffect as B, useMemo as v, useId as or, useCallback as D, useReducer as Nr } from "react";
4
- import { M as $r, a as Wr, S as Fr, E as _r } from "../chunks/search-0LmWwZzW.js";
5
- import { X as zr, j as Mr } from "../chunks/x-IdR_js6f.js";
1
+ import { toSemaphorInputSnapshots as Tr, toSemaphorInputBinding as kr, toSemaphorActiveInputSnapshots as Y, toSemaphorMatrixIntent as Cr, toSemaphorSqlIntent as Dr, toSemaphorInputOptionsIntent as Lr, toSemaphorRecordsIntent as Or, toSemaphorAnalysisQueryOptions as Br, toSemaphorAnalysisIntent as Kr, toSemaphorMetricIntent as Nr, hasSemaphorInputValue as oe, normalizeSemaphorInputOptions as nr, toSemaphorInputSpec as ir } from "../data-app-sdk-adapters/index.js";
2
+ import { jsxs as p, Fragment as or, jsx as o } from "react/jsx-runtime";
3
+ import { createContext as ye, useContext as Q, useState as V, useRef as D, useEffect as K, useMemo as b, Fragment as $r, useId as sr, useCallback as O, useReducer as Wr } from "react";
4
+ import { M as Fr, a as _r, S as zr, E as Hr } from "../chunks/search-0LmWwZzW.js";
5
+ import { X as Mr, j as jr } from "../chunks/x-IdR_js6f.js";
6
6
  import { b as Pr } from "../chunks/validators-CHPH6ORs.js";
7
7
  import "../chunks/analyze-result-contract-DuhlklhI.js";
8
- function ae(e, r, t = {}) {
8
+ function le(e, r, t = {}) {
9
9
  return {
10
10
  ...t,
11
11
  name: e,
12
12
  role: r
13
13
  };
14
14
  }
15
- function Zn(e) {
15
+ function ri(e) {
16
16
  return e;
17
17
  }
18
- function ei(e) {
18
+ function ti(e) {
19
19
  return e;
20
20
  }
21
- const ri = {
21
+ const ni = {
22
22
  source: {
23
23
  semantic(e) {
24
24
  return {
@@ -35,16 +35,16 @@ const ri = {
35
35
  },
36
36
  field: {
37
37
  measure(e, r) {
38
- return ae(e, "measure", r);
38
+ return le(e, "measure", r);
39
39
  },
40
40
  dimension(e, r) {
41
- return ae(e, "dimension", r);
41
+ return le(e, "dimension", r);
42
42
  },
43
43
  date(e, r) {
44
- return ae(e, "date", r);
44
+ return le(e, "date", r);
45
45
  },
46
46
  id(e, r) {
47
- return ae(e, "id", r);
47
+ return le(e, "id", r);
48
48
  }
49
49
  },
50
50
  filter(e) {
@@ -56,7 +56,7 @@ const ri = {
56
56
  bindInput(e, r) {
57
57
  return {
58
58
  toAnalyticsInput() {
59
- const [t] = Tr([e]), n = Er({
59
+ const [t] = Tr([e]), n = kr({
60
60
  ...r,
61
61
  inputId: r.inputId || t.inputId
62
62
  });
@@ -128,44 +128,44 @@ const ri = {
128
128
  queryKind: "matrix"
129
129
  };
130
130
  }
131
- }, ve = 10, be = 100, Hr = 25, jr = 500, sr = {
131
+ }, be = 10, Se = 100, Qr = 25, Vr = 500, ar = {
132
132
  enabled: !1,
133
133
  queries: [],
134
134
  getQuery: () => {
135
135
  },
136
136
  getQueries: () => []
137
- }, De = ge(null), Oe = ge(null), Be = ge(
137
+ }, Le = ye(null), Oe = ye(null), Be = ye(
138
138
  void 0
139
139
  ), P = [];
140
- function Qr({
140
+ function Ur({
141
141
  debug: e,
142
142
  children: r
143
143
  }) {
144
- const t = v(() => Xt(e), [e]), [n, i] = Nr(
144
+ const t = b(() => Zt(e), [e]), [n, i] = Wr(
145
145
  Mt,
146
146
  t,
147
- yr
148
- ), a = L(n), l = or(), [c, u] = j({ open: !1 });
149
- a.current = n, B(() => {
147
+ hr
148
+ ), d = D(n), l = sr(), [c, u] = V({ open: !1 });
149
+ d.current = n, K(() => {
150
150
  i({ type: "config", config: t });
151
- }, [t]), B(() => {
151
+ }, [t]), K(() => {
152
152
  if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
153
153
  return;
154
- const S = Ut(() => a.current);
155
- return Vr({
154
+ const S = Gt(() => d.current);
155
+ return Gr({
156
156
  ownerId: l,
157
157
  bridge: S
158
158
  }), () => {
159
- Ur(l);
159
+ Jr(l);
160
160
  };
161
161
  }, [l, n.enabled, n.exposeWindowBridge]);
162
- const f = v(() => ({ state: n, dispatch: i }), [n]), m = D((S) => {
162
+ const f = b(() => ({ state: n, dispatch: i }), [n]), m = O((S) => {
163
163
  u({ open: !0, focus: S });
164
- }, []), y = D(() => {
164
+ }, []), y = O(() => {
165
165
  u((S) => ({ ...S, open: !1 }));
166
- }, []), h = D((S) => {
166
+ }, []), h = O((S) => {
167
167
  u({ open: !0, focus: S });
168
- }, []), g = v(
168
+ }, []), g = b(
169
169
  () => ({
170
170
  open: c.open,
171
171
  focus: c.focus,
@@ -181,91 +181,95 @@ function Qr({
181
181
  c.open
182
182
  ]
183
183
  );
184
- return /* @__PURE__ */ o(De.Provider, { value: f, children: /* @__PURE__ */ o(Oe.Provider, { value: g, children: r }) });
184
+ return /* @__PURE__ */ o(Le.Provider, { value: f, children: /* @__PURE__ */ o(Oe.Provider, { value: g, children: r }) });
185
185
  }
186
- function Vr(e) {
186
+ function Gr(e) {
187
187
  const r = P.findIndex(
188
188
  (t) => t.ownerId === e.ownerId
189
189
  );
190
- r >= 0 && P.splice(r, 1), P.push(e), ar();
190
+ r >= 0 && P.splice(r, 1), P.push(e), dr();
191
191
  }
192
- function Ur(e) {
192
+ function Jr(e) {
193
193
  const r = P.findIndex(
194
194
  (t) => t.ownerId === e
195
195
  );
196
- r >= 0 && P.splice(r, 1), ar();
196
+ r >= 0 && P.splice(r, 1), dr();
197
197
  }
198
- function ar() {
198
+ function dr() {
199
199
  if (typeof window > "u")
200
200
  return;
201
201
  const e = P[P.length - 1];
202
202
  e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
203
203
  }
204
- function ti({
204
+ function ii({
205
205
  id: e,
206
206
  title: r,
207
207
  children: t
208
208
  }) {
209
- const n = v(() => ({ id: e, title: r }), [e, r]);
209
+ const n = b(() => ({ id: e, title: r }), [e, r]);
210
210
  return /* @__PURE__ */ o(Be.Provider, { value: n, children: t });
211
211
  }
212
- function Gr({
212
+ function Yr({
213
213
  buttonPosition: e = "bottom-right",
214
214
  initialIsOpen: r = !1,
215
215
  panelPosition: t = "right",
216
216
  className: n,
217
217
  style: i
218
218
  } = {}) {
219
- const a = dr(), l = H(Oe), [c, u] = j(""), [f, m] = j(!1), y = L(null), h = L(null), g = l == null ? void 0 : l.openDevtools, S = l == null ? void 0 : l.closeDevtools, E = (l == null ? void 0 : l.open) === !0;
220
- B(() => {
221
- mr();
222
- }, []), B(() => {
223
- r && a.enabled && (g == null || g());
224
- }, [r, a.enabled, g]), B(() => {
225
- if (!E || !S)
219
+ const d = lr(), l = Q(Oe), [c, u] = V(""), [f, m] = V(!1), y = D(null), h = D(null), g = l == null ? void 0 : l.openDevtools, S = l == null ? void 0 : l.closeDevtools, k = (l == null ? void 0 : l.open) === !0;
220
+ K(() => {
221
+ yr();
222
+ }, []), K(() => {
223
+ r && d.enabled && (g == null || g());
224
+ }, [r, d.enabled, g]), K(() => {
225
+ if (!k || !S)
226
226
  return;
227
- const b = (I) => {
228
- var A, R;
229
- const k = I.target;
230
- k instanceof Node && ((A = y.current) != null && A.contains(k) || (R = h.current) != null && R.contains(k) || S());
227
+ const v = (w) => {
228
+ var I, E;
229
+ const A = w.target;
230
+ A instanceof Node && ((I = y.current) != null && I.contains(A) || (E = h.current) != null && E.contains(A) || S());
231
231
  };
232
- return document.addEventListener("pointerdown", b, !0), document.addEventListener("mousedown", b, !0), document.addEventListener("click", b, !0), () => {
233
- document.removeEventListener("pointerdown", b, !0), document.removeEventListener("mousedown", b, !0), document.removeEventListener("click", b, !0);
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
- }, [S, E]);
236
- const d = v(
237
- () => ft(a.queries),
238
- [a.queries]
239
- ), x = v(
240
- () => pt(a.queries, c),
241
- [a.queries, c]
242
- ), N = v(
243
- () => gt(x),
244
- [x]
245
- ), C = v(
246
- () => lr(x, l == null ? void 0 : l.focus) || x[0],
247
- [x, l == null ? void 0 : l.focus]
235
+ }, [S, k]);
236
+ const a = b(
237
+ () => gt(d.queries),
238
+ [d.queries]
239
+ ), x = mt(a), C = b(
240
+ () => yt(d.queries, c),
241
+ [d.queries, c]
242
+ ), L = b(
243
+ () => ht(C),
244
+ [C]
245
+ ), B = b(
246
+ () => ur(C, l == null ? void 0 : l.focus) || C[0],
247
+ [C, l == null ? void 0 : l.focus]
248
248
  );
249
- return !a.enabled || !l ? null : /* @__PURE__ */ p(ke, { children: [
249
+ return !d.enabled || !l ? null : /* @__PURE__ */ p(or, { children: [
250
250
  /* @__PURE__ */ p(
251
251
  "button",
252
252
  {
253
253
  ref: y,
254
254
  type: "button",
255
255
  "aria-label": "Open Semaphor Inspector",
256
- title: "Open Semaphor Inspector",
256
+ title: x,
257
257
  className: n ? `${$} ${n}` : $,
258
258
  style: {
259
259
  ...s.launcher,
260
- ...Kt(e),
261
- ...Nt(d.severity),
260
+ ...Nt(e),
261
+ ...$t(a.severity),
262
262
  ...i
263
263
  },
264
264
  onClick: () => l.openDevtools(),
265
265
  children: [
266
- /* @__PURE__ */ o(Yr, {}),
267
- /* @__PURE__ */ o("span", { style: s.launcherText, children: d.total }),
268
- d.issueCount > 0 ? /* @__PURE__ */ o("span", { style: s.launcherIssueCount, children: d.issueCount }) : null
266
+ /* @__PURE__ */ o(Zr, {}),
267
+ /* @__PURE__ */ o("span", { style: s.launcherText, children: a.total }),
268
+ a.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
269
+ a.issueCount,
270
+ " issue",
271
+ a.issueCount === 1 ? "" : "s"
272
+ ] }) : null
269
273
  ]
270
274
  }
271
275
  ),
@@ -279,7 +283,7 @@ function Gr({
279
283
  className: $,
280
284
  style: {
281
285
  ...s.panel,
282
- ...$t(t),
286
+ ...Wt(t),
283
287
  ...f ? s.panelFullscreen : null
284
288
  },
285
289
  children: [
@@ -287,12 +291,12 @@ function Gr({
287
291
  /* @__PURE__ */ p("div", { style: s.panelTitleBlock, children: [
288
292
  /* @__PURE__ */ o("div", { style: s.panelTitle, children: "Semaphor Inspector" }),
289
293
  /* @__PURE__ */ p("div", { style: s.panelSubtitle, children: [
290
- d.total,
294
+ a.total,
291
295
  " queries · ",
292
- d.loading,
296
+ a.loading,
293
297
  " loading ·",
294
298
  " ",
295
- d.failed,
299
+ a.failed,
296
300
  " failed"
297
301
  ] })
298
302
  ] }),
@@ -304,8 +308,8 @@ function Gr({
304
308
  "aria-label": f ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
305
309
  title: f ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
306
310
  style: s.iconButton,
307
- onClick: () => m((b) => !b),
308
- children: f ? /* @__PURE__ */ o($r, { size: 15 }) : /* @__PURE__ */ o(Wr, { size: 15 })
311
+ onClick: () => m((v) => !v),
312
+ children: f ? /* @__PURE__ */ o(Fr, { size: 15 }) : /* @__PURE__ */ o(_r, { size: 15 })
309
313
  }
310
314
  ),
311
315
  /* @__PURE__ */ o(
@@ -315,19 +319,19 @@ function Gr({
315
319
  "aria-label": "Close Semaphor Inspector",
316
320
  style: s.iconButton,
317
321
  onClick: l.closeDevtools,
318
- children: /* @__PURE__ */ o(zr, { size: 15 })
322
+ children: /* @__PURE__ */ o(Mr, { size: 15 })
319
323
  }
320
324
  )
321
325
  ] })
322
326
  ] }),
323
327
  /* @__PURE__ */ p("label", { style: s.searchBox, children: [
324
- /* @__PURE__ */ o(Fr, { size: 14 }),
328
+ /* @__PURE__ */ o(zr, { size: 14 }),
325
329
  /* @__PURE__ */ o(
326
330
  "input",
327
331
  {
328
332
  "aria-label": "Search Semaphor traces",
329
333
  value: c,
330
- onChange: (b) => u(b.currentTarget.value),
334
+ onChange: (v) => u(v.currentTarget.value),
331
335
  placeholder: "Search traces",
332
336
  style: s.searchInput
333
337
  }
@@ -338,7 +342,7 @@ function Gr({
338
342
  {
339
343
  style: {
340
344
  ...s.panelBody,
341
- ...Wt(t)
345
+ ...Ft(t)
342
346
  },
343
347
  children: [
344
348
  /* @__PURE__ */ o(
@@ -346,70 +350,67 @@ function Gr({
346
350
  {
347
351
  style: {
348
352
  ...s.queryList,
349
- ...Ft()
353
+ ..._t()
350
354
  },
351
355
  "aria-label": "Registered queries",
352
- children: x.length ? N.map((b) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
356
+ children: C.length ? L.map((v) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
353
357
  /* @__PURE__ */ p("div", { style: s.queryGroupHeader, children: [
354
- /* @__PURE__ */ o("span", { children: b.title }),
355
- /* @__PURE__ */ o("span", { style: s.queryGroupCount, children: b.traces.length })
358
+ /* @__PURE__ */ o("span", { children: v.title }),
359
+ /* @__PURE__ */ o("span", { style: s.queryGroupCount, children: v.traces.length })
356
360
  ] }),
357
- b.traces.length ? b.traces.map((I) => {
358
- var oe;
359
- const k = yt(I, C), A = me(I), R = pr(I), w = St(I), K = Ke(I), ne = vt(I), Q = bt(I), ie = ur(R);
361
+ v.traces.length ? v.traces.map((w) => {
362
+ var R;
363
+ const A = bt(w, B), I = Ke(w), E = pr(w), z = gr(w), Z = wt(w, I, z), ee = Z.join(" · "), ae = cr(E);
360
364
  return /* @__PURE__ */ p(
361
365
  "button",
362
366
  {
363
367
  type: "button",
364
- title: `${A} · ${R} · ${K}`,
368
+ title: `${I} · ${E} · ${ee}`,
365
369
  style: {
366
370
  ...s.queryListItem,
367
- ...k ? s.queryListItemSelected : null
371
+ ...A ? s.queryListItemSelected : null
368
372
  },
369
373
  onClick: () => l.focusTrace({
370
- traceId: I.traceId,
371
- queryId: I.queryId,
372
- viewId: I.viewId
374
+ traceId: w.traceId,
375
+ queryId: w.queryId,
376
+ viewId: w.viewId
373
377
  }),
374
378
  children: [
375
379
  /* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
376
- /* @__PURE__ */ o(Zr, { status: (oe = I.latestAttempt) == null ? void 0 : oe.status }),
377
- /* @__PURE__ */ o("span", { style: s.queryListTitle, title: A, children: ne }),
380
+ /* @__PURE__ */ o(rt, { status: (R = w.latestAttempt) == null ? void 0 : R.status }),
381
+ /* @__PURE__ */ o("span", { style: s.queryListTitle, title: I, children: I }),
378
382
  /* @__PURE__ */ o(
379
383
  "span",
380
384
  {
381
385
  style: {
382
386
  ...s.queryListKindChip,
383
- ...cr(ie)
387
+ ...fr(ae)
384
388
  },
385
- children: R
389
+ children: E
386
390
  }
387
391
  )
388
392
  ] }),
389
- /* @__PURE__ */ p(
393
+ /* @__PURE__ */ o(
390
394
  "span",
391
395
  {
392
396
  className: `${$}-source`,
393
397
  style: s.queryListSource,
394
- title: `${w} · ${K}`,
395
- children: [
396
- /* @__PURE__ */ o("span", { children: Q.source }),
397
- Q.queryId ? /* @__PURE__ */ p(ke, { children: [
398
- /* @__PURE__ */ o("span", { style: s.queryListPrefixSep, children: " · " }),
399
- /* @__PURE__ */ o("span", { style: s.queryListPrefixId, children: Q.queryId })
400
- ] }) : null
401
- ]
398
+ title: ee,
399
+ children: Z.map((H, re) => /* @__PURE__ */ p($r, { children: [
400
+ re > 0 ? /* @__PURE__ */ o("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
401
+ /* @__PURE__ */ o("span", { children: H })
402
+ ] }, `${H}:${re}`))
402
403
  }
403
404
  )
404
405
  ]
405
406
  },
406
- Ce(I)
407
+ Ce(w)
407
408
  );
408
409
  }) : /* @__PURE__ */ o("div", { style: s.queryGroupEmpty, children: "No input traces" })
409
- ] }, b.title)) : /* @__PURE__ */ o("div", { style: s.emptyState, children: "No matching traces" })
410
+ ] }, v.title)) : /* @__PURE__ */ o("div", { style: s.emptyState, children: "No matching traces" })
410
411
  }
411
412
  ),
412
- /* @__PURE__ */ o(Xr, { trace: C })
413
+ /* @__PURE__ */ o(et, { trace: B })
413
414
  ]
414
415
  }
415
416
  )
@@ -418,7 +419,7 @@ function Gr({
418
419
  ) : null
419
420
  ] });
420
421
  }
421
- function ni({
422
+ function oi({
422
423
  queryId: e,
423
424
  viewId: r,
424
425
  label: t,
@@ -426,22 +427,22 @@ function ni({
426
427
  style: i
427
428
  } = {}) {
428
429
  var y, h;
429
- const a = dr(), l = H(Oe), c = H(Be);
430
- B(() => {
431
- mr();
430
+ const d = lr(), l = Q(Oe), c = Q(Be);
431
+ K(() => {
432
+ yr();
432
433
  }, []);
433
- const u = r || (c == null ? void 0 : c.id), f = v(
434
- () => mt(a.queries, {
434
+ const u = r || (c == null ? void 0 : c.id), f = b(
435
+ () => vt(d.queries, {
435
436
  queryId: e,
436
437
  viewId: u
437
438
  }),
438
439
  [
439
- a.queries,
440
+ d.queries,
440
441
  e,
441
442
  u
442
443
  ]
443
444
  );
444
- if (!a.enabled || !l || !f)
445
+ if (!d.enabled || !l || !f)
445
446
  return null;
446
447
  const m = t || `Inspect ${xt(f, !!e)}`;
447
448
  return /* @__PURE__ */ p(
@@ -453,7 +454,7 @@ function ni({
453
454
  className: n ? `${$} ${n}` : $,
454
455
  style: {
455
456
  ...s.inspectButton,
456
- ..._t((y = f.latestAttempt) == null ? void 0 : y.status),
457
+ ...zt((y = f.latestAttempt) == null ? void 0 : y.status),
457
458
  ...i
458
459
  },
459
460
  onClick: () => l.openDevtools({
@@ -462,189 +463,184 @@ function ni({
462
463
  viewId: f.viewId
463
464
  }),
464
465
  children: [
465
- /* @__PURE__ */ o(_r, { size: 13 }),
466
+ /* @__PURE__ */ o(Hr, { size: 13 }),
466
467
  /* @__PURE__ */ o("span", { style: s.inspectButtonText, children: ((h = f.latestAttempt) == null ? void 0 : h.status) || "idle" })
467
468
  ]
468
469
  }
469
470
  );
470
471
  }
471
- function dr() {
472
- const e = H(De);
473
- return !e || !e.state.enabled ? sr : fe(e.state);
472
+ function lr() {
473
+ const e = Q(Le);
474
+ return !e || !e.state.enabled ? ar : ge(e.state);
474
475
  }
475
- function Jr({
476
+ function Xr({
476
477
  spec: e,
477
478
  queryKind: r,
478
479
  queryKey: t,
479
480
  intent: n,
480
481
  activeInputs: i,
481
- debug: a
482
+ debug: d
482
483
  }) {
483
- const l = H(De), c = H(Be), u = !!(l != null && l.state.enabled), f = l == null ? void 0 : l.dispatch, m = Zt(e), y = e.label, h = v(
484
+ const l = Q(Le), c = Q(Be), u = !!(l != null && l.state.enabled), f = l == null ? void 0 : l.dispatch, m = rn(e), y = e.label, h = b(
484
485
  () => JSON.stringify(e),
485
486
  [e]
486
- ), g = v(
487
+ ), g = b(
487
488
  () => JSON.stringify(i || []),
488
489
  [i]
489
- ), S = v(
490
+ ), S = b(
490
491
  () => JSON.stringify(n || null),
491
492
  [n]
492
- ), E = L(e), d = L(h), x = L(n), N = L(S), C = L(i), b = L(g);
493
- d.current !== h && (d.current = h, E.current = e), N.current !== S && (N.current = S, x.current = n), b.current !== g && (b.current = g, C.current = i);
494
- const I = E.current, k = x.current, A = C.current, R = or(), w = v(
493
+ ), k = D(e), a = D(h), x = D(n), C = D(S), L = D(i), B = D(g), v = en(d), w = JSON.stringify(v || []), A = D(v), I = D(w);
494
+ a.current !== h && (a.current = h, k.current = e), C.current !== S && (C.current = S, x.current = n), B.current !== g && (B.current = g, L.current = i), I.current !== w && (I.current = w, A.current = v);
495
+ const E = k.current, z = x.current, Z = L.current, ee = A.current, ae = sr(), R = b(
495
496
  () => m || `query_${xr(t)}`,
496
497
  [t, m]
497
- ), K = (a == null ? void 0 : a.viewId) || (c == null ? void 0 : c.id), ne = (a == null ? void 0 : a.viewTitle) || (a == null ? void 0 : a.title) || (c == null ? void 0 : c.title), Q = a == null ? void 0 : a.visualType, ie = a == null ? void 0 : a.sectionTitle, oe = JSON.stringify(Ge(a) || []), Fe = v(
498
- () => Ge(a),
499
- // Keep inline debug={{ sourceHint: ... }} objects from re-registering every render.
500
- // eslint-disable-next-line react-hooks/exhaustive-deps
501
- [oe]
502
- ), z = v(
498
+ ), H = (d == null ? void 0 : d.viewId) || (c == null ? void 0 : c.id), re = (d == null ? void 0 : d.viewTitle) || (d == null ? void 0 : d.title) || (c == null ? void 0 : c.title), Fe = d == null ? void 0 : d.visualType, _e = d == null ? void 0 : d.sectionTitle, M = b(
503
499
  () => [
504
- K || "unscoped-view",
505
- w,
506
- R
500
+ H || "unscoped-view",
501
+ R,
502
+ ae
507
503
  ].join("::"),
508
- [w, R, K]
509
- ), _e = v(
504
+ [R, ae, H]
505
+ ), ze = b(
510
506
  () => ({
511
- traceKey: z,
512
- spec: I,
513
- queryId: w,
507
+ traceKey: M,
508
+ spec: E,
509
+ queryId: R,
514
510
  queryLabel: y,
515
511
  queryKind: r,
516
- builder: en(r),
517
- viewId: K,
518
- viewTitle: ne,
519
- visualType: Q,
520
- sectionTitle: ie,
521
- sourceHints: Fe,
522
- intent: k,
523
- activeInputs: A,
512
+ builder: tn(r),
513
+ viewId: H,
514
+ viewTitle: re,
515
+ visualType: Fe,
516
+ sectionTitle: _e,
517
+ sourceHints: ee,
518
+ intent: z,
519
+ activeInputs: Z,
524
520
  clientWarnings: m ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
525
521
  }),
526
522
  [
527
- w,
523
+ R,
528
524
  r,
529
525
  m,
530
526
  y,
531
- I,
532
- A,
533
- k,
534
- Fe,
535
- ie,
527
+ E,
528
+ Z,
536
529
  z,
537
- K,
538
- ne,
539
- Q
530
+ ee,
531
+ _e,
532
+ M,
533
+ H,
534
+ re,
535
+ Fe
540
536
  ]
541
537
  );
542
- B(() => {
538
+ K(() => {
543
539
  if (!(!u || !f))
544
- return f({ type: "register", descriptor: _e }), () => {
545
- f({ type: "unregister", traceKey: z });
540
+ return f({ type: "register", descriptor: ze }), () => {
541
+ f({ type: "unregister", traceKey: M });
546
542
  };
547
- }, [_e, f, u, z]);
548
- const W = D(
549
- (T, V) => {
550
- !u || !f || f({ type: "event", traceKey: z, event: T, latestAttempt: V });
543
+ }, [ze, f, u, M]);
544
+ const W = O(
545
+ (T, U) => {
546
+ !u || !f || f({ type: "event", traceKey: M, event: T, latestAttempt: U });
551
547
  },
552
- [f, u, z]
553
- ), ze = D(() => {
548
+ [f, u, M]
549
+ ), He = O(() => {
554
550
  W(
555
551
  {
556
552
  type: "query_started",
557
- queryId: w,
558
- at: ue()
553
+ queryId: R,
554
+ at: fe()
559
555
  },
560
556
  { status: "loading" }
561
557
  );
562
- }, [W, w]), Me = D(
563
- (T, V) => {
564
- const X = er(T), Z = ln(T), Ar = un(T);
558
+ }, [W, R]), Me = O(
559
+ (T, U) => {
560
+ const te = er(T), ne = cn(T), Er = fn(T);
565
561
  W(
566
562
  {
567
563
  type: "query_succeeded",
568
- queryId: w,
569
- requestId: X,
570
- at: ue(),
571
- rowCount: Z,
572
- durationMs: V
564
+ queryId: R,
565
+ requestId: te,
566
+ at: fe(),
567
+ rowCount: ne,
568
+ durationMs: U
573
569
  },
574
570
  {
575
- requestId: X,
571
+ requestId: te,
576
572
  status: "success",
577
- durationMs: V,
578
- rowCount: Z,
579
- columnCount: Ar,
573
+ durationMs: U,
574
+ rowCount: ne,
575
+ columnCount: Er,
580
576
  executionResult: Ze(T)
581
577
  }
582
578
  );
583
579
  },
584
- [W, w]
585
- ), se = D(
586
- (T, V) => {
587
- const X = er(T), Z = T instanceof Error ? T.message : String(T);
580
+ [W, R]
581
+ ), de = O(
582
+ (T, U) => {
583
+ const te = er(T), ne = T instanceof Error ? T.message : String(T);
588
584
  W(
589
585
  {
590
586
  type: "query_failed",
591
- queryId: w,
592
- requestId: X,
593
- at: ue(),
594
- errorMessage: Z
587
+ queryId: R,
588
+ requestId: te,
589
+ at: fe(),
590
+ errorMessage: ne
595
591
  },
596
592
  {
597
- requestId: X,
593
+ requestId: te,
598
594
  status: "error",
599
- durationMs: V,
600
- errorMessage: Z,
595
+ durationMs: U,
596
+ errorMessage: ne,
601
597
  executionResult: Ze(T)
602
598
  }
603
599
  );
604
600
  },
605
- [W, w]
606
- ), Pe = D(
601
+ [W, R]
602
+ ), je = O(
607
603
  (T) => {
608
604
  W(
609
605
  {
610
606
  type: "query_ignored_stale",
611
- queryId: w,
612
- at: ue(),
607
+ queryId: R,
608
+ at: fe(),
613
609
  reason: T
614
610
  }
615
611
  );
616
612
  },
617
- [W, w]
618
- ), He = D(
613
+ [W, R]
614
+ ), Pe = O(
619
615
  (T) => {
620
- se(T, 0);
616
+ de(T, 0);
621
617
  },
622
- [se]
623
- ), he = u ? l == null ? void 0 : l.state.entries[z] : void 0;
624
- return v(
618
+ [de]
619
+ ), ve = u ? l == null ? void 0 : l.state.entries[M] : void 0;
620
+ return b(
625
621
  () => ({
626
622
  enabled: u,
627
- queryId: w,
628
- trace: he ? ce(he) : void 0,
629
- start: ze,
623
+ queryId: R,
624
+ trace: ve ? pe(ve) : void 0,
625
+ start: He,
630
626
  success: Me,
631
- failure: se,
632
- ignored: Pe,
633
- validationFailure: He
627
+ failure: de,
628
+ ignored: je,
629
+ validationFailure: Pe
634
630
  }),
635
631
  [
636
632
  u,
637
- se,
638
- Pe,
639
- w,
640
- ze,
633
+ de,
634
+ je,
635
+ R,
636
+ He,
641
637
  Me,
642
- he,
643
- He
638
+ ve,
639
+ Pe
644
640
  ]
645
641
  );
646
642
  }
647
- function Yr() {
643
+ function Zr() {
648
644
  return /* @__PURE__ */ o("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
649
645
  "svg",
650
646
  {
@@ -662,22 +658,22 @@ function Yr() {
662
658
  }
663
659
  ) });
664
660
  }
665
- function Xr({
661
+ function et({
666
662
  trace: e
667
663
  }) {
668
- var C, b, I, k, A;
664
+ var L, B, v, w, A;
669
665
  if (!e)
670
666
  return /* @__PURE__ */ o("div", { style: s.detailsPane, children: /* @__PURE__ */ o("div", { style: s.emptyState, children: "No traces registered yet" }) });
671
667
  const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = xe(
672
- (C = t == null ? void 0 : t.validation) == null ? void 0 : C.warnings
673
- ), i = xe((b = t == null ? void 0 : t.validation) == null ? void 0 : b.errors), a = xe(
674
- (I = t == null ? void 0 : t.coverage) == null ? void 0 : I.missingObligations
675
- ), l = t == null ? void 0 : t.compiledQuery, c = Bt(t), u = ((k = e.server) == null ? void 0 : k.compiledSql) || c.compiledSql, f = r != null && r.errorMessage ? [r.errorMessage] : [], m = [
668
+ (L = t == null ? void 0 : t.validation) == null ? void 0 : L.warnings
669
+ ), i = xe((B = t == null ? void 0 : t.validation) == null ? void 0 : B.errors), d = xe(
670
+ (v = t == null ? void 0 : t.coverage) == null ? void 0 : v.missingObligations
671
+ ), l = t == null ? void 0 : t.compiledQuery, c = Kt(t), u = ((w = e.server) == null ? void 0 : w.compiledSql) || c.compiledSql, f = r != null && r.errorMessage ? [r.errorMessage] : [], m = [
676
672
  ...e.clientWarnings,
677
673
  ...n,
678
674
  ...i,
679
- ...a
680
- ], y = e.inputsApplied.length > 0, h = !!(l || u), g = qt(e), S = Et(r == null ? void 0 : r.rowCount), E = kt(r == null ? void 0 : r.durationMs), d = e.sourceRefs.length, x = pr(e), N = ur(x);
675
+ ...d
676
+ ], y = e.inputsApplied.length > 0, h = !!(l || u), g = Rt(e), S = kt(r == null ? void 0 : r.rowCount), k = Ct(r == null ? void 0 : r.durationMs), a = e.sourceRefs.length, x = pr(e), C = cr(x);
681
677
  return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
682
678
  /* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
683
679
  /* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
@@ -687,17 +683,17 @@ function Xr({
687
683
  "aria-hidden": !0,
688
684
  style: {
689
685
  ...s.detailsHeaderStatusDot,
690
- ...gr(r == null ? void 0 : r.status)
686
+ ...mr(r == null ? void 0 : r.status)
691
687
  }
692
688
  }
693
689
  ),
694
- /* @__PURE__ */ o("span", { style: s.detailsTitle, children: me(e) }),
690
+ /* @__PURE__ */ o("span", { style: s.detailsTitle, children: Ke(e) }),
695
691
  /* @__PURE__ */ o(
696
692
  "span",
697
693
  {
698
694
  style: {
699
695
  ...s.detailsKindChip,
700
- ...cr(N)
696
+ ...fr(C)
701
697
  },
702
698
  children: x
703
699
  }
@@ -711,41 +707,41 @@ function Xr({
711
707
  " rows"
712
708
  ] }),
713
709
  /* @__PURE__ */ o("span", { style: s.metaStripDot, children: "·" }),
714
- /* @__PURE__ */ o("span", { style: s.metaStripItem, children: E }),
715
- d > 0 ? /* @__PURE__ */ p(ke, { children: [
710
+ /* @__PURE__ */ o("span", { style: s.metaStripItem, children: k }),
711
+ a > 0 ? /* @__PURE__ */ p(or, { children: [
716
712
  /* @__PURE__ */ o("span", { style: s.metaStripDot, children: "·" }),
717
- /* @__PURE__ */ o("span", { style: s.metaStripItem, children: d === 1 ? "1 source" : `${d} sources` })
713
+ /* @__PURE__ */ o("span", { style: s.metaStripItem, children: a === 1 ? "1 source" : `${a} sources` })
718
714
  ] }) : null
719
715
  ] })
720
716
  ] }),
721
- f.length ? /* @__PURE__ */ o(je, { tone: "error", title: "Error", items: f }) : null,
722
- m.length ? /* @__PURE__ */ o(je, { tone: "warning", title: "Warnings", items: m }) : null,
723
- /* @__PURE__ */ o(et, { trace: e }),
724
- /* @__PURE__ */ o(nt, { trace: e }),
725
- (A = e.sourceHints) != null && A.length ? /* @__PURE__ */ o(it, { hints: e.sourceHints }) : null,
726
- y ? /* @__PURE__ */ o(dt, { inputs: e.inputsApplied }) : null,
727
- h ? /* @__PURE__ */ o(ee, { title: "Compiled Query", defaultOpen: !0, children: /* @__PURE__ */ o(
728
- lt,
717
+ f.length ? /* @__PURE__ */ o(Qe, { tone: "error", title: "Error", items: f }) : null,
718
+ m.length ? /* @__PURE__ */ o(Qe, { tone: "warning", title: "Warnings", items: m }) : null,
719
+ /* @__PURE__ */ o(tt, { trace: e }),
720
+ /* @__PURE__ */ o(ot, { trace: e }),
721
+ (A = e.sourceHints) != null && A.length ? /* @__PURE__ */ o(st, { hints: e.sourceHints }) : null,
722
+ y ? /* @__PURE__ */ o(ut, { inputs: e.inputsApplied }) : null,
723
+ h ? /* @__PURE__ */ o(ie, { title: "Compiled Query", defaultOpen: !0, children: /* @__PURE__ */ o(
724
+ ct,
729
725
  {
730
726
  compiledQuery: l,
731
727
  compiledSql: u
732
728
  }
733
729
  ) }) : null,
734
- /* @__PURE__ */ o(ee, { title: "Lifecycle Events", children: e.recentEvents.length ? /* @__PURE__ */ o("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((R, w) => /* @__PURE__ */ p(
730
+ /* @__PURE__ */ o(ie, { title: "Lifecycle Events", children: e.recentEvents.length ? /* @__PURE__ */ o("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((I, E) => /* @__PURE__ */ p(
735
731
  "div",
736
732
  {
737
733
  style: s.eventRow,
738
734
  children: [
739
- /* @__PURE__ */ o("span", { style: s.eventType, children: Lt(R) }),
740
- /* @__PURE__ */ o("span", { style: s.eventMeta, children: Dt(R) })
735
+ /* @__PURE__ */ o("span", { style: s.eventType, children: Lt(I) }),
736
+ /* @__PURE__ */ o("span", { style: s.eventMeta, children: Ot(I) })
741
737
  ]
742
738
  },
743
- `${R.type}:${R.at}:${w}`
739
+ `${I.type}:${I.at}:${E}`
744
740
  )) }) : /* @__PURE__ */ o("div", { style: s.mutedText, children: "No attempts recorded" }) }),
745
- /* @__PURE__ */ o(ee, { title: "Raw Trace", children: /* @__PURE__ */ o("pre", { style: s.codeBlock, children: Ct(e) }) })
741
+ /* @__PURE__ */ o(ie, { title: "Raw Trace", children: /* @__PURE__ */ o("pre", { style: s.codeBlock, children: Dt(e) }) })
746
742
  ] });
747
743
  }
748
- function je({
744
+ function Qe({
749
745
  tone: e,
750
746
  title: r,
751
747
  items: t
@@ -753,10 +749,10 @@ function je({
753
749
  const n = e === "error" ? s.alertCardError : s.alertCardWarning;
754
750
  return /* @__PURE__ */ p("div", { style: { ...s.alertCard, ...n }, children: [
755
751
  /* @__PURE__ */ o("div", { style: s.alertCardTitle, children: r }),
756
- t.length > 1 ? /* @__PURE__ */ o("ul", { style: s.alertCardList, children: t.map((i, a) => /* @__PURE__ */ o("li", { children: i }, `${e}-${a}`)) }) : /* @__PURE__ */ o("div", { children: t[0] })
752
+ t.length > 1 ? /* @__PURE__ */ o("ul", { style: s.alertCardList, children: t.map((i, d) => /* @__PURE__ */ o("li", { children: i }, `${e}-${d}`)) }) : /* @__PURE__ */ o("div", { children: t[0] })
757
753
  ] });
758
754
  }
759
- function Zr({
755
+ function rt({
760
756
  status: e
761
757
  }) {
762
758
  return /* @__PURE__ */ o(
@@ -765,23 +761,23 @@ function Zr({
765
761
  "aria-hidden": !0,
766
762
  style: {
767
763
  ...s.statusDot,
768
- ...gr(e)
764
+ ...mr(e)
769
765
  }
770
766
  }
771
767
  );
772
768
  }
773
- function ee({
769
+ function ie({
774
770
  title: e,
775
771
  children: r,
776
772
  defaultOpen: t = !1
777
773
  }) {
778
- const [n, i] = j(t);
774
+ const [n, i] = V(t);
779
775
  return /* @__PURE__ */ p(
780
776
  "details",
781
777
  {
782
778
  style: s.disclosure,
783
779
  open: n,
784
- onToggle: (a) => i(a.currentTarget.open),
780
+ onToggle: (d) => i(d.currentTarget.open),
785
781
  children: [
786
782
  /* @__PURE__ */ o("summary", { style: s.disclosureSummary, children: e }),
787
783
  /* @__PURE__ */ o("div", { style: s.disclosureBody, children: r })
@@ -789,29 +785,29 @@ function ee({
789
785
  }
790
786
  );
791
787
  }
792
- function et({
788
+ function tt({
793
789
  trace: e
794
790
  }) {
795
791
  var i;
796
- const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = wt(r);
792
+ const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = qt(r);
797
793
  return /* @__PURE__ */ p("div", { style: s.recipe, children: [
798
- /* @__PURE__ */ o(rt, { sources: e.sourceRefs }),
799
- /* @__PURE__ */ o(M, { title: "Measures", fields: n.measures }),
800
- /* @__PURE__ */ o(M, { title: "Time fields", fields: n.timeFields }),
794
+ /* @__PURE__ */ o(nt, { sources: e.sourceRefs }),
795
+ /* @__PURE__ */ o(j, { title: "Measures", fields: n.measures }),
796
+ /* @__PURE__ */ o(j, { title: "Time fields", fields: n.timeFields }),
801
797
  /* @__PURE__ */ o(
802
- M,
798
+ j,
803
799
  {
804
800
  title: "Dimensions",
805
801
  fields: n.dimensions,
806
802
  emptyText: "No dimensions selected"
807
803
  }
808
804
  ),
809
- /* @__PURE__ */ o(M, { title: "Identifiers", fields: n.identifiers }),
810
- /* @__PURE__ */ o(M, { title: "Other fields", fields: n.other }),
811
- /* @__PURE__ */ o(M, { title: "Input bindings", fields: t })
805
+ /* @__PURE__ */ o(j, { title: "Identifiers", fields: n.identifiers }),
806
+ /* @__PURE__ */ o(j, { title: "Other fields", fields: n.other }),
807
+ /* @__PURE__ */ o(j, { title: "Input bindings", fields: t })
812
808
  ] });
813
809
  }
814
- function rt({
810
+ function nt({
815
811
  sources: e
816
812
  }) {
817
813
  return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
@@ -820,7 +816,7 @@ function rt({
820
816
  /* @__PURE__ */ o("span", { style: s.recipeGroupCount, children: e.length })
821
817
  ] }),
822
818
  /* @__PURE__ */ o("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ o(
823
- tt,
819
+ it,
824
820
  {
825
821
  source: r
826
822
  },
@@ -828,20 +824,20 @@ function rt({
828
824
  )) })
829
825
  ] }) : null;
830
826
  }
831
- function tt({ source: e }) {
827
+ function it({ source: e }) {
832
828
  const r = F(e);
833
829
  return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
834
830
  /* @__PURE__ */ o("span", { style: s.sourcePillLabel, children: r }),
835
831
  /* @__PURE__ */ o("span", { style: s.sourcePillRole, children: e.kind })
836
832
  ] });
837
833
  }
838
- function nt({
834
+ function ot({
839
835
  trace: e
840
836
  }) {
841
- return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ o(ee, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
842
- /* @__PURE__ */ o(ot, { sources: e.sourceRefs }),
837
+ return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ o(ie, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
838
+ /* @__PURE__ */ o(at, { sources: e.sourceRefs }),
843
839
  /* @__PURE__ */ o(
844
- M,
840
+ j,
845
841
  {
846
842
  title: "All field refs",
847
843
  fields: e.fieldRefs,
@@ -850,11 +846,11 @@ function nt({
850
846
  )
851
847
  ] }) });
852
848
  }
853
- function it({
849
+ function st({
854
850
  hints: e
855
851
  }) {
856
- return /* @__PURE__ */ o(ee, { title: "Source hints", children: /* @__PURE__ */ o("div", { style: s.recipeFieldList, children: e.map((r, t) => {
857
- const n = Tt(r), i = r.component || r.exportName || n || "Source hint", a = [
852
+ return /* @__PURE__ */ o(ie, { title: "Source hints", children: /* @__PURE__ */ o("div", { style: s.recipeFieldList, children: e.map((r, t) => {
853
+ const n = Tt(r), i = r.component || r.exportName || n || "Source hint", d = [
858
854
  r.exportName && r.exportName !== i ? r.exportName : void 0,
859
855
  n,
860
856
  r.note
@@ -863,17 +859,17 @@ function it({
863
859
  "div",
864
860
  {
865
861
  style: s.recipeFieldRow,
866
- title: a || i,
862
+ title: d || i,
867
863
  children: [
868
864
  /* @__PURE__ */ o("span", { style: s.recipeFieldName, children: i }),
869
- a ? /* @__PURE__ */ o("span", { style: s.recipeFieldMeta, children: a }) : null
865
+ d ? /* @__PURE__ */ o("span", { style: s.recipeFieldMeta, children: d }) : null
870
866
  ]
871
867
  },
872
868
  `${i}:${n}:${t}`
873
869
  );
874
870
  }) }) });
875
871
  }
876
- function ot({
872
+ function at({
877
873
  sources: e
878
874
  }) {
879
875
  return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
@@ -895,7 +891,7 @@ function ot({
895
891
  )) }) : /* @__PURE__ */ o("div", { style: s.recipeEmptyText, children: "No sources captured" })
896
892
  ] });
897
893
  }
898
- function M({
894
+ function j({
899
895
  title: e,
900
896
  fields: r,
901
897
  emptyText: t
@@ -906,7 +902,7 @@ function M({
906
902
  /* @__PURE__ */ o("span", { style: s.recipeGroupCount, children: r.length })
907
903
  ] }),
908
904
  r.length ? /* @__PURE__ */ o("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ o(
909
- st,
905
+ dt,
910
906
  {
911
907
  field: n,
912
908
  groupTitle: e
@@ -915,21 +911,21 @@ function M({
915
911
  )) }) : /* @__PURE__ */ o("div", { style: s.recipeEmptyText, children: t })
916
912
  ] });
917
913
  }
918
- function st({
914
+ function dt({
919
915
  field: e,
920
916
  groupTitle: r
921
917
  }) {
922
- const t = Rt(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, a = e.source ? F(e.source) : void 0, l = [t, i, a].filter(Boolean).join(" · "), c = at(e, r);
918
+ const t = At(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, d = e.source ? F(e.source) : void 0, l = [t, i, d].filter(Boolean).join(" · "), c = lt(e, r);
923
919
  return /* @__PURE__ */ p("div", { style: s.fieldChip, title: l, children: [
924
920
  /* @__PURE__ */ o("span", { style: { ...s.fieldGlyph, ...c.style }, children: c.text }),
925
921
  e.aggregate ? /* @__PURE__ */ o("span", { style: s.fieldAggBadge, children: e.aggregate }) : null,
926
922
  /* @__PURE__ */ o("span", { style: s.fieldChipName, children: n }),
927
923
  i ? /* @__PURE__ */ o("span", { style: s.fieldChipMeta, children: i }) : null,
928
- i && a ? /* @__PURE__ */ o("span", { style: s.fieldChipMetaDot, children: "·" }) : null,
929
- a ? /* @__PURE__ */ o("span", { style: s.fieldChipMeta, children: a }) : null
924
+ i && d ? /* @__PURE__ */ o("span", { style: s.fieldChipMetaDot, children: "·" }) : null,
925
+ d ? /* @__PURE__ */ o("span", { style: s.fieldChipMeta, children: d }) : null
930
926
  ] });
931
927
  }
932
- function at(e, r) {
928
+ function lt(e, r) {
933
929
  const t = e.dataType, n = e.role;
934
930
  return !!e.aggregate || n === "measure" || r === "Measures" ? {
935
931
  text: "Σ",
@@ -968,7 +964,7 @@ function at(e, r) {
968
964
  }
969
965
  };
970
966
  }
971
- function dt({
967
+ function ut({
972
968
  inputs: e
973
969
  }) {
974
970
  return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
@@ -977,7 +973,7 @@ function dt({
977
973
  /* @__PURE__ */ o("span", { style: s.inputsAppliedCount, children: e.length })
978
974
  ] }),
979
975
  /* @__PURE__ */ o("div", { style: s.inputRecipeList, children: e.map((r) => {
980
- const t = At(r);
976
+ const t = Et(r);
981
977
  return /* @__PURE__ */ p(
982
978
  "div",
983
979
  {
@@ -997,23 +993,23 @@ function dt({
997
993
  }) })
998
994
  ] });
999
995
  }
1000
- function lt({
996
+ function ct({
1001
997
  compiledQuery: e,
1002
998
  compiledSql: r
1003
999
  }) {
1004
1000
  return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
1005
- /* @__PURE__ */ o(Qe, { label: "SQL", value: e.sql }),
1006
- e.pythonCode ? /* @__PURE__ */ o(Se, { label: "Python", value: e.pythonCode }) : null,
1001
+ /* @__PURE__ */ o(Ve, { label: "SQL", value: e.sql }),
1002
+ e.pythonCode ? /* @__PURE__ */ o(we, { label: "Python", value: e.pythonCode }) : null,
1007
1003
  e.parameters ? /* @__PURE__ */ o(
1008
- Se,
1004
+ we,
1009
1005
  {
1010
1006
  label: "Parameters",
1011
- value: Le(e.parameters)
1007
+ value: De(e.parameters)
1012
1008
  }
1013
1009
  ) : null
1014
- ] }) : r ? /* @__PURE__ */ o(Qe, { label: "SQL", value: r }) : /* @__PURE__ */ o(Se, { label: "Compiled Query", value: Le(e) });
1010
+ ] }) : r ? /* @__PURE__ */ o(Ve, { label: "SQL", value: r }) : /* @__PURE__ */ o(we, { label: "Compiled Query", value: De(e) });
1015
1011
  }
1016
- function Se({
1012
+ function we({
1017
1013
  label: e,
1018
1014
  value: r
1019
1015
  }) {
@@ -1022,16 +1018,16 @@ function Se({
1022
1018
  /* @__PURE__ */ o("pre", { style: s.codeBlock, children: r })
1023
1019
  ] });
1024
1020
  }
1025
- function Qe({
1021
+ function Ve({
1026
1022
  label: e,
1027
1023
  value: r
1028
1024
  }) {
1029
1025
  return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
1030
1026
  /* @__PURE__ */ o("div", { style: s.codeBlockLabel, children: e }),
1031
- /* @__PURE__ */ o("pre", { style: s.codeBlock, children: ct(r) })
1027
+ /* @__PURE__ */ o("pre", { style: s.codeBlock, children: pt(r) })
1032
1028
  ] });
1033
1029
  }
1034
- const ut = /* @__PURE__ */ new Set([
1030
+ const ft = /* @__PURE__ */ new Set([
1035
1031
  "SELECT",
1036
1032
  "FROM",
1037
1033
  "JOIN",
@@ -1069,28 +1065,28 @@ const ut = /* @__PURE__ */ new Set([
1069
1065
  "ALL",
1070
1066
  "WITH"
1071
1067
  ]);
1072
- function ct(e) {
1068
+ function pt(e) {
1073
1069
  return e.split(/(\s+|,|\(|\))/).map((t, n) => {
1074
1070
  if (!t) return null;
1075
1071
  const i = t.toUpperCase();
1076
- return ut.has(i) ? /* @__PURE__ */ o("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ o("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ o("span", { children: t }, n);
1072
+ return ft.has(i) ? /* @__PURE__ */ o("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ o("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ o("span", { children: t }, n);
1077
1073
  });
1078
1074
  }
1079
- function ft(e) {
1075
+ function gt(e) {
1080
1076
  const r = e.filter(
1081
1077
  (i) => {
1082
- var a;
1083
- return ((a = i.latestAttempt) == null ? void 0 : a.status) === "error";
1078
+ var d;
1079
+ return ((d = i.latestAttempt) == null ? void 0 : d.status) === "error";
1084
1080
  }
1085
1081
  ).length, t = e.filter(
1086
1082
  (i) => {
1087
- var a;
1088
- return ((a = i.latestAttempt) == null ? void 0 : a.status) === "loading";
1083
+ var d;
1084
+ return ((d = i.latestAttempt) == null ? void 0 : d.status) === "loading";
1089
1085
  }
1090
1086
  ).length, n = e.filter(
1091
1087
  (i) => {
1092
- var a, l, c, u;
1093
- return i.clientWarnings.length > 0 || !!((u = (c = (l = (a = i.latestAttempt) == null ? void 0 : a.executionResult) == null ? void 0 : l.validation) == null ? void 0 : c.warnings) != null && u.length);
1088
+ var d, l, c, u;
1089
+ return i.clientWarnings.length > 0 || !!((u = (c = (l = (d = i.latestAttempt) == null ? void 0 : d.executionResult) == null ? void 0 : l.validation) == null ? void 0 : c.warnings) != null && u.length);
1094
1090
  }
1095
1091
  ).length;
1096
1092
  return {
@@ -1099,10 +1095,18 @@ function ft(e) {
1099
1095
  loading: t,
1100
1096
  warningCount: n,
1101
1097
  issueCount: r + n,
1102
- severity: r ? "error" : n ? "warning" : "ok"
1098
+ severity: r ? "error" : n ? "warning" : t ? "loading" : "ok"
1103
1099
  };
1104
1100
  }
1105
- function pt(e, r) {
1101
+ function mt(e) {
1102
+ return [
1103
+ `${e.total} ${e.total === 1 ? "trace" : "traces"}`,
1104
+ `${e.loading} loading`,
1105
+ `${e.failed} failed`,
1106
+ `${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
1107
+ ].join(" · ");
1108
+ }
1109
+ function yt(e, r) {
1106
1110
  const t = r.trim().toLowerCase();
1107
1111
  return t ? e.filter(
1108
1112
  (n) => [
@@ -1114,36 +1118,36 @@ function pt(e, r) {
1114
1118
  n.sectionTitle,
1115
1119
  n.builder,
1116
1120
  n.queryKind,
1117
- Ke(n)
1121
+ gr(n)
1118
1122
  ].filter(Boolean).join(" ").toLowerCase().includes(t)
1119
1123
  ) : e;
1120
1124
  }
1121
- function gt(e) {
1125
+ function ht(e) {
1122
1126
  const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Ce));
1123
1127
  return [
1124
1128
  { title: "Views", traces: e.filter((i) => !t.has(Ce(i))) },
1125
1129
  { title: "Inputs", traces: r }
1126
1130
  ];
1127
1131
  }
1128
- function lr(e, r) {
1132
+ function ur(e, r) {
1129
1133
  if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
1130
1134
  return r.traceId ? e.find((t) => t.traceId === r.traceId) : e.find((t) => !(r.queryId && t.queryId !== r.queryId || r.viewId && t.viewId !== r.viewId));
1131
1135
  }
1132
- function mt(e, r) {
1136
+ function vt(e, r) {
1133
1137
  if (r.queryId)
1134
- return lr(e, r);
1138
+ return ur(e, r);
1135
1139
  if (!r.viewId)
1136
1140
  return;
1137
1141
  const t = e.filter((n) => n.viewId === r.viewId);
1138
1142
  return t.length === 1 ? t[0] : void 0;
1139
1143
  }
1140
- function yt(e, r) {
1144
+ function bt(e, r) {
1141
1145
  return !!(e && r && e.traceId === r.traceId);
1142
1146
  }
1143
1147
  function Ce(e) {
1144
1148
  return e.traceId;
1145
1149
  }
1146
- function ht(e) {
1150
+ function St(e) {
1147
1151
  switch (e) {
1148
1152
  case "metric":
1149
1153
  return "metric";
@@ -1158,14 +1162,14 @@ function ht(e) {
1158
1162
  case "sql":
1159
1163
  return "sql";
1160
1164
  default:
1161
- return ye(e);
1165
+ return he(e);
1162
1166
  }
1163
1167
  }
1164
- function ur(e) {
1168
+ function cr(e) {
1165
1169
  const r = e.trim().toLowerCase();
1166
1170
  return r === "metric" || r === "kpi" ? "metric" : r === "records" || r === "table" ? "records" : r === "matrix" || r === "pivot" ? "matrix" : r === "analysis" ? "analysis" : r === "inputs" || r === "input options" ? "inputs" : r === "sql" ? "sql" : "default";
1167
1171
  }
1168
- function cr(e) {
1172
+ function fr(e) {
1169
1173
  switch (e) {
1170
1174
  case "metric":
1171
1175
  return {
@@ -1197,37 +1201,28 @@ function cr(e) {
1197
1201
  };
1198
1202
  }
1199
1203
  }
1200
- function fr(e) {
1201
- return e.queryLabel || e.queryId || me(e);
1202
- }
1203
- function vt(e) {
1204
- return fr(e);
1205
- }
1206
- function bt(e) {
1207
- const r = Ke(e), t = fr(e);
1208
- return e.queryId && e.queryId !== t ? { source: r, queryId: e.queryId } : { source: r };
1209
- }
1210
- function me(e) {
1204
+ function Ke(e) {
1211
1205
  return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
1212
1206
  }
1213
- function St(e) {
1214
- return e.viewTitle && e.queryLabel && e.queryLabel !== e.viewTitle ? `${e.queryLabel} · ${e.queryId}` : e.viewTitle || e.queryLabel ? e.queryId : e.viewId ? `${e.viewId} · ${e.queryId}` : e.queryId;
1207
+ function wt(e, r, t) {
1208
+ const n = [];
1209
+ return e.queryLabel && e.queryLabel !== r && n.push(e.queryLabel), e.queryId && e.queryId !== r && e.queryId !== e.queryLabel ? n.push(e.queryId) : e.viewId && e.viewId !== r && e.viewId !== e.queryLabel && n.push(e.viewId), n.push(t), n;
1215
1210
  }
1216
1211
  function pr(e) {
1217
- return It(e.visualType) || ht(e.queryKind);
1212
+ return It(e.visualType) || St(e.queryKind);
1218
1213
  }
1219
1214
  function xt(e, r) {
1220
- return r ? e.queryLabel || e.queryId : me(e);
1215
+ return r ? e.queryLabel || e.queryId : Ke(e);
1221
1216
  }
1222
1217
  function It(e) {
1223
1218
  if (e)
1224
1219
  return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
1225
1220
  }
1226
- function Ke(e) {
1221
+ function gr(e) {
1227
1222
  const r = e.sourceRefs.map(F);
1228
1223
  return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
1229
1224
  }
1230
- function wt(e) {
1225
+ function qt(e) {
1231
1226
  return e.reduce(
1232
1227
  (r, t) => (t.role === "measure" ? r.measures.push(t) : t.role === "date" ? r.timeFields.push(t) : t.role === "dimension" ? r.dimensions.push(t) : t.role === "id" ? r.identifiers.push(t) : r.other.push(t), r),
1233
1228
  {
@@ -1239,7 +1234,7 @@ function wt(e) {
1239
1234
  }
1240
1235
  );
1241
1236
  }
1242
- function qt(e) {
1237
+ function Rt(e) {
1243
1238
  var r, t;
1244
1239
  if (e.queryKind === "records" && ((r = e.projectionFieldRefs) != null && r.length) && e.projectionFieldRefs.every((n) => n.role === "measure") && ((t = e.latestAttempt) == null ? void 0 : t.rowCount) === 1)
1245
1240
  return "KPI query";
@@ -1257,15 +1252,15 @@ function qt(e) {
1257
1252
  case "sql":
1258
1253
  return "SQL query";
1259
1254
  default:
1260
- return ye(e.queryKind);
1255
+ return he(e.queryKind);
1261
1256
  }
1262
1257
  }
1263
- function Rt(e) {
1258
+ function At(e) {
1264
1259
  return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
1265
1260
  }
1266
- function At(e) {
1261
+ function Et(e) {
1267
1262
  var l, c, u;
1268
- const r = e.valuePreview || "redacted", t = ((l = e.fieldRef) == null ? void 0 : l.label) || ((c = e.fieldRef) == null ? void 0 : c.name), n = (u = e.fieldRef) != null && u.source ? F(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "), a = [
1263
+ const r = e.valuePreview || "redacted", t = ((l = e.fieldRef) == null ? void 0 : l.label) || ((c = e.fieldRef) == null ? void 0 : c.name), n = (u = e.fieldRef) != null && u.source ? F(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "), d = [
1269
1264
  e.inputId,
1270
1265
  e.operator,
1271
1266
  r,
@@ -1275,7 +1270,7 @@ function At(e) {
1275
1270
  operator: e.operator,
1276
1271
  value: r,
1277
1272
  binding: i,
1278
- title: a
1273
+ title: d
1279
1274
  };
1280
1275
  }
1281
1276
  function F(e) {
@@ -1288,16 +1283,16 @@ function Tt(e) {
1288
1283
  if (e.file)
1289
1284
  return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
1290
1285
  }
1291
- function Et(e) {
1286
+ function kt(e) {
1292
1287
  return typeof e == "number" ? e.toLocaleString() : "-";
1293
1288
  }
1294
- function kt(e) {
1289
+ function Ct(e) {
1295
1290
  return typeof e == "number" ? `${Math.round(e)}ms` : "-";
1296
1291
  }
1297
- function Ct(e) {
1298
- return Le(e);
1292
+ function Dt(e) {
1293
+ return De(e);
1299
1294
  }
1300
- function Le(e) {
1295
+ function De(e) {
1301
1296
  return JSON.stringify(e, null, 2) ?? "undefined";
1302
1297
  }
1303
1298
  function Lt(e) {
@@ -1313,10 +1308,10 @@ function Lt(e) {
1313
1308
  case "input_changed":
1314
1309
  return "Input changed";
1315
1310
  default:
1316
- return Ot(e);
1311
+ return Bt(e);
1317
1312
  }
1318
1313
  }
1319
- function Dt(e) {
1314
+ function Ot(e) {
1320
1315
  return [
1321
1316
  e.at,
1322
1317
  "durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
@@ -1325,20 +1320,20 @@ function Dt(e) {
1325
1320
  "errorMessage" in e ? e.errorMessage : void 0
1326
1321
  ].filter(Boolean).join(" - ");
1327
1322
  }
1328
- function Ot(e) {
1323
+ function Bt(e) {
1329
1324
  throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
1330
1325
  }
1331
1326
  function xe(e) {
1332
1327
  return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
1333
1328
  }
1334
- function Bt(e) {
1329
+ function Kt(e) {
1335
1330
  const r = e == null ? void 0 : e.metadata, t = r && typeof r == "object" && !Array.isArray(r) && "dataAppDebug" in r && r.dataAppDebug && typeof r.dataAppDebug == "object" && !Array.isArray(r.dataAppDebug) ? r.dataAppDebug : void 0;
1336
1331
  return {
1337
1332
  compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
1338
1333
  queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
1339
1334
  };
1340
1335
  }
1341
- function Kt(e) {
1336
+ function Nt(e) {
1342
1337
  return e === "relative" ? {
1343
1338
  position: "relative",
1344
1339
  top: "auto",
@@ -1352,7 +1347,7 @@ function Kt(e) {
1352
1347
  left: e.endsWith("left") ? 20 : "auto"
1353
1348
  };
1354
1349
  }
1355
- function Nt(e) {
1350
+ function $t(e) {
1356
1351
  return e === "error" ? {
1357
1352
  borderColor: "var(--sd-error-border)",
1358
1353
  background: "var(--sd-error-bg)",
@@ -1361,13 +1356,17 @@ function Nt(e) {
1361
1356
  borderColor: "var(--sd-warning-border)",
1362
1357
  background: "var(--sd-warning-bg)",
1363
1358
  color: "var(--sd-warning-fg)"
1359
+ } : e === "loading" ? {
1360
+ borderColor: "var(--sd-loading-border)",
1361
+ background: "var(--sd-loading-bg)",
1362
+ color: "var(--sd-loading-fg)"
1364
1363
  } : {
1365
1364
  borderColor: "var(--sd-success-border)",
1366
1365
  background: "var(--sd-success-bg)",
1367
1366
  color: "var(--sd-success-fg)"
1368
1367
  };
1369
1368
  }
1370
- function $t(e) {
1369
+ function Wt(e) {
1371
1370
  return e === "right" ? {
1372
1371
  top: 16,
1373
1372
  right: 16,
@@ -1386,23 +1385,23 @@ function $t(e) {
1386
1385
  borderRadius: 6
1387
1386
  };
1388
1387
  }
1389
- function Wt(e) {
1388
+ function Ft(e) {
1390
1389
  return e === "right" ? {
1391
1390
  gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
1392
1391
  } : {
1393
1392
  gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
1394
1393
  };
1395
1394
  }
1396
- function Ft(e) {
1395
+ function _t(e) {
1397
1396
  return {
1398
1397
  borderRight: "1px solid var(--sd-border)",
1399
1398
  borderBottom: 0
1400
1399
  };
1401
1400
  }
1402
- function gr(e) {
1401
+ function mr(e) {
1403
1402
  return e === "error" ? { background: "var(--sd-error-dot)" } : e === "success" ? { background: "var(--sd-success-dot)" } : e === "loading" ? { background: "var(--sd-loading-dot)" } : { background: "var(--sd-idle-dot)" };
1404
1403
  }
1405
- function _t(e) {
1404
+ function zt(e) {
1406
1405
  return e === "error" ? {
1407
1406
  borderColor: "var(--sd-error-border)",
1408
1407
  color: "var(--sd-error-fg)"
@@ -1417,7 +1416,7 @@ function _t(e) {
1417
1416
  color: "var(--sd-fg-muted)"
1418
1417
  };
1419
1418
  }
1420
- const Ve = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", zt = `
1419
+ const Ue = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Ht = `
1421
1420
  .${$} {
1422
1421
  --sd-bg: #ffffff;
1423
1422
  --sd-bg-muted: #fafafa;
@@ -1519,13 +1518,13 @@ const Ve = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", zt = `
1519
1518
  word-break: break-all;
1520
1519
  }
1521
1520
  `;
1522
- function mr() {
1523
- if (typeof document > "u" || document.getElementById(Ve))
1521
+ function yr() {
1522
+ if (typeof document > "u" || document.getElementById(Ue))
1524
1523
  return;
1525
1524
  const e = document.createElement("style");
1526
- e.id = Ve, e.textContent = zt, document.head.appendChild(e);
1525
+ e.id = Ue, e.textContent = Ht, document.head.appendChild(e);
1527
1526
  }
1528
- const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', O = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Ie = {
1527
+ const ue = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', N = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Ie = {
1529
1528
  color: "var(--sd-fg-muted)",
1530
1529
  fontSize: 10,
1531
1530
  fontWeight: 600,
@@ -1546,7 +1545,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1546
1545
  borderStyle: "solid",
1547
1546
  borderRadius: 6,
1548
1547
  boxShadow: "var(--sd-shadow)",
1549
- font: `600 12px/1.2 ${de}`,
1548
+ font: `600 12px/1.2 ${ue}`,
1550
1549
  cursor: "pointer"
1551
1550
  },
1552
1551
  launcherText: {
@@ -1554,14 +1553,17 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1554
1553
  },
1555
1554
  launcherIssueCount: {
1556
1555
  display: "grid",
1557
- minWidth: 16,
1558
- height: 16,
1556
+ minWidth: 18,
1557
+ height: 18,
1558
+ padding: "0 6px",
1559
1559
  placeItems: "center",
1560
- borderRadius: 8,
1561
- background: "currentColor",
1562
- color: "var(--sd-bg)",
1560
+ borderRadius: 999,
1561
+ border: "1px solid currentColor",
1562
+ background: "var(--sd-bg)",
1563
+ color: "currentColor",
1563
1564
  fontSize: 10,
1564
- lineHeight: "16px"
1565
+ lineHeight: "18px",
1566
+ whiteSpace: "nowrap"
1565
1567
  },
1566
1568
  logoMark: {
1567
1569
  display: "grid",
@@ -1588,7 +1590,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1588
1590
  background: "var(--sd-bg)",
1589
1591
  color: "var(--sd-fg)",
1590
1592
  boxShadow: "var(--sd-shadow)",
1591
- font: `13px/1.4 ${de}`
1593
+ font: `13px/1.4 ${ue}`
1592
1594
  },
1593
1595
  panelFullscreen: {
1594
1596
  top: 0,
@@ -1657,7 +1659,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1657
1659
  outline: 0,
1658
1660
  background: "transparent",
1659
1661
  color: "var(--sd-fg)",
1660
- font: `12px/1.4 ${de}`
1662
+ font: `12px/1.4 ${ue}`
1661
1663
  },
1662
1664
  panelBody: {
1663
1665
  display: "grid",
@@ -1746,7 +1748,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1746
1748
  borderRadius: 3,
1747
1749
  background: "var(--sd-bg-accent)",
1748
1750
  color: "var(--sd-fg-muted)",
1749
- fontFamily: O,
1751
+ fontFamily: N,
1750
1752
  fontSize: 9,
1751
1753
  fontWeight: 600,
1752
1754
  textTransform: "uppercase",
@@ -1757,13 +1759,12 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1757
1759
  paddingLeft: 14,
1758
1760
  color: "var(--sd-fg-muted)",
1759
1761
  fontSize: 11,
1760
- lineHeight: 1.35
1761
- },
1762
- queryListPrefixSep: {
1763
- color: "var(--sd-fg-subtle)"
1762
+ lineHeight: 1.35,
1763
+ overflow: "hidden",
1764
+ textOverflow: "ellipsis",
1765
+ whiteSpace: "nowrap"
1764
1766
  },
1765
- queryListPrefixId: {
1766
- fontFamily: O,
1767
+ queryListSubtitleSep: {
1767
1768
  color: "var(--sd-fg-subtle)"
1768
1769
  },
1769
1770
  detailsPane: {
@@ -1807,7 +1808,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1807
1808
  borderRadius: 3,
1808
1809
  background: "var(--sd-bg-accent)",
1809
1810
  color: "var(--sd-fg-muted)",
1810
- fontFamily: O,
1811
+ fontFamily: N,
1811
1812
  fontSize: 10,
1812
1813
  fontWeight: 600,
1813
1814
  textTransform: "uppercase",
@@ -1848,7 +1849,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1848
1849
  color: "var(--sd-fg)"
1849
1850
  },
1850
1851
  sourcePillLabel: {
1851
- fontFamily: O,
1852
+ fontFamily: N,
1852
1853
  fontSize: 11,
1853
1854
  color: "var(--sd-fg)"
1854
1855
  },
@@ -1860,7 +1861,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1860
1861
  borderRadius: 3,
1861
1862
  background: "var(--sd-bg-accent)",
1862
1863
  color: "var(--sd-fg-subtle)",
1863
- fontFamily: O,
1864
+ fontFamily: N,
1864
1865
  fontSize: 9,
1865
1866
  textTransform: "uppercase",
1866
1867
  letterSpacing: "0.06em"
@@ -1892,7 +1893,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1892
1893
  borderWidth: 1,
1893
1894
  borderStyle: "solid",
1894
1895
  borderRadius: 4,
1895
- fontFamily: O,
1896
+ fontFamily: N,
1896
1897
  fontSize: 11,
1897
1898
  fontWeight: 700,
1898
1899
  lineHeight: 1
@@ -1905,7 +1906,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1905
1906
  borderRadius: 3,
1906
1907
  background: "var(--sd-bg-accent)",
1907
1908
  color: "var(--sd-fg)",
1908
- fontFamily: O,
1909
+ fontFamily: N,
1909
1910
  fontSize: 10,
1910
1911
  fontWeight: 600,
1911
1912
  letterSpacing: "0.04em"
@@ -1922,7 +1923,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1922
1923
  },
1923
1924
  fieldChipMeta: {
1924
1925
  flex: "0 0 auto",
1925
- fontFamily: O,
1926
+ fontFamily: N,
1926
1927
  fontSize: 10,
1927
1928
  color: "var(--sd-fg-subtle)"
1928
1929
  },
@@ -2098,7 +2099,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
2098
2099
  textOverflow: "ellipsis",
2099
2100
  whiteSpace: "nowrap",
2100
2101
  color: "var(--sd-fg)",
2101
- fontFamily: O,
2102
+ fontFamily: N,
2102
2103
  fontSize: 11,
2103
2104
  fontWeight: 600
2104
2105
  },
@@ -2111,7 +2112,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
2111
2112
  borderRadius: 3,
2112
2113
  background: "var(--sd-bg-accent)",
2113
2114
  color: "var(--sd-fg-muted)",
2114
- fontFamily: O,
2115
+ fontFamily: N,
2115
2116
  fontSize: 10,
2116
2117
  textTransform: "uppercase",
2117
2118
  letterSpacing: "0.06em"
@@ -2181,7 +2182,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
2181
2182
  borderRadius: 5,
2182
2183
  background: "var(--sd-bg-muted)",
2183
2184
  color: "var(--sd-fg)",
2184
- fontFamily: O,
2185
+ fontFamily: N,
2185
2186
  fontSize: 11,
2186
2187
  lineHeight: 1.5,
2187
2188
  whiteSpace: "pre-wrap"
@@ -2203,7 +2204,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
2203
2204
  borderStyle: "solid",
2204
2205
  borderRadius: 5,
2205
2206
  background: "var(--sd-bg)",
2206
- font: `600 11px/1 ${de}`,
2207
+ font: `600 11px/1 ${ue}`,
2207
2208
  cursor: "pointer"
2208
2209
  },
2209
2210
  inspectButtonText: {
@@ -2212,7 +2213,7 @@ const de = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
2212
2213
  whiteSpace: "nowrap"
2213
2214
  }
2214
2215
  };
2215
- function yr(e) {
2216
+ function hr(e) {
2216
2217
  return {
2217
2218
  ...e,
2218
2219
  order: [],
@@ -2225,24 +2226,24 @@ function Mt(e, r) {
2225
2226
  return r.config.enabled ? {
2226
2227
  ...e,
2227
2228
  ...r.config
2228
- } : yr(r.config);
2229
+ } : hr(r.config);
2229
2230
  if (!e.enabled)
2230
2231
  return e;
2231
2232
  switch (r.type) {
2232
2233
  case "register":
2233
- return Qt(Pt(e, r.descriptor));
2234
+ return Vt(jt(e, r.descriptor));
2234
2235
  case "unregister":
2235
- return Ht(e, r.traceKey);
2236
+ return Pt(e, r.traceKey);
2236
2237
  case "event":
2237
- return jt(e, r);
2238
+ return Qt(e, r);
2238
2239
  default:
2239
2240
  return e;
2240
2241
  }
2241
2242
  }
2242
- function Pt(e, r) {
2243
- const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = $e(), a = {
2244
- ...t || Vt(r),
2245
- ...hr(r),
2243
+ function jt(e, r) {
2244
+ const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = $e(), d = {
2245
+ ...t || Ut(r),
2246
+ ...vr(r),
2246
2247
  traceKey: r.traceKey,
2247
2248
  latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
2248
2249
  recentEvents: (t == null ? void 0 : t.recentEvents) || [],
@@ -2256,11 +2257,11 @@ function Pt(e, r) {
2256
2257
  order: t ? e.order : [...e.order, r.traceKey],
2257
2258
  entries: {
2258
2259
  ...e.entries,
2259
- [r.traceKey]: a
2260
+ [r.traceKey]: d
2260
2261
  }
2261
2262
  };
2262
2263
  }
2263
- function Ht(e, r) {
2264
+ function Pt(e, r) {
2264
2265
  const t = e.entries[r];
2265
2266
  return t ? {
2266
2267
  ...e,
@@ -2273,7 +2274,7 @@ function Ht(e, r) {
2273
2274
  }
2274
2275
  } : e;
2275
2276
  }
2276
- function jt(e, r) {
2277
+ function Qt(e, r) {
2277
2278
  const t = e.entries[r.traceKey];
2278
2279
  if (!t)
2279
2280
  return e;
@@ -2297,10 +2298,10 @@ function jt(e, r) {
2297
2298
  }
2298
2299
  };
2299
2300
  }
2300
- function Qt(e) {
2301
+ function Vt(e) {
2301
2302
  if (e.order.length <= e.maxQueries)
2302
2303
  return e;
2303
- const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, a) => i.mounted !== a.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - a.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
2304
+ const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, d) => i.mounted !== d.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - d.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
2304
2305
  r.slice(0, t).map((i) => i.traceKey)
2305
2306
  );
2306
2307
  return n.size ? {
@@ -2311,10 +2312,10 @@ function Qt(e) {
2311
2312
  )
2312
2313
  } : e;
2313
2314
  }
2314
- function Vt(e) {
2315
+ function Ut(e) {
2315
2316
  const r = $e();
2316
2317
  return {
2317
- ...hr(e),
2318
+ ...vr(e),
2318
2319
  traceKey: e.traceKey,
2319
2320
  latestAttempt: { status: "idle" },
2320
2321
  recentEvents: [],
@@ -2323,9 +2324,9 @@ function Vt(e) {
2323
2324
  lastEventAt: r
2324
2325
  };
2325
2326
  }
2326
- function hr(e) {
2327
+ function vr(e) {
2327
2328
  var n;
2328
- const r = on(e.spec), t = sn(
2329
+ const r = an(e.spec), t = dn(
2329
2330
  e.spec,
2330
2331
  e.activeInputs
2331
2332
  );
@@ -2339,55 +2340,55 @@ function hr(e) {
2339
2340
  queryLabel: e.queryLabel,
2340
2341
  queryKind: e.queryKind,
2341
2342
  builder: e.builder,
2342
- sourceRefs: nn(e.intent),
2343
+ sourceRefs: sn(e.intent),
2343
2344
  sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
2344
2345
  projectionFieldRefs: r,
2345
2346
  inputFieldRefs: t,
2346
- fieldRefs: an(e.intent),
2347
+ fieldRefs: ln(e.intent),
2347
2348
  inputsApplied: (e.activeInputs || []).map((i) => ({
2348
2349
  inputId: i.inputId,
2349
2350
  fieldRef: i.field,
2350
2351
  operator: i.operator,
2351
- valuePreview: rn(i)
2352
+ valuePreview: nn(i)
2352
2353
  })),
2353
2354
  recentEvents: [],
2354
2355
  clientWarnings: e.clientWarnings
2355
2356
  };
2356
2357
  }
2357
- function ce(e) {
2358
+ function pe(e) {
2358
2359
  const {
2359
2360
  traceKey: r,
2360
2361
  mounted: t,
2361
2362
  registeredAt: n,
2362
2363
  lastEventAt: i,
2363
- ...a
2364
+ ...d
2364
2365
  } = e;
2365
- return a;
2366
+ return d;
2366
2367
  }
2367
- function fe(e) {
2368
+ function ge(e) {
2368
2369
  return e.enabled ? {
2369
2370
  enabled: !0,
2370
- queries: e.order.map((t) => e.entries[t]).filter((t) => !!t).map(ce),
2371
+ queries: e.order.map((t) => e.entries[t]).filter((t) => !!t).map(pe),
2371
2372
  getQuery: (t) => {
2372
2373
  const n = Object.values(e.entries).find(
2373
2374
  (i) => i.queryId === t
2374
2375
  );
2375
- return n ? ce(n) : void 0;
2376
+ return n ? pe(n) : void 0;
2376
2377
  },
2377
- getQueries: (t) => Object.values(e.entries).filter((n) => n.queryId === t).map(ce)
2378
- } : sr;
2378
+ getQueries: (t) => Object.values(e.entries).filter((n) => n.queryId === t).map(pe)
2379
+ } : ar;
2379
2380
  }
2380
- function Ut(e) {
2381
+ function Gt(e) {
2381
2382
  return {
2382
- snapshot: () => Gt(fe(e())),
2383
- getQuery: (r) => Ue(fe(e()).getQuery(r)),
2384
- getQueries: (r) => fe(e()).getQueries(r).map((t) => Ue(t)).filter((t) => !!t)
2383
+ snapshot: () => Jt(ge(e())),
2384
+ getQuery: (r) => Ge(ge(e()).getQuery(r)),
2385
+ getQueries: (r) => ge(e()).getQueries(r).map((t) => Ge(t)).filter((t) => !!t)
2385
2386
  };
2386
2387
  }
2387
- function Gt(e) {
2388
+ function Jt(e) {
2388
2389
  if (!e.enabled)
2389
2390
  return e;
2390
- const r = e.queries.map(vr);
2391
+ const r = e.queries.map(br);
2391
2392
  return {
2392
2393
  enabled: e.enabled,
2393
2394
  queries: r,
@@ -2395,36 +2396,36 @@ function Gt(e) {
2395
2396
  getQueries: (t) => r.filter((n) => n.queryId === t)
2396
2397
  };
2397
2398
  }
2398
- function Ue(e) {
2399
- return e ? vr(e) : void 0;
2399
+ function Ge(e) {
2400
+ return e ? br(e) : void 0;
2400
2401
  }
2401
- function vr(e) {
2402
+ function br(e) {
2402
2403
  var r;
2403
2404
  return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
2404
2405
  ...e,
2405
2406
  latestAttempt: {
2406
2407
  ...e.latestAttempt,
2407
- executionResult: Jt(
2408
+ executionResult: Yt(
2408
2409
  e.latestAttempt.executionResult
2409
2410
  )
2410
2411
  }
2411
2412
  } : e;
2412
2413
  }
2413
- function Jt(e) {
2414
+ function Yt(e) {
2414
2415
  const {
2415
2416
  compiledQuery: r,
2416
2417
  intent: t,
2417
2418
  result: n,
2418
2419
  ...i
2419
- } = e, a = Yt(
2420
+ } = e, d = Xt(
2420
2421
  i.metadata
2421
2422
  );
2422
2423
  return {
2423
2424
  ...i,
2424
- ...a ? { metadata: a } : {}
2425
+ ...d ? { metadata: d } : {}
2425
2426
  };
2426
2427
  }
2427
- function Yt(e) {
2428
+ function Xt(e) {
2428
2429
  if (!e || typeof e != "object" || Array.isArray(e))
2429
2430
  return e;
2430
2431
  const r = e.dataAppDebug;
@@ -2436,49 +2437,49 @@ function Yt(e) {
2436
2437
  dataAppDebug: n
2437
2438
  };
2438
2439
  }
2439
- function Xt(e) {
2440
+ function Zt(e) {
2440
2441
  return e === void 0 || e === !1 ? {
2441
2442
  enabled: !1,
2442
2443
  exposeWindowBridge: !1,
2443
- maxEventsPerQuery: ve,
2444
- maxQueries: be
2444
+ maxEventsPerQuery: be,
2445
+ maxQueries: Se
2445
2446
  } : e === !0 ? {
2446
2447
  enabled: !0,
2447
2448
  exposeWindowBridge: !1,
2448
- maxEventsPerQuery: ve,
2449
- maxQueries: be
2449
+ maxEventsPerQuery: be,
2450
+ maxQueries: Se
2450
2451
  } : {
2451
2452
  enabled: e.enabled !== !1,
2452
2453
  exposeWindowBridge: e.exposeWindowBridge === !0,
2453
2454
  maxEventsPerQuery: Ye(
2454
2455
  e.maxEventsPerQuery,
2455
- ve,
2456
- Hr
2456
+ be,
2457
+ Qr
2457
2458
  ),
2458
2459
  maxQueries: Ye(
2459
2460
  e.maxQueries,
2460
- be,
2461
- jr
2461
+ Se,
2462
+ Vr
2462
2463
  )
2463
2464
  };
2464
2465
  }
2465
- function Ge(e) {
2466
+ function en(e) {
2466
2467
  const t = [
2467
2468
  e == null ? void 0 : e.sourceHint,
2468
2469
  ...(e == null ? void 0 : e.sourceHints) || []
2469
2470
  ].filter((n) => !!n).map((n) => ({
2470
- file: le(n.file),
2471
+ file: ce(n.file),
2471
2472
  line: Je(n.line),
2472
2473
  column: Je(n.column),
2473
- exportName: le(n.exportName),
2474
- component: le(n.component),
2475
- note: le(n.note)
2474
+ exportName: ce(n.exportName),
2475
+ component: ce(n.component),
2476
+ note: ce(n.note)
2476
2477
  })).filter(
2477
2478
  (n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
2478
2479
  );
2479
2480
  return t.length ? t : void 0;
2480
2481
  }
2481
- function le(e) {
2482
+ function ce(e) {
2482
2483
  if (typeof e != "string")
2483
2484
  return;
2484
2485
  const r = e.trim();
@@ -2490,10 +2491,10 @@ function Je(e) {
2490
2491
  function Ye(e, r, t) {
2491
2492
  return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
2492
2493
  }
2493
- function Zt(e) {
2494
+ function rn(e) {
2494
2495
  return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
2495
2496
  }
2496
- function en(e) {
2497
+ function tn(e) {
2497
2498
  switch (e) {
2498
2499
  case "metric":
2499
2500
  return "semaphor.metric";
@@ -2508,14 +2509,14 @@ function en(e) {
2508
2509
  case "sql":
2509
2510
  return "semaphor.sql";
2510
2511
  default:
2511
- return ye(e);
2512
+ return he(e);
2512
2513
  }
2513
2514
  }
2514
- function ye(e) {
2515
+ function he(e) {
2515
2516
  throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
2516
2517
  }
2517
- function rn(e) {
2518
- if (tn(e))
2518
+ function nn(e) {
2519
+ if (on(e))
2519
2520
  return;
2520
2521
  const r = e.value;
2521
2522
  if (r !== void 0) {
@@ -2535,7 +2536,7 @@ function rn(e) {
2535
2536
  function Xe(e) {
2536
2537
  return e.length > 80 ? `${e.slice(0, 77)}...` : e;
2537
2538
  }
2538
- function tn(e) {
2539
+ function on(e) {
2539
2540
  var t;
2540
2541
  const r = [
2541
2542
  e.inputId,
@@ -2546,105 +2547,105 @@ function tn(e) {
2546
2547
  (n) => r.includes(n)
2547
2548
  );
2548
2549
  }
2549
- function nn(e) {
2550
+ function sn(e) {
2550
2551
  const r = /* @__PURE__ */ new Map();
2551
- return pe(e, (t) => {
2552
- dn(t) && r.set(Sr(t), t);
2552
+ return me(e, (t) => {
2553
+ un(t) && r.set(wr(t), t);
2553
2554
  }), [...r.values()];
2554
2555
  }
2555
- function on(e) {
2556
+ function an(e) {
2556
2557
  switch (e.queryKind) {
2557
2558
  case "metric":
2558
2559
  case "analysis":
2559
- return G([
2560
+ return J([
2560
2561
  ...e.measures || [],
2561
2562
  e.primaryMeasure,
2562
2563
  e.dateField,
2563
2564
  ...e.dimensions || []
2564
2565
  ]);
2565
2566
  case "records":
2566
- return G(e.fields || []);
2567
+ return J(e.fields || []);
2567
2568
  case "inputOptions":
2568
- return G([
2569
+ return J([
2569
2570
  e.labelField,
2570
2571
  e.valueField,
2571
2572
  e.searchField,
2572
2573
  ...e.disambiguationFields || []
2573
2574
  ]);
2574
2575
  case "sql":
2575
- return G(e.fields || []);
2576
+ return J(e.fields || []);
2576
2577
  case "matrix":
2577
- return G([
2578
- ...(e.rows || []).map(we),
2579
- ...(e.columns || []).map(we),
2580
- ...(e.values || []).map(we)
2578
+ return J([
2579
+ ...(e.rows || []).map(qe),
2580
+ ...(e.columns || []).map(qe),
2581
+ ...(e.values || []).map(qe)
2581
2582
  ]);
2582
2583
  default:
2583
- return ye(e);
2584
+ return he(e);
2584
2585
  }
2585
2586
  }
2586
- function sn(e, r) {
2587
+ function dn(e, r) {
2587
2588
  const t = [
2588
- ...(e.inputs || []).map(br),
2589
+ ...(e.inputs || []).map(Sr),
2589
2590
  ...(r || []).map((n) => n.field)
2590
2591
  ];
2591
- return G(t);
2592
+ return J(t);
2592
2593
  }
2593
- function G(e) {
2594
+ function J(e) {
2594
2595
  const r = /* @__PURE__ */ new Map();
2595
2596
  return e.forEach((t) => {
2596
- t && te(t) && r.set(Ne(t), t);
2597
+ t && se(t) && r.set(Ne(t), t);
2597
2598
  }), [...r.values()];
2598
2599
  }
2599
- function br(e) {
2600
+ function Sr(e) {
2600
2601
  if (!e || typeof e != "object")
2601
2602
  return;
2602
2603
  const r = e.toAnalyticsInput;
2603
2604
  if (typeof r == "function") {
2604
2605
  const n = r.call(e);
2605
- return br(n);
2606
+ return Sr(n);
2606
2607
  }
2607
2608
  const t = e.field;
2608
- return te(t) ? t : void 0;
2609
+ return se(t) ? t : void 0;
2609
2610
  }
2610
- function we(e) {
2611
- if (te(e))
2611
+ function qe(e) {
2612
+ if (se(e))
2612
2613
  return e;
2613
2614
  if (!e || typeof e != "object")
2614
2615
  return;
2615
2616
  const r = e.field;
2616
- return te(r) ? r : void 0;
2617
+ return se(r) ? r : void 0;
2617
2618
  }
2618
- function an(e) {
2619
+ function ln(e) {
2619
2620
  const r = /* @__PURE__ */ new Map();
2620
- return pe(e, (t) => {
2621
- te(t) && r.set(Ne(t), t);
2621
+ return me(e, (t) => {
2622
+ se(t) && r.set(Ne(t), t);
2622
2623
  }), [...r.values()];
2623
2624
  }
2624
- function pe(e, r) {
2625
+ function me(e, r) {
2625
2626
  if (!(!e || typeof e != "object")) {
2626
2627
  if (r(e), Array.isArray(e)) {
2627
- e.forEach((t) => pe(t, r));
2628
+ e.forEach((t) => me(t, r));
2628
2629
  return;
2629
2630
  }
2630
2631
  Object.values(e).forEach(
2631
- (t) => pe(t, r)
2632
+ (t) => me(t, r)
2632
2633
  );
2633
2634
  }
2634
2635
  }
2635
- function dn(e) {
2636
+ function un(e) {
2636
2637
  if (!e || typeof e != "object")
2637
2638
  return !1;
2638
2639
  const r = e;
2639
2640
  return r.kind === "semantic" ? typeof r.domainId == "string" && typeof r.datasetName == "string" : r.kind === "physical" ? typeof r.connectionId == "string" && typeof r.tableName == "string" : r.kind === "sql" ? typeof r.connectionId == "string" : !1;
2640
2641
  }
2641
- function te(e) {
2642
+ function se(e) {
2642
2643
  if (!e || typeof e != "object")
2643
2644
  return !1;
2644
2645
  const r = e;
2645
2646
  return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
2646
2647
  }
2647
- function Sr(e) {
2648
+ function wr(e) {
2648
2649
  return e.kind === "semantic" ? [
2649
2650
  e.kind,
2650
2651
  e.domainId,
@@ -2662,14 +2663,14 @@ function Ne(e) {
2662
2663
  e.name,
2663
2664
  e.role,
2664
2665
  e.aggregate,
2665
- e.source ? Sr(e.source) : ""
2666
+ e.source ? wr(e.source) : ""
2666
2667
  ].join(":");
2667
2668
  }
2668
- function ln(e) {
2669
+ function cn(e) {
2669
2670
  const r = e;
2670
2671
  return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
2671
2672
  }
2672
- function un(e) {
2673
+ function fn(e) {
2673
2674
  const r = e;
2674
2675
  return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
2675
2676
  }
@@ -2687,13 +2688,13 @@ function xr(e) {
2687
2688
  r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
2688
2689
  return (r >>> 0).toString(36);
2689
2690
  }
2690
- function ue() {
2691
+ function fe() {
2691
2692
  return (/* @__PURE__ */ new Date()).toISOString();
2692
2693
  }
2693
2694
  function $e() {
2694
2695
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
2695
2696
  }
2696
- const cn = [
2697
+ const pn = [
2697
2698
  "records",
2698
2699
  "changes",
2699
2700
  "drivers",
@@ -2701,7 +2702,7 @@ const cn = [
2701
2702
  "largestPositiveChanges",
2702
2703
  "largestNegativeDrivers",
2703
2704
  "largestPositiveDrivers"
2704
- ], fn = [
2705
+ ], gn = [
2705
2706
  "records",
2706
2707
  "changes",
2707
2708
  "drivers",
@@ -2713,7 +2714,7 @@ const cn = [
2713
2714
  function Ir(e) {
2714
2715
  if (!e)
2715
2716
  return {};
2716
- const r = hn(e.executionResult), t = pn(e, r), n = mn(t);
2717
+ const r = bn(e.executionResult), t = mn(e, r), n = hn(t);
2717
2718
  return {
2718
2719
  ...e,
2719
2720
  ...Object.keys(t).length ? { resultSets: t } : {},
@@ -2724,35 +2725,35 @@ function Ir(e) {
2724
2725
  } : {}
2725
2726
  };
2726
2727
  }
2727
- function pn(e, r) {
2728
- const t = gn(e.resultSets);
2729
- for (const i of cn) {
2728
+ function mn(e, r) {
2729
+ const t = yn(e.resultSets);
2730
+ for (const i of pn) {
2730
2731
  if (t[i]) {
2731
- t[i] = wr(t[i]);
2732
+ t[i] = qr(t[i]);
2732
2733
  continue;
2733
2734
  }
2734
- const a = vn(e[i]);
2735
- if (!a.length)
2735
+ const d = Sn(e[i]);
2736
+ if (!d.length)
2736
2737
  continue;
2737
- const l = r.length ? r : bn(a);
2738
+ const l = r.length ? r : wn(d);
2738
2739
  t[i] = {
2739
- records: We(a, l),
2740
+ records: We(d, l),
2740
2741
  columns: l,
2741
- rowCount: a.length
2742
+ rowCount: d.length
2742
2743
  };
2743
2744
  }
2744
- const n = yn(e.executionResult);
2745
+ const n = vn(e.executionResult);
2745
2746
  return n && n.records.length > 0 && !t.records && (t.records = n), t;
2746
2747
  }
2747
- function gn(e) {
2748
+ function yn(e) {
2748
2749
  return Object.fromEntries(
2749
2750
  Object.entries(e || {}).map(([r, t]) => [
2750
2751
  r,
2751
- wr(t)
2752
+ qr(t)
2752
2753
  ])
2753
2754
  );
2754
2755
  }
2755
- function wr(e) {
2756
+ function qr(e) {
2756
2757
  var r;
2757
2758
  return {
2758
2759
  ...e,
@@ -2763,14 +2764,14 @@ function wr(e) {
2763
2764
  rowCount: e.rowCount ?? ((r = e.records) == null ? void 0 : r.length) ?? 0
2764
2765
  };
2765
2766
  }
2766
- function mn(e) {
2767
+ function hn(e) {
2767
2768
  var r;
2768
- for (const t of fn)
2769
+ for (const t of gn)
2769
2770
  if ((r = e[t]) != null && r.records.length)
2770
2771
  return e[t];
2771
2772
  return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
2772
2773
  }
2773
- function yn(e) {
2774
+ function vn(e) {
2774
2775
  const r = e == null ? void 0 : e.result;
2775
2776
  if (!(!r || r.kind !== "records" && r.kind !== "sql"))
2776
2777
  return {
@@ -2779,11 +2780,11 @@ function yn(e) {
2779
2780
  rowCount: r.rowCount ?? r.records.length
2780
2781
  };
2781
2782
  }
2782
- function hn(e) {
2783
+ function bn(e) {
2783
2784
  const r = e == null ? void 0 : e.result;
2784
2785
  return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
2785
2786
  }
2786
- function vn(e) {
2787
+ function Sn(e) {
2787
2788
  return Array.isArray(e) ? e.filter(
2788
2789
  (r) => !!(r && typeof r == "object" && !Array.isArray(r))
2789
2790
  ) : [];
@@ -2791,17 +2792,17 @@ function vn(e) {
2791
2792
  function We(e, r) {
2792
2793
  return r.length ? e.map((t) => {
2793
2794
  const n = {};
2794
- return r.forEach((i, a) => {
2795
- const l = Sn(t, {
2795
+ return r.forEach((i, d) => {
2796
+ const l = xn(t, {
2796
2797
  name: i.key,
2797
2798
  label: i.label,
2798
- fallbackNames: [i.name, Object.keys(t)[a]]
2799
+ fallbackNames: [i.name, Object.keys(t)[d]]
2799
2800
  });
2800
2801
  l !== void 0 && (n[i.key] = l);
2801
2802
  }), Object.keys(n).length ? n : t;
2802
2803
  }) : e;
2803
2804
  }
2804
- function bn(e) {
2805
+ function wn(e) {
2805
2806
  return Array.from(
2806
2807
  new Set(e.flatMap((t) => Object.keys(t)))
2807
2808
  ).map((t) => ({
@@ -2810,7 +2811,7 @@ function bn(e) {
2810
2811
  label: t
2811
2812
  }));
2812
2813
  }
2813
- function Sn(e, r) {
2814
+ function xn(e, r) {
2814
2815
  const t = [
2815
2816
  r.name,
2816
2817
  r.label,
@@ -2820,29 +2821,29 @@ function Sn(e, r) {
2820
2821
  if (Object.prototype.hasOwnProperty.call(e, n))
2821
2822
  return e[n];
2822
2823
  }
2823
- function xn() {
2824
+ function In() {
2824
2825
  return {
2825
- executeAnalysis: (e, r, t) => U(
2826
+ executeAnalysis: (e, r, t) => G(
2826
2827
  e,
2827
2828
  r,
2828
2829
  t ?? {}
2829
2830
  ).then(Ir),
2830
- executeMetric: (e, r) => U(e, r),
2831
- executeRecords: (e, r) => U(e, r),
2832
- executeInputOptions: (e, r) => U(e, r),
2833
- executeSql: (e, r) => U(e, r),
2834
- executeMatrix: (e, r) => U(e, r)
2831
+ executeMetric: (e, r) => G(e, r),
2832
+ executeRecords: (e, r) => G(e, r),
2833
+ executeInputOptions: (e, r) => G(e, r),
2834
+ executeSql: (e, r) => G(e, r),
2835
+ executeMatrix: (e, r) => G(e, r)
2835
2836
  };
2836
2837
  }
2837
- async function U(e, r, t) {
2838
+ async function G(e, r, t) {
2838
2839
  if (!r.token)
2839
2840
  throw new Error(
2840
2841
  "SemaphorDataAppProvider needs a token to execute queries."
2841
2842
  );
2842
- const n = kn(r), i = qn(e, n);
2843
- let a;
2843
+ const n = Dn(r), i = An(e, n);
2844
+ let d;
2844
2845
  try {
2845
- a = await fetch(n, {
2846
+ d = await fetch(n, {
2846
2847
  method: "POST",
2847
2848
  headers: {
2848
2849
  "Content-Type": "application/json",
@@ -2853,7 +2854,7 @@ async function U(e, r, t) {
2853
2854
  activeInputs: r.activeInputs,
2854
2855
  ...t ? { analysisOptions: t } : {},
2855
2856
  resultShape: e.kind,
2856
- ...wn(r) ? { debug: { responseDetail: "debug" } } : {}
2857
+ ...Rn(r) ? { debug: { responseDetail: "debug" } } : {}
2857
2858
  })
2858
2859
  });
2859
2860
  } catch (c) {
@@ -2861,32 +2862,32 @@ async function U(e, r, t) {
2861
2862
  `${i}: ${c instanceof Error ? c.message : String(c)}`
2862
2863
  );
2863
2864
  }
2864
- const l = await Tn(a);
2865
- if (!a.ok || l.error)
2866
- throw In(
2867
- `${i}: ${l.error || `Semaphor Data App execution failed with status ${a.status}.`}`,
2865
+ const l = await kn(d);
2866
+ if (!d.ok || l.error)
2867
+ throw qn(
2868
+ `${i}: ${l.error || `Semaphor Data App execution failed with status ${d.status}.`}`,
2868
2869
  l
2869
2870
  );
2870
2871
  return l;
2871
2872
  }
2872
- function In(e, r) {
2873
+ function qn(e, r) {
2873
2874
  const t = new Error(e);
2874
2875
  return r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), t;
2875
2876
  }
2876
- function wn(e) {
2877
+ function Rn(e) {
2877
2878
  const r = e.debug;
2878
2879
  return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
2879
2880
  }
2880
- function qn(e, r) {
2881
+ function An(e, r) {
2881
2882
  return [
2882
2883
  `Semaphor ${e.kind} query`,
2883
2884
  e.id ? `id=${e.id}` : void 0,
2884
2885
  e.label ? `label=${e.label}` : void 0,
2885
- Rn(e),
2886
- `endpoint=${An(r)}`
2886
+ En(e),
2887
+ `endpoint=${Tn(r)}`
2887
2888
  ].filter((t) => !!t).join(" ");
2888
2889
  }
2889
- function Rn(e) {
2890
+ function En(e) {
2890
2891
  const r = "source" in e ? e.source : void 0;
2891
2892
  if (!(!r || typeof r != "object")) {
2892
2893
  if (r.kind === "semantic")
@@ -2905,7 +2906,7 @@ function Rn(e) {
2905
2906
  return r.connectionId ? `source=${r.connectionId}` : void 0;
2906
2907
  }
2907
2908
  }
2908
- function An(e) {
2909
+ function Tn(e) {
2909
2910
  if (!e)
2910
2911
  return "/api/v1/data-app/execute";
2911
2912
  try {
@@ -2914,7 +2915,7 @@ function An(e) {
2914
2915
  return e;
2915
2916
  }
2916
2917
  }
2917
- async function Tn(e) {
2918
+ async function kn(e) {
2918
2919
  const r = await e.text().catch(() => "");
2919
2920
  if (!r.trim())
2920
2921
  return e.ok ? {
@@ -2927,43 +2928,43 @@ async function Tn(e) {
2927
2928
  error: "Semaphor Data App execution returned invalid JSON.",
2928
2929
  details: r
2929
2930
  } : {
2930
- error: En(e, r),
2931
+ error: Cn(e, r),
2931
2932
  details: r
2932
2933
  };
2933
2934
  }
2934
2935
  }
2935
- function En(e, r) {
2936
+ function Cn(e, r) {
2936
2937
  const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
2937
2938
  return n ? `Semaphor Data App execution failed with status ${e.status}${t}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${e.status}${t}.`;
2938
2939
  }
2939
- function kn(e) {
2940
- const r = Cn(e).replace(/\/+$/, "");
2940
+ function Dn(e) {
2941
+ const r = Ln(e).replace(/\/+$/, "");
2941
2942
  return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
2942
2943
  }
2943
- function Cn(e) {
2944
+ function Ln(e) {
2944
2945
  if (e.apiBaseUrl)
2945
2946
  return e.apiBaseUrl;
2946
2947
  if (!e.token)
2947
2948
  return "";
2948
2949
  try {
2949
- return Mr(e.token).apiServiceUrl || "";
2950
+ return jr(e.token).apiServiceUrl || "";
2950
2951
  } catch {
2951
2952
  return "";
2952
2953
  }
2953
2954
  }
2954
- const qr = ge({});
2955
- function Ln() {
2955
+ const Rr = ye({});
2956
+ function On() {
2956
2957
  if (!(typeof window > "u"))
2957
2958
  return window.__SEMAPHOR_DATA_APP_RUNTIME__;
2958
2959
  }
2959
- function Dn() {
2960
- return H(qr);
2960
+ function Bn() {
2961
+ return Q(Rr);
2961
2962
  }
2962
- const qe = { value: null }, Re = {}, On = { records: [] }, Ae = { options: [] }, Bn = { records: [] }, Te = {};
2963
- function Kn(e) {
2964
- const r = J(e.inputs), t = Or(e);
2963
+ const Re = { value: null }, Ae = {}, Kn = { records: [] }, Ee = { options: [] }, Nn = { records: [] }, Te = {};
2964
+ function $n(e) {
2965
+ const r = Y(e.inputs), t = Br(e);
2965
2966
  try {
2966
- const n = Br(e), i = Y(n);
2967
+ const n = Kr(e), i = X(n);
2967
2968
  return i ? {
2968
2969
  error: i,
2969
2970
  activeInputs: r,
@@ -2974,14 +2975,14 @@ function Kn(e) {
2974
2975
  i,
2975
2976
  t
2976
2977
  ),
2977
- idleData: Re
2978
+ idleData: Ae
2978
2979
  } : {
2979
2980
  intent: n,
2980
2981
  error: null,
2981
2982
  activeInputs: r,
2982
2983
  analysisOptions: t,
2983
2984
  queryKey: q(n, r, void 0, t),
2984
- idleData: Re
2985
+ idleData: Ae
2985
2986
  };
2986
2987
  } catch (n) {
2987
2988
  const i = _(n);
@@ -2995,25 +2996,25 @@ function Kn(e) {
2995
2996
  i,
2996
2997
  t
2997
2998
  ),
2998
- idleData: Re
2999
+ idleData: Ae
2999
3000
  };
3000
3001
  }
3001
3002
  }
3002
- function Nn(e) {
3003
- const r = J(e.inputs);
3003
+ function Wn(e) {
3004
+ const r = Y(e.inputs);
3004
3005
  try {
3005
- const t = Kr(e), n = Y(t);
3006
+ const t = Nr(e), n = X(t);
3006
3007
  return n ? {
3007
3008
  error: n,
3008
3009
  activeInputs: r,
3009
3010
  queryKey: q(void 0, r, n),
3010
- idleData: qe
3011
+ idleData: Re
3011
3012
  } : {
3012
3013
  intent: t,
3013
3014
  error: null,
3014
3015
  activeInputs: r,
3015
3016
  queryKey: q(t, r),
3016
- idleData: qe
3017
+ idleData: Re
3017
3018
  };
3018
3019
  } catch (t) {
3019
3020
  const n = _(t);
@@ -3021,14 +3022,14 @@ function Nn(e) {
3021
3022
  error: n,
3022
3023
  activeInputs: r,
3023
3024
  queryKey: q(void 0, r, n),
3024
- idleData: qe
3025
+ idleData: Re
3025
3026
  };
3026
3027
  }
3027
3028
  }
3028
- function $n(e) {
3029
- const r = J(e.inputs), t = On;
3029
+ function Fn(e) {
3030
+ const r = Y(e.inputs), t = Kn;
3030
3031
  try {
3031
- const n = Dr(e), i = Y(n);
3032
+ const n = Or(e), i = X(n);
3032
3033
  return i ? {
3033
3034
  error: i,
3034
3035
  activeInputs: r,
@@ -3051,21 +3052,21 @@ function $n(e) {
3051
3052
  };
3052
3053
  }
3053
3054
  }
3054
- function Wn(e) {
3055
- const r = J(e.inputs);
3055
+ function _n(e) {
3056
+ const r = Y(e.inputs);
3056
3057
  try {
3057
- const t = Lr(e), n = Y(t);
3058
+ const t = Lr(e), n = X(t);
3058
3059
  return n ? {
3059
3060
  error: n,
3060
3061
  activeInputs: r,
3061
3062
  queryKey: q(void 0, r, n),
3062
- idleData: Ae
3063
+ idleData: Ee
3063
3064
  } : {
3064
3065
  intent: t,
3065
3066
  error: null,
3066
3067
  activeInputs: r,
3067
3068
  queryKey: q(t, r),
3068
- idleData: Ae
3069
+ idleData: Ee
3069
3070
  };
3070
3071
  } catch (t) {
3071
3072
  const n = _(t);
@@ -3073,14 +3074,14 @@ function Wn(e) {
3073
3074
  error: n,
3074
3075
  activeInputs: r,
3075
3076
  queryKey: q(void 0, r, n),
3076
- idleData: Ae
3077
+ idleData: Ee
3077
3078
  };
3078
3079
  }
3079
3080
  }
3080
- function Fn(e) {
3081
- const r = J(e.inputs), t = Bn;
3081
+ function zn(e) {
3082
+ const r = Y(e.inputs), t = Nn;
3082
3083
  try {
3083
- const n = Cr(e), i = Y(n);
3084
+ const n = Dr(e), i = X(n);
3084
3085
  return i ? {
3085
3086
  error: i,
3086
3087
  activeInputs: r,
@@ -3103,10 +3104,10 @@ function Fn(e) {
3103
3104
  };
3104
3105
  }
3105
3106
  }
3106
- function _n(e) {
3107
- const r = J(e.inputs);
3107
+ function Hn(e) {
3108
+ const r = Y(e.inputs);
3108
3109
  try {
3109
- const t = kr(e), n = Y(t);
3110
+ const t = Cr(e), n = X(t);
3110
3111
  return n ? {
3111
3112
  error: n,
3112
3113
  activeInputs: r,
@@ -3132,7 +3133,7 @@ function _n(e) {
3132
3133
  function _(e) {
3133
3134
  return e instanceof Error ? e : new Error(String(e));
3134
3135
  }
3135
- function Y(e) {
3136
+ function X(e) {
3136
3137
  const r = Pr(e);
3137
3138
  if (r.ok)
3138
3139
  return null;
@@ -3149,19 +3150,19 @@ function q(e, r, t, n) {
3149
3150
  error: t == null ? void 0 : t.message
3150
3151
  });
3151
3152
  }
3152
- function ii(e) {
3153
- const [r, t] = j(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, a = v(
3153
+ function si(e) {
3154
+ const [r, t] = V(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, d = b(
3154
3155
  () => nr(e.options),
3155
3156
  [e.options]
3156
- ), l = D(
3157
+ ), l = O(
3157
3158
  (u) => {
3158
3159
  var m;
3159
3160
  const f = u;
3160
3161
  (m = e.onValueChange) == null || m.call(e, f), n || t(f);
3161
3162
  },
3162
3163
  [n, e]
3163
- ), c = D(() => l(void 0), [l]);
3164
- return v(() => {
3164
+ ), c = O(() => l(void 0), [l]);
3165
+ return b(() => {
3165
3166
  const u = ir(e);
3166
3167
  return {
3167
3168
  id: e.id,
@@ -3172,8 +3173,8 @@ function ii(e) {
3172
3173
  relationshipHint: u.relationshipHint,
3173
3174
  controlRole: e.kind === "control" ? e.role : void 0,
3174
3175
  value: i,
3175
- options: a,
3176
- isActive: re(i),
3176
+ options: d,
3177
+ isActive: oe(i),
3177
3178
  setValue: l,
3178
3179
  clear: c,
3179
3180
  toAnalyticsInput: () => ({
@@ -3182,29 +3183,29 @@ function ii(e) {
3182
3183
  kind: e.kind,
3183
3184
  label: e.label,
3184
3185
  value: i,
3185
- isActive: re(i),
3186
+ isActive: oe(i),
3186
3187
  operator: u.operator,
3187
3188
  relationshipHint: u.relationshipHint,
3188
3189
  controlRole: e.kind === "control" ? e.role : void 0
3189
3190
  })
3190
3191
  };
3191
- }, [c, a, l, e, i]);
3192
+ }, [c, d, l, e, i]);
3192
3193
  }
3193
- function oi(e) {
3194
- const [r, t] = j(() => Hn(e));
3195
- return B(() => {
3194
+ function ai(e) {
3195
+ const [r, t] = V(() => Qn(e));
3196
+ return K(() => {
3196
3197
  t((n) => {
3197
3198
  let i = n;
3198
- for (const a of e)
3199
- !Object.prototype.hasOwnProperty.call(i, a.id) && a.defaultValue !== void 0 && (i = { ...i, [a.id]: a.defaultValue });
3199
+ for (const d of e)
3200
+ !Object.prototype.hasOwnProperty.call(i, d.id) && d.defaultValue !== void 0 && (i = { ...i, [d.id]: d.defaultValue });
3200
3201
  return i;
3201
3202
  });
3202
- }, [e]), v(
3203
+ }, [e]), b(
3203
3204
  () => e.map((n) => {
3204
3205
  const i = Object.prototype.hasOwnProperty.call(
3205
3206
  n,
3206
3207
  "value"
3207
- ), a = i ? n.value : r[n.id], l = nr(n.options), c = (m) => {
3208
+ ), d = i ? n.value : r[n.id], l = nr(n.options), c = (m) => {
3208
3209
  var y;
3209
3210
  (y = n.onValueChange) == null || y.call(n, m), i || t((h) => ({
3210
3211
  ...h,
@@ -3219,9 +3220,9 @@ function oi(e) {
3219
3220
  operator: f.operator,
3220
3221
  relationshipHint: f.relationshipHint,
3221
3222
  controlRole: n.kind === "control" ? n.role : void 0,
3222
- value: a,
3223
+ value: d,
3223
3224
  options: l,
3224
- isActive: re(a),
3225
+ isActive: oe(d),
3225
3226
  setValue: c,
3226
3227
  clear: u,
3227
3228
  toAnalyticsInput: () => ({
@@ -3229,8 +3230,8 @@ function oi(e) {
3229
3230
  field: f.field,
3230
3231
  kind: n.kind,
3231
3232
  label: n.label,
3232
- value: a,
3233
- isActive: re(a),
3233
+ value: d,
3234
+ isActive: oe(d),
3234
3235
  operator: f.operator,
3235
3236
  relationshipHint: f.relationshipHint,
3236
3237
  controlRole: n.kind === "control" ? n.role : void 0
@@ -3240,14 +3241,14 @@ function oi(e) {
3240
3241
  [e, r]
3241
3242
  );
3242
3243
  }
3243
- function si(e, r) {
3244
- const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = v(() => Mn(t), [t]);
3245
- B(() => {
3246
- zn(e.value, t) || e.clear();
3244
+ function di(e, r) {
3245
+ const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = b(() => jn(t), [t]);
3246
+ K(() => {
3247
+ Mn(e.value, t) || e.clear();
3247
3248
  }, [e, n, r == null ? void 0 : r.status, t]);
3248
3249
  }
3249
- function zn(e, r) {
3250
- if (!re(e) || r === void 0)
3250
+ function Mn(e, r) {
3251
+ if (!oe(e) || r === void 0)
3251
3252
  return !0;
3252
3253
  const t = new Set(
3253
3254
  r.map((i) => rr(i.value))
@@ -3256,62 +3257,62 @@ function zn(e, r) {
3256
3257
  (i) => t.has(rr(i))
3257
3258
  );
3258
3259
  }
3259
- function Mn(e) {
3260
+ function jn(e) {
3260
3261
  return JSON.stringify((e || []).map((r) => r.value));
3261
3262
  }
3262
3263
  function rr(e) {
3263
3264
  return `${typeof e}:${String(e)}`;
3264
3265
  }
3265
- function ai(e, r = {}) {
3266
- const t = v(
3266
+ function li(e, r = {}) {
3267
+ const t = b(
3267
3268
  () => r.inputs ? {
3268
3269
  ...e,
3269
3270
  inputs: r.inputs
3270
3271
  } : e,
3271
3272
  [r.inputs, e]
3272
- ), n = v(() => {
3273
+ ), n = b(() => {
3273
3274
  switch (t.queryKind) {
3274
3275
  case "metric":
3275
3276
  return {
3276
3277
  queryKind: t.queryKind,
3277
- request: Nn(t)
3278
+ request: Wn(t)
3278
3279
  };
3279
3280
  case "analysis":
3280
3281
  return {
3281
3282
  queryKind: t.queryKind,
3282
- request: Kn(t)
3283
+ request: $n(t)
3283
3284
  };
3284
3285
  case "records":
3285
3286
  return {
3286
3287
  queryKind: t.queryKind,
3287
- request: $n(t)
3288
+ request: Fn(t)
3288
3289
  };
3289
3290
  case "inputOptions":
3290
3291
  return {
3291
3292
  queryKind: t.queryKind,
3292
- request: Wn(t)
3293
+ request: _n(t)
3293
3294
  };
3294
3295
  case "sql":
3295
3296
  return {
3296
3297
  queryKind: t.queryKind,
3297
- request: Fn(t)
3298
+ request: zn(t)
3298
3299
  };
3299
3300
  case "matrix":
3300
3301
  return {
3301
3302
  queryKind: t.queryKind,
3302
- request: _n(t)
3303
+ request: Hn(t)
3303
3304
  };
3304
3305
  default:
3305
- return Ee(t);
3306
+ return ke(t);
3306
3307
  }
3307
- }, [t]), i = Jr({
3308
+ }, [t]), i = Xr({
3308
3309
  spec: t,
3309
3310
  queryKind: n.queryKind,
3310
3311
  queryKey: n.request.queryKey,
3311
3312
  intent: n.request.intent,
3312
3313
  activeInputs: n.request.activeInputs,
3313
3314
  debug: r.debug
3314
- }), a = L(null), l = v(
3315
+ }), d = D(null), l = b(
3315
3316
  () => ({
3316
3317
  start: i.start,
3317
3318
  success: i.success,
@@ -3324,48 +3325,48 @@ function ai(e, r = {}) {
3324
3325
  i.start,
3325
3326
  i.success
3326
3327
  ]
3327
- ), c = D(
3328
- (d) => {
3329
- var N, C, b, I, k, A, R, w, K;
3328
+ ), c = O(
3329
+ (a) => {
3330
+ var C, L, B, v, w, A, I, E, z;
3330
3331
  const x = n.request;
3331
3332
  if (x.intent)
3332
3333
  switch (n.queryKind) {
3333
3334
  case "metric":
3334
- return (N = d.executor) == null ? void 0 : N.executeMetric(
3335
+ return (C = a.executor) == null ? void 0 : C.executeMetric(
3335
3336
  x.intent,
3336
- d
3337
+ a
3337
3338
  );
3338
3339
  case "analysis":
3339
- return (b = (C = d.executor) == null ? void 0 : C.executeAnalysis) == null ? void 0 : b.call(
3340
- C,
3340
+ return (B = (L = a.executor) == null ? void 0 : L.executeAnalysis) == null ? void 0 : B.call(
3341
+ L,
3341
3342
  x.intent,
3342
- d,
3343
+ a,
3343
3344
  x.analysisOptions
3344
3345
  );
3345
3346
  case "records":
3346
- return (I = d.executor) == null ? void 0 : I.executeRecords(
3347
+ return (v = a.executor) == null ? void 0 : v.executeRecords(
3347
3348
  x.intent,
3348
- d
3349
+ a
3349
3350
  );
3350
3351
  case "inputOptions":
3351
- return (k = d.executor) == null ? void 0 : k.executeInputOptions(
3352
+ return (w = a.executor) == null ? void 0 : w.executeInputOptions(
3352
3353
  x.intent,
3353
- d
3354
+ a
3354
3355
  );
3355
3356
  case "sql":
3356
- return (R = (A = d.executor) == null ? void 0 : A.executeSql) == null ? void 0 : R.call(
3357
+ return (I = (A = a.executor) == null ? void 0 : A.executeSql) == null ? void 0 : I.call(
3357
3358
  A,
3358
3359
  x.intent,
3359
- d
3360
+ a
3360
3361
  );
3361
3362
  case "matrix":
3362
- return (K = (w = d.executor) == null ? void 0 : w.executeMatrix) == null ? void 0 : K.call(
3363
- w,
3363
+ return (z = (E = a.executor) == null ? void 0 : E.executeMatrix) == null ? void 0 : z.call(
3364
+ E,
3364
3365
  x.intent,
3365
- d
3366
+ a
3366
3367
  );
3367
3368
  default:
3368
- return Ee(n);
3369
+ return ke(n);
3369
3370
  }
3370
3371
  },
3371
3372
  [n]
@@ -3376,129 +3377,129 @@ function ai(e, r = {}) {
3376
3377
  n.request.activeInputs,
3377
3378
  l
3378
3379
  ), f = i.queryId, m = i.validationFailure;
3379
- B(() => {
3380
- const d = n.request.error;
3381
- if (!d) {
3382
- a.current = null;
3380
+ K(() => {
3381
+ const a = n.request.error;
3382
+ if (!a) {
3383
+ d.current = null;
3383
3384
  return;
3384
3385
  }
3385
- const x = `${f}:${d.message}`;
3386
- a.current !== x && (a.current = x, m(d));
3386
+ const x = `${f}:${a.message}`;
3387
+ d.current !== x && (d.current = x, m(a));
3387
3388
  }, [
3388
3389
  n.request.error,
3389
3390
  n.request.queryKey,
3390
3391
  f,
3391
3392
  m
3392
3393
  ]);
3393
- const y = n.request.error ? n.request.idleData : u.data, h = n.request.error ? "error" : u.status, g = !n.request.error && u.status === "loading", S = n.request.error || u.error, E = i.trace;
3394
+ const y = n.request.error ? n.request.idleData : u.data, h = n.request.error ? "error" : u.status, g = !n.request.error && u.status === "loading", S = n.request.error || u.error, k = i.trace;
3394
3395
  switch (n.queryKind) {
3395
3396
  case "metric": {
3396
- const d = y;
3397
+ const a = y;
3397
3398
  return {
3398
3399
  id: t.id,
3399
3400
  intent: n.request.intent,
3400
- value: (d == null ? void 0 : d.value) ?? null,
3401
- measures: d == null ? void 0 : d.measures,
3402
- comparisonValue: d == null ? void 0 : d.comparisonValue,
3403
- delta: d == null ? void 0 : d.delta,
3404
- deltaPercent: d == null ? void 0 : d.deltaPercent,
3405
- records: d == null ? void 0 : d.records,
3406
- executionResult: d == null ? void 0 : d.executionResult,
3401
+ value: (a == null ? void 0 : a.value) ?? null,
3402
+ measures: a == null ? void 0 : a.measures,
3403
+ comparisonValue: a == null ? void 0 : a.comparisonValue,
3404
+ delta: a == null ? void 0 : a.delta,
3405
+ deltaPercent: a == null ? void 0 : a.deltaPercent,
3406
+ records: a == null ? void 0 : a.records,
3407
+ executionResult: a == null ? void 0 : a.executionResult,
3407
3408
  status: h,
3408
3409
  isLoading: g,
3409
3410
  error: S,
3410
- trace: E
3411
+ trace: k
3411
3412
  };
3412
3413
  }
3413
3414
  case "analysis": {
3414
- const d = Ir(y);
3415
+ const a = Ir(y);
3415
3416
  return {
3416
3417
  id: t.id,
3417
3418
  intent: n.request.intent,
3418
- ...d || {},
3419
+ ...a || {},
3419
3420
  status: h,
3420
3421
  isLoading: g,
3421
3422
  error: S,
3422
- trace: E
3423
+ trace: k
3423
3424
  };
3424
3425
  }
3425
3426
  case "records": {
3426
- const d = y;
3427
+ const a = y;
3427
3428
  return {
3428
3429
  id: t.id,
3429
3430
  intent: n.request.intent,
3430
- records: (d == null ? void 0 : d.records) || [],
3431
- columns: d == null ? void 0 : d.columns,
3432
- rowCount: d == null ? void 0 : d.rowCount,
3433
- pagination: d == null ? void 0 : d.pagination,
3434
- executionResult: d == null ? void 0 : d.executionResult,
3431
+ records: (a == null ? void 0 : a.records) || [],
3432
+ columns: a == null ? void 0 : a.columns,
3433
+ rowCount: a == null ? void 0 : a.rowCount,
3434
+ pagination: a == null ? void 0 : a.pagination,
3435
+ executionResult: a == null ? void 0 : a.executionResult,
3435
3436
  status: h,
3436
3437
  isLoading: g,
3437
3438
  error: S,
3438
- trace: E
3439
+ trace: k
3439
3440
  };
3440
3441
  }
3441
3442
  case "inputOptions": {
3442
- const d = y;
3443
+ const a = y;
3443
3444
  return {
3444
3445
  id: t.id,
3445
3446
  intent: n.request.intent,
3446
- options: (d == null ? void 0 : d.options) || [],
3447
- executionResult: d == null ? void 0 : d.executionResult,
3447
+ options: (a == null ? void 0 : a.options) || [],
3448
+ executionResult: a == null ? void 0 : a.executionResult,
3448
3449
  status: h,
3449
3450
  isLoading: g,
3450
3451
  error: S,
3451
- trace: E
3452
+ trace: k
3452
3453
  };
3453
3454
  }
3454
3455
  case "sql": {
3455
- const d = y;
3456
+ const a = y;
3456
3457
  return {
3457
3458
  id: t.id,
3458
3459
  intent: n.request.intent,
3459
- records: (d == null ? void 0 : d.records) || [],
3460
- columns: d == null ? void 0 : d.columns,
3461
- rowCount: d == null ? void 0 : d.rowCount,
3462
- pagination: d == null ? void 0 : d.pagination,
3463
- output: d == null ? void 0 : d.output,
3464
- rowLimitExceeded: d == null ? void 0 : d.rowLimitExceeded,
3465
- executionResult: d == null ? void 0 : d.executionResult,
3460
+ records: (a == null ? void 0 : a.records) || [],
3461
+ columns: a == null ? void 0 : a.columns,
3462
+ rowCount: a == null ? void 0 : a.rowCount,
3463
+ pagination: a == null ? void 0 : a.pagination,
3464
+ output: a == null ? void 0 : a.output,
3465
+ rowLimitExceeded: a == null ? void 0 : a.rowLimitExceeded,
3466
+ executionResult: a == null ? void 0 : a.executionResult,
3466
3467
  status: h,
3467
3468
  isLoading: g,
3468
3469
  error: S,
3469
- trace: E
3470
+ trace: k
3470
3471
  };
3471
3472
  }
3472
3473
  case "matrix": {
3473
- const d = y;
3474
+ const a = y;
3474
3475
  return {
3475
3476
  id: t.id,
3476
3477
  intent: n.request.intent,
3477
- matrixResult: d == null ? void 0 : d.matrixResult,
3478
- grid: d == null ? void 0 : d.grid,
3479
- expansion: d == null ? void 0 : d.expansion,
3480
- executionResult: d == null ? void 0 : d.executionResult,
3478
+ matrixResult: a == null ? void 0 : a.matrixResult,
3479
+ grid: a == null ? void 0 : a.grid,
3480
+ expansion: a == null ? void 0 : a.expansion,
3481
+ executionResult: a == null ? void 0 : a.executionResult,
3481
3482
  status: h,
3482
3483
  isLoading: g,
3483
3484
  error: S,
3484
- trace: E
3485
+ trace: k
3485
3486
  };
3486
3487
  }
3487
3488
  default:
3488
- return Ee(n);
3489
+ return ke(n);
3489
3490
  }
3490
3491
  }
3491
3492
  function Pn(e, r, t, n, i) {
3492
- const a = Dn(), l = L(r), c = L(n), [u, f] = j({
3493
+ const d = Bn(), l = D(r), c = D(n), [u, f] = V({
3493
3494
  status: "idle",
3494
3495
  data: t,
3495
3496
  error: null
3496
3497
  });
3497
- return l.current = r, c.current = n, B(() => {
3498
+ return l.current = r, c.current = n, K(() => {
3498
3499
  let m;
3499
3500
  try {
3500
3501
  m = l.current({
3501
- ...a,
3502
+ ...d,
3502
3503
  activeInputs: c.current
3503
3504
  });
3504
3505
  } catch (g) {
@@ -3514,7 +3515,7 @@ function Pn(e, r, t, n, i) {
3514
3515
  return;
3515
3516
  }
3516
3517
  let y = !1;
3517
- const h = Rr();
3518
+ const h = Ar();
3518
3519
  return i == null || i.start(), f((g) => ({
3519
3520
  status: "loading",
3520
3521
  data: g.data,
@@ -3530,26 +3531,26 @@ function Pn(e, r, t, n, i) {
3530
3531
  }), () => {
3531
3532
  y = !0;
3532
3533
  };
3533
- }, [t, e, a, i]), u;
3534
+ }, [t, e, d, i]), u;
3534
3535
  }
3535
- function Rr() {
3536
+ function Ar() {
3536
3537
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
3537
3538
  }
3538
3539
  function tr(e) {
3539
- return Math.max(0, Math.round(Rr() - e));
3540
+ return Math.max(0, Math.round(Ar() - e));
3540
3541
  }
3541
- function Hn(e) {
3542
+ function Qn(e) {
3542
3543
  return Object.fromEntries(
3543
3544
  e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
3544
3545
  );
3545
3546
  }
3546
- function Ee(e) {
3547
+ function ke(e) {
3547
3548
  throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
3548
3549
  }
3549
- function jn(e) {
3550
+ function Vn(e) {
3550
3551
  return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
3551
3552
  }
3552
- function di({
3553
+ function ui({
3553
3554
  token: e,
3554
3555
  apiBaseUrl: r,
3555
3556
  executor: t,
@@ -3557,7 +3558,7 @@ function di({
3557
3558
  children: i
3558
3559
  }) {
3559
3560
  var g;
3560
- const a = Ln(), l = ((g = a == null ? void 0 : a.authToken) == null ? void 0 : g.accessToken) || e, c = (a == null ? void 0 : a.dataApiBaseUrl) || (a == null ? void 0 : a.apiBaseUrl) || r, u = (a == null ? void 0 : a.debug) ?? n, f = jn(u), m = v(() => xn(), []), y = t || m, h = v(
3561
+ const d = On(), l = ((g = d == null ? void 0 : d.authToken) == null ? void 0 : g.accessToken) || e, c = (d == null ? void 0 : d.dataApiBaseUrl) || (d == null ? void 0 : d.apiBaseUrl) || r, u = (d == null ? void 0 : d.debug) ?? n, f = Vn(u), m = b(() => In(), []), y = t || m, h = b(
3561
3562
  () => ({
3562
3563
  token: l,
3563
3564
  apiBaseUrl: c,
@@ -3566,24 +3567,24 @@ function di({
3566
3567
  }),
3567
3568
  [c, u, y, l]
3568
3569
  );
3569
- return /* @__PURE__ */ o(Qr, { debug: u, children: /* @__PURE__ */ p(qr.Provider, { value: h, children: [
3570
+ return /* @__PURE__ */ o(Ur, { debug: u, children: /* @__PURE__ */ p(Rr.Provider, { value: h, children: [
3570
3571
  i,
3571
- f ? /* @__PURE__ */ o(Gr, { ...f }) : null
3572
+ f ? /* @__PURE__ */ o(Yr, { ...f }) : null
3572
3573
  ] }) });
3573
3574
  }
3574
3575
  export {
3575
- di as SemaphorDataAppProvider,
3576
- Gr as SemaphorDevtools,
3577
- ni as SemaphorDevtoolsInspectButton,
3578
- ti as SemaphorViewBoundary,
3579
- xn as createSemaphorQueryExecutor,
3580
- Zn as defineSemaphorDataApp,
3581
- ei as defineSemaphorInput,
3582
- zn as isSemaphorInputValueValidForOptions,
3583
- ri as semaphor,
3584
- si as useClearInvalidSemaphorInputValue,
3585
- dr as useSemaphorDevtools,
3586
- ii as useSemaphorInput,
3587
- oi as useSemaphorInputs,
3588
- ai as useSemaphorQuery
3576
+ ui as SemaphorDataAppProvider,
3577
+ Yr as SemaphorDevtools,
3578
+ oi as SemaphorDevtoolsInspectButton,
3579
+ ii as SemaphorViewBoundary,
3580
+ In as createSemaphorQueryExecutor,
3581
+ ri as defineSemaphorDataApp,
3582
+ ti as defineSemaphorInput,
3583
+ Mn as isSemaphorInputValueValidForOptions,
3584
+ ni as semaphor,
3585
+ di as useClearInvalidSemaphorInputValue,
3586
+ lr as useSemaphorDevtools,
3587
+ si as useSemaphorInput,
3588
+ ai as useSemaphorInputs,
3589
+ li as useSemaphorQuery
3589
3590
  };