call-control-sdk 6.4.5-dev.10 → 6.4.5-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +251 -173
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +252 -174
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1311,7 +1311,7 @@ import {
|
|
|
1311
1311
|
TableBody,
|
|
1312
1312
|
CircularProgress
|
|
1313
1313
|
} from "@mui/material";
|
|
1314
|
-
import { useEffect as useEffect4,
|
|
1314
|
+
import { useEffect as useEffect4, useState as useState9 } from "react";
|
|
1315
1315
|
|
|
1316
1316
|
// call-control-sdk/lib/components/styles.ts
|
|
1317
1317
|
import { useTheme } from "@mui/material";
|
|
@@ -1379,8 +1379,8 @@ var styles_default = useStyles;
|
|
|
1379
1379
|
|
|
1380
1380
|
// call-control-sdk/lib/components/dialog.tsx
|
|
1381
1381
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1382
|
-
var ConferenceTableRow = ({ each
|
|
1383
|
-
var _a2, _b, _c, _d, _e;
|
|
1382
|
+
var ConferenceTableRow = ({ each }) => {
|
|
1383
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
|
|
1384
1384
|
const state = useSDKState();
|
|
1385
1385
|
const { showToast } = useToast();
|
|
1386
1386
|
const { disabled, enabled, outlined } = styles_default({
|
|
@@ -1392,7 +1392,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1392
1392
|
const [conferenceCallStart, setConferenceCallStart] = useState9(false);
|
|
1393
1393
|
const [conferenceCallMerge, setConferenceCallMerge] = useState9(false);
|
|
1394
1394
|
const [conferenceCallHoldOrUnHold, setConferenceCallHoldOrUnHold] = useState9(false);
|
|
1395
|
-
const [conferenceCallMuteOrUnMute, setConferenceCallMuteOrUnMute] = useState9(false);
|
|
1396
1395
|
const [conferenceCallEnd, setConferenceCallEnd] = useState9(false);
|
|
1397
1396
|
const onConferenceLineUpdate = (line, data) => {
|
|
1398
1397
|
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
@@ -1468,30 +1467,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1468
1467
|
setConferenceCallHoldOrUnHold(false);
|
|
1469
1468
|
});
|
|
1470
1469
|
};
|
|
1471
|
-
const onMuteOrUnMuteConferenceCall = (line, data, type) => {
|
|
1472
|
-
var _a3, _b2, _c2, _d2;
|
|
1473
|
-
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
1474
|
-
setConferenceCallMuteOrUnMute(true);
|
|
1475
|
-
const payload = {
|
|
1476
|
-
action: "EXTERNAL_CONFERENCE",
|
|
1477
|
-
operation: type,
|
|
1478
|
-
channel_no: type === "MUTEUSER" ? `mute${line_used.line}` : `play${line_used.line}`,
|
|
1479
|
-
userid: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.agent_id) != null ? _b2 : "",
|
|
1480
|
-
thirdparty_no: line_used.phone,
|
|
1481
|
-
process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : ""
|
|
1482
|
-
};
|
|
1483
|
-
axios_default.post(END_POINT.CONFERENCE_CALL_MUTE_OT_UN_MUTE, payload).then((res) => {
|
|
1484
|
-
var _a4;
|
|
1485
|
-
showToast((_a4 = res.data) == null ? void 0 : _a4.message, "success");
|
|
1486
|
-
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
1487
|
-
}).catch((err) => {
|
|
1488
|
-
var _a4, _b3, _c3, _d3;
|
|
1489
|
-
const message = ((_b3 = (_a4 = err.response) == null ? void 0 : _a4.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1490
|
-
showToast(message, "error");
|
|
1491
|
-
}).finally(() => {
|
|
1492
|
-
setConferenceCallMuteOrUnMute(false);
|
|
1493
|
-
});
|
|
1494
|
-
};
|
|
1495
1470
|
const onEndConferenceCall = (line, data) => {
|
|
1496
1471
|
var _a3, _b2, _c2, _d2;
|
|
1497
1472
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
@@ -1517,6 +1492,38 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1517
1492
|
setConferenceCallEnd(false);
|
|
1518
1493
|
});
|
|
1519
1494
|
};
|
|
1495
|
+
const [holdOrUnHold, { isLoading: holdOrUnHoldLoading }] = usePostRequest({
|
|
1496
|
+
onSuccess: () => {
|
|
1497
|
+
sdkStateManager.setHolding(!state.isHolding);
|
|
1498
|
+
},
|
|
1499
|
+
onError: (error) => {
|
|
1500
|
+
console.log("\u274C Hold operation error:", error);
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
const [muteOrUnMute, { isLoading: muteOrUnMuteLoading }] = usePostRequest({
|
|
1504
|
+
onSuccess: () => {
|
|
1505
|
+
sdkStateManager.setMuted(!state.isMuted);
|
|
1506
|
+
},
|
|
1507
|
+
onError: (error) => {
|
|
1508
|
+
console.log("\u274C Mute operation error:", error);
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
const handleHoldToggle = () => {
|
|
1512
|
+
var _a3;
|
|
1513
|
+
const payload = {
|
|
1514
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
|
|
1515
|
+
userId: state.agentId
|
|
1516
|
+
};
|
|
1517
|
+
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
1518
|
+
};
|
|
1519
|
+
const handleMuteToggle = () => {
|
|
1520
|
+
var _a3;
|
|
1521
|
+
const payload = {
|
|
1522
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
|
|
1523
|
+
userId: state.agentId
|
|
1524
|
+
};
|
|
1525
|
+
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
1526
|
+
};
|
|
1520
1527
|
return /* @__PURE__ */ jsxs2(
|
|
1521
1528
|
TableRow,
|
|
1522
1529
|
{
|
|
@@ -1528,7 +1535,9 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1528
1535
|
TableCell,
|
|
1529
1536
|
{
|
|
1530
1537
|
sx: {
|
|
1531
|
-
padding: "6px"
|
|
1538
|
+
padding: "6px",
|
|
1539
|
+
flex: 1,
|
|
1540
|
+
width: "100px"
|
|
1532
1541
|
},
|
|
1533
1542
|
children: /* @__PURE__ */ jsxs2(Typography, { children: [
|
|
1534
1543
|
"Line ",
|
|
@@ -1541,7 +1550,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1541
1550
|
TableCell,
|
|
1542
1551
|
{
|
|
1543
1552
|
sx: {
|
|
1544
|
-
padding: "6px"
|
|
1553
|
+
padding: "6px",
|
|
1554
|
+
width: "100px"
|
|
1545
1555
|
},
|
|
1546
1556
|
children: /* @__PURE__ */ jsx2(
|
|
1547
1557
|
Typography,
|
|
@@ -1549,7 +1559,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1549
1559
|
variant: "body2",
|
|
1550
1560
|
sx: {
|
|
1551
1561
|
px: 1,
|
|
1552
|
-
borderRadius: "10px"
|
|
1562
|
+
borderRadius: "10px",
|
|
1563
|
+
flex: 1
|
|
1553
1564
|
},
|
|
1554
1565
|
children: (_e = each == null ? void 0 : each.status) != null ? _e : ""
|
|
1555
1566
|
}
|
|
@@ -1560,25 +1571,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1560
1571
|
TableCell,
|
|
1561
1572
|
{
|
|
1562
1573
|
sx: {
|
|
1563
|
-
padding: "6px"
|
|
1564
|
-
|
|
1565
|
-
children: /* @__PURE__ */ jsx2(
|
|
1566
|
-
Button,
|
|
1567
|
-
{
|
|
1568
|
-
sx: {
|
|
1569
|
-
textTransform: "capitalize"
|
|
1570
|
-
},
|
|
1571
|
-
size: "small",
|
|
1572
|
-
children: /* @__PURE__ */ jsx2(Typography, { variant: "body2", children: (each == null ? void 0 : each.line) === 1 ? "Internal" : "External" })
|
|
1573
|
-
}
|
|
1574
|
-
)
|
|
1575
|
-
}
|
|
1576
|
-
),
|
|
1577
|
-
/* @__PURE__ */ jsx2(
|
|
1578
|
-
TableCell,
|
|
1579
|
-
{
|
|
1580
|
-
sx: {
|
|
1581
|
-
padding: "6px"
|
|
1574
|
+
padding: "6px",
|
|
1575
|
+
flex: 1
|
|
1582
1576
|
},
|
|
1583
1577
|
children: /* @__PURE__ */ jsx2(
|
|
1584
1578
|
TextField,
|
|
@@ -1587,7 +1581,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1587
1581
|
placeholder: "Phone Number",
|
|
1588
1582
|
fullWidth: true,
|
|
1589
1583
|
value: (each == null ? void 0 : each.phone) || "",
|
|
1590
|
-
disabled: (each == null ? void 0 : each.line) === 1 || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "CONFERENCE" || (each == null ? void 0 : each.status) === "HOLD" || (each == null ? void 0 : each.status) === "MUTE",
|
|
1584
|
+
disabled: (each == null ? void 0 : each.line) === 1 || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "CONFERENCE" || (each == null ? void 0 : each.status) === "HOLD" || (each == null ? void 0 : each.status) === "MUTE" || (each == null ? void 0 : each.status) === "DIALING" || (each == null ? void 0 : each.status) === "RINGING",
|
|
1591
1585
|
onChange: (e) => {
|
|
1592
1586
|
onConferenceLineUpdate(each, { phone: e.target.value });
|
|
1593
1587
|
}
|
|
@@ -1599,17 +1593,171 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1599
1593
|
TableCell,
|
|
1600
1594
|
{
|
|
1601
1595
|
sx: {
|
|
1602
|
-
padding: "6px"
|
|
1596
|
+
padding: "6px",
|
|
1597
|
+
// width: "200px",
|
|
1598
|
+
flex: 1
|
|
1603
1599
|
},
|
|
1604
1600
|
children: /* @__PURE__ */ jsxs2(
|
|
1605
1601
|
Box,
|
|
1606
1602
|
{
|
|
1607
1603
|
sx: {
|
|
1604
|
+
width: "100%",
|
|
1608
1605
|
display: "flex",
|
|
1609
1606
|
alignItems: "center",
|
|
1610
|
-
justifyContent: "
|
|
1607
|
+
justifyContent: "flex-start",
|
|
1608
|
+
gap: "10px"
|
|
1611
1609
|
},
|
|
1612
1610
|
children: [
|
|
1611
|
+
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ jsx2(Tooltip, { title: ((_f = state.callData) == null ? void 0 : _f.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ jsx2(
|
|
1612
|
+
Button,
|
|
1613
|
+
{
|
|
1614
|
+
variant: ((_g = state.callData) == null ? void 0 : _g.hold) === 1 && ((_i = (_h = state.callData) == null ? void 0 : _h.status) == null ? void 0 : _i.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
1615
|
+
onClick: (e) => {
|
|
1616
|
+
e.stopPropagation();
|
|
1617
|
+
handleHoldToggle();
|
|
1618
|
+
},
|
|
1619
|
+
sx: ((_j = state.callData) == null ? void 0 : _j.hold) === 1 && ((_l = (_k = state.callData) == null ? void 0 : _k.status) == null ? void 0 : _l.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_n = (_m = state.callData) == null ? void 0 : _m.status) == null ? void 0 : _n.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1620
|
+
disabled: ((_p = (_o = state.callData) == null ? void 0 : _o.status) == null ? void 0 : _p.toUpperCase()) !== "ONCALL" && ((_q = state.callData) == null ? void 0 : _q.hold) !== 1 || holdOrUnHoldLoading,
|
|
1621
|
+
children: ((_r = state.callData) == null ? void 0 : _r.hold) === 1 ? /* @__PURE__ */ jsxs2(
|
|
1622
|
+
Box,
|
|
1623
|
+
{
|
|
1624
|
+
sx: {
|
|
1625
|
+
display: "flex",
|
|
1626
|
+
alignItems: "center",
|
|
1627
|
+
justifyContent: "center",
|
|
1628
|
+
gap: "5px",
|
|
1629
|
+
width: "98px"
|
|
1630
|
+
},
|
|
1631
|
+
children: [
|
|
1632
|
+
/* @__PURE__ */ jsx2(
|
|
1633
|
+
Typography,
|
|
1634
|
+
{
|
|
1635
|
+
sx: {
|
|
1636
|
+
color: ((_s = state.callData) == null ? void 0 : _s.hold) === 1 ? "#fff" : "initial"
|
|
1637
|
+
},
|
|
1638
|
+
children: "Unhold"
|
|
1639
|
+
}
|
|
1640
|
+
),
|
|
1641
|
+
holdOrUnHoldLoading ? /* @__PURE__ */ jsx2(
|
|
1642
|
+
CircularProgress,
|
|
1643
|
+
{
|
|
1644
|
+
size: "16px",
|
|
1645
|
+
sx: {
|
|
1646
|
+
color: theme.palette.primary.main
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
) : /* @__PURE__ */ jsx2(PlayArrow, {})
|
|
1650
|
+
]
|
|
1651
|
+
}
|
|
1652
|
+
) : /* @__PURE__ */ jsxs2(
|
|
1653
|
+
Box,
|
|
1654
|
+
{
|
|
1655
|
+
sx: {
|
|
1656
|
+
display: "flex",
|
|
1657
|
+
alignItems: "center",
|
|
1658
|
+
justifyContent: "center",
|
|
1659
|
+
gap: "5px",
|
|
1660
|
+
width: "98px"
|
|
1661
|
+
},
|
|
1662
|
+
children: [
|
|
1663
|
+
/* @__PURE__ */ jsx2(
|
|
1664
|
+
Typography,
|
|
1665
|
+
{
|
|
1666
|
+
sx: {
|
|
1667
|
+
color: ((_t = state.callData) == null ? void 0 : _t.hold) === 1 ? "#fff" : "#000"
|
|
1668
|
+
},
|
|
1669
|
+
children: "Hold"
|
|
1670
|
+
}
|
|
1671
|
+
),
|
|
1672
|
+
holdOrUnHoldLoading ? /* @__PURE__ */ jsx2(
|
|
1673
|
+
CircularProgress,
|
|
1674
|
+
{
|
|
1675
|
+
size: "16px",
|
|
1676
|
+
sx: {
|
|
1677
|
+
color: theme.palette.primary.main
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
) : /* @__PURE__ */ jsx2(Pause, {})
|
|
1681
|
+
]
|
|
1682
|
+
}
|
|
1683
|
+
)
|
|
1684
|
+
}
|
|
1685
|
+
) }),
|
|
1686
|
+
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ jsx2(Tooltip, { title: ((_u = state.callData) == null ? void 0 : _u.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ jsx2(
|
|
1687
|
+
Button,
|
|
1688
|
+
{
|
|
1689
|
+
variant: state.isHolding ? "outlined" : ((_v = state.callData) == null ? void 0 : _v.mute) === 1 && ((_x = (_w = state.callData) == null ? void 0 : _w.status) == null ? void 0 : _x.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
1690
|
+
onClick: (e) => {
|
|
1691
|
+
e.stopPropagation();
|
|
1692
|
+
handleMuteToggle();
|
|
1693
|
+
},
|
|
1694
|
+
sx: ((_y = state.callData) == null ? void 0 : _y.hold) === 1 ? __spreadValues({}, disabled) : ((_z = state.callData) == null ? void 0 : _z.mute) === 1 && ((_B = (_A = state.callData) == null ? void 0 : _A.status) == null ? void 0 : _B.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_D = (_C = state.callData) == null ? void 0 : _C.status) == null ? void 0 : _D.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1695
|
+
disabled: ((_F = (_E = state.callData) == null ? void 0 : _E.status) == null ? void 0 : _F.toUpperCase()) !== "ONCALL" && ((_G = state.callData) == null ? void 0 : _G.mute) !== 1 || muteOrUnMuteLoading || ((_H = state.callData) == null ? void 0 : _H.hold) === 1,
|
|
1696
|
+
children: ((_I = state.callData) == null ? void 0 : _I.mute) === 1 ? /* @__PURE__ */ jsxs2(
|
|
1697
|
+
Box,
|
|
1698
|
+
{
|
|
1699
|
+
sx: {
|
|
1700
|
+
display: "flex",
|
|
1701
|
+
alignItems: "center",
|
|
1702
|
+
justifyContent: "center",
|
|
1703
|
+
gap: "5px",
|
|
1704
|
+
width: "98px"
|
|
1705
|
+
},
|
|
1706
|
+
children: [
|
|
1707
|
+
/* @__PURE__ */ jsx2(
|
|
1708
|
+
Typography,
|
|
1709
|
+
{
|
|
1710
|
+
sx: {
|
|
1711
|
+
color: ((_J = state.callData) == null ? void 0 : _J.mute) === 1 ? "#fff" : "initial"
|
|
1712
|
+
},
|
|
1713
|
+
children: "Unmute"
|
|
1714
|
+
}
|
|
1715
|
+
),
|
|
1716
|
+
muteOrUnMuteLoading ? /* @__PURE__ */ jsx2(
|
|
1717
|
+
CircularProgress,
|
|
1718
|
+
{
|
|
1719
|
+
size: "16px",
|
|
1720
|
+
sx: {
|
|
1721
|
+
color: theme.palette.primary.main
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
) : /* @__PURE__ */ jsx2(MicOff, {})
|
|
1725
|
+
]
|
|
1726
|
+
}
|
|
1727
|
+
) : /* @__PURE__ */ jsxs2(
|
|
1728
|
+
Box,
|
|
1729
|
+
{
|
|
1730
|
+
sx: {
|
|
1731
|
+
display: "flex",
|
|
1732
|
+
alignItems: "center",
|
|
1733
|
+
justifyContent: "center",
|
|
1734
|
+
gap: "5px",
|
|
1735
|
+
width: "98px"
|
|
1736
|
+
},
|
|
1737
|
+
children: [
|
|
1738
|
+
/* @__PURE__ */ jsx2(
|
|
1739
|
+
Typography,
|
|
1740
|
+
{
|
|
1741
|
+
sx: {
|
|
1742
|
+
color: ((_K = state.callData) == null ? void 0 : _K.mute) === 1 ? "#fff" : "#000"
|
|
1743
|
+
},
|
|
1744
|
+
children: "Mute"
|
|
1745
|
+
}
|
|
1746
|
+
),
|
|
1747
|
+
muteOrUnMuteLoading ? /* @__PURE__ */ jsx2(
|
|
1748
|
+
CircularProgress,
|
|
1749
|
+
{
|
|
1750
|
+
size: "16px",
|
|
1751
|
+
sx: {
|
|
1752
|
+
color: theme.palette.primary.main
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
) : /* @__PURE__ */ jsx2(Mic, {})
|
|
1756
|
+
]
|
|
1757
|
+
}
|
|
1758
|
+
)
|
|
1759
|
+
}
|
|
1760
|
+
) }),
|
|
1613
1761
|
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx2(Tooltip, { title: "Call", children: /* @__PURE__ */ jsx2(
|
|
1614
1762
|
Button,
|
|
1615
1763
|
{
|
|
@@ -1647,31 +1795,25 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1647
1795
|
)
|
|
1648
1796
|
}
|
|
1649
1797
|
) }),
|
|
1650
|
-
(each == null ? void 0 : each.line)
|
|
1798
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx2(Tooltip, { title: "Merge Call", children: /* @__PURE__ */ jsx2(
|
|
1651
1799
|
Button,
|
|
1652
1800
|
{
|
|
1653
|
-
variant:
|
|
1654
|
-
sx:
|
|
1801
|
+
variant: (each == null ? void 0 : each.status) === "ONCALL" ? "contained" : "outlined",
|
|
1802
|
+
sx: (each == null ? void 0 : each.status) === "ONCALL" ? __spreadValues({}, enabled) : __spreadValues({}, disabled),
|
|
1655
1803
|
onClick: () => {
|
|
1656
1804
|
onMergeConferenceCall(each, {
|
|
1657
1805
|
isMergeCall: true
|
|
1658
1806
|
});
|
|
1659
1807
|
},
|
|
1660
|
-
disabled:
|
|
1661
|
-
children:
|
|
1662
|
-
(each == null ? void 0 : each.isMergeCall) ? "Merged" : "Merge",
|
|
1663
|
-
conferenceCallMerge ? /* @__PURE__ */ jsx2(CircularProgress, { size: "20px" }) : /* @__PURE__ */ jsx2(CallSplit, {})
|
|
1664
|
-
]
|
|
1808
|
+
disabled: (each == null ? void 0 : each.status) !== "ONCALL",
|
|
1809
|
+
children: conferenceCallMerge ? /* @__PURE__ */ jsx2(CircularProgress, { size: "20px" }) : /* @__PURE__ */ jsx2(CallSplit, {})
|
|
1665
1810
|
}
|
|
1666
1811
|
) }),
|
|
1667
|
-
/* @__PURE__ */ jsx2(Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Un Hold", children: /* @__PURE__ */ jsx2(
|
|
1812
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx2(Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Un Hold", children: /* @__PURE__ */ jsx2(
|
|
1668
1813
|
Button,
|
|
1669
1814
|
{
|
|
1670
1815
|
variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",
|
|
1671
|
-
sx: (each == null ? void 0 : each.status) === "
|
|
1672
|
-
// each.status === "IDLE"
|
|
1673
|
-
__spreadValues({}, outlined)
|
|
1674
|
-
) : __spreadValues({}, disabled),
|
|
1816
|
+
sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1675
1817
|
onClick: () => {
|
|
1676
1818
|
if (each.status === "HOLD") {
|
|
1677
1819
|
onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
|
|
@@ -1679,7 +1821,11 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1679
1821
|
onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
|
|
1680
1822
|
}
|
|
1681
1823
|
},
|
|
1682
|
-
disabled: (each == null ? void 0 : each.status)
|
|
1824
|
+
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD" || // each?.status === "IDLE" ||
|
|
1825
|
+
// each?.status === "ONCALL" ||
|
|
1826
|
+
// each?.status === "DIALING" ||
|
|
1827
|
+
// each?.status === "RINGING" ||
|
|
1828
|
+
conferenceCallHoldOrUnHold,
|
|
1683
1829
|
children: conferenceCallHoldOrUnHold ? /* @__PURE__ */ jsx2(
|
|
1684
1830
|
CircularProgress,
|
|
1685
1831
|
{
|
|
@@ -1691,31 +1837,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1691
1837
|
) : each.status === "HOLD" ? /* @__PURE__ */ jsx2(PlayArrow, {}) : /* @__PURE__ */ jsx2(Pause, {})
|
|
1692
1838
|
}
|
|
1693
1839
|
) }),
|
|
1694
|
-
/* @__PURE__ */ jsx2(Tooltip, { title:
|
|
1695
|
-
Button,
|
|
1696
|
-
{
|
|
1697
|
-
variant: each.status === "MUTE" ? "contained" : "outlined",
|
|
1698
|
-
sx: each.status === "DISCONNECTED" || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" || (each == null ? void 0 : each.status) === "DIALING" || (each == null ? void 0 : each.status) === "RINGING" ? __spreadValues({}, disabled) : (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1699
|
-
onClick: () => {
|
|
1700
|
-
if (each.status === "MUTE") {
|
|
1701
|
-
onMuteOrUnMuteConferenceCall(each, { isMute: false }, "PLAYUSER");
|
|
1702
|
-
} else {
|
|
1703
|
-
onMuteOrUnMuteConferenceCall(each, { isMute: true }, "MUTEUSER");
|
|
1704
|
-
}
|
|
1705
|
-
},
|
|
1706
|
-
disabled: (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "IDLE" || (each == null ? void 0 : each.status) === "HOLD" || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "DIALING" || (each == null ? void 0 : each.status) === "RINGING" || conferenceCallMuteOrUnMute,
|
|
1707
|
-
children: conferenceCallMuteOrUnMute ? /* @__PURE__ */ jsx2(
|
|
1708
|
-
CircularProgress,
|
|
1709
|
-
{
|
|
1710
|
-
size: "20px",
|
|
1711
|
-
sx: {
|
|
1712
|
-
color: theme.palette.primary.main
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
) : each.status === "MUTE" ? /* @__PURE__ */ jsx2(MicOff, {}) : /* @__PURE__ */ jsx2(Mic, {})
|
|
1716
|
-
}
|
|
1717
|
-
) }),
|
|
1718
|
-
(each == null ? void 0 : each.line) !== 1 ? /* @__PURE__ */ jsx2(Tooltip, { title: "End Call", children: /* @__PURE__ */ jsx2(
|
|
1840
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx2(Tooltip, { title: "End Call", children: /* @__PURE__ */ jsx2(
|
|
1719
1841
|
Button,
|
|
1720
1842
|
{
|
|
1721
1843
|
variant: (each == null ? void 0 : each.status) !== "IDLE" && (each == null ? void 0 : each.status) !== "DISCONNECTED" ? "contained" : "outlined",
|
|
@@ -1749,32 +1871,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1749
1871
|
}
|
|
1750
1872
|
) : /* @__PURE__ */ jsx2(CallEnd, {})
|
|
1751
1873
|
}
|
|
1752
|
-
) })
|
|
1753
|
-
Button,
|
|
1754
|
-
{
|
|
1755
|
-
variant: (each == null ? void 0 : each.status) !== "IDLE" || (each == null ? void 0 : each.status) !== "DISCONNECTED" ? "contained" : "outlined",
|
|
1756
|
-
color: "error",
|
|
1757
|
-
sx: {
|
|
1758
|
-
display: "none"
|
|
1759
|
-
},
|
|
1760
|
-
onClick: () => {
|
|
1761
|
-
onEndConferenceCall(each, {
|
|
1762
|
-
isCallStart: false,
|
|
1763
|
-
isMergeCall: false,
|
|
1764
|
-
isMute: false,
|
|
1765
|
-
isHold: false
|
|
1766
|
-
});
|
|
1767
|
-
},
|
|
1768
|
-
disabled: (each == null ? void 0 : each.status) === "IDLE" || (each == null ? void 0 : each.status) === "DISCONNECTED" || conferenceCallEnd,
|
|
1769
|
-
children: conferenceCallEnd ? /* @__PURE__ */ jsx2(
|
|
1770
|
-
CircularProgress,
|
|
1771
|
-
{
|
|
1772
|
-
size: "20px",
|
|
1773
|
-
color: "error"
|
|
1774
|
-
}
|
|
1775
|
-
) : /* @__PURE__ */ jsx2(CallEnd, {})
|
|
1776
|
-
}
|
|
1777
|
-
)
|
|
1874
|
+
) })
|
|
1778
1875
|
]
|
|
1779
1876
|
}
|
|
1780
1877
|
)
|
|
@@ -1815,22 +1912,12 @@ function ConferenceDialog() {
|
|
|
1815
1912
|
setConferenceCallEndAll(false);
|
|
1816
1913
|
});
|
|
1817
1914
|
};
|
|
1818
|
-
const isMergeCall = useMemo(() => {
|
|
1819
|
-
var _a3;
|
|
1820
|
-
return (_a3 = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a3.some((each) => {
|
|
1821
|
-
if ((each == null ? void 0 : each.line) !== 1) {
|
|
1822
|
-
return (each == null ? void 0 : each.status) === "ONCALL";
|
|
1823
|
-
}
|
|
1824
|
-
return false;
|
|
1825
|
-
});
|
|
1826
|
-
}, [state == null ? void 0 : state.conferenceLine]);
|
|
1827
1915
|
return /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(
|
|
1828
1916
|
Dialog,
|
|
1829
1917
|
{
|
|
1830
1918
|
open: state.openConferenceDialog,
|
|
1831
1919
|
"aria-labelledby": "alert-dialog-title",
|
|
1832
1920
|
"aria-describedby": "alert-dialog-description",
|
|
1833
|
-
fullWidth: true,
|
|
1834
1921
|
maxWidth: "md",
|
|
1835
1922
|
children: /* @__PURE__ */ jsxs2(Paper, { sx: { borderRadius: 2 }, children: [
|
|
1836
1923
|
/* @__PURE__ */ jsxs2(
|
|
@@ -1899,15 +1986,6 @@ function ConferenceDialog() {
|
|
|
1899
1986
|
children: "Status"
|
|
1900
1987
|
}
|
|
1901
1988
|
),
|
|
1902
|
-
/* @__PURE__ */ jsx2(
|
|
1903
|
-
TableCell,
|
|
1904
|
-
{
|
|
1905
|
-
sx: {
|
|
1906
|
-
padding: "6px"
|
|
1907
|
-
},
|
|
1908
|
-
children: "Call Type"
|
|
1909
|
-
}
|
|
1910
|
-
),
|
|
1911
1989
|
/* @__PURE__ */ jsx2(
|
|
1912
1990
|
TableCell,
|
|
1913
1991
|
{
|
|
@@ -1929,13 +2007,7 @@ function ConferenceDialog() {
|
|
|
1929
2007
|
]
|
|
1930
2008
|
}
|
|
1931
2009
|
) }),
|
|
1932
|
-
/* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(
|
|
1933
|
-
ConferenceTableRow,
|
|
1934
|
-
{
|
|
1935
|
-
each,
|
|
1936
|
-
isMergeCall
|
|
1937
|
-
}
|
|
1938
|
-
)) })
|
|
2010
|
+
/* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(ConferenceTableRow, { each })) })
|
|
1939
2011
|
]
|
|
1940
2012
|
}
|
|
1941
2013
|
)
|
|
@@ -2841,19 +2913,19 @@ var getCombineConfrenceData = (localState, apiData) => {
|
|
|
2841
2913
|
const localConfrenceData = localState == null ? void 0 : localState.conferenceLine;
|
|
2842
2914
|
const apiConferenceData = apiData == null ? void 0 : apiData.conferencestatus;
|
|
2843
2915
|
const updatedConferenceData = localConfrenceData.map((item) => {
|
|
2844
|
-
var _a2, _b, _c, _d;
|
|
2916
|
+
var _a2, _b, _c, _d, _e;
|
|
2845
2917
|
if ((item == null ? void 0 : item.line) === 1) {
|
|
2846
2918
|
const statusKey = `line_${item.line}_status`;
|
|
2847
2919
|
return __spreadProps(__spreadValues({}, item), {
|
|
2848
2920
|
line: 1,
|
|
2849
|
-
status: (
|
|
2850
|
-
phone: (
|
|
2921
|
+
status: (_b = apiConferenceData[statusKey]) != null ? _b : (_a2 = localState == null ? void 0 : localState.callData) == null ? void 0 : _a2.status,
|
|
2922
|
+
phone: (_d = (_c = localState == null ? void 0 : localState.callData) == null ? void 0 : _c.phone_number) != null ? _d : ""
|
|
2851
2923
|
});
|
|
2852
2924
|
} else {
|
|
2853
2925
|
const statusKey = `line_${item.line}_status`;
|
|
2854
2926
|
const phoneKey = `line_${item.line}_phonenumber`;
|
|
2855
2927
|
return __spreadProps(__spreadValues({}, item), {
|
|
2856
|
-
status: (
|
|
2928
|
+
status: (_e = apiConferenceData[statusKey]) != null ? _e : item.status,
|
|
2857
2929
|
phone: apiConferenceData[phoneKey] === null || apiConferenceData[phoneKey] === "0" ? item.phone : apiConferenceData[phoneKey]
|
|
2858
2930
|
});
|
|
2859
2931
|
}
|
|
@@ -2866,7 +2938,7 @@ var formatDuration = (seconds) => {
|
|
|
2866
2938
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
2867
2939
|
};
|
|
2868
2940
|
function CallControls({ onDataChange }) {
|
|
2869
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa;
|
|
2941
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma;
|
|
2870
2942
|
const theme = useTheme3();
|
|
2871
2943
|
const state = useSDKState();
|
|
2872
2944
|
const { showToast } = useToast();
|
|
@@ -2931,7 +3003,11 @@ function CallControls({ onDataChange }) {
|
|
|
2931
3003
|
});
|
|
2932
3004
|
const [readyAgentStatus, { isLoading: agentReadyLoading }] = usePostRequest();
|
|
2933
3005
|
const [updateAgentStatus, { isLoading }] = usePostRequest();
|
|
2934
|
-
const [endCall, { isLoading: endCallLoading }] = usePostRequest(
|
|
3006
|
+
const [endCall, { isLoading: endCallLoading }] = usePostRequest({
|
|
3007
|
+
onSuccess: () => {
|
|
3008
|
+
sdkStateManager.resetConferenceLines();
|
|
3009
|
+
}
|
|
3010
|
+
});
|
|
2935
3011
|
const handleCloseQueueCounts = () => {
|
|
2936
3012
|
setAnchorEl(null);
|
|
2937
3013
|
};
|
|
@@ -2983,15 +3059,17 @@ function CallControls({ onDataChange }) {
|
|
|
2983
3059
|
}
|
|
2984
3060
|
};
|
|
2985
3061
|
const handleHoldToggle = () => {
|
|
3062
|
+
var _a3;
|
|
2986
3063
|
const payload = {
|
|
2987
|
-
action: state.
|
|
3064
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
|
|
2988
3065
|
userId: state.agentId
|
|
2989
3066
|
};
|
|
2990
3067
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
2991
3068
|
};
|
|
2992
3069
|
const handleMuteToggle = () => {
|
|
3070
|
+
var _a3;
|
|
2993
3071
|
const payload = {
|
|
2994
|
-
action: state.
|
|
3072
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
|
|
2995
3073
|
userId: state.agentId
|
|
2996
3074
|
};
|
|
2997
3075
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
@@ -3397,16 +3475,16 @@ function CallControls({ onDataChange }) {
|
|
|
3397
3475
|
children: /* @__PURE__ */ jsx3(SupportAgent2, {})
|
|
3398
3476
|
}
|
|
3399
3477
|
) }),
|
|
3400
|
-
/* @__PURE__ */ jsx3(Tooltip2, { title: state.
|
|
3478
|
+
/* @__PURE__ */ jsx3(Tooltip2, { title: ((_I = state.callData) == null ? void 0 : _I.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ jsx3(
|
|
3401
3479
|
Button2,
|
|
3402
3480
|
{
|
|
3403
|
-
variant: state.
|
|
3481
|
+
variant: ((_J = state.callData) == null ? void 0 : _J.hold) === 1 && ((_L = (_K = state.callData) == null ? void 0 : _K.status) == null ? void 0 : _L.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3404
3482
|
onClick: (e) => {
|
|
3405
3483
|
e.stopPropagation();
|
|
3406
3484
|
handleHoldToggle();
|
|
3407
3485
|
},
|
|
3408
|
-
sx: state.
|
|
3409
|
-
disabled: ((
|
|
3486
|
+
sx: ((_M = state.callData) == null ? void 0 : _M.hold) === 1 && ((_O = (_N = state.callData) == null ? void 0 : _N.status) == null ? void 0 : _O.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_Q = (_P = state.callData) == null ? void 0 : _P.status) == null ? void 0 : _Q.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3487
|
+
disabled: ((_S = (_R = state.callData) == null ? void 0 : _R.status) == null ? void 0 : _S.toUpperCase()) !== "ONCALL" && ((_T = state.callData) == null ? void 0 : _T.hold) !== 1 || holdOrUnHoldLoading,
|
|
3410
3488
|
children: holdOrUnHoldLoading ? /* @__PURE__ */ jsx3(
|
|
3411
3489
|
CircularProgress2,
|
|
3412
3490
|
{
|
|
@@ -3415,19 +3493,19 @@ function CallControls({ onDataChange }) {
|
|
|
3415
3493
|
color: theme.palette.primary.main
|
|
3416
3494
|
}
|
|
3417
3495
|
}
|
|
3418
|
-
) : state.
|
|
3496
|
+
) : ((_U = state.callData) == null ? void 0 : _U.hold) === 1 ? /* @__PURE__ */ jsx3(PlayArrow2, {}) : /* @__PURE__ */ jsx3(Pause2, {})
|
|
3419
3497
|
}
|
|
3420
3498
|
) }),
|
|
3421
|
-
/* @__PURE__ */ jsx3(Tooltip2, { title: state.
|
|
3499
|
+
/* @__PURE__ */ jsx3(Tooltip2, { title: ((_V = state.callData) == null ? void 0 : _V.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ jsx3(
|
|
3422
3500
|
Button2,
|
|
3423
3501
|
{
|
|
3424
|
-
variant: state.isHolding ? "outlined" : state.
|
|
3502
|
+
variant: state.isHolding ? "outlined" : ((_W = state.callData) == null ? void 0 : _W.mute) === 1 && ((_Y = (_X = state.callData) == null ? void 0 : _X.status) == null ? void 0 : _Y.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3425
3503
|
onClick: (e) => {
|
|
3426
3504
|
e.stopPropagation();
|
|
3427
3505
|
handleMuteToggle();
|
|
3428
3506
|
},
|
|
3429
|
-
sx: state.
|
|
3430
|
-
disabled: ((
|
|
3507
|
+
sx: ((_Z = state.callData) == null ? void 0 : _Z.hold) === 1 ? __spreadValues({}, disabled) : ((__ = state.callData) == null ? void 0 : __.mute) === 1 && ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_ca = (_ba = state.callData) == null ? void 0 : _ba.status) == null ? void 0 : _ca.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3508
|
+
disabled: ((_ea = (_da = state.callData) == null ? void 0 : _da.status) == null ? void 0 : _ea.toUpperCase()) !== "ONCALL" && ((_fa = state.callData) == null ? void 0 : _fa.mute) !== 1 || muteOrUnMuteLoading || ((_ga = state.callData) == null ? void 0 : _ga.hold) === 1,
|
|
3431
3509
|
children: muteOrUnMuteLoading ? /* @__PURE__ */ jsx3(
|
|
3432
3510
|
CircularProgress2,
|
|
3433
3511
|
{
|
|
@@ -3436,10 +3514,10 @@ function CallControls({ onDataChange }) {
|
|
|
3436
3514
|
color: theme.palette.primary.main
|
|
3437
3515
|
}
|
|
3438
3516
|
}
|
|
3439
|
-
) : state.
|
|
3517
|
+
) : ((_ha = state.callData) == null ? void 0 : _ha.mute) === 1 ? /* @__PURE__ */ jsx3(MicOff2, {}) : /* @__PURE__ */ jsx3(Mic2, {})
|
|
3440
3518
|
}
|
|
3441
3519
|
) }),
|
|
3442
|
-
!((
|
|
3520
|
+
!((_ia = state.sdkConfig) == null ? void 0 : _ia.disableCallTransferButton) && /* @__PURE__ */ jsx3(Tooltip2, { title: "Transfer Call", children: /* @__PURE__ */ jsx3(
|
|
3443
3521
|
Button2,
|
|
3444
3522
|
{
|
|
3445
3523
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
@@ -3450,12 +3528,12 @@ function CallControls({ onDataChange }) {
|
|
|
3450
3528
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
3451
3529
|
}
|
|
3452
3530
|
},
|
|
3453
|
-
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((
|
|
3454
|
-
disabled: ((
|
|
3531
|
+
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_ka = (_ja = state.callData) == null ? void 0 : _ja.status) == null ? void 0 : _ka.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3532
|
+
disabled: ((_ma = (_la = state.callData) == null ? void 0 : _la.status) == null ? void 0 : _ma.toUpperCase()) !== "ONCALL",
|
|
3455
3533
|
children: /* @__PURE__ */ jsx3(TransferWithinAStation, {})
|
|
3456
3534
|
}
|
|
3457
3535
|
) }),
|
|
3458
|
-
!((
|
|
3536
|
+
!((_na = state.sdkConfig) == null ? void 0 : _na.disableConferenceButton) && /* @__PURE__ */ jsx3(Tooltip2, { title: "Conference Call", children: /* @__PURE__ */ jsx3(
|
|
3459
3537
|
Button2,
|
|
3460
3538
|
{
|
|
3461
3539
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
@@ -3466,15 +3544,15 @@ function CallControls({ onDataChange }) {
|
|
|
3466
3544
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
3467
3545
|
}
|
|
3468
3546
|
},
|
|
3469
|
-
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((
|
|
3470
|
-
disabled: ((
|
|
3547
|
+
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_pa = (_oa = state.callData) == null ? void 0 : _oa.status) == null ? void 0 : _pa.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3548
|
+
disabled: ((_ra = (_qa = state.callData) == null ? void 0 : _qa.status) == null ? void 0 : _ra.toUpperCase()) !== "ONCALL",
|
|
3471
3549
|
children: /* @__PURE__ */ jsx3(Group, {})
|
|
3472
3550
|
}
|
|
3473
3551
|
) }),
|
|
3474
|
-
!((
|
|
3552
|
+
!((_sa = state.sdkConfig) == null ? void 0 : _sa.disableEndCallButton) && /* @__PURE__ */ jsx3(Tooltip2, { title: "End Call", children: /* @__PURE__ */ jsx3(
|
|
3475
3553
|
Button2,
|
|
3476
3554
|
{
|
|
3477
|
-
variant: ((
|
|
3555
|
+
variant: ((_ua = (_ta = state.callData) == null ? void 0 : _ta.status) == null ? void 0 : _ua.toUpperCase()) === "ONCALL" || ((_wa = (_va = state.callData) == null ? void 0 : _va.status) == null ? void 0 : _wa.toUpperCase()) === "RINGING" || ((_ya = (_xa = state.callData) == null ? void 0 : _xa.status) == null ? void 0 : _ya.toUpperCase()) === "WRAPUP" ? "contained" : "outlined",
|
|
3478
3556
|
onClick: (e) => {
|
|
3479
3557
|
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
3480
3558
|
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" || ((_d2 = (_c2 = state.callData) == null ? void 0 : _c2.status) == null ? void 0 : _d2.toUpperCase()) === "RINGING" || ((_f2 = (_e2 = state.callData) == null ? void 0 : _e2.status) == null ? void 0 : _f2.toUpperCase()) === "WRAPUP") {
|
|
@@ -3482,7 +3560,7 @@ function CallControls({ onDataChange }) {
|
|
|
3482
3560
|
setOpenCallDisposition(true);
|
|
3483
3561
|
}
|
|
3484
3562
|
},
|
|
3485
|
-
sx: ((
|
|
3563
|
+
sx: ((_Aa = (_za = state.callData) == null ? void 0 : _za.status) == null ? void 0 : _Aa.toUpperCase()) === "ONCALL" || ((_Ca = (_Ba = state.callData) == null ? void 0 : _Ba.status) == null ? void 0 : _Ca.toUpperCase()) === "RINGING" || ((_Ea = (_Da = state.callData) == null ? void 0 : _Da.status) == null ? void 0 : _Ea.toUpperCase()) === "WRAPUP" ? __spreadProps(__spreadValues({}, enabled), {
|
|
3486
3564
|
borderRight: "1px",
|
|
3487
3565
|
backgroundColor: "error.main",
|
|
3488
3566
|
minWidth: "60px !important",
|
|
@@ -3501,7 +3579,7 @@ function CallControls({ onDataChange }) {
|
|
|
3501
3579
|
}) : __spreadProps(__spreadValues({}, disabled), {
|
|
3502
3580
|
minWidth: "60px !important"
|
|
3503
3581
|
}),
|
|
3504
|
-
disabled: ((
|
|
3582
|
+
disabled: ((_Ga = (_Fa = state.callData) == null ? void 0 : _Fa.status) == null ? void 0 : _Ga.toUpperCase()) !== "ONCALL" && ((_Ia = (_Ha = state.callData) == null ? void 0 : _Ha.status) == null ? void 0 : _Ia.toUpperCase()) !== "RINGING" && ((_Ka = (_Ja = state.callData) == null ? void 0 : _Ja.status) == null ? void 0 : _Ka.toUpperCase()) !== "WRAPUP" || endCallLoading,
|
|
3505
3583
|
children: endCallLoading ? /* @__PURE__ */ jsx3(
|
|
3506
3584
|
CircularProgress2,
|
|
3507
3585
|
{
|
|
@@ -3541,7 +3619,7 @@ function CallControls({ onDataChange }) {
|
|
|
3541
3619
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3542
3620
|
duration: theme.transitions.duration.short
|
|
3543
3621
|
}),
|
|
3544
|
-
visibility: showIframe && !((
|
|
3622
|
+
visibility: showIframe && !((_La = state.sdkConfig) == null ? void 0 : _La.disableSoftPhone) ? "visible" : "hidden",
|
|
3545
3623
|
userSelect: "none"
|
|
3546
3624
|
},
|
|
3547
3625
|
children: [
|
|
@@ -3575,7 +3653,7 @@ function CallControls({ onDataChange }) {
|
|
|
3575
3653
|
/* @__PURE__ */ jsx3(Box2, { children: /* @__PURE__ */ jsx3(
|
|
3576
3654
|
"iframe",
|
|
3577
3655
|
{
|
|
3578
|
-
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(
|
|
3656
|
+
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_Ma = state.process) == null ? void 0 : _Ma.process_id}`,
|
|
3579
3657
|
height: 380,
|
|
3580
3658
|
width: 420,
|
|
3581
3659
|
allow: "camera; microphone; autoplay",
|