react-semaphor 0.1.340 → 0.1.342
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.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/chunks/{calendar-preferences-dialog-8-KE5sVX.js → calendar-preferences-dialog-_u4Xm011.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-2IbYrrP1.js → calendar-preferences-dialog-hS6POgEs.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CcqDPVke.js → dashboard-briefing-launcher-D18qNhwa.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DtxDRAiu.js → dashboard-briefing-launcher-DHzIiaKF.js} +3 -3
- package/dist/chunks/{dashboard-controls-By7aKmDj.js → dashboard-controls-CilLVS_Q.js} +1 -1
- package/dist/chunks/{dashboard-controls-Bi98DhYD.js → dashboard-controls-g1OcteYf.js} +3 -3
- package/dist/chunks/{dashboard-json-CGxIsTEP.js → dashboard-json-BjnGSaxC.js} +1 -1
- package/dist/chunks/{dashboard-json-BOyLuhS6.js → dashboard-json-ClH0kTga.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BuXlHmJH.js → edit-dashboard-visual-C_3NYnPz.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-Ba8LenNc.js → edit-dashboard-visual-DbVMVMKM.js} +3 -3
- package/dist/chunks/{index-DT9osgRT.js → index-BNZjkxPH.js} +3 -3
- package/dist/chunks/{index-DVPvpd8u.js → index-CuSvSh86.js} +7 -6
- package/dist/chunks/{resource-management-panel-98Hy6SYB.js → resource-management-panel-DxjN2uw4.js} +2 -2
- package/dist/chunks/{resource-management-panel-ByR-FD3h.js → resource-management-panel-N5iUOE89.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-uNxArZdj.js → use-create-flow-overlay-state-CSjc7cXZ.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-D5uvjbwY.js → use-create-flow-overlay-state-CXPnnXh1.js} +2 -2
- package/dist/chunks/{use-visual-utils-CpaqIHoc.js → use-visual-utils-C3MRLrHu.js} +1 -1
- package/dist/chunks/{use-visual-utils-BLh9mKic.js → use-visual-utils-DsoGoqPF.js} +1 -1
- package/dist/chunks/{validators-CPEQojnV.js → validators-BqEnmlC6.js} +236 -155
- package/dist/chunks/validators-v8WAqhaN.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +151 -140
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +18 -2
- package/dist/types/dashboard-authoring.d.ts +10 -1
- package/dist/types/dashboard.d.ts +2 -0
- package/dist/types/data-app-builder.d.ts +9 -1
- package/dist/types/data-app-sdk.d.ts +16 -5
- package/dist/types/main.d.ts +11 -1
- package/dist/types/shared.d.ts +1 -0
- package/dist/types/surfboard.d.ts +2 -0
- package/dist/types/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/validators-CfP-49k9.js +0 -1
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { e as b, f as
|
|
2
|
-
import { j as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { jsx as
|
|
5
|
-
function
|
|
1
|
+
import { e as b, f as $, v as q } from "../chunks/validators-BqEnmlC6.js";
|
|
2
|
+
import { j as O } from "../chunks/index-CuHybtft.js";
|
|
3
|
+
import { createContext as T, useContext as _, useMemo as p, useState as R, useCallback as h, useRef as x, useEffect as K } from "react";
|
|
4
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
5
|
+
function C(t) {
|
|
6
6
|
var n;
|
|
7
|
-
const e =
|
|
7
|
+
const e = F(t);
|
|
8
8
|
return {
|
|
9
9
|
version: 1,
|
|
10
10
|
kind: "metric",
|
|
11
11
|
id: t.id,
|
|
12
12
|
label: t.label,
|
|
13
|
-
source:
|
|
13
|
+
source: A(t),
|
|
14
14
|
metrics: e,
|
|
15
|
-
primaryMetric:
|
|
16
|
-
dateField: t.dateField ?
|
|
15
|
+
primaryMetric: U(t, e),
|
|
16
|
+
dateField: t.dateField ? s(t.dateField, "date") : void 0,
|
|
17
17
|
timeGrain: t.timeGrain,
|
|
18
|
-
dimensions: (n = t.dimensions) == null ? void 0 : n.map((o) =>
|
|
19
|
-
comparison:
|
|
20
|
-
|
|
18
|
+
dimensions: (n = t.dimensions) == null ? void 0 : n.map((o) => s(o, "dimension")),
|
|
19
|
+
comparison: W(t.comparison),
|
|
20
|
+
orderBy: t.orderBy ? {
|
|
21
|
+
field: s(t.orderBy.field),
|
|
22
|
+
direction: t.orderBy.direction
|
|
23
|
+
} : void 0,
|
|
24
|
+
inputs: D(t.inputs),
|
|
21
25
|
limit: t.limit
|
|
22
26
|
};
|
|
23
27
|
}
|
|
24
|
-
function
|
|
28
|
+
function U(t, e) {
|
|
25
29
|
if (!t.primaryMetric)
|
|
26
30
|
return e[0] || { name: "", role: "measure" };
|
|
27
|
-
const n =
|
|
31
|
+
const n = s(t.primaryMetric, "measure"), o = n.source ? e.find((r) => b(r, n)) : (() => {
|
|
28
32
|
const r = e.filter(
|
|
29
33
|
(i) => i.name === n.name
|
|
30
34
|
);
|
|
31
35
|
return r.length === 1 ? r[0] : void 0;
|
|
32
36
|
})();
|
|
33
|
-
return o ?
|
|
37
|
+
return o ? M(n, o) : n;
|
|
34
38
|
}
|
|
35
|
-
function
|
|
39
|
+
function F(t) {
|
|
36
40
|
const e = [];
|
|
37
|
-
for (const n of t.metrics.map((o) =>
|
|
41
|
+
for (const n of t.metrics.map((o) => s(o, "measure"))) {
|
|
38
42
|
if (!n.name)
|
|
39
43
|
continue;
|
|
40
44
|
const o = e.findIndex(
|
|
@@ -44,43 +48,50 @@ function U(t) {
|
|
|
44
48
|
e.push(n);
|
|
45
49
|
continue;
|
|
46
50
|
}
|
|
47
|
-
e[o] =
|
|
48
|
-
e[o],
|
|
49
|
-
n
|
|
50
|
-
);
|
|
51
|
+
e[o] = M(e[o], n);
|
|
51
52
|
}
|
|
52
53
|
return e;
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function M(t, e) {
|
|
56
|
+
if (t.aggregate && e.aggregate && t.aggregate !== e.aggregate)
|
|
57
|
+
throw new Error(
|
|
58
|
+
`Metric "${t.name}" was requested with conflicting aggregate semantics: ${t.aggregate} and ${e.aggregate}.`
|
|
59
|
+
);
|
|
60
|
+
return {
|
|
61
|
+
...$(t, e),
|
|
62
|
+
aggregate: t.aggregate || e.aggregate
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function z(t) {
|
|
55
66
|
if ("sort" in t)
|
|
56
67
|
throw new Error(
|
|
57
68
|
"useSemaphorRecords supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet."
|
|
58
69
|
);
|
|
59
|
-
if (!
|
|
70
|
+
if (!H(t))
|
|
60
71
|
throw new Error(
|
|
61
72
|
"useSemaphorRecords needs at least one field."
|
|
62
73
|
);
|
|
63
|
-
const e =
|
|
74
|
+
const e = V(t.fields);
|
|
64
75
|
return {
|
|
65
76
|
version: 1,
|
|
66
77
|
kind: "records",
|
|
67
78
|
id: t.id,
|
|
68
79
|
label: t.label,
|
|
69
|
-
source:
|
|
80
|
+
source: A(t),
|
|
70
81
|
fields: e,
|
|
71
|
-
dateField: t.dateField ?
|
|
82
|
+
dateField: t.dateField ? s(t.dateField, "date") : void 0,
|
|
72
83
|
timeGrain: t.timeGrain,
|
|
73
84
|
orderBy: t.orderBy ? {
|
|
74
|
-
field:
|
|
85
|
+
field: s(t.orderBy.field),
|
|
75
86
|
direction: t.orderBy.direction
|
|
76
87
|
} : void 0,
|
|
77
|
-
inputs:
|
|
88
|
+
inputs: D(t.inputs),
|
|
78
89
|
limit: t.limit
|
|
79
90
|
};
|
|
80
91
|
}
|
|
81
|
-
function
|
|
92
|
+
function V(t) {
|
|
82
93
|
return t.map((e) => {
|
|
83
|
-
const n =
|
|
94
|
+
const n = s(e);
|
|
84
95
|
if (!n.role)
|
|
85
96
|
throw new Error(
|
|
86
97
|
`useSemaphorRecords field "${n.name}" needs an explicit role.`
|
|
@@ -88,19 +99,19 @@ function z(t) {
|
|
|
88
99
|
return n;
|
|
89
100
|
});
|
|
90
101
|
}
|
|
91
|
-
function
|
|
102
|
+
function j(t) {
|
|
92
103
|
return {
|
|
93
104
|
version: 1,
|
|
94
105
|
kind: "inputOptions",
|
|
95
106
|
id: t.id,
|
|
96
107
|
label: t.label,
|
|
97
|
-
source:
|
|
98
|
-
field:
|
|
108
|
+
source: A(t),
|
|
109
|
+
field: s(t.field, "dimension"),
|
|
99
110
|
search: t.search,
|
|
100
111
|
limit: t.limit
|
|
101
112
|
};
|
|
102
113
|
}
|
|
103
|
-
function
|
|
114
|
+
function N(t) {
|
|
104
115
|
if ("toAnalyticsInput" in t) {
|
|
105
116
|
const e = t.toAnalyticsInput();
|
|
106
117
|
return {
|
|
@@ -113,22 +124,22 @@ function j(t) {
|
|
|
113
124
|
...t.field ? { field: t.field } : {}
|
|
114
125
|
};
|
|
115
126
|
}
|
|
116
|
-
function
|
|
117
|
-
const e =
|
|
127
|
+
function ft(t) {
|
|
128
|
+
const e = D(t);
|
|
118
129
|
return e.length > 0 ? e : void 0;
|
|
119
130
|
}
|
|
120
|
-
function
|
|
121
|
-
return (t || []).map(
|
|
131
|
+
function L(t) {
|
|
132
|
+
return (t || []).map(J);
|
|
122
133
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
134
|
+
function w(t) {
|
|
135
|
+
return L(t).filter((e) => e.isActive);
|
|
125
136
|
}
|
|
126
|
-
function
|
|
137
|
+
function Q(t) {
|
|
127
138
|
return t.kind === "filter" ? {
|
|
128
139
|
inputId: t.id,
|
|
129
140
|
kind: t.kind,
|
|
130
141
|
label: t.label,
|
|
131
|
-
field:
|
|
142
|
+
field: s(t.field, "dimension"),
|
|
132
143
|
operator: t.operator || "in"
|
|
133
144
|
} : {
|
|
134
145
|
inputId: t.id,
|
|
@@ -136,7 +147,7 @@ function L(t) {
|
|
|
136
147
|
label: t.label
|
|
137
148
|
};
|
|
138
149
|
}
|
|
139
|
-
function
|
|
150
|
+
function G(t = []) {
|
|
140
151
|
return t.map(
|
|
141
152
|
(e) => typeof e == "object" ? e : {
|
|
142
153
|
label: String(e),
|
|
@@ -144,40 +155,40 @@ function Q(t = []) {
|
|
|
144
155
|
}
|
|
145
156
|
);
|
|
146
157
|
}
|
|
147
|
-
function
|
|
158
|
+
function I(t) {
|
|
148
159
|
return t == null ? !1 : Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : !0;
|
|
149
160
|
}
|
|
150
|
-
function
|
|
161
|
+
function J(t) {
|
|
151
162
|
return "toAnalyticsInput" in t ? t.toAnalyticsInput() : "kind" in t && "isActive" in t ? t : {
|
|
152
163
|
...t,
|
|
153
164
|
kind: "filter",
|
|
154
|
-
isActive:
|
|
165
|
+
isActive: I(
|
|
155
166
|
t.value
|
|
156
167
|
),
|
|
157
168
|
value: t.value
|
|
158
169
|
};
|
|
159
170
|
}
|
|
160
|
-
function
|
|
171
|
+
function A(t) {
|
|
161
172
|
return t.source;
|
|
162
173
|
}
|
|
163
|
-
function
|
|
174
|
+
function H(t) {
|
|
164
175
|
var e;
|
|
165
176
|
return !!((e = t.fields) != null && e.length);
|
|
166
177
|
}
|
|
167
|
-
function
|
|
178
|
+
function s(t, e) {
|
|
168
179
|
return {
|
|
169
180
|
...t,
|
|
170
181
|
role: t.role || e
|
|
171
182
|
};
|
|
172
183
|
}
|
|
173
|
-
function
|
|
174
|
-
return (t || []).map(
|
|
184
|
+
function D(t) {
|
|
185
|
+
return (t || []).map(N);
|
|
175
186
|
}
|
|
176
|
-
function
|
|
187
|
+
function W(t) {
|
|
177
188
|
if (t)
|
|
178
189
|
return t;
|
|
179
190
|
}
|
|
180
|
-
function
|
|
191
|
+
function X() {
|
|
181
192
|
return {
|
|
182
193
|
executeMetric: (t, e) => v(t, e),
|
|
183
194
|
executeRecords: (t, e) => v(t, e),
|
|
@@ -187,7 +198,7 @@ function W() {
|
|
|
187
198
|
async function v(t, e) {
|
|
188
199
|
if (!e.token)
|
|
189
200
|
throw new Error("SemaphorDataAppProvider needs a token to execute queries.");
|
|
190
|
-
const n = await fetch(
|
|
201
|
+
const n = await fetch(tt(e), {
|
|
191
202
|
method: "POST",
|
|
192
203
|
headers: {
|
|
193
204
|
"Content-Type": "application/json",
|
|
@@ -198,14 +209,14 @@ async function v(t, e) {
|
|
|
198
209
|
activeInputs: e.activeInputs,
|
|
199
210
|
resultShape: t.kind
|
|
200
211
|
})
|
|
201
|
-
}), o = await
|
|
212
|
+
}), o = await Y(n);
|
|
202
213
|
if (!n.ok || o.error)
|
|
203
214
|
throw new Error(
|
|
204
215
|
o.error || `Semaphor Data App execution failed with status ${n.status}.`
|
|
205
216
|
);
|
|
206
217
|
return o;
|
|
207
218
|
}
|
|
208
|
-
async function
|
|
219
|
+
async function Y(t) {
|
|
209
220
|
const e = await t.text().catch(() => "");
|
|
210
221
|
if (!e.trim())
|
|
211
222
|
return t.ok ? {
|
|
@@ -218,46 +229,46 @@ async function X(t) {
|
|
|
218
229
|
error: "Semaphor Data App execution returned invalid JSON.",
|
|
219
230
|
details: e
|
|
220
231
|
} : {
|
|
221
|
-
error:
|
|
232
|
+
error: Z(t, e),
|
|
222
233
|
details: e
|
|
223
234
|
};
|
|
224
235
|
}
|
|
225
236
|
}
|
|
226
|
-
function
|
|
237
|
+
function Z(t, e) {
|
|
227
238
|
const n = t.statusText ? ` ${t.statusText}` : "", o = e.replace(/\s+/g, " ").trim();
|
|
228
239
|
return o ? `Semaphor Data App execution failed with status ${t.status}${n}: ${o.slice(0, 240)}` : `Semaphor Data App execution failed with status ${t.status}${n}.`;
|
|
229
240
|
}
|
|
230
|
-
function
|
|
231
|
-
const e =
|
|
241
|
+
function tt(t) {
|
|
242
|
+
const e = et(t).replace(/\/+$/, "");
|
|
232
243
|
return e ? e.endsWith("/api") ? `${e}/v1/data-app/execute` : `${e}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
233
244
|
}
|
|
234
|
-
function
|
|
245
|
+
function et(t) {
|
|
235
246
|
if (t.apiBaseUrl)
|
|
236
247
|
return t.apiBaseUrl;
|
|
237
248
|
if (!t.token)
|
|
238
249
|
return "";
|
|
239
250
|
try {
|
|
240
|
-
return
|
|
251
|
+
return O(t.token).apiServiceUrl || "";
|
|
241
252
|
} catch {
|
|
242
253
|
return "";
|
|
243
254
|
}
|
|
244
255
|
}
|
|
245
|
-
const
|
|
246
|
-
function
|
|
256
|
+
const B = T({});
|
|
257
|
+
function rt() {
|
|
247
258
|
if (!(typeof window > "u"))
|
|
248
259
|
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
249
260
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
261
|
+
function nt() {
|
|
262
|
+
return _(B);
|
|
252
263
|
}
|
|
253
|
-
function
|
|
264
|
+
function pt({
|
|
254
265
|
token: t,
|
|
255
266
|
apiBaseUrl: e,
|
|
256
267
|
executor: n,
|
|
257
268
|
children: o
|
|
258
269
|
}) {
|
|
259
|
-
var
|
|
260
|
-
const r =
|
|
270
|
+
var l;
|
|
271
|
+
const r = rt(), i = ((l = r == null ? void 0 : r.authToken) == null ? void 0 : l.accessToken) || t, a = (r == null ? void 0 : r.dataApiBaseUrl) || (r == null ? void 0 : r.apiBaseUrl) || e, m = p(() => X(), []), u = n || m, c = p(
|
|
261
272
|
() => ({
|
|
262
273
|
token: i,
|
|
263
274
|
apiBaseUrl: a,
|
|
@@ -265,49 +276,49 @@ function ft({
|
|
|
265
276
|
}),
|
|
266
277
|
[a, u, i]
|
|
267
278
|
);
|
|
268
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ P(B.Provider, { value: c, children: o });
|
|
269
280
|
}
|
|
270
|
-
const
|
|
271
|
-
function
|
|
272
|
-
const e =
|
|
281
|
+
const g = { value: null }, ot = { records: [] }, S = { options: [] };
|
|
282
|
+
function it(t) {
|
|
283
|
+
const e = w(t.inputs);
|
|
273
284
|
try {
|
|
274
|
-
const n =
|
|
285
|
+
const n = C(t), o = k(n);
|
|
275
286
|
return o ? {
|
|
276
287
|
error: o,
|
|
277
288
|
activeInputs: e,
|
|
278
|
-
queryKey:
|
|
279
|
-
idleData:
|
|
289
|
+
queryKey: d(void 0, e, o),
|
|
290
|
+
idleData: g
|
|
280
291
|
} : {
|
|
281
292
|
intent: n,
|
|
282
293
|
error: null,
|
|
283
294
|
activeInputs: e,
|
|
284
|
-
queryKey:
|
|
285
|
-
idleData:
|
|
295
|
+
queryKey: d(n, e),
|
|
296
|
+
idleData: g
|
|
286
297
|
};
|
|
287
298
|
} catch (n) {
|
|
288
299
|
const o = y(n);
|
|
289
300
|
return {
|
|
290
301
|
error: o,
|
|
291
302
|
activeInputs: e,
|
|
292
|
-
queryKey:
|
|
293
|
-
idleData:
|
|
303
|
+
queryKey: d(void 0, e, o),
|
|
304
|
+
idleData: g
|
|
294
305
|
};
|
|
295
306
|
}
|
|
296
307
|
}
|
|
297
|
-
function
|
|
298
|
-
const e =
|
|
308
|
+
function at(t) {
|
|
309
|
+
const e = w(t.inputs), n = ot;
|
|
299
310
|
try {
|
|
300
|
-
const o =
|
|
311
|
+
const o = z(t), r = k(o);
|
|
301
312
|
return r ? {
|
|
302
313
|
error: r,
|
|
303
314
|
activeInputs: e,
|
|
304
|
-
queryKey:
|
|
315
|
+
queryKey: d(void 0, e, r),
|
|
305
316
|
idleData: n
|
|
306
317
|
} : {
|
|
307
318
|
intent: o,
|
|
308
319
|
error: null,
|
|
309
320
|
activeInputs: e,
|
|
310
|
-
queryKey:
|
|
321
|
+
queryKey: d(o, e),
|
|
311
322
|
idleData: n
|
|
312
323
|
};
|
|
313
324
|
} catch (o) {
|
|
@@ -315,38 +326,38 @@ function it(t) {
|
|
|
315
326
|
return {
|
|
316
327
|
error: r,
|
|
317
328
|
activeInputs: e,
|
|
318
|
-
queryKey:
|
|
329
|
+
queryKey: d(void 0, e, r),
|
|
319
330
|
idleData: n
|
|
320
331
|
};
|
|
321
332
|
}
|
|
322
333
|
}
|
|
323
|
-
function
|
|
334
|
+
function ut(t) {
|
|
324
335
|
try {
|
|
325
|
-
const e =
|
|
336
|
+
const e = j(t), n = k(e);
|
|
326
337
|
return n ? {
|
|
327
338
|
error: n,
|
|
328
|
-
queryKey:
|
|
329
|
-
idleData:
|
|
339
|
+
queryKey: d(void 0, void 0, n),
|
|
340
|
+
idleData: S
|
|
330
341
|
} : {
|
|
331
342
|
intent: e,
|
|
332
343
|
error: null,
|
|
333
|
-
queryKey:
|
|
334
|
-
idleData:
|
|
344
|
+
queryKey: d(e),
|
|
345
|
+
idleData: S
|
|
335
346
|
};
|
|
336
347
|
} catch (e) {
|
|
337
348
|
const n = y(e);
|
|
338
349
|
return {
|
|
339
350
|
error: n,
|
|
340
|
-
queryKey:
|
|
341
|
-
idleData:
|
|
351
|
+
queryKey: d(void 0, void 0, n),
|
|
352
|
+
idleData: S
|
|
342
353
|
};
|
|
343
354
|
}
|
|
344
355
|
}
|
|
345
356
|
function y(t) {
|
|
346
357
|
return t instanceof Error ? t : new Error(String(t));
|
|
347
358
|
}
|
|
348
|
-
function
|
|
349
|
-
const e =
|
|
359
|
+
function k(t) {
|
|
360
|
+
const e = q(t);
|
|
350
361
|
if (e.ok)
|
|
351
362
|
return null;
|
|
352
363
|
const n = e.errors.map(
|
|
@@ -354,27 +365,27 @@ function x(t) {
|
|
|
354
365
|
).join("; ");
|
|
355
366
|
return new Error(`Invalid Semaphor analytics intent. ${n}`);
|
|
356
367
|
}
|
|
357
|
-
function
|
|
368
|
+
function d(t, e, n) {
|
|
358
369
|
return JSON.stringify({
|
|
359
370
|
intent: t,
|
|
360
371
|
activeInputs: e,
|
|
361
372
|
error: n == null ? void 0 : n.message
|
|
362
373
|
});
|
|
363
374
|
}
|
|
364
|
-
function
|
|
365
|
-
const [e, n] =
|
|
366
|
-
() =>
|
|
375
|
+
function mt(t) {
|
|
376
|
+
const [e, n] = R(t.defaultValue), o = Object.prototype.hasOwnProperty.call(t, "value"), r = o ? t.value : e, i = p(
|
|
377
|
+
() => G(t.options),
|
|
367
378
|
[t.options]
|
|
368
379
|
), a = h(
|
|
369
380
|
(u) => {
|
|
370
|
-
var
|
|
381
|
+
var l;
|
|
371
382
|
const c = u;
|
|
372
|
-
(
|
|
383
|
+
(l = t.onValueChange) == null || l.call(t, c), o || n(c);
|
|
373
384
|
},
|
|
374
385
|
[o, t]
|
|
375
386
|
), m = h(() => a(void 0), [a]);
|
|
376
387
|
return p(() => {
|
|
377
|
-
const u =
|
|
388
|
+
const u = Q(t);
|
|
378
389
|
return {
|
|
379
390
|
id: t.id,
|
|
380
391
|
kind: t.kind,
|
|
@@ -384,7 +395,7 @@ function pt(t) {
|
|
|
384
395
|
controlRole: t.kind === "control" ? t.role : void 0,
|
|
385
396
|
value: r,
|
|
386
397
|
options: i,
|
|
387
|
-
isActive:
|
|
398
|
+
isActive: I(r),
|
|
388
399
|
setValue: a,
|
|
389
400
|
clear: m,
|
|
390
401
|
toAnalyticsInput: () => ({
|
|
@@ -393,21 +404,21 @@ function pt(t) {
|
|
|
393
404
|
kind: t.kind,
|
|
394
405
|
label: t.label,
|
|
395
406
|
value: r,
|
|
396
|
-
isActive:
|
|
407
|
+
isActive: I(r),
|
|
397
408
|
operator: u.operator,
|
|
398
409
|
controlRole: t.kind === "control" ? t.role : void 0
|
|
399
410
|
})
|
|
400
411
|
};
|
|
401
412
|
}, [m, i, a, t, r]);
|
|
402
413
|
}
|
|
403
|
-
function
|
|
404
|
-
const e = p(() =>
|
|
414
|
+
function ht(t) {
|
|
415
|
+
const e = p(() => it(t), [t]), n = h(
|
|
405
416
|
(i) => {
|
|
406
417
|
var a;
|
|
407
418
|
return e.intent ? (a = i.executor) == null ? void 0 : a.executeMetric(e.intent, i) : void 0;
|
|
408
419
|
},
|
|
409
420
|
[e.intent]
|
|
410
|
-
), o =
|
|
421
|
+
), o = E(
|
|
411
422
|
e.queryKey,
|
|
412
423
|
n,
|
|
413
424
|
e.idleData,
|
|
@@ -427,14 +438,14 @@ function mt(t) {
|
|
|
427
438
|
error: e.error || o.error
|
|
428
439
|
};
|
|
429
440
|
}
|
|
430
|
-
function
|
|
431
|
-
const e = p(() =>
|
|
441
|
+
function yt(t) {
|
|
442
|
+
const e = p(() => at(t), [t]), n = h(
|
|
432
443
|
(i) => {
|
|
433
444
|
var a;
|
|
434
445
|
return e.intent ? (a = i.executor) == null ? void 0 : a.executeRecords(e.intent, i) : void 0;
|
|
435
446
|
},
|
|
436
447
|
[e.intent]
|
|
437
|
-
), o =
|
|
448
|
+
), o = E(
|
|
438
449
|
e.queryKey,
|
|
439
450
|
n,
|
|
440
451
|
e.idleData,
|
|
@@ -451,14 +462,14 @@ function ht(t) {
|
|
|
451
462
|
error: e.error || o.error
|
|
452
463
|
};
|
|
453
464
|
}
|
|
454
|
-
function
|
|
455
|
-
const e = p(() =>
|
|
465
|
+
function vt(t) {
|
|
466
|
+
const e = p(() => ut(t), [t]), n = h(
|
|
456
467
|
(i) => {
|
|
457
468
|
var a;
|
|
458
469
|
return e.intent ? (a = i.executor) == null ? void 0 : a.executeInputOptions(e.intent, i) : void 0;
|
|
459
470
|
},
|
|
460
471
|
[e.intent]
|
|
461
|
-
), o =
|
|
472
|
+
), o = E(
|
|
462
473
|
e.queryKey,
|
|
463
474
|
n,
|
|
464
475
|
e.idleData
|
|
@@ -472,13 +483,13 @@ function yt(t) {
|
|
|
472
483
|
error: e.error || o.error
|
|
473
484
|
};
|
|
474
485
|
}
|
|
475
|
-
function
|
|
476
|
-
const r =
|
|
486
|
+
function E(t, e, n, o) {
|
|
487
|
+
const r = nt(), i = x(e), a = x(o), [m, u] = R({
|
|
477
488
|
status: "idle",
|
|
478
489
|
data: n,
|
|
479
490
|
error: null
|
|
480
491
|
});
|
|
481
|
-
return i.current = e, a.current = o,
|
|
492
|
+
return i.current = e, a.current = o, K(() => {
|
|
482
493
|
let c;
|
|
483
494
|
try {
|
|
484
495
|
c = i.current({
|
|
@@ -497,42 +508,42 @@ function g(t, e, n, o) {
|
|
|
497
508
|
u({ status: "idle", data: n, error: null });
|
|
498
509
|
return;
|
|
499
510
|
}
|
|
500
|
-
let
|
|
511
|
+
let l = !1;
|
|
501
512
|
return u((f) => ({
|
|
502
513
|
status: "loading",
|
|
503
514
|
data: f.data,
|
|
504
515
|
error: null
|
|
505
516
|
})), c.then((f) => {
|
|
506
|
-
|
|
517
|
+
l || u({ status: "success", data: f, error: null });
|
|
507
518
|
}).catch((f) => {
|
|
508
|
-
|
|
519
|
+
l || u({
|
|
509
520
|
status: "error",
|
|
510
521
|
data: n,
|
|
511
522
|
error: y(f)
|
|
512
523
|
});
|
|
513
524
|
}), () => {
|
|
514
|
-
|
|
525
|
+
l = !0;
|
|
515
526
|
};
|
|
516
527
|
}, [n, t, r]), m;
|
|
517
528
|
}
|
|
518
529
|
export {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
530
|
+
B as SemaphorDataAppContext,
|
|
531
|
+
pt as SemaphorDataAppProvider,
|
|
532
|
+
X as createSemaphorDataAppExecutor,
|
|
533
|
+
I as hasSemaphorInputValue,
|
|
534
|
+
G as normalizeSemaphorInputOptions,
|
|
535
|
+
rt as readWindowRuntime,
|
|
536
|
+
w as toSemaphorActiveInputSnapshots,
|
|
537
|
+
N as toSemaphorInputBinding,
|
|
538
|
+
ft as toSemaphorInputBindings,
|
|
539
|
+
j as toSemaphorInputOptionsIntent,
|
|
540
|
+
L as toSemaphorInputSnapshots,
|
|
541
|
+
Q as toSemaphorInputSpec,
|
|
542
|
+
C as toSemaphorMetricIntent,
|
|
543
|
+
z as toSemaphorRecordsIntent,
|
|
544
|
+
nt as useSemaphorDataAppRuntime,
|
|
545
|
+
mt as useSemaphorInput,
|
|
546
|
+
vt as useSemaphorInputOptions,
|
|
547
|
+
ht as useSemaphorMetric,
|
|
548
|
+
yt as useSemaphorRecords
|
|
538
549
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-DT9osgRT.js"),d=require("./chunks/common-types-C73-Ud1-.js"),P=require("./chunks/calendar-preferences-dialog-8-KE5sVX.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch-DYRgERrC.js"),C=require("react"),N=require("./chunks/resource-management-panel-ByR-FD3h.js"),y=require("./types/index.cjs"),_=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const r=require("./chunks/dashboard-briefing-launcher-CcqDPVke.js"),S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js");require("./chunks/index-BxM99sFL.js");function R(o){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const n in o)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(i,n,u.get?u:{enumerable:!0,get:()=>o[n]})}}return i.default=o,Object.freeze(i)}const h=R(C);function j(o){const{displayPreferences:i,cardId:n,...u}=o,s={...u,id:o.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:o.cardId}),t.jsx(e.UXProvider,{appearance:o.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:i,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(w,{cardId:n})})})})]})})}function w({cardId:o}){const i=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=i==null?void 0:i.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===o),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===o)});return{card:D,frame:E}},[i,o]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${o}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function M(o,i,n,u){C.useEffect(()=>{o&&!n&&i&&u(e.cloneDeep(i))},[o,n,i,u])}function L({name:o,items:i,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...i||[],{id:"none",name:"None"}]:i;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function F(){var f;return s?"Loading...":c?"Error":n?(f=i==null?void 0:i.find(m=>m.id===n))==null?void 0:f.name:`Select ${o}`}function v(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:F()})]}),t.jsx(a.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:D,children:t.jsx(e.RefreshCw,{className:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",o==null?void 0:o.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>v(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(o,i){C.useEffect(()=>(o&&i&&(window.__SEMAPHOR_PRINT_STATE__={...i}),()=>{o&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[o,i])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=P.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.ResourceManagementPanel=N.ResourceManagementPanel;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.useDebouncedDirtyCheck=_.useDebouncedDirtyCheck;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=L;exports.Visual=j;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=M;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BNZjkxPH.js"),d=require("./chunks/common-types-C73-Ud1-.js"),P=require("./chunks/calendar-preferences-dialog-_u4Xm011.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch-DYRgERrC.js"),C=require("react"),N=require("./chunks/resource-management-panel-N5iUOE89.js"),y=require("./types/index.cjs"),_=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const r=require("./chunks/dashboard-briefing-launcher-D18qNhwa.js"),S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js");require("./chunks/index-BxM99sFL.js");function R(o){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const n in o)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(i,n,u.get?u:{enumerable:!0,get:()=>o[n]})}}return i.default=o,Object.freeze(i)}const h=R(C);function j(o){const{displayPreferences:i,cardId:n,...u}=o,s={...u,id:o.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:o.cardId}),t.jsx(e.UXProvider,{appearance:o.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:i,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(w,{cardId:n})})})})]})})}function w({cardId:o}){const i=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=i==null?void 0:i.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===o),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===o)});return{card:D,frame:E}},[i,o]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${o}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function M(o,i,n,u){C.useEffect(()=>{o&&!n&&i&&u(e.cloneDeep(i))},[o,n,i,u])}function L({name:o,items:i,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...i||[],{id:"none",name:"None"}]:i;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function F(){var f;return s?"Loading...":c?"Error":n?(f=i==null?void 0:i.find(m=>m.id===n))==null?void 0:f.name:`Select ${o}`}function v(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:F()})]}),t.jsx(a.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:D,children:t.jsx(e.RefreshCw,{className:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",o==null?void 0:o.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>v(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(o,i){C.useEffect(()=>(o&&i&&(window.__SEMAPHOR_PRINT_STATE__={...i}),()=>{o&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[o,i])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=P.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.ResourceManagementPanel=N.ResourceManagementPanel;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.useDebouncedDirtyCheck=_.useDebouncedDirtyCheck;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=L;exports.Visual=j;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=M;
|