padorixnpm 0.0.71 → 0.0.72
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-DOV89YL7.js → chat-panel-N3AY-SGW.js} +924 -932
- package/dist/chat-panel-N3AY-SGW.js.map +1 -0
- package/dist/chat-panel-skeleton-Br7Bmq0L.js +420 -0
- package/dist/chat-panel-skeleton-Br7Bmq0L.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-lobby.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-panel-skeleton.d.ts +7 -0
- package/dist/chats/chatScreen/chat-panel-skeleton.d.ts.map +1 -0
- package/dist/chats/chatScreen/styles.d.ts +2 -0
- package/dist/chats/chatScreen/styles.d.ts.map +1 -1
- package/dist/chats/newchat/new-chat.d.ts.map +1 -1
- package/dist/config-Cgly4edG.js.map +1 -1
- package/dist/global.d.ts +2 -1
- package/dist/global.d.ts.map +1 -1
- package/dist/padorixnpm.css +1 -1
- package/dist/padorixnpm.js +116 -100
- package/dist/padorixnpm.js.map +1 -1
- package/dist/padorixnpm.umd.cjs +9 -9
- package/dist/padorixnpm.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/chat-panel-DOV89YL7.js.map +0 -1
- package/dist/widget-api-BfWB6m6w.js +0 -335
- package/dist/widget-api-BfWB6m6w.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, M as i,
|
|
2
|
-
import
|
|
3
|
-
import { useDispatch as
|
|
4
|
-
import
|
|
5
|
-
import { Add as
|
|
6
|
-
import { Fade as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { MantineProvider as
|
|
1
|
+
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, P as s, S as c, T as l, _ as u, b as d, d as f, f as p, g as m, j as h, k as g, l as _, m as v, n as y, o as b, s as x, t as S, v as C, w, x as T, y as E } from "./chat-panel-skeleton-Br7Bmq0L.js";
|
|
2
|
+
import D, { i as O, n as ee, r as k, t as te } from "./notification-ChYfFRqp.js";
|
|
3
|
+
import { useDispatch as A, useSelector as j } from "react-redux";
|
|
4
|
+
import M, { createElement as N, forwardRef as P, useState as F } from "react";
|
|
5
|
+
import { Add as I, ArrowDown2 as L, ArrowForward as ne, ArrowLeft2 as re, Copy as ie, DocumentDownload as ae, EmojiHappy as oe, Global as R, Minus as se, Send as z, Star1 as ce, Trash as le } from "iconsax-reactjs";
|
|
6
|
+
import { Fade as B, JackInTheBox as ue, Slide as de } from "react-awesome-reveal";
|
|
7
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
8
|
+
import { MantineProvider as W, Modal as fe, Popover as G } from "@mantine/core";
|
|
9
9
|
import K from "dayjs";
|
|
10
|
-
import { useDisclosure as
|
|
11
|
-
import { useForm as
|
|
10
|
+
import { useDisclosure as pe } from "@mantine/hooks";
|
|
11
|
+
import { useForm as me } from "@mantine/form";
|
|
12
12
|
//#region lib/chats/chatform/chat-text-input.tsx
|
|
13
|
-
var
|
|
14
|
-
let { sender: s } =
|
|
15
|
-
|
|
13
|
+
var q = 120, J = 2500, he = 1500, ge = P(({ setMessage: e, message: t, userType: n, onImagePasted: r, onSubmit: i, ...a }, o) => {
|
|
14
|
+
let { sender: s } = j((e) => e.data), c = M.useRef(null), l = M.useRef(0), u = M.useRef(!1);
|
|
15
|
+
M.useImperativeHandle(o, () => c.current), M.useLayoutEffect(() => {
|
|
16
16
|
let e = c.current;
|
|
17
|
-
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
17
|
+
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, q)}px`, e.style.overflowY = e.scrollHeight > q ? "auto" : "hidden");
|
|
18
18
|
}, [t]);
|
|
19
19
|
let d = (e) => {
|
|
20
20
|
let t = e.clipboardData?.items;
|
|
@@ -25,12 +25,12 @@ var pe = 120, q = 2500, J = 1500, me = M(({ setMessage: e, message: t, userType:
|
|
|
25
25
|
r && n.push(r);
|
|
26
26
|
}
|
|
27
27
|
n.length > 0 && (e.preventDefault(), r?.(n));
|
|
28
|
-
}, f =
|
|
28
|
+
}, f = M.useCallback((t) => {
|
|
29
29
|
e(t.target.value);
|
|
30
|
-
}, [e]), p =
|
|
31
|
-
u.current && (u.current = !1, l.current = 0,
|
|
30
|
+
}, [e]), p = M.useCallback((e) => {
|
|
31
|
+
u.current && (u.current = !1, l.current = 0, O.emit(k.not_typing, e));
|
|
32
32
|
}, []);
|
|
33
|
-
|
|
33
|
+
M.useEffect(() => {
|
|
34
34
|
let e = s?.conversationId;
|
|
35
35
|
if (!e) return;
|
|
36
36
|
let r = {
|
|
@@ -43,8 +43,8 @@ var pe = 120, q = 2500, J = 1500, me = M(({ setMessage: e, message: t, userType:
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
let i = Date.now();
|
|
46
|
-
i - l.current >
|
|
47
|
-
let a = window.setTimeout(() => p(r),
|
|
46
|
+
i - l.current > J && (l.current = i, u.current = !0, O.emit(k.is_typing, r));
|
|
47
|
+
let a = window.setTimeout(() => p(r), he);
|
|
48
48
|
return () => {
|
|
49
49
|
window.clearTimeout(a);
|
|
50
50
|
};
|
|
@@ -54,7 +54,7 @@ var pe = 120, q = 2500, J = 1500, me = M(({ setMessage: e, message: t, userType:
|
|
|
54
54
|
s?.senderId,
|
|
55
55
|
n,
|
|
56
56
|
p
|
|
57
|
-
]),
|
|
57
|
+
]), M.useEffect(() => {
|
|
58
58
|
let e = s?.conversationId;
|
|
59
59
|
return () => {
|
|
60
60
|
e && p({
|
|
@@ -78,9 +78,9 @@ var pe = 120, q = 2500, J = 1500, me = M(({ setMessage: e, message: t, userType:
|
|
|
78
78
|
userType: n
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ H("div", {
|
|
82
82
|
className: "padorix:w-full padorix:bg-slate-100 padorix:rounded-lg",
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ H("textarea", {
|
|
84
84
|
ref: c,
|
|
85
85
|
...a,
|
|
86
86
|
spellCheck: !0,
|
|
@@ -97,27 +97,27 @@ var pe = 120, q = 2500, J = 1500, me = M(({ setMessage: e, message: t, userType:
|
|
|
97
97
|
rows: 1
|
|
98
98
|
})
|
|
99
99
|
});
|
|
100
|
-
}),
|
|
100
|
+
}), _e = {
|
|
101
101
|
color: void 0,
|
|
102
102
|
size: void 0,
|
|
103
103
|
className: void 0,
|
|
104
104
|
style: void 0,
|
|
105
105
|
attr: void 0
|
|
106
|
-
},
|
|
106
|
+
}, ve = M.createContext && /*#__PURE__*/ M.createContext(_e), ye = [
|
|
107
107
|
"attr",
|
|
108
108
|
"size",
|
|
109
109
|
"title"
|
|
110
110
|
];
|
|
111
|
-
function
|
|
111
|
+
function be(e, t) {
|
|
112
112
|
if (e == null) return {};
|
|
113
|
-
var n, r, i =
|
|
113
|
+
var n, r, i = xe(e, t);
|
|
114
114
|
if (Object.getOwnPropertySymbols) {
|
|
115
115
|
var a = Object.getOwnPropertySymbols(e);
|
|
116
116
|
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
117
117
|
}
|
|
118
118
|
return i;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function xe(e, t) {
|
|
121
121
|
if (e == null) return {};
|
|
122
122
|
var n = {};
|
|
123
123
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -135,7 +135,7 @@ function Y() {
|
|
|
135
135
|
return e;
|
|
136
136
|
}, Y.apply(null, arguments);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Se(e, t) {
|
|
139
139
|
var n = Object.keys(e);
|
|
140
140
|
if (Object.getOwnPropertySymbols) {
|
|
141
141
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -148,27 +148,27 @@ function be(e, t) {
|
|
|
148
148
|
function X(e) {
|
|
149
149
|
for (var t = 1; t < arguments.length; t++) {
|
|
150
150
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
151
|
-
t % 2 ?
|
|
152
|
-
|
|
153
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
151
|
+
t % 2 ? Se(Object(n), !0).forEach(function(t) {
|
|
152
|
+
Ce(e, t, n[t]);
|
|
153
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Se(Object(n)).forEach(function(t) {
|
|
154
154
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
return e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
return (t =
|
|
159
|
+
function Ce(e, t, n) {
|
|
160
|
+
return (t = we(t)) in e ? Object.defineProperty(e, t, {
|
|
161
161
|
value: n,
|
|
162
162
|
enumerable: !0,
|
|
163
163
|
configurable: !0,
|
|
164
164
|
writable: !0
|
|
165
165
|
}) : e[t] = n, e;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
var t =
|
|
167
|
+
function we(e) {
|
|
168
|
+
var t = Te(e, "string");
|
|
169
169
|
return typeof t == "symbol" ? t : t + "";
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Te(e, t) {
|
|
172
172
|
if (typeof e != "object" || !e) return e;
|
|
173
173
|
var n = e[Symbol.toPrimitive];
|
|
174
174
|
if (n !== void 0) {
|
|
@@ -178,16 +178,16 @@ function Ce(e, t) {
|
|
|
178
178
|
}
|
|
179
179
|
return (t === "string" ? String : Number)(e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return e && e.map((e, t) => /*#__PURE__*/
|
|
181
|
+
function Ee(e) {
|
|
182
|
+
return e && e.map((e, t) => /*#__PURE__*/ M.createElement(e.tag, X({ key: t }, e.attr), Ee(e.child)));
|
|
183
183
|
}
|
|
184
184
|
function Z(e) {
|
|
185
|
-
return (t) => /*#__PURE__*/
|
|
185
|
+
return (t) => /*#__PURE__*/ M.createElement(De, Y({ attr: X({}, e.attr) }, t), Ee(e.child));
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function De(e) {
|
|
188
188
|
var t = (t) => {
|
|
189
|
-
var { attr: n, size: r, title: i } = e, a =
|
|
190
|
-
return t.className && (s = t.className), e.className && (s = (s ? s + " " : "") + e.className), /*#__PURE__*/
|
|
189
|
+
var { attr: n, size: r, title: i } = e, a = be(e, ye), o = r || t.size || "1em", s;
|
|
190
|
+
return t.className && (s = t.className), e.className && (s = (s ? s + " " : "") + e.className), /*#__PURE__*/ M.createElement("svg", Y({
|
|
191
191
|
stroke: "currentColor",
|
|
192
192
|
fill: "currentColor",
|
|
193
193
|
strokeWidth: "0"
|
|
@@ -197,9 +197,9 @@ function Te(e) {
|
|
|
197
197
|
height: o,
|
|
198
198
|
width: o,
|
|
199
199
|
xmlns: "http://www.w3.org/2000/svg"
|
|
200
|
-
}), i && /*#__PURE__*/
|
|
200
|
+
}), i && /*#__PURE__*/ M.createElement("title", null, i), e.children);
|
|
201
201
|
};
|
|
202
|
-
return
|
|
202
|
+
return ve === void 0 ? t(_e) : /*#__PURE__*/ M.createElement(ve.Consumer, null, (e) => t(e));
|
|
203
203
|
}
|
|
204
204
|
//#endregion
|
|
205
205
|
//#region node_modules/react-icons/fi/index.mjs
|
|
@@ -235,7 +235,7 @@ function Q(e) {
|
|
|
235
235
|
}]
|
|
236
236
|
})(e);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Oe(e) {
|
|
239
239
|
return Z({
|
|
240
240
|
tag: "svg",
|
|
241
241
|
attr: {
|
|
@@ -258,7 +258,7 @@ function Ee(e) {
|
|
|
258
258
|
}]
|
|
259
259
|
})(e);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function ke(e) {
|
|
262
262
|
return Z({
|
|
263
263
|
tag: "svg",
|
|
264
264
|
attr: {
|
|
@@ -293,7 +293,7 @@ function De(e) {
|
|
|
293
293
|
]
|
|
294
294
|
})(e);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Ae(e) {
|
|
297
297
|
return Z({
|
|
298
298
|
tag: "svg",
|
|
299
299
|
attr: {
|
|
@@ -311,7 +311,7 @@ function Oe(e) {
|
|
|
311
311
|
}]
|
|
312
312
|
})(e);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function je(e) {
|
|
315
315
|
return Z({
|
|
316
316
|
tag: "svg",
|
|
317
317
|
attr: {
|
|
@@ -331,44 +331,44 @@ function ke(e) {
|
|
|
331
331
|
}
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region lib/chats/chatmessages/chat-display-reply.tsx
|
|
334
|
-
function
|
|
335
|
-
let t =
|
|
336
|
-
function
|
|
337
|
-
t(
|
|
334
|
+
function Me(e) {
|
|
335
|
+
let t = A(), r = Array.isArray(e.data?.message) ? e.data.message.join(" ") : String(e.data?.message ?? "");
|
|
336
|
+
function i() {
|
|
337
|
+
t(n(void 0)), t(h(void 0));
|
|
338
338
|
}
|
|
339
|
-
if (e.data?.id) return /* @__PURE__ */
|
|
339
|
+
if (e.data?.id) return /* @__PURE__ */ H("div", {
|
|
340
340
|
className: e.styles.replyContainer,
|
|
341
|
-
children: /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ H("div", {
|
|
342
342
|
className: "padorix-fade-in padorix:bg-white padorix:w-[96%] padorix:mx-auto padorix:py-0.5",
|
|
343
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ H("div", { children: /* @__PURE__ */ H("div", {
|
|
344
344
|
className: "padorix:px-2",
|
|
345
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ U("div", {
|
|
346
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__ */
|
|
347
|
+
children: [/* @__PURE__ */ U("div", {
|
|
348
348
|
className: "padorix:flex padorix:items-center padorix:py-2.5 padorix:text-sm",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
350
|
-
}), /* @__PURE__ */
|
|
349
|
+
children: [/* @__PURE__ */ H(ne, { className: "padorix:inline padorix:size-6 padorix:mr-3" }), r.length > 0 && /* @__PURE__ */ U("span", { children: [r.slice(0, 30), r.length > 30 ? "..." : ""] })]
|
|
350
|
+
}), /* @__PURE__ */ U("div", {
|
|
351
351
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
352
|
-
children: [Number(e.data?.images?.length) > 0 && /* @__PURE__ */
|
|
352
|
+
children: [Number(e.data?.images?.length) > 0 && /* @__PURE__ */ U("div", {
|
|
353
353
|
className: "padorix:flex padorix:gap-1 padorix:flex-row",
|
|
354
|
-
children: [Array.isArray(e?.data?.images) && e?.data?.images?.slice(0, 2)?.map((e, t) => /* @__PURE__ */
|
|
354
|
+
children: [Array.isArray(e?.data?.images) && e?.data?.images?.slice(0, 2)?.map((e, t) => /* @__PURE__ */ H("img", {
|
|
355
355
|
src: e,
|
|
356
356
|
alt: "Padorix",
|
|
357
357
|
className: "padorix:size-10 padorix:bg-slate-800 padorix:inline padorix:object-contain"
|
|
358
|
-
}, t)), Number(e.data?.images?.length) > 2 && /* @__PURE__ */
|
|
358
|
+
}, t)), Number(e.data?.images?.length) > 2 && /* @__PURE__ */ U("div", {
|
|
359
359
|
className: "padorix:flex padorix:items-center",
|
|
360
360
|
children: [
|
|
361
361
|
" ",
|
|
362
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ H(I, { className: "padorix:inline padorix:size-5" }),
|
|
363
363
|
" ",
|
|
364
364
|
Number(e.data?.images?.length) - 2,
|
|
365
365
|
" "
|
|
366
366
|
]
|
|
367
367
|
})]
|
|
368
|
-
}), /* @__PURE__ */
|
|
369
|
-
onClick:
|
|
368
|
+
}), /* @__PURE__ */ H("div", {
|
|
369
|
+
onClick: i,
|
|
370
370
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-95",
|
|
371
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ H(Q, { className: "padorix:inline padorix:size-6 padorix:mr-3" })
|
|
372
372
|
})]
|
|
373
373
|
})]
|
|
374
374
|
})
|
|
@@ -378,7 +378,7 @@ function Ae(e) {
|
|
|
378
378
|
}
|
|
379
379
|
//#endregion
|
|
380
380
|
//#region lib/chats/chatform/emoji-picker.tsx
|
|
381
|
-
var
|
|
381
|
+
var Ne = [
|
|
382
382
|
{
|
|
383
383
|
name: "Smileys",
|
|
384
384
|
icon: "😀",
|
|
@@ -429,18 +429,18 @@ var je = [
|
|
|
429
429
|
icon: "✅",
|
|
430
430
|
emojis: "✅ ☑️ ✔️ ❌ ❎ ➕ ➖ ➗ ✖️ ❓ ❔ ❗ ❕ ‼️ ⁉️ ⚠️ 🚫 ⛔ 🔞 ♻️ 🆗 🆕 🆓 🆒 🆘 🔝 🔜 ⏩ ⏪ ▶️ ⏸️ ⏹️ 🔁 🔄 ⬆️ ⬇️ ⬅️ ➡️ ↩️ ℹ️ 🔴 🟠 🟡 🟢 🔵 🟣 ⚫ ⚪ 🟥 🟩 🟦 💲 ©️ ®️ ™️ 🔔 🔕 💬 💭 🗯️"
|
|
431
431
|
}
|
|
432
|
-
],
|
|
433
|
-
function
|
|
432
|
+
], Pe = "padorix-recent-emojis", Fe = 24;
|
|
433
|
+
function Ie() {
|
|
434
434
|
try {
|
|
435
|
-
let e = JSON.parse(localStorage.getItem(
|
|
436
|
-
return Array.isArray(e) ? e.filter((e) => typeof e == "string").slice(0,
|
|
435
|
+
let e = JSON.parse(localStorage.getItem(Pe) || "[]");
|
|
436
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "string").slice(0, Fe) : [];
|
|
437
437
|
} catch {
|
|
438
438
|
return [];
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
let [t, n] =
|
|
443
|
-
|
|
441
|
+
function Le(e) {
|
|
442
|
+
let [t, n] = M.useState(Ie), [r, i] = M.useState(() => Ie().length > 0 ? "Recent" : Ne[0].name), a = M.useRef(null);
|
|
443
|
+
M.useEffect(() => {
|
|
444
444
|
let t = (t) => {
|
|
445
445
|
let n = t.composedPath();
|
|
446
446
|
a.current && n.includes(a.current) || e.toggleRef?.current && n.includes(e.toggleRef.current) || e.onClose();
|
|
@@ -453,25 +453,25 @@ function Fe(e) {
|
|
|
453
453
|
}, [e.onClose, e.toggleRef]);
|
|
454
454
|
function o(r) {
|
|
455
455
|
e.onSelect(r);
|
|
456
|
-
let i = [r, ...t.filter((e) => e !== r)].slice(0,
|
|
456
|
+
let i = [r, ...t.filter((e) => e !== r)].slice(0, Fe);
|
|
457
457
|
n(i);
|
|
458
458
|
try {
|
|
459
|
-
localStorage.setItem(
|
|
459
|
+
localStorage.setItem(Pe, JSON.stringify(i));
|
|
460
460
|
} catch {}
|
|
461
461
|
}
|
|
462
462
|
let s = [...t.length > 0 ? [{
|
|
463
463
|
name: "Recent",
|
|
464
464
|
icon: "🕘"
|
|
465
|
-
}] : [], ...
|
|
466
|
-
return /* @__PURE__ */
|
|
465
|
+
}] : [], ...Ne], c = r === "Recent" ? t : Ne.find((e) => e.name === r)?.emojis.split(" ") ?? [];
|
|
466
|
+
return /* @__PURE__ */ U("div", {
|
|
467
467
|
ref: a,
|
|
468
468
|
role: "dialog",
|
|
469
469
|
"aria-label": "Emoji picker",
|
|
470
470
|
className: "padorix:w-[min(20rem,calc(100vw-2rem))] padorix:rounded-xl padorix:border padorix:border-gray-200 padorix:bg-white padorix:shadow-lg padorix:overflow-hidden",
|
|
471
471
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ H("div", {
|
|
473
473
|
className: "padorix:flex padorix:gap-0.5 padorix:overflow-x-auto padorix-scrolls padorix:border-b padorix:border-gray-200 padorix:px-1 padorix:py-1",
|
|
474
|
-
children: s.map((e) => /* @__PURE__ */
|
|
474
|
+
children: s.map((e) => /* @__PURE__ */ H("button", {
|
|
475
475
|
type: "button",
|
|
476
476
|
title: e.name,
|
|
477
477
|
"aria-pressed": r === e.name,
|
|
@@ -480,13 +480,13 @@ function Fe(e) {
|
|
|
480
480
|
children: e.icon
|
|
481
481
|
}, e.name))
|
|
482
482
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ H("div", {
|
|
484
484
|
className: "padorix:px-2 padorix:pt-1.5 padorix:text-xs padorix:text-gray-500",
|
|
485
485
|
children: r
|
|
486
486
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ H("div", {
|
|
488
488
|
className: "padorix:grid padorix:grid-cols-8 padorix:gap-0.5 padorix:p-1.5 padorix:h-52 padorix:overflow-y-auto padorix-scrolls",
|
|
489
|
-
children: c.map((e, t) => /* @__PURE__ */
|
|
489
|
+
children: c.map((e, t) => /* @__PURE__ */ H("button", {
|
|
490
490
|
type: "button",
|
|
491
491
|
onClick: () => o(e),
|
|
492
492
|
className: "padorix:size-8 padorix:rounded-md padorix:text-xl padorix:leading-none padorix:cursor-pointer padorix:hover:bg-gray-100",
|
|
@@ -498,8 +498,8 @@ function Fe(e) {
|
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region lib/chats/chatform/chat-form.tsx
|
|
501
|
-
function
|
|
502
|
-
let { sender: t, workspace: n, message: r } =
|
|
501
|
+
function Re(e) {
|
|
502
|
+
let { sender: t, workspace: n, message: r } = j((e) => e.data), [i, a] = M.useState(!1), o = M.useRef(null), s = M.useCallback(() => a(!1), []), [c, l] = M.useState(""), u = M.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;
|
|
503
503
|
function g(e) {
|
|
504
504
|
let t = u.current, n = t?.value ?? c, r = t && !(t.selectionStart === 0 && t.selectionEnd === 0 && n.length > 0), i = r ? t.selectionStart : n.length, a = r ? t.selectionEnd : n.length;
|
|
505
505
|
l(n.substring(0, i) + e + n.substring(a)), requestAnimationFrame(() => {
|
|
@@ -510,7 +510,7 @@ function Ie(e) {
|
|
|
510
510
|
}
|
|
511
511
|
function _() {
|
|
512
512
|
if (d && !c || e.isSending) return;
|
|
513
|
-
t?.conversationId &&
|
|
513
|
+
t?.conversationId && O.emit(k.not_typing, {
|
|
514
514
|
conversationId: t.conversationId,
|
|
515
515
|
senderId: t.senderId,
|
|
516
516
|
userType: e.userType
|
|
@@ -524,29 +524,29 @@ function Ie(e) {
|
|
|
524
524
|
};
|
|
525
525
|
e.sendChat(r), l("");
|
|
526
526
|
}
|
|
527
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ U("div", {
|
|
528
528
|
className: "padorix:relative",
|
|
529
|
-
children: [i && /* @__PURE__ */
|
|
529
|
+
children: [i && /* @__PURE__ */ H("div", {
|
|
530
530
|
className: e.styles.emojiContainer,
|
|
531
|
-
children: /* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ H(Le, {
|
|
532
532
|
onSelect: g,
|
|
533
533
|
onClose: s,
|
|
534
534
|
toggleRef: o
|
|
535
535
|
})
|
|
536
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ U("div", {
|
|
537
537
|
className: e.styles.formContainer,
|
|
538
|
-
children: [r?.id && /* @__PURE__ */
|
|
538
|
+
children: [r?.id && /* @__PURE__ */ H(Me, {
|
|
539
539
|
styles: e.styles,
|
|
540
540
|
data: r
|
|
541
|
-
}), /* @__PURE__ */
|
|
541
|
+
}), /* @__PURE__ */ U("div", {
|
|
542
542
|
className: "padorix:flex padorix:items-center padorix:justify-center padorix:rounded-lg padorix:p-0.5 padorix:relative padorix:gap-1",
|
|
543
|
-
children: [/* @__PURE__ */
|
|
543
|
+
children: [/* @__PURE__ */ U("div", {
|
|
544
544
|
className: "padorix:flex padorix:items-center padorix:gap-1 padorix:bg-gray-100 padorix:w-full padorix:rounded-lg",
|
|
545
545
|
children: [
|
|
546
|
-
h && /* @__PURE__ */
|
|
546
|
+
h && /* @__PURE__ */ U("label", {
|
|
547
547
|
title: "Attach images",
|
|
548
548
|
className: "padorix:cursor-pointer padorix:px-1 padorix:text-[#99a1af]",
|
|
549
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ H(I, {}), /* @__PURE__ */ H("input", {
|
|
550
550
|
type: "file",
|
|
551
551
|
accept: ".png,.jpg,.jpeg,.webp",
|
|
552
552
|
hidden: !0,
|
|
@@ -554,7 +554,7 @@ function Ie(e) {
|
|
|
554
554
|
multiple: !0
|
|
555
555
|
})]
|
|
556
556
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ U("div", {
|
|
558
558
|
ref: o,
|
|
559
559
|
role: "button",
|
|
560
560
|
"aria-label": "Insert emoji",
|
|
@@ -564,13 +564,13 @@ function Ie(e) {
|
|
|
564
564
|
className: "padorix:text-[#99a1af] padorix:cursor-pointer padorix:px-1 padorix:transition-all",
|
|
565
565
|
children: [
|
|
566
566
|
" ",
|
|
567
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ H(oe, {}),
|
|
568
568
|
" "
|
|
569
569
|
]
|
|
570
570
|
}),
|
|
571
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ H("div", {
|
|
572
572
|
className: "padorix:w-full",
|
|
573
|
-
children: /* @__PURE__ */
|
|
573
|
+
children: /* @__PURE__ */ H(ge, {
|
|
574
574
|
ref: u,
|
|
575
575
|
message: c,
|
|
576
576
|
setMessage: l,
|
|
@@ -579,14 +579,14 @@ function Ie(e) {
|
|
|
579
579
|
})
|
|
580
580
|
})
|
|
581
581
|
]
|
|
582
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */ H("div", { children: /* @__PURE__ */ U("div", {
|
|
583
583
|
onClick: _,
|
|
584
584
|
style: {
|
|
585
585
|
background: d && !c || e.isSending ? "#9f9fa9" : String(n?.widget?.colorScheme),
|
|
586
586
|
cursor: d && !c || e.isSending ? "not-allowed" : "pointer"
|
|
587
587
|
},
|
|
588
588
|
className: "padorix:-mt-1 padorix:size-10 padorix:text-white padorix:rounded-lg padorix:flex padorix:last:items-center padorix:justify-center",
|
|
589
|
-
children: [" ", /* @__PURE__ */
|
|
589
|
+
children: [" ", /* @__PURE__ */ H(z, { className: "padorix:size-6" })]
|
|
590
590
|
}) })]
|
|
591
591
|
})]
|
|
592
592
|
})]
|
|
@@ -594,81 +594,81 @@ function Ie(e) {
|
|
|
594
594
|
}
|
|
595
595
|
//#endregion
|
|
596
596
|
//#region lib/chats/chatform/chat-image-upload.tsx
|
|
597
|
-
function
|
|
598
|
-
let { workspace: t } =
|
|
597
|
+
function ze(e) {
|
|
598
|
+
let { workspace: t } = j((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] = M.useState(e.previews?.[0]?.id), s = e.previews?.find((e) => e.id === a) ?? e.previews?.[0];
|
|
599
599
|
function c(t) {
|
|
600
600
|
e.sendChat(t);
|
|
601
601
|
}
|
|
602
|
-
if (Number(e.previews?.length || 0) > 0) return /* @__PURE__ */
|
|
602
|
+
if (Number(e.previews?.length || 0) > 0) return /* @__PURE__ */ U("div", {
|
|
603
603
|
className: e.styles.imageUploadContainer,
|
|
604
604
|
children: [
|
|
605
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ U("div", {
|
|
606
606
|
className: `padorix:relative padorix:border padorix:border-gray-300 padorix:py-3 padorix:bg-white ${e.styles.imagePreviewBox}`,
|
|
607
|
-
children: [/* @__PURE__ */
|
|
607
|
+
children: [/* @__PURE__ */ H("div", {
|
|
608
608
|
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",
|
|
609
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ U("div", {
|
|
610
610
|
onClick: e.DiscardAllImages,
|
|
611
611
|
className: "padorix:size-fit padorix:ml-auto padorix:text-red-600 padorix:cursor-pointer padorix:text-xl",
|
|
612
612
|
children: [
|
|
613
613
|
" ",
|
|
614
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ H(Q, {}),
|
|
615
615
|
" "
|
|
616
616
|
]
|
|
617
617
|
})
|
|
618
|
-
}), /* @__PURE__ */
|
|
618
|
+
}), /* @__PURE__ */ H("img", {
|
|
619
619
|
src: s?.img,
|
|
620
620
|
className: "padorix:size-full padorix:mx-auto padorix:object-contain"
|
|
621
621
|
})]
|
|
622
622
|
}),
|
|
623
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ U("div", {
|
|
624
624
|
className: "padorix:shrink-0 padorix:flex padorix:items-center padorix:justify-center padorix:gap-1 padorix:max-w-[98%] padorix:mx-auto",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
625
|
+
children: [/* @__PURE__ */ H("div", {
|
|
626
626
|
className: "padorix:overflow-y-hidden padorix:overflow-x-auto",
|
|
627
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ H("div", {
|
|
628
628
|
className: "padorix:w-fit",
|
|
629
|
-
children: /* @__PURE__ */
|
|
629
|
+
children: /* @__PURE__ */ H("div", {
|
|
630
630
|
className: "padorix:flex padorix:items-center padorix:justify-center padorix:gap-1",
|
|
631
|
-
children: e.previews?.map((n, r) => /* @__PURE__ */
|
|
631
|
+
children: e.previews?.map((n, r) => /* @__PURE__ */ U("div", {
|
|
632
632
|
style: { border: `3.5px solid ${s?.id === n.id ? String(t?.widget?.colorScheme) : "transparent"}` },
|
|
633
633
|
className: "padorix:relative padorix:size-14 padorix:border-2 padorix:rounded-lg",
|
|
634
634
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ H("div", {
|
|
636
636
|
onClick: () => e.DiscardSingleImage(r),
|
|
637
637
|
className: "padorix:absolute padorix:top-0 padorix:left-0 padorix:w-full padorix:bg-slate-700 padorix:rounded-t-sm",
|
|
638
|
-
children: /* @__PURE__ */
|
|
638
|
+
children: /* @__PURE__ */ U("div", {
|
|
639
639
|
className: "padorix:size-fit padorix:ml-auto padorix:cursor-pointer padorix:text-[#ef4444] padorix:text-sm",
|
|
640
640
|
children: [
|
|
641
641
|
" ",
|
|
642
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ H(Q, {}),
|
|
643
643
|
" "
|
|
644
644
|
]
|
|
645
645
|
})
|
|
646
646
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ H("img", {
|
|
648
648
|
onClick: () => o(n.id),
|
|
649
649
|
src: n?.img,
|
|
650
650
|
className: "padorix:size-full padorix:cursor-pointer padorix:rounded-md padorix:object-cover"
|
|
651
651
|
}),
|
|
652
|
-
n.status === "uploading" && /* @__PURE__ */
|
|
652
|
+
n.status === "uploading" && /* @__PURE__ */ H("div", {
|
|
653
653
|
title: "Uploading…",
|
|
654
654
|
className: "padorix:absolute padorix:inset-0 padorix:flex padorix:items-center padorix:justify-center padorix:bg-white/50 padorix:rounded-md padorix:pointer-events-none",
|
|
655
|
-
children: /* @__PURE__ */
|
|
655
|
+
children: /* @__PURE__ */ H("div", { className: "padorix:size-5 padorix:rounded-full padorix:border-2 padorix:border-gray-300 padorix:border-t-gray-600 padorix:animate-spin" })
|
|
656
656
|
})
|
|
657
657
|
]
|
|
658
658
|
}, n.id))
|
|
659
659
|
})
|
|
660
660
|
})
|
|
661
|
-
}), i + e.pendingFileCount < n && /* @__PURE__ */
|
|
661
|
+
}), i + e.pendingFileCount < n && /* @__PURE__ */ H("div", {
|
|
662
662
|
className: "",
|
|
663
|
-
children: /* @__PURE__ */
|
|
663
|
+
children: /* @__PURE__ */ H("div", {
|
|
664
664
|
style: {
|
|
665
665
|
borderColor: `${t?.widget?.colorScheme}`,
|
|
666
666
|
color: String(t?.widget?.colorScheme)
|
|
667
667
|
},
|
|
668
668
|
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",
|
|
669
|
-
children: /* @__PURE__ */
|
|
669
|
+
children: /* @__PURE__ */ U("label", {
|
|
670
670
|
className: "padorix:cursor-pointer",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ H(I, {}), /* @__PURE__ */ H("input", {
|
|
672
672
|
type: "file",
|
|
673
673
|
accept: ".png,.jpg,.jpeg,.webp",
|
|
674
674
|
hidden: !0,
|
|
@@ -679,9 +679,9 @@ function Le(e) {
|
|
|
679
679
|
})
|
|
680
680
|
})]
|
|
681
681
|
}),
|
|
682
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ H("div", {
|
|
683
683
|
className: "padorix:shrink-0",
|
|
684
|
-
children: /* @__PURE__ */
|
|
684
|
+
children: /* @__PURE__ */ H(Re, {
|
|
685
685
|
showFile: !1,
|
|
686
686
|
pendingFileCount: e.pendingFileCount,
|
|
687
687
|
sendChat: c,
|
|
@@ -697,9 +697,9 @@ function Le(e) {
|
|
|
697
697
|
}
|
|
698
698
|
//#endregion
|
|
699
699
|
//#region lib/utils/use-chat-identity.ts
|
|
700
|
-
function
|
|
701
|
-
let { sender: t, workspace: n, conversation: r } =
|
|
702
|
-
return
|
|
700
|
+
function Be(e) {
|
|
701
|
+
let { sender: t, workspace: n, conversation: r } = j((e) => e.data), i = t?.workspaceId || n?.id || r?.workspaceId, a = t?.conversationId, o = t?.senderId, s = t?.userType || e, c = t?.fullName;
|
|
702
|
+
return M.useMemo(() => !i || !a || !o ? null : {
|
|
703
703
|
workspaceId: String(i),
|
|
704
704
|
conversationId: String(a),
|
|
705
705
|
senderId: String(o),
|
|
@@ -715,101 +715,101 @@ function Re(e) {
|
|
|
715
715
|
}
|
|
716
716
|
//#endregion
|
|
717
717
|
//#region lib/chats/chatform/chat-form-component.tsx
|
|
718
|
-
function
|
|
719
|
-
let [t, n] =
|
|
720
|
-
|
|
721
|
-
let
|
|
718
|
+
function Ve(e) {
|
|
719
|
+
let [t, n] = M.useState([]), r = M.useRef([]), i = M.useRef(/* @__PURE__ */ new Map()), [a, o] = M.useState(!1), { sender: l, workspace: u } = j((e) => e.data), d = M.useRef(u);
|
|
720
|
+
d.current = u;
|
|
721
|
+
let f = A(), p = Be(e.userType), m = Math.max(0, Number(u?.tier?.max_file_upload ?? 2)), h = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), g = u?.file_uploads_date === h ? Number(u?.file_uploads_used ?? 0) : 0, _ = t.filter((e) => e.status === "uploading").length, y = M.useCallback((e) => {
|
|
722
722
|
r.current = e(r.current), n(r.current);
|
|
723
723
|
}, []);
|
|
724
|
-
|
|
725
|
-
function
|
|
726
|
-
!
|
|
724
|
+
M.useEffect(() => () => r.current.forEach((e) => URL.revokeObjectURL(e.img)), []);
|
|
725
|
+
function b(e) {
|
|
726
|
+
!p || e.length === 0 || v.removeImages(p, e).catch((e) => console.log(e.message));
|
|
727
727
|
}
|
|
728
|
-
function
|
|
728
|
+
function x(e) {
|
|
729
729
|
let t = (async () => {
|
|
730
730
|
try {
|
|
731
|
-
let t = await
|
|
731
|
+
let t = await w([e], String(d.current?.id ?? "")), n = (Array.isArray(t) ? t : t?.images)?.[0];
|
|
732
732
|
if (!n) throw Error("Upload returned no image URL");
|
|
733
|
-
let
|
|
734
|
-
if (
|
|
735
|
-
...
|
|
736
|
-
file_uploads_used:
|
|
737
|
-
file_uploads_date:
|
|
738
|
-
})), !r.current.some((t) => t.id === e.id)) return
|
|
739
|
-
|
|
733
|
+
let i = Array.isArray(t) ? null : t, a = d.current;
|
|
734
|
+
if (i?.file_uploads_used !== void 0 && a && f(s({
|
|
735
|
+
...a,
|
|
736
|
+
file_uploads_used: i.file_uploads_used,
|
|
737
|
+
file_uploads_date: i.file_uploads_date
|
|
738
|
+
})), !r.current.some((t) => t.id === e.id)) return b([n]);
|
|
739
|
+
y((t) => t.map((t) => t.id === e.id ? {
|
|
740
740
|
...t,
|
|
741
741
|
status: "uploaded",
|
|
742
742
|
url: n
|
|
743
743
|
} : t));
|
|
744
744
|
} catch (t) {
|
|
745
|
-
console.log(`Image upload failed: ${t.message}`), URL.revokeObjectURL(e.img),
|
|
745
|
+
console.log(`Image upload failed: ${t.message}`), URL.revokeObjectURL(e.img), y((t) => t.filter((t) => t.id !== e.id));
|
|
746
746
|
} finally {
|
|
747
|
-
|
|
747
|
+
i.current.delete(e.id);
|
|
748
748
|
}
|
|
749
749
|
})();
|
|
750
|
-
|
|
750
|
+
i.current.set(e.id, t);
|
|
751
751
|
}
|
|
752
|
-
let
|
|
752
|
+
let S = (e) => {
|
|
753
753
|
let t = e.target, n = Array.from(t.files ?? []).filter((e) => e.type.startsWith("image/"));
|
|
754
754
|
t.value = "";
|
|
755
|
-
let i = r.current.filter((e) => e.status === "uploading").length, a = Math.max(0,
|
|
756
|
-
if (n.length > o.length &&
|
|
755
|
+
let i = r.current.filter((e) => e.status === "uploading").length, a = Math.max(0, m - g - i), o = n.slice(0, a);
|
|
756
|
+
if (n.length > o.length && c(`You can attach up to ${m} images.`, "info"), o.length === 0) return;
|
|
757
757
|
let s = o.map((e) => ({
|
|
758
758
|
id: crypto.randomUUID(),
|
|
759
759
|
file: e,
|
|
760
760
|
img: URL.createObjectURL(e),
|
|
761
761
|
status: "uploading"
|
|
762
762
|
}));
|
|
763
|
-
|
|
763
|
+
y((e) => [...e, ...s]), s.forEach(x);
|
|
764
764
|
};
|
|
765
|
-
async function
|
|
766
|
-
|
|
767
|
-
let n = r.current,
|
|
768
|
-
|
|
765
|
+
async function C(t) {
|
|
766
|
+
i.current.size > 0 && (o(!0), await Promise.allSettled([...i.current.values()]), o(!1));
|
|
767
|
+
let n = r.current, a = n.map((e) => e.url).filter(Boolean);
|
|
768
|
+
a.length === 0 && !t.message || (e.sendChat({
|
|
769
769
|
...t,
|
|
770
|
-
images:
|
|
771
|
-
}), n.forEach((e) => URL.revokeObjectURL(e.img)),
|
|
770
|
+
images: a
|
|
771
|
+
}), n.forEach((e) => URL.revokeObjectURL(e.img)), y(() => []));
|
|
772
772
|
}
|
|
773
773
|
function T(e) {
|
|
774
774
|
let t = r.current[e];
|
|
775
|
-
t && (URL.revokeObjectURL(t.img),
|
|
775
|
+
t && (URL.revokeObjectURL(t.img), y((e) => e.filter((e) => e.id !== t.id)), t.url && b([t.url]));
|
|
776
776
|
}
|
|
777
777
|
function E() {
|
|
778
778
|
let e = r.current.map((e) => e.url).filter(Boolean);
|
|
779
|
-
r.current.forEach((e) => URL.revokeObjectURL(e.img)),
|
|
779
|
+
r.current.forEach((e) => URL.revokeObjectURL(e.img)), y(() => []), b(e);
|
|
780
780
|
}
|
|
781
|
-
let
|
|
782
|
-
return /* @__PURE__ */
|
|
781
|
+
let D = e.isSending || a;
|
|
782
|
+
return /* @__PURE__ */ U("div", {
|
|
783
783
|
className: e.styles.formRoot,
|
|
784
|
-
children: [t.length > 0 && /* @__PURE__ */
|
|
784
|
+
children: [t.length > 0 && /* @__PURE__ */ H(ze, {
|
|
785
785
|
previews: t,
|
|
786
786
|
DiscardSingleImage: T,
|
|
787
787
|
DiscardAllImages: E,
|
|
788
788
|
styles: e.styles,
|
|
789
|
-
sendChat:
|
|
789
|
+
sendChat: C,
|
|
790
790
|
userType: e.userType,
|
|
791
791
|
senderId: String(l?.senderId),
|
|
792
|
-
handleFile:
|
|
793
|
-
isSending:
|
|
794
|
-
pendingFileCount:
|
|
795
|
-
}), /* @__PURE__ */
|
|
796
|
-
sendChat:
|
|
792
|
+
handleFile: S,
|
|
793
|
+
isSending: D,
|
|
794
|
+
pendingFileCount: _
|
|
795
|
+
}), /* @__PURE__ */ H(Re, {
|
|
796
|
+
sendChat: C,
|
|
797
797
|
previews: t,
|
|
798
798
|
showFile: !0,
|
|
799
|
-
pendingFileCount:
|
|
799
|
+
pendingFileCount: _,
|
|
800
800
|
styles: e.styles,
|
|
801
801
|
userType: e.userType,
|
|
802
|
-
handleFile:
|
|
803
|
-
isSending:
|
|
802
|
+
handleFile: S,
|
|
803
|
+
isSending: D
|
|
804
804
|
})]
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
807
|
//#endregion
|
|
808
808
|
//#region lib/assets/images/wd__user.png
|
|
809
|
-
var
|
|
809
|
+
var He = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJVHZNWXrm6+zq7+9VYIChqbhXY4JUX4ChqrlVX4Hd4uVRYICvt8NVYYFXYoJWYIFzfJZVYYFVYIFVYIFVYIDs8fHK0Njt8vFVYIBTXn5KVnfn7e1UYIBVYIHIztZWYIHx9fRWYoKkrLtWYIFWYoNXYYJXX4FWYYFWYYJWYoJdZ4ZXYoJrdpHl6utVYIBVYH9rdZBWYYFVYIBWXX1UXnzn7OxUX4BVYIBbZoRWYYDh5ulVYYJWYYHu8/N+h57CydJ7hZ1VYYFeaYdWYYG/xtCpsL9aZIRaZYOLk6jw9PPl6etWYYLv8/fr9fC/zL+yusagqLjp7e6zucbX3eJPW3tRXH1gaoja4OSutMPGzNTk6Oqmrr1XV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5/u60tNi4T8tvWvfPJQg8msrdQLa+NnikCFxqO4Tp4cWH9go2j+2hGT03t6u9CEqwZDetfc9lJAQzcdmmIQNO1/uqR7COqQl9ry8c0M0r99HQgKad+j77rQoIaSlddf9fl6Ur38eAXppf6g70RAF+Yn/Of3Cw2hI/nshJDy4//uegLiYrDYEeupeOJgwVPfnILx0aEtXXSI0JPAP67q2HHo4Ju65OmkT1tC8nW+FejqrDWkCIBKx9/au0FsfzcMqvl+NYmTcm2x88P0/dXaFvByIxMF9pxmqvaFTdZ++f3AjitHbX/gAlHvchocP7Bt2+lR3uzfRYOBwJPY6xp4NhupAe/ep0LB9Bx7c0LuLxNrU93MYEr786rO//s3Q3nWq53RdvddrNHq99XWne051tRv+8a8DX33J/yh23A/MEJv4fzZ+fvDv33y9f++nXwxLS1v3xV/27v/6m38enLeBL3cTNony/n9GHU2UlcLeHAAAAABJRU5ErkJggg==";
|
|
810
810
|
//#endregion
|
|
811
811
|
//#region node_modules/react-icons/io5/index.mjs
|
|
812
|
-
function
|
|
812
|
+
function Ue(e) {
|
|
813
813
|
return Z({
|
|
814
814
|
tag: "svg",
|
|
815
815
|
attr: { viewBox: "0 0 512 512" },
|
|
@@ -846,7 +846,7 @@ function Ve(e) {
|
|
|
846
846
|
}
|
|
847
847
|
//#endregion
|
|
848
848
|
//#region node_modules/react-icons/vsc/index.mjs
|
|
849
|
-
function
|
|
849
|
+
function We(e) {
|
|
850
850
|
return Z({
|
|
851
851
|
tag: "svg",
|
|
852
852
|
attr: {
|
|
@@ -870,22 +870,22 @@ function He(e) {
|
|
|
870
870
|
}
|
|
871
871
|
//#endregion
|
|
872
872
|
//#region lib/chats/chatheader/chat-header.tsx
|
|
873
|
-
function
|
|
874
|
-
let [t, { open:
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
873
|
+
function Ge(e) {
|
|
874
|
+
let [t, { open: n, close: r }] = pe(!1), { workspace: i, conversation: a, sender: s } = j((e) => e.data), l = f(i?.widget?.darkMode, !1), [u, d] = M.useState(!1), p = A(), m = Be(e.userType), h = e.userType === T.VISITOR, y = i?.widget?.notifications?.customerEndsConversation === E.true, b = M.useMemo(() => h ? i?.widget?.department : a?.fullName, [i, a]), x = M.useMemo(() => h ? i?.logo : He, [i]), S = M.useMemo(() => h ? i?.name : K(a?.createdAt).format("DD dddd MMMM YYYY"), [
|
|
875
|
+
h,
|
|
876
|
+
i?.name,
|
|
877
|
+
a?.createdAt
|
|
878
878
|
]);
|
|
879
|
-
function
|
|
880
|
-
|
|
879
|
+
function C() {
|
|
880
|
+
d(!1);
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function w() {
|
|
883
883
|
let t = K(), n = [
|
|
884
|
-
|
|
884
|
+
b || "Chat transcript",
|
|
885
885
|
`Exported: ${t.format("YYYY-MM-DD HH:mm")}`,
|
|
886
886
|
"",
|
|
887
887
|
...e.messages.length > 0 ? e.messages.map((e) => {
|
|
888
|
-
let t = K(e.createdAt), n = e.senderName || e.senderType || "Unknown", r = e.deleted ===
|
|
888
|
+
let t = K(e.createdAt), n = e.senderName || e.senderType || "Unknown", r = e.deleted === E.true ? "[This message was deleted]" : Array.isArray(e.message) ? e.message.join("\n") : "", i = e.deleted === E.true ? [] : Array.isArray(e.images) ? e.images : [];
|
|
889
889
|
return [
|
|
890
890
|
`[${t.isValid() ? t.format("YYYY-MM-DD HH:mm") : e.createdAt}] ${n} (${e.senderType})`,
|
|
891
891
|
r,
|
|
@@ -893,144 +893,144 @@ function Ue(e) {
|
|
|
893
893
|
].filter(Boolean).join("\n");
|
|
894
894
|
}) : ["No messages in this chat."]
|
|
895
895
|
].join("\n\n"), r = URL.createObjectURL(new Blob([n], { type: "text/plain;charset=utf-8" })), i = document.createElement("a");
|
|
896
|
-
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),
|
|
896
|
+
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();
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
898
|
+
function D() {
|
|
899
|
+
p(o({
|
|
900
900
|
userType: String(e?.userType),
|
|
901
|
-
senderId: String(
|
|
902
|
-
workspaceId: String(
|
|
903
|
-
conversationId: String(
|
|
904
|
-
senderName: String(
|
|
905
|
-
isEndChat:
|
|
906
|
-
})),
|
|
901
|
+
senderId: String(s?.senderId),
|
|
902
|
+
workspaceId: String(a?.workspaceId),
|
|
903
|
+
conversationId: String(s?.conversationId),
|
|
904
|
+
senderName: String(s?.fullName),
|
|
905
|
+
isEndChat: E.true
|
|
906
|
+
})), d(!1), e.toBottom();
|
|
907
907
|
}
|
|
908
|
-
function
|
|
909
|
-
|
|
908
|
+
function O() {
|
|
909
|
+
d(!1), n();
|
|
910
910
|
}
|
|
911
|
-
function
|
|
912
|
-
|
|
911
|
+
function ee() {
|
|
912
|
+
r(), m && v.requestFeedback(m).then((e) => p(g(e))).catch((e) => c(e.message, "error")), e.toBottom();
|
|
913
913
|
}
|
|
914
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ H("div", {
|
|
915
915
|
className: e.styles.header,
|
|
916
|
-
children: /* @__PURE__ */
|
|
916
|
+
children: /* @__PURE__ */ U("div", {
|
|
917
917
|
className: "padorix:rounded-2xl",
|
|
918
|
-
children: [/* @__PURE__ */
|
|
918
|
+
children: [/* @__PURE__ */ H(fe, {
|
|
919
919
|
withCloseButton: !1,
|
|
920
920
|
opened: t,
|
|
921
|
-
onClose:
|
|
921
|
+
onClose: r,
|
|
922
922
|
centered: !0,
|
|
923
923
|
styles: { body: { padding: 0 } },
|
|
924
|
-
children: /* @__PURE__ */
|
|
925
|
-
className:
|
|
926
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ H("div", {
|
|
925
|
+
className: l ? "padorix-dark" : void 0,
|
|
926
|
+
children: /* @__PURE__ */ U("div", {
|
|
927
927
|
className: "padorix:dark:bg-[#2a3549] padorix:p-4 padorix:dark:text-white",
|
|
928
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ H("div", {
|
|
929
929
|
className: "",
|
|
930
930
|
children: "Confirm your action to stop chat session by requesting for feedback"
|
|
931
|
-
}), /* @__PURE__ */
|
|
931
|
+
}), /* @__PURE__ */ U("div", {
|
|
932
932
|
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",
|
|
933
|
-
children: [/* @__PURE__ */
|
|
934
|
-
onClick:
|
|
933
|
+
children: [/* @__PURE__ */ H("button", {
|
|
934
|
+
onClick: r,
|
|
935
935
|
className: "padorix:py-1 padorix:cursor-pointer padorix:px-3 padorix:border padorix:border-slate-300 padorix:bg-slate-200/70 padorix:rounded-md",
|
|
936
936
|
children: "Cancel"
|
|
937
|
-
}), /* @__PURE__ */
|
|
938
|
-
onClick:
|
|
937
|
+
}), /* @__PURE__ */ H("button", {
|
|
938
|
+
onClick: ee,
|
|
939
939
|
className: "padorix:px-3 padorix:cursor-pointer padorix:py-1 padorix:rounded-md padorix:text-white",
|
|
940
|
-
style: { background: String(
|
|
940
|
+
style: { background: String(i?.widget?.colorScheme) },
|
|
941
941
|
children: "Proceed"
|
|
942
942
|
})]
|
|
943
943
|
})]
|
|
944
944
|
})
|
|
945
945
|
})
|
|
946
|
-
}), /* @__PURE__ */
|
|
947
|
-
style: { color:
|
|
946
|
+
}), /* @__PURE__ */ U("div", {
|
|
947
|
+
style: { color: i?.widget?.textColor || void 0 },
|
|
948
948
|
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",
|
|
949
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ U("div", {
|
|
950
950
|
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
951
951
|
children: [
|
|
952
|
-
|
|
952
|
+
h ? null : /* @__PURE__ */ H("div", {
|
|
953
953
|
onClick: e.goBack,
|
|
954
954
|
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",
|
|
955
|
-
children: /* @__PURE__ */
|
|
955
|
+
children: /* @__PURE__ */ H(re, { className: "padorix:size-5" })
|
|
956
956
|
}),
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
src:
|
|
957
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("img", {
|
|
958
|
+
src: x,
|
|
959
959
|
loading: "lazy",
|
|
960
960
|
className: "padorix:size-8 padorix:rounded-full"
|
|
961
961
|
}) }),
|
|
962
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ U("div", {
|
|
963
963
|
className: "padorix:text-gray-600",
|
|
964
|
-
children: [/* @__PURE__ */
|
|
964
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
965
965
|
className: "padorix:font-semibold",
|
|
966
|
-
children:
|
|
967
|
-
}) }), /* @__PURE__ */
|
|
966
|
+
children: b
|
|
967
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
968
968
|
className: "",
|
|
969
|
-
children:
|
|
969
|
+
children: S
|
|
970
970
|
}) })]
|
|
971
971
|
})
|
|
972
972
|
]
|
|
973
|
-
}), /* @__PURE__ */
|
|
973
|
+
}), /* @__PURE__ */ U("div", {
|
|
974
974
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
975
|
-
children: [/* @__PURE__ */
|
|
975
|
+
children: [/* @__PURE__ */ H("div", {
|
|
976
976
|
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
977
|
-
children: /* @__PURE__ */
|
|
978
|
-
position:
|
|
979
|
-
opened:
|
|
980
|
-
onChange:
|
|
977
|
+
children: /* @__PURE__ */ U(G, {
|
|
978
|
+
position: h ? "bottom-end" : "bottom",
|
|
979
|
+
opened: u,
|
|
980
|
+
onChange: d,
|
|
981
981
|
withinPortal: !0,
|
|
982
|
-
portalProps: { target:
|
|
982
|
+
portalProps: { target: _() },
|
|
983
983
|
zIndex: 2147483647,
|
|
984
|
-
children: [/* @__PURE__ */
|
|
985
|
-
onClick: () =>
|
|
984
|
+
children: [/* @__PURE__ */ H(G.Target, { children: /* @__PURE__ */ H("div", {
|
|
985
|
+
onClick: () => d((e) => !e),
|
|
986
986
|
className: "padorix:cursor-pointer padorix:transition-all padorix:size-fit padorix:text-xl",
|
|
987
|
-
children: /* @__PURE__ */
|
|
988
|
-
}) }), /* @__PURE__ */
|
|
989
|
-
className:
|
|
987
|
+
children: /* @__PURE__ */ H(Ue, {})
|
|
988
|
+
}) }), /* @__PURE__ */ H(G.Dropdown, {
|
|
989
|
+
className: l ? "padorix-dark" : void 0,
|
|
990
990
|
styles: { dropdown: {
|
|
991
991
|
padding: 0,
|
|
992
992
|
minWidth: "12rem",
|
|
993
993
|
zIndex: 2147483647,
|
|
994
994
|
border: 0,
|
|
995
|
-
backgroundColor:
|
|
995
|
+
backgroundColor: l ? "#2a3549" : "#fff"
|
|
996
996
|
} },
|
|
997
|
-
children: /* @__PURE__ */
|
|
997
|
+
children: /* @__PURE__ */ U("div", {
|
|
998
998
|
className: "padorix:text-xs padori:flex padorix:flex-col padorix:dark:bg-[#2a3549] padorix:dark:text-white",
|
|
999
999
|
children: [
|
|
1000
|
-
!
|
|
1001
|
-
onClick:
|
|
1000
|
+
!h && /* @__PURE__ */ U("div", {
|
|
1001
|
+
onClick: w,
|
|
1002
1002
|
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",
|
|
1003
|
-
children: [/* @__PURE__ */
|
|
1003
|
+
children: [/* @__PURE__ */ H(ae, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:mr-1" }), "Download Chat transcript"]
|
|
1004
1004
|
}),
|
|
1005
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ U("a", {
|
|
1006
1006
|
target: "_blank",
|
|
1007
1007
|
href: "https://app.farmsac.com/signup",
|
|
1008
1008
|
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",
|
|
1009
|
-
children: [/* @__PURE__ */
|
|
1009
|
+
children: [/* @__PURE__ */ H(R, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Add to your website"]
|
|
1010
1010
|
}),
|
|
1011
|
-
!
|
|
1012
|
-
onClick:
|
|
1011
|
+
!h && a?.status === E.true && /* @__PURE__ */ U("div", {
|
|
1012
|
+
onClick: O,
|
|
1013
1013
|
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",
|
|
1014
|
-
children: [/* @__PURE__ */
|
|
1014
|
+
children: [/* @__PURE__ */ H(We, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Request for Feedback"]
|
|
1015
1015
|
}),
|
|
1016
|
-
|
|
1016
|
+
a?.closed_at === null && (!h || y) && /* @__PURE__ */ H("div", {
|
|
1017
1017
|
className: "padorix:border-t padorix:border-[#d1d5dc] padorix:dark:border-gray-600 padorix:mt-1",
|
|
1018
|
-
children: /* @__PURE__ */
|
|
1019
|
-
onClick:
|
|
1018
|
+
children: /* @__PURE__ */ U("div", {
|
|
1019
|
+
onClick: D,
|
|
1020
1020
|
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",
|
|
1021
|
-
children: [/* @__PURE__ */
|
|
1021
|
+
children: [/* @__PURE__ */ H(Q, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "End Chat Session"]
|
|
1022
1022
|
})
|
|
1023
1023
|
})
|
|
1024
1024
|
]
|
|
1025
1025
|
})
|
|
1026
1026
|
})]
|
|
1027
1027
|
})
|
|
1028
|
-
}),
|
|
1028
|
+
}), h && /* @__PURE__ */ H("div", {
|
|
1029
1029
|
className: "padorix:size-8 padorix:ml-auto",
|
|
1030
|
-
children: /* @__PURE__ */
|
|
1030
|
+
children: /* @__PURE__ */ H("div", {
|
|
1031
1031
|
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",
|
|
1032
1032
|
onClick: e.close,
|
|
1033
|
-
children: /* @__PURE__ */
|
|
1033
|
+
children: /* @__PURE__ */ H(L, {})
|
|
1034
1034
|
})
|
|
1035
1035
|
})]
|
|
1036
1036
|
})]
|
|
@@ -1040,7 +1040,7 @@ function Ue(e) {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
//#endregion
|
|
1042
1042
|
//#region node_modules/react-icons/bs/index.mjs
|
|
1043
|
-
function
|
|
1043
|
+
function Ke(e) {
|
|
1044
1044
|
return Z({
|
|
1045
1045
|
tag: "svg",
|
|
1046
1046
|
attr: {
|
|
@@ -1054,7 +1054,7 @@ function We(e) {
|
|
|
1054
1054
|
}]
|
|
1055
1055
|
})(e);
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function qe(e) {
|
|
1058
1058
|
return Z({
|
|
1059
1059
|
tag: "svg",
|
|
1060
1060
|
attr: {
|
|
@@ -1068,7 +1068,7 @@ function Ge(e) {
|
|
|
1068
1068
|
}]
|
|
1069
1069
|
})(e);
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function Je(e) {
|
|
1072
1072
|
return Z({
|
|
1073
1073
|
tag: "svg",
|
|
1074
1074
|
attr: {
|
|
@@ -1082,7 +1082,7 @@ function Ke(e) {
|
|
|
1082
1082
|
}]
|
|
1083
1083
|
})(e);
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Ye(e) {
|
|
1086
1086
|
return Z({
|
|
1087
1087
|
tag: "svg",
|
|
1088
1088
|
attr: {
|
|
@@ -1100,7 +1100,7 @@ function qe(e) {
|
|
|
1100
1100
|
}]
|
|
1101
1101
|
})(e);
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function Xe(e) {
|
|
1104
1104
|
return Z({
|
|
1105
1105
|
tag: "svg",
|
|
1106
1106
|
attr: {
|
|
@@ -1116,11 +1116,11 @@ function Je(e) {
|
|
|
1116
1116
|
}
|
|
1117
1117
|
//#endregion
|
|
1118
1118
|
//#region lib/chats/chatform/render-text.tsx
|
|
1119
|
-
function
|
|
1119
|
+
function Ze(e) {
|
|
1120
1120
|
if (!e) return "";
|
|
1121
1121
|
let t = /(https?:\/\/[^\s]+)/g, n = /\*(.*?)\*/g;
|
|
1122
1122
|
return e.split(t).map((e, r) => {
|
|
1123
|
-
if (t.test(e)) return /* @__PURE__ */
|
|
1123
|
+
if (t.test(e)) return /* @__PURE__ */ H("a", {
|
|
1124
1124
|
href: e,
|
|
1125
1125
|
target: "_blank",
|
|
1126
1126
|
rel: "noopener noreferrer",
|
|
@@ -1128,7 +1128,7 @@ function Ye(e) {
|
|
|
1128
1128
|
children: e
|
|
1129
1129
|
}, r);
|
|
1130
1130
|
let i = e.split(n);
|
|
1131
|
-
return e.match(n) ? i.map((e, t) => t % 2 == 1 ? /* @__PURE__ */
|
|
1131
|
+
return e.match(n) ? i.map((e, t) => t % 2 == 1 ? /* @__PURE__ */ H("strong", {
|
|
1132
1132
|
className: "padorix:font-bold",
|
|
1133
1133
|
children: e
|
|
1134
1134
|
}, `b-${t}`) : e) : e;
|
|
@@ -1136,58 +1136,58 @@ function Ye(e) {
|
|
|
1136
1136
|
}
|
|
1137
1137
|
//#endregion
|
|
1138
1138
|
//#region lib/chats/chatmessages/chat-message-cover.tsx
|
|
1139
|
-
function
|
|
1140
|
-
let { workspace: t } =
|
|
1141
|
-
if (e.isSender) return /* @__PURE__ */
|
|
1142
|
-
style: { background: e.data?.deleted ===
|
|
1139
|
+
function Qe(e) {
|
|
1140
|
+
let { workspace: t } = j((e) => e.data), n = "padorix:w-fit padorix:h-fit padorix:max-w-[91%] padorix:relative padorix:bottom-3 padorix:md:max-w-[80%]";
|
|
1141
|
+
if (e.isSender) return /* @__PURE__ */ H(B, {
|
|
1142
|
+
style: { background: e.data?.deleted === E.true ? "" : e.data?.message ? String(t?.widget?.colorScheme) : "" },
|
|
1143
1143
|
className: `
|
|
1144
1144
|
${n} padorix:ml-auto
|
|
1145
1145
|
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-bl-xl" : "padorix:rounded-xl"}
|
|
1146
|
-
${e.data?.deleted ===
|
|
1146
|
+
${e.data?.deleted === E.true ? "" : e.data?.message ? "padorix:text-white" : "padorix:text-black!"}`,
|
|
1147
1147
|
children: e.children
|
|
1148
1148
|
});
|
|
1149
|
-
if (!e.isSender) return /* @__PURE__ */
|
|
1149
|
+
if (!e.isSender) return /* @__PURE__ */ H(B, {
|
|
1150
1150
|
className: `${n} padorix:mr-auto
|
|
1151
1151
|
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-br-xl" : "padorix:rounded-xl"}
|
|
1152
|
-
${e.data?.deleted ===
|
|
1152
|
+
${e.data?.deleted === E.true ? "" : e.data?.message ? "padorix:bg-[#f6f6f6] padorix:text-black" : "padorix:text-black!"}`,
|
|
1153
1153
|
children: e.children
|
|
1154
1154
|
});
|
|
1155
1155
|
}
|
|
1156
1156
|
//#endregion
|
|
1157
1157
|
//#region lib/chats/chatmessages/chat-avatar.tsx
|
|
1158
|
-
function
|
|
1159
|
-
return /* @__PURE__ */
|
|
1158
|
+
function $e(e) {
|
|
1159
|
+
return /* @__PURE__ */ H(de, {
|
|
1160
1160
|
direction: "up",
|
|
1161
|
-
children: /* @__PURE__ */
|
|
1161
|
+
children: /* @__PURE__ */ H("div", {
|
|
1162
1162
|
className: "padorix:self-end padorix:mb-3 padorix:w-10",
|
|
1163
|
-
children: e.isLastInGroup ? /* @__PURE__ */
|
|
1163
|
+
children: e.isLastInGroup ? /* @__PURE__ */ H("div", {
|
|
1164
1164
|
className: "padorix:size-8",
|
|
1165
|
-
children: /* @__PURE__ */
|
|
1165
|
+
children: /* @__PURE__ */ H("img", {
|
|
1166
1166
|
src: e.img,
|
|
1167
1167
|
alt: "Padorix",
|
|
1168
1168
|
className: "padorix:size-8 padorix:border-2 padorix:rounded-full padorix:shadow-md padorix:border-white"
|
|
1169
1169
|
})
|
|
1170
|
-
}) : /* @__PURE__ */
|
|
1170
|
+
}) : /* @__PURE__ */ H("div", { className: "padorix:size-10" })
|
|
1171
1171
|
})
|
|
1172
1172
|
});
|
|
1173
1173
|
}
|
|
1174
1174
|
//#endregion
|
|
1175
1175
|
//#region lib/chats/chatmessages/chat-delete-selector.tsx
|
|
1176
|
-
function
|
|
1177
|
-
let { workspace: t } =
|
|
1178
|
-
return /* @__PURE__ */
|
|
1176
|
+
function et(e) {
|
|
1177
|
+
let { workspace: t } = j((e) => e.data), n = e.messagesToDelete?.find((t) => t === e.data?.id);
|
|
1178
|
+
return /* @__PURE__ */ H("div", {
|
|
1179
1179
|
style: { background: n ? String(t?.widget?.colorScheme) : "#e4e4e7" },
|
|
1180
1180
|
onClick: () => e.handleDeleteAction(e.data?.id),
|
|
1181
1181
|
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",
|
|
1182
|
-
children: /* @__PURE__ */
|
|
1182
|
+
children: /* @__PURE__ */ H("div", {
|
|
1183
1183
|
className: "padorix:size-6 padorix:flex padorix:items-center padorix:justify-center",
|
|
1184
|
-
children:
|
|
1184
|
+
children: H(n ? je : Oe, { className: "padorix:text-white" })
|
|
1185
1185
|
})
|
|
1186
1186
|
});
|
|
1187
1187
|
}
|
|
1188
1188
|
//#endregion
|
|
1189
1189
|
//#region lib/chats/chatmessages/chat-image-viewer.tsx
|
|
1190
|
-
function
|
|
1190
|
+
function tt(e) {
|
|
1191
1191
|
let t = e.data?.images, n = [];
|
|
1192
1192
|
if (Array.isArray(t)) n = t.filter((e) => typeof e == "string" && e.length > 0);
|
|
1193
1193
|
else if (typeof t == "string") try {
|
|
@@ -1196,11 +1196,11 @@ function $e(e) {
|
|
|
1196
1196
|
} catch {
|
|
1197
1197
|
n = t.length > 0 ? [t] : [];
|
|
1198
1198
|
}
|
|
1199
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ H("div", {
|
|
1200
1200
|
className: "padorix:min-w-0 padorix:max-w-full",
|
|
1201
|
-
children: n.length > 0 && /* @__PURE__ */
|
|
1201
|
+
children: n.length > 0 && /* @__PURE__ */ H("div", {
|
|
1202
1202
|
className: "padorix:flex padorix:min-w-0 padorix:max-w-full padorix:flex-col padorix:items-end padorix:gap-1",
|
|
1203
|
-
children: n.map((e, t) => /* @__PURE__ */
|
|
1203
|
+
children: n.map((e, t) => /* @__PURE__ */ H("img", {
|
|
1204
1204
|
src: e,
|
|
1205
1205
|
alt: "Attachment",
|
|
1206
1206
|
loading: "lazy",
|
|
@@ -1212,7 +1212,7 @@ function $e(e) {
|
|
|
1212
1212
|
}
|
|
1213
1213
|
//#endregion
|
|
1214
1214
|
//#region lib/chats/chatmessages/chat-reply.tsx
|
|
1215
|
-
function
|
|
1215
|
+
function nt(e) {
|
|
1216
1216
|
if (Array.isArray(e)) return e.filter((e) => typeof e == "string" && e.length > 0);
|
|
1217
1217
|
if (typeof e == "string" && e.length > 0) try {
|
|
1218
1218
|
let t = JSON.parse(e);
|
|
@@ -1222,17 +1222,17 @@ function et(e) {
|
|
|
1222
1222
|
}
|
|
1223
1223
|
return [];
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1226
|
-
let t = e.data?.replies?.[0], n = t?.id ?
|
|
1227
|
-
if (t?.id) return /* @__PURE__ */
|
|
1225
|
+
function rt(e) {
|
|
1226
|
+
let t = e.data?.replies?.[0], n = t?.id ? nt(t?.repliedTo?.images) : [], r = nt(t?.repliedTo?.message).join(" ");
|
|
1227
|
+
if (t?.id) return /* @__PURE__ */ H("div", {
|
|
1228
1228
|
className: "padorix:px-0.5 padorix:pt-0.5",
|
|
1229
|
-
children: /* @__PURE__ */
|
|
1229
|
+
children: /* @__PURE__ */ U("div", {
|
|
1230
1230
|
onClick: () => e.handleScrollToTargetMessage(String(t?.replyId)),
|
|
1231
1231
|
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"}`,
|
|
1232
|
-
children: [/* @__PURE__ */
|
|
1232
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1233
1233
|
className: "padorix:w-full",
|
|
1234
1234
|
children: [r.slice(0, 40), r.length > 40 ? "..." : ""]
|
|
1235
|
-
}), n?.length > 0 && /* @__PURE__ */
|
|
1235
|
+
}), n?.length > 0 && /* @__PURE__ */ H("div", { children: /* @__PURE__ */ H("img", {
|
|
1236
1236
|
src: n[0],
|
|
1237
1237
|
alt: "Padorix",
|
|
1238
1238
|
className: "padorix:size-6"
|
|
@@ -1242,24 +1242,24 @@ function tt(e) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
//#endregion
|
|
1244
1244
|
//#region lib/chats/chatmessages/single-message-pop.tsx
|
|
1245
|
-
function
|
|
1246
|
-
let t =
|
|
1247
|
-
function
|
|
1245
|
+
function it(e) {
|
|
1246
|
+
let t = A(), { reply: r, conversation: i, workspace: a } = j((e) => e.data), o = f(a?.widget?.darkMode, !1);
|
|
1247
|
+
function s(t) {
|
|
1248
1248
|
t.stopPropagation(), e.setOpens((e) => !e);
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1251
|
-
t(
|
|
1252
|
-
...
|
|
1250
|
+
function c() {
|
|
1251
|
+
t(n({
|
|
1252
|
+
...r,
|
|
1253
1253
|
messageId: e.data?.id
|
|
1254
|
-
})), t(
|
|
1254
|
+
})), t(h(e.data)), e.handleClick();
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function l(t) {
|
|
1257
1257
|
e.handleStarMessage(e.data?.id, t), e.handleClick();
|
|
1258
1258
|
}
|
|
1259
1259
|
function d() {
|
|
1260
|
-
|
|
1260
|
+
u(String(e.data?.message)), e.handleClick();
|
|
1261
1261
|
}
|
|
1262
|
-
async function
|
|
1262
|
+
async function p() {
|
|
1263
1263
|
let t = Array.isArray(e.data.images) ? e.data.images : [];
|
|
1264
1264
|
for (let [e, n] of t.entries()) {
|
|
1265
1265
|
let t = (() => {
|
|
@@ -1283,66 +1283,66 @@ function nt(e) {
|
|
|
1283
1283
|
e.handleClick();
|
|
1284
1284
|
}
|
|
1285
1285
|
let m = Array.isArray(e.data.images) && e.data.images.length > 0;
|
|
1286
|
-
return /* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ U(G, {
|
|
1287
1287
|
opened: e.opens,
|
|
1288
1288
|
onChange: e.setOpens,
|
|
1289
1289
|
position: "top",
|
|
1290
1290
|
withArrow: !0,
|
|
1291
1291
|
withinPortal: !0,
|
|
1292
|
-
portalProps: { target:
|
|
1292
|
+
portalProps: { target: _() },
|
|
1293
1293
|
zIndex: 2147483647,
|
|
1294
|
-
children: [/* @__PURE__ */
|
|
1295
|
-
onClick:
|
|
1294
|
+
children: [/* @__PURE__ */ H(G.Target, { children: /* @__PURE__ */ H("div", {
|
|
1295
|
+
onClick: s,
|
|
1296
1296
|
className: `padorix:absolute padorix:top-0 padorix:cursor-pointer padorix:size-fit padorix:text-lg padorix:transition-all padorix:hover:scale-110 ${e.isSender, "padorix:-right-5"}`,
|
|
1297
|
-
children: /* @__PURE__ */
|
|
1298
|
-
}) }), /* @__PURE__ */
|
|
1299
|
-
className:
|
|
1297
|
+
children: /* @__PURE__ */ H(Ue, { style: { color: String(a?.widget?.colorScheme) } })
|
|
1298
|
+
}) }), /* @__PURE__ */ H(G.Dropdown, {
|
|
1299
|
+
className: o ? "padorix-dark" : void 0,
|
|
1300
1300
|
styles: { dropdown: {
|
|
1301
1301
|
padding: 0,
|
|
1302
1302
|
minWidth: "10rem",
|
|
1303
1303
|
zIndex: 2147483647,
|
|
1304
1304
|
border: 0,
|
|
1305
|
-
backgroundColor:
|
|
1305
|
+
backgroundColor: o ? "#2a3549" : "#fff"
|
|
1306
1306
|
} },
|
|
1307
|
-
children: /* @__PURE__ */
|
|
1307
|
+
children: /* @__PURE__ */ U("div", {
|
|
1308
1308
|
className: "padorix:text-xs padorix:text-gray-800 padorix:dark:bg-[#2a3549] padorix:dark:text-white padorix:rounded-lg",
|
|
1309
1309
|
children: [
|
|
1310
|
-
|
|
1311
|
-
onClick:
|
|
1310
|
+
i?.status === E.true && /* @__PURE__ */ U("div", {
|
|
1311
|
+
onClick: c,
|
|
1312
1312
|
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",
|
|
1313
|
-
children: [/* @__PURE__ */
|
|
1313
|
+
children: [/* @__PURE__ */ H(ne, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Reply"]
|
|
1314
1314
|
}),
|
|
1315
|
-
e.isMessage && /* @__PURE__ */
|
|
1315
|
+
e.isMessage && /* @__PURE__ */ U("div", {
|
|
1316
1316
|
onClick: d,
|
|
1317
1317
|
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",
|
|
1318
|
-
children: [/* @__PURE__ */
|
|
1318
|
+
children: [/* @__PURE__ */ H(ie, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Copy"]
|
|
1319
1319
|
}),
|
|
1320
|
-
m && /* @__PURE__ */
|
|
1321
|
-
onClick:
|
|
1320
|
+
m && /* @__PURE__ */ U("div", {
|
|
1321
|
+
onClick: p,
|
|
1322
1322
|
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",
|
|
1323
1323
|
children: [
|
|
1324
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ H(ke, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1325
1325
|
" Download image",
|
|
1326
1326
|
e.data.images.length > 1 ? "s" : ""
|
|
1327
1327
|
]
|
|
1328
1328
|
}),
|
|
1329
|
-
|
|
1330
|
-
onClick: () =>
|
|
1329
|
+
i?.status === E.true && /* @__PURE__ */ U("div", {
|
|
1330
|
+
onClick: () => l(e.data?.starred === E.true ? E.false : E.true),
|
|
1331
1331
|
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",
|
|
1332
1332
|
children: [
|
|
1333
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ H(ce, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1334
1334
|
" ",
|
|
1335
|
-
e.data?.starred ===
|
|
1336
|
-
e.data?.starred ===
|
|
1335
|
+
e.data?.starred === E.true ? "Unstar" : "Star",
|
|
1336
|
+
e.data?.starred === E.true && /* @__PURE__ */ H(Ke, { className: "padorix:size-2 padorix:inline padorix:text-amber-400 padorix:ml-1" })
|
|
1337
1337
|
]
|
|
1338
1338
|
}),
|
|
1339
1339
|
e.moreActions,
|
|
1340
|
-
|
|
1340
|
+
i?.status === E.true && e.isSender && e.canDeleteMessage && /* @__PURE__ */ H("div", {
|
|
1341
1341
|
className: "padorix:border-t padorix:border-gray-200 padorix:dark:border-gray-500",
|
|
1342
|
-
children: /* @__PURE__ */
|
|
1342
|
+
children: /* @__PURE__ */ U("div", {
|
|
1343
1343
|
onClick: () => e.handleDeleteAction(e.data?.id),
|
|
1344
1344
|
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",
|
|
1345
|
-
children: [/* @__PURE__ */
|
|
1345
|
+
children: [/* @__PURE__ */ H(le, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Delete"]
|
|
1346
1346
|
})
|
|
1347
1347
|
})
|
|
1348
1348
|
]
|
|
@@ -1352,8 +1352,8 @@ function nt(e) {
|
|
|
1352
1352
|
}
|
|
1353
1353
|
//#endregion
|
|
1354
1354
|
//#region lib/chats/chatmessages/chat-single-message.tsx
|
|
1355
|
-
function
|
|
1356
|
-
let [s,
|
|
1355
|
+
function at({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage: r, messages: i, userType: a, moreActions: o }) {
|
|
1356
|
+
let [s, c] = M.useState(!1), [l, u] = M.useState(!1), { workspace: d } = j((e) => e.data), f = String(e?.message ?? "").trim().length > 0, p = a === "VISITOR", m = d?.widget?.notifications?.customerDeletesMessage === E.true, h = !p || m, g = p ? e?.senderType === "VISITOR" : e?.senderType !== "VISITOR", _ = M.useMemo(() => {
|
|
1357
1357
|
if (!i?.length || !e?.id) return !1;
|
|
1358
1358
|
let t = i.findIndex((t) => t.id === e.id);
|
|
1359
1359
|
if (t === -1) return !1;
|
|
@@ -1365,11 +1365,11 @@ function rt({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1365
1365
|
i,
|
|
1366
1366
|
e.id,
|
|
1367
1367
|
e.senderType
|
|
1368
|
-
]),
|
|
1369
|
-
|
|
1370
|
-
}, []),
|
|
1371
|
-
n(e),
|
|
1372
|
-
}, [n,
|
|
1368
|
+
]), v = M.useCallback(() => {
|
|
1369
|
+
c(!1);
|
|
1370
|
+
}, []), y = M.useCallback((e) => {
|
|
1371
|
+
n(e), v();
|
|
1372
|
+
}, [n, v]), b = M.useCallback((t) => {
|
|
1373
1373
|
if (!t) return;
|
|
1374
1374
|
let n = document.getElementById(`padorix-msg-${t}`);
|
|
1375
1375
|
if (n) {
|
|
@@ -1377,28 +1377,28 @@ function rt({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1377
1377
|
behavior: "smooth",
|
|
1378
1378
|
block: "center"
|
|
1379
1379
|
}), e.id === t) {
|
|
1380
|
-
|
|
1380
|
+
u(!0);
|
|
1381
1381
|
return;
|
|
1382
1382
|
}
|
|
1383
1383
|
window.dispatchEvent(new CustomEvent(`padorix-flash-${t}`));
|
|
1384
1384
|
}
|
|
1385
1385
|
}, [e.id]);
|
|
1386
|
-
return
|
|
1386
|
+
return M.useEffect(() => {
|
|
1387
1387
|
let t = `padorix-flash-${e.id}`, n = () => {
|
|
1388
|
-
|
|
1388
|
+
u(!0);
|
|
1389
1389
|
};
|
|
1390
1390
|
return window.addEventListener(t, n), () => {
|
|
1391
1391
|
window.removeEventListener(t, n);
|
|
1392
1392
|
};
|
|
1393
|
-
}, [e.id]),
|
|
1394
|
-
if (!
|
|
1393
|
+
}, [e.id]), M.useEffect(() => {
|
|
1394
|
+
if (!l) return;
|
|
1395
1395
|
let e = window.setTimeout(() => {
|
|
1396
|
-
|
|
1396
|
+
u(!1);
|
|
1397
1397
|
}, 1500);
|
|
1398
1398
|
return () => {
|
|
1399
1399
|
window.clearTimeout(e);
|
|
1400
1400
|
};
|
|
1401
|
-
}, [
|
|
1401
|
+
}, [l]), /* @__PURE__ */ H(V, { children: /* @__PURE__ */ U("div", {
|
|
1402
1402
|
id: `padorix-msg-${e.id}`,
|
|
1403
1403
|
className: `
|
|
1404
1404
|
padorix:flex
|
|
@@ -1410,114 +1410,114 @@ function rt({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1410
1410
|
padorix:transition-all
|
|
1411
1411
|
padorix:duration-500
|
|
1412
1412
|
padorix:ease-in-out
|
|
1413
|
-
${
|
|
1413
|
+
${l ? "padorix:bg-gray-100/80 padorix:scale-[1.01]" : "padorix:bg-transparent"}
|
|
1414
1414
|
`,
|
|
1415
1415
|
children: [
|
|
1416
|
-
!
|
|
1417
|
-
isLastInGroup:
|
|
1418
|
-
img: String(
|
|
1416
|
+
!g && /* @__PURE__ */ H($e, {
|
|
1417
|
+
isLastInGroup: _,
|
|
1418
|
+
img: String(d?.logo ?? "")
|
|
1419
1419
|
}),
|
|
1420
|
-
|
|
1420
|
+
h && t?.length > 0 && e?.deleted === E.false && /* @__PURE__ */ H(et, {
|
|
1421
1421
|
data: e,
|
|
1422
|
-
handleDeleteAction:
|
|
1422
|
+
handleDeleteAction: y,
|
|
1423
1423
|
messagesToDelete: t
|
|
1424
1424
|
}),
|
|
1425
|
-
/* @__PURE__ */
|
|
1426
|
-
isLastInGroup:
|
|
1427
|
-
isSender:
|
|
1425
|
+
/* @__PURE__ */ H(Qe, {
|
|
1426
|
+
isLastInGroup: _,
|
|
1427
|
+
isSender: g,
|
|
1428
1428
|
data: e,
|
|
1429
|
-
children: /* @__PURE__ */
|
|
1429
|
+
children: /* @__PURE__ */ U("div", {
|
|
1430
1430
|
className: "padorix:w-full padorix:px-1",
|
|
1431
|
-
children: [e?.deleted ===
|
|
1431
|
+
children: [e?.deleted === E.false && /* @__PURE__ */ H(it, {
|
|
1432
1432
|
data: e,
|
|
1433
1433
|
deleteAction: n,
|
|
1434
1434
|
handleStarMessage: r,
|
|
1435
|
-
isSender:
|
|
1436
|
-
isMessage:
|
|
1437
|
-
handleClick:
|
|
1438
|
-
handleDeleteAction:
|
|
1439
|
-
setOpens:
|
|
1435
|
+
isSender: g,
|
|
1436
|
+
isMessage: f,
|
|
1437
|
+
handleClick: v,
|
|
1438
|
+
handleDeleteAction: y,
|
|
1439
|
+
setOpens: c,
|
|
1440
1440
|
opens: s,
|
|
1441
1441
|
moreActions: o,
|
|
1442
|
-
canDeleteMessage:
|
|
1443
|
-
}), /* @__PURE__ */
|
|
1442
|
+
canDeleteMessage: h
|
|
1443
|
+
}), /* @__PURE__ */ H("div", {
|
|
1444
1444
|
className: "padorix:p-1 padorix:whitespace-pre-wrap",
|
|
1445
|
-
children: e?.deleted ===
|
|
1445
|
+
children: e?.deleted === E.true ? /* @__PURE__ */ U("div", {
|
|
1446
1446
|
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",
|
|
1447
|
-
children: [/* @__PURE__ */
|
|
1448
|
-
}) : /* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1447
|
+
children: [/* @__PURE__ */ H(Xe, {}), /* @__PURE__ */ H("span", { children: "This message was deleted" })]
|
|
1448
|
+
}) : /* @__PURE__ */ U(V, { children: [
|
|
1449
|
+
/* @__PURE__ */ H(rt, {
|
|
1450
1450
|
data: e,
|
|
1451
|
-
isSender:
|
|
1452
|
-
handleScrollToTargetMessage:
|
|
1451
|
+
isSender: g,
|
|
1452
|
+
handleScrollToTargetMessage: b
|
|
1453
1453
|
}),
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
|
|
1454
|
+
/* @__PURE__ */ H(tt, { data: e }),
|
|
1455
|
+
f && /* @__PURE__ */ H("div", {
|
|
1456
1456
|
className: "padorix:text-[0.8rem] padorix:whitespace-pre-wrap padorix:mt-2",
|
|
1457
|
-
children:
|
|
1457
|
+
children: Ze(String(e.message))
|
|
1458
1458
|
}),
|
|
1459
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ U("div", {
|
|
1460
1460
|
className: "padorix:text-right padorix:text-[12px] padorix:mt-1 padorix:flex padorix:items-center padorix:justify-end padorix:gap-1 padorix:pl-2",
|
|
1461
1461
|
children: [
|
|
1462
|
-
!
|
|
1462
|
+
!p && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("span", {
|
|
1463
1463
|
className: "padorix:text-[0.65rem]",
|
|
1464
1464
|
children: e?.senderType
|
|
1465
|
-
}), /* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1465
|
+
}), /* @__PURE__ */ H(se, {})] }),
|
|
1466
|
+
/* @__PURE__ */ H("span", {
|
|
1467
1467
|
className: "padorix:text-[0.55rem]",
|
|
1468
1468
|
children: K(e?.createdAt).format("hh:mm A")
|
|
1469
1469
|
}),
|
|
1470
|
-
e?.starred ===
|
|
1471
|
-
|
|
1470
|
+
e?.starred === E.true && /* @__PURE__ */ H(ue, { children: /* @__PURE__ */ H(Ke, { className: "padorix:size-3 padorix:text-amber-400" }) }),
|
|
1471
|
+
g && /* @__PURE__ */ H(Ye, { className: "padorix:inline padorix:text-base padorix:size-3" })
|
|
1472
1472
|
]
|
|
1473
1473
|
})
|
|
1474
1474
|
] })
|
|
1475
1475
|
})]
|
|
1476
1476
|
})
|
|
1477
1477
|
}),
|
|
1478
|
-
|
|
1479
|
-
isLastInGroup:
|
|
1478
|
+
p ? e?.deleted === E.false && g && /* @__PURE__ */ H($e, {
|
|
1479
|
+
isLastInGroup: _,
|
|
1480
1480
|
img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJ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vSVCUeJQkmDaIDs1X36Ob0kAt2R+PiIURkIQkfRpIjDxS+eeltAUvrfrNrnT8Av6dzEVi4UIYMOtEnQSsGHBIsjC7vlaPHvWJuqAgs4JFORBjpxBXC7vX9EVhYLP1nKuprXUaRNjgLWfbcTKQmj/U+W3o+KfRJv93kMEZhg7CgaioSGOvl9qM5E3p1IEb6MAiqpsLnkER4tPo5HgFrPfHo5uug0hdcCIYf7Z6LJJDh8jmlHRq2dbk46ZMgHLlRR1m09gnPwcbr5eip9fbUW0RLnwRh1epUZ+6z0A8MlGj3iv+u9YqXfmQIFc/8b/7TSCLiE4+PTnunG2Nm0wOndor65Ap/4/TxJ92G6ti4rzZ0f/KxyE++1JvQ5/u60tNi4T8tvWvfPJQg8msrdQLa+NnikCFxqO4Tp4cWH9go2j+2hGT03t6u9CEqwZDetfc9lJAQzcdmmIQNO1/uqR7COqQl9ry8c0M0r99HQgKad+j77rQoIaSlddf9fl6Ur38eAXppf6g70RAF+Yn/Of3Cw2hI/nshJDy4//uegLiYrDYEeupeOJgwVPfnILx0aEtXXSI0JPAP67q2HHo4Ju65OmkT1tC8nW+FejqrDWkCIBKx9/au0FsfzcMqvl+NYmTcm2x88P0/dXaFvByIxMF9pxmqvaFTdZ++f3AjitHbX/gAlHvchocP7Bt2+lR3uzfRYOBwJPY6xp4NhupAe/ep0LB9Bx7c0LuLxNrU93MYEr786rO//s3Q3nWq53RdvddrNHq99XWne051tRv+8a8DX33J/yh23A/MEJv4fzZ+fvDv33y9f++nXwxLS1v3xV/27v/6m38enLeBL3cTNony/n9GHU2UlcLeHAAAAABJRU5ErkJggg=="
|
|
1481
|
-
}) : /* @__PURE__ */
|
|
1481
|
+
}) : /* @__PURE__ */ H("div", { className: "padorix:size-7" })
|
|
1482
1482
|
]
|
|
1483
1483
|
}) });
|
|
1484
1484
|
}
|
|
1485
1485
|
//#endregion
|
|
1486
1486
|
//#region lib/chats/newchat/chat-input.tsx
|
|
1487
|
-
var $ =
|
|
1487
|
+
var $ = P(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
1488
1488
|
className: "padorix:mb-4",
|
|
1489
1489
|
children: [
|
|
1490
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ U("div", {
|
|
1491
1491
|
className: "padorix:mb-1 padorix:ml-2 padorix:text-[0.8rem] padorix:font-medium",
|
|
1492
1492
|
children: [
|
|
1493
1493
|
n.content,
|
|
1494
1494
|
" ",
|
|
1495
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ H("span", {
|
|
1496
1496
|
className: "padorix:text-red-600",
|
|
1497
1497
|
children: "*"
|
|
1498
1498
|
}),
|
|
1499
1499
|
" "
|
|
1500
1500
|
]
|
|
1501
1501
|
}),
|
|
1502
|
-
t === "input" && /* @__PURE__ */
|
|
1502
|
+
t === "input" && /* @__PURE__ */ H("input", {
|
|
1503
1503
|
type: e,
|
|
1504
1504
|
...n,
|
|
1505
1505
|
ref: r,
|
|
1506
1506
|
placeholder: n.placeholder,
|
|
1507
1507
|
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"}`
|
|
1508
1508
|
}),
|
|
1509
|
-
t === "textarea" && /* @__PURE__ */
|
|
1509
|
+
t === "textarea" && /* @__PURE__ */ H("textarea", {
|
|
1510
1510
|
...n,
|
|
1511
1511
|
ref: r,
|
|
1512
1512
|
placeholder: "Leave a message",
|
|
1513
1513
|
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"}`
|
|
1514
1514
|
}),
|
|
1515
|
-
n.error && /* @__PURE__ */
|
|
1515
|
+
n.error && /* @__PURE__ */ H("div", {
|
|
1516
1516
|
className: "padorix:text-red-400 padorix:text-xs",
|
|
1517
1517
|
children: n.error
|
|
1518
1518
|
})
|
|
1519
1519
|
]
|
|
1520
|
-
}) })),
|
|
1520
|
+
}) })), ot = [
|
|
1521
1521
|
{
|
|
1522
1522
|
index: 1,
|
|
1523
1523
|
color: "padorix:text-red-600"
|
|
@@ -1539,31 +1539,31 @@ var $ = M(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__
|
|
|
1539
1539
|
color: "padorix:text-green-400"
|
|
1540
1540
|
}
|
|
1541
1541
|
];
|
|
1542
|
-
function
|
|
1542
|
+
function st(e) {
|
|
1543
1543
|
function t(t) {
|
|
1544
1544
|
let n = t?.split("-")[1];
|
|
1545
1545
|
if (e.value !== t) return e.setFieldValue?.(e.valueName || "", t), e.setFieldValue2?.(e.valueName2 || "", n);
|
|
1546
1546
|
e.setFieldValue?.(e.valueName || "", ""), e.setFieldValue2?.(e.valueName2 || "", "");
|
|
1547
1547
|
}
|
|
1548
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ U("div", {
|
|
1549
1549
|
className: "padorix:mb-5",
|
|
1550
1550
|
children: [
|
|
1551
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ H("div", {
|
|
1552
1552
|
className: "",
|
|
1553
1553
|
children: e.content
|
|
1554
1554
|
}),
|
|
1555
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ H("div", {
|
|
1556
1556
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
1557
|
-
children: Object.values(
|
|
1558
|
-
let i = Object.values(
|
|
1559
|
-
return /* @__PURE__ */
|
|
1557
|
+
children: Object.values(m).map((n, r) => {
|
|
1558
|
+
let i = Object.values(m).findIndex((t) => t?.split("-")[1] === e.value2) + 1, a = r + 1 <= i, o = ot.find((e) => e.index === i);
|
|
1559
|
+
return /* @__PURE__ */ H("div", {
|
|
1560
1560
|
onClick: () => e.tag === "write" ? t(n) : {},
|
|
1561
1561
|
className: `${e.tag === "write" ? "padorix:cursor-pointer padorix:active:scale-125 padorix:transition-all padorix:hover:scale-110" : ""} padorix:text-3xl`,
|
|
1562
|
-
children: /* @__PURE__ */
|
|
1562
|
+
children: /* @__PURE__ */ H(Ke, { className: a ? o?.color : "padorix:text-gray-400" })
|
|
1563
1563
|
}, r);
|
|
1564
1564
|
})
|
|
1565
1565
|
}),
|
|
1566
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ H("div", {
|
|
1567
1567
|
className: "padorix:mt-2 padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1568
1568
|
children: e.value?.split("-")[0]?.replace("_", " ")
|
|
1569
1569
|
})
|
|
@@ -1572,8 +1572,8 @@ function at(e) {
|
|
|
1572
1572
|
}
|
|
1573
1573
|
//#endregion
|
|
1574
1574
|
//#region lib/chats/chatmessages/chat-feedback-form.tsx
|
|
1575
|
-
function
|
|
1576
|
-
let { sender: e, conversation: t, workspace:
|
|
1575
|
+
function ct() {
|
|
1576
|
+
let { sender: e, conversation: t, workspace: n } = j((e) => e.data), [r, i] = F(!1), a = A(), o = Be(T.VISITOR), s = me({
|
|
1577
1577
|
mode: "uncontrolled",
|
|
1578
1578
|
initialValues: {
|
|
1579
1579
|
workspaceId: t?.workspaceId,
|
|
@@ -1593,45 +1593,45 @@ function ot() {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
});
|
|
1595
1595
|
async function l(e) {
|
|
1596
|
-
if (
|
|
1597
|
-
|
|
1596
|
+
if (o) {
|
|
1597
|
+
i(!0);
|
|
1598
1598
|
try {
|
|
1599
|
-
|
|
1599
|
+
a(g(await v.submitFeedback(o, {
|
|
1600
1600
|
comment: e.comment,
|
|
1601
1601
|
satisfactory: e.satisfactory?.split("-")[0]?.replace("_", " "),
|
|
1602
1602
|
rating: Number(e.rating)
|
|
1603
|
-
}))),
|
|
1603
|
+
}))), s.reset();
|
|
1604
1604
|
} catch (e) {
|
|
1605
|
-
|
|
1605
|
+
i(!1), c(e.message, "error");
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
1609
|
-
return
|
|
1610
|
-
onSubmit:
|
|
1609
|
+
return r ? null : /* @__PURE__ */ U("form", {
|
|
1610
|
+
onSubmit: s.onSubmit(l),
|
|
1611
1611
|
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1612
1612
|
children: [
|
|
1613
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ H(st, {
|
|
1614
1614
|
content: "",
|
|
1615
|
-
value:
|
|
1616
|
-
value2:
|
|
1615
|
+
value: s.values.satisfactory,
|
|
1616
|
+
value2: s.values.rating,
|
|
1617
1617
|
tag: "write",
|
|
1618
1618
|
valueName: "satisfactory",
|
|
1619
1619
|
valueName2: "rating",
|
|
1620
|
-
setFieldValue:
|
|
1621
|
-
setFieldValue2:
|
|
1620
|
+
setFieldValue: s.setFieldValue,
|
|
1621
|
+
setFieldValue2: s.setFieldValue
|
|
1622
1622
|
}),
|
|
1623
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ N($, {
|
|
1624
1624
|
content: "",
|
|
1625
1625
|
formtype: "textarea",
|
|
1626
|
-
error:
|
|
1627
|
-
...
|
|
1628
|
-
key:
|
|
1626
|
+
error: s.errors.comment?.toString() || "",
|
|
1627
|
+
...s.getInputProps("comment"),
|
|
1628
|
+
key: s.key("comment")
|
|
1629
1629
|
}),
|
|
1630
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ H("div", {
|
|
1631
1631
|
className: "padorix:mt-5",
|
|
1632
|
-
children: /* @__PURE__ */
|
|
1633
|
-
style: { background:
|
|
1634
|
-
className: `padorix:cursor-pointer ${
|
|
1632
|
+
children: /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
1633
|
+
style: { background: s.submitting ? "" : String(n?.widget?.colorScheme) },
|
|
1634
|
+
className: `padorix:cursor-pointer ${s.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`,
|
|
1635
1635
|
children: "Submit your feedback"
|
|
1636
1636
|
}) })
|
|
1637
1637
|
})
|
|
@@ -1640,47 +1640,47 @@ function ot() {
|
|
|
1640
1640
|
}
|
|
1641
1641
|
//#endregion
|
|
1642
1642
|
//#region lib/chats/chatmessages/end-chat-confirmation.tsx
|
|
1643
|
-
function
|
|
1644
|
-
let { chatToEnd: e, workspace: t } =
|
|
1645
|
-
function
|
|
1646
|
-
|
|
1643
|
+
function lt() {
|
|
1644
|
+
let { chatToEnd: e, workspace: t } = j((e) => e.data), n = A(), [r, i] = M.useState(!1);
|
|
1645
|
+
function a() {
|
|
1646
|
+
n(o(void 0));
|
|
1647
1647
|
}
|
|
1648
|
-
async function
|
|
1648
|
+
async function s() {
|
|
1649
1649
|
if (e) {
|
|
1650
|
-
|
|
1650
|
+
i(!0);
|
|
1651
1651
|
try {
|
|
1652
|
-
|
|
1652
|
+
n(g(await v.endChat({
|
|
1653
1653
|
workspaceId: e.workspaceId,
|
|
1654
1654
|
conversationId: e.conversationId,
|
|
1655
1655
|
senderId: e.senderId,
|
|
1656
1656
|
userType: e.userType,
|
|
1657
1657
|
senderName: e.senderName
|
|
1658
|
-
}))),
|
|
1658
|
+
}))), n(o(void 0));
|
|
1659
1659
|
} catch (e) {
|
|
1660
|
-
|
|
1660
|
+
c(e.message, "error");
|
|
1661
1661
|
} finally {
|
|
1662
|
-
|
|
1662
|
+
i(!1);
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
|
-
return /* @__PURE__ */
|
|
1666
|
+
return /* @__PURE__ */ U("div", {
|
|
1667
1667
|
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1668
|
-
children: [/* @__PURE__ */
|
|
1668
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1669
1669
|
className: "padorix:text-center padorix:text-slate-500",
|
|
1670
1670
|
children: "Kindly confirm your request to end this chat session"
|
|
1671
|
-
}), /* @__PURE__ */
|
|
1671
|
+
}), /* @__PURE__ */ H("div", {
|
|
1672
1672
|
className: "padorix:border-t padorix:border-gray-200 padorix:mt-5",
|
|
1673
|
-
children: /* @__PURE__ */
|
|
1673
|
+
children: /* @__PURE__ */ U("div", {
|
|
1674
1674
|
className: "padorix:mt-2 padorix:size-fit padorix:ml-auto padorix:flex padorix:items-center padorix:gap-5",
|
|
1675
|
-
children: [/* @__PURE__ */
|
|
1676
|
-
onClick:
|
|
1677
|
-
className: `${
|
|
1675
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
1676
|
+
onClick: a,
|
|
1677
|
+
className: `${r ? "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`,
|
|
1678
1678
|
children: "Cancel"
|
|
1679
|
-
}) }), /* @__PURE__ */
|
|
1680
|
-
onClick:
|
|
1681
|
-
disabled:
|
|
1679
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
1680
|
+
onClick: s,
|
|
1681
|
+
disabled: r,
|
|
1682
1682
|
style: { background: String(t?.widget?.colorScheme) },
|
|
1683
|
-
className: `${
|
|
1683
|
+
className: `${r ? "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`,
|
|
1684
1684
|
children: "End chat"
|
|
1685
1685
|
}) })]
|
|
1686
1686
|
})
|
|
@@ -1689,15 +1689,15 @@ function st() {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
//#endregion
|
|
1691
1691
|
//#region lib/chats/chatmessages/chat-messages.tsx
|
|
1692
|
-
function
|
|
1693
|
-
let { conversation: r, chatToEnd: i, workspace: a } =
|
|
1692
|
+
function ut({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
1693
|
+
let { conversation: r, chatToEnd: i, workspace: a } = j((e) => e.data), o = n.userType === "VISITOR";
|
|
1694
1694
|
function s(n) {
|
|
1695
1695
|
e.find((e) => e === n) ? t((e) => e.filter((e) => e !== n)) : t((e) => [...e, n]);
|
|
1696
1696
|
}
|
|
1697
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ U("div", {
|
|
1698
1698
|
className: "padorix:relative",
|
|
1699
1699
|
children: [
|
|
1700
|
-
n.messages.map((t) => /* @__PURE__ */
|
|
1700
|
+
n.messages.map((t) => /* @__PURE__ */ H(at, {
|
|
1701
1701
|
messagesToDelete: e,
|
|
1702
1702
|
handleStarMessage: n.handleStarMessage,
|
|
1703
1703
|
deleteAction: s,
|
|
@@ -1707,7 +1707,7 @@ function ct({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
|
1707
1707
|
userType: n.userType,
|
|
1708
1708
|
moreActions: n.moreActions
|
|
1709
1709
|
}, t.clientMessageId || t.id)),
|
|
1710
|
-
n.isTyping && /* @__PURE__ */
|
|
1710
|
+
n.isTyping && /* @__PURE__ */ H("div", {
|
|
1711
1711
|
role: "status",
|
|
1712
1712
|
"aria-label": "Typing",
|
|
1713
1713
|
style: n.isOwnTyping ? { backgroundColor: a?.widget?.colorScheme || "#6c63ff" } : void 0,
|
|
@@ -1716,19 +1716,19 @@ function ct({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
|
1716
1716
|
0,
|
|
1717
1717
|
1,
|
|
1718
1718
|
2
|
|
1719
|
-
].map((e) => /* @__PURE__ */
|
|
1719
|
+
].map((e) => /* @__PURE__ */ H("span", {
|
|
1720
1720
|
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",
|
|
1721
1721
|
style: { animationDelay: `${e * 120}ms` }
|
|
1722
1722
|
}, e))
|
|
1723
1723
|
}),
|
|
1724
|
-
o && r?.status ===
|
|
1725
|
-
i?.isEndChat ===
|
|
1724
|
+
o && r?.status === E.false && /* @__PURE__ */ H(ct, {}),
|
|
1725
|
+
i?.isEndChat === E.true && /* @__PURE__ */ H(lt, {})
|
|
1726
1726
|
]
|
|
1727
1727
|
});
|
|
1728
1728
|
}
|
|
1729
1729
|
//#endregion
|
|
1730
1730
|
//#region node_modules/react-icons/rx/index.mjs
|
|
1731
|
-
function
|
|
1731
|
+
function dt(e) {
|
|
1732
1732
|
return Z({
|
|
1733
1733
|
tag: "svg",
|
|
1734
1734
|
attr: {
|
|
@@ -1747,36 +1747,36 @@ function lt(e) {
|
|
|
1747
1747
|
}
|
|
1748
1748
|
//#endregion
|
|
1749
1749
|
//#region lib/chats/chatmessages/chat-message-skeleton.tsx
|
|
1750
|
-
function
|
|
1751
|
-
return /* @__PURE__ */
|
|
1750
|
+
function ft(e) {
|
|
1751
|
+
return /* @__PURE__ */ H(B, {
|
|
1752
1752
|
style: { width: `${Math.floor(Math.random() * 100 + (e.index + 15))}%` },
|
|
1753
1753
|
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",
|
|
1754
|
-
children: /* @__PURE__ */
|
|
1754
|
+
children: /* @__PURE__ */ H("div", { className: "padorix:px-1 padorix:h-12" })
|
|
1755
1755
|
});
|
|
1756
1756
|
}
|
|
1757
1757
|
//#endregion
|
|
1758
1758
|
//#region lib/chats/chatScreen/chat-container.tsx
|
|
1759
|
-
var
|
|
1760
|
-
function
|
|
1759
|
+
var pt = 3500, mt = ["Invalid chat session", "No Active session found"];
|
|
1760
|
+
function ht(e) {
|
|
1761
1761
|
return e ? Array.isArray(e) ? e.join("\n") : String(e) : "";
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1764
|
-
let a =
|
|
1765
|
-
...
|
|
1763
|
+
function gt({ styles: e, userType: t, ...r }) {
|
|
1764
|
+
let a = A(), s = M.useRef(null), l = M.useRef(null), [u, f] = M.useState(!1), [p, m] = M.useState([]), [_, y] = M.useState(!1), [b, x] = M.useState(!1), [S, w] = M.useState(null), D = M.useRef(null), N = M.useRef(null), [P, F] = M.useState([]), I = M.useRef(/* @__PURE__ */ new Set()), { sender: L, workspace: ne, reply: re, conversation: ie } = j((e) => e.data), ae = S !== null, oe = !!(S?.senderId && S.senderId === L?.senderId), R = M.useMemo(() => t === T.VISITOR ? {
|
|
1765
|
+
...L,
|
|
1766
1766
|
workspaceId: ne?.id,
|
|
1767
1767
|
userType: t
|
|
1768
|
-
} :
|
|
1768
|
+
} : r.sender, [
|
|
1769
1769
|
t,
|
|
1770
|
-
|
|
1770
|
+
L,
|
|
1771
1771
|
ne?.id,
|
|
1772
|
-
|
|
1772
|
+
r.sender
|
|
1773
1773
|
]), se = JSON.stringify([
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
]),
|
|
1774
|
+
R?.workspaceId,
|
|
1775
|
+
R?.conversationId,
|
|
1776
|
+
R?.senderId,
|
|
1777
|
+
R?.userType ?? t,
|
|
1778
|
+
R?.fullName
|
|
1779
|
+
]), z = M.useMemo(() => {
|
|
1780
1780
|
let [e, t, n, r, i] = JSON.parse(se);
|
|
1781
1781
|
return !e || !t || !n ? null : {
|
|
1782
1782
|
workspaceId: String(e),
|
|
@@ -1785,217 +1785,238 @@ function pt({ styles: e, userType: t, ...i }) {
|
|
|
1785
1785
|
userType: String(r),
|
|
1786
1786
|
senderName: i ? String(i) : void 0
|
|
1787
1787
|
};
|
|
1788
|
-
}, [se]),
|
|
1789
|
-
|
|
1790
|
-
let
|
|
1788
|
+
}, [se]), ce = String(R?.conversationId ?? ""), ue = M.useRef(ce);
|
|
1789
|
+
ue.current = ce;
|
|
1790
|
+
let V = M.useCallback((e) => e == null || e === "" ? !0 : String(e) === ue.current, []);
|
|
1791
1791
|
function W() {
|
|
1792
|
-
|
|
1792
|
+
d(s), l.current?.scrollIntoView({ behavior: "smooth" });
|
|
1793
1793
|
}
|
|
1794
|
-
let
|
|
1794
|
+
let fe = (e, t) => e.clientMessageId || !t.clientMessageId ? e : {
|
|
1795
1795
|
...e,
|
|
1796
1796
|
clientMessageId: t.clientMessageId
|
|
1797
|
-
},
|
|
1797
|
+
}, G = M.useCallback((e) => {
|
|
1798
1798
|
let t = e.message;
|
|
1799
|
-
if (!t || !
|
|
1799
|
+
if (!t || !V(t.conversationId)) return;
|
|
1800
1800
|
let n = t.clientMessageId;
|
|
1801
|
-
n &&
|
|
1801
|
+
n && I.current.delete(n), F((e) => {
|
|
1802
1802
|
let r = e.findIndex((e) => e.id === t.id);
|
|
1803
|
-
if (r !== -1) return e.map((e, n) => n === r ?
|
|
1803
|
+
if (r !== -1) return e.map((e, n) => n === r ? fe(t, e) : e);
|
|
1804
1804
|
if (n) {
|
|
1805
1805
|
let r = e.findIndex((e) => e.clientMessageId === n || e.id === n);
|
|
1806
|
-
if (r !== -1) return e.map((e, n) => n === r ?
|
|
1806
|
+
if (r !== -1) return e.map((e, n) => n === r ? fe(t, e) : e);
|
|
1807
1807
|
}
|
|
1808
|
-
let i =
|
|
1809
|
-
let n = !!(e.id && e.id.length >= 32), r = String(e.senderId) === String(t.senderId), a =
|
|
1808
|
+
let i = ht(t.message), a = e.findIndex((e) => {
|
|
1809
|
+
let n = !!(e.id && e.id.length >= 32), r = String(e.senderId) === String(t.senderId), a = ht(e.message) === i;
|
|
1810
1810
|
return n && r && a;
|
|
1811
1811
|
});
|
|
1812
|
-
return a === -1 ? [...e, t] : e.map((e, n) => n === a ?
|
|
1813
|
-
}),
|
|
1812
|
+
return a === -1 ? [...e, t] : e.map((e, n) => n === a ? fe(t, e) : e);
|
|
1813
|
+
}), x(!1), setTimeout(() => {
|
|
1814
1814
|
W();
|
|
1815
1815
|
}, 300);
|
|
1816
|
-
}, [
|
|
1817
|
-
|
|
1818
|
-
}, [
|
|
1819
|
-
if (!
|
|
1820
|
-
|
|
1816
|
+
}, [V]), K = M.useCallback((e) => {
|
|
1817
|
+
G(e);
|
|
1818
|
+
}, [G]), pe = M.useCallback((e) => {
|
|
1819
|
+
if (!I.current.has(e)) return;
|
|
1820
|
+
I.current.delete(e);
|
|
1821
1821
|
let t = [e];
|
|
1822
|
-
|
|
1822
|
+
F((e) => e.filter((e) => !t.includes(e.id) && (!e.clientMessageId || !t.includes(e.clientMessageId)))), x(!1);
|
|
1823
1823
|
}, []);
|
|
1824
|
-
function
|
|
1825
|
-
let
|
|
1824
|
+
function me(e) {
|
|
1825
|
+
let r = !!re?.messageId, i = crypto.randomUUID(), o = {
|
|
1826
1826
|
...e,
|
|
1827
|
-
clientMessageId:
|
|
1827
|
+
clientMessageId: i,
|
|
1828
1828
|
merchantId: ne?.userId,
|
|
1829
|
-
...
|
|
1829
|
+
...r ? {
|
|
1830
1830
|
isReply: !0,
|
|
1831
1831
|
messageId: re?.messageId
|
|
1832
1832
|
} : {},
|
|
1833
1833
|
message: e.message.trim()
|
|
1834
|
-
},
|
|
1835
|
-
id:
|
|
1836
|
-
clientMessageId:
|
|
1837
|
-
conversationId:
|
|
1838
|
-
workspaceId:
|
|
1839
|
-
senderName:
|
|
1834
|
+
}, s = (/* @__PURE__ */ new Date()).toISOString(), l = {
|
|
1835
|
+
id: i,
|
|
1836
|
+
clientMessageId: i,
|
|
1837
|
+
conversationId: o.conversationId,
|
|
1838
|
+
workspaceId: o.workspaceId,
|
|
1839
|
+
senderName: L?.fullName ?? "",
|
|
1840
1840
|
senderType: t,
|
|
1841
|
-
senderId:
|
|
1842
|
-
message: [
|
|
1843
|
-
images:
|
|
1844
|
-
starred:
|
|
1845
|
-
deleted:
|
|
1846
|
-
createdAt:
|
|
1847
|
-
updatedAt:
|
|
1841
|
+
senderId: o.senderId,
|
|
1842
|
+
message: [o.message],
|
|
1843
|
+
images: o.images ?? [],
|
|
1844
|
+
starred: E.false,
|
|
1845
|
+
deleted: E.false,
|
|
1846
|
+
createdAt: s,
|
|
1847
|
+
updatedAt: s
|
|
1848
1848
|
};
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
}), a(
|
|
1849
|
+
I.current.add(i), F((e) => e.some((e) => e.id === i || e.clientMessageId && e.clientMessageId === i) ? e : [...e, l]), x(!0), z && v.sendMessage(z, o).then((e) => G({ message: e })).catch((e) => {
|
|
1850
|
+
pe(i), c(e.message || "Message not sent", "error");
|
|
1851
|
+
}), a(n(void 0)), a(h(void 0)), setTimeout(() => {
|
|
1852
1852
|
W();
|
|
1853
1853
|
}, 50);
|
|
1854
1854
|
}
|
|
1855
|
-
let q =
|
|
1856
|
-
|
|
1855
|
+
let q = M.useCallback((e) => {
|
|
1856
|
+
F((t) => t.some((t) => t.id === e.messageId) ? t.map((t) => t.id === e.messageId ? {
|
|
1857
1857
|
...t,
|
|
1858
1858
|
starred: e.status
|
|
1859
1859
|
} : t) : t);
|
|
1860
|
-
}, []), J =
|
|
1861
|
-
|
|
1860
|
+
}, []), J = M.useCallback((e) => {
|
|
1861
|
+
V(e?.id) && (a(g(e)), setTimeout(() => {
|
|
1862
1862
|
W();
|
|
1863
1863
|
}, 1e3));
|
|
1864
|
-
}, [a,
|
|
1865
|
-
|
|
1864
|
+
}, [a, V]), he = M.useCallback(() => {
|
|
1865
|
+
localStorage.removeItem(C), a(i(void 0)), a(g(void 0));
|
|
1866
|
+
}, [a]), ge = M.useCallback((e) => {
|
|
1867
|
+
V(e?.id) && (a(g(e)), a(o(void 0)), localStorage.removeItem(C), t === T.VISITOR && ee(), r.closeModal());
|
|
1866
1868
|
}, [
|
|
1867
1869
|
a,
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
+
r,
|
|
1871
|
+
V,
|
|
1870
1872
|
t
|
|
1871
|
-
]),
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1873
|
+
]), _e = M.useCallback((e) => {
|
|
1874
|
+
if (V(e?.conversation?.id)) {
|
|
1875
|
+
if (t === T.VISITOR && e.conversation?.conversation_status === E.false) {
|
|
1876
|
+
he();
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1879
|
+
F((t) => {
|
|
1880
|
+
let n = new Map(t.map((e) => [e.id, e]));
|
|
1881
|
+
return (e.messages ?? []).map((e) => {
|
|
1882
|
+
let t = n.get(e.id);
|
|
1883
|
+
return t ? fe(e, t) : e;
|
|
1884
|
+
});
|
|
1885
|
+
}), new Set((e.messages ?? []).map((e) => e.clientMessageId).filter(Boolean)).forEach((e) => I.current.delete(e)), a(g(e.conversation)), setTimeout(() => {
|
|
1886
|
+
W();
|
|
1887
|
+
}, 1e3);
|
|
1888
|
+
}
|
|
1889
|
+
}, [
|
|
1890
|
+
a,
|
|
1891
|
+
V,
|
|
1892
|
+
t,
|
|
1893
|
+
he
|
|
1894
|
+
]);
|
|
1895
|
+
function ve(e, t) {
|
|
1896
|
+
z && v.starMessage(z, e, t).then(q).catch((e) => c(e.message, "error"));
|
|
1884
1897
|
}
|
|
1885
|
-
function
|
|
1898
|
+
function ye(e) {
|
|
1886
1899
|
let t = [];
|
|
1887
1900
|
e.forEach((e) => {
|
|
1888
|
-
let n =
|
|
1901
|
+
let n = P.find((t) => t.id === e);
|
|
1889
1902
|
n && t.push(n.id);
|
|
1890
|
-
}), !(!
|
|
1903
|
+
}), !(!z || t.length === 0) && v.deleteMessages(z, t).then(be).catch((e) => c(e.message, "error"));
|
|
1891
1904
|
}
|
|
1892
|
-
let
|
|
1905
|
+
let be = M.useCallback((e) => {
|
|
1893
1906
|
if (!e || e.length === 0) return;
|
|
1894
1907
|
let t = new Set(e);
|
|
1895
|
-
|
|
1908
|
+
F((e) => e.some((e) => t.has(e.id)) ? e.map((e) => t.has(e.id) ? {
|
|
1896
1909
|
...e,
|
|
1897
|
-
deleted:
|
|
1910
|
+
deleted: E.true
|
|
1898
1911
|
} : e) : e);
|
|
1899
|
-
}, []),
|
|
1912
|
+
}, []), xe = M.useCallback((e) => {
|
|
1900
1913
|
let t = typeof e == "object" && e ? e : {};
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
},
|
|
1904
|
-
}, [
|
|
1914
|
+
V(t.conversationId) && (D.current = t, w(t), N.current !== null && window.clearTimeout(N.current), N.current = window.setTimeout(() => {
|
|
1915
|
+
D.current = null, w(null), N.current = null;
|
|
1916
|
+
}, pt));
|
|
1917
|
+
}, [V]), Y = M.useCallback((e) => {
|
|
1905
1918
|
let t = typeof e == "object" && e ? e : {};
|
|
1906
|
-
|
|
1907
|
-
}, [
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
}, [
|
|
1911
|
-
|
|
1912
|
-
}), [Y,
|
|
1913
|
-
ae && !
|
|
1914
|
-
}, [
|
|
1915
|
-
let e =
|
|
1919
|
+
V(t.conversationId) && (t.senderId && D.current?.senderId && t.senderId !== D.current.senderId || (N.current !== null && (window.clearTimeout(N.current), N.current = null), D.current = null, w(null)));
|
|
1920
|
+
}, [V]);
|
|
1921
|
+
M.useEffect(() => {
|
|
1922
|
+
N.current !== null && (window.clearTimeout(N.current), N.current = null), D.current = null, w(null);
|
|
1923
|
+
}, [ce]), M.useEffect(() => (O.on(k.is_typing, xe), O.on(k.not_typing, Y), () => {
|
|
1924
|
+
O.off(k.is_typing, xe), O.off(k.not_typing, Y), N.current !== null && window.clearTimeout(N.current);
|
|
1925
|
+
}), [Y, xe]), M.useEffect(() => {
|
|
1926
|
+
ae && !u && l.current?.scrollIntoView({ behavior: "smooth" });
|
|
1927
|
+
}, [u, ae]), M.useEffect(() => {
|
|
1928
|
+
let e = s.current;
|
|
1916
1929
|
if (!e) return;
|
|
1917
1930
|
let t = () => {
|
|
1918
1931
|
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e;
|
|
1919
|
-
n - t - r > 5 ?
|
|
1932
|
+
n - t - r > 5 ? f(!0) : f(!1);
|
|
1920
1933
|
};
|
|
1921
1934
|
return e.addEventListener("scroll", t, { passive: !0 }), () => {
|
|
1922
1935
|
e.removeEventListener("scroll", t);
|
|
1923
1936
|
};
|
|
1924
1937
|
}, []);
|
|
1925
|
-
function
|
|
1938
|
+
function Se() {
|
|
1926
1939
|
W(), setTimeout(() => W(), 100);
|
|
1927
1940
|
}
|
|
1928
1941
|
function X() {
|
|
1929
|
-
|
|
1942
|
+
m([]);
|
|
1930
1943
|
}
|
|
1931
|
-
function
|
|
1932
|
-
|
|
1933
|
-
|
|
1944
|
+
function Ce() {
|
|
1945
|
+
ye(p), setTimeout(() => {
|
|
1946
|
+
m([]);
|
|
1934
1947
|
}, 100);
|
|
1935
1948
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1949
|
+
M.useEffect(() => (O.on(k.delete_message, be), O.on(k.star_message, q), O.on(k.request_feedback, J), O.on(k.submit_feedback, J), O.on(k.end_chat_session, ge), () => {
|
|
1950
|
+
O.off(k.delete_message, be), O.off(k.star_message, q), O.off(k.request_feedback, J), O.off(k.submit_feedback, J), O.off(k.end_chat_session, ge);
|
|
1938
1951
|
}), [
|
|
1939
|
-
|
|
1952
|
+
be,
|
|
1940
1953
|
q,
|
|
1941
1954
|
J,
|
|
1942
|
-
|
|
1943
|
-
]),
|
|
1944
|
-
|
|
1945
|
-
}), [
|
|
1946
|
-
if (!
|
|
1955
|
+
ge
|
|
1956
|
+
]), M.useEffect(() => (O.on(k.send_message, G), O.on(k.update_send_message, K), () => {
|
|
1957
|
+
O.off(k.update_send_message, K), O.off(k.send_message, G);
|
|
1958
|
+
}), [G, K]), M.useEffect(() => {
|
|
1959
|
+
if (!z) return;
|
|
1947
1960
|
let e = !1, t = () => {
|
|
1948
|
-
|
|
1961
|
+
v.history(z).then((t) => !e && _e(t)).catch((t) => {
|
|
1962
|
+
let n = t.message;
|
|
1963
|
+
if (!e && z.userType === T.VISITOR && mt.includes(n)) return he();
|
|
1964
|
+
console.log(n);
|
|
1965
|
+
});
|
|
1949
1966
|
}, n = () => {
|
|
1950
|
-
|
|
1967
|
+
O.emit(k.subscribe_conversation, z), t();
|
|
1951
1968
|
};
|
|
1952
|
-
return
|
|
1953
|
-
e = !0,
|
|
1969
|
+
return O.on(k.connected, n), O.connected ? n() : (t(), te(z.userType !== T.VISITOR)), () => {
|
|
1970
|
+
e = !0, O.off(k.connected, n);
|
|
1954
1971
|
};
|
|
1955
|
-
}, [
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1972
|
+
}, [
|
|
1973
|
+
z,
|
|
1974
|
+
_e,
|
|
1975
|
+
he
|
|
1976
|
+
]);
|
|
1977
|
+
let we = `calc(var(--padorix-vvh, 100dvh) * ${p.length > 0 || ie?.status === E.false ? .915 : .81})`;
|
|
1978
|
+
return /* @__PURE__ */ U("div", {
|
|
1979
|
+
className: e.chatScreen,
|
|
1959
1980
|
children: [
|
|
1960
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ H(Ge, {
|
|
1961
1982
|
styles: e,
|
|
1962
1983
|
userType: t,
|
|
1963
|
-
goBack:
|
|
1964
|
-
close:
|
|
1965
|
-
toBottom:
|
|
1966
|
-
messages:
|
|
1984
|
+
goBack: r.goBack,
|
|
1985
|
+
close: r.closeModal,
|
|
1986
|
+
toBottom: Se,
|
|
1987
|
+
messages: P
|
|
1967
1988
|
}),
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
ref:
|
|
1970
|
-
style: { height:
|
|
1989
|
+
/* @__PURE__ */ U("div", {
|
|
1990
|
+
ref: s,
|
|
1991
|
+
style: t === T.VISITOR ? void 0 : { height: we },
|
|
1971
1992
|
className: `${e.chatContainerPadding}`,
|
|
1972
1993
|
children: [
|
|
1973
|
-
|
|
1994
|
+
u && /* @__PURE__ */ H(de, {
|
|
1974
1995
|
direction: "up",
|
|
1975
1996
|
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 ",
|
|
1976
|
-
children: /* @__PURE__ */
|
|
1997
|
+
children: /* @__PURE__ */ H("div", {
|
|
1977
1998
|
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 ",
|
|
1978
1999
|
onClick: W,
|
|
1979
|
-
children: /* @__PURE__ */
|
|
2000
|
+
children: /* @__PURE__ */ H(dt, {})
|
|
1980
2001
|
})
|
|
1981
2002
|
}),
|
|
1982
|
-
Number(
|
|
2003
|
+
Number(P?.length) < 1 && /* @__PURE__ */ H("div", {
|
|
1983
2004
|
className: "padorix:relative padorix:p-4",
|
|
1984
|
-
children: Array(8).fill(0).map((e, t) => /* @__PURE__ */
|
|
2005
|
+
children: Array(8).fill(0).map((e, t) => /* @__PURE__ */ H(ft, { index: t }, t))
|
|
1985
2006
|
}),
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
messages:
|
|
1988
|
-
deleteMessagesAction:
|
|
1989
|
-
handleStarMessage:
|
|
2007
|
+
/* @__PURE__ */ H(ut, {
|
|
2008
|
+
messages: P,
|
|
2009
|
+
deleteMessagesAction: ye,
|
|
2010
|
+
handleStarMessage: ve,
|
|
1990
2011
|
styles: e,
|
|
1991
2012
|
userType: t,
|
|
1992
|
-
messagesToDelete:
|
|
1993
|
-
setMessagesToDelete:
|
|
1994
|
-
moreActions:
|
|
2013
|
+
messagesToDelete: p,
|
|
2014
|
+
setMessagesToDelete: m,
|
|
2015
|
+
moreActions: r.moreActions,
|
|
1995
2016
|
isTyping: ae,
|
|
1996
2017
|
isOwnTyping: oe
|
|
1997
2018
|
}),
|
|
1998
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ H("div", {
|
|
1999
2020
|
ref: l,
|
|
2000
2021
|
style: {
|
|
2001
2022
|
float: "left",
|
|
@@ -2004,56 +2025,56 @@ function pt({ styles: e, userType: t, ...i }) {
|
|
|
2004
2025
|
})
|
|
2005
2026
|
]
|
|
2006
2027
|
}),
|
|
2007
|
-
|
|
2028
|
+
_ && p.length > 0 && /* @__PURE__ */ U("div", {
|
|
2008
2029
|
className: e.messagesContainer,
|
|
2009
|
-
children: [/* @__PURE__ */
|
|
2030
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2010
2031
|
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
2011
|
-
children: [/* @__PURE__ */
|
|
2032
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2012
2033
|
onClick: X,
|
|
2013
2034
|
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
2014
|
-
children: /* @__PURE__ */
|
|
2015
|
-
}), /* @__PURE__ */
|
|
2035
|
+
children: /* @__PURE__ */ H(Q, {})
|
|
2036
|
+
}), /* @__PURE__ */ U("div", {
|
|
2016
2037
|
className: "padorix:space-x-0.5",
|
|
2017
2038
|
children: [
|
|
2018
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ H("span", { children: "Confirm to delete" }),
|
|
2019
2040
|
" ",
|
|
2020
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ U("span", {
|
|
2021
2042
|
className: "padorix:text-red-500",
|
|
2022
2043
|
children: [
|
|
2023
|
-
|
|
2044
|
+
p.length,
|
|
2024
2045
|
" message",
|
|
2025
|
-
|
|
2046
|
+
p.length === 1 ? "" : "s"
|
|
2026
2047
|
]
|
|
2027
2048
|
})
|
|
2028
2049
|
]
|
|
2029
2050
|
})]
|
|
2030
|
-
}), /* @__PURE__ */
|
|
2031
|
-
onClick:
|
|
2051
|
+
}), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2052
|
+
onClick: Ce,
|
|
2032
2053
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125 padorix:text-red-500",
|
|
2033
|
-
children: /* @__PURE__ */
|
|
2054
|
+
children: /* @__PURE__ */ H(le, {})
|
|
2034
2055
|
}) })]
|
|
2035
2056
|
}),
|
|
2036
|
-
!
|
|
2057
|
+
!_ && p.length > 0 && /* @__PURE__ */ U("div", {
|
|
2037
2058
|
className: e.messagesContainer,
|
|
2038
|
-
children: [/* @__PURE__ */
|
|
2059
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2039
2060
|
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
2040
2061
|
children: [
|
|
2041
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ H("div", {
|
|
2042
2063
|
onClick: X,
|
|
2043
2064
|
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
2044
|
-
children: /* @__PURE__ */
|
|
2065
|
+
children: /* @__PURE__ */ H(Q, {})
|
|
2045
2066
|
}),
|
|
2046
|
-
|
|
2067
|
+
p.length,
|
|
2047
2068
|
" Selected"
|
|
2048
2069
|
]
|
|
2049
|
-
}), /* @__PURE__ */
|
|
2070
|
+
}), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2050
2071
|
onClick: () => y(!0),
|
|
2051
2072
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125",
|
|
2052
|
-
children: /* @__PURE__ */
|
|
2073
|
+
children: /* @__PURE__ */ H(le, {})
|
|
2053
2074
|
}) })]
|
|
2054
2075
|
}),
|
|
2055
|
-
|
|
2056
|
-
sendChat:
|
|
2076
|
+
p.length < 1 && ie?.status === E.true && /* @__PURE__ */ H(Ve, {
|
|
2077
|
+
sendChat: me,
|
|
2057
2078
|
styles: e,
|
|
2058
2079
|
userType: t,
|
|
2059
2080
|
isSending: b
|
|
@@ -2063,221 +2084,220 @@ function pt({ styles: e, userType: t, ...i }) {
|
|
|
2063
2084
|
}
|
|
2064
2085
|
//#endregion
|
|
2065
2086
|
//#region lib/assets/images/wave.png
|
|
2066
|
-
var
|
|
2067
|
-
function
|
|
2068
|
-
let { workspace:
|
|
2087
|
+
var _t = "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+SVDBO4g9rbBrsnDBRMIAQ44ApmBe1l3iFev37x9dyUQAjrPIYxdmCV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.test(e);
|
|
2088
|
+
function bt(e) {
|
|
2089
|
+
let { workspace: n, tags: r } = j((e) => e.data), a = A(), [o, s] = M.useState(!1), l = M.useMemo(() => t(e.workspaceId), [e.workspaceId]), [u, d] = M.useState(e.openOptions ? 2 : r.length > 0 ? 1 : 2), f = M.useRef(0), p = me({
|
|
2069
2090
|
mode: "uncontrolled",
|
|
2070
2091
|
initialValues: {
|
|
2071
|
-
tagId:
|
|
2072
|
-
fullName:
|
|
2073
|
-
email:
|
|
2074
|
-
message:
|
|
2092
|
+
tagId: r.find((t) => t.tag.trim().toLowerCase() === e.openOptions?.tag?.trim().toLowerCase())?.id ?? "",
|
|
2093
|
+
fullName: e.openOptions?.name ?? "",
|
|
2094
|
+
email: e.openOptions?.email ?? "",
|
|
2095
|
+
message: e.openOptions?.message ?? ""
|
|
2075
2096
|
},
|
|
2076
2097
|
validate: {
|
|
2077
|
-
fullName: (e) =>
|
|
2078
|
-
email: (e) =>
|
|
2079
|
-
message: (e) =>
|
|
2098
|
+
fullName: (e) => u === 2 && !e ? "Full name is required" : u === 2 && e.length <= 2 ? "Your name is expected to be more than 2 characters" : null,
|
|
2099
|
+
email: (e) => u === 2 && !e ? "Email address is required" : u === 2 && !yt(e) ? "Please enter a valid email address" : null,
|
|
2100
|
+
message: (e) => u === 4 && !e ? "Enquiry content is required" : null
|
|
2080
2101
|
}
|
|
2081
2102
|
});
|
|
2082
|
-
function
|
|
2083
|
-
if (
|
|
2084
|
-
if (
|
|
2085
|
-
|
|
2103
|
+
function m() {
|
|
2104
|
+
if (r.length > 0) {
|
|
2105
|
+
if (u === 1) return e.changeScreen(1);
|
|
2106
|
+
d((e) => e - 1);
|
|
2086
2107
|
}
|
|
2087
|
-
if (
|
|
2088
|
-
if (
|
|
2089
|
-
|
|
2108
|
+
if (r.length < 1) {
|
|
2109
|
+
if (u === 2) return e.changeScreen(1);
|
|
2110
|
+
d((e) => e - 1);
|
|
2090
2111
|
}
|
|
2091
2112
|
}
|
|
2092
|
-
function
|
|
2093
|
-
|
|
2113
|
+
function h(e) {
|
|
2114
|
+
p.setFieldValue("tagId", e), d((e) => e + 1);
|
|
2094
2115
|
}
|
|
2095
|
-
async function
|
|
2116
|
+
async function _(e) {
|
|
2096
2117
|
s(!0);
|
|
2097
2118
|
try {
|
|
2098
|
-
let
|
|
2099
|
-
conversationId:
|
|
2100
|
-
senderId:
|
|
2101
|
-
fullName:
|
|
2102
|
-
tagId:
|
|
2103
|
-
expiresAt: K().add(1, "day").endOf("day").toDate().toString()
|
|
2119
|
+
let t = await v.startConversation(e), n = {
|
|
2120
|
+
conversationId: t.conversation.id,
|
|
2121
|
+
senderId: t.senderId,
|
|
2122
|
+
fullName: t.fullName,
|
|
2123
|
+
tagId: e.tagId
|
|
2104
2124
|
};
|
|
2105
|
-
localStorage.setItem(
|
|
2125
|
+
localStorage.setItem(C, JSON.stringify(n)), a(g(t.conversation)), a(i(n));
|
|
2106
2126
|
} catch (e) {
|
|
2107
|
-
|
|
2127
|
+
c(e.message || "Unable to start the chat", "error"), window.dispatchEvent(new Event(b));
|
|
2108
2128
|
} finally {
|
|
2109
2129
|
s(!1);
|
|
2110
2130
|
}
|
|
2111
2131
|
}
|
|
2112
|
-
async function
|
|
2113
|
-
if (
|
|
2114
|
-
await
|
|
2115
|
-
...
|
|
2116
|
-
workspaceId:
|
|
2132
|
+
async function y(t) {
|
|
2133
|
+
if (u < 3) return d((e) => e + 1);
|
|
2134
|
+
await _({
|
|
2135
|
+
...t,
|
|
2136
|
+
workspaceId: e.workspaceId,
|
|
2117
2137
|
userType: "VISITOR",
|
|
2118
|
-
visitorId:
|
|
2119
|
-
tag:
|
|
2138
|
+
visitorId: l,
|
|
2139
|
+
tag: e.openOptions?.tag
|
|
2120
2140
|
});
|
|
2121
2141
|
}
|
|
2122
|
-
return
|
|
2123
|
-
if (!
|
|
2124
|
-
let
|
|
2125
|
-
if (!
|
|
2126
|
-
|
|
2142
|
+
return M.useEffect(() => {
|
|
2143
|
+
if (!e.openRequestId) return;
|
|
2144
|
+
let t = e.openOptions;
|
|
2145
|
+
if (!t) {
|
|
2146
|
+
d(1);
|
|
2127
2147
|
return;
|
|
2128
2148
|
}
|
|
2129
|
-
let n =
|
|
2130
|
-
|
|
2149
|
+
let n = r.find((e) => e.tag.trim().toLowerCase() === t.tag?.trim().toLowerCase())?.id ?? "";
|
|
2150
|
+
p.setValues({
|
|
2131
2151
|
tagId: n,
|
|
2132
|
-
fullName:
|
|
2133
|
-
email:
|
|
2134
|
-
message:
|
|
2135
|
-
}),
|
|
2136
|
-
workspaceId:
|
|
2152
|
+
fullName: t.name ?? "",
|
|
2153
|
+
email: t.email ?? "",
|
|
2154
|
+
message: t.message ?? ""
|
|
2155
|
+
}), d(2), !(e.autoSubmitRequestId !== e.openRequestId || f.current === e.openRequestId || !x(t)) && (f.current = e.openRequestId, _({
|
|
2156
|
+
workspaceId: e.workspaceId,
|
|
2137
2157
|
userType: "VISITOR",
|
|
2138
|
-
visitorId:
|
|
2139
|
-
fullName:
|
|
2140
|
-
email:
|
|
2141
|
-
message:
|
|
2158
|
+
visitorId: l,
|
|
2159
|
+
fullName: t.name?.trim(),
|
|
2160
|
+
email: t.email?.trim(),
|
|
2161
|
+
message: t.message?.trim(),
|
|
2142
2162
|
tagId: n || void 0,
|
|
2143
|
-
tag:
|
|
2163
|
+
tag: t.tag
|
|
2144
2164
|
}));
|
|
2145
|
-
}, [
|
|
2146
|
-
className:
|
|
2147
|
-
children: [/* @__PURE__ */
|
|
2165
|
+
}, [e.openRequestId]), /* @__PURE__ */ U("div", {
|
|
2166
|
+
className: e.styles.container,
|
|
2167
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2148
2168
|
style: {
|
|
2149
|
-
background: String(
|
|
2150
|
-
color:
|
|
2169
|
+
background: String(n?.widget?.colorScheme),
|
|
2170
|
+
color: n?.widget?.textColor || "#ffffff"
|
|
2151
2171
|
},
|
|
2152
2172
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:gap-2",
|
|
2153
|
-
children: [/* @__PURE__ */
|
|
2173
|
+
children: [/* @__PURE__ */ H(B, {
|
|
2154
2174
|
className: "",
|
|
2155
2175
|
children: "Kindly drop your enquiry and we will get back to you immediately"
|
|
2156
|
-
}), /* @__PURE__ */
|
|
2176
|
+
}), /* @__PURE__ */ H("div", {
|
|
2157
2177
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2158
|
-
children: /* @__PURE__ */
|
|
2178
|
+
children: /* @__PURE__ */ H("div", {
|
|
2159
2179
|
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",
|
|
2160
|
-
onClick:
|
|
2161
|
-
children: /* @__PURE__ */
|
|
2180
|
+
onClick: e.close,
|
|
2181
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2162
2182
|
})
|
|
2163
2183
|
})]
|
|
2164
|
-
}), /* @__PURE__ */
|
|
2184
|
+
}), /* @__PURE__ */ U("div", {
|
|
2165
2185
|
className: "padorix:p-4",
|
|
2166
2186
|
children: [
|
|
2167
|
-
/* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ U("div", {
|
|
2168
2188
|
className: "padorix:flex padorix:items-center padorix:gap-2",
|
|
2169
|
-
children: [/* @__PURE__ */
|
|
2189
|
+
children: [/* @__PURE__ */ H(B, {
|
|
2170
2190
|
className: "padorix:size-10",
|
|
2171
|
-
children: /* @__PURE__ */
|
|
2191
|
+
children: /* @__PURE__ */ U("div", {
|
|
2172
2192
|
className: "",
|
|
2173
2193
|
children: [
|
|
2174
2194
|
" ",
|
|
2175
|
-
/* @__PURE__ */
|
|
2176
|
-
src:
|
|
2177
|
-
alt:
|
|
2195
|
+
/* @__PURE__ */ H("img", {
|
|
2196
|
+
src: n?.logo,
|
|
2197
|
+
alt: n?.name,
|
|
2178
2198
|
loading: "lazy",
|
|
2179
2199
|
className: "padorix:size-10 padorix:object-contain"
|
|
2180
2200
|
}),
|
|
2181
2201
|
" "
|
|
2182
2202
|
]
|
|
2183
2203
|
})
|
|
2184
|
-
}), /* @__PURE__ */
|
|
2204
|
+
}), /* @__PURE__ */ H(B, {
|
|
2185
2205
|
className: "padorix:text-right padorix:w-full",
|
|
2186
|
-
children: /* @__PURE__ */
|
|
2206
|
+
children: /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("div", {
|
|
2187
2207
|
className: "padorix:font-medium padorix:text-right",
|
|
2188
|
-
children:
|
|
2189
|
-
}), /* @__PURE__ */
|
|
2208
|
+
children: n?.name
|
|
2209
|
+
}), /* @__PURE__ */ H("div", {
|
|
2190
2210
|
className: "padorix:text-sm padorix:text-right padorix:text-slate-500",
|
|
2191
|
-
children:
|
|
2211
|
+
children: n?.widget?.department
|
|
2192
2212
|
})] })
|
|
2193
2213
|
})]
|
|
2194
2214
|
}),
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
onSubmit:
|
|
2197
|
-
children: [/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ U("form", {
|
|
2216
|
+
onSubmit: p.onSubmit(y),
|
|
2217
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2198
2218
|
className: "padorix:h-[35dvh] padorix:flex padorix:items-center padorix:justify-center",
|
|
2199
|
-
children: /* @__PURE__ */
|
|
2219
|
+
children: /* @__PURE__ */ U("div", {
|
|
2200
2220
|
className: "padorix:w-full",
|
|
2201
2221
|
children: [
|
|
2202
|
-
|
|
2203
|
-
/* @__PURE__ */
|
|
2204
|
-
/* @__PURE__ */
|
|
2222
|
+
u === 1 && /* @__PURE__ */ U(V, { children: [
|
|
2223
|
+
/* @__PURE__ */ H(xt, { current: 1 }),
|
|
2224
|
+
/* @__PURE__ */ H("div", {
|
|
2205
2225
|
className: "padorix:font-bold padorix:mb-2",
|
|
2206
2226
|
children: "What is your enquiry about?"
|
|
2207
2227
|
}),
|
|
2208
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ H("div", {
|
|
2209
2229
|
className: "padorix:flex padorix:flex-wrap padorix:items-center padorix:gap-2",
|
|
2210
|
-
children:
|
|
2211
|
-
onClick: () =>
|
|
2212
|
-
style: { background:
|
|
2213
|
-
className: `padorix:text-xs padorix:py-1.5 padorix:px-2 padorix:rounded-md ${
|
|
2230
|
+
children: r?.map((e, t) => /* @__PURE__ */ H("div", {
|
|
2231
|
+
onClick: () => h(e.id),
|
|
2232
|
+
style: { background: p.values.tagId === e.id ? String(n?.widget?.colorScheme) : "#f1f5f9" },
|
|
2233
|
+
className: `padorix:text-xs padorix:py-1.5 padorix:px-2 padorix:rounded-md ${p.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`,
|
|
2214
2234
|
children: e.tag
|
|
2215
2235
|
}, t))
|
|
2216
2236
|
}),
|
|
2217
|
-
|
|
2237
|
+
p.errors.tagId ? /* @__PURE__ */ H("div", {
|
|
2218
2238
|
className: "padorix:text-red-400 padorix:text-sm padorix:mt-2",
|
|
2219
|
-
children:
|
|
2239
|
+
children: p.errors.tagId?.toString()
|
|
2220
2240
|
}) : ""
|
|
2221
2241
|
] }),
|
|
2222
|
-
|
|
2223
|
-
/* @__PURE__ */
|
|
2224
|
-
/* @__PURE__ */
|
|
2225
|
-
screen:
|
|
2226
|
-
tagId:
|
|
2227
|
-
tags:
|
|
2242
|
+
u === 2 && /* @__PURE__ */ U(V, { children: [
|
|
2243
|
+
/* @__PURE__ */ H(xt, { current: 2 }),
|
|
2244
|
+
/* @__PURE__ */ H(St, {
|
|
2245
|
+
screen: u,
|
|
2246
|
+
tagId: p.values.tagId,
|
|
2247
|
+
tags: r
|
|
2228
2248
|
}),
|
|
2229
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ H($, {
|
|
2230
2250
|
content: "Full name",
|
|
2231
2251
|
placeholder: "Enter your full name",
|
|
2232
|
-
error:
|
|
2233
|
-
...
|
|
2234
|
-
},
|
|
2235
|
-
/* @__PURE__ */
|
|
2252
|
+
error: p.errors.fullName?.toString() || "",
|
|
2253
|
+
...p.getInputProps("fullName")
|
|
2254
|
+
}, p.key("fullName")),
|
|
2255
|
+
/* @__PURE__ */ H($, {
|
|
2236
2256
|
content: "Email address",
|
|
2237
2257
|
placeholder: "name@example.com",
|
|
2238
|
-
error:
|
|
2239
|
-
...
|
|
2240
|
-
},
|
|
2258
|
+
error: p.errors.email?.toString() || "",
|
|
2259
|
+
...p.getInputProps("email")
|
|
2260
|
+
}, p.key("email"))
|
|
2241
2261
|
] }),
|
|
2242
|
-
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2245
|
-
screen:
|
|
2246
|
-
tagId:
|
|
2247
|
-
tags:
|
|
2248
|
-
name:
|
|
2249
|
-
email:
|
|
2262
|
+
u === 3 && /* @__PURE__ */ U(V, { children: [
|
|
2263
|
+
/* @__PURE__ */ H(xt, { current: 3 }),
|
|
2264
|
+
/* @__PURE__ */ H(St, {
|
|
2265
|
+
screen: u,
|
|
2266
|
+
tagId: p.values.tagId,
|
|
2267
|
+
tags: r,
|
|
2268
|
+
name: p.values.fullName,
|
|
2269
|
+
email: p.values.email
|
|
2250
2270
|
}),
|
|
2251
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ H($, {
|
|
2252
2272
|
content: "Message",
|
|
2253
2273
|
formtype: "textarea",
|
|
2254
|
-
error:
|
|
2255
|
-
...
|
|
2256
|
-
},
|
|
2274
|
+
error: p.errors.message?.toString() || "",
|
|
2275
|
+
...p.getInputProps("message")
|
|
2276
|
+
}, p.key("message"))
|
|
2257
2277
|
] })
|
|
2258
2278
|
]
|
|
2259
2279
|
})
|
|
2260
|
-
}), /* @__PURE__ */
|
|
2280
|
+
}), /* @__PURE__ */ U("div", {
|
|
2261
2281
|
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2262
|
-
children: [/* @__PURE__ */
|
|
2282
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2263
2283
|
type: "button",
|
|
2264
|
-
onClick:
|
|
2284
|
+
onClick: m,
|
|
2265
2285
|
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",
|
|
2266
2286
|
children: "Back"
|
|
2267
|
-
}) }), /* @__PURE__ */
|
|
2287
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2268
2288
|
disabled: o,
|
|
2269
|
-
style: { background: o ? "#62748e" : String(
|
|
2289
|
+
style: { background: o ? "#62748e" : String(n?.widget?.colorScheme) },
|
|
2270
2290
|
className: `${o ? "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`,
|
|
2271
|
-
children:
|
|
2291
|
+
children: u < 3 ? "Next" : "Start Chat"
|
|
2272
2292
|
}) })]
|
|
2273
2293
|
})]
|
|
2274
2294
|
}),
|
|
2275
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
2276
2296
|
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",
|
|
2277
2297
|
children: [
|
|
2278
2298
|
" ",
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
src:
|
|
2299
|
+
/* @__PURE__ */ H("img", {
|
|
2300
|
+
src: vt,
|
|
2281
2301
|
alt: "padorix",
|
|
2282
2302
|
loading: "lazy",
|
|
2283
2303
|
className: "padorix:size-6 padorix:inline"
|
|
@@ -2289,13 +2309,13 @@ function _t(t) {
|
|
|
2289
2309
|
})]
|
|
2290
2310
|
});
|
|
2291
2311
|
}
|
|
2292
|
-
function
|
|
2293
|
-
let { tags: t, workspace: n } =
|
|
2294
|
-
return /* @__PURE__ */
|
|
2312
|
+
function xt(e) {
|
|
2313
|
+
let { tags: t, workspace: n } = j((e) => e.data), r = t.length > 0 ? 3 : 2, i = t.length > 0 ? e.current : e.current - 1;
|
|
2314
|
+
return /* @__PURE__ */ U("div", {
|
|
2295
2315
|
className: "padorix:text-right padorix:text-sm padorix:text-gray-500 padorix:italic padorix:font-semibold",
|
|
2296
2316
|
children: [
|
|
2297
2317
|
"Step ",
|
|
2298
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ H("span", {
|
|
2299
2319
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2300
2320
|
children: i
|
|
2301
2321
|
}),
|
|
@@ -2304,36 +2324,36 @@ function vt(e) {
|
|
|
2304
2324
|
]
|
|
2305
2325
|
});
|
|
2306
2326
|
}
|
|
2307
|
-
function
|
|
2308
|
-
return /* @__PURE__ */
|
|
2327
|
+
function St(e) {
|
|
2328
|
+
return /* @__PURE__ */ U("div", {
|
|
2309
2329
|
className: "padorix:my-2",
|
|
2310
|
-
children: [e.tagId && e.screen > 1 && /* @__PURE__ */
|
|
2330
|
+
children: [e.tagId && e.screen > 1 && /* @__PURE__ */ U("div", {
|
|
2311
2331
|
className: "padorix:text-xs",
|
|
2312
2332
|
children: [
|
|
2313
2333
|
" ",
|
|
2314
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ H("span", {
|
|
2315
2335
|
className: "padorix:text-slate-500 padorix:mr-1",
|
|
2316
2336
|
children: "Enquiry: "
|
|
2317
2337
|
}),
|
|
2318
2338
|
" ",
|
|
2319
2339
|
e.tags?.find((t) => t.id === e.tagId)?.tag
|
|
2320
2340
|
]
|
|
2321
|
-
}), e.screen > 2 && /* @__PURE__ */
|
|
2341
|
+
}), e.screen > 2 && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
|
|
2322
2342
|
className: "padorix:text-xs",
|
|
2323
2343
|
children: [
|
|
2324
2344
|
" ",
|
|
2325
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ H("span", {
|
|
2326
2346
|
className: "padorix:text-slate-500 padorix:mr-3",
|
|
2327
2347
|
children: "Name: "
|
|
2328
2348
|
}),
|
|
2329
2349
|
" ",
|
|
2330
2350
|
e.name
|
|
2331
2351
|
]
|
|
2332
|
-
}), /* @__PURE__ */
|
|
2352
|
+
}), /* @__PURE__ */ U("div", {
|
|
2333
2353
|
className: "padorix:text-xs",
|
|
2334
2354
|
children: [
|
|
2335
2355
|
" ",
|
|
2336
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ H("span", {
|
|
2337
2357
|
className: "padorix:text-slate-500 padorix:mr-4",
|
|
2338
2358
|
children: "Email: "
|
|
2339
2359
|
}),
|
|
@@ -2345,129 +2365,129 @@ function yt(e) {
|
|
|
2345
2365
|
}
|
|
2346
2366
|
//#endregion
|
|
2347
2367
|
//#region lib/chats/chatScreen/not-available-banner.tsx
|
|
2348
|
-
function
|
|
2349
|
-
return /* @__PURE__ */
|
|
2368
|
+
function Ct() {
|
|
2369
|
+
return /* @__PURE__ */ H("div", {
|
|
2350
2370
|
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",
|
|
2351
2371
|
children: "We're currently unavailable. Leave us a message \n and we'll get back to you via email."
|
|
2352
2372
|
});
|
|
2353
2373
|
}
|
|
2354
2374
|
//#endregion
|
|
2355
2375
|
//#region lib/chats/chatScreen/chat-faqs.tsx
|
|
2356
|
-
function
|
|
2357
|
-
let { faqs: t, workspace: n } =
|
|
2376
|
+
function wt(e) {
|
|
2377
|
+
let { faqs: t, workspace: n } = j((e) => e.data), [r, i] = M.useState(), a = e.isOpen ? "Talk to an agent" : "Send us a message";
|
|
2358
2378
|
function o(e) {
|
|
2359
2379
|
i(e);
|
|
2360
2380
|
}
|
|
2361
|
-
return r?.question ? /* @__PURE__ */
|
|
2362
|
-
/* @__PURE__ */
|
|
2381
|
+
return r?.question ? /* @__PURE__ */ U(V, { children: [
|
|
2382
|
+
/* @__PURE__ */ U("div", {
|
|
2363
2383
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2364
2384
|
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",
|
|
2365
2385
|
children: [
|
|
2366
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2367
2387
|
className: "padorix:size-8",
|
|
2368
|
-
children: /* @__PURE__ */
|
|
2388
|
+
children: /* @__PURE__ */ U("div", {
|
|
2369
2389
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2370
2390
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2371
2391
|
children: [
|
|
2372
2392
|
" ",
|
|
2373
|
-
/* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ H(qe, { className: "padorix:size-7" }),
|
|
2374
2394
|
" "
|
|
2375
2395
|
]
|
|
2376
2396
|
})
|
|
2377
2397
|
}) }),
|
|
2378
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2379
2399
|
className: "",
|
|
2380
2400
|
children: "Our Frequently asked questions"
|
|
2381
2401
|
}) }),
|
|
2382
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ H("div", {
|
|
2383
2403
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2384
|
-
children: /* @__PURE__ */
|
|
2404
|
+
children: /* @__PURE__ */ H("div", {
|
|
2385
2405
|
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",
|
|
2386
2406
|
onClick: e.close,
|
|
2387
|
-
children: /* @__PURE__ */
|
|
2407
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2388
2408
|
})
|
|
2389
2409
|
})
|
|
2390
2410
|
]
|
|
2391
2411
|
}),
|
|
2392
|
-
/* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ U("div", {
|
|
2393
2413
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2394
2414
|
children: [
|
|
2395
|
-
!e.isOpen && /* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2415
|
+
!e.isOpen && /* @__PURE__ */ H(Ct, {}),
|
|
2416
|
+
/* @__PURE__ */ H("div", {
|
|
2397
2417
|
className: "padorix:font-bold padorix:text-xl padorix:mb-3",
|
|
2398
2418
|
children: r.question
|
|
2399
2419
|
}),
|
|
2400
|
-
/* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ H("div", {
|
|
2401
2421
|
className: "padorix:whitespace-pre-line padorix:pl-2 padorix:text-gray-600 padorix:text-sm",
|
|
2402
2422
|
children: r.answer
|
|
2403
2423
|
})
|
|
2404
2424
|
]
|
|
2405
2425
|
}),
|
|
2406
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ U("div", {
|
|
2407
2427
|
className: "padorix:flex padorix:items-center padorix:justify-end padorix:p-2 padorix:gap-5",
|
|
2408
|
-
children: [/* @__PURE__ */
|
|
2428
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2409
2429
|
type: "button",
|
|
2410
2430
|
onClick: () => o(void 0),
|
|
2411
2431
|
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",
|
|
2412
2432
|
children: "Back"
|
|
2413
|
-
}) }), /* @__PURE__ */
|
|
2433
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2414
2434
|
onClick: () => e.talkToTeam(!1),
|
|
2415
2435
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2416
2436
|
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",
|
|
2417
2437
|
children: a
|
|
2418
2438
|
}) })]
|
|
2419
2439
|
})
|
|
2420
|
-
] }) : /* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2440
|
+
] }) : /* @__PURE__ */ U(V, { children: [
|
|
2441
|
+
/* @__PURE__ */ U("div", {
|
|
2422
2442
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2423
2443
|
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",
|
|
2424
2444
|
children: [
|
|
2425
|
-
/* @__PURE__ */
|
|
2445
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2426
2446
|
className: "padorix:size-8",
|
|
2427
|
-
children: /* @__PURE__ */
|
|
2447
|
+
children: /* @__PURE__ */ U("div", {
|
|
2428
2448
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2429
2449
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2430
2450
|
children: [
|
|
2431
2451
|
" ",
|
|
2432
|
-
/* @__PURE__ */
|
|
2452
|
+
/* @__PURE__ */ H(qe, { className: "padorix:size-7" }),
|
|
2433
2453
|
" "
|
|
2434
2454
|
]
|
|
2435
2455
|
})
|
|
2436
2456
|
}) }),
|
|
2437
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2438
2458
|
className: "",
|
|
2439
2459
|
children: "Our Frequently asked questions"
|
|
2440
2460
|
}) }),
|
|
2441
|
-
/* @__PURE__ */
|
|
2461
|
+
/* @__PURE__ */ H("div", {
|
|
2442
2462
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2443
|
-
children: /* @__PURE__ */
|
|
2463
|
+
children: /* @__PURE__ */ H("div", {
|
|
2444
2464
|
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",
|
|
2445
2465
|
onClick: e.close,
|
|
2446
|
-
children: /* @__PURE__ */
|
|
2466
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2447
2467
|
})
|
|
2448
2468
|
})
|
|
2449
2469
|
]
|
|
2450
2470
|
}),
|
|
2451
|
-
/* @__PURE__ */
|
|
2471
|
+
/* @__PURE__ */ U("div", {
|
|
2452
2472
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2453
|
-
children: [!e.isOpen && /* @__PURE__ */
|
|
2473
|
+
children: [!e.isOpen && /* @__PURE__ */ H(Ct, {}), t.map((e, t) => /* @__PURE__ */ U("div", {
|
|
2454
2474
|
onClick: () => o(e),
|
|
2455
2475
|
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",
|
|
2456
|
-
children: [/* @__PURE__ */
|
|
2476
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2457
2477
|
className: "padorix:w-full",
|
|
2458
|
-
children: [/* @__PURE__ */
|
|
2478
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2459
2479
|
className: "padorix:font-semibold",
|
|
2460
2480
|
children: e.question
|
|
2461
|
-
}), /* @__PURE__ */
|
|
2481
|
+
}), /* @__PURE__ */ U("div", {
|
|
2462
2482
|
className: "padorix:text-sm padorix:text-gray-500",
|
|
2463
2483
|
children: [e.answer?.slice(0, 50), "..."]
|
|
2464
2484
|
})]
|
|
2465
|
-
}), /* @__PURE__ */
|
|
2485
|
+
}), /* @__PURE__ */ H(Ae, {})]
|
|
2466
2486
|
}, t))]
|
|
2467
2487
|
}),
|
|
2468
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ H("div", {
|
|
2469
2489
|
className: "padorix:size-fit padorix:ml-auto padorix:p-2",
|
|
2470
|
-
children: /* @__PURE__ */
|
|
2490
|
+
children: /* @__PURE__ */ H("button", {
|
|
2471
2491
|
onClick: () => e.talkToTeam(!1),
|
|
2472
2492
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2473
2493
|
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",
|
|
@@ -2478,21 +2498,21 @@ function xt(e) {
|
|
|
2478
2498
|
}
|
|
2479
2499
|
//#endregion
|
|
2480
2500
|
//#region lib/chats/chatScreen/unavailable-form.tsx
|
|
2481
|
-
function
|
|
2482
|
-
let { workspace:
|
|
2501
|
+
function Tt(e) {
|
|
2502
|
+
let { workspace: t } = j((e) => e.data), [n, i] = M.useState(!1), [a, o] = M.useState({
|
|
2483
2503
|
status: "success",
|
|
2484
2504
|
message: ""
|
|
2485
|
-
}), s =
|
|
2505
|
+
}), s = me({
|
|
2486
2506
|
mode: "uncontrolled",
|
|
2487
2507
|
initialValues: {
|
|
2488
|
-
workspaceId:
|
|
2508
|
+
workspaceId: t?.id ?? "",
|
|
2489
2509
|
name: "",
|
|
2490
2510
|
email: "",
|
|
2491
2511
|
message: ""
|
|
2492
2512
|
},
|
|
2493
2513
|
validate: {
|
|
2494
2514
|
name: (e) => e ? e.length <= 2 ? "Your name is expected to be more than 2 characters" : null : "Full name is required",
|
|
2495
|
-
email: (e) => e ?
|
|
2515
|
+
email: (e) => e ? yt(e) ? null : "Please enter a valid email address" : "Email address is required",
|
|
2496
2516
|
message: (e) => e ? null : "Enquiry content is required"
|
|
2497
2517
|
}
|
|
2498
2518
|
});
|
|
@@ -2500,8 +2520,8 @@ function St(e) {
|
|
|
2500
2520
|
try {
|
|
2501
2521
|
i(!0), o({
|
|
2502
2522
|
status: "success",
|
|
2503
|
-
message: (await
|
|
2504
|
-
endpoint:
|
|
2523
|
+
message: (await r({
|
|
2524
|
+
endpoint: l.inquiries.inquiries,
|
|
2505
2525
|
method: "POST",
|
|
2506
2526
|
data: e
|
|
2507
2527
|
})).message
|
|
@@ -2518,81 +2538,81 @@ function St(e) {
|
|
|
2518
2538
|
}), 3e3);
|
|
2519
2539
|
}
|
|
2520
2540
|
}
|
|
2521
|
-
return /* @__PURE__ */
|
|
2522
|
-
style: { background: String(
|
|
2541
|
+
return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
|
|
2542
|
+
style: { background: String(t?.widget?.colorScheme) },
|
|
2523
2543
|
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",
|
|
2524
2544
|
children: [
|
|
2525
|
-
/* @__PURE__ */
|
|
2545
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2526
2546
|
className: "padorix:size-8",
|
|
2527
|
-
children: /* @__PURE__ */
|
|
2528
|
-
style: { color: String(
|
|
2547
|
+
children: /* @__PURE__ */ U("div", {
|
|
2548
|
+
style: { color: String(t?.widget?.colorScheme) },
|
|
2529
2549
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2530
2550
|
children: [
|
|
2531
2551
|
" ",
|
|
2532
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ H(Je, { className: "padorix:size-5" }),
|
|
2533
2553
|
" "
|
|
2534
2554
|
]
|
|
2535
2555
|
})
|
|
2536
2556
|
}) }),
|
|
2537
|
-
/* @__PURE__ */
|
|
2557
|
+
/* @__PURE__ */ U("div", {
|
|
2538
2558
|
className: "",
|
|
2539
|
-
children: [/* @__PURE__ */
|
|
2559
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2540
2560
|
className: "",
|
|
2541
2561
|
children: "Send us a message"
|
|
2542
|
-
}) }), /* @__PURE__ */
|
|
2562
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2543
2563
|
className: "padorix:text-xs",
|
|
2544
2564
|
children: "Leave us a message and we'll reply via email."
|
|
2545
2565
|
}) })]
|
|
2546
2566
|
}),
|
|
2547
|
-
/* @__PURE__ */
|
|
2567
|
+
/* @__PURE__ */ H("div", {
|
|
2548
2568
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2549
|
-
children: /* @__PURE__ */
|
|
2569
|
+
children: /* @__PURE__ */ H("div", {
|
|
2550
2570
|
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",
|
|
2551
2571
|
onClick: e.close,
|
|
2552
|
-
children: /* @__PURE__ */
|
|
2572
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2553
2573
|
})
|
|
2554
2574
|
})
|
|
2555
2575
|
]
|
|
2556
|
-
}), /* @__PURE__ */
|
|
2576
|
+
}), /* @__PURE__ */ H("div", {
|
|
2557
2577
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2558
|
-
children: /* @__PURE__ */
|
|
2578
|
+
children: /* @__PURE__ */ U("form", {
|
|
2559
2579
|
onSubmit: s.onSubmit(c),
|
|
2560
2580
|
children: [
|
|
2561
|
-
/* @__PURE__ */
|
|
2581
|
+
/* @__PURE__ */ H($, {
|
|
2562
2582
|
content: "Full name",
|
|
2563
2583
|
placeholder: "Enter your full name",
|
|
2564
2584
|
error: s.errors.name?.toString() || "",
|
|
2565
2585
|
...s.getInputProps("name")
|
|
2566
2586
|
}, s.key("name")),
|
|
2567
|
-
/* @__PURE__ */
|
|
2587
|
+
/* @__PURE__ */ H($, {
|
|
2568
2588
|
content: "Email address",
|
|
2569
2589
|
placeholder: "name@example.com",
|
|
2570
2590
|
error: s.errors.email?.toString() || "",
|
|
2571
2591
|
...s.getInputProps("email")
|
|
2572
2592
|
}, s.key("email")),
|
|
2573
|
-
/* @__PURE__ */
|
|
2593
|
+
/* @__PURE__ */ H($, {
|
|
2574
2594
|
content: "Message",
|
|
2575
2595
|
formtype: "textarea",
|
|
2576
2596
|
error: s.errors.message?.toString() || "",
|
|
2577
2597
|
...s.getInputProps("message")
|
|
2578
2598
|
}, s.key("message")),
|
|
2579
|
-
a.message && /* @__PURE__ */
|
|
2599
|
+
a.message && /* @__PURE__ */ H("div", {
|
|
2580
2600
|
className: `padorix:mt-4 padorix:text-sm padorix:p-2 padorix:rounded-md ${a.status === "success" ? "padorix:bg-green-100 padorix:text-green-800" : "padorix:bg-red-100 padorix:text-red-800"}`,
|
|
2581
2601
|
children: a.message
|
|
2582
2602
|
}),
|
|
2583
|
-
/* @__PURE__ */
|
|
2603
|
+
/* @__PURE__ */ U("div", {
|
|
2584
2604
|
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2585
|
-
children: [/* @__PURE__ */
|
|
2605
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2586
2606
|
type: "button",
|
|
2587
2607
|
onClick: e.backAction,
|
|
2588
2608
|
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",
|
|
2589
2609
|
children: "Back"
|
|
2590
|
-
}) }), /* @__PURE__ */
|
|
2610
|
+
}) }), /* @__PURE__ */ H(B, {
|
|
2591
2611
|
className: "padorix:w-full",
|
|
2592
|
-
children: /* @__PURE__ */
|
|
2593
|
-
disabled:
|
|
2594
|
-
style: { background:
|
|
2595
|
-
className: `${
|
|
2612
|
+
children: /* @__PURE__ */ H("button", {
|
|
2613
|
+
disabled: n,
|
|
2614
|
+
style: { background: n ? "#62748e" : String(t?.widget?.colorScheme) },
|
|
2615
|
+
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`,
|
|
2596
2616
|
children: "Submit message"
|
|
2597
2617
|
})
|
|
2598
2618
|
})]
|
|
@@ -2603,49 +2623,49 @@ function St(e) {
|
|
|
2603
2623
|
}
|
|
2604
2624
|
//#endregion
|
|
2605
2625
|
//#region lib/chats/chatScreen/chat-lobby.tsx
|
|
2606
|
-
function
|
|
2607
|
-
let { sender: t, faqs: n, faqsLoaded: r, workspace: i } =
|
|
2608
|
-
function
|
|
2626
|
+
function Et(e) {
|
|
2627
|
+
let { sender: t, faqs: n, faqsLoaded: r, workspace: i } = j((e) => e.data), a = JSON.parse(localStorage.getItem("pdx-sess") || "null"), [o, s] = M.useState(!0), [c, l] = M.useState(!1), u = f(i?.widget?.notifications?.showFaqBeforeConversation), d = p(i?.widget), m = !!(e.openOptions && Object.values(e.openOptions).some(Boolean));
|
|
2628
|
+
function h(e) {
|
|
2609
2629
|
s(e), l(!d);
|
|
2610
2630
|
}
|
|
2611
|
-
function
|
|
2631
|
+
function g() {
|
|
2612
2632
|
s(!0), l(!1);
|
|
2613
2633
|
}
|
|
2614
|
-
function
|
|
2634
|
+
function _() {
|
|
2615
2635
|
s(!0);
|
|
2616
2636
|
}
|
|
2617
|
-
if (t?.conversationId && a?.conversationId) return /* @__PURE__ */
|
|
2618
|
-
if (!
|
|
2619
|
-
if (!
|
|
2637
|
+
if (t?.conversationId && a?.conversationId) return /* @__PURE__ */ H(gt, { ...e });
|
|
2638
|
+
if (!m && o && u && !r) return /* @__PURE__ */ H(S, { close: e.close });
|
|
2639
|
+
if (!m && o && u && n.length > 0) return /* @__PURE__ */ H("div", {
|
|
2620
2640
|
className: e.styles.container,
|
|
2621
|
-
children: /* @__PURE__ */
|
|
2622
|
-
talkToTeam:
|
|
2641
|
+
children: /* @__PURE__ */ H(wt, {
|
|
2642
|
+
talkToTeam: h,
|
|
2623
2643
|
isOpen: d,
|
|
2624
2644
|
...e
|
|
2625
2645
|
})
|
|
2626
2646
|
});
|
|
2627
|
-
if (c) return /* @__PURE__ */
|
|
2647
|
+
if (c) return /* @__PURE__ */ H("div", {
|
|
2628
2648
|
className: e.styles.container,
|
|
2629
|
-
children: /* @__PURE__ */
|
|
2649
|
+
children: /* @__PURE__ */ H(Tt, {
|
|
2630
2650
|
close: e.close,
|
|
2631
2651
|
isOpen: d,
|
|
2632
|
-
backAction:
|
|
2652
|
+
backAction: g
|
|
2633
2653
|
})
|
|
2634
2654
|
});
|
|
2635
|
-
if (!c) return /* @__PURE__ */
|
|
2636
|
-
openFaq:
|
|
2655
|
+
if (!c) return /* @__PURE__ */ H(Dt, {
|
|
2656
|
+
openFaq: _,
|
|
2637
2657
|
...e
|
|
2638
2658
|
});
|
|
2639
2659
|
}
|
|
2640
|
-
function
|
|
2641
|
-
let { workspace: n, faqs: r } =
|
|
2642
|
-
|
|
2660
|
+
function Dt({ openFaq: e, ...t }) {
|
|
2661
|
+
let { workspace: n, faqs: r } = j((e) => e.data), [i, a] = M.useState(t.openOptions ? 2 : 1), o = p(n?.widget), s = f(n?.widget?.notifications?.showFaqBeforeConversation) && r.length > 0, c = M.useMemo(() => n?.logo, [n]);
|
|
2662
|
+
M.useEffect(() => {
|
|
2643
2663
|
a(t.openOptions ? 2 : 1);
|
|
2644
2664
|
}, [t.openRequestId]);
|
|
2645
2665
|
function l(e) {
|
|
2646
2666
|
a(e);
|
|
2647
2667
|
}
|
|
2648
|
-
if (i === 2) return /* @__PURE__ */
|
|
2668
|
+
if (i === 2) return /* @__PURE__ */ H(bt, {
|
|
2649
2669
|
close: t.close,
|
|
2650
2670
|
styles: t.styles,
|
|
2651
2671
|
changeScreen: l,
|
|
@@ -2654,23 +2674,23 @@ function wt({ openFaq: e, ...t }) {
|
|
|
2654
2674
|
openRequestId: t.openRequestId,
|
|
2655
2675
|
autoSubmitRequestId: t.autoSubmitRequestId
|
|
2656
2676
|
});
|
|
2657
|
-
if (i === 1) return /* @__PURE__ */
|
|
2677
|
+
if (i === 1) return /* @__PURE__ */ U("div", {
|
|
2658
2678
|
className: t.styles.container,
|
|
2659
|
-
children: [/* @__PURE__ */
|
|
2679
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2660
2680
|
style: {
|
|
2661
2681
|
background: String(n?.widget?.colorScheme),
|
|
2662
2682
|
color: n?.widget?.textColor || "#ffffff"
|
|
2663
2683
|
},
|
|
2664
2684
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2665
2685
|
children: [
|
|
2666
|
-
/* @__PURE__ */
|
|
2686
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2667
2687
|
className: "padorix:size-8",
|
|
2668
|
-
children: /* @__PURE__ */
|
|
2688
|
+
children: /* @__PURE__ */ U("div", {
|
|
2669
2689
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2670
2690
|
children: [
|
|
2671
2691
|
" ",
|
|
2672
|
-
/* @__PURE__ */
|
|
2673
|
-
src:
|
|
2692
|
+
/* @__PURE__ */ H("img", {
|
|
2693
|
+
src: _t,
|
|
2674
2694
|
alt: n?.name,
|
|
2675
2695
|
loading: "lazy",
|
|
2676
2696
|
className: "padorix:size-6"
|
|
@@ -2679,29 +2699,29 @@ function wt({ openFaq: e, ...t }) {
|
|
|
2679
2699
|
]
|
|
2680
2700
|
})
|
|
2681
2701
|
}) }),
|
|
2682
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2683
2703
|
className: "",
|
|
2684
2704
|
children: n?.widget?.widgetMessage
|
|
2685
2705
|
}) }),
|
|
2686
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ H("div", {
|
|
2687
2707
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2688
|
-
children: /* @__PURE__ */
|
|
2708
|
+
children: /* @__PURE__ */ H("div", {
|
|
2689
2709
|
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",
|
|
2690
2710
|
onClick: t.close,
|
|
2691
|
-
children: /* @__PURE__ */
|
|
2711
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2692
2712
|
})
|
|
2693
2713
|
})
|
|
2694
2714
|
]
|
|
2695
|
-
}), /* @__PURE__ */
|
|
2715
|
+
}), /* @__PURE__ */ H("div", {
|
|
2696
2716
|
className: "padorix:p-4 padorix:mt-5",
|
|
2697
|
-
children: /* @__PURE__ */
|
|
2717
|
+
children: /* @__PURE__ */ U("div", {
|
|
2698
2718
|
className: "padorix:flex padorix:flex-col padorix:items-center padorix:text-center padorix:h-full padorix:justify-center",
|
|
2699
2719
|
children: [
|
|
2700
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
2701
2721
|
className: "padorix:mb-3",
|
|
2702
2722
|
children: [
|
|
2703
2723
|
" ",
|
|
2704
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ H("img", {
|
|
2705
2725
|
src: c,
|
|
2706
2726
|
alt: n?.name,
|
|
2707
2727
|
loading: "lazy",
|
|
@@ -2710,33 +2730,33 @@ function wt({ openFaq: e, ...t }) {
|
|
|
2710
2730
|
" "
|
|
2711
2731
|
]
|
|
2712
2732
|
}) }),
|
|
2713
|
-
/* @__PURE__ */
|
|
2733
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2714
2734
|
className: "padorix:font-semibold",
|
|
2715
2735
|
children: n?.widget?.department
|
|
2716
2736
|
}) }),
|
|
2717
|
-
/* @__PURE__ */
|
|
2737
|
+
/* @__PURE__ */ U(B, { children: [/* @__PURE__ */ H("div", {
|
|
2718
2738
|
className: "padorix:mt-5",
|
|
2719
2739
|
children: n?.widget?.welcomeMessage || "Ask us anything - we will get back to you here or by email."
|
|
2720
|
-
}), !o && /* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2740
|
+
}), !o && /* @__PURE__ */ H(Ct, {})] }),
|
|
2741
|
+
/* @__PURE__ */ U("div", {
|
|
2722
2742
|
className: "padorix:mt-10",
|
|
2723
|
-
children: [/* @__PURE__ */
|
|
2743
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2724
2744
|
onClick: () => o && l(2),
|
|
2725
2745
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2726
2746
|
disabled: !o,
|
|
2727
2747
|
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"}`,
|
|
2728
2748
|
children: "Start new conversation"
|
|
2729
|
-
}) }), s && /* @__PURE__ */
|
|
2749
|
+
}) }), s && /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2730
2750
|
onClick: () => e?.(),
|
|
2731
2751
|
className: "padorix:underline padorix:mt-5 padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2732
2752
|
children: "Frequently asked questions?"
|
|
2733
2753
|
}) })]
|
|
2734
2754
|
}),
|
|
2735
|
-
|
|
2755
|
+
f(n?.widget?.notifications?.displaySourceLogoOnWidget) && /* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
2736
2756
|
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",
|
|
2737
2757
|
children: [
|
|
2738
2758
|
" ",
|
|
2739
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ H("img", {
|
|
2740
2760
|
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/AGVOgFUuQOTL4LVdsFUeAOS7gAWP0EVvATVMkTVcQNTsgSUMAIUdwOT74CWPgEWPQEU+cDVvIHUuAFVeQFVu4KVNcEWPQOUL8CVfYMU80STrsFVOwGVOsQT70FVesFUuc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i5V90h924KDpTxkxNzhAxOyMI3frGH6O/OfjMgtPhj5YbNasUD4aWhPyXSxESOrbLoiAO73Waz63Qpam+4Pw2h8Mq3wnqYJ+hcBYfx1XbNf0J03yVPTdj2VMvoWd3vyCqGQfDtOBl1bwxw2E4sJOwiYJgIzcipd1r8rJIGTIhbBonnxXNiJqHL/aMeqsWECRcfOvBo31CIfOWHiVdbtGjRs+fU0zh+7nvdhCHu15OgaYsaTPu8071bwDuf/aQ9C5RzJcdwbdG7ItvWID6+Vljcvx7DzwqdMTQmuV4+BM1hpWQukv+Mwytm/z2Dg9FqQ0lOtCF10Mc/gCtD7of+Z0X0RRTanSbbXGWj8eGpt4N3m1Sb5F2EAwfxsdL0NhiiiwMhqDfDDPS6iDFJ7y6lyHvQ/oBdwb3yxHAse4poiQqd61IMJvvJL4J8LWyAb/Zi5Ivl1Oz1YNDCqLzgRgitXSSnpr+XDVoN7UKhy7ag2295kXTF4SgTajkI+6prkB2Ewt7ausfrA4Bth4Jdo1p4ZhlKE0NIRDxu5uBLd2kyeDuYUHdFmP7MwZhgrx/R9q8LLxy4cOHCK6NGHcpt5Lrzt6HXkhiCKDwEh/9u/wHzq1jxN2ehBgz8P+K/qzfIpxuSbGgAAAAASUVORK5CYII=",
|
|
2741
2761
|
alt: "padorix",
|
|
2742
2762
|
loading: "lazy",
|
|
@@ -2751,41 +2771,13 @@ function wt({ openFaq: e, ...t }) {
|
|
|
2751
2771
|
});
|
|
2752
2772
|
}
|
|
2753
2773
|
//#endregion
|
|
2754
|
-
//#region lib/
|
|
2755
|
-
var
|
|
2756
|
-
visitor: {
|
|
2757
|
-
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",
|
|
2758
|
-
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",
|
|
2759
|
-
height: "80dvh",
|
|
2760
|
-
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",
|
|
2761
|
-
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",
|
|
2762
|
-
emojiContainer: "padorix:fixed padorix:bottom-20 padorix:left-4 padorix:z-30 padorix:md:left-auto padorix:md:right-6",
|
|
2763
|
-
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",
|
|
2764
|
-
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]",
|
|
2765
|
-
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",
|
|
2766
|
-
replyContainer: "padorix:relative padorix:w-full padorix:mb-1",
|
|
2767
|
-
formRoot: "padorix:relative padorix:z-50",
|
|
2768
|
-
imagePreviewBox: "padorix:h-[60dvh] padorix:md:h-[50dvh]"
|
|
2769
|
-
},
|
|
2770
|
-
nonVisitor: {
|
|
2771
|
-
container: "padorix:bg-[#fff] padorix:relative!",
|
|
2772
|
-
height: "",
|
|
2773
|
-
chatContainerPadding: "padorix:pt-5 padorix:pb-20 padorix:overflow-y-auto padorix:overflow-x-hidden padorix-scrolls padorix:relative",
|
|
2774
|
-
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",
|
|
2775
|
-
emojiContainer: "padorix:absolute padorix:bottom-full padorix:left-1 padorix:mb-1 padorix:z-40",
|
|
2776
|
-
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 ${Tt} padorix:ml-auto padorix:right-0 padorix:md:text-sm padorix:px-1.5 padorix:pt-1.5 padorix:pb-4`,
|
|
2777
|
-
imageUploadContainer: `padorix:absolute padorix:inset-0 padorix:bg-white padorix:z-30 padorix:flex padorix:flex-col padorix:gap-3 ${Tt}`,
|
|
2778
|
-
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",
|
|
2779
|
-
replyContainer: `padorix:relative padorix:w-full padorix:mb-1 ${Tt}`,
|
|
2780
|
-
formRoot: "",
|
|
2781
|
-
imagePreviewBox: "padorix:flex-1 padorix:min-h-0"
|
|
2782
|
-
}
|
|
2783
|
-
}, Dt = "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", Ot = "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";
|
|
2774
|
+
//#region lib/assets/images/error.svg
|
|
2775
|
+
var Ot = "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", kt = "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";
|
|
2784
2776
|
//#endregion
|
|
2785
2777
|
//#region lib/chats/online-check/online-check.tsx
|
|
2786
|
-
function
|
|
2787
|
-
let t = e.userType ===
|
|
2788
|
-
return
|
|
2778
|
+
function At(e) {
|
|
2779
|
+
let t = e.userType === T.VISITOR ? y.visitor : y.nonVisitor, n = e.userType === T.VISITOR, [r, i] = M.useState(navigator.onLine);
|
|
2780
|
+
return M.useEffect(() => {
|
|
2789
2781
|
let e = () => {
|
|
2790
2782
|
i(!0);
|
|
2791
2783
|
}, t = () => {
|
|
@@ -2794,19 +2786,19 @@ function kt(e) {
|
|
|
2794
2786
|
return window.addEventListener("online", e), window.addEventListener("offline", t), () => {
|
|
2795
2787
|
window.removeEventListener("online", e), window.removeEventListener("offline", t);
|
|
2796
2788
|
};
|
|
2797
|
-
}, []), r ? e.children : /* @__PURE__ */
|
|
2789
|
+
}, []), r ? e.children : /* @__PURE__ */ U("div", {
|
|
2798
2790
|
className: t.container,
|
|
2799
|
-
children: [/* @__PURE__ */
|
|
2791
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2800
2792
|
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",
|
|
2801
2793
|
children: [
|
|
2802
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2803
2795
|
className: "padorix:size-8",
|
|
2804
|
-
children: /* @__PURE__ */
|
|
2796
|
+
children: /* @__PURE__ */ U("div", {
|
|
2805
2797
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2806
2798
|
children: [
|
|
2807
2799
|
" ",
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
src:
|
|
2800
|
+
/* @__PURE__ */ H("img", {
|
|
2801
|
+
src: kt,
|
|
2810
2802
|
alt: "Padorix",
|
|
2811
2803
|
loading: "lazy",
|
|
2812
2804
|
className: "padorix:size-6"
|
|
@@ -2815,39 +2807,39 @@ function kt(e) {
|
|
|
2815
2807
|
]
|
|
2816
2808
|
})
|
|
2817
2809
|
}) }),
|
|
2818
|
-
/* @__PURE__ */
|
|
2810
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2819
2811
|
className: "",
|
|
2820
2812
|
children: "Internet connected lost, try reconnecting your device network to proceed"
|
|
2821
2813
|
}) }),
|
|
2822
|
-
n && /* @__PURE__ */
|
|
2814
|
+
n && /* @__PURE__ */ H("div", {
|
|
2823
2815
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2824
|
-
children: /* @__PURE__ */
|
|
2816
|
+
children: /* @__PURE__ */ H("div", {
|
|
2825
2817
|
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",
|
|
2826
2818
|
onClick: e.close,
|
|
2827
|
-
children: /* @__PURE__ */
|
|
2819
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2828
2820
|
})
|
|
2829
2821
|
})
|
|
2830
2822
|
]
|
|
2831
|
-
}), /* @__PURE__ */
|
|
2823
|
+
}), /* @__PURE__ */ U("div", {
|
|
2832
2824
|
className: "padorix:flex padorix:flex-col padorix:items-center padorix:justify-center padorix:h-full padorix:text-center",
|
|
2833
|
-
children: [/* @__PURE__ */
|
|
2834
|
-
src:
|
|
2825
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("img", {
|
|
2826
|
+
src: Ot,
|
|
2835
2827
|
alt: "",
|
|
2836
2828
|
className: ""
|
|
2837
|
-
}) }), /* @__PURE__ */
|
|
2838
|
-
/* @__PURE__ */
|
|
2829
|
+
}) }), /* @__PURE__ */ U(B, { children: [
|
|
2830
|
+
/* @__PURE__ */ H("div", {
|
|
2839
2831
|
className: "padorix:text-2xl padorix:font-bold padorix:mt-10 padorix:mb-3",
|
|
2840
2832
|
children: "Oops!"
|
|
2841
2833
|
}),
|
|
2842
|
-
/* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ H("div", {
|
|
2843
2835
|
className: "padorix:text-base padorix:text-zinc-500",
|
|
2844
2836
|
children: "Your internet is disconnected"
|
|
2845
2837
|
}),
|
|
2846
|
-
/* @__PURE__ */
|
|
2838
|
+
/* @__PURE__ */ U("div", {
|
|
2847
2839
|
className: "padorix:text-zinc-500 padorix:text-sm",
|
|
2848
2840
|
children: [
|
|
2849
2841
|
"Do not worry your chat sessions are saved ",
|
|
2850
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ H("br", {}),
|
|
2851
2843
|
" till you are back online"
|
|
2852
2844
|
]
|
|
2853
2845
|
})
|
|
@@ -2857,16 +2849,16 @@ function kt(e) {
|
|
|
2857
2849
|
}
|
|
2858
2850
|
//#endregion
|
|
2859
2851
|
//#region lib/chats/chatScreen/chat-conversation.tsx
|
|
2860
|
-
function
|
|
2861
|
-
let n = t.userType ===
|
|
2862
|
-
if (
|
|
2852
|
+
function jt(t) {
|
|
2853
|
+
let n = t.userType === T.VISITOR, r = A(), { workspace: o } = j((e) => e.data);
|
|
2854
|
+
if (M.useEffect(() => {
|
|
2863
2855
|
if (!n) {
|
|
2864
|
-
r(
|
|
2856
|
+
r(i(t.sender));
|
|
2865
2857
|
return;
|
|
2866
2858
|
}
|
|
2867
2859
|
try {
|
|
2868
|
-
let
|
|
2869
|
-
|
|
2860
|
+
let e = JSON.parse(localStorage.getItem("pdx-sess") ?? "null");
|
|
2861
|
+
e?.conversationId && r(i(e));
|
|
2870
2862
|
} catch (e) {
|
|
2871
2863
|
console.log(e);
|
|
2872
2864
|
}
|
|
@@ -2874,40 +2866,40 @@ function At(t) {
|
|
|
2874
2866
|
r,
|
|
2875
2867
|
n,
|
|
2876
2868
|
t.sender
|
|
2877
|
-
]),
|
|
2869
|
+
]), M.useEffect(() => {
|
|
2878
2870
|
if (!t.workspaceId) return;
|
|
2879
|
-
let
|
|
2880
|
-
return
|
|
2881
|
-
|
|
2871
|
+
let n = !1;
|
|
2872
|
+
return v.config(t.workspaceId, t.userType).then((t) => {
|
|
2873
|
+
n || (r(s(t.workspace)), r(e(t.faqs)), r(a(t.tags)));
|
|
2882
2874
|
}).catch((e) => console.log(e.message, "error data")), () => {
|
|
2883
|
-
|
|
2875
|
+
n = !0;
|
|
2884
2876
|
};
|
|
2885
2877
|
}, [
|
|
2886
2878
|
r,
|
|
2887
2879
|
t.userType,
|
|
2888
2880
|
t.workspaceId
|
|
2889
|
-
]),
|
|
2881
|
+
]), M.useEffect(() => {
|
|
2890
2882
|
if (n || !t.workspaceId) return;
|
|
2891
|
-
let e = () =>
|
|
2892
|
-
return
|
|
2893
|
-
|
|
2883
|
+
let e = () => O.emit(k.subscribe_workspace, { workspaceId: t.workspaceId });
|
|
2884
|
+
return O.on(k.connected, e), te(!0), e(), () => {
|
|
2885
|
+
O.off(k.connected, e);
|
|
2894
2886
|
};
|
|
2895
2887
|
}, [n, t.workspaceId]), o?.id) return t.children;
|
|
2896
2888
|
}
|
|
2897
2889
|
//#endregion
|
|
2898
2890
|
//#region lib/chats/chatScreen/chat-panel.tsx
|
|
2899
|
-
function
|
|
2900
|
-
return /* @__PURE__ */
|
|
2891
|
+
function Mt(e) {
|
|
2892
|
+
return /* @__PURE__ */ U(W, { children: [/* @__PURE__ */ H("div", {
|
|
2901
2893
|
"aria-hidden": !0,
|
|
2902
|
-
className:
|
|
2903
|
-
}), /* @__PURE__ */
|
|
2894
|
+
className: y.visitor.backdrop
|
|
2895
|
+
}), /* @__PURE__ */ H(At, {
|
|
2904
2896
|
...e,
|
|
2905
2897
|
close: e.close,
|
|
2906
|
-
children: /* @__PURE__ */
|
|
2898
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2907
2899
|
...e,
|
|
2908
|
-
children: /* @__PURE__ */
|
|
2900
|
+
children: /* @__PURE__ */ H(Et, {
|
|
2909
2901
|
close: e.close,
|
|
2910
|
-
styles:
|
|
2902
|
+
styles: y.visitor,
|
|
2911
2903
|
workspaceId: e.workspaceId,
|
|
2912
2904
|
moreActions: e.moreActions,
|
|
2913
2905
|
userType: e.userType,
|
|
@@ -2921,13 +2913,13 @@ function jt(e) {
|
|
|
2921
2913
|
})
|
|
2922
2914
|
})] });
|
|
2923
2915
|
}
|
|
2924
|
-
function
|
|
2925
|
-
return /* @__PURE__ */
|
|
2916
|
+
function Nt(e) {
|
|
2917
|
+
return /* @__PURE__ */ U(W, { children: [/* @__PURE__ */ H(D, {}), /* @__PURE__ */ H(At, {
|
|
2926
2918
|
...e,
|
|
2927
|
-
children: /* @__PURE__ */
|
|
2919
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2928
2920
|
...e,
|
|
2929
|
-
children: /* @__PURE__ */
|
|
2930
|
-
styles:
|
|
2921
|
+
children: /* @__PURE__ */ H(gt, {
|
|
2922
|
+
styles: y.nonVisitor,
|
|
2931
2923
|
moreActions: e.moreActions,
|
|
2932
2924
|
userType: e.userType,
|
|
2933
2925
|
sender: e.sender,
|
|
@@ -2938,6 +2930,6 @@ function Mt(e) {
|
|
|
2938
2930
|
})] });
|
|
2939
2931
|
}
|
|
2940
2932
|
//#endregion
|
|
2941
|
-
export {
|
|
2933
|
+
export { Nt as AgentChatPanel, Mt as VisitorChatPanel };
|
|
2942
2934
|
|
|
2943
|
-
//# sourceMappingURL=chat-panel-
|
|
2935
|
+
//# sourceMappingURL=chat-panel-N3AY-SGW.js.map
|