react-semaphor 0.1.546 → 0.1.548

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 (59) hide show
  1. package/dist/analytics-protocol/index.js +71 -68
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
  5. package/dist/chunks/{assistant-chat-BPXhulAx.js → assistant-chat-DCcWsoGm.js} +106 -106
  6. package/dist/chunks/{bookmark-state-C4vetoa0.js → bookmark-state-Cu-a5ie_.js} +2 -8
  7. package/dist/chunks/{custom-visual-inputs-CkJW9pBS.js → custom-visual-inputs-BTRnwsfd.js} +1 -1
  8. package/dist/chunks/{dashboard-C3CoKbGY.js → dashboard-BZHL9a-z.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-Be4h-7My.js → dashboard-briefing-launcher-DML-cAzB.js} +528 -528
  10. package/dist/chunks/{dashboard-controls-bxPrlSyp.js → dashboard-controls-BGoBTPS7.js} +45 -45
  11. package/dist/chunks/{dashboard-json-BrjxIiRt.js → dashboard-json-iHPsdn3j.js} +1 -1
  12. package/dist/chunks/{document-dashboard-inputs-CRVHpIHp.js → document-dashboard-inputs-B2AqPfrq.js} +94 -94
  13. package/dist/chunks/{edit-dashboard-visual-DYYYDjY6.js → edit-dashboard-visual-CLEFFf2T.js} +281 -281
  14. package/dist/chunks/{column-catalog-BYnochWQ.js → filter-reach-copy-ByzGadUk.js} +978 -861
  15. package/dist/chunks/{global-date-filter-utils-9d6m9-FE.js → global-date-filter-utils-CeeFJ1CP.js} +4070 -3792
  16. package/dist/chunks/{index-DkQkMKa1.js → index-DeDHr3iz.js} +30 -30
  17. package/dist/chunks/{raw-temporal-presentation-CBzrDOjM.js → raw-temporal-presentation-CrUM2I_o.js} +1 -1
  18. package/dist/chunks/{report-preferences-dialog-4QEZWe5U.js → report-preferences-dialog-CM7kXmXp.js} +59 -59
  19. package/dist/chunks/{resolve-dashboard-input-context-UpK_LBpL.js → resolve-dashboard-input-context-BmWF9hSl.js} +1511 -1612
  20. package/dist/chunks/{saved-dashboard-context-D_I3Lxk0.js → saved-dashboard-context-qtfzl9Eb.js} +5 -5
  21. package/dist/chunks/{semaphor-ready-indicator-4zpRHE-X.js → semaphor-ready-indicator-Ol6VcaR7.js} +36548 -35855
  22. package/dist/chunks/{shelf-drop-preview-context-Cfw7TRAx.js → shelf-drop-preview-context-C2SEC3I9.js} +80 -80
  23. package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js} +221 -192
  24. package/dist/chunks/{table-settings-CunhoDUi.js → table-settings-WysCBj62.js} +133 -124
  25. package/dist/chunks/{use-create-flow-overlay-state-DZBZiiD-.js → use-create-flow-overlay-state-CbGIjaVD.js} +2 -2
  26. package/dist/dashboard/index.js +2 -2
  27. package/dist/dashboard-authoring/index.js +1419 -1340
  28. package/dist/data-app-sdk-validation/index.js +1 -1
  29. package/dist/index.js +14 -14
  30. package/dist/surfboard/index.js +2 -2
  31. package/dist/types/components/surfboard/filter/types.d.ts +7 -0
  32. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -4
  33. package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
  34. package/dist/types/index.js +2 -2
  35. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +383 -22
  36. package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
  37. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
  38. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  39. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  40. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
  41. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
  42. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +83 -13
  43. package/dist/types/lib/stores/dashboard-store.d.ts +12 -0
  44. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
  45. package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
  46. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  47. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +7 -0
  48. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
  49. package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
  50. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
  51. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
  52. package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
  53. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
  54. package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
  55. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -1
  56. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
  57. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +26 -4
  58. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
  59. package/package.json +1 -1
@@ -1,37 +1,37 @@
1
1
  import { al as K } from "./validators-C-aOQlTB.js";
2
- function p(e) {
2
+ function h(e) {
3
3
  const i = V(e);
4
4
  return i.length > 0 ? i.join(".") : void 0;
5
5
  }
6
6
  function Q(e) {
7
- const i = p(
7
+ const i = h(
8
8
  e.qualifiedName
9
9
  ), t = (i == null ? void 0 : i.split(".")) || [];
10
10
  if (t.length === 0) return {};
11
- const n = {};
11
+ const a = {};
12
12
  let s = t.length - 1;
13
13
  for (let r = e.capabilities.prefixLevels.length - 1; r >= 0 && s >= 0; r -= 1, s -= 1)
14
- Y(
15
- n,
14
+ Z(
15
+ a,
16
16
  e.capabilities.prefixLevels[r],
17
17
  t[s]
18
18
  );
19
- return n;
19
+ return a;
20
20
  }
21
21
  function P(e) {
22
22
  return !e.left.tableName || !e.right.tableName ? !1 : e.capabilities.prefixLevels.every((i) => {
23
- const t = I(e.left, i), n = I(e.right, i);
24
- return !t || !n || t === n;
23
+ const t = C(e.left, i), a = C(e.right, i);
24
+ return !t || !a || t === a;
25
25
  });
26
26
  }
27
- function pe(e) {
27
+ function X(e) {
28
28
  return e.capabilities.prefixLevels.every((i) => {
29
- const t = I(e.requested, i);
30
- return t ? I(e.allowed, i) === t : !0;
29
+ const t = C(e.requested, i);
30
+ return t ? C(e.allowed, i) === t : !0;
31
31
  });
32
32
  }
33
- function X(e, i = {}) {
34
- const t = j(e), n = {
33
+ function Y(e, i = {}) {
34
+ const t = j(e), a = {
35
35
  connectionId: i.connectionId,
36
36
  connectionType: e,
37
37
  path: ["database", "schema", "table"],
@@ -45,24 +45,24 @@ function X(e, i = {}) {
45
45
  supportsFilterClause: !0
46
46
  };
47
47
  return t.includes("postgres") ? {
48
- ...n,
48
+ ...a,
49
49
  prefixLevels: ["schema", "table"],
50
50
  dialect: "postgres"
51
51
  } : t.includes("mysql") ? {
52
- ...n,
52
+ ...a,
53
53
  prefixLevels: ["database", "table"],
54
54
  dialect: "mysql",
55
55
  supportsFilterClause: !1
56
56
  } : t.includes("mssql") || t.includes("sqlserver") ? {
57
- ...n,
57
+ ...a,
58
58
  dialect: "mssql",
59
59
  supportsFilterClause: !1
60
60
  } : t.includes("redshift") ? {
61
- ...n,
61
+ ...a,
62
62
  prefixLevels: ["schema", "table"],
63
63
  dialect: "redshift"
64
64
  } : t.includes("snowflake") ? {
65
- ...n,
65
+ ...a,
66
66
  dialect: "snowflake"
67
67
  } : t.includes("clickhouse") ? {
68
68
  connectionId: i.connectionId,
@@ -96,7 +96,7 @@ function X(e, i = {}) {
96
96
  dialect: "postgres",
97
97
  supportsFilterClause: !0
98
98
  } : t === "bigquery" ? {
99
- ...n,
99
+ ...a,
100
100
  labels: {
101
101
  database: "Project",
102
102
  schema: "Dataset",
@@ -105,12 +105,12 @@ function X(e, i = {}) {
105
105
  prefixLevels: ["schema", "table"],
106
106
  dialect: "bigquery",
107
107
  supportsFilterClause: !1
108
- } : n;
108
+ } : a;
109
109
  }
110
110
  function v(e, i = {}) {
111
111
  return M(
112
112
  e
113
- ) ? X(e, i) : void 0;
113
+ ) ? Y(e, i) : void 0;
114
114
  }
115
115
  function M(e) {
116
116
  const i = j(e);
@@ -145,44 +145,44 @@ function z(e) {
145
145
  return "unknown";
146
146
  }
147
147
  }
148
- function ve(e) {
148
+ function ke(e) {
149
149
  return e.capabilities.prefixLevels.every(
150
- (i) => !!I(e.source, i)
150
+ (i) => !!C(e.source, i)
151
151
  );
152
152
  }
153
- function ke(e) {
154
- const i = e.quoteIdentifier ?? ie;
155
- return e.capabilities.prefixLevels.map((t) => I(e.source, t)).filter((t) => !!t).map((t) => i(t, e.capabilities.dialect)).join(".");
153
+ function ge(e) {
154
+ const i = e.quoteIdentifier ?? te;
155
+ return e.capabilities.prefixLevels.map((t) => C(e.source, t)).filter((t) => !!t).map((t) => i(t, e.capabilities.dialect)).join(".");
156
156
  }
157
- function I(e, i) {
157
+ function C(e, i) {
158
158
  return i === "database" ? e.databaseName : i === "schema" ? e.schemaName : e.tableName;
159
159
  }
160
- function Y(e, i, t) {
160
+ function Z(e, i, t) {
161
161
  i === "database" ? e.databaseName = t : i === "schema" ? e.schemaName = t : e.tableName = t;
162
162
  }
163
- const Z = [
163
+ const ee = [
164
164
  ['"', '"'],
165
165
  ["`", "`"],
166
166
  ["[", "]"]
167
167
  ];
168
- function ee(e) {
168
+ function ie(e) {
169
169
  const i = e.trim();
170
- for (const [t, n] of Z)
171
- if (i.length >= 2 && i.startsWith(t) && i.endsWith(n))
172
- return i.slice(1, -1).split(n + n).join(n);
170
+ for (const [t, a] of ee)
171
+ if (i.length >= 2 && i.startsWith(t) && i.endsWith(a))
172
+ return i.slice(1, -1).split(a + a).join(a);
173
173
  return i;
174
174
  }
175
175
  function V(e) {
176
176
  const i = e == null ? void 0 : e.trim();
177
177
  if (!i) return [];
178
- const t = i.split(".").map(ee);
179
- return t.some((n) => !n) ? [] : t;
178
+ const t = i.split(".").map(ie);
179
+ return t.some((a) => !a) ? [] : t;
180
180
  }
181
- function ge(e) {
181
+ function Ne(e) {
182
182
  const i = V(e ?? void 0);
183
183
  return i[i.length - 1] || "";
184
184
  }
185
- function ie(e, i) {
185
+ function te(e, i) {
186
186
  return i === "mysql" || i === "bigquery" || i === "clickhouse" || i === "duckdb" ? `\`${e.replace(/`/g, "``")}\`` : i === "mssql" ? `[${e.replace(/]/g, "]]")}]` : `"${e.replace(/"/g, '""')}"`;
187
187
  }
188
188
  function j(e) {
@@ -190,10 +190,10 @@ function j(e) {
190
190
  return "";
191
191
  const i = [];
192
192
  for (const t of e.trim().toLowerCase())
193
- te(t) && i.push(t);
193
+ ae(t) && i.push(t);
194
194
  return i.join("");
195
195
  }
196
- function te(e) {
196
+ function ae(e) {
197
197
  const i = e.charCodeAt(0);
198
198
  return i >= 48 && i <= 57 || i >= 97 && i <= 122;
199
199
  }
@@ -205,18 +205,18 @@ function O(e) {
205
205
  ])
206
206
  );
207
207
  }
208
- function Ne(e) {
209
- const i = e.source.connectionType ? v(e.source.connectionType) : void 0, t = e.source.dialect ? z(e.source.dialect) : void 0, n = e.source.dialect && e.source.dialect !== "unknown" ? v(e.source.dialect) : void 0;
208
+ function Ie(e) {
209
+ const i = e.source.connectionType ? v(e.source.connectionType) : void 0, t = e.source.dialect ? z(e.source.dialect) : void 0, a = e.source.dialect && e.source.dialect !== "unknown" ? v(e.source.dialect) : void 0;
210
210
  if (!e.capabilities && e.source.connectionType && e.source.dialect && e.source.dialect !== "unknown" && (!i || t === "unknown" || i.dialect !== t))
211
211
  return { kind: "incompatible_capabilities" };
212
- const s = e.capabilities || i || n;
212
+ const s = e.capabilities || i || a;
213
213
  if (!s) return { kind: "incompatible_capabilities" };
214
214
  const r = O(s), o = {
215
215
  ...r.includes("database") && e.source.databaseName ? { databaseName: e.source.databaseName } : {},
216
216
  ...r.includes("schema") && e.source.schemaName ? { schemaName: e.source.schemaName } : {},
217
217
  ...e.source.tableName ? { tableName: e.source.tableName } : {}
218
- }, a = r.filter((d) => d === "database" ? !o.databaseName : d === "schema" ? !o.schemaName : !o.tableName);
219
- return a.length > 0 ? { kind: "missing_coordinates", missing: a } : {
218
+ }, n = r.filter((d) => d === "database" ? !o.databaseName : d === "schema" ? !o.schemaName : !o.tableName);
219
+ return n.length > 0 ? { kind: "missing_coordinates", missing: n } : {
220
220
  kind: "resolved",
221
221
  coordinates: o
222
222
  };
@@ -242,22 +242,22 @@ function x(e) {
242
242
  };
243
243
  }
244
244
  function ne(e) {
245
- if (re(e)) return { kind: "malformed" };
246
- const i = e.entities.filter(W), t = ae(e), n = se({
245
+ if (ce(e)) return { kind: "malformed" };
246
+ const i = e.entities.filter(W), t = se(e), a = oe({
247
247
  entities: i,
248
248
  connectionType: e.connectionType,
249
249
  dialect: e.dialect,
250
250
  capabilities: e.capabilities
251
251
  });
252
- if (!n) return { kind: "incompatible_capabilities" };
253
- const { capabilities: s } = n, r = ce({
252
+ if (!a) return { kind: "incompatible_capabilities" };
253
+ const { capabilities: s } = a, r = le({
254
254
  hints: e.qualifiedHints || [],
255
255
  coordinateHint: e.coordinateHint,
256
- capabilityAuthority: n
256
+ capabilityAuthority: a
257
257
  });
258
258
  if (r.kind !== "valid")
259
259
  return { kind: r.kind };
260
- const o = r.coordinates, a = o ? i.filter(
260
+ const o = r.coordinates, n = o ? i.filter(
261
261
  (c) => P({
262
262
  left: G(
263
263
  x(c),
@@ -267,23 +267,23 @@ function ne(e) {
267
267
  capabilities: s
268
268
  })
269
269
  ) : i;
270
- if (o && a.length === 0)
270
+ if (o && n.length === 0)
271
271
  return {
272
272
  kind: "not_found",
273
273
  basis: "qualified",
274
274
  coordinates: o,
275
- capabilityAuthority: n
275
+ capabilityAuthority: a
276
276
  };
277
- if (o && a.length === 1) {
278
- const c = a[0], u = E(
279
- n,
277
+ if (o && n.length === 1) {
278
+ const c = n[0], u = E(
279
+ a,
280
280
  c
281
281
  );
282
282
  return {
283
283
  kind: "resolved",
284
284
  basis: "qualified",
285
285
  entity: c,
286
- coordinates: fe(
286
+ coordinates: me(
287
287
  x(c),
288
288
  o,
289
289
  u
@@ -297,13 +297,13 @@ function ne(e) {
297
297
  o == null ? void 0 : o.tableName
298
298
  ]);
299
299
  if (d.size > 0) {
300
- const c = a.filter((u) => {
301
- const b = ue(u);
302
- return Array.from(d).some((h) => b.has(h));
300
+ const c = n.filter((u) => {
301
+ const b = fe(u);
302
+ return Array.from(d).some((y) => b.has(y));
303
303
  });
304
304
  if (c.length === 1) {
305
305
  const u = c[0], b = E(
306
- n,
306
+ a,
307
307
  u
308
308
  );
309
309
  return {
@@ -317,7 +317,7 @@ function ne(e) {
317
317
  capabilityAuthority: b
318
318
  };
319
319
  }
320
- return c.length > 1 ? { kind: "ambiguous", basis: "bare" } : { kind: "not_found", basis: "bare", capabilityAuthority: n };
320
+ return c.length > 1 ? { kind: "ambiguous", basis: "bare" } : { kind: "not_found", basis: "bare", capabilityAuthority: a };
321
321
  }
322
322
  if (o)
323
323
  return { kind: "ambiguous", basis: "qualified" };
@@ -325,11 +325,11 @@ function ne(e) {
325
325
  return {
326
326
  kind: "not_found",
327
327
  basis: t,
328
- capabilityAuthority: n
328
+ capabilityAuthority: a
329
329
  };
330
330
  if (i.length === 1) {
331
331
  const c = i[0], u = E(
332
- n,
332
+ a,
333
333
  c
334
334
  );
335
335
  return {
@@ -345,12 +345,12 @@ function ne(e) {
345
345
  }
346
346
  return { kind: "unqualified" };
347
347
  }
348
- function ae(e) {
349
- const i = (e.qualifiedHints || []).map(f).filter((n) => !!n);
348
+ function se(e) {
349
+ const i = (e.qualifiedHints || []).map(f).filter((a) => !!a);
350
350
  return Object.values(e.coordinateHint || {}).some(
351
- (n) => !!f(n)
352
- ) || i.some((n) => n.includes(".")) ? "qualified" : [...i, ...e.bareHints || []].some(
353
- (n) => !!f(n)
351
+ (a) => !!f(a)
352
+ ) || i.some((a) => a.includes(".")) ? "qualified" : [...i, ...e.bareHints || []].some(
353
+ (a) => !!f(a)
354
354
  ) ? "bare" : void 0;
355
355
  }
356
356
  function S(e) {
@@ -362,29 +362,29 @@ function L(e) {
362
362
  prefixLevels: [...e.prefixLevels]
363
363
  };
364
364
  }
365
- function se(e) {
365
+ function oe(e) {
366
366
  var q;
367
- const i = f(e.connectionType), t = f(e.dialect), n = e.capabilities ? L(e.capabilities) : void 0, s = i ? v(i) : void 0, r = t ? z(t) : void 0, o = t && t !== "unknown" ? v(t) : void 0;
368
- if (i && !s || t && t !== "unknown" && r === "unknown" || n && s && S(n) !== S(s))
367
+ const i = f(e.connectionType), t = f(e.dialect), a = e.capabilities ? L(e.capabilities) : void 0, s = i ? v(i) : void 0, r = t ? z(t) : void 0, o = t && t !== "unknown" ? v(t) : void 0;
368
+ if (i && !s || t && t !== "unknown" && r === "unknown" || a && s && S(a) !== S(s))
369
369
  return;
370
- const a = n || (s ? L(s) : o ? L(o) : void 0);
371
- if (a)
372
- return r && r !== "unknown" && a.dialect !== r ? void 0 : {
373
- capabilities: a,
370
+ const n = a || (s ? L(s) : o ? L(o) : void 0);
371
+ if (n)
372
+ return r && r !== "unknown" && n.dialect !== r ? void 0 : {
373
+ capabilities: n,
374
374
  ...i ? { connectionType: i } : {},
375
- dialect: a.dialect,
375
+ dialect: n.dialect,
376
376
  evidence: "explicit"
377
377
  };
378
378
  const d = e.entities.map((m) => {
379
- const k = w(m), g = f(k == null ? void 0 : k.connectionType), y = f(k == null ? void 0 : k.dialect), N = g ? v(g) : void 0, H = y ? z(y) : void 0, A = y && y !== "unknown" ? v(y) : void 0;
380
- if (g && !N || y && y !== "unknown" && H === "unknown" || y && y !== "unknown" && !N && !A || N && H && H !== "unknown" && N.dialect !== H)
379
+ const k = w(m), N = f(k == null ? void 0 : k.connectionType), p = f(k == null ? void 0 : k.dialect), I = N ? v(N) : void 0, H = p ? z(p) : void 0, A = p && p !== "unknown" ? v(p) : void 0;
380
+ if (N && !I || p && p !== "unknown" && H === "unknown" || p && p !== "unknown" && !I && !A || I && H && H !== "unknown" && I.dialect !== H)
381
381
  return;
382
- const F = N || A, B = F ? L(F) : oe(k);
382
+ const F = I || A, B = F ? L(F) : re(k);
383
383
  return B ? {
384
384
  capabilities: B,
385
- connectionType: g,
386
- capabilityIdentity: g ? M(g) : void 0,
387
- inferred: !N && !A,
385
+ connectionType: N,
386
+ capabilityIdentity: N ? M(N) : void 0,
387
+ inferred: !I && !A,
388
388
  signature: S(B)
389
389
  } : void 0;
390
390
  });
@@ -399,17 +399,17 @@ function se(e) {
399
399
  return;
400
400
  const b = new Set(
401
401
  c.map((m) => m.capabilityIdentity).filter((m) => !!m)
402
- ), h = c.every(
402
+ ), y = c.every(
403
403
  (m) => m.connectionType && m.capabilityIdentity
404
404
  );
405
405
  return {
406
406
  capabilities: u,
407
- ...h && b.size === 1 ? { connectionType: c[0].connectionType } : {},
407
+ ...y && b.size === 1 ? { connectionType: c[0].connectionType } : {},
408
408
  dialect: u.dialect,
409
409
  evidence: c.every((m) => m.inferred) ? "coordinates" : "entity"
410
410
  };
411
411
  }
412
- function oe(e) {
412
+ function re(e) {
413
413
  const i = !!f(e == null ? void 0 : e.database), t = !!f(e == null ? void 0 : e.schema);
414
414
  if (!(i && t)) {
415
415
  if (t)
@@ -421,34 +421,34 @@ function oe(e) {
421
421
  function E(e, i) {
422
422
  var s;
423
423
  if (e.evidence !== "entity") return e;
424
- const t = f((s = w(i)) == null ? void 0 : s.connectionType), n = t ? v(t) : void 0;
425
- return n && S(n) === S(e.capabilities) ? { ...e, connectionType: t } : e;
424
+ const t = f((s = w(i)) == null ? void 0 : s.connectionType), a = t ? v(t) : void 0;
425
+ return a && S(a) === S(e.capabilities) ? { ...e, connectionType: t } : e;
426
426
  }
427
- function re(e) {
427
+ function ce(e) {
428
428
  return (e.qualifiedHints || []).some(
429
429
  (t) => {
430
- const n = f(t);
431
- return !!(n && n.includes(".") && !p(n));
430
+ const a = f(t);
431
+ return !!(a && a.includes(".") && !h(a));
432
432
  }
433
433
  ) ? !0 : Object.values(e.coordinateHint || {}).some((t) => {
434
- const n = f(t);
435
- return !!(n && !p(n));
434
+ const a = f(t);
435
+ return !!(a && !h(a));
436
436
  });
437
437
  }
438
- function ce(e) {
439
- const { capabilities: i } = e.capabilityAuthority, t = [], n = [];
438
+ function le(e) {
439
+ const { capabilities: i } = e.capabilityAuthority, t = [], a = [];
440
440
  for (const b of e.hints) {
441
- const h = f(b);
442
- if (!h) continue;
443
- if (!h.includes(".")) {
444
- n.push(h);
441
+ const y = f(b);
442
+ if (!y) continue;
443
+ if (!y.includes(".")) {
444
+ a.push(y);
445
445
  continue;
446
446
  }
447
- const q = p(h);
447
+ const q = h(y);
448
448
  if (!q) return { kind: "malformed" };
449
449
  t.push(q);
450
450
  }
451
- const s = le(e.coordinateHint);
451
+ const s = de(e.coordinateHint);
452
452
  if (s.kind === "malformed") return s;
453
453
  const r = Array.from(new Set(t)).map(
454
454
  (b) => Q({
@@ -456,11 +456,11 @@ function ce(e) {
456
456
  capabilities: i
457
457
  })
458
458
  );
459
- if (!de(r, i))
459
+ if (!ue(r, i))
460
460
  return { kind: "conflicting" };
461
461
  const o = [...new Set(t)].sort(
462
- (b, h) => h.split(".").length - b.split(".").length
463
- )[0], a = o ? Q({
462
+ (b, y) => y.split(".").length - b.split(".").length
463
+ )[0], n = o ? Q({
464
464
  qualifiedName: o,
465
465
  capabilities: i
466
466
  }) : void 0, d = G(
@@ -470,28 +470,28 @@ function ce(e) {
470
470
  s.coordinates,
471
471
  e.capabilityAuthority
472
472
  ), u = !!(d.tableName && (d.databaseName || d.schemaName));
473
- return a && u && !P({
474
- left: a,
473
+ return n && u && !P({
474
+ left: n,
475
475
  right: d,
476
476
  capabilities: i
477
477
  }) ? { kind: "conflicting" } : {
478
478
  kind: "valid",
479
- coordinates: a ? {
479
+ coordinates: n ? {
480
480
  ...c,
481
- ...a
481
+ ...n
482
482
  } : u ? c : void 0,
483
483
  bareHints: [
484
- ...n,
484
+ ...a,
485
485
  ...!u && d.tableName ? [d.tableName] : []
486
486
  ]
487
487
  };
488
488
  }
489
- function le(e) {
489
+ function de(e) {
490
490
  const i = {};
491
- for (const [t, n] of Object.entries(e || {})) {
492
- const s = f(n);
491
+ for (const [t, a] of Object.entries(e || {})) {
492
+ const s = f(a);
493
493
  if (!s) continue;
494
- const r = p(s);
494
+ const r = h(s);
495
495
  if (!r) return { kind: "malformed" };
496
496
  i[t] = r;
497
497
  }
@@ -504,9 +504,9 @@ function G(e, i) {
504
504
  ...e.tableName ? { tableName: e.tableName } : {}
505
505
  };
506
506
  }
507
- function de(e, i) {
507
+ function ue(e, i) {
508
508
  return e.every(
509
- (t, n) => e.slice(n + 1).every(
509
+ (t, a) => e.slice(a + 1).every(
510
510
  (s) => P({
511
511
  left: t,
512
512
  right: s,
@@ -517,10 +517,10 @@ function de(e, i) {
517
517
  }
518
518
  function U(e) {
519
519
  return new Set(
520
- e.map(f).map(p).filter((i) => !!i)
520
+ e.map(f).map(h).filter((i) => !!i)
521
521
  );
522
522
  }
523
- function ue(e) {
523
+ function fe(e) {
524
524
  const i = w(e);
525
525
  return i ? U([
526
526
  f(i.name),
@@ -528,7 +528,7 @@ function ue(e) {
528
528
  f(i.id)
529
529
  ]) : /* @__PURE__ */ new Set();
530
530
  }
531
- function fe(e, i, t) {
531
+ function me(e, i, t) {
532
532
  return T(
533
533
  {
534
534
  ...e,
@@ -548,67 +548,67 @@ function T(e, i) {
548
548
  function l(e) {
549
549
  return typeof e == "string" && e.trim() ? e.trim() : void 0;
550
550
  }
551
- function C(e) {
551
+ function g(e) {
552
552
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
553
553
  }
554
- function me(e) {
555
- const i = C(e);
554
+ function be(e) {
555
+ const i = g(e);
556
556
  return !!(i && i.type === "dataset" && l(i.name));
557
557
  }
558
558
  function J(e) {
559
- const i = C(e);
559
+ const i = g(e);
560
560
  return !!(i && i.type === "dataset" && i.datasetType !== "physical" && l(i.name));
561
561
  }
562
562
  function R(e) {
563
563
  const i = /* @__PURE__ */ new Set();
564
564
  for (const t of e) {
565
- const n = l(t);
566
- if (!n) continue;
567
- const s = p(n);
565
+ const a = l(t);
566
+ if (!a) continue;
567
+ const s = h(a);
568
568
  if (!s) continue;
569
569
  const r = s.toLowerCase();
570
570
  i.add(r);
571
- const o = r.split("."), a = o[o.length - 1];
572
- a && i.add(a);
571
+ const o = r.split("."), n = o[o.length - 1];
572
+ n && i.add(n);
573
573
  }
574
574
  return i;
575
575
  }
576
576
  function $(e) {
577
577
  var t;
578
578
  const i = l(e);
579
- return i ? (t = p(i)) == null ? void 0 : t.toLowerCase() : void 0;
579
+ return i ? (t = h(i)) == null ? void 0 : t.toLowerCase() : void 0;
580
580
  }
581
581
  function D(e, i) {
582
- const t = C(i), n = l(t == null ? void 0 : t.domainId) || l(e.semanticDomainId), s = l(t == null ? void 0 : t.name);
583
- if (!n || !s) return;
582
+ const t = g(i), a = l(t == null ? void 0 : t.domainId) || l(e.semanticDomainId), s = l(t == null ? void 0 : t.name);
583
+ if (!a || !s) return;
584
584
  const r = (t == null ? void 0 : t.datasetType) === "physical" ? void 0 : K(t || {}), o = l(t == null ? void 0 : t.connectionId) || l(e.connectionId);
585
585
  return {
586
586
  kind: "semantic",
587
- domainId: n,
587
+ domainId: a,
588
588
  datasetName: s,
589
589
  ...r ? { datasetId: r } : {},
590
590
  ...o ? { connectionId: o } : {}
591
591
  };
592
592
  }
593
- function be(e, i = {}) {
593
+ function he(e, i = {}) {
594
594
  const t = l(e.fieldEntityType);
595
595
  if (t && t !== "dataset")
596
596
  return { kind: "unqualified" };
597
- const n = e.entities.filter(
598
- (o) => i.includePhysicalDatasets ? me(o) : J(o)
597
+ const a = e.entities.filter(
598
+ (o) => i.includePhysicalDatasets ? be(o) : J(o)
599
599
  ), s = l(e.entityId);
600
600
  if (s) {
601
- const o = $(s), a = n.filter((d) => {
602
- const c = C(d);
601
+ const o = $(s), n = a.filter((d) => {
602
+ const c = g(d);
603
603
  return !!(o && $(c == null ? void 0 : c.id) === o);
604
604
  });
605
- if (a.length > 1) return { kind: "ambiguous", basis: "bare" };
606
- if (a.length === 1) {
607
- const d = D(e, a[0]);
605
+ if (n.length > 1) return { kind: "ambiguous", basis: "bare" };
606
+ if (n.length === 1) {
607
+ const d = D(e, n[0]);
608
608
  return d ? {
609
609
  kind: "resolved",
610
610
  basis: "bare",
611
- entity: a[0],
611
+ entity: n[0],
612
612
  source: d,
613
613
  matchedById: !0
614
614
  } : { kind: "not_found", basis: "bare" };
@@ -620,29 +620,29 @@ function be(e, i = {}) {
620
620
  ...e.bareHints || []
621
621
  ]);
622
622
  if (r.size > 0) {
623
- const o = n.filter((a) => {
624
- const d = C(a);
623
+ const o = a.filter((n) => {
624
+ const d = g(n);
625
625
  return [...R([d == null ? void 0 : d.id, d == null ? void 0 : d.name])].some((u) => r.has(u));
626
626
  });
627
627
  if (o.length > 1) return { kind: "ambiguous", basis: "bare" };
628
628
  if (o.length === 1) {
629
- const a = D(e, o[0]);
630
- return a ? {
629
+ const n = D(e, o[0]);
630
+ return n ? {
631
631
  kind: "resolved",
632
632
  basis: "bare",
633
633
  entity: o[0],
634
- source: a,
634
+ source: n,
635
635
  matchedById: !1
636
636
  } : { kind: "not_found", basis: "bare" };
637
637
  }
638
638
  return { kind: "not_found", basis: "bare" };
639
639
  }
640
- if (n.length === 1) {
641
- const o = D(e, n[0]);
640
+ if (a.length === 1) {
641
+ const o = D(e, a[0]);
642
642
  return o ? {
643
643
  kind: "resolved",
644
644
  basis: "unqualified",
645
- entity: n[0],
645
+ entity: a[0],
646
646
  source: o,
647
647
  matchedById: !1
648
648
  } : { kind: "unqualified" };
@@ -650,21 +650,39 @@ function be(e, i = {}) {
650
650
  return { kind: "unqualified" };
651
651
  }
652
652
  function _(e) {
653
- const i = e.resolution.kind === "resolved" ? C(e.resolution.entity) : void 0, t = l(e.connectionId) || l(i == null ? void 0 : i.connectionId), { connectionType: n, dialect: s } = e.resolution.capabilityAuthority, r = v(s), o = !!(r && r.dialect === e.resolution.capabilityAuthority.capabilities.dialect && r.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
653
+ const i = e.resolution.kind === "resolved" ? g(e.resolution.entity) : void 0, t = l(e.connectionId) || l(i == null ? void 0 : i.connectionId), { connectionType: a, dialect: s } = e.resolution.capabilityAuthority, r = v(s), o = !!(r && r.dialect === e.resolution.capabilityAuthority.capabilities.dialect && r.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
654
654
  "."
655
- )), a = e.resolution.coordinates;
656
- if (!(!t || !(a != null && a.tableName)))
655
+ )), n = e.resolution.coordinates;
656
+ if (!(!t || !(n != null && n.tableName)))
657
657
  return {
658
658
  kind: "physical",
659
659
  connectionId: t,
660
- ...n ? { connectionType: n } : {},
661
- ...!n && o ? { dialect: s } : {},
662
- tableName: a.tableName,
663
- ...a.databaseName ? { databaseName: a.databaseName } : {},
664
- ...a.schemaName ? { schemaName: a.schemaName } : {}
660
+ ...a ? { connectionType: a } : {},
661
+ ...!a && o ? { dialect: s } : {},
662
+ tableName: n.tableName,
663
+ ...n.databaseName ? { databaseName: n.databaseName } : {},
664
+ ...n.schemaName ? { schemaName: n.schemaName } : {}
665
665
  };
666
666
  }
667
- function he(e) {
667
+ function ye(e) {
668
+ const i = g(e.entity), t = h(l(i == null ? void 0 : i.table));
669
+ if (!t) return !1;
670
+ const a = h(
671
+ l(i == null ? void 0 : i.database)
672
+ ), s = h(
673
+ l(i == null ? void 0 : i.schema)
674
+ );
675
+ return e.coordinates.tableName ? X({
676
+ requested: e.coordinates,
677
+ allowed: {
678
+ ...a ? { databaseName: a } : {},
679
+ ...s ? { schemaName: s } : {},
680
+ tableName: t
681
+ },
682
+ capabilities: e.capabilityAuthority.capabilities
683
+ }) : !1;
684
+ }
685
+ function pe(e) {
668
686
  var s, r, o;
669
687
  if (l(e.connectionType) || l(e.dialect) || e.capabilities || l(e.semanticDomainId) || l(e.fieldEntityType) === "dataset" || l((s = e.fallbackCoordinateHint) == null ? void 0 : s.databaseName) || l((r = e.fallbackCoordinateHint) == null ? void 0 : r.schemaName))
670
688
  return;
@@ -674,23 +692,23 @@ function he(e) {
674
692
  ...(e.bareHints || []).map(l),
675
693
  l(e.entityName),
676
694
  ...l(e.fieldEntityType) === "table" ? [l(e.entityId)] : []
677
- ].filter((a) => !!a);
678
- if (!i.length || i.some((a) => a.includes(".")))
695
+ ].filter((n) => !!n);
696
+ if (!i.length || i.some((n) => n.includes(".")))
679
697
  return;
680
- const t = i.map(p);
681
- return t.some((a) => !a) ? void 0 : new Set(t.map((a) => a.toLowerCase())).size === 1 ? t[0] : void 0;
698
+ const t = i.map(h);
699
+ return t.some((n) => !n) ? void 0 : new Set(t.map((n) => n.toLowerCase())).size === 1 ? t[0] : void 0;
682
700
  }
683
- function Ie(e) {
701
+ function Ce(e) {
684
702
  const i = e.entities.filter(
685
703
  W
686
704
  ), t = e.entities.filter(
687
705
  J
688
- ), n = i.length > 0 || t.length > 0, s = be(e), r = e.qualifiedHints || [], o = r.some(
706
+ ), a = i.length > 0 || t.length > 0, s = he(e), r = e.qualifiedHints || [], o = r.some(
689
707
  (c) => {
690
708
  var u;
691
709
  return (u = l(c)) == null ? void 0 : u.includes(".");
692
710
  }
693
- ), a = ne({
711
+ ), n = ne({
694
712
  entities: i,
695
713
  connectionType: l(e.connectionType),
696
714
  dialect: e.dialect,
@@ -699,49 +717,60 @@ function Ie(e) {
699
717
  bareHints: [e.entityName, e.entityId, ...e.bareHints || []],
700
718
  ...!o && e.fallbackCoordinateHint ? { coordinateHint: e.fallbackCoordinateHint } : {}
701
719
  });
702
- if (a.kind === "malformed" || a.kind === "conflicting" || a.kind === "incompatible_capabilities" && o || a.kind === "ambiguous" && a.basis === "qualified")
703
- return a;
704
- if (a.kind === "resolved" && a.basis === "qualified") {
720
+ if (n.kind === "malformed" || n.kind === "conflicting" || n.kind === "incompatible_capabilities" && o || n.kind === "ambiguous" && n.basis === "qualified")
721
+ return n;
722
+ if (n.kind === "resolved" && n.basis === "qualified") {
705
723
  const c = _({
706
- resolution: a,
724
+ resolution: n,
707
725
  connectionId: e.connectionId
708
726
  });
709
727
  return c ? {
710
728
  kind: "resolved",
711
- basis: a.basis,
729
+ basis: n.basis,
712
730
  source: c,
713
- entity: a.entity
731
+ entity: n.entity
714
732
  } : { kind: "missing_connection" };
715
733
  }
716
- if (a.kind === "not_found" && a.basis === "qualified" && a.coordinates) {
734
+ if (n.kind === "not_found" && n.basis === "qualified" && n.coordinates) {
735
+ if (s.kind === "resolved" && s.matchedById && ye({
736
+ entity: s.entity,
737
+ coordinates: n.coordinates,
738
+ capabilityAuthority: n.capabilityAuthority
739
+ }))
740
+ return {
741
+ kind: "resolved",
742
+ basis: s.basis,
743
+ source: s.source,
744
+ entity: s.entity
745
+ };
717
746
  const c = _({
718
- resolution: a,
747
+ resolution: n,
719
748
  connectionId: e.connectionId
720
749
  });
721
- return c ? n ? { kind: "candidate", basis: "qualified", source: c } : { kind: "resolved", basis: "qualified", source: c } : { kind: "missing_connection" };
750
+ return c ? a ? { kind: "candidate", basis: "qualified", source: c } : { kind: "resolved", basis: "qualified", source: c } : { kind: "missing_connection" };
722
751
  }
723
752
  if (s.kind === "resolved")
724
- return a.kind === "resolved" && a.basis === "bare" && !s.matchedById ? { kind: "ambiguous", basis: "bare" } : {
753
+ return n.kind === "resolved" && n.basis === "bare" && !s.matchedById ? { kind: "ambiguous", basis: "bare" } : {
725
754
  kind: "resolved",
726
755
  basis: s.basis,
727
756
  source: s.source,
728
757
  entity: s.entity
729
758
  };
730
759
  if (s.kind === "ambiguous") return s;
731
- if (a.kind === "resolved") {
760
+ if (n.kind === "resolved") {
732
761
  const c = _({
733
- resolution: a,
762
+ resolution: n,
734
763
  connectionId: e.connectionId
735
764
  });
736
765
  return c ? {
737
766
  kind: "resolved",
738
- basis: a.basis,
767
+ basis: n.basis,
739
768
  source: c,
740
- entity: a.entity
769
+ entity: n.entity
741
770
  } : { kind: "missing_connection" };
742
771
  }
743
772
  const d = l(e.entityName) || l(e.entityId);
744
- if (!n && !o && l(e.semanticDomainId) && (!l(e.fieldEntityType) || l(e.fieldEntityType) === "dataset") && d)
773
+ if (!a && !o && l(e.semanticDomainId) && (!l(e.fieldEntityType) || l(e.fieldEntityType) === "dataset") && d)
745
774
  return {
746
775
  kind: "resolved",
747
776
  basis: "historical",
@@ -752,35 +781,35 @@ function Ie(e) {
752
781
  ...l(e.connectionId) ? { connectionId: l(e.connectionId) } : {}
753
782
  }
754
783
  };
755
- if (a.kind === "incompatible_capabilities") {
756
- const c = n ? void 0 : he(e), u = l(e.connectionId);
784
+ if (n.kind === "incompatible_capabilities") {
785
+ const c = a ? void 0 : pe(e), u = l(e.connectionId);
757
786
  return c && u ? {
758
787
  kind: "resolved",
759
788
  basis: "historical",
760
789
  source: { kind: "physical", connectionId: u, tableName: c }
761
- } : a;
790
+ } : n;
762
791
  }
763
- return a.kind === "ambiguous" ? a : a.kind === "not_found" ? {
792
+ return n.kind === "ambiguous" ? n : n.kind === "not_found" ? {
764
793
  kind: "not_found",
765
- basis: a.basis
794
+ basis: n.basis
766
795
  } : { kind: "unqualified" };
767
796
  }
768
797
  export {
769
- pe as a,
798
+ X as a,
770
799
  M as b,
771
- p as c,
772
- ve as d,
773
- ke as e,
774
- ge as f,
775
- X as g,
800
+ h as c,
801
+ ke as d,
802
+ ge as e,
803
+ Ne as f,
804
+ Y as g,
776
805
  O as h,
777
- Ne as i,
806
+ Ie as i,
778
807
  W as j,
779
808
  ne as k,
780
809
  J as l,
781
- be as m,
810
+ he as m,
782
811
  z as n,
783
- Ie as o,
812
+ Ce as o,
784
813
  Q as p,
785
814
  v as r,
786
815
  P as s