react-semaphor 0.1.552 → 0.1.553

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 (62) hide show
  1. package/dist/analytics-protocol/index.js +8 -8
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +3 -3
  4. package/dist/briefings/index.js +5 -5
  5. package/dist/chunks/{assistant-chat-sWQaBT61.js → assistant-chat-DaIdRbbd.js} +1275 -1296
  6. package/dist/chunks/{bookmark-state-Cu-a5ie_.js → bookmark-state-aGO7_ryE.js} +3 -3
  7. package/dist/chunks/{comparison-window-caption-CF90-I0i.js → comparison-window-caption-BugAu7zS.js} +7 -7
  8. package/dist/chunks/{custom-visual-inputs-ByQUyWf4.js → custom-visual-inputs-D7ez5sab.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-DUJQv719.js → dashboard-briefing-launcher-DBJ0xrfF.js} +62 -62
  10. package/dist/chunks/{dashboard-controls-BjnvfcQp.js → dashboard-controls-CDX74NTl.js} +46 -46
  11. package/dist/chunks/{dashboard-json-BqcLekhd.js → dashboard-json-Cf5dpYTr.js} +4 -4
  12. package/dist/chunks/{dashboard-BjoJI7NN.js → dashboard-z3GYw7xR.js} +1 -1
  13. package/dist/chunks/{document-dashboard-inputs-PoQihHLu.js → document-dashboard-inputs-LMMWPOwU.js} +119 -119
  14. package/dist/chunks/{edit-dashboard-visual-KNJQr60W.js → edit-dashboard-visual-hCGiyxgm.js} +18 -18
  15. package/dist/chunks/{filter-reach-copy-zdhUFn6t.js → filter-reach-copy-BG5qVZKS.js} +48 -48
  16. package/dist/chunks/{filter-value-text-Ddf55Ku1.js → filter-value-text-DwP5dN9m.js} +2 -2
  17. package/dist/chunks/{global-date-filter-utils-C1jCNWdV.js → global-date-filter-utils-Ce6Ydv2W.js} +5927 -5723
  18. package/dist/chunks/{index-Dp0ta6KB.js → index-C_UIqop8.js} +9 -9
  19. package/dist/chunks/{matrix-analytical-definition-B9vW-osb.js → matrix-analytical-definition-cvzKdxPE.js} +2 -2
  20. package/dist/chunks/{matrix-card-LiMEipvq.js → matrix-card-VFE-yDlr.js} +2 -2
  21. package/dist/chunks/{matrix-formatter-C_EpDP6o.js → matrix-formatter-B27bz08Y.js} +15 -15
  22. package/dist/chunks/{matrix-member-presentation-DqzG-UhQ.js → matrix-member-presentation-DyC-e9pD.js} +1 -1
  23. package/dist/chunks/{matrix-operation-contract-D6vYkZK4.js → matrix-operation-contract-L_SiObB7.js} +1 -1
  24. package/dist/chunks/{metric-comparison-zpGw4lD6.js → metric-comparison-B5gyyW9k.js} +1 -1
  25. package/dist/chunks/{pivot-header-presentation-CQnIDtUv.js → pivot-header-presentation-BQFfowp1.js} +1 -1
  26. package/dist/chunks/{pivot-result-identity-C-Q1j1Wb.js → pivot-result-identity-dZIYsMrY.js} +1 -1
  27. package/dist/chunks/{pivot-result-lifecycle-pwq3b7LC.js → pivot-result-lifecycle-D0kSz5QX.js} +6 -6
  28. package/dist/chunks/{raw-temporal-presentation-D3i0mnUe.js → raw-temporal-presentation-BWRH754b.js} +6 -6
  29. package/dist/chunks/{report-preferences-dialog-C0uGI0v7.js → report-preferences-dialog-DvabpYcC.js} +49 -49
  30. package/dist/chunks/{report-runtime-context-hWiTCzFV.js → report-runtime-context-CKiIubIu.js} +1 -1
  31. package/dist/chunks/{resolve-dashboard-input-context-Cm0b7s-d.js → resolve-dashboard-input-context-Ctq1YCDV.js} +2062 -1988
  32. package/dist/chunks/{saved-dashboard-context-DCtGmAWe.js → saved-dashboard-context-Bt1E9d1l.js} +8 -8
  33. package/dist/chunks/{selection-reducer-CJzkTZio.js → selection-reducer-DdPwKDDQ.js} +1 -1
  34. package/dist/chunks/{semaphor-ready-indicator-ChyotaWB.js → semaphor-ready-indicator-Cc1TG_gw.js} +26 -26
  35. package/dist/chunks/{shelf-drop-preview-context-D09ATIXv.js → shelf-drop-preview-context-Ch9XqytU.js} +119 -119
  36. package/dist/chunks/{source-entity-resolution-D195CrYS.js → source-entity-resolution-DkW3Iek5.js} +1 -1
  37. package/dist/chunks/{switch-wJP6O7ZT.js → switch-gm7RW-PW.js} +2 -2
  38. package/dist/chunks/{table-export-sheet-DUS_s8Cj.js → table-export-sheet-C7bDdC8r.js} +1 -1
  39. package/dist/chunks/{table-settings-WysCBj62.js → table-settings-CBm7G0yx.js} +224 -201
  40. package/dist/chunks/{temporal-bucket-CQOSbv9-.js → temporal-bucket-BikY3FFR.js} +1 -1
  41. package/dist/chunks/{token-types-BMqRmT-C.js → token-types-B1p9F_wS.js} +1 -1
  42. package/dist/chunks/{use-create-flow-overlay-state-t7JLE_LV.js → use-create-flow-overlay-state-CZdDRUpc.js} +6 -6
  43. package/dist/chunks/{validators-C-aOQlTB.js → validators-BdBzm_EV.js} +17 -16
  44. package/dist/dashboard/index.js +2 -2
  45. package/dist/dashboard-authoring/index.js +273 -264
  46. package/dist/data-app-sdk/index.js +5 -5
  47. package/dist/data-app-sdk-adapters/index.js +2 -2
  48. package/dist/data-app-sdk-validation/index.js +5 -5
  49. package/dist/format-utils/index.js +15 -15
  50. package/dist/index.js +21 -21
  51. package/dist/report-runtime-context/index.js +1 -1
  52. package/dist/style.css +1 -1
  53. package/dist/surfboard/index.js +2 -2
  54. package/dist/types/index.js +6 -6
  55. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +3 -0
  56. package/dist/types/lib/utils/card-config-utils.d.ts +61 -0
  57. package/dist/types/lib/utils/card-type-change.d.ts +5 -1
  58. package/dist/types/shared/analytics-protocol/explorer-input-schemas.d.ts +2 -0
  59. package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +6 -0
  60. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  61. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +64 -0
  62. package/package.json +2 -2
@@ -1,20 +1,20 @@
1
- import { k as x, u as B, ab as P } from "./validators-C-aOQlTB.js";
2
- import "./matrix-operation-contract-D6vYkZK4.js";
1
+ import { k as P, u as B, ab as j } from "./validators-BdBzm_EV.js";
2
+ import "./matrix-operation-contract-L_SiObB7.js";
3
3
  import "./analytics-base-schemas-BKs3flFS.js";
4
- import { z as d } from "zod";
5
- const F = 8, T = 6, g = Object.freeze([]);
6
- function j(e) {
4
+ import { z as f } from "zod";
5
+ const T = 8, A = 6, E = Object.freeze([]);
6
+ function z(e) {
7
7
  switch (e.type) {
8
8
  case "table":
9
9
  case "chart":
10
- return e.card ? [e.card] : g;
10
+ return e.card ? [e.card] : E;
11
11
  case "kpi":
12
- return Array.isArray(e.cards) ? e.cards : g;
12
+ return Array.isArray(e.cards) ? e.cards : E;
13
13
  default:
14
- return g;
14
+ return E;
15
15
  }
16
16
  }
17
- function fe(e, t) {
17
+ function K(e, t) {
18
18
  switch (e.type) {
19
19
  case "table":
20
20
  case "chart": {
@@ -31,7 +31,7 @@ function fe(e, t) {
31
31
  return e;
32
32
  }
33
33
  }
34
- function O(e) {
34
+ function $(e) {
35
35
  var n;
36
36
  const t = [];
37
37
  for (const r of e.sheets || []) {
@@ -48,7 +48,7 @@ function O(e) {
48
48
  card: s
49
49
  });
50
50
  for (const i of ((n = r.document) == null ? void 0 : n.sections) || [])
51
- for (const s of j(i))
51
+ for (const s of z(i))
52
52
  t.push({
53
53
  kind: "documentSectionCard",
54
54
  sheetId: a,
@@ -59,11 +59,33 @@ function O(e) {
59
59
  }
60
60
  return t;
61
61
  }
62
- function S(e) {
62
+ function pe(e, t) {
63
+ const n = (a, i) => {
64
+ const s = a.map((o) => t(o, i(o)));
65
+ return s.every((o, u) => o === a[u]) ? a : s;
66
+ }, r = (e.sheets || []).map((a) => {
67
+ var h, p, c;
68
+ const i = a.id, s = a.cards && n(a.cards, (d) => ({ kind: "sheetCard", sheetId: i, cardId: d.id, card: d })), o = (h = a.frames) == null ? void 0 : h.map((d) => {
69
+ if (!d.cards) return d;
70
+ const l = n(d.cards, (F) => ({ kind: "frameCard", sheetId: i, frameId: d.id, cardId: F.id, card: F }));
71
+ return l === d.cards ? d : { ...d, cards: l };
72
+ }), u = (c = (p = a.document) == null ? void 0 : p.sections) == null ? void 0 : c.map(
73
+ (d) => K(d, (l) => t(l, { kind: "documentSectionCard", sheetId: i, sectionId: d.id, cardId: l.id, card: l }))
74
+ ), m = !!o && o.some((d, l) => d !== a.frames[l]), y = !!u && u.some((d, l) => d !== a.document.sections[l]);
75
+ return s === a.cards && !m && !y ? a : {
76
+ ...a,
77
+ ...s === a.cards ? {} : { cards: s },
78
+ ...m ? { frames: o } : {},
79
+ ...y ? { document: { ...a.document, sections: u } } : {}
80
+ };
81
+ });
82
+ return r.every((a, i) => a === e.sheets[i]) ? e : { ...e, sheets: r };
83
+ }
84
+ function N(e) {
63
85
  return !!e && typeof e == "object" && !Array.isArray(e);
64
86
  }
65
- function me(e) {
66
- if (!S(e))
87
+ function ye(e) {
88
+ if (!N(e))
67
89
  return [{ path: "", message: "must be an object." }];
68
90
  const t = [];
69
91
  e.title !== void 0 && typeof e.title != "string" && t.push({ path: "title", message: "must be a string." });
@@ -71,13 +93,13 @@ function me(e) {
71
93
  if (!Array.isArray(n))
72
94
  t.push({ path: "cards", message: "must be an array of KPI cards." });
73
95
  else {
74
- (n.length < 1 || n.length > F) && t.push({
96
+ (n.length < 1 || n.length > T) && t.push({
75
97
  path: "cards",
76
- message: `must hold 1 to ${F} KPI cards.`
98
+ message: `must hold 1 to ${T} KPI cards.`
77
99
  });
78
100
  const a = /* @__PURE__ */ new Set();
79
101
  n.forEach((i, s) => {
80
- if (!S(i)) {
102
+ if (!N(i)) {
81
103
  t.push({ path: `cards[${s}]`, message: "must be a card." });
82
104
  return;
83
105
  }
@@ -91,18 +113,18 @@ function me(e) {
91
113
  });
92
114
  }
93
115
  const r = e.kpi;
94
- return S(r) ? (r.layout !== "tiles" && r.layout !== "lines" ? t.push({
116
+ return N(r) ? (r.layout !== "tiles" && r.layout !== "lines" ? t.push({
95
117
  path: "kpi.layout",
96
118
  message: "must be 'tiles' or 'lines'."
97
- }) : r.layout === "tiles" && Array.isArray(n) && n.length > T && t.push({
119
+ }) : r.layout === "tiles" && Array.isArray(n) && n.length > A && t.push({
98
120
  path: "kpi.layout",
99
- message: `must be 'lines' for more than ${T} KPI cards.`
121
+ message: `must be 'lines' for more than ${A} KPI cards.`
100
122
  }), r.columns !== void 0 && r.columns !== 1 && r.columns !== 2 && t.push({ path: "kpi.columns", message: "must be 1 or 2." })) : t.push({ path: "kpi", message: "must be an object." }), t;
101
123
  }
102
- const z = ["new", "edit", "delete", "create", "update", "remove"];
103
- function $(e, t) {
124
+ const U = ["new", "edit", "delete", "create", "update", "remove"];
125
+ function M(e, t) {
104
126
  return (e.sheets || []).flatMap(
105
- (n) => O({ sheets: [n] }).filter(t).map((r) => ({
127
+ (n) => $({ sheets: [n] }).filter(t).map((r) => ({
106
128
  card: r.card,
107
129
  sheet: n,
108
130
  ...r.kind === "frameCard" && { frameId: r.frameId },
@@ -112,25 +134,25 @@ function $(e, t) {
112
134
  }))
113
135
  );
114
136
  }
115
- function m(e) {
116
- return $(e, (t) => t.kind !== "documentSectionCard");
137
+ function b(e) {
138
+ return M(e, (t) => t.kind !== "documentSectionCard");
117
139
  }
118
- function pe(e) {
140
+ function he(e) {
119
141
  return [
120
- ...m(e),
121
- ...$(e, (t) => t.kind === "documentSectionCard")
142
+ ...b(e),
143
+ ...M(e, (t) => t.kind === "documentSectionCard")
122
144
  ];
123
145
  }
124
- function he(e) {
125
- return m(e).map((t) => t.card);
146
+ function be(e) {
147
+ return b(e).map((t) => t.card);
126
148
  }
127
- function ye(e, t, n) {
128
- return n && t === n ? !0 : !O(e).some(
149
+ function Ie(e, t, n) {
150
+ return n && t === n ? !0 : !$(e).some(
129
151
  (r) => r.cardId === t
130
152
  );
131
153
  }
132
- function be(e) {
133
- return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? z.includes(e.toLowerCase()) ? {
154
+ function ge(e) {
155
+ return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? U.includes(e.toLowerCase()) ? {
134
156
  isValid: !1,
135
157
  error: `"${e}" is a reserved keyword and cannot be used`
136
158
  } : { isValid: !0 } : {
@@ -141,27 +163,27 @@ function be(e) {
141
163
  error: "Card ID can only contain letters, numbers, hyphens, and underscores"
142
164
  };
143
165
  }
144
- function ge(e, t) {
166
+ function Se(e, t) {
145
167
  var n;
146
- return (n = K(e, t)) == null ? void 0 : n.card;
168
+ return (n = Q(e, t)) == null ? void 0 : n.card;
147
169
  }
148
- function K(e, t) {
149
- for (const n of m(e))
170
+ function Q(e, t) {
171
+ for (const n of b(e))
150
172
  if (n.card.id === t)
151
173
  return n;
152
174
  }
153
- function Se(e, t) {
175
+ function Ce(e, t) {
154
176
  for (const n of e.sheets || [])
155
177
  for (const r of n.frames || [])
156
178
  for (const a of r.cards || [])
157
179
  if (a.id === t)
158
180
  return { card: a, sheet: n };
159
181
  }
160
- const y = {
182
+ const S = {
161
183
  includeMetricFilterDatasets: !0,
162
184
  preferQualifiedIdentity: !1
163
185
  };
164
- function M(e) {
186
+ function V(e) {
165
187
  if (!e) return;
166
188
  if (e.kind === "semantic")
167
189
  return { entityName: e.datasetName, entityId: e.datasetId, label: e.label };
@@ -172,12 +194,12 @@ function M(e) {
172
194
  label: e.label
173
195
  };
174
196
  }
175
- function U(e) {
197
+ function G(e) {
176
198
  var n;
177
- const t = M(e.source);
199
+ const t = V(e.source);
178
200
  return t ? `${(n = e.source) == null ? void 0 : n.kind}:${t.qualifiedEntityName || t.entityName}` : "";
179
201
  }
180
- function Q(e) {
202
+ function Y(e) {
181
203
  return [
182
204
  e.id,
183
205
  e.qualifiedEntityName,
@@ -187,38 +209,38 @@ function Q(e) {
187
209
  e.name,
188
210
  // Source-only fields from different datasets can otherwise share a key
189
211
  // and the second dataset would be silently dropped.
190
- U(e)
212
+ G(e)
191
213
  ].join("|");
192
214
  }
193
- function G(e) {
215
+ function W(e) {
194
216
  return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
195
217
  }
196
- function Ie(e) {
218
+ function Ee(e) {
197
219
  return e.entityName || e.qualifiedEntityName || "";
198
220
  }
199
- function Y(e) {
221
+ function J(e) {
200
222
  var t, n;
201
223
  return !!(e.expression || e.derivedField || (n = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && n.length);
202
224
  }
203
- function W(e) {
204
- return x(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Y(e);
225
+ function Z(e) {
226
+ return P(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || J(e);
205
227
  }
206
- function I(e, t) {
207
- const n = G(t);
228
+ function w(e, t) {
229
+ const n = W(t);
208
230
  e.found.has(n) || e.found.set(n, t);
209
231
  }
210
- function p(e, t) {
211
- var c, w, D;
232
+ function I(e, t) {
233
+ var m, y, h;
212
234
  if (!e) return;
213
- const n = Q(e);
235
+ const n = Y(e);
214
236
  if (t.visitedFields.has(n)) return;
215
237
  t.visitedFields.add(n);
216
- const r = W(e);
238
+ const r = Z(e);
217
239
  if (!r) {
218
- const f = !e.entityName && !e.qualifiedEntityName ? M(e.source) : void 0;
219
- I(
240
+ const p = !e.entityName && !e.qualifiedEntityName ? V(e.source) : void 0;
241
+ w(
220
242
  t,
221
- f || {
243
+ p || {
222
244
  // May be empty for qualified-only metadata; identity then comes from
223
245
  // `qualifiedEntityName` (see `identityFor` and the calculator).
224
246
  entityName: e.entityName || "",
@@ -228,50 +250,50 @@ function p(e, t) {
228
250
  }
229
251
  );
230
252
  }
231
- t.includeMetricFilterDatasets && "parameters" in e && ((c = e.parameters) != null && c.filters) && E(e.parameters.filters, t);
232
- const a = (w = e.calculatedFormula) == null ? void 0 : w.inputFields, i = !!(a && a.length > 0);
233
- i && a.forEach((f) => p(f, t));
253
+ t.includeMetricFilterDatasets && "parameters" in e && ((m = e.parameters) != null && m.filters) && D(e.parameters.filters, t);
254
+ const a = (y = e.calculatedFormula) == null ? void 0 : y.inputFields, i = !!(a && a.length > 0);
255
+ i && a.forEach((p) => I(p, t));
234
256
  let s = !1, o = !1;
235
- const u = i || (D = e.derivedField) == null ? void 0 : D.inputs;
257
+ const u = i || (h = e.derivedField) == null ? void 0 : h.inputs;
236
258
  if (u && Object.keys(u).length > 0)
237
- for (const f of Object.values(u)) {
238
- const l = f.field.source;
239
- if (!l) {
259
+ for (const p of Object.values(u)) {
260
+ const c = p.field.source;
261
+ if (!c) {
240
262
  i || (o = !0);
241
263
  continue;
242
264
  }
243
- if (l.kind === "sql") {
265
+ if (c.kind === "sql") {
244
266
  o = !0;
245
267
  continue;
246
268
  }
247
- if (l.kind === "semantic")
248
- I(t, {
249
- entityName: l.datasetName,
250
- entityId: l.datasetId,
251
- label: l.label
269
+ if (c.kind === "semantic")
270
+ w(t, {
271
+ entityName: c.datasetName,
272
+ entityId: c.datasetId,
273
+ label: c.label
252
274
  });
253
275
  else {
254
- const k = [l.databaseName, l.schemaName, l.tableName].filter((v) => !!(v && v.trim())).join(".");
255
- I(t, {
256
- entityName: l.tableName,
257
- qualifiedEntityName: k.includes(".") ? k : void 0,
258
- label: l.label
276
+ const d = [c.databaseName, c.schemaName, c.tableName].filter((l) => !!(l && l.trim())).join(".");
277
+ w(t, {
278
+ entityName: c.tableName,
279
+ qualifiedEntityName: d.includes(".") ? d : void 0,
280
+ label: c.label
259
281
  });
260
282
  }
261
283
  s = !0;
262
284
  }
263
285
  o && (t.complete = !1), r && !i && !s && (t.complete = !1);
264
286
  }
265
- function E(e, t) {
287
+ function D(e, t) {
266
288
  if (e && !t.visitedGroups.has(e.id)) {
267
289
  t.visitedGroups.add(e.id);
268
290
  for (const n of e.conditions || [])
269
- p(n.field, t);
291
+ I(n.field, t);
270
292
  for (const n of e.groups || [])
271
- E(n, t);
293
+ D(n, t);
272
294
  }
273
295
  }
274
- function b(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
296
+ function C(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
275
297
  return {
276
298
  found: /* @__PURE__ */ new Map(),
277
299
  complete: !0,
@@ -280,50 +302,50 @@ function b(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
280
302
  includeMetricFilterDatasets: e
281
303
  };
282
304
  }
283
- function N(e, t) {
305
+ function v(e, t) {
284
306
  var r;
285
307
  const n = (r = e.qualifiedEntityName) != null && r.includes(".") ? e.qualifiedEntityName : void 0;
286
308
  return t === "qualifiedOnly" ? n : t === "preferQualified" ? n || e.entityName || void 0 : e.entityName || void 0;
287
309
  }
288
- function Ce(e) {
289
- const t = b(!1);
290
- return p(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
310
+ function Ne(e) {
311
+ const t = C(!1);
312
+ return I(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
291
313
  }
292
- function V(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = y) {
293
- const i = { ...y, ...a }, s = b(i.includeMetricFilterDatasets, n, r);
294
- p(e, s), s.found.forEach((o) => {
295
- const u = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
314
+ function L(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = S) {
315
+ const i = { ...S, ...a }, s = C(i.includeMetricFilterDatasets, n, r);
316
+ I(e, s), s.found.forEach((o) => {
317
+ const u = v(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
296
318
  u && t.add(u);
297
319
  });
298
320
  }
299
- function Ee(e, t) {
300
- V(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
321
+ function we(e, t) {
322
+ L(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
301
323
  preferQualifiedIdentity: !0
302
324
  });
303
325
  }
304
- function Ne(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
305
- const a = b(!0, n, r);
306
- p(e, a), a.found.forEach((i) => {
307
- const s = N(i, "qualifiedOnly");
326
+ function ke(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
327
+ const a = C(!0, n, r);
328
+ I(e, a), a.found.forEach((i) => {
329
+ const s = v(i, "qualifiedOnly");
308
330
  s && t.add(s);
309
331
  });
310
332
  }
311
- function we(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
312
- V(e, t, n, r, {
333
+ function De(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
334
+ L(e, t, n, r, {
313
335
  includeMetricFilterDatasets: !1
314
336
  });
315
337
  }
316
- function De(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = y) {
317
- const i = { ...y, ...a }, s = b(i.includeMetricFilterDatasets, n, r);
318
- E(e, s), s.found.forEach((o) => {
319
- const u = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
338
+ function ve(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = S) {
339
+ const i = { ...S, ...a }, s = C(i.includeMetricFilterDatasets, n, r);
340
+ D(e, s), s.found.forEach((o) => {
341
+ const u = v(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
320
342
  u && t.add(u);
321
343
  });
322
344
  }
323
- function ke(e, t) {
345
+ function Fe(e, t) {
324
346
  return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (r) => r.toUpperCase());
325
347
  }
326
- const J = {
348
+ const H = {
327
349
  date: /* @__PURE__ */ new Set([
328
350
  "between",
329
351
  "not between",
@@ -362,14 +384,14 @@ const J = {
362
384
  ]),
363
385
  boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
364
386
  };
365
- function Z(e) {
366
- const t = P(e);
387
+ function X(e) {
388
+ const t = j(e);
367
389
  return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
368
390
  }
369
- function ve(e, t) {
370
- return typeof t != "string" ? !1 : J[Z(e)].has(t);
391
+ function Te(e, t) {
392
+ return typeof t != "string" ? !1 : H[X(e)].has(t);
371
393
  }
372
- const Fe = /* @__PURE__ */ new Set([
394
+ const Ae = /* @__PURE__ */ new Set([
373
395
  "=",
374
396
  ">",
375
397
  "<",
@@ -385,19 +407,19 @@ const Fe = /* @__PURE__ */ new Set([
385
407
  "is null",
386
408
  "is not null"
387
409
  ]);
388
- function H(e, t) {
410
+ function ee(e, t) {
389
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";
390
412
  }
391
- function Te(e, t, n, r) {
413
+ function _e(e, t, n, r) {
392
414
  if (B(e.relativeMeta)) {
393
415
  r.push(
394
416
  `${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
395
417
  );
396
418
  return;
397
419
  }
398
- X(e.operation, e.values, t, `${n}.values`, r);
420
+ te(e.operation, e.values, t, `${n}.values`, r);
399
421
  }
400
- function X(e, t, n, r, a) {
422
+ function te(e, t, n, r, a) {
401
423
  if (e === "is null" || e === "is not null") {
402
424
  t.length !== 0 && a.push(`${r} must be empty for null filter operations.`);
403
425
  return;
@@ -423,29 +445,29 @@ function X(e, t, n, r, a) {
423
445
  return;
424
446
  }
425
447
  for (const i of t)
426
- if (!H(i, n)) {
448
+ if (!ee(i, n)) {
427
449
  a.push(
428
450
  `${r} contains a value that is incompatible with valueType '${n}'.`
429
451
  );
430
452
  return;
431
453
  }
432
454
  }
433
- const Ae = {
455
+ const Oe = {
434
456
  database: null,
435
457
  schema: null,
436
458
  table: null
437
- }, _e = "__card_default__", L = {
459
+ }, $e = "__card_default__", q = {
438
460
  bookmarksPerViewerPerDashboard: 20,
439
461
  bookmarkNameMaxChars: 100,
440
462
  columnLabelMaxChars: 120,
441
463
  tableSettingsMaxBytes: 65536,
442
464
  rememberedTableSettingsMaxBytes: 262144,
443
465
  bookmarkStateMaxBytes: 65536
444
- }, ee = 1;
445
- function Oe(e) {
466
+ }, ne = 1;
467
+ function Me(e) {
446
468
  return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
447
469
  }
448
- function te(e) {
470
+ function re(e) {
449
471
  const t = encodeURIComponent;
450
472
  switch (e.kind) {
451
473
  case "dimension":
@@ -458,7 +480,7 @@ function te(e) {
458
480
  return `result:${t(e.key)}`;
459
481
  }
460
482
  }
461
- function h(e) {
483
+ function g(e) {
462
484
  if (e)
463
485
  try {
464
486
  return decodeURIComponent(e);
@@ -466,149 +488,150 @@ function h(e) {
466
488
  return;
467
489
  }
468
490
  }
469
- function ne(e) {
491
+ function ae(e) {
470
492
  if (typeof e != "string") return;
471
493
  const t = e.split(":");
472
494
  let n;
473
495
  if (t[0] === "dim" && t.length === 3) {
474
- const r = t[1], a = h(t[2]);
496
+ const r = t[1], a = g(t[2]);
475
497
  (r === "detail" || r === "groupby") && a && (n = { kind: "dimension", role: r, fieldId: a });
476
498
  } else if (t[0] === "metric" && t.length === 3) {
477
- const r = h(t[1]), a = h(t[2]);
499
+ const r = g(t[1]), a = g(t[2]);
478
500
  r && a && (n = { kind: "metric", metricId: r, metricAlias: a });
479
501
  } else if (t[0] === "result" && t.length === 2) {
480
- const r = h(t[1]);
502
+ const r = g(t[1]);
481
503
  r && (n = { kind: "result", key: r });
482
504
  }
483
- return n && te(n) === e ? n : void 0;
484
- }
485
- function C(e) {
486
- return typeof e == "string" && ne(e) !== void 0;
487
- }
488
- const A = d.array(d.string()).max(2e3), re = d.object({
489
- order: A.optional(),
490
- hidden: A.optional(),
491
- labels: d.record(d.string(), d.string().max(L.columnLabelMaxChars)).optional(),
492
- sort: d.array(
493
- d.object({
494
- columnId: d.string(),
495
- direction: d.enum(["asc", "desc"])
505
+ return n && re(n) === e ? n : void 0;
506
+ }
507
+ function k(e) {
508
+ return typeof e == "string" && ae(e) !== void 0;
509
+ }
510
+ const _ = f.array(f.string()).max(2e3), ie = f.object({
511
+ order: _.optional(),
512
+ hidden: _.optional(),
513
+ labels: f.record(f.string(), f.string().max(q.columnLabelMaxChars)).optional(),
514
+ sort: f.array(
515
+ f.object({
516
+ columnId: f.string(),
517
+ direction: f.enum(["asc", "desc"])
496
518
  }).strict()
497
519
  ).max(2e3).optional()
498
520
  }).strict();
499
- function _(e) {
521
+ function O(e) {
500
522
  const t = /* @__PURE__ */ new Set(), n = [];
501
523
  for (const r of e)
502
- !C(r) || t.has(r) || (t.add(r), n.push(r));
524
+ !k(r) || t.has(r) || (t.add(r), n.push(r));
503
525
  return n;
504
526
  }
505
- function q(e) {
527
+ function x(e) {
506
528
  if (!e) return;
507
- const t = e.order ? _(e.order) : void 0, n = e.hidden ? _(e.hidden) : void 0, r = Object.entries(e.labels ?? {}).flatMap(
529
+ const t = e.order ? O(e.order) : void 0, n = e.hidden ? O(e.hidden) : void 0, r = Object.entries(e.labels ?? {}).flatMap(
508
530
  ([o, u]) => {
509
- const c = typeof u == "string" ? u.trim() : "";
510
- return C(o) && c ? [
531
+ const m = typeof u == "string" ? u.trim() : "";
532
+ return k(o) && m ? [
511
533
  [
512
534
  o,
513
- c.slice(0, L.columnLabelMaxChars)
535
+ m.slice(0, q.columnLabelMaxChars)
514
536
  ]
515
537
  ] : [];
516
538
  }
517
- ), a = /* @__PURE__ */ new Set(), i = e.sort ? e.sort.filter((o) => !C(o.columnId) || a.has(o.columnId) ? !1 : (a.add(o.columnId), !0)) : void 0, s = {};
539
+ ), a = /* @__PURE__ */ new Set(), i = e.sort ? e.sort.filter((o) => !k(o.columnId) || a.has(o.columnId) ? !1 : (a.add(o.columnId), !0)) : void 0, s = {};
518
540
  return t != null && t.length && (s.order = t), n != null && n.length && (s.hidden = n), r.length && (s.labels = Object.fromEntries(r)), i && (s.sort = i.map(({ columnId: o, direction: u }) => ({
519
541
  columnId: o,
520
542
  direction: u
521
543
  }))), Object.keys(s).length ? s : void 0;
522
544
  }
523
- function ae(e) {
524
- return q(e) === void 0;
545
+ function se(e) {
546
+ return x(e) === void 0;
525
547
  }
526
- function ie(e, t) {
527
- if (t !== ee)
548
+ function oe(e, t) {
549
+ if (t !== ne)
528
550
  return {
529
551
  ok: !1,
530
552
  error: `Unsupported table settings version ${t}.`
531
553
  };
532
- const n = re.safeParse(e);
554
+ const n = ie.safeParse(e);
533
555
  return n.success ? {
534
556
  ok: !0,
535
- value: q(n.data) ?? {}
557
+ value: x(n.data) ?? {}
536
558
  } : { ok: !1, error: "Table settings are invalid." };
537
559
  }
538
- function $e(e, t, n) {
560
+ function Ve(e, t, n) {
539
561
  if (!e || typeof e != "object" || Array.isArray(e)) return {};
540
562
  const r = {};
541
563
  for (const [a, i] of Object.entries(
542
564
  e
543
565
  )) {
544
566
  if (!n.has(a)) continue;
545
- const s = ie(i, t);
546
- s.ok && !ae(s.value) && (r[a] = s.value);
567
+ const s = oe(i, t);
568
+ s.ok && !se(s.value) && (r[a] = s.value);
547
569
  }
548
570
  return r;
549
571
  }
550
- const se = /* @__PURE__ */ new Set([
572
+ const ue = /* @__PURE__ */ new Set([
551
573
  "table",
552
574
  "detailTable"
553
575
  ]);
554
576
  function R(e) {
555
- return se.has(e.type);
577
+ return ue.has(e.type);
556
578
  }
557
- function oe(e) {
579
+ function de(e) {
558
580
  var t, n;
559
581
  return R(e) && ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.allowViewerColumnCustomization) !== !1;
560
582
  }
561
- function Me(e) {
583
+ function Le(e) {
562
584
  return new Set(
563
- m(e).filter(({ card: t }) => R(t)).map(({ card: t }) => t.id)
585
+ b(e).filter(({ card: t }) => R(t)).map(({ card: t }) => t.id)
564
586
  );
565
587
  }
566
- function Ve(e) {
588
+ function qe(e) {
567
589
  return new Set(
568
- m(e).filter(({ card: t }) => oe(t)).map(({ card: t }) => t.id)
590
+ b(e).filter(({ card: t }) => de(t)).map(({ card: t }) => t.id)
569
591
  );
570
592
  }
571
593
  export {
572
- fe as A,
573
- me as B,
574
- _e as C,
575
- Fe as D,
576
- Ae as E,
577
- Z as F,
578
- ve as G,
579
- K as H,
580
- he as I,
581
- m as J,
582
- ge as K,
583
- pe as L,
584
- ye as M,
585
- be as N,
586
- Se as O,
587
- L as V,
588
- Ie as a,
589
- Ee as b,
590
- V as c,
591
- M as d,
592
- Ne as e,
593
- we as f,
594
- De as g,
595
- ke as h,
596
- ee as i,
597
- ae as j,
598
- ie as k,
599
- $e as l,
600
- Oe as m,
601
- q as n,
594
+ K as A,
595
+ pe as B,
596
+ $e as C,
597
+ Ae as D,
598
+ Oe as E,
599
+ ye as F,
600
+ X as G,
601
+ Te as H,
602
+ Q as I,
603
+ be as J,
604
+ b as K,
605
+ Se as L,
606
+ he as M,
607
+ Ie as N,
608
+ ge as O,
609
+ Ce as P,
610
+ q as V,
611
+ Ee as a,
612
+ we as b,
613
+ L as c,
614
+ V as d,
615
+ ke as e,
616
+ De as f,
617
+ ve as g,
618
+ Fe as h,
619
+ ne as i,
620
+ se as j,
621
+ oe as k,
622
+ Ve as l,
623
+ Me as m,
624
+ x as n,
602
625
  R as o,
603
- ne as p,
604
- oe as q,
605
- Ce as r,
606
- Me as s,
607
- te as t,
608
- Ve as u,
609
- Te as v,
610
- O as w,
611
- F as x,
612
- T as y,
613
- j as z
626
+ ae as p,
627
+ de as q,
628
+ Ne as r,
629
+ Le as s,
630
+ re as t,
631
+ qe as u,
632
+ _e as v,
633
+ $ as w,
634
+ T as x,
635
+ A as y,
636
+ z
614
637
  };