call-control-sdk 6.4.5-beta.11 → 6.4.5-beta.12

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 CHANGED
@@ -1360,8 +1360,8 @@ var styles_default = useStyles;
1360
1360
 
1361
1361
  // call-control-sdk/lib/components/dialog.tsx
1362
1362
  var import_jsx_runtime2 = require("react/jsx-runtime");
1363
- var ConferenceTableRow = ({ each, isMergeCall }) => {
1364
- var _a2, _b, _c, _d, _e;
1363
+ var ConferenceTableRow = ({ each }) => {
1364
+ 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;
1365
1365
  const state = useSDKState();
1366
1366
  const { showToast } = useToast();
1367
1367
  const { disabled, enabled, outlined } = styles_default({
@@ -1373,7 +1373,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1373
1373
  const [conferenceCallStart, setConferenceCallStart] = (0, import_react10.useState)(false);
1374
1374
  const [conferenceCallMerge, setConferenceCallMerge] = (0, import_react10.useState)(false);
1375
1375
  const [conferenceCallHoldOrUnHold, setConferenceCallHoldOrUnHold] = (0, import_react10.useState)(false);
1376
- const [conferenceCallMuteOrUnMute, setConferenceCallMuteOrUnMute] = (0, import_react10.useState)(false);
1377
1376
  const [conferenceCallEnd, setConferenceCallEnd] = (0, import_react10.useState)(false);
1378
1377
  const onConferenceLineUpdate = (line, data) => {
1379
1378
  sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
@@ -1449,30 +1448,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1449
1448
  setConferenceCallHoldOrUnHold(false);
1450
1449
  });
1451
1450
  };
1452
- const onMuteOrUnMuteConferenceCall = (line, data, type) => {
1453
- var _a3, _b2, _c2, _d2;
1454
- const line_used = __spreadValues(__spreadValues({}, line), data);
1455
- setConferenceCallMuteOrUnMute(true);
1456
- const payload = {
1457
- action: "EXTERNAL_CONFERENCE",
1458
- operation: type,
1459
- channel_no: type === "MUTEUSER" ? `mute${line_used.line}` : `play${line_used.line}`,
1460
- userid: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.agent_id) != null ? _b2 : "",
1461
- thirdparty_no: line_used.phone,
1462
- process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : ""
1463
- };
1464
- axios_default.post(END_POINT.CONFERENCE_CALL_MUTE_OT_UN_MUTE, payload).then((res) => {
1465
- var _a4;
1466
- showToast((_a4 = res.data) == null ? void 0 : _a4.message, "success");
1467
- sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
1468
- }).catch((err) => {
1469
- var _a4, _b3, _c3, _d3;
1470
- 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";
1471
- showToast(message, "error");
1472
- }).finally(() => {
1473
- setConferenceCallMuteOrUnMute(false);
1474
- });
1475
- };
1476
1451
  const onEndConferenceCall = (line, data) => {
1477
1452
  var _a3, _b2, _c2, _d2;
1478
1453
  const line_used = __spreadValues(__spreadValues({}, line), data);
@@ -1498,6 +1473,38 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1498
1473
  setConferenceCallEnd(false);
1499
1474
  });
1500
1475
  };
1476
+ const [holdOrUnHold, { isLoading: holdOrUnHoldLoading }] = usePostRequest({
1477
+ onSuccess: () => {
1478
+ sdkStateManager.setHolding(!state.isHolding);
1479
+ },
1480
+ onError: (error) => {
1481
+ console.log("\u274C Hold operation error:", error);
1482
+ }
1483
+ });
1484
+ const [muteOrUnMute, { isLoading: muteOrUnMuteLoading }] = usePostRequest({
1485
+ onSuccess: () => {
1486
+ sdkStateManager.setMuted(!state.isMuted);
1487
+ },
1488
+ onError: (error) => {
1489
+ console.log("\u274C Mute operation error:", error);
1490
+ }
1491
+ });
1492
+ const handleHoldToggle = () => {
1493
+ var _a3;
1494
+ const payload = {
1495
+ action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
1496
+ userId: state.agentId
1497
+ };
1498
+ holdOrUnHold(END_POINT.HOLD_CALL, payload);
1499
+ };
1500
+ const handleMuteToggle = () => {
1501
+ var _a3;
1502
+ const payload = {
1503
+ action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
1504
+ userId: state.agentId
1505
+ };
1506
+ muteOrUnMute(END_POINT.MUTE_CALL, payload);
1507
+ };
1501
1508
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1502
1509
  import_material3.TableRow,
1503
1510
  {
@@ -1509,7 +1516,9 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1509
1516
  import_material3.TableCell,
1510
1517
  {
1511
1518
  sx: {
1512
- padding: "6px"
1519
+ padding: "6px",
1520
+ flex: 1,
1521
+ width: "100px"
1513
1522
  },
1514
1523
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Typography, { children: [
1515
1524
  "Line ",
@@ -1522,7 +1531,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1522
1531
  import_material3.TableCell,
1523
1532
  {
1524
1533
  sx: {
1525
- padding: "6px"
1534
+ padding: "6px",
1535
+ width: "100px"
1526
1536
  },
1527
1537
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1528
1538
  import_material3.Typography,
@@ -1530,7 +1540,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1530
1540
  variant: "body2",
1531
1541
  sx: {
1532
1542
  px: 1,
1533
- borderRadius: "10px"
1543
+ borderRadius: "10px",
1544
+ flex: 1
1534
1545
  },
1535
1546
  children: (_e = each == null ? void 0 : each.status) != null ? _e : ""
1536
1547
  }
@@ -1541,25 +1552,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1541
1552
  import_material3.TableCell,
1542
1553
  {
1543
1554
  sx: {
1544
- padding: "6px"
1545
- },
1546
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1547
- import_material3.Button,
1548
- {
1549
- sx: {
1550
- textTransform: "capitalize"
1551
- },
1552
- size: "small",
1553
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Typography, { variant: "body2", children: (each == null ? void 0 : each.line) === 1 ? "Internal" : "External" })
1554
- }
1555
- )
1556
- }
1557
- ),
1558
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1559
- import_material3.TableCell,
1560
- {
1561
- sx: {
1562
- padding: "6px"
1555
+ padding: "6px",
1556
+ flex: 1
1563
1557
  },
1564
1558
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1565
1559
  import_material3.TextField,
@@ -1568,7 +1562,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1568
1562
  placeholder: "Phone Number",
1569
1563
  fullWidth: true,
1570
1564
  value: (each == null ? void 0 : each.phone) || "",
1571
- 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",
1565
+ 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",
1572
1566
  onChange: (e) => {
1573
1567
  onConferenceLineUpdate(each, { phone: e.target.value });
1574
1568
  }
@@ -1580,18 +1574,172 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1580
1574
  import_material3.TableCell,
1581
1575
  {
1582
1576
  sx: {
1583
- padding: "6px"
1577
+ padding: "6px",
1578
+ // width: "200px",
1579
+ flex: 1
1584
1580
  },
1585
1581
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1586
1582
  import_material3.Box,
1587
1583
  {
1588
1584
  sx: {
1585
+ width: "100%",
1589
1586
  display: "flex",
1590
1587
  alignItems: "center",
1591
- justifyContent: "space-around"
1588
+ justifyContent: "flex-start",
1589
+ gap: "10px"
1592
1590
  },
1593
1591
  children: [
1594
- each.line !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1592
+ (each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: ((_f = state.callData) == null ? void 0 : _f.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1593
+ import_material3.Button,
1594
+ {
1595
+ 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",
1596
+ onClick: (e) => {
1597
+ e.stopPropagation();
1598
+ handleHoldToggle();
1599
+ },
1600
+ 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),
1601
+ 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,
1602
+ children: ((_r = state.callData) == null ? void 0 : _r.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1603
+ import_material3.Box,
1604
+ {
1605
+ sx: {
1606
+ display: "flex",
1607
+ alignItems: "center",
1608
+ justifyContent: "center",
1609
+ gap: "5px",
1610
+ width: "98px"
1611
+ },
1612
+ children: [
1613
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1614
+ import_material3.Typography,
1615
+ {
1616
+ sx: {
1617
+ color: ((_s = state.callData) == null ? void 0 : _s.hold) === 1 ? "#fff" : "initial"
1618
+ },
1619
+ children: "Unhold"
1620
+ }
1621
+ ),
1622
+ holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1623
+ import_material3.CircularProgress,
1624
+ {
1625
+ size: "16px",
1626
+ sx: {
1627
+ color: theme.palette.primary.main
1628
+ }
1629
+ }
1630
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {})
1631
+ ]
1632
+ }
1633
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1634
+ import_material3.Box,
1635
+ {
1636
+ sx: {
1637
+ display: "flex",
1638
+ alignItems: "center",
1639
+ justifyContent: "center",
1640
+ gap: "5px",
1641
+ width: "98px"
1642
+ },
1643
+ children: [
1644
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1645
+ import_material3.Typography,
1646
+ {
1647
+ sx: {
1648
+ color: ((_t = state.callData) == null ? void 0 : _t.hold) === 1 ? "#fff" : "#000"
1649
+ },
1650
+ children: "Hold"
1651
+ }
1652
+ ),
1653
+ holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1654
+ import_material3.CircularProgress,
1655
+ {
1656
+ size: "16px",
1657
+ sx: {
1658
+ color: theme.palette.primary.main
1659
+ }
1660
+ }
1661
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
1662
+ ]
1663
+ }
1664
+ )
1665
+ }
1666
+ ) }),
1667
+ (each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: ((_u = state.callData) == null ? void 0 : _u.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1668
+ import_material3.Button,
1669
+ {
1670
+ 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",
1671
+ onClick: (e) => {
1672
+ e.stopPropagation();
1673
+ handleMuteToggle();
1674
+ },
1675
+ 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),
1676
+ 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,
1677
+ children: ((_I = state.callData) == null ? void 0 : _I.mute) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1678
+ import_material3.Box,
1679
+ {
1680
+ sx: {
1681
+ display: "flex",
1682
+ alignItems: "center",
1683
+ justifyContent: "center",
1684
+ gap: "5px",
1685
+ width: "98px"
1686
+ },
1687
+ children: [
1688
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1689
+ import_material3.Typography,
1690
+ {
1691
+ sx: {
1692
+ color: ((_J = state.callData) == null ? void 0 : _J.mute) === 1 ? "#fff" : "initial"
1693
+ },
1694
+ children: "Unmute"
1695
+ }
1696
+ ),
1697
+ muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1698
+ import_material3.CircularProgress,
1699
+ {
1700
+ size: "16px",
1701
+ sx: {
1702
+ color: theme.palette.primary.main
1703
+ }
1704
+ }
1705
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MicOff, {})
1706
+ ]
1707
+ }
1708
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1709
+ import_material3.Box,
1710
+ {
1711
+ sx: {
1712
+ display: "flex",
1713
+ alignItems: "center",
1714
+ justifyContent: "center",
1715
+ gap: "5px",
1716
+ width: "98px"
1717
+ },
1718
+ children: [
1719
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1720
+ import_material3.Typography,
1721
+ {
1722
+ sx: {
1723
+ color: ((_K = state.callData) == null ? void 0 : _K.mute) === 1 ? "#fff" : "#000"
1724
+ },
1725
+ children: "Mute"
1726
+ }
1727
+ ),
1728
+ muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1729
+ import_material3.CircularProgress,
1730
+ {
1731
+ size: "16px",
1732
+ sx: {
1733
+ color: theme.palette.primary.main
1734
+ }
1735
+ }
1736
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Mic, {})
1737
+ ]
1738
+ }
1739
+ )
1740
+ }
1741
+ ) }),
1742
+ (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1595
1743
  import_material3.Button,
1596
1744
  {
1597
1745
  variant: (each == null ? void 0 : each.status) !== "IDLE" ? "outlined" : "contained",
@@ -1628,31 +1776,25 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1628
1776
  )
1629
1777
  }
1630
1778
  ) }),
1631
- each.line === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "Merge Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1779
+ (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "Merge Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1632
1780
  import_material3.Button,
1633
1781
  {
1634
- variant: isMergeCall ? "contained" : "outlined",
1635
- sx: isMergeCall ? __spreadProps(__spreadValues({}, enabled), { padding: "0px 16px" }) : __spreadProps(__spreadValues({}, disabled), { padding: "0px 16px" }),
1782
+ variant: (each == null ? void 0 : each.status) === "ONCALL" ? "contained" : "outlined",
1783
+ sx: (each == null ? void 0 : each.status) === "ONCALL" ? __spreadValues({}, enabled) : __spreadValues({}, disabled),
1636
1784
  onClick: () => {
1637
1785
  onMergeConferenceCall(each, {
1638
1786
  isMergeCall: true
1639
1787
  });
1640
1788
  },
1641
- disabled: !isMergeCall || conferenceCallMerge,
1642
- children: [
1643
- (each == null ? void 0 : each.isMergeCall) ? "Merged" : "Merge",
1644
- conferenceCallMerge ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.CircularProgress, { size: "20px" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallSplit, {})
1645
- ]
1789
+ disabled: (each == null ? void 0 : each.status) !== "ONCALL",
1790
+ children: conferenceCallMerge ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.CircularProgress, { size: "20px" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallSplit, {})
1646
1791
  }
1647
1792
  ) }),
1648
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: each.status !== "HOLD" ? "Hold" : "Un Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1793
+ (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Un Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1649
1794
  import_material3.Button,
1650
1795
  {
1651
- variant: each.status === "HOLD" ? "contained" : "outlined",
1652
- sx: each.status === "DISCONNECTED" || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, disabled) : (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" ? (
1653
- // each.status === "IDLE"
1654
- __spreadValues({}, outlined)
1655
- ) : __spreadValues({}, disabled),
1796
+ variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",
1797
+ sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
1656
1798
  onClick: () => {
1657
1799
  if (each.status === "HOLD") {
1658
1800
  onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
@@ -1660,7 +1802,11 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1660
1802
  onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
1661
1803
  }
1662
1804
  },
1663
- disabled: (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "IDLE" || conferenceCallHoldOrUnHold,
1805
+ disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD" || // each?.status === "IDLE" ||
1806
+ // each?.status === "ONCALL" ||
1807
+ // each?.status === "DIALING" ||
1808
+ // each?.status === "RINGING" ||
1809
+ conferenceCallHoldOrUnHold,
1664
1810
  children: conferenceCallHoldOrUnHold ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1665
1811
  import_material3.CircularProgress,
1666
1812
  {
@@ -1672,31 +1818,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1672
1818
  ) : each.status === "HOLD" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
1673
1819
  }
1674
1820
  ) }),
1675
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: each.status !== "MUTE" ? "Mute" : "Un Mute", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1676
- import_material3.Button,
1677
- {
1678
- variant: each.status === "MUTE" ? "contained" : "outlined",
1679
- sx: each.status === "DISCONNECTED" || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, disabled) : (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
1680
- onClick: () => {
1681
- if (each.status === "MUTE") {
1682
- onMuteOrUnMuteConferenceCall(each, { isMute: false }, "PLAYUSER");
1683
- } else {
1684
- onMuteOrUnMuteConferenceCall(each, { isMute: true }, "MUTEUSER");
1685
- }
1686
- },
1687
- disabled: (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "IDLE" || (each == null ? void 0 : each.status) === "HOLD" || conferenceCallMuteOrUnMute,
1688
- children: conferenceCallMuteOrUnMute ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1689
- import_material3.CircularProgress,
1690
- {
1691
- size: "20px",
1692
- sx: {
1693
- color: theme.palette.primary.main
1694
- }
1695
- }
1696
- ) : each.status === "MUTE" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Mic, {})
1697
- }
1698
- ) }),
1699
- (each == null ? void 0 : each.line) !== 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1821
+ (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1700
1822
  import_material3.Button,
1701
1823
  {
1702
1824
  variant: (each == null ? void 0 : each.status) !== "IDLE" && (each == null ? void 0 : each.status) !== "DISCONNECTED" ? "contained" : "outlined",
@@ -1730,32 +1852,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
1730
1852
  }
1731
1853
  ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallEnd, {})
1732
1854
  }
1733
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1734
- import_material3.Button,
1735
- {
1736
- variant: (each == null ? void 0 : each.isCallStart) ? "contained" : "outlined",
1737
- color: "error",
1738
- sx: {
1739
- display: "none"
1740
- },
1741
- onClick: () => {
1742
- onEndConferenceCall(each, {
1743
- isCallStart: false,
1744
- isMergeCall: false,
1745
- isMute: false,
1746
- isHold: false
1747
- });
1748
- },
1749
- disabled: (each == null ? void 0 : each.status) === "IDLE" || (each == null ? void 0 : each.status) === "DISCONNECTED" || conferenceCallEnd,
1750
- children: conferenceCallEnd ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1751
- import_material3.CircularProgress,
1752
- {
1753
- size: "20px",
1754
- color: "error"
1755
- }
1756
- ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallEnd, {})
1757
- }
1758
- )
1855
+ ) })
1759
1856
  ]
1760
1857
  }
1761
1858
  )
@@ -1796,22 +1893,12 @@ function ConferenceDialog() {
1796
1893
  setConferenceCallEndAll(false);
1797
1894
  });
1798
1895
  };
1799
- const isMergeCall = (0, import_react10.useMemo)(() => {
1800
- var _a3;
1801
- return (_a3 = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a3.some((each) => {
1802
- if (each.line !== 1) {
1803
- return each.status === "ONCALL";
1804
- }
1805
- return false;
1806
- });
1807
- }, [state.conferenceLine]);
1808
1896
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1809
1897
  import_material3.Dialog,
1810
1898
  {
1811
1899
  open: state.openConferenceDialog,
1812
1900
  "aria-labelledby": "alert-dialog-title",
1813
1901
  "aria-describedby": "alert-dialog-description",
1814
- fullWidth: true,
1815
1902
  maxWidth: "md",
1816
1903
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Paper, { sx: { borderRadius: 2 }, children: [
1817
1904
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
@@ -1880,15 +1967,6 @@ function ConferenceDialog() {
1880
1967
  children: "Status"
1881
1968
  }
1882
1969
  ),
1883
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1884
- import_material3.TableCell,
1885
- {
1886
- sx: {
1887
- padding: "6px"
1888
- },
1889
- children: "Call Type"
1890
- }
1891
- ),
1892
1970
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1893
1971
  import_material3.TableCell,
1894
1972
  {
@@ -1910,13 +1988,7 @@ function ConferenceDialog() {
1910
1988
  ]
1911
1989
  }
1912
1990
  ) }),
1913
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1914
- ConferenceTableRow,
1915
- {
1916
- each,
1917
- isMergeCall
1918
- }
1919
- )) })
1991
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ConferenceTableRow, { each })) })
1920
1992
  ]
1921
1993
  }
1922
1994
  )
@@ -2767,7 +2839,7 @@ async function createAudioElement() {
2767
2839
  audio.loop = true;
2768
2840
  audio.volume = 0.7;
2769
2841
  audio.preload = "auto";
2770
- let audioUrl = null;
2842
+ let audioUrl = "";
2771
2843
  try {
2772
2844
  audioUrl = await loadAudioAsBlob();
2773
2845
  } catch (error) {
@@ -2818,26 +2890,24 @@ function cleanupAudioResources() {
2818
2890
 
2819
2891
  // call-control-sdk/lib/components/callControls.tsx
2820
2892
  var import_jsx_runtime3 = require("react/jsx-runtime");
2821
- var getCombineConfrenceData = (conferenceData, apiData, data) => {
2822
- const updatedConferenceData = conferenceData.map((item) => {
2823
- var _a2, _b, _c;
2893
+ var getCombineConfrenceData = (localState, apiData) => {
2894
+ const localConfrenceData = localState == null ? void 0 : localState.conferenceLine;
2895
+ const apiConferenceData = apiData == null ? void 0 : apiData.conferencestatus;
2896
+ const updatedConferenceData = localConfrenceData.map((item) => {
2897
+ var _a2, _b, _c, _d, _e;
2824
2898
  if ((item == null ? void 0 : item.line) === 1) {
2825
2899
  const statusKey = `line_${item.line}_status`;
2826
2900
  return __spreadProps(__spreadValues({}, item), {
2827
2901
  line: 1,
2828
- status: (_a2 = apiData[statusKey]) != null ? _a2 : data == null ? void 0 : data.status,
2829
- phone: (_b = data == null ? void 0 : data.phone_number) != null ? _b : ""
2830
- // isMute: false,
2831
- // isHold: false,
2832
- // isMergeCall: false,
2833
- // isCallStart: true,
2902
+ status: (_b = apiConferenceData[statusKey]) != null ? _b : (_a2 = localState == null ? void 0 : localState.callData) == null ? void 0 : _a2.status,
2903
+ phone: (_d = (_c = localState == null ? void 0 : localState.callData) == null ? void 0 : _c.phone_number) != null ? _d : ""
2834
2904
  });
2835
2905
  } else {
2836
2906
  const statusKey = `line_${item.line}_status`;
2837
2907
  const phoneKey = `line_${item.line}_phonenumber`;
2838
2908
  return __spreadProps(__spreadValues({}, item), {
2839
- status: (_c = apiData[statusKey]) != null ? _c : "IDLE",
2840
- phone: apiData[phoneKey] !== "0" ? apiData[phoneKey] : ""
2909
+ status: (_e = apiConferenceData[statusKey]) != null ? _e : item.status,
2910
+ phone: apiConferenceData[phoneKey] === null || apiConferenceData[phoneKey] === "0" ? item.phone : apiConferenceData[phoneKey]
2841
2911
  });
2842
2912
  }
2843
2913
  });
@@ -2849,7 +2919,7 @@ var formatDuration = (seconds) => {
2849
2919
  return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
2850
2920
  };
2851
2921
  function CallControls({ onDataChange }) {
2852
- 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;
2922
+ 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;
2853
2923
  const theme = (0, import_material4.useTheme)();
2854
2924
  const state = useSDKState();
2855
2925
  const { showToast } = useToast();
@@ -2864,7 +2934,7 @@ function CallControls({ onDataChange }) {
2864
2934
  const pingIntervalRef = (0, import_react11.useRef)(null);
2865
2935
  const reconnectAttemptsRef = (0, import_react11.useRef)(0);
2866
2936
  const maxReconnectAttempts = 60;
2867
- const baseReconnectDelay = 1e3;
2937
+ const baseReconnectDelay = 2e3;
2868
2938
  const maxReconnectDelay = 3e4;
2869
2939
  const [anchorEl, setAnchorEl] = (0, import_react11.useState)(null);
2870
2940
  const [showIframe, setShowIframe] = (0, import_react11.useState)(true);
@@ -2914,7 +2984,11 @@ function CallControls({ onDataChange }) {
2914
2984
  });
2915
2985
  const [readyAgentStatus, { isLoading: agentReadyLoading }] = usePostRequest();
2916
2986
  const [updateAgentStatus, { isLoading }] = usePostRequest();
2917
- const [endCall, { isLoading: endCallLoading }] = usePostRequest();
2987
+ const [endCall, { isLoading: endCallLoading }] = usePostRequest({
2988
+ onSuccess: () => {
2989
+ sdkStateManager.resetConferenceLines();
2990
+ }
2991
+ });
2918
2992
  const handleCloseQueueCounts = () => {
2919
2993
  setAnchorEl(null);
2920
2994
  };
@@ -2966,15 +3040,17 @@ function CallControls({ onDataChange }) {
2966
3040
  }
2967
3041
  };
2968
3042
  const handleHoldToggle = () => {
3043
+ var _a3;
2969
3044
  const payload = {
2970
- action: state.isHolding ? "UNHOLD" : "HOLD",
3045
+ action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
2971
3046
  userId: state.agentId
2972
3047
  };
2973
3048
  holdOrUnHold(END_POINT.HOLD_CALL, payload);
2974
3049
  };
2975
3050
  const handleMuteToggle = () => {
3051
+ var _a3;
2976
3052
  const payload = {
2977
- action: state.isMuted ? "UNMUTE" : "MUTE",
3053
+ action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
2978
3054
  userId: state.agentId
2979
3055
  };
2980
3056
  muteOrUnMute(END_POINT.MUTE_CALL, payload);
@@ -3110,11 +3186,8 @@ function CallControls({ onDataChange }) {
3110
3186
  console.log("\u{1F4E1} WebSocket pong received");
3111
3187
  return;
3112
3188
  }
3113
- const confrence = getCombineConfrenceData(
3114
- state == null ? void 0 : state.conferenceLine,
3115
- data == null ? void 0 : data.conferencestatus,
3116
- data
3117
- );
3189
+ const rls = localStorage.getItem("call-control-sdk-state");
3190
+ const confrence = getCombineConfrenceData(JSON.parse(rls || "{}"), data);
3118
3191
  sdkStateManager.updateCallData(data);
3119
3192
  sdkStateManager.updateConferenceData([...confrence]);
3120
3193
  if (data.status === "RINGING" || data.status === "DIALING") {
@@ -3123,22 +3196,19 @@ function CallControls({ onDataChange }) {
3123
3196
  console.error("Failed to play ringtone:", error);
3124
3197
  });
3125
3198
  }
3126
- }
3127
- if (data.status === "ONCALL") {
3199
+ } else {
3128
3200
  if (audioRef.current) {
3129
3201
  audioRef.current.pause();
3130
3202
  audioRef.current.currentTime = 0;
3131
3203
  }
3204
+ }
3205
+ if (data.status === "ONCALL") {
3132
3206
  sdkStateManager.startCall();
3133
3207
  if (!showIframe) {
3134
3208
  setShowIframe(true);
3135
3209
  }
3136
3210
  }
3137
3211
  if (data.status === "WRAPUP") {
3138
- if (audioRef.current) {
3139
- audioRef.current.pause();
3140
- audioRef.current.currentTime = 0;
3141
- }
3142
3212
  sdkStateManager.endCall();
3143
3213
  }
3144
3214
  } catch (e) {
@@ -3386,16 +3456,16 @@ function CallControls({ onDataChange }) {
3386
3456
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SupportAgent, {})
3387
3457
  }
3388
3458
  ) }),
3389
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: state.isHolding ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3459
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_I = state.callData) == null ? void 0 : _I.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3390
3460
  import_material4.Button,
3391
3461
  {
3392
- variant: state.isHolding && ((_J = (_I = state.callData) == null ? void 0 : _I.status) == null ? void 0 : _J.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
3462
+ 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",
3393
3463
  onClick: (e) => {
3394
3464
  e.stopPropagation();
3395
3465
  handleHoldToggle();
3396
3466
  },
3397
- sx: state.isHolding && ((_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),
3398
- disabled: ((_P = (_O = state.callData) == null ? void 0 : _O.status) == null ? void 0 : _P.toUpperCase()) !== "ONCALL" && !state.isHolding || holdOrUnHoldLoading,
3467
+ 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),
3468
+ 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,
3399
3469
  children: holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3400
3470
  import_material4.CircularProgress,
3401
3471
  {
@@ -3404,19 +3474,19 @@ function CallControls({ onDataChange }) {
3404
3474
  color: theme.palette.primary.main
3405
3475
  }
3406
3476
  }
3407
- ) : state.isHolding ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Pause, {})
3477
+ ) : ((_U = state.callData) == null ? void 0 : _U.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Pause, {})
3408
3478
  }
3409
3479
  ) }),
3410
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: state.isMuted ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3480
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_V = state.callData) == null ? void 0 : _V.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3411
3481
  import_material4.Button,
3412
3482
  {
3413
- variant: state.isMuted && ((_R = (_Q = state.callData) == null ? void 0 : _Q.status) == null ? void 0 : _R.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
3483
+ 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",
3414
3484
  onClick: (e) => {
3415
3485
  e.stopPropagation();
3416
3486
  handleMuteToggle();
3417
3487
  },
3418
- sx: state.isMuted && ((_T = (_S = state.callData) == null ? void 0 : _S.status) == null ? void 0 : _T.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_V = (_U = state.callData) == null ? void 0 : _U.status) == null ? void 0 : _V.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
3419
- disabled: ((_X = (_W = state.callData) == null ? void 0 : _W.status) == null ? void 0 : _X.toUpperCase()) !== "ONCALL" && !state.isMuted || muteOrUnMuteLoading,
3488
+ 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),
3489
+ 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,
3420
3490
  children: muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3421
3491
  import_material4.CircularProgress,
3422
3492
  {
@@ -3425,10 +3495,10 @@ function CallControls({ onDataChange }) {
3425
3495
  color: theme.palette.primary.main
3426
3496
  }
3427
3497
  }
3428
- ) : state.isMuted ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Mic, {})
3498
+ ) : ((_ha = state.callData) == null ? void 0 : _ha.mute) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Mic, {})
3429
3499
  }
3430
3500
  ) }),
3431
- !((_Y = state.sdkConfig) == null ? void 0 : _Y.disableCallTransferButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Transfer Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3501
+ !((_ia = state.sdkConfig) == null ? void 0 : _ia.disableCallTransferButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Transfer Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3432
3502
  import_material4.Button,
3433
3503
  {
3434
3504
  variant: state.openCallTransferDialog ? "contained" : "outlined",
@@ -3439,12 +3509,12 @@ function CallControls({ onDataChange }) {
3439
3509
  sdkStateManager.setOpenCallTransferDialog(true);
3440
3510
  }
3441
3511
  },
3442
- sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((__ = (_Z = state.callData) == null ? void 0 : _Z.status) == null ? void 0 : __.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
3443
- disabled: ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) !== "ONCALL",
3512
+ sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_ka = (_ja = state.callData) == null ? void 0 : _ja.status) == null ? void 0 : _ka.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
3513
+ disabled: ((_ma = (_la = state.callData) == null ? void 0 : _la.status) == null ? void 0 : _ma.toUpperCase()) !== "ONCALL",
3444
3514
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.TransferWithinAStation, {})
3445
3515
  }
3446
3516
  ) }),
3447
- !((_ba = state.sdkConfig) == null ? void 0 : _ba.disableConferenceButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Conference Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3517
+ !((_na = state.sdkConfig) == null ? void 0 : _na.disableConferenceButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Conference Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3448
3518
  import_material4.Button,
3449
3519
  {
3450
3520
  variant: state.openConferenceDialog ? "contained" : "outlined",
@@ -3455,15 +3525,15 @@ function CallControls({ onDataChange }) {
3455
3525
  sdkStateManager.setOpenConferenceDialog(true);
3456
3526
  }
3457
3527
  },
3458
- sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_da = (_ca = state.callData) == null ? void 0 : _ca.status) == null ? void 0 : _da.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
3459
- disabled: ((_fa = (_ea = state.callData) == null ? void 0 : _ea.status) == null ? void 0 : _fa.toUpperCase()) !== "ONCALL",
3528
+ sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_pa = (_oa = state.callData) == null ? void 0 : _oa.status) == null ? void 0 : _pa.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
3529
+ disabled: ((_ra = (_qa = state.callData) == null ? void 0 : _qa.status) == null ? void 0 : _ra.toUpperCase()) !== "ONCALL",
3460
3530
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Group, {})
3461
3531
  }
3462
3532
  ) }),
3463
- !((_ga = state.sdkConfig) == null ? void 0 : _ga.disableEndCallButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3533
+ !((_sa = state.sdkConfig) == null ? void 0 : _sa.disableEndCallButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3464
3534
  import_material4.Button,
3465
3535
  {
3466
- variant: ((_ia = (_ha = state.callData) == null ? void 0 : _ha.status) == null ? void 0 : _ia.toUpperCase()) === "ONCALL" || ((_ka = (_ja = state.callData) == null ? void 0 : _ja.status) == null ? void 0 : _ka.toUpperCase()) === "RINGING" || ((_ma = (_la = state.callData) == null ? void 0 : _la.status) == null ? void 0 : _ma.toUpperCase()) === "WRAPUP" ? "contained" : "outlined",
3536
+ 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",
3467
3537
  onClick: (e) => {
3468
3538
  var _a3, _b2, _c2, _d2, _e2, _f2;
3469
3539
  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") {
@@ -3471,7 +3541,7 @@ function CallControls({ onDataChange }) {
3471
3541
  setOpenCallDisposition(true);
3472
3542
  }
3473
3543
  },
3474
- sx: ((_oa = (_na = state.callData) == null ? void 0 : _na.status) == null ? void 0 : _oa.toUpperCase()) === "ONCALL" || ((_qa = (_pa = state.callData) == null ? void 0 : _pa.status) == null ? void 0 : _qa.toUpperCase()) === "RINGING" || ((_sa = (_ra = state.callData) == null ? void 0 : _ra.status) == null ? void 0 : _sa.toUpperCase()) === "WRAPUP" ? __spreadProps(__spreadValues({}, enabled), {
3544
+ 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), {
3475
3545
  borderRight: "1px",
3476
3546
  backgroundColor: "error.main",
3477
3547
  minWidth: "60px !important",
@@ -3490,7 +3560,7 @@ function CallControls({ onDataChange }) {
3490
3560
  }) : __spreadProps(__spreadValues({}, disabled), {
3491
3561
  minWidth: "60px !important"
3492
3562
  }),
3493
- disabled: ((_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" || endCallLoading,
3563
+ 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,
3494
3564
  children: endCallLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3495
3565
  import_material4.CircularProgress,
3496
3566
  {
@@ -3530,7 +3600,7 @@ function CallControls({ onDataChange }) {
3530
3600
  transition: theme.transitions.create(["box-shadow", "transform"], {
3531
3601
  duration: theme.transitions.duration.short
3532
3602
  }),
3533
- visibility: showIframe && !((_za = state.sdkConfig) == null ? void 0 : _za.disableSoftPhone) ? "visible" : "hidden",
3603
+ visibility: showIframe && !((_La = state.sdkConfig) == null ? void 0 : _La.disableSoftPhone) ? "visible" : "hidden",
3534
3604
  userSelect: "none"
3535
3605
  },
3536
3606
  children: [
@@ -3564,7 +3634,7 @@ function CallControls({ onDataChange }) {
3564
3634
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
3565
3635
  "iframe",
3566
3636
  {
3567
- src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_Aa = state.process) == null ? void 0 : _Aa.process_id}`,
3637
+ src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_Ma = state.process) == null ? void 0 : _Ma.process_id}`,
3568
3638
  height: 380,
3569
3639
  width: 420,
3570
3640
  allow: "camera; microphone; autoplay",