react-semaphor 0.1.314 → 0.1.316

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/brand-studio/index.js +65 -65
  2. package/dist/briefings/index.cjs +1 -0
  3. package/dist/briefings/index.js +848 -0
  4. package/dist/chunks/{braces-CWi8x9ww.js → braces-CDPz6CF2.js} +1 -1
  5. package/dist/chunks/{calendar-preferences-dialog-D70CuT-1.js → calendar-preferences-dialog-9NlFzHX8.js} +3 -3
  6. package/dist/chunks/{calendar-preferences-dialog-BzpQ5u4h.js → calendar-preferences-dialog-BDdxi7Xm.js} +1 -1
  7. package/dist/chunks/{chevrons-up-down-B2viXO2I.js → chevrons-up-down-BsdQRmJL.js} +1 -1
  8. package/dist/chunks/dashboard-briefing-launcher-5fM_KJoT.js +7321 -0
  9. package/dist/chunks/dashboard-briefing-launcher-CVxLt10p.js +96 -0
  10. package/dist/chunks/dashboard-controls-9YV-D1tD.js +2009 -0
  11. package/dist/chunks/dashboard-controls-UR_m0wD1.js +57 -0
  12. package/dist/chunks/{dashboard-json-CJCAen1R.js → dashboard-json-CKPID8Am.js} +2 -2
  13. package/dist/chunks/{dashboard-json-v2C6Tmqf.js → dashboard-json-ws4tortP.js} +1 -1
  14. package/dist/chunks/edit-dashboard-visual-CmxnZI8I.js +178 -0
  15. package/dist/chunks/{edit-dashboard-visual-DljWvnMy.js → edit-dashboard-visual-ifKJLMTS.js} +807 -822
  16. package/dist/chunks/index-Xdag_85e.js +1298 -0
  17. package/dist/chunks/{index-P5hPTTzm.js → index-gcA9Rs35.js} +41178 -46390
  18. package/dist/chunks/{palette-CIuwlEiG.js → palette-BlxLchHy.js} +1 -1
  19. package/dist/chunks/{resource-management-panel-CAxXzMdi.js → resource-management-panel-BduJanWW.js} +1 -1
  20. package/dist/chunks/{resource-management-panel-Dk0DzgVm.js → resource-management-panel-paSAzVj2.js} +81 -81
  21. package/dist/chunks/{save-_ALpoMy6.js → save-DVRQBMeb.js} +1 -1
  22. package/dist/chunks/{switch-B6fh8nb-.js → switch-sauemjyY.js} +199 -199
  23. package/dist/chunks/{use-create-flow-overlay-state-Cqf7GaFm.js → use-create-flow-overlay-state-DKV6tIc5.js} +254 -225
  24. package/dist/chunks/use-create-flow-overlay-state-DWnzVVlP.js +26 -0
  25. package/dist/chunks/{use-visual-utils-CQQ3jvDn.js → use-visual-utils-C8PDxg2w.js} +1 -1
  26. package/dist/chunks/{use-visual-utils-CPMQLBYR.js → use-visual-utils-Cs0-baCK.js} +48 -48
  27. package/dist/dashboard/index.cjs +1 -1
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +232 -485
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.cjs +1 -1
  33. package/dist/surfboard/index.js +2 -2
  34. package/dist/types/briefings.d.ts +240 -0
  35. package/dist/types/dashboard.d.ts +1 -0
  36. package/dist/types/main.d.ts +619 -1017
  37. package/dist/types/surfboard.d.ts +1 -0
  38. package/dist/types/types.d.ts +411 -261
  39. package/package.json +7 -2
  40. package/dist/chunks/dashboard-controls-BS_aZcxs.js +0 -57
  41. package/dist/chunks/dashboard-controls-DbKtbw1V.js +0 -2021
  42. package/dist/chunks/dashboard-filter-controls-launcher-C8Wm2Smj.js +0 -1540
  43. package/dist/chunks/dashboard-filter-controls-launcher-CMXpudFJ.js +0 -11
  44. package/dist/chunks/edit-dashboard-visual-lRn3FeaP.js +0 -183
  45. package/dist/chunks/index-XYIIY48z.js +0 -1330
  46. package/dist/chunks/use-create-flow-overlay-state-DMZTflFt.js +0 -16
package/dist/index.js CHANGED
@@ -1,159 +1,159 @@
1
- import { E as j, F as H, S as G, y as q, U as K, z as Y, A as X, B, G as J, H as Z, C as ee, h as ae, I as Q, J as te, i as se, j as re, k as ne, l as oe, K as ie, L as le, u as W, M as de, N as ce, O as ue, P as E, Q as me, T as he } from "./chunks/index-P5hPTTzm.js";
2
- import { av as Oe, ax as ze, aR as Be, aw as je, a8 as Qe, D as We, a6 as Ve, a3 as $e, aX as He, X as Ge, _ as qe, _ as Ke, $ as Ye, a7 as Xe, a as Je, aW as Ze, aC as ea, aS as aa, aE as ta, a5 as sa, a4 as ra, a_ as na, aB as oa, aL as ia, aI as la, aP as da, aJ as ca, aK as ua, aH as ma, aG as ha, aV as pa, aU as fa, aT as ga, aZ as xa, aY as Na, aO as va, aA as ya, aN as Ca, aF as Aa, aD as ba, aM as Sa, aQ as Da, af as Ea, ac as Ta, ao as wa, am as Ra, au as Ia, at as _a, al as Pa, ak as Fa, aj as ka, an as Ma, ay as La, ah as Ua, ai as Oa, ap as za, ar as Ba, a2 as ja, aq as Qa, aa as Wa, a1 as Va, W as $a, a9 as Ha, ab as Ga, Y as qa, az as Ka, ae as Ya, ad as Xa, ag as Ja, V as Za, a0 as et, as as at, Z as tt } from "./chunks/index-P5hPTTzm.js";
3
- import { a as rt, C as nt, D as ot, E as it, P as lt, g as dt, d as ct, h as ut, b as mt, c as ht, i as pt } from "./chunks/common-types-4bjoIgvm.js";
4
- import { C as gt } from "./chunks/calendar-preferences-dialog-D70CuT-1.js";
5
- import { jsx as e, jsxs as r, Fragment as pe } from "react/jsx-runtime";
6
- import { u as L, P as fe, b as ge, B as T, a as _, G as xe, d as Ne, e as ve } from "./chunks/switch-B6fh8nb-.js";
7
- import { a7 as Nt, Y as vt, H as yt, J as Ct, M as At, _ as bt, Z as St, a1 as Dt, a2 as Et, W as Tt, K as wt, V as Rt, $ as It, Q as _t, O as Pt, N as Ft, a3 as kt, a0 as Mt, a4 as Lt, a6 as Ut, a5 as Ot, h as zt, g as Bt, i as jt } from "./chunks/switch-B6fh8nb-.js";
8
- import * as R from "react";
9
- import { useMemo as V, useEffect as F, useState as P, useCallback as M } from "react";
10
- import { ResourceManagementPanel as Wt } from "./chunks/resource-management-panel-Dk0DzgVm.js";
11
- import { DEFAULT_CALENDAR_CONTEXT as $t, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Ht } from "./types/index.js";
12
- import { u as qt } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
1
+ import { E as T, F as S, S as B, p as P, U as _, q as w, r as F, s as x, t as R, v as I, C as M, h as L, I as k, w as U, i as O, j as z, k as V, l as q } from "./chunks/index-gcA9Rs35.js";
2
+ import { T as ua, D as ca, P as fa, M as ma, a7 as pa, z as ha, G as ga, G as Ca, H as Ea, Q as Da, a as xa, a6 as Ta, a2 as ya, O as ba, N as va, aa as Aa, a5 as Na, a4 as Sa, a3 as Ba, a9 as Pa, a8 as _a, $ as wa, Y as Fa, L as Ra, W as Ia, K as Ma, y as La, V as ka, X as Ua, A as Oa, a1 as za, _ as Va, Z as qa, a0 as Ha, x as Wa, J as ja, B as Ga } from "./chunks/index-gcA9Rs35.js";
3
+ import { a as Ka, C as Xa, D as Ya, E as $a, P as Ja, g as Za, d as ae, h as ee, b as se, c as re, i as oe } from "./chunks/common-types-4bjoIgvm.js";
4
+ import { C as ne } from "./chunks/calendar-preferences-dialog-9NlFzHX8.js";
5
+ import { jsx as a, jsxs as d } from "react/jsx-runtime";
6
+ import { u as H, P as W, b as j, B as G, a as C, g as Q, d as K, e as X } from "./chunks/switch-sauemjyY.js";
7
+ import { F as le, q as de, h as ue, i as ce, k as fe, s as me, r as pe, w as he, x as ge, p as Ce, j as Ee, o as De, t as xe, n as Te, m as ye, l as be, y as ve, v as Ae, z as Ne, D as Se, A as Be, E as Pe, H as _e, G as we } from "./chunks/switch-sauemjyY.js";
8
+ import * as m from "react";
9
+ import { useMemo as Y, useEffect as y } from "react";
10
+ import { ResourceManagementPanel as Re } from "./chunks/resource-management-panel-paSAzVj2.js";
11
+ import { DEFAULT_CALENDAR_CONTEXT as Me, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Le } from "./types/index.js";
12
+ import { u as Ue } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
13
13
  import "react-dom";
14
14
  import "./chunks/index-CJdxSyQq.js";
15
- import { A as Yt, D as Xt, d as Jt, e as Zt, c as es, a as as, E as ts, N as ss, U as rs, V as ns, u as os, b as is } from "./chunks/dashboard-filter-controls-launcher-C8Wm2Smj.js";
16
- import { n as ds, s as cs } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
17
- function we(a) {
18
- const { displayPreferences: t, cardId: n, ...o } = a, i = {
19
- ...o,
20
- id: a.dashboardId
15
+ import { A as ze, I as Ve, B as qe, J as He, D as We, d as je, e as Ge, c as Qe, a as Ke, E as Xe, N as Ye, U as $e, V as Je, W as Ze, z as as, F as es, G as ss, C as rs, t as os, h as ts, y as ns, j as is, v as ls, g as ds, w as us, x as cs, o as fs, s as ms, q as ps, f as hs, l as gs, p as Cs, m as Es, r as Ds, k as xs, n as Ts, i as ys, u as bs, b as vs, H as As } from "./chunks/dashboard-briefing-launcher-5fM_KJoT.js";
16
+ import { n as Ss, s as Bs } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
17
+ function oa(e) {
18
+ const { displayPreferences: s, cardId: t, ...l } = e, r = {
19
+ ...l,
20
+ id: e.dashboardId
21
21
  // override the id to the dashboard id so that the dashboard is not loaded
22
22
  };
23
- return /* @__PURE__ */ e(j, { FallbackComponent: H, children: /* @__PURE__ */ r(G, { dashboardProps: i, children: [
24
- /* @__PURE__ */ e(q, { componentType: "visual", componentId: a.cardId }),
25
- /* @__PURE__ */ e(K, { appearance: a.appearance, children: /* @__PURE__ */ e(Y, { displayPreferences: t, children: /* @__PURE__ */ e(X, { type: "visual", cardId: n, ...i, children: /* @__PURE__ */ e(ye, { cardId: n }) }) }) })
23
+ return /* @__PURE__ */ a(T, { FallbackComponent: S, children: /* @__PURE__ */ d(B, { dashboardProps: r, children: [
24
+ /* @__PURE__ */ a(P, { componentType: "visual", componentId: e.cardId }),
25
+ /* @__PURE__ */ a(_, { appearance: e.appearance, children: /* @__PURE__ */ a(w, { displayPreferences: s, children: /* @__PURE__ */ a(F, { type: "visual", cardId: t, ...r, children: /* @__PURE__ */ a($, { cardId: t }) }) }) })
26
26
  ] }) });
27
27
  }
28
- function ye({ cardId: a }) {
29
- const t = L((i) => {
30
- var c;
31
- return (c = i.dashboard) == null ? void 0 : c.sheets;
32
- }), { card: n, frame: o } = V(() => {
33
- const i = t == null ? void 0 : t.flatMap((l) => l.frames), c = i == null ? void 0 : i.flatMap((l) => l == null ? void 0 : l.cards), u = c == null ? void 0 : c.find((l) => (l == null ? void 0 : l.id) === a), s = i == null ? void 0 : i.find(
34
- (l) => {
35
- var m;
36
- return (m = l == null ? void 0 : l.cards) == null ? void 0 : m.find((g) => (g == null ? void 0 : g.id) === a);
28
+ function $({ cardId: e }) {
29
+ const s = H((r) => {
30
+ var n;
31
+ return (n = r.dashboard) == null ? void 0 : n.sheets;
32
+ }), { card: t, frame: l } = Y(() => {
33
+ const r = s == null ? void 0 : s.flatMap((o) => o.frames), n = r == null ? void 0 : r.flatMap((o) => o == null ? void 0 : o.cards), p = n == null ? void 0 : n.find((o) => (o == null ? void 0 : o.id) === e), h = r == null ? void 0 : r.find(
34
+ (o) => {
35
+ var f;
36
+ return (f = o == null ? void 0 : o.cards) == null ? void 0 : f.find((u) => (u == null ? void 0 : u.id) === e);
37
37
  }
38
38
  );
39
- return { card: u, frame: s };
40
- }, [t, a]);
41
- return !n || !o ? /* @__PURE__ */ e(
42
- B,
39
+ return { card: p, frame: h };
40
+ }, [s, e]);
41
+ return !t || !l ? /* @__PURE__ */ a(
42
+ x,
43
43
  {
44
44
  error: new Error("Card not found"),
45
45
  resetErrorBoundary: () => {
46
46
  },
47
- customerFacingMessage: `Card not found with ID: ${a}`
47
+ customerFacingMessage: `Card not found with ID: ${e}`
48
48
  }
49
- ) : /* @__PURE__ */ e("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ e(
50
- j,
49
+ ) : /* @__PURE__ */ a("main", { className: "flex h-full grow flex-col", children: /* @__PURE__ */ a(
50
+ T,
51
51
  {
52
52
  FallbackComponent: ({
53
- error: i,
54
- resetErrorBoundary: c
55
- }) => /* @__PURE__ */ e(
56
- B,
53
+ error: r,
54
+ resetErrorBoundary: n
55
+ }) => /* @__PURE__ */ a(
56
+ x,
57
57
  {
58
- error: i,
59
- resetErrorBoundary: c,
58
+ error: r,
59
+ resetErrorBoundary: n,
60
60
  customerFacingMessage: "Error creating visual. Please try again."
61
61
  }
62
62
  ),
63
- children: /* @__PURE__ */ e(J, { card: n, frame: o })
63
+ children: /* @__PURE__ */ a(R, { card: t, frame: l })
64
64
  }
65
65
  ) });
66
66
  }
67
- function Re(a, t, n, o) {
68
- F(() => {
69
- a && !n && t && o(Z(t));
70
- }, [a, n, t, o]);
67
+ function ta(e, s, t, l) {
68
+ y(() => {
69
+ e && !t && s && l(I(s));
70
+ }, [e, t, s, l]);
71
71
  }
72
- function Ie({
73
- name: a,
74
- items: t,
75
- value: n,
76
- onChange: o,
77
- isLoading: i,
78
- isError: c,
79
- refetch: u,
80
- className: s,
81
- icon: l,
82
- showNone: m = !1
72
+ function na({
73
+ name: e,
74
+ items: s,
75
+ value: t,
76
+ onChange: l,
77
+ isLoading: r,
78
+ isError: n,
79
+ refetch: p,
80
+ className: h,
81
+ icon: o,
82
+ showNone: f = !1
83
83
  }) {
84
- const g = R.useRef(null), [y, x] = R.useState(!1), [C, A] = R.useState("100%"), N = m ? [...t || [], { id: "none", name: "None" }] : t;
85
- R.useLayoutEffect(() => {
86
- g.current && A(g.current.offsetWidth);
84
+ const u = m.useRef(null), [E, D] = m.useState(!1), [b, v] = m.useState("100%"), g = f ? [...s || [], { id: "none", name: "None" }] : s;
85
+ m.useLayoutEffect(() => {
86
+ u.current && v(u.current.offsetWidth);
87
87
  }, []);
88
- function k() {
89
- var h;
90
- return i ? "Loading..." : c ? "Error" : n ? (h = t == null ? void 0 : t.find((v) => v.id === n)) == null ? void 0 : h.name : `Select ${a}`;
88
+ function A() {
89
+ var i;
90
+ return r ? "Loading..." : n ? "Error" : t ? (i = s == null ? void 0 : s.find((c) => c.id === t)) == null ? void 0 : i.name : `Select ${e}`;
91
91
  }
92
- function w(h, v) {
93
- o(v), x(!1);
92
+ function N(i, c) {
93
+ l(c), D(!1);
94
94
  }
95
- return /* @__PURE__ */ r(fe, { open: y, onOpenChange: x, children: [
96
- /* @__PURE__ */ e(ge, { asChild: !0, children: /* @__PURE__ */ r(
97
- T,
95
+ return /* @__PURE__ */ d(W, { open: E, onOpenChange: D, children: [
96
+ /* @__PURE__ */ a(j, { asChild: !0, children: /* @__PURE__ */ d(
97
+ G,
98
98
  {
99
- ref: g,
99
+ ref: u,
100
100
  variant: "outline",
101
101
  role: "combobox",
102
- "aria-expanded": y,
103
- className: _("flex h-9 w-full justify-between", s),
102
+ "aria-expanded": E,
103
+ className: C("flex h-9 w-full justify-between", h),
104
104
  children: [
105
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
106
- l && /* @__PURE__ */ e("div", { className: "mr-2", children: l }),
107
- /* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: k() })
105
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
106
+ o && /* @__PURE__ */ a("div", { className: "mr-2", children: o }),
107
+ /* @__PURE__ */ a("span", { className: "max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap", children: A() })
108
108
  ] }),
109
- /* @__PURE__ */ e(xe, { className: "size-4 opacity-50" })
109
+ /* @__PURE__ */ a(Q, { className: "size-4 opacity-50" })
110
110
  ]
111
111
  }
112
112
  ) }),
113
- /* @__PURE__ */ e(
114
- Ne,
113
+ /* @__PURE__ */ a(
114
+ K,
115
115
  {
116
116
  className: "w-full p-0",
117
- style: { minWidth: C },
118
- children: /* @__PURE__ */ r(ee, { children: [
119
- /* @__PURE__ */ r("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
120
- /* @__PURE__ */ e(ae, { className: "h-9", placeholder: "Search..." }),
121
- /* @__PURE__ */ e(Q, { className: "h-7", onClick: u, children: /* @__PURE__ */ e(
122
- te,
117
+ style: { minWidth: b },
118
+ children: /* @__PURE__ */ d(M, { children: [
119
+ /* @__PURE__ */ d("div", { className: "flex h-9 items-center justify-between border-b pr-1", children: [
120
+ /* @__PURE__ */ a(L, { className: "h-9", placeholder: "Search..." }),
121
+ /* @__PURE__ */ a(k, { className: "h-7", onClick: p, children: /* @__PURE__ */ a(
122
+ U,
123
123
  {
124
- className: _(
124
+ className: C(
125
125
  "size-3.5 opacity-50",
126
- i && "animate-spin"
126
+ r && "animate-spin"
127
127
  )
128
128
  }
129
129
  ) })
130
130
  ] }),
131
- /* @__PURE__ */ r(se, { children: [
132
- /* @__PURE__ */ r(re, { children: [
131
+ /* @__PURE__ */ d(O, { children: [
132
+ /* @__PURE__ */ d(z, { children: [
133
133
  "No ",
134
- a == null ? void 0 : a.toLowerCase(),
134
+ e == null ? void 0 : e.toLowerCase(),
135
135
  " found."
136
136
  ] }),
137
- /* @__PURE__ */ e(ne, { children: N == null ? void 0 : N.map((h) => /* @__PURE__ */ e(
138
- oe,
137
+ /* @__PURE__ */ a(V, { children: g == null ? void 0 : g.map((i) => /* @__PURE__ */ a(
138
+ q,
139
139
  {
140
140
  className: "overflow-x-auto",
141
- value: h.name,
142
- onSelect: (v) => w(v, h.id),
143
- children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
144
- /* @__PURE__ */ e(
145
- ve,
141
+ value: i.name,
142
+ onSelect: (c) => N(c, i.id),
143
+ children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
144
+ /* @__PURE__ */ a(
145
+ X,
146
146
  {
147
- className: _(
147
+ className: C(
148
148
  "size-4",
149
- n === h.id ? "opacity-100" : "opacity-0"
149
+ t === i.id ? "opacity-100" : "opacity-0"
150
150
  )
151
151
  }
152
152
  ),
153
- /* @__PURE__ */ e("div", { title: h.name, children: h.name })
153
+ /* @__PURE__ */ a("div", { title: i.name, children: i.name })
154
154
  ] })
155
155
  },
156
- h.id
156
+ i.id
157
157
  )) })
158
158
  ] })
159
159
  ] })
@@ -161,391 +161,138 @@ function Ie({
161
161
  )
162
162
  ] });
163
163
  }
164
- function _e({
165
- triggerButtonClassName: a,
166
- variant: t = "ghost"
167
- }) {
168
- const [n, o] = P(!1), i = L((u) => {
169
- var s;
170
- return (s = u.dashboard) == null ? void 0 : s.id;
171
- }), c = L((u) => {
172
- var s;
173
- return (s = u.dashboard) == null ? void 0 : s.title;
174
- });
175
- return i ? /* @__PURE__ */ r(pe, { children: [
176
- /* @__PURE__ */ e(
177
- Q,
178
- {
179
- tooltip: "Schedule Dashboard",
180
- className: _("h-7 p-2", a),
181
- buttonProps: { variant: t },
182
- onClick: () => o(!0),
183
- children: /* @__PURE__ */ e(ie, { className: "size-4" })
184
- }
185
- ),
186
- /* @__PURE__ */ e(
187
- le,
188
- {
189
- open: n,
190
- onOpenChange: o,
191
- dashboardId: i,
192
- dashboardName: c
193
- }
194
- )
195
- ] }) : null;
196
- }
197
- function Pe(a) {
198
- const { authToken: t, tokenProps: n } = W();
199
- return de({
200
- mutationFn: async (o) => ce(
201
- n.apiServiceUrl,
202
- t.accessToken,
203
- a,
204
- o
205
- )
206
- });
207
- }
208
- function Fe(a, t) {
209
- F(() => (a && t && (window.__SEMAPHOR_PRINT_STATE__ = {
210
- ...t
164
+ function ia(e, s) {
165
+ y(() => (e && s && (window.__SEMAPHOR_PRINT_STATE__ = {
166
+ ...s
211
167
  }), () => {
212
- a && window.__SEMAPHOR_PRINT_STATE__ && delete window.__SEMAPHOR_PRINT_STATE__;
213
- }), [a, t]);
214
- }
215
- function I(a) {
216
- if (!a) return "--";
217
- const t = new Date(a);
218
- return Number.isNaN(t.getTime()) ? "--" : t.toLocaleString();
219
- }
220
- function Ce(a) {
221
- var t;
222
- return ((t = a.alertState) == null ? void 0 : t.currentState) === "FIRING" ? "Signal surfaced" : a.status === "ACTIVE" ? "Watching" : a.status === "PAUSED" ? "Paused" : a.status;
223
- }
224
- function ke({ alertId: a, onBack: t }) {
225
- var h, v, U, O;
226
- const { authToken: n, tokenProps: o } = W(), { data: i, isLoading: c, refetch: u } = ue(a), s = (i == null ? void 0 : i.alert) ?? null, [l, m] = P([]), [g, y] = P([]), [x, C] = P(null), A = M(async () => {
227
- var f;
228
- const d = o == null ? void 0 : o.apiServiceUrl, p = n == null ? void 0 : n.accessToken;
229
- if (!d || !p || !a) return null;
230
- try {
231
- const S = await fetch(`${d}/v1/alerts/${a}/runs?limit=20`, {
232
- headers: { Authorization: `Bearer ${p}` }
233
- });
234
- if (S.ok) {
235
- const D = await S.json(), b = Array.isArray(D.runs) ? D.runs : [], z = x && b.some(($) => $.id === x) ? x : ((f = b[0]) == null ? void 0 : f.id) ?? null;
236
- return y(b), C(z), z;
237
- }
238
- y([]), C(null);
239
- } catch {
240
- return y([]), C(null), null;
241
- }
242
- return null;
243
- }, [a, n, x, o]), N = M(async (d) => {
244
- const p = o == null ? void 0 : o.apiServiceUrl, f = n == null ? void 0 : n.accessToken, S = d ?? x;
245
- if (!p || !f || !a || !S) {
246
- m([]);
247
- return;
248
- }
249
- try {
250
- const D = await fetch(
251
- `${p}/v1/alerts/${a}/runs/${S}/deliveries`,
252
- {
253
- headers: { Authorization: `Bearer ${f}` }
254
- }
255
- );
256
- if (D.ok) {
257
- const b = await D.json();
258
- m(Array.isArray(b.attempts) ? b.attempts : []);
259
- } else
260
- m([]);
261
- } catch {
262
- m([]);
263
- }
264
- }, [a, n, x, o]), k = M(async () => {
265
- await u();
266
- const d = await A();
267
- await N(d);
268
- }, [N, A, u]);
269
- F(() => {
270
- A().catch(() => {
271
- });
272
- }, [A]), F(() => {
273
- N().catch(() => {
274
- });
275
- }, [N]);
276
- const w = V(() => {
277
- const d = {};
278
- for (const p of l)
279
- d[p.channel] || (d[p.channel] = []), d[p.channel].push(p);
280
- return d;
281
- }, [l]);
282
- return c ? /* @__PURE__ */ e("div", { className: "p-4 text-sm text-muted-foreground", children: "Loading signal detail..." }) : s ? /* @__PURE__ */ r("div", { className: "space-y-4 p-4", children: [
283
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2", children: [
284
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
285
- t && /* @__PURE__ */ e(T, { variant: "outline", size: "sm", onClick: t, children: "Back" }),
286
- /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: s.name }),
287
- /* @__PURE__ */ e(E, { variant: s.status === "ACTIVE" ? "default" : "secondary", children: Ce(s) }),
288
- ((h = s.alertState) == null ? void 0 : h.currentState) && /* @__PURE__ */ e(E, { variant: s.alertState.currentState === "FIRING" ? "destructive" : "outline", children: s.alertState.currentState === "FIRING" ? "Signal surfaced" : "Stable" })
289
- ] }),
290
- /* @__PURE__ */ e(T, { variant: "outline", size: "sm", onClick: () => void k(), children: "Refresh" })
291
- ] }),
292
- s.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: s.description }),
293
- /* @__PURE__ */ r("div", { className: "rounded-md border bg-muted/30 p-4 text-sm", children: [
294
- /* @__PURE__ */ e("p", { className: "font-medium", children: "What changed" }),
295
- /* @__PURE__ */ e("p", { className: "mt-1 text-muted-foreground", children: "Review the latest signal activity, then investigate the underlying dashboard context if you need more detail." })
296
- ] }),
297
- /* @__PURE__ */ r("div", { className: "rounded-md border bg-background p-4 space-y-2", children: [
298
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Signal Watch" }),
299
- /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
300
- /* @__PURE__ */ r("div", { children: [
301
- /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Watching for:" }),
302
- " ",
303
- me(s.jobConfig.operator, s.jobConfig.threshold)
304
- ] }),
305
- /* @__PURE__ */ r("div", { children: [
306
- /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Severity:" }),
307
- " ",
308
- s.jobConfig.severity
309
- ] }),
310
- /* @__PURE__ */ r("div", { children: [
311
- /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Last Evaluated:" }),
312
- " ",
313
- I((v = s.alertState) == null ? void 0 : v.lastEvaluatedAt)
314
- ] }),
315
- /* @__PURE__ */ r("div", { children: [
316
- /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Last Surfaced:" }),
317
- " ",
318
- I((U = s.alertState) == null ? void 0 : U.lastTriggeredAt)
319
- ] })
320
- ] })
321
- ] }),
322
- ((O = s.deliveryConfig) == null ? void 0 : O.channels) && s.deliveryConfig.channels.length > 0 && /* @__PURE__ */ r("div", { className: "rounded-md border bg-background p-4 space-y-2", children: [
323
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Where It Surfaces" }),
324
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: s.deliveryConfig.channels.map((d) => /* @__PURE__ */ e(E, { variant: "outline", children: d }, d)) })
325
- ] }),
326
- g.length > 0 && /* @__PURE__ */ r("div", { className: "rounded-md border bg-background p-4 space-y-3", children: [
327
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Recent Delivery Activity" }),
328
- g.length > 1 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: g.map((d) => /* @__PURE__ */ e(
329
- T,
330
- {
331
- variant: d.id === x ? "default" : "outline",
332
- size: "sm",
333
- onClick: () => C(d.id),
334
- children: I(d.scheduledFor)
335
- },
336
- d.id
337
- )) }),
338
- Object.keys(w).length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No delivery attempts were recorded for this run." }) : Object.entries(w).map(([d, p]) => /* @__PURE__ */ r("div", { className: "space-y-1", children: [
339
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(E, { variant: "secondary", className: "text-xs", children: d }) }),
340
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded border", children: /* @__PURE__ */ r("table", { className: "w-full text-xs", children: [
341
- /* @__PURE__ */ e("thead", { className: "bg-muted/40", children: /* @__PURE__ */ r("tr", { children: [
342
- /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Recipient" }),
343
- /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Status" }),
344
- /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Time" }),
345
- /* @__PURE__ */ e("th", { className: "px-2 py-1 text-left font-medium", children: "Error" })
346
- ] }) }),
347
- /* @__PURE__ */ e("tbody", { children: p.map((f) => /* @__PURE__ */ r("tr", { className: "border-t", children: [
348
- /* @__PURE__ */ e("td", { className: "px-2 py-1", children: f.recipient }),
349
- /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
350
- E,
351
- {
352
- variant: f.status === "SENT" ? "default" : "destructive",
353
- className: "text-[10px]",
354
- children: f.status
355
- }
356
- ) }),
357
- /* @__PURE__ */ e("td", { className: "px-2 py-1", children: I(f.createdAt) }),
358
- /* @__PURE__ */ e("td", { className: "px-2 py-1 text-muted-foreground", children: f.error || "--" })
359
- ] }, f.id)) })
360
- ] }) })
361
- ] }, d))
362
- ] })
363
- ] }) : /* @__PURE__ */ e("div", { className: "p-4 text-sm text-muted-foreground", children: "Signal not found." });
364
- }
365
- function Me() {
366
- var c, u;
367
- const { quotasQuery: a, usageQuery: t } = he(), n = ((c = a.data) == null ? void 0 : c.quotas) || [], o = ((u = t.data) == null ? void 0 : u.usage) || [], i = new Map(o.map((s) => [s.tenantId || "org", s]));
368
- return /* @__PURE__ */ r("div", { className: "space-y-4 p-4", children: [
369
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
370
- /* @__PURE__ */ e("h2", { className: "text-xl font-semibold", children: "Alert Quotas" }),
371
- /* @__PURE__ */ e(
372
- T,
373
- {
374
- variant: "outline",
375
- size: "sm",
376
- onClick: () => {
377
- a.refetch(), t.refetch();
378
- },
379
- children: "Refresh"
380
- }
381
- )
382
- ] }),
383
- a.isLoading || t.isLoading ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Loading quota usage..." }) : null,
384
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-lg border", children: /* @__PURE__ */ r("table", { className: "w-full text-sm", children: [
385
- /* @__PURE__ */ e("thead", { className: "bg-muted/40", children: /* @__PURE__ */ r("tr", { children: [
386
- /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Tenant" }),
387
- /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Active Alerts" }),
388
- /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Max Active" }),
389
- /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Min Cadence" }),
390
- /* @__PURE__ */ e("th", { className: "px-3 py-2 text-left font-medium", children: "Max Context Sources" })
391
- ] }) }),
392
- /* @__PURE__ */ e("tbody", { children: n.map((s) => {
393
- const l = s.tenantId || "org", m = i.get(l);
394
- return /* @__PURE__ */ r("tr", { className: "border-t", children: [
395
- /* @__PURE__ */ e("td", { className: "px-3 py-2", children: l }),
396
- /* @__PURE__ */ e("td", { className: "px-3 py-2", children: (m == null ? void 0 : m.activeAlerts) ?? 0 }),
397
- /* @__PURE__ */ e("td", { className: "px-3 py-2", children: s.policy.maxActiveAlerts }),
398
- /* @__PURE__ */ r("td", { className: "px-3 py-2", children: [
399
- s.policy.minCadenceMinutes,
400
- " min"
401
- ] }),
402
- /* @__PURE__ */ e("td", { className: "px-3 py-2", children: s.policy.maxContextSources })
403
- ] }, l);
404
- }) })
405
- ] }) })
406
- ] });
168
+ e && window.__SEMAPHOR_PRINT_STATE__ && delete window.__SEMAPHOR_PRINT_STATE__;
169
+ }), [e, s]);
407
170
  }
408
171
  export {
409
- Yt as AdvancedModeToggle,
410
- ke as AlertDetailPageEmbedded,
411
- Oe as AlertManagementPage,
412
- ze as AlertWizardDialog,
413
- Be as AlertsApiError,
414
- rt as CALCULATED_FIELD_ENTITY_MARKER,
415
- nt as CONTROL_CARD_DEFAULT_VALUE,
416
- gt as CalendarPreferencesDialog,
417
- je as CardAlertIndicator,
418
- Qe as CardSummary,
419
- Ie as Combobox,
420
- ot as DATE_FORMAT_VALUES,
421
- $t as DEFAULT_CALENDAR_CONTEXT,
422
- Ht as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
423
- We as Dashboard,
424
- Xt as DashboardControlsSettings,
425
- Ve as DashboardExportDialog,
426
- Jt as DashboardFilterControlsButton,
427
- Zt as DashboardFilterControlsLauncher,
428
- $e as DashboardWC,
429
- es as DocumentControlsSettings,
430
- it as EMPTY_SELECTION,
431
- le as EmailScheduleDialog,
432
- He as ExportError,
433
- as as ExportNotificationItem,
434
- ts as ExportNotificationList,
435
- ss as NotificationBell,
436
- lt as PivotMarkerEnum,
437
- Wt as ResourceManagementPanel,
438
- Ge as ResourceType,
439
- _e as ScheduleDashboard,
440
- G as SemaphorContextProvider,
441
- qe as SemaphorDataProvider,
442
- Ke as SemaphorQueryClient,
443
- Ye as ShareDialog,
444
- Xe as SummaryCard,
445
- Je as Surfboard,
446
- Me as TenantQuotaPage,
447
- rs as UnsavedChangesAlert,
448
- we as Visual,
449
- ns as VisualEditingControls,
450
- ce as backtestAlert,
451
- Ze as cancelExport,
452
- Z as cloneDeep,
453
- ea as createAlert,
454
- Nt as createEmptyKpiConfig,
455
- aa as createExport,
456
- vt as createSqlGenConfig,
457
- ta as deleteAlert,
458
- sa as downloadDocumentPdf,
459
- ra as downloadPdf,
460
- yt as emitDashboardLoad,
461
- Ct as emitDashboardUnload,
462
- At as fmt,
463
- na as formatFileSize,
464
- oa as getAlert,
465
- ia as getAlertContextSources,
466
- la as getAlertHistory,
467
- da as getAlertQuotaUsage,
468
- ca as getAlertRunDeliveries,
469
- ua as getAlertRunSteps,
470
- ma as getAlertRuns,
471
- ha as getAlertState,
472
- bt as getColumnDataType,
473
- pa as getDownloadUrl,
474
- fa as getExportStatus,
475
- ga as getExports,
476
- dt as getFieldRuntimeColumnName,
477
- St as getFilterValueType,
478
- Dt as getFormattedTableNameForQuery,
479
- Et as getQualifiedTableName,
480
- Tt as getSql,
481
- ct as hasCalculatedFieldMarker,
482
- ut as hasCalculatedFormulaInputs,
483
- wt as invalidateToken,
484
- Rt as isBooleanDataType,
485
- mt as isCalculatedDimension,
486
- ht as isCalculatedField,
487
- pt as isCalculatedMetric,
488
- It as isColumnInSqlGen,
489
- _t as isDateDataType,
490
- xa as isExportComplete,
491
- Na as isExportInProgress,
492
- Pt as isNumberDataType,
493
- Ft as isTextDataType,
494
- va as listAlertQuotas,
495
- ya as listAlerts,
496
- ds as normalizeDashboardForDirtyCheck,
497
- Ca as previewAlertDeliverable,
498
- kt as resolveDataType,
499
- Mt as resolveDatamodelName,
500
- cs as serializeDashboardForDirtyCheck,
501
- Aa as triggerAlertNow,
502
- ba as updateAlert,
503
- Sa as updateAlertContextSources,
504
- Da as updateAlertQuota,
505
- Ea as useActiveExports,
506
- Ta as useAddNewFrame,
507
- wa as useAlertActions,
508
- Pe as useAlertBacktest,
509
- Ra as useAlertDeliveries,
510
- ue as useAlertDetail,
511
- Ia as useAlertDraft,
512
- _a as useAlertFilters,
513
- Pa as useAlertHistory,
514
- he as useAlertQuotas,
515
- Fa as useAlertRuns,
516
- ka as useAlertState,
517
- Ma as useAlertStore,
518
- La as useAlertWizard,
519
- Ua as useAlerts,
520
- Oa as useAlertsBootstrap,
521
- za as useAlertsById,
522
- Ba as useAlertsForCard,
523
- ja as useCard,
524
- Qa as useCardAlertMap,
525
- Wa as useCardSummary,
526
- Lt as useCurrentActiveCard,
527
- Ut as useCurrentCardConfig,
528
- Ot as useCurrentSheetActiveCards,
529
- zt as useDashboardActions,
530
- Va as useDashboardById,
531
- $a as useDashboardQuery,
532
- L as useDashboardStore,
533
- Ha as useDashboardSummary,
534
- Ga as useDataColumns,
535
- qa as useDateFilterHook,
536
- qt as useDebouncedDirtyCheck,
537
- Bt as useEditorActions,
538
- Ka as useEditorAside,
539
- jt as useEditorStore,
540
- Ya as useExportActions,
541
- os as useExportPolling,
542
- is as useExportRecovery,
543
- Xa as useExportStore,
544
- Fe as useExposePrintState,
545
- Ja as useInProgressExportsCount,
546
- Za as useManagementStore,
547
- Re as usePristineSnapshotInitializer,
548
- et as useResourceManagement,
549
- at as useSelectedAlertId,
550
- tt as useTextFilterHook
172
+ ze as AdvancedModeToggle,
173
+ Ve as BriefingAuthor,
174
+ qe as BriefingsApiError,
175
+ Ka as CALCULATED_FIELD_ENTITY_MARKER,
176
+ Xa as CONTROL_CARD_DEFAULT_VALUE,
177
+ ne as CalendarPreferencesDialog,
178
+ ua as CardSummary,
179
+ na as Combobox,
180
+ Ya as DATE_FORMAT_VALUES,
181
+ Me as DEFAULT_CALENDAR_CONTEXT,
182
+ Le as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
183
+ ca as Dashboard,
184
+ He as DashboardBriefingLauncher,
185
+ We as DashboardControlsSettings,
186
+ fa as DashboardExportDialog,
187
+ je as DashboardFilterControlsButton,
188
+ Ge as DashboardFilterControlsLauncher,
189
+ ma as DashboardWC,
190
+ Qe as DocumentControlsSettings,
191
+ $a as EMPTY_SELECTION,
192
+ pa as ExportError,
193
+ Ke as ExportNotificationItem,
194
+ Xe as ExportNotificationList,
195
+ Ye as NotificationBell,
196
+ Ja as PivotMarkerEnum,
197
+ Re as ResourceManagementPanel,
198
+ ha as ResourceType,
199
+ B as SemaphorContextProvider,
200
+ ga as SemaphorDataProvider,
201
+ Ca as SemaphorQueryClient,
202
+ Ea as ShareDialog,
203
+ Da as SummaryCard,
204
+ xa as Surfboard,
205
+ $e as UnsavedChangesAlert,
206
+ oa as Visual,
207
+ Je as VisualEditingControls,
208
+ Ze as WatchDashboardButton,
209
+ as as applyBriefingFormPatch,
210
+ es as briefingFormDraftToCreateRequest,
211
+ ss as briefingFormDraftToUpdateRequest,
212
+ rs as briefingToFormDraft,
213
+ os as cancelBriefingRun,
214
+ Ta as cancelExport,
215
+ I as cloneDeep,
216
+ ts as createBriefing,
217
+ ns as createBriefingFormDraft,
218
+ le as createEmptyKpiConfig,
219
+ ya as createExport,
220
+ de as createSqlGenConfig,
221
+ is as deleteBriefing,
222
+ ls as deleteBriefingRun,
223
+ ba as downloadDocumentPdf,
224
+ va as downloadPdf,
225
+ ue as emitDashboardLoad,
226
+ ce as emitDashboardUnload,
227
+ fe as fmt,
228
+ Aa as formatFileSize,
229
+ ds as getBriefing,
230
+ us as getBriefingArtifact,
231
+ cs as getBriefingEvidence,
232
+ fs as getBriefingPreviewRun,
233
+ ms as getBriefingRun,
234
+ me as getColumnDataType,
235
+ Na as getDownloadUrl,
236
+ Sa as getExportStatus,
237
+ Ba as getExports,
238
+ Za as getFieldRuntimeColumnName,
239
+ pe as getFilterValueType,
240
+ he as getFormattedTableNameForQuery,
241
+ ge as getQualifiedTableName,
242
+ Ce as getSql,
243
+ ae as hasCalculatedFieldMarker,
244
+ ee as hasCalculatedFormulaInputs,
245
+ Ee as invalidateToken,
246
+ De as isBooleanDataType,
247
+ se as isCalculatedDimension,
248
+ re as isCalculatedField,
249
+ oe as isCalculatedMetric,
250
+ xe as isColumnInSqlGen,
251
+ Te as isDateDataType,
252
+ Pa as isExportComplete,
253
+ _a as isExportInProgress,
254
+ ye as isNumberDataType,
255
+ be as isTextDataType,
256
+ ps as listBriefingRuns,
257
+ hs as listBriefingTenantSummaries,
258
+ gs as listBriefings,
259
+ Ss as normalizeDashboardForDirtyCheck,
260
+ Cs as pauseBriefing,
261
+ Es as previewBriefingPlan,
262
+ ve as resolveDataType,
263
+ Ae as resolveDatamodelName,
264
+ Ds as resumeBriefing,
265
+ xs as runBriefingNow,
266
+ Ts as runBriefingPreview,
267
+ Bs as serializeDashboardForDirtyCheck,
268
+ ys as updateBriefing,
269
+ wa as useActiveExports,
270
+ Fa as useAddNewFrame,
271
+ Ra as useCard,
272
+ Ia as useCardSummary,
273
+ Ne as useCurrentActiveCard,
274
+ Se as useCurrentCardConfig,
275
+ Be as useCurrentSheetActiveCards,
276
+ Pe as useDashboardActions,
277
+ Ma as useDashboardById,
278
+ La as useDashboardQuery,
279
+ H as useDashboardStore,
280
+ ka as useDashboardSummary,
281
+ Ua as useDataColumns,
282
+ Oa as useDateFilterHook,
283
+ Ue as useDebouncedDirtyCheck,
284
+ _e as useEditorActions,
285
+ za as useEditorAside,
286
+ we as useEditorStore,
287
+ Va as useExportActions,
288
+ bs as useExportPolling,
289
+ vs as useExportRecovery,
290
+ qa as useExportStore,
291
+ ia as useExposePrintState,
292
+ Ha as useInProgressExportsCount,
293
+ Wa as useManagementStore,
294
+ ta as usePristineSnapshotInitializer,
295
+ ja as useResourceManagement,
296
+ Ga as useTextFilterHook,
297
+ As as validateBriefingFormDraft
551
298
  };