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