react-semaphor 0.1.540 → 0.1.542
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/analytics-protocol/index.js +75 -75
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +3 -3
- package/dist/briefings/index.js +50 -45
- package/dist/chunks/apply-dashboard-operations-Btbp2-6v.js +2260 -0
- package/dist/chunks/{assistant-chat-ya7xopaC.js → assistant-chat-oHF5lTjA.js} +12 -12
- package/dist/chunks/bookmark-state-CXw7lZ50.js +118 -0
- package/dist/chunks/{calendar-day-equality-Bpl15IBo.js → calendar-day-equality-BmJAWduY.js} +180 -207
- package/dist/chunks/comparison-window-caption-ChIyd_-L.js +1618 -0
- package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +323 -0
- package/dist/chunks/{dashboard-briefing-launcher-DJI-zfEq.js → dashboard-briefing-launcher-B-cm719R.js} +18 -18
- package/dist/chunks/{dashboard-controls-Dh7HqoKy.js → dashboard-controls-CIn22Qgp.js} +69 -70
- package/dist/chunks/{dashboard-filter-value-compatibility-D95O4nd7.js → dashboard-filter-value-compatibility-CwQ_iSNb.js} +2 -2
- package/dist/chunks/{dashboard-json-BnmlB71h.js → dashboard-json-ZUYsIExq.js} +4 -4
- package/dist/chunks/{dashboard-B6Bithfl.js → dashboard-s5WJBcK8.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-BrYYlRVo.js → document-dashboard-inputs-C6MJVyoI.js} +2357 -4948
- package/dist/chunks/document-sheet-utils-BsZUnHRl.js +3619 -0
- package/dist/chunks/{edit-dashboard-visual-CydOkSko.js → edit-dashboard-visual-DLdereA7.js} +728 -728
- package/dist/chunks/{filter-value-text-BhWugPWE.js → filter-value-text-CYsVYPuD.js} +18 -19
- package/dist/chunks/index-CV5rHq5D.js +2673 -0
- package/dist/chunks/{matrix-analytical-definition-bcprSe4u.js → matrix-analytical-definition-C7Gb0e12.js} +1 -1
- package/dist/chunks/{matrix-card-CJn1hB5V.js → matrix-card-DjwWcCo8.js} +2 -2
- package/dist/chunks/{matrix-formatter-DQ8avoIQ.js → matrix-formatter-BnsTX90d.js} +430 -417
- package/dist/chunks/{matrix-member-presentation-BNPSDKBG.js → matrix-member-presentation-CQGdVks6.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-B8PBF1Gd.js → matrix-operation-contract-8OIO4gob.js} +65 -65
- package/dist/chunks/metric-comparison-DEwi9uc2.js +498 -0
- package/dist/chunks/numeric-presentation-BSAqPpHt.js +5227 -0
- package/dist/chunks/{pivot-header-presentation-MkcKnjn3.js → pivot-header-presentation-DHcx1XGQ.js} +1 -1
- package/dist/chunks/{pivot-result-identity-D6hhcRXi.js → pivot-result-identity-DJhXXcns.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-BBlAfBA0.js +1155 -0
- package/dist/chunks/raw-temporal-presentation-CZ2r0Vb_.js +585 -0
- package/dist/chunks/{report-preferences-dialog-neMDolLg.js → report-preferences-dialog-MRUWpMcJ.js} +75 -75
- package/dist/chunks/{report-runtime-context-B984Nq1E.js → report-runtime-context-Dq8XyODK.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CCrLpfSQ.js → saved-dashboard-context-DjPqgFly.js} +233 -206
- package/dist/chunks/{selection-reducer-vKIb_jS6.js → selection-reducer-Dj_8xD69.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator--4DWtVBu.js → semaphor-ready-indicator-BWSpRsPj.js} +38555 -40449
- package/dist/chunks/{shelf-drop-preview-context-CpdB5ois.js → shelf-drop-preview-context-CQbFLm3q.js} +6 -6
- package/dist/chunks/sort-target-MT1WK1vX.js +29 -0
- package/dist/chunks/{source-entity-resolution-CVA1a85c.js → source-entity-resolution-BYn9giz3.js} +1 -1
- package/dist/chunks/{switch-DWEWiv1J.js → switch-C3jLxlG0.js} +2 -2
- package/dist/chunks/table-export-sheet-BHSnuZHd.js +949 -0
- package/dist/chunks/table-settings-CLZocegs.js +501 -0
- package/dist/chunks/temporal-bucket-D7NBrrtL.js +2071 -0
- package/dist/chunks/{token-types-bxUxXDX2.js → token-types-DBbZVQsm.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-8g6Zhphh.js → use-create-flow-overlay-state-BJDNqdOh.js} +151 -151
- package/dist/chunks/{validators-Ej1DdCXa.js → validators-DMHTpf7a.js} +73 -73
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +399 -380
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +9 -9
- package/dist/format-utils/index.js +346 -238
- package/dist/index.js +174 -175
- package/dist/pdf-export-policy/index.js +20 -10
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +23 -0
- package/dist/types/briefings/attachments.d.ts +17 -1
- package/dist/types/briefings/index.d.ts +6 -3
- package/dist/types/index.js +48 -48
- package/dist/types/lib/api/exports-api.d.ts +11 -65
- package/dist/types/lib/dashboard-inputs/control-contract-overrides.d.ts +17 -0
- package/dist/types/lib/dashboard-viewer/export-table-view.d.ts +2 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/hooks/use-dashboard.d.ts +3 -6
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +8 -2
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +8 -6
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +50 -0
- package/dist/types/lib/query-context/card-server-request.d.ts +5 -1
- package/dist/types/lib/types/common-types.d.ts +7 -0
- package/dist/types/lib/types/explorer-types.d.ts +8 -2
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +3 -3
- package/dist/types/shared/assistant-context/index.d.ts +1 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +23 -6
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +173 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +4 -3
- package/dist/types/shared/format-utils/attachment-filter-line.d.ts +14 -0
- package/dist/types/shared/format-utils/exporters/export-cells.d.ts +90 -0
- package/dist/types/shared/format-utils/exporters/export-file-format.d.ts +44 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +6 -0
- package/dist/types/shared/format-utils/exporters/xlsx-file.d.ts +90 -0
- package/dist/types/shared/format-utils/filter-line.d.ts +7 -0
- package/dist/types/shared/format-utils/formatters/date-formatter.d.ts +8 -12
- package/dist/types/shared/format-utils/formatters/index.d.ts +1 -1
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +2 -0
- package/dist/types/shared/format-utils/index.d.ts +3 -0
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +55 -9
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +21 -1
- package/dist/types/shared/format-utils/matrix-export-xlsx.d.ts +27 -0
- package/dist/types/shared/format-utils/pdf-export-policy.d.ts +9 -0
- package/dist/types/shared/format-utils/presentation-execution.d.ts +27 -2
- package/dist/types/shared/format-utils/raw-temporal.d.ts +8 -0
- package/dist/types/shared/format-utils/table-export/index.d.ts +8 -0
- package/dist/types/shared/format-utils/table-export/prepare-table-export.d.ts +50 -0
- package/dist/types/shared/format-utils/table-export/table-export-formatting.d.ts +47 -0
- package/dist/types/shared/format-utils/table-export/table-export-raw-temporal.d.ts +40 -0
- package/dist/types/shared/format-utils/table-export/table-export-result.d.ts +31 -0
- package/dist/types/shared/format-utils/table-export/table-export-sheet.d.ts +38 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +9 -0
- package/package.json +2 -1
- package/dist/chunks/aggregate-table-row-presentation-BjK9YfMI.js +0 -979
- package/dist/chunks/apply-dashboard-operations-C-iahGka.js +0 -402
- package/dist/chunks/bookmark-state-k7y5SNGf.js +0 -331
- package/dist/chunks/calculated-field-identity-DcBS2NPP.js +0 -2161
- package/dist/chunks/canonical-result-keys-CEQefvdO.js +0 -33
- package/dist/chunks/common-types-CUf03Htv.js +0 -288
- package/dist/chunks/csv-utils-GUfKyT1J.js +0 -56
- package/dist/chunks/custom-visual-inputs-BrUOIwln.js +0 -3288
- package/dist/chunks/document-sheet-utils-C1eEldxs.js +0 -1076
- package/dist/chunks/index-CqMiAkay.js +0 -3164
- package/dist/chunks/matrix-definition-DQDI2okF.js +0 -206
- package/dist/chunks/metric-comparison-CojWeLqx.js +0 -392
- package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +0 -804
- package/dist/chunks/raw-temporal-D61lr48Y.js +0 -1464
- package/dist/chunks/temporal-bucket-D8JF7zKz.js +0 -575
- package/dist/chunks/temporal-bucket-contract-DaOajRC7.js +0 -108
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import { z as s } from "zod";
|
|
2
|
-
import { s as _, b as L } from "./matrix-operation-contract-B8PBF1Gd.js";
|
|
3
|
-
import { v as M } from "./metric-comparison-CojWeLqx.js";
|
|
4
|
-
import { D as x, v as $ } from "./dashboard-filter-value-compatibility-D95O4nd7.js";
|
|
5
|
-
import { l as y } from "./common-types-CUf03Htv.js";
|
|
6
|
-
const P = ["new", "edit", "delete", "create", "update", "remove"];
|
|
7
|
-
function T(e, t) {
|
|
8
|
-
return (e.sheets || []).flatMap(
|
|
9
|
-
(r) => y({ sheets: [r] }).filter(t).map((n) => ({
|
|
10
|
-
card: n.card,
|
|
11
|
-
sheet: r,
|
|
12
|
-
...n.kind === "frameCard" && { frameId: n.frameId },
|
|
13
|
-
...n.kind === "documentSectionCard" && {
|
|
14
|
-
sectionId: n.sectionId
|
|
15
|
-
}
|
|
16
|
-
}))
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
function f(e) {
|
|
20
|
-
return T(e, (t) => t.kind !== "documentSectionCard");
|
|
21
|
-
}
|
|
22
|
-
function re(e) {
|
|
23
|
-
return [
|
|
24
|
-
...f(e),
|
|
25
|
-
...T(e, (t) => t.kind === "documentSectionCard")
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
function ne(e) {
|
|
29
|
-
return f(e).map((t) => t.card);
|
|
30
|
-
}
|
|
31
|
-
function se(e, t, r) {
|
|
32
|
-
return r && t === r ? !0 : !y(e).some(
|
|
33
|
-
(n) => n.cardId === t
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
function oe(e) {
|
|
37
|
-
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) ? P.includes(e.toLowerCase()) ? {
|
|
38
|
-
isValid: !1,
|
|
39
|
-
error: `"${e}" is a reserved keyword and cannot be used`
|
|
40
|
-
} : { isValid: !0 } : {
|
|
41
|
-
isValid: !1,
|
|
42
|
-
error: "Card ID must start with a letter or number"
|
|
43
|
-
} : {
|
|
44
|
-
isValid: !1,
|
|
45
|
-
error: "Card ID can only contain letters, numbers, hyphens, and underscores"
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function ie(e, t) {
|
|
49
|
-
var r;
|
|
50
|
-
return (r = K(e, t)) == null ? void 0 : r.card;
|
|
51
|
-
}
|
|
52
|
-
function K(e, t) {
|
|
53
|
-
for (const r of f(e))
|
|
54
|
-
if (r.card.id === t)
|
|
55
|
-
return r;
|
|
56
|
-
}
|
|
57
|
-
function ae(e, t) {
|
|
58
|
-
for (const r of e.sheets || [])
|
|
59
|
-
for (const n of r.frames || [])
|
|
60
|
-
for (const o of n.cards || [])
|
|
61
|
-
if (o.id === t)
|
|
62
|
-
return { card: o, sheet: r };
|
|
63
|
-
}
|
|
64
|
-
const E = {
|
|
65
|
-
bookmarksPerViewerPerDashboard: 20,
|
|
66
|
-
bookmarkNameMaxChars: 100,
|
|
67
|
-
columnLabelMaxChars: 120,
|
|
68
|
-
tableSettingsMaxBytes: 65536,
|
|
69
|
-
rememberedTableSettingsMaxBytes: 262144,
|
|
70
|
-
bookmarkStateMaxBytes: 65536
|
|
71
|
-
}, V = 1;
|
|
72
|
-
function ce(e) {
|
|
73
|
-
return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
|
|
74
|
-
}
|
|
75
|
-
function N(e) {
|
|
76
|
-
const t = encodeURIComponent;
|
|
77
|
-
switch (e.kind) {
|
|
78
|
-
case "dimension":
|
|
79
|
-
return `dim:${e.role}:${t(e.fieldId)}`;
|
|
80
|
-
case "metric":
|
|
81
|
-
return `metric:${t(e.metricId)}:${t(
|
|
82
|
-
e.metricAlias
|
|
83
|
-
)}`;
|
|
84
|
-
case "result":
|
|
85
|
-
return `result:${t(e.key)}`;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
function m(e) {
|
|
89
|
-
if (e)
|
|
90
|
-
try {
|
|
91
|
-
return decodeURIComponent(e);
|
|
92
|
-
} catch {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function U(e) {
|
|
97
|
-
if (typeof e != "string") return;
|
|
98
|
-
const t = e.split(":");
|
|
99
|
-
let r;
|
|
100
|
-
if (t[0] === "dim" && t.length === 3) {
|
|
101
|
-
const n = t[1], o = m(t[2]);
|
|
102
|
-
(n === "detail" || n === "groupby") && o && (r = { kind: "dimension", role: n, fieldId: o });
|
|
103
|
-
} else if (t[0] === "metric" && t.length === 3) {
|
|
104
|
-
const n = m(t[1]), o = m(t[2]);
|
|
105
|
-
n && o && (r = { kind: "metric", metricId: n, metricAlias: o });
|
|
106
|
-
} else if (t[0] === "result" && t.length === 2) {
|
|
107
|
-
const n = m(t[1]);
|
|
108
|
-
n && (r = { kind: "result", key: n });
|
|
109
|
-
}
|
|
110
|
-
return r && N(r) === e ? r : void 0;
|
|
111
|
-
}
|
|
112
|
-
function S(e) {
|
|
113
|
-
return typeof e == "string" && U(e) !== void 0;
|
|
114
|
-
}
|
|
115
|
-
const g = s.array(s.string()).max(2e3), j = s.object({
|
|
116
|
-
order: g.optional(),
|
|
117
|
-
hidden: g.optional(),
|
|
118
|
-
labels: s.record(s.string(), s.string().max(E.columnLabelMaxChars)).optional(),
|
|
119
|
-
sort: s.array(
|
|
120
|
-
s.object({
|
|
121
|
-
columnId: s.string(),
|
|
122
|
-
direction: s.enum(["asc", "desc"])
|
|
123
|
-
}).strict()
|
|
124
|
-
).max(2e3).optional()
|
|
125
|
-
}).strict();
|
|
126
|
-
function v(e) {
|
|
127
|
-
const t = /* @__PURE__ */ new Set(), r = [];
|
|
128
|
-
for (const n of e)
|
|
129
|
-
!S(n) || t.has(n) || (t.add(n), r.push(n));
|
|
130
|
-
return r;
|
|
131
|
-
}
|
|
132
|
-
function w(e) {
|
|
133
|
-
if (!e) return;
|
|
134
|
-
const t = e.order ? v(e.order) : void 0, r = e.hidden ? v(e.hidden) : void 0, n = Object.entries(e.labels ?? {}).flatMap(
|
|
135
|
-
([a, c]) => {
|
|
136
|
-
const l = typeof c == "string" ? c.trim() : "";
|
|
137
|
-
return S(a) && l ? [
|
|
138
|
-
[
|
|
139
|
-
a,
|
|
140
|
-
l.slice(0, E.columnLabelMaxChars)
|
|
141
|
-
]
|
|
142
|
-
] : [];
|
|
143
|
-
}
|
|
144
|
-
), o = /* @__PURE__ */ new Set(), d = e.sort ? e.sort.filter((a) => !S(a.columnId) || o.has(a.columnId) ? !1 : (o.add(a.columnId), !0)) : void 0, i = {};
|
|
145
|
-
return t != null && t.length && (i.order = t), r != null && r.length && (i.hidden = r), n.length && (i.labels = Object.fromEntries(n)), d && (i.sort = d.map(({ columnId: a, direction: c }) => ({
|
|
146
|
-
columnId: a,
|
|
147
|
-
direction: c
|
|
148
|
-
}))), Object.keys(i).length ? i : void 0;
|
|
149
|
-
}
|
|
150
|
-
function O(e) {
|
|
151
|
-
return w(e) === void 0;
|
|
152
|
-
}
|
|
153
|
-
function A(e, t) {
|
|
154
|
-
if (t !== V)
|
|
155
|
-
return {
|
|
156
|
-
ok: !1,
|
|
157
|
-
error: `Unsupported table settings version ${t}.`
|
|
158
|
-
};
|
|
159
|
-
const r = j.safeParse(e);
|
|
160
|
-
return r.success ? {
|
|
161
|
-
ok: !0,
|
|
162
|
-
value: w(r.data) ?? {}
|
|
163
|
-
} : { ok: !1, error: "Table settings are invalid." };
|
|
164
|
-
}
|
|
165
|
-
function le(e, t, r) {
|
|
166
|
-
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
167
|
-
const n = {};
|
|
168
|
-
for (const [o, d] of Object.entries(
|
|
169
|
-
e
|
|
170
|
-
)) {
|
|
171
|
-
if (!r.has(o)) continue;
|
|
172
|
-
const i = A(d, t);
|
|
173
|
-
i.ok && !O(i.value) && (n[o] = i.value);
|
|
174
|
-
}
|
|
175
|
-
return n;
|
|
176
|
-
}
|
|
177
|
-
const z = /* @__PURE__ */ new Set([
|
|
178
|
-
"table",
|
|
179
|
-
"detailTable"
|
|
180
|
-
]);
|
|
181
|
-
function D(e) {
|
|
182
|
-
return z.has(e.type);
|
|
183
|
-
}
|
|
184
|
-
function F(e) {
|
|
185
|
-
var t, r;
|
|
186
|
-
return D(e) && ((r = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : r.allowViewerColumnCustomization) !== !1;
|
|
187
|
-
}
|
|
188
|
-
function de(e) {
|
|
189
|
-
return new Set(
|
|
190
|
-
f(e).filter(({ card: t }) => D(t)).map(({ card: t }) => t.id)
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
function ue(e) {
|
|
194
|
-
return new Set(
|
|
195
|
-
f(e).filter(({ card: t }) => F(t)).map(({ card: t }) => t.id)
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
const b = 1, fe = ["PRIVATE", "TEAM", "DASHBOARD"], W = s.object({
|
|
199
|
-
filterId: s.string().min(1),
|
|
200
|
-
name: s.string(),
|
|
201
|
-
operation: s.string(),
|
|
202
|
-
valueType: s.enum(["string", "number", "date", "boolean"]),
|
|
203
|
-
values: s.array(s.unknown())
|
|
204
|
-
}).passthrough().superRefine((e, t) => {
|
|
205
|
-
const r = [];
|
|
206
|
-
x.has(e.operation) ? $(
|
|
207
|
-
e.operation,
|
|
208
|
-
e.values,
|
|
209
|
-
e.valueType,
|
|
210
|
-
"filterValue.values",
|
|
211
|
-
r
|
|
212
|
-
) : r.push("filterValue.operation must be a valid filter operation.");
|
|
213
|
-
for (const n of r) t.addIssue({ code: "custom", message: n });
|
|
214
|
-
}), h = s.unknown().superRefine((e, t) => {
|
|
215
|
-
for (const r of M(e).errors)
|
|
216
|
-
t.addIssue({ code: "custom", message: r.message });
|
|
217
|
-
}), Y = s.discriminatedUnion("kind", [
|
|
218
|
-
s.object({ kind: s.literal("filter"), filterValue: W }).strict(),
|
|
219
|
-
s.object({ kind: s.literal("control"), value: s.unknown() }).strict(),
|
|
220
|
-
s.object({
|
|
221
|
-
kind: s.literal("selection"),
|
|
222
|
-
selection: _
|
|
223
|
-
}).strict()
|
|
224
|
-
]), q = s.union([
|
|
225
|
-
s.object({
|
|
226
|
-
status: s.literal("set"),
|
|
227
|
-
value: Y,
|
|
228
|
-
comparisonSelection: h.optional()
|
|
229
|
-
}).strict(),
|
|
230
|
-
s.object({
|
|
231
|
-
status: s.literal("cleared"),
|
|
232
|
-
comparisonSelection: h.optional()
|
|
233
|
-
}).strict(),
|
|
234
|
-
s.object({ comparisonSelection: h }).strict()
|
|
235
|
-
]), R = ["bySheetId", "byCardId", "byDocumentSectionId"], G = /* @__PURE__ */ new Set(["version", "selectedSheetId", "inputs", "tableSettings"]), H = /* @__PURE__ */ new Set(["shared", ...R]), u = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
236
|
-
function C(e, t, r) {
|
|
237
|
-
if (e === void 0) return;
|
|
238
|
-
if (!u(e)) {
|
|
239
|
-
t.push({ target: "input", id: r });
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
const n = {};
|
|
243
|
-
for (const [o, d] of Object.entries(e)) {
|
|
244
|
-
const i = o ? q.safeParse(d) : void 0;
|
|
245
|
-
i != null && i.success ? n[o] = i.data : t.push({
|
|
246
|
-
target: L(o) ? "selection" : "input",
|
|
247
|
-
id: o
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
return Object.keys(n).length ? n : void 0;
|
|
251
|
-
}
|
|
252
|
-
function J(e, t) {
|
|
253
|
-
if (t !== b)
|
|
254
|
-
return { ok: !1, error: `Unsupported bookmark version ${t}.` };
|
|
255
|
-
if (!u(e) || e.version !== b)
|
|
256
|
-
return { ok: !1, error: "The bookmark state is invalid." };
|
|
257
|
-
const r = [], n = Object.keys(e).filter((a) => !G.has(a));
|
|
258
|
-
let o;
|
|
259
|
-
typeof e.selectedSheetId == "string" && e.selectedSheetId ? o = e.selectedSheetId : e.selectedSheetId !== void 0 && r.push({ target: "sheet", id: String(e.selectedSheetId) });
|
|
260
|
-
const d = {};
|
|
261
|
-
if (u(e.inputs)) {
|
|
262
|
-
n.push(
|
|
263
|
-
...Object.keys(e.inputs).filter((c) => !H.has(c)).map((c) => `inputs.${c}`)
|
|
264
|
-
);
|
|
265
|
-
const a = C(e.inputs.shared, r, "shared");
|
|
266
|
-
a && (d.shared = a);
|
|
267
|
-
for (const c of R) {
|
|
268
|
-
const l = e.inputs[c];
|
|
269
|
-
if (l === void 0) continue;
|
|
270
|
-
if (!u(l)) {
|
|
271
|
-
r.push({ target: "input", id: c });
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
const p = {};
|
|
275
|
-
for (const [I, B] of Object.entries(l)) {
|
|
276
|
-
const k = C(B, r, `${c}.${I}`);
|
|
277
|
-
k && (p[I] = k);
|
|
278
|
-
}
|
|
279
|
-
Object.keys(p).length && (d[c] = p);
|
|
280
|
-
}
|
|
281
|
-
} else e.inputs !== void 0 && n.push("inputs");
|
|
282
|
-
const i = {};
|
|
283
|
-
if (u(e.tableSettings))
|
|
284
|
-
for (const [a, c] of Object.entries(e.tableSettings)) {
|
|
285
|
-
const l = a ? A(c, V) : void 0;
|
|
286
|
-
l != null && l.ok ? O(l.value) || (i[a] = l.value) : r.push({ target: "card", id: a });
|
|
287
|
-
}
|
|
288
|
-
else e.tableSettings !== void 0 && n.push("tableSettings");
|
|
289
|
-
return {
|
|
290
|
-
ok: !0,
|
|
291
|
-
value: {
|
|
292
|
-
version: b,
|
|
293
|
-
...o ? { selectedSheetId: o } : {},
|
|
294
|
-
...Object.keys(d).length ? { inputs: d } : {},
|
|
295
|
-
...Object.keys(i).length ? { tableSettings: i } : {}
|
|
296
|
-
},
|
|
297
|
-
issues: r,
|
|
298
|
-
unknownKeys: n
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
function me(e, t) {
|
|
302
|
-
const r = J(e, t);
|
|
303
|
-
return r.ok ? r.issues.some((n) => n.target === "card") ? { ok: !1, error: "The bookmark table settings are invalid." } : r.issues.length || r.unknownKeys.length ? { ok: !1, error: "The bookmark state is invalid." } : { ok: !0, value: r.value } : r;
|
|
304
|
-
}
|
|
305
|
-
export {
|
|
306
|
-
b as B,
|
|
307
|
-
E as V,
|
|
308
|
-
V as a,
|
|
309
|
-
U as b,
|
|
310
|
-
A as c,
|
|
311
|
-
le as d,
|
|
312
|
-
D as e,
|
|
313
|
-
F as f,
|
|
314
|
-
de as g,
|
|
315
|
-
ue as h,
|
|
316
|
-
O as i,
|
|
317
|
-
fe as j,
|
|
318
|
-
K as k,
|
|
319
|
-
ie as l,
|
|
320
|
-
ce as m,
|
|
321
|
-
w as n,
|
|
322
|
-
ne as o,
|
|
323
|
-
me as p,
|
|
324
|
-
f as q,
|
|
325
|
-
J as r,
|
|
326
|
-
re as s,
|
|
327
|
-
N as t,
|
|
328
|
-
se as u,
|
|
329
|
-
oe as v,
|
|
330
|
-
ae as w
|
|
331
|
-
};
|