ahs-cti 0.0.1

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 (60) hide show
  1. package/LICENSE +53 -0
  2. package/LICENSE-ACHALA +80 -0
  3. package/README.md +639 -0
  4. package/dist/agentDetailReport-7TDO6MYQ.mjs +11 -0
  5. package/dist/agentDetailReport-7TDO6MYQ.mjs.map +1 -0
  6. package/dist/agentPerformanceReport-R3WY7Q7D.mjs +531 -0
  7. package/dist/agentPerformanceReport-R3WY7Q7D.mjs.map +1 -0
  8. package/dist/auditReport-CJ23LXIZ.mjs +15 -0
  9. package/dist/auditReport-CJ23LXIZ.mjs.map +1 -0
  10. package/dist/callHistory-743J7EKD.mjs +783 -0
  11. package/dist/callHistory-743J7EKD.mjs.map +1 -0
  12. package/dist/campaigns-N2RLUJHH.mjs +3005 -0
  13. package/dist/campaigns-N2RLUJHH.mjs.map +1 -0
  14. package/dist/caroQualityAuditDashboard-NRWY6SEC.mjs +66 -0
  15. package/dist/caroQualityAuditDashboard-NRWY6SEC.mjs.map +1 -0
  16. package/dist/caroVoiceAI-Z5BDDDSY.mjs +21 -0
  17. package/dist/caroVoiceAI-Z5BDDDSY.mjs.map +1 -0
  18. package/dist/cdrReport-577UYGZA.mjs +798 -0
  19. package/dist/cdrReport-577UYGZA.mjs.map +1 -0
  20. package/dist/chunk-6ICPXSN6.mjs +61 -0
  21. package/dist/chunk-6ICPXSN6.mjs.map +1 -0
  22. package/dist/chunk-BU6FMNBY.mjs +82 -0
  23. package/dist/chunk-BU6FMNBY.mjs.map +1 -0
  24. package/dist/chunk-DBSNJ3QH.mjs +1060 -0
  25. package/dist/chunk-DBSNJ3QH.mjs.map +1 -0
  26. package/dist/chunk-EJIWPC3H.mjs +747 -0
  27. package/dist/chunk-EJIWPC3H.mjs.map +1 -0
  28. package/dist/chunk-GTDWTI5S.mjs +17217 -0
  29. package/dist/chunk-GTDWTI5S.mjs.map +1 -0
  30. package/dist/chunk-L4LLUMYA.mjs +57 -0
  31. package/dist/chunk-L4LLUMYA.mjs.map +1 -0
  32. package/dist/chunk-NQL4VODC.mjs +180 -0
  33. package/dist/chunk-NQL4VODC.mjs.map +1 -0
  34. package/dist/chunk-NUYGQI7D.mjs +678 -0
  35. package/dist/chunk-NUYGQI7D.mjs.map +1 -0
  36. package/dist/chunk-RZZQ42MG.mjs +115 -0
  37. package/dist/chunk-RZZQ42MG.mjs.map +1 -0
  38. package/dist/chunk-UB5HSUGK.mjs +65 -0
  39. package/dist/chunk-UB5HSUGK.mjs.map +1 -0
  40. package/dist/chunk-VGVOMFYH.mjs +5781 -0
  41. package/dist/chunk-VGVOMFYH.mjs.map +1 -0
  42. package/dist/chunk-VZCHJLAW.mjs +61 -0
  43. package/dist/chunk-VZCHJLAW.mjs.map +1 -0
  44. package/dist/incoming-4WP3FJI4.mp3 +0 -0
  45. package/dist/incoming.mp3 +0 -0
  46. package/dist/index.d.mts +2476 -0
  47. package/dist/index.d.ts +2477 -0
  48. package/dist/index.js +41208 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/index.mjs +4641 -0
  51. package/dist/index.mjs.map +1 -0
  52. package/dist/liveStatus-IQIEZZE5.mjs +1077 -0
  53. package/dist/liveStatus-IQIEZZE5.mjs.map +1 -0
  54. package/dist/loginReport-H6XJU2MY.mjs +826 -0
  55. package/dist/loginReport-H6XJU2MY.mjs.map +1 -0
  56. package/dist/managementDashboard-NZMAJPPB.mjs +527 -0
  57. package/dist/managementDashboard-NZMAJPPB.mjs.map +1 -0
  58. package/dist/qualityAuditDashboard-ZJEEAMBS.mjs +66 -0
  59. package/dist/qualityAuditDashboard-ZJEEAMBS.mjs.map +1 -0
  60. package/package.json +114 -0
@@ -0,0 +1,1077 @@
1
+ import {
2
+ useCallMonitoring
3
+ } from "./chunk-BU6FMNBY.mjs";
4
+ import {
5
+ SDKPermissionGuard
6
+ } from "./chunk-NQL4VODC.mjs";
7
+ import {
8
+ SDKProvider,
9
+ useToast
10
+ } from "./chunk-6ICPXSN6.mjs";
11
+ import {
12
+ END_POINT,
13
+ SDK_PERMISSIONS,
14
+ axios_default
15
+ } from "./chunk-DBSNJ3QH.mjs";
16
+ import {
17
+ __spreadProps,
18
+ __spreadValues
19
+ } from "./chunk-UB5HSUGK.mjs";
20
+
21
+ // call-control-sdk/lib/pages/liveStatus/index.tsx
22
+ import React, { useCallback as useCallback2, useState as useState2, useEffect as useEffect2 } from "react";
23
+ import { Box as Box2, CircularProgress } from "@mui/material";
24
+
25
+ // call-control-sdk/lib/pages/liveStatus/useLiveStatus.ts
26
+ import { useCallback, useEffect, useRef, useState } from "react";
27
+ var POLL_INTERVAL_MS = 5e3;
28
+ var LONG_CALL_SECS = 420;
29
+ var WAITING_THRESHOLD = 3;
30
+ function parseDur(dur) {
31
+ const p = (dur || "00:00:00").split(":").map(Number);
32
+ return (p[0] || 0) * 3600 + (p[1] || 0) * 60 + (p[2] || 0);
33
+ }
34
+ function fmtDur(s) {
35
+ const h = Math.floor(s / 3600);
36
+ const m = Math.floor(s % 3600 / 60);
37
+ const sc = s % 60;
38
+ return [h, m, sc].map((x) => String(x).padStart(2, "0")).join(":");
39
+ }
40
+ var STATUS_PRIORITY = {
41
+ "s-oncall-in": 0,
42
+ "s-oncall-out": 1,
43
+ "s-break": 2,
44
+ "s-wrapup": 3,
45
+ "s-idle": 4
46
+ };
47
+ function getAgentStatusKey(status, callDirection) {
48
+ const lower = (status || "").toLowerCase();
49
+ if (lower.includes("idle") || lower.includes("ready") || lower.includes("available")) return "s-idle";
50
+ if (lower.includes("break") || lower.includes("pause")) return "s-break";
51
+ if (lower.includes("wrap") || lower.includes("acw")) return "s-wrapup";
52
+ if (lower.includes("outbound") || lower.includes("outgoing") || lower.includes("dialing")) return "s-oncall-out";
53
+ if (lower.includes("call") || lower.includes("busy") || lower.includes("oncall") || lower.includes("on-call") || lower.includes("on_call") || lower.includes("incoming") || lower.includes("ringing") || lower.includes("connected")) {
54
+ return callDirection === "OUTBOUND" ? "s-oncall-out" : "s-oncall-in";
55
+ }
56
+ return "s-idle";
57
+ }
58
+ function getSortedAgents(list) {
59
+ return [...list].sort(
60
+ (a, b) => {
61
+ var _a, _b;
62
+ return ((_a = STATUS_PRIORITY[getAgentStatusKey(a.status, a.callDirection)]) != null ? _a : 9) - ((_b = STATUS_PRIORITY[getAgentStatusKey(b.status, b.callDirection)]) != null ? _b : 9);
63
+ }
64
+ );
65
+ }
66
+ async function fetchTopStats() {
67
+ const res = await axios_default.get(END_POINT.DASHBOARD_TOP_STATS);
68
+ return res.data;
69
+ }
70
+ async function fetchAgents() {
71
+ const res = await axios_default.get(END_POINT.DASHBOARD_AGENTS);
72
+ return res.data;
73
+ }
74
+ async function fetchQueues() {
75
+ const res = await axios_default.get(END_POINT.DASHBOARD_QUEUES);
76
+ return res.data;
77
+ }
78
+ async function fetchAlerts() {
79
+ const res = await axios_default.get(END_POINT.DASHBOARD_ALERTS);
80
+ return res.data;
81
+ }
82
+ async function fetchQueuePulse() {
83
+ const res = await axios_default.get(END_POINT.DASHBOARD_QUEUE_PULSE);
84
+ return res.data;
85
+ }
86
+ function useLiveStatus() {
87
+ const [isLoading, setIsLoading] = useState(true);
88
+ const [topStats, setTopStats] = useState(null);
89
+ const [agents, setAgents] = useState([]);
90
+ const [queues, setQueues] = useState([]);
91
+ const [alerts, setAlerts] = useState([]);
92
+ const [queuePulse, setQueuePulse] = useState(null);
93
+ const [durations, setDurations] = useState({});
94
+ const [clockStr, setClockStr] = useState("--:--:--");
95
+ const [dateStr, setDateStr] = useState("");
96
+ const agentsRef = useRef(agents);
97
+ agentsRef.current = agents;
98
+ const fetchDashboard = useCallback(async () => {
99
+ var _a;
100
+ try {
101
+ const [topStatsRes, agentsRes, queuesRes, alertsRes, pulseRes] = await Promise.allSettled([
102
+ fetchTopStats(),
103
+ fetchAgents(),
104
+ fetchQueues(),
105
+ fetchAlerts(),
106
+ fetchQueuePulse()
107
+ ]);
108
+ if (topStatsRes.status === "fulfilled" && topStatsRes.value) setTopStats(topStatsRes.value);
109
+ if (agentsRes.status === "fulfilled" && ((_a = agentsRes.value) == null ? void 0 : _a.length)) {
110
+ setAgents(agentsRes.value);
111
+ const m = {};
112
+ agentsRes.value.forEach((a) => {
113
+ m[a.agentId] = parseDur(a.statusDuration || "00:00:00");
114
+ });
115
+ setDurations(m);
116
+ }
117
+ if (queuesRes.status === "fulfilled" && queuesRes.value) setQueues(queuesRes.value);
118
+ if (alertsRes.status === "fulfilled" && alertsRes.value) setAlerts(alertsRes.value);
119
+ if (pulseRes.status === "fulfilled" && pulseRes.value) setQueuePulse(pulseRes.value);
120
+ } catch (e) {
121
+ } finally {
122
+ setIsLoading(false);
123
+ }
124
+ }, []);
125
+ useEffect(() => {
126
+ fetchDashboard();
127
+ const iv = setInterval(fetchDashboard, POLL_INTERVAL_MS);
128
+ return () => clearInterval(iv);
129
+ }, [fetchDashboard]);
130
+ useEffect(() => {
131
+ const iv = setInterval(() => {
132
+ const now = /* @__PURE__ */ new Date();
133
+ setClockStr(
134
+ [now.getHours(), now.getMinutes(), now.getSeconds()].map((v) => String(v).padStart(2, "0")).join(":")
135
+ );
136
+ setDateStr(
137
+ now.toLocaleDateString("en-US", {
138
+ weekday: "long",
139
+ year: "numeric",
140
+ month: "long",
141
+ day: "numeric"
142
+ })
143
+ );
144
+ setDurations((prev) => {
145
+ const next = __spreadValues({}, prev);
146
+ for (const key of Object.keys(next)) next[key] = next[key] + 1;
147
+ return next;
148
+ });
149
+ }, 1e3);
150
+ return () => clearInterval(iv);
151
+ }, []);
152
+ return {
153
+ isLoading,
154
+ topStats,
155
+ agents,
156
+ queues,
157
+ alerts,
158
+ queuePulse,
159
+ durations,
160
+ clockStr,
161
+ dateStr,
162
+ refresh: fetchDashboard
163
+ };
164
+ }
165
+
166
+ // call-control-sdk/lib/pages/liveStatus/styles.ts
167
+ import { Box, styled } from "@mui/material";
168
+ import { keyframes } from "@mui/material/styles";
169
+ var pulse = keyframes`
170
+ 0%, 100% { transform: scale(1); opacity: 1; }
171
+ 50% { transform: scale(1.6); opacity: 0.3; }
172
+ `;
173
+ var slideUp = keyframes`
174
+ from { transform: translateY(16px); opacity: 0; }
175
+ to { transform: translateY(0); opacity: 1; }
176
+ `;
177
+ var flashBg = keyframes`
178
+ 0%, 100% { background: #fdf3e0; }
179
+ 50% { background: #fff7e0; }
180
+ `;
181
+ var rowBlink = keyframes`
182
+ 0%, 100% { background: rgba(204,42,42,.07); }
183
+ 50% { background: rgba(204,42,42,.2); }
184
+ `;
185
+ var ticker = keyframes`
186
+ 0% { transform: translateX(0); }
187
+ 100% { transform: translateX(-50%); }
188
+ `;
189
+ var C = {
190
+ bg0: "#eef2f7",
191
+ bg1: "#ffffff",
192
+ bg2: "#f4f7fb",
193
+ bg3: "#e4eaf3",
194
+ bg4: "#d5dfee",
195
+ b1: "rgba(30,60,120,.08)",
196
+ b2: "rgba(30,60,120,.14)",
197
+ t1: "#0d1e35",
198
+ t2: "#3a5278",
199
+ t3: "#7a93b5",
200
+ t4: "#b0c0d5",
201
+ green: "#0a9a62",
202
+ greenLt: "#e4f6ef",
203
+ greenBd: "rgba(10,154,98,.2)",
204
+ amber: "#c47c00",
205
+ amberLt: "#fdf3e0",
206
+ amberBd: "rgba(196,124,0,.2)",
207
+ blue: "#1565c8",
208
+ blueLt: "#e8f0fc",
209
+ blueBd: "rgba(21,101,200,.2)",
210
+ red: "#cc2a2a",
211
+ redLt: "#fde8e8",
212
+ redBd: "rgba(204,42,42,.2)",
213
+ purple: "#6b3fbf",
214
+ purpleLt: "#f0eafa",
215
+ purpleBd: "rgba(107,63,191,.2)",
216
+ teal: "#0b7a8f",
217
+ tealLt: "#e3f4f7",
218
+ tealBd: "rgba(11,122,143,.2)",
219
+ orange: "#c45a00",
220
+ orangeLt: "#fdf0e4",
221
+ navy: "#1A5F6C"
222
+ };
223
+ var STATUS_COLORS = {
224
+ "s-oncall-in": { bg: "#fff8e1", border: "rgba(196,124,0,.3)", bar: "#e68a00", text: "#b36b00" },
225
+ "s-oncall-out": { bg: "#e3f2fd", border: "rgba(21,101,200,.3)", bar: "#1976d2", text: "#0d47a1" },
226
+ "s-wrapup": { bg: "#f3e5f5", border: "rgba(107,63,191,.3)", bar: "#8e24aa", text: "#6a1b9a" },
227
+ "s-break": { bg: "#ffebee", border: "rgba(204,42,42,.3)", bar: "#e53935", text: "#c62828" },
228
+ "s-idle": { bg: "#e8f5e9", border: "rgba(46,125,50,.25)", bar: "#2e7d32", text: "#1b5e20" }
229
+ };
230
+ var WallboardRoot = styled(Box, {
231
+ shouldForwardProp: (prop) => prop !== "isTv"
232
+ })(({ theme, isTv }) => ({
233
+ display: "grid",
234
+ gridTemplateRows: "auto auto 1fr auto",
235
+ minHeight: isTv ? "100vh" : "calc(100vh - 60px)",
236
+ height: isTv ? "100vh" : "calc(100vh - 60px)",
237
+ fontFamily: "'Poppins', Arial, sans-serif",
238
+ background: "transparent",
239
+ color: C.t1,
240
+ [theme.breakpoints.up("lg")]: {
241
+ height: isTv ? "100vh" : "calc(100vh - 60px)",
242
+ overflow: "hidden"
243
+ }
244
+ }));
245
+ var TopBar = styled(Box)(({ theme }) => ({
246
+ background: C.navy,
247
+ display: "flex",
248
+ alignItems: "center",
249
+ justifyContent: "space-between",
250
+ padding: "0 10px",
251
+ height: 34,
252
+ minHeight: 34,
253
+ borderBottom: `1px solid ${C.blue}`,
254
+ flexWrap: "wrap",
255
+ gap: 4,
256
+ [theme.breakpoints.up("sm")]: { padding: "0 14px", flexWrap: "nowrap" }
257
+ }));
258
+ var BrandLogo = styled(Box)({
259
+ width: 22,
260
+ height: 22,
261
+ borderRadius: 4,
262
+ background: "#fff",
263
+ display: "flex",
264
+ alignItems: "center",
265
+ justifyContent: "center",
266
+ overflow: "hidden"
267
+ });
268
+ var LiveBadge = styled(Box)({
269
+ display: "flex",
270
+ alignItems: "center",
271
+ gap: 4,
272
+ background: "rgba(10,154,98,.2)",
273
+ border: "1px solid rgba(10,154,98,.4)",
274
+ borderRadius: 12,
275
+ padding: "2px 7px",
276
+ fontSize: 8,
277
+ fontWeight: 700,
278
+ letterSpacing: 1.5,
279
+ color: "#0ef5a8",
280
+ textTransform: "uppercase"
281
+ });
282
+ var PulseDot = styled("span")({
283
+ width: 5,
284
+ height: 5,
285
+ borderRadius: "50%",
286
+ background: "#0ef5a8",
287
+ display: "inline-block",
288
+ animation: `${pulse} 1.5s ease infinite`
289
+ });
290
+ var KpiStrip = styled(Box)(({ theme }) => ({
291
+ display: "grid",
292
+ gridTemplateColumns: "repeat(auto-fit, minmax(72px, 1fr))",
293
+ background: "transparent",
294
+ borderBottom: `1px solid ${C.b1}`,
295
+ [theme.breakpoints.up("xl")]: {
296
+ gridTemplateColumns: "repeat(14, 1fr)"
297
+ }
298
+ }));
299
+ var KpiCell = styled(Box)(({ accentColor }) => ({
300
+ padding: "4px 0 3px 8px",
301
+ borderRight: `1px solid ${C.b1}`,
302
+ borderBottom: `1px solid ${C.b1}`,
303
+ position: "relative",
304
+ cursor: "default",
305
+ "&:last-child": { borderRight: "none" },
306
+ "&::after": {
307
+ content: '""',
308
+ position: "absolute",
309
+ bottom: 0,
310
+ left: 0,
311
+ width: "100%",
312
+ height: 2,
313
+ background: accentColor
314
+ },
315
+ "@media (min-width: 960px)": { padding: "5px 0 4px 6px" }
316
+ }));
317
+ var KpiValue = styled("div")(({ kcolor, theme }) => ({
318
+ fontFamily: "'Poppins', Arial, sans-serif",
319
+ fontSize: 15,
320
+ fontWeight: 800,
321
+ lineHeight: 1,
322
+ color: kcolor,
323
+ [theme.breakpoints.up("md")]: { fontSize: 17 },
324
+ [theme.breakpoints.up("lg")]: { fontSize: 20 }
325
+ }));
326
+ var KpiLabel = styled("div")({
327
+ fontSize: 8,
328
+ letterSpacing: 0.8,
329
+ textTransform: "uppercase",
330
+ color: C.t3,
331
+ fontWeight: 600,
332
+ marginTop: 1
333
+ });
334
+ var BodyGrid = styled(Box)(({ theme }) => ({
335
+ display: "grid",
336
+ gridTemplateColumns: "1fr",
337
+ marginTop: 0,
338
+ overflow: "auto",
339
+ minHeight: 0,
340
+ [theme.breakpoints.up("md")]: { gridTemplateColumns: "2fr 1fr" },
341
+ [theme.breakpoints.up("lg")]: { gridTemplateColumns: "2fr 1fr", overflow: "hidden" }
342
+ }));
343
+ var Panel = styled(Box)(({ theme }) => ({
344
+ display: "flex",
345
+ flexDirection: "column",
346
+ overflow: "auto",
347
+ minHeight: 0,
348
+ borderRight: `1px solid ${C.b1}`,
349
+ [theme.breakpoints.up("lg")]: { overflow: "hidden" }
350
+ }));
351
+ var PanelHeader = styled(Box)({
352
+ display: "flex",
353
+ alignItems: "center",
354
+ justifyContent: "space-between",
355
+ padding: "4px 10px",
356
+ background: "transparent",
357
+ borderBottom: `1px solid ${C.b1}`,
358
+ flexShrink: 0
359
+ });
360
+ var PhTitle = styled("span")({
361
+ fontFamily: "'Poppins', Arial, sans-serif",
362
+ fontSize: 10,
363
+ fontWeight: 700,
364
+ letterSpacing: 1.2,
365
+ textTransform: "uppercase",
366
+ color: C.t2
367
+ });
368
+ var Badge = styled("span")(({ bg, color, border }) => ({
369
+ fontFamily: "'JetBrains Mono', monospace",
370
+ fontSize: 9,
371
+ fontWeight: 700,
372
+ padding: "1px 6px",
373
+ borderRadius: 3,
374
+ letterSpacing: 0.2,
375
+ background: bg,
376
+ color,
377
+ border: `1px solid ${border}`
378
+ }));
379
+ var StatusDot = styled("span")(({ dotColor, animated }) => __spreadValues({
380
+ width: 5,
381
+ height: 5,
382
+ borderRadius: "50%",
383
+ flexShrink: 0,
384
+ background: dotColor
385
+ }, animated ? { animation: `${pulse} 1.3s ease infinite` } : {}));
386
+ var AgentTable = styled("table")({
387
+ width: "100%",
388
+ borderCollapse: "collapse",
389
+ tableLayout: "auto"
390
+ });
391
+ var AgTh = styled("th")({
392
+ padding: "4px 8px",
393
+ fontSize: 8,
394
+ letterSpacing: 0.8,
395
+ textTransform: "uppercase",
396
+ color: C.t3,
397
+ fontWeight: 600,
398
+ textAlign: "left",
399
+ borderBottom: `1px solid ${C.b2}`,
400
+ background: C.bg2,
401
+ whiteSpace: "nowrap",
402
+ position: "sticky",
403
+ top: 0,
404
+ zIndex: 1
405
+ });
406
+ var AgTd = styled("td")({
407
+ padding: "4px 8px",
408
+ fontSize: 11,
409
+ borderBottom: `1px solid ${C.b1}`,
410
+ verticalAlign: "middle"
411
+ });
412
+ var PageInfo = styled(Box)({
413
+ display: "flex",
414
+ alignItems: "center",
415
+ justifyContent: "space-between",
416
+ padding: "2px 10px",
417
+ fontSize: 8,
418
+ color: C.t3,
419
+ background: C.bg2,
420
+ flexShrink: 0,
421
+ borderTop: `1px solid ${C.b1}`
422
+ });
423
+ var QName = styled("span")({
424
+ fontWeight: 600,
425
+ color: C.t1,
426
+ fontFamily: "'Poppins', Arial, sans-serif",
427
+ fontSize: 11,
428
+ "@media (min-width: 1280px)": { fontSize: 12 }
429
+ });
430
+ var QNum = styled("span")(({ numColor }) => ({
431
+ fontFamily: "'JetBrains Mono', monospace",
432
+ fontWeight: 700,
433
+ fontSize: 11,
434
+ color: numColor || C.t1
435
+ }));
436
+ var QBar = styled(Box)({ height: 4, background: C.bg3, borderRadius: 2, overflow: "hidden", width: 56 });
437
+ var QBarFill = styled(Box)(({ w, barColor }) => ({
438
+ height: "100%",
439
+ borderRadius: 3,
440
+ width: `${w}%`,
441
+ background: barColor
442
+ }));
443
+ var SbHeader = styled(Box)({
444
+ padding: "7px 12px",
445
+ display: "flex",
446
+ alignItems: "center",
447
+ justifyContent: "space-between",
448
+ background: C.bg2,
449
+ borderBottom: `1px solid ${C.b1}`
450
+ });
451
+ var SbTitle = styled("span")({
452
+ fontSize: 9,
453
+ fontWeight: 700,
454
+ letterSpacing: 1.5,
455
+ textTransform: "uppercase",
456
+ color: C.t3
457
+ });
458
+ var NoDataBox = styled(Box)({
459
+ display: "flex",
460
+ alignItems: "center",
461
+ justifyContent: "center",
462
+ padding: "12px 8px",
463
+ fontSize: 10,
464
+ fontWeight: 600,
465
+ color: C.t3,
466
+ letterSpacing: 0.5,
467
+ fontFamily: "'Poppins', Arial, sans-serif"
468
+ });
469
+ var Footer = styled(Box)({
470
+ background: C.navy,
471
+ borderTop: "1px solid rgba(255,255,255,.08)",
472
+ display: "flex",
473
+ alignItems: "center",
474
+ overflow: "hidden",
475
+ minHeight: 18,
476
+ height: 18,
477
+ position: "sticky",
478
+ bottom: 0,
479
+ zIndex: 5
480
+ });
481
+ var TickerLabel = styled("div")({
482
+ flexShrink: 0,
483
+ padding: "0 8px",
484
+ fontSize: 7,
485
+ fontWeight: 700,
486
+ letterSpacing: 1.2,
487
+ textTransform: "uppercase",
488
+ color: "rgba(255,255,255,.4)",
489
+ borderRight: "1px solid rgba(255,255,255,.1)",
490
+ whiteSpace: "nowrap"
491
+ });
492
+ var TickerTrack = styled(Box)({ flex: 1, overflow: "hidden", position: "relative" });
493
+ var TickerInner = styled(Box)({
494
+ display: "flex",
495
+ animation: `${ticker} 50s linear infinite`,
496
+ whiteSpace: "nowrap"
497
+ });
498
+ var TickerSpan = styled("span")(({ isWarn, isGood }) => ({
499
+ fontSize: 9,
500
+ color: "rgba(255,255,255,.55)",
501
+ padding: "0 16px",
502
+ letterSpacing: 0.3,
503
+ "& b": {
504
+ color: isWarn ? "#fcd34d" : isGood ? "#6ee7b7" : "rgba(255,255,255,.85)",
505
+ fontWeight: 600
506
+ }
507
+ }));
508
+ var MonitorBtn = styled("button")(({ variant }) => {
509
+ const colors = {
510
+ listen: { bg: "#e3f2fd", color: "#1976d2", hoverBg: "#bbdefb" },
511
+ whisper: { bg: "#fff3e0", color: "#ef6c00", hoverBg: "#ffe0b2" },
512
+ barge: { bg: "#fce4ec", color: "#c2185b", hoverBg: "#f8bbd0" },
513
+ stop: { bg: "#ffebee", color: "#c62828", hoverBg: "#ffcdd2" }
514
+ };
515
+ const c = colors[variant];
516
+ return {
517
+ padding: "2px 5px",
518
+ border: "none",
519
+ borderRadius: 3,
520
+ cursor: "pointer",
521
+ fontSize: 8,
522
+ fontWeight: 600,
523
+ display: "flex",
524
+ alignItems: "center",
525
+ gap: 2,
526
+ background: c.bg,
527
+ color: c.color,
528
+ transition: "all 0.2s",
529
+ "&:hover": { background: c.hoverBg },
530
+ "&:disabled": { opacity: 0.5, cursor: "not-allowed" }
531
+ };
532
+ });
533
+ var MonitorCard = styled(Box)({
534
+ position: "fixed",
535
+ bottom: 20,
536
+ right: 20,
537
+ width: 296,
538
+ background: "#fff",
539
+ borderRadius: 14,
540
+ boxShadow: "0 8px 32px rgba(13,30,53,0.18), 0 2px 8px rgba(13,30,53,0.08)",
541
+ zIndex: 1001,
542
+ overflow: "hidden",
543
+ animation: `${slideUp} 0.2s cubic-bezier(.22,.68,0,1.2)`
544
+ });
545
+
546
+ // call-control-sdk/lib/pages/liveStatus/index.tsx
547
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
548
+ var AgentTableRow = React.memo(({
549
+ agent,
550
+ durSecs,
551
+ onMonitor,
552
+ activeMonitoring,
553
+ onStopMonitoring
554
+ }) => {
555
+ const statusKey = getAgentStatusKey(agent.status, agent.callDirection);
556
+ const sc = STATUS_COLORS[statusKey];
557
+ const isOnCall = statusKey === "s-oncall-in" || statusKey === "s-oncall-out";
558
+ const isLong = isOnCall && durSecs >= LONG_CALL_SECS;
559
+ const isBeingMonitored = (activeMonitoring == null ? void 0 : activeMonitoring.agentId) === agent.agentId;
560
+ const statusColor = isOnCall ? agent.callDirection === "OUTBOUND" ? C.blue : C.green : sc.text;
561
+ const durColor = isLong ? C.red : statusColor;
562
+ return /* @__PURE__ */ jsxs("tr", { style: { background: isLong ? "rgba(204,42,42,.07)" : sc.bg, transition: "background 0.3s" }, children: [
563
+ /* @__PURE__ */ jsx(AgTd, { sx: { borderLeft: `2px solid ${sc.bar}`, pl: "8px", maxWidth: 160 }, children: /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: "4px" }, children: [
564
+ /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'Poppins', Arial, sans-serif", fontSize: 11, fontWeight: 700, color: C.t1, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: agent.agentName }),
565
+ isLong && /* @__PURE__ */ jsx(Box2, { component: "span", sx: { fontSize: 7, fontWeight: 700, color: C.red, letterSpacing: 0.3, flexShrink: 0 }, children: "!7m" })
566
+ ] }) }),
567
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 9, color: C.t3 }, children: agent.extension || "\u2014" }) }),
568
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: "4px", flexWrap: "nowrap" }, children: [
569
+ /* @__PURE__ */ jsx(StatusDot, { dotColor: statusColor, animated: isOnCall }),
570
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 8, fontWeight: 700, letterSpacing: 0.6, textTransform: "uppercase", color: statusColor, whiteSpace: "nowrap" }, children: agent.status })
571
+ ] }) }),
572
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 11, fontWeight: 700, color: durColor, whiteSpace: "nowrap" }, children: fmtDur(durSecs) }) }),
573
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 9, color: C.t3 }, children: agent.activeCallerNumber || "\u2014" }) }),
574
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 9, color: C.t3, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", maxWidth: 110 }, children: agent.queueNames || "\u2014" }) }),
575
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 10, fontWeight: 700, color: C.t2 }, children: agent.callsToday }) }),
576
+ onMonitor !== void 0 && /* @__PURE__ */ jsx(AgTd, { children: isOnCall && onMonitor && /* @__PURE__ */ jsx(Box2, { sx: { display: "flex", gap: "3px", flexWrap: "nowrap", alignItems: "center" }, children: isBeingMonitored ? /* @__PURE__ */ jsxs(Fragment, { children: [
577
+ /* @__PURE__ */ jsxs(Box2, { sx: { fontSize: 7, color: C.green, fontWeight: 600, display: "flex", alignItems: "center", gap: "2px", whiteSpace: "nowrap" }, children: [
578
+ /* @__PURE__ */ jsx(StatusDot, { dotColor: C.green, animated: true }),
579
+ activeMonitoring == null ? void 0 : activeMonitoring.mode.toUpperCase()
580
+ ] }),
581
+ /* @__PURE__ */ jsx(MonitorBtn, { variant: "stop", onClick: onStopMonitoring, children: "\u23F9 Stop" })
582
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
583
+ /* @__PURE__ */ jsx(SDKPermissionGuard, { permission: SDK_PERMISSIONS.SUPERVISOR_MONITOR_LISTEN, showFallback: false, children: /* @__PURE__ */ jsx(MonitorBtn, { variant: "listen", onClick: () => onMonitor(agent, "listen"), title: "Start listening", children: "\u{1F442}" }) }),
584
+ /* @__PURE__ */ jsx(SDKPermissionGuard, { permission: SDK_PERMISSIONS.SUPERVISOR_MONITOR_WHISPER, showFallback: false, children: /* @__PURE__ */ jsx(MonitorBtn, { variant: "whisper", onClick: () => onMonitor(agent, "whisper"), title: "Whisper to agent", children: "\u{1F5E3}" }) }),
585
+ /* @__PURE__ */ jsx(SDKPermissionGuard, { permission: SDK_PERMISSIONS.SUPERVISOR_MONITOR_BARGE, showFallback: false, children: /* @__PURE__ */ jsx(MonitorBtn, { variant: "barge", onClick: () => onMonitor(agent, "barge"), title: "Barge in to call", children: "\u{1F4E2}" }) })
586
+ ] }) }) })
587
+ ] });
588
+ });
589
+ function LiveStatusPageInner({ isTvDashboard = false }) {
590
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
591
+ const toast = useToast();
592
+ const {
593
+ isLoading,
594
+ topStats,
595
+ agents,
596
+ queues,
597
+ alerts,
598
+ queuePulse,
599
+ durations,
600
+ clockStr,
601
+ dateStr
602
+ } = useLiveStatus();
603
+ const { startMonitoring, stopMonitoring, changeMode, isLoading: monitoringLoading } = useCallMonitoring();
604
+ const [monitoringSession, setMonitoringSession] = useState2(null);
605
+ const [showMonitorModal, setShowMonitorModal] = useState2(false);
606
+ const [selectedAgent, setSelectedAgent] = useState2(null);
607
+ const [selectedMode, setSelectedMode] = useState2("listen");
608
+ const [monitoringError, setMonitoringError] = useState2(null);
609
+ const handleOpenMonitorModal = useCallback2((agent, mode) => {
610
+ setSelectedAgent(agent);
611
+ setSelectedMode(mode);
612
+ setShowMonitorModal(true);
613
+ setMonitoringError(null);
614
+ }, []);
615
+ const handleStartMonitoring = useCallback2(async () => {
616
+ if (!selectedAgent) return;
617
+ if (!selectedAgent.activeCallUuid) {
618
+ setMonitoringError("No active call found for this agent");
619
+ return;
620
+ }
621
+ setMonitoringError(null);
622
+ const response = await startMonitoring({
623
+ call_id: selectedAgent.activeCallUuid,
624
+ agent_extension: selectedAgent.extension || "",
625
+ mode: selectedMode
626
+ });
627
+ if ((response == null ? void 0 : response.success) && (response == null ? void 0 : response.session_id)) {
628
+ setMonitoringSession({
629
+ sessionId: response.session_id,
630
+ agentId: selectedAgent.agentId,
631
+ agentName: selectedAgent.agentName,
632
+ agentExt: selectedAgent.extension || "",
633
+ mode: selectedMode,
634
+ callUuid: selectedAgent.activeCallUuid,
635
+ startTime: Date.now()
636
+ });
637
+ setShowMonitorModal(false);
638
+ if (response.message) toast.showToast(response.message, "success");
639
+ } else {
640
+ setMonitoringError((response == null ? void 0 : response.message) || "Failed to start monitoring");
641
+ }
642
+ }, [selectedAgent, selectedMode, startMonitoring, toast]);
643
+ const handleStopMonitoring = useCallback2(async () => {
644
+ if (!monitoringSession) return;
645
+ const response = await stopMonitoring({ call_uuid: monitoringSession.callUuid });
646
+ if ((response == null ? void 0 : response.success) && (response == null ? void 0 : response.message)) toast.showToast(response.message, "success");
647
+ setMonitoringSession(null);
648
+ }, [monitoringSession, stopMonitoring, toast]);
649
+ const handleChangeMode = useCallback2(async (newMode) => {
650
+ if (!monitoringSession) return;
651
+ const response = await changeMode({ call_uuid: monitoringSession.callUuid, mode: newMode });
652
+ if (response == null ? void 0 : response.success) {
653
+ setMonitoringSession((prev) => prev ? __spreadProps(__spreadValues({}, prev), { mode: newMode }) : null);
654
+ if (response.message) toast.showToast(response.message, "success");
655
+ }
656
+ }, [monitoringSession, changeMode, toast]);
657
+ const handleCloseMonitorModal = useCallback2(() => {
658
+ setShowMonitorModal(false);
659
+ setSelectedAgent(null);
660
+ setMonitoringError(null);
661
+ }, []);
662
+ useEffect2(() => {
663
+ var _a2;
664
+ if (!monitoringSession) return;
665
+ const agent = agents.find((a) => a.agentId === monitoringSession.agentId);
666
+ if (!agent) return;
667
+ const isOnCall = ((_a2 = agent.status) == null ? void 0 : _a2.toUpperCase()) === "ONCALL";
668
+ const callUuidChanged = agent.activeCallUuid !== monitoringSession.callUuid;
669
+ if (!isOnCall || callUuidChanged) {
670
+ setMonitoringSession(null);
671
+ setShowMonitorModal(false);
672
+ toast.showToast("Monitoring ended \u2014 agent call has ended.", "info");
673
+ }
674
+ }, [agents, monitoringSession, toast]);
675
+ const sorted = getSortedAgents(agents);
676
+ const oncallCount = (_a = topStats == null ? void 0 : topStats.onCall) != null ? _a : agents.filter((a) => getAgentStatusKey(a.status, a.callDirection).startsWith("s-oncall")).length;
677
+ const breakCount = (_b = topStats == null ? void 0 : topStats.onBreak) != null ? _b : agents.filter((a) => getAgentStatusKey(a.status, a.callDirection) === "s-break").length;
678
+ const longCallCount = agents.filter((a) => getAgentStatusKey(a.status, a.callDirection) === "s-oncall-in" && (durations[a.agentId] || 0) >= LONG_CALL_SECS).length;
679
+ const kpiTotalAgents = (_c = topStats == null ? void 0 : topStats.totalAgents) != null ? _c : agents.length;
680
+ const kpiLoginCount = (_d = topStats == null ? void 0 : topStats.loggedIn) != null ? _d : agents.length;
681
+ const kpiIdleCount = (_e = topStats == null ? void 0 : topStats.idleReady) != null ? _e : agents.filter((a) => getAgentStatusKey(a.status, a.callDirection) === "s-idle").length;
682
+ const kpiOnCallCount = (_f = topStats == null ? void 0 : topStats.onCall) != null ? _f : agents.filter((a) => getAgentStatusKey(a.status, a.callDirection).startsWith("s-oncall")).length;
683
+ const kpiWrapup = (_g = topStats == null ? void 0 : topStats.wrapup) != null ? _g : agents.filter((a) => getAgentStatusKey(a.status, a.callDirection) === "s-wrapup").length;
684
+ const kpiBreak = (_h = topStats == null ? void 0 : topStats.onBreak) != null ? _h : agents.filter((a) => getAgentStatusKey(a.status, a.callDirection) === "s-break").length;
685
+ const kpiNotLogged = (_i = topStats == null ? void 0 : topStats.notLogged) != null ? _i : Math.max(0, kpiTotalAgents - kpiLoginCount);
686
+ const tickerItems = queues.map((q) => ({
687
+ text: `${q.queueName} Queue \u2014 <b>${q.waitingCalls > 0 ? q.waitingCalls + " waiting" : "all clear"}</b> \xB7 avg ${q.avgWaitFormatted}`,
688
+ warn: q.waitingCalls > 0,
689
+ good: q.waitingCalls === 0
690
+ }));
691
+ if (isLoading) {
692
+ return /* @__PURE__ */ jsxs(Box2, { sx: {
693
+ height: "100vh",
694
+ display: "flex",
695
+ flexDirection: "column",
696
+ alignItems: "center",
697
+ justifyContent: "center",
698
+ background: "transparent",
699
+ gap: 2
700
+ }, children: [
701
+ /* @__PURE__ */ jsx(CircularProgress, { size: 48, sx: { color: C.blue } }),
702
+ /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'Poppins', Arial, sans-serif", fontSize: 16, fontWeight: 600, color: C.t2, letterSpacing: 1, textTransform: "uppercase" }, children: "Loading Live Status..." })
703
+ ] });
704
+ }
705
+ return /* @__PURE__ */ jsxs(WallboardRoot, { isTv: isTvDashboard, children: [
706
+ isTvDashboard && /* @__PURE__ */ jsxs(TopBar, { children: [
707
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: "10px" }, children: [
708
+ /* @__PURE__ */ jsx(BrandLogo, { children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 26 26", fill: "none", width: 16, height: 16, children: [
709
+ /* @__PURE__ */ jsx("rect", { width: "26", height: "26", rx: "5", fill: "#1A5F6C" }),
710
+ /* @__PURE__ */ jsx("path", { d: "M5 18 Q5 8 13 8 Q21 8 21 18", stroke: "#1565c8", strokeWidth: "2.5", fill: "none", strokeLinecap: "round" }),
711
+ /* @__PURE__ */ jsx("path", { d: "M9 18 Q9 12 13 12 Q17 12 17 18", stroke: "#0a9a62", strokeWidth: "2", fill: "none", strokeLinecap: "round" }),
712
+ /* @__PURE__ */ jsx("circle", { cx: "13", cy: "19", r: "2", fill: "#1565c8" })
713
+ ] }) }),
714
+ /* @__PURE__ */ jsxs(Box2, { sx: { color: "#fff" }, children: [
715
+ /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'Poppins', Arial, sans-serif", fontSize: 13, fontWeight: 800, letterSpacing: 1.2, lineHeight: 1 }, children: "AHS" }),
716
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 7.5, letterSpacing: 1, color: "rgba(255,255,255,.45)", textTransform: "uppercase" }, children: "Supervisor Wallboard" })
717
+ ] }),
718
+ /* @__PURE__ */ jsxs(LiveBadge, { children: [
719
+ /* @__PURE__ */ jsx(PulseDot, {}),
720
+ "LIVE"
721
+ ] })
722
+ ] }),
723
+ /* @__PURE__ */ jsxs(Box2, { sx: { textAlign: "right" }, children: [
724
+ /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 14, fontWeight: 700, color: "#fff", letterSpacing: 1.5, lineHeight: 1 }, children: clockStr }),
725
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 7.5, color: "rgba(255,255,255,.4)", letterSpacing: 0.5, mt: "1px" }, children: dateStr })
726
+ ] })
727
+ ] }),
728
+ /* @__PURE__ */ jsxs(KpiStrip, { children: [
729
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: "#94a3b8", children: [
730
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.t1, children: kpiTotalAgents }),
731
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Total Agents" })
732
+ ] }),
733
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.green, children: [
734
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.green, children: kpiLoginCount }),
735
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Logged In" })
736
+ ] }),
737
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: "#cbd5e1", children: [
738
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: "#94a3b8", children: kpiNotLogged }),
739
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Not Logged" })
740
+ ] }),
741
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.teal, children: [
742
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.teal, children: kpiIdleCount }),
743
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Idle / Ready" })
744
+ ] }),
745
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.amber, children: [
746
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.amber, children: kpiOnCallCount }),
747
+ /* @__PURE__ */ jsx(KpiLabel, { children: "On Call" })
748
+ ] }),
749
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.green, children: [
750
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.green, children: (_j = topStats == null ? void 0 : topStats.inboundToday) != null ? _j : 0 }),
751
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Inbound" })
752
+ ] }),
753
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.blue, children: [
754
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.blue, children: (_k = topStats == null ? void 0 : topStats.outboundToday) != null ? _k : 0 }),
755
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Outbound" })
756
+ ] }),
757
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.purple, children: [
758
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.purple, children: kpiWrapup }),
759
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Wrapup" })
760
+ ] }),
761
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.red, children: [
762
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.red, children: kpiBreak }),
763
+ /* @__PURE__ */ jsx(KpiLabel, { children: "On Break" })
764
+ ] }),
765
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.blue, children: [
766
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.blue, children: (_l = topStats == null ? void 0 : topStats.callsToday) != null ? _l : 0 }),
767
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Calls Today" })
768
+ ] }),
769
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.red, children: [
770
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.red, children: (_m = topStats == null ? void 0 : topStats.abandonedToday) != null ? _m : 0 }),
771
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Abandoned" })
772
+ ] }),
773
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.green, children: [
774
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.green, children: (topStats == null ? void 0 : topStats.slaThisHrPct) != null ? `${topStats.slaThisHrPct}%` : "\u2014" }),
775
+ /* @__PURE__ */ jsx(KpiLabel, { children: "SLA This Hr" })
776
+ ] }),
777
+ /* @__PURE__ */ jsxs(KpiCell, { accentColor: C.amber, children: [
778
+ /* @__PURE__ */ jsx(KpiValue, { kcolor: C.amber, children: (_n = topStats == null ? void 0 : topStats.avgSpeedAnswerFormatted) != null ? _n : "00:00" }),
779
+ /* @__PURE__ */ jsx(KpiLabel, { children: "Avg Speed Ans" })
780
+ ] })
781
+ ] }),
782
+ /* @__PURE__ */ jsxs(BodyGrid, { children: [
783
+ /* @__PURE__ */ jsxs(Panel, { children: [
784
+ /* @__PURE__ */ jsxs(PanelHeader, { children: [
785
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
786
+ /* @__PURE__ */ jsx(PhTitle, { children: "Agent Status" }),
787
+ /* @__PURE__ */ jsxs(Badge, { bg: C.amberLt, color: C.amber, border: C.amberBd, children: [
788
+ oncallCount,
789
+ " On-Call"
790
+ ] }),
791
+ /* @__PURE__ */ jsxs(Badge, { bg: C.redLt, color: C.red, border: C.redBd, children: [
792
+ breakCount,
793
+ " Break"
794
+ ] }),
795
+ longCallCount > 0 && /* @__PURE__ */ jsxs(Badge, { bg: C.redLt, color: C.red, border: C.redBd, children: [
796
+ longCallCount,
797
+ " Long"
798
+ ] })
799
+ ] }),
800
+ /* @__PURE__ */ jsxs(Box2, { sx: { fontSize: 8, color: C.t3 }, children: [
801
+ agents.length,
802
+ " agents"
803
+ ] })
804
+ ] }),
805
+ /* @__PURE__ */ jsx(Box2, { sx: {
806
+ overflowX: "auto",
807
+ overflowY: "auto",
808
+ flex: 1,
809
+ minHeight: 0,
810
+ "&::-webkit-scrollbar": { width: 3, height: 3 },
811
+ "&::-webkit-scrollbar-track": { background: C.bg2, borderRadius: 2 },
812
+ "&::-webkit-scrollbar-thumb": { background: C.t4, borderRadius: 2, "&:hover": { background: C.t3 } }
813
+ }, children: /* @__PURE__ */ jsxs(AgentTable, { children: [
814
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
815
+ /* @__PURE__ */ jsx(AgTh, { style: { width: "20%" }, children: "Agent" }),
816
+ /* @__PURE__ */ jsx(AgTh, { style: { width: "7%" }, children: "Ext" }),
817
+ /* @__PURE__ */ jsx(AgTh, { style: { width: "14%" }, children: "Status" }),
818
+ /* @__PURE__ */ jsx(AgTh, { style: { width: "10%" }, children: "Duration" }),
819
+ /* @__PURE__ */ jsx(AgTh, { style: { width: "12%" }, children: "Caller" }),
820
+ /* @__PURE__ */ jsx(AgTh, { style: { width: "17%" }, children: "Queue" }),
821
+ /* @__PURE__ */ jsx(AgTh, { style: { width: "6%" }, children: "Calls" }),
822
+ !isTvDashboard && /* @__PURE__ */ jsx(AgTh, { style: { width: "14%" }, children: "Actions" })
823
+ ] }) }),
824
+ /* @__PURE__ */ jsx("tbody", { children: sorted.length > 0 ? sorted.map((a) => /* @__PURE__ */ jsx(
825
+ AgentTableRow,
826
+ {
827
+ agent: a,
828
+ durSecs: durations[a.agentId] || 0,
829
+ onMonitor: isTvDashboard ? void 0 : handleOpenMonitorModal,
830
+ activeMonitoring: monitoringSession,
831
+ onStopMonitoring: handleStopMonitoring
832
+ },
833
+ a.agentId
834
+ )) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(AgTd, { colSpan: isTvDashboard ? 7 : 8, children: /* @__PURE__ */ jsx(NoDataBox, { children: "No data available" }) }) }) })
835
+ ] }) }),
836
+ /* @__PURE__ */ jsxs(PageInfo, { children: [
837
+ /* @__PURE__ */ jsxs("span", { children: [
838
+ agents.length,
839
+ " agents \xB7 ",
840
+ oncallCount,
841
+ " on call \xB7 ",
842
+ agents.filter((a) => getAgentStatusKey(a.status, a.callDirection) === "s-idle").length,
843
+ " idle"
844
+ ] }),
845
+ /* @__PURE__ */ jsx("span", { children: "Auto-refreshes every 5s" })
846
+ ] })
847
+ ] }),
848
+ /* @__PURE__ */ jsxs(Panel, { sx: { borderRight: `1px solid ${C.b1}`, maxHeight: { xs: "none", lg: "calc(100vh - 96px)" } }, children: [
849
+ /* @__PURE__ */ jsxs(PanelHeader, { children: [
850
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
851
+ /* @__PURE__ */ jsx(PhTitle, { children: "Queue Performance" }),
852
+ /* @__PURE__ */ jsx(Badge, { bg: C.greenLt, color: C.green, border: C.greenBd, children: "All Healthy" })
853
+ ] }),
854
+ /* @__PURE__ */ jsx(Badge, { bg: C.bg2, color: C.t3, border: C.b2, children: "Live SLA" })
855
+ ] }),
856
+ /* @__PURE__ */ jsxs(Box2, { sx: {
857
+ flex: 1,
858
+ minHeight: 0,
859
+ "&::-webkit-scrollbar": { width: 3 },
860
+ "&::-webkit-scrollbar-track": { background: C.bg2, borderRadius: 2 },
861
+ "&::-webkit-scrollbar-thumb": { background: C.t4, borderRadius: 2, "&:hover": { background: C.t3 } }
862
+ }, children: [
863
+ /* @__PURE__ */ jsx(Box2, { sx: { overflowX: "auto", "&::-webkit-scrollbar": { height: 3 }, "&::-webkit-scrollbar-track": { background: C.bg2, borderRadius: 2 }, "&::-webkit-scrollbar-thumb": { background: C.t4, borderRadius: 2 } }, children: /* @__PURE__ */ jsxs(AgentTable, { children: [
864
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
865
+ /* @__PURE__ */ jsx(AgTh, { children: "Queue" }),
866
+ /* @__PURE__ */ jsx(AgTh, { children: "Agents" }),
867
+ /* @__PURE__ */ jsx(AgTh, { children: "Active" }),
868
+ /* @__PURE__ */ jsx(AgTh, { children: "Waiting" }),
869
+ /* @__PURE__ */ jsx(AgTh, { children: "Avg Wait" }),
870
+ /* @__PURE__ */ jsx(AgTh, { children: "Load" }),
871
+ /* @__PURE__ */ jsx(AgTh, { children: "SLA%" }),
872
+ /* @__PURE__ */ jsx(AgTh, { children: "C/hr" })
873
+ ] }) }),
874
+ /* @__PURE__ */ jsx("tbody", { children: queues.length > 0 ? queues.map((q) => {
875
+ const loadColor = q.loadPct > 50 ? C.red : q.loadPct > 25 ? C.amber : C.green;
876
+ const slaColor = q.slaPct >= 95 ? C.green : q.slaPct >= 85 ? C.amber : C.red;
877
+ const isWaitingHigh = q.waitingCalls > WAITING_THRESHOLD;
878
+ return /* @__PURE__ */ jsxs(Box2, { component: "tr", sx: isWaitingHigh ? { animation: `${rowBlink} 1s ease infinite` } : q.slaPct < 90 ? { background: "rgba(204,42,42,.04)" } : {}, children: [
879
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(QName, { children: q.queueName }) }),
880
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(QNum, { numColor: C.blue, children: q.totalAgents }) }),
881
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(QNum, { numColor: C.amber, children: q.activeAgents }) }),
882
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(QNum, { numColor: isWaitingHigh ? C.red : q.waitingCalls > 0 ? C.red : C.green, children: q.waitingCalls }) }),
883
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(QNum, { numColor: C.green, children: q.avgWaitFormatted }) }),
884
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: "5px" }, children: [
885
+ /* @__PURE__ */ jsx(QBar, { children: /* @__PURE__ */ jsx(QBarFill, { w: q.loadPct, barColor: loadColor }) }),
886
+ /* @__PURE__ */ jsxs(Box2, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 10, color: C.t3 }, children: [
887
+ q.loadPct,
888
+ "%"
889
+ ] })
890
+ ] }) }),
891
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsxs(QNum, { numColor: slaColor, children: [
892
+ q.slaPct,
893
+ "%"
894
+ ] }) }),
895
+ /* @__PURE__ */ jsx(AgTd, { children: /* @__PURE__ */ jsx(QNum, { numColor: C.blue, children: q.callsPerHour }) })
896
+ ] }, q.queueId);
897
+ }) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(AgTd, { colSpan: 8, children: /* @__PURE__ */ jsx(NoDataBox, { children: "No data available" }) }) }) })
898
+ ] }) }),
899
+ /* @__PURE__ */ jsxs(Box2, { sx: { borderTop: `1px solid ${C.b1}` }, children: [
900
+ /* @__PURE__ */ jsxs(SbHeader, { children: [
901
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: "7px" }, children: [
902
+ /* @__PURE__ */ jsx("svg", { width: "11", height: "11", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M1 8h2l2-5 2 9 2-7 2 5 1-2h3", stroke: C.blue, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }) }),
903
+ /* @__PURE__ */ jsx(SbTitle, { children: "Queue Pulse" })
904
+ ] }),
905
+ /* @__PURE__ */ jsx(Badge, { bg: C.greenLt, color: C.green, border: C.greenBd, children: "Live" })
906
+ ] }),
907
+ /* @__PURE__ */ jsx(Box2, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", borderBottom: `1px solid ${C.b1}` }, children: [
908
+ { label: "In Queue", value: (_o = queuePulse == null ? void 0 : queuePulse.runningInQueue) != null ? _o : 0, color: C.amber, bg: C.amberLt },
909
+ { label: "Ready", value: (_p = queuePulse == null ? void 0 : queuePulse.readyAgents) != null ? _p : 0, color: C.green, bg: C.greenLt },
910
+ { label: "Avg Wait", value: (_q = queuePulse == null ? void 0 : queuePulse.avgWaitFormatted) != null ? _q : "--:--", color: C.blue, bg: C.blueLt }
911
+ ].map((s) => /* @__PURE__ */ jsxs(Box2, { sx: { p: "12px", borderRight: `1px solid ${C.b1}`, "&:last-child": { borderRight: "none" }, background: s.bg }, children: [
912
+ /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'Poppins', Arial, sans-serif", fontSize: 20, fontWeight: 800, color: s.color, lineHeight: 1 }, children: s.value }),
913
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 8, letterSpacing: 0.8, textTransform: "uppercase", color: s.color, mt: "4px", fontWeight: 600, opacity: 0.75 }, children: s.label })
914
+ ] }, s.label)) })
915
+ ] }),
916
+ /* @__PURE__ */ jsxs(Box2, { children: [
917
+ /* @__PURE__ */ jsxs(SbHeader, { children: [
918
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: "7px" }, children: [
919
+ /* @__PURE__ */ jsxs("svg", { width: "11", height: "11", viewBox: "0 0 16 16", fill: "none", children: [
920
+ /* @__PURE__ */ jsx("path", { d: "M8 1.5a5 5 0 0 1 5 5v2.5l1 2H2l1-2V6.5a5 5 0 0 1 5-5z", stroke: alerts.length > 0 ? C.amber : C.t3, strokeWidth: "1.4", strokeLinejoin: "round" }),
921
+ /* @__PURE__ */ jsx("path", { d: "M6.5 13a1.5 1.5 0 0 0 3 0", stroke: alerts.length > 0 ? C.amber : C.t3, strokeWidth: "1.4", strokeLinecap: "round" })
922
+ ] }),
923
+ /* @__PURE__ */ jsx(SbTitle, { children: "Live Alerts" })
924
+ ] }),
925
+ /* @__PURE__ */ jsx(Badge, { bg: alerts.length > 0 ? C.amberLt : C.bg2, color: alerts.length > 0 ? C.amber : C.t3, border: alerts.length > 0 ? C.amberBd : C.b2, children: alerts.length })
926
+ ] }),
927
+ /* @__PURE__ */ jsx(Box2, { sx: {
928
+ overflowY: "auto",
929
+ maxHeight: 220,
930
+ "&::-webkit-scrollbar": { width: 3 },
931
+ "&::-webkit-scrollbar-track": { background: C.bg2, borderRadius: 2 },
932
+ "&::-webkit-scrollbar-thumb": { background: C.t4, borderRadius: 2, "&:hover": { background: C.t3 } }
933
+ }, children: alerts.length > 0 ? alerts.map((a, i) => {
934
+ var _a2, _b2, _c2;
935
+ const sk = ((_a2 = a.severity) == null ? void 0 : _a2.toLowerCase()) === "critical" ? "red" : ((_b2 = a.severity) == null ? void 0 : _b2.toLowerCase()) === "warning" ? "amber" : "blue";
936
+ const ALERT_COLORS = {
937
+ red: { bg: C.redLt, color: C.red },
938
+ amber: { bg: C.amberLt, color: C.amber },
939
+ blue: { bg: C.blueLt, color: C.blue }
940
+ };
941
+ const ac = (_c2 = ALERT_COLORS[sk]) != null ? _c2 : ALERT_COLORS.blue;
942
+ return /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", gap: "10px", px: "12px", py: "9px", borderBottom: `1px solid ${C.b1}`, background: i % 2 === 0 ? "transparent" : C.bg2 }, children: [
943
+ /* @__PURE__ */ jsx(Box2, { sx: { width: 8, height: 8, borderRadius: "50%", background: ac.color, flexShrink: 0, mt: "3px" } }),
944
+ /* @__PURE__ */ jsxs(Box2, { sx: { flex: 1, minWidth: 0 }, children: [
945
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 11, fontWeight: 600, color: C.t1, mb: "2px" }, children: a.alertTitle }),
946
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 9, color: C.t3, lineHeight: 1.4 }, children: a.alertMessage })
947
+ ] }),
948
+ /* @__PURE__ */ jsxs(Box2, { sx: { flexShrink: 0, display: "flex", flexDirection: "column", alignItems: "flex-end", gap: "4px" }, children: [
949
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 7, fontWeight: 700, px: "5px", py: "1px", borderRadius: "3px", background: ac.bg, color: ac.color, textTransform: "uppercase", letterSpacing: 0.5 }, children: a.severity }),
950
+ /* @__PURE__ */ jsx(Box2, { sx: { fontFamily: "'JetBrains Mono', monospace", fontSize: 9, color: C.t3 }, children: (() => {
951
+ try {
952
+ const [h, m] = a.alertTime.split(":");
953
+ const hr = parseInt(h, 10);
954
+ return `${hr % 12 || 12}:${m} ${hr >= 12 ? "PM" : "AM"}`;
955
+ } catch (e) {
956
+ return a.alertTime;
957
+ }
958
+ })() })
959
+ ] })
960
+ ] }, i);
961
+ }) : /* @__PURE__ */ jsx(NoDataBox, { children: "No active alerts" }) })
962
+ ] })
963
+ ] })
964
+ ] })
965
+ ] }),
966
+ /* @__PURE__ */ jsxs(Footer, { children: [
967
+ /* @__PURE__ */ jsx(TickerLabel, { children: "AHS Live" }),
968
+ /* @__PURE__ */ jsx(TickerTrack, { children: /* @__PURE__ */ jsx(TickerInner, { children: [...tickerItems, ...tickerItems].map((t, i) => /* @__PURE__ */ jsx(TickerSpan, { isWarn: t.warn, isGood: t.good, dangerouslySetInnerHTML: { __html: t.text } }, i)) }) })
969
+ ] }),
970
+ showMonitorModal && selectedAgent && (() => {
971
+ const modeConfig = {
972
+ listen: { icon: "\u{1F442}", label: "Listen", desc: "Silent \u2013 agent unaware", accent: C.blue, accentLt: "#e3f2fd", accentText: "#1565c0" },
973
+ whisper: { icon: "\u{1F5E3}\uFE0F", label: "Whisper", desc: "Only agent hears you", accent: "#ef6c00", accentLt: "#fff3e0", accentText: "#e65100" },
974
+ barge: { icon: "\u{1F4E2}", label: "Barge", desc: "Both parties hear you", accent: "#c2185b", accentLt: "#fce4ec", accentText: "#880e4f" }
975
+ };
976
+ const m = modeConfig[selectedMode];
977
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
978
+ /* @__PURE__ */ jsx(Box2, { onClick: handleCloseMonitorModal, sx: { position: "fixed", inset: 0, zIndex: 1e3 } }),
979
+ /* @__PURE__ */ jsxs(MonitorCard, { children: [
980
+ /* @__PURE__ */ jsx(Box2, { sx: { height: 3, background: m.accent } }),
981
+ /* @__PURE__ */ jsxs(Box2, { sx: { p: "12px 14px" }, children: [
982
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 1.5 }, children: [
983
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
984
+ /* @__PURE__ */ jsx(Box2, { sx: { width: 32, height: 32, borderRadius: "10px", background: m.accentLt, display: "flex", alignItems: "center", justifyContent: "center", fontSize: 16 }, children: m.icon }),
985
+ /* @__PURE__ */ jsxs(Box2, { children: [
986
+ /* @__PURE__ */ jsx(Box2, { sx: { fontWeight: 700, fontSize: 13, color: C.t1, lineHeight: 1.2 }, children: "Monitor Call" }),
987
+ /* @__PURE__ */ jsxs(Box2, { sx: { fontSize: 10, color: C.t3 }, children: [
988
+ selectedAgent.agentName,
989
+ " \xB7 ext ",
990
+ selectedAgent.extension || ""
991
+ ] })
992
+ ] })
993
+ ] }),
994
+ /* @__PURE__ */ jsx(Box2, { component: "button", onClick: handleCloseMonitorModal, sx: { border: "none", background: "none", cursor: "pointer", color: C.t4, fontSize: 18, lineHeight: 1, p: 0, "&:hover": { color: C.t2 } }, children: "\xD7" })
995
+ ] }),
996
+ /* @__PURE__ */ jsx(Box2, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "4px 0", background: C.bg2, borderRadius: "8px", p: "8px 10px", mb: 1.5 }, children: [
997
+ ["Customer", selectedAgent.activeCallerNumber || "\u2014"],
998
+ ["Duration", fmtDur(durations[selectedAgent.agentId] || 0)]
999
+ ].map(([label, value]) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
1000
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 10, color: C.t3, fontWeight: 500 }, children: label }),
1001
+ /* @__PURE__ */ jsx(Box2, { sx: { fontSize: 10, fontWeight: 600, color: C.t1, textAlign: "right" }, children: value })
1002
+ ] }, label)) }),
1003
+ /* @__PURE__ */ jsx(Box2, { sx: { display: "flex", gap: "6px", mb: 1.5 }, children: ["listen", "whisper", "barge"].map((mode) => {
1004
+ const mc = modeConfig[mode];
1005
+ const active = selectedMode === mode;
1006
+ return /* @__PURE__ */ jsxs(Box2, { onClick: () => setSelectedMode(mode), sx: { flex: 1, textAlign: "center", py: "5px", borderRadius: "20px", fontSize: 9, fontWeight: 700, letterSpacing: 0.4, cursor: "pointer", textTransform: "uppercase", transition: "all 0.15s", background: active ? mc.accent : C.bg2, color: active ? "#fff" : C.t3, border: `1px solid ${active ? mc.accent : "transparent"}`, "&:hover": { background: active ? mc.accent : C.bg3 } }, children: [
1007
+ mc.icon,
1008
+ " ",
1009
+ mc.label
1010
+ ] }, mode);
1011
+ }) }),
1012
+ /* @__PURE__ */ jsxs(Box2, { sx: { fontSize: 10, color: m.accentText, background: m.accentLt, borderRadius: "6px", px: 1.25, py: 0.75, mb: 1.5, display: "flex", alignItems: "center", gap: 0.5 }, children: [
1013
+ /* @__PURE__ */ jsx("span", { style: { fontSize: 11 }, children: "\u2139\uFE0F" }),
1014
+ " ",
1015
+ m.desc,
1016
+ " \xB7 Your dialer will ring to connect."
1017
+ ] }),
1018
+ monitoringError && /* @__PURE__ */ jsx(Box2, { sx: { mb: 1.5, px: 1.25, py: 0.75, background: C.redLt, borderRadius: "6px", color: C.red, fontSize: 11 }, children: monitoringError }),
1019
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", gap: "8px" }, children: [
1020
+ /* @__PURE__ */ jsx(Box2, { component: "button", onClick: handleCloseMonitorModal, sx: { flex: 1, py: "7px", border: `1px solid ${C.b2}`, borderRadius: "8px", cursor: "pointer", fontSize: 11, fontWeight: 500, background: "transparent", color: C.t2, "&:hover": { background: C.bg2 } }, children: "Cancel" }),
1021
+ /* @__PURE__ */ jsx(Box2, { component: "button", onClick: handleStartMonitoring, disabled: monitoringLoading, sx: { flex: 2, py: "7px", border: "none", borderRadius: "8px", cursor: monitoringLoading ? "not-allowed" : "pointer", fontSize: 11, fontWeight: 700, background: m.accent, color: "#fff", opacity: monitoringLoading ? 0.7 : 1, transition: "opacity 0.15s", "&:hover": { opacity: monitoringLoading ? 0.7 : 0.88 } }, children: monitoringLoading ? "Starting\u2026" : `\u25B6 Start ${m.label}` })
1022
+ ] })
1023
+ ] })
1024
+ ] })
1025
+ ] });
1026
+ })(),
1027
+ monitoringSession && (() => {
1028
+ var _a2;
1029
+ const sessionModeConfig = {
1030
+ listen: { icon: "\u{1F442}", accent: C.blue, accentLt: "#e3f2fd", label: "Listen" },
1031
+ whisper: { icon: "\u{1F5E3}\uFE0F", accent: "#ef6c00", accentLt: "#fff3e0", label: "Whisper" },
1032
+ barge: { icon: "\u{1F4E2}", accent: "#c2185b", accentLt: "#fce4ec", label: "Barge" }
1033
+ };
1034
+ const sm = (_a2 = sessionModeConfig[monitoringSession.mode]) != null ? _a2 : sessionModeConfig.listen;
1035
+ return /* @__PURE__ */ jsxs(Box2, { sx: { position: "fixed", bottom: 20, right: 20, width: 268, background: "#fff", borderRadius: "14px", boxShadow: "0 8px 28px rgba(13,30,53,0.16), 0 2px 6px rgba(13,30,53,0.08)", zIndex: 999, overflow: "hidden", animation: `${slideUp} 0.22s cubic-bezier(.22,.68,0,1.2)` }, children: [
1036
+ /* @__PURE__ */ jsx(Box2, { sx: { height: 3, background: sm.accent } }),
1037
+ /* @__PURE__ */ jsxs(Box2, { sx: { p: "10px 12px" }, children: [
1038
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: "8px", mb: 1 }, children: [
1039
+ /* @__PURE__ */ jsx(Box2, { sx: { width: 8, height: 8, borderRadius: "50%", background: C.green, flexShrink: 0, animation: `${pulse} 1.6s ease infinite` } }),
1040
+ /* @__PURE__ */ jsxs(Box2, { sx: { fontWeight: 700, fontSize: 11, color: C.t1, textTransform: "uppercase", letterSpacing: 0.6 }, children: [
1041
+ sm.icon,
1042
+ " ",
1043
+ sm.label,
1044
+ " Active"
1045
+ ] }),
1046
+ /* @__PURE__ */ jsx(Box2, { sx: { ml: "auto", fontFamily: "'JetBrains Mono', monospace", fontSize: 11, fontWeight: 600, color: sm.accent }, children: fmtDur(Math.floor((Date.now() - monitoringSession.startTime) / 1e3)) })
1047
+ ] }),
1048
+ /* @__PURE__ */ jsxs(Box2, { sx: { fontSize: 11, color: C.t2, mb: 1, pl: "16px" }, children: [
1049
+ monitoringSession.agentName,
1050
+ /* @__PURE__ */ jsx(Box2, { component: "span", sx: { color: C.t4, mx: 0.5 }, children: "\xB7" }),
1051
+ "ext ",
1052
+ monitoringSession.agentExt
1053
+ ] }),
1054
+ /* @__PURE__ */ jsx(Box2, { sx: { borderTop: `1px solid ${C.b1}`, mb: 1 } }),
1055
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", gap: "5px" }, children: [
1056
+ ["listen", "whisper", "barge"].filter((m) => m !== monitoringSession.mode).map((mode) => {
1057
+ const mc = sessionModeConfig[mode];
1058
+ return /* @__PURE__ */ jsxs(MonitorBtn, { variant: mode, onClick: () => handleChangeMode(mode), style: { flex: 1, justifyContent: "center", padding: "4px 0", fontSize: 9, borderRadius: 4 }, children: [
1059
+ mc.icon,
1060
+ " ",
1061
+ mc.label
1062
+ ] }, mode);
1063
+ }),
1064
+ /* @__PURE__ */ jsx(MonitorBtn, { variant: "stop", onClick: handleStopMonitoring, style: { flex: 1, justifyContent: "center", padding: "4px 0", fontSize: 9, borderRadius: 4 }, children: "\u23F9 Stop" })
1065
+ ] })
1066
+ ] })
1067
+ ] });
1068
+ })()
1069
+ ] });
1070
+ }
1071
+ function LiveStatusPage(props) {
1072
+ return /* @__PURE__ */ jsx(SDKProvider, { children: /* @__PURE__ */ jsx(LiveStatusPageInner, __spreadValues({}, props)) });
1073
+ }
1074
+ export {
1075
+ LiveStatusPage as default
1076
+ };
1077
+ //# sourceMappingURL=liveStatus-IQIEZZE5.mjs.map