call-control-sdk 6.5.1-uat.7 → 6.5.2-uat.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.
package/dist/index.js CHANGED
@@ -60,6 +60,9 @@ __export(index_exports, {
60
60
  });
61
61
  module.exports = __toCommonJS(index_exports);
62
62
 
63
+ // call-control-sdk/lib/hooks/sdk-state.ts
64
+ var import_vault = require("@react-solutions/vault");
65
+
63
66
  // call-control-sdk/lib/services/endPoint.ts
64
67
  var IP = "uat-cti.aighospitals.com";
65
68
  var BASE_URL = `https://${IP}:8095`;
@@ -89,7 +92,9 @@ var END_POINT = {
89
92
  SEND_NOTIFICATIONS: `${BASE_URL}${VERSION.v1}/cti/notifications/send`,
90
93
  CALL_HISTORY: `${BASE_URL}${VERSION.v1}/dashboard/call-history`,
91
94
  SENTIMENTAL_ANALYSIS: `${BASE_URL}${VERSION.v1}/users/get_sentiment_analysis`,
92
- DISPOSITIONS: `${BASE_URL}${VERSION.v1}/cti/calls/dispositions`
95
+ DISPOSITIONS: `${BASE_URL}${VERSION.v1}/cti/calls/dispositions`,
96
+ HOSPITALS_SERVICES: `${BASE_URL}${VERSION.v1}/cti/hospital/services`,
97
+ BLIEND_TRANSFER: `${BASE_URL}${VERSION.v1}/cti/calls/blind_transfer?provider=convox`
93
98
  };
94
99
  var WS_END_POINT = {
95
100
  WS: `${WS_BASE_URL}${VERSION.v1}/cti/ws`
@@ -201,9 +206,9 @@ var SDKStateManager = class {
201
206
  loadFromStorage() {
202
207
  var _a2, _b;
203
208
  try {
204
- const stored = localStorage.getItem(this.STORAGE_KEY);
209
+ const stored = (0, import_vault.getItem)(this.STORAGE_KEY);
205
210
  if (stored) {
206
- const parsedState = JSON.parse(stored);
211
+ const parsedState = stored;
207
212
  this.state = __spreadProps(__spreadValues({}, this.state), {
208
213
  agentId: parsedState.agentId || "",
209
214
  authorization: parsedState.authorization || void 0,
@@ -265,7 +270,7 @@ var SDKStateManager = class {
265
270
  callData: this.state.callData,
266
271
  conferenceLine: this.state.conferenceLine
267
272
  };
268
- localStorage.setItem(this.STORAGE_KEY, JSON.stringify(persistentState));
273
+ (0, import_vault.setItem)(this.STORAGE_KEY, persistentState);
269
274
  } catch (error) {
270
275
  console.warn("Failed to save SDK state:", error);
271
276
  }
@@ -462,7 +467,7 @@ var SDKStateManager = class {
462
467
  }
463
468
  clearStorageAndReset() {
464
469
  try {
465
- localStorage.removeItem(this.STORAGE_KEY);
470
+ (0, import_vault.removeItem)(this.STORAGE_KEY);
466
471
  this.state = this.getInitialState();
467
472
  this.notifyListeners();
468
473
  } catch (error) {
@@ -627,6 +632,7 @@ var axiosInstance = createAxiosInstance();
627
632
  var axios_default = axiosInstance;
628
633
 
629
634
  // call-control-sdk/lib/hooks/useLogout.ts
635
+ var import_vault2 = require("@react-solutions/vault");
630
636
  var useLogout = () => {
631
637
  const [loading, setLoading] = (0, import_react.useState)(false);
632
638
  const [success, setSuccess] = (0, import_react.useState)(false);
@@ -634,8 +640,7 @@ var useLogout = () => {
634
640
  const [error, setError] = (0, import_react.useState)(null);
635
641
  const [data, setData] = (0, import_react.useState)(null);
636
642
  const handleLogout = (0, import_react.useCallback)(async () => {
637
- var _a2;
638
- const state = JSON.parse((_a2 = localStorage.getItem(STORAGE_KEY)) != null ? _a2 : "");
643
+ const state = (0, import_vault2.getItem)(STORAGE_KEY);
639
644
  setLoading(true);
640
645
  const payload = {
641
646
  action: "LOGOUTUSER",
@@ -643,16 +648,15 @@ var useLogout = () => {
643
648
  };
644
649
  return axios_default.post(END_POINT.LOGOUT, payload).then((res) => {
645
650
  sdkStateManager.clearStorageAndReset();
646
- localStorage.clear();
647
- sessionStorage.clear();
651
+ (0, import_vault2.removeItem)(STORAGE_KEY);
648
652
  setData(res == null ? void 0 : res.data);
649
653
  setSuccess(true);
650
654
  return res == null ? void 0 : res.data;
651
655
  }).catch((err) => {
652
- var _a3;
656
+ var _a2;
653
657
  setIsError(true);
654
658
  setError(err);
655
- return (_a3 = err == null ? void 0 : err.response) == null ? void 0 : _a3.data;
659
+ return (_a2 = err == null ? void 0 : err.response) == null ? void 0 : _a2.data;
656
660
  }).finally(() => {
657
661
  setLoading(false);
658
662
  });
@@ -669,6 +673,7 @@ var useLogout = () => {
669
673
 
670
674
  // call-control-sdk/lib/hooks/useEndCall.ts
671
675
  var import_react2 = require("react");
676
+ var import_vault3 = require("@react-solutions/vault");
672
677
  var useEndCall = () => {
673
678
  const [loading, setLoading] = (0, import_react2.useState)(false);
674
679
  const [success, setSuccess] = (0, import_react2.useState)(false);
@@ -677,26 +682,26 @@ var useEndCall = () => {
677
682
  const [data, setData] = (0, import_react2.useState)(null);
678
683
  const handleEndCall = (0, import_react2.useCallback)(
679
684
  async (data2) => {
680
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
681
- const state = JSON.parse((_a2 = localStorage.getItem(STORAGE_KEY)) != null ? _a2 : "");
685
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
686
+ const state = (0, import_vault3.getItem)(STORAGE_KEY);
682
687
  setLoading(true);
683
688
  const payload = {
684
689
  action: "ENDCALL",
685
690
  userId: state == null ? void 0 : state.agentId,
686
- processid: (_d = (_c = (_b = state == null ? void 0 : state.process) == null ? void 0 : _b.process_id) == null ? void 0 : _c.toString()) != null ? _d : "",
687
- process_name: (_f = (_e = state == null ? void 0 : state.process) == null ? void 0 : _e.process_name) != null ? _f : "",
688
- callreferenceid: (_h = (_g = state == null ? void 0 : state.callData) == null ? void 0 : _g.convox_id) != null ? _h : "",
689
- mobile_number: (_j = (_i = state == null ? void 0 : state.callData) == null ? void 0 : _i.phone_number) != null ? _j : "",
690
- disposition: (_k = data2 == null ? void 0 : data2.disposition) != null ? _k : "RES",
691
- set_followUp: (_l = data2 == null ? void 0 : data2.followUp) != null ? _l : "N",
692
- callback_date: (_m = data2 == null ? void 0 : data2.callbackDate) != null ? _m : "",
693
- callback_hrs: (_n = data2 == null ? void 0 : data2.callbackHrs) != null ? _n : "",
694
- callback_mins: (_o = data2 == null ? void 0 : data2.callbackMins) != null ? _o : "",
691
+ processid: (_c = (_b = (_a2 = state == null ? void 0 : state.process) == null ? void 0 : _a2.process_id) == null ? void 0 : _b.toString()) != null ? _c : "",
692
+ process_name: (_e = (_d = state == null ? void 0 : state.process) == null ? void 0 : _d.process_name) != null ? _e : "",
693
+ callreferenceid: (_g = (_f = state == null ? void 0 : state.callData) == null ? void 0 : _f.convox_id) != null ? _g : "",
694
+ mobile_number: (_i = (_h = state == null ? void 0 : state.callData) == null ? void 0 : _h.phone_number) != null ? _i : "",
695
+ disposition: (_j = data2 == null ? void 0 : data2.disposition) != null ? _j : "RES",
696
+ set_followUp: (_k = data2 == null ? void 0 : data2.followUp) != null ? _k : "N",
697
+ callback_date: (_l = data2 == null ? void 0 : data2.callbackDate) != null ? _l : "",
698
+ callback_hrs: (_m = data2 == null ? void 0 : data2.callbackHrs) != null ? _m : "",
699
+ callback_mins: (_n = data2 == null ? void 0 : data2.callbackMins) != null ? _n : "",
695
700
  endcall_type: "CLOSE"
696
701
  };
697
702
  return axios_default.post(END_POINT.END_CALL, payload, {
698
703
  params: {
699
- isBreak: (_p = data2 == null ? void 0 : data2.isBreak) != null ? _p : false
704
+ isBreak: (_o = data2 == null ? void 0 : data2.isBreak) != null ? _o : false
700
705
  }
701
706
  }).then((res) => {
702
707
  sdkStateManager.resetConferenceLines();
@@ -727,6 +732,7 @@ var useEndCall = () => {
727
732
 
728
733
  // call-control-sdk/lib/hooks/useClickToCall.ts
729
734
  var import_react3 = require("react");
735
+ var import_vault4 = require("@react-solutions/vault");
730
736
  var useClickToCall = () => {
731
737
  const [loading, setLoading] = (0, import_react3.useState)(false);
732
738
  const [success, setSuccess] = (0, import_react3.useState)(false);
@@ -734,10 +740,10 @@ var useClickToCall = () => {
734
740
  const [error, setError] = (0, import_react3.useState)(null);
735
741
  const [data, setData] = (0, import_react3.useState)(null);
736
742
  const handleStartCall = (0, import_react3.useCallback)(async (data2) => {
737
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
738
- const state = JSON.parse((_a2 = localStorage.getItem(STORAGE_KEY)) != null ? _a2 : "");
743
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
744
+ const state = (0, import_vault4.getItem)(STORAGE_KEY);
739
745
  setLoading(true);
740
- if (((_b = state == null ? void 0 : state.callData) == null ? void 0 : _b.status) === "IDLE") {
746
+ if (((_a2 = state == null ? void 0 : state.callData) == null ? void 0 : _a2.status) === "IDLE") {
741
747
  const payload = {
742
748
  action: "CALL",
743
749
  userId: state == null ? void 0 : state.agentId,
@@ -756,15 +762,15 @@ var useClickToCall = () => {
756
762
  }).finally(() => {
757
763
  setLoading(false);
758
764
  });
759
- } else if (((_c = state == null ? void 0 : state.callData) == null ? void 0 : _c.status) === "ONCALL") {
760
- const line_used = (_e = (_d = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _d.filter((each) => each.line !== 1)) == null ? void 0 : _e.find((each) => each.status === "IDLE" && !(each == null ? void 0 : each.isCallStart));
765
+ } else if (((_b = state == null ? void 0 : state.callData) == null ? void 0 : _b.status) === "ONCALL") {
766
+ const line_used = (_d = (_c = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _c.filter((each) => each.line !== 1)) == null ? void 0 : _d.find((each) => each.status === "IDLE" && !(each == null ? void 0 : each.isCallStart));
761
767
  const payload = {
762
768
  action: "EXTERNAL_CONFERENCE",
763
769
  operation: `CALL${line_used.line}`,
764
770
  line_used: String(line_used.line),
765
771
  thirdparty_no: data2 == null ? void 0 : data2.mobileNumber,
766
- userid: (_g = (_f = state.callData) == null ? void 0 : _f.agent_id) != null ? _g : "",
767
- process: (_i = (_h = state.callData) == null ? void 0 : _h.process_name) != null ? _i : ""
772
+ userid: (_f = (_e = state.callData) == null ? void 0 : _e.agent_id) != null ? _f : "",
773
+ process: (_h = (_g = state.callData) == null ? void 0 : _g.process_name) != null ? _h : ""
768
774
  };
769
775
  return axios_default.post(END_POINT.CONFERENCE_CALL, payload).then((res) => {
770
776
  setData(res == null ? void 0 : res.data);
@@ -1729,17 +1735,26 @@ function ConferenceDialog() {
1729
1735
  ) });
1730
1736
  }
1731
1737
  function CallTransferDialog({ open }) {
1732
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1738
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
1733
1739
  const state = useSDKState();
1740
+ const [mobileNumber, setMobileNumber] = (0, import_react9.useState)("");
1734
1741
  const [transferCall] = usePostRequest({
1735
1742
  onSuccess: () => {
1736
1743
  sdkStateManager.setOpenCallTransferDialog(false);
1737
1744
  }
1738
1745
  });
1746
+ const [blindTransferCall] = usePostRequest({
1747
+ onSuccess: () => {
1748
+ sdkStateManager.setOpenCallTransferDialog(false);
1749
+ }
1750
+ });
1739
1751
  const [currentselecteTab, setCurrentselecteTab] = (0, import_react9.useState)("process");
1740
1752
  const [getIdelAgentsList, { data: idleAgentsList, isLoading: isIdleAgentsListLoading }] = usePostRequest({
1741
1753
  disabledSuccessToast: true
1742
1754
  });
1755
+ const [getHospitalsServicesList, { data: hospitalsServicesList, isLoading: isHospitalsServicesListLoading }] = useGetRequest({
1756
+ disabledSuccessToast: true
1757
+ });
1743
1758
  const [
1744
1759
  getProcessAndQueuesList,
1745
1760
  { data: processAndQueuesList, isLoading: isProcessAndQueuesListLoading }
@@ -1750,7 +1765,7 @@ function CallTransferDialog({ open }) {
1750
1765
  sdkStateManager.setOpenCallTransferDialog(false);
1751
1766
  };
1752
1767
  const handleTransferCall = (data, type) => {
1753
- var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G;
1768
+ var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
1754
1769
  if (type === "PROCESS") {
1755
1770
  const payload = {
1756
1771
  mobile_number: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.phone_number) != null ? _b2 : "",
@@ -1764,13 +1779,13 @@ function CallTransferDialog({ open }) {
1764
1779
  transferCall(END_POINT.TRANSFER_CALL, payload);
1765
1780
  } else if (type === "QUEUE") {
1766
1781
  const payload = {
1767
- mobile_number: (_m = (_l2 = state.callData) == null ? void 0 : _l2.phone_number) != null ? _m : "",
1768
- userid: (_o = (_n = state.callData) == null ? void 0 : _n.agent_id) != null ? _o : "",
1782
+ mobile_number: (_m2 = (_l2 = state.callData) == null ? void 0 : _l2.phone_number) != null ? _m2 : "",
1783
+ userid: (_o2 = (_n2 = state.callData) == null ? void 0 : _n2.agent_id) != null ? _o2 : "",
1769
1784
  type: "QUEUE",
1770
- transfer_to: (_p = data == null ? void 0 : data.queue_name) != null ? _p : "",
1771
- callreferenceid: (_r = (_q = state.callData) == null ? void 0 : _q.convox_id) != null ? _r : "",
1772
- processid: String((_t = (_s = state.callData) == null ? void 0 : _s.process_id) != null ? _t : ""),
1773
- process_name: (_v = (_u = state.callData) == null ? void 0 : _u.process_name) != null ? _v : ""
1785
+ transfer_to: (_p2 = data == null ? void 0 : data.queue_name) != null ? _p2 : "",
1786
+ callreferenceid: (_r2 = (_q2 = state.callData) == null ? void 0 : _q2.convox_id) != null ? _r2 : "",
1787
+ processid: String((_t2 = (_s2 = state.callData) == null ? void 0 : _s2.process_id) != null ? _t2 : ""),
1788
+ process_name: (_v = (_u2 = state.callData) == null ? void 0 : _u2.process_name) != null ? _v : ""
1774
1789
  };
1775
1790
  transferCall(END_POINT.TRANSFER_CALL, payload);
1776
1791
  } else if (type === "AGENT") {
@@ -1784,6 +1799,15 @@ function CallTransferDialog({ open }) {
1784
1799
  process_name: (_G = (_F = state.callData) == null ? void 0 : _F.process_name) != null ? _G : ""
1785
1800
  };
1786
1801
  transferCall(END_POINT.TRANSFER_CALL, payload);
1802
+ } else if (type === "OTHER") {
1803
+ const payload = {
1804
+ action: "BLIND_TRANSFER",
1805
+ userid: (_I = (_H = state.callData) == null ? void 0 : _H.agent_id) != null ? _I : "",
1806
+ callreferenceid: (_K = (_J = state.callData) == null ? void 0 : _J.convox_id) != null ? _K : "",
1807
+ blind_transfer_no: (_L = data == null ? void 0 : data.mobile_number) != null ? _L : ""
1808
+ };
1809
+ console.log("payload", payload);
1810
+ blindTransferCall(END_POINT.BLIEND_TRANSFER, payload);
1787
1811
  }
1788
1812
  };
1789
1813
  (0, import_react9.useEffect)(() => {
@@ -1795,6 +1819,7 @@ function CallTransferDialog({ open }) {
1795
1819
  status: "ACTIVE",
1796
1820
  active: true
1797
1821
  });
1822
+ getHospitalsServicesList(END_POINT.HOSPITALS_SERVICES);
1798
1823
  }, []);
1799
1824
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1800
1825
  import_material3.Dialog,
@@ -1803,7 +1828,7 @@ function CallTransferDialog({ open }) {
1803
1828
  "aria-labelledby": "alert-dialog-title",
1804
1829
  "aria-describedby": "alert-dialog-description",
1805
1830
  fullWidth: true,
1806
- maxWidth: "md",
1831
+ maxWidth: "sm",
1807
1832
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Paper, { sx: { borderRadius: 2 }, children: [
1808
1833
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1809
1834
  import_material3.Box,
@@ -1825,23 +1850,17 @@ function CallTransferDialog({ open }) {
1825
1850
  import_material3.Box,
1826
1851
  {
1827
1852
  sx: {
1828
- boxShadow: "1px 1px 4px #d3d3d3ff",
1829
- padding: "6px 10px",
1830
1853
  margin: "10px",
1831
1854
  borderRadius: "10px"
1832
1855
  },
1833
1856
  children: [
1834
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { display: "flex", gap: 1 }, children: [
1857
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { display: "flex", gap: 1, margin: "10px" }, children: [
1835
1858
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1836
1859
  import_material3.Button,
1837
1860
  {
1838
1861
  variant: currentselecteTab === "process" ? "contained" : "outlined",
1839
1862
  onClick: () => {
1840
1863
  setCurrentselecteTab("process");
1841
- getProcessAndQueuesList(END_POINT.TRANSFER_TO_DETAILS, {
1842
- status: "ACTIVE",
1843
- active: true
1844
- });
1845
1864
  },
1846
1865
  children: "Process"
1847
1866
  }
@@ -1852,10 +1871,6 @@ function CallTransferDialog({ open }) {
1852
1871
  variant: currentselecteTab === "queues" ? "contained" : "outlined",
1853
1872
  onClick: () => {
1854
1873
  setCurrentselecteTab("queues");
1855
- getProcessAndQueuesList(END_POINT.TRANSFER_TO_DETAILS, {
1856
- status: "ACTIVE",
1857
- active: true
1858
- });
1859
1874
  },
1860
1875
  children: "Queues"
1861
1876
  }
@@ -1873,9 +1888,19 @@ function CallTransferDialog({ open }) {
1873
1888
  },
1874
1889
  children: "Agents"
1875
1890
  }
1891
+ ),
1892
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1893
+ import_material3.Button,
1894
+ {
1895
+ variant: currentselecteTab === "others" ? "contained" : "outlined",
1896
+ onClick: () => {
1897
+ setCurrentselecteTab("others");
1898
+ },
1899
+ children: "Others"
1900
+ }
1876
1901
  )
1877
1902
  ] }),
1878
- (isProcessAndQueuesListLoading || isIdleAgentsListLoading) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1903
+ (isProcessAndQueuesListLoading || isIdleAgentsListLoading || isHospitalsServicesListLoading) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1879
1904
  import_material3.Box,
1880
1905
  {
1881
1906
  sx: {
@@ -1890,7 +1915,7 @@ function CallTransferDialog({ open }) {
1890
1915
  ]
1891
1916
  }
1892
1917
  ),
1893
- !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && currentselecteTab === "process" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: ((_a2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a2.process) && ((_c = (_b = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _b.process) == null ? void 0 : _c.length) > 0 ? (_e = (_d = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d.process) == null ? void 0 : _e.map((process, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1918
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "process" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: ((_a2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a2.process) && ((_c = (_b = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _b.process) == null ? void 0 : _c.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: ((_d = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d.process) && ((_f = (_e = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _e.process) == null ? void 0 : _f.length) > 0 ? (_h = (_g = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _g.process) == null ? void 0 : _h.map((process, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1894
1919
  import_material3.Box,
1895
1920
  {
1896
1921
  sx: {
@@ -1915,7 +1940,7 @@ function CallTransferDialog({ open }) {
1915
1940
  alignItems: "center"
1916
1941
  },
1917
1942
  children: [
1918
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.SupportAgent, { sx: { marginRight: "4px" } }),
1943
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MemoryOutlined, { sx: { marginRight: "4px" } }),
1919
1944
  process.process_name
1920
1945
  ]
1921
1946
  }
@@ -1937,26 +1962,41 @@ function CallTransferDialog({ open }) {
1937
1962
  ]
1938
1963
  },
1939
1964
  index
1940
- )) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1941
- import_material3.Typography,
1965
+ )) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1966
+ import_material3.Box,
1942
1967
  {
1943
- variant: "body1",
1944
1968
  sx: {
1945
- fontSize: "16px",
1946
- letterSpacing: "0.02em",
1947
- textTransform: "capitalize",
1948
1969
  display: "flex",
1949
1970
  alignItems: "center",
1950
1971
  justifyContent: "center",
1951
- width: "100%",
1952
- margin: "10px 0px",
1953
- color: "gray",
1954
- height: "60px"
1972
+ flexDirection: "column"
1955
1973
  },
1956
- children: "No Process Found"
1974
+ p: 2,
1975
+ children: [
1976
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Upcoming, { color: "primary" }),
1977
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1978
+ import_material3.Typography,
1979
+ {
1980
+ variant: "body1",
1981
+ sx: {
1982
+ fontSize: "16px",
1983
+ letterSpacing: "0.02em",
1984
+ textTransform: "capitalize",
1985
+ display: "flex",
1986
+ alignItems: "center",
1987
+ justifyContent: "center",
1988
+ width: "100%",
1989
+ margin: "10px 0px",
1990
+ color: "primary.main",
1991
+ height: "20px"
1992
+ },
1993
+ children: "No Process Found"
1994
+ }
1995
+ )
1996
+ ]
1957
1997
  }
1958
1998
  ) }),
1959
- !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && currentselecteTab === "queues" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: ((_f = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _f.queue) && ((_h = (_g = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _g.queue) == null ? void 0 : _h.length) > 0 ? (_j = (_i = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _i.queue) == null ? void 0 : _j.map((queue, index) => {
1999
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "queues" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: ((_i = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _i.queue) && ((_k = (_j = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _j.queue) == null ? void 0 : _k.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: ((_l = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _l.queue) && ((_n = (_m = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _m.queue) == null ? void 0 : _n.length) > 0 ? (_p = (_o = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _o.queue) == null ? void 0 : _p.map((queue, index) => {
1960
2000
  var _a3, _b2, _c2, _d2, _e2, _f2;
1961
2001
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1962
2002
  import_material3.Box,
@@ -1983,7 +2023,7 @@ function CallTransferDialog({ open }) {
1983
2023
  alignItems: "center"
1984
2024
  },
1985
2025
  children: [
1986
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.SupportAgent, { sx: { marginRight: "4px" } }),
2026
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Airlines, { sx: { marginRight: "4px" } }),
1987
2027
  queue.queue_name,
1988
2028
  ((_c2 = (_b2 = (_a3 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a3.process) == null ? void 0 : _b2.find(
1989
2029
  (process) => process.process_id === queue.process_id
@@ -2024,26 +2064,41 @@ function CallTransferDialog({ open }) {
2024
2064
  },
2025
2065
  index
2026
2066
  );
2027
- }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2028
- import_material3.Typography,
2067
+ }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2068
+ import_material3.Box,
2029
2069
  {
2030
- variant: "body1",
2031
2070
  sx: {
2032
- fontSize: "16px",
2033
- letterSpacing: "0.02em",
2034
- textTransform: "capitalize",
2035
2071
  display: "flex",
2036
2072
  alignItems: "center",
2037
2073
  justifyContent: "center",
2038
- width: "100%",
2039
- margin: "10px 0px",
2040
- color: "gray",
2041
- height: "60px"
2074
+ flexDirection: "column"
2042
2075
  },
2043
- children: "No Queues Found"
2076
+ p: 2,
2077
+ children: [
2078
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Upcoming, { color: "primary" }),
2079
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2080
+ import_material3.Typography,
2081
+ {
2082
+ variant: "body1",
2083
+ sx: {
2084
+ fontSize: "16px",
2085
+ letterSpacing: "0.02em",
2086
+ textTransform: "capitalize",
2087
+ display: "flex",
2088
+ alignItems: "center",
2089
+ justifyContent: "center",
2090
+ width: "100%",
2091
+ margin: "10px 0px",
2092
+ color: "primary.main",
2093
+ height: "20px"
2094
+ },
2095
+ children: "No Queues Found"
2096
+ }
2097
+ )
2098
+ ]
2044
2099
  }
2045
2100
  ) }),
2046
- !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && currentselecteTab === "agents" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_k = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _k.length) > 0 ? (_l = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _l.map((agent, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2101
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "agents" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_q = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _q.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_r = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _r.length) > 0 ? (_s = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _s.map((agent, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2047
2102
  import_material3.Box,
2048
2103
  {
2049
2104
  sx: {
@@ -2090,25 +2145,178 @@ function CallTransferDialog({ open }) {
2090
2145
  ]
2091
2146
  },
2092
2147
  index
2093
- )) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2094
- import_material3.Typography,
2148
+ )) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2149
+ import_material3.Box,
2095
2150
  {
2096
- variant: "body1",
2097
2151
  sx: {
2098
- fontSize: "16px",
2099
- letterSpacing: "0.02em",
2100
- textTransform: "capitalize",
2101
2152
  display: "flex",
2102
2153
  alignItems: "center",
2103
2154
  justifyContent: "center",
2104
- width: "100%",
2105
- margin: "10px 0px",
2106
- color: "gray",
2107
- height: "60px"
2155
+ flexDirection: "column"
2108
2156
  },
2109
- children: "No Agents Found"
2157
+ p: 2,
2158
+ children: [
2159
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Upcoming, { color: "primary" }),
2160
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2161
+ import_material3.Typography,
2162
+ {
2163
+ variant: "body1",
2164
+ sx: {
2165
+ fontSize: "16px",
2166
+ letterSpacing: "0.02em",
2167
+ textTransform: "capitalize",
2168
+ display: "flex",
2169
+ alignItems: "center",
2170
+ justifyContent: "center",
2171
+ width: "100%",
2172
+ margin: "10px 0px",
2173
+ color: "primary.main",
2174
+ height: "20px"
2175
+ },
2176
+ children: "No Agents Found"
2177
+ }
2178
+ )
2179
+ ]
2110
2180
  }
2111
- ) })
2181
+ ) }),
2182
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "others" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: [
2183
+ (hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_t = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _t.length) > 0 && ((_u = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _u.map((service, index) => {
2184
+ var _a3, _b2, _c2;
2185
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2186
+ import_material3.Box,
2187
+ {
2188
+ sx: {
2189
+ p: 1,
2190
+ display: "flex",
2191
+ alignItems: "center",
2192
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2193
+ padding: "6px",
2194
+ borderRadius: "10px",
2195
+ "&:hover": { bgcolor: "action.selected" }
2196
+ },
2197
+ children: [
2198
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2199
+ import_material3.Typography,
2200
+ {
2201
+ variant: "body1",
2202
+ sx: {
2203
+ mx: 1,
2204
+ width: "200px",
2205
+ maxWidth: "250px",
2206
+ display: "flex",
2207
+ alignItems: "center"
2208
+ },
2209
+ children: [
2210
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Roofing, { sx: { marginRight: "4px" } }),
2211
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: `${(_a3 = service == null ? void 0 : service.description) != null ? _a3 : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { color: "text.secondary" }, children: [
2212
+ service.name,
2213
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: {
2214
+ fontSize: "9px",
2215
+ fontWeight: "600",
2216
+ letterSpacing: "0.02em",
2217
+ textTransform: "capitalize",
2218
+ color: "gray",
2219
+ textOverflow: "ellipsis",
2220
+ whiteSpace: "nowrap",
2221
+ overflow: "hidden",
2222
+ maxWidth: "160px"
2223
+ }, children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : "" })
2224
+ ] }) })
2225
+ ]
2226
+ }
2227
+ ),
2228
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (_c2 = service == null ? void 0 : service.phone_number) != null ? _c2 : "", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2229
+ import_material3.IconButton,
2230
+ {
2231
+ color: "success",
2232
+ sx: {
2233
+ bgcolor: "action.hover",
2234
+ "&:hover": { bgcolor: "action.selected" }
2235
+ },
2236
+ onClick: () => {
2237
+ var _a4;
2238
+ handleTransferCall({
2239
+ mobile_number: (_a4 = service == null ? void 0 : service.phone_number) != null ? _a4 : ""
2240
+ }, "OTHER");
2241
+ },
2242
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Call, {})
2243
+ }
2244
+ ) })
2245
+ ]
2246
+ },
2247
+ index
2248
+ );
2249
+ })),
2250
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2251
+ import_material3.Box,
2252
+ {
2253
+ sx: {
2254
+ p: 1,
2255
+ display: "flex",
2256
+ alignItems: "center",
2257
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2258
+ padding: "6px",
2259
+ borderRadius: "10px"
2260
+ },
2261
+ children: [
2262
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2263
+ import_material3.Typography,
2264
+ {
2265
+ variant: "body1",
2266
+ sx: {
2267
+ mx: 1,
2268
+ width: "200px",
2269
+ maxWidth: "250px",
2270
+ display: "flex",
2271
+ alignItems: "center"
2272
+ },
2273
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2274
+ import_material3.TextField,
2275
+ {
2276
+ size: "small",
2277
+ name: "others",
2278
+ label: "Mobile number",
2279
+ variant: "outlined",
2280
+ type: "tel",
2281
+ value: mobileNumber,
2282
+ onChange: (e) => {
2283
+ const v = e.target.value;
2284
+ if (/^\d*$/.test(v)) {
2285
+ setMobileNumber(v);
2286
+ }
2287
+ },
2288
+ slotProps: {
2289
+ htmlInput: {
2290
+ inputMode: "numeric",
2291
+ maxLength: 11
2292
+ }
2293
+ },
2294
+ placeholder: "Enter mobile number",
2295
+ autoComplete: "off"
2296
+ }
2297
+ )
2298
+ }
2299
+ ),
2300
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: mobileNumber ? `Call To - ${mobileNumber}` : "Enter mobile number", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2301
+ import_material3.IconButton,
2302
+ {
2303
+ color: "success",
2304
+ sx: {
2305
+ bgcolor: "action.hover",
2306
+ "&:hover": { bgcolor: "action.selected" }
2307
+ },
2308
+ onClick: () => {
2309
+ handleTransferCall({
2310
+ mobile_number: mobileNumber != null ? mobileNumber : ""
2311
+ }, "OTHER");
2312
+ },
2313
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Call, {})
2314
+ }
2315
+ ) })
2316
+ ]
2317
+ }
2318
+ )
2319
+ ] })
2112
2320
  ]
2113
2321
  }
2114
2322
  )
@@ -2723,6 +2931,7 @@ function cleanupAudioResources() {
2723
2931
  }
2724
2932
 
2725
2933
  // call-control-sdk/lib/components/callControls.tsx
2934
+ var import_vault5 = require("@react-solutions/vault");
2726
2935
  var import_jsx_runtime3 = require("react/jsx-runtime");
2727
2936
  var getCombineConfrenceData = (localState, apiData) => {
2728
2937
  const localConfrenceData = localState == null ? void 0 : localState.conferenceLine;
@@ -2930,31 +3139,31 @@ function CallControls({ onDataChange }) {
2930
3139
  console.error("Failed to start mic:", err);
2931
3140
  });
2932
3141
  const handleKeyDown = (event) => {
2933
- var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
2934
- const fullState = JSON.parse((_a3 = localStorage.getItem("call-control-sdk-state")) != null ? _a3 : "");
2935
- const key = (_b2 = event.key) == null ? void 0 : _b2.toLowerCase();
2936
- if (!event.altKey || ((_c2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _c2.status) !== "ONCALL" /* ONCALL */) {
3142
+ var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
3143
+ const fullState = (0, import_vault5.getItem)(STORAGE_KEY);
3144
+ const key = (_a3 = event.key) == null ? void 0 : _a3.toLowerCase();
3145
+ if (!event.altKey || ((_b2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _b2.status) !== "ONCALL" /* ONCALL */) {
2937
3146
  return;
2938
3147
  }
2939
- if (key === "m" && String((_d2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _d2.mute) === "0") {
3148
+ if (key === "m" && String((_c2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _c2.mute) === "0") {
2940
3149
  event.preventDefault();
2941
- (_e2 = micRef.current) == null ? void 0 : _e2.mute();
3150
+ (_d2 = micRef.current) == null ? void 0 : _d2.mute();
2942
3151
  const payload = {
2943
3152
  action: "MUTE" /* MUTE */,
2944
3153
  userId: fullState.agentId
2945
3154
  };
2946
3155
  muteOrUnMute(END_POINT.MUTE_CALL, payload);
2947
3156
  }
2948
- if (key === "u" && String((_f2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _f2.mute) === "1") {
3157
+ if (key === "u" && String((_e2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _e2.mute) === "1") {
2949
3158
  event.preventDefault();
2950
3159
  const payload = {
2951
3160
  action: "UNMUTE" /* UNMUTE */,
2952
3161
  userId: fullState.agentId
2953
3162
  };
2954
3163
  muteOrUnMute(END_POINT.MUTE_CALL, payload);
2955
- (_g2 = micRef.current) == null ? void 0 : _g2.unmute();
3164
+ (_f2 = micRef.current) == null ? void 0 : _f2.unmute();
2956
3165
  }
2957
- if (key === "h" && String((_h2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _h2.hold) === "0") {
3166
+ if (key === "h" && String((_g2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _g2.hold) === "0") {
2958
3167
  event.preventDefault();
2959
3168
  const payload = {
2960
3169
  action: "HOLD" /* HOLD */,
@@ -2962,7 +3171,7 @@ function CallControls({ onDataChange }) {
2962
3171
  };
2963
3172
  holdOrUnHold(END_POINT.HOLD_CALL, payload);
2964
3173
  }
2965
- if (key === "r" && String((_i2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _i2.hold) === "1") {
3174
+ if (key === "r" && String((_h2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _h2.hold) === "1") {
2966
3175
  event.preventDefault();
2967
3176
  const payload = {
2968
3177
  action: "UNHOLD" /* UNHOLD */,
@@ -3088,13 +3297,13 @@ function CallControls({ onDataChange }) {
3088
3297
  }, 3e4);
3089
3298
  };
3090
3299
  webSocketRef.current.onmessage = (event) => {
3091
- var _a3, _b2, _c2;
3300
+ var _a3, _b2;
3092
3301
  try {
3093
3302
  const data = JSON.parse(event.data);
3094
3303
  if (data.type === "pong") {
3095
3304
  return;
3096
3305
  }
3097
- const sdkState = JSON.parse((_a3 = localStorage.getItem(STORAGE_KEY)) != null ? _a3 : "{}");
3306
+ const sdkState = (0, import_vault5.getItem)(STORAGE_KEY);
3098
3307
  const confrence = getCombineConfrenceData(sdkState, data);
3099
3308
  const callData = {
3100
3309
  "agent_id": data == null ? void 0 : data.agent_id,
@@ -3114,7 +3323,7 @@ function CallControls({ onDataChange }) {
3114
3323
  sdkStateManager.updateConferenceData([...confrence]);
3115
3324
  if (["RINGING" /* RINGING */, "DIALING" /* DIALING */].includes(data.status)) {
3116
3325
  setShowIframe(true);
3117
- setCallWrapuptime((_c2 = (_b2 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _b2.auto_wrapup_time) != null ? _c2 : null);
3326
+ setCallWrapuptime((_b2 = (_a3 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _a3.auto_wrapup_time) != null ? _b2 : null);
3118
3327
  sdkStateManager.updateConferenceData(
3119
3328
  [
3120
3329
  {