call-control-sdk 6.5.1-uat.2 → 6.5.1-uat.3
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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +182 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +185 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -221,6 +221,8 @@ interface CallData {
|
|
|
221
221
|
interface SDKConfig {
|
|
222
222
|
disableEndCallButton?: boolean;
|
|
223
223
|
disabledDialButton?: boolean;
|
|
224
|
+
enableSmsServices?: boolean;
|
|
225
|
+
enableQueueName?: boolean;
|
|
224
226
|
disableCallTransferButton?: boolean;
|
|
225
227
|
isDraggable?: boolean;
|
|
226
228
|
disableSoftPhone?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -221,6 +221,8 @@ interface CallData {
|
|
|
221
221
|
interface SDKConfig {
|
|
222
222
|
disableEndCallButton?: boolean;
|
|
223
223
|
disabledDialButton?: boolean;
|
|
224
|
+
enableSmsServices?: boolean;
|
|
225
|
+
enableQueueName?: boolean;
|
|
224
226
|
disableCallTransferButton?: boolean;
|
|
225
227
|
isDraggable?: boolean;
|
|
226
228
|
disableSoftPhone?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -86,6 +86,7 @@ var END_POINT = {
|
|
|
86
86
|
AGENTS_LIST: `${BASE_URL}${VERSION.v1}/cti/users`,
|
|
87
87
|
PROCESS_LIST: `${BASE_URL}${VERSION.v1}/cti/processes-list`,
|
|
88
88
|
TRANSFER_TO_DETAILS: `${BASE_URL}${VERSION.v1}/cti/transfer-to-details?provider=convox`,
|
|
89
|
+
SEND_NOTIFICATIONS: `${BASE_URL}${VERSION.v1}/cti/notifications/send`,
|
|
89
90
|
CALL_HISTORY: `${BASE_URL}${VERSION.v1}/dashboard/call-history`,
|
|
90
91
|
SENTIMENTAL_ANALYSIS: `${BASE_URL}${VERSION.v1}/users/get_sentiment_analysis`
|
|
91
92
|
};
|
|
@@ -117,6 +118,8 @@ var SDKStateManager = class {
|
|
|
117
118
|
sdkConfig: {
|
|
118
119
|
disableEndCallButton: false,
|
|
119
120
|
disabledDialButton: false,
|
|
121
|
+
enableSmsServices: false,
|
|
122
|
+
enableQueueName: false,
|
|
120
123
|
disableCallTransferButton: false,
|
|
121
124
|
isDraggable: true,
|
|
122
125
|
disableSoftPhone: false,
|
|
@@ -133,6 +136,7 @@ var SDKStateManager = class {
|
|
|
133
136
|
iframePosition: { x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460, y: ((_b = window.screen) == null ? void 0 : _b.height) - 580 },
|
|
134
137
|
callData: {
|
|
135
138
|
agent_id: "",
|
|
139
|
+
queue_name: "",
|
|
136
140
|
hold: 0,
|
|
137
141
|
mute: 0,
|
|
138
142
|
status: "",
|
|
@@ -211,6 +215,8 @@ var SDKStateManager = class {
|
|
|
211
215
|
isInitialized: parsedState.isInitialized || false,
|
|
212
216
|
sdkConfig: parsedState.sdkConfig || {
|
|
213
217
|
disableEndCallButton: false,
|
|
218
|
+
enableSmsServices: false,
|
|
219
|
+
enableQueueName: false,
|
|
214
220
|
disabledDialButton: false,
|
|
215
221
|
disableCallTransferButton: false,
|
|
216
222
|
isDraggable: true,
|
|
@@ -298,6 +304,8 @@ var SDKStateManager = class {
|
|
|
298
304
|
this.state.sdkConfig = __spreadValues({
|
|
299
305
|
disableEndCallButton: false,
|
|
300
306
|
disabledDialButton: false,
|
|
307
|
+
enableSmsServices: false,
|
|
308
|
+
enableQueueName: false,
|
|
301
309
|
disableCallTransferButton: false,
|
|
302
310
|
isDraggable: true,
|
|
303
311
|
disableSoftPhone: false,
|
|
@@ -2910,7 +2918,7 @@ var formatDuration = (seconds) => {
|
|
|
2910
2918
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
2911
2919
|
};
|
|
2912
2920
|
function CallControls({ onDataChange }) {
|
|
2913
|
-
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;
|
|
2921
|
+
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, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za;
|
|
2914
2922
|
const theme = (0, import_material4.useTheme)();
|
|
2915
2923
|
const state = useSDKState();
|
|
2916
2924
|
const { showToast } = useToast();
|
|
@@ -2931,6 +2939,7 @@ function CallControls({ onDataChange }) {
|
|
|
2931
2939
|
const [showIframe, setShowIframe] = (0, import_react11.useState)(true);
|
|
2932
2940
|
const [statusAnchorEl, setStatusAnchorEl] = (0, import_react11.useState)(null);
|
|
2933
2941
|
const [dialerAnchorEl, setDialerAnchorEl] = (0, import_react11.useState)(null);
|
|
2942
|
+
const [ambulanceAnchorEl, setAmbulanceAnchorEl] = (0, import_react11.useState)(null);
|
|
2934
2943
|
const [openCallDisposition, setOpenCallDisposition] = (0, import_react11.useState)(false);
|
|
2935
2944
|
const [openProcessorDialog, setOpenProcessorDialog] = (0, import_react11.useState)(false);
|
|
2936
2945
|
const [openCallHistoryDialog, setOpenCallHistoryDialog] = (0, import_react11.useState)(false);
|
|
@@ -2975,6 +2984,7 @@ function CallControls({ onDataChange }) {
|
|
|
2975
2984
|
});
|
|
2976
2985
|
const [readyAgentStatus, { isLoading: agentReadyLoading }] = usePostRequest();
|
|
2977
2986
|
const [updateAgentStatus, { isLoading }] = usePostRequest();
|
|
2987
|
+
const [sendNotification] = usePostRequest();
|
|
2978
2988
|
const [endCall, { isLoading: endCallLoading }] = usePostRequest({
|
|
2979
2989
|
onSuccess: () => {
|
|
2980
2990
|
sdkStateManager.resetConferenceLines();
|
|
@@ -2988,12 +2998,18 @@ function CallControls({ onDataChange }) {
|
|
|
2988
2998
|
setDialerAnchorEl(event.currentTarget);
|
|
2989
2999
|
sdkStateManager.setStatus("dial");
|
|
2990
3000
|
};
|
|
3001
|
+
const handleOpenAbulanceServices = (event) => {
|
|
3002
|
+
setAmbulanceAnchorEl(event.currentTarget);
|
|
3003
|
+
};
|
|
2991
3004
|
const handleCloseDialer = () => {
|
|
2992
3005
|
if (state.status !== "on call") {
|
|
2993
3006
|
sdkStateManager.setStatus("idle");
|
|
2994
3007
|
}
|
|
2995
3008
|
setDialerAnchorEl(null);
|
|
2996
3009
|
};
|
|
3010
|
+
const handleCloseAmbulance = () => {
|
|
3011
|
+
setAmbulanceAnchorEl(null);
|
|
3012
|
+
};
|
|
2997
3013
|
const handleOpenAgentStatus = (event) => {
|
|
2998
3014
|
setStatusAnchorEl(event.currentTarget);
|
|
2999
3015
|
};
|
|
@@ -3076,6 +3092,52 @@ function CallControls({ onDataChange }) {
|
|
|
3076
3092
|
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
3077
3093
|
};
|
|
3078
3094
|
}, []);
|
|
3095
|
+
(0, import_react11.useEffect)(() => {
|
|
3096
|
+
const handleKeyDown = (event) => {
|
|
3097
|
+
var _a3, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
3098
|
+
const fullState = JSON.parse((_a3 = localStorage.getItem("call-control-sdk-state")) != null ? _a3 : "");
|
|
3099
|
+
const key = (_b2 = event.key) == null ? void 0 : _b2.toLowerCase();
|
|
3100
|
+
if (!event.altKey || ((_c2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _c2.status) !== "ONCALL") {
|
|
3101
|
+
return;
|
|
3102
|
+
}
|
|
3103
|
+
if (key === "m" && String((_d2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _d2.mute) === "0") {
|
|
3104
|
+
event.preventDefault();
|
|
3105
|
+
const payload = {
|
|
3106
|
+
action: "MUTE",
|
|
3107
|
+
userId: fullState.agentId
|
|
3108
|
+
};
|
|
3109
|
+
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
3110
|
+
}
|
|
3111
|
+
if (key === "u" && String((_e2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _e2.mute) === "1") {
|
|
3112
|
+
event.preventDefault();
|
|
3113
|
+
const payload = {
|
|
3114
|
+
action: "UNMUTE",
|
|
3115
|
+
userId: fullState.agentId
|
|
3116
|
+
};
|
|
3117
|
+
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
3118
|
+
}
|
|
3119
|
+
if (key === "h" && String((_f2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _f2.hold) === "0") {
|
|
3120
|
+
event.preventDefault();
|
|
3121
|
+
const payload = {
|
|
3122
|
+
action: "HOLD",
|
|
3123
|
+
userId: fullState.agentId
|
|
3124
|
+
};
|
|
3125
|
+
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
3126
|
+
}
|
|
3127
|
+
if (key === "r" && String((_g2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _g2.hold) === "1") {
|
|
3128
|
+
event.preventDefault();
|
|
3129
|
+
const payload = {
|
|
3130
|
+
action: "UNHOLD",
|
|
3131
|
+
userId: fullState.agentId
|
|
3132
|
+
};
|
|
3133
|
+
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
3134
|
+
}
|
|
3135
|
+
};
|
|
3136
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
3137
|
+
return () => {
|
|
3138
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
3139
|
+
};
|
|
3140
|
+
}, []);
|
|
3079
3141
|
(0, import_react11.useEffect)(() => {
|
|
3080
3142
|
let interval;
|
|
3081
3143
|
if (state.callData.status && state.callData.status === "ONCALL") {
|
|
@@ -3181,7 +3243,7 @@ function CallControls({ onDataChange }) {
|
|
|
3181
3243
|
const confrence = getCombineConfrenceData(JSON.parse(rls || "{}"), data);
|
|
3182
3244
|
sdkStateManager.updateCallData(data);
|
|
3183
3245
|
sdkStateManager.updateConferenceData([...confrence]);
|
|
3184
|
-
if (data.status === "RINGING" || data.status === "DIALING") {
|
|
3246
|
+
if ((data.status === "RINGING" || data.status === "DIALING") && (data == null ? void 0 : data.mode) !== "manual") {
|
|
3185
3247
|
setShowIframe(true);
|
|
3186
3248
|
sdkStateManager.updateConferenceData([
|
|
3187
3249
|
{
|
|
@@ -3319,6 +3381,13 @@ function CallControls({ onDataChange }) {
|
|
|
3319
3381
|
reconnectAttemptsRef.current = 0;
|
|
3320
3382
|
};
|
|
3321
3383
|
}, [state.agentId]);
|
|
3384
|
+
const handleSendSMS = (data) => {
|
|
3385
|
+
var _a3;
|
|
3386
|
+
sendNotification(END_POINT.SEND_NOTIFICATIONS, {
|
|
3387
|
+
phone_number: (_a3 = data == null ? void 0 : data.phone_number) != null ? _a3 : "",
|
|
3388
|
+
type: "ambulance"
|
|
3389
|
+
});
|
|
3390
|
+
};
|
|
3322
3391
|
if (!state.isInitialized || !state.process) {
|
|
3323
3392
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: Boolean(openProcessorDialog) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3324
3393
|
ProcessorListDialog,
|
|
@@ -3394,7 +3463,8 @@ function CallControls({ onDataChange }) {
|
|
|
3394
3463
|
]
|
|
3395
3464
|
}
|
|
3396
3465
|
),
|
|
3397
|
-
|
|
3466
|
+
((_k = state.sdkConfig) == null ? void 0 : _k.enableQueueName) && ((_l = state == null ? void 0 : state.callData) == null ? void 0 : _l.queue_name) && ((_m = state == null ? void 0 : state.callData) == null ? void 0 : _m.mode) !== "manual" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Chip, { label: (_n = state == null ? void 0 : state.callData) == null ? void 0 : _n.queue_name }),
|
|
3467
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: !((_o = state.sdkConfig) == null ? void 0 : _o.disabledDialButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Dial", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3398
3468
|
import_material4.IconButton,
|
|
3399
3469
|
{
|
|
3400
3470
|
size: "small",
|
|
@@ -3414,7 +3484,7 @@ function CallControls({ onDataChange }) {
|
|
|
3414
3484
|
import_icons_material2.WifiCalling3,
|
|
3415
3485
|
{
|
|
3416
3486
|
sx: {
|
|
3417
|
-
color: ((
|
|
3487
|
+
color: ((_q = (_p = state.callData) == null ? void 0 : _p.status) == null ? void 0 : _q.toUpperCase()) === "ONCALL" || ((_s = (_r = state.callData) == null ? void 0 : _r.status) == null ? void 0 : _s.toUpperCase()) === "BREAK" || ((_u = (_t = state.callData) == null ? void 0 : _t.status) == null ? void 0 : _u.toUpperCase()) === "RINGING" || ((_w = (_v = state.callData) == null ? void 0 : _v.status) == null ? void 0 : _w.toUpperCase()) === "WRAPUP" ? "action.selected" : "success.main"
|
|
3418
3488
|
}
|
|
3419
3489
|
}
|
|
3420
3490
|
)
|
|
@@ -3461,7 +3531,7 @@ function CallControls({ onDataChange }) {
|
|
|
3461
3531
|
width: "60px",
|
|
3462
3532
|
textAlign: "center"
|
|
3463
3533
|
},
|
|
3464
|
-
children: (
|
|
3534
|
+
children: (_z = (_y = (_x = state.callData) == null ? void 0 : _x.status) == null ? void 0 : _y.toUpperCase()) != null ? _z : "N/A"
|
|
3465
3535
|
}
|
|
3466
3536
|
),
|
|
3467
3537
|
onClick: handleOpenAgentStatus,
|
|
@@ -3485,7 +3555,7 @@ function CallControls({ onDataChange }) {
|
|
|
3485
3555
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Agent Ready", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3486
3556
|
import_material4.Button,
|
|
3487
3557
|
{
|
|
3488
|
-
variant: ((
|
|
3558
|
+
variant: ((_B = (_A = state.callData) == null ? void 0 : _A.status) == null ? void 0 : _B.toUpperCase()) === "BREAK" || ((_D = (_C = state.callData) == null ? void 0 : _C.status) == null ? void 0 : _D.toUpperCase()) === "MISSED" ? "outlined" : "contained",
|
|
3489
3559
|
onClick: (e) => {
|
|
3490
3560
|
var _a3, _b2, _c2, _d2;
|
|
3491
3561
|
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "BREAK" || ((_d2 = (_c2 = state.callData) == null ? void 0 : _c2.status) == null ? void 0 : _d2.toUpperCase()) === "MISSED") {
|
|
@@ -3494,23 +3564,23 @@ function CallControls({ onDataChange }) {
|
|
|
3494
3564
|
}
|
|
3495
3565
|
},
|
|
3496
3566
|
classes: {
|
|
3497
|
-
root: ((
|
|
3567
|
+
root: ((_F = (_E = state.callData) == null ? void 0 : _E.status) == null ? void 0 : _F.toUpperCase()) === "BREAK" || ((_H = (_G = state.callData) == null ? void 0 : _G.status) == null ? void 0 : _H.toUpperCase()) === "MISSED" ? "outlined" : "enabled"
|
|
3498
3568
|
},
|
|
3499
|
-
sx: __spreadValues({}, ((
|
|
3569
|
+
sx: __spreadValues({}, ((_J = (_I = state.callData) == null ? void 0 : _I.status) == null ? void 0 : _J.toUpperCase()) === "BREAK" || ((_L = (_K = state.callData) == null ? void 0 : _K.status) == null ? void 0 : _L.toUpperCase()) === "MISSED" ? outlined : enabled),
|
|
3500
3570
|
disabled: agentReadyLoading,
|
|
3501
3571
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SupportAgent, {})
|
|
3502
3572
|
}
|
|
3503
3573
|
) }),
|
|
3504
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_M = state.callData) == null ? void 0 : _M.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3505
3575
|
import_material4.Button,
|
|
3506
3576
|
{
|
|
3507
|
-
variant: ((
|
|
3577
|
+
variant: ((_N = state.callData) == null ? void 0 : _N.hold) === 1 && ((_P = (_O = state.callData) == null ? void 0 : _O.status) == null ? void 0 : _P.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3508
3578
|
onClick: (e) => {
|
|
3509
3579
|
e.stopPropagation();
|
|
3510
3580
|
handleHoldToggle();
|
|
3511
3581
|
},
|
|
3512
|
-
sx: ((
|
|
3513
|
-
disabled: ((
|
|
3582
|
+
sx: ((_Q = state.callData) == null ? void 0 : _Q.hold) === 1 && ((_S = (_R = state.callData) == null ? void 0 : _R.status) == null ? void 0 : _S.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_U = (_T = state.callData) == null ? void 0 : _T.status) == null ? void 0 : _U.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3583
|
+
disabled: ((_W = (_V = state.callData) == null ? void 0 : _V.status) == null ? void 0 : _W.toUpperCase()) !== "ONCALL" && ((_X = state.callData) == null ? void 0 : _X.hold) !== 1 || holdOrUnHoldLoading,
|
|
3514
3584
|
children: holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3515
3585
|
import_material4.CircularProgress,
|
|
3516
3586
|
{
|
|
@@ -3519,19 +3589,19 @@ function CallControls({ onDataChange }) {
|
|
|
3519
3589
|
color: theme.palette.primary.main
|
|
3520
3590
|
}
|
|
3521
3591
|
}
|
|
3522
|
-
) : ((
|
|
3592
|
+
) : ((_Y = state.callData) == null ? void 0 : _Y.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Pause, {})
|
|
3523
3593
|
}
|
|
3524
3594
|
) }),
|
|
3525
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_Z = state.callData) == null ? void 0 : _Z.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3526
3596
|
import_material4.Button,
|
|
3527
3597
|
{
|
|
3528
|
-
variant:
|
|
3598
|
+
variant: ((__ = state.callData) == null ? void 0 : __.mute) === 1 && ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3529
3599
|
onClick: (e) => {
|
|
3530
3600
|
e.stopPropagation();
|
|
3531
3601
|
handleMuteToggle();
|
|
3532
3602
|
},
|
|
3533
|
-
sx: ((
|
|
3534
|
-
disabled: ((
|
|
3603
|
+
sx: ((_ba = state.callData) == null ? void 0 : _ba.hold) === 1 ? __spreadValues({}, disabled) : ((_ca = state.callData) == null ? void 0 : _ca.mute) === 1 && ((_ea = (_da = state.callData) == null ? void 0 : _da.status) == null ? void 0 : _ea.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_ga = (_fa = state.callData) == null ? void 0 : _fa.status) == null ? void 0 : _ga.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3604
|
+
disabled: ((_ia = (_ha = state.callData) == null ? void 0 : _ha.status) == null ? void 0 : _ia.toUpperCase()) !== "ONCALL" && ((_ja = state.callData) == null ? void 0 : _ja.mute) !== 1 || muteOrUnMuteLoading || ((_ka = state.callData) == null ? void 0 : _ka.hold) === 1,
|
|
3535
3605
|
children: muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3536
3606
|
import_material4.CircularProgress,
|
|
3537
3607
|
{
|
|
@@ -3540,10 +3610,10 @@ function CallControls({ onDataChange }) {
|
|
|
3540
3610
|
color: theme.palette.primary.main
|
|
3541
3611
|
}
|
|
3542
3612
|
}
|
|
3543
|
-
) : ((
|
|
3613
|
+
) : ((_la = state.callData) == null ? void 0 : _la.mute) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Mic, {})
|
|
3544
3614
|
}
|
|
3545
3615
|
) }),
|
|
3546
|
-
!((
|
|
3616
|
+
!((_ma = state.sdkConfig) == null ? void 0 : _ma.disableCallTransferButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Transfer Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3547
3617
|
import_material4.Button,
|
|
3548
3618
|
{
|
|
3549
3619
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
@@ -3554,12 +3624,12 @@ function CallControls({ onDataChange }) {
|
|
|
3554
3624
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
3555
3625
|
}
|
|
3556
3626
|
},
|
|
3557
|
-
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((
|
|
3558
|
-
disabled: ((
|
|
3627
|
+
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_oa = (_na = state.callData) == null ? void 0 : _na.status) == null ? void 0 : _oa.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3628
|
+
disabled: ((_qa = (_pa = state.callData) == null ? void 0 : _pa.status) == null ? void 0 : _qa.toUpperCase()) !== "ONCALL",
|
|
3559
3629
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.TransferWithinAStation, {})
|
|
3560
3630
|
}
|
|
3561
3631
|
) }),
|
|
3562
|
-
!((
|
|
3632
|
+
!((_ra = state.sdkConfig) == null ? void 0 : _ra.disableConferenceButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Conference Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3563
3633
|
import_material4.Button,
|
|
3564
3634
|
{
|
|
3565
3635
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
@@ -3570,15 +3640,31 @@ function CallControls({ onDataChange }) {
|
|
|
3570
3640
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
3571
3641
|
}
|
|
3572
3642
|
},
|
|
3573
|
-
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((
|
|
3574
|
-
disabled: ((
|
|
3643
|
+
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_ta = (_sa = state.callData) == null ? void 0 : _sa.status) == null ? void 0 : _ta.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3644
|
+
disabled: ((_va = (_ua = state.callData) == null ? void 0 : _ua.status) == null ? void 0 : _va.toUpperCase()) !== "ONCALL",
|
|
3575
3645
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Group, {})
|
|
3576
3646
|
}
|
|
3577
3647
|
) }),
|
|
3578
|
-
|
|
3648
|
+
((_wa = state.sdkConfig) == null ? void 0 : _wa.enableSmsServices) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Send SMS", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3649
|
+
import_material4.Button,
|
|
3650
|
+
{
|
|
3651
|
+
variant: Boolean(ambulanceAnchorEl) ? "contained" : "outlined",
|
|
3652
|
+
onClick: (e) => {
|
|
3653
|
+
var _a3, _b2, _c2, _d2;
|
|
3654
|
+
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()) === "WRAPUP") {
|
|
3655
|
+
e.stopPropagation();
|
|
3656
|
+
handleOpenAbulanceServices(e);
|
|
3657
|
+
}
|
|
3658
|
+
},
|
|
3659
|
+
sx: Boolean(ambulanceAnchorEl) ? __spreadValues({}, enabled) : ((_ya = (_xa = state.callData) == null ? void 0 : _xa.status) == null ? void 0 : _ya.toUpperCase()) === "ONCALL" || ((_Aa = (_za = state.callData) == null ? void 0 : _za.status) == null ? void 0 : _Aa.toUpperCase()) === "WRAPUP" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3660
|
+
disabled: ((_Ca = (_Ba = state.callData) == null ? void 0 : _Ba.status) == null ? void 0 : _Ca.toUpperCase()) !== "ONCALL" && ((_Ea = (_Da = state.callData) == null ? void 0 : _Da.status) == null ? void 0 : _Ea.toUpperCase()) !== "WRAPUP",
|
|
3661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SmsSharp, {})
|
|
3662
|
+
}
|
|
3663
|
+
) }),
|
|
3664
|
+
!((_Fa = state.sdkConfig) == null ? void 0 : _Fa.disableEndCallButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3579
3665
|
import_material4.Button,
|
|
3580
3666
|
{
|
|
3581
|
-
variant: ((
|
|
3667
|
+
variant: ((_Ha = (_Ga = state.callData) == null ? void 0 : _Ga.status) == null ? void 0 : _Ha.toUpperCase()) === "ONCALL" || ((_Ja = (_Ia = state.callData) == null ? void 0 : _Ia.status) == null ? void 0 : _Ja.toUpperCase()) === "RINGING" || ((_La = (_Ka = state.callData) == null ? void 0 : _Ka.status) == null ? void 0 : _La.toUpperCase()) === "WRAPUP" ? "contained" : "outlined",
|
|
3582
3668
|
onClick: (e) => {
|
|
3583
3669
|
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
3584
3670
|
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") {
|
|
@@ -3586,7 +3672,7 @@ function CallControls({ onDataChange }) {
|
|
|
3586
3672
|
setOpenCallDisposition(true);
|
|
3587
3673
|
}
|
|
3588
3674
|
},
|
|
3589
|
-
sx: ((
|
|
3675
|
+
sx: ((_Na = (_Ma = state.callData) == null ? void 0 : _Ma.status) == null ? void 0 : _Na.toUpperCase()) === "ONCALL" || ((_Pa = (_Oa = state.callData) == null ? void 0 : _Oa.status) == null ? void 0 : _Pa.toUpperCase()) === "RINGING" || ((_Ra = (_Qa = state.callData) == null ? void 0 : _Qa.status) == null ? void 0 : _Ra.toUpperCase()) === "WRAPUP" ? __spreadProps(__spreadValues({}, enabled), {
|
|
3590
3676
|
borderRight: "1px",
|
|
3591
3677
|
backgroundColor: "error.main",
|
|
3592
3678
|
minWidth: "60px !important",
|
|
@@ -3605,7 +3691,7 @@ function CallControls({ onDataChange }) {
|
|
|
3605
3691
|
}) : __spreadProps(__spreadValues({}, disabled), {
|
|
3606
3692
|
minWidth: "60px !important"
|
|
3607
3693
|
}),
|
|
3608
|
-
disabled: ((
|
|
3694
|
+
disabled: ((_Ta = (_Sa = state.callData) == null ? void 0 : _Sa.status) == null ? void 0 : _Ta.toUpperCase()) !== "ONCALL" && ((_Va = (_Ua = state.callData) == null ? void 0 : _Ua.status) == null ? void 0 : _Va.toUpperCase()) !== "RINGING" && ((_Xa = (_Wa = state.callData) == null ? void 0 : _Wa.status) == null ? void 0 : _Xa.toUpperCase()) !== "WRAPUP" || endCallLoading,
|
|
3609
3695
|
children: endCallLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3610
3696
|
import_material4.CircularProgress,
|
|
3611
3697
|
{
|
|
@@ -3645,7 +3731,7 @@ function CallControls({ onDataChange }) {
|
|
|
3645
3731
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3646
3732
|
duration: theme.transitions.duration.short
|
|
3647
3733
|
}),
|
|
3648
|
-
visibility: showIframe && !((
|
|
3734
|
+
visibility: showIframe && !((_Ya = state.sdkConfig) == null ? void 0 : _Ya.disableSoftPhone) ? "visible" : "hidden",
|
|
3649
3735
|
userSelect: "none"
|
|
3650
3736
|
},
|
|
3651
3737
|
children: [
|
|
@@ -3679,7 +3765,7 @@ function CallControls({ onDataChange }) {
|
|
|
3679
3765
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3680
3766
|
"iframe",
|
|
3681
3767
|
{
|
|
3682
|
-
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(
|
|
3768
|
+
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_Za = state.process) == null ? void 0 : _Za.process_id}`,
|
|
3683
3769
|
height: 380,
|
|
3684
3770
|
width: 420,
|
|
3685
3771
|
allow: "camera; microphone; autoplay",
|
|
@@ -3748,6 +3834,72 @@ function CallControls({ onDataChange }) {
|
|
|
3748
3834
|
)
|
|
3749
3835
|
}
|
|
3750
3836
|
),
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3838
|
+
import_material4.Menu,
|
|
3839
|
+
{
|
|
3840
|
+
anchorEl: ambulanceAnchorEl,
|
|
3841
|
+
open: Boolean(ambulanceAnchorEl),
|
|
3842
|
+
onClose: handleCloseAmbulance,
|
|
3843
|
+
onClick: (e) => e.stopPropagation(),
|
|
3844
|
+
sx: {
|
|
3845
|
+
zIndex: 99999
|
|
3846
|
+
},
|
|
3847
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3848
|
+
import_material4.Box,
|
|
3849
|
+
{
|
|
3850
|
+
sx: {
|
|
3851
|
+
all: "unset",
|
|
3852
|
+
padding: " 0px 20px",
|
|
3853
|
+
"&hover": {
|
|
3854
|
+
backgroundColor: "white"
|
|
3855
|
+
},
|
|
3856
|
+
display: "flex",
|
|
3857
|
+
alignItems: "center"
|
|
3858
|
+
},
|
|
3859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Ambulance Service", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3860
|
+
import_material4.Button,
|
|
3861
|
+
{
|
|
3862
|
+
color: "primary",
|
|
3863
|
+
variant: "outlined",
|
|
3864
|
+
onClick: () => {
|
|
3865
|
+
handleSendSMS(state.callData);
|
|
3866
|
+
},
|
|
3867
|
+
children: [
|
|
3868
|
+
"Ambulance",
|
|
3869
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3870
|
+
import_material4.Box,
|
|
3871
|
+
{
|
|
3872
|
+
sx: {
|
|
3873
|
+
display: "flex",
|
|
3874
|
+
alignItems: "center",
|
|
3875
|
+
backgroundColor: "green",
|
|
3876
|
+
color: "#fff",
|
|
3877
|
+
marginLeft: "14px",
|
|
3878
|
+
padding: "2px 6px",
|
|
3879
|
+
borderRadius: "10px"
|
|
3880
|
+
},
|
|
3881
|
+
children: [
|
|
3882
|
+
"Send",
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3884
|
+
import_icons_material2.SendRounded,
|
|
3885
|
+
{
|
|
3886
|
+
sx: {
|
|
3887
|
+
marginLeft: "8px",
|
|
3888
|
+
width: "18px",
|
|
3889
|
+
transform: "rotate(-16deg)"
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
)
|
|
3893
|
+
]
|
|
3894
|
+
}
|
|
3895
|
+
)
|
|
3896
|
+
]
|
|
3897
|
+
}
|
|
3898
|
+
) })
|
|
3899
|
+
}
|
|
3900
|
+
)
|
|
3901
|
+
}
|
|
3902
|
+
),
|
|
3751
3903
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3752
3904
|
import_material4.Menu,
|
|
3753
3905
|
{
|