react-semaphor 0.1.420 → 0.1.421

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.
Files changed (57) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +28 -27
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/chunks/analyze-result-contract-B5Eeu7vD.js +1 -0
  6. package/dist/chunks/analyze-result-contract-sWcmvBOA.js +2070 -0
  7. package/dist/chunks/{calendar-preferences-dialog-f0Z7Kf-U.js → calendar-preferences-dialog-CscmhyuZ.js} +1 -1
  8. package/dist/chunks/{calendar-preferences-dialog-DIfAbE_y.js → calendar-preferences-dialog-cN3_2C-u.js} +3 -3
  9. package/dist/chunks/{dashboard-briefing-launcher-anh-Jy5v.js → dashboard-briefing-launcher-BYTBNetR.js} +4 -4
  10. package/dist/chunks/{dashboard-briefing-launcher-C3tNkGFG.js → dashboard-briefing-launcher-DmZkzIC3.js} +1 -1
  11. package/dist/chunks/{dashboard-controls-DQxlOxzy.js → dashboard-controls-9DFeKIP4.js} +1 -1
  12. package/dist/chunks/{dashboard-controls-8dCQaPaq.js → dashboard-controls-PhzuaTBj.js} +5 -5
  13. package/dist/chunks/{dashboard-json-i7Ae9KGD.js → dashboard-json-Cxhw2TZc.js} +3 -3
  14. package/dist/chunks/{dashboard-json-B309EInF.js → dashboard-json-DyRHI3mL.js} +1 -1
  15. package/dist/chunks/{edit-dashboard-visual-4HycwBHR.js → edit-dashboard-visual-3_jiBXsu.js} +1 -1
  16. package/dist/chunks/{edit-dashboard-visual-z3IqzYnj.js → edit-dashboard-visual-BigSJ3-x.js} +4 -4
  17. package/dist/chunks/{index-yxKWKFdr.js → index-BKDQw0aK.js} +2 -2
  18. package/dist/chunks/{index-B6DLEXRX.js → index-CH2ZzQo4.js} +5 -5
  19. package/dist/chunks/{switch-D6Ygf3wA.js → switch-CiOjVyVI.js} +1 -1
  20. package/dist/chunks/{switch-COWQU8aK.js → switch-TbCsyhv9.js} +1 -1
  21. package/dist/chunks/{update-policy-BzT2k4n6.js → update-policy-2MZ-Vf7v.js} +211 -187
  22. package/dist/chunks/update-policy-qpyAkOyO.js +3 -0
  23. package/dist/chunks/{use-create-flow-overlay-state-CX0D-6HM.js → use-create-flow-overlay-state-BzcJWNzh.js} +3 -3
  24. package/dist/chunks/{use-create-flow-overlay-state-DENfd7sW.js → use-create-flow-overlay-state-DUQmgb9H.js} +1 -1
  25. package/dist/chunks/{validators-Cxr9qbrR.js → validators-D0pfj3jJ.js} +93 -93
  26. package/dist/chunks/validators-Dj1Y-46V.js +1 -0
  27. package/dist/dashboard/index.cjs +1 -1
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/dashboard-authoring/index.cjs +1 -1
  30. package/dist/dashboard-authoring/index.js +14 -14
  31. package/dist/data-app-builder/index.cjs +1 -1
  32. package/dist/data-app-builder/index.js +2 -2
  33. package/dist/data-app-codegen/index.cjs +1 -1
  34. package/dist/data-app-codegen/index.js +2 -2
  35. package/dist/data-app-codegen-node/index.cjs +251 -139
  36. package/dist/data-app-codegen-node/index.js +806 -657
  37. package/dist/data-app-sdk/index.cjs +2 -2
  38. package/dist/data-app-sdk/index.js +730 -686
  39. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  40. package/dist/data-app-sdk-adapters/index.js +51 -51
  41. package/dist/data-app-sdk-validation/index.cjs +1 -1
  42. package/dist/data-app-sdk-validation/index.js +2 -2
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.js +7 -7
  45. package/dist/surfboard/index.cjs +1 -1
  46. package/dist/surfboard/index.js +2 -2
  47. package/dist/types/analytics-protocol.d.ts +12 -5
  48. package/dist/types/dashboard-assistant.d.ts +0 -5
  49. package/dist/types/data-app-codegen-node.d.ts +12 -2
  50. package/dist/types/data-app-codegen.d.ts +12 -2
  51. package/dist/types/data-app-sdk-validation.d.ts +0 -5
  52. package/dist/types/data-app-sdk.d.ts +17 -5
  53. package/package.json +1 -1
  54. package/dist/chunks/analyze-result-contract-DdhEt99q.js +0 -2004
  55. package/dist/chunks/analyze-result-contract-DwRzl7yJ.js +0 -1
  56. package/dist/chunks/update-policy-VloD-0YM.js +0 -3
  57. package/dist/chunks/validators-BMQo93Y0.js +0 -1
@@ -1,11 +1,11 @@
1
- import { toSemaphorInputSnapshots as Pr, toSemaphorInputBinding as Fr, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as zr, toSemaphorSqlIntent as Mr, toSemaphorInputOptionsIntent as jr, toSemaphorRecordsIntent as Hr, toSemaphorAnalysisQueryOptions as Vr, toSemaphorAnalysisIntent as Qr, toSemaphorMetricIntent as Ur, hasSemaphorInputValue as ue, normalizeSemaphorInputOptions as gr, toSemaphorInputSpec as mr } from "../data-app-sdk-adapters/index.js";
2
- import { jsxs as p, Fragment as yr, jsx as a } from "react/jsx-runtime";
3
- import { createContext as Ie, useContext as Q, useState as z, useRef as E, useEffect as B, useMemo as I, Fragment as Gr, useId as hr, useCallback as O, useReducer as Jr } from "react";
4
- import { H as Yr, K as Xr } from "../chunks/analyze-result-contract-DdhEt99q.js";
5
- import { L as ro } from "../chunks/analyze-result-contract-DdhEt99q.js";
6
- import { M as Zr, a as et, S as rt, E as tt, C as nt } from "../chunks/search-BHsQIWBV.js";
7
- import { X as it, C as ot, j as st } from "../chunks/x-CXDkqdur.js";
8
- import { b as at } from "../chunks/validators-Cxr9qbrR.js";
1
+ import { toSemaphorInputSnapshots as jr, toSemaphorInputBinding as Hr, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as Pr, toSemaphorSqlIntent as Vr, toSemaphorInputOptionsIntent as Qr, toSemaphorRecordsIntent as Ur, toSemaphorAnalysisQueryOptions as Gr, toSemaphorAnalysisIntent as Jr, toSemaphorMetricIntent as Yr, hasSemaphorInputValue as ue, normalizeSemaphorInputOptions as hr, toSemaphorInputSpec as br } from "../data-app-sdk-adapters/index.js";
2
+ import { jsxs as p, Fragment as vr, jsx as a } from "react/jsx-runtime";
3
+ import { createContext as xe, useContext as Q, useState as z, useRef as E, useEffect as B, useMemo as I, Fragment as Xr, useId as Sr, useCallback as D, useReducer as Zr } from "react";
4
+ import { I as et, L as rt } from "../chunks/analyze-result-contract-sWcmvBOA.js";
5
+ import { b as ao, M as lo } from "../chunks/analyze-result-contract-sWcmvBOA.js";
6
+ import { M as tt, a as nt, S as it, E as ot, C as st } from "../chunks/search-BHsQIWBV.js";
7
+ import { X as at, C as lt, j as dt } from "../chunks/x-CXDkqdur.js";
8
+ import { b as ut } from "../chunks/validators-D0pfj3jJ.js";
9
9
  function me(e, r, t = {}) {
10
10
  return {
11
11
  ...t,
@@ -13,13 +13,13 @@ function me(e, r, t = {}) {
13
13
  role: r
14
14
  };
15
15
  }
16
- function Mi(e) {
16
+ function Gi(e) {
17
17
  return e;
18
18
  }
19
- function ji(e) {
19
+ function Ji(e) {
20
20
  return e;
21
21
  }
22
- const Hi = {
22
+ const Yi = {
23
23
  source: {
24
24
  semantic(e) {
25
25
  return {
@@ -57,7 +57,7 @@ const Hi = {
57
57
  bindInput(e, r) {
58
58
  return {
59
59
  toAnalyticsInput() {
60
- const [t] = Pr([e]), n = Fr({
60
+ const [t] = jr([e]), n = Hr({
61
61
  ...r,
62
62
  inputId: r.inputId || t.inputId
63
63
  });
@@ -129,38 +129,38 @@ const Hi = {
129
129
  queryKind: "matrix"
130
130
  };
131
131
  }
132
- }, ce = 10, _e = 8;
133
- function lt(e) {
134
- const r = e == null ? void 0 : e.result;
135
- if (r)
136
- switch (r.kind) {
132
+ }, ce = 10, Ne = 8;
133
+ function He(e, r) {
134
+ const t = e == null ? void 0 : e.result;
135
+ if (t)
136
+ switch (t.kind) {
137
137
  case "records":
138
138
  return le({
139
139
  title: "Records",
140
140
  rowNoun: "rows",
141
- records: r.records,
142
- columns: r.columns,
143
- rowCount: r.rowCount
141
+ records: t.records,
142
+ columns: t.columns,
143
+ rowCount: t.rowCount
144
144
  });
145
145
  case "sql":
146
146
  return le({
147
147
  title: "SQL Rows",
148
148
  rowNoun: "rows",
149
- records: r.records,
150
- columns: r.columns,
151
- rowCount: r.rowCount
149
+ records: t.records,
150
+ columns: t.columns,
151
+ rowCount: t.rowCount
152
152
  });
153
153
  case "inputOptions":
154
154
  return le({
155
155
  title: "Options",
156
156
  rowNoun: "options",
157
- records: r.options.slice(0, ce).map((t) => {
158
- var n;
157
+ records: t.options.slice(0, ce).map((n) => {
158
+ var i;
159
159
  return {
160
- label: t.label,
161
- value: t.value,
162
- count: t.count,
163
- disambiguation: (n = t.disambiguation) == null ? void 0 : n.join(" / ")
160
+ label: n.label,
161
+ value: n.value,
162
+ count: n.count,
163
+ disambiguation: (i = n.disambiguation) == null ? void 0 : i.join(" / ")
164
164
  };
165
165
  }),
166
166
  columns: [
@@ -169,42 +169,22 @@ function lt(e) {
169
169
  { key: "count", label: "Count" },
170
170
  { key: "disambiguation", label: "Disambiguation" }
171
171
  ],
172
- rowCount: r.rowCount ?? r.options.length
173
- });
174
- case "metric": {
175
- const t = [
176
- { metric: "primaryValue", value: r.primaryValue }
177
- ];
178
- return r.comparison && t.push(
179
- {
180
- metric: `${r.comparison.kind} value`,
181
- value: r.comparison.value
182
- },
183
- { metric: "delta", value: r.comparison.delta },
184
- { metric: "deltaPercent", value: r.comparison.deltaPercent }
185
- ), le({
186
- title: "Metric",
187
- rowNoun: "values",
188
- records: t,
189
- columns: [
190
- { key: "metric", label: "Metric" },
191
- { key: "value", label: "Value" }
192
- ],
193
- rowCount: t.length
172
+ rowCount: t.rowCount ?? t.options.length
194
173
  });
195
- }
174
+ case "metric":
175
+ return ct(t, r);
196
176
  case "matrix":
197
177
  return le({
198
178
  title: "Matrix Cells",
199
179
  rowNoun: "cells",
200
- records: r.cells.slice(0, ce).map((t) => {
201
- const n = r.nodesById[t.rowId], i = t.columnId ? r.nodesById[t.columnId] : void 0, o = r.measuresById[t.measureId];
180
+ records: t.cells.slice(0, ce).map((n) => {
181
+ const i = t.nodesById[n.rowId], o = n.columnId ? t.nodesById[n.columnId] : void 0, u = t.measuresById[n.measureId];
202
182
  return {
203
- row: (n == null ? void 0 : n.label) || t.rowId,
204
- column: (i == null ? void 0 : i.label) || t.columnId || "Total",
205
- measure: (o == null ? void 0 : o.label) || t.measureId,
206
- value: t.formattedValue ?? t.value,
207
- role: t.role
183
+ row: (i == null ? void 0 : i.label) || n.rowId,
184
+ column: (o == null ? void 0 : o.label) || n.columnId || "Total",
185
+ measure: (u == null ? void 0 : u.label) || n.measureId,
186
+ value: n.formattedValue ?? n.value,
187
+ role: n.role
208
188
  };
209
189
  }),
210
190
  columns: [
@@ -214,12 +194,52 @@ function lt(e) {
214
194
  { key: "value", label: "Value" },
215
195
  { key: "role", label: "Role" }
216
196
  ],
217
- rowCount: r.rowCount ?? r.cells.length
197
+ rowCount: t.rowCount ?? t.cells.length
218
198
  });
219
199
  default:
220
- return ut(r);
200
+ return pt(t);
221
201
  }
222
202
  }
203
+ function ct(e, r) {
204
+ var o, u, f, d, c;
205
+ const t = [
206
+ {
207
+ metric: "primaryValue",
208
+ value: (r == null ? void 0 : r.primaryValue) ?? e.primaryValue
209
+ }
210
+ ];
211
+ r && "value" in r && t.push({ metric: "value", value: r.value });
212
+ const n = (r == null ? void 0 : r.comparisonKind) ?? ((o = e.comparison) == null ? void 0 : o.kind);
213
+ return n && t.push(
214
+ {
215
+ metric: `${n} value`,
216
+ value: (r == null ? void 0 : r.comparisonValue) ?? ((u = e.comparison) == null ? void 0 : u.value)
217
+ },
218
+ {
219
+ metric: "delta",
220
+ value: (r == null ? void 0 : r.delta) ?? ((f = e.comparison) == null ? void 0 : f.delta)
221
+ },
222
+ {
223
+ metric: "deltaPercent",
224
+ value: (r == null ? void 0 : r.deltaPercent) ?? ((d = e.comparison) == null ? void 0 : d.deltaPercent)
225
+ }
226
+ ), (((c = r == null ? void 0 : r.missingMeasures) == null ? void 0 : c.filter(Boolean)) ?? []).forEach((g) => {
227
+ t.push({ metric: `missing:${g}`, value: "missing" });
228
+ }), Object.entries((r == null ? void 0 : r.measures) ?? {}).sort(([g], [m]) => g.localeCompare(m)).forEach(([g, m]) => {
229
+ t.push({ metric: `measure:${g}`, value: m });
230
+ }), Object.entries((r == null ? void 0 : r.measureBindings) ?? {}).sort(([g], [m]) => g.localeCompare(m)).forEach(([g, m]) => {
231
+ t.push({ metric: `binding:${g}`, value: m });
232
+ }), le({
233
+ title: "Metric",
234
+ rowNoun: "values",
235
+ records: t,
236
+ columns: [
237
+ { key: "metric", label: "Metric" },
238
+ { key: "value", label: "Value" }
239
+ ],
240
+ rowCount: t.length
241
+ });
242
+ }
223
243
  function le({
224
244
  title: e,
225
245
  rowNoun: r,
@@ -227,20 +247,20 @@ function le({
227
247
  columns: n,
228
248
  rowCount: i
229
249
  }) {
230
- const o = dt(n, t);
250
+ const o = ft(n, t);
231
251
  if (!o.length)
232
252
  return;
233
253
  const u = i ?? t.length, f = t.slice(0, ce);
234
254
  return {
235
255
  title: e,
236
- summary: `${ft(u)} ${r}`,
237
- columns: o.slice(0, _e),
256
+ summary: `${mt(u)} ${r}`,
257
+ columns: o.slice(0, Ne),
238
258
  rows: f,
239
259
  truncatedRows: u > f.length,
240
- truncatedColumns: o.length > _e
260
+ truncatedColumns: o.length > Ne
241
261
  };
242
262
  }
243
- function dt(e, r) {
263
+ function ft(e, r) {
244
264
  if (e != null && e.length)
245
265
  return e.filter((n) => n.key).map((n) => ({
246
266
  key: n.key,
@@ -251,47 +271,47 @@ function dt(e, r) {
251
271
  Object.keys(n).forEach((i) => t.add(i));
252
272
  }), [...t].map((n) => ({ key: n, label: n }));
253
273
  }
254
- function ut(e) {
255
- throw new Error(`Unhandled Semaphor result kind: ${br(e)}`);
274
+ function pt(e) {
275
+ throw new Error(`Unhandled Semaphor result kind: ${wr(e)}`);
256
276
  }
257
- function ct(e) {
258
- return e === null ? "null" : e === void 0 ? "" : typeof e == "string" ? tr(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : tr(br(e));
277
+ function gt(e) {
278
+ return e === null ? "null" : e === void 0 ? "" : typeof e == "string" ? or(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : or(wr(e));
259
279
  }
260
- function ft(e) {
280
+ function mt(e) {
261
281
  return typeof e == "number" ? e.toLocaleString() : "-";
262
282
  }
263
- function br(e) {
283
+ function wr(e) {
264
284
  return JSON.stringify(e, null, 2) ?? "undefined";
265
285
  }
266
- function tr(e) {
286
+ function or(e) {
267
287
  return e.length > 80 ? `${e.slice(0, 77)}...` : e;
268
288
  }
269
- function xe(e) {
289
+ function qe(e) {
270
290
  return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
271
291
  }
272
- function pt(e) {
292
+ function yt(e) {
273
293
  if (e.label)
274
294
  return e.label;
275
295
  if (e.queryKind !== "inputOptions")
276
296
  return;
277
297
  const t = e.labelField.label || e.valueField.label || e.labelField.name || e.valueField.name || e.inputId;
278
- return `${gt(t)} Options`;
298
+ return `${ht(t)} Options`;
279
299
  }
280
- function gt(e) {
300
+ function ht(e) {
281
301
  return (e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\bfilter\b/gi, " ").replace(/\boptions?\b/gi, " ").replace(/\bid\b/gi, " ").replace(/\s+/g, " ").trim() || e).split(" ").filter(Boolean).map((n) => n === n.toUpperCase() && n.length > 1 ? n : `${n.slice(0, 1).toUpperCase()}${n.slice(1)}`).join(" ");
282
302
  }
283
- function Me(e) {
303
+ function Pe(e) {
284
304
  return e.flatMap((r) => {
285
- var y, m, v, g;
286
- const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i = Ce(
287
- (y = n == null ? void 0 : n.validation) == null ? void 0 : y.warnings
288
- ), o = Ce(
305
+ var g, m, v, y;
306
+ const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i = ke(
307
+ (g = n == null ? void 0 : n.validation) == null ? void 0 : g.warnings
308
+ ), o = ke(
289
309
  (m = n == null ? void 0 : n.validation) == null ? void 0 : m.errors
290
- ), u = bt(
310
+ ), u = wt(
291
311
  (v = n == null ? void 0 : n.coverage) == null ? void 0 : v.missingObligations
292
- ), f = Ce(
293
- (g = n == null ? void 0 : n.coverage) == null ? void 0 : g.warnings
294
- ), d = [], c = xe(r);
312
+ ), f = ke(
313
+ (y = n == null ? void 0 : n.coverage) == null ? void 0 : y.warnings
314
+ ), d = [], c = qe(r);
295
315
  (t == null ? void 0 : t.status) === "error" && d.push({
296
316
  trace: r,
297
317
  tone: "error",
@@ -311,7 +331,7 @@ function Me(e) {
311
331
  return d;
312
332
  });
313
333
  }
314
- function mt(e) {
334
+ function bt(e) {
315
335
  return {
316
336
  traceId: e.trace.traceId,
317
337
  queryId: e.trace.queryId,
@@ -325,11 +345,11 @@ function mt(e) {
325
345
  path: e.path
326
346
  };
327
347
  }
328
- function yt(e, r) {
348
+ function vt(e, r) {
329
349
  return e.filter((t) => t.trace.traceId === r.traceId).length;
330
350
  }
331
- function ht(e) {
332
- const r = Me(e), t = e.filter(
351
+ function St(e) {
352
+ const r = Pe(e), t = e.filter(
333
353
  (u) => {
334
354
  var f;
335
355
  return ((f = u.latestAttempt) == null ? void 0 : f.status) === "error";
@@ -350,15 +370,15 @@ function ht(e) {
350
370
  severity: t || i ? "error" : o ? "warning" : n ? "loading" : "ok"
351
371
  };
352
372
  }
353
- function bt(e) {
373
+ function wt(e) {
354
374
  return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
355
375
  }
356
- function Ce(e) {
357
- return Array.isArray(e) ? e.map(vt).filter(
376
+ function ke(e) {
377
+ return Array.isArray(e) ? e.map(It).filter(
358
378
  (r) => !!r
359
379
  ) : [];
360
380
  }
361
- function vt(e) {
381
+ function It(e) {
362
382
  if (typeof e == "string")
363
383
  return { message: e };
364
384
  if (!e || typeof e != "object" || Array.isArray(e))
@@ -373,10 +393,10 @@ function vt(e) {
373
393
  ...i ? { path: i } : {}
374
394
  } : n ? { message: n, code: n } : void 0;
375
395
  }
376
- function St(e) {
396
+ function xt(e) {
377
397
  if (!e.enabled)
378
398
  return e;
379
- const r = e.queries.map(vr);
399
+ const r = e.queries.map(Ir);
380
400
  return {
381
401
  enabled: e.enabled,
382
402
  queries: r,
@@ -385,28 +405,29 @@ function St(e) {
385
405
  getQueries: (t) => r.filter((n) => n.queryId === t)
386
406
  };
387
407
  }
388
- function nr(e) {
389
- return e ? vr(e) : void 0;
408
+ function sr(e) {
409
+ return e ? Ir(e) : void 0;
390
410
  }
391
- function vr(e) {
411
+ function Ir(e) {
392
412
  var r;
393
413
  return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
394
414
  ...e,
395
415
  latestAttempt: {
396
416
  ...e.latestAttempt,
397
- executionResult: wt(
417
+ resultPreview: e.latestAttempt.resultPreview || He(e.latestAttempt.executionResult),
418
+ executionResult: qt(
398
419
  e.latestAttempt.executionResult
399
420
  )
400
421
  }
401
422
  } : e;
402
423
  }
403
- function wt(e) {
424
+ function qt(e) {
404
425
  const {
405
426
  compiledQuery: r,
406
427
  intent: t,
407
428
  result: n,
408
429
  ...i
409
- } = e, o = It(
430
+ } = e, o = At(
410
431
  i.metadata
411
432
  );
412
433
  return {
@@ -414,7 +435,7 @@ function wt(e) {
414
435
  ...o ? { metadata: o } : {}
415
436
  };
416
437
  }
417
- function It(e) {
438
+ function At(e) {
418
439
  if (!e || typeof e != "object" || Array.isArray(e))
419
440
  return e;
420
441
  const r = e.dataAppDebug;
@@ -426,7 +447,7 @@ function It(e) {
426
447
  dataAppDebug: n
427
448
  };
428
449
  }
429
- function xt(e) {
450
+ function Ct(e) {
430
451
  return e === "relative" ? {
431
452
  position: "relative",
432
453
  top: "auto",
@@ -440,7 +461,7 @@ function xt(e) {
440
461
  left: e.endsWith("left") ? 20 : "auto"
441
462
  };
442
463
  }
443
- function qt(e) {
464
+ function Tt(e) {
444
465
  return e === "error" ? {
445
466
  borderColor: "var(--sd-error-border)",
446
467
  background: "var(--sd-error-bg)",
@@ -459,7 +480,7 @@ function qt(e) {
459
480
  color: "var(--sd-success-fg)"
460
481
  };
461
482
  }
462
- function At(e) {
483
+ function kt(e) {
463
484
  return e === "right" ? {
464
485
  top: 16,
465
486
  right: 16,
@@ -478,23 +499,23 @@ function At(e) {
478
499
  borderRadius: 6
479
500
  };
480
501
  }
481
- function Tt(e) {
502
+ function Et(e) {
482
503
  return e === "right" ? {
483
504
  gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
484
505
  } : {
485
506
  gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
486
507
  };
487
508
  }
488
- function Ct(e) {
509
+ function Rt(e) {
489
510
  return {
490
511
  borderRight: "1px solid var(--sd-border)",
491
512
  borderBottom: 0
492
513
  };
493
514
  }
494
- function Sr(e) {
515
+ function xr(e) {
495
516
  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)" };
496
517
  }
497
- function kt(e) {
518
+ function Lt(e) {
498
519
  return e === "error" ? {
499
520
  borderColor: "var(--sd-error-border)",
500
521
  color: "var(--sd-error-fg)"
@@ -509,7 +530,7 @@ function kt(e) {
509
530
  color: "var(--sd-fg-muted)"
510
531
  };
511
532
  }
512
- const ir = "semaphor-devtools-stylesheet", R = "semaphor-devtools", Et = `
533
+ const ar = "semaphor-devtools-stylesheet", R = "semaphor-devtools", $t = `
513
534
  .${R} {
514
535
  --sd-bg: #ffffff;
515
536
  --sd-bg-muted: #fafafa;
@@ -626,13 +647,13 @@ const ir = "semaphor-devtools-stylesheet", R = "semaphor-devtools", Et = `
626
647
  color: var(--sd-fg);
627
648
  }
628
649
  `;
629
- function wr() {
630
- if (typeof document > "u" || document.getElementById(ir))
650
+ function qr() {
651
+ if (typeof document > "u" || document.getElementById(ar))
631
652
  return;
632
653
  const e = document.createElement("style");
633
- e.id = ir, e.textContent = Et, document.head.appendChild(e);
654
+ e.id = ar, e.textContent = $t, document.head.appendChild(e);
634
655
  }
635
- const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', W = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", ke = {
656
+ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', W = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Ee = {
636
657
  color: "var(--sd-fg-muted)",
637
658
  fontSize: 10,
638
659
  fontWeight: 600,
@@ -790,7 +811,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
790
811
  background: "transparent",
791
812
  color: "inherit",
792
813
  cursor: "pointer",
793
- ...ke
814
+ ...Ee
794
815
  },
795
816
  issueSummaryHeaderLabel: {
796
817
  display: "inline-flex",
@@ -897,7 +918,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
897
918
  alignItems: "center",
898
919
  justifyContent: "space-between",
899
920
  padding: "4px 6px 3px",
900
- ...ke
921
+ ...Ee
901
922
  },
902
923
  queryGroupCount: {
903
924
  color: "var(--sd-fg-subtle)",
@@ -1499,7 +1520,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1499
1520
  gap: 5
1500
1521
  },
1501
1522
  codeBlockLabel: {
1502
- ...ke
1523
+ ...Ee
1503
1524
  },
1504
1525
  codeBlock: {
1505
1526
  maxHeight: 260,
@@ -1540,129 +1561,129 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1540
1561
  textOverflow: "ellipsis",
1541
1562
  whiteSpace: "nowrap"
1542
1563
  }
1543
- }, Ee = 10, Re = 100, Rt = 25, Lt = 500, Ir = {
1564
+ }, Re = 10, Le = 100, Ot = 25, Dt = 500, Ar = {
1544
1565
  enabled: !1,
1545
1566
  queries: [],
1546
1567
  issues: [],
1547
1568
  getQuery: () => {
1548
1569
  },
1549
1570
  getQueries: () => []
1550
- }, je = Ie(null), He = Ie(null), Ve = Ie(
1571
+ }, Ve = xe(null), Qe = xe(null), Ue = xe(
1551
1572
  void 0
1552
1573
  ), V = [];
1553
- function $t({
1574
+ function Bt({
1554
1575
  debug: e,
1555
1576
  children: r
1556
1577
  }) {
1557
- const t = I(() => On(e), [e]), [n, i] = Jr(
1558
- Cn,
1578
+ const t = I(() => Wn(e), [e]), [n, i] = Zr(
1579
+ Rn,
1559
1580
  t,
1560
- Rr
1561
- ), o = E(n), u = hr(), [f, d] = z({ open: !1 });
1581
+ Or
1582
+ ), o = E(n), u = Sr(), [f, d] = z({ open: !1 });
1562
1583
  o.current = n, B(() => {
1563
1584
  i({ type: "config", config: t });
1564
1585
  }, [t]), B(() => {
1565
1586
  if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
1566
1587
  return;
1567
- const h = Dn(() => o.current);
1568
- return Dt({
1588
+ const h = Kn(() => o.current);
1589
+ return Kt({
1569
1590
  ownerId: u,
1570
1591
  bridge: h
1571
1592
  }), () => {
1572
- Ot(u);
1593
+ Wt(u);
1573
1594
  };
1574
1595
  }, [u, n.enabled, n.exposeWindowBridge]);
1575
- const c = I(() => ({ state: n, dispatch: i }), [n]), y = O((h) => {
1596
+ const c = I(() => ({ state: n, dispatch: i }), [n]), g = D((h) => {
1576
1597
  d({ open: !0, focus: h });
1577
- }, []), m = O(() => {
1598
+ }, []), m = D(() => {
1578
1599
  d((h) => ({ ...h, open: !1 }));
1579
- }, []), v = O((h) => {
1600
+ }, []), v = D((h) => {
1580
1601
  d({ open: !0, focus: h });
1581
- }, []), g = I(
1602
+ }, []), y = I(
1582
1603
  () => ({
1583
1604
  open: f.open,
1584
1605
  focus: f.focus,
1585
- openDevtools: y,
1606
+ openDevtools: g,
1586
1607
  closeDevtools: m,
1587
1608
  focusTrace: v
1588
1609
  }),
1589
1610
  [
1590
1611
  m,
1591
1612
  v,
1592
- y,
1613
+ g,
1593
1614
  f.focus,
1594
1615
  f.open
1595
1616
  ]
1596
1617
  );
1597
- return /* @__PURE__ */ a(je.Provider, { value: c, children: /* @__PURE__ */ a(He.Provider, { value: g, children: r }) });
1618
+ return /* @__PURE__ */ a(Ve.Provider, { value: c, children: /* @__PURE__ */ a(Qe.Provider, { value: y, children: r }) });
1598
1619
  }
1599
- function Dt(e) {
1620
+ function Kt(e) {
1600
1621
  const r = V.findIndex(
1601
1622
  (t) => t.ownerId === e.ownerId
1602
1623
  );
1603
- r >= 0 && V.splice(r, 1), V.push(e), xr();
1624
+ r >= 0 && V.splice(r, 1), V.push(e), Cr();
1604
1625
  }
1605
- function Ot(e) {
1626
+ function Wt(e) {
1606
1627
  const r = V.findIndex(
1607
1628
  (t) => t.ownerId === e
1608
1629
  );
1609
- r >= 0 && V.splice(r, 1), xr();
1630
+ r >= 0 && V.splice(r, 1), Cr();
1610
1631
  }
1611
- function xr() {
1632
+ function Cr() {
1612
1633
  if (typeof window > "u")
1613
1634
  return;
1614
1635
  const e = V[V.length - 1];
1615
1636
  e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
1616
1637
  }
1617
- function Vi({
1638
+ function Xi({
1618
1639
  id: e,
1619
1640
  title: r,
1620
1641
  children: t
1621
1642
  }) {
1622
1643
  const n = I(() => ({ id: e, title: r }), [e, r]);
1623
- return /* @__PURE__ */ a(Ve.Provider, { value: n, children: t });
1644
+ return /* @__PURE__ */ a(Ue.Provider, { value: n, children: t });
1624
1645
  }
1625
- function Bt({
1646
+ function _t({
1626
1647
  buttonPosition: e = "bottom-right",
1627
1648
  initialIsOpen: r = !1,
1628
1649
  panelPosition: t = "right",
1629
1650
  className: n,
1630
1651
  style: i
1631
1652
  } = {}) {
1632
- const o = qr(), u = Q(He), [f, d] = z(""), [c, y] = z(!1), m = E(null), v = E(null), g = u == null ? void 0 : u.openDevtools, h = u == null ? void 0 : u.closeDevtools, A = (u == null ? void 0 : u.open) === !0;
1653
+ const o = Tr(), u = Q(Qe), [f, d] = z(""), [c, g] = z(!1), m = E(null), v = E(null), y = u == null ? void 0 : u.openDevtools, h = u == null ? void 0 : u.closeDevtools, C = (u == null ? void 0 : u.open) === !0;
1633
1654
  B(() => {
1634
- wr();
1655
+ qr();
1635
1656
  }, []), B(() => {
1636
- r && o.enabled && (g == null || g());
1637
- }, [r, o.enabled, g]), B(() => {
1638
- if (!A || !h)
1657
+ r && o.enabled && (y == null || y());
1658
+ }, [r, o.enabled, y]), B(() => {
1659
+ if (!C || !h)
1639
1660
  return;
1640
1661
  const S = (w) => {
1641
- var x, D;
1662
+ var x, O;
1642
1663
  const L = w.target;
1643
- L instanceof Node && ((x = m.current) != null && x.contains(L) || (D = v.current) != null && D.contains(L) || h());
1664
+ L instanceof Node && ((x = m.current) != null && x.contains(L) || (O = v.current) != null && O.contains(L) || h());
1644
1665
  };
1645
1666
  return document.addEventListener("pointerdown", S, !0), document.addEventListener("mousedown", S, !0), document.addEventListener("click", S, !0), () => {
1646
1667
  document.removeEventListener("pointerdown", S, !0), document.removeEventListener("mousedown", S, !0), document.removeEventListener("click", S, !0);
1647
1668
  };
1648
- }, [h, A]);
1669
+ }, [h, C]);
1649
1670
  const l = I(
1650
- () => ht(o.queries),
1671
+ () => St(o.queries),
1651
1672
  [o.queries]
1652
1673
  ), b = I(
1653
- () => Me(o.queries),
1674
+ () => Pe(o.queries),
1654
1675
  [o.queries]
1655
- ), K = tn(l), T = I(
1656
- () => nn(o.queries, f),
1676
+ ), K = sn(l), T = I(
1677
+ () => an(o.queries, f),
1657
1678
  [o.queries, f]
1658
1679
  ), N = I(
1659
- () => on(T),
1680
+ () => ln(T),
1660
1681
  [T]
1661
1682
  ), $ = I(
1662
- () => Ar(T, u == null ? void 0 : u.focus) || T[0],
1683
+ () => kr(T, u == null ? void 0 : u.focus) || T[0],
1663
1684
  [T, u == null ? void 0 : u.focus]
1664
1685
  );
1665
- return !o.enabled || !u ? null : /* @__PURE__ */ p(yr, { children: [
1686
+ return !o.enabled || !u ? null : /* @__PURE__ */ p(vr, { children: [
1666
1687
  /* @__PURE__ */ p(
1667
1688
  "button",
1668
1689
  {
@@ -1673,8 +1694,8 @@ function Bt({
1673
1694
  className: n ? `${R} ${n}` : R,
1674
1695
  style: {
1675
1696
  ...s.launcher,
1676
- ...xt(e),
1677
- ...qt(l.severity),
1697
+ ...Ct(e),
1698
+ ...Tt(l.severity),
1678
1699
  ...i
1679
1700
  },
1680
1701
  onClick: () => {
@@ -1689,7 +1710,7 @@ function Bt({
1689
1710
  );
1690
1711
  },
1691
1712
  children: [
1692
- /* @__PURE__ */ a(Wt, {}),
1713
+ /* @__PURE__ */ a(Mt, {}),
1693
1714
  /* @__PURE__ */ a("span", { style: s.launcherText, children: l.total }),
1694
1715
  l.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
1695
1716
  l.issueCount,
@@ -1709,7 +1730,7 @@ function Bt({
1709
1730
  className: R,
1710
1731
  style: {
1711
1732
  ...s.panel,
1712
- ...At(t),
1733
+ ...kt(t),
1713
1734
  ...c ? s.panelFullscreen : null
1714
1735
  },
1715
1736
  children: [
@@ -1739,8 +1760,8 @@ function Bt({
1739
1760
  "aria-label": c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
1740
1761
  title: c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
1741
1762
  style: s.iconButton,
1742
- onClick: () => y((S) => !S),
1743
- children: c ? /* @__PURE__ */ a(Zr, { size: 15 }) : /* @__PURE__ */ a(et, { size: 15 })
1763
+ onClick: () => g((S) => !S),
1764
+ children: c ? /* @__PURE__ */ a(tt, { size: 15 }) : /* @__PURE__ */ a(nt, { size: 15 })
1744
1765
  }
1745
1766
  ),
1746
1767
  /* @__PURE__ */ a(
@@ -1750,13 +1771,13 @@ function Bt({
1750
1771
  "aria-label": "Close Semaphor Inspector",
1751
1772
  style: s.iconButton,
1752
1773
  onClick: u.closeDevtools,
1753
- children: /* @__PURE__ */ a(it, { size: 15 })
1774
+ children: /* @__PURE__ */ a(at, { size: 15 })
1754
1775
  }
1755
1776
  )
1756
1777
  ] })
1757
1778
  ] }),
1758
1779
  /* @__PURE__ */ p("label", { style: s.searchBox, children: [
1759
- /* @__PURE__ */ a(rt, { size: 14 }),
1780
+ /* @__PURE__ */ a(it, { size: 14 }),
1760
1781
  /* @__PURE__ */ a(
1761
1782
  "input",
1762
1783
  {
@@ -1769,7 +1790,7 @@ function Bt({
1769
1790
  )
1770
1791
  ] }),
1771
1792
  b.length ? /* @__PURE__ */ a(
1772
- Ft,
1793
+ Ht,
1773
1794
  {
1774
1795
  issues: b,
1775
1796
  onSelect: (S) => u.focusTrace({
@@ -1784,7 +1805,7 @@ function Bt({
1784
1805
  {
1785
1806
  style: {
1786
1807
  ...s.panelBody,
1787
- ...Tt(t)
1808
+ ...Et(t)
1788
1809
  },
1789
1810
  children: [
1790
1811
  /* @__PURE__ */ a(
@@ -1792,7 +1813,7 @@ function Bt({
1792
1813
  {
1793
1814
  style: {
1794
1815
  ...s.queryList,
1795
- ...Ct()
1816
+ ...Rt()
1796
1817
  },
1797
1818
  "aria-label": "Registered queries",
1798
1819
  children: T.length ? N.map((S) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
@@ -1802,12 +1823,12 @@ function Bt({
1802
1823
  ] }),
1803
1824
  S.traces.length ? S.traces.map((w) => {
1804
1825
  var ne;
1805
- const L = an(w, $), x = xe(w), D = kr(w), pe = Er(w), re = dn(w, x, pe), te = re.join(" · "), k = Tr(D), M = yt(b, w);
1826
+ const L = un(w, $), x = qe(w), O = Lr(w), pe = $r(w), re = fn(w, x, pe), te = re.join(" · "), k = Er(O), j = vt(b, w);
1806
1827
  return /* @__PURE__ */ p(
1807
1828
  "button",
1808
1829
  {
1809
1830
  type: "button",
1810
- title: `${x} · ${D} · ${te}`,
1831
+ title: `${x} · ${O} · ${te}`,
1811
1832
  style: {
1812
1833
  ...s.queryListItem,
1813
1834
  ...L ? s.queryListItemSelected : null
@@ -1819,19 +1840,19 @@ function Bt({
1819
1840
  }),
1820
1841
  children: [
1821
1842
  /* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
1822
- /* @__PURE__ */ a(zt, { status: (ne = w.latestAttempt) == null ? void 0 : ne.status }),
1843
+ /* @__PURE__ */ a(Pt, { status: (ne = w.latestAttempt) == null ? void 0 : ne.status }),
1823
1844
  /* @__PURE__ */ a("span", { style: s.queryListTitle, title: x, children: x }),
1824
1845
  /* @__PURE__ */ a(
1825
1846
  "span",
1826
1847
  {
1827
1848
  style: {
1828
1849
  ...s.queryListKindChip,
1829
- ...Cr(k)
1850
+ ...Rr(k)
1830
1851
  },
1831
- children: D
1852
+ children: O
1832
1853
  }
1833
1854
  ),
1834
- M > 0 ? /* @__PURE__ */ a("span", { style: s.queryListIssueBadge, children: M }) : null
1855
+ j > 0 ? /* @__PURE__ */ a("span", { style: s.queryListIssueBadge, children: j }) : null
1835
1856
  ] }),
1836
1857
  /* @__PURE__ */ a(
1837
1858
  "span",
@@ -1839,7 +1860,7 @@ function Bt({
1839
1860
  className: `${R}-source`,
1840
1861
  style: s.queryListSource,
1841
1862
  title: te,
1842
- children: re.map((ie, oe) => /* @__PURE__ */ p(Gr, { children: [
1863
+ children: re.map((ie, oe) => /* @__PURE__ */ p(Xr, { children: [
1843
1864
  oe > 0 ? /* @__PURE__ */ a("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
1844
1865
  /* @__PURE__ */ a("span", { children: ie })
1845
1866
  ] }, `${ie}:${oe}`))
@@ -1847,13 +1868,13 @@ function Bt({
1847
1868
  )
1848
1869
  ]
1849
1870
  },
1850
- Ne(w)
1871
+ Me(w)
1851
1872
  );
1852
1873
  }) : /* @__PURE__ */ a("div", { style: s.queryGroupEmpty, children: "No input traces" })
1853
1874
  ] }, S.title)) : /* @__PURE__ */ a("div", { style: s.emptyState, children: "No matching traces" })
1854
1875
  }
1855
1876
  ),
1856
- /* @__PURE__ */ a(_t, { trace: $ })
1877
+ /* @__PURE__ */ a(Ft, { trace: $ })
1857
1878
  ]
1858
1879
  }
1859
1880
  )
@@ -1862,7 +1883,7 @@ function Bt({
1862
1883
  ) : null
1863
1884
  ] });
1864
1885
  }
1865
- function Qi({
1886
+ function Zi({
1866
1887
  queryId: e,
1867
1888
  viewId: r,
1868
1889
  label: t,
@@ -1870,12 +1891,12 @@ function Qi({
1870
1891
  style: i
1871
1892
  } = {}) {
1872
1893
  var m, v;
1873
- const o = qr(), u = Q(He), f = Q(Ve);
1894
+ const o = Tr(), u = Q(Qe), f = Q(Ue);
1874
1895
  B(() => {
1875
- wr();
1896
+ qr();
1876
1897
  }, []);
1877
1898
  const d = r || (f == null ? void 0 : f.id), c = I(
1878
- () => sn(o.queries, {
1899
+ () => dn(o.queries, {
1879
1900
  queryId: e,
1880
1901
  viewId: d
1881
1902
  }),
@@ -1887,17 +1908,17 @@ function Qi({
1887
1908
  );
1888
1909
  if (!o.enabled || !u || !c)
1889
1910
  return null;
1890
- const y = t || `Inspect ${un(c, !!e)}`;
1911
+ const g = t || `Inspect ${pn(c, !!e)}`;
1891
1912
  return /* @__PURE__ */ p(
1892
1913
  "button",
1893
1914
  {
1894
1915
  type: "button",
1895
- "aria-label": y,
1896
- title: y,
1916
+ "aria-label": g,
1917
+ title: g,
1897
1918
  className: n ? `${R} ${n}` : R,
1898
1919
  style: {
1899
1920
  ...s.inspectButton,
1900
- ...kt((m = c.latestAttempt) == null ? void 0 : m.status),
1921
+ ...Lt((m = c.latestAttempt) == null ? void 0 : m.status),
1901
1922
  ...i
1902
1923
  },
1903
1924
  onClick: () => u.openDevtools({
@@ -1906,17 +1927,17 @@ function Qi({
1906
1927
  viewId: c.viewId
1907
1928
  }),
1908
1929
  children: [
1909
- /* @__PURE__ */ a(tt, { size: 13 }),
1930
+ /* @__PURE__ */ a(ot, { size: 13 }),
1910
1931
  /* @__PURE__ */ a("span", { style: s.inspectButtonText, children: ((v = c.latestAttempt) == null ? void 0 : v.status) || "idle" })
1911
1932
  ]
1912
1933
  }
1913
1934
  );
1914
1935
  }
1915
- function qr() {
1916
- const e = Q(je);
1917
- return !e || !e.state.enabled ? Ir : de(e.state);
1936
+ function Tr() {
1937
+ const e = Q(Ve);
1938
+ return !e || !e.state.enabled ? Ar : de(e.state);
1918
1939
  }
1919
- function Kt({
1940
+ function Nt({
1920
1941
  spec: e,
1921
1942
  queryKind: r,
1922
1943
  queryKey: t,
@@ -1924,73 +1945,73 @@ function Kt({
1924
1945
  activeInputs: i,
1925
1946
  debug: o
1926
1947
  }) {
1927
- const u = Q(je), f = Q(Ve), d = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, y = Kn(e), m = pt(e), v = I(
1948
+ const u = Q(Ve), f = Q(Ue), d = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, g = Nn(e), m = yt(e), v = I(
1928
1949
  () => JSON.stringify(e),
1929
1950
  [e]
1930
- ), g = I(
1951
+ ), y = I(
1931
1952
  () => JSON.stringify(i || []),
1932
1953
  [i]
1933
1954
  ), h = I(
1934
1955
  () => JSON.stringify(n || null),
1935
1956
  [n]
1936
- ), A = E(e), l = E(v), b = E(n), K = E(h), T = E(i), N = E(g), $ = Bn(o), S = JSON.stringify($ || []), w = E($), L = E(S);
1937
- l.current !== v && (l.current = v, A.current = e), K.current !== h && (K.current = h, b.current = n), N.current !== g && (N.current = g, T.current = i), L.current !== S && (L.current = S, w.current = $);
1938
- const x = A.current, D = b.current, pe = T.current, re = w.current, te = hr(), k = I(
1939
- () => y || `query_${Dr(t)}`,
1940
- [t, y]
1941
- ), M = (o == null ? void 0 : o.viewId) || (f == null ? void 0 : f.id), ne = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (f == null ? void 0 : f.title), ie = o == null ? void 0 : o.visualType, oe = o == null ? void 0 : o.sectionTitle, j = I(
1957
+ ), C = E(e), l = E(v), b = E(n), K = E(h), T = E(i), N = E(y), $ = _n(o), S = JSON.stringify($ || []), w = E($), L = E(S);
1958
+ l.current !== v && (l.current = v, C.current = e), K.current !== h && (K.current = h, b.current = n), N.current !== y && (N.current = y, T.current = i), L.current !== S && (L.current = S, w.current = $);
1959
+ const x = C.current, O = b.current, pe = T.current, re = w.current, te = Sr(), k = I(
1960
+ () => g || `query_${Kr(t)}`,
1961
+ [t, g]
1962
+ ), j = (o == null ? void 0 : o.viewId) || (f == null ? void 0 : f.id), ne = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (f == null ? void 0 : f.title), ie = o == null ? void 0 : o.visualType, oe = o == null ? void 0 : o.sectionTitle, H = I(
1942
1963
  () => [
1943
- M || "unscoped-view",
1964
+ j || "unscoped-view",
1944
1965
  k,
1945
1966
  te
1946
1967
  ].join("::"),
1947
- [k, te, M]
1948
- ), Ye = I(
1968
+ [k, te, j]
1969
+ ), Ze = I(
1949
1970
  () => ({
1950
- traceKey: j,
1971
+ traceKey: H,
1951
1972
  spec: x,
1952
1973
  queryId: k,
1953
1974
  queryLabel: m,
1954
1975
  queryKind: r,
1955
- builder: Wn(r),
1956
- viewId: M,
1976
+ builder: Mn(r),
1977
+ viewId: j,
1957
1978
  viewTitle: ne,
1958
1979
  visualType: ie,
1959
1980
  sectionTitle: oe,
1960
1981
  sourceHints: re,
1961
- intent: D,
1982
+ intent: O,
1962
1983
  activeInputs: pe,
1963
- clientWarnings: y ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
1984
+ clientWarnings: g ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
1964
1985
  }),
1965
1986
  [
1966
1987
  k,
1967
1988
  r,
1968
- y,
1989
+ g,
1969
1990
  m,
1970
1991
  x,
1971
1992
  pe,
1972
- D,
1993
+ O,
1973
1994
  re,
1974
1995
  oe,
1996
+ H,
1975
1997
  j,
1976
- M,
1977
1998
  ne,
1978
1999
  ie
1979
2000
  ]
1980
2001
  );
1981
2002
  B(() => {
1982
2003
  if (!(!d || !c))
1983
- return c({ type: "register", descriptor: Ye }), () => {
1984
- c({ type: "unregister", traceKey: j });
2004
+ return c({ type: "register", descriptor: Ze }), () => {
2005
+ c({ type: "unregister", traceKey: H });
1985
2006
  };
1986
- }, [Ye, c, d, j]);
1987
- const P = O(
1988
- (C, U) => {
1989
- !d || !c || c({ type: "event", traceKey: j, event: C, latestAttempt: U });
2007
+ }, [Ze, c, d, H]);
2008
+ const M = D(
2009
+ (q, U) => {
2010
+ !d || !c || c({ type: "event", traceKey: H, event: q, latestAttempt: U });
1990
2011
  },
1991
- [c, d, j]
1992
- ), Xe = O(() => {
1993
- P(
2012
+ [c, d, H]
2013
+ ), er = D(() => {
2014
+ M(
1994
2015
  {
1995
2016
  type: "query_started",
1996
2017
  queryId: k,
@@ -1998,10 +2019,10 @@ function Kt({
1998
2019
  },
1999
2020
  { status: "loading" }
2000
2021
  );
2001
- }, [P, k]), Ze = O(
2002
- (C, U) => {
2003
- const se = cr(C), ae = Hn(C), Nr = Vn(C);
2004
- P(
2022
+ }, [M, k]), rr = D(
2023
+ (q, U) => {
2024
+ const se = gr(q), ae = Un(q), zr = Gn(q), ir = pr(q);
2025
+ M(
2005
2026
  {
2006
2027
  type: "query_succeeded",
2007
2028
  queryId: k,
@@ -2015,17 +2036,21 @@ function Kt({
2015
2036
  status: "success",
2016
2037
  durationMs: U,
2017
2038
  rowCount: ae,
2018
- columnCount: Nr,
2019
- metricCoverage: Qn(C),
2020
- executionResult: ur(C)
2039
+ columnCount: zr,
2040
+ metricCoverage: Jn(q),
2041
+ resultPreview: He(
2042
+ ir,
2043
+ Yn(q)
2044
+ ),
2045
+ executionResult: ir
2021
2046
  }
2022
2047
  );
2023
2048
  },
2024
- [P, k]
2025
- ), ge = O(
2026
- (C, U) => {
2027
- const se = cr(C), ae = C instanceof Error ? C.message : String(C);
2028
- P(
2049
+ [M, k]
2050
+ ), ge = D(
2051
+ (q, U) => {
2052
+ const se = gr(q), ae = q instanceof Error ? q.message : String(q);
2053
+ M(
2029
2054
  {
2030
2055
  type: "query_failed",
2031
2056
  queryId: k,
@@ -2038,53 +2063,53 @@ function Kt({
2038
2063
  status: "error",
2039
2064
  durationMs: U,
2040
2065
  errorMessage: ae,
2041
- executionResult: ur(C)
2066
+ executionResult: pr(q)
2042
2067
  }
2043
2068
  );
2044
2069
  },
2045
- [P, k]
2046
- ), er = O(
2047
- (C) => {
2048
- P(
2070
+ [M, k]
2071
+ ), tr = D(
2072
+ (q) => {
2073
+ M(
2049
2074
  {
2050
2075
  type: "query_ignored_stale",
2051
2076
  queryId: k,
2052
2077
  at: be(),
2053
- reason: C
2078
+ reason: q
2054
2079
  }
2055
2080
  );
2056
2081
  },
2057
- [P, k]
2058
- ), rr = O(
2059
- (C) => {
2060
- ge(C, 0);
2082
+ [M, k]
2083
+ ), nr = D(
2084
+ (q) => {
2085
+ ge(q, 0);
2061
2086
  },
2062
2087
  [ge]
2063
- ), Te = d ? u == null ? void 0 : u.state.entries[j] : void 0;
2088
+ ), Te = d ? u == null ? void 0 : u.state.entries[H] : void 0;
2064
2089
  return I(
2065
2090
  () => ({
2066
2091
  enabled: d,
2067
2092
  queryId: k,
2068
2093
  trace: Te ? ve(Te) : void 0,
2069
- start: Xe,
2070
- success: Ze,
2094
+ start: er,
2095
+ success: rr,
2071
2096
  failure: ge,
2072
- ignored: er,
2073
- validationFailure: rr
2097
+ ignored: tr,
2098
+ validationFailure: nr
2074
2099
  }),
2075
2100
  [
2076
2101
  d,
2077
2102
  ge,
2078
- er,
2103
+ tr,
2079
2104
  k,
2080
- Xe,
2081
- Ze,
2105
+ er,
2106
+ rr,
2082
2107
  Te,
2083
- rr
2108
+ nr
2084
2109
  ]
2085
2110
  );
2086
2111
  }
2087
- function Wt() {
2112
+ function Mt() {
2088
2113
  return /* @__PURE__ */ a("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
2089
2114
  "svg",
2090
2115
  {
@@ -2102,19 +2127,19 @@ function Wt() {
2102
2127
  }
2103
2128
  ) });
2104
2129
  }
2105
- function _t({
2130
+ function Ft({
2106
2131
  trace: e
2107
2132
  }) {
2108
2133
  var $, S, w, L, x;
2109
2134
  if (!e)
2110
2135
  return /* @__PURE__ */ a("div", { style: s.detailsPane, children: /* @__PURE__ */ a("div", { style: s.emptyState, children: "No traces registered yet" }) });
2111
- const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = $e(
2136
+ const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = Oe(
2112
2137
  ($ = t == null ? void 0 : t.validation) == null ? void 0 : $.warnings
2113
- ), i = $e((S = t == null ? void 0 : t.validation) == null ? void 0 : S.errors), o = xn(
2138
+ ), i = Oe((S = t == null ? void 0 : t.validation) == null ? void 0 : S.errors), o = Cn(
2114
2139
  (w = t == null ? void 0 : t.coverage) == null ? void 0 : w.missingObligations
2115
- ), u = $e(
2140
+ ), u = Oe(
2116
2141
  (L = t == null ? void 0 : t.coverage) == null ? void 0 : L.warnings
2117
- ), f = t == null ? void 0 : t.compiledQuery, d = Tn(t), c = ((x = e.server) == null ? void 0 : x.compiledSql) || d.compiledSql, y = lt(t), m = [
2142
+ ), f = t == null ? void 0 : t.compiledQuery, d = En(t), c = ((x = e.server) == null ? void 0 : x.compiledSql) || d.compiledSql, g = (r == null ? void 0 : r.resultPreview) || He(t), m = [
2118
2143
  ...r != null && r.errorMessage ? [r.errorMessage] : [],
2119
2144
  ...i
2120
2145
  ], v = [
@@ -2122,7 +2147,7 @@ function _t({
2122
2147
  ...n,
2123
2148
  ...o,
2124
2149
  ...u
2125
- ], g = e.inputsApplied.length > 0, h = !!(f || c), A = pn(e), l = hn(r == null ? void 0 : r.rowCount), b = bn(r == null ? void 0 : r.durationMs), K = e.sourceRefs.length, T = kr(e), N = Tr(T);
2150
+ ], y = e.inputsApplied.length > 0, h = !!(f || c), C = yn(e), l = Sn(r == null ? void 0 : r.rowCount), b = wn(r == null ? void 0 : r.durationMs), K = e.sourceRefs.length, T = Lr(e), N = Er(T);
2126
2151
  return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
2127
2152
  /* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
2128
2153
  /* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
@@ -2132,24 +2157,24 @@ function _t({
2132
2157
  "aria-hidden": !0,
2133
2158
  style: {
2134
2159
  ...s.detailsHeaderStatusDot,
2135
- ...Sr(r == null ? void 0 : r.status)
2160
+ ...xr(r == null ? void 0 : r.status)
2136
2161
  }
2137
2162
  }
2138
2163
  ),
2139
- /* @__PURE__ */ a("span", { style: s.detailsTitle, children: xe(e) }),
2164
+ /* @__PURE__ */ a("span", { style: s.detailsTitle, children: qe(e) }),
2140
2165
  /* @__PURE__ */ a(
2141
2166
  "span",
2142
2167
  {
2143
2168
  style: {
2144
2169
  ...s.detailsKindChip,
2145
- ...Cr(N)
2170
+ ...Rr(N)
2146
2171
  },
2147
2172
  children: T
2148
2173
  }
2149
2174
  )
2150
2175
  ] }),
2151
2176
  /* @__PURE__ */ p("div", { style: s.metaStrip, children: [
2152
- /* @__PURE__ */ a("span", { style: s.metaStripItem, children: A }),
2177
+ /* @__PURE__ */ a("span", { style: s.metaStripItem, children: C }),
2153
2178
  /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
2154
2179
  /* @__PURE__ */ p("span", { style: s.metaStripItem, children: [
2155
2180
  l,
@@ -2157,21 +2182,21 @@ function _t({
2157
2182
  ] }),
2158
2183
  /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
2159
2184
  /* @__PURE__ */ a("span", { style: s.metaStripItem, children: b }),
2160
- K > 0 ? /* @__PURE__ */ p(yr, { children: [
2185
+ K > 0 ? /* @__PURE__ */ p(vr, { children: [
2161
2186
  /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
2162
2187
  /* @__PURE__ */ a("span", { style: s.metaStripItem, children: K === 1 ? "1 source" : `${K} sources` })
2163
2188
  ] }) : null
2164
2189
  ] })
2165
2190
  ] }),
2166
- m.length ? /* @__PURE__ */ a(or, { tone: "error", title: "Error", items: m }) : null,
2167
- v.length ? /* @__PURE__ */ a(or, { tone: "warning", title: "Warnings", items: v }) : null,
2168
- /* @__PURE__ */ a(Mt, { trace: e }),
2169
- g ? /* @__PURE__ */ a(Yt, { inputs: e.inputsApplied }) : null,
2191
+ m.length ? /* @__PURE__ */ a(lr, { tone: "error", title: "Error", items: m }) : null,
2192
+ v.length ? /* @__PURE__ */ a(lr, { tone: "warning", title: "Warnings", items: v }) : null,
2193
+ /* @__PURE__ */ a(Vt, { trace: e }),
2194
+ y ? /* @__PURE__ */ a(en, { inputs: e.inputsApplied }) : null,
2170
2195
  /* @__PURE__ */ a(
2171
- Nt,
2196
+ zt,
2172
2197
  {
2173
2198
  trace: e,
2174
- resultPreview: y,
2199
+ resultPreview: g,
2175
2200
  compiledQuery: f,
2176
2201
  compiledSql: c,
2177
2202
  hasCompiled: h
@@ -2179,24 +2204,24 @@ function _t({
2179
2204
  )
2180
2205
  ] });
2181
2206
  }
2182
- function Nt({
2207
+ function zt({
2183
2208
  trace: e,
2184
2209
  resultPreview: r,
2185
2210
  compiledQuery: t,
2186
2211
  compiledSql: n,
2187
2212
  hasCompiled: i
2188
2213
  }) {
2189
- var h, A;
2214
+ var h, C;
2190
2215
  const o = [];
2191
2216
  r && o.push({
2192
2217
  id: "returned",
2193
2218
  label: "Returned",
2194
- render: () => /* @__PURE__ */ a(Xt, { preview: r })
2219
+ render: () => /* @__PURE__ */ a(rn, { preview: r })
2195
2220
  }), i && o.push({
2196
2221
  id: "compiled",
2197
2222
  label: "Compiled",
2198
2223
  render: () => /* @__PURE__ */ a(
2199
- Zt,
2224
+ tn,
2200
2225
  {
2201
2226
  compiledQuery: t,
2202
2227
  compiledSql: n
@@ -2205,24 +2230,24 @@ function Nt({
2205
2230
  }), (e.sourceRefs.length || e.fieldRefs.length) && o.push({
2206
2231
  id: "lineage",
2207
2232
  label: "Sources",
2208
- render: () => /* @__PURE__ */ a(Vt, { trace: e })
2233
+ render: () => /* @__PURE__ */ a(Gt, { trace: e })
2209
2234
  }), (h = e.sourceHints) != null && h.length && o.push({
2210
2235
  id: "hints",
2211
2236
  label: "Hints",
2212
- render: () => /* @__PURE__ */ a(Qt, { hints: e.sourceHints ?? [] })
2237
+ render: () => /* @__PURE__ */ a(Jt, { hints: e.sourceHints ?? [] })
2213
2238
  }), o.push({
2214
2239
  id: "lifecycle",
2215
2240
  label: "Lifecycle",
2216
- render: () => /* @__PURE__ */ a(Pt, { trace: e })
2241
+ render: () => /* @__PURE__ */ a(jt, { trace: e })
2217
2242
  }), o.push({
2218
2243
  id: "raw",
2219
2244
  label: "Raw",
2220
- render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children: vn(e) })
2245
+ render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children: In(e) })
2221
2246
  });
2222
- const u = (A = o[0]) == null ? void 0 : A.id, f = e.traceId || `${e.viewId ?? ""}:${e.queryId}`, [d, c] = z(u), y = E(f), m = E(!1), v = o.map((l) => l.id).join("|");
2247
+ const u = (C = o[0]) == null ? void 0 : C.id, f = e.traceId || `${e.viewId ?? ""}:${e.queryId}`, [d, c] = z(u), g = E(f), m = E(!1), v = o.map((l) => l.id).join("|");
2223
2248
  B(() => {
2224
- if (y.current !== f) {
2225
- y.current = f, m.current = !1, c(u);
2249
+ if (g.current !== f) {
2250
+ g.current = f, m.current = !1, c(u);
2226
2251
  return;
2227
2252
  }
2228
2253
  if (!(d ? v.split("|").includes(d) : !1)) {
@@ -2231,10 +2256,10 @@ function Nt({
2231
2256
  }
2232
2257
  !m.current && d !== u && c(u);
2233
2258
  }, [d, u, v, f]);
2234
- const g = o.find((l) => l.id === d) ?? o[0];
2259
+ const y = o.find((l) => l.id === d) ?? o[0];
2235
2260
  return /* @__PURE__ */ p("div", { style: s.traceTabs, children: [
2236
2261
  /* @__PURE__ */ a("div", { style: s.traceTabBar, role: "tablist", "aria-label": "Trace details", children: o.map((l) => {
2237
- const b = l.id === g.id;
2262
+ const b = l.id === y.id;
2238
2263
  return /* @__PURE__ */ a(
2239
2264
  "button",
2240
2265
  {
@@ -2254,18 +2279,18 @@ function Nt({
2254
2279
  l.id
2255
2280
  );
2256
2281
  }) }),
2257
- /* @__PURE__ */ a("div", { style: s.traceTabPanel, role: "tabpanel", children: g.render() })
2282
+ /* @__PURE__ */ a("div", { style: s.traceTabPanel, role: "tabpanel", children: y.render() })
2258
2283
  ] });
2259
2284
  }
2260
- function Pt({
2285
+ function jt({
2261
2286
  trace: e
2262
2287
  }) {
2263
2288
  return e.recentEvents.length ? /* @__PURE__ */ a("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((r, t) => /* @__PURE__ */ p("div", { style: s.eventRow, children: [
2264
- /* @__PURE__ */ a("span", { style: s.eventType, children: Sn(r) }),
2265
- /* @__PURE__ */ a("span", { style: s.eventMeta, children: wn(r) })
2289
+ /* @__PURE__ */ a("span", { style: s.eventType, children: xn(r) }),
2290
+ /* @__PURE__ */ a("span", { style: s.eventMeta, children: qn(r) })
2266
2291
  ] }, `${r.type}:${r.at}:${t}`)) }) : /* @__PURE__ */ a("div", { style: s.mutedText, children: "No attempts recorded" });
2267
2292
  }
2268
- function or({
2293
+ function lr({
2269
2294
  tone: e,
2270
2295
  title: r,
2271
2296
  items: t
@@ -2276,7 +2301,7 @@ function or({
2276
2301
  t.length > 1 ? /* @__PURE__ */ a("ul", { style: s.alertCardList, children: t.map((i, o) => /* @__PURE__ */ a("li", { children: i }, `${e}-${o}`)) }) : /* @__PURE__ */ a("div", { children: t[0] })
2277
2302
  ] });
2278
2303
  }
2279
- function Ft({
2304
+ function Ht({
2280
2305
  issues: e,
2281
2306
  onSelect: r
2282
2307
  }) {
@@ -2294,7 +2319,7 @@ function Ft({
2294
2319
  onClick: () => n((c) => !c),
2295
2320
  children: [
2296
2321
  /* @__PURE__ */ p("span", { style: s.issueSummaryHeaderLabel, children: [
2297
- t ? /* @__PURE__ */ a(ot, { size: 13 }) : /* @__PURE__ */ a(nt, { size: 13 }),
2322
+ t ? /* @__PURE__ */ a(lt, { size: 13 }) : /* @__PURE__ */ a(st, { size: 13 }),
2298
2323
  /* @__PURE__ */ a("span", { children: "Issues" })
2299
2324
  ] }),
2300
2325
  /* @__PURE__ */ a("span", { style: s.issueSummaryCount, children: e.length })
@@ -2302,7 +2327,7 @@ function Ft({
2302
2327
  }
2303
2328
  ),
2304
2329
  t ? /* @__PURE__ */ p("div", { style: s.issueSummaryList, children: [
2305
- i.map((c, y) => /* @__PURE__ */ p(
2330
+ i.map((c, g) => /* @__PURE__ */ p(
2306
2331
  "button",
2307
2332
  {
2308
2333
  type: "button",
@@ -2326,7 +2351,7 @@ function Ft({
2326
2351
  ] })
2327
2352
  ]
2328
2353
  },
2329
- `${c.trace.traceId}:${c.title}:${y}`
2354
+ `${c.trace.traceId}:${c.title}:${g}`
2330
2355
  )),
2331
2356
  o > 0 ? /* @__PURE__ */ p("div", { style: s.issueSummaryMore, children: [
2332
2357
  o,
@@ -2340,7 +2365,7 @@ function Ft({
2340
2365
  ] })
2341
2366
  ] });
2342
2367
  }
2343
- function zt({
2368
+ function Pt({
2344
2369
  status: e
2345
2370
  }) {
2346
2371
  return /* @__PURE__ */ a(
@@ -2349,32 +2374,32 @@ function zt({
2349
2374
  "aria-hidden": !0,
2350
2375
  style: {
2351
2376
  ...s.statusDot,
2352
- ...Sr(e)
2377
+ ...xr(e)
2353
2378
  }
2354
2379
  }
2355
2380
  );
2356
2381
  }
2357
- function Mt({
2382
+ function Vt({
2358
2383
  trace: e
2359
2384
  }) {
2360
2385
  var i;
2361
- const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = fn(r);
2386
+ const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = mn(r);
2362
2387
  return /* @__PURE__ */ p("div", { style: s.recipe, children: [
2363
- /* @__PURE__ */ a(jt, { sources: e.sourceRefs }),
2364
- /* @__PURE__ */ a(H, { title: "Measures", fields: n.measures }),
2365
- /* @__PURE__ */ a(H, { title: "Time fields", fields: n.timeFields }),
2388
+ /* @__PURE__ */ a(Qt, { sources: e.sourceRefs }),
2389
+ /* @__PURE__ */ a(P, { title: "Measures", fields: n.measures }),
2390
+ /* @__PURE__ */ a(P, { title: "Time fields", fields: n.timeFields }),
2366
2391
  /* @__PURE__ */ a(
2367
- H,
2392
+ P,
2368
2393
  {
2369
2394
  title: "Dimensions",
2370
2395
  fields: n.dimensions,
2371
2396
  emptyText: "No dimensions selected"
2372
2397
  }
2373
2398
  ),
2374
- /* @__PURE__ */ a(H, { title: "Identifiers", fields: n.identifiers }),
2375
- /* @__PURE__ */ a(H, { title: "Other fields", fields: n.other }),
2399
+ /* @__PURE__ */ a(P, { title: "Identifiers", fields: n.identifiers }),
2400
+ /* @__PURE__ */ a(P, { title: "Other fields", fields: n.other }),
2376
2401
  /* @__PURE__ */ a(
2377
- H,
2402
+ P,
2378
2403
  {
2379
2404
  title: "Input bindings (Filters)",
2380
2405
  fields: t
@@ -2382,7 +2407,7 @@ function Mt({
2382
2407
  )
2383
2408
  ] });
2384
2409
  }
2385
- function jt({
2410
+ function Qt({
2386
2411
  sources: e
2387
2412
  }) {
2388
2413
  return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
@@ -2391,7 +2416,7 @@ function jt({
2391
2416
  /* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
2392
2417
  ] }),
2393
2418
  /* @__PURE__ */ a("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ a(
2394
- Ht,
2419
+ Ut,
2395
2420
  {
2396
2421
  source: r
2397
2422
  },
@@ -2399,20 +2424,20 @@ function jt({
2399
2424
  )) })
2400
2425
  ] }) : null;
2401
2426
  }
2402
- function Ht({ source: e }) {
2427
+ function Ut({ source: e }) {
2403
2428
  const r = F(e);
2404
2429
  return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
2405
2430
  /* @__PURE__ */ a("span", { style: s.sourcePillLabel, children: r }),
2406
2431
  /* @__PURE__ */ a("span", { style: s.sourcePillRole, children: e.kind })
2407
2432
  ] });
2408
2433
  }
2409
- function Vt({
2434
+ function Gt({
2410
2435
  trace: e
2411
2436
  }) {
2412
2437
  return /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
2413
- /* @__PURE__ */ a(Ut, { sources: e.sourceRefs }),
2438
+ /* @__PURE__ */ a(Yt, { sources: e.sourceRefs }),
2414
2439
  /* @__PURE__ */ a(
2415
- H,
2440
+ P,
2416
2441
  {
2417
2442
  title: "All field refs",
2418
2443
  fields: e.fieldRefs,
@@ -2421,11 +2446,11 @@ function Vt({
2421
2446
  )
2422
2447
  ] });
2423
2448
  }
2424
- function Qt({
2449
+ function Jt({
2425
2450
  hints: e
2426
2451
  }) {
2427
2452
  return /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => {
2428
- const n = yn(r), i = r.component || r.exportName || n || "Source hint", o = [
2453
+ const n = vn(r), i = r.component || r.exportName || n || "Source hint", o = [
2429
2454
  r.exportName && r.exportName !== i ? r.exportName : void 0,
2430
2455
  n,
2431
2456
  r.note
@@ -2444,7 +2469,7 @@ function Qt({
2444
2469
  );
2445
2470
  }) });
2446
2471
  }
2447
- function Ut({
2472
+ function Yt({
2448
2473
  sources: e
2449
2474
  }) {
2450
2475
  return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
@@ -2466,7 +2491,7 @@ function Ut({
2466
2491
  )) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: "No sources captured" })
2467
2492
  ] });
2468
2493
  }
2469
- function H({
2494
+ function P({
2470
2495
  title: e,
2471
2496
  fields: r,
2472
2497
  emptyText: t
@@ -2477,20 +2502,20 @@ function H({
2477
2502
  /* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: r.length })
2478
2503
  ] }),
2479
2504
  r.length ? /* @__PURE__ */ a("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ a(
2480
- Gt,
2505
+ Xt,
2481
2506
  {
2482
2507
  field: n,
2483
2508
  groupTitle: e
2484
2509
  },
2485
- `${Qe(n)}:${i}`
2510
+ `${Ge(n)}:${i}`
2486
2511
  )) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: t })
2487
2512
  ] });
2488
2513
  }
2489
- function Gt({
2514
+ function Xt({
2490
2515
  field: e,
2491
2516
  groupTitle: r
2492
2517
  }) {
2493
- const t = gn(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, o = e.source ? F(e.source) : void 0, u = [t, i, o].filter(Boolean).join(" · "), f = Jt(e, r);
2518
+ const t = hn(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, o = e.source ? F(e.source) : void 0, u = [t, i, o].filter(Boolean).join(" · "), f = Zt(e, r);
2494
2519
  return /* @__PURE__ */ p(
2495
2520
  "div",
2496
2521
  {
@@ -2508,7 +2533,7 @@ function Gt({
2508
2533
  }
2509
2534
  );
2510
2535
  }
2511
- function Jt(e, r) {
2536
+ function Zt(e, r) {
2512
2537
  const t = e.dataType, n = e.role;
2513
2538
  return !!e.aggregate || n === "measure" || r === "Measures" ? {
2514
2539
  text: "Σ",
@@ -2547,7 +2572,7 @@ function Jt(e, r) {
2547
2572
  }
2548
2573
  };
2549
2574
  }
2550
- function Yt({
2575
+ function en({
2551
2576
  inputs: e
2552
2577
  }) {
2553
2578
  return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
@@ -2556,7 +2581,7 @@ function Yt({
2556
2581
  /* @__PURE__ */ a("span", { style: s.inputsAppliedCount, children: e.length })
2557
2582
  ] }),
2558
2583
  /* @__PURE__ */ a("div", { style: s.inputRecipeList, children: e.map((r) => {
2559
- const t = mn(r);
2584
+ const t = bn(r);
2560
2585
  return /* @__PURE__ */ p(
2561
2586
  "div",
2562
2587
  {
@@ -2577,7 +2602,7 @@ function Yt({
2577
2602
  }) })
2578
2603
  ] });
2579
2604
  }
2580
- function Xt({
2605
+ function rn({
2581
2606
  preview: e
2582
2607
  }) {
2583
2608
  return /* @__PURE__ */ p("div", { style: s.resultPreview, children: [
@@ -2587,7 +2612,7 @@ function Xt({
2587
2612
  ] }),
2588
2613
  /* @__PURE__ */ a("div", { style: s.resultPreviewScroller, children: /* @__PURE__ */ p("table", { style: s.resultPreviewTable, children: [
2589
2614
  /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: e.columns.map((r) => /* @__PURE__ */ a("th", { style: s.resultPreviewTh, children: r.label }, r.key)) }) }),
2590
- /* @__PURE__ */ a("tbody", { children: e.rows.length ? e.rows.map((r, t) => /* @__PURE__ */ a("tr", { children: e.columns.map((n) => /* @__PURE__ */ a("td", { style: s.resultPreviewTd, children: ct(r[n.key]) }, n.key)) }, t)) : /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
2615
+ /* @__PURE__ */ a("tbody", { children: e.rows.length ? e.rows.map((r, t) => /* @__PURE__ */ a("tr", { children: e.columns.map((n) => /* @__PURE__ */ a("td", { style: s.resultPreviewTd, children: gt(r[n.key]) }, n.key)) }, t)) : /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
2591
2616
  "td",
2592
2617
  {
2593
2618
  colSpan: e.columns.length,
@@ -2601,28 +2626,28 @@ function Xt({
2601
2626
  ce,
2602
2627
  " rows and first",
2603
2628
  " ",
2604
- _e,
2629
+ Ne,
2605
2630
  " columns."
2606
2631
  ] }) : null
2607
2632
  ] });
2608
2633
  }
2609
- function Zt({
2634
+ function tn({
2610
2635
  compiledQuery: e,
2611
2636
  compiledSql: r
2612
2637
  }) {
2613
2638
  return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
2614
- /* @__PURE__ */ a(sr, { label: "SQL", value: e.sql }),
2615
- e.pythonCode ? /* @__PURE__ */ a(Le, { label: "Python", value: e.pythonCode }) : null,
2639
+ /* @__PURE__ */ a(dr, { label: "SQL", value: e.sql }),
2640
+ e.pythonCode ? /* @__PURE__ */ a($e, { label: "Python", value: e.pythonCode }) : null,
2616
2641
  e.parameters ? /* @__PURE__ */ a(
2617
- Le,
2642
+ $e,
2618
2643
  {
2619
2644
  label: "Parameters",
2620
- value: Pe(e.parameters)
2645
+ value: Fe(e.parameters)
2621
2646
  }
2622
2647
  ) : null
2623
- ] }) : r ? /* @__PURE__ */ a(sr, { label: "SQL", value: r }) : /* @__PURE__ */ a(Le, { label: "Compiled Query", value: Pe(e) });
2648
+ ] }) : r ? /* @__PURE__ */ a(dr, { label: "SQL", value: r }) : /* @__PURE__ */ a($e, { label: "Compiled Query", value: Fe(e) });
2624
2649
  }
2625
- function Le({
2650
+ function $e({
2626
2651
  label: e,
2627
2652
  value: r
2628
2653
  }) {
@@ -2631,16 +2656,16 @@ function Le({
2631
2656
  /* @__PURE__ */ a("pre", { style: s.codeBlock, children: r })
2632
2657
  ] });
2633
2658
  }
2634
- function sr({
2659
+ function dr({
2635
2660
  label: e,
2636
2661
  value: r
2637
2662
  }) {
2638
2663
  return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
2639
2664
  /* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
2640
- /* @__PURE__ */ a("pre", { style: s.codeBlock, children: rn(r) })
2665
+ /* @__PURE__ */ a("pre", { style: s.codeBlock, children: on(r) })
2641
2666
  ] });
2642
2667
  }
2643
- const en = /* @__PURE__ */ new Set([
2668
+ const nn = /* @__PURE__ */ new Set([
2644
2669
  "SELECT",
2645
2670
  "FROM",
2646
2671
  "JOIN",
@@ -2678,14 +2703,14 @@ const en = /* @__PURE__ */ new Set([
2678
2703
  "ALL",
2679
2704
  "WITH"
2680
2705
  ]);
2681
- function rn(e) {
2706
+ function on(e) {
2682
2707
  return e.split(/(\s+|,|\(|\))/).map((t, n) => {
2683
2708
  if (!t) return null;
2684
2709
  const i = t.toUpperCase();
2685
- return en.has(i) ? /* @__PURE__ */ a("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ a("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ a("span", { children: t }, n);
2710
+ return nn.has(i) ? /* @__PURE__ */ a("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ a("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ a("span", { children: t }, n);
2686
2711
  });
2687
2712
  }
2688
- function tn(e) {
2713
+ function sn(e) {
2689
2714
  return [
2690
2715
  `${e.total} ${e.total === 1 ? "trace" : "traces"}`,
2691
2716
  `${e.loading} loading`,
@@ -2694,7 +2719,7 @@ function tn(e) {
2694
2719
  `${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
2695
2720
  ].join(" · ");
2696
2721
  }
2697
- function nn(e, r) {
2722
+ function an(e, r) {
2698
2723
  const t = r.trim().toLowerCase();
2699
2724
  return t ? e.filter(
2700
2725
  (n) => [
@@ -2706,36 +2731,36 @@ function nn(e, r) {
2706
2731
  n.sectionTitle,
2707
2732
  n.builder,
2708
2733
  n.queryKind,
2709
- Er(n)
2734
+ $r(n)
2710
2735
  ].filter(Boolean).join(" ").toLowerCase().includes(t)
2711
2736
  ) : e;
2712
2737
  }
2713
- function on(e) {
2714
- const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Ne));
2738
+ function ln(e) {
2739
+ const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Me));
2715
2740
  return [
2716
- { title: "Views", traces: e.filter((i) => !t.has(Ne(i))) },
2741
+ { title: "Views", traces: e.filter((i) => !t.has(Me(i))) },
2717
2742
  { title: "Inputs", traces: r }
2718
2743
  ];
2719
2744
  }
2720
- function Ar(e, r) {
2745
+ function kr(e, r) {
2721
2746
  if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
2722
2747
  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));
2723
2748
  }
2724
- function sn(e, r) {
2749
+ function dn(e, r) {
2725
2750
  if (r.queryId)
2726
- return Ar(e, r);
2751
+ return kr(e, r);
2727
2752
  if (!r.viewId)
2728
2753
  return;
2729
2754
  const t = e.filter((n) => n.viewId === r.viewId);
2730
2755
  return t.length === 1 ? t[0] : void 0;
2731
2756
  }
2732
- function an(e, r) {
2757
+ function un(e, r) {
2733
2758
  return !!(e && r && e.traceId === r.traceId);
2734
2759
  }
2735
- function Ne(e) {
2760
+ function Me(e) {
2736
2761
  return e.traceId;
2737
2762
  }
2738
- function ln(e) {
2763
+ function cn(e) {
2739
2764
  switch (e) {
2740
2765
  case "metric":
2741
2766
  return "metric";
@@ -2750,14 +2775,14 @@ function ln(e) {
2750
2775
  case "sql":
2751
2776
  return "sql";
2752
2777
  default:
2753
- return qe(e);
2778
+ return Ae(e);
2754
2779
  }
2755
2780
  }
2756
- function Tr(e) {
2781
+ function Er(e) {
2757
2782
  const r = e.trim().toLowerCase();
2758
2783
  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";
2759
2784
  }
2760
- function Cr(e) {
2785
+ function Rr(e) {
2761
2786
  switch (e) {
2762
2787
  case "metric":
2763
2788
  return {
@@ -2789,25 +2814,25 @@ function Cr(e) {
2789
2814
  };
2790
2815
  }
2791
2816
  }
2792
- function dn(e, r, t) {
2817
+ function fn(e, r, t) {
2793
2818
  const n = [];
2794
2819
  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;
2795
2820
  }
2796
- function kr(e) {
2797
- return cn(e.visualType) || ln(e.queryKind);
2821
+ function Lr(e) {
2822
+ return gn(e.visualType) || cn(e.queryKind);
2798
2823
  }
2799
- function un(e, r) {
2800
- return r ? e.queryLabel || e.queryId : xe(e);
2824
+ function pn(e, r) {
2825
+ return r ? e.queryLabel || e.queryId : qe(e);
2801
2826
  }
2802
- function cn(e) {
2827
+ function gn(e) {
2803
2828
  if (e)
2804
2829
  return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
2805
2830
  }
2806
- function Er(e) {
2831
+ function $r(e) {
2807
2832
  const r = e.sourceRefs.map(F);
2808
2833
  return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
2809
2834
  }
2810
- function fn(e) {
2835
+ function mn(e) {
2811
2836
  return e.reduce(
2812
2837
  (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),
2813
2838
  {
@@ -2819,7 +2844,7 @@ function fn(e) {
2819
2844
  }
2820
2845
  );
2821
2846
  }
2822
- function pn(e) {
2847
+ function yn(e) {
2823
2848
  var r, t;
2824
2849
  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)
2825
2850
  return "KPI query";
@@ -2837,13 +2862,13 @@ function pn(e) {
2837
2862
  case "sql":
2838
2863
  return "SQL query";
2839
2864
  default:
2840
- return qe(e.queryKind);
2865
+ return Ae(e.queryKind);
2841
2866
  }
2842
2867
  }
2843
- function gn(e) {
2868
+ function hn(e) {
2844
2869
  return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
2845
2870
  }
2846
- function mn(e) {
2871
+ function bn(e) {
2847
2872
  var f, d, c;
2848
2873
  const r = e.valuePreview || "redacted", t = e.inputLabel || e.inputId, n = ((f = e.fieldRef) == null ? void 0 : f.label) || ((d = e.fieldRef) == null ? void 0 : d.name), i = (c = e.fieldRef) != null && c.source ? F(e.fieldRef.source) : void 0, o = [n ? `on ${n}` : void 0, i].filter(Boolean).join(" · "), u = [
2849
2874
  t,
@@ -2867,23 +2892,23 @@ function F(e) {
2867
2892
  e.tableName
2868
2893
  ].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
2869
2894
  }
2870
- function yn(e) {
2895
+ function vn(e) {
2871
2896
  if (e.file)
2872
2897
  return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
2873
2898
  }
2874
- function hn(e) {
2899
+ function Sn(e) {
2875
2900
  return typeof e == "number" ? e.toLocaleString() : "-";
2876
2901
  }
2877
- function bn(e) {
2902
+ function wn(e) {
2878
2903
  return typeof e == "number" ? `${Math.round(e)}ms` : "-";
2879
2904
  }
2880
- function vn(e) {
2881
- return Pe(e);
2905
+ function In(e) {
2906
+ return Fe(e);
2882
2907
  }
2883
- function Pe(e) {
2908
+ function Fe(e) {
2884
2909
  return JSON.stringify(e, null, 2) ?? "undefined";
2885
2910
  }
2886
- function Sn(e) {
2911
+ function xn(e) {
2887
2912
  switch (e.type) {
2888
2913
  case "query_started":
2889
2914
  return "Started";
@@ -2896,10 +2921,10 @@ function Sn(e) {
2896
2921
  case "input_changed":
2897
2922
  return "Input changed";
2898
2923
  default:
2899
- return In(e);
2924
+ return An(e);
2900
2925
  }
2901
2926
  }
2902
- function wn(e) {
2927
+ function qn(e) {
2903
2928
  return [
2904
2929
  e.at,
2905
2930
  "durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
@@ -2908,20 +2933,20 @@ function wn(e) {
2908
2933
  "errorMessage" in e ? e.errorMessage : void 0
2909
2934
  ].filter(Boolean).join(" - ");
2910
2935
  }
2911
- function In(e) {
2936
+ function An(e) {
2912
2937
  throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
2913
2938
  }
2914
- function xn(e) {
2939
+ function Cn(e) {
2915
2940
  return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
2916
2941
  }
2917
- function $e(e) {
2918
- return Array.isArray(e) ? e.map((r) => qn(r)).filter((r) => !!r) : [];
2942
+ function Oe(e) {
2943
+ return Array.isArray(e) ? e.map((r) => Tn(r)).filter((r) => !!r) : [];
2919
2944
  }
2920
- function qn(e) {
2945
+ function Tn(e) {
2921
2946
  var r;
2922
- return (r = An(e)) == null ? void 0 : r.message;
2947
+ return (r = kn(e)) == null ? void 0 : r.message;
2923
2948
  }
2924
- function An(e) {
2949
+ function kn(e) {
2925
2950
  if (typeof e == "string")
2926
2951
  return { message: e };
2927
2952
  if (!e || typeof e != "object" || Array.isArray(e))
@@ -2933,14 +2958,14 @@ function An(e) {
2933
2958
  ...i ? { path: i } : {}
2934
2959
  } : t ? { message: t } : n ? { message: n, code: n } : void 0;
2935
2960
  }
2936
- function Tn(e) {
2961
+ function En(e) {
2937
2962
  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;
2938
2963
  return {
2939
2964
  compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
2940
2965
  queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
2941
2966
  };
2942
2967
  }
2943
- function Rr(e) {
2968
+ function Or(e) {
2944
2969
  return {
2945
2970
  ...e,
2946
2971
  order: [],
@@ -2948,29 +2973,29 @@ function Rr(e) {
2948
2973
  sequence: 0
2949
2974
  };
2950
2975
  }
2951
- function Cn(e, r) {
2976
+ function Rn(e, r) {
2952
2977
  if (r.type === "config")
2953
2978
  return r.config.enabled ? {
2954
2979
  ...e,
2955
2980
  ...r.config
2956
- } : Rr(r.config);
2981
+ } : Or(r.config);
2957
2982
  if (!e.enabled)
2958
2983
  return e;
2959
2984
  switch (r.type) {
2960
2985
  case "register":
2961
- return Ln(kn(e, r.descriptor));
2986
+ return Dn(Ln(e, r.descriptor));
2962
2987
  case "unregister":
2963
- return En(e, r.traceKey);
2988
+ return $n(e, r.traceKey);
2964
2989
  case "event":
2965
- return Rn(e, r);
2990
+ return On(e, r);
2966
2991
  default:
2967
2992
  return e;
2968
2993
  }
2969
2994
  }
2970
- function kn(e, r) {
2971
- const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Ue(), o = {
2972
- ...t || $n(r),
2973
- ...Lr(r),
2995
+ function Ln(e, r) {
2996
+ const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Je(), o = {
2997
+ ...t || Bn(r),
2998
+ ...Dr(r),
2974
2999
  traceKey: r.traceKey,
2975
3000
  latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
2976
3001
  recentEvents: (t == null ? void 0 : t.recentEvents) || [],
@@ -2988,7 +3013,7 @@ function kn(e, r) {
2988
3013
  }
2989
3014
  };
2990
3015
  }
2991
- function En(e, r) {
3016
+ function $n(e, r) {
2992
3017
  const t = e.entries[r];
2993
3018
  return t ? {
2994
3019
  ...e,
@@ -3001,11 +3026,11 @@ function En(e, r) {
3001
3026
  }
3002
3027
  } : e;
3003
3028
  }
3004
- function Rn(e, r) {
3029
+ function On(e, r) {
3005
3030
  const t = e.entries[r.traceKey];
3006
3031
  if (!t)
3007
3032
  return e;
3008
- const n = Ue(), i = [
3033
+ const n = Je(), i = [
3009
3034
  ...t.recentEvents,
3010
3035
  r.event
3011
3036
  ].slice(-e.maxEventsPerQuery);
@@ -3025,7 +3050,7 @@ function Rn(e, r) {
3025
3050
  }
3026
3051
  };
3027
3052
  }
3028
- function Ln(e) {
3053
+ function Dn(e) {
3029
3054
  if (e.order.length <= e.maxQueries)
3030
3055
  return e;
3031
3056
  const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, o) => i.mounted !== o.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - o.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
@@ -3039,10 +3064,10 @@ function Ln(e) {
3039
3064
  )
3040
3065
  } : e;
3041
3066
  }
3042
- function $n(e) {
3043
- const r = Ue();
3067
+ function Bn(e) {
3068
+ const r = Je();
3044
3069
  return {
3045
- ...Lr(e),
3070
+ ...Dr(e),
3046
3071
  traceKey: e.traceKey,
3047
3072
  latestAttempt: { status: "idle" },
3048
3073
  recentEvents: [],
@@ -3051,14 +3076,14 @@ function $n(e) {
3051
3076
  lastEventAt: r
3052
3077
  };
3053
3078
  }
3054
- function Lr(e) {
3079
+ function Dr(e) {
3055
3080
  var n;
3056
- const r = Fn(e.spec), t = zn(
3081
+ const r = Hn(e.spec), t = Pn(
3057
3082
  e.spec,
3058
3083
  e.activeInputs
3059
3084
  );
3060
3085
  return {
3061
- traceId: Dr(e.traceKey),
3086
+ traceId: Kr(e.traceKey),
3062
3087
  viewId: e.viewId,
3063
3088
  viewTitle: e.viewTitle,
3064
3089
  visualType: e.visualType,
@@ -3067,17 +3092,17 @@ function Lr(e) {
3067
3092
  queryLabel: e.queryLabel,
3068
3093
  queryKind: e.queryKind,
3069
3094
  builder: e.builder,
3070
- sourceRefs: Pn(e.intent),
3095
+ sourceRefs: jn(e.intent),
3071
3096
  sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
3072
3097
  projectionFieldRefs: r,
3073
3098
  inputFieldRefs: t,
3074
- fieldRefs: Mn(e.intent),
3099
+ fieldRefs: Vn(e.intent),
3075
3100
  inputsApplied: (e.activeInputs || []).map((i) => ({
3076
3101
  inputId: i.inputId,
3077
3102
  inputLabel: i.label,
3078
3103
  fieldRef: i.field,
3079
3104
  operator: i.operator,
3080
- valuePreview: _n(i)
3105
+ valuePreview: Fn(i)
3081
3106
  })),
3082
3107
  recentEvents: [],
3083
3108
  clientWarnings: e.clientWarnings
@@ -3095,8 +3120,8 @@ function ve(e) {
3095
3120
  }
3096
3121
  function de(e) {
3097
3122
  if (!e.enabled)
3098
- return Ir;
3099
- const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(ve), t = Me(r).map(mt);
3123
+ return Ar;
3124
+ const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(ve), t = Pe(r).map(bt);
3100
3125
  return {
3101
3126
  enabled: !0,
3102
3127
  queries: r,
@@ -3110,48 +3135,48 @@ function de(e) {
3110
3135
  getQueries: (n) => Object.values(e.entries).filter((i) => i.queryId === n).map(ve)
3111
3136
  };
3112
3137
  }
3113
- function Dn(e) {
3138
+ function Kn(e) {
3114
3139
  return {
3115
- snapshot: () => St(de(e())),
3116
- getQuery: (r) => nr(de(e()).getQuery(r)),
3117
- getQueries: (r) => de(e()).getQueries(r).map((t) => nr(t)).filter((t) => !!t),
3140
+ snapshot: () => xt(de(e())),
3141
+ getQuery: (r) => sr(de(e()).getQuery(r)),
3142
+ getQueries: (r) => de(e()).getQueries(r).map((t) => sr(t)).filter((t) => !!t),
3118
3143
  getIssues: () => de(e()).issues
3119
3144
  };
3120
3145
  }
3121
- function On(e) {
3146
+ function Wn(e) {
3122
3147
  return e === void 0 || e === !1 ? {
3123
3148
  enabled: !1,
3124
3149
  exposeWindowBridge: !1,
3125
- maxEventsPerQuery: Ee,
3126
- maxQueries: Re
3150
+ maxEventsPerQuery: Re,
3151
+ maxQueries: Le
3127
3152
  } : e === !0 ? {
3128
3153
  enabled: !0,
3129
3154
  exposeWindowBridge: !1,
3130
- maxEventsPerQuery: Ee,
3131
- maxQueries: Re
3155
+ maxEventsPerQuery: Re,
3156
+ maxQueries: Le
3132
3157
  } : {
3133
3158
  enabled: e.enabled !== !1,
3134
3159
  exposeWindowBridge: e.exposeWindowBridge === !0,
3135
- maxEventsPerQuery: lr(
3160
+ maxEventsPerQuery: cr(
3136
3161
  e.maxEventsPerQuery,
3137
- Ee,
3138
- Rt
3162
+ Re,
3163
+ Ot
3139
3164
  ),
3140
- maxQueries: lr(
3165
+ maxQueries: cr(
3141
3166
  e.maxQueries,
3142
- Re,
3143
- Lt
3167
+ Le,
3168
+ Dt
3144
3169
  )
3145
3170
  };
3146
3171
  }
3147
- function Bn(e) {
3172
+ function _n(e) {
3148
3173
  const t = [
3149
3174
  e == null ? void 0 : e.sourceHint,
3150
3175
  ...(e == null ? void 0 : e.sourceHints) || []
3151
3176
  ].filter((n) => !!n).map((n) => ({
3152
3177
  file: he(n.file),
3153
- line: ar(n.line),
3154
- column: ar(n.column),
3178
+ line: ur(n.line),
3179
+ column: ur(n.column),
3155
3180
  exportName: he(n.exportName),
3156
3181
  component: he(n.component),
3157
3182
  note: he(n.note)
@@ -3166,16 +3191,16 @@ function he(e) {
3166
3191
  const r = e.trim();
3167
3192
  return r || void 0;
3168
3193
  }
3169
- function ar(e) {
3194
+ function ur(e) {
3170
3195
  return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
3171
3196
  }
3172
- function lr(e, r, t) {
3197
+ function cr(e, r, t) {
3173
3198
  return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
3174
3199
  }
3175
- function Kn(e) {
3200
+ function Nn(e) {
3176
3201
  return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
3177
3202
  }
3178
- function Wn(e) {
3203
+ function Mn(e) {
3179
3204
  switch (e) {
3180
3205
  case "metric":
3181
3206
  return "semaphor.metric";
@@ -3190,14 +3215,14 @@ function Wn(e) {
3190
3215
  case "sql":
3191
3216
  return "semaphor.sql";
3192
3217
  default:
3193
- return qe(e);
3218
+ return Ae(e);
3194
3219
  }
3195
3220
  }
3196
- function qe(e) {
3221
+ function Ae(e) {
3197
3222
  throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
3198
3223
  }
3199
- function _n(e) {
3200
- if (Nn(e))
3224
+ function Fn(e) {
3225
+ if (zn(e))
3201
3226
  return;
3202
3227
  const r = e.value;
3203
3228
  if (r !== void 0) {
@@ -3207,17 +3232,17 @@ function _n(e) {
3207
3232
  ).map((n) => String(n));
3208
3233
  if (t.length === r.length && t.length > 0) {
3209
3234
  const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
3210
- return dr(`${n}${i}`);
3235
+ return fr(`${n}${i}`);
3211
3236
  }
3212
3237
  return `${r.length} selected`;
3213
3238
  }
3214
- return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? dr(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
3239
+ return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? fr(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
3215
3240
  }
3216
3241
  }
3217
- function dr(e) {
3242
+ function fr(e) {
3218
3243
  return e.length > 80 ? `${e.slice(0, 77)}...` : e;
3219
3244
  }
3220
- function Nn(e) {
3245
+ function zn(e) {
3221
3246
  var t;
3222
3247
  const r = [
3223
3248
  e.inputId,
@@ -3228,13 +3253,13 @@ function Nn(e) {
3228
3253
  (n) => r.includes(n)
3229
3254
  );
3230
3255
  }
3231
- function Pn(e) {
3256
+ function jn(e) {
3232
3257
  const r = [];
3233
- return we(e, (t) => {
3234
- jn(t) && r.push(t);
3235
- }), Xr(r);
3258
+ return Ie(e, (t) => {
3259
+ Qn(t) && r.push(t);
3260
+ }), rt(r);
3236
3261
  }
3237
- function Fn(e) {
3262
+ function Hn(e) {
3238
3263
  switch (e.queryKind) {
3239
3264
  case "metric":
3240
3265
  case "analysis":
@@ -3262,12 +3287,12 @@ function Fn(e) {
3262
3287
  ...(e.values || []).map(De)
3263
3288
  ]);
3264
3289
  default:
3265
- return qe(e);
3290
+ return Ae(e);
3266
3291
  }
3267
3292
  }
3268
- function zn(e, r) {
3293
+ function Pn(e, r) {
3269
3294
  const t = [
3270
- ...(e.inputs || []).map($r),
3295
+ ...(e.inputs || []).map(Br),
3271
3296
  ...(r || []).map((n) => n.field)
3272
3297
  ];
3273
3298
  return Y(t);
@@ -3275,16 +3300,16 @@ function zn(e, r) {
3275
3300
  function Y(e) {
3276
3301
  const r = /* @__PURE__ */ new Map();
3277
3302
  return e.forEach((t) => {
3278
- t && fe(t) && r.set(Qe(t), t);
3303
+ t && fe(t) && r.set(Ge(t), t);
3279
3304
  }), [...r.values()];
3280
3305
  }
3281
- function $r(e) {
3306
+ function Br(e) {
3282
3307
  if (!e || typeof e != "object")
3283
3308
  return;
3284
3309
  const r = e.toAnalyticsInput;
3285
3310
  if (typeof r == "function") {
3286
3311
  const n = r.call(e);
3287
- return $r(n);
3312
+ return Br(n);
3288
3313
  }
3289
3314
  const t = e.field;
3290
3315
  return fe(t) ? t : void 0;
@@ -3297,24 +3322,24 @@ function De(e) {
3297
3322
  const r = e.field;
3298
3323
  return fe(r) ? r : void 0;
3299
3324
  }
3300
- function Mn(e) {
3325
+ function Vn(e) {
3301
3326
  const r = /* @__PURE__ */ new Map();
3302
- return we(e, (t) => {
3303
- fe(t) && r.set(Qe(t), t);
3327
+ return Ie(e, (t) => {
3328
+ fe(t) && r.set(Ge(t), t);
3304
3329
  }), [...r.values()];
3305
3330
  }
3306
- function we(e, r) {
3331
+ function Ie(e, r) {
3307
3332
  if (!(!e || typeof e != "object")) {
3308
3333
  if (r(e), Array.isArray(e)) {
3309
- e.forEach((t) => we(t, r));
3334
+ e.forEach((t) => Ie(t, r));
3310
3335
  return;
3311
3336
  }
3312
3337
  Object.values(e).forEach(
3313
- (t) => we(t, r)
3338
+ (t) => Ie(t, r)
3314
3339
  );
3315
3340
  }
3316
3341
  }
3317
- function jn(e) {
3342
+ function Qn(e) {
3318
3343
  if (!e || typeof e != "object")
3319
3344
  return !1;
3320
3345
  const r = e;
@@ -3326,27 +3351,27 @@ function fe(e) {
3326
3351
  const r = e;
3327
3352
  return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
3328
3353
  }
3329
- function Qe(e) {
3354
+ function Ge(e) {
3330
3355
  return [
3331
3356
  e.name,
3332
3357
  e.role,
3333
3358
  e.aggregate,
3334
- e.source ? Yr(e.source) : ""
3359
+ e.source ? et(e.source) : ""
3335
3360
  ].join(":");
3336
3361
  }
3337
- function Hn(e) {
3362
+ function Un(e) {
3338
3363
  const r = e;
3339
3364
  return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
3340
3365
  }
3341
- function Vn(e) {
3366
+ function Gn(e) {
3342
3367
  const r = e;
3343
3368
  return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
3344
3369
  }
3345
- function ur(e) {
3370
+ function pr(e) {
3346
3371
  const r = e;
3347
3372
  return r == null ? void 0 : r.executionResult;
3348
3373
  }
3349
- function Qn(e) {
3374
+ function Jn(e) {
3350
3375
  const r = e, t = [
3351
3376
  ...r != null && r.measures ? Object.keys(r.measures) : [],
3352
3377
  ...r != null && r.measureBindings ? Object.keys(r.measureBindings) : []
@@ -3359,11 +3384,29 @@ function Qn(e) {
3359
3384
  ...n.length > 0 ? { missingMeasures: n } : {}
3360
3385
  };
3361
3386
  }
3362
- function cr(e) {
3387
+ function Yn(e) {
3388
+ const r = e;
3389
+ if (!r || typeof r != "object")
3390
+ return;
3391
+ const t = {};
3392
+ return Se(r.primaryValue) && (t.primaryValue = r.primaryValue), Se(r.value) && (t.value = r.value), Se(r.comparisonValue) && (t.comparisonValue = r.comparisonValue), typeof r.comparisonKind == "string" && (t.comparisonKind = r.comparisonKind), (typeof r.delta == "number" || r.delta === null) && (t.delta = r.delta), (typeof r.deltaPercent == "number" || r.deltaPercent === null) && (t.deltaPercent = r.deltaPercent), Xn(r.measures) && (t.measures = r.measures), Zn(r.measureBindings) && (t.measureBindings = r.measureBindings), Array.isArray(r.missingMeasures) && (t.missingMeasures = r.missingMeasures.filter(
3393
+ (n) => typeof n == "string" && !!n
3394
+ )), Object.keys(t).length > 0 ? t : void 0;
3395
+ }
3396
+ function Se(e) {
3397
+ return e === null || typeof e == "number" || typeof e == "string";
3398
+ }
3399
+ function Xn(e) {
3400
+ return e !== null && typeof e == "object" && !Array.isArray(e) && Object.values(e).every(Se);
3401
+ }
3402
+ function Zn(e) {
3403
+ return e !== null && typeof e == "object" && !Array.isArray(e) && Object.values(e).every((r) => typeof r == "string");
3404
+ }
3405
+ function gr(e) {
3363
3406
  const r = e;
3364
3407
  return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
3365
3408
  }
3366
- function Dr(e) {
3409
+ function Kr(e) {
3367
3410
  let r = 2166136261;
3368
3411
  for (let t = 0; t < e.length; t += 1)
3369
3412
  r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
@@ -3372,10 +3415,10 @@ function Dr(e) {
3372
3415
  function be() {
3373
3416
  return (/* @__PURE__ */ new Date()).toISOString();
3374
3417
  }
3375
- function Ue() {
3418
+ function Je() {
3376
3419
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
3377
3420
  }
3378
- const Un = [
3421
+ const ei = [
3379
3422
  "primary",
3380
3423
  "comparisons",
3381
3424
  "contributors",
@@ -3389,7 +3432,7 @@ const Un = [
3389
3432
  "largestPositiveChanges",
3390
3433
  "largestNegativeDrivers",
3391
3434
  "largestPositiveDrivers"
3392
- ], Gn = [
3435
+ ], ri = [
3393
3436
  "primary",
3394
3437
  "records",
3395
3438
  "periodChanges",
@@ -3404,12 +3447,12 @@ const Un = [
3404
3447
  "largestNegativeDrivers",
3405
3448
  "largestPositiveDrivers"
3406
3449
  ];
3407
- function Or(e) {
3450
+ function Wr(e) {
3408
3451
  if (!e)
3409
3452
  return {};
3410
- const r = ri(e.executionResult), t = Jn(e, r), n = Zn(t), i = Br(
3411
- Je(e.analysisWarnings),
3412
- ii(t)
3453
+ const r = ai(e.executionResult), t = ti(e, r), n = oi(t), i = _r(
3454
+ Xe(e.analysisWarnings),
3455
+ ui(t)
3413
3456
  );
3414
3457
  return {
3415
3458
  ...e,
@@ -3422,19 +3465,19 @@ function Or(e) {
3422
3465
  } : {}
3423
3466
  };
3424
3467
  }
3425
- function Jn(e, r) {
3426
- const t = Yn(e.resultSets);
3427
- for (const i of Un) {
3468
+ function ti(e, r) {
3469
+ const t = ni(e.resultSets);
3470
+ for (const i of ei) {
3428
3471
  if (t[i])
3429
3472
  continue;
3430
- const o = ti(e[i]);
3473
+ const o = li(e[i]);
3431
3474
  if (!o.length)
3432
3475
  continue;
3433
- const u = r.length ? r : ni(o);
3476
+ const u = r.length ? r : di(o);
3434
3477
  t[i] = {
3435
3478
  id: i,
3436
3479
  role: i,
3437
- ...Ge({
3480
+ ...Ye({
3438
3481
  records: o,
3439
3482
  columns: u,
3440
3483
  resultSetKey: i
@@ -3443,20 +3486,20 @@ function Jn(e, r) {
3443
3486
  rowCount: o.length
3444
3487
  };
3445
3488
  }
3446
- const n = ei(e.executionResult);
3489
+ const n = si(e.executionResult);
3447
3490
  return n && n.records.length > 0 && !t.records && (t.records = n), t;
3448
3491
  }
3449
- function Yn(e) {
3492
+ function ni(e) {
3450
3493
  return Object.fromEntries(
3451
3494
  Object.entries(e || {}).map(([r, t]) => [
3452
3495
  r,
3453
- Xn(t, r)
3496
+ ii(t, r)
3454
3497
  ])
3455
3498
  );
3456
3499
  }
3457
- function Xn(e, r = e.id || e.role || "resultSet") {
3500
+ function ii(e, r = e.id || e.role || "resultSet") {
3458
3501
  var n;
3459
- const t = Ge({
3502
+ const t = Ye({
3460
3503
  records: e.records || [],
3461
3504
  columns: e.columns || [],
3462
3505
  resultSetKey: r
@@ -3465,28 +3508,28 @@ function Xn(e, r = e.id || e.role || "resultSet") {
3465
3508
  ...e,
3466
3509
  ...t,
3467
3510
  ...e.warnings || t.warnings ? {
3468
- warnings: Br(
3469
- Je(e.warnings),
3511
+ warnings: _r(
3512
+ Xe(e.warnings),
3470
3513
  t.warnings
3471
3514
  )
3472
3515
  } : {},
3473
3516
  rowCount: e.rowCount ?? ((n = e.records) == null ? void 0 : n.length) ?? 0
3474
3517
  };
3475
3518
  }
3476
- function Zn(e) {
3519
+ function oi(e) {
3477
3520
  var r;
3478
- for (const t of Gn)
3521
+ for (const t of ri)
3479
3522
  if ((r = e[t]) != null && r.records.length)
3480
3523
  return e[t];
3481
3524
  return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
3482
3525
  }
3483
- function ei(e) {
3526
+ function si(e) {
3484
3527
  const r = e == null ? void 0 : e.result;
3485
3528
  if (!(!r || r.kind !== "records" && r.kind !== "sql"))
3486
3529
  return {
3487
3530
  id: "records",
3488
3531
  role: "records",
3489
- ...Ge({
3532
+ ...Ye({
3490
3533
  records: r.records,
3491
3534
  columns: r.columns,
3492
3535
  resultSetKey: "records"
@@ -3495,16 +3538,16 @@ function ei(e) {
3495
3538
  rowCount: r.rowCount ?? r.records.length
3496
3539
  };
3497
3540
  }
3498
- function ri(e) {
3541
+ function ai(e) {
3499
3542
  const r = e == null ? void 0 : e.result;
3500
3543
  return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
3501
3544
  }
3502
- function ti(e) {
3545
+ function li(e) {
3503
3546
  return Array.isArray(e) ? e.filter(
3504
3547
  (r) => !!(r && typeof r == "object" && !Array.isArray(r))
3505
3548
  ) : [];
3506
3549
  }
3507
- function Ge({
3550
+ function Ye({
3508
3551
  records: e,
3509
3552
  columns: r,
3510
3553
  resultSetKey: t
@@ -3536,7 +3579,7 @@ function Ge({
3536
3579
  ...n.length ? { warnings: n } : {}
3537
3580
  };
3538
3581
  }
3539
- function ni(e) {
3582
+ function di(e) {
3540
3583
  return Array.from(
3541
3584
  new Set(e.flatMap((t) => Object.keys(t)))
3542
3585
  ).map((t) => ({
@@ -3545,67 +3588,67 @@ function ni(e) {
3545
3588
  label: t
3546
3589
  }));
3547
3590
  }
3548
- function ii(e) {
3591
+ function ui(e) {
3549
3592
  return Object.values(e).flatMap(
3550
- (r) => Je(r.warnings)
3593
+ (r) => Xe(r.warnings)
3551
3594
  );
3552
3595
  }
3553
- function Je(e) {
3554
- return Array.isArray(e) ? e.filter(oi) : [];
3596
+ function Xe(e) {
3597
+ return Array.isArray(e) ? e.filter(ci) : [];
3555
3598
  }
3556
- function oi(e) {
3599
+ function ci(e) {
3557
3600
  return !!(e && typeof e == "object" && !Array.isArray(e));
3558
3601
  }
3559
- function Br(...e) {
3602
+ function _r(...e) {
3560
3603
  const r = /* @__PURE__ */ new Set(), t = [];
3561
3604
  for (const n of e.flatMap((i) => i || [])) {
3562
- const i = si(n);
3605
+ const i = fi(n);
3563
3606
  r.has(i) || (r.add(i), t.push(n));
3564
3607
  }
3565
3608
  return t;
3566
3609
  }
3567
- function si(e) {
3610
+ function fi(e) {
3568
3611
  return e.code === "missing_analysis_result_key" ? [
3569
3612
  e.code,
3570
3613
  e.resultSetKey,
3571
3614
  e.rowIndex,
3572
3615
  e.columnKey
3573
- ].join(":") : Fe(e);
3616
+ ].join(":") : ze(e);
3574
3617
  }
3575
- function Fe(e) {
3618
+ function ze(e) {
3576
3619
  if (!e || typeof e != "object")
3577
3620
  return JSON.stringify(e);
3578
3621
  if (Array.isArray(e))
3579
- return `[${e.map((t) => Fe(t)).join(",")}]`;
3622
+ return `[${e.map((t) => ze(t)).join(",")}]`;
3580
3623
  const r = e;
3581
- return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${Fe(r[t])}`).join(",")}}`;
3624
+ return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${ze(r[t])}`).join(",")}}`;
3582
3625
  }
3583
- const Oe = {
3626
+ const Be = {
3584
3627
  value: null,
3585
3628
  primaryValue: null
3586
- }, Be = {}, ai = { records: [] }, Ke = { options: [] }, li = { records: [] }, We = {};
3587
- function di(e) {
3588
- const r = X(e.inputs), t = Vr(e);
3629
+ }, Ke = {}, pi = { records: [] }, We = { options: [] }, gi = { records: [] }, _e = {};
3630
+ function mi(e) {
3631
+ const r = X(e.inputs), t = Gr(e);
3589
3632
  try {
3590
- const n = Qr(e), i = ee(n, "analysis");
3633
+ const n = Jr(e), i = ee(n, "analysis");
3591
3634
  return i ? {
3592
3635
  error: i,
3593
3636
  activeInputs: r,
3594
3637
  analysisOptions: t,
3595
- queryKey: q(
3638
+ queryKey: A(
3596
3639
  void 0,
3597
3640
  r,
3598
3641
  i,
3599
3642
  t
3600
3643
  ),
3601
- idleData: Be
3644
+ idleData: Ke
3602
3645
  } : {
3603
3646
  intent: n,
3604
3647
  error: null,
3605
3648
  activeInputs: r,
3606
3649
  analysisOptions: t,
3607
- queryKey: q(n, r, void 0, t),
3608
- idleData: Be
3650
+ queryKey: A(n, r, void 0, t),
3651
+ idleData: Ke
3609
3652
  };
3610
3653
  } catch (n) {
3611
3654
  const i = Z(n, "analysis");
@@ -3613,56 +3656,56 @@ function di(e) {
3613
3656
  error: i,
3614
3657
  activeInputs: r,
3615
3658
  analysisOptions: t,
3616
- queryKey: q(
3659
+ queryKey: A(
3617
3660
  void 0,
3618
3661
  r,
3619
3662
  i,
3620
3663
  t
3621
3664
  ),
3622
- idleData: Be
3665
+ idleData: Ke
3623
3666
  };
3624
3667
  }
3625
3668
  }
3626
- function ui(e) {
3669
+ function yi(e) {
3627
3670
  const r = X(e.inputs);
3628
3671
  try {
3629
- const t = Ur(e), n = ee(t);
3672
+ const t = Yr(e), n = ee(t);
3630
3673
  return n ? {
3631
3674
  error: n,
3632
3675
  activeInputs: r,
3633
- queryKey: q(void 0, r, n),
3634
- idleData: Oe
3676
+ queryKey: A(void 0, r, n),
3677
+ idleData: Be
3635
3678
  } : {
3636
3679
  intent: t,
3637
3680
  error: null,
3638
3681
  activeInputs: r,
3639
- queryKey: q(t, r),
3640
- idleData: Oe
3682
+ queryKey: A(t, r),
3683
+ idleData: Be
3641
3684
  };
3642
3685
  } catch (t) {
3643
3686
  const n = Z(t, "metric");
3644
3687
  return {
3645
3688
  error: n,
3646
3689
  activeInputs: r,
3647
- queryKey: q(void 0, r, n),
3648
- idleData: Oe
3690
+ queryKey: A(void 0, r, n),
3691
+ idleData: Be
3649
3692
  };
3650
3693
  }
3651
3694
  }
3652
- function ci(e) {
3653
- const r = X(e.inputs), t = ai;
3695
+ function hi(e) {
3696
+ const r = X(e.inputs), t = pi;
3654
3697
  try {
3655
- const n = Hr(e), i = ee(n);
3698
+ const n = Ur(e), i = ee(n);
3656
3699
  return i ? {
3657
3700
  error: i,
3658
3701
  activeInputs: r,
3659
- queryKey: q(void 0, r, i),
3702
+ queryKey: A(void 0, r, i),
3660
3703
  idleData: t
3661
3704
  } : {
3662
3705
  intent: n,
3663
3706
  error: null,
3664
3707
  activeInputs: r,
3665
- queryKey: q(n, r),
3708
+ queryKey: A(n, r),
3666
3709
  idleData: t
3667
3710
  };
3668
3711
  } catch (n) {
@@ -3670,51 +3713,51 @@ function ci(e) {
3670
3713
  return {
3671
3714
  error: i,
3672
3715
  activeInputs: r,
3673
- queryKey: q(void 0, r, i),
3716
+ queryKey: A(void 0, r, i),
3674
3717
  idleData: t
3675
3718
  };
3676
3719
  }
3677
3720
  }
3678
- function fi(e) {
3721
+ function bi(e) {
3679
3722
  const r = X(e.inputs);
3680
3723
  try {
3681
- const t = jr(e), n = ee(t);
3724
+ const t = Qr(e), n = ee(t);
3682
3725
  return n ? {
3683
3726
  error: n,
3684
3727
  activeInputs: r,
3685
- queryKey: q(void 0, r, n),
3686
- idleData: Ke
3728
+ queryKey: A(void 0, r, n),
3729
+ idleData: We
3687
3730
  } : {
3688
3731
  intent: t,
3689
3732
  error: null,
3690
3733
  activeInputs: r,
3691
- queryKey: q(t, r),
3692
- idleData: Ke
3734
+ queryKey: A(t, r),
3735
+ idleData: We
3693
3736
  };
3694
3737
  } catch (t) {
3695
3738
  const n = Z(t, "inputOptions");
3696
3739
  return {
3697
3740
  error: n,
3698
3741
  activeInputs: r,
3699
- queryKey: q(void 0, r, n),
3700
- idleData: Ke
3742
+ queryKey: A(void 0, r, n),
3743
+ idleData: We
3701
3744
  };
3702
3745
  }
3703
3746
  }
3704
- function pi(e) {
3705
- const r = X(e.inputs), t = li;
3747
+ function vi(e) {
3748
+ const r = X(e.inputs), t = gi;
3706
3749
  try {
3707
- const n = Mr(e), i = ee(n);
3750
+ const n = Vr(e), i = ee(n);
3708
3751
  return i ? {
3709
3752
  error: i,
3710
3753
  activeInputs: r,
3711
- queryKey: q(void 0, r, i),
3754
+ queryKey: A(void 0, r, i),
3712
3755
  idleData: t
3713
3756
  } : {
3714
3757
  intent: n,
3715
3758
  error: null,
3716
3759
  activeInputs: r,
3717
- queryKey: q(n, r),
3760
+ queryKey: A(n, r),
3718
3761
  idleData: t
3719
3762
  };
3720
3763
  } catch (n) {
@@ -3722,42 +3765,42 @@ function pi(e) {
3722
3765
  return {
3723
3766
  error: i,
3724
3767
  activeInputs: r,
3725
- queryKey: q(void 0, r, i),
3768
+ queryKey: A(void 0, r, i),
3726
3769
  idleData: t
3727
3770
  };
3728
3771
  }
3729
3772
  }
3730
- function gi(e) {
3773
+ function Si(e) {
3731
3774
  const r = X(e.inputs);
3732
3775
  try {
3733
- const t = zr(e), n = ee(t);
3776
+ const t = Pr(e), n = ee(t);
3734
3777
  return n ? {
3735
3778
  error: n,
3736
3779
  activeInputs: r,
3737
- queryKey: q(void 0, r, n),
3738
- idleData: We
3780
+ queryKey: A(void 0, r, n),
3781
+ idleData: _e
3739
3782
  } : {
3740
3783
  intent: t,
3741
3784
  error: null,
3742
3785
  activeInputs: r,
3743
- queryKey: q(t, r),
3744
- idleData: We
3786
+ queryKey: A(t, r),
3787
+ idleData: _e
3745
3788
  };
3746
3789
  } catch (t) {
3747
3790
  const n = Z(t, "matrix");
3748
3791
  return {
3749
3792
  error: n,
3750
3793
  activeInputs: r,
3751
- queryKey: q(void 0, r, n),
3752
- idleData: We
3794
+ queryKey: A(void 0, r, n),
3795
+ idleData: _e
3753
3796
  };
3754
3797
  }
3755
3798
  }
3756
- function ze(e) {
3799
+ function je(e) {
3757
3800
  var o;
3758
- if (mi(e))
3801
+ if (wi(e))
3759
3802
  return e;
3760
- const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Ae(
3803
+ const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Ce(
3761
3804
  (r == null ? void 0 : r.message) ?? String(e),
3762
3805
  {
3763
3806
  requestId: typeof (t == null ? void 0 : t.requestId) == "string" ? t.requestId : void 0,
@@ -3770,7 +3813,7 @@ function ze(e) {
3770
3813
  return i.name = (r == null ? void 0 : r.name) || i.name, i.stack = r == null ? void 0 : r.stack, i;
3771
3814
  }
3772
3815
  function Z(e, r) {
3773
- const t = ze(e);
3816
+ const t = je(e);
3774
3817
  if (t.executionResult || t.validation)
3775
3818
  return t;
3776
3819
  const n = {
@@ -3790,39 +3833,39 @@ function Z(e, r) {
3790
3833
  recommendedNextStep: "Update the Data App query spec to satisfy the SDK builder contract."
3791
3834
  }
3792
3835
  ]
3793
- }, i = Kr(
3836
+ }, i = Nr(
3794
3837
  void 0,
3795
3838
  r,
3796
3839
  n
3797
- ), o = Ae(t.message, {
3840
+ ), o = Ce(t.message, {
3798
3841
  executionResult: i,
3799
3842
  validation: n,
3800
3843
  validationIssues: n.errors
3801
3844
  });
3802
3845
  return o.stack = t.stack, o;
3803
3846
  }
3804
- function Ae(e, r = {}) {
3847
+ function Ce(e, r = {}) {
3805
3848
  var i, o, u;
3806
3849
  const t = new Error(e);
3807
3850
  t.name = "SemaphorDataAppQueryError", t.kind = "data_app_query_error", r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), r.validation !== void 0 && (t.validation = r.validation);
3808
3851
  const n = r.validationIssues ?? ((i = r.validation) == null ? void 0 : i.errors) ?? ((u = (o = r.executionResult) == null ? void 0 : o.validation) == null ? void 0 : u.errors);
3809
3852
  return n !== void 0 && (t.validationIssues = n), t;
3810
3853
  }
3811
- function mi(e) {
3854
+ function wi(e) {
3812
3855
  return e instanceof Error && e.kind === "data_app_query_error";
3813
3856
  }
3814
3857
  function ee(e, r = e.kind) {
3815
- const t = at(e);
3858
+ const t = ut(e);
3816
3859
  if (t.ok)
3817
3860
  return null;
3818
3861
  const n = t.errors.map(
3819
3862
  (o) => o.path ? `${o.code} at ${o.path}: ${o.message}` : `${o.code}: ${o.message}`
3820
- ).join("; "), i = Kr(
3863
+ ).join("; "), i = Nr(
3821
3864
  e,
3822
3865
  r,
3823
3866
  t
3824
3867
  );
3825
- return Ae(
3868
+ return Ce(
3826
3869
  `Invalid Semaphor analytics intent. ${n}`,
3827
3870
  {
3828
3871
  executionResult: i,
@@ -3831,7 +3874,7 @@ function ee(e, r = e.kind) {
3831
3874
  }
3832
3875
  );
3833
3876
  }
3834
- function Kr(e, r, t) {
3877
+ function Nr(e, r, t) {
3835
3878
  return {
3836
3879
  ...e != null && e.id ? { intentId: e.id } : {},
3837
3880
  ...e ? { intent: e } : {},
@@ -3870,7 +3913,7 @@ function Kr(e, r, t) {
3870
3913
  }
3871
3914
  };
3872
3915
  }
3873
- function q(e, r, t, n) {
3916
+ function A(e, r, t, n) {
3874
3917
  return JSON.stringify({
3875
3918
  intent: e,
3876
3919
  activeInputs: r,
@@ -3878,13 +3921,13 @@ function q(e, r, t, n) {
3878
3921
  error: t == null ? void 0 : t.message
3879
3922
  });
3880
3923
  }
3881
- function yi() {
3924
+ function Ii() {
3882
3925
  return {
3883
3926
  executeAnalysis: (e, r, t) => G(
3884
3927
  e,
3885
3928
  r,
3886
3929
  t ?? {}
3887
- ).then(Or),
3930
+ ).then(Wr),
3888
3931
  executeMetric: (e, r) => G(e, r),
3889
3932
  executeRecords: (e, r) => G(e, r),
3890
3933
  executeInputOptions: (e, r) => G(e, r),
@@ -3897,7 +3940,7 @@ async function G(e, r, t) {
3897
3940
  throw new Error(
3898
3941
  "SemaphorDataAppProvider needs a token to execute queries."
3899
3942
  );
3900
- const n = qi(r), i = vi(e, n);
3943
+ const n = Ri(r), i = Ai(e, n);
3901
3944
  let o;
3902
3945
  try {
3903
3946
  o = await fetch(n, {
@@ -3911,7 +3954,7 @@ async function G(e, r, t) {
3911
3954
  activeInputs: r.activeInputs,
3912
3955
  ...t ? { analysisOptions: t } : {},
3913
3956
  resultShape: e.kind,
3914
- ...bi(r) ? { debug: { responseDetail: "debug" } } : {}
3957
+ ...qi(r) ? { debug: { responseDetail: "debug" } } : {}
3915
3958
  })
3916
3959
  });
3917
3960
  } catch (f) {
@@ -3919,37 +3962,37 @@ async function G(e, r, t) {
3919
3962
  `${i}: ${f instanceof Error ? f.message : String(f)}`
3920
3963
  );
3921
3964
  }
3922
- const u = await Ii(o);
3965
+ const u = await ki(o);
3923
3966
  if (!o.ok || u.error)
3924
- throw hi(
3967
+ throw xi(
3925
3968
  `${i}: ${u.error || `Semaphor Data App execution failed with status ${o.status}.`}`,
3926
3969
  u
3927
3970
  );
3928
3971
  return u;
3929
3972
  }
3930
- function hi(e, r) {
3973
+ function xi(e, r) {
3931
3974
  var t;
3932
- return Ae(e, {
3975
+ return Ce(e, {
3933
3976
  requestId: r.requestId,
3934
3977
  details: r.details,
3935
3978
  executionResult: r.executionResult,
3936
3979
  validation: (t = r.executionResult) == null ? void 0 : t.validation
3937
3980
  });
3938
3981
  }
3939
- function bi(e) {
3982
+ function qi(e) {
3940
3983
  const r = e.debug;
3941
3984
  return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
3942
3985
  }
3943
- function vi(e, r) {
3986
+ function Ai(e, r) {
3944
3987
  return [
3945
3988
  `Semaphor ${e.kind} query`,
3946
3989
  e.id ? `id=${e.id}` : void 0,
3947
3990
  e.label ? `label=${e.label}` : void 0,
3948
- Si(e),
3949
- `endpoint=${wi(r)}`
3991
+ Ci(e),
3992
+ `endpoint=${Ti(r)}`
3950
3993
  ].filter((t) => !!t).join(" ");
3951
3994
  }
3952
- function Si(e) {
3995
+ function Ci(e) {
3953
3996
  const r = "source" in e ? e.source : void 0;
3954
3997
  if (!(!r || typeof r != "object")) {
3955
3998
  if (r.kind === "semantic")
@@ -3968,7 +4011,7 @@ function Si(e) {
3968
4011
  return r.connectionId ? `source=${r.connectionId}` : void 0;
3969
4012
  }
3970
4013
  }
3971
- function wi(e) {
4014
+ function Ti(e) {
3972
4015
  if (!e)
3973
4016
  return "/api/v1/data-app/execute";
3974
4017
  try {
@@ -3977,7 +4020,7 @@ function wi(e) {
3977
4020
  return e;
3978
4021
  }
3979
4022
  }
3980
- async function Ii(e) {
4023
+ async function ki(e) {
3981
4024
  const r = await e.text().catch(() => "");
3982
4025
  if (!r.trim())
3983
4026
  return e.ok ? {
@@ -3990,52 +4033,52 @@ async function Ii(e) {
3990
4033
  error: "Semaphor Data App execution returned invalid JSON.",
3991
4034
  details: r
3992
4035
  } : {
3993
- error: xi(e, r),
4036
+ error: Ei(e, r),
3994
4037
  details: r
3995
4038
  };
3996
4039
  }
3997
4040
  }
3998
- function xi(e, r) {
4041
+ function Ei(e, r) {
3999
4042
  const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
4000
4043
  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}.`;
4001
4044
  }
4002
- function qi(e) {
4003
- const r = Ai(e).replace(/\/+$/, "");
4045
+ function Ri(e) {
4046
+ const r = Li(e).replace(/\/+$/, "");
4004
4047
  return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
4005
4048
  }
4006
- function Ai(e) {
4049
+ function Li(e) {
4007
4050
  if (e.apiBaseUrl)
4008
4051
  return e.apiBaseUrl;
4009
4052
  if (!e.token)
4010
4053
  return "";
4011
4054
  try {
4012
- return st(e.token).apiServiceUrl || "";
4055
+ return dt(e.token).apiServiceUrl || "";
4013
4056
  } catch {
4014
4057
  return "";
4015
4058
  }
4016
4059
  }
4017
- const Wr = Ie({});
4018
- function Ti() {
4060
+ const Mr = xe({});
4061
+ function $i() {
4019
4062
  if (!(typeof window > "u"))
4020
4063
  return window.__SEMAPHOR_DATA_APP_RUNTIME__;
4021
4064
  }
4022
- function Ci() {
4023
- return Q(Wr);
4065
+ function Oi() {
4066
+ return Q(Mr);
4024
4067
  }
4025
- function Ui(e) {
4068
+ function eo(e) {
4026
4069
  const [r, t] = z(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = I(
4027
- () => gr(e.options),
4070
+ () => hr(e.options),
4028
4071
  [e.options]
4029
- ), u = O(
4072
+ ), u = D(
4030
4073
  (d) => {
4031
- var y;
4074
+ var g;
4032
4075
  const c = d;
4033
- (y = e.onValueChange) == null || y.call(e, c), n || t(c);
4076
+ (g = e.onValueChange) == null || g.call(e, c), n || t(c);
4034
4077
  },
4035
4078
  [n, e]
4036
- ), f = O(() => u(void 0), [u]);
4079
+ ), f = D(() => u(void 0), [u]);
4037
4080
  return I(() => {
4038
- const d = mr(e);
4081
+ const d = br(e);
4039
4082
  return {
4040
4083
  id: e.id,
4041
4084
  kind: e.kind,
@@ -4063,8 +4106,8 @@ function Ui(e) {
4063
4106
  };
4064
4107
  }, [f, o, u, e, i]);
4065
4108
  }
4066
- function Gi(e) {
4067
- const [r, t] = z(() => Oi(e));
4109
+ function ro(e) {
4110
+ const [r, t] = z(() => Mi(e));
4068
4111
  return B(() => {
4069
4112
  t((n) => {
4070
4113
  let i = n;
@@ -4077,13 +4120,13 @@ function Gi(e) {
4077
4120
  const i = Object.prototype.hasOwnProperty.call(
4078
4121
  n,
4079
4122
  "value"
4080
- ), o = i ? n.value : r[n.id], u = gr(n.options), f = (y) => {
4123
+ ), o = i ? n.value : r[n.id], u = hr(n.options), f = (g) => {
4081
4124
  var m;
4082
- (m = n.onValueChange) == null || m.call(n, y), i || t((v) => ({
4125
+ (m = n.onValueChange) == null || m.call(n, g), i || t((v) => ({
4083
4126
  ...v,
4084
- [n.id]: y
4127
+ [n.id]: g
4085
4128
  }));
4086
- }, d = () => f(void 0), c = mr(n);
4129
+ }, d = () => f(void 0), c = br(n);
4087
4130
  return {
4088
4131
  id: n.id,
4089
4132
  kind: n.kind,
@@ -4113,29 +4156,29 @@ function Gi(e) {
4113
4156
  [e, r]
4114
4157
  );
4115
4158
  }
4116
- function Ji(e, r) {
4117
- const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Ei(t), [t]);
4159
+ function to(e, r) {
4160
+ const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Bi(t), [t]);
4118
4161
  B(() => {
4119
- ki(e.value, t) || e.clear();
4162
+ Di(e.value, t) || e.clear();
4120
4163
  }, [e, n, r == null ? void 0 : r.status, t]);
4121
4164
  }
4122
- function ki(e, r) {
4165
+ function Di(e, r) {
4123
4166
  if (!ue(e) || r === void 0)
4124
4167
  return !0;
4125
4168
  const t = new Set(
4126
- r.map((i) => fr(i.value))
4169
+ r.map((i) => mr(i.value))
4127
4170
  );
4128
4171
  return (Array.isArray(e) ? e : [e]).every(
4129
- (i) => t.has(fr(i))
4172
+ (i) => t.has(mr(i))
4130
4173
  );
4131
4174
  }
4132
- function Ei(e) {
4175
+ function Bi(e) {
4133
4176
  return JSON.stringify((e || []).map((r) => r.value));
4134
4177
  }
4135
- function fr(e) {
4178
+ function mr(e) {
4136
4179
  return `${typeof e}:${String(e)}`;
4137
4180
  }
4138
- function Yi(e, r = {}) {
4181
+ function no(e, r = {}) {
4139
4182
  const t = I(
4140
4183
  () => r.inputs ? {
4141
4184
  ...e,
@@ -4147,37 +4190,37 @@ function Yi(e, r = {}) {
4147
4190
  case "metric":
4148
4191
  return {
4149
4192
  queryKind: t.queryKind,
4150
- request: ui(t)
4193
+ request: yi(t)
4151
4194
  };
4152
4195
  case "analysis":
4153
4196
  return {
4154
4197
  queryKind: t.queryKind,
4155
- request: di(t)
4198
+ request: mi(t)
4156
4199
  };
4157
4200
  case "records":
4158
4201
  return {
4159
4202
  queryKind: t.queryKind,
4160
- request: ci(t)
4203
+ request: hi(t)
4161
4204
  };
4162
4205
  case "inputOptions":
4163
4206
  return {
4164
4207
  queryKind: t.queryKind,
4165
- request: fi(t)
4208
+ request: bi(t)
4166
4209
  };
4167
4210
  case "sql":
4168
4211
  return {
4169
4212
  queryKind: t.queryKind,
4170
- request: pi(t)
4213
+ request: vi(t)
4171
4214
  };
4172
4215
  case "matrix":
4173
4216
  return {
4174
4217
  queryKind: t.queryKind,
4175
- request: gi(t)
4218
+ request: Si(t)
4176
4219
  };
4177
4220
  default:
4178
- return Se(t);
4221
+ return we(t);
4179
4222
  }
4180
- }, [t]), i = Kt({
4223
+ }, [t]), i = Nt({
4181
4224
  spec: t,
4182
4225
  queryKind: n.queryKind,
4183
4226
  queryKey: n.request.queryKey,
@@ -4197,9 +4240,9 @@ function Yi(e, r = {}) {
4197
4240
  i.start,
4198
4241
  i.success
4199
4242
  ]
4200
- ), f = O(
4243
+ ), f = D(
4201
4244
  (l) => {
4202
- var K, T, N, $, S, w, L, x, D;
4245
+ var K, T, N, $, S, w, L, x, O;
4203
4246
  const b = n.request;
4204
4247
  if (b.intent)
4205
4248
  switch (n.queryKind) {
@@ -4232,23 +4275,23 @@ function Yi(e, r = {}) {
4232
4275
  l
4233
4276
  );
4234
4277
  case "matrix":
4235
- return (D = (x = l.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : D.call(
4278
+ return (O = (x = l.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : O.call(
4236
4279
  x,
4237
4280
  b.intent,
4238
4281
  l
4239
4282
  );
4240
4283
  default:
4241
- return Se(n);
4284
+ return we(n);
4242
4285
  }
4243
4286
  },
4244
4287
  [n]
4245
- ), d = Di(
4288
+ ), d = Ni(
4246
4289
  n.request.queryKey,
4247
4290
  f,
4248
4291
  n.request.idleData,
4249
4292
  n.request.activeInputs,
4250
4293
  u
4251
- ), c = i.queryId, y = i.validationFailure;
4294
+ ), c = i.queryId, g = i.validationFailure;
4252
4295
  B(() => {
4253
4296
  const l = n.request.error;
4254
4297
  if (!l) {
@@ -4256,22 +4299,22 @@ function Yi(e, r = {}) {
4256
4299
  return;
4257
4300
  }
4258
4301
  const b = `${c}:${l.message}`;
4259
- o.current !== b && (o.current = b, y(l));
4302
+ o.current !== b && (o.current = b, g(l));
4260
4303
  }, [
4261
4304
  n.request.error,
4262
4305
  n.request.queryKey,
4263
4306
  c,
4264
- y
4307
+ g
4265
4308
  ]);
4266
- const m = n.request.error ? n.request.idleData : d.data, v = n.request.error ? "error" : d.status, g = !n.request.error && d.status === "loading", h = n.request.error || d.error, A = i.trace;
4309
+ const m = n.request.error ? n.request.idleData : d.data, v = n.request.error ? "error" : d.status, y = !n.request.error && d.status === "loading", h = n.request.error || d.error, C = i.trace;
4267
4310
  switch (n.queryKind) {
4268
4311
  case "metric": {
4269
4312
  const l = m, b = J({
4270
4313
  queryKind: n.queryKind,
4271
4314
  status: v,
4272
- isLoading: g,
4315
+ isLoading: y,
4273
4316
  error: h,
4274
- trace: A,
4317
+ trace: C,
4275
4318
  payload: l,
4276
4319
  activeInputs: n.request.activeInputs,
4277
4320
  isStale: d.isStale
@@ -4293,12 +4336,12 @@ function Yi(e, r = {}) {
4293
4336
  };
4294
4337
  }
4295
4338
  case "analysis": {
4296
- const l = Or(m), b = J({
4339
+ const l = Wr(m), b = J({
4297
4340
  queryKind: n.queryKind,
4298
4341
  status: v,
4299
- isLoading: g,
4342
+ isLoading: y,
4300
4343
  error: h,
4301
- trace: A,
4344
+ trace: C,
4302
4345
  payload: l,
4303
4346
  activeInputs: n.request.activeInputs,
4304
4347
  isStale: d.isStale
@@ -4314,9 +4357,9 @@ function Yi(e, r = {}) {
4314
4357
  const l = m, b = J({
4315
4358
  queryKind: n.queryKind,
4316
4359
  status: v,
4317
- isLoading: g,
4360
+ isLoading: y,
4318
4361
  error: h,
4319
- trace: A,
4362
+ trace: C,
4320
4363
  payload: l,
4321
4364
  activeInputs: n.request.activeInputs,
4322
4365
  isStale: d.isStale
@@ -4336,9 +4379,9 @@ function Yi(e, r = {}) {
4336
4379
  const l = m, b = J({
4337
4380
  queryKind: n.queryKind,
4338
4381
  status: v,
4339
- isLoading: g,
4382
+ isLoading: y,
4340
4383
  error: h,
4341
- trace: A,
4384
+ trace: C,
4342
4385
  payload: l,
4343
4386
  activeInputs: n.request.activeInputs,
4344
4387
  isStale: d.isStale
@@ -4354,9 +4397,9 @@ function Yi(e, r = {}) {
4354
4397
  const l = m, b = J({
4355
4398
  queryKind: n.queryKind,
4356
4399
  status: v,
4357
- isLoading: g,
4400
+ isLoading: y,
4358
4401
  error: h,
4359
- trace: A,
4402
+ trace: C,
4360
4403
  payload: l,
4361
4404
  activeInputs: n.request.activeInputs,
4362
4405
  isStale: d.isStale
@@ -4377,9 +4420,9 @@ function Yi(e, r = {}) {
4377
4420
  const l = m, b = J({
4378
4421
  queryKind: n.queryKind,
4379
4422
  status: v,
4380
- isLoading: g,
4423
+ isLoading: y,
4381
4424
  error: h,
4382
- trace: A,
4425
+ trace: C,
4383
4426
  payload: l,
4384
4427
  activeInputs: n.request.activeInputs,
4385
4428
  isStale: d.isStale
@@ -4394,12 +4437,12 @@ function Yi(e, r = {}) {
4394
4437
  };
4395
4438
  }
4396
4439
  default:
4397
- return Se(n);
4440
+ return we(n);
4398
4441
  }
4399
4442
  }
4400
4443
  function J(e) {
4401
4444
  var o, u, f;
4402
- const r = Ri(e.payload) ?? ((o = e.error) == null ? void 0 : o.executionResult), t = ((u = e.error) == null ? void 0 : u.validation) ?? (r == null ? void 0 : r.validation), n = r == null ? void 0 : r.coverage, i = r == null ? void 0 : r.diagnosticFeedback;
4445
+ const r = Ki(e.payload) ?? ((o = e.error) == null ? void 0 : o.executionResult), t = ((u = e.error) == null ? void 0 : u.validation) ?? (r == null ? void 0 : r.validation), n = r == null ? void 0 : r.coverage, i = r == null ? void 0 : r.diagnosticFeedback;
4403
4446
  return {
4404
4447
  status: e.status,
4405
4448
  executionStatus: r == null ? void 0 : r.status,
@@ -4408,8 +4451,8 @@ function J(e) {
4408
4451
  coverage: n,
4409
4452
  diagnosticFeedback: i,
4410
4453
  isLoading: e.isLoading,
4411
- isEmpty: $i(e.queryKind, e.payload, e.status),
4412
- isPartial: Li(e.payload, r),
4454
+ isEmpty: _i(e.queryKind, e.payload, e.status),
4455
+ isPartial: Wi(e.payload, r),
4413
4456
  isFiltered: !!((f = e.activeInputs) != null && f.some(
4414
4457
  (d) => d.kind === "filter" && d.isActive
4415
4458
  )),
@@ -4419,16 +4462,16 @@ function J(e) {
4419
4462
  trace: e.trace
4420
4463
  };
4421
4464
  }
4422
- function Ri(e) {
4465
+ function Ki(e) {
4423
4466
  const r = e;
4424
4467
  return r == null ? void 0 : r.executionResult;
4425
4468
  }
4426
- function Li(e, r) {
4469
+ function Wi(e, r) {
4427
4470
  var n, i;
4428
4471
  const t = !!(e != null && e.rowLimitExceeded);
4429
4472
  return !!((r == null ? void 0 : r.status) === "partial" || ((n = r == null ? void 0 : r.diagnosticFeedback) == null ? void 0 : n.status) === "partial" || (r == null ? void 0 : r.status) !== "failed" && ((i = r == null ? void 0 : r.coverage) != null && i.missingObligations.length) || t);
4430
4473
  }
4431
- function $i(e, r, t) {
4474
+ function _i(e, r, t) {
4432
4475
  var n, i, o, u, f;
4433
4476
  if (t !== "success")
4434
4477
  return !1;
@@ -4460,53 +4503,53 @@ function $i(e, r, t) {
4460
4503
  return !((o = (i = d == null ? void 0 : d.matrixResult) == null ? void 0 : i.cells) != null && o.length) && !((f = (u = d == null ? void 0 : d.grid) == null ? void 0 : u.cells) != null && f.length);
4461
4504
  }
4462
4505
  default:
4463
- return Se(e);
4506
+ return we(e);
4464
4507
  }
4465
4508
  }
4466
4509
  function _(e) {
4467
4510
  return Array.isArray(e) && e.length > 0;
4468
4511
  }
4469
- function Di(e, r, t, n, i) {
4470
- const o = Ci(), u = E(r), f = E(n), [d, c] = z({
4512
+ function Ni(e, r, t, n, i) {
4513
+ const o = Oi(), u = E(r), f = E(n), [d, c] = z({
4471
4514
  status: "idle",
4472
4515
  data: t,
4473
4516
  error: null,
4474
4517
  isStale: !1
4475
4518
  });
4476
4519
  return u.current = r, f.current = n, B(() => {
4477
- let y;
4520
+ let g;
4478
4521
  try {
4479
- y = u.current({
4522
+ g = u.current({
4480
4523
  ...o,
4481
4524
  activeInputs: f.current
4482
4525
  });
4483
- } catch (g) {
4484
- i == null || i.failure(g, 0), c({
4526
+ } catch (y) {
4527
+ i == null || i.failure(y, 0), c({
4485
4528
  status: "error",
4486
4529
  data: t,
4487
- error: ze(g),
4530
+ error: je(y),
4488
4531
  isStale: !1
4489
4532
  });
4490
4533
  return;
4491
4534
  }
4492
- if (!y) {
4535
+ if (!g) {
4493
4536
  c({ status: "idle", data: t, error: null, isStale: !1 });
4494
4537
  return;
4495
4538
  }
4496
4539
  let m = !1;
4497
- const v = _r();
4498
- return i == null || i.start(), c((g) => ({
4540
+ const v = Fr();
4541
+ return i == null || i.start(), c((y) => ({
4499
4542
  status: "loading",
4500
- data: g.data,
4543
+ data: y.data,
4501
4544
  error: null,
4502
- isStale: g.isStale || g.status === "success"
4503
- })), y.then((g) => {
4504
- m ? i == null || i.ignored("superseded") : (i == null || i.success(g, pr(v)), c({ status: "success", data: g, error: null, isStale: !1 }));
4505
- }).catch((g) => {
4506
- m ? i == null || i.ignored("superseded") : (i == null || i.failure(g, pr(v)), c({
4545
+ isStale: y.isStale || y.status === "success"
4546
+ })), g.then((y) => {
4547
+ m ? i == null || i.ignored("superseded") : (i == null || i.success(y, yr(v)), c({ status: "success", data: y, error: null, isStale: !1 }));
4548
+ }).catch((y) => {
4549
+ m ? i == null || i.ignored("superseded") : (i == null || i.failure(y, yr(v)), c({
4507
4550
  status: "error",
4508
4551
  data: t,
4509
- error: ze(g),
4552
+ error: je(y),
4510
4553
  isStale: !1
4511
4554
  }));
4512
4555
  }), () => {
@@ -4514,32 +4557,32 @@ function Di(e, r, t, n, i) {
4514
4557
  };
4515
4558
  }, [t, e, o, i]), d;
4516
4559
  }
4517
- function _r() {
4560
+ function Fr() {
4518
4561
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
4519
4562
  }
4520
- function pr(e) {
4521
- return Math.max(0, Math.round(_r() - e));
4563
+ function yr(e) {
4564
+ return Math.max(0, Math.round(Fr() - e));
4522
4565
  }
4523
- function Oi(e) {
4566
+ function Mi(e) {
4524
4567
  return Object.fromEntries(
4525
4568
  e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
4526
4569
  );
4527
4570
  }
4528
- function Se(e) {
4571
+ function we(e) {
4529
4572
  throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
4530
4573
  }
4531
- function Bi(e) {
4574
+ function Fi(e) {
4532
4575
  return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
4533
4576
  }
4534
- function Xi({
4577
+ function io({
4535
4578
  token: e,
4536
4579
  apiBaseUrl: r,
4537
4580
  executor: t,
4538
4581
  debug: n,
4539
4582
  children: i
4540
4583
  }) {
4541
- var g;
4542
- const o = Ti(), u = ((g = o == null ? void 0 : o.authToken) == null ? void 0 : g.accessToken) || e, f = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || r, d = (o == null ? void 0 : o.debug) ?? n, c = Bi(d), y = I(() => yi(), []), m = t || y, v = I(
4584
+ var y;
4585
+ const o = $i(), u = ((y = o == null ? void 0 : o.authToken) == null ? void 0 : y.accessToken) || e, f = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || r, d = (o == null ? void 0 : o.debug) ?? n, c = Fi(d), g = I(() => Ii(), []), m = t || g, v = I(
4543
4586
  () => ({
4544
4587
  token: u,
4545
4588
  apiBaseUrl: f,
@@ -4548,25 +4591,26 @@ function Xi({
4548
4591
  }),
4549
4592
  [f, d, m, u]
4550
4593
  );
4551
- return /* @__PURE__ */ a($t, { debug: d, children: /* @__PURE__ */ p(Wr.Provider, { value: v, children: [
4594
+ return /* @__PURE__ */ a(Bt, { debug: d, children: /* @__PURE__ */ p(Mr.Provider, { value: v, children: [
4552
4595
  i,
4553
- c ? /* @__PURE__ */ a(Bt, { ...c }) : null
4596
+ c ? /* @__PURE__ */ a(_t, { ...c }) : null
4554
4597
  ] }) });
4555
4598
  }
4556
4599
  export {
4557
- Xi as SemaphorDataAppProvider,
4558
- Bt as SemaphorDevtools,
4559
- Qi as SemaphorDevtoolsInspectButton,
4560
- Vi as SemaphorViewBoundary,
4561
- yi as createSemaphorQueryExecutor,
4562
- Mi as defineSemaphorDataApp,
4563
- ji as defineSemaphorInput,
4564
- ki as isSemaphorInputValueValidForOptions,
4565
- Hi as semaphor,
4566
- ro as semaphorMetricMeasureBindingKey,
4567
- Ji as useClearInvalidSemaphorInputValue,
4568
- qr as useSemaphorDevtools,
4569
- Ui as useSemaphorInput,
4570
- Gi as useSemaphorInputs,
4571
- Yi as useSemaphorQuery
4600
+ io as SemaphorDataAppProvider,
4601
+ _t as SemaphorDevtools,
4602
+ Zi as SemaphorDevtoolsInspectButton,
4603
+ Xi as SemaphorViewBoundary,
4604
+ Ii as createSemaphorQueryExecutor,
4605
+ Gi as defineSemaphorDataApp,
4606
+ Ji as defineSemaphorInput,
4607
+ Di as isSemaphorInputValueValidForOptions,
4608
+ Yi as semaphor,
4609
+ ao as semaphorMetricAggregate,
4610
+ lo as semaphorMetricMeasureBindingKey,
4611
+ to as useClearInvalidSemaphorInputValue,
4612
+ Tr as useSemaphorDevtools,
4613
+ eo as useSemaphorInput,
4614
+ ro as useSemaphorInputs,
4615
+ no as useSemaphorQuery
4572
4616
  };