lulichat 1.0.7 → 1.0.8
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/lulichat-support.es.js +1156 -890
- package/dist/lulichat-support.umd.js +11 -10
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +94 -12
- package/package.json +4 -2
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
var St = Object.defineProperty;
|
|
2
|
+
var _t = (n, r, a) => r in n ? St(n, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[r] = a;
|
|
3
|
+
var q = (n, r, a) => _t(n, typeof r != "symbol" ? r + "" : r, a);
|
|
4
|
+
import g, { useRef as J, useCallback as Ue, useImperativeHandle as Tt, useState as W, useEffect as be } from "react";
|
|
5
|
+
import Nt from "socket.io-client";
|
|
6
|
+
import { marked as Ot } from "marked";
|
|
7
|
+
import Mt from "dompurify";
|
|
8
|
+
var je = { exports: {} }, te = {};
|
|
7
9
|
/**
|
|
8
10
|
* @license React
|
|
9
11
|
* react-jsx-runtime.production.min.js
|
|
@@ -13,21 +15,21 @@ var ue = { exports: {} }, J = {};
|
|
|
13
15
|
* This source code is licensed under the MIT license found in the
|
|
14
16
|
* LICENSE file in the root directory of this source tree.
|
|
15
17
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
var n =
|
|
21
|
-
function
|
|
22
|
-
var p, E = {},
|
|
23
|
-
|
|
24
|
-
for (p in u) i.call(u, p) && !
|
|
25
|
-
if (
|
|
26
|
-
return { $$typeof:
|
|
18
|
+
var He;
|
|
19
|
+
function Dt() {
|
|
20
|
+
if (He) return te;
|
|
21
|
+
He = 1;
|
|
22
|
+
var n = g, r = Symbol.for("react.element"), a = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
23
|
+
function h(f, u, b) {
|
|
24
|
+
var p, E = {}, m = null, _ = null;
|
|
25
|
+
b !== void 0 && (m = "" + b), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (_ = u.ref);
|
|
26
|
+
for (p in u) i.call(u, p) && !c.hasOwnProperty(p) && (E[p] = u[p]);
|
|
27
|
+
if (f && f.defaultProps) for (p in u = f.defaultProps, u) E[p] === void 0 && (E[p] = u[p]);
|
|
28
|
+
return { $$typeof: r, type: f, key: m, ref: _, props: E, _owner: l.current };
|
|
27
29
|
}
|
|
28
|
-
return
|
|
30
|
+
return te.Fragment = a, te.jsx = h, te.jsxs = h, te;
|
|
29
31
|
}
|
|
30
|
-
var
|
|
32
|
+
var re = {};
|
|
31
33
|
/**
|
|
32
34
|
* @license React
|
|
33
35
|
* react-jsx-runtime.development.js
|
|
@@ -37,91 +39,91 @@ var K = {};
|
|
|
37
39
|
* This source code is licensed under the MIT license found in the
|
|
38
40
|
* LICENSE file in the root directory of this source tree.
|
|
39
41
|
*/
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
return
|
|
43
|
-
var n =
|
|
44
|
-
function
|
|
42
|
+
var Ye;
|
|
43
|
+
function It() {
|
|
44
|
+
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
45
|
+
var n = g, r = Symbol.for("react.element"), a = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), f = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), S = Symbol.iterator, w = "@@iterator";
|
|
46
|
+
function R(e) {
|
|
45
47
|
if (e === null || typeof e != "object")
|
|
46
48
|
return null;
|
|
47
|
-
var
|
|
48
|
-
return typeof
|
|
49
|
+
var s = S && e[S] || e[w];
|
|
50
|
+
return typeof s == "function" ? s : null;
|
|
49
51
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
52
|
+
var T = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
|
+
function j(e) {
|
|
52
54
|
{
|
|
53
|
-
for (var
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
for (var s = arguments.length, o = new Array(s > 1 ? s - 1 : 0), d = 1; d < s; d++)
|
|
56
|
+
o[d - 1] = arguments[d];
|
|
57
|
+
X("error", e, o);
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
|
-
function
|
|
60
|
+
function X(e, s, o) {
|
|
59
61
|
{
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
return String(
|
|
62
|
+
var d = T.ReactDebugCurrentFrame, k = d.getStackAddendum();
|
|
63
|
+
k !== "" && (s += "%s", o = o.concat([k]));
|
|
64
|
+
var C = o.map(function(x) {
|
|
65
|
+
return String(x);
|
|
64
66
|
});
|
|
65
|
-
|
|
67
|
+
C.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, C);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === i || e ===
|
|
70
|
+
var D = !1, B = !1, Y = !1, z = !1, y = !1, I;
|
|
71
|
+
I = Symbol.for("react.module.reference");
|
|
72
|
+
function M(e) {
|
|
73
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === c || y || e === l || e === b || e === p || z || e === _ || D || B || Y || typeof e == "object" && e !== null && (e.$$typeof === m || e.$$typeof === E || e.$$typeof === h || e.$$typeof === f || e.$$typeof === u || // This needs to include all possible module reference object
|
|
72
74
|
// types supported by any Flight configuration anywhere since
|
|
73
75
|
// we don't know which Flight build this will end up being used
|
|
74
76
|
// with.
|
|
75
|
-
e.$$typeof ===
|
|
77
|
+
e.$$typeof === I || e.getModuleId !== void 0));
|
|
76
78
|
}
|
|
77
|
-
function
|
|
78
|
-
var
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
var
|
|
82
|
-
return
|
|
79
|
+
function $(e, s, o) {
|
|
80
|
+
var d = e.displayName;
|
|
81
|
+
if (d)
|
|
82
|
+
return d;
|
|
83
|
+
var k = s.displayName || s.name || "";
|
|
84
|
+
return k !== "" ? o + "(" + k + ")" : o;
|
|
83
85
|
}
|
|
84
|
-
function
|
|
86
|
+
function ne(e) {
|
|
85
87
|
return e.displayName || "Context";
|
|
86
88
|
}
|
|
87
|
-
function
|
|
89
|
+
function F(e) {
|
|
88
90
|
if (e == null)
|
|
89
91
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
92
|
+
if (typeof e.tag == "number" && j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
93
|
return e.displayName || e.name || null;
|
|
92
94
|
if (typeof e == "string")
|
|
93
95
|
return e;
|
|
94
96
|
switch (e) {
|
|
95
97
|
case i:
|
|
96
98
|
return "Fragment";
|
|
97
|
-
case
|
|
99
|
+
case a:
|
|
98
100
|
return "Portal";
|
|
99
|
-
case
|
|
101
|
+
case c:
|
|
100
102
|
return "Profiler";
|
|
101
|
-
case
|
|
103
|
+
case l:
|
|
102
104
|
return "StrictMode";
|
|
103
|
-
case
|
|
105
|
+
case b:
|
|
104
106
|
return "Suspense";
|
|
105
107
|
case p:
|
|
106
108
|
return "SuspenseList";
|
|
107
109
|
}
|
|
108
110
|
if (typeof e == "object")
|
|
109
111
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
111
|
-
var
|
|
112
|
-
return
|
|
113
|
-
case
|
|
114
|
-
var
|
|
115
|
-
return
|
|
112
|
+
case f:
|
|
113
|
+
var s = e;
|
|
114
|
+
return ne(s) + ".Consumer";
|
|
115
|
+
case h:
|
|
116
|
+
var o = e;
|
|
117
|
+
return ne(o._context) + ".Provider";
|
|
116
118
|
case u:
|
|
117
|
-
return
|
|
119
|
+
return $(e, e.render, "ForwardRef");
|
|
118
120
|
case E:
|
|
119
|
-
var
|
|
120
|
-
return
|
|
121
|
-
case
|
|
122
|
-
var
|
|
121
|
+
var d = e.displayName || null;
|
|
122
|
+
return d !== null ? d : F(e.type) || "Memo";
|
|
123
|
+
case m: {
|
|
124
|
+
var k = e, C = k._payload, x = k._init;
|
|
123
125
|
try {
|
|
124
|
-
return
|
|
126
|
+
return F(x(C));
|
|
125
127
|
} catch {
|
|
126
128
|
return null;
|
|
127
129
|
}
|
|
@@ -129,18 +131,18 @@ function Nt() {
|
|
|
129
131
|
}
|
|
130
132
|
return null;
|
|
131
133
|
}
|
|
132
|
-
var
|
|
133
|
-
function
|
|
134
|
+
var V = Object.assign, Q = 0, ke, we, Ce, Ee, Re, Se, _e;
|
|
135
|
+
function Te() {
|
|
134
136
|
}
|
|
135
|
-
|
|
136
|
-
function
|
|
137
|
+
Te.__reactDisabledLog = !0;
|
|
138
|
+
function et() {
|
|
137
139
|
{
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
+
if (Q === 0) {
|
|
141
|
+
ke = console.log, we = console.info, Ce = console.warn, Ee = console.error, Re = console.group, Se = console.groupCollapsed, _e = console.groupEnd;
|
|
140
142
|
var e = {
|
|
141
143
|
configurable: !0,
|
|
142
144
|
enumerable: !0,
|
|
143
|
-
value:
|
|
145
|
+
value: Te,
|
|
144
146
|
writable: !0
|
|
145
147
|
};
|
|
146
148
|
Object.defineProperties(console, {
|
|
@@ -153,332 +155,332 @@ function Nt() {
|
|
|
153
155
|
groupEnd: e
|
|
154
156
|
});
|
|
155
157
|
}
|
|
156
|
-
|
|
158
|
+
Q++;
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
|
-
function
|
|
161
|
+
function tt() {
|
|
160
162
|
{
|
|
161
|
-
if (
|
|
163
|
+
if (Q--, Q === 0) {
|
|
162
164
|
var e = {
|
|
163
165
|
configurable: !0,
|
|
164
166
|
enumerable: !0,
|
|
165
167
|
writable: !0
|
|
166
168
|
};
|
|
167
169
|
Object.defineProperties(console, {
|
|
168
|
-
log:
|
|
169
|
-
value:
|
|
170
|
+
log: V({}, e, {
|
|
171
|
+
value: ke
|
|
170
172
|
}),
|
|
171
|
-
info:
|
|
172
|
-
value:
|
|
173
|
+
info: V({}, e, {
|
|
174
|
+
value: we
|
|
173
175
|
}),
|
|
174
|
-
warn:
|
|
175
|
-
value:
|
|
176
|
+
warn: V({}, e, {
|
|
177
|
+
value: Ce
|
|
176
178
|
}),
|
|
177
|
-
error:
|
|
178
|
-
value:
|
|
179
|
+
error: V({}, e, {
|
|
180
|
+
value: Ee
|
|
179
181
|
}),
|
|
180
|
-
group:
|
|
181
|
-
value:
|
|
182
|
+
group: V({}, e, {
|
|
183
|
+
value: Re
|
|
182
184
|
}),
|
|
183
|
-
groupCollapsed:
|
|
184
|
-
value:
|
|
185
|
+
groupCollapsed: V({}, e, {
|
|
186
|
+
value: Se
|
|
185
187
|
}),
|
|
186
|
-
groupEnd:
|
|
187
|
-
value:
|
|
188
|
+
groupEnd: V({}, e, {
|
|
189
|
+
value: _e
|
|
188
190
|
})
|
|
189
191
|
});
|
|
190
192
|
}
|
|
191
|
-
|
|
193
|
+
Q < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
194
|
}
|
|
193
195
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
196
|
+
var de = T.ReactCurrentDispatcher, fe;
|
|
197
|
+
function ae(e, s, o) {
|
|
196
198
|
{
|
|
197
|
-
if (
|
|
199
|
+
if (fe === void 0)
|
|
198
200
|
try {
|
|
199
201
|
throw Error();
|
|
200
|
-
} catch (
|
|
201
|
-
var
|
|
202
|
-
|
|
202
|
+
} catch (k) {
|
|
203
|
+
var d = k.stack.trim().match(/\n( *(at )?)/);
|
|
204
|
+
fe = d && d[1] || "";
|
|
203
205
|
}
|
|
204
206
|
return `
|
|
205
|
-
` +
|
|
207
|
+
` + fe + e;
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
|
-
var
|
|
210
|
+
var he = !1, oe;
|
|
209
211
|
{
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
+
var rt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
+
oe = new rt();
|
|
212
214
|
}
|
|
213
|
-
function
|
|
214
|
-
if (!e ||
|
|
215
|
+
function Ne(e, s) {
|
|
216
|
+
if (!e || he)
|
|
215
217
|
return "";
|
|
216
218
|
{
|
|
217
|
-
var
|
|
218
|
-
if (
|
|
219
|
-
return
|
|
219
|
+
var o = oe.get(e);
|
|
220
|
+
if (o !== void 0)
|
|
221
|
+
return o;
|
|
220
222
|
}
|
|
221
|
-
var
|
|
222
|
-
|
|
223
|
-
var
|
|
223
|
+
var d;
|
|
224
|
+
he = !0;
|
|
225
|
+
var k = Error.prepareStackTrace;
|
|
224
226
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
227
|
+
var C;
|
|
228
|
+
C = de.current, de.current = null, et();
|
|
227
229
|
try {
|
|
228
|
-
if (
|
|
229
|
-
var
|
|
230
|
+
if (s) {
|
|
231
|
+
var x = function() {
|
|
230
232
|
throw Error();
|
|
231
233
|
};
|
|
232
|
-
if (Object.defineProperty(
|
|
234
|
+
if (Object.defineProperty(x.prototype, "props", {
|
|
233
235
|
set: function() {
|
|
234
236
|
throw Error();
|
|
235
237
|
}
|
|
236
238
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
239
|
try {
|
|
238
|
-
Reflect.construct(
|
|
239
|
-
} catch (
|
|
240
|
-
|
|
240
|
+
Reflect.construct(x, []);
|
|
241
|
+
} catch (P) {
|
|
242
|
+
d = P;
|
|
241
243
|
}
|
|
242
|
-
Reflect.construct(e, [],
|
|
244
|
+
Reflect.construct(e, [], x);
|
|
243
245
|
} else {
|
|
244
246
|
try {
|
|
245
|
-
|
|
246
|
-
} catch (
|
|
247
|
-
|
|
247
|
+
x.call();
|
|
248
|
+
} catch (P) {
|
|
249
|
+
d = P;
|
|
248
250
|
}
|
|
249
|
-
e.call(
|
|
251
|
+
e.call(x.prototype);
|
|
250
252
|
}
|
|
251
253
|
} else {
|
|
252
254
|
try {
|
|
253
255
|
throw Error();
|
|
254
|
-
} catch (
|
|
255
|
-
|
|
256
|
+
} catch (P) {
|
|
257
|
+
d = P;
|
|
256
258
|
}
|
|
257
259
|
e();
|
|
258
260
|
}
|
|
259
|
-
} catch (
|
|
260
|
-
if (
|
|
261
|
-
for (var
|
|
262
|
-
`),
|
|
263
|
-
`),
|
|
264
|
-
|
|
265
|
-
for (;
|
|
266
|
-
if (
|
|
267
|
-
if (
|
|
261
|
+
} catch (P) {
|
|
262
|
+
if (P && d && typeof P.stack == "string") {
|
|
263
|
+
for (var v = P.stack.split(`
|
|
264
|
+
`), L = d.stack.split(`
|
|
265
|
+
`), N = v.length - 1, O = L.length - 1; N >= 1 && O >= 0 && v[N] !== L[O]; )
|
|
266
|
+
O--;
|
|
267
|
+
for (; N >= 1 && O >= 0; N--, O--)
|
|
268
|
+
if (v[N] !== L[O]) {
|
|
269
|
+
if (N !== 1 || O !== 1)
|
|
268
270
|
do
|
|
269
|
-
if (
|
|
270
|
-
var
|
|
271
|
-
` +
|
|
272
|
-
return e.displayName &&
|
|
271
|
+
if (N--, O--, O < 0 || v[N] !== L[O]) {
|
|
272
|
+
var A = `
|
|
273
|
+
` + v[N].replace(" at new ", " at ");
|
|
274
|
+
return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && oe.set(e, A), A;
|
|
273
275
|
}
|
|
274
|
-
while (
|
|
276
|
+
while (N >= 1 && O >= 0);
|
|
275
277
|
break;
|
|
276
278
|
}
|
|
277
279
|
}
|
|
278
280
|
} finally {
|
|
279
|
-
|
|
281
|
+
he = !1, de.current = C, tt(), Error.prepareStackTrace = k;
|
|
280
282
|
}
|
|
281
|
-
var
|
|
282
|
-
return typeof e == "function" &&
|
|
283
|
+
var K = e ? e.displayName || e.name : "", H = K ? ae(K) : "";
|
|
284
|
+
return typeof e == "function" && oe.set(e, H), H;
|
|
283
285
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
286
|
+
function st(e, s, o) {
|
|
287
|
+
return Ne(e, !1);
|
|
286
288
|
}
|
|
287
|
-
function
|
|
288
|
-
var
|
|
289
|
-
return !!(
|
|
289
|
+
function nt(e) {
|
|
290
|
+
var s = e.prototype;
|
|
291
|
+
return !!(s && s.isReactComponent);
|
|
290
292
|
}
|
|
291
|
-
function
|
|
293
|
+
function ie(e, s, o) {
|
|
292
294
|
if (e == null)
|
|
293
295
|
return "";
|
|
294
296
|
if (typeof e == "function")
|
|
295
|
-
return
|
|
297
|
+
return Ne(e, nt(e));
|
|
296
298
|
if (typeof e == "string")
|
|
297
|
-
return
|
|
299
|
+
return ae(e);
|
|
298
300
|
switch (e) {
|
|
299
|
-
case
|
|
300
|
-
return
|
|
301
|
+
case b:
|
|
302
|
+
return ae("Suspense");
|
|
301
303
|
case p:
|
|
302
|
-
return
|
|
304
|
+
return ae("SuspenseList");
|
|
303
305
|
}
|
|
304
306
|
if (typeof e == "object")
|
|
305
307
|
switch (e.$$typeof) {
|
|
306
308
|
case u:
|
|
307
|
-
return
|
|
309
|
+
return st(e.render);
|
|
308
310
|
case E:
|
|
309
|
-
return
|
|
310
|
-
case
|
|
311
|
-
var
|
|
311
|
+
return ie(e.type, s, o);
|
|
312
|
+
case m: {
|
|
313
|
+
var d = e, k = d._payload, C = d._init;
|
|
312
314
|
try {
|
|
313
|
-
return
|
|
315
|
+
return ie(C(k), s, o);
|
|
314
316
|
} catch {
|
|
315
317
|
}
|
|
316
318
|
}
|
|
317
319
|
}
|
|
318
320
|
return "";
|
|
319
321
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
322
|
+
var ee = Object.prototype.hasOwnProperty, Oe = {}, Me = T.ReactDebugCurrentFrame;
|
|
323
|
+
function le(e) {
|
|
322
324
|
if (e) {
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
+
var s = e._owner, o = ie(e.type, e._source, s ? s.type : null);
|
|
326
|
+
Me.setExtraStackFrame(o);
|
|
325
327
|
} else
|
|
326
|
-
|
|
328
|
+
Me.setExtraStackFrame(null);
|
|
327
329
|
}
|
|
328
|
-
function
|
|
330
|
+
function at(e, s, o, d, k) {
|
|
329
331
|
{
|
|
330
|
-
var
|
|
331
|
-
for (var
|
|
332
|
-
if (
|
|
333
|
-
var
|
|
332
|
+
var C = Function.call.bind(ee);
|
|
333
|
+
for (var x in e)
|
|
334
|
+
if (C(e, x)) {
|
|
335
|
+
var v = void 0;
|
|
334
336
|
try {
|
|
335
|
-
if (typeof e[
|
|
336
|
-
var
|
|
337
|
-
throw
|
|
337
|
+
if (typeof e[x] != "function") {
|
|
338
|
+
var L = Error((d || "React class") + ": " + o + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
339
|
+
throw L.name = "Invariant Violation", L;
|
|
338
340
|
}
|
|
339
|
-
|
|
340
|
-
} catch (
|
|
341
|
-
|
|
341
|
+
v = e[x](s, x, d, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
|
+
} catch (N) {
|
|
343
|
+
v = N;
|
|
342
344
|
}
|
|
343
|
-
|
|
345
|
+
v && !(v instanceof Error) && (le(k), j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", o, x, typeof v), le(null)), v instanceof Error && !(v.message in Oe) && (Oe[v.message] = !0, le(k), j("Failed %s type: %s", o, v.message), le(null));
|
|
344
346
|
}
|
|
345
347
|
}
|
|
346
348
|
}
|
|
347
|
-
var
|
|
348
|
-
function
|
|
349
|
-
return
|
|
349
|
+
var ot = Array.isArray;
|
|
350
|
+
function me(e) {
|
|
351
|
+
return ot(e);
|
|
350
352
|
}
|
|
351
|
-
function
|
|
353
|
+
function it(e) {
|
|
352
354
|
{
|
|
353
|
-
var
|
|
354
|
-
return
|
|
355
|
+
var s = typeof Symbol == "function" && Symbol.toStringTag, o = s && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
356
|
+
return o;
|
|
355
357
|
}
|
|
356
358
|
}
|
|
357
|
-
function
|
|
359
|
+
function lt(e) {
|
|
358
360
|
try {
|
|
359
|
-
return
|
|
361
|
+
return De(e), !1;
|
|
360
362
|
} catch {
|
|
361
363
|
return !0;
|
|
362
364
|
}
|
|
363
365
|
}
|
|
364
|
-
function
|
|
366
|
+
function De(e) {
|
|
365
367
|
return "" + e;
|
|
366
368
|
}
|
|
367
|
-
function
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
369
|
+
function Ie(e) {
|
|
370
|
+
if (lt(e))
|
|
371
|
+
return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", it(e)), De(e);
|
|
370
372
|
}
|
|
371
|
-
var
|
|
373
|
+
var Fe = T.ReactCurrentOwner, ct = {
|
|
372
374
|
key: !0,
|
|
373
375
|
ref: !0,
|
|
374
376
|
__self: !0,
|
|
375
377
|
__source: !0
|
|
376
|
-
},
|
|
377
|
-
function
|
|
378
|
-
if (
|
|
379
|
-
var
|
|
380
|
-
if (
|
|
378
|
+
}, Le, Pe;
|
|
379
|
+
function ut(e) {
|
|
380
|
+
if (ee.call(e, "ref")) {
|
|
381
|
+
var s = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
382
|
+
if (s && s.isReactWarning)
|
|
381
383
|
return !1;
|
|
382
384
|
}
|
|
383
385
|
return e.ref !== void 0;
|
|
384
386
|
}
|
|
385
|
-
function
|
|
386
|
-
if (
|
|
387
|
-
var
|
|
388
|
-
if (
|
|
387
|
+
function dt(e) {
|
|
388
|
+
if (ee.call(e, "key")) {
|
|
389
|
+
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
390
|
+
if (s && s.isReactWarning)
|
|
389
391
|
return !1;
|
|
390
392
|
}
|
|
391
393
|
return e.key !== void 0;
|
|
392
394
|
}
|
|
393
|
-
function
|
|
394
|
-
typeof e.ref == "string" &&
|
|
395
|
+
function ft(e, s) {
|
|
396
|
+
typeof e.ref == "string" && Fe.current;
|
|
395
397
|
}
|
|
396
|
-
function
|
|
398
|
+
function ht(e, s) {
|
|
397
399
|
{
|
|
398
|
-
var
|
|
399
|
-
|
|
400
|
+
var o = function() {
|
|
401
|
+
Le || (Le = !0, j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
400
402
|
};
|
|
401
|
-
|
|
402
|
-
get:
|
|
403
|
+
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
404
|
+
get: o,
|
|
403
405
|
configurable: !0
|
|
404
406
|
});
|
|
405
407
|
}
|
|
406
408
|
}
|
|
407
|
-
function
|
|
409
|
+
function mt(e, s) {
|
|
408
410
|
{
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
+
var o = function() {
|
|
412
|
+
Pe || (Pe = !0, j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
411
413
|
};
|
|
412
|
-
|
|
413
|
-
get:
|
|
414
|
+
o.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
415
|
+
get: o,
|
|
414
416
|
configurable: !0
|
|
415
417
|
});
|
|
416
418
|
}
|
|
417
419
|
}
|
|
418
|
-
var
|
|
419
|
-
var
|
|
420
|
+
var gt = function(e, s, o, d, k, C, x) {
|
|
421
|
+
var v = {
|
|
420
422
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
|
-
$$typeof:
|
|
423
|
+
$$typeof: r,
|
|
422
424
|
// Built-in properties that belong on the element
|
|
423
425
|
type: e,
|
|
424
|
-
key:
|
|
425
|
-
ref:
|
|
426
|
-
props:
|
|
426
|
+
key: s,
|
|
427
|
+
ref: o,
|
|
428
|
+
props: x,
|
|
427
429
|
// Record the component responsible for creating this element.
|
|
428
|
-
_owner:
|
|
430
|
+
_owner: C
|
|
429
431
|
};
|
|
430
|
-
return
|
|
432
|
+
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
431
433
|
configurable: !1,
|
|
432
434
|
enumerable: !1,
|
|
433
435
|
writable: !0,
|
|
434
436
|
value: !1
|
|
435
|
-
}), Object.defineProperty(
|
|
437
|
+
}), Object.defineProperty(v, "_self", {
|
|
436
438
|
configurable: !1,
|
|
437
439
|
enumerable: !1,
|
|
438
440
|
writable: !1,
|
|
439
|
-
value:
|
|
440
|
-
}), Object.defineProperty(
|
|
441
|
+
value: d
|
|
442
|
+
}), Object.defineProperty(v, "_source", {
|
|
441
443
|
configurable: !1,
|
|
442
444
|
enumerable: !1,
|
|
443
445
|
writable: !1,
|
|
444
|
-
value:
|
|
445
|
-
}), Object.freeze && (Object.freeze(
|
|
446
|
+
value: k
|
|
447
|
+
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
446
448
|
};
|
|
447
|
-
function
|
|
449
|
+
function pt(e, s, o, d, k) {
|
|
448
450
|
{
|
|
449
|
-
var
|
|
450
|
-
|
|
451
|
-
for (
|
|
452
|
-
|
|
451
|
+
var C, x = {}, v = null, L = null;
|
|
452
|
+
o !== void 0 && (Ie(o), v = "" + o), dt(s) && (Ie(s.key), v = "" + s.key), ut(s) && (L = s.ref, ft(s, k));
|
|
453
|
+
for (C in s)
|
|
454
|
+
ee.call(s, C) && !ct.hasOwnProperty(C) && (x[C] = s[C]);
|
|
453
455
|
if (e && e.defaultProps) {
|
|
454
|
-
var
|
|
455
|
-
for (
|
|
456
|
-
|
|
456
|
+
var N = e.defaultProps;
|
|
457
|
+
for (C in N)
|
|
458
|
+
x[C] === void 0 && (x[C] = N[C]);
|
|
457
459
|
}
|
|
458
|
-
if (
|
|
459
|
-
var
|
|
460
|
-
|
|
460
|
+
if (v || L) {
|
|
461
|
+
var O = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
462
|
+
v && ht(x, O), L && mt(x, O);
|
|
461
463
|
}
|
|
462
|
-
return
|
|
464
|
+
return gt(e, v, L, k, d, Fe.current, x);
|
|
463
465
|
}
|
|
464
466
|
}
|
|
465
|
-
var
|
|
466
|
-
function
|
|
467
|
+
var ge = T.ReactCurrentOwner, Ae = T.ReactDebugCurrentFrame;
|
|
468
|
+
function U(e) {
|
|
467
469
|
if (e) {
|
|
468
|
-
var
|
|
469
|
-
|
|
470
|
+
var s = e._owner, o = ie(e.type, e._source, s ? s.type : null);
|
|
471
|
+
Ae.setExtraStackFrame(o);
|
|
470
472
|
} else
|
|
471
|
-
|
|
473
|
+
Ae.setExtraStackFrame(null);
|
|
472
474
|
}
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
function
|
|
476
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
475
|
+
var pe;
|
|
476
|
+
pe = !1;
|
|
477
|
+
function ve(e) {
|
|
478
|
+
return typeof e == "object" && e !== null && e.$$typeof === r;
|
|
477
479
|
}
|
|
478
|
-
function
|
|
480
|
+
function qe() {
|
|
479
481
|
{
|
|
480
|
-
if (
|
|
481
|
-
var e =
|
|
482
|
+
if (ge.current) {
|
|
483
|
+
var e = F(ge.current.type);
|
|
482
484
|
if (e)
|
|
483
485
|
return `
|
|
484
486
|
|
|
@@ -487,288 +489,380 @@ Check the render method of \`` + e + "`.";
|
|
|
487
489
|
return "";
|
|
488
490
|
}
|
|
489
491
|
}
|
|
490
|
-
function
|
|
492
|
+
function vt(e) {
|
|
491
493
|
return "";
|
|
492
494
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
495
|
+
var $e = {};
|
|
496
|
+
function yt(e) {
|
|
495
497
|
{
|
|
496
|
-
var
|
|
497
|
-
if (!
|
|
498
|
-
var
|
|
499
|
-
|
|
498
|
+
var s = qe();
|
|
499
|
+
if (!s) {
|
|
500
|
+
var o = typeof e == "string" ? e : e.displayName || e.name;
|
|
501
|
+
o && (s = `
|
|
500
502
|
|
|
501
|
-
Check the top-level render call using <` +
|
|
503
|
+
Check the top-level render call using <` + o + ">.");
|
|
502
504
|
}
|
|
503
|
-
return
|
|
505
|
+
return s;
|
|
504
506
|
}
|
|
505
507
|
}
|
|
506
|
-
function
|
|
508
|
+
function We(e, s) {
|
|
507
509
|
{
|
|
508
510
|
if (!e._store || e._store.validated || e.key != null)
|
|
509
511
|
return;
|
|
510
512
|
e._store.validated = !0;
|
|
511
|
-
var
|
|
512
|
-
if (
|
|
513
|
+
var o = yt(s);
|
|
514
|
+
if ($e[o])
|
|
513
515
|
return;
|
|
514
|
-
|
|
515
|
-
var
|
|
516
|
-
e && e._owner && e._owner !==
|
|
516
|
+
$e[o] = !0;
|
|
517
|
+
var d = "";
|
|
518
|
+
e && e._owner && e._owner !== ge.current && (d = " It was passed a child from " + F(e._owner.type) + "."), U(e), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, d), U(null);
|
|
517
519
|
}
|
|
518
520
|
}
|
|
519
|
-
function
|
|
521
|
+
function Be(e, s) {
|
|
520
522
|
{
|
|
521
523
|
if (typeof e != "object")
|
|
522
524
|
return;
|
|
523
|
-
if (
|
|
524
|
-
for (var
|
|
525
|
-
var
|
|
526
|
-
|
|
525
|
+
if (me(e))
|
|
526
|
+
for (var o = 0; o < e.length; o++) {
|
|
527
|
+
var d = e[o];
|
|
528
|
+
ve(d) && We(d, s);
|
|
527
529
|
}
|
|
528
|
-
else if (
|
|
530
|
+
else if (ve(e))
|
|
529
531
|
e._store && (e._store.validated = !0);
|
|
530
532
|
else if (e) {
|
|
531
|
-
var
|
|
532
|
-
if (typeof
|
|
533
|
-
for (var
|
|
534
|
-
|
|
533
|
+
var k = R(e);
|
|
534
|
+
if (typeof k == "function" && k !== e.entries)
|
|
535
|
+
for (var C = k.call(e), x; !(x = C.next()).done; )
|
|
536
|
+
ve(x.value) && We(x.value, s);
|
|
535
537
|
}
|
|
536
538
|
}
|
|
537
539
|
}
|
|
538
|
-
function
|
|
540
|
+
function xt(e) {
|
|
539
541
|
{
|
|
540
|
-
var
|
|
541
|
-
if (
|
|
542
|
+
var s = e.type;
|
|
543
|
+
if (s == null || typeof s == "string")
|
|
542
544
|
return;
|
|
543
|
-
var
|
|
544
|
-
if (typeof
|
|
545
|
-
|
|
546
|
-
else if (typeof
|
|
545
|
+
var o;
|
|
546
|
+
if (typeof s == "function")
|
|
547
|
+
o = s.propTypes;
|
|
548
|
+
else if (typeof s == "object" && (s.$$typeof === u || // Note: Memo only checks outer props here.
|
|
547
549
|
// Inner props are checked in the reconciler.
|
|
548
|
-
|
|
549
|
-
|
|
550
|
+
s.$$typeof === E))
|
|
551
|
+
o = s.propTypes;
|
|
550
552
|
else
|
|
551
553
|
return;
|
|
552
|
-
if (
|
|
553
|
-
var
|
|
554
|
-
|
|
555
|
-
} else if (
|
|
556
|
-
|
|
557
|
-
var
|
|
558
|
-
|
|
554
|
+
if (o) {
|
|
555
|
+
var d = F(s);
|
|
556
|
+
at(o, e.props, "prop", d, e);
|
|
557
|
+
} else if (s.PropTypes !== void 0 && !pe) {
|
|
558
|
+
pe = !0;
|
|
559
|
+
var k = F(s);
|
|
560
|
+
j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
|
|
559
561
|
}
|
|
560
|
-
typeof
|
|
562
|
+
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
563
|
}
|
|
562
564
|
}
|
|
563
|
-
function
|
|
565
|
+
function bt(e) {
|
|
564
566
|
{
|
|
565
|
-
for (var
|
|
566
|
-
var
|
|
567
|
-
if (
|
|
568
|
-
|
|
567
|
+
for (var s = Object.keys(e.props), o = 0; o < s.length; o++) {
|
|
568
|
+
var d = s[o];
|
|
569
|
+
if (d !== "children" && d !== "key") {
|
|
570
|
+
U(e), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), U(null);
|
|
569
571
|
break;
|
|
570
572
|
}
|
|
571
573
|
}
|
|
572
|
-
e.ref !== null && (
|
|
574
|
+
e.ref !== null && (U(e), j("Invalid attribute `ref` supplied to `React.Fragment`."), U(null));
|
|
573
575
|
}
|
|
574
576
|
}
|
|
575
|
-
var
|
|
576
|
-
function
|
|
577
|
+
var ze = {};
|
|
578
|
+
function Ve(e, s, o, d, k, C) {
|
|
577
579
|
{
|
|
578
|
-
var
|
|
579
|
-
if (!
|
|
580
|
-
var
|
|
581
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
582
|
-
var
|
|
583
|
-
|
|
584
|
-
var
|
|
585
|
-
e === null ?
|
|
580
|
+
var x = M(e);
|
|
581
|
+
if (!x) {
|
|
582
|
+
var v = "";
|
|
583
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
584
|
+
var L = vt();
|
|
585
|
+
L ? v += L : v += qe();
|
|
586
|
+
var N;
|
|
587
|
+
e === null ? N = "null" : me(e) ? N = "array" : e !== void 0 && e.$$typeof === r ? (N = "<" + (F(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, v);
|
|
586
588
|
}
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
590
|
-
if (
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
593
|
-
if (
|
|
594
|
-
if (
|
|
595
|
-
for (var
|
|
596
|
-
|
|
597
|
-
Object.freeze && Object.freeze(
|
|
589
|
+
var O = pt(e, s, o, k, C);
|
|
590
|
+
if (O == null)
|
|
591
|
+
return O;
|
|
592
|
+
if (x) {
|
|
593
|
+
var A = s.children;
|
|
594
|
+
if (A !== void 0)
|
|
595
|
+
if (d)
|
|
596
|
+
if (me(A)) {
|
|
597
|
+
for (var K = 0; K < A.length; K++)
|
|
598
|
+
Be(A[K], e);
|
|
599
|
+
Object.freeze && Object.freeze(A);
|
|
598
600
|
} else
|
|
599
|
-
|
|
601
|
+
j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
602
|
else
|
|
601
|
-
|
|
603
|
+
Be(A, e);
|
|
602
604
|
}
|
|
603
|
-
if (
|
|
604
|
-
var
|
|
605
|
-
return
|
|
606
|
-
}),
|
|
607
|
-
if (!
|
|
608
|
-
var
|
|
609
|
-
|
|
605
|
+
if (ee.call(s, "key")) {
|
|
606
|
+
var H = F(e), P = Object.keys(s).filter(function(Rt) {
|
|
607
|
+
return Rt !== "key";
|
|
608
|
+
}), ye = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
609
|
+
if (!ze[H + ye]) {
|
|
610
|
+
var Et = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
|
|
611
|
+
j(`A props object containing a "key" prop is being spread into JSX:
|
|
610
612
|
let props = %s;
|
|
611
613
|
<%s {...props} />
|
|
612
614
|
React keys must be passed directly to JSX without using spread:
|
|
613
615
|
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`,
|
|
616
|
+
<%s key={someKey} {...props} />`, ye, H, Et, H), ze[H + ye] = !0;
|
|
615
617
|
}
|
|
616
618
|
}
|
|
617
|
-
return e === i ?
|
|
619
|
+
return e === i ? bt(O) : xt(O), O;
|
|
618
620
|
}
|
|
619
621
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
622
|
+
function jt(e, s, o) {
|
|
623
|
+
return Ve(e, s, o, !0);
|
|
622
624
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
625
|
+
function kt(e, s, o) {
|
|
626
|
+
return Ve(e, s, o, !1);
|
|
625
627
|
}
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
}()),
|
|
628
|
+
var wt = kt, Ct = jt;
|
|
629
|
+
re.Fragment = i, re.jsx = wt, re.jsxs = Ct;
|
|
630
|
+
}()), re;
|
|
629
631
|
}
|
|
630
|
-
process.env.NODE_ENV === "production" ?
|
|
631
|
-
var t =
|
|
632
|
-
class
|
|
633
|
-
constructor(
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
this
|
|
632
|
+
process.env.NODE_ENV === "production" ? je.exports = Dt() : je.exports = It();
|
|
633
|
+
var t = je.exports;
|
|
634
|
+
class Ft {
|
|
635
|
+
constructor(r) {
|
|
636
|
+
q(this, "config");
|
|
637
|
+
q(this, "baseUrl");
|
|
638
|
+
q(this, "abortControllers", {});
|
|
639
|
+
this.config = r, this.baseUrl = r.baseUrl || "https://api.lulichat.com";
|
|
637
640
|
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
headers: {
|
|
642
|
-
Authorization: `Bearer ${this.config.apiKey}`,
|
|
643
|
-
"Content-Type": "application/json"
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
if (!s.ok)
|
|
647
|
-
throw new Error(`HTTP error! status: ${s.status}`);
|
|
648
|
-
return await s.json();
|
|
649
|
-
} catch (s) {
|
|
650
|
-
throw console.error("Failed to fetch company info:", s), s;
|
|
651
|
-
}
|
|
641
|
+
abort(r) {
|
|
642
|
+
var a;
|
|
643
|
+
(a = this.abortControllers[r]) == null || a.abort();
|
|
652
644
|
}
|
|
653
|
-
|
|
645
|
+
useRequest() {
|
|
646
|
+
const [r, a] = g.useState(!1), [i, l] = g.useState("");
|
|
647
|
+
let c;
|
|
648
|
+
return { loading: r, error: i, getOptions: async (f) => {
|
|
649
|
+
try {
|
|
650
|
+
c && this.abort(c), c = (Math.random() * 9999999999).toString(16), a(!0);
|
|
651
|
+
const u = await this.getOptions(f, c);
|
|
652
|
+
return a(!1), u;
|
|
653
|
+
} catch (u) {
|
|
654
|
+
l(u.message || "Error getting options");
|
|
655
|
+
} finally {
|
|
656
|
+
}
|
|
657
|
+
}, setLoading: a };
|
|
658
|
+
}
|
|
659
|
+
async request(r, a = {}) {
|
|
660
|
+
const { body: i, headers: l, key: c } = a;
|
|
654
661
|
try {
|
|
655
|
-
const
|
|
656
|
-
|
|
662
|
+
const h = new AbortController();
|
|
663
|
+
c && (this.abortControllers[c] = h);
|
|
664
|
+
const f = await fetch(`${this.baseUrl}${r}`, {
|
|
665
|
+
body: i ? JSON.stringify(i) : void 0,
|
|
666
|
+
method: i ? "POST" : "GET",
|
|
657
667
|
headers: {
|
|
658
668
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
659
|
-
"Content-Type": "application/json"
|
|
669
|
+
"Content-Type": "application/json",
|
|
670
|
+
...l
|
|
660
671
|
},
|
|
661
|
-
|
|
672
|
+
signal: h.signal
|
|
662
673
|
});
|
|
663
|
-
if (!
|
|
664
|
-
throw new Error(`HTTP error! status: ${
|
|
665
|
-
return await
|
|
666
|
-
} catch (
|
|
667
|
-
throw console.error("Failed to
|
|
674
|
+
if (!f.ok)
|
|
675
|
+
throw new Error(`HTTP error! status: ${f.status}`);
|
|
676
|
+
return await f.json();
|
|
677
|
+
} catch (h) {
|
|
678
|
+
throw console.error("Failed to fetch company info:", h), h;
|
|
668
679
|
}
|
|
669
680
|
}
|
|
670
|
-
async
|
|
671
|
-
return this.
|
|
681
|
+
async getCompanyInfo() {
|
|
682
|
+
return this.request("/companies/e/info");
|
|
683
|
+
}
|
|
684
|
+
async getOptions(r, a) {
|
|
685
|
+
const i = Object.keys(r).reduce((l, c) => (l.push(`${c}=${r[c]}`), l), []).join("&");
|
|
686
|
+
return this.request("/queue-options/external?" + i, { key: a });
|
|
687
|
+
}
|
|
688
|
+
async submitContactInfo(r, a) {
|
|
689
|
+
return this.request("/help/create-ticket/external", {
|
|
690
|
+
body: r,
|
|
691
|
+
key: a
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
async getTicketMessages(r, a = 1) {
|
|
695
|
+
return this.request(`/messages/${r}/external?pageNumber=${a}`);
|
|
696
|
+
}
|
|
697
|
+
async getSession(r) {
|
|
698
|
+
return this.request(`/help/${r}/session`);
|
|
672
699
|
}
|
|
673
700
|
}
|
|
674
|
-
function
|
|
675
|
-
return
|
|
701
|
+
function se(...n) {
|
|
702
|
+
return n.filter(Boolean).map((r) => r == null ? void 0 : r.toString().trim()).join(" ");
|
|
676
703
|
}
|
|
677
|
-
|
|
678
|
-
(n
|
|
704
|
+
function Ke(n = 32) {
|
|
705
|
+
return Array.from(crypto.getRandomValues(new Uint8Array(n))).map((r) => r.toString(36)).join("").slice(0, n);
|
|
706
|
+
}
|
|
707
|
+
function Lt(n, r) {
|
|
708
|
+
const a = /* @__PURE__ */ new Set(), i = [];
|
|
709
|
+
for (const l of n) {
|
|
710
|
+
const c = r(l);
|
|
711
|
+
a.has(c) || (a.add(c), i.push(l));
|
|
712
|
+
}
|
|
713
|
+
return i;
|
|
714
|
+
}
|
|
715
|
+
const ce = g.forwardRef(
|
|
716
|
+
(n, r) => /* @__PURE__ */ t.jsx(
|
|
679
717
|
"input",
|
|
680
718
|
{
|
|
681
719
|
...n,
|
|
682
720
|
autoComplete: n.autoComplete || n.name || "off",
|
|
683
|
-
ref:
|
|
684
|
-
className:
|
|
721
|
+
ref: r,
|
|
722
|
+
className: se("lulichat-input", n.className)
|
|
685
723
|
}
|
|
686
724
|
)
|
|
687
725
|
);
|
|
688
|
-
|
|
689
|
-
(n,
|
|
726
|
+
g.forwardRef(
|
|
727
|
+
(n, r) => /* @__PURE__ */ t.jsx("input", { className: "", ...n, ref: r })
|
|
690
728
|
);
|
|
691
|
-
const
|
|
729
|
+
const Ge = g.createContext(
|
|
692
730
|
void 0
|
|
693
|
-
),
|
|
694
|
-
({ children: n, onValuesChange:
|
|
695
|
-
const
|
|
696
|
-
(
|
|
697
|
-
|
|
731
|
+
), G = g.forwardRef(
|
|
732
|
+
({ children: n, onValuesChange: r, initialValues: a, ...i }, l) => {
|
|
733
|
+
const c = J(a || {}), h = J(null), f = Ue(
|
|
734
|
+
(b, p) => {
|
|
735
|
+
c.current[b] = p, r && r({ ...c.current });
|
|
698
736
|
},
|
|
699
|
-
[
|
|
737
|
+
[r]
|
|
700
738
|
), u = {
|
|
701
|
-
getValues: () =>
|
|
702
|
-
getFieldValue: (
|
|
739
|
+
getValues: () => c.current,
|
|
740
|
+
getFieldValue: (b) => {
|
|
703
741
|
var p;
|
|
704
|
-
return (p =
|
|
742
|
+
return (p = c.current) == null ? void 0 : p[b];
|
|
705
743
|
},
|
|
706
|
-
elementRef: () =>
|
|
707
|
-
setFieldValue:
|
|
744
|
+
elementRef: () => h.current,
|
|
745
|
+
setFieldValue: f
|
|
708
746
|
};
|
|
709
|
-
return
|
|
747
|
+
return Tt(l, () => u), /* @__PURE__ */ t.jsx(Ge.Provider, { value: u, children: /* @__PURE__ */ t.jsx("form", { ...i, ref: h, onSubmit: i.onSubmit, children: n }) });
|
|
710
748
|
}
|
|
711
|
-
),
|
|
712
|
-
({ name: n, children:
|
|
713
|
-
const
|
|
714
|
-
var
|
|
715
|
-
|
|
716
|
-
},
|
|
717
|
-
if (
|
|
718
|
-
let
|
|
719
|
-
return
|
|
720
|
-
...
|
|
749
|
+
), Pt = g.forwardRef(
|
|
750
|
+
({ name: n, children: r, ...a }, i) => {
|
|
751
|
+
const l = g.useContext(Ge), c = function(u) {
|
|
752
|
+
var b, p;
|
|
753
|
+
l && n && l.setFieldValue(n, u.target.value), (p = (b = this.props).onChange) == null || p.call(b, u);
|
|
754
|
+
}, h = g.Children.map(r, (u) => {
|
|
755
|
+
if (g.isValidElement(u) && n && u.type === ce) {
|
|
756
|
+
let b = u;
|
|
757
|
+
return g.cloneElement(b, {
|
|
758
|
+
...b.props,
|
|
721
759
|
name: n,
|
|
722
|
-
value: (
|
|
723
|
-
onChange:
|
|
724
|
-
required:
|
|
760
|
+
value: (l == null ? void 0 : l.getFieldValue(n)) ?? "",
|
|
761
|
+
onChange: c.bind(b),
|
|
762
|
+
required: a.required
|
|
725
763
|
});
|
|
726
764
|
}
|
|
727
765
|
return u;
|
|
728
|
-
}),
|
|
729
|
-
return delete
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
766
|
+
}), f = Object.create(a);
|
|
767
|
+
return delete f.required, delete f.label, /* @__PURE__ */ t.jsxs("div", { className: "lulichat-form-item", ref: i, ...f, children: [
|
|
768
|
+
a.label && /* @__PURE__ */ t.jsx(Je, { htmlFor: n, required: a.required, children: a.label }),
|
|
769
|
+
h,
|
|
770
|
+
a.error && /* @__PURE__ */ t.jsx("p", { className: "error", children: a.error })
|
|
733
771
|
] });
|
|
734
772
|
}
|
|
735
|
-
),
|
|
736
|
-
(n,
|
|
737
|
-
const
|
|
773
|
+
), Je = g.forwardRef(
|
|
774
|
+
(n, r) => {
|
|
775
|
+
const a = n.required, i = n.children;
|
|
738
776
|
return /* @__PURE__ */ t.jsxs(
|
|
739
777
|
"label",
|
|
740
778
|
{
|
|
741
779
|
...n,
|
|
742
|
-
className:
|
|
743
|
-
ref:
|
|
780
|
+
className: se("lulichat-form-label", n.className),
|
|
781
|
+
ref: r,
|
|
744
782
|
children: [
|
|
745
783
|
i,
|
|
746
|
-
|
|
784
|
+
a && /* @__PURE__ */ t.jsx("b", { style: { color: "red" }, children: "*" })
|
|
747
785
|
]
|
|
748
786
|
}
|
|
749
787
|
);
|
|
750
788
|
}
|
|
751
|
-
),
|
|
752
|
-
const
|
|
753
|
-
(
|
|
754
|
-
|
|
789
|
+
), At = (n) => {
|
|
790
|
+
const r = J(n || {}), a = J(null), i = Ue(
|
|
791
|
+
(c, h) => {
|
|
792
|
+
r.current[c] = h;
|
|
755
793
|
},
|
|
756
794
|
[]
|
|
757
795
|
);
|
|
758
796
|
return [{
|
|
759
|
-
getValues: () =>
|
|
760
|
-
getFieldValue: (
|
|
761
|
-
var
|
|
762
|
-
return (
|
|
797
|
+
getValues: () => r.current,
|
|
798
|
+
getFieldValue: (c) => {
|
|
799
|
+
var h;
|
|
800
|
+
return (h = r.current) == null ? void 0 : h[c];
|
|
763
801
|
},
|
|
764
|
-
elementRef: () =>
|
|
802
|
+
elementRef: () => a.current,
|
|
765
803
|
setFieldValue: i
|
|
766
804
|
}];
|
|
767
805
|
};
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
const
|
|
806
|
+
G.Item = Pt;
|
|
807
|
+
G.Label = Je;
|
|
808
|
+
G.useForm = At;
|
|
809
|
+
const qt = (n) => /* @__PURE__ */ t.jsx(
|
|
810
|
+
"svg",
|
|
811
|
+
{
|
|
812
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
813
|
+
width: "48",
|
|
814
|
+
height: "48",
|
|
815
|
+
viewBox: "0 0 24 24",
|
|
816
|
+
...n,
|
|
817
|
+
children: /* @__PURE__ */ t.jsxs(
|
|
818
|
+
"g",
|
|
819
|
+
{
|
|
820
|
+
fill: "none",
|
|
821
|
+
stroke: "currentColor",
|
|
822
|
+
strokeLinecap: "round",
|
|
823
|
+
strokeLinejoin: "round",
|
|
824
|
+
strokeWidth: "2",
|
|
825
|
+
children: [
|
|
826
|
+
/* @__PURE__ */ t.jsx(
|
|
827
|
+
"path",
|
|
828
|
+
{
|
|
829
|
+
strokeDasharray: "14",
|
|
830
|
+
strokeDashoffset: "14",
|
|
831
|
+
d: "M15 7h-11.5M9 17h11.5",
|
|
832
|
+
children: /* @__PURE__ */ t.jsx(
|
|
833
|
+
"animate",
|
|
834
|
+
{
|
|
835
|
+
fill: "freeze",
|
|
836
|
+
attributeName: "stroke-dashoffset",
|
|
837
|
+
dur: "0.3s",
|
|
838
|
+
values: "14;0"
|
|
839
|
+
}
|
|
840
|
+
)
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
/* @__PURE__ */ t.jsx(
|
|
844
|
+
"path",
|
|
845
|
+
{
|
|
846
|
+
strokeDasharray: "8",
|
|
847
|
+
strokeDashoffset: "8",
|
|
848
|
+
d: "M3 7l4 4M3 7l4 -4M21 17l-4 4M21 17l-4 -4",
|
|
849
|
+
children: /* @__PURE__ */ t.jsx(
|
|
850
|
+
"animate",
|
|
851
|
+
{
|
|
852
|
+
fill: "freeze",
|
|
853
|
+
attributeName: "stroke-dashoffset",
|
|
854
|
+
begin: "0.3s",
|
|
855
|
+
dur: "0.2s",
|
|
856
|
+
values: "8;0"
|
|
857
|
+
}
|
|
858
|
+
)
|
|
859
|
+
}
|
|
860
|
+
)
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
)
|
|
864
|
+
}
|
|
865
|
+
), $t = (n) => /* @__PURE__ */ t.jsx(
|
|
772
866
|
"svg",
|
|
773
867
|
{
|
|
774
868
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -799,7 +893,7 @@ const Pt = (n) => /* @__PURE__ */ t.jsx(
|
|
|
799
893
|
}
|
|
800
894
|
)
|
|
801
895
|
}
|
|
802
|
-
),
|
|
896
|
+
), Wt = (n) => /* @__PURE__ */ t.jsxs(
|
|
803
897
|
"svg",
|
|
804
898
|
{
|
|
805
899
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -902,39 +996,52 @@ const Pt = (n) => /* @__PURE__ */ t.jsx(
|
|
|
902
996
|
)
|
|
903
997
|
]
|
|
904
998
|
}
|
|
905
|
-
),
|
|
999
|
+
), Ze = (n) => /* @__PURE__ */ t.jsx(
|
|
906
1000
|
"svg",
|
|
907
1001
|
{
|
|
908
1002
|
xmlns: "http://www.w3.org/2000/svg",
|
|
909
1003
|
width: "48",
|
|
910
1004
|
height: "48",
|
|
911
|
-
viewBox: "0 0
|
|
1005
|
+
viewBox: "0 0 24 24",
|
|
912
1006
|
...n,
|
|
913
1007
|
children: /* @__PURE__ */ t.jsx(
|
|
914
1008
|
"path",
|
|
915
1009
|
{
|
|
916
|
-
fill: "
|
|
917
|
-
|
|
1010
|
+
fill: "none",
|
|
1011
|
+
stroke: "currentColor",
|
|
1012
|
+
strokeLinecap: "round",
|
|
1013
|
+
strokeLinejoin: "round",
|
|
1014
|
+
strokeWidth: "2",
|
|
1015
|
+
d: "M5 5L12 5L19 5M5 12H19M5 19L12 19L19 19",
|
|
1016
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1017
|
+
"animate",
|
|
1018
|
+
{
|
|
1019
|
+
fill: "freeze",
|
|
1020
|
+
attributeName: "d",
|
|
1021
|
+
dur: "0.4s",
|
|
1022
|
+
values: "M5 5L12 5L19 5M5 12H19M5 19L12 19L19 19;M5 5L12 12L19 5M12 12H12M5 19L12 12L19 19"
|
|
1023
|
+
}
|
|
1024
|
+
)
|
|
918
1025
|
}
|
|
919
1026
|
)
|
|
920
1027
|
}
|
|
921
|
-
),
|
|
1028
|
+
), Bt = (n) => /* @__PURE__ */ t.jsx(
|
|
922
1029
|
"svg",
|
|
923
1030
|
{
|
|
924
1031
|
xmlns: "http://www.w3.org/2000/svg",
|
|
925
|
-
width: "
|
|
926
|
-
height: "
|
|
927
|
-
viewBox: "0 0
|
|
1032
|
+
width: "48",
|
|
1033
|
+
height: "48",
|
|
1034
|
+
viewBox: "0 0 22 22",
|
|
928
1035
|
...n,
|
|
929
1036
|
children: /* @__PURE__ */ t.jsx(
|
|
930
1037
|
"path",
|
|
931
1038
|
{
|
|
932
1039
|
fill: "currentColor",
|
|
933
|
-
d: "
|
|
1040
|
+
d: "M1.5 4v1.5c0 4.15 2.21 7.78 5.5 9.8V20h15v-2c0-2.66-5.33-4-8-4h-.25C9 14 5 10 5 5.5V4m9 0a4 4 0 0 0-4 4a4 4 0 0 0 4 4a4 4 0 0 0 4-4a4 4 0 0 0-4-4"
|
|
934
1041
|
}
|
|
935
1042
|
)
|
|
936
1043
|
}
|
|
937
|
-
),
|
|
1044
|
+
), zt = (n) => /* @__PURE__ */ t.jsx(
|
|
938
1045
|
"svg",
|
|
939
1046
|
{
|
|
940
1047
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -942,41 +1049,15 @@ const Pt = (n) => /* @__PURE__ */ t.jsx(
|
|
|
942
1049
|
height: "24",
|
|
943
1050
|
viewBox: "0 0 24 24",
|
|
944
1051
|
...n,
|
|
945
|
-
children: /* @__PURE__ */ t.
|
|
946
|
-
"
|
|
1052
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1053
|
+
"path",
|
|
947
1054
|
{
|
|
948
|
-
fill: "
|
|
949
|
-
|
|
950
|
-
strokeDasharray: "28",
|
|
951
|
-
strokeDashoffset: "28",
|
|
952
|
-
strokeLinecap: "round",
|
|
953
|
-
strokeLinejoin: "round",
|
|
954
|
-
strokeWidth: "2",
|
|
955
|
-
children: [
|
|
956
|
-
/* @__PURE__ */ t.jsx("path", { d: "M4 21v-1c0 -3.31 2.69 -6 6 -6h4c3.31 0 6 2.69 6 6v1", children: /* @__PURE__ */ t.jsx(
|
|
957
|
-
"animate",
|
|
958
|
-
{
|
|
959
|
-
fill: "freeze",
|
|
960
|
-
attributeName: "stroke-dashoffset",
|
|
961
|
-
dur: "0.4s",
|
|
962
|
-
values: "28;0"
|
|
963
|
-
}
|
|
964
|
-
) }),
|
|
965
|
-
/* @__PURE__ */ t.jsx("path", { d: "M12 11c-2.21 0 -4 -1.79 -4 -4c0 -2.21 1.79 -4 4 -4c2.21 0 4 1.79 4 4c0 2.21 -1.79 4 -4 4Z", children: /* @__PURE__ */ t.jsx(
|
|
966
|
-
"animate",
|
|
967
|
-
{
|
|
968
|
-
fill: "freeze",
|
|
969
|
-
attributeName: "stroke-dashoffset",
|
|
970
|
-
begin: "0.4s",
|
|
971
|
-
dur: "0.4s",
|
|
972
|
-
values: "28;0"
|
|
973
|
-
}
|
|
974
|
-
) })
|
|
975
|
-
]
|
|
1055
|
+
fill: "currentColor",
|
|
1056
|
+
d: "M12 2.25A9.75 9.75 0 0 0 2.25 12v5q0 .04.004.08v.05c-.003 1.278.602 2.682 1.963 3.25l.071.03c.11.044.22.12.362.25c.07.064.138.132.22.213l.008.008c.08.08.175.175.277.265c.204.183.474.388.83.506c.37.122.77.131 1.208.022c.723-.18 1.266-.752 1.469-1.454c.089-.309.089-.668.088-1.084v-4.094c0-.285 0-.528-.01-.728a2.3 2.3 0 0 0-.107-.627c-.23-.683-.786-1.223-1.504-1.377a2.25 2.25 0 0 0-1.264.065c-.37.133-.652.354-.87.558c-.12.11-.269.267-.391.396l-.164.17a1.8 1.8 0 0 1-.427.338q-.136.07-.263.152V12a8.25 8.25 0 1 1 16.5 0v1.864a3 3 0 0 0-.538-.274a1.2 1.2 0 0 1-.362-.25c-.07-.064-.138-.132-.22-.213l-.008-.008a7 7 0 0 0-.277-.265a2.4 2.4 0 0 0-.83-.506q-.553-.184-1.208-.022c-.723.18-1.266.752-1.469 1.454c-.089.309-.088.668-.088 1.085v4.093c0 .285 0 .528.01.728c.012.208.037.418.107.627c.23.683.786 1.223 1.504 1.377c.463.1.883.073 1.264-.065c.37-.133.652-.354.87-.558c.12-.11.269-.267.391-.395c.065-.069.123-.13.164-.17a1.8 1.8 0 0 1 .427-.34c1.11-.573 1.755-1.724 1.758-2.936v-.143L21.75 17v-5A9.75 9.75 0 0 0 12 2.25"
|
|
976
1057
|
}
|
|
977
1058
|
)
|
|
978
1059
|
}
|
|
979
|
-
),
|
|
1060
|
+
), Xe = () => /* @__PURE__ */ t.jsx(
|
|
980
1061
|
"svg",
|
|
981
1062
|
{
|
|
982
1063
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -995,7 +1076,7 @@ const Pt = (n) => /* @__PURE__ */ t.jsx(
|
|
|
995
1076
|
}
|
|
996
1077
|
)
|
|
997
1078
|
}
|
|
998
|
-
),
|
|
1079
|
+
), ue = (n) => /* @__PURE__ */ t.jsx(
|
|
999
1080
|
"svg",
|
|
1000
1081
|
{
|
|
1001
1082
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1063,7 +1144,7 @@ const Pt = (n) => /* @__PURE__ */ t.jsx(
|
|
|
1063
1144
|
}
|
|
1064
1145
|
)
|
|
1065
1146
|
}
|
|
1066
|
-
),
|
|
1147
|
+
), Vt = (n) => /* @__PURE__ */ t.jsxs(
|
|
1067
1148
|
"svg",
|
|
1068
1149
|
{
|
|
1069
1150
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1206,441 +1287,451 @@ const Pt = (n) => /* @__PURE__ */ t.jsx(
|
|
|
1206
1287
|
)
|
|
1207
1288
|
]
|
|
1208
1289
|
}
|
|
1209
|
-
),
|
|
1290
|
+
), Z = g.forwardRef(
|
|
1210
1291
|
({
|
|
1211
1292
|
className: n,
|
|
1212
|
-
variant:
|
|
1213
|
-
size:
|
|
1293
|
+
variant: r = "outline",
|
|
1294
|
+
size: a = "md",
|
|
1214
1295
|
shape: i = "rounded",
|
|
1215
|
-
...
|
|
1216
|
-
},
|
|
1296
|
+
...l
|
|
1297
|
+
}, c) => /* @__PURE__ */ t.jsx(
|
|
1217
1298
|
"button",
|
|
1218
1299
|
{
|
|
1219
|
-
className:
|
|
1300
|
+
className: se(
|
|
1220
1301
|
"lulichat-btn",
|
|
1221
|
-
`lulichat-btn-${
|
|
1222
|
-
`lulichat-btn-${
|
|
1302
|
+
`lulichat-btn-${r}`,
|
|
1303
|
+
`lulichat-btn-${a}`,
|
|
1223
1304
|
`lulichat-btn-${i}`,
|
|
1224
1305
|
n
|
|
1225
1306
|
),
|
|
1226
|
-
ref:
|
|
1227
|
-
...
|
|
1307
|
+
ref: c,
|
|
1308
|
+
...l
|
|
1228
1309
|
}
|
|
1229
1310
|
)
|
|
1230
1311
|
);
|
|
1231
|
-
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1312
|
+
Z.displayName = "Button";
|
|
1313
|
+
const Ht = g.forwardRef(
|
|
1314
|
+
(n, r) => {
|
|
1315
|
+
const { companyName: a, isLoading: i, allowAnonymous: l } = n, [c, h] = g.useState(!0), [f, u] = W({
|
|
1316
|
+
name: "",
|
|
1317
|
+
email: ""
|
|
1318
|
+
}), [b, p] = W({}), [E, m] = g.useState(!1), _ = () => {
|
|
1319
|
+
var T, j;
|
|
1320
|
+
const R = {};
|
|
1321
|
+
return !l && !((T = f.name) != null && T.trim()) && (R.name = "Name is required"), l || ((j = f.email) != null && j.trim() ? /\S+@\S+\.\S+/.test(f.email) || (R.email = "Email is invalid") : R.email = "Email is required"), p(R), Object.keys(R).length === 0;
|
|
1322
|
+
}, S = (R) => {
|
|
1323
|
+
R.preventDefault(), _() && (m(!0), h(!1));
|
|
1324
|
+
}, w = (R, T) => {
|
|
1325
|
+
u((j) => ({ ...j, [R]: T })), b[R] && p((j) => ({ ...j, [R]: void 0 }));
|
|
1326
|
+
};
|
|
1327
|
+
return g.useImperativeHandle(
|
|
1328
|
+
r,
|
|
1329
|
+
() => ({
|
|
1330
|
+
getValues: () => f
|
|
1331
|
+
}),
|
|
1332
|
+
[f]
|
|
1333
|
+
), console.log({ formData: f, submitted: E }), /* @__PURE__ */ t.jsxs(
|
|
1334
|
+
G,
|
|
1335
|
+
{
|
|
1336
|
+
autoComplete: "off",
|
|
1337
|
+
onSubmit: S,
|
|
1338
|
+
onValuesChange: u,
|
|
1339
|
+
className: "lulichat-contact-form",
|
|
1340
|
+
children: [
|
|
1341
|
+
/* @__PURE__ */ t.jsxs("div", { className: "lulichat-form-header", children: [
|
|
1342
|
+
/* @__PURE__ */ t.jsxs(
|
|
1343
|
+
"div",
|
|
1344
|
+
{
|
|
1345
|
+
style: {
|
|
1346
|
+
marginBottom: "20px",
|
|
1347
|
+
display: "flex",
|
|
1348
|
+
alignItems: "end",
|
|
1349
|
+
columnGap: 8
|
|
1350
|
+
},
|
|
1351
|
+
children: [
|
|
1352
|
+
/* @__PURE__ */ t.jsx(
|
|
1353
|
+
Bt,
|
|
1354
|
+
{
|
|
1355
|
+
style: { display: "block" },
|
|
1356
|
+
color: "#DEDEDE6A",
|
|
1357
|
+
height: 40,
|
|
1358
|
+
width: 50
|
|
1359
|
+
}
|
|
1360
|
+
),
|
|
1361
|
+
/* @__PURE__ */ t.jsx("h3", { style: { fontWeight: 500 }, children: "Hello," })
|
|
1362
|
+
]
|
|
1363
|
+
}
|
|
1364
|
+
),
|
|
1365
|
+
/* @__PURE__ */ t.jsxs("h3", { style: { marginBottom: 8 }, className: "lulichat-title", children: [
|
|
1366
|
+
"Welcome to ",
|
|
1367
|
+
a,
|
|
1368
|
+
" Live Chat"
|
|
1369
|
+
] }),
|
|
1370
|
+
E ? /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1371
|
+
/* @__PURE__ */ t.jsxs("p", { children: [
|
|
1372
|
+
"Name: ",
|
|
1373
|
+
/* @__PURE__ */ t.jsx("b", { children: f.name })
|
|
1374
|
+
] }),
|
|
1375
|
+
/* @__PURE__ */ t.jsxs("p", { children: [
|
|
1376
|
+
"Email: ",
|
|
1377
|
+
/* @__PURE__ */ t.jsx("b", { children: f.email })
|
|
1378
|
+
] })
|
|
1379
|
+
] }) : /* @__PURE__ */ t.jsxs(
|
|
1380
|
+
"p",
|
|
1381
|
+
{
|
|
1382
|
+
role: "button",
|
|
1383
|
+
onClickCapture: () => h(!c),
|
|
1384
|
+
style: {
|
|
1385
|
+
textDecoration: "underline",
|
|
1386
|
+
lineHeight: "1rem",
|
|
1387
|
+
cursor: "pointer"
|
|
1388
|
+
},
|
|
1389
|
+
children: [
|
|
1390
|
+
"Please provide your details for a better support experience",
|
|
1391
|
+
" ",
|
|
1392
|
+
/* @__PURE__ */ t.jsx(
|
|
1393
|
+
$t,
|
|
1394
|
+
{
|
|
1395
|
+
style: {
|
|
1396
|
+
display: "inline-block",
|
|
1397
|
+
marginBottom: -2
|
|
1398
|
+
},
|
|
1399
|
+
height: 20,
|
|
1400
|
+
width: 20
|
|
1401
|
+
}
|
|
1402
|
+
)
|
|
1403
|
+
]
|
|
1404
|
+
}
|
|
1405
|
+
)
|
|
1291
1406
|
] }),
|
|
1292
|
-
/* @__PURE__ */ t.jsxs(
|
|
1293
|
-
"
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
z,
|
|
1345
|
-
{
|
|
1346
|
-
type: "submit",
|
|
1347
|
-
disabled: v || !E.email,
|
|
1348
|
-
style: { width: "100%", marginTop: 10 },
|
|
1349
|
-
className: "lulichat-contact-form-btn",
|
|
1350
|
-
children: v ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1351
|
-
/* @__PURE__ */ t.jsx(Be, {}),
|
|
1352
|
-
"Submitting..."
|
|
1353
|
-
] }) : "Submit"
|
|
1354
|
-
}
|
|
1355
|
-
)
|
|
1356
|
-
] })
|
|
1357
|
-
]
|
|
1358
|
-
}
|
|
1359
|
-
);
|
|
1360
|
-
};
|
|
1361
|
-
class Wt {
|
|
1362
|
-
constructor(s, l, i = "wss://ws.lulichat.com") {
|
|
1363
|
-
F(this, "socket", null);
|
|
1364
|
-
F(this, "token");
|
|
1365
|
-
F(this, "sessionId");
|
|
1366
|
-
F(this, "onMessageCallback");
|
|
1367
|
-
F(this, "onStatusCallback");
|
|
1368
|
-
F(this, "reconnectAttempts", 0);
|
|
1369
|
-
F(this, "maxReconnectAttempts", 5);
|
|
1370
|
-
this.token = s, this.sessionId = l, this.connect(i);
|
|
1407
|
+
/* @__PURE__ */ t.jsxs("div", { className: `lulichat-form-group${c ? " open" : ""}`, children: [
|
|
1408
|
+
/* @__PURE__ */ t.jsx(G.Item, { error: b.name, label: "Name (Optional)", name: "name", children: /* @__PURE__ */ t.jsx(
|
|
1409
|
+
ce,
|
|
1410
|
+
{
|
|
1411
|
+
id: "name",
|
|
1412
|
+
placeholder: "Enter your name",
|
|
1413
|
+
type: "text",
|
|
1414
|
+
value: f.name,
|
|
1415
|
+
onChange: (R) => w("name", R.target.value),
|
|
1416
|
+
className: "transparent" + (b.name ? " error" : "")
|
|
1417
|
+
}
|
|
1418
|
+
) }),
|
|
1419
|
+
/* @__PURE__ */ t.jsx(G.Item, { name: "email", error: b.email, label: "Email", children: /* @__PURE__ */ t.jsx(
|
|
1420
|
+
ce,
|
|
1421
|
+
{
|
|
1422
|
+
id: "email",
|
|
1423
|
+
type: "email",
|
|
1424
|
+
placeholder: "Enter your valid email",
|
|
1425
|
+
value: f.email,
|
|
1426
|
+
onChange: (R) => w("email", R.target.value),
|
|
1427
|
+
className: "transparent" + (b.name ? " error" : "")
|
|
1428
|
+
}
|
|
1429
|
+
) }),
|
|
1430
|
+
/* @__PURE__ */ t.jsx(
|
|
1431
|
+
Z,
|
|
1432
|
+
{
|
|
1433
|
+
type: "submit",
|
|
1434
|
+
disabled: i || !f.email,
|
|
1435
|
+
style: { width: "100%", marginBlock: 10 },
|
|
1436
|
+
className: "lulichat-contact-form-btn",
|
|
1437
|
+
children: i ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1438
|
+
/* @__PURE__ */ t.jsx(ue, {}),
|
|
1439
|
+
"Submitting..."
|
|
1440
|
+
] }) : "Submit"
|
|
1441
|
+
}
|
|
1442
|
+
)
|
|
1443
|
+
] })
|
|
1444
|
+
]
|
|
1445
|
+
}
|
|
1446
|
+
);
|
|
1447
|
+
}
|
|
1448
|
+
);
|
|
1449
|
+
class Yt {
|
|
1450
|
+
constructor(r, a = "wss://ws.lulichat.com", i) {
|
|
1451
|
+
q(this, "socket", null);
|
|
1452
|
+
q(this, "token");
|
|
1453
|
+
q(this, "ticket");
|
|
1454
|
+
q(this, "onMessageCallback");
|
|
1455
|
+
q(this, "onStatusCallback");
|
|
1456
|
+
q(this, "reconnectAttempts", 0);
|
|
1457
|
+
q(this, "maxReconnectAttempts", 5);
|
|
1458
|
+
this.token = r, this.ticket = i, this.connect(a);
|
|
1371
1459
|
}
|
|
1372
|
-
connect(
|
|
1373
|
-
var
|
|
1460
|
+
connect(r) {
|
|
1461
|
+
var a;
|
|
1374
1462
|
try {
|
|
1375
|
-
this.socket =
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1463
|
+
this.socket = Nt(`${r}`, {
|
|
1464
|
+
transports: ["websocket"],
|
|
1465
|
+
// @ts-expect-error
|
|
1466
|
+
pingTimeout: 18e3,
|
|
1467
|
+
pingInterval: 18e3,
|
|
1468
|
+
query: { token: this.token }
|
|
1469
|
+
}), this.socket.on("connect", () => {
|
|
1470
|
+
var i, l;
|
|
1471
|
+
console.log("Socket connected"), this.reconnectAttempts = 0, (i = this.socket) == null || i.emit("joinChatBox", this.ticket.id), (l = this.onStatusCallback) == null || l.call(this, "connected");
|
|
1472
|
+
}), this.socket.on(
|
|
1473
|
+
`company-${this.ticket.companyId}-appMessage`,
|
|
1474
|
+
(i) => {
|
|
1475
|
+
var l;
|
|
1476
|
+
(l = this.onMessageCallback) == null || l.call(this, i.message);
|
|
1387
1477
|
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1478
|
+
), this.socket.onAny((i, ...l) => {
|
|
1479
|
+
console.debug({ event: i, args: l });
|
|
1480
|
+
}), this.socket.on("disconnect", (i, l) => {
|
|
1481
|
+
var c;
|
|
1482
|
+
console.log("Socket disconnected"), console.log({ reason: i, details: l }), (c = this.onStatusCallback) == null || c.call(this, "disconnected");
|
|
1483
|
+
}), this.socket.on("connect_error", (i) => {
|
|
1484
|
+
var l;
|
|
1485
|
+
console.error("Socket error:", i.message), (l = this.onStatusCallback) == null || l.call(this, "error");
|
|
1486
|
+
});
|
|
1395
1487
|
} catch (i) {
|
|
1396
|
-
console.error("Failed to connect socket:", i), (
|
|
1488
|
+
console.error("Failed to connect socket:", i), (a = this.onStatusCallback) == null || a.call(this, "error");
|
|
1397
1489
|
}
|
|
1398
1490
|
}
|
|
1399
|
-
handleReconnect(
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1491
|
+
// private handleReconnect(baseUrl: string) {
|
|
1492
|
+
// if (this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
1493
|
+
// this.reconnectAttempts++;
|
|
1494
|
+
// setTimeout(() => {
|
|
1495
|
+
// console.log(`Reconnecting... attempt ${this.reconnectAttempts}`);
|
|
1496
|
+
// this.connect(baseUrl);
|
|
1497
|
+
// }, 2000 * this.reconnectAttempts);
|
|
1498
|
+
// }
|
|
1499
|
+
// }
|
|
1500
|
+
sendMessage(r) {
|
|
1501
|
+
var a;
|
|
1502
|
+
(a = this.socket) != null && a.connected && this.socket.emit("message", r);
|
|
1403
1503
|
}
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
if (((l = this.socket) == null ? void 0 : l.readyState) === WebSocket.OPEN) {
|
|
1407
|
-
const i = {
|
|
1408
|
-
type: "message",
|
|
1409
|
-
content: s,
|
|
1410
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1411
|
-
};
|
|
1412
|
-
this.socket.send(JSON.stringify(i));
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
onMessage(s) {
|
|
1416
|
-
this.onMessageCallback = s;
|
|
1504
|
+
onMessage(r) {
|
|
1505
|
+
this.onMessageCallback = r;
|
|
1417
1506
|
}
|
|
1418
|
-
onStatus(
|
|
1419
|
-
this.onStatusCallback =
|
|
1507
|
+
onStatus(r) {
|
|
1508
|
+
this.onStatusCallback = r;
|
|
1420
1509
|
}
|
|
1421
1510
|
disconnect() {
|
|
1422
1511
|
this.socket && (this.socket.close(), this.socket = null);
|
|
1423
1512
|
}
|
|
1424
1513
|
}
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1514
|
+
function Qe(n) {
|
|
1515
|
+
const r = Mt(), a = Ot.parse(n || "");
|
|
1516
|
+
return r.sanitize(a);
|
|
1517
|
+
}
|
|
1518
|
+
const Ut = (n) => {
|
|
1519
|
+
var z;
|
|
1520
|
+
const { session: r, companyInfo: a, onClose: i, api: l } = n, [c, h] = W([]), [f, u] = W(""), [b, p] = W(!1), [E, m] = W("disconnected"), _ = J(null), S = J(null), [w, R] = g.useState(), { ticket: T } = r, j = g.useCallback(async () => {
|
|
1521
|
+
const y = await l.getTicketMessages(r.ticket.id);
|
|
1522
|
+
h(
|
|
1523
|
+
(I) => Lt([...I, ...y.messages], (M) => M.id).sort(
|
|
1524
|
+
(M, $) => +new Date(M.createdAt) - +new Date($.createdAt)
|
|
1525
|
+
)
|
|
1526
|
+
), R(y);
|
|
1527
|
+
}, [r.ticket.id]);
|
|
1528
|
+
g.useEffect(() => {
|
|
1529
|
+
j();
|
|
1530
|
+
}, [j]), be(() => {
|
|
1531
|
+
const { token: y, ticket: I } = r;
|
|
1532
|
+
return S.current = new Yt(y, l.baseUrl, I), S.current.onMessage((M) => {
|
|
1533
|
+
h(($) => [...$, M]), p(!1);
|
|
1534
|
+
}), S.current.onStatus((M) => {
|
|
1535
|
+
m(M);
|
|
1536
|
+
}), () => {
|
|
1537
|
+
var M;
|
|
1538
|
+
(M = S.current) == null || M.disconnect();
|
|
1539
|
+
};
|
|
1540
|
+
}, [r, a]), be(() => {
|
|
1541
|
+
X();
|
|
1542
|
+
}, [c]);
|
|
1543
|
+
const X = () => {
|
|
1544
|
+
var y;
|
|
1545
|
+
(y = _.current) == null || y.scrollIntoView({ behavior: "smooth" });
|
|
1546
|
+
}, D = () => {
|
|
1547
|
+
var I;
|
|
1548
|
+
if (!f.trim() || E !== "connected") return;
|
|
1549
|
+
const y = {
|
|
1550
|
+
id: Ke(32),
|
|
1551
|
+
ticketId: T.id,
|
|
1552
|
+
body: f,
|
|
1553
|
+
contactId: T.contact.id,
|
|
1554
|
+
queueId: T.queueId,
|
|
1555
|
+
companyId: T.companyId
|
|
1457
1556
|
};
|
|
1458
|
-
|
|
1459
|
-
},
|
|
1460
|
-
|
|
1461
|
-
},
|
|
1557
|
+
(I = S.current) == null || I.sendMessage(y), u(""), p(!0);
|
|
1558
|
+
}, B = (y) => {
|
|
1559
|
+
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), D());
|
|
1560
|
+
}, Y = (y) => new Intl.DateTimeFormat("en-US", {
|
|
1462
1561
|
hour: "2-digit",
|
|
1463
1562
|
minute: "2-digit"
|
|
1464
|
-
}).format(
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
case "user":
|
|
1469
|
-
return /* @__PURE__ */ t.jsx(It, { className: "w-4 h-4" });
|
|
1470
|
-
default:
|
|
1471
|
-
return null;
|
|
1472
|
-
}
|
|
1473
|
-
};
|
|
1474
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
1475
|
-
/* @__PURE__ */ t.jsxs("div", { className: "bg-primary text-primary-foreground p-4 rounded-t-lg", children: [
|
|
1476
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1477
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1478
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-green-400" }),
|
|
1479
|
-
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children: s.name })
|
|
1480
|
-
] }),
|
|
1481
|
-
/* @__PURE__ */ t.jsx(
|
|
1482
|
-
z,
|
|
1483
|
-
{
|
|
1484
|
-
variant: "ghost",
|
|
1485
|
-
size: "sm",
|
|
1486
|
-
onClick: l,
|
|
1487
|
-
className: "text-primary-foreground hover:bg-primary-foreground/20",
|
|
1488
|
-
children: "×"
|
|
1489
|
-
}
|
|
1490
|
-
)
|
|
1491
|
-
] }),
|
|
1492
|
-
/* @__PURE__ */ t.jsx("div", { className: "text-xs opacity-80 mt-1", children: h === "connected" ? "Online" : "Connecting..." })
|
|
1493
|
-
] }),
|
|
1494
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 bg-background", children: [
|
|
1495
|
-
i.map((o) => /* @__PURE__ */ t.jsx(
|
|
1496
|
-
"div",
|
|
1497
|
-
{
|
|
1498
|
-
className: `flex ${o.sender === "user" ? "justify-end" : "justify-start"}`,
|
|
1499
|
-
children: /* @__PURE__ */ t.jsxs(
|
|
1500
|
-
"div",
|
|
1501
|
-
{
|
|
1502
|
-
className: `max-w-xs lg:max-w-md px-4 py-2 rounded-lg ${o.sender === "user" ? "bg-primary text-primary-foreground" : o.sender === "system" ? "bg-muted text-muted-foreground text-center" : "bg-muted text-foreground"}`,
|
|
1503
|
-
children: [
|
|
1504
|
-
o.sender !== "system" && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-1 mb-1", children: [
|
|
1505
|
-
O(o.sender),
|
|
1506
|
-
/* @__PURE__ */ t.jsx("span", { className: "text-xs opacity-70", children: o.senderName || (o.sender === "user" ? "You" : "Support") })
|
|
1507
|
-
] }),
|
|
1508
|
-
/* @__PURE__ */ t.jsx("p", { className: "text-sm", children: o.content }),
|
|
1509
|
-
/* @__PURE__ */ t.jsx("p", { className: "text-xs opacity-60 mt-1", children: j(o.timestamp) })
|
|
1510
|
-
]
|
|
1511
|
-
}
|
|
1512
|
-
)
|
|
1513
|
-
},
|
|
1514
|
-
o.id
|
|
1515
|
-
)),
|
|
1516
|
-
b && /* @__PURE__ */ t.jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ t.jsx("div", { className: "bg-muted text-foreground px-4 py-2 rounded-lg", children: /* @__PURE__ */ t.jsxs("div", { className: "flex space-x-1", children: [
|
|
1517
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce" }),
|
|
1563
|
+
}).format(y);
|
|
1564
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "lulichat-room", children: [
|
|
1565
|
+
/* @__PURE__ */ t.jsx("div", { className: "lulichat-room-header", children: /* @__PURE__ */ t.jsxs("div", { className: "lulichat-flex lulichat-space-x-2", children: [
|
|
1566
|
+
/* @__PURE__ */ t.jsxs("div", { className: "lulichat-flex lulichat-space-x-2", children: [
|
|
1518
1567
|
/* @__PURE__ */ t.jsx(
|
|
1519
1568
|
"div",
|
|
1520
1569
|
{
|
|
1521
|
-
|
|
1522
|
-
|
|
1570
|
+
style: {
|
|
1571
|
+
width: "0.5rem",
|
|
1572
|
+
height: "0.5rem",
|
|
1573
|
+
borderRadius: "9999px",
|
|
1574
|
+
background: "#22c55e"
|
|
1575
|
+
// green
|
|
1576
|
+
}
|
|
1523
1577
|
}
|
|
1524
1578
|
),
|
|
1525
|
-
/* @__PURE__ */ t.jsx(
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1579
|
+
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children: ((z = T.contact) == null ? void 0 : z.name) || "Anonymous" }),
|
|
1580
|
+
/* @__PURE__ */ t.jsx(qt, { height: 24, width: 24 }),
|
|
1581
|
+
/* @__PURE__ */ t.jsx("span", { className: "font-medium", children: a.name })
|
|
1582
|
+
] }),
|
|
1583
|
+
/* @__PURE__ */ t.jsx(Z, { variant: "ghost", size: "sm", onClick: i, className: "", children: /* @__PURE__ */ t.jsx(Ze, { height: 16, width: 16 }) })
|
|
1584
|
+
] }) }),
|
|
1585
|
+
/* @__PURE__ */ t.jsxs(
|
|
1586
|
+
"div",
|
|
1587
|
+
{
|
|
1588
|
+
className: "lulichat-flex-1 lulichat-p-4 lulichat-bg-background",
|
|
1589
|
+
style: { overflowY: "auto", flex: 1 },
|
|
1590
|
+
children: [
|
|
1591
|
+
c.map((y, I) => {
|
|
1592
|
+
var $;
|
|
1593
|
+
const M = ($ = c[I - 1]) == null ? void 0 : $.fromMe;
|
|
1594
|
+
return /* @__PURE__ */ t.jsx(
|
|
1595
|
+
"div",
|
|
1596
|
+
{
|
|
1597
|
+
className: se(
|
|
1598
|
+
"lulichat-message",
|
|
1599
|
+
y.fromMe ? "agent" : "user"
|
|
1600
|
+
),
|
|
1601
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: "lulichat-message-content", children: [
|
|
1602
|
+
y.fromMe && !M && /* @__PURE__ */ t.jsxs("div", { className: "lulichat-message-header", children: [
|
|
1603
|
+
/* @__PURE__ */ t.jsx(zt, { width: 16, height: 16 }),
|
|
1604
|
+
/* @__PURE__ */ t.jsx("span", { className: "lulichat-message-sender", children: "Support" })
|
|
1605
|
+
] }),
|
|
1606
|
+
/* @__PURE__ */ t.jsxs(
|
|
1607
|
+
"p",
|
|
1608
|
+
{
|
|
1609
|
+
className: se(
|
|
1610
|
+
"lulichat-message-body",
|
|
1611
|
+
y.fromMe ? "support" : "user"
|
|
1612
|
+
),
|
|
1613
|
+
children: [
|
|
1614
|
+
/* @__PURE__ */ t.jsx(
|
|
1615
|
+
"span",
|
|
1616
|
+
{
|
|
1617
|
+
dangerouslySetInnerHTML: {
|
|
1618
|
+
__html: Qe(y.body)
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
),
|
|
1622
|
+
/* @__PURE__ */ t.jsx("p", { className: "lulichat-message-time", children: Y(new Date(y.createdAt)) })
|
|
1623
|
+
]
|
|
1624
|
+
}
|
|
1625
|
+
)
|
|
1626
|
+
] })
|
|
1627
|
+
},
|
|
1628
|
+
y.id
|
|
1629
|
+
);
|
|
1630
|
+
}),
|
|
1631
|
+
b && /* @__PURE__ */ t.jsx("div", { className: "lulichat-typing", children: /* @__PURE__ */ t.jsx("div", { className: "lulichat-typing-bubble", children: /* @__PURE__ */ t.jsxs("div", { className: "lulichat-typing-dots", children: [
|
|
1632
|
+
/* @__PURE__ */ t.jsx("div", { className: "lulichat-typing-dot" }),
|
|
1633
|
+
/* @__PURE__ */ t.jsx("div", { className: "lulichat-typing-dot" }),
|
|
1634
|
+
/* @__PURE__ */ t.jsx("div", { className: "lulichat-typing-dot" })
|
|
1635
|
+
] }) }) }),
|
|
1636
|
+
/* @__PURE__ */ t.jsx("div", { ref: _ })
|
|
1637
|
+
]
|
|
1638
|
+
}
|
|
1639
|
+
),
|
|
1640
|
+
/* @__PURE__ */ t.jsxs("div", { className: "lulichat-input-wrapper", children: [
|
|
1641
|
+
/* @__PURE__ */ t.jsxs("div", { className: "lulichat-input-container", children: [
|
|
1537
1642
|
/* @__PURE__ */ t.jsx(
|
|
1538
1643
|
"input",
|
|
1539
1644
|
{
|
|
1540
|
-
value:
|
|
1541
|
-
onChange: (
|
|
1542
|
-
onKeyPress:
|
|
1645
|
+
value: f,
|
|
1646
|
+
onChange: (y) => u(y.target.value),
|
|
1647
|
+
onKeyPress: B,
|
|
1543
1648
|
placeholder: "Type your message...",
|
|
1544
|
-
disabled:
|
|
1545
|
-
className: "
|
|
1649
|
+
disabled: E !== "connected",
|
|
1650
|
+
className: "lulichat-input"
|
|
1546
1651
|
}
|
|
1547
1652
|
),
|
|
1548
1653
|
/* @__PURE__ */ t.jsx(
|
|
1549
|
-
|
|
1654
|
+
"button",
|
|
1550
1655
|
{
|
|
1551
|
-
onClick:
|
|
1552
|
-
disabled: !
|
|
1553
|
-
|
|
1554
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1656
|
+
onClick: D,
|
|
1657
|
+
disabled: !f.trim() || E !== "connected",
|
|
1658
|
+
className: "lulichat-send-button",
|
|
1659
|
+
children: /* @__PURE__ */ t.jsx(Xe, { width: 16, height: 16 })
|
|
1555
1660
|
}
|
|
1556
1661
|
)
|
|
1557
1662
|
] }),
|
|
1558
|
-
|
|
1663
|
+
E !== "connected" && /* @__PURE__ */ t.jsx("p", { className: "lulichat-connection-status", children: E === "error" ? "Connection error. Retrying..." : "Connecting..." })
|
|
1559
1664
|
] })
|
|
1560
1665
|
] });
|
|
1561
|
-
},
|
|
1562
|
-
const [
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
A();
|
|
1567
|
-
}, [n]);
|
|
1568
|
-
const A = async () => {
|
|
1569
|
-
try {
|
|
1570
|
-
const o = await T.getCompanyInfo();
|
|
1571
|
-
v(o.data);
|
|
1572
|
-
} catch (o) {
|
|
1573
|
-
p("Failed to load chat configuration"), console.error("Failed to load company info:", o);
|
|
1666
|
+
}, Kt = g.forwardRef((n, r) => {
|
|
1667
|
+
const [a, i] = g.useState([]), [l, c] = g.useState(n.queues), h = g.useRef(null), f = g.useRef("auto"), u = n.api.useRequest(), b = g.useCallback(async (m) => {
|
|
1668
|
+
if (!m.length) {
|
|
1669
|
+
c(n.queues);
|
|
1670
|
+
return;
|
|
1574
1671
|
}
|
|
1575
|
-
|
|
1576
|
-
u(
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1672
|
+
c([]);
|
|
1673
|
+
const _ = m[m.length - 1], S = _.type == "queue", w = await u.getOptions({
|
|
1674
|
+
[S ? "queueId" : "queueOptionId"]: _.id,
|
|
1675
|
+
parentId: S ? -1 : _.id
|
|
1676
|
+
});
|
|
1677
|
+
w != null && w.length && (E(), c(w));
|
|
1678
|
+
}, []);
|
|
1679
|
+
g.useEffect(() => {
|
|
1680
|
+
b(a);
|
|
1681
|
+
}, [a]), g.useImperativeHandle(
|
|
1682
|
+
r,
|
|
1683
|
+
() => ({
|
|
1684
|
+
getTags: () => a
|
|
1685
|
+
}),
|
|
1686
|
+
[a]
|
|
1687
|
+
);
|
|
1688
|
+
const p = a[a.length - 1];
|
|
1689
|
+
g.useEffect(() => {
|
|
1690
|
+
if (!h.current) return;
|
|
1691
|
+
const m = h.current, _ = m.offsetHeight;
|
|
1692
|
+
m.style.height = `${_}px`, requestAnimationFrame(() => {
|
|
1693
|
+
if (!h.current) return;
|
|
1694
|
+
const S = m.scrollHeight;
|
|
1695
|
+
if (_ === S) {
|
|
1696
|
+
m.style.height = "auto";
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1699
|
+
m.offsetHeight, m.style.height = `${S}px`;
|
|
1700
|
+
const w = () => {
|
|
1701
|
+
h.current && (h.current.style.height = "auto"), m.removeEventListener("transitionend", w);
|
|
1596
1702
|
};
|
|
1597
|
-
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
},
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
companyName: i == null ? void 0 : i.name,
|
|
1616
|
-
onSubmit: M,
|
|
1617
|
-
onSkip: n.allowAnonymous ? j : void 0,
|
|
1618
|
-
allowAnonymous: n.allowAnonymous || !1,
|
|
1619
|
-
isLoading: b
|
|
1620
|
-
}
|
|
1621
|
-
),
|
|
1622
|
-
/* @__PURE__ */ t.jsxs("div", { style: { padding: 16 }, children: [
|
|
1623
|
-
/* @__PURE__ */ t.jsx(
|
|
1703
|
+
m.addEventListener("transitionend", w);
|
|
1704
|
+
});
|
|
1705
|
+
}, [a, n.message]);
|
|
1706
|
+
const E = g.useCallback(() => {
|
|
1707
|
+
var m;
|
|
1708
|
+
h.current && (f.current = (m = h.current) == null ? void 0 : m.offsetHeight);
|
|
1709
|
+
}, []);
|
|
1710
|
+
return g.useEffect(E, [l, a]), console.log({ loading: u.loading }), /* @__PURE__ */ t.jsxs(
|
|
1711
|
+
"div",
|
|
1712
|
+
{
|
|
1713
|
+
className: "wrap",
|
|
1714
|
+
ref: h,
|
|
1715
|
+
style: {
|
|
1716
|
+
overflow: "hidden",
|
|
1717
|
+
transition: "height 200ms ease"
|
|
1718
|
+
},
|
|
1719
|
+
children: [
|
|
1720
|
+
(p || n.message) && /* @__PURE__ */ t.jsx(
|
|
1624
1721
|
"div",
|
|
1625
1722
|
{
|
|
1723
|
+
className: "lulichat-queue-message",
|
|
1626
1724
|
style: {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1725
|
+
background: "#EBEBEBFF",
|
|
1726
|
+
padding: 10,
|
|
1727
|
+
marginBottom: 10,
|
|
1728
|
+
fontSize: ".79rem",
|
|
1729
|
+
borderRadius: "0.5rem"
|
|
1630
1730
|
},
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
}
|
|
1636
|
-
),
|
|
1637
|
-
/* @__PURE__ */ t.jsx(
|
|
1638
|
-
"div",
|
|
1639
|
-
{
|
|
1640
|
-
style: {
|
|
1641
|
-
height: 2,
|
|
1642
|
-
backgroundColor: "hsl(var(--border))",
|
|
1643
|
-
marginBlock: 16
|
|
1731
|
+
dangerouslySetInnerHTML: {
|
|
1732
|
+
__html: Qe(
|
|
1733
|
+
(p == null ? void 0 : p.message) || (p == null ? void 0 : p.greetingMessage) || n.message
|
|
1734
|
+
)
|
|
1644
1735
|
}
|
|
1645
1736
|
}
|
|
1646
1737
|
),
|
|
@@ -1650,40 +1741,148 @@ const zt = ({
|
|
|
1650
1741
|
style: {
|
|
1651
1742
|
display: "flex",
|
|
1652
1743
|
alignItems: "center",
|
|
1653
|
-
|
|
1744
|
+
justifyContent: "start",
|
|
1745
|
+
gap: 10,
|
|
1746
|
+
flexWrap: "wrap"
|
|
1654
1747
|
},
|
|
1655
|
-
className: "form-control",
|
|
1656
1748
|
children: [
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1749
|
+
a.map((m, _) => {
|
|
1750
|
+
m.name;
|
|
1751
|
+
const S = m.name || m.title, w = _ == a.length - 1, R = w && u.loading;
|
|
1752
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1753
|
+
"button",
|
|
1754
|
+
{
|
|
1755
|
+
onClick: w ? () => {
|
|
1756
|
+
E(), i(
|
|
1757
|
+
(T) => [...T].filter((j) => j.id != m.id ? m.type != j.type : !1)
|
|
1758
|
+
);
|
|
1759
|
+
} : void 0,
|
|
1760
|
+
disabled: !w,
|
|
1761
|
+
className: "lulichat-tag" + (w ? " selected" : ""),
|
|
1762
|
+
children: [
|
|
1763
|
+
R && /* @__PURE__ */ t.jsx(ue, { height: 14, width: 14 }),
|
|
1764
|
+
S == null ? void 0 : S.toLocaleLowerCase(),
|
|
1765
|
+
w && /* @__PURE__ */ t.jsx(Ze, { style: { marginLeft: 4 }, height: 14, width: 14 })
|
|
1766
|
+
]
|
|
1767
|
+
},
|
|
1768
|
+
m.id
|
|
1769
|
+
);
|
|
1770
|
+
}),
|
|
1771
|
+
l.map((m) => {
|
|
1772
|
+
const _ = m.name ? "queue" : "option", S = a.find((R) => R.id == m.id && R.type == _), w = m.name || m.title;
|
|
1773
|
+
return /* @__PURE__ */ t.jsx(
|
|
1774
|
+
"button",
|
|
1775
|
+
{
|
|
1776
|
+
onClick: () => i([...a, { ...m, type: _ }]),
|
|
1777
|
+
className: "lulichat-tag" + (S ? " selected" : ""),
|
|
1778
|
+
children: w == null ? void 0 : w.toLocaleLowerCase()
|
|
1779
|
+
},
|
|
1780
|
+
m.id
|
|
1781
|
+
);
|
|
1782
|
+
})
|
|
1670
1783
|
]
|
|
1671
1784
|
}
|
|
1672
1785
|
)
|
|
1786
|
+
]
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1789
|
+
}), xe = "luli-g-id", Gt = ({ config: n }) => {
|
|
1790
|
+
const [r, a] = W(
|
|
1791
|
+
null
|
|
1792
|
+
), [i, l] = W(null), [c, h] = W(!1), [f, u] = W(null), [b, p] = g.useState(!1), [E, m] = g.useState(
|
|
1793
|
+
localStorage.getItem(xe) || Ke()
|
|
1794
|
+
), _ = g.useRef(null), S = g.useRef(null), w = new Ft(n);
|
|
1795
|
+
be(() => {
|
|
1796
|
+
R(), j();
|
|
1797
|
+
}, [n]);
|
|
1798
|
+
const R = async () => {
|
|
1799
|
+
try {
|
|
1800
|
+
const D = await w.getCompanyInfo();
|
|
1801
|
+
a(D.data);
|
|
1802
|
+
} catch (D) {
|
|
1803
|
+
u("Failed to load chat configuration"), console.error("Failed to load company info:", D);
|
|
1804
|
+
}
|
|
1805
|
+
}, T = async (D) => {
|
|
1806
|
+
var B, Y;
|
|
1807
|
+
h(!0);
|
|
1808
|
+
try {
|
|
1809
|
+
const z = ((B = _.current) == null ? void 0 : B.getValues()) || {}, y = ((Y = S.current) == null ? void 0 : Y.getTags()) || [], I = y[0], M = (y == null ? void 0 : y.length) > 1 ? y[y.length - 1] : void 0, $ = {
|
|
1810
|
+
...z,
|
|
1811
|
+
...D,
|
|
1812
|
+
message: `${y.map((F) => `*${(F == null ? void 0 : F.name) || (F == null ? void 0 : F.title)}*`)}
|
|
1813
|
+
${D.message}`,
|
|
1814
|
+
queueId: I == null ? void 0 : I.id,
|
|
1815
|
+
queueOptionId: M == null ? void 0 : M.id,
|
|
1816
|
+
guestId: E
|
|
1817
|
+
}, ne = await w.submitContactInfo($);
|
|
1818
|
+
localStorage.setItem(xe, E), l(ne.data);
|
|
1819
|
+
} catch (z) {
|
|
1820
|
+
u("Failed to start chat. Please try again."), console.error("Failed to submit contact info:", z);
|
|
1821
|
+
} finally {
|
|
1822
|
+
h(!1);
|
|
1823
|
+
}
|
|
1824
|
+
}, j = g.useCallback(async () => {
|
|
1825
|
+
var B;
|
|
1826
|
+
const D = await w.getSession(E);
|
|
1827
|
+
(B = D.data) != null && B.ticket && D.data.token && (l(D.data), p(!0));
|
|
1828
|
+
}, [xe]), X = () => {
|
|
1829
|
+
l(null), u(null);
|
|
1830
|
+
};
|
|
1831
|
+
return r ? /* @__PURE__ */ t.jsxs("div", { className: `lulichat lulichat-${n.position}`, children: [
|
|
1832
|
+
b && /* @__PURE__ */ t.jsxs("div", { className: "lulichat-main", children: [
|
|
1833
|
+
!i && /* @__PURE__ */ t.jsxs(g.Fragment, { children: [
|
|
1834
|
+
/* @__PURE__ */ t.jsx(
|
|
1835
|
+
Ht,
|
|
1836
|
+
{
|
|
1837
|
+
companyName: r == null ? void 0 : r.name,
|
|
1838
|
+
allowAnonymous: n.allowAnonymous || !1,
|
|
1839
|
+
isLoading: c,
|
|
1840
|
+
ref: _
|
|
1841
|
+
}
|
|
1842
|
+
),
|
|
1843
|
+
/* @__PURE__ */ t.jsxs("div", { style: { padding: 16 }, children: [
|
|
1844
|
+
/* @__PURE__ */ t.jsx(
|
|
1845
|
+
Kt,
|
|
1846
|
+
{
|
|
1847
|
+
message: n.welcomeMessage,
|
|
1848
|
+
api: w,
|
|
1849
|
+
queues: r == null ? void 0 : r.queues,
|
|
1850
|
+
ref: S
|
|
1851
|
+
}
|
|
1852
|
+
),
|
|
1853
|
+
/* @__PURE__ */ t.jsx(
|
|
1854
|
+
"div",
|
|
1855
|
+
{
|
|
1856
|
+
style: {
|
|
1857
|
+
height: 2,
|
|
1858
|
+
backgroundColor: "hsl(var(--border))",
|
|
1859
|
+
marginBlock: 16
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
),
|
|
1863
|
+
/* @__PURE__ */ t.jsx(
|
|
1864
|
+
Jt,
|
|
1865
|
+
{
|
|
1866
|
+
isLoading: c,
|
|
1867
|
+
handleSubmit: T
|
|
1868
|
+
}
|
|
1869
|
+
)
|
|
1870
|
+
] })
|
|
1673
1871
|
] }),
|
|
1674
|
-
|
|
1675
|
-
|
|
1872
|
+
i && /* @__PURE__ */ t.jsx(
|
|
1873
|
+
Ut,
|
|
1676
1874
|
{
|
|
1677
|
-
session:
|
|
1678
|
-
companyInfo:
|
|
1679
|
-
onClose:
|
|
1875
|
+
session: i,
|
|
1876
|
+
companyInfo: r,
|
|
1877
|
+
onClose: X,
|
|
1878
|
+
api: w
|
|
1680
1879
|
}
|
|
1681
1880
|
)
|
|
1682
1881
|
] }),
|
|
1683
1882
|
/* @__PURE__ */ t.jsx(
|
|
1684
|
-
|
|
1883
|
+
Z,
|
|
1685
1884
|
{
|
|
1686
|
-
onClick: () =>
|
|
1885
|
+
onClick: () => p(!b),
|
|
1687
1886
|
className: "",
|
|
1688
1887
|
shape: "circle",
|
|
1689
1888
|
size: "icon",
|
|
@@ -1695,33 +1894,100 @@ const zt = ({
|
|
|
1695
1894
|
color: "#fff",
|
|
1696
1895
|
alignSelf: "end"
|
|
1697
1896
|
},
|
|
1698
|
-
disabled: !
|
|
1699
|
-
children: !
|
|
1897
|
+
disabled: !r && !f,
|
|
1898
|
+
children: !r && !f ? /* @__PURE__ */ t.jsx(ue, {}) : /* @__PURE__ */ t.jsx(Vt, { height: 40, width: 40 })
|
|
1700
1899
|
}
|
|
1701
1900
|
)
|
|
1702
|
-
] });
|
|
1703
|
-
},
|
|
1901
|
+
] }) : /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
1902
|
+
}, Jt = (n) => {
|
|
1903
|
+
const [r, a] = g.useState({
|
|
1904
|
+
message: "",
|
|
1905
|
+
files: null
|
|
1906
|
+
}), i = g.useRef(null);
|
|
1907
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1908
|
+
"div",
|
|
1909
|
+
{
|
|
1910
|
+
style: {
|
|
1911
|
+
display: "flex",
|
|
1912
|
+
alignItems: "center",
|
|
1913
|
+
columnGap: 10
|
|
1914
|
+
},
|
|
1915
|
+
className: "form-control",
|
|
1916
|
+
children: [
|
|
1917
|
+
/* @__PURE__ */ t.jsx(
|
|
1918
|
+
ce,
|
|
1919
|
+
{
|
|
1920
|
+
name: "message",
|
|
1921
|
+
autoComplete: "off",
|
|
1922
|
+
style: { border: "none", paddingInline: 0 },
|
|
1923
|
+
placeholder: "What can we help you with ?.",
|
|
1924
|
+
onChange: (l) => a({ ...r, message: l.target.value })
|
|
1925
|
+
}
|
|
1926
|
+
),
|
|
1927
|
+
n.isLoading ? /* @__PURE__ */ t.jsx(ue, {}) : /* @__PURE__ */ t.jsxs("div", { className: "lulichat-btn-group", children: [
|
|
1928
|
+
/* @__PURE__ */ t.jsxs(
|
|
1929
|
+
Z,
|
|
1930
|
+
{
|
|
1931
|
+
onClick: () => {
|
|
1932
|
+
var l;
|
|
1933
|
+
return (l = i.current) == null ? void 0 : l.click();
|
|
1934
|
+
},
|
|
1935
|
+
style: { color: "#00000080" },
|
|
1936
|
+
size: "icon",
|
|
1937
|
+
children: [
|
|
1938
|
+
/* @__PURE__ */ t.jsx(Wt, { height: 24 }),
|
|
1939
|
+
/* @__PURE__ */ t.jsx(
|
|
1940
|
+
"input",
|
|
1941
|
+
{
|
|
1942
|
+
ref: i,
|
|
1943
|
+
hidden: !0,
|
|
1944
|
+
type: "file",
|
|
1945
|
+
multiple: !1,
|
|
1946
|
+
onChange: (l) => a({ ...r, files: l.target.files }),
|
|
1947
|
+
accept: "image/jpeg,image/png"
|
|
1948
|
+
}
|
|
1949
|
+
)
|
|
1950
|
+
]
|
|
1951
|
+
}
|
|
1952
|
+
),
|
|
1953
|
+
/* @__PURE__ */ t.jsx(
|
|
1954
|
+
Z,
|
|
1955
|
+
{
|
|
1956
|
+
onClick: r.message ? () => {
|
|
1957
|
+
n.handleSubmit(r);
|
|
1958
|
+
} : void 0,
|
|
1959
|
+
disabled: !r.message,
|
|
1960
|
+
style: { color: "#00000080" },
|
|
1961
|
+
size: "icon",
|
|
1962
|
+
children: /* @__PURE__ */ t.jsx(Xe, {})
|
|
1963
|
+
}
|
|
1964
|
+
)
|
|
1965
|
+
] })
|
|
1966
|
+
]
|
|
1967
|
+
}
|
|
1968
|
+
);
|
|
1969
|
+
}, rr = ({
|
|
1704
1970
|
apiKey: n,
|
|
1705
|
-
baseUrl:
|
|
1706
|
-
position:
|
|
1971
|
+
baseUrl: r,
|
|
1972
|
+
position: a = "bottom-right",
|
|
1707
1973
|
primaryColor: i = "#007bff",
|
|
1708
|
-
companyName:
|
|
1709
|
-
welcomeMessage:
|
|
1710
|
-
requireContactInfo:
|
|
1711
|
-
allowAnonymous:
|
|
1974
|
+
companyName: l = "Support",
|
|
1975
|
+
welcomeMessage: c = "Hello! How can we help you today?",
|
|
1976
|
+
requireContactInfo: h = !0,
|
|
1977
|
+
allowAnonymous: f = !0
|
|
1712
1978
|
}) => {
|
|
1713
1979
|
const u = {
|
|
1714
1980
|
apiKey: n,
|
|
1715
|
-
baseUrl:
|
|
1716
|
-
position:
|
|
1981
|
+
baseUrl: r,
|
|
1982
|
+
position: a,
|
|
1717
1983
|
primaryColor: i,
|
|
1718
|
-
companyName:
|
|
1719
|
-
welcomeMessage:
|
|
1720
|
-
requireContactInfo:
|
|
1721
|
-
allowAnonymous:
|
|
1984
|
+
companyName: l,
|
|
1985
|
+
welcomeMessage: c,
|
|
1986
|
+
requireContactInfo: h,
|
|
1987
|
+
allowAnonymous: f
|
|
1722
1988
|
};
|
|
1723
|
-
return n ? /* @__PURE__ */ t.jsx(
|
|
1989
|
+
return n ? /* @__PURE__ */ t.jsx(Gt, { config: u }) : (console.error("LuliChat: API key is required"), null);
|
|
1724
1990
|
};
|
|
1725
1991
|
export {
|
|
1726
|
-
|
|
1992
|
+
rr as default
|
|
1727
1993
|
};
|