@paramms/chat-widget 1.0.30 → 1.0.32
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/README.md +20 -13
- package/dist/annotations.d.ts +11 -0
- package/dist/chatlist.d.ts +28 -4
- package/dist/chatlist.js +63 -51
- package/dist/chatlist.js.map +1 -1
- package/dist/core.d.ts +77 -0
- package/dist/core.js +146 -0
- package/dist/core.js.map +1 -0
- package/dist/e2e.js +1608 -0
- package/dist/e2e.js.map +1 -0
- package/dist/hooks.d.ts +61 -0
- package/dist/hooks.js +74 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.html +176 -0
- package/dist/react.d.ts +68 -26
- package/dist/react.js +266 -233
- package/dist/react.js.map +1 -1
- package/package.json +6 -24
package/dist/react.js
CHANGED
|
@@ -1,289 +1,319 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { mount as
|
|
4
|
-
function
|
|
5
|
-
url:
|
|
1
|
+
import { jsxs as M, jsx as p, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { useState as F, useRef as j, useEffect as _ } from "react";
|
|
3
|
+
import { mount as H } from "./index.js";
|
|
4
|
+
function E({
|
|
5
|
+
url: w,
|
|
6
6
|
apiUrl: i,
|
|
7
|
-
profileId:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
profileId: v,
|
|
8
|
+
token: r,
|
|
9
|
+
refreshToken: g,
|
|
10
|
+
userId: e,
|
|
11
|
+
userName: c,
|
|
12
|
+
userEmail: d,
|
|
13
|
+
userAvatar: s,
|
|
14
|
+
contextTitle: x,
|
|
15
|
+
contextSubtitle: m,
|
|
16
|
+
contextStatus: C,
|
|
17
|
+
subjectId: t,
|
|
18
|
+
accent: b,
|
|
19
|
+
launcher: f,
|
|
20
|
+
position: n,
|
|
21
|
+
quickReplies: h,
|
|
22
|
+
height: y = "100%",
|
|
23
|
+
i18n: u,
|
|
24
|
+
translateLang: R
|
|
23
25
|
}) {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
return (
|
|
29
|
-
el:
|
|
30
|
-
url:
|
|
26
|
+
const l = j(null), o = j(null);
|
|
27
|
+
return _(() => {
|
|
28
|
+
var a;
|
|
29
|
+
if (l.current)
|
|
30
|
+
return (a = o.current) == null || a.close(), o.current = H({
|
|
31
|
+
el: l.current,
|
|
32
|
+
url: w,
|
|
31
33
|
...i ? { apiUrl: i } : {},
|
|
32
|
-
profileId:
|
|
33
|
-
...
|
|
34
|
-
...
|
|
35
|
-
...
|
|
34
|
+
profileId: v,
|
|
35
|
+
...t ? { subjectId: t } : {},
|
|
36
|
+
...r ? { token: r } : {},
|
|
37
|
+
...g ? { refreshToken: g } : {},
|
|
38
|
+
...e ? { userId: e } : {},
|
|
39
|
+
...e || c || d || s ? {
|
|
36
40
|
user: {
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
41
|
+
...c ? { name: c } : {},
|
|
42
|
+
...d ? { email: d } : {},
|
|
43
|
+
...s ? { avatar: s } : {}
|
|
40
44
|
}
|
|
41
45
|
} : {},
|
|
42
|
-
...
|
|
46
|
+
...x ? {
|
|
43
47
|
subject: {
|
|
44
|
-
title:
|
|
45
|
-
...
|
|
46
|
-
...
|
|
48
|
+
title: x,
|
|
49
|
+
...m ? { subtitle: m } : {},
|
|
50
|
+
...C ? { status: C } : {}
|
|
47
51
|
}
|
|
48
52
|
} : {},
|
|
49
|
-
...
|
|
50
|
-
...
|
|
51
|
-
...
|
|
52
|
-
...
|
|
53
|
-
...
|
|
53
|
+
...h ? { quickReplies: h } : {},
|
|
54
|
+
...b ? { accent: b } : {},
|
|
55
|
+
...R ? { translateLang: R } : {},
|
|
56
|
+
...u ? { i18n: u } : {},
|
|
57
|
+
...f ? { launcher: f, position: n ?? "bottom-right" } : {}
|
|
54
58
|
}), () => {
|
|
55
|
-
var
|
|
56
|
-
(
|
|
59
|
+
var W;
|
|
60
|
+
(W = o.current) == null || W.close(), o.current = null;
|
|
57
61
|
};
|
|
58
|
-
}, [
|
|
62
|
+
}, [w, i, v, t, r, e, c, d, b, f, n, R]), /* @__PURE__ */ p(
|
|
59
63
|
"div",
|
|
60
64
|
{
|
|
61
|
-
ref:
|
|
62
|
-
style:
|
|
65
|
+
ref: l,
|
|
66
|
+
style: f ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: y, minHeight: y === "100%" ? "480px" : void 0 }
|
|
63
67
|
}
|
|
64
68
|
);
|
|
65
69
|
}
|
|
66
|
-
const
|
|
70
|
+
const k = [
|
|
67
71
|
"Is this still available?",
|
|
68
72
|
"Can I schedule a viewing?",
|
|
69
73
|
"What is your best price?"
|
|
70
74
|
];
|
|
71
|
-
function
|
|
72
|
-
url:
|
|
75
|
+
function G({
|
|
76
|
+
url: w,
|
|
73
77
|
apiUrl: i,
|
|
74
|
-
profileId:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
profileId: v,
|
|
79
|
+
token: r,
|
|
80
|
+
refreshToken: g,
|
|
81
|
+
listingId: e,
|
|
82
|
+
listingTitle: c,
|
|
83
|
+
listingMeta: d,
|
|
84
|
+
listingPrice: s,
|
|
85
|
+
listingStatus: x,
|
|
86
|
+
userId: m,
|
|
87
|
+
userName: C,
|
|
88
|
+
userEmail: t,
|
|
89
|
+
userAvatar: b,
|
|
90
|
+
accent: f,
|
|
91
|
+
launcher: n,
|
|
92
|
+
position: h,
|
|
93
|
+
quickReplies: y,
|
|
94
|
+
height: u = "100%",
|
|
95
|
+
i18n: R,
|
|
96
|
+
translateLang: l
|
|
91
97
|
}) {
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
if (!
|
|
95
|
-
let
|
|
96
|
-
const
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
el:
|
|
100
|
-
url:
|
|
98
|
+
const o = j(null), a = j(null);
|
|
99
|
+
return _(() => {
|
|
100
|
+
if (!o.current) return;
|
|
101
|
+
let W = !1;
|
|
102
|
+
const D = setTimeout(() => {
|
|
103
|
+
var z;
|
|
104
|
+
W || !o.current || ((z = a.current) == null || z.close(), a.current = H({
|
|
105
|
+
el: o.current,
|
|
106
|
+
url: w,
|
|
101
107
|
...i ? { apiUrl: i } : {},
|
|
102
|
-
profileId:
|
|
103
|
-
...
|
|
104
|
-
...
|
|
105
|
-
...
|
|
108
|
+
profileId: v,
|
|
109
|
+
...e ? { subjectId: `listing_${e}` } : {},
|
|
110
|
+
...r ? { token: r } : {},
|
|
111
|
+
...g ? { refreshToken: g } : {},
|
|
112
|
+
...m ? { userId: m } : {},
|
|
113
|
+
...m || C || t || b ? {
|
|
106
114
|
user: {
|
|
107
|
-
...
|
|
108
|
-
...
|
|
109
|
-
...
|
|
110
|
-
...
|
|
115
|
+
...C ? { name: C } : {},
|
|
116
|
+
...t ? { email: t } : {},
|
|
117
|
+
...b ? { avatar: b } : {},
|
|
118
|
+
...e ? { meta: { listingId: e } } : {}
|
|
111
119
|
}
|
|
112
120
|
} : {},
|
|
113
|
-
...
|
|
121
|
+
...c ? {
|
|
114
122
|
subject: {
|
|
115
|
-
title:
|
|
116
|
-
...
|
|
117
|
-
...
|
|
118
|
-
...
|
|
123
|
+
title: c,
|
|
124
|
+
...d ? { subtitle: d } : {},
|
|
125
|
+
...s ? { tags: [`$${s.toLocaleString()}`] } : {},
|
|
126
|
+
...x ? { status: x } : {}
|
|
119
127
|
}
|
|
120
128
|
} : {},
|
|
121
|
-
quickReplies:
|
|
122
|
-
...
|
|
123
|
-
...
|
|
124
|
-
...
|
|
125
|
-
...
|
|
129
|
+
quickReplies: y ?? k,
|
|
130
|
+
...f ? { accent: f } : {},
|
|
131
|
+
...l ? { translateLang: l } : {},
|
|
132
|
+
...R ? { i18n: R } : {},
|
|
133
|
+
...n ? { launcher: n, position: h ?? "bottom-right" } : {}
|
|
126
134
|
}));
|
|
127
135
|
}, 0);
|
|
128
136
|
return () => {
|
|
129
|
-
var
|
|
130
|
-
|
|
137
|
+
var z;
|
|
138
|
+
W = !0, clearTimeout(D), (z = a.current) == null || z.close(), a.current = null;
|
|
131
139
|
};
|
|
132
|
-
}, [
|
|
140
|
+
}, [w, i, v, e, r, m, f, n, h, l]), /* @__PURE__ */ p(
|
|
133
141
|
"div",
|
|
134
142
|
{
|
|
135
|
-
ref:
|
|
136
|
-
style:
|
|
143
|
+
ref: o,
|
|
144
|
+
style: n ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: u, minHeight: u === "100%" ? "480px" : void 0 }
|
|
137
145
|
}
|
|
138
146
|
);
|
|
139
147
|
}
|
|
140
|
-
function
|
|
141
|
-
url:
|
|
148
|
+
function A({
|
|
149
|
+
url: w,
|
|
142
150
|
apiUrl: i,
|
|
143
|
-
profileId:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
profileId: v,
|
|
152
|
+
token: r,
|
|
153
|
+
refreshToken: g,
|
|
154
|
+
userId: e,
|
|
155
|
+
userName: c,
|
|
156
|
+
userEmail: d,
|
|
157
|
+
accent: s,
|
|
158
|
+
height: x = "100%",
|
|
159
|
+
i18n: m,
|
|
160
|
+
scope: C = "tenant"
|
|
150
161
|
}) {
|
|
151
|
-
const [
|
|
152
|
-
|
|
153
|
-
if (!
|
|
154
|
-
let
|
|
155
|
-
return import("./chatlist.js").then(({ mountChatList:
|
|
156
|
-
|
|
157
|
-
el:
|
|
158
|
-
url:
|
|
162
|
+
const [t, b] = F(null), f = j(null), n = j(null), h = j(null), y = j(null);
|
|
163
|
+
_(() => {
|
|
164
|
+
if (!f.current) return;
|
|
165
|
+
let R = !1;
|
|
166
|
+
return import("./chatlist.js").then(({ mountChatList: l }) => {
|
|
167
|
+
R || !f.current || (h.current = l({
|
|
168
|
+
el: f.current,
|
|
169
|
+
url: w,
|
|
159
170
|
...i ? { apiUrl: i } : {},
|
|
160
|
-
profileId:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
profileId: v,
|
|
172
|
+
scope: C,
|
|
173
|
+
onSelect: (o) => b(o),
|
|
174
|
+
// Compose (✎) opens the chatroom's general support thread — without
|
|
175
|
+
// this a user with no conversations yet had an empty list and no way
|
|
176
|
+
// to ever start one, which is what made ChatApp feel broken.
|
|
177
|
+
onNewChat: () => b({ id: "__new__", state: "open", updatedAt: Date.now() }),
|
|
178
|
+
...r ? { token: r } : {},
|
|
179
|
+
...e ? { userId: e } : {},
|
|
180
|
+
...s ? { accent: s } : {},
|
|
181
|
+
...m ? { i18n: m } : {}
|
|
165
182
|
}));
|
|
166
183
|
}), () => {
|
|
167
|
-
var
|
|
168
|
-
|
|
184
|
+
var l;
|
|
185
|
+
R = !0, (l = h.current) == null || l.close(), h.current = null;
|
|
169
186
|
};
|
|
170
|
-
}, [
|
|
171
|
-
var
|
|
172
|
-
if (!
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
187
|
+
}, [w, i, v, r, e, C]), _(() => {
|
|
188
|
+
var l;
|
|
189
|
+
if (!n.current || !t) return;
|
|
190
|
+
(l = y.current) == null || l.close(), y.current = H({
|
|
191
|
+
el: n.current,
|
|
192
|
+
url: w,
|
|
193
|
+
...i ? { apiUrl: i } : {},
|
|
194
|
+
profileId: t.profileId ?? v,
|
|
195
|
+
...t.subjectId ? { subjectId: t.subjectId } : {},
|
|
196
|
+
...r ? { token: r } : {},
|
|
197
|
+
...g ? { refreshToken: g } : {},
|
|
198
|
+
...e ? { userId: e } : {},
|
|
199
|
+
...e || c || d ? {
|
|
200
|
+
user: {
|
|
201
|
+
...c ? { name: c } : {},
|
|
202
|
+
...d ? { email: d } : {}
|
|
203
|
+
}
|
|
204
|
+
} : {},
|
|
205
|
+
...t.subjectTitle ? {
|
|
206
|
+
subject: {
|
|
207
|
+
title: t.subjectTitle,
|
|
208
|
+
...t.subjectMeta ? { subtitle: t.subjectMeta } : {}
|
|
209
|
+
}
|
|
210
|
+
} : {},
|
|
211
|
+
...s ? { accent: s } : {}
|
|
212
|
+
});
|
|
213
|
+
const R = setInterval(() => {
|
|
214
|
+
var o;
|
|
215
|
+
return (o = h.current) == null ? void 0 : o.refresh();
|
|
216
|
+
}, 2e4);
|
|
217
|
+
return () => {
|
|
218
|
+
var o, a;
|
|
219
|
+
clearInterval(R), (o = y.current) == null || o.close(), y.current = null, (a = h.current) == null || a.refresh();
|
|
220
|
+
};
|
|
221
|
+
}, [t == null ? void 0 : t.id]);
|
|
222
|
+
const u = typeof window < "u" && window.innerWidth < 768;
|
|
223
|
+
return /* @__PURE__ */ M("div", { style: { display: "flex", width: "100%", height: x, minHeight: "400px", overflow: "hidden" }, children: [
|
|
200
224
|
/* @__PURE__ */ p("div", { style: {
|
|
201
|
-
width:
|
|
202
|
-
flex:
|
|
203
|
-
display:
|
|
225
|
+
width: u ? "100%" : "360px",
|
|
226
|
+
flex: u && t ? "none" : void 0,
|
|
227
|
+
display: u && t ? "none" : "flex",
|
|
204
228
|
flexDirection: "column",
|
|
205
|
-
borderRight:
|
|
229
|
+
borderRight: u ? "none" : "1px solid #e8eaed",
|
|
206
230
|
minWidth: 0
|
|
207
|
-
}, children: /* @__PURE__ */ p("div", { ref:
|
|
208
|
-
|
|
209
|
-
|
|
231
|
+
}, children: /* @__PURE__ */ p("div", { ref: f, style: { width: "100%", height: "100%" } }) }),
|
|
232
|
+
t ? /* @__PURE__ */ M("div", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, position: "relative" }, children: [
|
|
233
|
+
u && /* @__PURE__ */ p(
|
|
210
234
|
"button",
|
|
211
235
|
{
|
|
212
|
-
onClick: () =>
|
|
236
|
+
onClick: () => b(null),
|
|
213
237
|
style: { position: "absolute", top: 12, left: 12, zIndex: 10, background: "none", border: "none", fontSize: 22, cursor: "pointer", color: "#1c1b1a" },
|
|
214
238
|
children: "←"
|
|
215
239
|
}
|
|
216
240
|
),
|
|
217
241
|
/* @__PURE__ */ p("div", { ref: n, style: { width: "100%", height: "100%" } })
|
|
218
|
-
] }) : /* @__PURE__ */ p("div", { style: { flex: 1, display:
|
|
242
|
+
] }) : /* @__PURE__ */ p("div", { style: { flex: 1, display: u ? "none" : "flex", alignItems: "center", justifyContent: "center", color: "#9b9690", fontSize: 14 }, children: "Select a conversation" })
|
|
219
243
|
] });
|
|
220
244
|
}
|
|
221
|
-
function
|
|
222
|
-
url:
|
|
245
|
+
function J({
|
|
246
|
+
url: w,
|
|
223
247
|
apiUrl: i,
|
|
224
|
-
profileId:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
248
|
+
profileId: v,
|
|
249
|
+
token: r,
|
|
250
|
+
refreshToken: g,
|
|
251
|
+
userId: e,
|
|
252
|
+
userName: c,
|
|
253
|
+
userEmail: d,
|
|
254
|
+
scope: s,
|
|
255
|
+
accent: x = "#4F63F5",
|
|
256
|
+
floating: m = !0,
|
|
257
|
+
position: C = "bottom-right",
|
|
258
|
+
label: t,
|
|
259
|
+
panelWidth: b,
|
|
260
|
+
panelHeight: f = "600px"
|
|
234
261
|
}) {
|
|
235
|
-
const [n,
|
|
236
|
-
if (
|
|
237
|
-
const
|
|
238
|
-
|
|
262
|
+
const [n, h] = F(!1), y = j(null), u = C === "bottom-right", l = t ?? (m ? "💬" : "Messages");
|
|
263
|
+
if (_(() => {
|
|
264
|
+
const S = ($) => {
|
|
265
|
+
$.key === "Escape" && h(!1);
|
|
239
266
|
};
|
|
240
|
-
return document.addEventListener("keydown",
|
|
241
|
-
}, []),
|
|
242
|
-
const
|
|
243
|
-
return /* @__PURE__ */
|
|
267
|
+
return document.addEventListener("keydown", S), () => document.removeEventListener("keydown", S);
|
|
268
|
+
}, []), m) {
|
|
269
|
+
const S = typeof window < "u" && window.innerWidth < 480, $ = S ? "100vw" : b ?? "420px", Y = S ? "100dvh" : f;
|
|
270
|
+
return /* @__PURE__ */ M("div", { style: {
|
|
244
271
|
position: "fixed",
|
|
245
|
-
[
|
|
272
|
+
[u ? "right" : "left"]: "20px",
|
|
246
273
|
bottom: "20px",
|
|
247
274
|
zIndex: 9999,
|
|
248
275
|
display: "flex",
|
|
249
276
|
flexDirection: "column",
|
|
250
|
-
alignItems:
|
|
277
|
+
alignItems: u ? "flex-end" : "flex-start",
|
|
251
278
|
gap: "12px"
|
|
252
279
|
}, children: [
|
|
253
280
|
/* @__PURE__ */ p("div", { style: {
|
|
254
|
-
width:
|
|
255
|
-
height:
|
|
256
|
-
borderRadius:
|
|
281
|
+
width: $,
|
|
282
|
+
height: Y,
|
|
283
|
+
borderRadius: S ? "0" : "16px",
|
|
257
284
|
overflow: "hidden",
|
|
258
285
|
boxShadow: "0 8px 40px rgba(0,0,0,.18)",
|
|
259
286
|
background: "#fff",
|
|
260
287
|
display: n ? "flex" : "none",
|
|
261
288
|
flexDirection: "column",
|
|
262
|
-
transformOrigin: `bottom ${
|
|
289
|
+
transformOrigin: `bottom ${u ? "right" : "left"}`,
|
|
263
290
|
animation: n ? "ocl-pop-in .18s ease" : "none"
|
|
264
291
|
}, children: /* @__PURE__ */ p(
|
|
265
|
-
|
|
292
|
+
A,
|
|
266
293
|
{
|
|
267
|
-
url:
|
|
294
|
+
url: w,
|
|
268
295
|
...i ? { apiUrl: i } : {},
|
|
269
|
-
profileId:
|
|
270
|
-
...
|
|
271
|
-
...
|
|
272
|
-
...
|
|
273
|
-
|
|
296
|
+
profileId: v,
|
|
297
|
+
...r ? { token: r } : {},
|
|
298
|
+
...g ? { refreshToken: g } : {},
|
|
299
|
+
...e ? { userId: e } : {},
|
|
300
|
+
...c ? { userName: c } : {},
|
|
301
|
+
...d ? { userEmail: d } : {},
|
|
302
|
+
...s ? { scope: s } : {},
|
|
303
|
+
accent: x,
|
|
274
304
|
height: "100%"
|
|
275
305
|
}
|
|
276
306
|
) }),
|
|
277
307
|
/* @__PURE__ */ p(
|
|
278
308
|
"button",
|
|
279
309
|
{
|
|
280
|
-
ref:
|
|
281
|
-
onClick: () =>
|
|
310
|
+
ref: y,
|
|
311
|
+
onClick: () => h((L) => !L),
|
|
282
312
|
style: {
|
|
283
313
|
width: "56px",
|
|
284
314
|
height: "56px",
|
|
285
315
|
borderRadius: "50%",
|
|
286
|
-
background:
|
|
316
|
+
background: x,
|
|
287
317
|
color: "#fff",
|
|
288
318
|
border: "none",
|
|
289
319
|
fontSize: "24px",
|
|
@@ -292,36 +322,36 @@ function P({
|
|
|
292
322
|
boxShadow: "0 4px 16px rgba(0,0,0,.25)",
|
|
293
323
|
transition: "transform .15s"
|
|
294
324
|
},
|
|
295
|
-
onMouseEnter: (
|
|
296
|
-
|
|
325
|
+
onMouseEnter: (L) => {
|
|
326
|
+
L.target.style.transform = "scale(1.08)";
|
|
297
327
|
},
|
|
298
|
-
onMouseLeave: (
|
|
299
|
-
|
|
328
|
+
onMouseLeave: (L) => {
|
|
329
|
+
L.target.style.transform = "scale(1)";
|
|
300
330
|
},
|
|
301
|
-
children: n ? "✕" :
|
|
331
|
+
children: n ? "✕" : l
|
|
302
332
|
}
|
|
303
333
|
),
|
|
304
334
|
/* @__PURE__ */ p("style", { children: "@keyframes ocl-pop-in { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }" })
|
|
305
335
|
] });
|
|
306
336
|
}
|
|
307
|
-
const
|
|
308
|
-
!n &&
|
|
309
|
-
},
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
337
|
+
const o = b ?? "420px", [a, W] = F(null), D = () => {
|
|
338
|
+
!n && y.current && W(y.current.getBoundingClientRect()), h((S) => !S);
|
|
339
|
+
}, z = a ? a.bottom + 8 : 0, O = a ? window.innerWidth - a.right : 0;
|
|
340
|
+
return /* @__PURE__ */ M(B, { children: [
|
|
341
|
+
/* @__PURE__ */ M(
|
|
312
342
|
"button",
|
|
313
343
|
{
|
|
314
|
-
ref:
|
|
315
|
-
onClick:
|
|
344
|
+
ref: y,
|
|
345
|
+
onClick: D,
|
|
316
346
|
style: {
|
|
317
347
|
display: "inline-flex",
|
|
318
348
|
alignItems: "center",
|
|
319
349
|
gap: "6px",
|
|
320
350
|
padding: "8px 16px",
|
|
321
351
|
borderRadius: "8px",
|
|
322
|
-
background: n ?
|
|
323
|
-
color: n ? "#fff" :
|
|
324
|
-
border: `2px solid ${
|
|
352
|
+
background: n ? x : "transparent",
|
|
353
|
+
color: n ? "#fff" : x,
|
|
354
|
+
border: `2px solid ${x}`,
|
|
325
355
|
fontSize: "14px",
|
|
326
356
|
fontWeight: 600,
|
|
327
357
|
cursor: "pointer",
|
|
@@ -329,24 +359,24 @@ function P({
|
|
|
329
359
|
},
|
|
330
360
|
children: [
|
|
331
361
|
"💬 ",
|
|
332
|
-
|
|
362
|
+
l
|
|
333
363
|
]
|
|
334
364
|
}
|
|
335
365
|
),
|
|
336
|
-
n &&
|
|
366
|
+
n && a && /* @__PURE__ */ M(B, { children: [
|
|
337
367
|
/* @__PURE__ */ p(
|
|
338
368
|
"div",
|
|
339
369
|
{
|
|
340
|
-
onClick: () =>
|
|
370
|
+
onClick: () => h(!1),
|
|
341
371
|
style: { position: "fixed", inset: 0, zIndex: 9998 }
|
|
342
372
|
}
|
|
343
373
|
),
|
|
344
374
|
/* @__PURE__ */ p("div", { style: {
|
|
345
375
|
position: "fixed",
|
|
346
|
-
top:
|
|
347
|
-
right:
|
|
348
|
-
width:
|
|
349
|
-
height:
|
|
376
|
+
top: z,
|
|
377
|
+
right: O,
|
|
378
|
+
width: o,
|
|
379
|
+
height: f,
|
|
350
380
|
borderRadius: "16px",
|
|
351
381
|
overflow: "hidden",
|
|
352
382
|
boxShadow: "0 8px 40px rgba(0,0,0,.2)",
|
|
@@ -354,15 +384,18 @@ function P({
|
|
|
354
384
|
zIndex: 9999,
|
|
355
385
|
animation: "ocl-slide-in .18s ease"
|
|
356
386
|
}, children: /* @__PURE__ */ p(
|
|
357
|
-
|
|
387
|
+
A,
|
|
358
388
|
{
|
|
359
|
-
url:
|
|
389
|
+
url: w,
|
|
360
390
|
...i ? { apiUrl: i } : {},
|
|
361
|
-
profileId:
|
|
362
|
-
...
|
|
363
|
-
...
|
|
364
|
-
...
|
|
365
|
-
|
|
391
|
+
profileId: v,
|
|
392
|
+
...r ? { token: r } : {},
|
|
393
|
+
...g ? { refreshToken: g } : {},
|
|
394
|
+
...e ? { userId: e } : {},
|
|
395
|
+
...c ? { userName: c } : {},
|
|
396
|
+
...d ? { userEmail: d } : {},
|
|
397
|
+
...s ? { scope: s } : {},
|
|
398
|
+
accent: x,
|
|
366
399
|
height: "100%"
|
|
367
400
|
}
|
|
368
401
|
) }),
|
|
@@ -371,9 +404,9 @@ function P({
|
|
|
371
404
|
] });
|
|
372
405
|
}
|
|
373
406
|
export {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
407
|
+
A as ChatApp,
|
|
408
|
+
J as ChatAppLauncher,
|
|
409
|
+
E as ChatWidget,
|
|
410
|
+
G as MarketplaceChat
|
|
378
411
|
};
|
|
379
412
|
//# sourceMappingURL=react.js.map
|