padorixnpm 0.0.66 → 0.0.69
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/chat-panel-CXbOkOSq.js +2781 -0
- package/dist/chat-panel-CXbOkOSq.js.map +1 -0
- package/dist/chats/chatScreen/chat-container.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-conversation-selector.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-conversation.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-float-container.d.ts +1 -0
- package/dist/chats/chatScreen/chat-float-container.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-panel.d.ts +18 -0
- package/dist/chats/chatScreen/chat-panel.d.ts.map +1 -0
- package/dist/chats/chatScreen/chat-screen.d.ts.map +1 -1
- package/dist/chats/chatform/chat-form-component.d.ts.map +1 -1
- package/dist/chats/chatform/chat-form.d.ts.map +1 -1
- package/dist/chats/chatform/chat-text-input.d.ts.map +1 -1
- package/dist/chats/chatheader/chat-header.d.ts.map +1 -1
- package/dist/chats/chatmessages/chat-feedback-form.d.ts.map +1 -1
- package/dist/chats/chatmessages/chat-reply.d.ts.map +1 -1
- package/dist/chats/chatmessages/end-chat-confirmation.d.ts.map +1 -1
- package/dist/chats/newchat/new-chat.d.ts.map +1 -1
- package/dist/config-Cgly4edG.js +6 -0
- package/dist/config-Cgly4edG.js.map +1 -0
- package/dist/notification-ChYfFRqp.js +122 -0
- package/dist/notification-ChYfFRqp.js.map +1 -0
- package/dist/padorixnpm.js +181 -3225
- package/dist/padorixnpm.js.map +1 -1
- package/dist/padorixnpm.umd.cjs +10 -10
- package/dist/padorixnpm.umd.cjs.map +1 -1
- package/dist/services/chat-api.d.ts +58 -0
- package/dist/services/chat-api.d.ts.map +1 -0
- package/dist/services/config.d.ts +2 -0
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/socket.d.ts +14 -3
- package/dist/services/socket.d.ts.map +1 -1
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/use-chat-identity.d.ts +4 -0
- package/dist/utils/use-chat-identity.d.ts.map +1 -0
- package/dist/utils/widget-api.d.ts +1 -0
- package/dist/utils/widget-api.d.ts.map +1 -1
- package/dist/widget-api-2bTO9wMA.js +356 -0
- package/dist/widget-api-2bTO9wMA.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2781 @@
|
|
|
1
|
+
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, f, g as p, h as m, i as h, j as g, k as _, l as v, m as y, s as b, u as x, v as ee, w as S, x as C, y as w } from "./widget-api-2bTO9wMA.js";
|
|
2
|
+
import T, { i as E, n as te, r as D, t as ne } from "./notification-ChYfFRqp.js";
|
|
3
|
+
import { useDispatch as O, useSelector as k } from "react-redux";
|
|
4
|
+
import A, { createElement as j, forwardRef as M, useState as N } from "react";
|
|
5
|
+
import { Add as P, ArrowDown2 as F, ArrowForward as re, ArrowLeft2 as ie, Copy as ae, DocumentDownload as oe, EmojiHappy as se, Global as I, Minus as ce, Send as L, Star1 as le, Trash as ue } from "iconsax-reactjs";
|
|
6
|
+
import { Fade as R, JackInTheBox as de, Slide as fe } from "react-awesome-reveal";
|
|
7
|
+
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
8
|
+
import { MantineProvider as H, Modal as U, Popover as W } from "@mantine/core";
|
|
9
|
+
import G from "dayjs";
|
|
10
|
+
import { useDisclosure as pe } from "@mantine/hooks";
|
|
11
|
+
import { useForm as K } from "@mantine/form";
|
|
12
|
+
//#region lib/chats/chatform/chat-text-input.tsx
|
|
13
|
+
var q = 120, me = 2500, he = 1500, ge = M(({ setMessage: e, message: t, userType: n, onImagePasted: r, onSubmit: i, ...a }, o) => {
|
|
14
|
+
let { sender: s } = k((e) => e.data), c = A.useRef(null), l = A.useRef(0), u = A.useRef(!1);
|
|
15
|
+
A.useImperativeHandle(o, () => c.current), A.useLayoutEffect(() => {
|
|
16
|
+
let e = c.current;
|
|
17
|
+
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, q)}px`, e.style.overflowY = e.scrollHeight > q ? "auto" : "hidden");
|
|
18
|
+
}, [t]);
|
|
19
|
+
let d = (e) => {
|
|
20
|
+
let t = e.clipboardData?.items;
|
|
21
|
+
if (!t) return;
|
|
22
|
+
let n = [];
|
|
23
|
+
for (let e = 0; e < t.length; e++) if (t[e].type.indexOf("image") !== -1) {
|
|
24
|
+
let r = t[e].getAsFile();
|
|
25
|
+
r && n.push(r);
|
|
26
|
+
}
|
|
27
|
+
n.length > 0 && (e.preventDefault(), r?.(n));
|
|
28
|
+
}, f = A.useCallback((t) => {
|
|
29
|
+
e(t.target.value);
|
|
30
|
+
}, [e]), p = A.useCallback((e) => {
|
|
31
|
+
u.current && (u.current = !1, l.current = 0, E.emit(D.not_typing, e));
|
|
32
|
+
}, []);
|
|
33
|
+
A.useEffect(() => {
|
|
34
|
+
let e = s?.conversationId;
|
|
35
|
+
if (!e) return;
|
|
36
|
+
let r = {
|
|
37
|
+
conversationId: e,
|
|
38
|
+
senderId: s?.senderId,
|
|
39
|
+
userType: n
|
|
40
|
+
};
|
|
41
|
+
if (!t.trim()) {
|
|
42
|
+
p(r);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let i = Date.now();
|
|
46
|
+
i - l.current > me && (l.current = i, u.current = !0, E.emit(D.is_typing, r));
|
|
47
|
+
let a = window.setTimeout(() => p(r), he);
|
|
48
|
+
return () => {
|
|
49
|
+
window.clearTimeout(a);
|
|
50
|
+
};
|
|
51
|
+
}, [
|
|
52
|
+
t,
|
|
53
|
+
s?.conversationId,
|
|
54
|
+
s?.senderId,
|
|
55
|
+
n,
|
|
56
|
+
p
|
|
57
|
+
]), A.useEffect(() => {
|
|
58
|
+
let e = s?.conversationId;
|
|
59
|
+
return () => {
|
|
60
|
+
e && p({
|
|
61
|
+
conversationId: e,
|
|
62
|
+
senderId: s?.senderId,
|
|
63
|
+
userType: n
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
}, [
|
|
67
|
+
s?.conversationId,
|
|
68
|
+
s?.senderId,
|
|
69
|
+
n,
|
|
70
|
+
p
|
|
71
|
+
]);
|
|
72
|
+
let m = (e) => {
|
|
73
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), i());
|
|
74
|
+
}, h = () => {
|
|
75
|
+
s?.conversationId && p({
|
|
76
|
+
conversationId: s.conversationId,
|
|
77
|
+
senderId: s.senderId,
|
|
78
|
+
userType: n
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
return /* @__PURE__ */ B("div", {
|
|
82
|
+
className: "padorix:w-full padorix:bg-slate-100 padorix:rounded-lg",
|
|
83
|
+
children: /* @__PURE__ */ B("textarea", {
|
|
84
|
+
ref: c,
|
|
85
|
+
...a,
|
|
86
|
+
spellCheck: !0,
|
|
87
|
+
autoCorrect: "on",
|
|
88
|
+
autoCapitalize: "sentences",
|
|
89
|
+
autoComplete: "on",
|
|
90
|
+
value: t,
|
|
91
|
+
onChange: f,
|
|
92
|
+
onPaste: d,
|
|
93
|
+
onKeyDown: m,
|
|
94
|
+
onBlur: h,
|
|
95
|
+
placeholder: "Type a message...",
|
|
96
|
+
className: "padorix:w-full padorix:text-left padorix:px-3 padorix:py-2 padorix:outline-none padorix:text-sm padorix:max-md:text-base padorix:resize-none padorix-scrolls padorix:min-h-10 padorix:max-h-30",
|
|
97
|
+
rows: 1
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}), _e = {
|
|
101
|
+
color: void 0,
|
|
102
|
+
size: void 0,
|
|
103
|
+
className: void 0,
|
|
104
|
+
style: void 0,
|
|
105
|
+
attr: void 0
|
|
106
|
+
}, J = A.createContext && /*#__PURE__*/ A.createContext(_e), ve = [
|
|
107
|
+
"attr",
|
|
108
|
+
"size",
|
|
109
|
+
"title"
|
|
110
|
+
];
|
|
111
|
+
function ye(e, t) {
|
|
112
|
+
if (e == null) return {};
|
|
113
|
+
var n, r, i = be(e, t);
|
|
114
|
+
if (Object.getOwnPropertySymbols) {
|
|
115
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
116
|
+
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
117
|
+
}
|
|
118
|
+
return i;
|
|
119
|
+
}
|
|
120
|
+
function be(e, t) {
|
|
121
|
+
if (e == null) return {};
|
|
122
|
+
var n = {};
|
|
123
|
+
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
124
|
+
if (t.indexOf(r) !== -1) continue;
|
|
125
|
+
n[r] = e[r];
|
|
126
|
+
}
|
|
127
|
+
return n;
|
|
128
|
+
}
|
|
129
|
+
function Y() {
|
|
130
|
+
return Y = Object.assign ? Object.assign.bind() : function(e) {
|
|
131
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
132
|
+
var n = arguments[t];
|
|
133
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
134
|
+
}
|
|
135
|
+
return e;
|
|
136
|
+
}, Y.apply(null, arguments);
|
|
137
|
+
}
|
|
138
|
+
function xe(e, t) {
|
|
139
|
+
var n = Object.keys(e);
|
|
140
|
+
if (Object.getOwnPropertySymbols) {
|
|
141
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
142
|
+
t && (r = r.filter(function(t) {
|
|
143
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
144
|
+
})), n.push.apply(n, r);
|
|
145
|
+
}
|
|
146
|
+
return n;
|
|
147
|
+
}
|
|
148
|
+
function X(e) {
|
|
149
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
150
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
151
|
+
t % 2 ? xe(Object(n), !0).forEach(function(t) {
|
|
152
|
+
Se(e, t, n[t]);
|
|
153
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : xe(Object(n)).forEach(function(t) {
|
|
154
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return e;
|
|
158
|
+
}
|
|
159
|
+
function Se(e, t, n) {
|
|
160
|
+
return (t = Ce(t)) in e ? Object.defineProperty(e, t, {
|
|
161
|
+
value: n,
|
|
162
|
+
enumerable: !0,
|
|
163
|
+
configurable: !0,
|
|
164
|
+
writable: !0
|
|
165
|
+
}) : e[t] = n, e;
|
|
166
|
+
}
|
|
167
|
+
function Ce(e) {
|
|
168
|
+
var t = we(e, "string");
|
|
169
|
+
return typeof t == "symbol" ? t : t + "";
|
|
170
|
+
}
|
|
171
|
+
function we(e, t) {
|
|
172
|
+
if (typeof e != "object" || !e) return e;
|
|
173
|
+
var n = e[Symbol.toPrimitive];
|
|
174
|
+
if (n !== void 0) {
|
|
175
|
+
var r = n.call(e, t || "default");
|
|
176
|
+
if (typeof r != "object") return r;
|
|
177
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
178
|
+
}
|
|
179
|
+
return (t === "string" ? String : Number)(e);
|
|
180
|
+
}
|
|
181
|
+
function Te(e) {
|
|
182
|
+
return e && e.map((e, t) => /*#__PURE__*/ A.createElement(e.tag, X({ key: t }, e.attr), Te(e.child)));
|
|
183
|
+
}
|
|
184
|
+
function Z(e) {
|
|
185
|
+
return (t) => /*#__PURE__*/ A.createElement(Ee, Y({ attr: X({}, e.attr) }, t), Te(e.child));
|
|
186
|
+
}
|
|
187
|
+
function Ee(e) {
|
|
188
|
+
var t = (t) => {
|
|
189
|
+
var { attr: n, size: r, title: i } = e, a = ye(e, ve), o = r || t.size || "1em", s;
|
|
190
|
+
return t.className && (s = t.className), e.className && (s = (s ? s + " " : "") + e.className), /*#__PURE__*/ A.createElement("svg", Y({
|
|
191
|
+
stroke: "currentColor",
|
|
192
|
+
fill: "currentColor",
|
|
193
|
+
strokeWidth: "0"
|
|
194
|
+
}, t.attr, n, a, {
|
|
195
|
+
className: s,
|
|
196
|
+
style: X(X({ color: e.color || t.color }, t.style), e.style),
|
|
197
|
+
height: o,
|
|
198
|
+
width: o,
|
|
199
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
200
|
+
}), i && /*#__PURE__*/ A.createElement("title", null, i), e.children);
|
|
201
|
+
};
|
|
202
|
+
return J === void 0 ? t(_e) : /*#__PURE__*/ A.createElement(J.Consumer, null, (e) => t(e));
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region node_modules/react-icons/fi/index.mjs
|
|
206
|
+
function Q(e) {
|
|
207
|
+
return Z({
|
|
208
|
+
tag: "svg",
|
|
209
|
+
attr: {
|
|
210
|
+
viewBox: "0 0 24 24",
|
|
211
|
+
fill: "none",
|
|
212
|
+
stroke: "currentColor",
|
|
213
|
+
strokeWidth: "2",
|
|
214
|
+
strokeLinecap: "round",
|
|
215
|
+
strokeLinejoin: "round"
|
|
216
|
+
},
|
|
217
|
+
child: [{
|
|
218
|
+
tag: "line",
|
|
219
|
+
attr: {
|
|
220
|
+
x1: "18",
|
|
221
|
+
y1: "6",
|
|
222
|
+
x2: "6",
|
|
223
|
+
y2: "18"
|
|
224
|
+
},
|
|
225
|
+
child: []
|
|
226
|
+
}, {
|
|
227
|
+
tag: "line",
|
|
228
|
+
attr: {
|
|
229
|
+
x1: "6",
|
|
230
|
+
y1: "6",
|
|
231
|
+
x2: "18",
|
|
232
|
+
y2: "18"
|
|
233
|
+
},
|
|
234
|
+
child: []
|
|
235
|
+
}]
|
|
236
|
+
})(e);
|
|
237
|
+
}
|
|
238
|
+
function De(e) {
|
|
239
|
+
return Z({
|
|
240
|
+
tag: "svg",
|
|
241
|
+
attr: {
|
|
242
|
+
viewBox: "0 0 24 24",
|
|
243
|
+
fill: "none",
|
|
244
|
+
stroke: "currentColor",
|
|
245
|
+
strokeWidth: "2",
|
|
246
|
+
strokeLinecap: "round",
|
|
247
|
+
strokeLinejoin: "round"
|
|
248
|
+
},
|
|
249
|
+
child: [{
|
|
250
|
+
tag: "line",
|
|
251
|
+
attr: {
|
|
252
|
+
x1: "5",
|
|
253
|
+
y1: "12",
|
|
254
|
+
x2: "19",
|
|
255
|
+
y2: "12"
|
|
256
|
+
},
|
|
257
|
+
child: []
|
|
258
|
+
}]
|
|
259
|
+
})(e);
|
|
260
|
+
}
|
|
261
|
+
function Oe(e) {
|
|
262
|
+
return Z({
|
|
263
|
+
tag: "svg",
|
|
264
|
+
attr: {
|
|
265
|
+
viewBox: "0 0 24 24",
|
|
266
|
+
fill: "none",
|
|
267
|
+
stroke: "currentColor",
|
|
268
|
+
strokeWidth: "2",
|
|
269
|
+
strokeLinecap: "round",
|
|
270
|
+
strokeLinejoin: "round"
|
|
271
|
+
},
|
|
272
|
+
child: [
|
|
273
|
+
{
|
|
274
|
+
tag: "path",
|
|
275
|
+
attr: { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" },
|
|
276
|
+
child: []
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
tag: "polyline",
|
|
280
|
+
attr: { points: "7 10 12 15 17 10" },
|
|
281
|
+
child: []
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
tag: "line",
|
|
285
|
+
attr: {
|
|
286
|
+
x1: "12",
|
|
287
|
+
y1: "15",
|
|
288
|
+
x2: "12",
|
|
289
|
+
y2: "3"
|
|
290
|
+
},
|
|
291
|
+
child: []
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
})(e);
|
|
295
|
+
}
|
|
296
|
+
function ke(e) {
|
|
297
|
+
return Z({
|
|
298
|
+
tag: "svg",
|
|
299
|
+
attr: {
|
|
300
|
+
viewBox: "0 0 24 24",
|
|
301
|
+
fill: "none",
|
|
302
|
+
stroke: "currentColor",
|
|
303
|
+
strokeWidth: "2",
|
|
304
|
+
strokeLinecap: "round",
|
|
305
|
+
strokeLinejoin: "round"
|
|
306
|
+
},
|
|
307
|
+
child: [{
|
|
308
|
+
tag: "polyline",
|
|
309
|
+
attr: { points: "9 18 15 12 9 6" },
|
|
310
|
+
child: []
|
|
311
|
+
}]
|
|
312
|
+
})(e);
|
|
313
|
+
}
|
|
314
|
+
function Ae(e) {
|
|
315
|
+
return Z({
|
|
316
|
+
tag: "svg",
|
|
317
|
+
attr: {
|
|
318
|
+
viewBox: "0 0 24 24",
|
|
319
|
+
fill: "none",
|
|
320
|
+
stroke: "currentColor",
|
|
321
|
+
strokeWidth: "2",
|
|
322
|
+
strokeLinecap: "round",
|
|
323
|
+
strokeLinejoin: "round"
|
|
324
|
+
},
|
|
325
|
+
child: [{
|
|
326
|
+
tag: "polyline",
|
|
327
|
+
attr: { points: "20 6 9 17 4 12" },
|
|
328
|
+
child: []
|
|
329
|
+
}]
|
|
330
|
+
})(e);
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region lib/chats/chatmessages/chat-display-reply.tsx
|
|
334
|
+
function je(t) {
|
|
335
|
+
let n = O(), i = Array.isArray(t.data?.message) ? t.data.message.join(" ") : String(t.data?.message ?? "");
|
|
336
|
+
function a() {
|
|
337
|
+
n(r(void 0)), n(e(void 0));
|
|
338
|
+
}
|
|
339
|
+
if (t.data?.id) return /* @__PURE__ */ B("div", {
|
|
340
|
+
className: t.styles.replyContainer,
|
|
341
|
+
children: /* @__PURE__ */ B("div", {
|
|
342
|
+
className: "padorix-fade-in padorix:bg-white padorix:w-[96%] padorix:mx-auto padorix:py-0.5",
|
|
343
|
+
children: /* @__PURE__ */ B("div", { children: /* @__PURE__ */ B("div", {
|
|
344
|
+
className: "padorix:px-2",
|
|
345
|
+
children: /* @__PURE__ */ V("div", {
|
|
346
|
+
className: "padorix:bg-white padorix:rounded-tl-lg padorix:rounded-tr-lg padorix:border-t padorix:border-x padorix:border-gray-200 padorix:shadow-inner padorix:text-zinc-600 padorix:px-4 padorix:flex padorix:items-center padorix:justify-between",
|
|
347
|
+
children: [/* @__PURE__ */ V("div", {
|
|
348
|
+
className: "padorix:flex padorix:items-center padorix:py-2.5 padorix:text-sm",
|
|
349
|
+
children: [/* @__PURE__ */ B(re, { className: "padorix:inline padorix:size-6 padorix:mr-3" }), i.length > 0 && /* @__PURE__ */ V("span", { children: [i.slice(0, 30), i.length > 30 ? "..." : ""] })]
|
|
350
|
+
}), /* @__PURE__ */ V("div", {
|
|
351
|
+
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
352
|
+
children: [Number(t.data?.images?.length) > 0 && /* @__PURE__ */ V("div", {
|
|
353
|
+
className: "padorix:flex padorix:gap-1 padorix:flex-row",
|
|
354
|
+
children: [Array.isArray(t?.data?.images) && t?.data?.images?.slice(0, 2)?.map((e, t) => /* @__PURE__ */ B("img", {
|
|
355
|
+
src: e,
|
|
356
|
+
alt: "Padorix",
|
|
357
|
+
className: "padorix:size-10 padorix:bg-slate-800 padorix:inline padorix:object-contain"
|
|
358
|
+
}, t)), Number(t.data?.images?.length) > 2 && /* @__PURE__ */ V("div", {
|
|
359
|
+
className: "padorix:flex padorix:items-center",
|
|
360
|
+
children: [
|
|
361
|
+
" ",
|
|
362
|
+
/* @__PURE__ */ B(P, { className: "padorix:inline padorix:size-5" }),
|
|
363
|
+
" ",
|
|
364
|
+
Number(t.data?.images?.length) - 2,
|
|
365
|
+
" "
|
|
366
|
+
]
|
|
367
|
+
})]
|
|
368
|
+
}), /* @__PURE__ */ B("div", {
|
|
369
|
+
onClick: a,
|
|
370
|
+
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-95",
|
|
371
|
+
children: /* @__PURE__ */ B(Q, { className: "padorix:inline padorix:size-6 padorix:mr-3" })
|
|
372
|
+
})]
|
|
373
|
+
})]
|
|
374
|
+
})
|
|
375
|
+
}) })
|
|
376
|
+
}, t.data.id)
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region lib/chats/chatform/chat-form.tsx
|
|
381
|
+
var Me = A.lazy(() => import("emoji-picker-react"));
|
|
382
|
+
function Ne(e) {
|
|
383
|
+
let { sender: t, workspace: n, message: r } = k((e) => e.data), [i, a] = A.useState(!1), [o, s] = A.useState(!1);
|
|
384
|
+
i && !o && s(!0);
|
|
385
|
+
let [c, l] = A.useState(""), u = A.useRef(null), d = Number(e.previews?.length) < 1, f = Math.max(0, Number(n?.tier?.max_file_upload ?? 2)), p = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), m = n?.file_uploads_date === p ? Number(n?.file_uploads_used ?? 0) : 0, h = e.showFile && m + e.pendingFileCount < f;
|
|
386
|
+
function g(e) {
|
|
387
|
+
let t = u.current;
|
|
388
|
+
if (!t) return;
|
|
389
|
+
let n = t.selectionStart, r = t.selectionEnd, i = t.value;
|
|
390
|
+
l(i.substring(0, n) + e + i.substring(r));
|
|
391
|
+
}
|
|
392
|
+
function _() {
|
|
393
|
+
if (d && !c || e.isSending) return;
|
|
394
|
+
t?.conversationId && E.emit(D.not_typing, {
|
|
395
|
+
conversationId: t.conversationId,
|
|
396
|
+
senderId: t.senderId,
|
|
397
|
+
userType: e.userType
|
|
398
|
+
});
|
|
399
|
+
let r = {
|
|
400
|
+
senderId: String(t?.senderId),
|
|
401
|
+
workspaceId: String(n?.id),
|
|
402
|
+
conversationId: String(t?.conversationId),
|
|
403
|
+
message: c.trim(),
|
|
404
|
+
userType: String(e.userType)
|
|
405
|
+
};
|
|
406
|
+
e.sendChat(r), l("");
|
|
407
|
+
}
|
|
408
|
+
return /* @__PURE__ */ V("div", {
|
|
409
|
+
className: "relative overflow-x-hidden",
|
|
410
|
+
children: [/* @__PURE__ */ B("div", {
|
|
411
|
+
style: { visibility: i ? "visible" : "hidden" },
|
|
412
|
+
className: e.styles.emojiContainer,
|
|
413
|
+
children: o && /* @__PURE__ */ B(A.Suspense, {
|
|
414
|
+
fallback: null,
|
|
415
|
+
children: /* @__PURE__ */ B(Me, { onEmojiClick: (e) => g(e.emoji) })
|
|
416
|
+
})
|
|
417
|
+
}), /* @__PURE__ */ V("div", {
|
|
418
|
+
className: e.styles.formContainer,
|
|
419
|
+
children: [r?.id && /* @__PURE__ */ B(je, {
|
|
420
|
+
styles: e.styles,
|
|
421
|
+
data: r
|
|
422
|
+
}), /* @__PURE__ */ V("div", {
|
|
423
|
+
className: "padorix:flex padorix:items-center padorix:justify-center padorix:rounded-lg padorix:p-0.5 padorix:relative padorix:gap-1",
|
|
424
|
+
children: [/* @__PURE__ */ V("div", {
|
|
425
|
+
className: "padorix:flex padorix:items-center padorix:gap-1 padorix:bg-gray-100 padorix:w-full padorix:rounded-lg",
|
|
426
|
+
children: [
|
|
427
|
+
h && /* @__PURE__ */ V("label", {
|
|
428
|
+
title: "Attach images",
|
|
429
|
+
className: "padorix:cursor-pointer padorix:px-1 padorix:text-[#99a1af]",
|
|
430
|
+
children: [/* @__PURE__ */ B(P, {}), /* @__PURE__ */ B("input", {
|
|
431
|
+
type: "file",
|
|
432
|
+
accept: ".png,.jpg,.jpeg,.webp",
|
|
433
|
+
hidden: !0,
|
|
434
|
+
onChange: e.handleFile,
|
|
435
|
+
multiple: !0
|
|
436
|
+
})]
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ V("div", {
|
|
439
|
+
onClick: () => a((e) => !e),
|
|
440
|
+
className: "padorix:text-[#99a1af] padorix:cursor-pointer padorix:px-1 padorix:transition-all",
|
|
441
|
+
children: [
|
|
442
|
+
" ",
|
|
443
|
+
/* @__PURE__ */ B(se, {}),
|
|
444
|
+
" "
|
|
445
|
+
]
|
|
446
|
+
}),
|
|
447
|
+
/* @__PURE__ */ B("div", {
|
|
448
|
+
className: "padorix:w-full",
|
|
449
|
+
children: /* @__PURE__ */ B(ge, {
|
|
450
|
+
ref: u,
|
|
451
|
+
message: c,
|
|
452
|
+
setMessage: l,
|
|
453
|
+
userType: e.userType,
|
|
454
|
+
onSubmit: _
|
|
455
|
+
})
|
|
456
|
+
})
|
|
457
|
+
]
|
|
458
|
+
}), /* @__PURE__ */ B("div", { children: /* @__PURE__ */ V("div", {
|
|
459
|
+
onClick: _,
|
|
460
|
+
style: {
|
|
461
|
+
background: d && !c || e.isSending ? "#9f9fa9" : String(n?.widget?.colorScheme),
|
|
462
|
+
cursor: d && !c || e.isSending ? "not-allowed" : "pointer"
|
|
463
|
+
},
|
|
464
|
+
className: "padorix:-mt-1 padorix:size-10 padorix:text-white padorix:rounded-lg padorix:flex padorix:last:items-center padorix:justify-center",
|
|
465
|
+
children: [" ", /* @__PURE__ */ B(L, { className: "padorix:size-6" })]
|
|
466
|
+
}) })]
|
|
467
|
+
})]
|
|
468
|
+
})]
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region lib/chats/chatform/chat-image-upload.tsx
|
|
473
|
+
function Pe(e) {
|
|
474
|
+
let { workspace: t } = k((e) => e.data), n = Math.max(0, Number(t?.tier?.max_file_upload ?? 2)), r = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), i = t?.file_uploads_date === r ? Number(t?.file_uploads_used ?? 0) : 0, [a, o] = A.useState({
|
|
475
|
+
index: 0,
|
|
476
|
+
image: e.previews?.[0]?.img
|
|
477
|
+
});
|
|
478
|
+
function s(t) {
|
|
479
|
+
e.sendChat(t);
|
|
480
|
+
}
|
|
481
|
+
if (Number(e.previews?.length || 0) > 0) return /* @__PURE__ */ V("div", {
|
|
482
|
+
className: e.styles.imageUploadContainer,
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ V("div", {
|
|
485
|
+
className: "padorix:h-[60dvh] padorix:border padorix:border-gray-300 padorix:py-3 padorix:md:h-[50dvh] padorix:md:relative padorix:bg-white",
|
|
486
|
+
children: [/* @__PURE__ */ B("div", {
|
|
487
|
+
className: "padorix:py-0 padorix:px-2 padorix:pt-1.5 padorix:absolute padorix:top-0 padorix:right-0 padorix:w-full padorix:bg-white",
|
|
488
|
+
children: /* @__PURE__ */ V("div", {
|
|
489
|
+
onClick: e.DiscardAllImages,
|
|
490
|
+
className: "padorix:size-fit padorix:ml-auto padorix:text-red-600 padorix:cursor-pointer padorix:text-xl",
|
|
491
|
+
children: [
|
|
492
|
+
" ",
|
|
493
|
+
/* @__PURE__ */ B(Q, {}),
|
|
494
|
+
" "
|
|
495
|
+
]
|
|
496
|
+
})
|
|
497
|
+
}), /* @__PURE__ */ B("img", {
|
|
498
|
+
src: a.image,
|
|
499
|
+
loading: "lazy",
|
|
500
|
+
className: "padorix:size-full padorix:mx-auto padorix:object-contain"
|
|
501
|
+
})]
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ V("div", {
|
|
504
|
+
className: "padorix:flex padorix:items-center padorix:justify-center padorix:gap-1 padorix:max-w-[98%] padorix:mx-auto",
|
|
505
|
+
children: [/* @__PURE__ */ B("div", {
|
|
506
|
+
className: "padorix:overflow-y-hidden padorix:overflow-x-auto",
|
|
507
|
+
children: /* @__PURE__ */ B("div", {
|
|
508
|
+
className: "padorix:w-fit",
|
|
509
|
+
children: /* @__PURE__ */ B("div", {
|
|
510
|
+
className: "padorix:flex padorix:items-center padorix:justify-center padorix:gap-1",
|
|
511
|
+
children: e.previews?.map((n, r) => /* @__PURE__ */ V("div", {
|
|
512
|
+
style: { border: `3.5px solid ${a.index === r ? String(t?.widget?.colorScheme) : "transparent"}` },
|
|
513
|
+
className: "padorix:relative padorix:size-14 padorix:border-2 padorix:rounded-lg",
|
|
514
|
+
children: [/* @__PURE__ */ B("div", {
|
|
515
|
+
onClick: () => e.DiscardSingleImage(r),
|
|
516
|
+
className: "padorix:absolute padorix:top-0 padorix:left-0 padorix:w-full padorix:bg-slate-700 padorix:rounded-t-sm",
|
|
517
|
+
children: /* @__PURE__ */ V("div", {
|
|
518
|
+
className: "padorix:size-fit padorix:ml-auto padorix:cursor-pointer padorix:text-[#ef4444] padorix:text-sm",
|
|
519
|
+
children: [
|
|
520
|
+
" ",
|
|
521
|
+
/* @__PURE__ */ B(Q, {}),
|
|
522
|
+
" "
|
|
523
|
+
]
|
|
524
|
+
})
|
|
525
|
+
}), /* @__PURE__ */ B("img", {
|
|
526
|
+
onClick: () => o({
|
|
527
|
+
index: r,
|
|
528
|
+
image: n?.img
|
|
529
|
+
}),
|
|
530
|
+
src: n?.img,
|
|
531
|
+
loading: "lazy",
|
|
532
|
+
className: "padorix:size-full padorix:cursor-pointer padorix:rounded-md padorix:object-cover"
|
|
533
|
+
})]
|
|
534
|
+
}, r))
|
|
535
|
+
})
|
|
536
|
+
})
|
|
537
|
+
}), i + e.pendingFileCount < n && /* @__PURE__ */ B("div", {
|
|
538
|
+
className: "",
|
|
539
|
+
children: /* @__PURE__ */ B("div", {
|
|
540
|
+
style: {
|
|
541
|
+
borderColor: `${t?.widget?.colorScheme}`,
|
|
542
|
+
color: String(t?.widget?.colorScheme)
|
|
543
|
+
},
|
|
544
|
+
className: "padorix:size-12 padorix:border padorix:sticky padorix:left-0 padorix:cursor-pointer padorix:rounded-md padorix:flex padorix:items-center padorix:justify-center",
|
|
545
|
+
children: /* @__PURE__ */ V("label", {
|
|
546
|
+
className: "padorix:cursor-pointer",
|
|
547
|
+
children: [/* @__PURE__ */ B(P, {}), /* @__PURE__ */ B("input", {
|
|
548
|
+
type: "file",
|
|
549
|
+
accept: ".png,.jpg,.jpeg,.webp",
|
|
550
|
+
hidden: !0,
|
|
551
|
+
onChange: e.handleFile,
|
|
552
|
+
multiple: !0
|
|
553
|
+
})]
|
|
554
|
+
})
|
|
555
|
+
})
|
|
556
|
+
})]
|
|
557
|
+
}),
|
|
558
|
+
/* @__PURE__ */ B(Ne, {
|
|
559
|
+
showFile: !1,
|
|
560
|
+
pendingFileCount: e.pendingFileCount,
|
|
561
|
+
sendChat: s,
|
|
562
|
+
styles: e.styles,
|
|
563
|
+
userType: e.userType,
|
|
564
|
+
handleFile: e.handleFile,
|
|
565
|
+
isSending: e.isSending
|
|
566
|
+
})
|
|
567
|
+
]
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region lib/utils/use-chat-identity.ts
|
|
572
|
+
function Fe(e) {
|
|
573
|
+
let { sender: t, workspace: n, conversation: r } = k((e) => e.data), i = t?.workspaceId || n?.id || r?.workspaceId, a = t?.conversationId, o = t?.senderId, s = t?.userType || e, c = t?.fullName;
|
|
574
|
+
return A.useMemo(() => !i || !a || !o ? null : {
|
|
575
|
+
workspaceId: String(i),
|
|
576
|
+
conversationId: String(a),
|
|
577
|
+
senderId: String(o),
|
|
578
|
+
userType: String(s),
|
|
579
|
+
senderName: c ? String(c) : void 0
|
|
580
|
+
}, [
|
|
581
|
+
i,
|
|
582
|
+
a,
|
|
583
|
+
o,
|
|
584
|
+
s,
|
|
585
|
+
c
|
|
586
|
+
]);
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region lib/chats/chatform/chat-form-component.tsx
|
|
590
|
+
function Ie(e) {
|
|
591
|
+
let [n, r] = A.useState([]), [i, o] = A.useState([]), [c, l] = A.useState(0), u = A.useRef(0), { sender: p, workspace: m } = k((e) => e.data), h = O(), g = Fe(e.userType), _ = Math.max(0, Number(m?.tier?.max_file_upload ?? 2)), v = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), y = m?.file_uploads_date === v ? Number(m?.file_uploads_used ?? 0) : 0;
|
|
592
|
+
function b(t) {
|
|
593
|
+
let i = {
|
|
594
|
+
...t,
|
|
595
|
+
...n.length > 0 ? { images: n } : { images: [] }
|
|
596
|
+
};
|
|
597
|
+
e.sendChat(i), o([]), r([]);
|
|
598
|
+
}
|
|
599
|
+
let x = async (e) => {
|
|
600
|
+
let n = e.target, i = Array.from(n.files ?? []), c = Math.max(0, _ - y - u.current), f = i.slice(0, c);
|
|
601
|
+
if (f.length === 0) {
|
|
602
|
+
n.value = "";
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
u.current += f.length, l((e) => e + f.length);
|
|
606
|
+
try {
|
|
607
|
+
i.length > f.length && d(`You can attach up to ${_} images.`, "info");
|
|
608
|
+
let e = await t(f);
|
|
609
|
+
if (!Array.isArray(e) || e.length === 0) return;
|
|
610
|
+
let n = await s(e, String(m?.id ?? "")), c = Array.isArray(n) ? n : n?.images;
|
|
611
|
+
if (!Array.isArray(c)) return;
|
|
612
|
+
o((t) => [...t, ...e]), r((e) => [...e, ...c]), n?.file_uploads_used !== void 0 && m && h(a({
|
|
613
|
+
...m,
|
|
614
|
+
file_uploads_used: n.file_uploads_used,
|
|
615
|
+
file_uploads_date: n.file_uploads_date
|
|
616
|
+
}));
|
|
617
|
+
} catch (e) {
|
|
618
|
+
d(e.message?.toString() || "Image upload failed", "error");
|
|
619
|
+
} finally {
|
|
620
|
+
u.current = Math.max(0, u.current - f.length), l((e) => Math.max(0, e - f.length)), n.value = "";
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
function ee(e) {
|
|
624
|
+
!g || e.length === 0 || f.removeImages(g, e).catch((e) => console.log(e.message));
|
|
625
|
+
}
|
|
626
|
+
function S(e) {
|
|
627
|
+
let t = n.find((t, n) => n === e);
|
|
628
|
+
r(n?.filter((t, n) => n !== e)), o(i?.filter((t, n) => n !== e)), t && ee([t]);
|
|
629
|
+
}
|
|
630
|
+
function C() {
|
|
631
|
+
o([]), r([]), ee(n);
|
|
632
|
+
}
|
|
633
|
+
return /* @__PURE__ */ V("div", {
|
|
634
|
+
className: "padorix:relative padorix:z-50",
|
|
635
|
+
children: [i.length > 0 && /* @__PURE__ */ B(Pe, {
|
|
636
|
+
previews: i,
|
|
637
|
+
DiscardSingleImage: S,
|
|
638
|
+
DiscardAllImages: C,
|
|
639
|
+
styles: e.styles,
|
|
640
|
+
sendChat: b,
|
|
641
|
+
userType: e.userType,
|
|
642
|
+
senderId: String(p?.senderId),
|
|
643
|
+
handleFile: x,
|
|
644
|
+
isSending: e.isSending,
|
|
645
|
+
pendingFileCount: c
|
|
646
|
+
}), /* @__PURE__ */ B(Ne, {
|
|
647
|
+
sendChat: b,
|
|
648
|
+
previews: i,
|
|
649
|
+
showFile: !0,
|
|
650
|
+
pendingFileCount: c,
|
|
651
|
+
styles: e.styles,
|
|
652
|
+
userType: e.userType,
|
|
653
|
+
handleFile: x,
|
|
654
|
+
isSending: e.isSending
|
|
655
|
+
})]
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
//#endregion
|
|
659
|
+
//#region lib/assets/images/wd__user.png
|
|
660
|
+
var Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJVHZNWXrm6+zq7+9VYIChqbhXY4JUX4ChqrlVX4Hd4uVRYICvt8NVYYFXYoJWYIFzfJZVYYFVYIFVYIFVYIDs8fHK0Njt8vFVYIBTXn5KVnfn7e1UYIBVYIHIztZWYIHx9fRWYoKkrLtWYIFWYoNXYYJXX4FWYYFWYYJWYoJdZ4ZXYoJrdpHl6utVYIBVYH9rdZBWYYFVYIBWXX1UXnzn7OxUX4BVYIBbZoRWYYDh5ulVYYJWYYHu8/N+h57CydJ7hZ1VYYFeaYdWYYG/xtCpsL9aZIRaZYOLk6jw9PPl6etWYYLv8/fr9fC/zL+yusagqLjp7e6zucbX3eJPW3tRXH1gaoja4OSutMPGzNTk6Oqmrr1XV4dVX4Dn7O3n7O3n7O3m7Ozm6utVYH/o7O1WYYBUXn5WYYHm6+tVYH93gZq////a3+Tn6uywt8SOl6zl7O3T2N5oc49GUnbM0tllb4ypsL5dZ39ra4zV299RXH1VW35UYYDm6uuEjaNbZoXo6+/O1Nrq7/CZobO3vsiTnK+FjqRUXYJVYIHl6uu+xM6Xn7CcpLVRXH3l6+nn7O1kb4x5g5yeprekq7rc4eXs8vHj6Onq8PHm7Ozl6uvl6+vn6+1UYH7l6Ojn7e3m7Ozn6uxVX39gaohibIlteJPl6eurssF2f5hncI3l6ut+h59mcIzm6uzn6u3n7O3m6uzm7O3o7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B9Bx7c0LuLxNrU93MYEr786rO//s3Q3nWq53RdvddrNHq99XWne051tRv+8a8DX33J/yh23A/MEJv4fzZ+fvDv33y9f++nXwxLS1v3xV/27v/6m38enLeBL3cTNony/n9GHU2UlcLeHAAAAABJRU5ErkJggg==";
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region node_modules/react-icons/io5/index.mjs
|
|
663
|
+
function Re(e) {
|
|
664
|
+
return Z({
|
|
665
|
+
tag: "svg",
|
|
666
|
+
attr: { viewBox: "0 0 512 512" },
|
|
667
|
+
child: [
|
|
668
|
+
{
|
|
669
|
+
tag: "circle",
|
|
670
|
+
attr: {
|
|
671
|
+
cx: "256",
|
|
672
|
+
cy: "256",
|
|
673
|
+
r: "48"
|
|
674
|
+
},
|
|
675
|
+
child: []
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
tag: "circle",
|
|
679
|
+
attr: {
|
|
680
|
+
cx: "256",
|
|
681
|
+
cy: "416",
|
|
682
|
+
r: "48"
|
|
683
|
+
},
|
|
684
|
+
child: []
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
tag: "circle",
|
|
688
|
+
attr: {
|
|
689
|
+
cx: "256",
|
|
690
|
+
cy: "96",
|
|
691
|
+
r: "48"
|
|
692
|
+
},
|
|
693
|
+
child: []
|
|
694
|
+
}
|
|
695
|
+
]
|
|
696
|
+
})(e);
|
|
697
|
+
}
|
|
698
|
+
//#endregion
|
|
699
|
+
//#region node_modules/react-icons/vsc/index.mjs
|
|
700
|
+
function ze(e) {
|
|
701
|
+
return Z({
|
|
702
|
+
tag: "svg",
|
|
703
|
+
attr: {
|
|
704
|
+
viewBox: "0 0 16 16",
|
|
705
|
+
fill: "currentColor"
|
|
706
|
+
},
|
|
707
|
+
child: [{
|
|
708
|
+
tag: "path",
|
|
709
|
+
attr: { d: "M4.5 1L4 1.5V3.02746C4.16417 3.00932 4.331 3 4.5 3C4.669 3 4.83583 3.00932 5 3.02746V2H14V7H12.2929L11 8.29289V7H8.97254C8.99068 7.16417 9 7.331 9 7.5C9 7.669 8.99068 7.83583 8.97254 8H10V9.5L10.8536 9.85355L12.7071 8H14.5L15 7.5V1.5L14.5 1H4.5Z" },
|
|
710
|
+
child: []
|
|
711
|
+
}, {
|
|
712
|
+
tag: "path",
|
|
713
|
+
attr: {
|
|
714
|
+
fillRule: "evenodd",
|
|
715
|
+
clipRule: "evenodd",
|
|
716
|
+
d: "M6.41705 10.4288C7.37039 9.80348 8 8.72527 8 7.5C8 5.567 6.433 4 4.5 4C2.567 4 1 5.567 1 7.5C1 8.72527 1.62961 9.80348 2.58295 10.4288C2.11364 10.6498 1.68557 10.9505 1.31802 11.318C0.900156 11.7359 0.568688 12.232 0.342542 12.7779C0.180451 13.1692 0.0747425 13.5807 0.0278638 14C0.00933826 14.1657 0 14.3326 0 14.5V15H1L0.999398 14.5C0.999398 14.4784 0.999599 14.4567 1 14.4351C1.00811 13.9975 1.09823 13.5651 1.26587 13.1604C1.44179 12.7357 1.69964 12.3498 2.0247 12.0247C2.34976 11.6996 2.73566 11.4418 3.16038 11.2659C3.57088 11.0958 4.00986 11.0056 4.45387 10.9997C4.46922 10.9999 4.4846 11 4.5 11C4.5154 11 4.53078 10.9999 4.54613 10.9997C4.99014 11.0056 5.42912 11.0958 5.83962 11.2659C6.26433 11.4418 6.65024 11.6996 6.9753 12.0247C7.30036 12.3498 7.55821 12.7357 7.73413 13.1604C7.90177 13.5651 7.99189 13.9975 8 14.4351C8.0004 14.4567 8.0006 14.4784 8.0006 14.5L8 15H9V14.5C9 14.3326 8.99066 14.1657 8.97214 14C8.92526 13.5807 8.81955 13.1692 8.65746 12.7779C8.43131 12.232 8.09984 11.7359 7.68198 11.318C7.31443 10.9505 6.88636 10.6498 6.41705 10.4288ZM4.5 10C3.11929 10 2 8.88071 2 7.5C2 6.11929 3.11929 5 4.5 5C5.88071 5 7 6.11929 7 7.5C7 8.88071 5.88071 10 4.5 10Z"
|
|
717
|
+
},
|
|
718
|
+
child: []
|
|
719
|
+
}]
|
|
720
|
+
})(e);
|
|
721
|
+
}
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region lib/chats/chatheader/chat-header.tsx
|
|
724
|
+
function Be(e) {
|
|
725
|
+
let [t, { open: r, close: i }] = pe(!1), { workspace: a, conversation: s, sender: c } = k((e) => e.data), u = v(a?.widget?.darkMode, !1), [p, m] = A.useState(!1), h = O(), g = Fe(e.userType), _ = e.userType === w.VISITOR, y = a?.widget?.notifications?.customerEndsConversation === l.true, x = A.useMemo(() => _ ? a?.widget?.department : s?.fullName, [a, s]), ee = A.useMemo(() => _ ? a?.logo : Le, [a]), S = A.useMemo(() => _ ? a?.name : G(s?.createdAt).format("DD dddd MMMM YYYY"), [
|
|
726
|
+
_,
|
|
727
|
+
a?.name,
|
|
728
|
+
s?.createdAt
|
|
729
|
+
]);
|
|
730
|
+
function C() {
|
|
731
|
+
m(!1);
|
|
732
|
+
}
|
|
733
|
+
function T() {
|
|
734
|
+
let t = G(), n = [
|
|
735
|
+
x || "Chat transcript",
|
|
736
|
+
`Exported: ${t.format("YYYY-MM-DD HH:mm")}`,
|
|
737
|
+
"",
|
|
738
|
+
...e.messages.length > 0 ? e.messages.map((e) => {
|
|
739
|
+
let t = G(e.createdAt), n = e.senderName || e.senderType || "Unknown", r = e.deleted === l.true ? "[This message was deleted]" : Array.isArray(e.message) ? e.message.join("\n") : "", i = e.deleted === l.true ? [] : Array.isArray(e.images) ? e.images : [];
|
|
740
|
+
return [
|
|
741
|
+
`[${t.isValid() ? t.format("YYYY-MM-DD HH:mm") : e.createdAt}] ${n} (${e.senderType})`,
|
|
742
|
+
r,
|
|
743
|
+
...i.map((e) => `Image: ${e}`)
|
|
744
|
+
].filter(Boolean).join("\n");
|
|
745
|
+
}) : ["No messages in this chat."]
|
|
746
|
+
].join("\n\n"), r = URL.createObjectURL(new Blob([n], { type: "text/plain;charset=utf-8" })), i = document.createElement("a");
|
|
747
|
+
i.href = r, i.download = `padorix-chat-${t.format("YYYY-MM-DD-HHmmss")}.txt`, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(r), 1e3), C();
|
|
748
|
+
}
|
|
749
|
+
function E() {
|
|
750
|
+
h(n({
|
|
751
|
+
userType: String(e?.userType),
|
|
752
|
+
senderId: String(c?.senderId),
|
|
753
|
+
workspaceId: String(s?.workspaceId),
|
|
754
|
+
conversationId: String(c?.conversationId),
|
|
755
|
+
senderName: String(c?.fullName),
|
|
756
|
+
isEndChat: l.true
|
|
757
|
+
})), m(!1), e.toBottom();
|
|
758
|
+
}
|
|
759
|
+
function te() {
|
|
760
|
+
m(!1), r();
|
|
761
|
+
}
|
|
762
|
+
function D() {
|
|
763
|
+
i(), g && f.requestFeedback(g).then((e) => h(o(e))).catch((e) => d(e.message, "error")), e.toBottom();
|
|
764
|
+
}
|
|
765
|
+
return /* @__PURE__ */ B("div", {
|
|
766
|
+
className: e.styles.header,
|
|
767
|
+
children: /* @__PURE__ */ V("div", {
|
|
768
|
+
className: "padorix:rounded-2xl",
|
|
769
|
+
children: [/* @__PURE__ */ B(U, {
|
|
770
|
+
withCloseButton: !1,
|
|
771
|
+
opened: t,
|
|
772
|
+
onClose: i,
|
|
773
|
+
centered: !0,
|
|
774
|
+
styles: { body: { padding: 0 } },
|
|
775
|
+
children: /* @__PURE__ */ B("div", {
|
|
776
|
+
className: u ? "padorix-dark" : void 0,
|
|
777
|
+
children: /* @__PURE__ */ V("div", {
|
|
778
|
+
className: "padorix:dark:bg-[#2a3549] padorix:p-4 padorix:dark:text-white",
|
|
779
|
+
children: [/* @__PURE__ */ B("div", {
|
|
780
|
+
className: "",
|
|
781
|
+
children: "Confirm your action to stop chat session by requesting for feedback"
|
|
782
|
+
}), /* @__PURE__ */ V("div", {
|
|
783
|
+
className: "padorix:border-t padorix:border-gray-200 padorix:dark:border-gray-600 padorix:pt-3 padorix:mt-3 padorix:flex padorix:items-center padorix:justify-end padorix:gap-3",
|
|
784
|
+
children: [/* @__PURE__ */ B("button", {
|
|
785
|
+
onClick: i,
|
|
786
|
+
className: "padorix:py-1 padorix:cursor-pointer padorix:px-3 padorix:border padorix:border-slate-300 padorix:bg-slate-200/70 padorix:rounded-md",
|
|
787
|
+
children: "Cancel"
|
|
788
|
+
}), /* @__PURE__ */ B("button", {
|
|
789
|
+
onClick: D,
|
|
790
|
+
className: "padorix:px-3 padorix:cursor-pointer padorix:py-1 padorix:rounded-md padorix:text-white",
|
|
791
|
+
style: { background: String(a?.widget?.colorScheme) },
|
|
792
|
+
children: "Proceed"
|
|
793
|
+
})]
|
|
794
|
+
})]
|
|
795
|
+
})
|
|
796
|
+
})
|
|
797
|
+
}), /* @__PURE__ */ V("div", {
|
|
798
|
+
style: { color: a?.widget?.textColor || void 0 },
|
|
799
|
+
className: "padorix:px-2 padorix:py-2.5 padorix:transition-all.5 padorix:text-xs padorix:border-b padorix:border-[#d1d5dc] padorix:dark:border-gray-600 padorix:flex padorix:items-center padorix:justify-between",
|
|
800
|
+
children: [/* @__PURE__ */ V("div", {
|
|
801
|
+
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
802
|
+
children: [
|
|
803
|
+
_ ? null : /* @__PURE__ */ B("div", {
|
|
804
|
+
onClick: e.goBack,
|
|
805
|
+
className: "padorix:cursor-pointer padorix:size-7 padorix:flex padorix:items-center padorix:justify-center padorix:rounded-full padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:active:scale-95 padorix:md:hidden",
|
|
806
|
+
children: /* @__PURE__ */ B(ie, { className: "padorix:size-5" })
|
|
807
|
+
}),
|
|
808
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("img", {
|
|
809
|
+
src: ee,
|
|
810
|
+
loading: "lazy",
|
|
811
|
+
className: "padorix:size-8 padorix:rounded-full"
|
|
812
|
+
}) }),
|
|
813
|
+
/* @__PURE__ */ V("div", {
|
|
814
|
+
className: "padorix:text-gray-600",
|
|
815
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
816
|
+
className: "padorix:font-semibold",
|
|
817
|
+
children: x
|
|
818
|
+
}) }), /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
819
|
+
className: "",
|
|
820
|
+
children: S
|
|
821
|
+
}) })]
|
|
822
|
+
})
|
|
823
|
+
]
|
|
824
|
+
}), /* @__PURE__ */ V("div", {
|
|
825
|
+
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
826
|
+
children: [/* @__PURE__ */ B("div", {
|
|
827
|
+
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
828
|
+
children: /* @__PURE__ */ V(W, {
|
|
829
|
+
position: _ ? "bottom-end" : "bottom",
|
|
830
|
+
opened: p,
|
|
831
|
+
onChange: m,
|
|
832
|
+
withinPortal: !0,
|
|
833
|
+
portalProps: { target: b() },
|
|
834
|
+
zIndex: 2147483647,
|
|
835
|
+
children: [/* @__PURE__ */ B(W.Target, { children: /* @__PURE__ */ B("div", {
|
|
836
|
+
onClick: () => m((e) => !e),
|
|
837
|
+
className: "padorix:cursor-pointer padorix:transition-all padorix:size-fit padorix:text-xl",
|
|
838
|
+
children: /* @__PURE__ */ B(Re, {})
|
|
839
|
+
}) }), /* @__PURE__ */ B(W.Dropdown, {
|
|
840
|
+
className: u ? "padorix-dark" : void 0,
|
|
841
|
+
styles: { dropdown: {
|
|
842
|
+
padding: 0,
|
|
843
|
+
minWidth: "12rem",
|
|
844
|
+
zIndex: 2147483647,
|
|
845
|
+
border: 0,
|
|
846
|
+
backgroundColor: u ? "#2a3549" : "#fff"
|
|
847
|
+
} },
|
|
848
|
+
children: /* @__PURE__ */ V("div", {
|
|
849
|
+
className: "padorix:text-xs padori:flex padorix:flex-col padorix:dark:bg-[#2a3549] padorix:dark:text-white",
|
|
850
|
+
children: [
|
|
851
|
+
!_ && /* @__PURE__ */ V("div", {
|
|
852
|
+
onClick: T,
|
|
853
|
+
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:flex padorix:items-center",
|
|
854
|
+
children: [/* @__PURE__ */ B(oe, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:mr-1" }), "Download Chat transcript"]
|
|
855
|
+
}),
|
|
856
|
+
/* @__PURE__ */ V("a", {
|
|
857
|
+
target: "_blank",
|
|
858
|
+
href: "https://app.farmsac.com/signup",
|
|
859
|
+
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:hidden padorix:items-center",
|
|
860
|
+
children: [/* @__PURE__ */ B(I, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Add to your website"]
|
|
861
|
+
}),
|
|
862
|
+
!_ && s?.status === l.true && /* @__PURE__ */ V("div", {
|
|
863
|
+
onClick: te,
|
|
864
|
+
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:flex padorix:items-center",
|
|
865
|
+
children: [/* @__PURE__ */ B(ze, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Request for Feedback"]
|
|
866
|
+
}),
|
|
867
|
+
s?.closed_at === null && (!_ || y) && /* @__PURE__ */ B("div", {
|
|
868
|
+
className: "padorix:border-t padorix:border-[#d1d5dc] padorix:dark:border-gray-600 padorix:mt-1",
|
|
869
|
+
children: /* @__PURE__ */ V("div", {
|
|
870
|
+
onClick: E,
|
|
871
|
+
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:flex padorix:items-center",
|
|
872
|
+
children: [/* @__PURE__ */ B(Q, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "End Chat Session"]
|
|
873
|
+
})
|
|
874
|
+
})
|
|
875
|
+
]
|
|
876
|
+
})
|
|
877
|
+
})]
|
|
878
|
+
})
|
|
879
|
+
}), _ && /* @__PURE__ */ B("div", {
|
|
880
|
+
className: "padorix:size-8 padorix:ml-auto",
|
|
881
|
+
children: /* @__PURE__ */ B("div", {
|
|
882
|
+
className: "padorix:bg-slate-100 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
883
|
+
onClick: e.close,
|
|
884
|
+
children: /* @__PURE__ */ B(F, {})
|
|
885
|
+
})
|
|
886
|
+
})]
|
|
887
|
+
})]
|
|
888
|
+
})]
|
|
889
|
+
})
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region node_modules/react-icons/bs/index.mjs
|
|
894
|
+
function Ve(e) {
|
|
895
|
+
return Z({
|
|
896
|
+
tag: "svg",
|
|
897
|
+
attr: {
|
|
898
|
+
fill: "currentColor",
|
|
899
|
+
viewBox: "0 0 16 16"
|
|
900
|
+
},
|
|
901
|
+
child: [{
|
|
902
|
+
tag: "path",
|
|
903
|
+
attr: { d: "M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" },
|
|
904
|
+
child: []
|
|
905
|
+
}]
|
|
906
|
+
})(e);
|
|
907
|
+
}
|
|
908
|
+
function He(e) {
|
|
909
|
+
return Z({
|
|
910
|
+
tag: "svg",
|
|
911
|
+
attr: {
|
|
912
|
+
fill: "currentColor",
|
|
913
|
+
viewBox: "0 0 16 16"
|
|
914
|
+
},
|
|
915
|
+
child: [{
|
|
916
|
+
tag: "path",
|
|
917
|
+
attr: { d: "M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94" },
|
|
918
|
+
child: []
|
|
919
|
+
}]
|
|
920
|
+
})(e);
|
|
921
|
+
}
|
|
922
|
+
function Ue(e) {
|
|
923
|
+
return Z({
|
|
924
|
+
tag: "svg",
|
|
925
|
+
attr: {
|
|
926
|
+
fill: "currentColor",
|
|
927
|
+
viewBox: "0 0 16 16"
|
|
928
|
+
},
|
|
929
|
+
child: [{
|
|
930
|
+
tag: "path",
|
|
931
|
+
attr: { d: "M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1zm13 2.383-4.708 2.825L15 11.105zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741M1 11.105l4.708-2.897L1 5.383z" },
|
|
932
|
+
child: []
|
|
933
|
+
}]
|
|
934
|
+
})(e);
|
|
935
|
+
}
|
|
936
|
+
function We(e) {
|
|
937
|
+
return Z({
|
|
938
|
+
tag: "svg",
|
|
939
|
+
attr: {
|
|
940
|
+
fill: "currentColor",
|
|
941
|
+
viewBox: "0 0 16 16"
|
|
942
|
+
},
|
|
943
|
+
child: [{
|
|
944
|
+
tag: "path",
|
|
945
|
+
attr: { d: "M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0zm-4.208 7-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0" },
|
|
946
|
+
child: []
|
|
947
|
+
}, {
|
|
948
|
+
tag: "path",
|
|
949
|
+
attr: { d: "m5.354 7.146.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708" },
|
|
950
|
+
child: []
|
|
951
|
+
}]
|
|
952
|
+
})(e);
|
|
953
|
+
}
|
|
954
|
+
function Ge(e) {
|
|
955
|
+
return Z({
|
|
956
|
+
tag: "svg",
|
|
957
|
+
attr: {
|
|
958
|
+
fill: "currentColor",
|
|
959
|
+
viewBox: "0 0 16 16"
|
|
960
|
+
},
|
|
961
|
+
child: [{
|
|
962
|
+
tag: "path",
|
|
963
|
+
attr: { d: "M15 8a6.97 6.97 0 0 0-1.71-4.584l-9.874 9.875A7 7 0 0 0 15 8M2.71 12.584l9.874-9.875a7 7 0 0 0-9.874 9.874ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0" },
|
|
964
|
+
child: []
|
|
965
|
+
}]
|
|
966
|
+
})(e);
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region lib/chats/chatform/render-text.tsx
|
|
970
|
+
function Ke(e) {
|
|
971
|
+
if (!e) return "";
|
|
972
|
+
let t = /(https?:\/\/[^\s]+)/g, n = /\*(.*?)\*/g;
|
|
973
|
+
return e.split(t).map((e, r) => {
|
|
974
|
+
if (t.test(e)) return /* @__PURE__ */ B("a", {
|
|
975
|
+
href: e,
|
|
976
|
+
target: "_blank",
|
|
977
|
+
rel: "noopener noreferrer",
|
|
978
|
+
className: "padorix:underline hover:padorix:text-purple-800",
|
|
979
|
+
children: e
|
|
980
|
+
}, r);
|
|
981
|
+
let i = e.split(n);
|
|
982
|
+
return e.match(n) ? i.map((e, t) => t % 2 == 1 ? /* @__PURE__ */ B("strong", {
|
|
983
|
+
className: "padorix:font-bold",
|
|
984
|
+
children: e
|
|
985
|
+
}, `b-${t}`) : e) : e;
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
//#endregion
|
|
989
|
+
//#region lib/chats/chatmessages/chat-message-cover.tsx
|
|
990
|
+
function qe(e) {
|
|
991
|
+
let { workspace: t } = k((e) => e.data), n = "padorix:w-fit padorix:h-fit padorix:max-w-[91%] padorix:relative padorix:bottom-3 padorix:md:max-w-[80%]";
|
|
992
|
+
if (e.isSender) return /* @__PURE__ */ B(R, {
|
|
993
|
+
style: { background: e.data?.deleted === l.true ? "" : e.data?.message ? String(t?.widget?.colorScheme) : "" },
|
|
994
|
+
className: `
|
|
995
|
+
${n} padorix:ml-auto
|
|
996
|
+
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-bl-xl" : "padorix:rounded-xl"}
|
|
997
|
+
${e.data?.deleted === l.true ? "" : e.data?.message ? "padorix:text-white" : "padorix:text-black!"}`,
|
|
998
|
+
children: e.children
|
|
999
|
+
});
|
|
1000
|
+
if (!e.isSender) return /* @__PURE__ */ B(R, {
|
|
1001
|
+
className: `${n} padorix:mr-auto
|
|
1002
|
+
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-br-xl" : "padorix:rounded-xl"}
|
|
1003
|
+
${e.data?.deleted === l.true ? "" : e.data?.message ? "padorix:bg-[#f6f6f6] padorix:text-black" : "padorix:text-black!"}`,
|
|
1004
|
+
children: e.children
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region lib/chats/chatmessages/chat-avatar.tsx
|
|
1009
|
+
function Je(e) {
|
|
1010
|
+
return /* @__PURE__ */ B(fe, {
|
|
1011
|
+
direction: "up",
|
|
1012
|
+
children: /* @__PURE__ */ B("div", {
|
|
1013
|
+
className: "padorix:self-end padorix:mb-3 padorix:w-10",
|
|
1014
|
+
children: e.isLastInGroup ? /* @__PURE__ */ B("div", {
|
|
1015
|
+
className: "padorix:size-8",
|
|
1016
|
+
children: /* @__PURE__ */ B("img", {
|
|
1017
|
+
src: e.img,
|
|
1018
|
+
alt: "Padorix",
|
|
1019
|
+
className: "padorix:size-8 padorix:border-2 padorix:rounded-full padorix:shadow-md padorix:border-white"
|
|
1020
|
+
})
|
|
1021
|
+
}) : /* @__PURE__ */ B("div", { className: "padorix:size-10" })
|
|
1022
|
+
})
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
//#endregion
|
|
1026
|
+
//#region lib/chats/chatmessages/chat-delete-selector.tsx
|
|
1027
|
+
function Ye(e) {
|
|
1028
|
+
let { workspace: t } = k((e) => e.data), n = e.messagesToDelete?.find((t) => t === e.data?.id);
|
|
1029
|
+
return /* @__PURE__ */ B("div", {
|
|
1030
|
+
style: { background: n ? String(t?.widget?.colorScheme) : "#e4e4e7" },
|
|
1031
|
+
onClick: () => e.handleDeleteAction(e.data?.id),
|
|
1032
|
+
className: "padorix:size-6 padorix:rounded-md padorix:border padorix:border-gray-300 padorix:text-base padorix:cursor-pointer padorix:transition-all padorix:mb-3 padorix:absolute padorix:top-0 padorix:z-10 padorix:active:scale-150",
|
|
1033
|
+
children: /* @__PURE__ */ B("div", {
|
|
1034
|
+
className: "padorix:size-6 padorix:flex padorix:items-center padorix:justify-center",
|
|
1035
|
+
children: B(n ? Ae : De, { className: "padorix:text-white" })
|
|
1036
|
+
})
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
//#endregion
|
|
1040
|
+
//#region lib/chats/chatmessages/chat-image-viewer.tsx
|
|
1041
|
+
function Xe(e) {
|
|
1042
|
+
let t = e.data?.images, n = [];
|
|
1043
|
+
if (Array.isArray(t)) n = t.filter((e) => typeof e == "string" && e.length > 0);
|
|
1044
|
+
else if (typeof t == "string") try {
|
|
1045
|
+
let e = JSON.parse(t);
|
|
1046
|
+
n = Array.isArray(e) ? e.filter((e) => typeof e == "string" && e.length > 0) : [];
|
|
1047
|
+
} catch {
|
|
1048
|
+
n = t.length > 0 ? [t] : [];
|
|
1049
|
+
}
|
|
1050
|
+
return /* @__PURE__ */ B("div", {
|
|
1051
|
+
className: "padorix:min-w-0 padorix:max-w-full",
|
|
1052
|
+
children: n.length > 0 && /* @__PURE__ */ B("div", {
|
|
1053
|
+
className: "padorix:flex padorix:min-w-0 padorix:max-w-full padorix:flex-col padorix:items-end padorix:gap-1",
|
|
1054
|
+
children: n.map((e, t) => /* @__PURE__ */ B("img", {
|
|
1055
|
+
src: e,
|
|
1056
|
+
alt: "Attachment",
|
|
1057
|
+
loading: "lazy",
|
|
1058
|
+
decoding: "async",
|
|
1059
|
+
className: "padorix:block padorix:h-auto padorix:w-auto padorix:max-h-56 padorix:max-w-full padorix:cursor-pointer padorix:rounded-lg padorix:object-contain padorix:transition-all padorix:hover:brightness-90"
|
|
1060
|
+
}, `${e}-${t}`))
|
|
1061
|
+
})
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
//#endregion
|
|
1065
|
+
//#region lib/chats/chatmessages/chat-reply.tsx
|
|
1066
|
+
function Ze(e) {
|
|
1067
|
+
if (Array.isArray(e)) return e.filter((e) => typeof e == "string" && e.length > 0);
|
|
1068
|
+
if (typeof e == "string" && e.length > 0) try {
|
|
1069
|
+
let t = JSON.parse(e);
|
|
1070
|
+
return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.length > 0) : [e];
|
|
1071
|
+
} catch {
|
|
1072
|
+
return [e];
|
|
1073
|
+
}
|
|
1074
|
+
return [];
|
|
1075
|
+
}
|
|
1076
|
+
function Qe(e) {
|
|
1077
|
+
let t = e.data?.replies?.[0], n = t?.id ? Ze(t?.repliedTo?.images) : [], r = Ze(t?.repliedTo?.message).join(" ");
|
|
1078
|
+
if (t?.id) return /* @__PURE__ */ B("div", {
|
|
1079
|
+
className: "padorix:px-0.5 padorix:pt-0.5",
|
|
1080
|
+
children: /* @__PURE__ */ V("div", {
|
|
1081
|
+
onClick: () => e.handleScrollToTargetMessage(String(t?.replyId)),
|
|
1082
|
+
className: `padorix:flex padorix:flex-row padorix:items-center padorix:gap-1 padorix:p-2 padorix:mb-1 padorix:text-xs padorix:rounded padorix:border-l-4 padorix:border-white padorix:cursor-pointer padorix:hover:brightness-95 padorix:transition-all ${e.isSender ? "padorix:bg-black/20 padorix:text-gray-200" : "padorix:bg-gray-200 padorix:text-gray-700"}`,
|
|
1083
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1084
|
+
className: "padorix:w-full",
|
|
1085
|
+
children: [r.slice(0, 40), r.length > 40 ? "..." : ""]
|
|
1086
|
+
}), n?.length > 0 && /* @__PURE__ */ B("div", { children: /* @__PURE__ */ B("img", {
|
|
1087
|
+
src: n[0],
|
|
1088
|
+
alt: "Padorix",
|
|
1089
|
+
className: "padorix:size-6"
|
|
1090
|
+
}) })]
|
|
1091
|
+
})
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region lib/chats/chatmessages/single-message-pop.tsx
|
|
1096
|
+
function $e(t) {
|
|
1097
|
+
let n = O(), { reply: i, conversation: a, workspace: o } = k((e) => e.data), s = v(o?.widget?.darkMode, !1);
|
|
1098
|
+
function c(e) {
|
|
1099
|
+
e.stopPropagation(), t.setOpens((e) => !e);
|
|
1100
|
+
}
|
|
1101
|
+
function u() {
|
|
1102
|
+
n(r({
|
|
1103
|
+
...i,
|
|
1104
|
+
messageId: t.data?.id
|
|
1105
|
+
})), n(e(t.data)), t.handleClick();
|
|
1106
|
+
}
|
|
1107
|
+
function d(e) {
|
|
1108
|
+
t.handleStarMessage(t.data?.id, e), t.handleClick();
|
|
1109
|
+
}
|
|
1110
|
+
function f() {
|
|
1111
|
+
m(String(t.data?.message)), t.handleClick();
|
|
1112
|
+
}
|
|
1113
|
+
async function p() {
|
|
1114
|
+
let e = Array.isArray(t.data.images) ? t.data.images : [];
|
|
1115
|
+
for (let [t, n] of e.entries()) {
|
|
1116
|
+
let e = (() => {
|
|
1117
|
+
try {
|
|
1118
|
+
let e = new URL(n, window.location.href).pathname, r = decodeURIComponent(e.split("/").pop() || "");
|
|
1119
|
+
return /\.[a-z0-9]+$/i.test(r) ? r : `image-${t + 1}.jpg`;
|
|
1120
|
+
} catch {
|
|
1121
|
+
return `image-${t + 1}.jpg`;
|
|
1122
|
+
}
|
|
1123
|
+
})();
|
|
1124
|
+
try {
|
|
1125
|
+
let t = await fetch(n);
|
|
1126
|
+
if (!t.ok) throw Error("Unable to download image");
|
|
1127
|
+
let r = URL.createObjectURL(await t.blob()), i = document.createElement("a");
|
|
1128
|
+
i.href = r, i.download = e, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(r), 1e3);
|
|
1129
|
+
} catch {
|
|
1130
|
+
let e = document.createElement("a");
|
|
1131
|
+
e.href = n, e.target = "_blank", e.rel = "noopener noreferrer", e.click();
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
t.handleClick();
|
|
1135
|
+
}
|
|
1136
|
+
let h = Array.isArray(t.data.images) && t.data.images.length > 0;
|
|
1137
|
+
return /* @__PURE__ */ V(W, {
|
|
1138
|
+
opened: t.opens,
|
|
1139
|
+
onChange: t.setOpens,
|
|
1140
|
+
position: "top",
|
|
1141
|
+
withArrow: !0,
|
|
1142
|
+
withinPortal: !0,
|
|
1143
|
+
portalProps: { target: b() },
|
|
1144
|
+
zIndex: 2147483647,
|
|
1145
|
+
children: [/* @__PURE__ */ B(W.Target, { children: /* @__PURE__ */ B("div", {
|
|
1146
|
+
onClick: c,
|
|
1147
|
+
className: `padorix:absolute padorix:top-0 padorix:cursor-pointer padorix:size-fit padorix:text-lg padorix:transition-all padorix:hover:scale-110 ${t.isSender, "padorix:-right-5"}`,
|
|
1148
|
+
children: /* @__PURE__ */ B(Re, { style: { color: String(o?.widget?.colorScheme) } })
|
|
1149
|
+
}) }), /* @__PURE__ */ B(W.Dropdown, {
|
|
1150
|
+
className: s ? "padorix-dark" : void 0,
|
|
1151
|
+
styles: { dropdown: {
|
|
1152
|
+
padding: 0,
|
|
1153
|
+
minWidth: "10rem",
|
|
1154
|
+
zIndex: 2147483647,
|
|
1155
|
+
border: 0,
|
|
1156
|
+
backgroundColor: s ? "#2a3549" : "#fff"
|
|
1157
|
+
} },
|
|
1158
|
+
children: /* @__PURE__ */ V("div", {
|
|
1159
|
+
className: "padorix:text-xs padorix:text-gray-800 padorix:dark:bg-[#2a3549] padorix:dark:text-white padorix:rounded-lg",
|
|
1160
|
+
children: [
|
|
1161
|
+
a?.status === l.true && /* @__PURE__ */ V("div", {
|
|
1162
|
+
onClick: u,
|
|
1163
|
+
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:rounded-tr-lg padorix:rounded-tl-lg padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1164
|
+
children: [/* @__PURE__ */ B(re, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Reply"]
|
|
1165
|
+
}),
|
|
1166
|
+
t.isMessage && /* @__PURE__ */ V("div", {
|
|
1167
|
+
onClick: f,
|
|
1168
|
+
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1169
|
+
children: [/* @__PURE__ */ B(ae, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Copy"]
|
|
1170
|
+
}),
|
|
1171
|
+
h && /* @__PURE__ */ V("div", {
|
|
1172
|
+
onClick: p,
|
|
1173
|
+
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1174
|
+
children: [
|
|
1175
|
+
/* @__PURE__ */ B(Oe, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1176
|
+
" Download image",
|
|
1177
|
+
t.data.images.length > 1 ? "s" : ""
|
|
1178
|
+
]
|
|
1179
|
+
}),
|
|
1180
|
+
a?.status === l.true && /* @__PURE__ */ V("div", {
|
|
1181
|
+
onClick: () => d(t.data?.starred === l.true ? l.false : l.true),
|
|
1182
|
+
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1183
|
+
children: [
|
|
1184
|
+
/* @__PURE__ */ B(le, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1185
|
+
" ",
|
|
1186
|
+
t.data?.starred === l.true ? "Unstar" : "Star",
|
|
1187
|
+
t.data?.starred === l.true && /* @__PURE__ */ B(Ve, { className: "padorix:size-2 padorix:inline padorix:text-amber-400 padorix:ml-1" })
|
|
1188
|
+
]
|
|
1189
|
+
}),
|
|
1190
|
+
t.moreActions,
|
|
1191
|
+
a?.status === l.true && t.isSender && t.canDeleteMessage && /* @__PURE__ */ B("div", {
|
|
1192
|
+
className: "padorix:border-t padorix:border-gray-200 padorix:dark:border-gray-500",
|
|
1193
|
+
children: /* @__PURE__ */ V("div", {
|
|
1194
|
+
onClick: () => t.handleDeleteAction(t.data?.id),
|
|
1195
|
+
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:rounded-br-lg padorix:rounded-bl-lg padorix:text-red-500 padorix:dark:text-red-400 padorix:hover:bg-red-50 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1196
|
+
children: [/* @__PURE__ */ B(ue, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Delete"]
|
|
1197
|
+
})
|
|
1198
|
+
})
|
|
1199
|
+
]
|
|
1200
|
+
})
|
|
1201
|
+
})]
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
//#endregion
|
|
1205
|
+
//#region lib/chats/chatmessages/chat-single-message.tsx
|
|
1206
|
+
function et({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage: r, messages: i, userType: a, moreActions: o }) {
|
|
1207
|
+
let [s, c] = A.useState(!1), [u, d] = A.useState(!1), { workspace: f } = k((e) => e.data), p = String(e?.message ?? "").trim().length > 0, m = a === "VISITOR", h = f?.widget?.notifications?.customerDeletesMessage === l.true, g = !m || h, _ = m ? e?.senderType === "VISITOR" : e?.senderType !== "VISITOR", v = A.useMemo(() => {
|
|
1208
|
+
if (!i?.length || !e?.id) return !1;
|
|
1209
|
+
let t = i.findIndex((t) => t.id === e.id);
|
|
1210
|
+
if (t === -1) return !1;
|
|
1211
|
+
let n = i[t + 1];
|
|
1212
|
+
if (!n) return !0;
|
|
1213
|
+
let r = (e) => e.senderType === "VISITOR";
|
|
1214
|
+
return r(n) !== r(e);
|
|
1215
|
+
}, [
|
|
1216
|
+
i,
|
|
1217
|
+
e.id,
|
|
1218
|
+
e.senderType
|
|
1219
|
+
]), y = A.useCallback(() => {
|
|
1220
|
+
c(!1);
|
|
1221
|
+
}, []), b = A.useCallback((e) => {
|
|
1222
|
+
n(e), y();
|
|
1223
|
+
}, [n, y]), x = A.useCallback((t) => {
|
|
1224
|
+
if (!t) return;
|
|
1225
|
+
let n = document.getElementById(`padorix-msg-${t}`);
|
|
1226
|
+
if (n) {
|
|
1227
|
+
if (n.scrollIntoView({
|
|
1228
|
+
behavior: "smooth",
|
|
1229
|
+
block: "center"
|
|
1230
|
+
}), e.id === t) {
|
|
1231
|
+
d(!0);
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1234
|
+
window.dispatchEvent(new CustomEvent(`padorix-flash-${t}`));
|
|
1235
|
+
}
|
|
1236
|
+
}, [e.id]);
|
|
1237
|
+
return A.useEffect(() => {
|
|
1238
|
+
let t = `padorix-flash-${e.id}`, n = () => {
|
|
1239
|
+
d(!0);
|
|
1240
|
+
};
|
|
1241
|
+
return window.addEventListener(t, n), () => {
|
|
1242
|
+
window.removeEventListener(t, n);
|
|
1243
|
+
};
|
|
1244
|
+
}, [e.id]), A.useEffect(() => {
|
|
1245
|
+
if (!u) return;
|
|
1246
|
+
let e = window.setTimeout(() => {
|
|
1247
|
+
d(!1);
|
|
1248
|
+
}, 1500);
|
|
1249
|
+
return () => {
|
|
1250
|
+
window.clearTimeout(e);
|
|
1251
|
+
};
|
|
1252
|
+
}, [u]), /* @__PURE__ */ B(z, { children: /* @__PURE__ */ V("div", {
|
|
1253
|
+
id: `padorix-msg-${e.id}`,
|
|
1254
|
+
className: `
|
|
1255
|
+
padorix:flex
|
|
1256
|
+
padorix:items-end
|
|
1257
|
+
padorix:relative
|
|
1258
|
+
padorix:rounded-lg
|
|
1259
|
+
padorix:py-1
|
|
1260
|
+
padorix:px-1
|
|
1261
|
+
padorix:transition-all
|
|
1262
|
+
padorix:duration-500
|
|
1263
|
+
padorix:ease-in-out
|
|
1264
|
+
${u ? "padorix:bg-gray-100/80 padorix:scale-[1.01]" : "padorix:bg-transparent"}
|
|
1265
|
+
`,
|
|
1266
|
+
children: [
|
|
1267
|
+
!_ && /* @__PURE__ */ B(Je, {
|
|
1268
|
+
isLastInGroup: v,
|
|
1269
|
+
img: String(f?.logo ?? "")
|
|
1270
|
+
}),
|
|
1271
|
+
g && t?.length > 0 && e?.deleted === l.false && /* @__PURE__ */ B(Ye, {
|
|
1272
|
+
data: e,
|
|
1273
|
+
handleDeleteAction: b,
|
|
1274
|
+
messagesToDelete: t
|
|
1275
|
+
}),
|
|
1276
|
+
/* @__PURE__ */ B(qe, {
|
|
1277
|
+
isLastInGroup: v,
|
|
1278
|
+
isSender: _,
|
|
1279
|
+
data: e,
|
|
1280
|
+
children: /* @__PURE__ */ V("div", {
|
|
1281
|
+
className: "padorix:w-full padorix:px-1",
|
|
1282
|
+
children: [e?.deleted === l.false && /* @__PURE__ */ B($e, {
|
|
1283
|
+
data: e,
|
|
1284
|
+
deleteAction: n,
|
|
1285
|
+
handleStarMessage: r,
|
|
1286
|
+
isSender: _,
|
|
1287
|
+
isMessage: p,
|
|
1288
|
+
handleClick: y,
|
|
1289
|
+
handleDeleteAction: b,
|
|
1290
|
+
setOpens: c,
|
|
1291
|
+
opens: s,
|
|
1292
|
+
moreActions: o,
|
|
1293
|
+
canDeleteMessage: g
|
|
1294
|
+
}), /* @__PURE__ */ B("div", {
|
|
1295
|
+
className: "padorix:p-1 padorix:whitespace-pre-wrap",
|
|
1296
|
+
children: e?.deleted === l.true ? /* @__PURE__ */ V("div", {
|
|
1297
|
+
className: "padorix:italic padorix:px-3 padorix:py-2 padorix:rounded-lg padorix:bg-gray-200/60 padorix:text-gray-500 padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
1298
|
+
children: [/* @__PURE__ */ B(Ge, {}), /* @__PURE__ */ B("span", { children: "This message was deleted" })]
|
|
1299
|
+
}) : /* @__PURE__ */ V(z, { children: [
|
|
1300
|
+
/* @__PURE__ */ B(Qe, {
|
|
1301
|
+
data: e,
|
|
1302
|
+
isSender: _,
|
|
1303
|
+
handleScrollToTargetMessage: x
|
|
1304
|
+
}),
|
|
1305
|
+
/* @__PURE__ */ B(Xe, { data: e }),
|
|
1306
|
+
p && /* @__PURE__ */ B("div", {
|
|
1307
|
+
className: "padorix:text-[0.8rem] padorix:whitespace-pre-wrap padorix:mt-2",
|
|
1308
|
+
children: Ke(String(e.message))
|
|
1309
|
+
}),
|
|
1310
|
+
/* @__PURE__ */ V("div", {
|
|
1311
|
+
className: "padorix:text-right padorix:text-[12px] padorix:mt-1 padorix:flex padorix:items-center padorix:justify-end padorix:gap-1 padorix:pl-2",
|
|
1312
|
+
children: [
|
|
1313
|
+
!m && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
|
|
1314
|
+
className: "padorix:text-[0.65rem]",
|
|
1315
|
+
children: e?.senderType
|
|
1316
|
+
}), /* @__PURE__ */ B(ce, {})] }),
|
|
1317
|
+
/* @__PURE__ */ B("span", {
|
|
1318
|
+
className: "padorix:text-[0.55rem]",
|
|
1319
|
+
children: G(e?.createdAt).format("hh:mm A")
|
|
1320
|
+
}),
|
|
1321
|
+
e?.starred === l.true && /* @__PURE__ */ B(de, { children: /* @__PURE__ */ B(Ve, { className: "padorix:size-3 padorix:text-amber-400" }) }),
|
|
1322
|
+
_ && /* @__PURE__ */ B(We, { className: "padorix:inline padorix:text-base padorix:size-3" })
|
|
1323
|
+
]
|
|
1324
|
+
})
|
|
1325
|
+
] })
|
|
1326
|
+
})]
|
|
1327
|
+
})
|
|
1328
|
+
}),
|
|
1329
|
+
m ? e?.deleted === l.false && _ && /* @__PURE__ */ B(Je, {
|
|
1330
|
+
isLastInGroup: v,
|
|
1331
|
+
img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJVHZNWXrm6+zq7+9VYIChqbhXY4JUX4ChqrlVX4Hd4uVRYICvt8NVYYFXYoJWYIFzfJZVYYFVYIFVYIFVYIDs8fHK0Njt8vFVYIBTXn5KVnfn7e1UYIBVYIHIztZWYIHx9fRWYoKkrLtWYIFWYoNXYYJXX4FWYYFWYYJWYoJdZ4ZXYoJrdpHl6utVYIBVYH9rdZBWYYFVYIBWXX1UXnzn7OxUX4BVYIBbZoRWYYDh5ulVYYJWYYHu8/N+h57CydJ7hZ1VYYFeaYdWYYG/xtCpsL9aZIRaZYOLk6jw9PPl6etWYYLv8/fr9fC/zL+yusagqLjp7e6zucbX3eJPW3tRXH1gaoja4OSutMPGzNTk6Oqmrr1XV4dVX4Dn7O3n7O3n7O3m7Ozm6utVYH/o7O1WYYBUXn5WYYHm6+tVYH93gZq////a3+Tn6uywt8SOl6zl7O3T2N5oc49GUnbM0tllb4ypsL5dZ39ra4zV299RXH1VW35UYYDm6uuEjaNbZoXo6+/O1Nrq7/CZobO3vsiTnK+FjqRUXYJVYIHl6uu+xM6Xn7CcpLVRXH3l6+nn7O1kb4x5g5yeprekq7rc4eXs8vHj6Onq8PHm7Ozl6uvl6+vn6+1UYH7l6Ojn7e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vByIxMF9pxmqvaFTdZ++f3AjitHbX/gAlHvchocP7Bt2+lR3uzfRYOBwJPY6xp4NhupAe/ep0LB9Bx7c0LuLxNrU93MYEr786rO//s3Q3nWq53RdvddrNHq99XWne051tRv+8a8DX33J/yh23A/MEJv4fzZ+fvDv33y9f++nXwxLS1v3xV/27v/6m38enLeBL3cTNony/n9GHU2UlcLeHAAAAABJRU5ErkJggg=="
|
|
1332
|
+
}) : /* @__PURE__ */ B("div", { className: "padorix:size-7" })
|
|
1333
|
+
]
|
|
1334
|
+
}) });
|
|
1335
|
+
}
|
|
1336
|
+
//#endregion
|
|
1337
|
+
//#region lib/chats/newchat/chat-input.tsx
|
|
1338
|
+
var $ = M(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__ */ B(R, { children: /* @__PURE__ */ V("div", {
|
|
1339
|
+
className: "padorix:mb-4",
|
|
1340
|
+
children: [
|
|
1341
|
+
/* @__PURE__ */ V("div", {
|
|
1342
|
+
className: "padorix:mb-1 padorix:ml-2 padorix:text-[0.8rem] padorix:font-medium",
|
|
1343
|
+
children: [
|
|
1344
|
+
n.content,
|
|
1345
|
+
" ",
|
|
1346
|
+
/* @__PURE__ */ B("span", {
|
|
1347
|
+
className: "padorix:text-red-600",
|
|
1348
|
+
children: "*"
|
|
1349
|
+
}),
|
|
1350
|
+
" "
|
|
1351
|
+
]
|
|
1352
|
+
}),
|
|
1353
|
+
t === "input" && /* @__PURE__ */ B("input", {
|
|
1354
|
+
type: e,
|
|
1355
|
+
...n,
|
|
1356
|
+
ref: r,
|
|
1357
|
+
placeholder: n.placeholder,
|
|
1358
|
+
className: `padorix:w-full padorix:bg-slate-100 padorix:rounded-md padorix:p-3 padorix:outline-none padorix:text-sm! padorix:max-md:text-base! padorix:border ${n.error ? "padorix:border-red-400" : "padorix:border-transparent"}`
|
|
1359
|
+
}),
|
|
1360
|
+
t === "textarea" && /* @__PURE__ */ B("textarea", {
|
|
1361
|
+
...n,
|
|
1362
|
+
ref: r,
|
|
1363
|
+
placeholder: "Leave a message",
|
|
1364
|
+
className: `padorix:w-full padorix:bg-slate-100 padorix-scrolls padorix:rounded-md padorix:p-3 padorix:outline-none padorix:resize-none padorix:text-sm! padorix:max-md:text-base! padorix:h-24 padorix:border ${n.error ? "padorix:border-red-400" : "padorix:border-transparent"}`
|
|
1365
|
+
}),
|
|
1366
|
+
n.error && /* @__PURE__ */ B("div", {
|
|
1367
|
+
className: "padorix:text-red-400 padorix:text-xs",
|
|
1368
|
+
children: n.error
|
|
1369
|
+
})
|
|
1370
|
+
]
|
|
1371
|
+
}) })), tt = [
|
|
1372
|
+
{
|
|
1373
|
+
index: 1,
|
|
1374
|
+
color: "padorix:text-red-600"
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
index: 2,
|
|
1378
|
+
color: "padorix:text-red-400"
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
index: 3,
|
|
1382
|
+
color: "padorix:text-amber-600"
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
index: 4,
|
|
1386
|
+
color: "padorix:text-amber-400"
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
index: 5,
|
|
1390
|
+
color: "padorix:text-green-400"
|
|
1391
|
+
}
|
|
1392
|
+
];
|
|
1393
|
+
function nt(e) {
|
|
1394
|
+
function t(t) {
|
|
1395
|
+
let n = t?.split("-")[1];
|
|
1396
|
+
if (e.value !== t) return e.setFieldValue?.(e.valueName || "", t), e.setFieldValue2?.(e.valueName2 || "", n);
|
|
1397
|
+
e.setFieldValue?.(e.valueName || "", ""), e.setFieldValue2?.(e.valueName2 || "", "");
|
|
1398
|
+
}
|
|
1399
|
+
return /* @__PURE__ */ V("div", {
|
|
1400
|
+
className: "padorix:mb-5",
|
|
1401
|
+
children: [
|
|
1402
|
+
/* @__PURE__ */ B("div", {
|
|
1403
|
+
className: "",
|
|
1404
|
+
children: e.content
|
|
1405
|
+
}),
|
|
1406
|
+
/* @__PURE__ */ B("div", {
|
|
1407
|
+
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
1408
|
+
children: Object.values(y).map((n, r) => {
|
|
1409
|
+
let i = Object.values(y).findIndex((t) => t?.split("-")[1] === e.value2) + 1, a = r + 1 <= i, o = tt.find((e) => e.index === i);
|
|
1410
|
+
return /* @__PURE__ */ B("div", {
|
|
1411
|
+
onClick: () => e.tag === "write" ? t(n) : {},
|
|
1412
|
+
className: `${e.tag === "write" ? "padorix:cursor-pointer padorix:active:scale-125 padorix:transition-all padorix:hover:scale-110" : ""} padorix:text-3xl`,
|
|
1413
|
+
children: /* @__PURE__ */ B(Ve, { className: a ? o?.color : "padorix:text-gray-400" })
|
|
1414
|
+
}, r);
|
|
1415
|
+
})
|
|
1416
|
+
}),
|
|
1417
|
+
/* @__PURE__ */ B("div", {
|
|
1418
|
+
className: "padorix:mt-2 padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1419
|
+
children: e.value?.split("-")[0]?.replace("_", " ")
|
|
1420
|
+
})
|
|
1421
|
+
]
|
|
1422
|
+
});
|
|
1423
|
+
}
|
|
1424
|
+
//#endregion
|
|
1425
|
+
//#region lib/chats/chatmessages/chat-feedback-form.tsx
|
|
1426
|
+
function rt() {
|
|
1427
|
+
let { sender: e, conversation: t, workspace: n } = k((e) => e.data), [r, i] = N(!1), a = O(), s = Fe(w.VISITOR), c = K({
|
|
1428
|
+
mode: "uncontrolled",
|
|
1429
|
+
initialValues: {
|
|
1430
|
+
workspaceId: t?.workspaceId,
|
|
1431
|
+
conversationId: e?.conversationId,
|
|
1432
|
+
senderName: e?.fullName,
|
|
1433
|
+
rating: "",
|
|
1434
|
+
comment: "",
|
|
1435
|
+
satisfactory: ""
|
|
1436
|
+
},
|
|
1437
|
+
validate: {
|
|
1438
|
+
workspaceId: (e) => e ? null : "Workspace ID is required",
|
|
1439
|
+
conversationId: (e) => e ? null : "Conversation ID is required",
|
|
1440
|
+
senderName: (e) => e ? null : "Sender name is required",
|
|
1441
|
+
rating: (e) => e ? null : "Rating is required",
|
|
1442
|
+
comment: (e) => e ? null : "Comment is required",
|
|
1443
|
+
satisfactory: (e) => e ? null : "Satisfactory is required"
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
async function l(e) {
|
|
1447
|
+
if (s) {
|
|
1448
|
+
i(!0);
|
|
1449
|
+
try {
|
|
1450
|
+
a(o(await f.submitFeedback(s, {
|
|
1451
|
+
comment: e.comment,
|
|
1452
|
+
satisfactory: e.satisfactory?.split("-")[0]?.replace("_", " "),
|
|
1453
|
+
rating: Number(e.rating)
|
|
1454
|
+
}))), c.reset();
|
|
1455
|
+
} catch (e) {
|
|
1456
|
+
i(!1), d(e.message, "error");
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
return r ? null : /* @__PURE__ */ V("form", {
|
|
1461
|
+
onSubmit: c.onSubmit(l),
|
|
1462
|
+
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1463
|
+
children: [
|
|
1464
|
+
/* @__PURE__ */ B(nt, {
|
|
1465
|
+
content: "",
|
|
1466
|
+
value: c.values.satisfactory,
|
|
1467
|
+
value2: c.values.rating,
|
|
1468
|
+
tag: "write",
|
|
1469
|
+
valueName: "satisfactory",
|
|
1470
|
+
valueName2: "rating",
|
|
1471
|
+
setFieldValue: c.setFieldValue,
|
|
1472
|
+
setFieldValue2: c.setFieldValue
|
|
1473
|
+
}),
|
|
1474
|
+
/* @__PURE__ */ j($, {
|
|
1475
|
+
content: "",
|
|
1476
|
+
formtype: "textarea",
|
|
1477
|
+
error: c.errors.comment?.toString() || "",
|
|
1478
|
+
...c.getInputProps("comment"),
|
|
1479
|
+
key: c.key("comment")
|
|
1480
|
+
}),
|
|
1481
|
+
/* @__PURE__ */ B("div", {
|
|
1482
|
+
className: "padorix:mt-5",
|
|
1483
|
+
children: /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
1484
|
+
style: { background: c.submitting ? "" : String(n?.widget?.colorScheme) },
|
|
1485
|
+
className: `padorix:cursor-pointer ${c.submitting ? "padorix:bg-slate-500" : ""} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1486
|
+
children: "Submit your feedback"
|
|
1487
|
+
}) })
|
|
1488
|
+
})
|
|
1489
|
+
]
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
//#endregion
|
|
1493
|
+
//#region lib/chats/chatmessages/end-chat-confirmation.tsx
|
|
1494
|
+
function it() {
|
|
1495
|
+
let { chatToEnd: e, workspace: t } = k((e) => e.data), r = O(), [i, a] = A.useState(!1);
|
|
1496
|
+
function s() {
|
|
1497
|
+
r(n(void 0));
|
|
1498
|
+
}
|
|
1499
|
+
async function c() {
|
|
1500
|
+
if (e) {
|
|
1501
|
+
a(!0);
|
|
1502
|
+
try {
|
|
1503
|
+
r(o(await f.endChat({
|
|
1504
|
+
workspaceId: e.workspaceId,
|
|
1505
|
+
conversationId: e.conversationId,
|
|
1506
|
+
senderId: e.senderId,
|
|
1507
|
+
userType: e.userType,
|
|
1508
|
+
senderName: e.senderName
|
|
1509
|
+
}))), r(n(void 0));
|
|
1510
|
+
} catch (e) {
|
|
1511
|
+
d(e.message, "error");
|
|
1512
|
+
} finally {
|
|
1513
|
+
a(!1);
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
return /* @__PURE__ */ V("div", {
|
|
1518
|
+
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1519
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1520
|
+
className: "padorix:text-center padorix:text-slate-500",
|
|
1521
|
+
children: "Kindly confirm your request to end this chat session"
|
|
1522
|
+
}), /* @__PURE__ */ B("div", {
|
|
1523
|
+
className: "padorix:border-t padorix:border-gray-200 padorix:mt-5",
|
|
1524
|
+
children: /* @__PURE__ */ V("div", {
|
|
1525
|
+
className: "padorix:mt-2 padorix:size-fit padorix:ml-auto padorix:flex padorix:items-center padorix:gap-5",
|
|
1526
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
1527
|
+
onClick: s,
|
|
1528
|
+
className: `${i ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:border padorix:border-gray-200 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1529
|
+
children: "Cancel"
|
|
1530
|
+
}) }), /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
1531
|
+
onClick: c,
|
|
1532
|
+
disabled: i,
|
|
1533
|
+
style: { background: String(t?.widget?.colorScheme) },
|
|
1534
|
+
className: `${i ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1535
|
+
children: "End chat"
|
|
1536
|
+
}) })]
|
|
1537
|
+
})
|
|
1538
|
+
})]
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
//#endregion
|
|
1542
|
+
//#region lib/chats/chatmessages/chat-messages.tsx
|
|
1543
|
+
function at({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
1544
|
+
let { conversation: r, chatToEnd: i, workspace: a } = k((e) => e.data), o = n.userType === "VISITOR";
|
|
1545
|
+
function s(n) {
|
|
1546
|
+
e.find((e) => e === n) ? t((e) => e.filter((e) => e !== n)) : t((e) => [...e, n]);
|
|
1547
|
+
}
|
|
1548
|
+
return /* @__PURE__ */ V("div", {
|
|
1549
|
+
className: "padorix:relative",
|
|
1550
|
+
children: [
|
|
1551
|
+
n.messages.map((t) => /* @__PURE__ */ B(et, {
|
|
1552
|
+
messagesToDelete: e,
|
|
1553
|
+
handleStarMessage: n.handleStarMessage,
|
|
1554
|
+
deleteAction: s,
|
|
1555
|
+
styles: n.styles,
|
|
1556
|
+
data: t,
|
|
1557
|
+
messages: n.messages,
|
|
1558
|
+
userType: n.userType,
|
|
1559
|
+
moreActions: n.moreActions
|
|
1560
|
+
}, t.id)),
|
|
1561
|
+
n.isTyping && /* @__PURE__ */ B("div", {
|
|
1562
|
+
role: "status",
|
|
1563
|
+
"aria-label": "Typing",
|
|
1564
|
+
style: n.isOwnTyping ? { backgroundColor: a?.widget?.colorScheme || "#6c63ff" } : void 0,
|
|
1565
|
+
className: n.isOwnTyping ? "padorix:ml-auto padorix:mr-2 padorix:mb-2 padorix:flex padorix:w-fit padorix:items-center padorix:gap-1 padorix:rounded-2xl padorix:rounded-br-sm padorix:px-3 padorix:py-2.5" : "padorix:ml-2 padorix:mb-2 padorix:flex padorix:w-fit padorix:items-center padorix:gap-1 padorix:rounded-2xl padorix:rounded-bl-sm padorix:bg-gray-200 padorix:px-3 padorix:py-2.5 padorix:dark:bg-slate-600",
|
|
1566
|
+
children: [
|
|
1567
|
+
0,
|
|
1568
|
+
1,
|
|
1569
|
+
2
|
|
1570
|
+
].map((e) => /* @__PURE__ */ B("span", {
|
|
1571
|
+
className: n.isOwnTyping ? "padorix:size-2 padorix:animate-bounce padorix:rounded-full padorix:bg-white" : "padorix:size-2 padorix:animate-bounce padorix:rounded-full padorix:bg-gray-500 padorix:dark:bg-gray-200",
|
|
1572
|
+
style: { animationDelay: `${e * 120}ms` }
|
|
1573
|
+
}, e))
|
|
1574
|
+
}),
|
|
1575
|
+
o && r?.status === l.false && /* @__PURE__ */ B(rt, {}),
|
|
1576
|
+
i?.isEndChat === l.true && /* @__PURE__ */ B(it, {})
|
|
1577
|
+
]
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1580
|
+
//#endregion
|
|
1581
|
+
//#region node_modules/react-icons/rx/index.mjs
|
|
1582
|
+
function ot(e) {
|
|
1583
|
+
return Z({
|
|
1584
|
+
tag: "svg",
|
|
1585
|
+
attr: {
|
|
1586
|
+
viewBox: "0 0 15 15",
|
|
1587
|
+
fill: "none"
|
|
1588
|
+
},
|
|
1589
|
+
child: [{
|
|
1590
|
+
tag: "path",
|
|
1591
|
+
attr: {
|
|
1592
|
+
d: "M11.2248 8.08224C11.4189 7.95407 11.6829 7.97583 11.8537 8.14669C12.0246 8.31756 12.0463 8.58152 11.9182 8.7756L11.8537 8.85372L7.85372 12.8537C7.65846 13.049 7.34195 13.049 7.14669 12.8537L3.14669 8.85372L3.08224 8.7756C2.95407 8.58152 2.97583 8.31756 3.14669 8.14669C3.31756 7.97583 3.58152 7.95407 3.7756 8.08224L3.85372 8.14669L7.50021 11.7932L11.1467 8.14669L11.2248 8.08224ZM11.2248 2.08224C11.4189 1.95407 11.6829 1.97583 11.8537 2.14669C12.0246 2.31756 12.0463 2.58152 11.9182 2.7756L11.8537 2.85372L7.85372 6.85372C7.65846 7.04899 7.34195 7.04899 7.14669 6.85372L3.14669 2.85372L3.08224 2.7756C2.95407 2.58152 2.97583 2.31756 3.14669 2.14669C3.31756 1.97583 3.58152 1.95407 3.7756 2.08224L3.85372 2.14669L7.50021 5.79318L11.1467 2.14669L11.2248 2.08224Z",
|
|
1593
|
+
fill: "currentColor"
|
|
1594
|
+
},
|
|
1595
|
+
child: []
|
|
1596
|
+
}]
|
|
1597
|
+
})(e);
|
|
1598
|
+
}
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region lib/chats/chatmessages/chat-message-skeleton.tsx
|
|
1601
|
+
function st(e) {
|
|
1602
|
+
return /* @__PURE__ */ B(R, {
|
|
1603
|
+
style: { width: `${Math.floor(Math.random() * 100 + (e.index + 15))}%` },
|
|
1604
|
+
className: "padorix:w-fit padorix:h-fit padorix:max-w-[91%] padorix:relative padorix:bottom-3 padorix:md:max-w-[80%] padorix:mb-1.5 padorix:ml-auto padorix:rounded-t-xl padorix:rounded-bl-xl padorix:bg-gray-100 padorix:animate-pulse padorix:text-white",
|
|
1605
|
+
children: /* @__PURE__ */ B("div", { className: "padorix:px-1 padorix:h-12" })
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
//#endregion
|
|
1609
|
+
//#region lib/chats/chatScreen/chat-container.tsx
|
|
1610
|
+
var ct = 3500;
|
|
1611
|
+
function lt(e) {
|
|
1612
|
+
return e ? Array.isArray(e) ? e.join("\n") : String(e) : "";
|
|
1613
|
+
}
|
|
1614
|
+
function ut({ styles: t, userType: i, ...a }) {
|
|
1615
|
+
let s = O(), c = A.useRef(null), u = A.useRef(null), [m, h] = A.useState(!1), [g, _] = A.useState([]), [v, y] = A.useState(!1), [b, x] = A.useState(!1), [S, C] = A.useState(null), T = A.useRef(null), j = A.useRef(null), [M, N] = A.useState([]), P = A.useRef(/* @__PURE__ */ new Set()), { sender: F, workspace: re, reply: ie, conversation: ae } = k((e) => e.data), oe = S !== null, se = !!(S?.senderId && S.senderId === F?.senderId), I = A.useMemo(() => i === w.VISITOR ? {
|
|
1616
|
+
...F,
|
|
1617
|
+
workspaceId: re?.id,
|
|
1618
|
+
userType: i
|
|
1619
|
+
} : a.sender, [
|
|
1620
|
+
i,
|
|
1621
|
+
F,
|
|
1622
|
+
re?.id,
|
|
1623
|
+
a.sender
|
|
1624
|
+
]), ce = JSON.stringify([
|
|
1625
|
+
I?.workspaceId,
|
|
1626
|
+
I?.conversationId,
|
|
1627
|
+
I?.senderId,
|
|
1628
|
+
I?.userType ?? i,
|
|
1629
|
+
I?.fullName
|
|
1630
|
+
]), L = A.useMemo(() => {
|
|
1631
|
+
let [e, t, n, r, i] = JSON.parse(ce);
|
|
1632
|
+
return !e || !t || !n ? null : {
|
|
1633
|
+
workspaceId: String(e),
|
|
1634
|
+
conversationId: String(t),
|
|
1635
|
+
senderId: String(n),
|
|
1636
|
+
userType: String(r),
|
|
1637
|
+
senderName: i ? String(i) : void 0
|
|
1638
|
+
};
|
|
1639
|
+
}, [ce]), le = String(I?.conversationId ?? ""), de = A.useRef(le);
|
|
1640
|
+
de.current = le;
|
|
1641
|
+
let z = A.useCallback((e) => e == null || e === "" ? !0 : String(e) === de.current, []);
|
|
1642
|
+
function H() {
|
|
1643
|
+
ee(c), u.current?.scrollIntoView({ behavior: "smooth" });
|
|
1644
|
+
}
|
|
1645
|
+
let U = A.useCallback((e) => {
|
|
1646
|
+
let t = e.message;
|
|
1647
|
+
if (!t || !z(t.conversationId)) return;
|
|
1648
|
+
let n = t.clientMessageId;
|
|
1649
|
+
n && P.current.delete(n), N((e) => {
|
|
1650
|
+
let r = e.findIndex((e) => e.id === t.id);
|
|
1651
|
+
if (r !== -1) return e.map((e, n) => n === r ? t : e);
|
|
1652
|
+
if (n) {
|
|
1653
|
+
let r = e.findIndex((e) => e.clientMessageId === n || e.id === n);
|
|
1654
|
+
if (r !== -1) return e.map((e, n) => n === r ? t : e);
|
|
1655
|
+
}
|
|
1656
|
+
let i = lt(t.message), a = e.findIndex((e) => {
|
|
1657
|
+
let n = !!(e.id && e.id.length >= 32), r = String(e.senderId) === String(t.senderId), a = lt(e.message) === i;
|
|
1658
|
+
return n && r && a;
|
|
1659
|
+
});
|
|
1660
|
+
return a === -1 ? [...e, t] : e.map((e, n) => n === a ? t : e);
|
|
1661
|
+
}), x(!1), setTimeout(() => {
|
|
1662
|
+
H();
|
|
1663
|
+
}, 300);
|
|
1664
|
+
}, [z]), W = A.useCallback((e) => {
|
|
1665
|
+
U(e);
|
|
1666
|
+
}, [U]), G = A.useCallback((e) => {
|
|
1667
|
+
if (!P.current.has(e)) return;
|
|
1668
|
+
P.current.delete(e);
|
|
1669
|
+
let t = [e];
|
|
1670
|
+
N((e) => e.filter((e) => !t.includes(e.id) && (!e.clientMessageId || !t.includes(e.clientMessageId)))), x(!1);
|
|
1671
|
+
}, []);
|
|
1672
|
+
function pe(t) {
|
|
1673
|
+
let n = !!ie?.messageId, a = crypto.randomUUID(), o = {
|
|
1674
|
+
...t,
|
|
1675
|
+
clientMessageId: a,
|
|
1676
|
+
merchantId: re?.userId,
|
|
1677
|
+
...n ? {
|
|
1678
|
+
isReply: !0,
|
|
1679
|
+
messageId: ie?.messageId
|
|
1680
|
+
} : {},
|
|
1681
|
+
message: t.message.trim()
|
|
1682
|
+
}, c = (/* @__PURE__ */ new Date()).toISOString(), u = {
|
|
1683
|
+
id: a,
|
|
1684
|
+
clientMessageId: a,
|
|
1685
|
+
conversationId: o.conversationId,
|
|
1686
|
+
workspaceId: o.workspaceId,
|
|
1687
|
+
senderName: F?.fullName ?? "",
|
|
1688
|
+
senderType: i,
|
|
1689
|
+
senderId: o.senderId,
|
|
1690
|
+
message: [o.message],
|
|
1691
|
+
images: o.images ?? [],
|
|
1692
|
+
starred: l.false,
|
|
1693
|
+
deleted: l.false,
|
|
1694
|
+
createdAt: c,
|
|
1695
|
+
updatedAt: c
|
|
1696
|
+
};
|
|
1697
|
+
P.current.add(a), N((e) => e.some((e) => e.id === a || e.clientMessageId && e.clientMessageId === a) ? e : [...e, u]), x(!0), L && f.sendMessage(L, o).then((e) => U({ message: e })).catch((e) => {
|
|
1698
|
+
G(a), d(e.message || "Message not sent", "error");
|
|
1699
|
+
}), s(r(void 0)), s(e(void 0)), setTimeout(() => {
|
|
1700
|
+
H();
|
|
1701
|
+
}, 50);
|
|
1702
|
+
}
|
|
1703
|
+
let K = A.useCallback((e) => {
|
|
1704
|
+
N((t) => t.some((t) => t.id === e.messageId) ? t.map((t) => t.id === e.messageId ? {
|
|
1705
|
+
...t,
|
|
1706
|
+
starred: e.status
|
|
1707
|
+
} : t) : t);
|
|
1708
|
+
}, []), q = A.useCallback((e) => {
|
|
1709
|
+
z(e?.id) && (s(o(e)), setTimeout(() => {
|
|
1710
|
+
H();
|
|
1711
|
+
}, 1e3));
|
|
1712
|
+
}, [s, z]), me = A.useCallback((e) => {
|
|
1713
|
+
z(e?.id) && (s(o(e)), s(n(void 0)), localStorage.removeItem(p), i === w.VISITOR && te(), a.closeModal());
|
|
1714
|
+
}, [
|
|
1715
|
+
s,
|
|
1716
|
+
a,
|
|
1717
|
+
z,
|
|
1718
|
+
i
|
|
1719
|
+
]), he = A.useCallback((e) => {
|
|
1720
|
+
z(e?.conversation?.id) && (N(e.messages ?? []), new Set((e.messages ?? []).map((e) => e.clientMessageId).filter(Boolean)).forEach((e) => P.current.delete(e)), s(o(e.conversation)), setTimeout(() => {
|
|
1721
|
+
H();
|
|
1722
|
+
}, 1e3));
|
|
1723
|
+
}, [s, z]);
|
|
1724
|
+
function ge(e, t) {
|
|
1725
|
+
L && f.starMessage(L, e, t).then(K).catch((e) => d(e.message, "error"));
|
|
1726
|
+
}
|
|
1727
|
+
function _e(e) {
|
|
1728
|
+
let t = [];
|
|
1729
|
+
e.forEach((e) => {
|
|
1730
|
+
let n = M.find((t) => t.id === e);
|
|
1731
|
+
n && t.push(n.id);
|
|
1732
|
+
}), !(!L || t.length === 0) && f.deleteMessages(L, t).then(J).catch((e) => d(e.message, "error"));
|
|
1733
|
+
}
|
|
1734
|
+
let J = A.useCallback((e) => {
|
|
1735
|
+
if (!e || e.length === 0) return;
|
|
1736
|
+
let t = new Set(e);
|
|
1737
|
+
N((e) => e.some((e) => t.has(e.id)) ? e.map((e) => t.has(e.id) ? {
|
|
1738
|
+
...e,
|
|
1739
|
+
deleted: l.true
|
|
1740
|
+
} : e) : e);
|
|
1741
|
+
}, []), ve = A.useCallback((e) => {
|
|
1742
|
+
let t = typeof e == "object" && e ? e : {};
|
|
1743
|
+
z(t.conversationId) && (T.current = t, C(t), j.current !== null && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
1744
|
+
T.current = null, C(null), j.current = null;
|
|
1745
|
+
}, ct));
|
|
1746
|
+
}, [z]), ye = A.useCallback((e) => {
|
|
1747
|
+
let t = typeof e == "object" && e ? e : {};
|
|
1748
|
+
z(t.conversationId) && (t.senderId && T.current?.senderId && t.senderId !== T.current.senderId || (j.current !== null && (window.clearTimeout(j.current), j.current = null), T.current = null, C(null)));
|
|
1749
|
+
}, [z]);
|
|
1750
|
+
A.useEffect(() => {
|
|
1751
|
+
j.current !== null && (window.clearTimeout(j.current), j.current = null), T.current = null, C(null);
|
|
1752
|
+
}, [le]), A.useEffect(() => (E.on(D.is_typing, ve), E.on(D.not_typing, ye), () => {
|
|
1753
|
+
E.off(D.is_typing, ve), E.off(D.not_typing, ye), j.current !== null && window.clearTimeout(j.current);
|
|
1754
|
+
}), [ye, ve]), A.useEffect(() => {
|
|
1755
|
+
oe && !m && u.current?.scrollIntoView({ behavior: "smooth" });
|
|
1756
|
+
}, [m, oe]), A.useEffect(() => {
|
|
1757
|
+
let e = c.current;
|
|
1758
|
+
if (!e) return;
|
|
1759
|
+
let t = () => {
|
|
1760
|
+
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e;
|
|
1761
|
+
n - t - r > 5 ? h(!0) : h(!1);
|
|
1762
|
+
};
|
|
1763
|
+
return e.addEventListener("scroll", t, { passive: !0 }), () => {
|
|
1764
|
+
e.removeEventListener("scroll", t);
|
|
1765
|
+
};
|
|
1766
|
+
}, []);
|
|
1767
|
+
function be() {
|
|
1768
|
+
H(), setTimeout(() => H(), 100);
|
|
1769
|
+
}
|
|
1770
|
+
function Y() {
|
|
1771
|
+
_([]);
|
|
1772
|
+
}
|
|
1773
|
+
function xe() {
|
|
1774
|
+
_e(g), setTimeout(() => {
|
|
1775
|
+
_([]);
|
|
1776
|
+
}, 100);
|
|
1777
|
+
}
|
|
1778
|
+
A.useEffect(() => (E.on(D.delete_message, J), E.on(D.star_message, K), E.on(D.request_feedback, q), E.on(D.submit_feedback, q), E.on(D.end_chat_session, me), () => {
|
|
1779
|
+
E.off(D.delete_message, J), E.off(D.star_message, K), E.off(D.request_feedback, q), E.off(D.submit_feedback, q), E.off(D.end_chat_session, me);
|
|
1780
|
+
}), [
|
|
1781
|
+
J,
|
|
1782
|
+
K,
|
|
1783
|
+
q,
|
|
1784
|
+
me
|
|
1785
|
+
]), A.useEffect(() => (E.on(D.send_message, U), E.on(D.update_send_message, W), () => {
|
|
1786
|
+
E.off(D.update_send_message, W), E.off(D.send_message, U);
|
|
1787
|
+
}), [U, W]), A.useEffect(() => {
|
|
1788
|
+
if (!L) return;
|
|
1789
|
+
let e = !1, t = () => {
|
|
1790
|
+
f.history(L).then((t) => !e && he(t)).catch((e) => console.log(e.message));
|
|
1791
|
+
}, n = () => {
|
|
1792
|
+
E.emit(D.subscribe_conversation, L), t();
|
|
1793
|
+
};
|
|
1794
|
+
return E.on(D.connected, n), E.connected ? n() : (t(), ne(L.userType !== w.VISITOR)), () => {
|
|
1795
|
+
e = !0, E.off(D.connected, n);
|
|
1796
|
+
};
|
|
1797
|
+
}, [L, he]);
|
|
1798
|
+
let X = `calc(var(--padorix-vvh, 100dvh) * ${g.length > 0 || ae?.status === l.false ? .915 : .81})`;
|
|
1799
|
+
return /* @__PURE__ */ V("div", {
|
|
1800
|
+
className: t.container,
|
|
1801
|
+
children: [
|
|
1802
|
+
/* @__PURE__ */ B(Be, {
|
|
1803
|
+
styles: t,
|
|
1804
|
+
userType: i,
|
|
1805
|
+
goBack: a.goBack,
|
|
1806
|
+
close: a.closeModal,
|
|
1807
|
+
toBottom: be,
|
|
1808
|
+
messages: M
|
|
1809
|
+
}),
|
|
1810
|
+
/* @__PURE__ */ V("div", {
|
|
1811
|
+
ref: c,
|
|
1812
|
+
style: { height: X },
|
|
1813
|
+
className: `${t.chatContainerPadding}`,
|
|
1814
|
+
children: [
|
|
1815
|
+
m && /* @__PURE__ */ B(fe, {
|
|
1816
|
+
direction: "up",
|
|
1817
|
+
className: "\r\n padorix:fixed\r\n padorix:right-2\r\n padorix:bottom-36\r\n padorix:z-10\r\n padorix:cursor-pointer\r\n padorix:transition-all\r\n padorix:active:scale-125\r\n ",
|
|
1818
|
+
children: /* @__PURE__ */ B("div", {
|
|
1819
|
+
className: "\r\n padorix:transition-all\r\n padorix:rounded-full\r\n padorix:size-8\r\n padorix:text-slate-500\r\n padorix:border\r\n padorix:border-gray-200\r\n padorix:flex\r\n padorix:items-center\r\n padorix:justify-center\r\n padorix:bg-white\r\n padorix:shadow-lg\r\n ",
|
|
1820
|
+
onClick: H,
|
|
1821
|
+
children: /* @__PURE__ */ B(ot, {})
|
|
1822
|
+
})
|
|
1823
|
+
}),
|
|
1824
|
+
Number(M?.length) < 1 && /* @__PURE__ */ B("div", {
|
|
1825
|
+
className: "padorix:relative padorix:p-4",
|
|
1826
|
+
children: Array(8).fill(0).map((e, t) => /* @__PURE__ */ B(st, { index: t }, t))
|
|
1827
|
+
}),
|
|
1828
|
+
/* @__PURE__ */ B(at, {
|
|
1829
|
+
messages: M,
|
|
1830
|
+
deleteMessagesAction: _e,
|
|
1831
|
+
handleStarMessage: ge,
|
|
1832
|
+
styles: t,
|
|
1833
|
+
userType: i,
|
|
1834
|
+
messagesToDelete: g,
|
|
1835
|
+
setMessagesToDelete: _,
|
|
1836
|
+
moreActions: a.moreActions,
|
|
1837
|
+
isTyping: oe,
|
|
1838
|
+
isOwnTyping: se
|
|
1839
|
+
}),
|
|
1840
|
+
/* @__PURE__ */ B("div", {
|
|
1841
|
+
ref: u,
|
|
1842
|
+
style: {
|
|
1843
|
+
float: "left",
|
|
1844
|
+
clear: "both"
|
|
1845
|
+
}
|
|
1846
|
+
})
|
|
1847
|
+
]
|
|
1848
|
+
}),
|
|
1849
|
+
v && g.length > 0 && /* @__PURE__ */ V("div", {
|
|
1850
|
+
className: t.messagesContainer,
|
|
1851
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1852
|
+
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1853
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1854
|
+
onClick: Y,
|
|
1855
|
+
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
1856
|
+
children: /* @__PURE__ */ B(Q, {})
|
|
1857
|
+
}), /* @__PURE__ */ V("div", {
|
|
1858
|
+
className: "padorix:space-x-0.5",
|
|
1859
|
+
children: [
|
|
1860
|
+
/* @__PURE__ */ B("span", { children: "Confirm to delete" }),
|
|
1861
|
+
" ",
|
|
1862
|
+
/* @__PURE__ */ V("span", {
|
|
1863
|
+
className: "padorix:text-red-500",
|
|
1864
|
+
children: [
|
|
1865
|
+
g.length,
|
|
1866
|
+
" message",
|
|
1867
|
+
g.length === 1 ? "" : "s"
|
|
1868
|
+
]
|
|
1869
|
+
})
|
|
1870
|
+
]
|
|
1871
|
+
})]
|
|
1872
|
+
}), /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
1873
|
+
onClick: xe,
|
|
1874
|
+
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125 padorix:text-red-500",
|
|
1875
|
+
children: /* @__PURE__ */ B(ue, {})
|
|
1876
|
+
}) })]
|
|
1877
|
+
}),
|
|
1878
|
+
!v && g.length > 0 && /* @__PURE__ */ V("div", {
|
|
1879
|
+
className: t.messagesContainer,
|
|
1880
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1881
|
+
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1882
|
+
children: [
|
|
1883
|
+
/* @__PURE__ */ B("div", {
|
|
1884
|
+
onClick: Y,
|
|
1885
|
+
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
1886
|
+
children: /* @__PURE__ */ B(Q, {})
|
|
1887
|
+
}),
|
|
1888
|
+
g.length,
|
|
1889
|
+
" Selected"
|
|
1890
|
+
]
|
|
1891
|
+
}), /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
1892
|
+
onClick: () => y(!0),
|
|
1893
|
+
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125",
|
|
1894
|
+
children: /* @__PURE__ */ B(ue, {})
|
|
1895
|
+
}) })]
|
|
1896
|
+
}),
|
|
1897
|
+
g.length < 1 && ae?.status === l.true && /* @__PURE__ */ B(Ie, {
|
|
1898
|
+
sendChat: pe,
|
|
1899
|
+
styles: t,
|
|
1900
|
+
userType: i,
|
|
1901
|
+
isSending: b
|
|
1902
|
+
})
|
|
1903
|
+
]
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
//#endregion
|
|
1907
|
+
//#region lib/assets/images/wave.png
|
|
1908
|
+
var dt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAA7VBMVEUAAADro1Lro1Lro1Lro1L/3Wfvr1bvrlbro1Lro1Lro1JCreJCreJCreJCreL/3Wf70mP91mT4x1/uqlX/3Wf/3Wf+2WbzuVrro1JCreJCreJCreJCreJCreJCreL/3Wfro1L/3WdCreJCreLro1L/3Wfsp1P6zmH/3WfwsldCreJCreL1wF3vsFfurVbvrlbuq1X/3Wf6z2L/3Wf70WP2xF7uq1VCreL/3WfxtVnro1JCreLzu1v/3Wfro1L1wF3ro1L1wF3/3Wf4yGD3xl//3Wfro1L/3Wf/3Wf0vFv5y2Dro1Lwsljro1Lytlk09oXuAAAAT3RSTlMAMGC/rxCf//+fEFC/gBCf/////8/////Pr99gIO9AYFCAn//fv//v3//PMCCPv69wr/8w7//vcFD/QI+/IID/70Bw3+/vII9A//9w74+/T+PN6AAAA5JJREFUeNrdlm13mjAUxzPbzqhIFRtQEFZ7LSt2T7VlzrpJ92A3tdv3/zgrIZdAgHLO9mZn91VI/P/zy829OZJ/P579kapxcHDYIIQcPW9S2moT0umIFa2rk/o47vWNAW2RoxPGTIsOCdFHtsOXxq7t1epfsMcwm/R0wuKwaAxzBto4XvQAnDqDE67r0+k541b+lHAHl5+jC1DHwJjY+SVDBO4g9rbBrsnDBRMIAQ44ApmBe1l3iFev37x9dyUQAjrPIYxdmCVGsyr99c08DOh7YTBXERbJ3g7Ak/AWNYoIp0QcPyapTOMHoRukCBYiHBCS7N3hPhUGE9RJhH4yWNJbEocLq7gcYVxVQQqCgQhzgbACLTawH2mvzj82VINPiI5nZwNECBKEDrixwRk55qvrQhOgLqhA0AFiAy/5Y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nXcgygAzgjSWOpgBMFXFvlheOYvFlfbcuSgB7u9tLYJ1galFXGYJRD12Y8vmJQvsnPnt01knYCDtUfZ0mkmTCf5Nz57i2eQ3aks8rRQpHOg20HZSSmRgkZbH7DVVQm29HrpTCQPGsUpjOMMARnDe86tXTKmpKGnpqillLRIEDJggga46tvwlT+Prrjq2/CVP4+uuOrd8JU/j6646t3wlT+Prq7dMaetoJ6WnpZQ0q7Cz4wAdf/xAAvEQACAQMBBAkEAwEAAAAAAAABAgMABBESBSFBoRMVFiIxNFNhcxRRVHEygbGR/9oACAEDAQE/AL7al4t3OkculUcqAAOFda3/AOS3Kutb/wDJblXWu0PyW5V1ptHGfqGx+hVhtO8e7hSSXUrsFII+9X/nbr5W/wBq3ga4lWNSBnxJ8ABvJr6C1CgkShdxLll8DxK+IFR2cCTCRUkHRSFDG2G1vwANbRu0eH6XOpkkDMw/jnByB7CtneetfkWr/wA7dfK3+1s2PPTuc4KiIAeJL8BmnjUvM+dLSroZndCAPZVySae4iWUI0qiRgRHvBCe7EcW5Vf2whdZEwEffpDA6DxG6tneetfkWrqGWa/u1jQselc7v3Vq13DHLDHZkur5LEHKnGKt7Ke4KkIwQkgtjcMUba4EYlMLaDxxRsZwu+Ng+oAJjgQTVjG8d7ZFlI1OpGeIqSSBJdqrLnvSjAU4O5jR2hFIQJIX0q6smlsHugLv/AOUdoxlxL0La0L6MNuw5J3j2zQv4xmTom6RkVG73dwuPAf1S3qB5GaNjm46UYOPDOBUNwLraVpKVwxdQ2/dkfarvYks1xLLFMoDtnDZ3E12fufWi512fufWi512fufWi512fufWi51Z7EkguI5pJlIQ5AXia/9k=", pt = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
1909
|
+
function mt(e) {
|
|
1910
|
+
let { workspace: t, tags: n } = k((e) => e.data), r = O(), [i, a] = A.useState(!1), s = A.useMemo(() => C(e.workspaceId), [e.workspaceId]), [c, l] = A.useState(e.openOptions ? 2 : n.length > 0 ? 1 : 2), m = A.useRef(0), _ = K({
|
|
1911
|
+
mode: "uncontrolled",
|
|
1912
|
+
initialValues: {
|
|
1913
|
+
tagId: n.find((t) => t.tag.trim().toLowerCase() === e.openOptions?.tag?.trim().toLowerCase())?.id ?? "",
|
|
1914
|
+
fullName: e.openOptions?.name ?? "",
|
|
1915
|
+
email: e.openOptions?.email ?? "",
|
|
1916
|
+
message: e.openOptions?.message ?? ""
|
|
1917
|
+
},
|
|
1918
|
+
validate: {
|
|
1919
|
+
fullName: (e) => c === 2 && !e ? "Full name is required" : c === 2 && e.length <= 2 ? "Your name is expected to be more than 2 characters" : null,
|
|
1920
|
+
email: (e) => c === 2 && !e ? "Email address is required" : c === 2 && !pt(e) ? "Please enter a valid email address" : null,
|
|
1921
|
+
message: (e) => c === 4 && !e ? "Enquiry content is required" : null
|
|
1922
|
+
}
|
|
1923
|
+
});
|
|
1924
|
+
function v() {
|
|
1925
|
+
if (n.length > 0) {
|
|
1926
|
+
if (c === 1) return e.changeScreen(1);
|
|
1927
|
+
l((e) => e - 1);
|
|
1928
|
+
}
|
|
1929
|
+
if (n.length < 1) {
|
|
1930
|
+
if (c === 2) return e.changeScreen(1);
|
|
1931
|
+
l((e) => e - 1);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
function y(e) {
|
|
1935
|
+
_.setFieldValue("tagId", e), l((e) => e + 1);
|
|
1936
|
+
}
|
|
1937
|
+
async function b(e) {
|
|
1938
|
+
a(!0);
|
|
1939
|
+
try {
|
|
1940
|
+
let t = await f.startConversation(e), n = {
|
|
1941
|
+
conversationId: t.conversation.id,
|
|
1942
|
+
senderId: t.senderId,
|
|
1943
|
+
fullName: t.fullName,
|
|
1944
|
+
tagId: e.tagId,
|
|
1945
|
+
expiresAt: G().add(1, "day").endOf("day").toDate().toString()
|
|
1946
|
+
};
|
|
1947
|
+
localStorage.setItem(p, JSON.stringify(n)), r(o(t.conversation)), r(g(n));
|
|
1948
|
+
} catch (e) {
|
|
1949
|
+
d(e.message || "Unable to start the chat", "error"), window.dispatchEvent(new Event(h));
|
|
1950
|
+
} finally {
|
|
1951
|
+
a(!1);
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
async function x(t) {
|
|
1955
|
+
if (c < 3) return l((e) => e + 1);
|
|
1956
|
+
await b({
|
|
1957
|
+
...t,
|
|
1958
|
+
workspaceId: e.workspaceId,
|
|
1959
|
+
userType: "VISITOR",
|
|
1960
|
+
visitorId: s,
|
|
1961
|
+
tag: e.openOptions?.tag
|
|
1962
|
+
});
|
|
1963
|
+
}
|
|
1964
|
+
return A.useEffect(() => {
|
|
1965
|
+
if (!e.openRequestId) return;
|
|
1966
|
+
let t = e.openOptions;
|
|
1967
|
+
if (!t) {
|
|
1968
|
+
l(1);
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
let r = n.find((e) => e.tag.trim().toLowerCase() === t.tag?.trim().toLowerCase())?.id ?? "";
|
|
1972
|
+
_.setValues({
|
|
1973
|
+
tagId: r,
|
|
1974
|
+
fullName: t.name ?? "",
|
|
1975
|
+
email: t.email ?? "",
|
|
1976
|
+
message: t.message ?? ""
|
|
1977
|
+
}), l(2), !(e.autoSubmitRequestId !== e.openRequestId || m.current === e.openRequestId || !u(t)) && (m.current = e.openRequestId, b({
|
|
1978
|
+
workspaceId: e.workspaceId,
|
|
1979
|
+
userType: "VISITOR",
|
|
1980
|
+
visitorId: s,
|
|
1981
|
+
fullName: t.name?.trim(),
|
|
1982
|
+
email: t.email?.trim(),
|
|
1983
|
+
message: t.message?.trim(),
|
|
1984
|
+
tagId: r || void 0,
|
|
1985
|
+
tag: t.tag
|
|
1986
|
+
}));
|
|
1987
|
+
}, [e.openRequestId]), /* @__PURE__ */ V("div", {
|
|
1988
|
+
className: e.styles.container,
|
|
1989
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1990
|
+
style: {
|
|
1991
|
+
background: String(t?.widget?.colorScheme),
|
|
1992
|
+
color: t?.widget?.textColor || "#ffffff"
|
|
1993
|
+
},
|
|
1994
|
+
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:gap-2",
|
|
1995
|
+
children: [/* @__PURE__ */ B(R, {
|
|
1996
|
+
className: "",
|
|
1997
|
+
children: "Kindly drop your enquiry and we will get back to you immediately"
|
|
1998
|
+
}), /* @__PURE__ */ B("div", {
|
|
1999
|
+
className: "padorix:size-8 padorix:ml-auto",
|
|
2000
|
+
children: /* @__PURE__ */ B("div", {
|
|
2001
|
+
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2002
|
+
onClick: e.close,
|
|
2003
|
+
children: /* @__PURE__ */ B(F, {})
|
|
2004
|
+
})
|
|
2005
|
+
})]
|
|
2006
|
+
}), /* @__PURE__ */ V("div", {
|
|
2007
|
+
className: "padorix:p-4",
|
|
2008
|
+
children: [
|
|
2009
|
+
/* @__PURE__ */ V("div", {
|
|
2010
|
+
className: "padorix:flex padorix:items-center padorix:gap-2",
|
|
2011
|
+
children: [/* @__PURE__ */ B(R, {
|
|
2012
|
+
className: "padorix:size-10",
|
|
2013
|
+
children: /* @__PURE__ */ V("div", {
|
|
2014
|
+
className: "",
|
|
2015
|
+
children: [
|
|
2016
|
+
" ",
|
|
2017
|
+
/* @__PURE__ */ B("img", {
|
|
2018
|
+
src: t?.logo,
|
|
2019
|
+
alt: t?.name,
|
|
2020
|
+
loading: "lazy",
|
|
2021
|
+
className: "padorix:size-10 padorix:object-contain"
|
|
2022
|
+
}),
|
|
2023
|
+
" "
|
|
2024
|
+
]
|
|
2025
|
+
})
|
|
2026
|
+
}), /* @__PURE__ */ B(R, {
|
|
2027
|
+
className: "padorix:text-right padorix:w-full",
|
|
2028
|
+
children: /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("div", {
|
|
2029
|
+
className: "padorix:font-medium padorix:text-right",
|
|
2030
|
+
children: t?.name
|
|
2031
|
+
}), /* @__PURE__ */ B("div", {
|
|
2032
|
+
className: "padorix:text-sm padorix:text-right padorix:text-slate-500",
|
|
2033
|
+
children: t?.widget?.department
|
|
2034
|
+
})] })
|
|
2035
|
+
})]
|
|
2036
|
+
}),
|
|
2037
|
+
/* @__PURE__ */ V("form", {
|
|
2038
|
+
onSubmit: _.onSubmit(x),
|
|
2039
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2040
|
+
className: "padorix:h-[35dvh] padorix:flex padorix:items-center padorix:justify-center",
|
|
2041
|
+
children: /* @__PURE__ */ V("div", {
|
|
2042
|
+
className: "padorix:w-full",
|
|
2043
|
+
children: [
|
|
2044
|
+
c === 1 && /* @__PURE__ */ V(z, { children: [
|
|
2045
|
+
/* @__PURE__ */ B(ht, { current: 1 }),
|
|
2046
|
+
/* @__PURE__ */ B("div", {
|
|
2047
|
+
className: "padorix:font-bold padorix:mb-2",
|
|
2048
|
+
children: "What is your enquiry about?"
|
|
2049
|
+
}),
|
|
2050
|
+
/* @__PURE__ */ B("div", {
|
|
2051
|
+
className: "padorix:flex padorix:flex-wrap padorix:items-center padorix:gap-2",
|
|
2052
|
+
children: n?.map((e, n) => /* @__PURE__ */ B("div", {
|
|
2053
|
+
onClick: () => y(e.id),
|
|
2054
|
+
style: { background: _.values.tagId === e.id ? String(t?.widget?.colorScheme) : "#f1f5f9" },
|
|
2055
|
+
className: `padorix:text-xs padorix:py-1.5 padorix:px-2 padorix:rounded-md ${_.values.tagId === e.id ? "padorix:text-white" : "padorix:bg-slate-100 padorix:border padorix:border-gray-200"} padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all`,
|
|
2056
|
+
children: e.tag
|
|
2057
|
+
}, n))
|
|
2058
|
+
}),
|
|
2059
|
+
_.errors.tagId ? /* @__PURE__ */ B("div", {
|
|
2060
|
+
className: "padorix:text-red-400 padorix:text-sm padorix:mt-2",
|
|
2061
|
+
children: _.errors.tagId?.toString()
|
|
2062
|
+
}) : ""
|
|
2063
|
+
] }),
|
|
2064
|
+
c === 2 && /* @__PURE__ */ V(z, { children: [
|
|
2065
|
+
/* @__PURE__ */ B(ht, { current: 2 }),
|
|
2066
|
+
/* @__PURE__ */ B(gt, {
|
|
2067
|
+
screen: c,
|
|
2068
|
+
tagId: _.values.tagId,
|
|
2069
|
+
tags: n
|
|
2070
|
+
}),
|
|
2071
|
+
/* @__PURE__ */ B($, {
|
|
2072
|
+
content: "Full name",
|
|
2073
|
+
placeholder: "Enter your full name",
|
|
2074
|
+
error: _.errors.fullName?.toString() || "",
|
|
2075
|
+
..._.getInputProps("fullName")
|
|
2076
|
+
}, _.key("fullName")),
|
|
2077
|
+
/* @__PURE__ */ B($, {
|
|
2078
|
+
content: "Email address",
|
|
2079
|
+
placeholder: "name@example.com",
|
|
2080
|
+
error: _.errors.email?.toString() || "",
|
|
2081
|
+
..._.getInputProps("email")
|
|
2082
|
+
}, _.key("email"))
|
|
2083
|
+
] }),
|
|
2084
|
+
c === 3 && /* @__PURE__ */ V(z, { children: [
|
|
2085
|
+
/* @__PURE__ */ B(ht, { current: 3 }),
|
|
2086
|
+
/* @__PURE__ */ B(gt, {
|
|
2087
|
+
screen: c,
|
|
2088
|
+
tagId: _.values.tagId,
|
|
2089
|
+
tags: n,
|
|
2090
|
+
name: _.values.fullName,
|
|
2091
|
+
email: _.values.email
|
|
2092
|
+
}),
|
|
2093
|
+
/* @__PURE__ */ B($, {
|
|
2094
|
+
content: "Message",
|
|
2095
|
+
formtype: "textarea",
|
|
2096
|
+
error: _.errors.message?.toString() || "",
|
|
2097
|
+
..._.getInputProps("message")
|
|
2098
|
+
}, _.key("message"))
|
|
2099
|
+
] })
|
|
2100
|
+
]
|
|
2101
|
+
})
|
|
2102
|
+
}), /* @__PURE__ */ V("div", {
|
|
2103
|
+
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2104
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
2105
|
+
type: "button",
|
|
2106
|
+
onClick: v,
|
|
2107
|
+
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2108
|
+
children: "Back"
|
|
2109
|
+
}) }), /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
2110
|
+
disabled: i,
|
|
2111
|
+
style: { background: i ? "#62748e" : String(t?.widget?.colorScheme) },
|
|
2112
|
+
className: `${i ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
2113
|
+
children: c < 3 ? "Next" : "Start Chat"
|
|
2114
|
+
}) })]
|
|
2115
|
+
})]
|
|
2116
|
+
}),
|
|
2117
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ V("div", {
|
|
2118
|
+
className: "padorix:mt-20 padorix:grayscale-100 padorix:text-sm padorix:flex padorix:items-center padorix:justify-center padorix:text-zinc-500 padorix:gap-2",
|
|
2119
|
+
children: [
|
|
2120
|
+
" ",
|
|
2121
|
+
/* @__PURE__ */ B("img", {
|
|
2122
|
+
src: ft,
|
|
2123
|
+
alt: "padorix",
|
|
2124
|
+
loading: "lazy",
|
|
2125
|
+
className: "padorix:size-6 padorix:inline"
|
|
2126
|
+
}),
|
|
2127
|
+
" Powered by Padorix "
|
|
2128
|
+
]
|
|
2129
|
+
}) })
|
|
2130
|
+
]
|
|
2131
|
+
})]
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
function ht(e) {
|
|
2135
|
+
let { tags: t, workspace: n } = k((e) => e.data), r = t.length > 0 ? 3 : 2, i = t.length > 0 ? e.current : e.current - 1;
|
|
2136
|
+
return /* @__PURE__ */ V("div", {
|
|
2137
|
+
className: "padorix:text-right padorix:text-sm padorix:text-gray-500 padorix:italic padorix:font-semibold",
|
|
2138
|
+
children: [
|
|
2139
|
+
"Step ",
|
|
2140
|
+
/* @__PURE__ */ B("span", {
|
|
2141
|
+
style: { color: String(n?.widget?.colorScheme) },
|
|
2142
|
+
children: i
|
|
2143
|
+
}),
|
|
2144
|
+
" of ",
|
|
2145
|
+
r
|
|
2146
|
+
]
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2149
|
+
function gt(e) {
|
|
2150
|
+
return /* @__PURE__ */ V("div", {
|
|
2151
|
+
className: "padorix:my-2",
|
|
2152
|
+
children: [e.tagId && e.screen > 1 && /* @__PURE__ */ V("div", {
|
|
2153
|
+
className: "padorix:text-xs",
|
|
2154
|
+
children: [
|
|
2155
|
+
" ",
|
|
2156
|
+
/* @__PURE__ */ B("span", {
|
|
2157
|
+
className: "padorix:text-slate-500 padorix:mr-1",
|
|
2158
|
+
children: "Enquiry: "
|
|
2159
|
+
}),
|
|
2160
|
+
" ",
|
|
2161
|
+
e.tags?.find((t) => t.id === e.tagId)?.tag
|
|
2162
|
+
]
|
|
2163
|
+
}), e.screen > 2 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V("div", {
|
|
2164
|
+
className: "padorix:text-xs",
|
|
2165
|
+
children: [
|
|
2166
|
+
" ",
|
|
2167
|
+
/* @__PURE__ */ B("span", {
|
|
2168
|
+
className: "padorix:text-slate-500 padorix:mr-3",
|
|
2169
|
+
children: "Name: "
|
|
2170
|
+
}),
|
|
2171
|
+
" ",
|
|
2172
|
+
e.name
|
|
2173
|
+
]
|
|
2174
|
+
}), /* @__PURE__ */ V("div", {
|
|
2175
|
+
className: "padorix:text-xs",
|
|
2176
|
+
children: [
|
|
2177
|
+
" ",
|
|
2178
|
+
/* @__PURE__ */ B("span", {
|
|
2179
|
+
className: "padorix:text-slate-500 padorix:mr-4",
|
|
2180
|
+
children: "Email: "
|
|
2181
|
+
}),
|
|
2182
|
+
" ",
|
|
2183
|
+
e.email
|
|
2184
|
+
]
|
|
2185
|
+
})] })]
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
//#endregion
|
|
2189
|
+
//#region lib/chats/chatScreen/not-available-banner.tsx
|
|
2190
|
+
function _t() {
|
|
2191
|
+
return /* @__PURE__ */ B("div", {
|
|
2192
|
+
className: "padorix:p-2 padorix:text-yellow-800 padorix:bg-yellow-100/50 padorix:border padorix:border-yellow-200 padorix:rounded-md padorix:text-center padorix:text-[0.75rem] padorix:whitespace-pre-line",
|
|
2193
|
+
children: "We're currently unavailable. Leave us a message \n and we'll get back to you via email."
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2196
|
+
//#endregion
|
|
2197
|
+
//#region lib/chats/chatScreen/chat-faqs.tsx
|
|
2198
|
+
function vt(e) {
|
|
2199
|
+
let { faqs: t, workspace: n } = k((e) => e.data), [r, i] = A.useState(), a = e.isOpen ? "Talk to an agent" : "Send us a message";
|
|
2200
|
+
function o(e) {
|
|
2201
|
+
i(e);
|
|
2202
|
+
}
|
|
2203
|
+
return r?.question ? /* @__PURE__ */ V(z, { children: [
|
|
2204
|
+
/* @__PURE__ */ V("div", {
|
|
2205
|
+
style: { background: String(n?.widget?.colorScheme) },
|
|
2206
|
+
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2207
|
+
children: [
|
|
2208
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2209
|
+
className: "padorix:size-8",
|
|
2210
|
+
children: /* @__PURE__ */ V("div", {
|
|
2211
|
+
style: { color: String(n?.widget?.colorScheme) },
|
|
2212
|
+
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2213
|
+
children: [
|
|
2214
|
+
" ",
|
|
2215
|
+
/* @__PURE__ */ B(He, { className: "padorix:size-7" }),
|
|
2216
|
+
" "
|
|
2217
|
+
]
|
|
2218
|
+
})
|
|
2219
|
+
}) }),
|
|
2220
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2221
|
+
className: "",
|
|
2222
|
+
children: "Our Frequently asked questions"
|
|
2223
|
+
}) }),
|
|
2224
|
+
/* @__PURE__ */ B("div", {
|
|
2225
|
+
className: "padorix:size-8 padorix:ml-auto",
|
|
2226
|
+
children: /* @__PURE__ */ B("div", {
|
|
2227
|
+
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2228
|
+
onClick: e.close,
|
|
2229
|
+
children: /* @__PURE__ */ B(F, {})
|
|
2230
|
+
})
|
|
2231
|
+
})
|
|
2232
|
+
]
|
|
2233
|
+
}),
|
|
2234
|
+
/* @__PURE__ */ V("div", {
|
|
2235
|
+
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2236
|
+
children: [
|
|
2237
|
+
!e.isOpen && /* @__PURE__ */ B(_t, {}),
|
|
2238
|
+
/* @__PURE__ */ B("div", {
|
|
2239
|
+
className: "padorix:font-bold padorix:text-xl padorix:mb-3",
|
|
2240
|
+
children: r.question
|
|
2241
|
+
}),
|
|
2242
|
+
/* @__PURE__ */ B("div", {
|
|
2243
|
+
className: "padorix:whitespace-pre-line padorix:pl-2 padorix:text-gray-600 padorix:text-sm",
|
|
2244
|
+
children: r.answer
|
|
2245
|
+
})
|
|
2246
|
+
]
|
|
2247
|
+
}),
|
|
2248
|
+
/* @__PURE__ */ V("div", {
|
|
2249
|
+
className: "padorix:flex padorix:items-center padorix:justify-end padorix:p-2 padorix:gap-5",
|
|
2250
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
2251
|
+
type: "button",
|
|
2252
|
+
onClick: () => o(void 0),
|
|
2253
|
+
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2254
|
+
children: "Back"
|
|
2255
|
+
}) }), /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
2256
|
+
onClick: () => e.talkToTeam(!1),
|
|
2257
|
+
style: { background: String(n?.widget?.colorScheme) },
|
|
2258
|
+
className: "padorix:cursor-pointer padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2259
|
+
children: a
|
|
2260
|
+
}) })]
|
|
2261
|
+
})
|
|
2262
|
+
] }) : /* @__PURE__ */ V(z, { children: [
|
|
2263
|
+
/* @__PURE__ */ V("div", {
|
|
2264
|
+
style: { background: String(n?.widget?.colorScheme) },
|
|
2265
|
+
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2266
|
+
children: [
|
|
2267
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2268
|
+
className: "padorix:size-8",
|
|
2269
|
+
children: /* @__PURE__ */ V("div", {
|
|
2270
|
+
style: { color: String(n?.widget?.colorScheme) },
|
|
2271
|
+
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2272
|
+
children: [
|
|
2273
|
+
" ",
|
|
2274
|
+
/* @__PURE__ */ B(He, { className: "padorix:size-7" }),
|
|
2275
|
+
" "
|
|
2276
|
+
]
|
|
2277
|
+
})
|
|
2278
|
+
}) }),
|
|
2279
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2280
|
+
className: "",
|
|
2281
|
+
children: "Our Frequently asked questions"
|
|
2282
|
+
}) }),
|
|
2283
|
+
/* @__PURE__ */ B("div", {
|
|
2284
|
+
className: "padorix:size-8 padorix:ml-auto",
|
|
2285
|
+
children: /* @__PURE__ */ B("div", {
|
|
2286
|
+
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2287
|
+
onClick: e.close,
|
|
2288
|
+
children: /* @__PURE__ */ B(F, {})
|
|
2289
|
+
})
|
|
2290
|
+
})
|
|
2291
|
+
]
|
|
2292
|
+
}),
|
|
2293
|
+
/* @__PURE__ */ V("div", {
|
|
2294
|
+
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2295
|
+
children: [!e.isOpen && /* @__PURE__ */ B(_t, {}), t.map((e, t) => /* @__PURE__ */ V("div", {
|
|
2296
|
+
onClick: () => o(e),
|
|
2297
|
+
className: "padorix:p-2.5 padorix:flex padorix:items-center padorix:gap-2 padorix:transition-all padorix:cursor-pointer padorix:active:scale-95 padorix:border-b padorix:border-gray-200 padorix:last:border-0",
|
|
2298
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2299
|
+
className: "padorix:w-full",
|
|
2300
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2301
|
+
className: "padorix:font-semibold",
|
|
2302
|
+
children: e.question
|
|
2303
|
+
}), /* @__PURE__ */ V("div", {
|
|
2304
|
+
className: "padorix:text-sm padorix:text-gray-500",
|
|
2305
|
+
children: [e.answer?.slice(0, 50), "..."]
|
|
2306
|
+
})]
|
|
2307
|
+
}), /* @__PURE__ */ B(ke, {})]
|
|
2308
|
+
}, t))]
|
|
2309
|
+
}),
|
|
2310
|
+
/* @__PURE__ */ B("div", {
|
|
2311
|
+
className: "padorix:size-fit padorix:ml-auto padorix:p-2",
|
|
2312
|
+
children: /* @__PURE__ */ B("button", {
|
|
2313
|
+
onClick: () => e.talkToTeam(!1),
|
|
2314
|
+
style: { background: String(n?.widget?.colorScheme) },
|
|
2315
|
+
className: "padorix:cursor-pointer padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2316
|
+
children: a
|
|
2317
|
+
})
|
|
2318
|
+
})
|
|
2319
|
+
] });
|
|
2320
|
+
}
|
|
2321
|
+
//#endregion
|
|
2322
|
+
//#region lib/chats/chatScreen/unavailable-form.tsx
|
|
2323
|
+
function yt(e) {
|
|
2324
|
+
let { workspace: t } = k((e) => e.data), [n, r] = A.useState(!1), [i, a] = A.useState({
|
|
2325
|
+
status: "success",
|
|
2326
|
+
message: ""
|
|
2327
|
+
}), o = K({
|
|
2328
|
+
mode: "uncontrolled",
|
|
2329
|
+
initialValues: {
|
|
2330
|
+
workspaceId: t?.id ?? "",
|
|
2331
|
+
name: "",
|
|
2332
|
+
email: "",
|
|
2333
|
+
message: ""
|
|
2334
|
+
},
|
|
2335
|
+
validate: {
|
|
2336
|
+
name: (e) => e ? e.length <= 2 ? "Your name is expected to be more than 2 characters" : null : "Full name is required",
|
|
2337
|
+
email: (e) => e ? pt(e) ? null : "Please enter a valid email address" : "Email address is required",
|
|
2338
|
+
message: (e) => e ? null : "Enquiry content is required"
|
|
2339
|
+
}
|
|
2340
|
+
});
|
|
2341
|
+
async function s(e) {
|
|
2342
|
+
try {
|
|
2343
|
+
r(!0), a({
|
|
2344
|
+
status: "success",
|
|
2345
|
+
message: (await c({
|
|
2346
|
+
endpoint: S.inquiries.inquiries,
|
|
2347
|
+
method: "POST",
|
|
2348
|
+
data: e
|
|
2349
|
+
})).message
|
|
2350
|
+
});
|
|
2351
|
+
} catch {
|
|
2352
|
+
a({
|
|
2353
|
+
status: "error",
|
|
2354
|
+
message: "There was an error sending your message."
|
|
2355
|
+
});
|
|
2356
|
+
} finally {
|
|
2357
|
+
o.reset(), r(!1), setTimeout(() => a({
|
|
2358
|
+
status: "success",
|
|
2359
|
+
message: ""
|
|
2360
|
+
}), 3e3);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
return /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V("div", {
|
|
2364
|
+
style: { background: String(t?.widget?.colorScheme) },
|
|
2365
|
+
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2366
|
+
children: [
|
|
2367
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2368
|
+
className: "padorix:size-8",
|
|
2369
|
+
children: /* @__PURE__ */ V("div", {
|
|
2370
|
+
style: { color: String(t?.widget?.colorScheme) },
|
|
2371
|
+
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2372
|
+
children: [
|
|
2373
|
+
" ",
|
|
2374
|
+
/* @__PURE__ */ B(Ue, { className: "padorix:size-5" }),
|
|
2375
|
+
" "
|
|
2376
|
+
]
|
|
2377
|
+
})
|
|
2378
|
+
}) }),
|
|
2379
|
+
/* @__PURE__ */ V("div", {
|
|
2380
|
+
className: "",
|
|
2381
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2382
|
+
className: "",
|
|
2383
|
+
children: "Send us a message"
|
|
2384
|
+
}) }), /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2385
|
+
className: "padorix:text-xs",
|
|
2386
|
+
children: "Leave us a message and we'll reply via email."
|
|
2387
|
+
}) })]
|
|
2388
|
+
}),
|
|
2389
|
+
/* @__PURE__ */ B("div", {
|
|
2390
|
+
className: "padorix:size-8 padorix:ml-auto",
|
|
2391
|
+
children: /* @__PURE__ */ B("div", {
|
|
2392
|
+
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2393
|
+
onClick: e.close,
|
|
2394
|
+
children: /* @__PURE__ */ B(F, {})
|
|
2395
|
+
})
|
|
2396
|
+
})
|
|
2397
|
+
]
|
|
2398
|
+
}), /* @__PURE__ */ B("div", {
|
|
2399
|
+
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2400
|
+
children: /* @__PURE__ */ V("form", {
|
|
2401
|
+
onSubmit: o.onSubmit(s),
|
|
2402
|
+
children: [
|
|
2403
|
+
/* @__PURE__ */ B($, {
|
|
2404
|
+
content: "Full name",
|
|
2405
|
+
placeholder: "Enter your full name",
|
|
2406
|
+
error: o.errors.name?.toString() || "",
|
|
2407
|
+
...o.getInputProps("name")
|
|
2408
|
+
}, o.key("name")),
|
|
2409
|
+
/* @__PURE__ */ B($, {
|
|
2410
|
+
content: "Email address",
|
|
2411
|
+
placeholder: "name@example.com",
|
|
2412
|
+
error: o.errors.email?.toString() || "",
|
|
2413
|
+
...o.getInputProps("email")
|
|
2414
|
+
}, o.key("email")),
|
|
2415
|
+
/* @__PURE__ */ B($, {
|
|
2416
|
+
content: "Message",
|
|
2417
|
+
formtype: "textarea",
|
|
2418
|
+
error: o.errors.message?.toString() || "",
|
|
2419
|
+
...o.getInputProps("message")
|
|
2420
|
+
}, o.key("message")),
|
|
2421
|
+
i.message && /* @__PURE__ */ B("div", {
|
|
2422
|
+
className: `padorix:mt-4 padorix:text-sm padorix:p-2 padorix:rounded-md ${i.status === "success" ? "padorix:bg-green-100 padorix:text-green-800" : "padorix:bg-red-100 padorix:text-red-800"}`,
|
|
2423
|
+
children: i.message
|
|
2424
|
+
}),
|
|
2425
|
+
/* @__PURE__ */ V("div", {
|
|
2426
|
+
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2427
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
2428
|
+
type: "button",
|
|
2429
|
+
onClick: e.backAction,
|
|
2430
|
+
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2431
|
+
children: "Back"
|
|
2432
|
+
}) }), /* @__PURE__ */ B(R, {
|
|
2433
|
+
className: "padorix:w-full",
|
|
2434
|
+
children: /* @__PURE__ */ B("button", {
|
|
2435
|
+
disabled: n,
|
|
2436
|
+
style: { background: n ? "#62748e" : String(t?.widget?.colorScheme) },
|
|
2437
|
+
className: `${n ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:w-full padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
2438
|
+
children: "Submit message"
|
|
2439
|
+
})
|
|
2440
|
+
})]
|
|
2441
|
+
})
|
|
2442
|
+
]
|
|
2443
|
+
})
|
|
2444
|
+
})] });
|
|
2445
|
+
}
|
|
2446
|
+
//#endregion
|
|
2447
|
+
//#region lib/chats/chatScreen/chat-lobby.tsx
|
|
2448
|
+
function bt(e) {
|
|
2449
|
+
let { sender: t, faqs: n, faqsLoaded: r, workspace: i } = k((e) => e.data), a = JSON.parse(localStorage.getItem("pdx-sess") || "null"), [o, s] = A.useState(!0), [c, l] = A.useState(!1), u = v(i?.widget?.notifications?.showFaqBeforeConversation), d = x(i?.widget), f = !!(e.openOptions && Object.values(e.openOptions).some(Boolean));
|
|
2450
|
+
function p(e) {
|
|
2451
|
+
s(e), l(!d);
|
|
2452
|
+
}
|
|
2453
|
+
function m() {
|
|
2454
|
+
s(!0), l(!1);
|
|
2455
|
+
}
|
|
2456
|
+
function h() {
|
|
2457
|
+
s(!0);
|
|
2458
|
+
}
|
|
2459
|
+
if (t?.conversationId && a?.conversationId) return /* @__PURE__ */ B(ut, { ...e });
|
|
2460
|
+
if (!f && o && u && !r) return /* @__PURE__ */ B("div", { className: e.styles.container });
|
|
2461
|
+
if (!f && o && u && n.length > 0) return /* @__PURE__ */ B("div", {
|
|
2462
|
+
className: e.styles.container,
|
|
2463
|
+
children: /* @__PURE__ */ B(vt, {
|
|
2464
|
+
talkToTeam: p,
|
|
2465
|
+
isOpen: d,
|
|
2466
|
+
...e
|
|
2467
|
+
})
|
|
2468
|
+
});
|
|
2469
|
+
if (c) return /* @__PURE__ */ B("div", {
|
|
2470
|
+
className: e.styles.container,
|
|
2471
|
+
children: /* @__PURE__ */ B(yt, {
|
|
2472
|
+
close: e.close,
|
|
2473
|
+
isOpen: d,
|
|
2474
|
+
backAction: m
|
|
2475
|
+
})
|
|
2476
|
+
});
|
|
2477
|
+
if (!c) return /* @__PURE__ */ B(xt, {
|
|
2478
|
+
openFaq: h,
|
|
2479
|
+
...e
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
function xt({ openFaq: e, ...t }) {
|
|
2483
|
+
let { workspace: n, faqs: r } = k((e) => e.data), [i, a] = A.useState(t.openOptions ? 2 : 1), o = x(n?.widget), s = v(n?.widget?.notifications?.showFaqBeforeConversation) && r.length > 0, c = A.useMemo(() => n?.logo, [n]);
|
|
2484
|
+
A.useEffect(() => {
|
|
2485
|
+
a(t.openOptions ? 2 : 1);
|
|
2486
|
+
}, [t.openRequestId]);
|
|
2487
|
+
function l(e) {
|
|
2488
|
+
a(e);
|
|
2489
|
+
}
|
|
2490
|
+
if (i === 2) return /* @__PURE__ */ B(mt, {
|
|
2491
|
+
close: t.close,
|
|
2492
|
+
styles: t.styles,
|
|
2493
|
+
changeScreen: l,
|
|
2494
|
+
workspaceId: t.workspaceId,
|
|
2495
|
+
openOptions: t.openOptions,
|
|
2496
|
+
openRequestId: t.openRequestId,
|
|
2497
|
+
autoSubmitRequestId: t.autoSubmitRequestId
|
|
2498
|
+
});
|
|
2499
|
+
if (i === 1) return /* @__PURE__ */ V("div", {
|
|
2500
|
+
className: t.styles.container,
|
|
2501
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2502
|
+
style: {
|
|
2503
|
+
background: String(n?.widget?.colorScheme),
|
|
2504
|
+
color: n?.widget?.textColor || "#ffffff"
|
|
2505
|
+
},
|
|
2506
|
+
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2507
|
+
children: [
|
|
2508
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2509
|
+
className: "padorix:size-8",
|
|
2510
|
+
children: /* @__PURE__ */ V("div", {
|
|
2511
|
+
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2512
|
+
children: [
|
|
2513
|
+
" ",
|
|
2514
|
+
/* @__PURE__ */ B("img", {
|
|
2515
|
+
src: dt,
|
|
2516
|
+
alt: n?.name,
|
|
2517
|
+
loading: "lazy",
|
|
2518
|
+
className: "padorix:size-6"
|
|
2519
|
+
}),
|
|
2520
|
+
" "
|
|
2521
|
+
]
|
|
2522
|
+
})
|
|
2523
|
+
}) }),
|
|
2524
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2525
|
+
className: "",
|
|
2526
|
+
children: n?.widget?.widgetMessage
|
|
2527
|
+
}) }),
|
|
2528
|
+
/* @__PURE__ */ B("div", {
|
|
2529
|
+
className: "padorix:size-8 padorix:ml-auto",
|
|
2530
|
+
children: /* @__PURE__ */ B("div", {
|
|
2531
|
+
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2532
|
+
onClick: t.close,
|
|
2533
|
+
children: /* @__PURE__ */ B(F, {})
|
|
2534
|
+
})
|
|
2535
|
+
})
|
|
2536
|
+
]
|
|
2537
|
+
}), /* @__PURE__ */ B("div", {
|
|
2538
|
+
className: "padorix:p-4 padorix:mt-5",
|
|
2539
|
+
children: /* @__PURE__ */ V("div", {
|
|
2540
|
+
className: "padorix:flex padorix:flex-col padorix:items-center padorix:text-center padorix:h-full padorix:justify-center",
|
|
2541
|
+
children: [
|
|
2542
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ V("div", {
|
|
2543
|
+
className: "padorix:mb-3",
|
|
2544
|
+
children: [
|
|
2545
|
+
" ",
|
|
2546
|
+
/* @__PURE__ */ B("img", {
|
|
2547
|
+
src: c,
|
|
2548
|
+
alt: n?.name,
|
|
2549
|
+
loading: "lazy",
|
|
2550
|
+
className: "padorix:size-20 padorix:object-contain"
|
|
2551
|
+
}),
|
|
2552
|
+
" "
|
|
2553
|
+
]
|
|
2554
|
+
}) }),
|
|
2555
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2556
|
+
className: "padorix:font-semibold",
|
|
2557
|
+
children: n?.widget?.department
|
|
2558
|
+
}) }),
|
|
2559
|
+
/* @__PURE__ */ V(R, { children: [/* @__PURE__ */ B("div", {
|
|
2560
|
+
className: "padorix:mt-5",
|
|
2561
|
+
children: n?.widget?.welcomeMessage || "Ask us anything - we will get back to you here or by email."
|
|
2562
|
+
}), !o && /* @__PURE__ */ B(_t, {})] }),
|
|
2563
|
+
/* @__PURE__ */ V("div", {
|
|
2564
|
+
className: "padorix:mt-10",
|
|
2565
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("button", {
|
|
2566
|
+
onClick: () => o && l(2),
|
|
2567
|
+
style: { background: String(n?.widget?.colorScheme) },
|
|
2568
|
+
disabled: !o,
|
|
2569
|
+
className: `padorix:text-white padorix:py-3 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:transition-all ${o ? "padorix:cursor-pointer padorix:hover:-translate-y-2 padorix:hover:shadow-md" : "padorix:cursor-not-allowed padorix:opacity-50"}`,
|
|
2570
|
+
children: "Start new conversation"
|
|
2571
|
+
}) }), s && /* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2572
|
+
onClick: () => e?.(),
|
|
2573
|
+
className: "padorix:underline padorix:mt-5 padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2574
|
+
children: "Frequently asked questions?"
|
|
2575
|
+
}) })]
|
|
2576
|
+
}),
|
|
2577
|
+
v(n?.widget?.notifications?.displaySourceLogoOnWidget) && /* @__PURE__ */ B(R, { children: /* @__PURE__ */ V("div", {
|
|
2578
|
+
className: "padorix:mt-10 padorix:grayscale-100 padorix:text-sm padorix:flex padorix:items-center padorix:justify-center padorix:text-zinc-500 padorix:gap-2",
|
|
2579
|
+
children: [
|
|
2580
|
+
" ",
|
|
2581
|
+
/* @__PURE__ */ B("img", {
|
|
2582
|
+
src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABPCAMAAAAjvDDpAAADAFBMVEVMaXEAQf8AVvsAVv8CVaoAV/0AVvwAVf8AAP8Af/8AVv4AVvwIf38AVvwAV/wAXuAA//8AP79jAAAAV/0AV/4AV/8AV/0AVv0EVe1vLQgOTcIRRaYEU+UAWP8AWP4OUMIYVtUAV/wQS74AAHYGU98RSrIAVvpUMgADWPcIUNgATOkqOT0AVv0NUcIAW/8AVfwXSZwQTLsAH1UAAP8IUNMAV/sJUNYCVvYFVu8dNXMIU98CWPcAWP8EVe8NTsgNR7wIUt4aSJ8OSrkSR6sDVvIEV/MPSLQDVfQFUeICVvQOTLoFVOkDVfIPT8UIUNoDVvIWSrcNTsQFVOsURZwIUd4JU9sEU+cFVOkEVewLUdMOTr4LT8wGU+MFVegAWP8FVeoFVOsQUL4GU+ICWPcIUt4DV/IDV/UIU98HUuMEV/ADVvQFVeoGT9QGUdwHUdsDVfADVvUFU+oFVeoIVOQDVfALUtcJT9MKTtIOUssDV/IQUsciN3AFVOoJUdUHU98MUNAEV+8EVe4DV/QKUdUPTLkFUuUGUNsSRaIIU98ZNXQFVeoDVfMDVe4RU8EHUuACVfMGVOUPUsgFVesFUuUGVucOUsoFVOsQUcYPT8QQT8ASU8IRUsoGUuUDVfEEU+gGVOYDU/AGVOgFUuQOTL4LVdsFUeAOS7gAWP0EVvATVMkTVcQNTsgSUMAIUdwOT74CWPgE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PDwcKbmQx8SFkZOrDGvH4AlmYJOp0tgrY7KqdDu7u6fFpqxrC4Wf1Xq9XiclDi5V90h924KDpTxkxNzhAxOyMI3frGH6O/OfjMgtPhj5YbNasUD4aWhPyXSxESOrbLoiAO73Waz63Qpam+4Pw2h8Mq3wnqYJ+hcBYfx1XbNf0J03yVPTdj2VMvoWd3vyCqGQfDtOBl1bwxw2E4sJOwiYJgIzcipd1r8rJIGTIhbBonnxXNiJqHL/aMeqsWECRcfOvBo31CIfOWHiVdbtGjRs+fU0zh+7nvdhCHu15OgaYsaTPu8071bwDuf/aQ9C5RzJcdwbdG7ItvWID6+Vljcvx7DzwqdMTQmuV4+BM1hpWQukv+Mwytm/z2Dg9FqQ0lOtCF10Mc/gCtD7of+Z0X0RRTanSbbXGWj8eGpt4N3m1Sb5F2EAwfxsdL0NhiiiwMhqDfDDPS6iDFJ7y6lyHvQ/oBdwb3yxHAse4poiQqd61IMJvvJL4J8LWyAb/Zi5Ivl1Oz1YNDCqLzgRgitXSSnpr+XDVoN7UKhy7ag2295kXTF4SgTajkI+6prkB2Ewt7ausfrA4Bth4Jdo1p4ZhlKE0NIRDxu5uBLd2kyeDuYUHdFmP7MwZhgrx/R9q8LLxy4cOHCK6NGHcpt5Lrzt6HXkhiCKDwEh/9u/wHzq1jxN2ehBgz8P+K/qzfIpxuSbGgAAAAASUVORK5CYII=",
|
|
2583
|
+
alt: "padorix",
|
|
2584
|
+
loading: "lazy",
|
|
2585
|
+
className: "padorix:size-8 padorix:object-contain padorix:inline"
|
|
2586
|
+
}),
|
|
2587
|
+
" Powered by Padorix "
|
|
2588
|
+
]
|
|
2589
|
+
}) })
|
|
2590
|
+
]
|
|
2591
|
+
})
|
|
2592
|
+
})]
|
|
2593
|
+
});
|
|
2594
|
+
}
|
|
2595
|
+
//#endregion
|
|
2596
|
+
//#region lib/chats/chatScreen/styles.ts
|
|
2597
|
+
var St = "", Ct = {
|
|
2598
|
+
visitor: {
|
|
2599
|
+
container: "padorix:z-50 padorix:fixed padorix:bottom-0 padorix:left-0 padorix:right-0 padorix:top-0 padorix:bg-[#fff] padorix:w-screen padorix:h-screen padorix:max-w-full padorix:pb-16 padorix:max-md:h-(--padorix-vvh,100dvh) padorix:max-md:translate-y-(--padorix-vvt,0px) padorix:md:top-auto padorix:md:left-auto padorix:md:bottom-5 padorix:md:right-2 padorix:md:h-[93dvh] padorix:md:w-[400px] padorix:md:max-w-[640px] padorix:md:rounded-xl padorix:md:border padorix:border-gray-200 padorix:md:shadow-lg padorix:overflow-y-hidden padorix:flex padorix:flex-col",
|
|
2600
|
+
backdrop: "padorix:hidden padorix:max-md:block padorix:fixed padorix:top-0 padorix:left-0 padorix:right-0 padorix:-bottom-[100lvh] padorix:z-49 padorix:bg-white padorix:touch-none",
|
|
2601
|
+
height: "80dvh",
|
|
2602
|
+
chatContainerPadding: "padorix:pt-3 padorix:flex-1 padorix:min-h-0 padorix:pb-10 padorix:overflow-y-auto padorix:overflow-x-hidden padorix-scrolls padorix:relative",
|
|
2603
|
+
header: "padorix:relative padorix:shrink-0 padorix:w-full padorix:bg-white padorix:z-10 padorix:border-x padorix:border-t padorix:border-gray-200 padorix:md:rounded-t-lg",
|
|
2604
|
+
emojiContainer: "padorix:fixed padorix:bottom-18 padorix:ml-4 padorix:rounded-2xl padorix:h-[23.8rem] padorix:z-10 padorix:overflow-hidden padorix:right-auto padorix:bg-red-100 padorix:md:max-w-160 padorix:md:right-3",
|
|
2605
|
+
formContainer: "padorix:border-t padorix:border-gray-200 padorix:fixed padorix:bg-white padorix:z-10 padorix:right-0 padorix:bottom-5 padorix:w-dvw padorix:max-w-full padorix:text-sm padorix:px-4 padorix:py-2 padorix:md:max-w-160 padorix:md:w-100 padorix:md:right-2 padorix:md:rounded-b-xl",
|
|
2606
|
+
imageUploadContainer: "padorix:fixed padorix:top-12 padorix:left-0 padorix:right-0 padorix:w-dvw padorix:h-full padorix:bg-white padorix:z-20 padorix:p-0 padorix:ml-auto padorix:space-y-3 padorix:md:top-21 padorix:md:right-2 padorix:md:w-100 padorix:md:max-w-160 padorix:md:h-[90dvh]",
|
|
2607
|
+
messagesContainer: "padorix:fixed padorix:bottom-5 padorix:right-0 padorix:w-full padorix:z-30 padorix:bg-white padorix:flex padorix:items-center padorix:justify-between padorix:px-3 padorix:py-4 padorix:md:right-2 padorix:md:w-100 padorix:md:max-w-160 padorix:border padorix:border-gray-200 padorix:rounded-b-xl",
|
|
2608
|
+
replyContainer: "padorix:relative padorix:w-full padorix:mb-1"
|
|
2609
|
+
},
|
|
2610
|
+
nonVisitor: {
|
|
2611
|
+
container: "padorix:bg-[#fff] padorix:relative!",
|
|
2612
|
+
height: "",
|
|
2613
|
+
chatContainerPadding: "padorix:pt-5 padorix:pb-20 padorix:overflow-y-auto padorix:overflow-x-hidden padorix-scrolls padorix:relative",
|
|
2614
|
+
header: "padorix:sticky padorix:top-0 padorix:left-0 padorix:w-full padorix:bg-white padorix:z-10 padorix:border-x padorix:border-t padorix:border-gray-200",
|
|
2615
|
+
emojiContainer: "padorix:absolute padorix:bottom-0 padorix:left-1 padorix:bg-white",
|
|
2616
|
+
formContainer: `padorix:border-t padorix:bg-white padorix:z-10 padorix:relative padorix:border-gray-200 padorix:bottom-0 padorix:left-0 padorix:w-full ${St} padorix:ml-auto padorix:right-0 padorix:md:text-sm padorix:px-1.5 padorix:pt-1.5 padorix:pb-4`,
|
|
2617
|
+
imageUploadContainer: `padorix:absolute padorix:top-0 padorix:left-0 padorix:size-full padorix:bg-white padorix:z-20 padorix:space-y-3 ${St} padorix:ml-auto padorix:right-0 padorix:h-[90dvh]`,
|
|
2618
|
+
messagesContainer: "padorix:absolute padorix:border padorix:border-gray-200 padorix:bottom-0 padorix:right-0 padorix:w-full padorix:z-30 padorix:bg-white padorix:flex padorix:items-center padorix:justify-between padorix:px-3 padorix:py-4 padorix:md:right-2",
|
|
2619
|
+
replyContainer: `padorix:relative padorix:w-full padorix:mb-1 ${St}`
|
|
2620
|
+
}
|
|
2621
|
+
}, wt = "data:image/svg+xml,%3csvg%20width='122'%20height='123'%20viewBox='0%200%20122%20123'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.3'%3e%3cpath%20d='M56.6201%2019.9004H65.3779C85.9345%2019.9004%20102.6%2036.5645%20102.6%2057.1211V65.8789C102.6%2086.4355%2085.9346%20103.101%2065.3779%20103.101H56.6201C36.0636%20103.101%2019.3994%2086.4355%2019.3994%2065.8789V57.1211C19.3995%2036.5646%2036.0636%2019.9005%2056.6201%2019.9004Z'%20stroke='%23667085'%20stroke-width='6.4'/%3e%3c/g%3e%3cg%20opacity='0.1'%3e%3cpath%20d='M40.6201%203.90039H81.3779C101.934%203.90039%20118.6%2020.5645%20118.6%2041.1211V81.8789C118.6%20102.436%20101.935%20119.101%2081.3779%20119.101H40.6201C20.0636%20119.101%203.39941%20102.435%203.39941%2081.8789V41.1211C3.39948%2020.5646%2020.0636%203.90048%2040.6201%203.90039Z'%20stroke='%23667085'%20stroke-width='6.4'/%3e%3c/g%3e%3cpath%20d='M51.6693%2070.8339L70.3359%2052.1673M53.0026%2040.1673V34.834M69.0026%2082.834V88.1673M39.6693%2053.5007H34.3359M82.3359%2069.5007H87.6693M42.1072%2042.6052L38.3359%2038.834M79.8981%2080.3958L83.6694%2084.1671M61.0027%2076.5854L55.3458%2082.2422C51.1803%2086.4078%2044.4265%2086.4078%2040.2609%2082.2422C36.0953%2078.0766%2036.0953%2071.3229%2040.2609%2067.1573L45.9178%2061.5004M76.0876%2061.5004L81.7445%2055.8436C85.9101%2051.678%2085.9101%2044.9242%2081.7445%2040.7586C77.5789%2036.593%2070.8251%2036.593%2066.6596%2040.7586L61.0027%2046.4155'%20stroke='%23667085'%20stroke-width='6.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", Tt = "data:image/svg+xml,%3csvg%20width='122'%20height='122'%20viewBox='0%200%20122%20122'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.3'%3e%3cpath%20d='M56.6209%2019.4002H65.3787C85.9353%2019.4002%20102.6%2036.0643%20102.6%2056.6209V65.3787C102.6%2085.9353%2085.9353%20102.6%2065.3787%20102.6H56.6209C36.0643%20102.6%2019.4002%2085.9353%2019.4002%2065.3787V56.6209C19.4003%2036.0644%2036.0644%2019.4003%2056.6209%2019.4002Z'%20stroke='%23D12C2C'%20stroke-width='6.4'/%3e%3c/g%3e%3cg%20opacity='0.1'%3e%3cpath%20d='M40.6209%203.40019H81.3787C101.935%203.40019%20118.6%2020.0643%20118.6%2040.6209V81.3787C118.6%20101.935%20101.935%20118.6%2081.3787%20118.6H40.6209C20.0643%20118.6%203.40019%20101.935%203.40019%2081.3787V40.6209C3.40026%2020.0644%2020.0644%203.40028%2040.6209%203.40019Z'%20stroke='%23FF7E7E'%20stroke-width='6.4'/%3e%3c/g%3e%3cpath%20d='M69%2053L53%2069M53%2053L69%2069M87.6667%2061C87.6667%2075.7276%2075.7276%2087.6667%2061%2087.6667C46.2724%2087.6667%2034.3333%2075.7276%2034.3333%2061C34.3333%2046.2724%2046.2724%2034.3333%2061%2034.3333C75.7276%2034.3333%2087.6667%2046.2724%2087.6667%2061Z'%20stroke='%23D12C2C'%20stroke-width='6.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
2622
|
+
//#endregion
|
|
2623
|
+
//#region lib/chats/online-check/online-check.tsx
|
|
2624
|
+
function Et(e) {
|
|
2625
|
+
let t = e.userType === w.VISITOR ? Ct.visitor : Ct.nonVisitor, n = e.userType === w.VISITOR, [r, i] = A.useState(navigator.onLine);
|
|
2626
|
+
return A.useEffect(() => {
|
|
2627
|
+
let e = () => {
|
|
2628
|
+
i(!0);
|
|
2629
|
+
}, t = () => {
|
|
2630
|
+
i(!1);
|
|
2631
|
+
};
|
|
2632
|
+
return window.addEventListener("online", e), window.addEventListener("offline", t), () => {
|
|
2633
|
+
window.removeEventListener("online", e), window.removeEventListener("offline", t);
|
|
2634
|
+
};
|
|
2635
|
+
}, []), r ? e.children : /* @__PURE__ */ V("div", {
|
|
2636
|
+
className: t.container,
|
|
2637
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2638
|
+
className: "padorix:px-3 padorix:py-5 padorix:bg-[#6c63ff] padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2639
|
+
children: [
|
|
2640
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2641
|
+
className: "padorix:size-8",
|
|
2642
|
+
children: /* @__PURE__ */ V("div", {
|
|
2643
|
+
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2644
|
+
children: [
|
|
2645
|
+
" ",
|
|
2646
|
+
/* @__PURE__ */ B("img", {
|
|
2647
|
+
src: Tt,
|
|
2648
|
+
alt: "Padorix",
|
|
2649
|
+
loading: "lazy",
|
|
2650
|
+
className: "padorix:size-6"
|
|
2651
|
+
}),
|
|
2652
|
+
" "
|
|
2653
|
+
]
|
|
2654
|
+
})
|
|
2655
|
+
}) }),
|
|
2656
|
+
/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("div", {
|
|
2657
|
+
className: "",
|
|
2658
|
+
children: "Internet connected lost, try reconnecting your device network to proceed"
|
|
2659
|
+
}) }),
|
|
2660
|
+
n && /* @__PURE__ */ B("div", {
|
|
2661
|
+
className: "padorix:size-8 padorix:ml-auto",
|
|
2662
|
+
children: /* @__PURE__ */ B("div", {
|
|
2663
|
+
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2664
|
+
onClick: e.close,
|
|
2665
|
+
children: /* @__PURE__ */ B(F, {})
|
|
2666
|
+
})
|
|
2667
|
+
})
|
|
2668
|
+
]
|
|
2669
|
+
}), /* @__PURE__ */ V("div", {
|
|
2670
|
+
className: "padorix:flex padorix:flex-col padorix:items-center padorix:justify-center padorix:h-full padorix:text-center",
|
|
2671
|
+
children: [/* @__PURE__ */ B(R, { children: /* @__PURE__ */ B("img", {
|
|
2672
|
+
src: wt,
|
|
2673
|
+
alt: "",
|
|
2674
|
+
className: ""
|
|
2675
|
+
}) }), /* @__PURE__ */ V(R, { children: [
|
|
2676
|
+
/* @__PURE__ */ B("div", {
|
|
2677
|
+
className: "padorix:text-2xl padorix:font-bold padorix:mt-10 padorix:mb-3",
|
|
2678
|
+
children: "Oops!"
|
|
2679
|
+
}),
|
|
2680
|
+
/* @__PURE__ */ B("div", {
|
|
2681
|
+
className: "padorix:text-base padorix:text-zinc-500",
|
|
2682
|
+
children: "Your internet is disconnected"
|
|
2683
|
+
}),
|
|
2684
|
+
/* @__PURE__ */ V("div", {
|
|
2685
|
+
className: "padorix:text-zinc-500 padorix:text-sm",
|
|
2686
|
+
children: [
|
|
2687
|
+
"Do not worry your chat sessions are saved ",
|
|
2688
|
+
/* @__PURE__ */ B("br", {}),
|
|
2689
|
+
" till you are back online"
|
|
2690
|
+
]
|
|
2691
|
+
})
|
|
2692
|
+
] })]
|
|
2693
|
+
})]
|
|
2694
|
+
});
|
|
2695
|
+
}
|
|
2696
|
+
//#endregion
|
|
2697
|
+
//#region lib/chats/chatScreen/chat-conversation.tsx
|
|
2698
|
+
function Dt(e) {
|
|
2699
|
+
let t = e.userType === w.VISITOR, n = O(), { workspace: r } = k((e) => e.data);
|
|
2700
|
+
if (A.useEffect(() => {
|
|
2701
|
+
if (!t) {
|
|
2702
|
+
n(g(e.sender));
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
try {
|
|
2706
|
+
let e = JSON.parse(localStorage.getItem("pdx-sess") ?? "null"), t = e?.expiresAt ? G().isAfter(e?.expiresAt) : !0;
|
|
2707
|
+
t && localStorage.removeItem(p), !t && e?.conversationId && n(g(e));
|
|
2708
|
+
} catch (e) {
|
|
2709
|
+
console.log(e);
|
|
2710
|
+
}
|
|
2711
|
+
}, [
|
|
2712
|
+
n,
|
|
2713
|
+
t,
|
|
2714
|
+
e.sender
|
|
2715
|
+
]), A.useEffect(() => {
|
|
2716
|
+
if (!e.workspaceId) return;
|
|
2717
|
+
let t = !1;
|
|
2718
|
+
return f.config(e.workspaceId, e.userType).then((e) => {
|
|
2719
|
+
t || (n(a(e.workspace)), n(_(e.faqs)), n(i(e.tags)));
|
|
2720
|
+
}).catch((e) => console.log(e.message, "error data")), () => {
|
|
2721
|
+
t = !0;
|
|
2722
|
+
};
|
|
2723
|
+
}, [
|
|
2724
|
+
n,
|
|
2725
|
+
e.userType,
|
|
2726
|
+
e.workspaceId
|
|
2727
|
+
]), A.useEffect(() => {
|
|
2728
|
+
if (t || !e.workspaceId) return;
|
|
2729
|
+
let n = () => E.emit(D.subscribe_workspace, { workspaceId: e.workspaceId });
|
|
2730
|
+
return E.on(D.connected, n), ne(!0), n(), () => {
|
|
2731
|
+
E.off(D.connected, n);
|
|
2732
|
+
};
|
|
2733
|
+
}, [t, e.workspaceId]), r?.id) return e.children;
|
|
2734
|
+
}
|
|
2735
|
+
//#endregion
|
|
2736
|
+
//#region lib/chats/chatScreen/chat-panel.tsx
|
|
2737
|
+
function Ot(e) {
|
|
2738
|
+
return /* @__PURE__ */ V(H, { children: [/* @__PURE__ */ B("div", {
|
|
2739
|
+
"aria-hidden": !0,
|
|
2740
|
+
className: Ct.visitor.backdrop
|
|
2741
|
+
}), /* @__PURE__ */ B(Et, {
|
|
2742
|
+
...e,
|
|
2743
|
+
close: e.close,
|
|
2744
|
+
children: /* @__PURE__ */ B(Dt, {
|
|
2745
|
+
...e,
|
|
2746
|
+
children: /* @__PURE__ */ B(bt, {
|
|
2747
|
+
close: e.close,
|
|
2748
|
+
styles: Ct.visitor,
|
|
2749
|
+
workspaceId: e.workspaceId,
|
|
2750
|
+
moreActions: e.moreActions,
|
|
2751
|
+
userType: e.userType,
|
|
2752
|
+
sender: e.sender,
|
|
2753
|
+
openOptions: e.openOptions,
|
|
2754
|
+
openRequestId: e.openRequestId,
|
|
2755
|
+
autoSubmitRequestId: e.autoSubmitRequestId,
|
|
2756
|
+
goBack: e.goBack,
|
|
2757
|
+
closeModal: e.close
|
|
2758
|
+
})
|
|
2759
|
+
})
|
|
2760
|
+
})] });
|
|
2761
|
+
}
|
|
2762
|
+
function kt(e) {
|
|
2763
|
+
return /* @__PURE__ */ V(H, { children: [/* @__PURE__ */ B(T, {}), /* @__PURE__ */ B(Et, {
|
|
2764
|
+
...e,
|
|
2765
|
+
children: /* @__PURE__ */ B(Dt, {
|
|
2766
|
+
...e,
|
|
2767
|
+
children: /* @__PURE__ */ B(ut, {
|
|
2768
|
+
styles: Ct.nonVisitor,
|
|
2769
|
+
moreActions: e.moreActions,
|
|
2770
|
+
userType: e.userType,
|
|
2771
|
+
sender: e.sender,
|
|
2772
|
+
goBack: e.goBack,
|
|
2773
|
+
closeModal: () => null
|
|
2774
|
+
})
|
|
2775
|
+
})
|
|
2776
|
+
})] });
|
|
2777
|
+
}
|
|
2778
|
+
//#endregion
|
|
2779
|
+
export { kt as AgentChatPanel, Ot as VisitorChatPanel };
|
|
2780
|
+
|
|
2781
|
+
//# sourceMappingURL=chat-panel-CXbOkOSq.js.map
|