react-semaphor 0.1.565 → 0.1.567
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.
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +50 -46
- package/dist/chunks/{assistant-chat-DNfb5fbF.js → assistant-chat-D-IuHHwh.js} +6 -6
- package/dist/chunks/{bookmark-impact-CHr7b1J2.js → bookmark-impact-B0estCHn.js} +9 -9
- package/dist/chunks/{bookmark-state-ByODVqee.js → bookmark-state-Du3s13_V.js} +333 -321
- package/dist/chunks/{card-filter-builder-CcEcfaYz.js → card-filter-builder-DbSmzvem.js} +46 -46
- package/dist/chunks/{dashboard-briefing-launcher-D3mc6peE.js → dashboard-briefing-launcher-DunvZYsU.js} +333 -333
- package/dist/chunks/{dashboard-controls-BFv0zdws.js → dashboard-controls-B09cN2Dz.js} +57 -57
- package/dist/chunks/{dashboard-CtIfxycc.js → dashboard-f8J9DHh5.js} +1 -1
- package/dist/chunks/{dashboard-json-CXn_3OYb.js → dashboard-json-BNNCaKEc.js} +1 -1
- package/dist/chunks/{dates-DcRxw17S.js → dates-BsJcyoC_.js} +5 -5
- package/dist/chunks/{edit-dashboard-visual-Y6HatqBd.js → edit-dashboard-visual-Cwzbpty8.js} +213 -197
- package/dist/chunks/{filter-reach-copy-DbggA5B7.js → filter-reach-copy-P-kDwUpY.js} +852 -858
- package/dist/chunks/{index-DDa_rklN.js → index-BcXw0CpM.js} +648 -574
- package/dist/chunks/{report-preferences-dialog-Db-b04B4.js → report-preferences-dialog-CbgmdWeZ.js} +8 -8
- package/dist/chunks/{resolve-dashboard-input-context-C18J-YZC.js → resolve-dashboard-input-context-DPKSF3qj.js} +3403 -3378
- package/dist/chunks/{saved-dashboard-context-DhC_EVus.js → saved-dashboard-context-CNudmm9U.js} +13 -13
- package/dist/chunks/{semaphor-ready-indicator-T6TsiBMT.js → semaphor-ready-indicator-CQd-PCCZ.js} +32568 -32581
- package/dist/chunks/{shelf-drop-preview-context-CNWL_b0S.js → shelf-drop-preview-context-CWS3e20y.js} +2 -2
- package/dist/chunks/{stored-dashboard-IdmtrNkA.js → stored-dashboard-CrQFT27O.js} +1074 -1055
- package/dist/chunks/{variable-draft-3xseULxR.js → variable-draft-BDxlD0dM.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1669 -1642
- package/dist/index.js +12 -12
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/delivery-outcome.d.ts +37 -0
- package/dist/types/briefings/index.d.ts +2 -0
- package/dist/types/briefings/run-outcomes.d.ts +6 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +9 -0
- package/dist/types/index.js +33 -32
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +24 -2
- package/dist/types/lib/dashboard-viewer/use-table-view.d.ts +15 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +15 -3
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/dashboard-filter-sql-subscription.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +20 -4
- package/dist/types/shared/dashboard-viewer/table-settings.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { H as
|
|
1
|
+
import { H as Q, k as Ve, u as Pe } from "./validators-wtjw0aw6.js";
|
|
2
2
|
import { z as l } from "zod";
|
|
3
|
-
import { Q as
|
|
4
|
-
import { D as qe, C as Be, r as
|
|
3
|
+
import { Q as B, G as Le, v as $e } from "./matrix-operation-contract-Eb6elidS.js";
|
|
4
|
+
import { D as qe, C as Be, r as j, d as je } from "./metric-comparison-ChXUFaZu.js";
|
|
5
5
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
6
|
-
import { a as
|
|
6
|
+
import { a as O } from "./applied-constraints-DU-wndZ7.js";
|
|
7
7
|
import { r as Ue } from "./pivot-result-identity-BlbLrqaC.js";
|
|
8
|
-
const
|
|
8
|
+
const ne = 8, re = 6, V = Object.freeze([]);
|
|
9
9
|
function ze(e) {
|
|
10
10
|
switch (e.type) {
|
|
11
11
|
case "table":
|
|
12
12
|
case "chart":
|
|
13
|
-
return e.card ? [e.card] :
|
|
13
|
+
return e.card ? [e.card] : V;
|
|
14
14
|
case "kpi":
|
|
15
|
-
return Array.isArray(e.cards) ? e.cards :
|
|
15
|
+
return Array.isArray(e.cards) ? e.cards : V;
|
|
16
16
|
default:
|
|
17
|
-
return
|
|
17
|
+
return V;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
function We(e, t) {
|
|
@@ -34,7 +34,7 @@ function We(e, t) {
|
|
|
34
34
|
return e;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function _(e) {
|
|
38
38
|
var n;
|
|
39
39
|
const t = [];
|
|
40
40
|
for (const r of e.sheets || []) {
|
|
@@ -79,7 +79,7 @@ function Ge(e, t) {
|
|
|
79
79
|
var f, y, h;
|
|
80
80
|
const s = a.id, i = a.cards && n(a.cards, (p) => ({ kind: "sheetCard", sheetId: s, cardId: p.id, card: p })), o = (f = a.frames) == null ? void 0 : f.map((p) => {
|
|
81
81
|
if (!p.cards) return p;
|
|
82
|
-
const I = n(p.cards, (
|
|
82
|
+
const I = n(p.cards, (g) => ({ kind: "frameCard", sheetId: s, frameId: p.id, cardId: g.id, card: g }));
|
|
83
83
|
return I === p.cards ? p : { ...p, cards: I };
|
|
84
84
|
}), c = (h = (y = a.document) == null ? void 0 : y.sections) == null ? void 0 : h.map(
|
|
85
85
|
(p) => We(p, (I) => t(I, { kind: "documentSectionCard", sheetId: s, sectionId: p.id, cardId: I.id, card: I }))
|
|
@@ -93,11 +93,11 @@ function Ge(e, t) {
|
|
|
93
93
|
});
|
|
94
94
|
return r.every((a, s) => a === e.sheets[s]) ? e : { ...e, sheets: r };
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function P(e) {
|
|
97
97
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
98
98
|
}
|
|
99
99
|
function Zt(e) {
|
|
100
|
-
if (!
|
|
100
|
+
if (!P(e))
|
|
101
101
|
return [{ path: "", message: "must be an object." }];
|
|
102
102
|
const t = [];
|
|
103
103
|
e.title !== void 0 && typeof e.title != "string" && t.push({ path: "title", message: "must be a string." });
|
|
@@ -105,13 +105,13 @@ function Zt(e) {
|
|
|
105
105
|
if (!Array.isArray(n))
|
|
106
106
|
t.push({ path: "cards", message: "must be an array of KPI cards." });
|
|
107
107
|
else {
|
|
108
|
-
(n.length < 1 || n.length >
|
|
108
|
+
(n.length < 1 || n.length > ne) && t.push({
|
|
109
109
|
path: "cards",
|
|
110
|
-
message: `must hold 1 to ${
|
|
110
|
+
message: `must hold 1 to ${ne} KPI cards.`
|
|
111
111
|
});
|
|
112
112
|
const a = /* @__PURE__ */ new Set();
|
|
113
113
|
n.forEach((s, i) => {
|
|
114
|
-
if (!
|
|
114
|
+
if (!P(s)) {
|
|
115
115
|
t.push({ path: `cards[${i}]`, message: "must be a card." });
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
@@ -125,16 +125,16 @@ function Zt(e) {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
const r = e.kpi;
|
|
128
|
-
return
|
|
128
|
+
return P(r) ? (r.layout !== "tiles" && r.layout !== "lines" ? t.push({
|
|
129
129
|
path: "kpi.layout",
|
|
130
130
|
message: "must be 'tiles' or 'lines'."
|
|
131
|
-
}) : r.layout === "tiles" && Array.isArray(n) && n.length >
|
|
131
|
+
}) : r.layout === "tiles" && Array.isArray(n) && n.length > re && t.push({
|
|
132
132
|
path: "kpi.layout",
|
|
133
|
-
message: `must be 'lines' for more than ${
|
|
133
|
+
message: `must be 'lines' for more than ${re} KPI cards.`
|
|
134
134
|
}), 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;
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
136
|
+
const Ie = "dashboardInput";
|
|
137
|
+
function se(e) {
|
|
138
138
|
return e === "label" || e === "value" || e === "start" || e === "end" || e === "range";
|
|
139
139
|
}
|
|
140
140
|
function Qe(e) {
|
|
@@ -143,10 +143,10 @@ function Qe(e) {
|
|
|
143
143
|
function v(e) {
|
|
144
144
|
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
145
145
|
const t = e;
|
|
146
|
-
if (t.source === "input" || t.source ===
|
|
147
|
-
return typeof t.inputId == "string" &&
|
|
146
|
+
if (t.source === "input" || t.source === Ie)
|
|
147
|
+
return typeof t.inputId == "string" && se(t.export) ? { source: "input", inputId: t.inputId, export: t.export } : void 0;
|
|
148
148
|
if (t.source === "dashboardInputAlias")
|
|
149
|
-
return typeof t.variableName != "string" || t.export !== void 0 && !
|
|
149
|
+
return typeof t.variableName != "string" || t.export !== void 0 && !se(t.export) ? void 0 : {
|
|
150
150
|
source: "dashboardInputAlias",
|
|
151
151
|
variableName: t.variableName,
|
|
152
152
|
...t.export ? { export: t.export } : {}
|
|
@@ -161,35 +161,35 @@ function en(e, t) {
|
|
|
161
161
|
return !n || !r ? JSON.stringify(e) === JSON.stringify(t) : [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)])].every((s) => n[s] === r[s]);
|
|
162
162
|
}
|
|
163
163
|
function Ye(e) {
|
|
164
|
-
return
|
|
164
|
+
return x(e) ? e.type === "variable" ? e.ref === void 0 ? [] : [e.ref] : e.type === "when" && x(e.test) && e.test.ref !== void 0 ? [e.test.ref] : [] : [];
|
|
165
165
|
}
|
|
166
166
|
function Je(e, t) {
|
|
167
|
-
if (!
|
|
167
|
+
if (!x(e)) return e;
|
|
168
168
|
if (e.type === "variable" && e.ref !== void 0) {
|
|
169
169
|
const n = t(e.ref);
|
|
170
170
|
return n === e.ref ? e : { ...e, ref: n };
|
|
171
171
|
}
|
|
172
|
-
if (e.type === "when" &&
|
|
172
|
+
if (e.type === "when" && x(e.test) && e.test.ref !== void 0) {
|
|
173
173
|
const n = t(e.test.ref);
|
|
174
174
|
return n === e.test.ref ? e : { ...e, test: { ...e.test, ref: n } };
|
|
175
175
|
}
|
|
176
176
|
return e;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function x(e) {
|
|
179
179
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return !!e && typeof e == "object" && e.source ===
|
|
181
|
+
function ae(e) {
|
|
182
|
+
return !!e && typeof e == "object" && e.source === Ie;
|
|
183
183
|
}
|
|
184
184
|
function tn(e) {
|
|
185
|
-
return
|
|
185
|
+
return U(e);
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function U(e) {
|
|
188
188
|
if (!e || typeof e != "object") return e;
|
|
189
189
|
if (Array.isArray(e)) {
|
|
190
190
|
let s = !1;
|
|
191
191
|
const i = e.map((o) => {
|
|
192
|
-
const c =
|
|
192
|
+
const c = U(o);
|
|
193
193
|
return c !== o && (s = !0), c;
|
|
194
194
|
});
|
|
195
195
|
return s ? i : e;
|
|
@@ -200,18 +200,18 @@ function j(e) {
|
|
|
200
200
|
i !== t[s] && (n ?? (n = { ...t }), n[s] = i);
|
|
201
201
|
}, a = Je(
|
|
202
202
|
t,
|
|
203
|
-
(s) =>
|
|
203
|
+
(s) => ae(s) ? v(s) ?? s : s
|
|
204
204
|
);
|
|
205
205
|
if (a !== t && (a.ref !== t.ref && r("ref", a.ref), a.test !== t.test && r("test", a.test)), t.inputAliases && typeof t.inputAliases == "object") {
|
|
206
206
|
const s = t.inputAliases;
|
|
207
207
|
let i = !1;
|
|
208
208
|
const o = Object.fromEntries(
|
|
209
|
-
Object.entries(s).map(([c, u]) =>
|
|
209
|
+
Object.entries(s).map(([c, u]) => ae(u) ? (i = !0, [c, v(u) ?? u]) : [c, u])
|
|
210
210
|
);
|
|
211
211
|
i && r("inputAliases", o);
|
|
212
212
|
}
|
|
213
213
|
for (const [s, i] of Object.entries(t))
|
|
214
|
-
s === "ref" && t.type === "variable" || s === "test" && t.type === "when" || s === "inputAliases" || r(s,
|
|
214
|
+
s === "ref" && t.type === "variable" || s === "test" && t.type === "when" || s === "inputAliases" || r(s, U(i));
|
|
215
215
|
return n ?? e;
|
|
216
216
|
}
|
|
217
217
|
function nn(e) {
|
|
@@ -236,7 +236,7 @@ function He(e) {
|
|
|
236
236
|
(a) => (a == null ? void 0 : a.type) === "list" ? (Array.isArray(a.items) ? a.items : []).flatMap((s) => b(s)) : b(a == null ? void 0 : a.children)
|
|
237
237
|
) : b(t == null ? void 0 : t.content);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function be(e, t) {
|
|
240
240
|
var a;
|
|
241
241
|
const n = [], r = { kind: "document", sheetId: e };
|
|
242
242
|
for (const s of ["header", "footer"])
|
|
@@ -250,14 +250,14 @@ function Ie(e, t) {
|
|
|
250
250
|
n.push({ ref: i, place: r, where: { kind: "section", sectionId: s.id } });
|
|
251
251
|
return n;
|
|
252
252
|
}
|
|
253
|
-
const
|
|
254
|
-
function
|
|
255
|
-
const t =
|
|
253
|
+
const ie = /* @__PURE__ */ new WeakMap();
|
|
254
|
+
function Se(e) {
|
|
255
|
+
const t = ie.get(e);
|
|
256
256
|
if (t) return t;
|
|
257
257
|
const n = [];
|
|
258
258
|
for (const r of e.sheets ?? []) {
|
|
259
259
|
if (r.kind === "document") {
|
|
260
|
-
r.document && n.push(...
|
|
260
|
+
r.document && n.push(...be(r.id, r.document));
|
|
261
261
|
continue;
|
|
262
262
|
}
|
|
263
263
|
const a = { kind: "sheet", sheetId: r.id }, s = [...r.cards ?? [], ...(r.frames ?? []).flatMap((i) => i.cards ?? [])];
|
|
@@ -266,29 +266,29 @@ function be(e) {
|
|
|
266
266
|
for (const o of He(i))
|
|
267
267
|
n.push({ ref: o, place: a, where: { kind: "card", cardId: i.id } });
|
|
268
268
|
}
|
|
269
|
-
return
|
|
269
|
+
return ie.set(e, n), n;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Ce(e, t) {
|
|
272
272
|
return e.kind === t.kind && e.sheetId === t.sheetId;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
const n =
|
|
276
|
-
return t ? n.filter((r) =>
|
|
274
|
+
function ge(e, t) {
|
|
275
|
+
const n = Se(e);
|
|
276
|
+
return t ? n.filter((r) => Ce(r.place, t)) : [...n];
|
|
277
277
|
}
|
|
278
278
|
function Xe(e, t) {
|
|
279
279
|
const n = [];
|
|
280
|
-
for (const { ref: r, place: a } of
|
|
281
|
-
r.source !== "data" || r.variableId !== t || n.some((s) =>
|
|
280
|
+
for (const { ref: r, place: a } of Se(e))
|
|
281
|
+
r.source !== "data" || r.variableId !== t || n.some((s) => Ce(s, a)) || n.push(a);
|
|
282
282
|
return n;
|
|
283
283
|
}
|
|
284
284
|
function rn(e, t) {
|
|
285
285
|
const n = /* @__PURE__ */ new Set();
|
|
286
|
-
for (const { ref: r } of
|
|
286
|
+
for (const { ref: r } of ge(e, t))
|
|
287
287
|
r.source === "data" && n.add(r.variableId);
|
|
288
288
|
return [...n];
|
|
289
289
|
}
|
|
290
290
|
function sn(e, t) {
|
|
291
|
-
const n =
|
|
291
|
+
const n = be("", e).filter(
|
|
292
292
|
({ ref: r }) => r.source === "input" && r.inputId === t
|
|
293
293
|
);
|
|
294
294
|
return {
|
|
@@ -299,7 +299,7 @@ function sn(e, t) {
|
|
|
299
299
|
).size
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function ke(e, t) {
|
|
303
303
|
const n = Xe(e, t);
|
|
304
304
|
return n.length ? n.map((r) => ({
|
|
305
305
|
sheetId: r.sheetId,
|
|
@@ -307,16 +307,16 @@ function Ce(e, t) {
|
|
|
307
307
|
sheetKind: r.kind === "document" ? "document" : "dashboard"
|
|
308
308
|
})) : (e.sheets ?? []).filter((r) => r.kind !== "document").map((r) => ({ sheetId: r.id, cardId: t, sheetKind: "dashboard" }));
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function C(e, t) {
|
|
311
311
|
var r;
|
|
312
312
|
if (!nt(e, t))
|
|
313
313
|
return !1;
|
|
314
314
|
const n = e.scope;
|
|
315
315
|
switch (n.kind) {
|
|
316
316
|
case "allSheets":
|
|
317
|
-
return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !tt(n.exceptSheetIds, t) && !
|
|
317
|
+
return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !tt(n.exceptSheetIds, t) && !ue(n.exceptCardIds, t);
|
|
318
318
|
case "sheets":
|
|
319
|
-
return !!t.sheetId && n.sheetIds.includes(t.sheetId) && !
|
|
319
|
+
return !!t.sheetId && n.sheetIds.includes(t.sheetId) && !ue(n.exceptCardIds, t);
|
|
320
320
|
case "cards":
|
|
321
321
|
return !!t.cardId && n.cardIds.includes(t.cardId);
|
|
322
322
|
case "documentSections":
|
|
@@ -326,7 +326,7 @@ function S(e, t) {
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
function an(e, t) {
|
|
329
|
-
if (
|
|
329
|
+
if (C(e, {
|
|
330
330
|
sheetId: t.sheetId,
|
|
331
331
|
sheetKind: t.sheetKind
|
|
332
332
|
}))
|
|
@@ -334,7 +334,7 @@ function an(e, t) {
|
|
|
334
334
|
switch (e.scope.kind) {
|
|
335
335
|
case "cards":
|
|
336
336
|
for (const n of [...t.cardIds, ...t.variableIds ?? []])
|
|
337
|
-
if (
|
|
337
|
+
if (C(e, {
|
|
338
338
|
sheetId: t.sheetId,
|
|
339
339
|
cardId: n,
|
|
340
340
|
sheetKind: t.sheetKind
|
|
@@ -347,17 +347,17 @@ function an(e, t) {
|
|
|
347
347
|
return !1;
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
const
|
|
350
|
+
const oe = /* @__PURE__ */ new WeakMap();
|
|
351
351
|
function Ze(e) {
|
|
352
|
-
const t =
|
|
352
|
+
const t = oe.get(e);
|
|
353
353
|
if (t) return t;
|
|
354
354
|
const n = /* @__PURE__ */ new Map();
|
|
355
|
-
for (const s of
|
|
355
|
+
for (const s of _(e)) {
|
|
356
356
|
const i = n.get(s.sheetId) ?? /* @__PURE__ */ new Set();
|
|
357
357
|
i.add(s.cardId), n.set(s.sheetId, i);
|
|
358
358
|
}
|
|
359
359
|
const r = /* @__PURE__ */ new Map();
|
|
360
|
-
for (const { ref: s, place: i } of
|
|
360
|
+
for (const { ref: s, place: i } of ge(e)) {
|
|
361
361
|
if (s.source !== "data") continue;
|
|
362
362
|
const o = r.get(i.sheetId) ?? /* @__PURE__ */ new Set();
|
|
363
363
|
o.add(s.variableId), r.set(i.sheetId, o);
|
|
@@ -370,31 +370,31 @@ function Ze(e) {
|
|
|
370
370
|
cardIds: n.get(s.id) ?? /* @__PURE__ */ new Set(),
|
|
371
371
|
variableIds: r.get(s.id) ?? /* @__PURE__ */ new Set()
|
|
372
372
|
});
|
|
373
|
-
return
|
|
373
|
+
return oe.set(e, a), a;
|
|
374
374
|
}
|
|
375
375
|
function on(e, t) {
|
|
376
376
|
var a, s;
|
|
377
377
|
const n = /* @__PURE__ */ new Set(), r = Ze(e);
|
|
378
378
|
for (const i of r.values())
|
|
379
|
-
|
|
379
|
+
C(t, {
|
|
380
380
|
sheetId: i.sheetId,
|
|
381
381
|
sheetKind: i.sheetKind
|
|
382
382
|
}) && n.add(`sheet:${i.sheetId}`);
|
|
383
|
-
for (const i of
|
|
384
|
-
|
|
383
|
+
for (const i of _(e))
|
|
384
|
+
C(t, {
|
|
385
385
|
sheetId: i.sheetId,
|
|
386
386
|
cardId: i.cardId,
|
|
387
387
|
...i.kind === "documentSectionCard" ? { sectionId: i.sectionId } : {},
|
|
388
388
|
sheetKind: ((a = r.get(i.sheetId)) == null ? void 0 : a.sheetKind) ?? "dashboard"
|
|
389
389
|
}) && n.add(`card:${i.cardId}`);
|
|
390
390
|
for (const i of e.variables ?? [])
|
|
391
|
-
|
|
392
|
-
(o) =>
|
|
391
|
+
ke(e, i.id).some(
|
|
392
|
+
(o) => C(t, o)
|
|
393
393
|
) && n.add(`card:${i.id}`);
|
|
394
394
|
for (const i of e.sheets ?? [])
|
|
395
395
|
if (i.kind === "document")
|
|
396
396
|
for (const o of ((s = i.document) == null ? void 0 : s.sections) ?? [])
|
|
397
|
-
|
|
397
|
+
C(t, {
|
|
398
398
|
sheetId: i.id,
|
|
399
399
|
sectionId: o.id,
|
|
400
400
|
sheetKind: "document"
|
|
@@ -408,10 +408,10 @@ function un(e, t) {
|
|
|
408
408
|
var s, i, o;
|
|
409
409
|
const n = (c) => {
|
|
410
410
|
var u, d;
|
|
411
|
-
return
|
|
411
|
+
return ce(c, t.removedSheetIds, t.renamedSheetIds, !1, (u = t.copiedTab) == null ? void 0 : u.sheetIds, (d = t.copiedTab) == null ? void 0 : d.mode);
|
|
412
412
|
}, r = (c) => {
|
|
413
413
|
var u, d;
|
|
414
|
-
return
|
|
414
|
+
return ce(
|
|
415
415
|
c,
|
|
416
416
|
t.removedCardIds,
|
|
417
417
|
t.renamedCardIds,
|
|
@@ -461,7 +461,7 @@ function un(e, t) {
|
|
|
461
461
|
}
|
|
462
462
|
return et(e, a) ? e : a;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function ce(e, t, n, r, a, s) {
|
|
465
465
|
let i = e;
|
|
466
466
|
return t != null && t.size && (i = i.filter((o) => !t.has(o))), r && (i = i.filter((o) => n == null ? void 0 : n.has(o))), n != null && n.size && (i = i.map((o) => n.get(o) ?? o)), a != null && a.size && (i = s === "extend" ? [.../* @__PURE__ */ new Set([...i, ...i.flatMap((o) => a.has(o) ? [a.get(o)] : [])])] : i.map((o) => a.get(o) ?? o)), i;
|
|
467
467
|
}
|
|
@@ -471,7 +471,7 @@ function et(e, t) {
|
|
|
471
471
|
function tt(e, t) {
|
|
472
472
|
return !!t.sheetId && !!(e != null && e.includes(t.sheetId));
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ue(e, t) {
|
|
475
475
|
return !!t.cardId && !!(e != null && e.includes(t.cardId));
|
|
476
476
|
}
|
|
477
477
|
function nt(e, t) {
|
|
@@ -507,7 +507,7 @@ function mn(e, t) {
|
|
|
507
507
|
function pn(e, t, n) {
|
|
508
508
|
var o;
|
|
509
509
|
if (t.kind !== "allSheets" && t.kind !== "sheets") return t;
|
|
510
|
-
const r = rt(e), a = e.kind === "sheets" ? e.sheetIds.filter((c) => n.has(c)) : e.kind === "allSheets" &&
|
|
510
|
+
const r = rt(e), a = e.kind === "sheets" ? e.sheetIds.filter((c) => n.has(c)) : e.kind === "allSheets" && de(e) ? [...n].filter((c) => {
|
|
511
511
|
var u;
|
|
512
512
|
return !((u = e.exceptSheetIds) != null && u.includes(c));
|
|
513
513
|
}) : [], s = [...n].filter((c) => !a.includes(c));
|
|
@@ -520,7 +520,7 @@ function pn(e, t, n) {
|
|
|
520
520
|
const i = e.kind === "allSheets" ? ((o = e.exceptSheetIds) == null ? void 0 : o.filter((c) => n.has(c))) ?? [] : [];
|
|
521
521
|
return {
|
|
522
522
|
kind: "allSheets",
|
|
523
|
-
...e.kind === "allSheets" &&
|
|
523
|
+
...e.kind === "allSheets" && de(e) ? {
|
|
524
524
|
...e.sheetKinds ? { sheetKinds: e.sheetKinds } : {},
|
|
525
525
|
...i.length ? { exceptSheetIds: i } : {}
|
|
526
526
|
} : a.length ? {
|
|
@@ -530,7 +530,7 @@ function pn(e, t, n) {
|
|
|
530
530
|
...r.length ? { exceptCardIds: [...r] } : {}
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function de(e) {
|
|
534
534
|
var t;
|
|
535
535
|
return e.kind === "allSheets" && (!((t = e.sheetKinds) != null && t.length) || e.sheetKinds.includes("document"));
|
|
536
536
|
}
|
|
@@ -552,27 +552,27 @@ function yn(e) {
|
|
|
552
552
|
if (!(e === void 0 || !Number.isFinite(e)) && Number.isInteger(e))
|
|
553
553
|
return Math.max(0, Math.min(st, e));
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function we(e) {
|
|
556
556
|
var t;
|
|
557
557
|
return ((t = e == null ? void 0 : e.comparison) == null ? void 0 : t.mode) === "explicit" ? e.comparison.spec : void 0;
|
|
558
558
|
}
|
|
559
559
|
function at(e) {
|
|
560
560
|
var t;
|
|
561
|
-
return ((t =
|
|
561
|
+
return ((t = we(e)) == null ? void 0 : t.kind) || "none";
|
|
562
562
|
}
|
|
563
563
|
function In(e) {
|
|
564
|
-
const t =
|
|
564
|
+
const t = we(e);
|
|
565
565
|
return (t == null ? void 0 : t.kind) === "target" ? t.targetValue : void 0;
|
|
566
566
|
}
|
|
567
567
|
function bn(e) {
|
|
568
568
|
return (e == null ? void 0 : e.semanticComparisonPolarity) || (e == null ? void 0 : e.comparisonPolarity) || qe;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Y(e, t) {
|
|
571
571
|
const n = Object.entries(e || {}).filter(
|
|
572
572
|
([s, i]) => i.output.outputId === s
|
|
573
573
|
);
|
|
574
574
|
if (!t.name) return;
|
|
575
|
-
const r =
|
|
575
|
+
const r = j({
|
|
576
576
|
...t,
|
|
577
577
|
name: t.name
|
|
578
578
|
}), a = n.filter(
|
|
@@ -580,17 +580,17 @@ function Q(e, t) {
|
|
|
580
580
|
);
|
|
581
581
|
return a.length === 1 ? a[0][1] : void 0;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
584
|
-
const n =
|
|
583
|
+
function Sn(e, t) {
|
|
584
|
+
const n = Y(e, t);
|
|
585
585
|
return {
|
|
586
586
|
comparisonKind: (n == null ? void 0 : n.type) ?? at(t),
|
|
587
587
|
metadata: n
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Cn(e) {
|
|
591
591
|
return (e == null ? void 0 : e.showComparison) ?? Be.showComparison;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function gn(e) {
|
|
594
594
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
595
595
|
return Object.entries(e || {}).forEach(([c, u]) => {
|
|
596
596
|
const d = u.output;
|
|
@@ -612,7 +612,7 @@ function Cn(e) {
|
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
614
|
const it = "SEMAPHOR_CALCULATED_FIELD";
|
|
615
|
-
function
|
|
615
|
+
function J(e, t, n) {
|
|
616
616
|
if (n && (t === "groupby" || t === "pivotby"))
|
|
617
617
|
return n;
|
|
618
618
|
if (t === "metric" && e.name === "*" && !e.expression)
|
|
@@ -633,7 +633,7 @@ function Y(e, t, n) {
|
|
|
633
633
|
return r && r !== e.name ? `${r}_${e.name}` : e.name;
|
|
634
634
|
}
|
|
635
635
|
function kn(e) {
|
|
636
|
-
return
|
|
636
|
+
return J(e, "detail");
|
|
637
637
|
}
|
|
638
638
|
function ot(e) {
|
|
639
639
|
const t = e.label;
|
|
@@ -645,7 +645,7 @@ function wn(e) {
|
|
|
645
645
|
...(e.metricColumns ?? []).map((s) => ({ field: s, role: "metric" })),
|
|
646
646
|
...(e.pivotByColumns ?? []).map((s) => ({ field: s, role: "pivotby" })),
|
|
647
647
|
...(e.detailColumns ?? []).map((s) => ({ field: s, role: "detail" }))
|
|
648
|
-
], n = new Map(t.map(({ field: s, role: i }) => [s,
|
|
648
|
+
], n = new Map(t.map(({ field: s, role: i }) => [s, J(s, i)])), r = new Set(n.values()), a = /* @__PURE__ */ new Map();
|
|
649
649
|
for (const { field: s } of t)
|
|
650
650
|
s.label && a.set(s.label, (a.get(s.label) ?? 0) + 1);
|
|
651
651
|
return new Map(
|
|
@@ -660,9 +660,9 @@ function wn(e) {
|
|
|
660
660
|
])
|
|
661
661
|
);
|
|
662
662
|
}
|
|
663
|
-
const
|
|
663
|
+
const Ae = "text", R = 100, ct = 10, S = "value", ve = ["previous", "change", "percentChange"];
|
|
664
664
|
function ut(e) {
|
|
665
|
-
return
|
|
665
|
+
return ve.includes(e);
|
|
666
666
|
}
|
|
667
667
|
const dt = ["up", "down", "flat"];
|
|
668
668
|
function An(e, t, n) {
|
|
@@ -674,7 +674,7 @@ function An(e, t, n) {
|
|
|
674
674
|
...e === "percentChange" && (n == null ? void 0 : n.percent) === void 0 ? { percent: !0 } : {}
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function H(e) {
|
|
678
678
|
var r, a, s, i;
|
|
679
679
|
if (e.get.kind !== "aggregate" || (r = e.query.sql) != null && r.trim()) return;
|
|
680
680
|
const t = (i = (s = (a = e.query.config) == null ? void 0 : a.metricColumns) == null ? void 0 : s[0]) == null ? void 0 : i.comparison;
|
|
@@ -682,7 +682,7 @@ function J(e) {
|
|
|
682
682
|
const n = t.spec;
|
|
683
683
|
return n.kind === "previous_period" || n.kind === "previous_year" ? n : void 0;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function le(e, t) {
|
|
686
686
|
if (t === "preview" && e.get.kind !== "aggregate")
|
|
687
687
|
return R + 1;
|
|
688
688
|
switch (e.get.kind) {
|
|
@@ -694,18 +694,18 @@ function de(e, t) {
|
|
|
694
694
|
return 1;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
const
|
|
697
|
+
const fe = {
|
|
698
698
|
answer: /* @__PURE__ */ new WeakMap(),
|
|
699
699
|
preview: /* @__PURE__ */ new WeakMap()
|
|
700
700
|
};
|
|
701
701
|
function lt(e, t = "answer") {
|
|
702
702
|
var s;
|
|
703
|
-
const n =
|
|
703
|
+
const n = fe[t].get(e);
|
|
704
704
|
if (n) return n;
|
|
705
705
|
const { query: r } = e, a = {
|
|
706
706
|
id: e.id,
|
|
707
707
|
title: e.name,
|
|
708
|
-
type:
|
|
708
|
+
type: Ae,
|
|
709
709
|
respondsToSelections: !1,
|
|
710
710
|
dataVariableId: e.id,
|
|
711
711
|
// The viewer's dashboard comparison never changes a variable: its own
|
|
@@ -714,23 +714,23 @@ function lt(e, t = "answer") {
|
|
|
714
714
|
...r.connectionId ? { connectionId: r.connectionId } : {},
|
|
715
715
|
...r.dataSource ? { dataSource: r.dataSource } : {},
|
|
716
716
|
...r.calculatedFields ? { calculatedFields: r.calculatedFields } : {},
|
|
717
|
-
...(s = r.sql) != null && s.trim() ? { sql: r.sql, config: { rowLimit:
|
|
717
|
+
...(s = r.sql) != null && s.trim() ? { sql: r.sql, config: { rowLimit: le(e, t) } } : { config: { ...r.config, rowLimit: le(e, t) } }
|
|
718
718
|
};
|
|
719
|
-
return
|
|
719
|
+
return fe[t].set(e, a), a;
|
|
720
720
|
}
|
|
721
721
|
function vn(e) {
|
|
722
|
-
return e.type ===
|
|
722
|
+
return e.type === Ae && typeof e.dataVariableId == "string" && e.dataVariableId.length > 0;
|
|
723
723
|
}
|
|
724
724
|
function Tn(e, t, n) {
|
|
725
725
|
var r;
|
|
726
|
-
if (n ===
|
|
726
|
+
if (n === S && ((r = e.query.sql) != null && r.trim())) {
|
|
727
727
|
const a = Object.keys(t)[0];
|
|
728
728
|
return a === void 0 ? void 0 : t[a];
|
|
729
729
|
}
|
|
730
730
|
return n in t ? t[n] : void 0;
|
|
731
731
|
}
|
|
732
|
-
function
|
|
733
|
-
const t =
|
|
732
|
+
function z(e) {
|
|
733
|
+
const t = Q(e);
|
|
734
734
|
return t === "string" || t === "unknown" ? "text" : t;
|
|
735
735
|
}
|
|
736
736
|
function ft(e) {
|
|
@@ -742,8 +742,8 @@ function mt(e, t, n, r) {
|
|
|
742
742
|
return [
|
|
743
743
|
a == null ? void 0 : a.outputKey,
|
|
744
744
|
a == null ? void 0 : a.rawKey,
|
|
745
|
-
t === "metric" ? ((o = (i = r == null ? void 0 : r.byMetricAlias) == null ? void 0 : i[
|
|
746
|
-
|
|
745
|
+
t === "metric" ? ((o = (i = r == null ? void 0 : r.byMetricAlias) == null ? void 0 : i[j(e)]) == null ? void 0 : o.outputKey) ?? j(e) : void 0,
|
|
746
|
+
J(e, t === "metric" ? "metric" : "groupby"),
|
|
747
747
|
e.label,
|
|
748
748
|
e.name
|
|
749
749
|
].find((c) => !!c && n.has(c));
|
|
@@ -751,8 +751,8 @@ function mt(e, t, n, r) {
|
|
|
751
751
|
function En(e, t) {
|
|
752
752
|
var r;
|
|
753
753
|
if (e.get.kind === "aggregate")
|
|
754
|
-
return
|
|
755
|
-
if (e.get.kind === "list") return [
|
|
754
|
+
return H(e) ? [S, ...ve] : [S];
|
|
755
|
+
if (e.get.kind === "list") return [S];
|
|
756
756
|
if ((r = e.query.sql) != null && r.trim()) return [...t ?? []];
|
|
757
757
|
const n = e.query.config;
|
|
758
758
|
return pt([
|
|
@@ -766,11 +766,11 @@ function Kn(e, t) {
|
|
|
766
766
|
if ((s = e.query.sql) != null && s.trim()) return;
|
|
767
767
|
const n = e.query.config, r = (u, d) => {
|
|
768
768
|
if (!u) return;
|
|
769
|
-
const f = d === "metric" ?
|
|
770
|
-
return
|
|
769
|
+
const f = d === "metric" ? B(u) : u.dataType;
|
|
770
|
+
return Q(f) === "unknown" ? void 0 : z(f);
|
|
771
771
|
};
|
|
772
772
|
if (e.get.kind === "aggregate")
|
|
773
|
-
return ut(t) &&
|
|
773
|
+
return ut(t) && H(e) ? "number" : t === S ? r((i = n == null ? void 0 : n.metricColumns) == null ? void 0 : i[0], "metric") : void 0;
|
|
774
774
|
const a = (o = n == null ? void 0 : n.groupByColumns) == null ? void 0 : o.find((u) => u.name === t);
|
|
775
775
|
return a ? r(a, "groupby") : r((c = n == null ? void 0 : n.metricColumns) == null ? void 0 : c.find((u) => u.name === t), "metric");
|
|
776
776
|
}
|
|
@@ -778,33 +778,33 @@ function pt(e) {
|
|
|
778
778
|
return [...new Set(e)];
|
|
779
779
|
}
|
|
780
780
|
function ht(e, t, n) {
|
|
781
|
-
var p, I,
|
|
781
|
+
var p, I, g;
|
|
782
782
|
const r = t[0] ?? {}, a = new Set(
|
|
783
783
|
(p = n.columns) != null && p.length ? n.columns.map((m) => m.key) : Object.keys(r)
|
|
784
784
|
), s = new Map(
|
|
785
785
|
(n.columns ?? []).map((m) => [m.key, m.dataType])
|
|
786
|
-
), i = (m, k) => s.has(m) ?
|
|
786
|
+
), i = (m, k) => s.has(m) ? z(s.get(m)) : k !== void 0 ? z(k) : ft(r[m]);
|
|
787
787
|
if ((I = e.query.sql) != null && I.trim())
|
|
788
788
|
return [...a].map((m) => ({ part: m, key: m, type: i(m, void 0) }));
|
|
789
|
-
const o = e.query.config ?? {}, c = [], u = a.size === 1 ? [...a][0] : void 0, d = e.get.kind === "aggregate" || e.get.kind === "list", f = (m, k,
|
|
790
|
-
if (c.some((Fe) => Fe.part ===
|
|
789
|
+
const o = e.query.config ?? {}, c = [], u = a.size === 1 ? [...a][0] : void 0, d = e.get.kind === "aggregate" || e.get.kind === "list", f = (m, k, te) => {
|
|
790
|
+
if (c.some((Fe) => Fe.part === te)) return;
|
|
791
791
|
const K = mt(m, k, a, n.columnKeyMap) ?? (d ? u : void 0);
|
|
792
792
|
if (!K) return;
|
|
793
|
-
const _e = k === "metric" ? i(K,
|
|
794
|
-
c.push({ part:
|
|
793
|
+
const _e = k === "metric" ? i(K, B(m)) : i(K, m.dataType);
|
|
794
|
+
c.push({ part: te, key: K, type: _e });
|
|
795
795
|
}, y = o.metricColumns ?? [];
|
|
796
796
|
if (e.get.kind === "aggregate") {
|
|
797
|
-
const m = y[0] ? (
|
|
798
|
-
return m && a.has(m) ? c.push({ part:
|
|
797
|
+
const m = y[0] ? (g = Y(n.comparisonMetadata, y[0])) == null ? void 0 : g.output.currentColumnKey : void 0;
|
|
798
|
+
return m && a.has(m) ? c.push({ part: S, key: m, type: i(m, B(y[0])) }) : y[0] && f(y[0], "metric", S), c;
|
|
799
799
|
}
|
|
800
800
|
const h = o.groupByColumns ?? [];
|
|
801
801
|
if (e.get.kind === "list")
|
|
802
|
-
return h[0] && f(h[0], "groupby",
|
|
802
|
+
return h[0] && f(h[0], "groupby", S), c;
|
|
803
803
|
for (const m of h) f(m, "groupby", m.name);
|
|
804
804
|
for (const m of y) f(m, "metric", m.name);
|
|
805
805
|
return c;
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function W(e, t) {
|
|
808
808
|
return e == null ? { value: null, type: t } : typeof e == "number" || typeof e == "boolean" || typeof e == "string" ? { value: e, type: t } : e instanceof Date ? { value: e.toISOString(), type: t } : { value: JSON.stringify(e), type: t };
|
|
809
809
|
}
|
|
810
810
|
function w(e) {
|
|
@@ -812,7 +812,7 @@ function w(e) {
|
|
|
812
812
|
}
|
|
813
813
|
function Nn(e) {
|
|
814
814
|
if (!w(e)) return {};
|
|
815
|
-
const t = w(e.data) ? e.data : e, n =
|
|
815
|
+
const t = w(e.data) ? e.data : e, n = O(e).length ? O(e) : O(t), r = w(t.metadata) ? t.metadata : void 0;
|
|
816
816
|
return {
|
|
817
817
|
...t.records !== void 0 ? { records: t.records } : {},
|
|
818
818
|
...Array.isArray(t.columns) ? { columns: t.columns } : {},
|
|
@@ -822,15 +822,15 @@ function Nn(e) {
|
|
|
822
822
|
...typeof t.error == "string" && t.error ? { error: t.error } : {}
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function On(e, t, n = "answer") {
|
|
826
826
|
var d;
|
|
827
827
|
const r = (Array.isArray(t.records) ? t.records : []).filter(
|
|
828
828
|
(f) => !!f && typeof f == "object"
|
|
829
|
-
), a =
|
|
829
|
+
), a = O(t), s = n === "preview" ? { matched: r.length > R ? "beyondCap" : r.length } : {};
|
|
830
830
|
if (!r.length) return { status: "none", why: "noRows", filterReach: a, ...s };
|
|
831
831
|
const i = ht(e, r, t);
|
|
832
832
|
if (e.get.kind === "list") {
|
|
833
|
-
const f = i[0], y = r.length > R, h = f ? r.map((I) =>
|
|
833
|
+
const f = i[0], y = r.length > R, h = f ? r.map((I) => W(I[f.key], f.type)).filter((I) => I.value !== null) : [];
|
|
834
834
|
if (!h.length && !y) return { status: "none", why: "noRows", filterReach: a, ...s };
|
|
835
835
|
const p = Math.max(1, e.get.limit ?? ct);
|
|
836
836
|
return {
|
|
@@ -844,11 +844,11 @@ function Dn(e, t, n = "answer") {
|
|
|
844
844
|
if (e.get.kind === "only" && r.length > 1)
|
|
845
845
|
return { status: "none", why: "moreThanOne", filterReach: a, ...s };
|
|
846
846
|
const o = r[0], c = Object.fromEntries(
|
|
847
|
-
i.map((f) => [f.part,
|
|
847
|
+
i.map((f) => [f.part, W(o[f.key], f.type)])
|
|
848
848
|
);
|
|
849
|
-
if (e.get.kind === "aggregate" && ((d = c[
|
|
849
|
+
if (e.get.kind === "aggregate" && ((d = c[S]) == null ? void 0 : d.value) == null)
|
|
850
850
|
return { status: "none", why: "noRows", filterReach: a, ...s };
|
|
851
|
-
const u =
|
|
851
|
+
const u = H(e) ? yt(e, o, t) : void 0;
|
|
852
852
|
return {
|
|
853
853
|
status: "answered",
|
|
854
854
|
parts: u && "parts" in u ? { ...c, ...u.parts } : c,
|
|
@@ -859,12 +859,12 @@ function Dn(e, t, n = "answer") {
|
|
|
859
859
|
}
|
|
860
860
|
function yt(e, t, n) {
|
|
861
861
|
var o, c;
|
|
862
|
-
const r = (c = (o = e.query.config) == null ? void 0 : o.metricColumns) == null ? void 0 : c[0], a = r ?
|
|
862
|
+
const r = (c = (o = e.query.config) == null ? void 0 : o.metricColumns) == null ? void 0 : c[0], a = r ? Y(n.comparisonMetadata, r) : void 0, s = a == null ? void 0 : a.output;
|
|
863
863
|
if (!s || s.availability.status !== "available" || !s.comparisonColumnKey)
|
|
864
864
|
return { unavailable: (s == null ? void 0 : s.availability.status) === "unavailable" ? s.availability.reason : "temporal_binding_missing" };
|
|
865
865
|
const i = (u) => {
|
|
866
866
|
const d = t[u], f = typeof d == "string" && d.trim() !== "" ? Number(d) : d;
|
|
867
|
-
return
|
|
867
|
+
return W(typeof f == "number" && !Number.isFinite(f) ? null : f, "number");
|
|
868
868
|
};
|
|
869
869
|
return {
|
|
870
870
|
parts: {
|
|
@@ -874,16 +874,16 @@ function yt(e, t, n) {
|
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
876
|
}
|
|
877
|
-
const
|
|
878
|
-
function
|
|
879
|
-
const t =
|
|
877
|
+
const me = /* @__PURE__ */ new WeakMap();
|
|
878
|
+
function X(e) {
|
|
879
|
+
const t = me.get(e);
|
|
880
880
|
if (t) return t;
|
|
881
881
|
const n = new Map(
|
|
882
882
|
(e.sheets ?? []).map(
|
|
883
883
|
(s) => [s.id, s.kind === "document" ? "document" : "dashboard"]
|
|
884
884
|
)
|
|
885
885
|
), r = [
|
|
886
|
-
...
|
|
886
|
+
..._(e).map(
|
|
887
887
|
(s) => ({
|
|
888
888
|
kind: "card",
|
|
889
889
|
id: s.cardId,
|
|
@@ -902,18 +902,18 @@ function H(e) {
|
|
|
902
902
|
})
|
|
903
903
|
)
|
|
904
904
|
], a = { targets: r, byId: new Map(r.map((s) => [s.id, s])) };
|
|
905
|
-
return
|
|
905
|
+
return me.set(e, a), a;
|
|
906
906
|
}
|
|
907
907
|
function It(e) {
|
|
908
|
-
return
|
|
908
|
+
return X(e).targets;
|
|
909
909
|
}
|
|
910
|
-
function
|
|
911
|
-
return
|
|
910
|
+
function Dn(e, t) {
|
|
911
|
+
return X(e).byId.get(t);
|
|
912
912
|
}
|
|
913
913
|
function bt(e, t) {
|
|
914
|
-
return
|
|
914
|
+
return X(e).byId.has(t);
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function St(e, t) {
|
|
917
917
|
return t.kind === "card" ? [
|
|
918
918
|
{
|
|
919
919
|
sheetId: t.sheetId,
|
|
@@ -921,22 +921,22 @@ function gt(e, t) {
|
|
|
921
921
|
sheetKind: t.sheetKind,
|
|
922
922
|
...t.sectionId ? { sectionId: t.sectionId } : {}
|
|
923
923
|
}
|
|
924
|
-
] :
|
|
924
|
+
] : ke(e, t.id);
|
|
925
925
|
}
|
|
926
|
-
function
|
|
927
|
-
return
|
|
928
|
-
(r) =>
|
|
926
|
+
function Ct(e, t, n) {
|
|
927
|
+
return St(e, n).some(
|
|
928
|
+
(r) => C(t, r)
|
|
929
929
|
);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function xn(e, t) {
|
|
932
932
|
return It(e).filter(
|
|
933
|
-
(n) => n.kind === "variable" &&
|
|
933
|
+
(n) => n.kind === "variable" && Ct(e, t, n)
|
|
934
934
|
);
|
|
935
935
|
}
|
|
936
|
-
const
|
|
937
|
-
function
|
|
936
|
+
const gt = ["new", "edit", "delete", "create", "update", "remove"];
|
|
937
|
+
function Te(e, t) {
|
|
938
938
|
return (e.sheets || []).flatMap(
|
|
939
|
-
(n) =>
|
|
939
|
+
(n) => _({ sheets: [n] }).filter(t).map((r) => ({
|
|
940
940
|
card: r.card,
|
|
941
941
|
sheet: n,
|
|
942
942
|
...r.kind === "frameCard" && { frameId: r.frameId },
|
|
@@ -947,22 +947,22 @@ function ve(e, t) {
|
|
|
947
947
|
);
|
|
948
948
|
}
|
|
949
949
|
function T(e) {
|
|
950
|
-
return
|
|
950
|
+
return Te(e, (t) => t.kind !== "documentSectionCard");
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function Rn(e) {
|
|
953
953
|
return [
|
|
954
954
|
...T(e),
|
|
955
|
-
...
|
|
955
|
+
...Te(e, (t) => t.kind === "documentSectionCard")
|
|
956
956
|
];
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Mn(e) {
|
|
959
959
|
return T(e).map((t) => t.card);
|
|
960
960
|
}
|
|
961
961
|
function _n(e, t, n) {
|
|
962
962
|
return n && t === n ? !0 : !bt(e, t);
|
|
963
963
|
}
|
|
964
964
|
function Fn(e) {
|
|
965
|
-
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) ?
|
|
965
|
+
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) ? gt.includes(e.toLowerCase()) ? {
|
|
966
966
|
isValid: !1,
|
|
967
967
|
error: `"${e}" is a reserved keyword and cannot be used`
|
|
968
968
|
} : { isValid: !0 } : {
|
|
@@ -993,7 +993,7 @@ const M = {
|
|
|
993
993
|
includeMetricFilterDatasets: !0,
|
|
994
994
|
preferQualifiedIdentity: !1
|
|
995
995
|
};
|
|
996
|
-
function
|
|
996
|
+
function Ee(e) {
|
|
997
997
|
if (!e) return;
|
|
998
998
|
if (e.kind === "semantic")
|
|
999
999
|
return { entityName: e.datasetName, entityId: e.datasetId, label: e.label };
|
|
@@ -1006,7 +1006,7 @@ function Te(e) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
function wt(e) {
|
|
1008
1008
|
var n;
|
|
1009
|
-
const t =
|
|
1009
|
+
const t = Ee(e.source);
|
|
1010
1010
|
return t ? `${(n = e.source) == null ? void 0 : n.kind}:${t.qualifiedEntityName || t.entityName}` : "";
|
|
1011
1011
|
}
|
|
1012
1012
|
function At(e) {
|
|
@@ -1035,7 +1035,7 @@ function Tt(e) {
|
|
|
1035
1035
|
function Et(e) {
|
|
1036
1036
|
return Ve(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Tt(e);
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function L(e, t) {
|
|
1039
1039
|
const n = vt(t);
|
|
1040
1040
|
e.found.has(n) || e.found.set(n, t);
|
|
1041
1041
|
}
|
|
@@ -1047,8 +1047,8 @@ function E(e, t) {
|
|
|
1047
1047
|
t.visitedFields.add(n);
|
|
1048
1048
|
const r = Et(e);
|
|
1049
1049
|
if (!r) {
|
|
1050
|
-
const y = !e.entityName && !e.qualifiedEntityName ?
|
|
1051
|
-
|
|
1050
|
+
const y = !e.entityName && !e.qualifiedEntityName ? Ee(e.source) : void 0;
|
|
1051
|
+
L(
|
|
1052
1052
|
t,
|
|
1053
1053
|
y || {
|
|
1054
1054
|
// May be empty for qualified-only metadata; identity then comes from
|
|
@@ -1060,7 +1060,7 @@ function E(e, t) {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
);
|
|
1062
1062
|
}
|
|
1063
|
-
t.includeMetricFilterDatasets && "parameters" in e && ((u = e.parameters) != null && u.filters) &&
|
|
1063
|
+
t.includeMetricFilterDatasets && "parameters" in e && ((u = e.parameters) != null && u.filters) && Z(e.parameters.filters, t);
|
|
1064
1064
|
const a = (d = e.calculatedFormula) == null ? void 0 : d.inputFields, s = !!(a && a.length > 0);
|
|
1065
1065
|
s && a.forEach((y) => E(y, t));
|
|
1066
1066
|
let i = !1, o = !1;
|
|
@@ -1077,14 +1077,14 @@ function E(e, t) {
|
|
|
1077
1077
|
continue;
|
|
1078
1078
|
}
|
|
1079
1079
|
if (h.kind === "semantic")
|
|
1080
|
-
|
|
1080
|
+
L(t, {
|
|
1081
1081
|
entityName: h.datasetName,
|
|
1082
1082
|
entityId: h.datasetId,
|
|
1083
1083
|
label: h.label
|
|
1084
1084
|
});
|
|
1085
1085
|
else {
|
|
1086
1086
|
const p = [h.databaseName, h.schemaName, h.tableName].filter((I) => !!(I && I.trim())).join(".");
|
|
1087
|
-
|
|
1087
|
+
L(t, {
|
|
1088
1088
|
entityName: h.tableName,
|
|
1089
1089
|
qualifiedEntityName: p.includes(".") ? p : void 0,
|
|
1090
1090
|
label: h.label
|
|
@@ -1094,16 +1094,16 @@ function E(e, t) {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
o && (t.complete = !1), r && !s && !i && (t.complete = !1);
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function Z(e, t) {
|
|
1098
1098
|
if (e && !t.visitedGroups.has(e.id)) {
|
|
1099
1099
|
t.visitedGroups.add(e.id);
|
|
1100
1100
|
for (const n of e.conditions || [])
|
|
1101
1101
|
E(n.field, t);
|
|
1102
1102
|
for (const n of e.groups || [])
|
|
1103
|
-
|
|
1103
|
+
Z(n, t);
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1106
|
+
function F(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
|
|
1107
1107
|
return {
|
|
1108
1108
|
found: /* @__PURE__ */ new Map(),
|
|
1109
1109
|
complete: !0,
|
|
@@ -1112,43 +1112,43 @@ function _(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
|
|
|
1112
1112
|
includeMetricFilterDatasets: e
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function ee(e, t) {
|
|
1116
1116
|
var r;
|
|
1117
1117
|
const n = (r = e.qualifiedEntityName) != null && r.includes(".") ? e.qualifiedEntityName : void 0;
|
|
1118
1118
|
return t === "qualifiedOnly" ? n : t === "preferQualified" ? n || e.entityName || void 0 : e.entityName || void 0;
|
|
1119
1119
|
}
|
|
1120
1120
|
function $n(e) {
|
|
1121
|
-
const t =
|
|
1121
|
+
const t = F(!1);
|
|
1122
1122
|
return E(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1125
|
-
const s = { ...M, ...a }, i =
|
|
1124
|
+
function Ke(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = M) {
|
|
1125
|
+
const s = { ...M, ...a }, i = F(s.includeMetricFilterDatasets, n, r);
|
|
1126
1126
|
E(e, i), i.found.forEach((o) => {
|
|
1127
|
-
const c =
|
|
1127
|
+
const c = ee(o, s.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
1128
1128
|
c && t.add(c);
|
|
1129
1129
|
});
|
|
1130
1130
|
}
|
|
1131
1131
|
function qn(e, t) {
|
|
1132
|
-
|
|
1132
|
+
Ke(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
|
|
1133
1133
|
preferQualifiedIdentity: !0
|
|
1134
1134
|
});
|
|
1135
1135
|
}
|
|
1136
1136
|
function Bn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
1137
|
-
const a =
|
|
1137
|
+
const a = F(!0, n, r);
|
|
1138
1138
|
E(e, a), a.found.forEach((s) => {
|
|
1139
|
-
const i =
|
|
1139
|
+
const i = ee(s, "qualifiedOnly");
|
|
1140
1140
|
i && t.add(i);
|
|
1141
1141
|
});
|
|
1142
1142
|
}
|
|
1143
1143
|
function jn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
1144
|
-
|
|
1144
|
+
Ke(e, t, n, r, {
|
|
1145
1145
|
includeMetricFilterDatasets: !1
|
|
1146
1146
|
});
|
|
1147
1147
|
}
|
|
1148
1148
|
function Un(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = M) {
|
|
1149
|
-
const s = { ...M, ...a }, i =
|
|
1150
|
-
|
|
1151
|
-
const c =
|
|
1149
|
+
const s = { ...M, ...a }, i = F(s.includeMetricFilterDatasets, n, r);
|
|
1150
|
+
Z(e, i), i.found.forEach((o) => {
|
|
1151
|
+
const c = ee(o, s.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
1152
1152
|
c && t.add(c);
|
|
1153
1153
|
});
|
|
1154
1154
|
}
|
|
@@ -1199,13 +1199,13 @@ const Wn = {
|
|
|
1199
1199
|
boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
|
|
1200
1200
|
};
|
|
1201
1201
|
function Nt(e) {
|
|
1202
|
-
const t =
|
|
1202
|
+
const t = Q(e);
|
|
1203
1203
|
return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
|
|
1204
1204
|
}
|
|
1205
1205
|
function Qn(e, t) {
|
|
1206
1206
|
return typeof t != "string" ? !1 : Kt[Nt(e)].has(t);
|
|
1207
1207
|
}
|
|
1208
|
-
const
|
|
1208
|
+
const Ot = /* @__PURE__ */ new Set([
|
|
1209
1209
|
"=",
|
|
1210
1210
|
">",
|
|
1211
1211
|
"<",
|
|
@@ -1221,19 +1221,19 @@ const Dt = /* @__PURE__ */ new Set([
|
|
|
1221
1221
|
"is null",
|
|
1222
1222
|
"is not null"
|
|
1223
1223
|
]);
|
|
1224
|
-
function
|
|
1224
|
+
function Dt(e, t) {
|
|
1225
1225
|
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";
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function xt(e, t, n, r) {
|
|
1228
1228
|
if (Pe(e.relativeMeta)) {
|
|
1229
1229
|
r.push(
|
|
1230
1230
|
`${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
|
|
1231
1231
|
);
|
|
1232
1232
|
return;
|
|
1233
1233
|
}
|
|
1234
|
-
|
|
1234
|
+
Rt(e.operation, e.values, t, `${n}.values`, r);
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1236
|
+
function Rt(e, t, n, r, a) {
|
|
1237
1237
|
if (e === "is null" || e === "is not null") {
|
|
1238
1238
|
t.length !== 0 && a.push(`${r} must be empty for null filter operations.`);
|
|
1239
1239
|
return;
|
|
@@ -1259,17 +1259,18 @@ function Mt(e, t, n, r, a) {
|
|
|
1259
1259
|
return;
|
|
1260
1260
|
}
|
|
1261
1261
|
for (const s of t)
|
|
1262
|
-
if (!
|
|
1262
|
+
if (!Dt(s, n)) {
|
|
1263
1263
|
a.push(
|
|
1264
1264
|
`${r} contains a value that is incompatible with valueType '${n}'.`
|
|
1265
1265
|
);
|
|
1266
1266
|
return;
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1269
|
+
const G = {
|
|
1270
1270
|
bookmarksPerViewerPerDashboard: 20,
|
|
1271
1271
|
bookmarkNameMaxChars: 100,
|
|
1272
1272
|
columnLabelMaxChars: 120,
|
|
1273
|
+
columnWidthMaxPx: 4e3,
|
|
1273
1274
|
tableSettingsMaxBytes: 65536,
|
|
1274
1275
|
rememberedTableSettingsMaxBytes: 262144,
|
|
1275
1276
|
bookmarkStateMaxBytes: 65536
|
|
@@ -1277,7 +1278,7 @@ const Ke = {
|
|
|
1277
1278
|
function Yn(e) {
|
|
1278
1279
|
return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
|
|
1279
1280
|
}
|
|
1280
|
-
function
|
|
1281
|
+
function Mt(e) {
|
|
1281
1282
|
const t = encodeURIComponent;
|
|
1282
1283
|
switch (e.kind) {
|
|
1283
1284
|
case "dimension":
|
|
@@ -1312,50 +1313,60 @@ function _t(e) {
|
|
|
1312
1313
|
const r = N(t[1]);
|
|
1313
1314
|
r && (n = { kind: "result", key: r });
|
|
1314
1315
|
}
|
|
1315
|
-
return n &&
|
|
1316
|
+
return n && Mt(n) === e ? n : void 0;
|
|
1316
1317
|
}
|
|
1317
|
-
function
|
|
1318
|
+
function D(e) {
|
|
1318
1319
|
return typeof e == "string" && _t(e) !== void 0;
|
|
1319
1320
|
}
|
|
1320
|
-
const
|
|
1321
|
-
order:
|
|
1322
|
-
hidden:
|
|
1323
|
-
labels: l.record(l.string(), l.string().max(
|
|
1321
|
+
const pe = l.array(l.string()).max(2e3), Ft = l.object({
|
|
1322
|
+
order: pe.optional(),
|
|
1323
|
+
hidden: pe.optional(),
|
|
1324
|
+
labels: l.record(l.string(), l.string().max(G.columnLabelMaxChars)).optional(),
|
|
1324
1325
|
sort: l.array(
|
|
1325
1326
|
l.object({
|
|
1326
1327
|
columnId: l.string(),
|
|
1327
1328
|
direction: l.enum(["asc", "desc"])
|
|
1328
1329
|
}).strict()
|
|
1329
|
-
).max(2e3).optional()
|
|
1330
|
+
).max(2e3).optional(),
|
|
1331
|
+
widths: l.record(
|
|
1332
|
+
l.string(),
|
|
1333
|
+
l.number().int().min(1).max(G.columnWidthMaxPx)
|
|
1334
|
+
).optional()
|
|
1330
1335
|
}).strict();
|
|
1331
|
-
function
|
|
1336
|
+
function he(e) {
|
|
1332
1337
|
const t = /* @__PURE__ */ new Set(), n = [];
|
|
1333
1338
|
for (const r of e)
|
|
1334
|
-
!
|
|
1339
|
+
!D(r) || t.has(r) || (t.add(r), n.push(r));
|
|
1335
1340
|
return n;
|
|
1336
1341
|
}
|
|
1337
|
-
function
|
|
1342
|
+
function Oe(e) {
|
|
1338
1343
|
if (!e) return;
|
|
1339
|
-
const t = e.order ?
|
|
1340
|
-
([
|
|
1341
|
-
const
|
|
1342
|
-
return
|
|
1344
|
+
const t = e.order ? he(e.order) : void 0, n = e.hidden ? he(e.hidden) : void 0, r = Object.entries(e.labels ?? {}).flatMap(
|
|
1345
|
+
([c, u]) => {
|
|
1346
|
+
const d = typeof u == "string" ? u.trim() : "";
|
|
1347
|
+
return D(c) && d ? [
|
|
1343
1348
|
[
|
|
1344
|
-
|
|
1345
|
-
|
|
1349
|
+
c,
|
|
1350
|
+
d.slice(0, G.columnLabelMaxChars)
|
|
1346
1351
|
]
|
|
1347
1352
|
] : [];
|
|
1348
1353
|
}
|
|
1349
|
-
), a = /* @__PURE__ */ new Set(), s = e.sort ? e.sort.filter((
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
+
), a = /* @__PURE__ */ new Set(), s = e.sort ? e.sort.filter((c) => !D(c.columnId) || a.has(c.columnId) ? !1 : (a.add(c.columnId), !0)) : void 0, i = Object.entries(e.widths ?? {}).filter(
|
|
1355
|
+
([c]) => D(c)
|
|
1356
|
+
), o = {};
|
|
1357
|
+
return t != null && t.length && (o.order = t), n != null && n.length && (o.hidden = n), r.length && (o.labels = Object.fromEntries(r)), s && (o.sort = s.map(({ columnId: c, direction: u }) => ({
|
|
1358
|
+
columnId: c,
|
|
1359
|
+
direction: u
|
|
1360
|
+
}))), i.length && (o.widths = Object.fromEntries(i)), Object.keys(o).length ? o : void 0;
|
|
1361
|
+
}
|
|
1362
|
+
function Jn(e) {
|
|
1363
|
+
var t, n;
|
|
1364
|
+
return !!((t = e == null ? void 0 : e.order) != null && t.length) || !!((n = e == null ? void 0 : e.hidden) != null && n.length) || Object.keys((e == null ? void 0 : e.labels) ?? {}).length > 0 || Object.keys((e == null ? void 0 : e.widths) ?? {}).length > 0;
|
|
1354
1365
|
}
|
|
1355
|
-
function
|
|
1356
|
-
return
|
|
1366
|
+
function De(e) {
|
|
1367
|
+
return Oe(e) === void 0;
|
|
1357
1368
|
}
|
|
1358
|
-
function
|
|
1369
|
+
function xe(e, t) {
|
|
1359
1370
|
if (t !== Ne)
|
|
1360
1371
|
return {
|
|
1361
1372
|
ok: !1,
|
|
@@ -1364,18 +1375,18 @@ function Re(e, t) {
|
|
|
1364
1375
|
const n = Ft.safeParse(e);
|
|
1365
1376
|
return n.success ? {
|
|
1366
1377
|
ok: !0,
|
|
1367
|
-
value:
|
|
1378
|
+
value: Oe(n.data) ?? {}
|
|
1368
1379
|
} : { ok: !1, error: "Table settings are invalid." };
|
|
1369
1380
|
}
|
|
1370
|
-
function
|
|
1381
|
+
function Hn(e, t, n) {
|
|
1371
1382
|
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
1372
1383
|
const r = {};
|
|
1373
1384
|
for (const [a, s] of Object.entries(
|
|
1374
1385
|
e
|
|
1375
1386
|
)) {
|
|
1376
1387
|
if (!n.has(a)) continue;
|
|
1377
|
-
const i =
|
|
1378
|
-
i.ok && !
|
|
1388
|
+
const i = xe(s, t);
|
|
1389
|
+
i.ok && !De(i.value) && (r[a] = i.value);
|
|
1379
1390
|
}
|
|
1380
1391
|
return r;
|
|
1381
1392
|
}
|
|
@@ -1383,24 +1394,24 @@ const Vt = /* @__PURE__ */ new Set([
|
|
|
1383
1394
|
"table",
|
|
1384
1395
|
"detailTable"
|
|
1385
1396
|
]);
|
|
1386
|
-
function
|
|
1397
|
+
function Re(e) {
|
|
1387
1398
|
return Vt.has(e.type);
|
|
1388
1399
|
}
|
|
1389
1400
|
function Pt(e) {
|
|
1390
1401
|
var t, n;
|
|
1391
|
-
return
|
|
1402
|
+
return Re(e) && ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.allowViewerColumnCustomization) !== !1;
|
|
1392
1403
|
}
|
|
1393
|
-
function
|
|
1404
|
+
function Xn(e) {
|
|
1394
1405
|
return new Set(
|
|
1395
|
-
T(e).filter(({ card: t }) =>
|
|
1406
|
+
T(e).filter(({ card: t }) => Re(t)).map(({ card: t }) => t.id)
|
|
1396
1407
|
);
|
|
1397
1408
|
}
|
|
1398
|
-
function
|
|
1409
|
+
function Zn(e) {
|
|
1399
1410
|
return new Set(
|
|
1400
1411
|
T(e).filter(({ card: t }) => Pt(t)).map(({ card: t }) => t.id)
|
|
1401
1412
|
);
|
|
1402
1413
|
}
|
|
1403
|
-
const
|
|
1414
|
+
const $ = 1, er = ["PRIVATE", "TEAM", "DASHBOARD"], Lt = l.object({
|
|
1404
1415
|
filterId: l.string().min(1),
|
|
1405
1416
|
name: l.string(),
|
|
1406
1417
|
operation: l.string(),
|
|
@@ -1408,9 +1419,9 @@ const L = 1, Zn = ["PRIVATE", "TEAM", "DASHBOARD"], Lt = l.object({
|
|
|
1408
1419
|
values: l.array(l.unknown())
|
|
1409
1420
|
}).passthrough().superRefine((e, t) => {
|
|
1410
1421
|
const n = [];
|
|
1411
|
-
|
|
1422
|
+
Ot.has(e.operation) ? xt(e, e.valueType, "filterValue", n) : n.push("filterValue.operation must be a valid filter operation.");
|
|
1412
1423
|
for (const r of n) t.addIssue({ code: "custom", message: r });
|
|
1413
|
-
}),
|
|
1424
|
+
}), q = l.unknown().superRefine((e, t) => {
|
|
1414
1425
|
for (const n of je(e).errors)
|
|
1415
1426
|
t.addIssue({ code: "custom", message: n.message });
|
|
1416
1427
|
}), $t = l.discriminatedUnion("kind", [
|
|
@@ -1424,15 +1435,15 @@ const L = 1, Zn = ["PRIVATE", "TEAM", "DASHBOARD"], Lt = l.object({
|
|
|
1424
1435
|
l.object({
|
|
1425
1436
|
status: l.literal("set"),
|
|
1426
1437
|
value: $t,
|
|
1427
|
-
comparisonSelection:
|
|
1438
|
+
comparisonSelection: q.optional()
|
|
1428
1439
|
}).strict(),
|
|
1429
1440
|
l.object({
|
|
1430
1441
|
status: l.literal("cleared"),
|
|
1431
|
-
comparisonSelection:
|
|
1442
|
+
comparisonSelection: q.optional()
|
|
1432
1443
|
}).strict(),
|
|
1433
|
-
l.object({ comparisonSelection:
|
|
1434
|
-
]),
|
|
1435
|
-
function
|
|
1444
|
+
l.object({ comparisonSelection: q }).strict()
|
|
1445
|
+
]), Me = ["bySheetId", "byCardId", "byDocumentSectionId"], Bt = /* @__PURE__ */ new Set(["version", "selectedSheetId", "inputs", "tableSettings"]), jt = /* @__PURE__ */ new Set(["shared", ...Me]), A = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
1446
|
+
function ye(e, t, n) {
|
|
1436
1447
|
if (e === void 0) return;
|
|
1437
1448
|
if (!A(e)) {
|
|
1438
1449
|
t.push({ target: "input", id: n });
|
|
@@ -1449,9 +1460,9 @@ function he(e, t, n) {
|
|
|
1449
1460
|
return Object.keys(r).length ? r : void 0;
|
|
1450
1461
|
}
|
|
1451
1462
|
function Ut(e, t) {
|
|
1452
|
-
if (t !==
|
|
1463
|
+
if (t !== $)
|
|
1453
1464
|
return { ok: !1, error: `Unsupported bookmark version ${t}.` };
|
|
1454
|
-
if (!A(e) || e.version !==
|
|
1465
|
+
if (!A(e) || e.version !== $)
|
|
1455
1466
|
return { ok: !1, error: "The bookmark state is invalid." };
|
|
1456
1467
|
const n = [], r = Object.keys(e).filter((o) => !Bt.has(o));
|
|
1457
1468
|
let a;
|
|
@@ -1461,9 +1472,9 @@ function Ut(e, t) {
|
|
|
1461
1472
|
r.push(
|
|
1462
1473
|
...Object.keys(e.inputs).filter((c) => !jt.has(c)).map((c) => `inputs.${c}`)
|
|
1463
1474
|
);
|
|
1464
|
-
const o =
|
|
1475
|
+
const o = ye(e.inputs.shared, n, "shared");
|
|
1465
1476
|
o && (s.shared = o);
|
|
1466
|
-
for (const c of
|
|
1477
|
+
for (const c of Me) {
|
|
1467
1478
|
const u = e.inputs[c];
|
|
1468
1479
|
if (u === void 0) continue;
|
|
1469
1480
|
if (!A(u)) {
|
|
@@ -1472,7 +1483,7 @@ function Ut(e, t) {
|
|
|
1472
1483
|
}
|
|
1473
1484
|
const d = {};
|
|
1474
1485
|
for (const [f, y] of Object.entries(u)) {
|
|
1475
|
-
const h =
|
|
1486
|
+
const h = ye(y, n, `${c}.${f}`);
|
|
1476
1487
|
h && (d[f] = h);
|
|
1477
1488
|
}
|
|
1478
1489
|
Object.keys(d).length && (s[c] = d);
|
|
@@ -1481,14 +1492,14 @@ function Ut(e, t) {
|
|
|
1481
1492
|
const i = {};
|
|
1482
1493
|
if (A(e.tableSettings))
|
|
1483
1494
|
for (const [o, c] of Object.entries(e.tableSettings)) {
|
|
1484
|
-
const u = o ?
|
|
1485
|
-
u != null && u.ok ?
|
|
1495
|
+
const u = o ? xe(c, Ne) : void 0;
|
|
1496
|
+
u != null && u.ok ? De(u.value) || (i[o] = u.value) : n.push({ target: "card", id: o });
|
|
1486
1497
|
}
|
|
1487
1498
|
else e.tableSettings !== void 0 && r.push("tableSettings");
|
|
1488
1499
|
return {
|
|
1489
1500
|
ok: !0,
|
|
1490
1501
|
value: {
|
|
1491
|
-
version:
|
|
1502
|
+
version: $,
|
|
1492
1503
|
...a ? { selectedSheetId: a } : {},
|
|
1493
1504
|
...Object.keys(s).length ? { inputs: s } : {},
|
|
1494
1505
|
...Object.keys(i).length ? { tableSettings: i } : {}
|
|
@@ -1497,97 +1508,98 @@ function Ut(e, t) {
|
|
|
1497
1508
|
unknownKeys: r
|
|
1498
1509
|
};
|
|
1499
1510
|
}
|
|
1500
|
-
function
|
|
1511
|
+
function tr(e, t) {
|
|
1501
1512
|
const n = Ut(e, t);
|
|
1502
1513
|
return n.ok ? n.issues.some((r) => r.target === "card") ? { ok: !1, error: "The bookmark table settings are invalid." } : n.issues.length || n.unknownKeys.length ? { ok: !1, error: "The bookmark state is invalid." } : { ok: !0, value: n.value } : n;
|
|
1503
1514
|
}
|
|
1504
1515
|
export {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1516
|
+
Ge as $,
|
|
1517
|
+
_ as A,
|
|
1518
|
+
$ as B,
|
|
1508
1519
|
Gn as C,
|
|
1509
|
-
|
|
1520
|
+
C as D,
|
|
1510
1521
|
Wn as E,
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1522
|
+
cn as F,
|
|
1523
|
+
Dn as G,
|
|
1524
|
+
wn as H,
|
|
1525
|
+
ze as I,
|
|
1526
|
+
rt as J,
|
|
1527
|
+
It as K,
|
|
1528
|
+
fn as L,
|
|
1529
|
+
de as M,
|
|
1530
|
+
Ze as N,
|
|
1531
|
+
an as O,
|
|
1532
|
+
ge as P,
|
|
1533
|
+
pn as Q,
|
|
1534
|
+
En as R,
|
|
1535
|
+
yn as S,
|
|
1536
|
+
J as T,
|
|
1537
|
+
kn as U,
|
|
1538
|
+
G as V,
|
|
1539
|
+
ot as W,
|
|
1529
1540
|
ne as X,
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1541
|
+
re as Y,
|
|
1542
|
+
We as Z,
|
|
1543
|
+
Xt as _,
|
|
1533
1544
|
Ln as a,
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1545
|
+
Zt as a0,
|
|
1546
|
+
on as a1,
|
|
1547
|
+
un as a2,
|
|
1548
|
+
dn as a3,
|
|
1549
|
+
ln as a4,
|
|
1550
|
+
mn as a5,
|
|
1551
|
+
hn as a6,
|
|
1552
|
+
Ae as a7,
|
|
1553
|
+
R as a8,
|
|
1554
|
+
ct as a9,
|
|
1555
|
+
Mn as aA,
|
|
1556
|
+
tn as aB,
|
|
1557
|
+
Je as aC,
|
|
1558
|
+
v as aD,
|
|
1559
|
+
Y as aE,
|
|
1560
|
+
Sn as aF,
|
|
1561
|
+
gn as aG,
|
|
1562
|
+
Cn as aH,
|
|
1563
|
+
T as aI,
|
|
1564
|
+
at as aJ,
|
|
1565
|
+
bn as aK,
|
|
1566
|
+
se as aL,
|
|
1567
|
+
In as aM,
|
|
1568
|
+
Rn as aN,
|
|
1569
|
+
Qe as aO,
|
|
1570
|
+
_n as aP,
|
|
1571
|
+
Fn as aQ,
|
|
1572
|
+
Pn as aR,
|
|
1573
|
+
en as aS,
|
|
1574
|
+
S as aa,
|
|
1575
|
+
ve as ab,
|
|
1576
|
+
ut as ac,
|
|
1577
|
+
dt as ad,
|
|
1578
|
+
An as ae,
|
|
1579
|
+
H as af,
|
|
1580
|
+
lt as ag,
|
|
1581
|
+
vn as ah,
|
|
1582
|
+
Tn as ai,
|
|
1583
|
+
Kn as aj,
|
|
1584
|
+
Nn as ak,
|
|
1585
|
+
On as al,
|
|
1586
|
+
nn as am,
|
|
1587
|
+
Xe as an,
|
|
1588
|
+
rn as ao,
|
|
1589
|
+
sn as ap,
|
|
1590
|
+
ke as aq,
|
|
1591
|
+
bt as ar,
|
|
1580
1592
|
St as as,
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1593
|
+
Ct as at,
|
|
1594
|
+
xn as au,
|
|
1595
|
+
Nt as av,
|
|
1596
|
+
Qn as aw,
|
|
1597
|
+
Ot as ax,
|
|
1598
|
+
xt as ay,
|
|
1599
|
+
kt as az,
|
|
1588
1600
|
qn as b,
|
|
1589
|
-
|
|
1590
|
-
|
|
1601
|
+
Ke as c,
|
|
1602
|
+
Ee as d,
|
|
1591
1603
|
Bn as e,
|
|
1592
1604
|
jn as f,
|
|
1593
1605
|
Un as g,
|
|
@@ -1595,19 +1607,19 @@ export {
|
|
|
1595
1607
|
Ut as i,
|
|
1596
1608
|
Ne as j,
|
|
1597
1609
|
_t as k,
|
|
1598
|
-
|
|
1610
|
+
Jn as l,
|
|
1599
1611
|
Yn as m,
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1612
|
+
Oe as n,
|
|
1613
|
+
De as o,
|
|
1614
|
+
tr as p,
|
|
1615
|
+
xe as q,
|
|
1604
1616
|
$n as r,
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1617
|
+
Hn as s,
|
|
1618
|
+
Mt as t,
|
|
1619
|
+
Re as u,
|
|
1620
|
+
Pt as v,
|
|
1609
1621
|
Xn as w,
|
|
1610
1622
|
Zn as x,
|
|
1611
|
-
|
|
1612
|
-
|
|
1623
|
+
er as y,
|
|
1624
|
+
Vn as z
|
|
1613
1625
|
};
|