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