@paramms/chat-widget 1.0.15 → 1.0.17
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/chatlist.d.ts +3 -0
- package/dist/chatlist.js +35 -35
- package/dist/chatlist.js.map +1 -1
- package/dist/history.d.ts +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +570 -571
- package/dist/index.js.map +1 -1
- package/dist/protocol/entities.d.ts +8 -0
- package/dist/protocol/frames.d.ts +1 -0
- package/dist/react.d.ts +11 -4
- package/dist/react.js +195 -184
- package/dist/react.js.map +1 -1
- package/dist/uid.js +35 -35
- package/dist/uid.js.map +1 -1
- package/package.json +1 -1
|
@@ -80,6 +80,9 @@ export interface Conversation {
|
|
|
80
80
|
sentimentScore?: number;
|
|
81
81
|
/** Set once an SLA-breach escalation macro has fired, so it only fires once. */
|
|
82
82
|
slaEscalatedAt?: number;
|
|
83
|
+
/** If set, the conversation is snoozed until this Unix ms timestamp.
|
|
84
|
+
* Hidden from the inbox until the timestamp passes, then resurfaces. */
|
|
85
|
+
snoozedUntil?: number;
|
|
83
86
|
/** Page URL where the widget was open when the conversation started. */
|
|
84
87
|
pageUrl?: string;
|
|
85
88
|
/** Browser tab title at conversation start — gives agents context. */
|
|
@@ -110,3 +113,8 @@ export interface Subject {
|
|
|
110
113
|
createdAt: number;
|
|
111
114
|
updatedAt: number;
|
|
112
115
|
}
|
|
116
|
+
/** States in which a conversation is no longer "open": it's done with, so inbox
|
|
117
|
+
* / proactive sweeps skip it and load balancing frees the assigned agent. The
|
|
118
|
+
* single source of truth for "is this conversation finished?". */
|
|
119
|
+
export declare const TERMINAL_STATES: ReadonlySet<string>;
|
|
120
|
+
export declare function isTerminalState(state: string): boolean;
|
package/dist/react.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { type MountOptions } from './index.js';
|
|
|
2
2
|
interface BaseProps {
|
|
3
3
|
/** Relay WebSocket URL — set as NEXT_PUBLIC_RELAY_WS_URL in .env — required */
|
|
4
4
|
url: string;
|
|
5
|
+
/** HTTP(S) base for REST calls (history, uploads). Set when your REST API is
|
|
6
|
+
* on a different host/path than the WebSocket. Defaults to the WS origin. */
|
|
7
|
+
apiUrl?: string;
|
|
5
8
|
/** Your Relay profile ID — set as NEXT_PUBLIC_RELAY_PROFILE_ID in .env — required */
|
|
6
9
|
profileId: string;
|
|
7
10
|
/** Your logged-in user's stable ID. When omitted the widget automatically
|
|
@@ -64,7 +67,7 @@ export interface ChatWidgetProps extends BaseProps {
|
|
|
64
67
|
* />
|
|
65
68
|
* ```
|
|
66
69
|
*/
|
|
67
|
-
export declare function ChatWidget({ url, profileId, userId, userName, userEmail, userAvatar, contextTitle, contextSubtitle, contextStatus, subjectId, accent, launcher, position, quickReplies, height, i18n, translateLang, }: ChatWidgetProps): JSX.Element;
|
|
70
|
+
export declare function ChatWidget({ url, apiUrl, profileId, userId, userName, userEmail, userAvatar, contextTitle, contextSubtitle, contextStatus, subjectId, accent, launcher, position, quickReplies, height, i18n, translateLang, }: ChatWidgetProps): JSX.Element;
|
|
68
71
|
export interface MarketplaceChatProps extends BaseProps {
|
|
69
72
|
/** Unique ID for this listing — each listing gets its own thread.
|
|
70
73
|
* Omit for a general (non-item-specific) conversation. */
|
|
@@ -114,10 +117,12 @@ export interface MarketplaceChatProps extends BaseProps {
|
|
|
114
117
|
*
|
|
115
118
|
* Only `url` and `profileId` are required. All other props are optional.
|
|
116
119
|
*/
|
|
117
|
-
export declare function MarketplaceChat({ url, profileId, listingId, listingTitle, listingMeta, listingPrice, listingStatus, userId, userName, userEmail, userAvatar, accent, launcher, position, quickReplies, height, i18n, translateLang, }: MarketplaceChatProps): JSX.Element;
|
|
120
|
+
export declare function MarketplaceChat({ url, apiUrl, profileId, listingId, listingTitle, listingMeta, listingPrice, listingStatus, userId, userName, userEmail, userAvatar, accent, launcher, position, quickReplies, height, i18n, translateLang, }: MarketplaceChatProps): JSX.Element;
|
|
118
121
|
export interface ChatAppProps {
|
|
119
122
|
/** Relay WebSocket URL — required */
|
|
120
123
|
url: string;
|
|
124
|
+
/** HTTP(S) base for REST calls. Defaults to the WS origin. */
|
|
125
|
+
apiUrl?: string;
|
|
121
126
|
/** Your Relay profile ID — required */
|
|
122
127
|
profileId: string;
|
|
123
128
|
/** Your logged-in user's stable ID. Omit for anonymous (uses localStorage UID) */
|
|
@@ -160,10 +165,12 @@ export interface ChatAppProps {
|
|
|
160
165
|
* }
|
|
161
166
|
* ```
|
|
162
167
|
*/
|
|
163
|
-
export declare function ChatApp({ url, profileId, userId, userName, userEmail, accent, height, i18n, }: ChatAppProps): JSX.Element;
|
|
168
|
+
export declare function ChatApp({ url, apiUrl, profileId, userId, userName, userEmail, accent, height, i18n, }: ChatAppProps): JSX.Element;
|
|
164
169
|
export interface ChatAppLauncherProps {
|
|
165
170
|
/** Relay WebSocket URL — required */
|
|
166
171
|
url: string;
|
|
172
|
+
/** HTTP(S) base for REST calls. Defaults to the WS origin. */
|
|
173
|
+
apiUrl?: string;
|
|
167
174
|
/** Your Relay profile ID — required */
|
|
168
175
|
profileId: string;
|
|
169
176
|
/** Your logged-in user's stable ID */
|
|
@@ -215,5 +222,5 @@ export interface ChatAppLauncherProps {
|
|
|
215
222
|
* />
|
|
216
223
|
* ```
|
|
217
224
|
*/
|
|
218
|
-
export declare function ChatAppLauncher({ url, profileId, userId, userName, userEmail, accent, floating, position, label, panelWidth, panelHeight, }: ChatAppLauncherProps): JSX.Element;
|
|
225
|
+
export declare function ChatAppLauncher({ url, apiUrl, profileId, userId, userName, userEmail, accent, floating, position, label, panelWidth, panelHeight, }: ChatAppLauncherProps): JSX.Element;
|
|
219
226
|
export {};
|
package/dist/react.js
CHANGED
|
@@ -1,174 +1,182 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { mount as
|
|
4
|
-
function
|
|
5
|
-
url:
|
|
6
|
-
|
|
1
|
+
import { jsxs as j, jsx as u, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useRef as k, useEffect as W } from "react";
|
|
3
|
+
import { mount as D } from "./index.js";
|
|
4
|
+
function A({
|
|
5
|
+
url: b,
|
|
6
|
+
apiUrl: i,
|
|
7
|
+
profileId: a,
|
|
7
8
|
userId: e,
|
|
8
|
-
userName:
|
|
9
|
-
userEmail:
|
|
9
|
+
userName: l,
|
|
10
|
+
userEmail: c,
|
|
10
11
|
userAvatar: o,
|
|
11
|
-
contextTitle:
|
|
12
|
+
contextTitle: m,
|
|
12
13
|
contextSubtitle: y,
|
|
13
14
|
contextStatus: t,
|
|
14
|
-
subjectId:
|
|
15
|
-
accent:
|
|
15
|
+
subjectId: p,
|
|
16
|
+
accent: s,
|
|
16
17
|
launcher: n,
|
|
17
|
-
position:
|
|
18
|
-
quickReplies:
|
|
19
|
-
height:
|
|
20
|
-
i18n:
|
|
21
|
-
translateLang:
|
|
18
|
+
position: d,
|
|
19
|
+
quickReplies: f,
|
|
20
|
+
height: h = "100%",
|
|
21
|
+
i18n: g,
|
|
22
|
+
translateLang: r
|
|
22
23
|
}) {
|
|
23
|
-
const w =
|
|
24
|
-
return
|
|
25
|
-
var
|
|
24
|
+
const w = k(null), x = k(null);
|
|
25
|
+
return W(() => {
|
|
26
|
+
var v;
|
|
26
27
|
if (w.current)
|
|
27
|
-
return (
|
|
28
|
+
return (v = x.current) == null || v.close(), x.current = D({
|
|
28
29
|
el: w.current,
|
|
29
|
-
url:
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
url: b,
|
|
31
|
+
...i ? { apiUrl: i } : {},
|
|
32
|
+
profileId: a,
|
|
33
|
+
...p ? { subjectId: p } : {},
|
|
32
34
|
...e ? { token: e } : {},
|
|
33
|
-
...e ||
|
|
35
|
+
...e || l || c || o ? {
|
|
34
36
|
user: {
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
+
...l ? { name: l } : {},
|
|
38
|
+
...c ? { email: c } : {},
|
|
37
39
|
...o ? { avatar: o } : {}
|
|
38
40
|
}
|
|
39
41
|
} : {},
|
|
40
|
-
...
|
|
42
|
+
...m ? {
|
|
41
43
|
subject: {
|
|
42
|
-
title:
|
|
44
|
+
title: m,
|
|
43
45
|
...y ? { subtitle: y } : {},
|
|
44
46
|
...t ? { status: t } : {}
|
|
45
47
|
}
|
|
46
48
|
} : {},
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
...
|
|
50
|
-
...
|
|
51
|
-
...n ? { launcher: n, position:
|
|
49
|
+
...f ? { quickReplies: f } : {},
|
|
50
|
+
...s ? { accent: s } : {},
|
|
51
|
+
...r ? { translateLang: r } : {},
|
|
52
|
+
...g ? { i18n: g } : {},
|
|
53
|
+
...n ? { launcher: n, position: d ?? "bottom-right" } : {}
|
|
52
54
|
}), () => {
|
|
53
|
-
var
|
|
54
|
-
(
|
|
55
|
+
var C;
|
|
56
|
+
(C = x.current) == null || C.close(), x.current = null;
|
|
55
57
|
};
|
|
56
|
-
}, [
|
|
58
|
+
}, [b, i, a, p, e, l, c, s, n, d, r]), /* @__PURE__ */ u(
|
|
57
59
|
"div",
|
|
58
60
|
{
|
|
59
61
|
ref: w,
|
|
60
|
-
style: n ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height:
|
|
62
|
+
style: n ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: h, minHeight: h === "100%" ? "480px" : void 0 }
|
|
61
63
|
}
|
|
62
64
|
);
|
|
63
65
|
}
|
|
64
|
-
const
|
|
66
|
+
const T = [
|
|
65
67
|
"Is this still available?",
|
|
66
68
|
"Can I schedule a viewing?",
|
|
67
69
|
"What is your best price?"
|
|
68
70
|
];
|
|
69
|
-
function
|
|
70
|
-
url:
|
|
71
|
-
|
|
71
|
+
function K({
|
|
72
|
+
url: b,
|
|
73
|
+
apiUrl: i,
|
|
74
|
+
profileId: a,
|
|
72
75
|
listingId: e,
|
|
73
|
-
listingTitle:
|
|
74
|
-
listingMeta:
|
|
76
|
+
listingTitle: l,
|
|
77
|
+
listingMeta: c,
|
|
75
78
|
listingPrice: o,
|
|
76
|
-
listingStatus:
|
|
79
|
+
listingStatus: m,
|
|
77
80
|
userId: y,
|
|
78
81
|
userName: t,
|
|
79
|
-
userEmail:
|
|
80
|
-
userAvatar:
|
|
82
|
+
userEmail: p,
|
|
83
|
+
userAvatar: s,
|
|
81
84
|
accent: n,
|
|
82
|
-
launcher:
|
|
83
|
-
position:
|
|
84
|
-
quickReplies:
|
|
85
|
-
height:
|
|
86
|
-
i18n:
|
|
85
|
+
launcher: d,
|
|
86
|
+
position: f,
|
|
87
|
+
quickReplies: h,
|
|
88
|
+
height: g = "100%",
|
|
89
|
+
i18n: r,
|
|
87
90
|
translateLang: w
|
|
88
91
|
}) {
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
var
|
|
92
|
-
if (
|
|
93
|
-
return (
|
|
94
|
-
el:
|
|
95
|
-
url:
|
|
96
|
-
|
|
92
|
+
const x = k(null), v = k(null);
|
|
93
|
+
return W(() => {
|
|
94
|
+
var C;
|
|
95
|
+
if (x.current)
|
|
96
|
+
return (C = v.current) == null || C.close(), v.current = D({
|
|
97
|
+
el: x.current,
|
|
98
|
+
url: b,
|
|
99
|
+
...i ? { apiUrl: i } : {},
|
|
100
|
+
profileId: a,
|
|
97
101
|
...e ? { subjectId: `listing_${e}` } : {},
|
|
98
102
|
...y ? { token: y } : {},
|
|
99
|
-
...y || t ||
|
|
103
|
+
...y || t || p || s ? {
|
|
100
104
|
user: {
|
|
101
105
|
...t ? { name: t } : {},
|
|
102
|
-
...
|
|
103
|
-
...
|
|
106
|
+
...p ? { email: p } : {},
|
|
107
|
+
...s ? { avatar: s } : {},
|
|
104
108
|
...e ? { meta: { listingId: e } } : {}
|
|
105
109
|
}
|
|
106
110
|
} : {},
|
|
107
|
-
...
|
|
111
|
+
...l ? {
|
|
108
112
|
subject: {
|
|
109
|
-
title:
|
|
110
|
-
...
|
|
113
|
+
title: l,
|
|
114
|
+
...c ? { subtitle: c } : {},
|
|
111
115
|
...o ? { tags: [`$${o.toLocaleString()}`] } : {},
|
|
112
|
-
...
|
|
116
|
+
...m ? { status: m } : {}
|
|
113
117
|
}
|
|
114
118
|
} : {},
|
|
115
|
-
quickReplies:
|
|
119
|
+
quickReplies: h ?? T,
|
|
116
120
|
...n ? { accent: n } : {},
|
|
117
121
|
...w ? { translateLang: w } : {},
|
|
118
|
-
...
|
|
119
|
-
...
|
|
122
|
+
...r ? { i18n: r } : {},
|
|
123
|
+
...d ? { launcher: d, position: f ?? "bottom-right" } : {}
|
|
120
124
|
}), () => {
|
|
121
|
-
var
|
|
122
|
-
(
|
|
125
|
+
var z;
|
|
126
|
+
(z = v.current) == null || z.close(), v.current = null;
|
|
123
127
|
};
|
|
124
|
-
}, [
|
|
128
|
+
}, [b, i, a, e, y, t, p, n, d, f, w]), /* @__PURE__ */ u(
|
|
125
129
|
"div",
|
|
126
130
|
{
|
|
127
|
-
ref:
|
|
128
|
-
style:
|
|
131
|
+
ref: x,
|
|
132
|
+
style: d ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: g, minHeight: g === "100%" ? "480px" : void 0 }
|
|
129
133
|
}
|
|
130
134
|
);
|
|
131
135
|
}
|
|
132
|
-
function
|
|
133
|
-
url:
|
|
134
|
-
|
|
136
|
+
function F({
|
|
137
|
+
url: b,
|
|
138
|
+
apiUrl: i,
|
|
139
|
+
profileId: a,
|
|
135
140
|
userId: e,
|
|
136
|
-
userName:
|
|
137
|
-
userEmail:
|
|
141
|
+
userName: l,
|
|
142
|
+
userEmail: c,
|
|
138
143
|
accent: o,
|
|
139
|
-
height:
|
|
144
|
+
height: m = "100%",
|
|
140
145
|
i18n: y
|
|
141
146
|
}) {
|
|
142
|
-
const [t,
|
|
143
|
-
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
147
|
+
const [t, p] = L(null), s = k(null), n = k(null), d = k(null), f = k(null);
|
|
148
|
+
W(() => {
|
|
149
|
+
if (!s.current) return;
|
|
150
|
+
let g = !1;
|
|
151
|
+
return import("./chatlist.js").then(({ mountChatList: r }) => {
|
|
152
|
+
g || !s.current || (d.current = r({
|
|
153
|
+
el: s.current,
|
|
154
|
+
url: b,
|
|
155
|
+
...i ? { apiUrl: i } : {},
|
|
156
|
+
profileId: a,
|
|
157
|
+
onSelect: (w) => p(w),
|
|
158
|
+
...e ? { userId: e } : {},
|
|
159
|
+
...o ? { accent: o } : {},
|
|
160
|
+
...y ? { i18n: y } : {}
|
|
161
|
+
}));
|
|
162
|
+
}), () => {
|
|
163
|
+
var r;
|
|
164
|
+
g = !0, (r = d.current) == null || r.close(), d.current = null;
|
|
165
|
+
};
|
|
166
|
+
}, [b, a, e]), W(() => {
|
|
167
|
+
var g;
|
|
161
168
|
if (!(!n.current || !t))
|
|
162
|
-
return (
|
|
169
|
+
return (g = f.current) == null || g.close(), f.current = D({
|
|
163
170
|
el: n.current,
|
|
164
|
-
url:
|
|
165
|
-
|
|
171
|
+
url: b,
|
|
172
|
+
...i ? { apiUrl: i } : {},
|
|
173
|
+
profileId: a,
|
|
166
174
|
...t.subjectId ? { subjectId: t.subjectId } : {},
|
|
167
175
|
...e ? { token: e } : {},
|
|
168
|
-
...e ||
|
|
176
|
+
...e || l || c ? {
|
|
169
177
|
user: {
|
|
170
|
-
...
|
|
171
|
-
...
|
|
178
|
+
...l ? { name: l } : {},
|
|
179
|
+
...c ? { email: c } : {}
|
|
172
180
|
}
|
|
173
181
|
} : {},
|
|
174
182
|
...t.subjectTitle ? {
|
|
@@ -179,92 +187,94 @@ function $({
|
|
|
179
187
|
} : {},
|
|
180
188
|
...o ? { accent: o } : {}
|
|
181
189
|
}), () => {
|
|
182
|
-
var
|
|
183
|
-
(
|
|
190
|
+
var r;
|
|
191
|
+
(r = f.current) == null || r.close(), f.current = null;
|
|
184
192
|
};
|
|
185
193
|
}, [t == null ? void 0 : t.id]);
|
|
186
|
-
const
|
|
187
|
-
return /* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
width:
|
|
190
|
-
flex:
|
|
191
|
-
display:
|
|
194
|
+
const h = typeof window < "u" && window.innerWidth < 768;
|
|
195
|
+
return /* @__PURE__ */ j("div", { style: { display: "flex", width: "100%", height: m, minHeight: "400px", overflow: "hidden" }, children: [
|
|
196
|
+
/* @__PURE__ */ u("div", { style: {
|
|
197
|
+
width: h ? "100%" : "360px",
|
|
198
|
+
flex: h && t ? "none" : void 0,
|
|
199
|
+
display: h && t ? "none" : "flex",
|
|
192
200
|
flexDirection: "column",
|
|
193
|
-
borderRight:
|
|
201
|
+
borderRight: h ? "none" : "1px solid #e8eaed",
|
|
194
202
|
minWidth: 0
|
|
195
|
-
}, children: /* @__PURE__ */
|
|
196
|
-
t ? /* @__PURE__ */
|
|
197
|
-
|
|
203
|
+
}, children: /* @__PURE__ */ u("div", { ref: s, style: { width: "100%", height: "100%" } }) }),
|
|
204
|
+
t ? /* @__PURE__ */ j("div", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, position: "relative" }, children: [
|
|
205
|
+
h && /* @__PURE__ */ u(
|
|
198
206
|
"button",
|
|
199
207
|
{
|
|
200
|
-
onClick: () =>
|
|
208
|
+
onClick: () => p(null),
|
|
201
209
|
style: { position: "absolute", top: 12, left: 12, zIndex: 10, background: "none", border: "none", fontSize: 22, cursor: "pointer", color: "#1c1b1a" },
|
|
202
210
|
children: "←"
|
|
203
211
|
}
|
|
204
212
|
),
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
] }) : /* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ u("div", { ref: n, style: { width: "100%", height: "100%" } })
|
|
214
|
+
] }) : /* @__PURE__ */ u("div", { style: { flex: 1, display: h ? "none" : "flex", alignItems: "center", justifyContent: "center", color: "#9b9690", fontSize: 14 }, children: "Select a conversation" })
|
|
207
215
|
] });
|
|
208
216
|
}
|
|
209
|
-
function
|
|
210
|
-
url:
|
|
211
|
-
|
|
217
|
+
function P({
|
|
218
|
+
url: b,
|
|
219
|
+
apiUrl: i,
|
|
220
|
+
profileId: a,
|
|
212
221
|
userId: e,
|
|
213
|
-
userName:
|
|
214
|
-
userEmail:
|
|
222
|
+
userName: l,
|
|
223
|
+
userEmail: c,
|
|
215
224
|
accent: o = "#4F63F5",
|
|
216
|
-
floating:
|
|
225
|
+
floating: m = !0,
|
|
217
226
|
position: y = "bottom-right",
|
|
218
227
|
label: t,
|
|
219
|
-
panelWidth:
|
|
220
|
-
panelHeight:
|
|
228
|
+
panelWidth: p,
|
|
229
|
+
panelHeight: s = "600px"
|
|
221
230
|
}) {
|
|
222
|
-
const [n,
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
225
|
-
|
|
231
|
+
const [n, d] = L(!1), f = k(null), h = y === "bottom-right", r = t ?? (m ? "💬" : "Messages");
|
|
232
|
+
if (W(() => {
|
|
233
|
+
const R = (M) => {
|
|
234
|
+
M.key === "Escape" && d(!1);
|
|
226
235
|
};
|
|
227
|
-
return document.addEventListener("keydown",
|
|
228
|
-
}, []),
|
|
229
|
-
const
|
|
230
|
-
return /* @__PURE__ */
|
|
236
|
+
return document.addEventListener("keydown", R), () => document.removeEventListener("keydown", R);
|
|
237
|
+
}, []), m) {
|
|
238
|
+
const R = typeof window < "u" && window.innerWidth < 480, M = R ? "100vw" : p ?? "420px", B = R ? "100dvh" : s;
|
|
239
|
+
return /* @__PURE__ */ j("div", { style: {
|
|
231
240
|
position: "fixed",
|
|
232
|
-
[
|
|
241
|
+
[h ? "right" : "left"]: "20px",
|
|
233
242
|
bottom: "20px",
|
|
234
243
|
zIndex: 9999,
|
|
235
244
|
display: "flex",
|
|
236
245
|
flexDirection: "column",
|
|
237
|
-
alignItems:
|
|
246
|
+
alignItems: h ? "flex-end" : "flex-start",
|
|
238
247
|
gap: "12px"
|
|
239
248
|
}, children: [
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
width:
|
|
242
|
-
height:
|
|
243
|
-
borderRadius:
|
|
249
|
+
/* @__PURE__ */ u("div", { style: {
|
|
250
|
+
width: M,
|
|
251
|
+
height: B,
|
|
252
|
+
borderRadius: R ? "0" : "16px",
|
|
244
253
|
overflow: "hidden",
|
|
245
254
|
boxShadow: "0 8px 40px rgba(0,0,0,.18)",
|
|
246
255
|
background: "#fff",
|
|
247
256
|
display: n ? "flex" : "none",
|
|
248
257
|
flexDirection: "column",
|
|
249
|
-
transformOrigin: `bottom ${
|
|
258
|
+
transformOrigin: `bottom ${h ? "right" : "left"}`,
|
|
250
259
|
animation: n ? "ocl-pop-in .18s ease" : "none"
|
|
251
|
-
}, children: /* @__PURE__ */
|
|
252
|
-
|
|
260
|
+
}, children: /* @__PURE__ */ u(
|
|
261
|
+
F,
|
|
253
262
|
{
|
|
254
|
-
url:
|
|
255
|
-
|
|
263
|
+
url: b,
|
|
264
|
+
...i ? { apiUrl: i } : {},
|
|
265
|
+
profileId: a,
|
|
256
266
|
...e ? { userId: e } : {},
|
|
257
|
-
...
|
|
258
|
-
...
|
|
267
|
+
...l ? { userName: l } : {},
|
|
268
|
+
...c ? { userEmail: c } : {},
|
|
259
269
|
accent: o,
|
|
260
270
|
height: "100%"
|
|
261
271
|
}
|
|
262
272
|
) }),
|
|
263
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ u(
|
|
264
274
|
"button",
|
|
265
275
|
{
|
|
266
|
-
ref:
|
|
267
|
-
onClick: () =>
|
|
276
|
+
ref: f,
|
|
277
|
+
onClick: () => d((S) => !S),
|
|
268
278
|
style: {
|
|
269
279
|
width: "56px",
|
|
270
280
|
height: "56px",
|
|
@@ -278,27 +288,27 @@ function K({
|
|
|
278
288
|
boxShadow: "0 4px 16px rgba(0,0,0,.25)",
|
|
279
289
|
transition: "transform .15s"
|
|
280
290
|
},
|
|
281
|
-
onMouseEnter: (
|
|
282
|
-
|
|
291
|
+
onMouseEnter: (S) => {
|
|
292
|
+
S.target.style.transform = "scale(1.08)";
|
|
283
293
|
},
|
|
284
|
-
onMouseLeave: (
|
|
285
|
-
|
|
294
|
+
onMouseLeave: (S) => {
|
|
295
|
+
S.target.style.transform = "scale(1)";
|
|
286
296
|
},
|
|
287
|
-
children: n ? "✕" :
|
|
297
|
+
children: n ? "✕" : r
|
|
288
298
|
}
|
|
289
299
|
),
|
|
290
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ u("style", { children: "@keyframes ocl-pop-in { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }" })
|
|
291
301
|
] });
|
|
292
302
|
}
|
|
293
|
-
const w =
|
|
294
|
-
!n &&
|
|
295
|
-
},
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
303
|
+
const w = p ?? "420px", [x, v] = L(null), C = () => {
|
|
304
|
+
!n && f.current && v(f.current.getBoundingClientRect()), d((R) => !R);
|
|
305
|
+
}, z = x ? x.bottom + 8 : 0, H = x ? window.innerWidth - x.right : 0;
|
|
306
|
+
return /* @__PURE__ */ j($, { children: [
|
|
307
|
+
/* @__PURE__ */ j(
|
|
298
308
|
"button",
|
|
299
309
|
{
|
|
300
|
-
ref:
|
|
301
|
-
onClick:
|
|
310
|
+
ref: f,
|
|
311
|
+
onClick: C,
|
|
302
312
|
style: {
|
|
303
313
|
display: "inline-flex",
|
|
304
314
|
alignItems: "center",
|
|
@@ -315,50 +325,51 @@ function K({
|
|
|
315
325
|
},
|
|
316
326
|
children: [
|
|
317
327
|
"💬 ",
|
|
318
|
-
|
|
328
|
+
r
|
|
319
329
|
]
|
|
320
330
|
}
|
|
321
331
|
),
|
|
322
|
-
n &&
|
|
323
|
-
/* @__PURE__ */
|
|
332
|
+
n && x && /* @__PURE__ */ j($, { children: [
|
|
333
|
+
/* @__PURE__ */ u(
|
|
324
334
|
"div",
|
|
325
335
|
{
|
|
326
|
-
onClick: () =>
|
|
336
|
+
onClick: () => d(!1),
|
|
327
337
|
style: { position: "fixed", inset: 0, zIndex: 9998 }
|
|
328
338
|
}
|
|
329
339
|
),
|
|
330
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ u("div", { style: {
|
|
331
341
|
position: "fixed",
|
|
332
|
-
top:
|
|
333
|
-
right:
|
|
342
|
+
top: z,
|
|
343
|
+
right: H,
|
|
334
344
|
width: w,
|
|
335
|
-
height:
|
|
345
|
+
height: s,
|
|
336
346
|
borderRadius: "16px",
|
|
337
347
|
overflow: "hidden",
|
|
338
348
|
boxShadow: "0 8px 40px rgba(0,0,0,.2)",
|
|
339
349
|
background: "#fff",
|
|
340
350
|
zIndex: 9999,
|
|
341
351
|
animation: "ocl-slide-in .18s ease"
|
|
342
|
-
}, children: /* @__PURE__ */
|
|
343
|
-
|
|
352
|
+
}, children: /* @__PURE__ */ u(
|
|
353
|
+
F,
|
|
344
354
|
{
|
|
345
|
-
url:
|
|
346
|
-
|
|
355
|
+
url: b,
|
|
356
|
+
...i ? { apiUrl: i } : {},
|
|
357
|
+
profileId: a,
|
|
347
358
|
...e ? { userId: e } : {},
|
|
348
|
-
...
|
|
349
|
-
...
|
|
359
|
+
...l ? { userName: l } : {},
|
|
360
|
+
...c ? { userEmail: c } : {},
|
|
350
361
|
accent: o,
|
|
351
362
|
height: "100%"
|
|
352
363
|
}
|
|
353
364
|
) }),
|
|
354
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ u("style", { children: "@keyframes ocl-slide-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }" })
|
|
355
366
|
] })
|
|
356
367
|
] });
|
|
357
368
|
}
|
|
358
369
|
export {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
370
|
+
F as ChatApp,
|
|
371
|
+
P as ChatAppLauncher,
|
|
372
|
+
A as ChatWidget,
|
|
373
|
+
K as MarketplaceChat
|
|
363
374
|
};
|
|
364
375
|
//# sourceMappingURL=react.js.map
|