react-semaphor 0.1.558 → 0.1.560

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 (139) hide show
  1. package/dist/analytics-protocol/index.js +368 -358
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/analytics-base-schemas-CHLxsPfX.js +630 -0
  7. package/dist/chunks/{assistant-chat-BCWoP6Rf.js → assistant-chat-Bu2fFm_I.js} +206 -207
  8. package/dist/chunks/{bookmark-state-PjQpxbG7.js → bookmark-state-BFY9oNmr.js} +3 -3
  9. package/dist/chunks/{braces-D5Ucy7q1.js → braces-Da41xfUd.js} +1 -1
  10. package/dist/chunks/{comparison-window-caption-Dc7BaCMz.js → comparison-window-caption-4FNkMrzE.js} +213 -213
  11. package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
  12. package/dist/chunks/{custom-visual-inputs-B-DLRGrV.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
  13. package/dist/chunks/{dashboard-wK6Bai4V.js → dashboard-_MeBuy67.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-Coqghdn6.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
  15. package/dist/chunks/{dashboard-controls-BYWSM2RM.js → dashboard-controls-Bi7fyG-4.js} +98 -98
  16. package/dist/chunks/{dashboard-json-pPTB5gj0.js → dashboard-json-B1mU_OMa.js} +5 -5
  17. package/dist/chunks/{document-dashboard-inputs-PY_7Xm55.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
  18. package/dist/chunks/{edit-dashboard-visual-BODxuUeq.js → edit-dashboard-visual-0CJN31Y3.js} +8274 -8514
  19. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
  20. package/dist/chunks/{filter-value-text-CUBpotVN.js → filter-value-text-CRC-K_l_.js} +3 -3
  21. package/dist/chunks/{global-date-filter-utils-BsFqnnbA.js → global-date-filter-utils-D8365uPH.js} +4088 -3416
  22. package/dist/chunks/{index-DP_wQl0v.js → index-DtHidOPV.js} +579 -604
  23. package/dist/chunks/{layout-grid-CkoXmv0L.js → layout-grid-BvsH4RY2.js} +1 -1
  24. package/dist/chunks/{list-filter-B4i25kuc.js → list-filter-Dg0otx5E.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-4GTUDheD.js → matrix-analytical-definition-CM18W8w6.js} +41 -41
  26. package/dist/chunks/{matrix-card-fS_4O7zA.js → matrix-card-HPskLaPy.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Dj7HaAHC.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-CpgLZ7E5.js → matrix-operation-contract-WPv4R-H_.js} +130 -130
  29. package/dist/chunks/{metric-comparison-C8LY7GG5.js → metric-comparison-ljMKYZKa.js} +2 -2
  30. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
  31. package/dist/chunks/{palette-stlpjVk4.js → palette-Bsh376zO.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-DMk-mKhG.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
  33. package/dist/chunks/{pivot-result-identity-CrQ54Xbj.js → pivot-result-identity-vS9TSh4f.js} +1 -1
  34. package/dist/chunks/{raw-temporal-presentation-BI2z2LlB.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
  35. package/dist/chunks/{report-preferences-dialog-Dc-YyVwf.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-CohdtiMg.js → report-runtime-context-BZQh9ywy.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-BZYI1hB0.js → resolve-dashboard-input-context-CAMiWvyR.js} +2021 -2239
  38. package/dist/chunks/{save-C1dgxgAu.js → save-B5EAsgQF.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-CIBoMq46.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
  40. package/dist/chunks/{selection-reducer-_d6aKJnj.js → selection-reducer-D0YnaAD9.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-ERTLU7B4.js → semaphor-ready-indicator-XLBLOJ2V.js} +38446 -39176
  42. package/dist/chunks/{shelf-drop-preview-context-fEnx6iL_.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
  43. package/dist/chunks/source-entity-resolution-dUG5VWRm.js +607 -0
  44. package/dist/chunks/{switch-BqUan2mN.js → switch-ByxH4M7t.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-CTCTA_bd.js → table-export-sheet-C_GdeTYU.js} +1 -1
  46. package/dist/chunks/{table-settings-DF1gdVQR.js → table-settings-Imz0FgWi.js} +8 -8
  47. package/dist/chunks/{temporal-input-presentation-DoSniQj1.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
  48. package/dist/chunks/{token-types-DFyLflLY.js → token-types-CQtXUVMy.js} +1 -1
  49. package/dist/chunks/{upload-DcoyjkRV.js → upload-wbR-NVzq.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-xhb9YFg-.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
  51. package/dist/chunks/validators-CXTneCA4.js +3453 -0
  52. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +2207 -1496
  55. package/dist/data-app-sdk/index.js +20 -20
  56. package/dist/data-app-sdk-adapters/index.js +3 -3
  57. package/dist/data-app-sdk-validation/index.js +6 -6
  58. package/dist/format-utils/index.js +181 -176
  59. package/dist/index.js +22 -22
  60. package/dist/report-runtime-context/index.js +2 -2
  61. package/dist/style.css +1 -1
  62. package/dist/surfboard/index.js +2 -2
  63. package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
  64. package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
  65. package/dist/types/index.js +6 -6
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  68. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  69. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  70. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  71. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  72. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  73. package/dist/types/lib/stores/editor-store.d.ts +39 -9
  74. package/dist/types/lib/stores/table-actions.d.ts +9 -3
  75. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  76. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  79. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  80. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  81. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  82. package/dist/types/lib/types/common-types.d.ts +40 -47
  83. package/dist/types/lib/types/explorer-types.d.ts +13 -44
  84. package/dist/types/lib/utils/card-config-utils.d.ts +9 -1
  85. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  86. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
  87. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  88. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  89. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  90. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  91. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  92. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  93. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  94. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  95. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  96. package/dist/types/shared/analytics-protocol/source-capabilities.d.ts +21 -0
  97. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  98. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  99. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  100. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  101. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  103. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
  104. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  105. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  106. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  107. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
  108. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  109. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  110. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  111. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  112. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  113. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  114. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  115. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +2 -0
  116. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  117. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +4 -2
  118. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  119. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  120. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  121. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  122. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
  123. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  124. package/dist/types/shared/format-utils/index.d.ts +2 -0
  125. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  126. package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
  127. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  128. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  129. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  130. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  131. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  132. package/package.json +1 -1
  133. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  134. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  135. package/dist/chunks/filter-reach-copy-BvJH9JO-.js +0 -3411
  136. package/dist/chunks/source-entity-resolution-DXW1HpKf.js +0 -816
  137. package/dist/chunks/validators-hmfNNQz8.js +0 -3595
  138. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  139. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -0,0 +1,607 @@
1
+ import { w as p, x as _, y as z, z as y, A as G, B as Q, E as J, F as K } from "./validators-CXTneCA4.js";
2
+ function R(e) {
3
+ return e.prefixLevels.length === 1 && e.prefixLevels[0] === "table" ? ["table"] : Array.from(
4
+ /* @__PURE__ */ new Set([
5
+ "database",
6
+ ...e.prefixLevels
7
+ ])
8
+ );
9
+ }
10
+ function le(e) {
11
+ const i = e.source.connectionType ? p(e.source.connectionType) : void 0, n = e.source.dialect ? _(e.source.dialect) : void 0, a = e.source.dialect && e.source.dialect !== "unknown" ? p(e.source.dialect) : void 0;
12
+ if (!e.capabilities && e.source.connectionType && e.source.dialect && e.source.dialect !== "unknown" && (!i || n === "unknown" || i.dialect !== n))
13
+ return { kind: "incompatible_capabilities" };
14
+ const o = e.capabilities || i || a;
15
+ if (!o) return { kind: "incompatible_capabilities" };
16
+ const c = R(o), s = {
17
+ ...c.includes("database") && e.source.databaseName ? { databaseName: e.source.databaseName } : {},
18
+ ...c.includes("schema") && e.source.schemaName ? { schemaName: e.source.schemaName } : {},
19
+ ...e.source.tableName ? { tableName: e.source.tableName } : {}
20
+ }, t = c.filter((l) => l === "database" ? !s.databaseName : l === "schema" ? !s.schemaName : !s.tableName);
21
+ return t.length > 0 ? { kind: "missing_coordinates", missing: t } : {
22
+ kind: "resolved",
23
+ coordinates: s
24
+ };
25
+ }
26
+ function u(e) {
27
+ return typeof e == "string" && e.trim() ? e.trim() : void 0;
28
+ }
29
+ function H(e) {
30
+ return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
31
+ }
32
+ function M(e) {
33
+ const i = H(e);
34
+ return !i || !u(i.name) || i.type === "model" ? !1 : i.type === "dataset" ? i.datasetType === "physical" : !0;
35
+ }
36
+ function w(e) {
37
+ const i = H(e);
38
+ if (!i) return {};
39
+ const n = u(i.table) || u(i.name);
40
+ return {
41
+ ...u(i.database) ? { databaseName: u(i.database) } : {},
42
+ ...u(i.schema) ? { schemaName: u(i.schema) } : {},
43
+ ...n ? { tableName: n } : {}
44
+ };
45
+ }
46
+ function U(e) {
47
+ if (Z(e)) return { kind: "malformed" };
48
+ const i = e.entities.filter(M), n = W(e), a = X({
49
+ entities: i,
50
+ connectionType: e.connectionType,
51
+ dialect: e.dialect,
52
+ capabilities: e.capabilities
53
+ });
54
+ if (!a) return { kind: "incompatible_capabilities" };
55
+ const { capabilities: o } = a, c = ee({
56
+ hints: e.qualifiedHints || [],
57
+ coordinateHint: e.coordinateHint,
58
+ capabilityAuthority: a
59
+ });
60
+ if (c.kind !== "valid")
61
+ return { kind: c.kind };
62
+ const s = c.coordinates, t = s ? i.filter(
63
+ (r) => z({
64
+ left: $(
65
+ w(r),
66
+ o
67
+ ),
68
+ right: s,
69
+ capabilities: o
70
+ })
71
+ ) : i;
72
+ if (s && t.length === 0)
73
+ return {
74
+ kind: "not_found",
75
+ basis: "qualified",
76
+ coordinates: s,
77
+ capabilityAuthority: a
78
+ };
79
+ if (s && t.length === 1) {
80
+ const r = t[0], f = E(
81
+ a,
82
+ r
83
+ );
84
+ return {
85
+ kind: "resolved",
86
+ basis: "qualified",
87
+ entity: r,
88
+ coordinates: ae(
89
+ w(r),
90
+ s,
91
+ f
92
+ ),
93
+ capabilityAuthority: f
94
+ };
95
+ }
96
+ const l = O([
97
+ ...e.bareHints || [],
98
+ ...c.bareHints,
99
+ s == null ? void 0 : s.tableName
100
+ ]);
101
+ if (l.size > 0) {
102
+ const r = t.filter((f) => {
103
+ const b = ne(f);
104
+ return Array.from(l).some((h) => b.has(h));
105
+ });
106
+ if (r.length === 1) {
107
+ const f = r[0], b = E(
108
+ a,
109
+ f
110
+ );
111
+ return {
112
+ kind: "resolved",
113
+ basis: "bare",
114
+ entity: f,
115
+ coordinates: A(
116
+ w(f),
117
+ b
118
+ ),
119
+ capabilityAuthority: b
120
+ };
121
+ }
122
+ return r.length > 1 ? { kind: "ambiguous", basis: "bare" } : { kind: "not_found", basis: "bare", capabilityAuthority: a };
123
+ }
124
+ if (s)
125
+ return { kind: "ambiguous", basis: "qualified" };
126
+ if (n)
127
+ return {
128
+ kind: "not_found",
129
+ basis: n,
130
+ capabilityAuthority: a
131
+ };
132
+ if (i.length === 1) {
133
+ const r = i[0], f = E(
134
+ a,
135
+ r
136
+ );
137
+ return {
138
+ kind: "resolved",
139
+ basis: "unqualified",
140
+ entity: r,
141
+ coordinates: A(
142
+ w(r),
143
+ f
144
+ ),
145
+ capabilityAuthority: f
146
+ };
147
+ }
148
+ return { kind: "unqualified" };
149
+ }
150
+ function W(e) {
151
+ const i = (e.qualifiedHints || []).map(u).filter((a) => !!a);
152
+ return Object.values(e.coordinateHint || {}).some(
153
+ (a) => !!u(a)
154
+ ) || i.some((a) => a.includes(".")) ? "qualified" : [...i, ...e.bareHints || []].some(
155
+ (a) => !!u(a)
156
+ ) ? "bare" : void 0;
157
+ }
158
+ function S(e) {
159
+ return `${e.dialect}:${e.prefixLevels.join(".")}`;
160
+ }
161
+ function q(e) {
162
+ return {
163
+ dialect: e.dialect,
164
+ prefixLevels: [...e.prefixLevels]
165
+ };
166
+ }
167
+ function X(e) {
168
+ var I;
169
+ const i = u(e.connectionType), n = u(e.dialect), a = e.capabilities ? q(e.capabilities) : void 0, o = i ? p(i) : void 0, c = n ? _(n) : void 0, s = n && n !== "unknown" ? p(n) : void 0;
170
+ if (i && !o || n && n !== "unknown" && c === "unknown" || a && o && S(a) !== S(o))
171
+ return;
172
+ const t = a || (o ? q(o) : s ? q(s) : void 0);
173
+ if (t)
174
+ return c && c !== "unknown" && t.dialect !== c ? void 0 : {
175
+ capabilities: t,
176
+ ...i ? { connectionType: i } : {},
177
+ dialect: t.dialect,
178
+ evidence: "explicit"
179
+ };
180
+ const l = e.entities.map((m) => {
181
+ const k = H(m), g = u(k == null ? void 0 : k.connectionType), v = u(k == null ? void 0 : k.dialect), C = g ? p(g) : void 0, T = v ? _(v) : void 0, B = v && v !== "unknown" ? p(v) : void 0;
182
+ if (g && !C || v && v !== "unknown" && T === "unknown" || v && v !== "unknown" && !C && !B || C && T && T !== "unknown" && C.dialect !== T)
183
+ return;
184
+ const P = C || B, x = P ? q(P) : Y(k);
185
+ return x ? {
186
+ capabilities: x,
187
+ connectionType: g,
188
+ capabilityIdentity: g ? G(g) : void 0,
189
+ inferred: !C && !B,
190
+ signature: S(x)
191
+ } : void 0;
192
+ });
193
+ if (l.some((m) => !m)) return;
194
+ const r = l.filter(
195
+ (m) => !!m
196
+ );
197
+ if (new Set(r.map((m) => m.signature)).size > 1)
198
+ return;
199
+ const f = (I = r[0]) == null ? void 0 : I.capabilities;
200
+ if (!f || c && c !== "unknown" && f.dialect !== c)
201
+ return;
202
+ const b = new Set(
203
+ r.map((m) => m.capabilityIdentity).filter((m) => !!m)
204
+ ), h = r.every(
205
+ (m) => m.connectionType && m.capabilityIdentity
206
+ );
207
+ return {
208
+ capabilities: f,
209
+ ...h && b.size === 1 ? { connectionType: r[0].connectionType } : {},
210
+ dialect: f.dialect,
211
+ evidence: r.every((m) => m.inferred) ? "coordinates" : "entity"
212
+ };
213
+ }
214
+ function Y(e) {
215
+ const i = !!u(e == null ? void 0 : e.database), n = !!u(e == null ? void 0 : e.schema);
216
+ if (!(i && n)) {
217
+ if (n)
218
+ return { dialect: "unknown", prefixLevels: ["schema", "table"] };
219
+ if (i)
220
+ return { dialect: "unknown", prefixLevels: ["database", "table"] };
221
+ }
222
+ }
223
+ function E(e, i) {
224
+ var o;
225
+ if (e.evidence !== "entity") return e;
226
+ const n = u((o = H(i)) == null ? void 0 : o.connectionType), a = n ? p(n) : void 0;
227
+ return a && S(a) === S(e.capabilities) ? { ...e, connectionType: n } : e;
228
+ }
229
+ function Z(e) {
230
+ return (e.qualifiedHints || []).some(
231
+ (n) => {
232
+ const a = u(n);
233
+ return !!(a && a.includes(".") && !y(a));
234
+ }
235
+ ) ? !0 : Object.values(e.coordinateHint || {}).some((n) => {
236
+ const a = u(n);
237
+ return !!(a && !y(a));
238
+ });
239
+ }
240
+ function ee(e) {
241
+ const { capabilities: i } = e.capabilityAuthority, n = [], a = [];
242
+ for (const b of e.hints) {
243
+ const h = u(b);
244
+ if (!h) continue;
245
+ if (!h.includes(".")) {
246
+ a.push(h);
247
+ continue;
248
+ }
249
+ const I = y(h);
250
+ if (!I) return { kind: "malformed" };
251
+ n.push(I);
252
+ }
253
+ const o = ie(e.coordinateHint);
254
+ if (o.kind === "malformed") return o;
255
+ const c = Array.from(new Set(n)).map(
256
+ (b) => Q({
257
+ qualifiedName: b,
258
+ capabilities: i
259
+ })
260
+ );
261
+ if (!te(c, i))
262
+ return { kind: "conflicting" };
263
+ const s = [...new Set(n)].sort(
264
+ (b, h) => h.split(".").length - b.split(".").length
265
+ )[0], t = s ? Q({
266
+ qualifiedName: s,
267
+ capabilities: i
268
+ }) : void 0, l = $(
269
+ o.coordinates,
270
+ i
271
+ ), r = A(
272
+ o.coordinates,
273
+ e.capabilityAuthority
274
+ ), f = !!(l.tableName && (l.databaseName || l.schemaName));
275
+ return t && f && !z({
276
+ left: t,
277
+ right: l,
278
+ capabilities: i
279
+ }) ? { kind: "conflicting" } : {
280
+ kind: "valid",
281
+ coordinates: t ? {
282
+ ...r,
283
+ ...t
284
+ } : f ? r : void 0,
285
+ bareHints: [
286
+ ...a,
287
+ ...!f && l.tableName ? [l.tableName] : []
288
+ ]
289
+ };
290
+ }
291
+ function ie(e) {
292
+ const i = {};
293
+ for (const [n, a] of Object.entries(e || {})) {
294
+ const o = u(a);
295
+ if (!o) continue;
296
+ const c = y(o);
297
+ if (!c) return { kind: "malformed" };
298
+ i[n] = c;
299
+ }
300
+ return { kind: "valid", coordinates: i };
301
+ }
302
+ function $(e, i) {
303
+ return {
304
+ ...i.prefixLevels.includes("database") && e.databaseName ? { databaseName: e.databaseName } : {},
305
+ ...i.prefixLevels.includes("schema") && e.schemaName ? { schemaName: e.schemaName } : {},
306
+ ...e.tableName ? { tableName: e.tableName } : {}
307
+ };
308
+ }
309
+ function te(e, i) {
310
+ return e.every(
311
+ (n, a) => e.slice(a + 1).every(
312
+ (o) => z({
313
+ left: n,
314
+ right: o,
315
+ capabilities: i
316
+ })
317
+ )
318
+ );
319
+ }
320
+ function O(e) {
321
+ return new Set(
322
+ e.map(u).map(y).filter((i) => !!i)
323
+ );
324
+ }
325
+ function ne(e) {
326
+ const i = H(e);
327
+ return i ? O([
328
+ u(i.name),
329
+ u(i.table),
330
+ u(i.id)
331
+ ]) : /* @__PURE__ */ new Set();
332
+ }
333
+ function ae(e, i, n) {
334
+ return A(
335
+ {
336
+ ...e,
337
+ ...i
338
+ },
339
+ n
340
+ );
341
+ }
342
+ function A(e, i) {
343
+ const n = i.evidence === "coordinates" ? i.capabilities.prefixLevels : R(i.capabilities);
344
+ return {
345
+ ...n.includes("database") && e.databaseName ? { databaseName: e.databaseName } : {},
346
+ ...n.includes("schema") && e.schemaName ? { schemaName: e.schemaName } : {},
347
+ ...e.tableName ? { tableName: e.tableName } : {}
348
+ };
349
+ }
350
+ function d(e) {
351
+ return typeof e == "string" && e.trim() ? e.trim() : void 0;
352
+ }
353
+ function N(e) {
354
+ return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
355
+ }
356
+ function oe(e) {
357
+ const i = N(e);
358
+ return !!(i && i.type === "dataset" && d(i.name));
359
+ }
360
+ function V(e) {
361
+ const i = N(e);
362
+ return !!(i && i.type === "dataset" && i.datasetType !== "physical" && d(i.name));
363
+ }
364
+ function j(e) {
365
+ const i = /* @__PURE__ */ new Set();
366
+ for (const n of e) {
367
+ const a = d(n);
368
+ if (!a) continue;
369
+ const o = y(a);
370
+ if (!o) continue;
371
+ const c = o.toLowerCase();
372
+ i.add(c);
373
+ const s = c.split("."), t = s[s.length - 1];
374
+ t && i.add(t);
375
+ }
376
+ return i;
377
+ }
378
+ function F(e) {
379
+ var n;
380
+ const i = d(e);
381
+ return i ? (n = y(i)) == null ? void 0 : n.toLowerCase() : void 0;
382
+ }
383
+ function D(e, i) {
384
+ const n = N(i), a = d(n == null ? void 0 : n.domainId) || d(e.semanticDomainId), o = d(n == null ? void 0 : n.name);
385
+ if (!a || !o) return;
386
+ const c = (n == null ? void 0 : n.datasetType) === "physical" ? void 0 : J(n || {}), s = d(n == null ? void 0 : n.connectionId) || d(e.connectionId);
387
+ return {
388
+ kind: "semantic",
389
+ domainId: a,
390
+ datasetName: o,
391
+ ...c ? { datasetId: c } : {},
392
+ ...s ? { connectionId: s } : {}
393
+ };
394
+ }
395
+ function se(e, i = {}) {
396
+ const n = d(e.fieldEntityType);
397
+ if (n && n !== "dataset")
398
+ return { kind: "unqualified" };
399
+ const a = e.entities.filter(
400
+ (s) => i.includePhysicalDatasets ? oe(s) : V(s)
401
+ ), o = d(e.entityId);
402
+ if (o) {
403
+ const s = F(o), t = a.filter((l) => {
404
+ const r = N(l);
405
+ return !!(s && F(r == null ? void 0 : r.id) === s);
406
+ });
407
+ if (t.length > 1) return { kind: "ambiguous", basis: "bare" };
408
+ if (t.length === 1) {
409
+ const l = D(e, t[0]);
410
+ return l ? {
411
+ kind: "resolved",
412
+ basis: "bare",
413
+ entity: t[0],
414
+ source: l,
415
+ matchedById: !0
416
+ } : { kind: "not_found", basis: "bare" };
417
+ }
418
+ }
419
+ const c = j([
420
+ e.entityName,
421
+ ...e.qualifiedHints || [],
422
+ ...e.bareHints || []
423
+ ]);
424
+ if (c.size > 0) {
425
+ const s = a.filter((t) => {
426
+ const l = N(t);
427
+ return [...j([l == null ? void 0 : l.id, l == null ? void 0 : l.name])].some((f) => c.has(f));
428
+ });
429
+ if (s.length > 1) return { kind: "ambiguous", basis: "bare" };
430
+ if (s.length === 1) {
431
+ const t = D(e, s[0]);
432
+ return t ? {
433
+ kind: "resolved",
434
+ basis: "bare",
435
+ entity: s[0],
436
+ source: t,
437
+ matchedById: !1
438
+ } : { kind: "not_found", basis: "bare" };
439
+ }
440
+ return { kind: "not_found", basis: "bare" };
441
+ }
442
+ if (a.length === 1) {
443
+ const s = D(e, a[0]);
444
+ return s ? {
445
+ kind: "resolved",
446
+ basis: "unqualified",
447
+ entity: a[0],
448
+ source: s,
449
+ matchedById: !1
450
+ } : { kind: "unqualified" };
451
+ }
452
+ return { kind: "unqualified" };
453
+ }
454
+ function L(e) {
455
+ const i = e.resolution.kind === "resolved" ? N(e.resolution.entity) : void 0, n = d(e.connectionId) || d(i == null ? void 0 : i.connectionId), { connectionType: a, dialect: o } = e.resolution.capabilityAuthority, c = p(o), s = !!(c && c.dialect === e.resolution.capabilityAuthority.capabilities.dialect && c.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
456
+ "."
457
+ )), t = e.resolution.coordinates;
458
+ if (!(!n || !(t != null && t.tableName)))
459
+ return {
460
+ kind: "physical",
461
+ connectionId: n,
462
+ ...a ? { connectionType: a } : {},
463
+ ...!a && s ? { dialect: o } : {},
464
+ tableName: t.tableName,
465
+ ...t.databaseName ? { databaseName: t.databaseName } : {},
466
+ ...t.schemaName ? { schemaName: t.schemaName } : {}
467
+ };
468
+ }
469
+ function re(e) {
470
+ const i = N(e.entity), n = y(d(i == null ? void 0 : i.table));
471
+ if (!n) return !1;
472
+ const a = y(
473
+ d(i == null ? void 0 : i.database)
474
+ ), o = y(
475
+ d(i == null ? void 0 : i.schema)
476
+ );
477
+ return e.coordinates.tableName ? K({
478
+ requested: e.coordinates,
479
+ allowed: {
480
+ ...a ? { databaseName: a } : {},
481
+ ...o ? { schemaName: o } : {},
482
+ tableName: n
483
+ },
484
+ capabilities: e.capabilityAuthority.capabilities
485
+ }) : !1;
486
+ }
487
+ function ce(e) {
488
+ var o, c, s;
489
+ if (d(e.connectionType) || d(e.dialect) || e.capabilities || d(e.semanticDomainId) || d(e.fieldEntityType) === "dataset" || d((o = e.fallbackCoordinateHint) == null ? void 0 : o.databaseName) || d((c = e.fallbackCoordinateHint) == null ? void 0 : c.schemaName))
490
+ return;
491
+ const i = [
492
+ d((s = e.fallbackCoordinateHint) == null ? void 0 : s.tableName),
493
+ ...(e.qualifiedHints || []).map(d),
494
+ ...(e.bareHints || []).map(d),
495
+ d(e.entityName),
496
+ ...d(e.fieldEntityType) === "table" ? [d(e.entityId)] : []
497
+ ].filter((t) => !!t);
498
+ if (!i.length || i.some((t) => t.includes(".")))
499
+ return;
500
+ const n = i.map(y);
501
+ return n.some((t) => !t) ? void 0 : new Set(n.map((t) => t.toLowerCase())).size === 1 ? n[0] : void 0;
502
+ }
503
+ function fe(e) {
504
+ const i = e.entities.filter(
505
+ M
506
+ ), n = e.entities.filter(
507
+ V
508
+ ), a = i.length > 0 || n.length > 0, o = se(e), c = e.qualifiedHints || [], s = c.some(
509
+ (r) => {
510
+ var f;
511
+ return (f = d(r)) == null ? void 0 : f.includes(".");
512
+ }
513
+ ), t = U({
514
+ entities: i,
515
+ connectionType: d(e.connectionType),
516
+ dialect: e.dialect,
517
+ capabilities: e.capabilities,
518
+ qualifiedHints: c,
519
+ bareHints: [e.entityName, e.entityId, ...e.bareHints || []],
520
+ ...!s && e.fallbackCoordinateHint ? { coordinateHint: e.fallbackCoordinateHint } : {}
521
+ });
522
+ if (t.kind === "malformed" || t.kind === "conflicting" || t.kind === "incompatible_capabilities" && s || t.kind === "ambiguous" && t.basis === "qualified")
523
+ return t;
524
+ if (t.kind === "resolved" && t.basis === "qualified") {
525
+ const r = L({
526
+ resolution: t,
527
+ connectionId: e.connectionId
528
+ });
529
+ return r ? {
530
+ kind: "resolved",
531
+ basis: t.basis,
532
+ source: r,
533
+ entity: t.entity
534
+ } : { kind: "missing_connection" };
535
+ }
536
+ if (t.kind === "not_found" && t.basis === "qualified" && t.coordinates) {
537
+ if (o.kind === "resolved" && o.matchedById && re({
538
+ entity: o.entity,
539
+ coordinates: t.coordinates,
540
+ capabilityAuthority: t.capabilityAuthority
541
+ }))
542
+ return {
543
+ kind: "resolved",
544
+ basis: o.basis,
545
+ source: o.source,
546
+ entity: o.entity
547
+ };
548
+ const r = L({
549
+ resolution: t,
550
+ connectionId: e.connectionId
551
+ });
552
+ return r ? a ? { kind: "candidate", basis: "qualified", source: r } : { kind: "resolved", basis: "qualified", source: r } : { kind: "missing_connection" };
553
+ }
554
+ if (o.kind === "resolved")
555
+ return t.kind === "resolved" && t.basis === "bare" && !o.matchedById ? { kind: "ambiguous", basis: "bare" } : {
556
+ kind: "resolved",
557
+ basis: o.basis,
558
+ source: o.source,
559
+ entity: o.entity
560
+ };
561
+ if (o.kind === "ambiguous") return o;
562
+ if (t.kind === "resolved") {
563
+ const r = L({
564
+ resolution: t,
565
+ connectionId: e.connectionId
566
+ });
567
+ return r ? {
568
+ kind: "resolved",
569
+ basis: t.basis,
570
+ source: r,
571
+ entity: t.entity
572
+ } : { kind: "missing_connection" };
573
+ }
574
+ const l = d(e.entityName) || d(e.entityId);
575
+ if (!a && !s && d(e.semanticDomainId) && (!d(e.fieldEntityType) || d(e.fieldEntityType) === "dataset") && l)
576
+ return {
577
+ kind: "resolved",
578
+ basis: "historical",
579
+ source: {
580
+ kind: "semantic",
581
+ domainId: d(e.semanticDomainId),
582
+ datasetName: l,
583
+ ...d(e.connectionId) ? { connectionId: d(e.connectionId) } : {}
584
+ }
585
+ };
586
+ if (t.kind === "incompatible_capabilities") {
587
+ const r = a ? void 0 : ce(e), f = d(e.connectionId);
588
+ return r && f ? {
589
+ kind: "resolved",
590
+ basis: "historical",
591
+ source: { kind: "physical", connectionId: f, tableName: r }
592
+ } : t;
593
+ }
594
+ return t.kind === "ambiguous" ? t : t.kind === "not_found" ? {
595
+ kind: "not_found",
596
+ basis: t.basis
597
+ } : { kind: "unqualified" };
598
+ }
599
+ export {
600
+ U as a,
601
+ V as b,
602
+ se as c,
603
+ fe as d,
604
+ R as g,
605
+ M as i,
606
+ le as r
607
+ };
@@ -2,9 +2,9 @@ import { jsx as y, jsxs as de, Fragment as St } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import ke, { forwardRef as Vn, createElement as Pn, useLayoutEffect as Hi, useState as Qr, useRef as gn, useMemo as Vi, useId as zi, useImperativeHandle as ji } from "react";
4
4
  import "./index-CuHybtft.js";
5
- import "./validators-hmfNNQz8.js";
6
- import "./matrix-operation-contract-CpgLZ7E5.js";
7
- import "./analytics-base-schemas-BUFUoO6G.js";
5
+ import "./validators-CXTneCA4.js";
6
+ import "./matrix-operation-contract-WPv4R-H_.js";
7
+ import "./analytics-base-schemas-CHLxsPfX.js";
8
8
  import "zod";
9
9
  import "../value-format-preferences/index.js";
10
10
  import { a as Ki, c as te, b as me, g as Gi } from "./_commonjsHelpers-DimLPMtv.js";
@@ -2,7 +2,7 @@ var ft = Object.defineProperty;
2
2
  var ht = (e, t, r) => t in e ? ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var ne = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { z as S } from "zod";
5
- import { e as ct } from "./comparison-window-caption-Dc7BaCMz.js";
5
+ import { e as ct } from "./comparison-window-caption-4FNkMrzE.js";
6
6
  var E = Uint8Array, I = Uint16Array, pe = Int32Array, xe = new E([
7
7
  0,
8
8
  0,
@@ -1,6 +1,6 @@
1
- import { k as P, u as B, ab as j } from "./validators-hmfNNQz8.js";
2
- import "./matrix-operation-contract-CpgLZ7E5.js";
3
- import "./analytics-base-schemas-BUFUoO6G.js";
1
+ import { k as P, u as j, aj as B } from "./validators-CXTneCA4.js";
2
+ import "./matrix-operation-contract-WPv4R-H_.js";
3
+ import "./analytics-base-schemas-CHLxsPfX.js";
4
4
  import { z as f } from "zod";
5
5
  const T = 8, A = 6, E = Object.freeze([]);
6
6
  function z(e) {
@@ -385,7 +385,7 @@ const H = {
385
385
  boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
386
386
  };
387
387
  function X(e) {
388
- const t = j(e);
388
+ const t = B(e);
389
389
  return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
390
390
  }
391
391
  function Te(e, t) {
@@ -411,7 +411,7 @@ function ee(e, t) {
411
411
  return t === "number" ? typeof e == "number" && Number.isFinite(e) : t === "boolean" ? typeof e == "boolean" : t === "date" ? e instanceof Date || typeof e == "string" && e.trim().length > 0 : typeof e == "string" || typeof e == "number" || typeof e == "boolean";
412
412
  }
413
413
  function _e(e, t, n, r) {
414
- if (B(e.relativeMeta)) {
414
+ if (j(e.relativeMeta)) {
415
415
  r.push(
416
416
  `${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
417
417
  );
@@ -631,7 +631,7 @@ export {
631
631
  qe as u,
632
632
  _e as v,
633
633
  $ as w,
634
- T as x,
635
- A as y,
636
- z
634
+ z as x,
635
+ T as y,
636
+ A as z
637
637
  };