padorixnpm 0.0.69 → 0.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chat-panel-CXbOkOSq.js → chat-panel-DOV89YL7.js} +1076 -914
- package/dist/chat-panel-DOV89YL7.js.map +1 -0
- package/dist/chats/chatScreen/chat-container.d.ts.map +1 -1
- package/dist/chats/chatScreen/styles.d.ts +4 -0
- package/dist/chats/chatScreen/styles.d.ts.map +1 -1
- package/dist/chats/chatform/chat-form-component.d.ts +4 -0
- package/dist/chats/chatform/chat-form-component.d.ts.map +1 -1
- package/dist/chats/chatform/chat-form.d.ts +2 -2
- package/dist/chats/chatform/chat-form.d.ts.map +1 -1
- package/dist/chats/chatform/chat-image-upload.d.ts +2 -2
- package/dist/chats/chatform/chat-image-upload.d.ts.map +1 -1
- package/dist/chats/chatform/emoji-picker.d.ts +9 -0
- package/dist/chats/chatform/emoji-picker.d.ts.map +1 -0
- package/dist/global.d.ts +7 -0
- package/dist/global.d.ts.map +1 -1
- package/dist/padorixnpm.css +1 -1
- package/dist/padorixnpm.js +2 -2
- package/dist/padorixnpm.umd.cjs +9 -9
- package/dist/padorixnpm.umd.cjs.map +1 -1
- package/dist/{widget-api-2bTO9wMA.js → widget-api-BfWB6m6w.js} +50 -71
- package/dist/{widget-api-2bTO9wMA.js.map → widget-api-BfWB6m6w.js.map} +1 -1
- package/package.json +1 -2
- package/dist/chat-panel-CXbOkOSq.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 T, { i as E, n as
|
|
1
|
+
import { A as e, C as t, D as n, E as r, M as i, O as a, S as o, T as s, _ as c, a as l, b as u, f as d, g as f, h as p, i as m, j as h, k as g, l as _, m as v, s as y, u as b, v as x, w as S, x as C, y as w } from "./widget-api-BfWB6m6w.js";
|
|
2
|
+
import T, { i as E, n as ee, r as D, t as te } from "./notification-ChYfFRqp.js";
|
|
3
3
|
import { useDispatch as O, useSelector as k } from "react-redux";
|
|
4
4
|
import A, { createElement as j, forwardRef as M, useState as N } from "react";
|
|
5
|
-
import { Add as P, ArrowDown2 as F, ArrowForward as
|
|
6
|
-
import { Fade as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { MantineProvider as
|
|
9
|
-
import
|
|
10
|
-
import { useDisclosure as
|
|
11
|
-
import { useForm as
|
|
5
|
+
import { Add as P, ArrowDown2 as F, ArrowForward as I, ArrowLeft2 as ne, Copy as re, DocumentDownload as ie, EmojiHappy as ae, Global as oe, Minus as L, Send as se, Star1 as R, Trash as ce } from "iconsax-reactjs";
|
|
6
|
+
import { Fade as z, JackInTheBox as le, Slide as ue } from "react-awesome-reveal";
|
|
7
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
8
|
+
import { MantineProvider as U, Modal as W, Popover as G } from "@mantine/core";
|
|
9
|
+
import K from "dayjs";
|
|
10
|
+
import { useDisclosure as de } from "@mantine/hooks";
|
|
11
|
+
import { useForm as fe } from "@mantine/form";
|
|
12
12
|
//#region lib/chats/chatform/chat-text-input.tsx
|
|
13
|
-
var
|
|
13
|
+
var pe = 120, q = 2500, J = 1500, me = M(({ setMessage: e, message: t, userType: n, onImagePasted: r, onSubmit: i, ...a }, o) => {
|
|
14
14
|
let { sender: s } = k((e) => e.data), c = A.useRef(null), l = A.useRef(0), u = A.useRef(!1);
|
|
15
15
|
A.useImperativeHandle(o, () => c.current), A.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, pe)}px`, e.style.overflowY = e.scrollHeight > pe ? "auto" : "hidden");
|
|
18
18
|
}, [t]);
|
|
19
19
|
let d = (e) => {
|
|
20
20
|
let t = e.clipboardData?.items;
|
|
@@ -43,8 +43,8 @@ var q = 120, me = 2500, he = 1500, ge = 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 > q && (l.current = i, u.current = !0, E.emit(D.is_typing, r));
|
|
47
|
+
let a = window.setTimeout(() => p(r), J);
|
|
48
48
|
return () => {
|
|
49
49
|
window.clearTimeout(a);
|
|
50
50
|
};
|
|
@@ -78,9 +78,9 @@ var q = 120, me = 2500, he = 1500, ge = M(({ setMessage: e, message: t, userType
|
|
|
78
78
|
userType: n
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ V("div", {
|
|
82
82
|
className: "padorix:w-full padorix:bg-slate-100 padorix:rounded-lg",
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ V("textarea", {
|
|
84
84
|
ref: c,
|
|
85
85
|
...a,
|
|
86
86
|
spellCheck: !0,
|
|
@@ -97,27 +97,27 @@ var q = 120, me = 2500, he = 1500, ge = M(({ setMessage: e, message: t, userType
|
|
|
97
97
|
rows: 1
|
|
98
98
|
})
|
|
99
99
|
});
|
|
100
|
-
}),
|
|
100
|
+
}), he = {
|
|
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
|
+
}, ge = A.createContext && /*#__PURE__*/ A.createContext(he), _e = [
|
|
107
107
|
"attr",
|
|
108
108
|
"size",
|
|
109
109
|
"title"
|
|
110
110
|
];
|
|
111
|
-
function
|
|
111
|
+
function ve(e, t) {
|
|
112
112
|
if (e == null) return {};
|
|
113
|
-
var n, r, i =
|
|
113
|
+
var n, r, i = ye(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 ye(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 be(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 xe(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 ? be(Object(n), !0).forEach(function(t) {
|
|
152
|
+
xe(e, t, n[t]);
|
|
153
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : be(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 xe(e, t, n) {
|
|
160
|
+
return (t = Se(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 Se(e) {
|
|
168
|
+
var t = Ce(e, "string");
|
|
169
169
|
return typeof t == "symbol" ? t : t + "";
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Ce(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,15 +178,15 @@ function we(e, t) {
|
|
|
178
178
|
}
|
|
179
179
|
return (t === "string" ? String : Number)(e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return e && e.map((e, t) => /*#__PURE__*/ A.createElement(e.tag, X({ key: t }, e.attr),
|
|
181
|
+
function we(e) {
|
|
182
|
+
return e && e.map((e, t) => /*#__PURE__*/ A.createElement(e.tag, X({ key: t }, e.attr), we(e.child)));
|
|
183
183
|
}
|
|
184
184
|
function Z(e) {
|
|
185
|
-
return (t) => /*#__PURE__*/ A.createElement(
|
|
185
|
+
return (t) => /*#__PURE__*/ A.createElement(Te, Y({ attr: X({}, e.attr) }, t), we(e.child));
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Te(e) {
|
|
188
188
|
var t = (t) => {
|
|
189
|
-
var { attr: n, size: r, title: i } = e, a =
|
|
189
|
+
var { attr: n, size: r, title: i } = e, a = ve(e, _e), o = r || t.size || "1em", s;
|
|
190
190
|
return t.className && (s = t.className), e.className && (s = (s ? s + " " : "") + e.className), /*#__PURE__*/ A.createElement("svg", Y({
|
|
191
191
|
stroke: "currentColor",
|
|
192
192
|
fill: "currentColor",
|
|
@@ -199,7 +199,7 @@ function Ee(e) {
|
|
|
199
199
|
xmlns: "http://www.w3.org/2000/svg"
|
|
200
200
|
}), i && /*#__PURE__*/ A.createElement("title", null, i), e.children);
|
|
201
201
|
};
|
|
202
|
-
return
|
|
202
|
+
return ge === void 0 ? t(he) : /*#__PURE__*/ A.createElement(ge.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 Ee(e) {
|
|
239
239
|
return Z({
|
|
240
240
|
tag: "svg",
|
|
241
241
|
attr: {
|
|
@@ -258,7 +258,7 @@ function De(e) {
|
|
|
258
258
|
}]
|
|
259
259
|
})(e);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function De(e) {
|
|
262
262
|
return Z({
|
|
263
263
|
tag: "svg",
|
|
264
264
|
attr: {
|
|
@@ -293,7 +293,7 @@ function Oe(e) {
|
|
|
293
293
|
]
|
|
294
294
|
})(e);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Oe(e) {
|
|
297
297
|
return Z({
|
|
298
298
|
tag: "svg",
|
|
299
299
|
attr: {
|
|
@@ -311,7 +311,7 @@ function ke(e) {
|
|
|
311
311
|
}]
|
|
312
312
|
})(e);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function ke(e) {
|
|
315
315
|
return Z({
|
|
316
316
|
tag: "svg",
|
|
317
317
|
attr: {
|
|
@@ -331,63 +331,182 @@ function Ae(e) {
|
|
|
331
331
|
}
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region lib/chats/chatmessages/chat-display-reply.tsx
|
|
334
|
-
function
|
|
335
|
-
let
|
|
336
|
-
function
|
|
337
|
-
|
|
334
|
+
function Ae(e) {
|
|
335
|
+
let t = O(), n = Array.isArray(e.data?.message) ? e.data.message.join(" ") : String(e.data?.message ?? "");
|
|
336
|
+
function r() {
|
|
337
|
+
t(s(void 0)), t(g(void 0));
|
|
338
338
|
}
|
|
339
|
-
if (
|
|
340
|
-
className:
|
|
341
|
-
children: /* @__PURE__ */
|
|
339
|
+
if (e.data?.id) return /* @__PURE__ */ V("div", {
|
|
340
|
+
className: e.styles.replyContainer,
|
|
341
|
+
children: /* @__PURE__ */ V("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__ */ V("div", { children: /* @__PURE__ */ V("div", {
|
|
344
344
|
className: "padorix:px-2",
|
|
345
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ H("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__ */ H("div", {
|
|
348
348
|
className: "padorix:flex padorix:items-center padorix:py-2.5 padorix:text-sm",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
350
|
-
}), /* @__PURE__ */
|
|
349
|
+
children: [/* @__PURE__ */ V(I, { className: "padorix:inline padorix:size-6 padorix:mr-3" }), n.length > 0 && /* @__PURE__ */ H("span", { children: [n.slice(0, 30), n.length > 30 ? "..." : ""] })]
|
|
350
|
+
}), /* @__PURE__ */ H("div", {
|
|
351
351
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
352
|
-
children: [Number(
|
|
352
|
+
children: [Number(e.data?.images?.length) > 0 && /* @__PURE__ */ H("div", {
|
|
353
353
|
className: "padorix:flex padorix:gap-1 padorix:flex-row",
|
|
354
|
-
children: [Array.isArray(
|
|
354
|
+
children: [Array.isArray(e?.data?.images) && e?.data?.images?.slice(0, 2)?.map((e, t) => /* @__PURE__ */ V("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(
|
|
358
|
+
}, t)), Number(e.data?.images?.length) > 2 && /* @__PURE__ */ H("div", {
|
|
359
359
|
className: "padorix:flex padorix:items-center",
|
|
360
360
|
children: [
|
|
361
361
|
" ",
|
|
362
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ V(P, { className: "padorix:inline padorix:size-5" }),
|
|
363
363
|
" ",
|
|
364
|
-
Number(
|
|
364
|
+
Number(e.data?.images?.length) - 2,
|
|
365
365
|
" "
|
|
366
366
|
]
|
|
367
367
|
})]
|
|
368
|
-
}), /* @__PURE__ */
|
|
369
|
-
onClick:
|
|
368
|
+
}), /* @__PURE__ */ V("div", {
|
|
369
|
+
onClick: r,
|
|
370
370
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-95",
|
|
371
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ V(Q, { className: "padorix:inline padorix:size-6 padorix:mr-3" })
|
|
372
372
|
})]
|
|
373
373
|
})]
|
|
374
374
|
})
|
|
375
375
|
}) })
|
|
376
|
-
},
|
|
376
|
+
}, e.data.id)
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region lib/chats/chatform/emoji-picker.tsx
|
|
381
|
+
var je = [
|
|
382
|
+
{
|
|
383
|
+
name: "Smileys",
|
|
384
|
+
icon: "😀",
|
|
385
|
+
emojis: "😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 😉 😊 😇 🥰 😍 🤩 😘 😗 😚 😙 😋 😛 😜 🤪 😝 🤑 🤗 🤭 🤫 🤔 🤐 🤨 😐 😑 😶 😏 😒 🙄 😬 😌 😔 😪 🤤 😴 😷 🤒 🤕 🤢 🤧 🥵 🥶 😵 🤯 🤠 🥳 😎 🤓 🧐 😕 😟 🙁 😮 😯 😲 😳 🥺 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 🥱 😤 😡 😠 🤬"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: "Gestures",
|
|
389
|
+
icon: "👍",
|
|
390
|
+
emojis: "👍 👎 👌 🤌 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐️ 🖖 👋 🤝 🙏 👏 🙌 👐 🤲 💪 ✍️ 💅 🤳 👀 👂 🧠 🫶"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: "Hearts",
|
|
394
|
+
icon: "❤️",
|
|
395
|
+
emojis: "❤️ 🧡 💛 💚 💙 💜 🖤 🤍 🤎 💔 ❣️ 💕 💞 💓 💗 💖 💘 💝 💟 ❤️🔥 💯 💢 💥 💫 💦 💨"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: "People",
|
|
399
|
+
icon: "🧑",
|
|
400
|
+
emojis: "👶 🧒 👦 👧 🧑 👨 👩 🧓 👴 👵 👮 🕵️ 💂 👷 🤴 👸 👳 🧕 🤵 👰 🤰 🤱 👼 🎅 🦸 🦹 🧙 🧚 🧛 🧜 🧝 🙋 🙆 🙅 🤷 🤦 💁 🙇 💃 🕺 👯 🧘 🏃 🚶"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "Nature",
|
|
404
|
+
icon: "🐶",
|
|
405
|
+
emojis: "🐶 🐱 🐭 🐹 🐰 🦊 🐻 🐼 🐨 🐯 🦁 🐮 🐷 🐸 🐵 🐔 🐧 🐦 🐤 🦆 🦅 🦉 🐺 🐴 🦄 🐝 🦋 🐌 🐞 🐢 🐍 🐙 🐠 🐬 🐳 🦈 🌵 🌲 🌳 🌴 🌱 🌿 🍀 🍁 🍂 🌸 🌹 🌺 🌻 🌼 🌷 ⭐ 🌟 ✨ ⚡ 🔥 🌈 ☀️ 🌤️ ☁️ 🌧️ ❄️ 🌊"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: "Food",
|
|
409
|
+
icon: "🍔",
|
|
410
|
+
emojis: "🍏 🍎 🍐 🍊 🍋 🍌 🍉 🍇 🍓 🍒 🍑 🥭 🍍 🥥 🥝 🍅 🥑 🍆 🥔 🥕 🌽 🌶️ 🥒 🥬 🥦 🍞 🧀 🥚 🍳 🥞 🥓 🍗 🍖 🌭 🍔 🍟 🍕 🥪 🌮 🌯 🥗 🍝 🍜 🍲 🍛 🍣 🍱 🍤 🍚 🍰 🎂 🍦 🍩 🍪 🍫 🍬 🍭 ☕ 🍵 🥤 🧃 🍺 🍷 🥂"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: "Activities",
|
|
414
|
+
icon: "⚽",
|
|
415
|
+
emojis: "⚽ 🏀 🏈 ⚾ 🎾 🏐 🏉 🎱 🏓 🏸 🥊 🥋 ⛳ 🎣 🎿 🏂 🏋️ 🚴 🏆 🥇 🥈 🥉 🏅 🎖️ 🎗️ 🎫 🎟️ 🎪 🎭 🎨 🎬 🎤 🎧 🎼 🎹 🥁 🎷 🎺 🎸 🎻 🎲 🎯 🎳 🎮 🧩 🎉 🎊 🎈 🎁"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
name: "Travel",
|
|
419
|
+
icon: "✈️",
|
|
420
|
+
emojis: "🚗 🚕 🚙 🚌 🏎️ 🚓 🚑 🚒 🚚 🚜 🛵 🏍️ 🚲 🛴 🚨 🚆 🚇 🚊 ✈️ 🛫 🛬 🚀 🛸 🚁 ⛵ 🚤 🚢 ⚓ ⛽ 🗺️ 🏠 🏡 🏢 🏬 🏦 🏥 🏨 🏪 🏫 ⛪ 🕌 🗽 🗼 🏰 🌍 🌎 🌏 🏝️ 🏖️ ⛰️ 🌋"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
name: "Objects",
|
|
424
|
+
icon: "💡",
|
|
425
|
+
emojis: "⌚ 📱 💻 ⌨️ 🖥️ 🖨️ 🖱️ 💾 💿 📷 📸 📹 🎥 📞 ☎️ 📺 📻 ⏰ ⏳ 🔋 🔌 💡 🔦 🕯️ 💸 💵 💳 💰 💎 🔧 🔨 🛠️ 🔩 ⚙️ 🔫 💊 💉 🧪 🔬 🔭 📦 📫 📬 ✉️ 📧 📝 📁 📂 📅 📆 📈 📉 📊 📋 📌 📍 📎 🔍 🔒 🔓 🔑 🛒 🎒"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: "Symbols",
|
|
429
|
+
icon: "✅",
|
|
430
|
+
emojis: "✅ ☑️ ✔️ ❌ ❎ ➕ ➖ ➗ ✖️ ❓ ❔ ❗ ❕ ‼️ ⁉️ ⚠️ 🚫 ⛔ 🔞 ♻️ 🆗 🆕 🆓 🆒 🆘 🔝 🔜 ⏩ ⏪ ▶️ ⏸️ ⏹️ 🔁 🔄 ⬆️ ⬇️ ⬅️ ➡️ ↩️ ℹ️ 🔴 🟠 🟡 🟢 🔵 🟣 ⚫ ⚪ 🟥 🟩 🟦 💲 ©️ ®️ ™️ 🔔 🔕 💬 💭 🗯️"
|
|
431
|
+
}
|
|
432
|
+
], Me = "padorix-recent-emojis", Ne = 24;
|
|
433
|
+
function Pe() {
|
|
434
|
+
try {
|
|
435
|
+
let e = JSON.parse(localStorage.getItem(Me) || "[]");
|
|
436
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "string").slice(0, Ne) : [];
|
|
437
|
+
} catch {
|
|
438
|
+
return [];
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
function Fe(e) {
|
|
442
|
+
let [t, n] = A.useState(Pe), [r, i] = A.useState(() => Pe().length > 0 ? "Recent" : je[0].name), a = A.useRef(null);
|
|
443
|
+
A.useEffect(() => {
|
|
444
|
+
let t = (t) => {
|
|
445
|
+
let n = t.composedPath();
|
|
446
|
+
a.current && n.includes(a.current) || e.toggleRef?.current && n.includes(e.toggleRef.current) || e.onClose();
|
|
447
|
+
}, n = (t) => {
|
|
448
|
+
t.key === "Escape" && e.onClose();
|
|
449
|
+
};
|
|
450
|
+
return document.addEventListener("pointerdown", t), document.addEventListener("keydown", n), () => {
|
|
451
|
+
document.removeEventListener("pointerdown", t), document.removeEventListener("keydown", n);
|
|
452
|
+
};
|
|
453
|
+
}, [e.onClose, e.toggleRef]);
|
|
454
|
+
function o(r) {
|
|
455
|
+
e.onSelect(r);
|
|
456
|
+
let i = [r, ...t.filter((e) => e !== r)].slice(0, Ne);
|
|
457
|
+
n(i);
|
|
458
|
+
try {
|
|
459
|
+
localStorage.setItem(Me, JSON.stringify(i));
|
|
460
|
+
} catch {}
|
|
461
|
+
}
|
|
462
|
+
let s = [...t.length > 0 ? [{
|
|
463
|
+
name: "Recent",
|
|
464
|
+
icon: "🕘"
|
|
465
|
+
}] : [], ...je], c = r === "Recent" ? t : je.find((e) => e.name === r)?.emojis.split(" ") ?? [];
|
|
466
|
+
return /* @__PURE__ */ H("div", {
|
|
467
|
+
ref: a,
|
|
468
|
+
role: "dialog",
|
|
469
|
+
"aria-label": "Emoji picker",
|
|
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
|
+
children: [
|
|
472
|
+
/* @__PURE__ */ V("div", {
|
|
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__ */ V("button", {
|
|
475
|
+
type: "button",
|
|
476
|
+
title: e.name,
|
|
477
|
+
"aria-pressed": r === e.name,
|
|
478
|
+
onClick: () => i(e.name),
|
|
479
|
+
className: `padorix:shrink-0 padorix:size-8 padorix:rounded-md padorix:text-lg padorix:leading-none padorix:cursor-pointer ${r === e.name ? "padorix:bg-gray-100" : "padorix:opacity-60 padorix:hover:opacity-100"}`,
|
|
480
|
+
children: e.icon
|
|
481
|
+
}, e.name))
|
|
482
|
+
}),
|
|
483
|
+
/* @__PURE__ */ V("div", {
|
|
484
|
+
className: "padorix:px-2 padorix:pt-1.5 padorix:text-xs padorix:text-gray-500",
|
|
485
|
+
children: r
|
|
486
|
+
}),
|
|
487
|
+
/* @__PURE__ */ V("div", {
|
|
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__ */ V("button", {
|
|
490
|
+
type: "button",
|
|
491
|
+
onClick: () => o(e),
|
|
492
|
+
className: "padorix:size-8 padorix:rounded-md padorix:text-xl padorix:leading-none padorix:cursor-pointer padorix:hover:bg-gray-100",
|
|
493
|
+
children: e
|
|
494
|
+
}, `${e}-${t}`))
|
|
495
|
+
})
|
|
496
|
+
]
|
|
377
497
|
});
|
|
378
498
|
}
|
|
379
499
|
//#endregion
|
|
380
500
|
//#region lib/chats/chatform/chat-form.tsx
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
let { sender: t, workspace: n, message: r } = k((e) => e.data), [i, a] = A.useState(!1), [o, s] = A.useState(!1);
|
|
384
|
-
i && !o && s(!0);
|
|
385
|
-
let [c, l] = A.useState(""), u = A.useRef(null), d = Number(e.previews?.length) < 1, f = Math.max(0, Number(n?.tier?.max_file_upload ?? 2)), p = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), m = n?.file_uploads_date === p ? Number(n?.file_uploads_used ?? 0) : 0, h = e.showFile && m + e.pendingFileCount < f;
|
|
501
|
+
function Ie(e) {
|
|
502
|
+
let { sender: t, workspace: n, message: r } = k((e) => e.data), [i, a] = A.useState(!1), o = A.useRef(null), s = A.useCallback(() => a(!1), []), [c, l] = A.useState(""), u = A.useRef(null), d = Number(e.previews?.length) < 1, f = Math.max(0, Number(n?.tier?.max_file_upload ?? 2)), p = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), m = n?.file_uploads_date === p ? Number(n?.file_uploads_used ?? 0) : 0, h = e.showFile && m + e.pendingFileCount < f;
|
|
386
503
|
function g(e) {
|
|
387
|
-
let t = u.current;
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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
|
+
l(n.substring(0, i) + e + n.substring(a)), requestAnimationFrame(() => {
|
|
506
|
+
if (!t) return;
|
|
507
|
+
let n = i + e.length;
|
|
508
|
+
t.focus(), t.setSelectionRange(n, n);
|
|
509
|
+
});
|
|
391
510
|
}
|
|
392
511
|
function _() {
|
|
393
512
|
if (d && !c || e.isSending) return;
|
|
@@ -405,29 +524,29 @@ function Ne(e) {
|
|
|
405
524
|
};
|
|
406
525
|
e.sendChat(r), l("");
|
|
407
526
|
}
|
|
408
|
-
return /* @__PURE__ */
|
|
409
|
-
className: "relative
|
|
410
|
-
children: [/* @__PURE__ */
|
|
411
|
-
style: { visibility: i ? "visible" : "hidden" },
|
|
527
|
+
return /* @__PURE__ */ H("div", {
|
|
528
|
+
className: "padorix:relative",
|
|
529
|
+
children: [i && /* @__PURE__ */ V("div", {
|
|
412
530
|
className: e.styles.emojiContainer,
|
|
413
|
-
children:
|
|
414
|
-
|
|
415
|
-
|
|
531
|
+
children: /* @__PURE__ */ V(Fe, {
|
|
532
|
+
onSelect: g,
|
|
533
|
+
onClose: s,
|
|
534
|
+
toggleRef: o
|
|
416
535
|
})
|
|
417
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ H("div", {
|
|
418
537
|
className: e.styles.formContainer,
|
|
419
|
-
children: [r?.id && /* @__PURE__ */
|
|
538
|
+
children: [r?.id && /* @__PURE__ */ V(Ae, {
|
|
420
539
|
styles: e.styles,
|
|
421
540
|
data: r
|
|
422
|
-
}), /* @__PURE__ */
|
|
541
|
+
}), /* @__PURE__ */ H("div", {
|
|
423
542
|
className: "padorix:flex padorix:items-center padorix:justify-center padorix:rounded-lg padorix:p-0.5 padorix:relative padorix:gap-1",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
543
|
+
children: [/* @__PURE__ */ H("div", {
|
|
425
544
|
className: "padorix:flex padorix:items-center padorix:gap-1 padorix:bg-gray-100 padorix:w-full padorix:rounded-lg",
|
|
426
545
|
children: [
|
|
427
|
-
h && /* @__PURE__ */
|
|
546
|
+
h && /* @__PURE__ */ H("label", {
|
|
428
547
|
title: "Attach images",
|
|
429
548
|
className: "padorix:cursor-pointer padorix:px-1 padorix:text-[#99a1af]",
|
|
430
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ V(P, {}), /* @__PURE__ */ V("input", {
|
|
431
550
|
type: "file",
|
|
432
551
|
accept: ".png,.jpg,.jpeg,.webp",
|
|
433
552
|
hidden: !0,
|
|
@@ -435,18 +554,23 @@ function Ne(e) {
|
|
|
435
554
|
multiple: !0
|
|
436
555
|
})]
|
|
437
556
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ H("div", {
|
|
558
|
+
ref: o,
|
|
559
|
+
role: "button",
|
|
560
|
+
"aria-label": "Insert emoji",
|
|
561
|
+
"aria-expanded": i,
|
|
439
562
|
onClick: () => a((e) => !e),
|
|
563
|
+
style: i ? { color: String(n?.widget?.colorScheme || "#6c63ff") } : void 0,
|
|
440
564
|
className: "padorix:text-[#99a1af] padorix:cursor-pointer padorix:px-1 padorix:transition-all",
|
|
441
565
|
children: [
|
|
442
566
|
" ",
|
|
443
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ V(ae, {}),
|
|
444
568
|
" "
|
|
445
569
|
]
|
|
446
570
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ V("div", {
|
|
448
572
|
className: "padorix:w-full",
|
|
449
|
-
children: /* @__PURE__ */
|
|
573
|
+
children: /* @__PURE__ */ V(me, {
|
|
450
574
|
ref: u,
|
|
451
575
|
message: c,
|
|
452
576
|
setMessage: l,
|
|
@@ -455,14 +579,14 @@ function Ne(e) {
|
|
|
455
579
|
})
|
|
456
580
|
})
|
|
457
581
|
]
|
|
458
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */ V("div", { children: /* @__PURE__ */ H("div", {
|
|
459
583
|
onClick: _,
|
|
460
584
|
style: {
|
|
461
585
|
background: d && !c || e.isSending ? "#9f9fa9" : String(n?.widget?.colorScheme),
|
|
462
586
|
cursor: d && !c || e.isSending ? "not-allowed" : "pointer"
|
|
463
587
|
},
|
|
464
588
|
className: "padorix:-mt-1 padorix:size-10 padorix:text-white padorix:rounded-lg padorix:flex padorix:last:items-center padorix:justify-center",
|
|
465
|
-
children: [" ", /* @__PURE__ */
|
|
589
|
+
children: [" ", /* @__PURE__ */ V(se, { className: "padorix:size-6" })]
|
|
466
590
|
}) })]
|
|
467
591
|
})]
|
|
468
592
|
})]
|
|
@@ -470,81 +594,81 @@ function Ne(e) {
|
|
|
470
594
|
}
|
|
471
595
|
//#endregion
|
|
472
596
|
//#region lib/chats/chatform/chat-image-upload.tsx
|
|
473
|
-
function
|
|
474
|
-
let { workspace: t } = k((e) => e.data), n = Math.max(0, Number(t?.tier?.max_file_upload ?? 2)), r = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), i = t?.file_uploads_date === r ? Number(t?.file_uploads_used ?? 0) : 0, [a, o] = A.useState(
|
|
475
|
-
|
|
476
|
-
image: e.previews?.[0]?.img
|
|
477
|
-
});
|
|
478
|
-
function s(t) {
|
|
597
|
+
function Le(e) {
|
|
598
|
+
let { workspace: t } = k((e) => e.data), n = Math.max(0, Number(t?.tier?.max_file_upload ?? 2)), r = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), i = t?.file_uploads_date === r ? Number(t?.file_uploads_used ?? 0) : 0, [a, o] = A.useState(e.previews?.[0]?.id), s = e.previews?.find((e) => e.id === a) ?? e.previews?.[0];
|
|
599
|
+
function c(t) {
|
|
479
600
|
e.sendChat(t);
|
|
480
601
|
}
|
|
481
|
-
if (Number(e.previews?.length || 0) > 0) return /* @__PURE__ */
|
|
602
|
+
if (Number(e.previews?.length || 0) > 0) return /* @__PURE__ */ H("div", {
|
|
482
603
|
className: e.styles.imageUploadContainer,
|
|
483
604
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
className:
|
|
486
|
-
children: [/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ H("div", {
|
|
606
|
+
className: `padorix:relative padorix:border padorix:border-gray-300 padorix:py-3 padorix:bg-white ${e.styles.imagePreviewBox}`,
|
|
607
|
+
children: [/* @__PURE__ */ V("div", {
|
|
487
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",
|
|
488
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ H("div", {
|
|
489
610
|
onClick: e.DiscardAllImages,
|
|
490
611
|
className: "padorix:size-fit padorix:ml-auto padorix:text-red-600 padorix:cursor-pointer padorix:text-xl",
|
|
491
612
|
children: [
|
|
492
613
|
" ",
|
|
493
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ V(Q, {}),
|
|
494
615
|
" "
|
|
495
616
|
]
|
|
496
617
|
})
|
|
497
|
-
}), /* @__PURE__ */
|
|
498
|
-
src:
|
|
499
|
-
loading: "lazy",
|
|
618
|
+
}), /* @__PURE__ */ V("img", {
|
|
619
|
+
src: s?.img,
|
|
500
620
|
className: "padorix:size-full padorix:mx-auto padorix:object-contain"
|
|
501
621
|
})]
|
|
502
622
|
}),
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
className: "padorix:flex padorix:items-center padorix:justify-center padorix:gap-1 padorix:max-w-[98%] padorix:mx-auto",
|
|
505
|
-
children: [/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ H("div", {
|
|
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__ */ V("div", {
|
|
506
626
|
className: "padorix:overflow-y-hidden padorix:overflow-x-auto",
|
|
507
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ V("div", {
|
|
508
628
|
className: "padorix:w-fit",
|
|
509
|
-
children: /* @__PURE__ */
|
|
629
|
+
children: /* @__PURE__ */ V("div", {
|
|
510
630
|
className: "padorix:flex padorix:items-center padorix:justify-center padorix:gap-1",
|
|
511
|
-
children: e.previews?.map((n, r) => /* @__PURE__ */
|
|
512
|
-
style: { border: `3.5px solid ${
|
|
631
|
+
children: e.previews?.map((n, r) => /* @__PURE__ */ H("div", {
|
|
632
|
+
style: { border: `3.5px solid ${s?.id === n.id ? String(t?.widget?.colorScheme) : "transparent"}` },
|
|
513
633
|
className: "padorix:relative padorix:size-14 padorix:border-2 padorix:rounded-lg",
|
|
514
|
-
children: [
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
onClick: () => o({
|
|
527
|
-
index: r,
|
|
528
|
-
image: n?.img
|
|
634
|
+
children: [
|
|
635
|
+
/* @__PURE__ */ V("div", {
|
|
636
|
+
onClick: () => e.DiscardSingleImage(r),
|
|
637
|
+
className: "padorix:absolute padorix:top-0 padorix:left-0 padorix:w-full padorix:bg-slate-700 padorix:rounded-t-sm",
|
|
638
|
+
children: /* @__PURE__ */ H("div", {
|
|
639
|
+
className: "padorix:size-fit padorix:ml-auto padorix:cursor-pointer padorix:text-[#ef4444] padorix:text-sm",
|
|
640
|
+
children: [
|
|
641
|
+
" ",
|
|
642
|
+
/* @__PURE__ */ V(Q, {}),
|
|
643
|
+
" "
|
|
644
|
+
]
|
|
645
|
+
})
|
|
529
646
|
}),
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
647
|
+
/* @__PURE__ */ V("img", {
|
|
648
|
+
onClick: () => o(n.id),
|
|
649
|
+
src: n?.img,
|
|
650
|
+
className: "padorix:size-full padorix:cursor-pointer padorix:rounded-md padorix:object-cover"
|
|
651
|
+
}),
|
|
652
|
+
n.status === "uploading" && /* @__PURE__ */ V("div", {
|
|
653
|
+
title: "Uploading…",
|
|
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__ */ V("div", { className: "padorix:size-5 padorix:rounded-full padorix:border-2 padorix:border-gray-300 padorix:border-t-gray-600 padorix:animate-spin" })
|
|
656
|
+
})
|
|
657
|
+
]
|
|
658
|
+
}, n.id))
|
|
535
659
|
})
|
|
536
660
|
})
|
|
537
|
-
}), i + e.pendingFileCount < n && /* @__PURE__ */
|
|
661
|
+
}), i + e.pendingFileCount < n && /* @__PURE__ */ V("div", {
|
|
538
662
|
className: "",
|
|
539
|
-
children: /* @__PURE__ */
|
|
663
|
+
children: /* @__PURE__ */ V("div", {
|
|
540
664
|
style: {
|
|
541
665
|
borderColor: `${t?.widget?.colorScheme}`,
|
|
542
666
|
color: String(t?.widget?.colorScheme)
|
|
543
667
|
},
|
|
544
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",
|
|
545
|
-
children: /* @__PURE__ */
|
|
669
|
+
children: /* @__PURE__ */ H("label", {
|
|
546
670
|
className: "padorix:cursor-pointer",
|
|
547
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ V(P, {}), /* @__PURE__ */ V("input", {
|
|
548
672
|
type: "file",
|
|
549
673
|
accept: ".png,.jpg,.jpeg,.webp",
|
|
550
674
|
hidden: !0,
|
|
@@ -555,21 +679,25 @@ function Pe(e) {
|
|
|
555
679
|
})
|
|
556
680
|
})]
|
|
557
681
|
}),
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
682
|
+
/* @__PURE__ */ V("div", {
|
|
683
|
+
className: "padorix:shrink-0",
|
|
684
|
+
children: /* @__PURE__ */ V(Ie, {
|
|
685
|
+
showFile: !1,
|
|
686
|
+
pendingFileCount: e.pendingFileCount,
|
|
687
|
+
sendChat: c,
|
|
688
|
+
styles: e.styles,
|
|
689
|
+
userType: e.userType,
|
|
690
|
+
handleFile: e.handleFile,
|
|
691
|
+
isSending: e.isSending,
|
|
692
|
+
previews: e.previews
|
|
693
|
+
})
|
|
566
694
|
})
|
|
567
695
|
]
|
|
568
696
|
});
|
|
569
697
|
}
|
|
570
698
|
//#endregion
|
|
571
699
|
//#region lib/utils/use-chat-identity.ts
|
|
572
|
-
function
|
|
700
|
+
function Re(e) {
|
|
573
701
|
let { sender: t, workspace: n, conversation: r } = k((e) => e.data), i = t?.workspaceId || n?.id || r?.workspaceId, a = t?.conversationId, o = t?.senderId, s = t?.userType || e, c = t?.fullName;
|
|
574
702
|
return A.useMemo(() => !i || !a || !o ? null : {
|
|
575
703
|
workspaceId: String(i),
|
|
@@ -587,80 +715,101 @@ function Fe(e) {
|
|
|
587
715
|
}
|
|
588
716
|
//#endregion
|
|
589
717
|
//#region lib/chats/chatform/chat-form-component.tsx
|
|
590
|
-
function
|
|
591
|
-
let [
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
718
|
+
function ze(e) {
|
|
719
|
+
let [t, n] = A.useState([]), r = A.useRef([]), a = A.useRef(/* @__PURE__ */ new Map()), [s, c] = A.useState(!1), { sender: l, workspace: f } = k((e) => e.data), p = A.useRef(f);
|
|
720
|
+
p.current = f;
|
|
721
|
+
let m = O(), h = Re(e.userType), g = Math.max(0, Number(f?.tier?.max_file_upload ?? 2)), _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), v = f?.file_uploads_date === _ ? Number(f?.file_uploads_used ?? 0) : 0, y = t.filter((e) => e.status === "uploading").length, b = A.useCallback((e) => {
|
|
722
|
+
r.current = e(r.current), n(r.current);
|
|
723
|
+
}, []);
|
|
724
|
+
A.useEffect(() => () => r.current.forEach((e) => URL.revokeObjectURL(e.img)), []);
|
|
725
|
+
function x(e) {
|
|
726
|
+
!h || e.length === 0 || d.removeImages(h, e).catch((e) => console.log(e.message));
|
|
598
727
|
}
|
|
599
|
-
|
|
600
|
-
let
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
728
|
+
function S(e) {
|
|
729
|
+
let t = (async () => {
|
|
730
|
+
try {
|
|
731
|
+
let t = await o([e], String(p.current?.id ?? "")), n = (Array.isArray(t) ? t : t?.images)?.[0];
|
|
732
|
+
if (!n) throw Error("Upload returned no image URL");
|
|
733
|
+
let a = Array.isArray(t) ? null : t, s = p.current;
|
|
734
|
+
if (a?.file_uploads_used !== void 0 && s && m(i({
|
|
735
|
+
...s,
|
|
736
|
+
file_uploads_used: a.file_uploads_used,
|
|
737
|
+
file_uploads_date: a.file_uploads_date
|
|
738
|
+
})), !r.current.some((t) => t.id === e.id)) return x([n]);
|
|
739
|
+
b((t) => t.map((t) => t.id === e.id ? {
|
|
740
|
+
...t,
|
|
741
|
+
status: "uploaded",
|
|
742
|
+
url: n
|
|
743
|
+
} : t));
|
|
744
|
+
} catch (t) {
|
|
745
|
+
console.log(`Image upload failed: ${t.message}`), URL.revokeObjectURL(e.img), b((t) => t.filter((t) => t.id !== e.id));
|
|
746
|
+
} finally {
|
|
747
|
+
a.current.delete(e.id);
|
|
748
|
+
}
|
|
749
|
+
})();
|
|
750
|
+
a.current.set(e.id, t);
|
|
751
|
+
}
|
|
752
|
+
let C = (e) => {
|
|
753
|
+
let t = e.target, n = Array.from(t.files ?? []).filter((e) => e.type.startsWith("image/"));
|
|
754
|
+
t.value = "";
|
|
755
|
+
let i = r.current.filter((e) => e.status === "uploading").length, a = Math.max(0, g - v - i), o = n.slice(0, a);
|
|
756
|
+
if (n.length > o.length && u(`You can attach up to ${g} images.`, "info"), o.length === 0) return;
|
|
757
|
+
let s = o.map((e) => ({
|
|
758
|
+
id: crypto.randomUUID(),
|
|
759
|
+
file: e,
|
|
760
|
+
img: URL.createObjectURL(e),
|
|
761
|
+
status: "uploading"
|
|
762
|
+
}));
|
|
763
|
+
b((e) => [...e, ...s]), s.forEach(S);
|
|
622
764
|
};
|
|
623
|
-
function
|
|
624
|
-
|
|
765
|
+
async function w(t) {
|
|
766
|
+
a.current.size > 0 && (c(!0), await Promise.allSettled([...a.current.values()]), c(!1));
|
|
767
|
+
let n = r.current, i = n.map((e) => e.url).filter(Boolean);
|
|
768
|
+
i.length === 0 && !t.message || (e.sendChat({
|
|
769
|
+
...t,
|
|
770
|
+
images: i
|
|
771
|
+
}), n.forEach((e) => URL.revokeObjectURL(e.img)), b(() => []));
|
|
625
772
|
}
|
|
626
|
-
function
|
|
627
|
-
let t =
|
|
628
|
-
|
|
773
|
+
function T(e) {
|
|
774
|
+
let t = r.current[e];
|
|
775
|
+
t && (URL.revokeObjectURL(t.img), b((e) => e.filter((e) => e.id !== t.id)), t.url && x([t.url]));
|
|
629
776
|
}
|
|
630
|
-
function
|
|
631
|
-
|
|
777
|
+
function E() {
|
|
778
|
+
let e = r.current.map((e) => e.url).filter(Boolean);
|
|
779
|
+
r.current.forEach((e) => URL.revokeObjectURL(e.img)), b(() => []), x(e);
|
|
632
780
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
781
|
+
let ee = e.isSending || s;
|
|
782
|
+
return /* @__PURE__ */ H("div", {
|
|
783
|
+
className: e.styles.formRoot,
|
|
784
|
+
children: [t.length > 0 && /* @__PURE__ */ V(Le, {
|
|
785
|
+
previews: t,
|
|
786
|
+
DiscardSingleImage: T,
|
|
787
|
+
DiscardAllImages: E,
|
|
639
788
|
styles: e.styles,
|
|
640
|
-
sendChat:
|
|
789
|
+
sendChat: w,
|
|
641
790
|
userType: e.userType,
|
|
642
|
-
senderId: String(
|
|
643
|
-
handleFile:
|
|
644
|
-
isSending:
|
|
645
|
-
pendingFileCount:
|
|
646
|
-
}), /* @__PURE__ */
|
|
647
|
-
sendChat:
|
|
648
|
-
previews:
|
|
791
|
+
senderId: String(l?.senderId),
|
|
792
|
+
handleFile: C,
|
|
793
|
+
isSending: ee,
|
|
794
|
+
pendingFileCount: y
|
|
795
|
+
}), /* @__PURE__ */ V(Ie, {
|
|
796
|
+
sendChat: w,
|
|
797
|
+
previews: t,
|
|
649
798
|
showFile: !0,
|
|
650
|
-
pendingFileCount:
|
|
799
|
+
pendingFileCount: y,
|
|
651
800
|
styles: e.styles,
|
|
652
801
|
userType: e.userType,
|
|
653
|
-
handleFile:
|
|
654
|
-
isSending:
|
|
802
|
+
handleFile: C,
|
|
803
|
+
isSending: ee
|
|
655
804
|
})]
|
|
656
805
|
});
|
|
657
806
|
}
|
|
658
807
|
//#endregion
|
|
659
808
|
//#region lib/assets/images/wd__user.png
|
|
660
|
-
var
|
|
809
|
+
var Be = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJVHZNWXrm6+zq7+9VYIChqbhXY4JUX4ChqrlVX4Hd4uVRYICvt8NVYYFXYoJWYIFzfJZVYYFVYIFVYIFVYIDs8fHK0Njt8vFVYIBTXn5KVnfn7e1UYIBVYIHIztZWYIHx9fRWYoKkrLtWYIFWYoNX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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==";
|
|
661
810
|
//#endregion
|
|
662
811
|
//#region node_modules/react-icons/io5/index.mjs
|
|
663
|
-
function
|
|
812
|
+
function Ve(e) {
|
|
664
813
|
return Z({
|
|
665
814
|
tag: "svg",
|
|
666
815
|
attr: { viewBox: "0 0 512 512" },
|
|
@@ -697,7 +846,7 @@ function Re(e) {
|
|
|
697
846
|
}
|
|
698
847
|
//#endregion
|
|
699
848
|
//#region node_modules/react-icons/vsc/index.mjs
|
|
700
|
-
function
|
|
849
|
+
function He(e) {
|
|
701
850
|
return Z({
|
|
702
851
|
tag: "svg",
|
|
703
852
|
attr: {
|
|
@@ -721,22 +870,22 @@ function ze(e) {
|
|
|
721
870
|
}
|
|
722
871
|
//#endregion
|
|
723
872
|
//#region lib/chats/chatheader/chat-header.tsx
|
|
724
|
-
function
|
|
725
|
-
let [t, { open:
|
|
726
|
-
|
|
727
|
-
|
|
873
|
+
function Ue(e) {
|
|
874
|
+
let [t, { open: i, close: a }] = de(!1), { workspace: o, conversation: s, sender: l } = k((e) => e.data), f = _(o?.widget?.darkMode, !1), [p, m] = A.useState(!1), h = O(), g = Re(e.userType), v = e.userType === w.VISITOR, b = o?.widget?.notifications?.customerEndsConversation === c.true, x = A.useMemo(() => v ? o?.widget?.department : s?.fullName, [o, s]), S = A.useMemo(() => v ? o?.logo : Be, [o]), C = A.useMemo(() => v ? o?.name : K(s?.createdAt).format("DD dddd MMMM YYYY"), [
|
|
875
|
+
v,
|
|
876
|
+
o?.name,
|
|
728
877
|
s?.createdAt
|
|
729
878
|
]);
|
|
730
|
-
function
|
|
879
|
+
function T() {
|
|
731
880
|
m(!1);
|
|
732
881
|
}
|
|
733
|
-
function
|
|
734
|
-
let t =
|
|
882
|
+
function E() {
|
|
883
|
+
let t = K(), n = [
|
|
735
884
|
x || "Chat transcript",
|
|
736
885
|
`Exported: ${t.format("YYYY-MM-DD HH:mm")}`,
|
|
737
886
|
"",
|
|
738
887
|
...e.messages.length > 0 ? e.messages.map((e) => {
|
|
739
|
-
let t =
|
|
888
|
+
let t = K(e.createdAt), n = e.senderName || e.senderType || "Unknown", r = e.deleted === c.true ? "[This message was deleted]" : Array.isArray(e.message) ? e.message.join("\n") : "", i = e.deleted === c.true ? [] : Array.isArray(e.images) ? e.images : [];
|
|
740
889
|
return [
|
|
741
890
|
`[${t.isValid() ? t.format("YYYY-MM-DD HH:mm") : e.createdAt}] ${n} (${e.senderType})`,
|
|
742
891
|
r,
|
|
@@ -744,144 +893,144 @@ function Be(e) {
|
|
|
744
893
|
].filter(Boolean).join("\n");
|
|
745
894
|
}) : ["No messages in this chat."]
|
|
746
895
|
].join("\n\n"), r = URL.createObjectURL(new Blob([n], { type: "text/plain;charset=utf-8" })), i = document.createElement("a");
|
|
747
|
-
i.href = r, i.download = `padorix-chat-${t.format("YYYY-MM-DD-HHmmss")}.txt`, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(r), 1e3),
|
|
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), T();
|
|
748
897
|
}
|
|
749
|
-
function
|
|
750
|
-
h(
|
|
898
|
+
function ee() {
|
|
899
|
+
h(r({
|
|
751
900
|
userType: String(e?.userType),
|
|
752
|
-
senderId: String(
|
|
901
|
+
senderId: String(l?.senderId),
|
|
753
902
|
workspaceId: String(s?.workspaceId),
|
|
754
|
-
conversationId: String(
|
|
755
|
-
senderName: String(
|
|
756
|
-
isEndChat:
|
|
903
|
+
conversationId: String(l?.conversationId),
|
|
904
|
+
senderName: String(l?.fullName),
|
|
905
|
+
isEndChat: c.true
|
|
757
906
|
})), m(!1), e.toBottom();
|
|
758
907
|
}
|
|
759
|
-
function te() {
|
|
760
|
-
m(!1), r();
|
|
761
|
-
}
|
|
762
908
|
function D() {
|
|
763
|
-
|
|
909
|
+
m(!1), i();
|
|
764
910
|
}
|
|
765
|
-
|
|
911
|
+
function te() {
|
|
912
|
+
a(), g && d.requestFeedback(g).then((e) => h(n(e))).catch((e) => u(e.message, "error")), e.toBottom();
|
|
913
|
+
}
|
|
914
|
+
return /* @__PURE__ */ V("div", {
|
|
766
915
|
className: e.styles.header,
|
|
767
|
-
children: /* @__PURE__ */
|
|
916
|
+
children: /* @__PURE__ */ H("div", {
|
|
768
917
|
className: "padorix:rounded-2xl",
|
|
769
|
-
children: [/* @__PURE__ */
|
|
918
|
+
children: [/* @__PURE__ */ V(W, {
|
|
770
919
|
withCloseButton: !1,
|
|
771
920
|
opened: t,
|
|
772
|
-
onClose:
|
|
921
|
+
onClose: a,
|
|
773
922
|
centered: !0,
|
|
774
923
|
styles: { body: { padding: 0 } },
|
|
775
|
-
children: /* @__PURE__ */
|
|
776
|
-
className:
|
|
777
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ V("div", {
|
|
925
|
+
className: f ? "padorix-dark" : void 0,
|
|
926
|
+
children: /* @__PURE__ */ H("div", {
|
|
778
927
|
className: "padorix:dark:bg-[#2a3549] padorix:p-4 padorix:dark:text-white",
|
|
779
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ V("div", {
|
|
780
929
|
className: "",
|
|
781
930
|
children: "Confirm your action to stop chat session by requesting for feedback"
|
|
782
|
-
}), /* @__PURE__ */
|
|
931
|
+
}), /* @__PURE__ */ H("div", {
|
|
783
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",
|
|
784
|
-
children: [/* @__PURE__ */
|
|
785
|
-
onClick:
|
|
933
|
+
children: [/* @__PURE__ */ V("button", {
|
|
934
|
+
onClick: a,
|
|
786
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",
|
|
787
936
|
children: "Cancel"
|
|
788
|
-
}), /* @__PURE__ */
|
|
789
|
-
onClick:
|
|
937
|
+
}), /* @__PURE__ */ V("button", {
|
|
938
|
+
onClick: te,
|
|
790
939
|
className: "padorix:px-3 padorix:cursor-pointer padorix:py-1 padorix:rounded-md padorix:text-white",
|
|
791
|
-
style: { background: String(
|
|
940
|
+
style: { background: String(o?.widget?.colorScheme) },
|
|
792
941
|
children: "Proceed"
|
|
793
942
|
})]
|
|
794
943
|
})]
|
|
795
944
|
})
|
|
796
945
|
})
|
|
797
|
-
}), /* @__PURE__ */
|
|
798
|
-
style: { color:
|
|
946
|
+
}), /* @__PURE__ */ H("div", {
|
|
947
|
+
style: { color: o?.widget?.textColor || void 0 },
|
|
799
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",
|
|
800
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ H("div", {
|
|
801
950
|
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
802
951
|
children: [
|
|
803
|
-
|
|
952
|
+
v ? null : /* @__PURE__ */ V("div", {
|
|
804
953
|
onClick: e.goBack,
|
|
805
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",
|
|
806
|
-
children: /* @__PURE__ */
|
|
955
|
+
children: /* @__PURE__ */ V(ne, { className: "padorix:size-5" })
|
|
807
956
|
}),
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
src:
|
|
957
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("img", {
|
|
958
|
+
src: S,
|
|
810
959
|
loading: "lazy",
|
|
811
960
|
className: "padorix:size-8 padorix:rounded-full"
|
|
812
961
|
}) }),
|
|
813
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ H("div", {
|
|
814
963
|
className: "padorix:text-gray-600",
|
|
815
|
-
children: [/* @__PURE__ */
|
|
964
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
816
965
|
className: "padorix:font-semibold",
|
|
817
966
|
children: x
|
|
818
|
-
}) }), /* @__PURE__ */
|
|
967
|
+
}) }), /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
819
968
|
className: "",
|
|
820
|
-
children:
|
|
969
|
+
children: C
|
|
821
970
|
}) })]
|
|
822
971
|
})
|
|
823
972
|
]
|
|
824
|
-
}), /* @__PURE__ */
|
|
973
|
+
}), /* @__PURE__ */ H("div", {
|
|
825
974
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
826
|
-
children: [/* @__PURE__ */
|
|
975
|
+
children: [/* @__PURE__ */ V("div", {
|
|
827
976
|
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
828
|
-
children: /* @__PURE__ */
|
|
829
|
-
position:
|
|
977
|
+
children: /* @__PURE__ */ H(G, {
|
|
978
|
+
position: v ? "bottom-end" : "bottom",
|
|
830
979
|
opened: p,
|
|
831
980
|
onChange: m,
|
|
832
981
|
withinPortal: !0,
|
|
833
|
-
portalProps: { target:
|
|
982
|
+
portalProps: { target: y() },
|
|
834
983
|
zIndex: 2147483647,
|
|
835
|
-
children: [/* @__PURE__ */
|
|
984
|
+
children: [/* @__PURE__ */ V(G.Target, { children: /* @__PURE__ */ V("div", {
|
|
836
985
|
onClick: () => m((e) => !e),
|
|
837
986
|
className: "padorix:cursor-pointer padorix:transition-all padorix:size-fit padorix:text-xl",
|
|
838
|
-
children: /* @__PURE__ */
|
|
839
|
-
}) }), /* @__PURE__ */
|
|
840
|
-
className:
|
|
987
|
+
children: /* @__PURE__ */ V(Ve, {})
|
|
988
|
+
}) }), /* @__PURE__ */ V(G.Dropdown, {
|
|
989
|
+
className: f ? "padorix-dark" : void 0,
|
|
841
990
|
styles: { dropdown: {
|
|
842
991
|
padding: 0,
|
|
843
992
|
minWidth: "12rem",
|
|
844
993
|
zIndex: 2147483647,
|
|
845
994
|
border: 0,
|
|
846
|
-
backgroundColor:
|
|
995
|
+
backgroundColor: f ? "#2a3549" : "#fff"
|
|
847
996
|
} },
|
|
848
|
-
children: /* @__PURE__ */
|
|
997
|
+
children: /* @__PURE__ */ H("div", {
|
|
849
998
|
className: "padorix:text-xs padori:flex padorix:flex-col padorix:dark:bg-[#2a3549] padorix:dark:text-white",
|
|
850
999
|
children: [
|
|
851
|
-
!
|
|
852
|
-
onClick:
|
|
1000
|
+
!v && /* @__PURE__ */ H("div", {
|
|
1001
|
+
onClick: E,
|
|
853
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",
|
|
854
|
-
children: [/* @__PURE__ */
|
|
1003
|
+
children: [/* @__PURE__ */ V(ie, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:mr-1" }), "Download Chat transcript"]
|
|
855
1004
|
}),
|
|
856
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ H("a", {
|
|
857
1006
|
target: "_blank",
|
|
858
1007
|
href: "https://app.farmsac.com/signup",
|
|
859
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",
|
|
860
|
-
children: [/* @__PURE__ */
|
|
1009
|
+
children: [/* @__PURE__ */ V(oe, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Add to your website"]
|
|
861
1010
|
}),
|
|
862
|
-
!
|
|
863
|
-
onClick:
|
|
1011
|
+
!v && s?.status === c.true && /* @__PURE__ */ H("div", {
|
|
1012
|
+
onClick: D,
|
|
864
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",
|
|
865
|
-
children: [/* @__PURE__ */
|
|
1014
|
+
children: [/* @__PURE__ */ V(He, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Request for Feedback"]
|
|
866
1015
|
}),
|
|
867
|
-
s?.closed_at === null && (!
|
|
1016
|
+
s?.closed_at === null && (!v || b) && /* @__PURE__ */ V("div", {
|
|
868
1017
|
className: "padorix:border-t padorix:border-[#d1d5dc] padorix:dark:border-gray-600 padorix:mt-1",
|
|
869
|
-
children: /* @__PURE__ */
|
|
870
|
-
onClick:
|
|
1018
|
+
children: /* @__PURE__ */ H("div", {
|
|
1019
|
+
onClick: ee,
|
|
871
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",
|
|
872
|
-
children: [/* @__PURE__ */
|
|
1021
|
+
children: [/* @__PURE__ */ V(Q, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "End Chat Session"]
|
|
873
1022
|
})
|
|
874
1023
|
})
|
|
875
1024
|
]
|
|
876
1025
|
})
|
|
877
1026
|
})]
|
|
878
1027
|
})
|
|
879
|
-
}),
|
|
1028
|
+
}), v && /* @__PURE__ */ V("div", {
|
|
880
1029
|
className: "padorix:size-8 padorix:ml-auto",
|
|
881
|
-
children: /* @__PURE__ */
|
|
1030
|
+
children: /* @__PURE__ */ V("div", {
|
|
882
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",
|
|
883
1032
|
onClick: e.close,
|
|
884
|
-
children: /* @__PURE__ */
|
|
1033
|
+
children: /* @__PURE__ */ V(F, {})
|
|
885
1034
|
})
|
|
886
1035
|
})]
|
|
887
1036
|
})]
|
|
@@ -891,7 +1040,7 @@ function Be(e) {
|
|
|
891
1040
|
}
|
|
892
1041
|
//#endregion
|
|
893
1042
|
//#region node_modules/react-icons/bs/index.mjs
|
|
894
|
-
function
|
|
1043
|
+
function We(e) {
|
|
895
1044
|
return Z({
|
|
896
1045
|
tag: "svg",
|
|
897
1046
|
attr: {
|
|
@@ -905,7 +1054,7 @@ function Ve(e) {
|
|
|
905
1054
|
}]
|
|
906
1055
|
})(e);
|
|
907
1056
|
}
|
|
908
|
-
function
|
|
1057
|
+
function Ge(e) {
|
|
909
1058
|
return Z({
|
|
910
1059
|
tag: "svg",
|
|
911
1060
|
attr: {
|
|
@@ -919,7 +1068,7 @@ function He(e) {
|
|
|
919
1068
|
}]
|
|
920
1069
|
})(e);
|
|
921
1070
|
}
|
|
922
|
-
function
|
|
1071
|
+
function Ke(e) {
|
|
923
1072
|
return Z({
|
|
924
1073
|
tag: "svg",
|
|
925
1074
|
attr: {
|
|
@@ -933,7 +1082,7 @@ function Ue(e) {
|
|
|
933
1082
|
}]
|
|
934
1083
|
})(e);
|
|
935
1084
|
}
|
|
936
|
-
function
|
|
1085
|
+
function qe(e) {
|
|
937
1086
|
return Z({
|
|
938
1087
|
tag: "svg",
|
|
939
1088
|
attr: {
|
|
@@ -951,7 +1100,7 @@ function We(e) {
|
|
|
951
1100
|
}]
|
|
952
1101
|
})(e);
|
|
953
1102
|
}
|
|
954
|
-
function
|
|
1103
|
+
function Je(e) {
|
|
955
1104
|
return Z({
|
|
956
1105
|
tag: "svg",
|
|
957
1106
|
attr: {
|
|
@@ -967,11 +1116,11 @@ function Ge(e) {
|
|
|
967
1116
|
}
|
|
968
1117
|
//#endregion
|
|
969
1118
|
//#region lib/chats/chatform/render-text.tsx
|
|
970
|
-
function
|
|
1119
|
+
function Ye(e) {
|
|
971
1120
|
if (!e) return "";
|
|
972
1121
|
let t = /(https?:\/\/[^\s]+)/g, n = /\*(.*?)\*/g;
|
|
973
1122
|
return e.split(t).map((e, r) => {
|
|
974
|
-
if (t.test(e)) return /* @__PURE__ */
|
|
1123
|
+
if (t.test(e)) return /* @__PURE__ */ V("a", {
|
|
975
1124
|
href: e,
|
|
976
1125
|
target: "_blank",
|
|
977
1126
|
rel: "noopener noreferrer",
|
|
@@ -979,7 +1128,7 @@ function Ke(e) {
|
|
|
979
1128
|
children: e
|
|
980
1129
|
}, r);
|
|
981
1130
|
let i = e.split(n);
|
|
982
|
-
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__ */ V("strong", {
|
|
983
1132
|
className: "padorix:font-bold",
|
|
984
1133
|
children: e
|
|
985
1134
|
}, `b-${t}`) : e) : e;
|
|
@@ -987,58 +1136,58 @@ function Ke(e) {
|
|
|
987
1136
|
}
|
|
988
1137
|
//#endregion
|
|
989
1138
|
//#region lib/chats/chatmessages/chat-message-cover.tsx
|
|
990
|
-
function
|
|
1139
|
+
function Xe(e) {
|
|
991
1140
|
let { workspace: t } = k((e) => e.data), n = "padorix:w-fit padorix:h-fit padorix:max-w-[91%] padorix:relative padorix:bottom-3 padorix:md:max-w-[80%]";
|
|
992
|
-
if (e.isSender) return /* @__PURE__ */
|
|
993
|
-
style: { background: e.data?.deleted ===
|
|
1141
|
+
if (e.isSender) return /* @__PURE__ */ V(z, {
|
|
1142
|
+
style: { background: e.data?.deleted === c.true ? "" : e.data?.message ? String(t?.widget?.colorScheme) : "" },
|
|
994
1143
|
className: `
|
|
995
1144
|
${n} padorix:ml-auto
|
|
996
1145
|
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-bl-xl" : "padorix:rounded-xl"}
|
|
997
|
-
${e.data?.deleted ===
|
|
1146
|
+
${e.data?.deleted === c.true ? "" : e.data?.message ? "padorix:text-white" : "padorix:text-black!"}`,
|
|
998
1147
|
children: e.children
|
|
999
1148
|
});
|
|
1000
|
-
if (!e.isSender) return /* @__PURE__ */
|
|
1149
|
+
if (!e.isSender) return /* @__PURE__ */ V(z, {
|
|
1001
1150
|
className: `${n} padorix:mr-auto
|
|
1002
1151
|
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-br-xl" : "padorix:rounded-xl"}
|
|
1003
|
-
${e.data?.deleted ===
|
|
1152
|
+
${e.data?.deleted === c.true ? "" : e.data?.message ? "padorix:bg-[#f6f6f6] padorix:text-black" : "padorix:text-black!"}`,
|
|
1004
1153
|
children: e.children
|
|
1005
1154
|
});
|
|
1006
1155
|
}
|
|
1007
1156
|
//#endregion
|
|
1008
1157
|
//#region lib/chats/chatmessages/chat-avatar.tsx
|
|
1009
|
-
function
|
|
1010
|
-
return /* @__PURE__ */
|
|
1158
|
+
function Ze(e) {
|
|
1159
|
+
return /* @__PURE__ */ V(ue, {
|
|
1011
1160
|
direction: "up",
|
|
1012
|
-
children: /* @__PURE__ */
|
|
1161
|
+
children: /* @__PURE__ */ V("div", {
|
|
1013
1162
|
className: "padorix:self-end padorix:mb-3 padorix:w-10",
|
|
1014
|
-
children: e.isLastInGroup ? /* @__PURE__ */
|
|
1163
|
+
children: e.isLastInGroup ? /* @__PURE__ */ V("div", {
|
|
1015
1164
|
className: "padorix:size-8",
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1165
|
+
children: /* @__PURE__ */ V("img", {
|
|
1017
1166
|
src: e.img,
|
|
1018
1167
|
alt: "Padorix",
|
|
1019
1168
|
className: "padorix:size-8 padorix:border-2 padorix:rounded-full padorix:shadow-md padorix:border-white"
|
|
1020
1169
|
})
|
|
1021
|
-
}) : /* @__PURE__ */
|
|
1170
|
+
}) : /* @__PURE__ */ V("div", { className: "padorix:size-10" })
|
|
1022
1171
|
})
|
|
1023
1172
|
});
|
|
1024
1173
|
}
|
|
1025
1174
|
//#endregion
|
|
1026
1175
|
//#region lib/chats/chatmessages/chat-delete-selector.tsx
|
|
1027
|
-
function
|
|
1176
|
+
function Qe(e) {
|
|
1028
1177
|
let { workspace: t } = k((e) => e.data), n = e.messagesToDelete?.find((t) => t === e.data?.id);
|
|
1029
|
-
return /* @__PURE__ */
|
|
1178
|
+
return /* @__PURE__ */ V("div", {
|
|
1030
1179
|
style: { background: n ? String(t?.widget?.colorScheme) : "#e4e4e7" },
|
|
1031
1180
|
onClick: () => e.handleDeleteAction(e.data?.id),
|
|
1032
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",
|
|
1033
|
-
children: /* @__PURE__ */
|
|
1182
|
+
children: /* @__PURE__ */ V("div", {
|
|
1034
1183
|
className: "padorix:size-6 padorix:flex padorix:items-center padorix:justify-center",
|
|
1035
|
-
children:
|
|
1184
|
+
children: V(n ? ke : Ee, { className: "padorix:text-white" })
|
|
1036
1185
|
})
|
|
1037
1186
|
});
|
|
1038
1187
|
}
|
|
1039
1188
|
//#endregion
|
|
1040
1189
|
//#region lib/chats/chatmessages/chat-image-viewer.tsx
|
|
1041
|
-
function
|
|
1190
|
+
function $e(e) {
|
|
1042
1191
|
let t = e.data?.images, n = [];
|
|
1043
1192
|
if (Array.isArray(t)) n = t.filter((e) => typeof e == "string" && e.length > 0);
|
|
1044
1193
|
else if (typeof t == "string") try {
|
|
@@ -1047,11 +1196,11 @@ function Xe(e) {
|
|
|
1047
1196
|
} catch {
|
|
1048
1197
|
n = t.length > 0 ? [t] : [];
|
|
1049
1198
|
}
|
|
1050
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ V("div", {
|
|
1051
1200
|
className: "padorix:min-w-0 padorix:max-w-full",
|
|
1052
|
-
children: n.length > 0 && /* @__PURE__ */
|
|
1201
|
+
children: n.length > 0 && /* @__PURE__ */ V("div", {
|
|
1053
1202
|
className: "padorix:flex padorix:min-w-0 padorix:max-w-full padorix:flex-col padorix:items-end padorix:gap-1",
|
|
1054
|
-
children: n.map((e, t) => /* @__PURE__ */
|
|
1203
|
+
children: n.map((e, t) => /* @__PURE__ */ V("img", {
|
|
1055
1204
|
src: e,
|
|
1056
1205
|
alt: "Attachment",
|
|
1057
1206
|
loading: "lazy",
|
|
@@ -1063,7 +1212,7 @@ function Xe(e) {
|
|
|
1063
1212
|
}
|
|
1064
1213
|
//#endregion
|
|
1065
1214
|
//#region lib/chats/chatmessages/chat-reply.tsx
|
|
1066
|
-
function
|
|
1215
|
+
function et(e) {
|
|
1067
1216
|
if (Array.isArray(e)) return e.filter((e) => typeof e == "string" && e.length > 0);
|
|
1068
1217
|
if (typeof e == "string" && e.length > 0) try {
|
|
1069
1218
|
let t = JSON.parse(e);
|
|
@@ -1073,17 +1222,17 @@ function Ze(e) {
|
|
|
1073
1222
|
}
|
|
1074
1223
|
return [];
|
|
1075
1224
|
}
|
|
1076
|
-
function
|
|
1077
|
-
let t = e.data?.replies?.[0], n = t?.id ?
|
|
1078
|
-
if (t?.id) return /* @__PURE__ */
|
|
1225
|
+
function tt(e) {
|
|
1226
|
+
let t = e.data?.replies?.[0], n = t?.id ? et(t?.repliedTo?.images) : [], r = et(t?.repliedTo?.message).join(" ");
|
|
1227
|
+
if (t?.id) return /* @__PURE__ */ V("div", {
|
|
1079
1228
|
className: "padorix:px-0.5 padorix:pt-0.5",
|
|
1080
|
-
children: /* @__PURE__ */
|
|
1229
|
+
children: /* @__PURE__ */ H("div", {
|
|
1081
1230
|
onClick: () => e.handleScrollToTargetMessage(String(t?.replyId)),
|
|
1082
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"}`,
|
|
1083
|
-
children: [/* @__PURE__ */
|
|
1232
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1084
1233
|
className: "padorix:w-full",
|
|
1085
1234
|
children: [r.slice(0, 40), r.length > 40 ? "..." : ""]
|
|
1086
|
-
}), n?.length > 0 && /* @__PURE__ */
|
|
1235
|
+
}), n?.length > 0 && /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V("img", {
|
|
1087
1236
|
src: n[0],
|
|
1088
1237
|
alt: "Padorix",
|
|
1089
1238
|
className: "padorix:size-6"
|
|
@@ -1093,107 +1242,107 @@ function Qe(e) {
|
|
|
1093
1242
|
}
|
|
1094
1243
|
//#endregion
|
|
1095
1244
|
//#region lib/chats/chatmessages/single-message-pop.tsx
|
|
1096
|
-
function
|
|
1097
|
-
let
|
|
1098
|
-
function
|
|
1099
|
-
|
|
1245
|
+
function nt(e) {
|
|
1246
|
+
let t = O(), { reply: n, conversation: r, workspace: i } = k((e) => e.data), a = _(i?.widget?.darkMode, !1);
|
|
1247
|
+
function o(t) {
|
|
1248
|
+
t.stopPropagation(), e.setOpens((e) => !e);
|
|
1100
1249
|
}
|
|
1101
|
-
function
|
|
1102
|
-
|
|
1103
|
-
...
|
|
1104
|
-
messageId:
|
|
1105
|
-
})),
|
|
1250
|
+
function l() {
|
|
1251
|
+
t(s({
|
|
1252
|
+
...n,
|
|
1253
|
+
messageId: e.data?.id
|
|
1254
|
+
})), t(g(e.data)), e.handleClick();
|
|
1106
1255
|
}
|
|
1107
|
-
function
|
|
1108
|
-
|
|
1256
|
+
function u(t) {
|
|
1257
|
+
e.handleStarMessage(e.data?.id, t), e.handleClick();
|
|
1109
1258
|
}
|
|
1110
|
-
function
|
|
1111
|
-
|
|
1259
|
+
function d() {
|
|
1260
|
+
p(String(e.data?.message)), e.handleClick();
|
|
1112
1261
|
}
|
|
1113
|
-
async function
|
|
1114
|
-
let
|
|
1115
|
-
for (let [
|
|
1116
|
-
let
|
|
1262
|
+
async function f() {
|
|
1263
|
+
let t = Array.isArray(e.data.images) ? e.data.images : [];
|
|
1264
|
+
for (let [e, n] of t.entries()) {
|
|
1265
|
+
let t = (() => {
|
|
1117
1266
|
try {
|
|
1118
|
-
let
|
|
1119
|
-
return /\.[a-z0-9]+$/i.test(r) ? r : `image-${
|
|
1267
|
+
let t = new URL(n, window.location.href).pathname, r = decodeURIComponent(t.split("/").pop() || "");
|
|
1268
|
+
return /\.[a-z0-9]+$/i.test(r) ? r : `image-${e + 1}.jpg`;
|
|
1120
1269
|
} catch {
|
|
1121
|
-
return `image-${
|
|
1270
|
+
return `image-${e + 1}.jpg`;
|
|
1122
1271
|
}
|
|
1123
1272
|
})();
|
|
1124
1273
|
try {
|
|
1125
|
-
let
|
|
1126
|
-
if (!
|
|
1127
|
-
let r = URL.createObjectURL(await
|
|
1128
|
-
i.href = r, i.download =
|
|
1274
|
+
let e = await fetch(n);
|
|
1275
|
+
if (!e.ok) throw Error("Unable to download image");
|
|
1276
|
+
let r = URL.createObjectURL(await e.blob()), i = document.createElement("a");
|
|
1277
|
+
i.href = r, i.download = t, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(r), 1e3);
|
|
1129
1278
|
} catch {
|
|
1130
1279
|
let e = document.createElement("a");
|
|
1131
1280
|
e.href = n, e.target = "_blank", e.rel = "noopener noreferrer", e.click();
|
|
1132
1281
|
}
|
|
1133
1282
|
}
|
|
1134
|
-
|
|
1283
|
+
e.handleClick();
|
|
1135
1284
|
}
|
|
1136
|
-
let
|
|
1137
|
-
return /* @__PURE__ */
|
|
1138
|
-
opened:
|
|
1139
|
-
onChange:
|
|
1285
|
+
let m = Array.isArray(e.data.images) && e.data.images.length > 0;
|
|
1286
|
+
return /* @__PURE__ */ H(G, {
|
|
1287
|
+
opened: e.opens,
|
|
1288
|
+
onChange: e.setOpens,
|
|
1140
1289
|
position: "top",
|
|
1141
1290
|
withArrow: !0,
|
|
1142
1291
|
withinPortal: !0,
|
|
1143
|
-
portalProps: { target:
|
|
1292
|
+
portalProps: { target: y() },
|
|
1144
1293
|
zIndex: 2147483647,
|
|
1145
|
-
children: [/* @__PURE__ */
|
|
1146
|
-
onClick:
|
|
1147
|
-
className: `padorix:absolute padorix:top-0 padorix:cursor-pointer padorix:size-fit padorix:text-lg padorix:transition-all padorix:hover:scale-110 ${
|
|
1148
|
-
children: /* @__PURE__ */
|
|
1149
|
-
}) }), /* @__PURE__ */
|
|
1150
|
-
className:
|
|
1294
|
+
children: [/* @__PURE__ */ V(G.Target, { children: /* @__PURE__ */ V("div", {
|
|
1295
|
+
onClick: o,
|
|
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__ */ V(Ve, { style: { color: String(i?.widget?.colorScheme) } })
|
|
1298
|
+
}) }), /* @__PURE__ */ V(G.Dropdown, {
|
|
1299
|
+
className: a ? "padorix-dark" : void 0,
|
|
1151
1300
|
styles: { dropdown: {
|
|
1152
1301
|
padding: 0,
|
|
1153
1302
|
minWidth: "10rem",
|
|
1154
1303
|
zIndex: 2147483647,
|
|
1155
1304
|
border: 0,
|
|
1156
|
-
backgroundColor:
|
|
1305
|
+
backgroundColor: a ? "#2a3549" : "#fff"
|
|
1157
1306
|
} },
|
|
1158
|
-
children: /* @__PURE__ */
|
|
1307
|
+
children: /* @__PURE__ */ H("div", {
|
|
1159
1308
|
className: "padorix:text-xs padorix:text-gray-800 padorix:dark:bg-[#2a3549] padorix:dark:text-white padorix:rounded-lg",
|
|
1160
1309
|
children: [
|
|
1161
|
-
|
|
1162
|
-
onClick:
|
|
1310
|
+
r?.status === c.true && /* @__PURE__ */ H("div", {
|
|
1311
|
+
onClick: l,
|
|
1163
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",
|
|
1164
|
-
children: [/* @__PURE__ */
|
|
1313
|
+
children: [/* @__PURE__ */ V(I, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Reply"]
|
|
1165
1314
|
}),
|
|
1166
|
-
|
|
1167
|
-
onClick:
|
|
1315
|
+
e.isMessage && /* @__PURE__ */ H("div", {
|
|
1316
|
+
onClick: d,
|
|
1168
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",
|
|
1169
|
-
children: [/* @__PURE__ */
|
|
1318
|
+
children: [/* @__PURE__ */ V(re, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Copy"]
|
|
1170
1319
|
}),
|
|
1171
|
-
|
|
1172
|
-
onClick:
|
|
1320
|
+
m && /* @__PURE__ */ H("div", {
|
|
1321
|
+
onClick: f,
|
|
1173
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",
|
|
1174
1323
|
children: [
|
|
1175
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ V(De, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1176
1325
|
" Download image",
|
|
1177
|
-
|
|
1326
|
+
e.data.images.length > 1 ? "s" : ""
|
|
1178
1327
|
]
|
|
1179
1328
|
}),
|
|
1180
|
-
|
|
1181
|
-
onClick: () =>
|
|
1329
|
+
r?.status === c.true && /* @__PURE__ */ H("div", {
|
|
1330
|
+
onClick: () => u(e.data?.starred === c.true ? c.false : c.true),
|
|
1182
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",
|
|
1183
1332
|
children: [
|
|
1184
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ V(R, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1185
1334
|
" ",
|
|
1186
|
-
|
|
1187
|
-
|
|
1335
|
+
e.data?.starred === c.true ? "Unstar" : "Star",
|
|
1336
|
+
e.data?.starred === c.true && /* @__PURE__ */ V(We, { className: "padorix:size-2 padorix:inline padorix:text-amber-400 padorix:ml-1" })
|
|
1188
1337
|
]
|
|
1189
1338
|
}),
|
|
1190
|
-
|
|
1191
|
-
|
|
1339
|
+
e.moreActions,
|
|
1340
|
+
r?.status === c.true && e.isSender && e.canDeleteMessage && /* @__PURE__ */ V("div", {
|
|
1192
1341
|
className: "padorix:border-t padorix:border-gray-200 padorix:dark:border-gray-500",
|
|
1193
|
-
children: /* @__PURE__ */
|
|
1194
|
-
onClick: () =>
|
|
1342
|
+
children: /* @__PURE__ */ H("div", {
|
|
1343
|
+
onClick: () => e.handleDeleteAction(e.data?.id),
|
|
1195
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",
|
|
1196
|
-
children: [/* @__PURE__ */
|
|
1345
|
+
children: [/* @__PURE__ */ V(ce, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Delete"]
|
|
1197
1346
|
})
|
|
1198
1347
|
})
|
|
1199
1348
|
]
|
|
@@ -1203,8 +1352,8 @@ function $e(t) {
|
|
|
1203
1352
|
}
|
|
1204
1353
|
//#endregion
|
|
1205
1354
|
//#region lib/chats/chatmessages/chat-single-message.tsx
|
|
1206
|
-
function
|
|
1207
|
-
let [s,
|
|
1355
|
+
function rt({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage: r, messages: i, userType: a, moreActions: o }) {
|
|
1356
|
+
let [s, l] = A.useState(!1), [u, d] = A.useState(!1), { workspace: f } = k((e) => e.data), p = String(e?.message ?? "").trim().length > 0, m = a === "VISITOR", h = f?.widget?.notifications?.customerDeletesMessage === c.true, g = !m || h, _ = m ? e?.senderType === "VISITOR" : e?.senderType !== "VISITOR", v = A.useMemo(() => {
|
|
1208
1357
|
if (!i?.length || !e?.id) return !1;
|
|
1209
1358
|
let t = i.findIndex((t) => t.id === e.id);
|
|
1210
1359
|
if (t === -1) return !1;
|
|
@@ -1217,7 +1366,7 @@ function et({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1217
1366
|
e.id,
|
|
1218
1367
|
e.senderType
|
|
1219
1368
|
]), y = A.useCallback(() => {
|
|
1220
|
-
|
|
1369
|
+
l(!1);
|
|
1221
1370
|
}, []), b = A.useCallback((e) => {
|
|
1222
1371
|
n(e), y();
|
|
1223
1372
|
}, [n, y]), x = A.useCallback((t) => {
|
|
@@ -1249,7 +1398,7 @@ function et({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1249
1398
|
return () => {
|
|
1250
1399
|
window.clearTimeout(e);
|
|
1251
1400
|
};
|
|
1252
|
-
}, [u]), /* @__PURE__ */ B
|
|
1401
|
+
}, [u]), /* @__PURE__ */ V(B, { children: /* @__PURE__ */ H("div", {
|
|
1253
1402
|
id: `padorix-msg-${e.id}`,
|
|
1254
1403
|
className: `
|
|
1255
1404
|
padorix:flex
|
|
@@ -1264,22 +1413,22 @@ function et({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1264
1413
|
${u ? "padorix:bg-gray-100/80 padorix:scale-[1.01]" : "padorix:bg-transparent"}
|
|
1265
1414
|
`,
|
|
1266
1415
|
children: [
|
|
1267
|
-
!_ && /* @__PURE__ */
|
|
1416
|
+
!_ && /* @__PURE__ */ V(Ze, {
|
|
1268
1417
|
isLastInGroup: v,
|
|
1269
1418
|
img: String(f?.logo ?? "")
|
|
1270
1419
|
}),
|
|
1271
|
-
g && t?.length > 0 && e?.deleted ===
|
|
1420
|
+
g && t?.length > 0 && e?.deleted === c.false && /* @__PURE__ */ V(Qe, {
|
|
1272
1421
|
data: e,
|
|
1273
1422
|
handleDeleteAction: b,
|
|
1274
1423
|
messagesToDelete: t
|
|
1275
1424
|
}),
|
|
1276
|
-
/* @__PURE__ */
|
|
1425
|
+
/* @__PURE__ */ V(Xe, {
|
|
1277
1426
|
isLastInGroup: v,
|
|
1278
1427
|
isSender: _,
|
|
1279
1428
|
data: e,
|
|
1280
|
-
children: /* @__PURE__ */
|
|
1429
|
+
children: /* @__PURE__ */ H("div", {
|
|
1281
1430
|
className: "padorix:w-full padorix:px-1",
|
|
1282
|
-
children: [e?.deleted ===
|
|
1431
|
+
children: [e?.deleted === c.false && /* @__PURE__ */ V(nt, {
|
|
1283
1432
|
data: e,
|
|
1284
1433
|
deleteAction: n,
|
|
1285
1434
|
handleStarMessage: r,
|
|
@@ -1287,88 +1436,88 @@ function et({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1287
1436
|
isMessage: p,
|
|
1288
1437
|
handleClick: y,
|
|
1289
1438
|
handleDeleteAction: b,
|
|
1290
|
-
setOpens:
|
|
1439
|
+
setOpens: l,
|
|
1291
1440
|
opens: s,
|
|
1292
1441
|
moreActions: o,
|
|
1293
1442
|
canDeleteMessage: g
|
|
1294
|
-
}), /* @__PURE__ */
|
|
1443
|
+
}), /* @__PURE__ */ V("div", {
|
|
1295
1444
|
className: "padorix:p-1 padorix:whitespace-pre-wrap",
|
|
1296
|
-
children: e?.deleted ===
|
|
1445
|
+
children: e?.deleted === c.true ? /* @__PURE__ */ H("div", {
|
|
1297
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",
|
|
1298
|
-
children: [/* @__PURE__ */
|
|
1299
|
-
}) : /* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1447
|
+
children: [/* @__PURE__ */ V(Je, {}), /* @__PURE__ */ V("span", { children: "This message was deleted" })]
|
|
1448
|
+
}) : /* @__PURE__ */ H(B, { children: [
|
|
1449
|
+
/* @__PURE__ */ V(tt, {
|
|
1301
1450
|
data: e,
|
|
1302
1451
|
isSender: _,
|
|
1303
1452
|
handleScrollToTargetMessage: x
|
|
1304
1453
|
}),
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
p && /* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ V($e, { data: e }),
|
|
1455
|
+
p && /* @__PURE__ */ V("div", {
|
|
1307
1456
|
className: "padorix:text-[0.8rem] padorix:whitespace-pre-wrap padorix:mt-2",
|
|
1308
|
-
children:
|
|
1457
|
+
children: Ye(String(e.message))
|
|
1309
1458
|
}),
|
|
1310
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ H("div", {
|
|
1311
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",
|
|
1312
1461
|
children: [
|
|
1313
|
-
!m && /* @__PURE__ */
|
|
1462
|
+
!m && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
|
|
1314
1463
|
className: "padorix:text-[0.65rem]",
|
|
1315
1464
|
children: e?.senderType
|
|
1316
|
-
}), /* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1465
|
+
}), /* @__PURE__ */ V(L, {})] }),
|
|
1466
|
+
/* @__PURE__ */ V("span", {
|
|
1318
1467
|
className: "padorix:text-[0.55rem]",
|
|
1319
|
-
children:
|
|
1468
|
+
children: K(e?.createdAt).format("hh:mm A")
|
|
1320
1469
|
}),
|
|
1321
|
-
e?.starred ===
|
|
1322
|
-
_ && /* @__PURE__ */
|
|
1470
|
+
e?.starred === c.true && /* @__PURE__ */ V(le, { children: /* @__PURE__ */ V(We, { className: "padorix:size-3 padorix:text-amber-400" }) }),
|
|
1471
|
+
_ && /* @__PURE__ */ V(qe, { className: "padorix:inline padorix:text-base padorix:size-3" })
|
|
1323
1472
|
]
|
|
1324
1473
|
})
|
|
1325
1474
|
] })
|
|
1326
1475
|
})]
|
|
1327
1476
|
})
|
|
1328
1477
|
}),
|
|
1329
|
-
m ? e?.deleted ===
|
|
1478
|
+
m ? e?.deleted === c.false && _ && /* @__PURE__ */ V(Ze, {
|
|
1330
1479
|
isLastInGroup: v,
|
|
1331
1480
|
img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJVHZNWXrm6+zq7+9VYIChqbhXY4JUX4ChqrlVX4Hd4uVRYICvt8NVYYFXYoJWYIFzfJZVYYFVYIFVYIFVYIDs8fH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7vlaPHvWJuqAgs4JFORBjpxBXC7vX9EVhYLP1nKuprXUaRNjgLWfbcTKQmj/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=="
|
|
1332
|
-
}) : /* @__PURE__ */
|
|
1481
|
+
}) : /* @__PURE__ */ V("div", { className: "padorix:size-7" })
|
|
1333
1482
|
]
|
|
1334
1483
|
}) });
|
|
1335
1484
|
}
|
|
1336
1485
|
//#endregion
|
|
1337
1486
|
//#region lib/chats/newchat/chat-input.tsx
|
|
1338
|
-
var $ = M(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__ */
|
|
1487
|
+
var $ = M(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__ */ V(z, { children: /* @__PURE__ */ H("div", {
|
|
1339
1488
|
className: "padorix:mb-4",
|
|
1340
1489
|
children: [
|
|
1341
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ H("div", {
|
|
1342
1491
|
className: "padorix:mb-1 padorix:ml-2 padorix:text-[0.8rem] padorix:font-medium",
|
|
1343
1492
|
children: [
|
|
1344
1493
|
n.content,
|
|
1345
1494
|
" ",
|
|
1346
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ V("span", {
|
|
1347
1496
|
className: "padorix:text-red-600",
|
|
1348
1497
|
children: "*"
|
|
1349
1498
|
}),
|
|
1350
1499
|
" "
|
|
1351
1500
|
]
|
|
1352
1501
|
}),
|
|
1353
|
-
t === "input" && /* @__PURE__ */
|
|
1502
|
+
t === "input" && /* @__PURE__ */ V("input", {
|
|
1354
1503
|
type: e,
|
|
1355
1504
|
...n,
|
|
1356
1505
|
ref: r,
|
|
1357
1506
|
placeholder: n.placeholder,
|
|
1358
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"}`
|
|
1359
1508
|
}),
|
|
1360
|
-
t === "textarea" && /* @__PURE__ */
|
|
1509
|
+
t === "textarea" && /* @__PURE__ */ V("textarea", {
|
|
1361
1510
|
...n,
|
|
1362
1511
|
ref: r,
|
|
1363
1512
|
placeholder: "Leave a message",
|
|
1364
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"}`
|
|
1365
1514
|
}),
|
|
1366
|
-
n.error && /* @__PURE__ */
|
|
1515
|
+
n.error && /* @__PURE__ */ V("div", {
|
|
1367
1516
|
className: "padorix:text-red-400 padorix:text-xs",
|
|
1368
1517
|
children: n.error
|
|
1369
1518
|
})
|
|
1370
1519
|
]
|
|
1371
|
-
}) })),
|
|
1520
|
+
}) })), it = [
|
|
1372
1521
|
{
|
|
1373
1522
|
index: 1,
|
|
1374
1523
|
color: "padorix:text-red-600"
|
|
@@ -1390,31 +1539,31 @@ var $ = M(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__
|
|
|
1390
1539
|
color: "padorix:text-green-400"
|
|
1391
1540
|
}
|
|
1392
1541
|
];
|
|
1393
|
-
function
|
|
1542
|
+
function at(e) {
|
|
1394
1543
|
function t(t) {
|
|
1395
1544
|
let n = t?.split("-")[1];
|
|
1396
1545
|
if (e.value !== t) return e.setFieldValue?.(e.valueName || "", t), e.setFieldValue2?.(e.valueName2 || "", n);
|
|
1397
1546
|
e.setFieldValue?.(e.valueName || "", ""), e.setFieldValue2?.(e.valueName2 || "", "");
|
|
1398
1547
|
}
|
|
1399
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ H("div", {
|
|
1400
1549
|
className: "padorix:mb-5",
|
|
1401
1550
|
children: [
|
|
1402
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ V("div", {
|
|
1403
1552
|
className: "",
|
|
1404
1553
|
children: e.content
|
|
1405
1554
|
}),
|
|
1406
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ V("div", {
|
|
1407
1556
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
1408
|
-
children: Object.values(
|
|
1409
|
-
let i = Object.values(
|
|
1410
|
-
return /* @__PURE__ */
|
|
1557
|
+
children: Object.values(v).map((n, r) => {
|
|
1558
|
+
let i = Object.values(v).findIndex((t) => t?.split("-")[1] === e.value2) + 1, a = r + 1 <= i, o = it.find((e) => e.index === i);
|
|
1559
|
+
return /* @__PURE__ */ V("div", {
|
|
1411
1560
|
onClick: () => e.tag === "write" ? t(n) : {},
|
|
1412
1561
|
className: `${e.tag === "write" ? "padorix:cursor-pointer padorix:active:scale-125 padorix:transition-all padorix:hover:scale-110" : ""} padorix:text-3xl`,
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1562
|
+
children: /* @__PURE__ */ V(We, { className: a ? o?.color : "padorix:text-gray-400" })
|
|
1414
1563
|
}, r);
|
|
1415
1564
|
})
|
|
1416
1565
|
}),
|
|
1417
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ V("div", {
|
|
1418
1567
|
className: "padorix:mt-2 padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1419
1568
|
children: e.value?.split("-")[0]?.replace("_", " ")
|
|
1420
1569
|
})
|
|
@@ -1423,8 +1572,8 @@ function nt(e) {
|
|
|
1423
1572
|
}
|
|
1424
1573
|
//#endregion
|
|
1425
1574
|
//#region lib/chats/chatmessages/chat-feedback-form.tsx
|
|
1426
|
-
function
|
|
1427
|
-
let { sender: e, conversation: t, workspace:
|
|
1575
|
+
function ot() {
|
|
1576
|
+
let { sender: e, conversation: t, workspace: r } = k((e) => e.data), [i, a] = N(!1), o = O(), s = Re(w.VISITOR), c = fe({
|
|
1428
1577
|
mode: "uncontrolled",
|
|
1429
1578
|
initialValues: {
|
|
1430
1579
|
workspaceId: t?.workspaceId,
|
|
@@ -1445,23 +1594,23 @@ function rt() {
|
|
|
1445
1594
|
});
|
|
1446
1595
|
async function l(e) {
|
|
1447
1596
|
if (s) {
|
|
1448
|
-
|
|
1597
|
+
a(!0);
|
|
1449
1598
|
try {
|
|
1450
|
-
|
|
1599
|
+
o(n(await d.submitFeedback(s, {
|
|
1451
1600
|
comment: e.comment,
|
|
1452
1601
|
satisfactory: e.satisfactory?.split("-")[0]?.replace("_", " "),
|
|
1453
1602
|
rating: Number(e.rating)
|
|
1454
1603
|
}))), c.reset();
|
|
1455
1604
|
} catch (e) {
|
|
1456
|
-
|
|
1605
|
+
a(!1), u(e.message, "error");
|
|
1457
1606
|
}
|
|
1458
1607
|
}
|
|
1459
1608
|
}
|
|
1460
|
-
return
|
|
1609
|
+
return i ? null : /* @__PURE__ */ H("form", {
|
|
1461
1610
|
onSubmit: c.onSubmit(l),
|
|
1462
1611
|
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1463
1612
|
children: [
|
|
1464
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ V(at, {
|
|
1465
1614
|
content: "",
|
|
1466
1615
|
value: c.values.satisfactory,
|
|
1467
1616
|
value2: c.values.rating,
|
|
@@ -1478,10 +1627,10 @@ function rt() {
|
|
|
1478
1627
|
...c.getInputProps("comment"),
|
|
1479
1628
|
key: c.key("comment")
|
|
1480
1629
|
}),
|
|
1481
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ V("div", {
|
|
1482
1631
|
className: "padorix:mt-5",
|
|
1483
|
-
children: /* @__PURE__ */
|
|
1484
|
-
style: { background: c.submitting ? "" : String(
|
|
1632
|
+
children: /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
1633
|
+
style: { background: c.submitting ? "" : String(r?.widget?.colorScheme) },
|
|
1485
1634
|
className: `padorix:cursor-pointer ${c.submitting ? "padorix:bg-slate-500" : ""} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1486
1635
|
children: "Submit your feedback"
|
|
1487
1636
|
}) })
|
|
@@ -1491,47 +1640,47 @@ function rt() {
|
|
|
1491
1640
|
}
|
|
1492
1641
|
//#endregion
|
|
1493
1642
|
//#region lib/chats/chatmessages/end-chat-confirmation.tsx
|
|
1494
|
-
function
|
|
1495
|
-
let { chatToEnd: e, workspace: t } = k((e) => e.data),
|
|
1643
|
+
function st() {
|
|
1644
|
+
let { chatToEnd: e, workspace: t } = k((e) => e.data), i = O(), [a, o] = A.useState(!1);
|
|
1496
1645
|
function s() {
|
|
1497
|
-
r(
|
|
1646
|
+
i(r(void 0));
|
|
1498
1647
|
}
|
|
1499
1648
|
async function c() {
|
|
1500
1649
|
if (e) {
|
|
1501
|
-
|
|
1650
|
+
o(!0);
|
|
1502
1651
|
try {
|
|
1503
|
-
|
|
1652
|
+
i(n(await d.endChat({
|
|
1504
1653
|
workspaceId: e.workspaceId,
|
|
1505
1654
|
conversationId: e.conversationId,
|
|
1506
1655
|
senderId: e.senderId,
|
|
1507
1656
|
userType: e.userType,
|
|
1508
1657
|
senderName: e.senderName
|
|
1509
|
-
}))), r(
|
|
1658
|
+
}))), i(r(void 0));
|
|
1510
1659
|
} catch (e) {
|
|
1511
|
-
|
|
1660
|
+
u(e.message, "error");
|
|
1512
1661
|
} finally {
|
|
1513
|
-
|
|
1662
|
+
o(!1);
|
|
1514
1663
|
}
|
|
1515
1664
|
}
|
|
1516
1665
|
}
|
|
1517
|
-
return /* @__PURE__ */
|
|
1666
|
+
return /* @__PURE__ */ H("div", {
|
|
1518
1667
|
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1519
|
-
children: [/* @__PURE__ */
|
|
1668
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1520
1669
|
className: "padorix:text-center padorix:text-slate-500",
|
|
1521
1670
|
children: "Kindly confirm your request to end this chat session"
|
|
1522
|
-
}), /* @__PURE__ */
|
|
1671
|
+
}), /* @__PURE__ */ V("div", {
|
|
1523
1672
|
className: "padorix:border-t padorix:border-gray-200 padorix:mt-5",
|
|
1524
|
-
children: /* @__PURE__ */
|
|
1673
|
+
children: /* @__PURE__ */ H("div", {
|
|
1525
1674
|
className: "padorix:mt-2 padorix:size-fit padorix:ml-auto padorix:flex padorix:items-center padorix:gap-5",
|
|
1526
|
-
children: [/* @__PURE__ */
|
|
1675
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
1527
1676
|
onClick: s,
|
|
1528
|
-
className: `${
|
|
1677
|
+
className: `${a ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:border padorix:border-gray-200 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1529
1678
|
children: "Cancel"
|
|
1530
|
-
}) }), /* @__PURE__ */
|
|
1679
|
+
}) }), /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
1531
1680
|
onClick: c,
|
|
1532
|
-
disabled:
|
|
1681
|
+
disabled: a,
|
|
1533
1682
|
style: { background: String(t?.widget?.colorScheme) },
|
|
1534
|
-
className: `${
|
|
1683
|
+
className: `${a ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1535
1684
|
children: "End chat"
|
|
1536
1685
|
}) })]
|
|
1537
1686
|
})
|
|
@@ -1540,15 +1689,15 @@ function it() {
|
|
|
1540
1689
|
}
|
|
1541
1690
|
//#endregion
|
|
1542
1691
|
//#region lib/chats/chatmessages/chat-messages.tsx
|
|
1543
|
-
function
|
|
1692
|
+
function ct({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
1544
1693
|
let { conversation: r, chatToEnd: i, workspace: a } = k((e) => e.data), o = n.userType === "VISITOR";
|
|
1545
1694
|
function s(n) {
|
|
1546
1695
|
e.find((e) => e === n) ? t((e) => e.filter((e) => e !== n)) : t((e) => [...e, n]);
|
|
1547
1696
|
}
|
|
1548
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ H("div", {
|
|
1549
1698
|
className: "padorix:relative",
|
|
1550
1699
|
children: [
|
|
1551
|
-
n.messages.map((t) => /* @__PURE__ */
|
|
1700
|
+
n.messages.map((t) => /* @__PURE__ */ V(rt, {
|
|
1552
1701
|
messagesToDelete: e,
|
|
1553
1702
|
handleStarMessage: n.handleStarMessage,
|
|
1554
1703
|
deleteAction: s,
|
|
@@ -1557,8 +1706,8 @@ function at({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
|
1557
1706
|
messages: n.messages,
|
|
1558
1707
|
userType: n.userType,
|
|
1559
1708
|
moreActions: n.moreActions
|
|
1560
|
-
}, t.id)),
|
|
1561
|
-
n.isTyping && /* @__PURE__ */
|
|
1709
|
+
}, t.clientMessageId || t.id)),
|
|
1710
|
+
n.isTyping && /* @__PURE__ */ V("div", {
|
|
1562
1711
|
role: "status",
|
|
1563
1712
|
"aria-label": "Typing",
|
|
1564
1713
|
style: n.isOwnTyping ? { backgroundColor: a?.widget?.colorScheme || "#6c63ff" } : void 0,
|
|
@@ -1567,19 +1716,19 @@ function at({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
|
1567
1716
|
0,
|
|
1568
1717
|
1,
|
|
1569
1718
|
2
|
|
1570
|
-
].map((e) => /* @__PURE__ */
|
|
1719
|
+
].map((e) => /* @__PURE__ */ V("span", {
|
|
1571
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",
|
|
1572
1721
|
style: { animationDelay: `${e * 120}ms` }
|
|
1573
1722
|
}, e))
|
|
1574
1723
|
}),
|
|
1575
|
-
o && r?.status ===
|
|
1576
|
-
i?.isEndChat ===
|
|
1724
|
+
o && r?.status === c.false && /* @__PURE__ */ V(ot, {}),
|
|
1725
|
+
i?.isEndChat === c.true && /* @__PURE__ */ V(st, {})
|
|
1577
1726
|
]
|
|
1578
1727
|
});
|
|
1579
1728
|
}
|
|
1580
1729
|
//#endregion
|
|
1581
1730
|
//#region node_modules/react-icons/rx/index.mjs
|
|
1582
|
-
function
|
|
1731
|
+
function lt(e) {
|
|
1583
1732
|
return Z({
|
|
1584
1733
|
tag: "svg",
|
|
1585
1734
|
attr: {
|
|
@@ -1598,37 +1747,37 @@ function ot(e) {
|
|
|
1598
1747
|
}
|
|
1599
1748
|
//#endregion
|
|
1600
1749
|
//#region lib/chats/chatmessages/chat-message-skeleton.tsx
|
|
1601
|
-
function
|
|
1602
|
-
return /* @__PURE__ */
|
|
1750
|
+
function ut(e) {
|
|
1751
|
+
return /* @__PURE__ */ V(z, {
|
|
1603
1752
|
style: { width: `${Math.floor(Math.random() * 100 + (e.index + 15))}%` },
|
|
1604
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",
|
|
1605
|
-
children: /* @__PURE__ */
|
|
1754
|
+
children: /* @__PURE__ */ V("div", { className: "padorix:px-1 padorix:h-12" })
|
|
1606
1755
|
});
|
|
1607
1756
|
}
|
|
1608
1757
|
//#endregion
|
|
1609
1758
|
//#region lib/chats/chatScreen/chat-container.tsx
|
|
1610
|
-
var
|
|
1611
|
-
function
|
|
1759
|
+
var dt = 3500;
|
|
1760
|
+
function ft(e) {
|
|
1612
1761
|
return e ? Array.isArray(e) ? e.join("\n") : String(e) : "";
|
|
1613
1762
|
}
|
|
1614
|
-
function
|
|
1615
|
-
let
|
|
1616
|
-
...
|
|
1617
|
-
workspaceId:
|
|
1618
|
-
userType:
|
|
1619
|
-
} :
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
]),
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
]),
|
|
1631
|
-
let [e, t, n, r, i] = JSON.parse(
|
|
1763
|
+
function pt({ styles: e, userType: t, ...i }) {
|
|
1764
|
+
let a = O(), o = A.useRef(null), l = A.useRef(null), [p, m] = A.useState(!1), [h, _] = A.useState([]), [v, y] = A.useState(!1), [b, S] = A.useState(!1), [C, T] = A.useState(null), j = A.useRef(null), M = A.useRef(null), [N, P] = A.useState([]), F = A.useRef(/* @__PURE__ */ new Set()), { sender: I, workspace: ne, reply: re, conversation: ie } = k((e) => e.data), ae = C !== null, oe = !!(C?.senderId && C.senderId === I?.senderId), L = A.useMemo(() => t === w.VISITOR ? {
|
|
1765
|
+
...I,
|
|
1766
|
+
workspaceId: ne?.id,
|
|
1767
|
+
userType: t
|
|
1768
|
+
} : i.sender, [
|
|
1769
|
+
t,
|
|
1770
|
+
I,
|
|
1771
|
+
ne?.id,
|
|
1772
|
+
i.sender
|
|
1773
|
+
]), se = JSON.stringify([
|
|
1774
|
+
L?.workspaceId,
|
|
1775
|
+
L?.conversationId,
|
|
1776
|
+
L?.senderId,
|
|
1777
|
+
L?.userType ?? t,
|
|
1778
|
+
L?.fullName
|
|
1779
|
+
]), R = A.useMemo(() => {
|
|
1780
|
+
let [e, t, n, r, i] = JSON.parse(se);
|
|
1632
1781
|
return !e || !t || !n ? null : {
|
|
1633
1782
|
workspaceId: String(e),
|
|
1634
1783
|
conversationId: String(t),
|
|
@@ -1636,209 +1785,218 @@ function ut({ styles: t, userType: i, ...a }) {
|
|
|
1636
1785
|
userType: String(r),
|
|
1637
1786
|
senderName: i ? String(i) : void 0
|
|
1638
1787
|
};
|
|
1639
|
-
}, [
|
|
1640
|
-
|
|
1641
|
-
let
|
|
1642
|
-
function
|
|
1643
|
-
|
|
1788
|
+
}, [se]), le = String(L?.conversationId ?? ""), B = A.useRef(le);
|
|
1789
|
+
B.current = le;
|
|
1790
|
+
let U = A.useCallback((e) => e == null || e === "" ? !0 : String(e) === B.current, []);
|
|
1791
|
+
function W() {
|
|
1792
|
+
x(o), l.current?.scrollIntoView({ behavior: "smooth" });
|
|
1644
1793
|
}
|
|
1645
|
-
let
|
|
1794
|
+
let G = (e, t) => e.clientMessageId || !t.clientMessageId ? e : {
|
|
1795
|
+
...e,
|
|
1796
|
+
clientMessageId: t.clientMessageId
|
|
1797
|
+
}, K = A.useCallback((e) => {
|
|
1646
1798
|
let t = e.message;
|
|
1647
|
-
if (!t || !
|
|
1799
|
+
if (!t || !U(t.conversationId)) return;
|
|
1648
1800
|
let n = t.clientMessageId;
|
|
1649
|
-
n &&
|
|
1801
|
+
n && F.current.delete(n), P((e) => {
|
|
1650
1802
|
let r = e.findIndex((e) => e.id === t.id);
|
|
1651
|
-
if (r !== -1) return e.map((e, n) => n === r ? t : e);
|
|
1803
|
+
if (r !== -1) return e.map((e, n) => n === r ? G(t, e) : e);
|
|
1652
1804
|
if (n) {
|
|
1653
1805
|
let r = e.findIndex((e) => e.clientMessageId === n || e.id === n);
|
|
1654
|
-
if (r !== -1) return e.map((e, n) => n === r ? t : e);
|
|
1806
|
+
if (r !== -1) return e.map((e, n) => n === r ? G(t, e) : e);
|
|
1655
1807
|
}
|
|
1656
|
-
let i =
|
|
1657
|
-
let n = !!(e.id && e.id.length >= 32), r = String(e.senderId) === String(t.senderId), a =
|
|
1808
|
+
let i = ft(t.message), a = e.findIndex((e) => {
|
|
1809
|
+
let n = !!(e.id && e.id.length >= 32), r = String(e.senderId) === String(t.senderId), a = ft(e.message) === i;
|
|
1658
1810
|
return n && r && a;
|
|
1659
1811
|
});
|
|
1660
|
-
return a === -1 ? [...e, t] : e.map((e, n) => n === a ? t : e);
|
|
1661
|
-
}),
|
|
1662
|
-
|
|
1812
|
+
return a === -1 ? [...e, t] : e.map((e, n) => n === a ? G(t, e) : e);
|
|
1813
|
+
}), S(!1), setTimeout(() => {
|
|
1814
|
+
W();
|
|
1663
1815
|
}, 300);
|
|
1664
|
-
}, [
|
|
1665
|
-
|
|
1666
|
-
}, [
|
|
1667
|
-
if (!
|
|
1668
|
-
|
|
1816
|
+
}, [U]), de = A.useCallback((e) => {
|
|
1817
|
+
K(e);
|
|
1818
|
+
}, [K]), fe = A.useCallback((e) => {
|
|
1819
|
+
if (!F.current.has(e)) return;
|
|
1820
|
+
F.current.delete(e);
|
|
1669
1821
|
let t = [e];
|
|
1670
|
-
|
|
1822
|
+
P((e) => e.filter((e) => !t.includes(e.id) && (!e.clientMessageId || !t.includes(e.clientMessageId)))), S(!1);
|
|
1671
1823
|
}, []);
|
|
1672
|
-
function pe(
|
|
1673
|
-
let n = !!
|
|
1674
|
-
...
|
|
1675
|
-
clientMessageId:
|
|
1676
|
-
merchantId:
|
|
1824
|
+
function pe(e) {
|
|
1825
|
+
let n = !!re?.messageId, r = crypto.randomUUID(), i = {
|
|
1826
|
+
...e,
|
|
1827
|
+
clientMessageId: r,
|
|
1828
|
+
merchantId: ne?.userId,
|
|
1677
1829
|
...n ? {
|
|
1678
1830
|
isReply: !0,
|
|
1679
|
-
messageId:
|
|
1831
|
+
messageId: re?.messageId
|
|
1680
1832
|
} : {},
|
|
1681
|
-
message:
|
|
1682
|
-
},
|
|
1683
|
-
id:
|
|
1684
|
-
clientMessageId:
|
|
1685
|
-
conversationId:
|
|
1686
|
-
workspaceId:
|
|
1687
|
-
senderName:
|
|
1688
|
-
senderType:
|
|
1689
|
-
senderId:
|
|
1690
|
-
message: [
|
|
1691
|
-
images:
|
|
1692
|
-
starred:
|
|
1693
|
-
deleted:
|
|
1694
|
-
createdAt:
|
|
1695
|
-
updatedAt:
|
|
1833
|
+
message: e.message.trim()
|
|
1834
|
+
}, o = (/* @__PURE__ */ new Date()).toISOString(), l = {
|
|
1835
|
+
id: r,
|
|
1836
|
+
clientMessageId: r,
|
|
1837
|
+
conversationId: i.conversationId,
|
|
1838
|
+
workspaceId: i.workspaceId,
|
|
1839
|
+
senderName: I?.fullName ?? "",
|
|
1840
|
+
senderType: t,
|
|
1841
|
+
senderId: i.senderId,
|
|
1842
|
+
message: [i.message],
|
|
1843
|
+
images: i.images ?? [],
|
|
1844
|
+
starred: c.false,
|
|
1845
|
+
deleted: c.false,
|
|
1846
|
+
createdAt: o,
|
|
1847
|
+
updatedAt: o
|
|
1696
1848
|
};
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
}), s(
|
|
1700
|
-
|
|
1849
|
+
F.current.add(r), P((e) => e.some((e) => e.id === r || e.clientMessageId && e.clientMessageId === r) ? e : [...e, l]), S(!0), R && d.sendMessage(R, i).then((e) => K({ message: e })).catch((e) => {
|
|
1850
|
+
fe(r), u(e.message || "Message not sent", "error");
|
|
1851
|
+
}), a(s(void 0)), a(g(void 0)), setTimeout(() => {
|
|
1852
|
+
W();
|
|
1701
1853
|
}, 50);
|
|
1702
1854
|
}
|
|
1703
|
-
let
|
|
1704
|
-
|
|
1855
|
+
let q = A.useCallback((e) => {
|
|
1856
|
+
P((t) => t.some((t) => t.id === e.messageId) ? t.map((t) => t.id === e.messageId ? {
|
|
1705
1857
|
...t,
|
|
1706
1858
|
starred: e.status
|
|
1707
1859
|
} : t) : t);
|
|
1708
|
-
}, []),
|
|
1709
|
-
|
|
1710
|
-
|
|
1860
|
+
}, []), J = A.useCallback((e) => {
|
|
1861
|
+
U(e?.id) && (a(n(e)), setTimeout(() => {
|
|
1862
|
+
W();
|
|
1711
1863
|
}, 1e3));
|
|
1712
|
-
}, [
|
|
1713
|
-
|
|
1864
|
+
}, [a, U]), me = A.useCallback((e) => {
|
|
1865
|
+
U(e?.id) && (a(n(e)), a(r(void 0)), localStorage.removeItem(f), t === w.VISITOR && ee(), i.closeModal());
|
|
1714
1866
|
}, [
|
|
1715
|
-
s,
|
|
1716
1867
|
a,
|
|
1717
|
-
|
|
1718
|
-
|
|
1868
|
+
i,
|
|
1869
|
+
U,
|
|
1870
|
+
t
|
|
1719
1871
|
]), he = A.useCallback((e) => {
|
|
1720
|
-
|
|
1721
|
-
|
|
1872
|
+
U(e?.conversation?.id) && (P((t) => {
|
|
1873
|
+
let n = new Map(t.map((e) => [e.id, e]));
|
|
1874
|
+
return (e.messages ?? []).map((e) => {
|
|
1875
|
+
let t = n.get(e.id);
|
|
1876
|
+
return t ? G(e, t) : e;
|
|
1877
|
+
});
|
|
1878
|
+
}), new Set((e.messages ?? []).map((e) => e.clientMessageId).filter(Boolean)).forEach((e) => F.current.delete(e)), a(n(e.conversation)), setTimeout(() => {
|
|
1879
|
+
W();
|
|
1722
1880
|
}, 1e3));
|
|
1723
|
-
}, [
|
|
1881
|
+
}, [a, U]);
|
|
1724
1882
|
function ge(e, t) {
|
|
1725
|
-
|
|
1883
|
+
R && d.starMessage(R, e, t).then(q).catch((e) => u(e.message, "error"));
|
|
1726
1884
|
}
|
|
1727
1885
|
function _e(e) {
|
|
1728
1886
|
let t = [];
|
|
1729
1887
|
e.forEach((e) => {
|
|
1730
|
-
let n =
|
|
1888
|
+
let n = N.find((t) => t.id === e);
|
|
1731
1889
|
n && t.push(n.id);
|
|
1732
|
-
}), !(!
|
|
1890
|
+
}), !(!R || t.length === 0) && d.deleteMessages(R, t).then(ve).catch((e) => u(e.message, "error"));
|
|
1733
1891
|
}
|
|
1734
|
-
let
|
|
1892
|
+
let ve = A.useCallback((e) => {
|
|
1735
1893
|
if (!e || e.length === 0) return;
|
|
1736
1894
|
let t = new Set(e);
|
|
1737
|
-
|
|
1895
|
+
P((e) => e.some((e) => t.has(e.id)) ? e.map((e) => t.has(e.id) ? {
|
|
1738
1896
|
...e,
|
|
1739
|
-
deleted:
|
|
1897
|
+
deleted: c.true
|
|
1740
1898
|
} : e) : e);
|
|
1741
|
-
}, []),
|
|
1899
|
+
}, []), ye = A.useCallback((e) => {
|
|
1742
1900
|
let t = typeof e == "object" && e ? e : {};
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
},
|
|
1746
|
-
}, [
|
|
1901
|
+
U(t.conversationId) && (j.current = t, T(t), M.current !== null && window.clearTimeout(M.current), M.current = window.setTimeout(() => {
|
|
1902
|
+
j.current = null, T(null), M.current = null;
|
|
1903
|
+
}, dt));
|
|
1904
|
+
}, [U]), Y = A.useCallback((e) => {
|
|
1747
1905
|
let t = typeof e == "object" && e ? e : {};
|
|
1748
|
-
|
|
1749
|
-
}, [
|
|
1906
|
+
U(t.conversationId) && (t.senderId && j.current?.senderId && t.senderId !== j.current.senderId || (M.current !== null && (window.clearTimeout(M.current), M.current = null), j.current = null, T(null)));
|
|
1907
|
+
}, [U]);
|
|
1750
1908
|
A.useEffect(() => {
|
|
1751
|
-
|
|
1752
|
-
}, [le]), A.useEffect(() => (E.on(D.is_typing,
|
|
1753
|
-
E.off(D.is_typing,
|
|
1754
|
-
}), [
|
|
1755
|
-
|
|
1756
|
-
}, [
|
|
1757
|
-
let e =
|
|
1909
|
+
M.current !== null && (window.clearTimeout(M.current), M.current = null), j.current = null, T(null);
|
|
1910
|
+
}, [le]), A.useEffect(() => (E.on(D.is_typing, ye), E.on(D.not_typing, Y), () => {
|
|
1911
|
+
E.off(D.is_typing, ye), E.off(D.not_typing, Y), M.current !== null && window.clearTimeout(M.current);
|
|
1912
|
+
}), [Y, ye]), A.useEffect(() => {
|
|
1913
|
+
ae && !p && l.current?.scrollIntoView({ behavior: "smooth" });
|
|
1914
|
+
}, [p, ae]), A.useEffect(() => {
|
|
1915
|
+
let e = o.current;
|
|
1758
1916
|
if (!e) return;
|
|
1759
1917
|
let t = () => {
|
|
1760
1918
|
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e;
|
|
1761
|
-
n - t - r > 5 ?
|
|
1919
|
+
n - t - r > 5 ? m(!0) : m(!1);
|
|
1762
1920
|
};
|
|
1763
1921
|
return e.addEventListener("scroll", t, { passive: !0 }), () => {
|
|
1764
1922
|
e.removeEventListener("scroll", t);
|
|
1765
1923
|
};
|
|
1766
1924
|
}, []);
|
|
1767
1925
|
function be() {
|
|
1768
|
-
|
|
1926
|
+
W(), setTimeout(() => W(), 100);
|
|
1769
1927
|
}
|
|
1770
|
-
function
|
|
1928
|
+
function X() {
|
|
1771
1929
|
_([]);
|
|
1772
1930
|
}
|
|
1773
1931
|
function xe() {
|
|
1774
|
-
_e(
|
|
1932
|
+
_e(h), setTimeout(() => {
|
|
1775
1933
|
_([]);
|
|
1776
1934
|
}, 100);
|
|
1777
1935
|
}
|
|
1778
|
-
A.useEffect(() => (E.on(D.delete_message,
|
|
1779
|
-
E.off(D.delete_message,
|
|
1936
|
+
A.useEffect(() => (E.on(D.delete_message, ve), E.on(D.star_message, q), E.on(D.request_feedback, J), E.on(D.submit_feedback, J), E.on(D.end_chat_session, me), () => {
|
|
1937
|
+
E.off(D.delete_message, ve), E.off(D.star_message, q), E.off(D.request_feedback, J), E.off(D.submit_feedback, J), E.off(D.end_chat_session, me);
|
|
1780
1938
|
}), [
|
|
1781
|
-
|
|
1782
|
-
K,
|
|
1939
|
+
ve,
|
|
1783
1940
|
q,
|
|
1941
|
+
J,
|
|
1784
1942
|
me
|
|
1785
|
-
]), A.useEffect(() => (E.on(D.send_message,
|
|
1786
|
-
E.off(D.update_send_message,
|
|
1787
|
-
}), [
|
|
1788
|
-
if (!
|
|
1943
|
+
]), A.useEffect(() => (E.on(D.send_message, K), E.on(D.update_send_message, de), () => {
|
|
1944
|
+
E.off(D.update_send_message, de), E.off(D.send_message, K);
|
|
1945
|
+
}), [K, de]), A.useEffect(() => {
|
|
1946
|
+
if (!R) return;
|
|
1789
1947
|
let e = !1, t = () => {
|
|
1790
|
-
|
|
1948
|
+
d.history(R).then((t) => !e && he(t)).catch((e) => console.log(e.message));
|
|
1791
1949
|
}, n = () => {
|
|
1792
|
-
E.emit(D.subscribe_conversation,
|
|
1950
|
+
E.emit(D.subscribe_conversation, R), t();
|
|
1793
1951
|
};
|
|
1794
|
-
return E.on(D.connected, n), E.connected ? n() : (t(),
|
|
1952
|
+
return E.on(D.connected, n), E.connected ? n() : (t(), te(R.userType !== w.VISITOR)), () => {
|
|
1795
1953
|
e = !0, E.off(D.connected, n);
|
|
1796
1954
|
};
|
|
1797
|
-
}, [
|
|
1798
|
-
let
|
|
1799
|
-
return /* @__PURE__ */
|
|
1800
|
-
className:
|
|
1955
|
+
}, [R, he]);
|
|
1956
|
+
let Se = `calc(var(--padorix-vvh, 100dvh) * ${h.length > 0 || ie?.status === c.false ? .915 : .81})`;
|
|
1957
|
+
return /* @__PURE__ */ H("div", {
|
|
1958
|
+
className: e.container,
|
|
1801
1959
|
children: [
|
|
1802
|
-
/* @__PURE__ */
|
|
1803
|
-
styles:
|
|
1804
|
-
userType:
|
|
1805
|
-
goBack:
|
|
1806
|
-
close:
|
|
1960
|
+
/* @__PURE__ */ V(Ue, {
|
|
1961
|
+
styles: e,
|
|
1962
|
+
userType: t,
|
|
1963
|
+
goBack: i.goBack,
|
|
1964
|
+
close: i.closeModal,
|
|
1807
1965
|
toBottom: be,
|
|
1808
|
-
messages:
|
|
1966
|
+
messages: N
|
|
1809
1967
|
}),
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
ref:
|
|
1812
|
-
style: { height:
|
|
1813
|
-
className: `${
|
|
1968
|
+
/* @__PURE__ */ H("div", {
|
|
1969
|
+
ref: o,
|
|
1970
|
+
style: { height: Se },
|
|
1971
|
+
className: `${e.chatContainerPadding}`,
|
|
1814
1972
|
children: [
|
|
1815
|
-
|
|
1973
|
+
p && /* @__PURE__ */ V(ue, {
|
|
1816
1974
|
direction: "up",
|
|
1817
1975
|
className: "\r\n padorix:fixed\r\n padorix:right-2\r\n padorix:bottom-36\r\n padorix:z-10\r\n padorix:cursor-pointer\r\n padorix:transition-all\r\n padorix:active:scale-125\r\n ",
|
|
1818
|
-
children: /* @__PURE__ */
|
|
1976
|
+
children: /* @__PURE__ */ V("div", {
|
|
1819
1977
|
className: "\r\n padorix:transition-all\r\n padorix:rounded-full\r\n padorix:size-8\r\n padorix:text-slate-500\r\n padorix:border\r\n padorix:border-gray-200\r\n padorix:flex\r\n padorix:items-center\r\n padorix:justify-center\r\n padorix:bg-white\r\n padorix:shadow-lg\r\n ",
|
|
1820
|
-
onClick:
|
|
1821
|
-
children: /* @__PURE__ */
|
|
1978
|
+
onClick: W,
|
|
1979
|
+
children: /* @__PURE__ */ V(lt, {})
|
|
1822
1980
|
})
|
|
1823
1981
|
}),
|
|
1824
|
-
Number(
|
|
1982
|
+
Number(N?.length) < 1 && /* @__PURE__ */ V("div", {
|
|
1825
1983
|
className: "padorix:relative padorix:p-4",
|
|
1826
|
-
children: Array(8).fill(0).map((e, t) => /* @__PURE__ */
|
|
1984
|
+
children: Array(8).fill(0).map((e, t) => /* @__PURE__ */ V(ut, { index: t }, t))
|
|
1827
1985
|
}),
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
messages:
|
|
1986
|
+
/* @__PURE__ */ V(ct, {
|
|
1987
|
+
messages: N,
|
|
1830
1988
|
deleteMessagesAction: _e,
|
|
1831
1989
|
handleStarMessage: ge,
|
|
1832
|
-
styles:
|
|
1833
|
-
userType:
|
|
1834
|
-
messagesToDelete:
|
|
1990
|
+
styles: e,
|
|
1991
|
+
userType: t,
|
|
1992
|
+
messagesToDelete: h,
|
|
1835
1993
|
setMessagesToDelete: _,
|
|
1836
|
-
moreActions:
|
|
1837
|
-
isTyping:
|
|
1838
|
-
isOwnTyping:
|
|
1994
|
+
moreActions: i.moreActions,
|
|
1995
|
+
isTyping: ae,
|
|
1996
|
+
isOwnTyping: oe
|
|
1839
1997
|
}),
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
ref:
|
|
1998
|
+
/* @__PURE__ */ V("div", {
|
|
1999
|
+
ref: l,
|
|
1842
2000
|
style: {
|
|
1843
2001
|
float: "left",
|
|
1844
2002
|
clear: "both"
|
|
@@ -1846,58 +2004,58 @@ function ut({ styles: t, userType: i, ...a }) {
|
|
|
1846
2004
|
})
|
|
1847
2005
|
]
|
|
1848
2006
|
}),
|
|
1849
|
-
v &&
|
|
1850
|
-
className:
|
|
1851
|
-
children: [/* @__PURE__ */
|
|
2007
|
+
v && h.length > 0 && /* @__PURE__ */ H("div", {
|
|
2008
|
+
className: e.messagesContainer,
|
|
2009
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1852
2010
|
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1853
|
-
children: [/* @__PURE__ */
|
|
1854
|
-
onClick:
|
|
2011
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2012
|
+
onClick: X,
|
|
1855
2013
|
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
1856
|
-
children: /* @__PURE__ */
|
|
1857
|
-
}), /* @__PURE__ */
|
|
2014
|
+
children: /* @__PURE__ */ V(Q, {})
|
|
2015
|
+
}), /* @__PURE__ */ H("div", {
|
|
1858
2016
|
className: "padorix:space-x-0.5",
|
|
1859
2017
|
children: [
|
|
1860
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ V("span", { children: "Confirm to delete" }),
|
|
1861
2019
|
" ",
|
|
1862
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ H("span", {
|
|
1863
2021
|
className: "padorix:text-red-500",
|
|
1864
2022
|
children: [
|
|
1865
|
-
|
|
2023
|
+
h.length,
|
|
1866
2024
|
" message",
|
|
1867
|
-
|
|
2025
|
+
h.length === 1 ? "" : "s"
|
|
1868
2026
|
]
|
|
1869
2027
|
})
|
|
1870
2028
|
]
|
|
1871
2029
|
})]
|
|
1872
|
-
}), /* @__PURE__ */
|
|
2030
|
+
}), /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
1873
2031
|
onClick: xe,
|
|
1874
2032
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125 padorix:text-red-500",
|
|
1875
|
-
children: /* @__PURE__ */
|
|
2033
|
+
children: /* @__PURE__ */ V(ce, {})
|
|
1876
2034
|
}) })]
|
|
1877
2035
|
}),
|
|
1878
|
-
!v &&
|
|
1879
|
-
className:
|
|
1880
|
-
children: [/* @__PURE__ */
|
|
2036
|
+
!v && h.length > 0 && /* @__PURE__ */ H("div", {
|
|
2037
|
+
className: e.messagesContainer,
|
|
2038
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1881
2039
|
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1882
2040
|
children: [
|
|
1883
|
-
/* @__PURE__ */
|
|
1884
|
-
onClick:
|
|
2041
|
+
/* @__PURE__ */ V("div", {
|
|
2042
|
+
onClick: X,
|
|
1885
2043
|
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
1886
|
-
children: /* @__PURE__ */
|
|
2044
|
+
children: /* @__PURE__ */ V(Q, {})
|
|
1887
2045
|
}),
|
|
1888
|
-
|
|
2046
|
+
h.length,
|
|
1889
2047
|
" Selected"
|
|
1890
2048
|
]
|
|
1891
|
-
}), /* @__PURE__ */
|
|
2049
|
+
}), /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
1892
2050
|
onClick: () => y(!0),
|
|
1893
2051
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125",
|
|
1894
|
-
children: /* @__PURE__ */
|
|
2052
|
+
children: /* @__PURE__ */ V(ce, {})
|
|
1895
2053
|
}) })]
|
|
1896
2054
|
}),
|
|
1897
|
-
|
|
2055
|
+
h.length < 1 && ie?.status === c.true && /* @__PURE__ */ V(ze, {
|
|
1898
2056
|
sendChat: pe,
|
|
1899
|
-
styles:
|
|
1900
|
-
userType:
|
|
2057
|
+
styles: e,
|
|
2058
|
+
userType: t,
|
|
1901
2059
|
isSending: b
|
|
1902
2060
|
})
|
|
1903
2061
|
]
|
|
@@ -1905,192 +2063,192 @@ function ut({ styles: t, userType: i, ...a }) {
|
|
|
1905
2063
|
}
|
|
1906
2064
|
//#endregion
|
|
1907
2065
|
//#region lib/assets/images/wave.png
|
|
1908
|
-
var
|
|
1909
|
-
function
|
|
1910
|
-
let { workspace:
|
|
2066
|
+
var mt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAA7VBMVEUAAADro1Lro1Lro1Lro1L/3Wfvr1bvrlbro1Lro1Lro1JCreJCreJCreJCreL/3Wf70mP91mT4x1/uqlX/3Wf/3Wf+2WbzuVrro1JCreJCreJCreJCreJCreJCreL/3Wfro1L/3WdCreJCreLro1L/3Wfsp1P6zmH/3WfwsldCreJCreL1wF3vsFfurVbvrlbuq1X/3W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r6C1CgkShdxLll8DxK+IFR2cCTCRUkHRSFDG2G1vwANbRu0eH6XOpkkDMw/jnByB7CtneetfkWr/wA7dfK3+1s2PPTuc4KiIAeJL8BmnjUvM+dLSroZndCAPZVySae4iWUI0qiRgRHvBCe7EcW5Vf2whdZEwEffpDA6DxG6tneetfkWrqGWa/u1jQselc7v3Vq13DHLDHZkur5LEHKnGKt7Ke4KkIwQkgtjcMUba4EYlMLaDxxRsZwu+Ng+oAJjgQTVjG8d7ZFlI1OpGeIqSSBJdqrLnvSjAU4O5jR2hFIQJIX0q6smlsHugLv/AOUdoxlxL0La0L6MNuw5J3j2zQv4xmTom6RkVG73dwuPAf1S3qB5GaNjm46UYOPDOBUNwLraVpKVwxdQ2/dkfarvYks1xLLFMoDtnDZ3E12fufWi512fufWi512fufWi512fufWi51Z7EkguI5pJlIQ5AXia/9k=", gt = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
2067
|
+
function _t(t) {
|
|
2068
|
+
let { workspace: r, tags: i } = k((e) => e.data), a = O(), [o, s] = A.useState(!1), c = A.useMemo(() => C(t.workspaceId), [t.workspaceId]), [p, h] = A.useState(t.openOptions ? 2 : i.length > 0 ? 1 : 2), g = A.useRef(0), _ = fe({
|
|
1911
2069
|
mode: "uncontrolled",
|
|
1912
2070
|
initialValues: {
|
|
1913
|
-
tagId:
|
|
1914
|
-
fullName:
|
|
1915
|
-
email:
|
|
1916
|
-
message:
|
|
2071
|
+
tagId: i.find((e) => e.tag.trim().toLowerCase() === t.openOptions?.tag?.trim().toLowerCase())?.id ?? "",
|
|
2072
|
+
fullName: t.openOptions?.name ?? "",
|
|
2073
|
+
email: t.openOptions?.email ?? "",
|
|
2074
|
+
message: t.openOptions?.message ?? ""
|
|
1917
2075
|
},
|
|
1918
2076
|
validate: {
|
|
1919
|
-
fullName: (e) =>
|
|
1920
|
-
email: (e) =>
|
|
1921
|
-
message: (e) =>
|
|
2077
|
+
fullName: (e) => p === 2 && !e ? "Full name is required" : p === 2 && e.length <= 2 ? "Your name is expected to be more than 2 characters" : null,
|
|
2078
|
+
email: (e) => p === 2 && !e ? "Email address is required" : p === 2 && !gt(e) ? "Please enter a valid email address" : null,
|
|
2079
|
+
message: (e) => p === 4 && !e ? "Enquiry content is required" : null
|
|
1922
2080
|
}
|
|
1923
2081
|
});
|
|
1924
2082
|
function v() {
|
|
1925
|
-
if (
|
|
1926
|
-
if (
|
|
1927
|
-
|
|
2083
|
+
if (i.length > 0) {
|
|
2084
|
+
if (p === 1) return t.changeScreen(1);
|
|
2085
|
+
h((e) => e - 1);
|
|
1928
2086
|
}
|
|
1929
|
-
if (
|
|
1930
|
-
if (
|
|
1931
|
-
|
|
2087
|
+
if (i.length < 1) {
|
|
2088
|
+
if (p === 2) return t.changeScreen(1);
|
|
2089
|
+
h((e) => e - 1);
|
|
1932
2090
|
}
|
|
1933
2091
|
}
|
|
1934
2092
|
function y(e) {
|
|
1935
|
-
_.setFieldValue("tagId", e),
|
|
2093
|
+
_.setFieldValue("tagId", e), h((e) => e + 1);
|
|
1936
2094
|
}
|
|
1937
|
-
async function b(
|
|
1938
|
-
|
|
2095
|
+
async function b(t) {
|
|
2096
|
+
s(!0);
|
|
1939
2097
|
try {
|
|
1940
|
-
let
|
|
1941
|
-
conversationId:
|
|
1942
|
-
senderId:
|
|
1943
|
-
fullName:
|
|
1944
|
-
tagId:
|
|
1945
|
-
expiresAt:
|
|
2098
|
+
let r = await d.startConversation(t), i = {
|
|
2099
|
+
conversationId: r.conversation.id,
|
|
2100
|
+
senderId: r.senderId,
|
|
2101
|
+
fullName: r.fullName,
|
|
2102
|
+
tagId: t.tagId,
|
|
2103
|
+
expiresAt: K().add(1, "day").endOf("day").toDate().toString()
|
|
1946
2104
|
};
|
|
1947
|
-
localStorage.setItem(
|
|
2105
|
+
localStorage.setItem(f, JSON.stringify(i)), a(n(r.conversation)), a(e(i));
|
|
1948
2106
|
} catch (e) {
|
|
1949
|
-
|
|
2107
|
+
u(e.message || "Unable to start the chat", "error"), window.dispatchEvent(new Event(m));
|
|
1950
2108
|
} finally {
|
|
1951
|
-
|
|
2109
|
+
s(!1);
|
|
1952
2110
|
}
|
|
1953
2111
|
}
|
|
1954
|
-
async function x(
|
|
1955
|
-
if (
|
|
2112
|
+
async function x(e) {
|
|
2113
|
+
if (p < 3) return h((e) => e + 1);
|
|
1956
2114
|
await b({
|
|
1957
|
-
...
|
|
1958
|
-
workspaceId:
|
|
2115
|
+
...e,
|
|
2116
|
+
workspaceId: t.workspaceId,
|
|
1959
2117
|
userType: "VISITOR",
|
|
1960
|
-
visitorId:
|
|
1961
|
-
tag:
|
|
2118
|
+
visitorId: c,
|
|
2119
|
+
tag: t.openOptions?.tag
|
|
1962
2120
|
});
|
|
1963
2121
|
}
|
|
1964
2122
|
return A.useEffect(() => {
|
|
1965
|
-
if (!
|
|
1966
|
-
let
|
|
1967
|
-
if (!
|
|
1968
|
-
|
|
2123
|
+
if (!t.openRequestId) return;
|
|
2124
|
+
let e = t.openOptions;
|
|
2125
|
+
if (!e) {
|
|
2126
|
+
h(1);
|
|
1969
2127
|
return;
|
|
1970
2128
|
}
|
|
1971
|
-
let
|
|
2129
|
+
let n = i.find((t) => t.tag.trim().toLowerCase() === e.tag?.trim().toLowerCase())?.id ?? "";
|
|
1972
2130
|
_.setValues({
|
|
1973
|
-
tagId:
|
|
1974
|
-
fullName:
|
|
1975
|
-
email:
|
|
1976
|
-
message:
|
|
1977
|
-
}),
|
|
1978
|
-
workspaceId:
|
|
2131
|
+
tagId: n,
|
|
2132
|
+
fullName: e.name ?? "",
|
|
2133
|
+
email: e.email ?? "",
|
|
2134
|
+
message: e.message ?? ""
|
|
2135
|
+
}), h(2), !(t.autoSubmitRequestId !== t.openRequestId || g.current === t.openRequestId || !l(e)) && (g.current = t.openRequestId, b({
|
|
2136
|
+
workspaceId: t.workspaceId,
|
|
1979
2137
|
userType: "VISITOR",
|
|
1980
|
-
visitorId:
|
|
1981
|
-
fullName:
|
|
1982
|
-
email:
|
|
1983
|
-
message:
|
|
1984
|
-
tagId:
|
|
1985
|
-
tag:
|
|
2138
|
+
visitorId: c,
|
|
2139
|
+
fullName: e.name?.trim(),
|
|
2140
|
+
email: e.email?.trim(),
|
|
2141
|
+
message: e.message?.trim(),
|
|
2142
|
+
tagId: n || void 0,
|
|
2143
|
+
tag: e.tag
|
|
1986
2144
|
}));
|
|
1987
|
-
}, [
|
|
1988
|
-
className:
|
|
1989
|
-
children: [/* @__PURE__ */
|
|
2145
|
+
}, [t.openRequestId]), /* @__PURE__ */ H("div", {
|
|
2146
|
+
className: t.styles.container,
|
|
2147
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1990
2148
|
style: {
|
|
1991
|
-
background: String(
|
|
1992
|
-
color:
|
|
2149
|
+
background: String(r?.widget?.colorScheme),
|
|
2150
|
+
color: r?.widget?.textColor || "#ffffff"
|
|
1993
2151
|
},
|
|
1994
2152
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:gap-2",
|
|
1995
|
-
children: [/* @__PURE__ */
|
|
2153
|
+
children: [/* @__PURE__ */ V(z, {
|
|
1996
2154
|
className: "",
|
|
1997
2155
|
children: "Kindly drop your enquiry and we will get back to you immediately"
|
|
1998
|
-
}), /* @__PURE__ */
|
|
2156
|
+
}), /* @__PURE__ */ V("div", {
|
|
1999
2157
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2000
|
-
children: /* @__PURE__ */
|
|
2158
|
+
children: /* @__PURE__ */ V("div", {
|
|
2001
2159
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2002
|
-
onClick:
|
|
2003
|
-
children: /* @__PURE__ */
|
|
2160
|
+
onClick: t.close,
|
|
2161
|
+
children: /* @__PURE__ */ V(F, {})
|
|
2004
2162
|
})
|
|
2005
2163
|
})]
|
|
2006
|
-
}), /* @__PURE__ */
|
|
2164
|
+
}), /* @__PURE__ */ H("div", {
|
|
2007
2165
|
className: "padorix:p-4",
|
|
2008
2166
|
children: [
|
|
2009
|
-
/* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ H("div", {
|
|
2010
2168
|
className: "padorix:flex padorix:items-center padorix:gap-2",
|
|
2011
|
-
children: [/* @__PURE__ */
|
|
2169
|
+
children: [/* @__PURE__ */ V(z, {
|
|
2012
2170
|
className: "padorix:size-10",
|
|
2013
|
-
children: /* @__PURE__ */
|
|
2171
|
+
children: /* @__PURE__ */ H("div", {
|
|
2014
2172
|
className: "",
|
|
2015
2173
|
children: [
|
|
2016
2174
|
" ",
|
|
2017
|
-
/* @__PURE__ */
|
|
2018
|
-
src:
|
|
2019
|
-
alt:
|
|
2175
|
+
/* @__PURE__ */ V("img", {
|
|
2176
|
+
src: r?.logo,
|
|
2177
|
+
alt: r?.name,
|
|
2020
2178
|
loading: "lazy",
|
|
2021
2179
|
className: "padorix:size-10 padorix:object-contain"
|
|
2022
2180
|
}),
|
|
2023
2181
|
" "
|
|
2024
2182
|
]
|
|
2025
2183
|
})
|
|
2026
|
-
}), /* @__PURE__ */
|
|
2184
|
+
}), /* @__PURE__ */ V(z, {
|
|
2027
2185
|
className: "padorix:text-right padorix:w-full",
|
|
2028
|
-
children: /* @__PURE__ */
|
|
2186
|
+
children: /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("div", {
|
|
2029
2187
|
className: "padorix:font-medium padorix:text-right",
|
|
2030
|
-
children:
|
|
2031
|
-
}), /* @__PURE__ */
|
|
2188
|
+
children: r?.name
|
|
2189
|
+
}), /* @__PURE__ */ V("div", {
|
|
2032
2190
|
className: "padorix:text-sm padorix:text-right padorix:text-slate-500",
|
|
2033
|
-
children:
|
|
2191
|
+
children: r?.widget?.department
|
|
2034
2192
|
})] })
|
|
2035
2193
|
})]
|
|
2036
2194
|
}),
|
|
2037
|
-
/* @__PURE__ */
|
|
2195
|
+
/* @__PURE__ */ H("form", {
|
|
2038
2196
|
onSubmit: _.onSubmit(x),
|
|
2039
|
-
children: [/* @__PURE__ */
|
|
2197
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2040
2198
|
className: "padorix:h-[35dvh] padorix:flex padorix:items-center padorix:justify-center",
|
|
2041
|
-
children: /* @__PURE__ */
|
|
2199
|
+
children: /* @__PURE__ */ H("div", {
|
|
2042
2200
|
className: "padorix:w-full",
|
|
2043
2201
|
children: [
|
|
2044
|
-
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2202
|
+
p === 1 && /* @__PURE__ */ H(B, { children: [
|
|
2203
|
+
/* @__PURE__ */ V(vt, { current: 1 }),
|
|
2204
|
+
/* @__PURE__ */ V("div", {
|
|
2047
2205
|
className: "padorix:font-bold padorix:mb-2",
|
|
2048
2206
|
children: "What is your enquiry about?"
|
|
2049
2207
|
}),
|
|
2050
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ V("div", {
|
|
2051
2209
|
className: "padorix:flex padorix:flex-wrap padorix:items-center padorix:gap-2",
|
|
2052
|
-
children:
|
|
2210
|
+
children: i?.map((e, t) => /* @__PURE__ */ V("div", {
|
|
2053
2211
|
onClick: () => y(e.id),
|
|
2054
|
-
style: { background: _.values.tagId === e.id ? String(
|
|
2212
|
+
style: { background: _.values.tagId === e.id ? String(r?.widget?.colorScheme) : "#f1f5f9" },
|
|
2055
2213
|
className: `padorix:text-xs padorix:py-1.5 padorix:px-2 padorix:rounded-md ${_.values.tagId === e.id ? "padorix:text-white" : "padorix:bg-slate-100 padorix:border padorix:border-gray-200"} padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all`,
|
|
2056
2214
|
children: e.tag
|
|
2057
|
-
},
|
|
2215
|
+
}, t))
|
|
2058
2216
|
}),
|
|
2059
|
-
_.errors.tagId ? /* @__PURE__ */
|
|
2217
|
+
_.errors.tagId ? /* @__PURE__ */ V("div", {
|
|
2060
2218
|
className: "padorix:text-red-400 padorix:text-sm padorix:mt-2",
|
|
2061
2219
|
children: _.errors.tagId?.toString()
|
|
2062
2220
|
}) : ""
|
|
2063
2221
|
] }),
|
|
2064
|
-
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
screen:
|
|
2222
|
+
p === 2 && /* @__PURE__ */ H(B, { children: [
|
|
2223
|
+
/* @__PURE__ */ V(vt, { current: 2 }),
|
|
2224
|
+
/* @__PURE__ */ V(yt, {
|
|
2225
|
+
screen: p,
|
|
2068
2226
|
tagId: _.values.tagId,
|
|
2069
|
-
tags:
|
|
2227
|
+
tags: i
|
|
2070
2228
|
}),
|
|
2071
|
-
/* @__PURE__ */
|
|
2229
|
+
/* @__PURE__ */ V($, {
|
|
2072
2230
|
content: "Full name",
|
|
2073
2231
|
placeholder: "Enter your full name",
|
|
2074
2232
|
error: _.errors.fullName?.toString() || "",
|
|
2075
2233
|
..._.getInputProps("fullName")
|
|
2076
2234
|
}, _.key("fullName")),
|
|
2077
|
-
/* @__PURE__ */
|
|
2235
|
+
/* @__PURE__ */ V($, {
|
|
2078
2236
|
content: "Email address",
|
|
2079
2237
|
placeholder: "name@example.com",
|
|
2080
2238
|
error: _.errors.email?.toString() || "",
|
|
2081
2239
|
..._.getInputProps("email")
|
|
2082
2240
|
}, _.key("email"))
|
|
2083
2241
|
] }),
|
|
2084
|
-
|
|
2085
|
-
/* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
screen:
|
|
2242
|
+
p === 3 && /* @__PURE__ */ H(B, { children: [
|
|
2243
|
+
/* @__PURE__ */ V(vt, { current: 3 }),
|
|
2244
|
+
/* @__PURE__ */ V(yt, {
|
|
2245
|
+
screen: p,
|
|
2088
2246
|
tagId: _.values.tagId,
|
|
2089
|
-
tags:
|
|
2247
|
+
tags: i,
|
|
2090
2248
|
name: _.values.fullName,
|
|
2091
2249
|
email: _.values.email
|
|
2092
2250
|
}),
|
|
2093
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ V($, {
|
|
2094
2252
|
content: "Message",
|
|
2095
2253
|
formtype: "textarea",
|
|
2096
2254
|
error: _.errors.message?.toString() || "",
|
|
@@ -2099,27 +2257,27 @@ function mt(e) {
|
|
|
2099
2257
|
] })
|
|
2100
2258
|
]
|
|
2101
2259
|
})
|
|
2102
|
-
}), /* @__PURE__ */
|
|
2260
|
+
}), /* @__PURE__ */ H("div", {
|
|
2103
2261
|
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2104
|
-
children: [/* @__PURE__ */
|
|
2262
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
2105
2263
|
type: "button",
|
|
2106
2264
|
onClick: v,
|
|
2107
2265
|
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2108
2266
|
children: "Back"
|
|
2109
|
-
}) }), /* @__PURE__ */
|
|
2110
|
-
disabled:
|
|
2111
|
-
style: { background:
|
|
2112
|
-
className: `${
|
|
2113
|
-
children:
|
|
2267
|
+
}) }), /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
2268
|
+
disabled: o,
|
|
2269
|
+
style: { background: o ? "#62748e" : String(r?.widget?.colorScheme) },
|
|
2270
|
+
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: p < 3 ? "Next" : "Start Chat"
|
|
2114
2272
|
}) })]
|
|
2115
2273
|
})]
|
|
2116
2274
|
}),
|
|
2117
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ H("div", {
|
|
2118
2276
|
className: "padorix:mt-20 padorix:grayscale-100 padorix:text-sm padorix:flex padorix:items-center padorix:justify-center padorix:text-zinc-500 padorix:gap-2",
|
|
2119
2277
|
children: [
|
|
2120
2278
|
" ",
|
|
2121
|
-
/* @__PURE__ */
|
|
2122
|
-
src:
|
|
2279
|
+
/* @__PURE__ */ V("img", {
|
|
2280
|
+
src: ht,
|
|
2123
2281
|
alt: "padorix",
|
|
2124
2282
|
loading: "lazy",
|
|
2125
2283
|
className: "padorix:size-6 padorix:inline"
|
|
@@ -2131,13 +2289,13 @@ function mt(e) {
|
|
|
2131
2289
|
})]
|
|
2132
2290
|
});
|
|
2133
2291
|
}
|
|
2134
|
-
function
|
|
2292
|
+
function vt(e) {
|
|
2135
2293
|
let { tags: t, workspace: n } = k((e) => e.data), r = t.length > 0 ? 3 : 2, i = t.length > 0 ? e.current : e.current - 1;
|
|
2136
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ H("div", {
|
|
2137
2295
|
className: "padorix:text-right padorix:text-sm padorix:text-gray-500 padorix:italic padorix:font-semibold",
|
|
2138
2296
|
children: [
|
|
2139
2297
|
"Step ",
|
|
2140
|
-
/* @__PURE__ */
|
|
2298
|
+
/* @__PURE__ */ V("span", {
|
|
2141
2299
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2142
2300
|
children: i
|
|
2143
2301
|
}),
|
|
@@ -2146,36 +2304,36 @@ function ht(e) {
|
|
|
2146
2304
|
]
|
|
2147
2305
|
});
|
|
2148
2306
|
}
|
|
2149
|
-
function
|
|
2150
|
-
return /* @__PURE__ */
|
|
2307
|
+
function yt(e) {
|
|
2308
|
+
return /* @__PURE__ */ H("div", {
|
|
2151
2309
|
className: "padorix:my-2",
|
|
2152
|
-
children: [e.tagId && e.screen > 1 && /* @__PURE__ */
|
|
2310
|
+
children: [e.tagId && e.screen > 1 && /* @__PURE__ */ H("div", {
|
|
2153
2311
|
className: "padorix:text-xs",
|
|
2154
2312
|
children: [
|
|
2155
2313
|
" ",
|
|
2156
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ V("span", {
|
|
2157
2315
|
className: "padorix:text-slate-500 padorix:mr-1",
|
|
2158
2316
|
children: "Enquiry: "
|
|
2159
2317
|
}),
|
|
2160
2318
|
" ",
|
|
2161
2319
|
e.tags?.find((t) => t.id === e.tagId)?.tag
|
|
2162
2320
|
]
|
|
2163
|
-
}), e.screen > 2 && /* @__PURE__ */
|
|
2321
|
+
}), e.screen > 2 && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("div", {
|
|
2164
2322
|
className: "padorix:text-xs",
|
|
2165
2323
|
children: [
|
|
2166
2324
|
" ",
|
|
2167
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ V("span", {
|
|
2168
2326
|
className: "padorix:text-slate-500 padorix:mr-3",
|
|
2169
2327
|
children: "Name: "
|
|
2170
2328
|
}),
|
|
2171
2329
|
" ",
|
|
2172
2330
|
e.name
|
|
2173
2331
|
]
|
|
2174
|
-
}), /* @__PURE__ */
|
|
2332
|
+
}), /* @__PURE__ */ H("div", {
|
|
2175
2333
|
className: "padorix:text-xs",
|
|
2176
2334
|
children: [
|
|
2177
2335
|
" ",
|
|
2178
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ V("span", {
|
|
2179
2337
|
className: "padorix:text-slate-500 padorix:mr-4",
|
|
2180
2338
|
children: "Email: "
|
|
2181
2339
|
}),
|
|
@@ -2187,129 +2345,129 @@ function gt(e) {
|
|
|
2187
2345
|
}
|
|
2188
2346
|
//#endregion
|
|
2189
2347
|
//#region lib/chats/chatScreen/not-available-banner.tsx
|
|
2190
|
-
function
|
|
2191
|
-
return /* @__PURE__ */
|
|
2348
|
+
function bt() {
|
|
2349
|
+
return /* @__PURE__ */ V("div", {
|
|
2192
2350
|
className: "padorix:p-2 padorix:text-yellow-800 padorix:bg-yellow-100/50 padorix:border padorix:border-yellow-200 padorix:rounded-md padorix:text-center padorix:text-[0.75rem] padorix:whitespace-pre-line",
|
|
2193
2351
|
children: "We're currently unavailable. Leave us a message \n and we'll get back to you via email."
|
|
2194
2352
|
});
|
|
2195
2353
|
}
|
|
2196
2354
|
//#endregion
|
|
2197
2355
|
//#region lib/chats/chatScreen/chat-faqs.tsx
|
|
2198
|
-
function
|
|
2356
|
+
function xt(e) {
|
|
2199
2357
|
let { faqs: t, workspace: n } = k((e) => e.data), [r, i] = A.useState(), a = e.isOpen ? "Talk to an agent" : "Send us a message";
|
|
2200
2358
|
function o(e) {
|
|
2201
2359
|
i(e);
|
|
2202
2360
|
}
|
|
2203
|
-
return r?.question ? /* @__PURE__ */
|
|
2204
|
-
/* @__PURE__ */
|
|
2361
|
+
return r?.question ? /* @__PURE__ */ H(B, { children: [
|
|
2362
|
+
/* @__PURE__ */ H("div", {
|
|
2205
2363
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2206
2364
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2207
2365
|
children: [
|
|
2208
|
-
/* @__PURE__ */
|
|
2366
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2209
2367
|
className: "padorix:size-8",
|
|
2210
|
-
children: /* @__PURE__ */
|
|
2368
|
+
children: /* @__PURE__ */ H("div", {
|
|
2211
2369
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2212
2370
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2213
2371
|
children: [
|
|
2214
2372
|
" ",
|
|
2215
|
-
/* @__PURE__ */
|
|
2373
|
+
/* @__PURE__ */ V(Ge, { className: "padorix:size-7" }),
|
|
2216
2374
|
" "
|
|
2217
2375
|
]
|
|
2218
2376
|
})
|
|
2219
2377
|
}) }),
|
|
2220
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2221
2379
|
className: "",
|
|
2222
2380
|
children: "Our Frequently asked questions"
|
|
2223
2381
|
}) }),
|
|
2224
|
-
/* @__PURE__ */
|
|
2382
|
+
/* @__PURE__ */ V("div", {
|
|
2225
2383
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2226
|
-
children: /* @__PURE__ */
|
|
2384
|
+
children: /* @__PURE__ */ V("div", {
|
|
2227
2385
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2228
2386
|
onClick: e.close,
|
|
2229
|
-
children: /* @__PURE__ */
|
|
2387
|
+
children: /* @__PURE__ */ V(F, {})
|
|
2230
2388
|
})
|
|
2231
2389
|
})
|
|
2232
2390
|
]
|
|
2233
2391
|
}),
|
|
2234
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ H("div", {
|
|
2235
2393
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2236
2394
|
children: [
|
|
2237
|
-
!e.isOpen && /* @__PURE__ */
|
|
2238
|
-
/* @__PURE__ */
|
|
2395
|
+
!e.isOpen && /* @__PURE__ */ V(bt, {}),
|
|
2396
|
+
/* @__PURE__ */ V("div", {
|
|
2239
2397
|
className: "padorix:font-bold padorix:text-xl padorix:mb-3",
|
|
2240
2398
|
children: r.question
|
|
2241
2399
|
}),
|
|
2242
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ V("div", {
|
|
2243
2401
|
className: "padorix:whitespace-pre-line padorix:pl-2 padorix:text-gray-600 padorix:text-sm",
|
|
2244
2402
|
children: r.answer
|
|
2245
2403
|
})
|
|
2246
2404
|
]
|
|
2247
2405
|
}),
|
|
2248
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ H("div", {
|
|
2249
2407
|
className: "padorix:flex padorix:items-center padorix:justify-end padorix:p-2 padorix:gap-5",
|
|
2250
|
-
children: [/* @__PURE__ */
|
|
2408
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
2251
2409
|
type: "button",
|
|
2252
2410
|
onClick: () => o(void 0),
|
|
2253
2411
|
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2254
2412
|
children: "Back"
|
|
2255
|
-
}) }), /* @__PURE__ */
|
|
2413
|
+
}) }), /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
2256
2414
|
onClick: () => e.talkToTeam(!1),
|
|
2257
2415
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2258
2416
|
className: "padorix:cursor-pointer padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2259
2417
|
children: a
|
|
2260
2418
|
}) })]
|
|
2261
2419
|
})
|
|
2262
|
-
] }) : /* @__PURE__ */
|
|
2263
|
-
/* @__PURE__ */
|
|
2420
|
+
] }) : /* @__PURE__ */ H(B, { children: [
|
|
2421
|
+
/* @__PURE__ */ H("div", {
|
|
2264
2422
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2265
2423
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2266
2424
|
children: [
|
|
2267
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2268
2426
|
className: "padorix:size-8",
|
|
2269
|
-
children: /* @__PURE__ */
|
|
2427
|
+
children: /* @__PURE__ */ H("div", {
|
|
2270
2428
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2271
2429
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2272
2430
|
children: [
|
|
2273
2431
|
" ",
|
|
2274
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ V(Ge, { className: "padorix:size-7" }),
|
|
2275
2433
|
" "
|
|
2276
2434
|
]
|
|
2277
2435
|
})
|
|
2278
2436
|
}) }),
|
|
2279
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2280
2438
|
className: "",
|
|
2281
2439
|
children: "Our Frequently asked questions"
|
|
2282
2440
|
}) }),
|
|
2283
|
-
/* @__PURE__ */
|
|
2441
|
+
/* @__PURE__ */ V("div", {
|
|
2284
2442
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2285
|
-
children: /* @__PURE__ */
|
|
2443
|
+
children: /* @__PURE__ */ V("div", {
|
|
2286
2444
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2287
2445
|
onClick: e.close,
|
|
2288
|
-
children: /* @__PURE__ */
|
|
2446
|
+
children: /* @__PURE__ */ V(F, {})
|
|
2289
2447
|
})
|
|
2290
2448
|
})
|
|
2291
2449
|
]
|
|
2292
2450
|
}),
|
|
2293
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ H("div", {
|
|
2294
2452
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2295
|
-
children: [!e.isOpen && /* @__PURE__ */
|
|
2453
|
+
children: [!e.isOpen && /* @__PURE__ */ V(bt, {}), t.map((e, t) => /* @__PURE__ */ H("div", {
|
|
2296
2454
|
onClick: () => o(e),
|
|
2297
2455
|
className: "padorix:p-2.5 padorix:flex padorix:items-center padorix:gap-2 padorix:transition-all padorix:cursor-pointer padorix:active:scale-95 padorix:border-b padorix:border-gray-200 padorix:last:border-0",
|
|
2298
|
-
children: [/* @__PURE__ */
|
|
2456
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2299
2457
|
className: "padorix:w-full",
|
|
2300
|
-
children: [/* @__PURE__ */
|
|
2458
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2301
2459
|
className: "padorix:font-semibold",
|
|
2302
2460
|
children: e.question
|
|
2303
|
-
}), /* @__PURE__ */
|
|
2461
|
+
}), /* @__PURE__ */ H("div", {
|
|
2304
2462
|
className: "padorix:text-sm padorix:text-gray-500",
|
|
2305
2463
|
children: [e.answer?.slice(0, 50), "..."]
|
|
2306
2464
|
})]
|
|
2307
|
-
}), /* @__PURE__ */
|
|
2465
|
+
}), /* @__PURE__ */ V(Oe, {})]
|
|
2308
2466
|
}, t))]
|
|
2309
2467
|
}),
|
|
2310
|
-
/* @__PURE__ */
|
|
2468
|
+
/* @__PURE__ */ V("div", {
|
|
2311
2469
|
className: "padorix:size-fit padorix:ml-auto padorix:p-2",
|
|
2312
|
-
children: /* @__PURE__ */
|
|
2470
|
+
children: /* @__PURE__ */ V("button", {
|
|
2313
2471
|
onClick: () => e.talkToTeam(!1),
|
|
2314
2472
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2315
2473
|
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",
|
|
@@ -2320,121 +2478,121 @@ function vt(e) {
|
|
|
2320
2478
|
}
|
|
2321
2479
|
//#endregion
|
|
2322
2480
|
//#region lib/chats/chatScreen/unavailable-form.tsx
|
|
2323
|
-
function
|
|
2324
|
-
let { workspace:
|
|
2481
|
+
function St(e) {
|
|
2482
|
+
let { workspace: n } = k((e) => e.data), [r, i] = A.useState(!1), [a, o] = A.useState({
|
|
2325
2483
|
status: "success",
|
|
2326
2484
|
message: ""
|
|
2327
|
-
}),
|
|
2485
|
+
}), s = fe({
|
|
2328
2486
|
mode: "uncontrolled",
|
|
2329
2487
|
initialValues: {
|
|
2330
|
-
workspaceId:
|
|
2488
|
+
workspaceId: n?.id ?? "",
|
|
2331
2489
|
name: "",
|
|
2332
2490
|
email: "",
|
|
2333
2491
|
message: ""
|
|
2334
2492
|
},
|
|
2335
2493
|
validate: {
|
|
2336
2494
|
name: (e) => e ? e.length <= 2 ? "Your name is expected to be more than 2 characters" : null : "Full name is required",
|
|
2337
|
-
email: (e) => e ?
|
|
2495
|
+
email: (e) => e ? gt(e) ? null : "Please enter a valid email address" : "Email address is required",
|
|
2338
2496
|
message: (e) => e ? null : "Enquiry content is required"
|
|
2339
2497
|
}
|
|
2340
2498
|
});
|
|
2341
|
-
async function
|
|
2499
|
+
async function c(e) {
|
|
2342
2500
|
try {
|
|
2343
|
-
|
|
2501
|
+
i(!0), o({
|
|
2344
2502
|
status: "success",
|
|
2345
|
-
message: (await
|
|
2346
|
-
endpoint:
|
|
2503
|
+
message: (await S({
|
|
2504
|
+
endpoint: t.inquiries.inquiries,
|
|
2347
2505
|
method: "POST",
|
|
2348
2506
|
data: e
|
|
2349
2507
|
})).message
|
|
2350
2508
|
});
|
|
2351
2509
|
} catch {
|
|
2352
|
-
|
|
2510
|
+
o({
|
|
2353
2511
|
status: "error",
|
|
2354
2512
|
message: "There was an error sending your message."
|
|
2355
2513
|
});
|
|
2356
2514
|
} finally {
|
|
2357
|
-
|
|
2515
|
+
s.reset(), i(!1), setTimeout(() => o({
|
|
2358
2516
|
status: "success",
|
|
2359
2517
|
message: ""
|
|
2360
2518
|
}), 3e3);
|
|
2361
2519
|
}
|
|
2362
2520
|
}
|
|
2363
|
-
return /* @__PURE__ */
|
|
2364
|
-
style: { background: String(
|
|
2521
|
+
return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("div", {
|
|
2522
|
+
style: { background: String(n?.widget?.colorScheme) },
|
|
2365
2523
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2366
2524
|
children: [
|
|
2367
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2368
2526
|
className: "padorix:size-8",
|
|
2369
|
-
children: /* @__PURE__ */
|
|
2370
|
-
style: { color: String(
|
|
2527
|
+
children: /* @__PURE__ */ H("div", {
|
|
2528
|
+
style: { color: String(n?.widget?.colorScheme) },
|
|
2371
2529
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2372
2530
|
children: [
|
|
2373
2531
|
" ",
|
|
2374
|
-
/* @__PURE__ */
|
|
2532
|
+
/* @__PURE__ */ V(Ke, { className: "padorix:size-5" }),
|
|
2375
2533
|
" "
|
|
2376
2534
|
]
|
|
2377
2535
|
})
|
|
2378
2536
|
}) }),
|
|
2379
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ H("div", {
|
|
2380
2538
|
className: "",
|
|
2381
|
-
children: [/* @__PURE__ */
|
|
2539
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2382
2540
|
className: "",
|
|
2383
2541
|
children: "Send us a message"
|
|
2384
|
-
}) }), /* @__PURE__ */
|
|
2542
|
+
}) }), /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2385
2543
|
className: "padorix:text-xs",
|
|
2386
2544
|
children: "Leave us a message and we'll reply via email."
|
|
2387
2545
|
}) })]
|
|
2388
2546
|
}),
|
|
2389
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ V("div", {
|
|
2390
2548
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2391
|
-
children: /* @__PURE__ */
|
|
2549
|
+
children: /* @__PURE__ */ V("div", {
|
|
2392
2550
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2393
2551
|
onClick: e.close,
|
|
2394
|
-
children: /* @__PURE__ */
|
|
2552
|
+
children: /* @__PURE__ */ V(F, {})
|
|
2395
2553
|
})
|
|
2396
2554
|
})
|
|
2397
2555
|
]
|
|
2398
|
-
}), /* @__PURE__ */
|
|
2556
|
+
}), /* @__PURE__ */ V("div", {
|
|
2399
2557
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2400
|
-
children: /* @__PURE__ */
|
|
2401
|
-
onSubmit:
|
|
2558
|
+
children: /* @__PURE__ */ H("form", {
|
|
2559
|
+
onSubmit: s.onSubmit(c),
|
|
2402
2560
|
children: [
|
|
2403
|
-
/* @__PURE__ */
|
|
2561
|
+
/* @__PURE__ */ V($, {
|
|
2404
2562
|
content: "Full name",
|
|
2405
2563
|
placeholder: "Enter your full name",
|
|
2406
|
-
error:
|
|
2407
|
-
...
|
|
2408
|
-
},
|
|
2409
|
-
/* @__PURE__ */
|
|
2564
|
+
error: s.errors.name?.toString() || "",
|
|
2565
|
+
...s.getInputProps("name")
|
|
2566
|
+
}, s.key("name")),
|
|
2567
|
+
/* @__PURE__ */ V($, {
|
|
2410
2568
|
content: "Email address",
|
|
2411
2569
|
placeholder: "name@example.com",
|
|
2412
|
-
error:
|
|
2413
|
-
...
|
|
2414
|
-
},
|
|
2415
|
-
/* @__PURE__ */
|
|
2570
|
+
error: s.errors.email?.toString() || "",
|
|
2571
|
+
...s.getInputProps("email")
|
|
2572
|
+
}, s.key("email")),
|
|
2573
|
+
/* @__PURE__ */ V($, {
|
|
2416
2574
|
content: "Message",
|
|
2417
2575
|
formtype: "textarea",
|
|
2418
|
-
error:
|
|
2419
|
-
...
|
|
2420
|
-
},
|
|
2421
|
-
|
|
2422
|
-
className: `padorix:mt-4 padorix:text-sm padorix:p-2 padorix:rounded-md ${
|
|
2423
|
-
children:
|
|
2576
|
+
error: s.errors.message?.toString() || "",
|
|
2577
|
+
...s.getInputProps("message")
|
|
2578
|
+
}, s.key("message")),
|
|
2579
|
+
a.message && /* @__PURE__ */ V("div", {
|
|
2580
|
+
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
|
+
children: a.message
|
|
2424
2582
|
}),
|
|
2425
|
-
/* @__PURE__ */
|
|
2583
|
+
/* @__PURE__ */ H("div", {
|
|
2426
2584
|
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2427
|
-
children: [/* @__PURE__ */
|
|
2585
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
2428
2586
|
type: "button",
|
|
2429
2587
|
onClick: e.backAction,
|
|
2430
2588
|
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2431
2589
|
children: "Back"
|
|
2432
|
-
}) }), /* @__PURE__ */
|
|
2590
|
+
}) }), /* @__PURE__ */ V(z, {
|
|
2433
2591
|
className: "padorix:w-full",
|
|
2434
|
-
children: /* @__PURE__ */
|
|
2435
|
-
disabled:
|
|
2436
|
-
style: { background:
|
|
2437
|
-
className: `${
|
|
2592
|
+
children: /* @__PURE__ */ V("button", {
|
|
2593
|
+
disabled: r,
|
|
2594
|
+
style: { background: r ? "#62748e" : String(n?.widget?.colorScheme) },
|
|
2595
|
+
className: `${r ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:w-full padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
2438
2596
|
children: "Submit message"
|
|
2439
2597
|
})
|
|
2440
2598
|
})]
|
|
@@ -2445,8 +2603,8 @@ function yt(e) {
|
|
|
2445
2603
|
}
|
|
2446
2604
|
//#endregion
|
|
2447
2605
|
//#region lib/chats/chatScreen/chat-lobby.tsx
|
|
2448
|
-
function
|
|
2449
|
-
let { sender: t, faqs: n, faqsLoaded: r, workspace: i } = k((e) => e.data), a = JSON.parse(localStorage.getItem("pdx-sess") || "null"), [o, s] = A.useState(!0), [c, l] = A.useState(!1), u =
|
|
2606
|
+
function Ct(e) {
|
|
2607
|
+
let { sender: t, faqs: n, faqsLoaded: r, workspace: i } = k((e) => e.data), a = JSON.parse(localStorage.getItem("pdx-sess") || "null"), [o, s] = A.useState(!0), [c, l] = A.useState(!1), u = _(i?.widget?.notifications?.showFaqBeforeConversation), d = b(i?.widget), f = !!(e.openOptions && Object.values(e.openOptions).some(Boolean));
|
|
2450
2608
|
function p(e) {
|
|
2451
2609
|
s(e), l(!d);
|
|
2452
2610
|
}
|
|
@@ -2456,38 +2614,38 @@ function bt(e) {
|
|
|
2456
2614
|
function h() {
|
|
2457
2615
|
s(!0);
|
|
2458
2616
|
}
|
|
2459
|
-
if (t?.conversationId && a?.conversationId) return /* @__PURE__ */
|
|
2460
|
-
if (!f && o && u && !r) return /* @__PURE__ */
|
|
2461
|
-
if (!f && o && u && n.length > 0) return /* @__PURE__ */
|
|
2617
|
+
if (t?.conversationId && a?.conversationId) return /* @__PURE__ */ V(pt, { ...e });
|
|
2618
|
+
if (!f && o && u && !r) return /* @__PURE__ */ V("div", { className: e.styles.container });
|
|
2619
|
+
if (!f && o && u && n.length > 0) return /* @__PURE__ */ V("div", {
|
|
2462
2620
|
className: e.styles.container,
|
|
2463
|
-
children: /* @__PURE__ */
|
|
2621
|
+
children: /* @__PURE__ */ V(xt, {
|
|
2464
2622
|
talkToTeam: p,
|
|
2465
2623
|
isOpen: d,
|
|
2466
2624
|
...e
|
|
2467
2625
|
})
|
|
2468
2626
|
});
|
|
2469
|
-
if (c) return /* @__PURE__ */
|
|
2627
|
+
if (c) return /* @__PURE__ */ V("div", {
|
|
2470
2628
|
className: e.styles.container,
|
|
2471
|
-
children: /* @__PURE__ */
|
|
2629
|
+
children: /* @__PURE__ */ V(St, {
|
|
2472
2630
|
close: e.close,
|
|
2473
2631
|
isOpen: d,
|
|
2474
2632
|
backAction: m
|
|
2475
2633
|
})
|
|
2476
2634
|
});
|
|
2477
|
-
if (!c) return /* @__PURE__ */
|
|
2635
|
+
if (!c) return /* @__PURE__ */ V(wt, {
|
|
2478
2636
|
openFaq: h,
|
|
2479
2637
|
...e
|
|
2480
2638
|
});
|
|
2481
2639
|
}
|
|
2482
|
-
function
|
|
2483
|
-
let { workspace: n, faqs: r } = k((e) => e.data), [i, a] = A.useState(t.openOptions ? 2 : 1), o =
|
|
2640
|
+
function wt({ openFaq: e, ...t }) {
|
|
2641
|
+
let { workspace: n, faqs: r } = k((e) => e.data), [i, a] = A.useState(t.openOptions ? 2 : 1), o = b(n?.widget), s = _(n?.widget?.notifications?.showFaqBeforeConversation) && r.length > 0, c = A.useMemo(() => n?.logo, [n]);
|
|
2484
2642
|
A.useEffect(() => {
|
|
2485
2643
|
a(t.openOptions ? 2 : 1);
|
|
2486
2644
|
}, [t.openRequestId]);
|
|
2487
2645
|
function l(e) {
|
|
2488
2646
|
a(e);
|
|
2489
2647
|
}
|
|
2490
|
-
if (i === 2) return /* @__PURE__ */
|
|
2648
|
+
if (i === 2) return /* @__PURE__ */ V(_t, {
|
|
2491
2649
|
close: t.close,
|
|
2492
2650
|
styles: t.styles,
|
|
2493
2651
|
changeScreen: l,
|
|
@@ -2496,23 +2654,23 @@ function xt({ openFaq: e, ...t }) {
|
|
|
2496
2654
|
openRequestId: t.openRequestId,
|
|
2497
2655
|
autoSubmitRequestId: t.autoSubmitRequestId
|
|
2498
2656
|
});
|
|
2499
|
-
if (i === 1) return /* @__PURE__ */
|
|
2657
|
+
if (i === 1) return /* @__PURE__ */ H("div", {
|
|
2500
2658
|
className: t.styles.container,
|
|
2501
|
-
children: [/* @__PURE__ */
|
|
2659
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2502
2660
|
style: {
|
|
2503
2661
|
background: String(n?.widget?.colorScheme),
|
|
2504
2662
|
color: n?.widget?.textColor || "#ffffff"
|
|
2505
2663
|
},
|
|
2506
2664
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2507
2665
|
children: [
|
|
2508
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2509
2667
|
className: "padorix:size-8",
|
|
2510
|
-
children: /* @__PURE__ */
|
|
2668
|
+
children: /* @__PURE__ */ H("div", {
|
|
2511
2669
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2512
2670
|
children: [
|
|
2513
2671
|
" ",
|
|
2514
|
-
/* @__PURE__ */
|
|
2515
|
-
src:
|
|
2672
|
+
/* @__PURE__ */ V("img", {
|
|
2673
|
+
src: mt,
|
|
2516
2674
|
alt: n?.name,
|
|
2517
2675
|
loading: "lazy",
|
|
2518
2676
|
className: "padorix:size-6"
|
|
@@ -2521,29 +2679,29 @@ function xt({ openFaq: e, ...t }) {
|
|
|
2521
2679
|
]
|
|
2522
2680
|
})
|
|
2523
2681
|
}) }),
|
|
2524
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2525
2683
|
className: "",
|
|
2526
2684
|
children: n?.widget?.widgetMessage
|
|
2527
2685
|
}) }),
|
|
2528
|
-
/* @__PURE__ */
|
|
2686
|
+
/* @__PURE__ */ V("div", {
|
|
2529
2687
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2530
|
-
children: /* @__PURE__ */
|
|
2688
|
+
children: /* @__PURE__ */ V("div", {
|
|
2531
2689
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2532
2690
|
onClick: t.close,
|
|
2533
|
-
children: /* @__PURE__ */
|
|
2691
|
+
children: /* @__PURE__ */ V(F, {})
|
|
2534
2692
|
})
|
|
2535
2693
|
})
|
|
2536
2694
|
]
|
|
2537
|
-
}), /* @__PURE__ */
|
|
2695
|
+
}), /* @__PURE__ */ V("div", {
|
|
2538
2696
|
className: "padorix:p-4 padorix:mt-5",
|
|
2539
|
-
children: /* @__PURE__ */
|
|
2697
|
+
children: /* @__PURE__ */ H("div", {
|
|
2540
2698
|
className: "padorix:flex padorix:flex-col padorix:items-center padorix:text-center padorix:h-full padorix:justify-center",
|
|
2541
2699
|
children: [
|
|
2542
|
-
/* @__PURE__ */
|
|
2700
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ H("div", {
|
|
2543
2701
|
className: "padorix:mb-3",
|
|
2544
2702
|
children: [
|
|
2545
2703
|
" ",
|
|
2546
|
-
/* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ V("img", {
|
|
2547
2705
|
src: c,
|
|
2548
2706
|
alt: n?.name,
|
|
2549
2707
|
loading: "lazy",
|
|
@@ -2552,33 +2710,33 @@ function xt({ openFaq: e, ...t }) {
|
|
|
2552
2710
|
" "
|
|
2553
2711
|
]
|
|
2554
2712
|
}) }),
|
|
2555
|
-
/* @__PURE__ */
|
|
2713
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2556
2714
|
className: "padorix:font-semibold",
|
|
2557
2715
|
children: n?.widget?.department
|
|
2558
2716
|
}) }),
|
|
2559
|
-
/* @__PURE__ */
|
|
2717
|
+
/* @__PURE__ */ H(z, { children: [/* @__PURE__ */ V("div", {
|
|
2560
2718
|
className: "padorix:mt-5",
|
|
2561
2719
|
children: n?.widget?.welcomeMessage || "Ask us anything - we will get back to you here or by email."
|
|
2562
|
-
}), !o && /* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2720
|
+
}), !o && /* @__PURE__ */ V(bt, {})] }),
|
|
2721
|
+
/* @__PURE__ */ H("div", {
|
|
2564
2722
|
className: "padorix:mt-10",
|
|
2565
|
-
children: [/* @__PURE__ */
|
|
2723
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("button", {
|
|
2566
2724
|
onClick: () => o && l(2),
|
|
2567
2725
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2568
2726
|
disabled: !o,
|
|
2569
2727
|
className: `padorix:text-white padorix:py-3 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:transition-all ${o ? "padorix:cursor-pointer padorix:hover:-translate-y-2 padorix:hover:shadow-md" : "padorix:cursor-not-allowed padorix:opacity-50"}`,
|
|
2570
2728
|
children: "Start new conversation"
|
|
2571
|
-
}) }), s && /* @__PURE__ */
|
|
2729
|
+
}) }), s && /* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2572
2730
|
onClick: () => e?.(),
|
|
2573
2731
|
className: "padorix:underline padorix:mt-5 padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2574
2732
|
children: "Frequently asked questions?"
|
|
2575
2733
|
}) })]
|
|
2576
2734
|
}),
|
|
2577
|
-
|
|
2735
|
+
_(n?.widget?.notifications?.displaySourceLogoOnWidget) && /* @__PURE__ */ V(z, { children: /* @__PURE__ */ H("div", {
|
|
2578
2736
|
className: "padorix:mt-10 padorix:grayscale-100 padorix:text-sm padorix:flex padorix:items-center padorix:justify-center padorix:text-zinc-500 padorix:gap-2",
|
|
2579
2737
|
children: [
|
|
2580
2738
|
" ",
|
|
2581
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ V("img", {
|
|
2582
2740
|
src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABPCAMAAAAjvDDpAAADAFBMVEVMaXEAQf8AVvsAVv8CVaoAV/0AVvwAVf8AAP8Af/8AVv4AVvwIf38AVvwAV/wAXuAA//8AP79jAAAAV/0AV/4AV/8AV/0AVv0EVe1vLQgOTcIRRaYEU+UAWP8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/oBdwb3yxHAse4poiQqd61IMJvvJL4J8LWyAb/Zi5Ivl1Oz1YNDCqLzgRgitXSSnpr+XDVoN7UKhy7ag2295kXTF4SgTajkI+6prkB2Ewt7ausfrA4Bth4Jdo1p4ZhlKE0NIRDxu5uBLd2kyeDuYUHdFmP7MwZhgrx/R9q8LLxy4cOHCK6NGHcpt5Lrzt6HXkhiCKDwEh/9u/wHzq1jxN2ehBgz8P+K/qzfIpxuSbGgAAAAASUVORK5CYII=",
|
|
2583
2741
|
alt: "padorix",
|
|
2584
2742
|
loading: "lazy",
|
|
@@ -2594,35 +2752,39 @@ function xt({ openFaq: e, ...t }) {
|
|
|
2594
2752
|
}
|
|
2595
2753
|
//#endregion
|
|
2596
2754
|
//#region lib/chats/chatScreen/styles.ts
|
|
2597
|
-
var
|
|
2755
|
+
var Tt = "", Et = {
|
|
2598
2756
|
visitor: {
|
|
2599
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",
|
|
2600
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",
|
|
2601
2759
|
height: "80dvh",
|
|
2602
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",
|
|
2603
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",
|
|
2604
|
-
emojiContainer: "padorix:fixed padorix:bottom-
|
|
2762
|
+
emojiContainer: "padorix:fixed padorix:bottom-20 padorix:left-4 padorix:z-30 padorix:md:left-auto padorix:md:right-6",
|
|
2605
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",
|
|
2606
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]",
|
|
2607
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",
|
|
2608
|
-
replyContainer: "padorix:relative padorix:w-full padorix:mb-1"
|
|
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]"
|
|
2609
2769
|
},
|
|
2610
2770
|
nonVisitor: {
|
|
2611
2771
|
container: "padorix:bg-[#fff] padorix:relative!",
|
|
2612
2772
|
height: "",
|
|
2613
2773
|
chatContainerPadding: "padorix:pt-5 padorix:pb-20 padorix:overflow-y-auto padorix:overflow-x-hidden padorix-scrolls padorix:relative",
|
|
2614
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",
|
|
2615
|
-
emojiContainer: "padorix:absolute padorix:bottom-
|
|
2616
|
-
formContainer: `padorix:border-t padorix:bg-white padorix:z-10 padorix:relative padorix:border-gray-200 padorix:bottom-0 padorix:left-0 padorix:w-full ${
|
|
2617
|
-
imageUploadContainer: `padorix:absolute padorix:
|
|
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}`,
|
|
2618
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",
|
|
2619
|
-
replyContainer: `padorix:relative padorix:w-full padorix:mb-1 ${
|
|
2779
|
+
replyContainer: `padorix:relative padorix:w-full padorix:mb-1 ${Tt}`,
|
|
2780
|
+
formRoot: "",
|
|
2781
|
+
imagePreviewBox: "padorix:flex-1 padorix:min-h-0"
|
|
2620
2782
|
}
|
|
2621
|
-
},
|
|
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";
|
|
2622
2784
|
//#endregion
|
|
2623
2785
|
//#region lib/chats/online-check/online-check.tsx
|
|
2624
|
-
function
|
|
2625
|
-
let t = e.userType === w.VISITOR ?
|
|
2786
|
+
function kt(e) {
|
|
2787
|
+
let t = e.userType === w.VISITOR ? Et.visitor : Et.nonVisitor, n = e.userType === w.VISITOR, [r, i] = A.useState(navigator.onLine);
|
|
2626
2788
|
return A.useEffect(() => {
|
|
2627
2789
|
let e = () => {
|
|
2628
2790
|
i(!0);
|
|
@@ -2632,19 +2794,19 @@ function Et(e) {
|
|
|
2632
2794
|
return window.addEventListener("online", e), window.addEventListener("offline", t), () => {
|
|
2633
2795
|
window.removeEventListener("online", e), window.removeEventListener("offline", t);
|
|
2634
2796
|
};
|
|
2635
|
-
}, []), r ? e.children : /* @__PURE__ */
|
|
2797
|
+
}, []), r ? e.children : /* @__PURE__ */ H("div", {
|
|
2636
2798
|
className: t.container,
|
|
2637
|
-
children: [/* @__PURE__ */
|
|
2799
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2638
2800
|
className: "padorix:px-3 padorix:py-5 padorix:bg-[#6c63ff] padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2639
2801
|
children: [
|
|
2640
|
-
/* @__PURE__ */
|
|
2802
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2641
2803
|
className: "padorix:size-8",
|
|
2642
|
-
children: /* @__PURE__ */
|
|
2804
|
+
children: /* @__PURE__ */ H("div", {
|
|
2643
2805
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2644
2806
|
children: [
|
|
2645
2807
|
" ",
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
src:
|
|
2808
|
+
/* @__PURE__ */ V("img", {
|
|
2809
|
+
src: Ot,
|
|
2648
2810
|
alt: "Padorix",
|
|
2649
2811
|
loading: "lazy",
|
|
2650
2812
|
className: "padorix:size-6"
|
|
@@ -2653,39 +2815,39 @@ function Et(e) {
|
|
|
2653
2815
|
]
|
|
2654
2816
|
})
|
|
2655
2817
|
}) }),
|
|
2656
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("div", {
|
|
2657
2819
|
className: "",
|
|
2658
2820
|
children: "Internet connected lost, try reconnecting your device network to proceed"
|
|
2659
2821
|
}) }),
|
|
2660
|
-
n && /* @__PURE__ */
|
|
2822
|
+
n && /* @__PURE__ */ V("div", {
|
|
2661
2823
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2662
|
-
children: /* @__PURE__ */
|
|
2824
|
+
children: /* @__PURE__ */ V("div", {
|
|
2663
2825
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2664
2826
|
onClick: e.close,
|
|
2665
|
-
children: /* @__PURE__ */
|
|
2827
|
+
children: /* @__PURE__ */ V(F, {})
|
|
2666
2828
|
})
|
|
2667
2829
|
})
|
|
2668
2830
|
]
|
|
2669
|
-
}), /* @__PURE__ */
|
|
2831
|
+
}), /* @__PURE__ */ H("div", {
|
|
2670
2832
|
className: "padorix:flex padorix:flex-col padorix:items-center padorix:justify-center padorix:h-full padorix:text-center",
|
|
2671
|
-
children: [/* @__PURE__ */
|
|
2672
|
-
src:
|
|
2833
|
+
children: [/* @__PURE__ */ V(z, { children: /* @__PURE__ */ V("img", {
|
|
2834
|
+
src: Dt,
|
|
2673
2835
|
alt: "",
|
|
2674
2836
|
className: ""
|
|
2675
|
-
}) }), /* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
2837
|
+
}) }), /* @__PURE__ */ H(z, { children: [
|
|
2838
|
+
/* @__PURE__ */ V("div", {
|
|
2677
2839
|
className: "padorix:text-2xl padorix:font-bold padorix:mt-10 padorix:mb-3",
|
|
2678
2840
|
children: "Oops!"
|
|
2679
2841
|
}),
|
|
2680
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ V("div", {
|
|
2681
2843
|
className: "padorix:text-base padorix:text-zinc-500",
|
|
2682
2844
|
children: "Your internet is disconnected"
|
|
2683
2845
|
}),
|
|
2684
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ H("div", {
|
|
2685
2847
|
className: "padorix:text-zinc-500 padorix:text-sm",
|
|
2686
2848
|
children: [
|
|
2687
2849
|
"Do not worry your chat sessions are saved ",
|
|
2688
|
-
/* @__PURE__ */
|
|
2850
|
+
/* @__PURE__ */ V("br", {}),
|
|
2689
2851
|
" till you are back online"
|
|
2690
2852
|
]
|
|
2691
2853
|
})
|
|
@@ -2695,57 +2857,57 @@ function Et(e) {
|
|
|
2695
2857
|
}
|
|
2696
2858
|
//#endregion
|
|
2697
2859
|
//#region lib/chats/chatScreen/chat-conversation.tsx
|
|
2698
|
-
function
|
|
2699
|
-
let
|
|
2860
|
+
function At(t) {
|
|
2861
|
+
let n = t.userType === w.VISITOR, r = O(), { workspace: o } = k((e) => e.data);
|
|
2700
2862
|
if (A.useEffect(() => {
|
|
2701
|
-
if (!
|
|
2702
|
-
|
|
2863
|
+
if (!n) {
|
|
2864
|
+
r(e(t.sender));
|
|
2703
2865
|
return;
|
|
2704
2866
|
}
|
|
2705
2867
|
try {
|
|
2706
|
-
let
|
|
2707
|
-
|
|
2868
|
+
let t = JSON.parse(localStorage.getItem("pdx-sess") ?? "null"), n = t?.expiresAt ? K().isAfter(t?.expiresAt) : !0;
|
|
2869
|
+
n && localStorage.removeItem(f), !n && t?.conversationId && r(e(t));
|
|
2708
2870
|
} catch (e) {
|
|
2709
2871
|
console.log(e);
|
|
2710
2872
|
}
|
|
2711
2873
|
}, [
|
|
2874
|
+
r,
|
|
2712
2875
|
n,
|
|
2713
|
-
t
|
|
2714
|
-
e.sender
|
|
2876
|
+
t.sender
|
|
2715
2877
|
]), A.useEffect(() => {
|
|
2716
|
-
if (!
|
|
2717
|
-
let
|
|
2718
|
-
return
|
|
2719
|
-
|
|
2878
|
+
if (!t.workspaceId) return;
|
|
2879
|
+
let e = !1;
|
|
2880
|
+
return d.config(t.workspaceId, t.userType).then((t) => {
|
|
2881
|
+
e || (r(i(t.workspace)), r(a(t.faqs)), r(h(t.tags)));
|
|
2720
2882
|
}).catch((e) => console.log(e.message, "error data")), () => {
|
|
2721
|
-
|
|
2883
|
+
e = !0;
|
|
2722
2884
|
};
|
|
2723
2885
|
}, [
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2886
|
+
r,
|
|
2887
|
+
t.userType,
|
|
2888
|
+
t.workspaceId
|
|
2727
2889
|
]), A.useEffect(() => {
|
|
2728
|
-
if (
|
|
2729
|
-
let
|
|
2730
|
-
return E.on(D.connected,
|
|
2731
|
-
E.off(D.connected,
|
|
2890
|
+
if (n || !t.workspaceId) return;
|
|
2891
|
+
let e = () => E.emit(D.subscribe_workspace, { workspaceId: t.workspaceId });
|
|
2892
|
+
return E.on(D.connected, e), te(!0), e(), () => {
|
|
2893
|
+
E.off(D.connected, e);
|
|
2732
2894
|
};
|
|
2733
|
-
}, [
|
|
2895
|
+
}, [n, t.workspaceId]), o?.id) return t.children;
|
|
2734
2896
|
}
|
|
2735
2897
|
//#endregion
|
|
2736
2898
|
//#region lib/chats/chatScreen/chat-panel.tsx
|
|
2737
|
-
function
|
|
2738
|
-
return /* @__PURE__ */
|
|
2899
|
+
function jt(e) {
|
|
2900
|
+
return /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V("div", {
|
|
2739
2901
|
"aria-hidden": !0,
|
|
2740
|
-
className:
|
|
2741
|
-
}), /* @__PURE__ */
|
|
2902
|
+
className: Et.visitor.backdrop
|
|
2903
|
+
}), /* @__PURE__ */ V(kt, {
|
|
2742
2904
|
...e,
|
|
2743
2905
|
close: e.close,
|
|
2744
|
-
children: /* @__PURE__ */
|
|
2906
|
+
children: /* @__PURE__ */ V(At, {
|
|
2745
2907
|
...e,
|
|
2746
|
-
children: /* @__PURE__ */
|
|
2908
|
+
children: /* @__PURE__ */ V(Ct, {
|
|
2747
2909
|
close: e.close,
|
|
2748
|
-
styles:
|
|
2910
|
+
styles: Et.visitor,
|
|
2749
2911
|
workspaceId: e.workspaceId,
|
|
2750
2912
|
moreActions: e.moreActions,
|
|
2751
2913
|
userType: e.userType,
|
|
@@ -2759,13 +2921,13 @@ function Ot(e) {
|
|
|
2759
2921
|
})
|
|
2760
2922
|
})] });
|
|
2761
2923
|
}
|
|
2762
|
-
function
|
|
2763
|
-
return /* @__PURE__ */
|
|
2924
|
+
function Mt(e) {
|
|
2925
|
+
return /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V(T, {}), /* @__PURE__ */ V(kt, {
|
|
2764
2926
|
...e,
|
|
2765
|
-
children: /* @__PURE__ */
|
|
2927
|
+
children: /* @__PURE__ */ V(At, {
|
|
2766
2928
|
...e,
|
|
2767
|
-
children: /* @__PURE__ */
|
|
2768
|
-
styles:
|
|
2929
|
+
children: /* @__PURE__ */ V(pt, {
|
|
2930
|
+
styles: Et.nonVisitor,
|
|
2769
2931
|
moreActions: e.moreActions,
|
|
2770
2932
|
userType: e.userType,
|
|
2771
2933
|
sender: e.sender,
|
|
@@ -2776,6 +2938,6 @@ function kt(e) {
|
|
|
2776
2938
|
})] });
|
|
2777
2939
|
}
|
|
2778
2940
|
//#endregion
|
|
2779
|
-
export {
|
|
2941
|
+
export { Mt as AgentChatPanel, jt as VisitorChatPanel };
|
|
2780
2942
|
|
|
2781
|
-
//# sourceMappingURL=chat-panel-
|
|
2943
|
+
//# sourceMappingURL=chat-panel-DOV89YL7.js.map
|