@sendbird/ai-agent-messenger-react 1.1.0 → 1.1.1
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/cjs/{DR--J0iY.cjs → 4USOA6cB.cjs} +26 -25
- package/dist/cjs/{DQtZKX7E.cjs → 56s3GVJ_.cjs} +1 -1
- package/dist/cjs/{DQ9PZuXI.cjs → C2iVxqfU.cjs} +1 -1
- package/dist/cjs/{C5P45HBc.cjs → CVXXGvT2.cjs} +1 -1
- package/dist/cjs/{5eIFdny1.cjs → DZu-bitL.cjs} +1 -1
- package/dist/cjs/{muE0PabX.cjs → Hose4Xqt.cjs} +1 -1
- package/dist/es/{B_yFQNmk.js → BovngiOZ.js} +984 -979
- package/dist/es/{Cfv5QpcS.js → CSc2-BOs.js} +1 -1
- package/dist/es/{xCNPjZNB.js → D_jG_XZn.js} +1 -1
- package/dist/es/{BvhxxGUf.js → Dde5r6cu.js} +1 -1
- package/dist/es/{BdwtEHgL.js → DeR_25I_.js} +1 -1
- package/dist/es/{CXSnn4qx.js → XE_dyn7i.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { createContext as ye, useContext as J, useEffect as R, useState as
|
|
3
|
-
import
|
|
4
|
-
import c, { css as k, ThemeProvider as
|
|
5
|
-
import { format as
|
|
6
|
-
import { enUS as
|
|
7
|
-
import { AIAgentModule as
|
|
8
|
-
import { useGroupChannelMessages as
|
|
9
|
-
import { GroupChannelModule as
|
|
10
|
-
import { MessageMetaArray as
|
|
11
|
-
import { isSameDay as
|
|
12
|
-
import { renderer as
|
|
13
|
-
import { createMessageTemplate as
|
|
14
|
-
import
|
|
15
|
-
import { createPortal as
|
|
16
|
-
import
|
|
2
|
+
import { createContext as ye, useContext as J, useEffect as R, useState as T, useId as mn, useRef as D, useCallback as P, useLayoutEffect as ge, lazy as C, Suspense as $e, useMemo as Ie, Component as mr, Fragment as Rt, useReducer as gr, forwardRef as pr, Children as hr } from "react";
|
|
3
|
+
import fr, { SendbirdProduct as br, DeviceOsPlatform as Nt, SendbirdPlatform as xr, ConnectionHandler as ut, SendbirdError as Er, SessionHandler as vr, LogLevel as gn, ConnectionState as yr } from "@sendbird/chat";
|
|
4
|
+
import c, { css as k, ThemeProvider as Cr, useTheme as mt, createGlobalStyle as Tr, StyleSheetManager as _r, keyframes as pn } from "styled-components";
|
|
5
|
+
import { format as hn, isSameMinute as Dt, isSameDay as Sr } from "date-fns";
|
|
6
|
+
import { enUS as wr } from "date-fns/locale/en-US";
|
|
7
|
+
import { AIAgentModule as kr, ConversationStatus as z, ConversationListOrder as Ar, ConversationType as Ir } from "@sendbird/chat/aiAgent";
|
|
8
|
+
import { useGroupChannelMessages as $r, useGroupChannelHandler as fn, useForceUpdate as Mr } from "@sendbird/uikit-tools";
|
|
9
|
+
import { GroupChannelModule as Or } from "@sendbird/chat/groupChannel";
|
|
10
|
+
import { MessageMetaArray as Lr, SendingStatus as Rr } from "@sendbird/chat/message";
|
|
11
|
+
import { isSameDay as Nr } from "date-fns/isSameDay";
|
|
12
|
+
import { renderer as Dr, parser as Br, MessageProvider as Pr } from "@sendbird/react-uikit-message-template-view";
|
|
13
|
+
import { createMessageTemplate as Fr } from "@sendbird/uikit-message-template";
|
|
14
|
+
import bn from "dompurify";
|
|
15
|
+
import { createPortal as Hr } from "react-dom";
|
|
16
|
+
import Ur from "@emotion/is-prop-valid";
|
|
17
17
|
const W = (e, t) => {
|
|
18
|
-
const n = ye(null), o = ({ children:
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
18
|
+
const n = ye(null), o = ({ children: s, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof s == "function" ? s(l) : s), i = ({ children: s }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof s == "function" ? s(l) : s : null), a = () => {
|
|
19
|
+
const s = J(n);
|
|
20
|
+
if (!s)
|
|
21
21
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
22
|
-
return
|
|
22
|
+
return s;
|
|
23
23
|
};
|
|
24
|
-
return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, i.displayName = `${e}Consumer`,
|
|
24
|
+
return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, i.displayName = `${e}Consumer`, a.displayName = `use${e}Context`, { Context: n, Provider: o, Consumer: i, useContext: a };
|
|
25
25
|
};
|
|
26
26
|
function Ce(e) {
|
|
27
27
|
const t = ye({
|
|
@@ -32,57 +32,57 @@ function Ce(e) {
|
|
|
32
32
|
updateComponent: () => {
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
function n({ children:
|
|
36
|
-
const [
|
|
37
|
-
Template:
|
|
35
|
+
function n({ children: a }) {
|
|
36
|
+
const [s, l] = T(() => e.template), [d, g] = T(e.components), m = {
|
|
37
|
+
Template: s,
|
|
38
38
|
updateTemplate: (p) => l(() => p),
|
|
39
39
|
components: d,
|
|
40
40
|
updateComponent: (p, h) => g((b) => ({ ...b, [p]: h }))
|
|
41
41
|
};
|
|
42
|
-
return /* @__PURE__ */ r.createElement(t.Provider, { value: m },
|
|
42
|
+
return /* @__PURE__ */ r.createElement(t.Provider, { value: m }, a);
|
|
43
43
|
}
|
|
44
|
-
function o({ template:
|
|
44
|
+
function o({ template: a, children: s }) {
|
|
45
45
|
const { updateTemplate: l } = J(t);
|
|
46
46
|
return R(() => {
|
|
47
|
-
|
|
48
|
-
}, [
|
|
47
|
+
a && l(a);
|
|
48
|
+
}, [a]), /* @__PURE__ */ r.createElement(r.Fragment, null, s);
|
|
49
49
|
}
|
|
50
|
-
function i({ children:
|
|
51
|
-
return /* @__PURE__ */ r.createElement(n, null,
|
|
50
|
+
function i({ children: a }) {
|
|
51
|
+
return /* @__PURE__ */ r.createElement(n, null, a);
|
|
52
52
|
}
|
|
53
|
-
return i.defaults = e, i.useContext = () => J(t), i.Context = t, i.Template = o, Object.keys(e.components).forEach((
|
|
54
|
-
i[
|
|
53
|
+
return i.defaults = e, i.useContext = () => J(t), i.Context = t, i.Template = o, Object.keys(e.components).forEach((a) => {
|
|
54
|
+
i[a] = function({
|
|
55
55
|
component: l
|
|
56
56
|
}) {
|
|
57
57
|
const { updateComponent: d } = J(t);
|
|
58
58
|
return R(() => {
|
|
59
|
-
l && d(
|
|
59
|
+
l && d(a, l);
|
|
60
60
|
}, [l]), null;
|
|
61
61
|
};
|
|
62
62
|
}), i;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function zr(...e) {
|
|
65
65
|
return function({ children: n }) {
|
|
66
66
|
return e.reduce((o, i) => /* @__PURE__ */ r.createElement(i, null, o), n);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
function ot() {
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Wr() {
|
|
72
72
|
const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
|
|
73
73
|
return e || t;
|
|
74
74
|
}
|
|
75
|
-
class
|
|
75
|
+
class xn {
|
|
76
76
|
constructor(t) {
|
|
77
77
|
this.logger = t, this.subscribers = {};
|
|
78
78
|
}
|
|
79
79
|
async send(t) {
|
|
80
|
-
const n =
|
|
80
|
+
const n = Vr(), o = this.subscribers[t.type];
|
|
81
81
|
if (o) {
|
|
82
82
|
this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`, t.payload);
|
|
83
|
-
const i = o.map((
|
|
84
|
-
await Promise.all(i).catch((
|
|
85
|
-
this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`,
|
|
83
|
+
const i = o.map((a) => a(t.payload));
|
|
84
|
+
await Promise.all(i).catch((a) => {
|
|
85
|
+
this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`, a);
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
return n.resolve(), n.promise;
|
|
@@ -94,14 +94,14 @@ class bn {
|
|
|
94
94
|
this.subscribers[t] && (this.subscribers[t] = this.subscribers[t].filter((o) => o !== n));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
const
|
|
97
|
+
const Vr = () => {
|
|
98
98
|
let e = ot, t = ot;
|
|
99
99
|
return { promise: new Promise((o, i) => {
|
|
100
100
|
e = o, t = i;
|
|
101
101
|
}), resolve: e, reject: t };
|
|
102
|
-
},
|
|
103
|
-
var
|
|
104
|
-
class
|
|
102
|
+
}, Gr = "1.1.0", ke = "sb-agent", jr = Gr;
|
|
103
|
+
var En = /* @__PURE__ */ ((e) => (e[e.VERBOSE = 0] = "VERBOSE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.NONE = 5] = "NONE", e))(En || {});
|
|
104
|
+
class vn {
|
|
105
105
|
constructor(t) {
|
|
106
106
|
this.level = t;
|
|
107
107
|
}
|
|
@@ -121,63 +121,63 @@ class En {
|
|
|
121
121
|
this.level <= 4 && console.error(`[${ke}/error]`, ...t);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
const o =
|
|
124
|
+
function Bt(e, t, n) {
|
|
125
|
+
const o = fr.init({
|
|
126
126
|
appId: e,
|
|
127
|
-
modules: [new
|
|
127
|
+
modules: [new Or(), new kr()],
|
|
128
128
|
localCacheEnabled: !0,
|
|
129
129
|
...n
|
|
130
130
|
});
|
|
131
131
|
return o.addSendbirdExtensions(
|
|
132
|
-
[{ version:
|
|
132
|
+
[{ version: jr, product: br.AI_AGENT, platform: t.platform }],
|
|
133
133
|
{ platform: t.deviceOSPlatform, version: t.deviceOSVersion },
|
|
134
134
|
t.customData
|
|
135
135
|
) || console.warn("Invalid Sendbird Extensions", t), o;
|
|
136
136
|
}
|
|
137
137
|
const {
|
|
138
|
-
Provider:
|
|
138
|
+
Provider: Kr,
|
|
139
139
|
useContext: Ze
|
|
140
140
|
} = W("AIAgent");
|
|
141
|
-
function
|
|
141
|
+
function Zr({
|
|
142
142
|
appId: e,
|
|
143
143
|
aiAgentId: t,
|
|
144
144
|
language: n,
|
|
145
145
|
countryCode: o,
|
|
146
146
|
context: i,
|
|
147
|
-
chatSDK:
|
|
148
|
-
chatParams:
|
|
147
|
+
chatSDK: a,
|
|
148
|
+
chatParams: s,
|
|
149
149
|
dispatcher: l,
|
|
150
150
|
logger: d,
|
|
151
151
|
children: g,
|
|
152
152
|
extensions: m = {
|
|
153
|
-
platform:
|
|
154
|
-
deviceOSPlatform:
|
|
153
|
+
platform: xr.JS,
|
|
154
|
+
deviceOSPlatform: Wr() ? Nt.MOBILE_WEB : Nt.WEB
|
|
155
155
|
}
|
|
156
156
|
}) {
|
|
157
|
-
const [p, h] =
|
|
158
|
-
const b = d ?? new En
|
|
157
|
+
const [p, h] = T(() => {
|
|
158
|
+
const b = d ?? new vn(En.WARN), x = l ?? new xn(b);
|
|
159
159
|
return {
|
|
160
160
|
appId: e,
|
|
161
161
|
aiAgentId: t,
|
|
162
162
|
language: n,
|
|
163
163
|
countryCode: o,
|
|
164
164
|
context: i,
|
|
165
|
-
chatSDK:
|
|
165
|
+
chatSDK: a ?? Bt(e, m, s),
|
|
166
166
|
logger: b,
|
|
167
167
|
dispatcher: x
|
|
168
168
|
};
|
|
169
169
|
});
|
|
170
|
-
return (n !== p.language || o !== p.countryCode) && h((b) => ({ ...b, language: n, countryCode: o, context: i })),
|
|
170
|
+
return (n !== p.language || o !== p.countryCode) && h((b) => ({ ...b, language: n, countryCode: o, context: i })), a && a !== p.chatSDK ? h((b) => ({ ...b, aiAgentId: t, chatSDK: a })) : !a && p.chatSDK.appId !== e && h((b) => ({
|
|
171
171
|
...b,
|
|
172
172
|
aiAgentId: t,
|
|
173
|
-
chatSDK:
|
|
173
|
+
chatSDK: Bt(e, m, { newInstance: !0, ...s })
|
|
174
174
|
})), R(() => () => {
|
|
175
175
|
p.chatSDK.disconnectWebSocket();
|
|
176
|
-
}, [p.chatSDK]), /* @__PURE__ */ r.createElement(
|
|
176
|
+
}, [p.chatSDK]), /* @__PURE__ */ r.createElement(Kr, { value: p }, g);
|
|
177
177
|
}
|
|
178
|
-
const
|
|
178
|
+
const Yr = (e, t, n) => $r(e, t, { ...n, strictStreamingOrder: !0 });
|
|
179
179
|
var it = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(it || {});
|
|
180
|
-
class
|
|
180
|
+
class qr {
|
|
181
181
|
constructor(t = {}) {
|
|
182
182
|
this.payload = t;
|
|
183
183
|
}
|
|
@@ -185,27 +185,27 @@ class Yr {
|
|
|
185
185
|
return JSON.stringify({ type: this.type, payload: this.payload });
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
class
|
|
188
|
+
class Jr extends qr {
|
|
189
189
|
constructor() {
|
|
190
190
|
super(...arguments), this.type = "conv.close";
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
const
|
|
194
|
-
CloseConversation: () => new
|
|
193
|
+
const Xr = {
|
|
194
|
+
CloseConversation: () => new Jr()
|
|
195
195
|
}, {
|
|
196
|
-
Provider:
|
|
196
|
+
Provider: Qr
|
|
197
197
|
} = W("AIAgentConversation");
|
|
198
|
-
function
|
|
198
|
+
function eo({
|
|
199
199
|
children: e,
|
|
200
200
|
channelUrl: t,
|
|
201
201
|
onChannelDeleted: n,
|
|
202
202
|
onMessagesUpdated: o,
|
|
203
203
|
onConversationClosedViaDispatcher: i,
|
|
204
|
-
onBeforeSendMessage:
|
|
205
|
-
onAfterSendMessage:
|
|
204
|
+
onBeforeSendMessage: a,
|
|
205
|
+
onAfterSendMessage: s = ot
|
|
206
206
|
}) {
|
|
207
207
|
var v;
|
|
208
|
-
const { chatSDK: l, logger: d, dispatcher: g } = Ze(), { channel: m, channelFetchError: p, fetchChannel: h } =
|
|
208
|
+
const { chatSDK: l, logger: d, dispatcher: g } = Ze(), { channel: m, channelFetchError: p, fetchChannel: h } = to(t), b = Yr(l, m, {
|
|
209
209
|
shouldCountNewMessages: () => !1,
|
|
210
210
|
onChannelDeleted: n,
|
|
211
211
|
onMessagesReceived: o,
|
|
@@ -233,50 +233,50 @@ function Qr({
|
|
|
233
233
|
loadPrevious: () => b.loadPrevious(),
|
|
234
234
|
loadNext: () => b.loadNext(),
|
|
235
235
|
sendUserMessage: async (f) => {
|
|
236
|
-
|
|
237
|
-
const y = await b.sendUserMessage(f,
|
|
238
|
-
return
|
|
236
|
+
a && (f = await a(f));
|
|
237
|
+
const y = await b.sendUserMessage(f, s);
|
|
238
|
+
return s == null || s(y), y;
|
|
239
239
|
},
|
|
240
240
|
sendFileMessage: async (f) => {
|
|
241
|
-
|
|
242
|
-
const y = await b.sendFileMessage(f,
|
|
243
|
-
return
|
|
241
|
+
a && (f = await a(f));
|
|
242
|
+
const y = await b.sendFileMessage(f, s);
|
|
243
|
+
return s == null || s(y), y;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
|
-
return /* @__PURE__ */ r.createElement(
|
|
247
|
+
return /* @__PURE__ */ r.createElement(Qr, { value: x }, e);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
const { chatSDK: t, logger: n } = Ze(), [o, i] =
|
|
249
|
+
function to(e) {
|
|
250
|
+
const { chatSDK: t, logger: n } = Ze(), [o, i] = T(void 0), [a, s] = T(void 0);
|
|
251
251
|
async function l() {
|
|
252
|
-
if (n.debug("conversation.fetchChannel: start"), i(void 0),
|
|
252
|
+
if (n.debug("conversation.fetchChannel: start"), i(void 0), s(void 0), e)
|
|
253
253
|
try {
|
|
254
254
|
n.debug("conversation.fetchChannel: get channel", e);
|
|
255
255
|
const d = await t.groupChannel.getChannel(e);
|
|
256
256
|
i(d);
|
|
257
|
-
const g = new
|
|
257
|
+
const g = new ut({ onReconnectSucceeded: () => d.refresh() });
|
|
258
258
|
t.addConnectionHandler("sba-refresh", g), n.debug("conversation.fetchChannel: fetched channel", d);
|
|
259
259
|
} catch (d) {
|
|
260
|
-
d instanceof
|
|
260
|
+
d instanceof Er && s(d), n.error("conversation.fetchChannel: error", d);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
return R(() => {
|
|
264
264
|
l();
|
|
265
265
|
}, [e, t]), {
|
|
266
266
|
channel: o,
|
|
267
|
-
channelFetchError:
|
|
267
|
+
channelFetchError: a,
|
|
268
268
|
fetchChannel: l
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
const
|
|
272
|
-
const n =
|
|
271
|
+
const no = (e, t) => {
|
|
272
|
+
const n = mn(), [o, i] = T(!1), [a, s] = T(null), [l, d] = T([]), [g, m] = T(null), p = D(!1), h = P(async () => {
|
|
273
273
|
if (!p.current && e.currentUser) {
|
|
274
|
-
p.current = !0, i(!1),
|
|
274
|
+
p.current = !0, i(!1), s(null), d([]);
|
|
275
275
|
try {
|
|
276
276
|
const x = e.aiAgent.createConversationListQuery(t), v = await x.next();
|
|
277
|
-
d(v), m(x),
|
|
277
|
+
d(v), m(x), s(null);
|
|
278
278
|
} catch (x) {
|
|
279
|
-
m(null),
|
|
279
|
+
m(null), s(x);
|
|
280
280
|
} finally {
|
|
281
281
|
i(!0), p.current = !1;
|
|
282
282
|
}
|
|
@@ -287,22 +287,22 @@ const to = (e, t) => {
|
|
|
287
287
|
}).catch(() => {
|
|
288
288
|
});
|
|
289
289
|
}, [g]);
|
|
290
|
-
return R(() => (e.addConnectionHandler(n, new
|
|
290
|
+
return R(() => (e.addConnectionHandler(n, new ut({ onConnected: () => h() })), () => e.removeConnectionHandler(n)), [e, n, h]), R(() => {
|
|
291
291
|
h();
|
|
292
292
|
}, [h]), {
|
|
293
293
|
initialized: o,
|
|
294
|
-
error:
|
|
294
|
+
error: a,
|
|
295
295
|
conversations: l,
|
|
296
296
|
loadMore: b
|
|
297
297
|
};
|
|
298
298
|
}, {
|
|
299
|
-
Provider:
|
|
299
|
+
Provider: ro
|
|
300
300
|
} = W("AIAgentConversationList");
|
|
301
|
-
function
|
|
302
|
-
const { chatSDK: t, aiAgentId: n } = Ze(), o =
|
|
301
|
+
function oo({ children: e }) {
|
|
302
|
+
const { chatSDK: t, aiAgentId: n } = Ze(), o = no(t, {
|
|
303
303
|
aiAgentId: n,
|
|
304
304
|
status: z.CLOSED,
|
|
305
|
-
order:
|
|
305
|
+
order: Ar.UPDATED_AT,
|
|
306
306
|
reverse: !0
|
|
307
307
|
}), i = {
|
|
308
308
|
listSource: {
|
|
@@ -312,18 +312,18 @@ function ro({ children: e }) {
|
|
|
312
312
|
loadMore: () => o.loadMore()
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
|
-
return /* @__PURE__ */ r.createElement(
|
|
315
|
+
return /* @__PURE__ */ r.createElement(ro, { value: i }, e);
|
|
316
316
|
}
|
|
317
317
|
const st = {
|
|
318
318
|
DEFAULT_BOT_MSG_BG: "#eeeeee",
|
|
319
319
|
WHITE: "#ffffff",
|
|
320
320
|
BLACK: "#000000"
|
|
321
321
|
};
|
|
322
|
-
function
|
|
322
|
+
function yn(e) {
|
|
323
323
|
return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
const t =
|
|
325
|
+
function io(e) {
|
|
326
|
+
const t = yn(e);
|
|
327
327
|
return [
|
|
328
328
|
parseInt(t.slice(1, 3), 16),
|
|
329
329
|
// r
|
|
@@ -333,33 +333,33 @@ function oo(e) {
|
|
|
333
333
|
// b
|
|
334
334
|
];
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function so(e) {
|
|
337
337
|
return `#${e.map((t) => t.toString(16).padStart(2, "0")).join("")}`;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function ao(e, t, n) {
|
|
340
340
|
e /= 255, t /= 255, n /= 255;
|
|
341
|
-
const o = Math.max(e, t, n), i = Math.min(e, t, n),
|
|
342
|
-
let
|
|
341
|
+
const o = Math.max(e, t, n), i = Math.min(e, t, n), a = o - i;
|
|
342
|
+
let s = 0, l = 0;
|
|
343
343
|
const d = (o + i) / 2;
|
|
344
|
-
return o !== i && (l = d > 0.5 ?
|
|
344
|
+
return o !== i && (l = d > 0.5 ? a / (2 - o - i) : a / (o + i)), o === e ? s = (t - n) / a + (t < n ? 6 : 0) : o === t ? s = (n - e) / a + 2 : o === n && (s = (e - t) / a + 4), s /= 6, [s, l, d];
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
let o, i,
|
|
346
|
+
function lo(e, t, n) {
|
|
347
|
+
let o, i, a;
|
|
348
348
|
if (t === 0)
|
|
349
|
-
o = i =
|
|
349
|
+
o = i = a = n;
|
|
350
350
|
else {
|
|
351
|
-
const
|
|
351
|
+
const s = function(m, p, h) {
|
|
352
352
|
return h < 0 && (h += 1), h > 1 && (h -= 1), h < 0.16666666666666666 ? m + (p - m) * 6 * h : h < 0.5 ? p : h < 0.6666666666666666 ? m + (p - m) * (0.6666666666666666 - h) * 6 : m;
|
|
353
353
|
}, l = n < 0.5 ? n * (1 + t) : n + t - n * t, d = 2 * n - l;
|
|
354
|
-
o =
|
|
354
|
+
o = s(d, l, e + 1 / 3), i = s(d, l, e), a = s(d, l, e - 1 / 3);
|
|
355
355
|
}
|
|
356
|
-
return [Math.round(o * 255), Math.round(i * 255), Math.round(
|
|
356
|
+
return [Math.round(o * 255), Math.round(i * 255), Math.round(a * 255)];
|
|
357
357
|
}
|
|
358
358
|
function De(e, t, n) {
|
|
359
|
-
const [o, i,
|
|
360
|
-
return
|
|
359
|
+
const [o, i, a] = io(e), [s, l, d] = ao(o, i, a), g = Math.max(0, Math.min(1, d * t)), m = Math.max(0, Math.min(1, l * n)), [p, h, b] = lo(s, m, g);
|
|
360
|
+
return so([Math.round(p), Math.round(h), Math.round(b)]);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function co(e, t = "light") {
|
|
363
363
|
return {
|
|
364
364
|
extraDark: De(e, 0.6, 1.2),
|
|
365
365
|
dark: De(e, 0.85, 1.1),
|
|
@@ -369,10 +369,10 @@ function lo(e, t = "light") {
|
|
|
369
369
|
};
|
|
370
370
|
}
|
|
371
371
|
function at(e) {
|
|
372
|
-
const t =
|
|
373
|
-
return o * 0.299 + i * 0.587 +
|
|
372
|
+
const t = yn(e), n = 149, o = +`0x${t[1]}${t[2]}`, i = +`0x${t[3]}${t[4]}`, a = +`0x${t[5]}${t[6]}`;
|
|
373
|
+
return o * 0.299 + i * 0.587 + a * 0.114 > n ? st.BLACK : st.WHITE;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function uo(e, t, n, o, i) {
|
|
376
376
|
return {
|
|
377
377
|
base: {
|
|
378
378
|
primary: t,
|
|
@@ -401,7 +401,7 @@ function co(e, t, n, o, i) {
|
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
const
|
|
404
|
+
const mo = (e, t, n, o, i) => ({
|
|
405
405
|
base: {
|
|
406
406
|
primary: t,
|
|
407
407
|
primaryContrastContent: n,
|
|
@@ -494,8 +494,8 @@ const uo = (e, t, n, o, i) => ({
|
|
|
494
494
|
caption3: { fontSize: 11, fontWeight: 700 },
|
|
495
495
|
caption4: { fontSize: 11, fontWeight: 400 }
|
|
496
496
|
};
|
|
497
|
-
function
|
|
498
|
-
const t =
|
|
497
|
+
function Pt(e) {
|
|
498
|
+
const t = go(e), { colors: n, aiAgentColorVariables: o } = po(e, t), i = fo(e);
|
|
499
499
|
return {
|
|
500
500
|
selectedTheme: e.selectedTheme,
|
|
501
501
|
palette: t,
|
|
@@ -504,51 +504,58 @@ function Bt(e) {
|
|
|
504
504
|
typography: i
|
|
505
505
|
};
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
const o = t != null && t.primary ? t.primary : n ? n === Be.primary.main ? Be.primary :
|
|
507
|
+
function go({ selectedTheme: e, palette: t, primary: n }) {
|
|
508
|
+
const o = t != null && t.primary ? t.primary : n ? n === Be.primary.main ? Be.primary : co(n, e) : Be.primary;
|
|
509
509
|
return {
|
|
510
510
|
...Be,
|
|
511
511
|
primary: o,
|
|
512
512
|
...t
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const
|
|
515
|
+
function po({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, i) {
|
|
516
|
+
const a = i.primary.main, s = t ?? at(a), l = n ?? st.DEFAULT_BOT_MSG_BG, d = o ?? at(l);
|
|
517
517
|
return {
|
|
518
|
-
colors: (e === "light" ?
|
|
518
|
+
colors: (e === "light" ? uo : mo)(
|
|
519
519
|
i,
|
|
520
|
-
s,
|
|
521
520
|
a,
|
|
521
|
+
s,
|
|
522
522
|
l,
|
|
523
523
|
d
|
|
524
524
|
),
|
|
525
525
|
aiAgentColorVariables: {
|
|
526
|
-
primary_color:
|
|
526
|
+
primary_color: a,
|
|
527
527
|
bot_message_bg_color: l,
|
|
528
|
-
primary_contrast_color:
|
|
528
|
+
primary_contrast_color: s,
|
|
529
529
|
bot_message_bg_contrast_color: d
|
|
530
530
|
}
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function ho(e, t, n) {
|
|
534
|
+
const o = { ...e };
|
|
535
|
+
return n.forEach((i) => {
|
|
536
|
+
const a = t[i];
|
|
537
|
+
a != null && (o[i] = a);
|
|
538
|
+
}), o;
|
|
539
|
+
}
|
|
540
|
+
function fo({ typography: e }) {
|
|
534
541
|
if (!e)
|
|
535
542
|
return Qe;
|
|
536
543
|
const t = { ...Qe };
|
|
537
544
|
return Object.keys(e).forEach((n) => {
|
|
538
545
|
const o = e[n];
|
|
539
546
|
if (o && typeof o == "object") {
|
|
540
|
-
const
|
|
541
|
-
|
|
547
|
+
const i = Qe[n], a = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
|
|
548
|
+
t[n] = ho(i, o, a);
|
|
542
549
|
}
|
|
543
550
|
}), t;
|
|
544
551
|
}
|
|
545
552
|
const {
|
|
546
|
-
Provider:
|
|
547
|
-
useContext:
|
|
553
|
+
Provider: bo,
|
|
554
|
+
useContext: Cn
|
|
548
555
|
} = W("AIAgentTheme");
|
|
549
|
-
function
|
|
550
|
-
const [
|
|
551
|
-
() =>
|
|
556
|
+
function xo({ logger: e, palette: t, typography: n, appearance: o, children: i }) {
|
|
557
|
+
const [a, s] = T(
|
|
558
|
+
() => Pt({
|
|
552
559
|
selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
|
|
553
560
|
palette: t,
|
|
554
561
|
typography: n,
|
|
@@ -564,16 +571,16 @@ function fo({ logger: e, palette: t, typography: n, appearance: o, children: i }
|
|
|
564
571
|
botMessageBackgroundContrast: void 0
|
|
565
572
|
};
|
|
566
573
|
!h.primary && (p != null && p.primaryColor) && (h.primary = p.primaryColor, h.primaryContrast = p.primaryContrastColor), !h.botMessageBackground && (p != null && p.botMessageBackgroundColor) && (h.botMessageBackground = p.botMessageBackgroundColor, h.botMessageBackgroundContrast = p.botMessageBackgroundContrastColor);
|
|
567
|
-
const b =
|
|
568
|
-
|
|
574
|
+
const b = Pt({ selectedTheme: m, palette: t, typography: n, ...h });
|
|
575
|
+
s(b), e == null || e.info("theme.update:", m);
|
|
569
576
|
},
|
|
570
577
|
[o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor, t, n, e]
|
|
571
578
|
);
|
|
572
579
|
return R(() => {
|
|
573
|
-
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(
|
|
574
|
-
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(
|
|
580
|
+
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(a.selectedTheme);
|
|
581
|
+
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(bo, { value: { theme: a, updateTheme: l } }, i);
|
|
575
582
|
}
|
|
576
|
-
const
|
|
583
|
+
const Tn = (e) => {
|
|
577
584
|
try {
|
|
578
585
|
const t = JSON.parse(e);
|
|
579
586
|
return typeof t == "string" ? JSON.stringify(t).slice(1, -1) : e.trim();
|
|
@@ -581,70 +588,70 @@ const Cn = (e) => {
|
|
|
581
588
|
return JSON.stringify(e).slice(1, -1);
|
|
582
589
|
}
|
|
583
590
|
}, Me = (e) => JSON.parse(e), Ye = (e) => JSON.parse(e);
|
|
584
|
-
function
|
|
591
|
+
function Eo(e, t) {
|
|
585
592
|
const [n, o] = t.split(",").map((i) => i.trim());
|
|
586
593
|
return e === "dark" && o || n;
|
|
587
594
|
}
|
|
588
|
-
function
|
|
595
|
+
function vo(e) {
|
|
589
596
|
const t = {};
|
|
590
597
|
function n(o, i = "") {
|
|
591
|
-
for (const [
|
|
592
|
-
const l = i ? `${i}.${
|
|
593
|
-
|
|
598
|
+
for (const [a, s] of Object.entries(o)) {
|
|
599
|
+
const l = i ? `${i}.${a}` : a;
|
|
600
|
+
s && typeof s == "object" && !Array.isArray(s) ? n(s, l) : t[l] = s;
|
|
594
601
|
}
|
|
595
602
|
}
|
|
596
603
|
return n(e), t;
|
|
597
604
|
}
|
|
598
|
-
function
|
|
605
|
+
function gt({
|
|
599
606
|
template: e,
|
|
600
607
|
variables: t,
|
|
601
608
|
variableKeyPattern: n,
|
|
602
609
|
variableValueTransformer: o
|
|
603
610
|
}) {
|
|
604
|
-
return Object.entries(t).reduce((i, [
|
|
605
|
-
if (!o && !["number", "boolean", "string"].includes(typeof
|
|
611
|
+
return Object.entries(t).reduce((i, [a, s]) => {
|
|
612
|
+
if (!o && !["number", "boolean", "string"].includes(typeof s))
|
|
606
613
|
throw new Error("If transformer is not provided, value must be a {string, number, or boolean}");
|
|
607
|
-
const l = o ? o(
|
|
608
|
-
return i.replace(d,
|
|
614
|
+
const l = o ? o(s) : String(s), d = n(a);
|
|
615
|
+
return i.replace(d, Tn(l));
|
|
609
616
|
}, e);
|
|
610
617
|
}
|
|
611
|
-
async function
|
|
618
|
+
async function yo({
|
|
612
619
|
template: e,
|
|
613
620
|
variables: t,
|
|
614
621
|
variableKeyPattern: n,
|
|
615
622
|
variableValueTransformer: o
|
|
616
623
|
}) {
|
|
617
624
|
return (await Promise.all(
|
|
618
|
-
Object.entries(t).map(async ([
|
|
619
|
-
const l = await o(
|
|
620
|
-
return { regex: n(
|
|
625
|
+
Object.entries(t).map(async ([a, s]) => {
|
|
626
|
+
const l = await o(s);
|
|
627
|
+
return { regex: n(a), transformedValue: l };
|
|
621
628
|
})
|
|
622
|
-
)).reduce((
|
|
629
|
+
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s, Tn(l)), e);
|
|
623
630
|
}
|
|
624
|
-
const
|
|
631
|
+
const Co = (e) => ({
|
|
625
632
|
setTemplate: (t, n) => e.onSetTemplate(t, n),
|
|
626
633
|
getTemplate: (t) => e.onGetTemplate(t),
|
|
627
634
|
setCachedToken: (t) => e.onSetCachedToken(t),
|
|
628
635
|
getCachedToken: () => e.onGetCachedToken(),
|
|
629
636
|
clear: () => e.onClear()
|
|
630
637
|
}), {
|
|
631
|
-
Provider:
|
|
632
|
-
useContext:
|
|
638
|
+
Provider: To,
|
|
639
|
+
useContext: _n
|
|
633
640
|
} = W("MessageCacheTemplate");
|
|
634
|
-
function
|
|
641
|
+
function _o({ logger: e, storage: t, children: n }) {
|
|
635
642
|
const o = P(
|
|
636
|
-
(
|
|
643
|
+
(s) => {
|
|
637
644
|
var g, m;
|
|
638
|
-
const l = (m = (g =
|
|
645
|
+
const l = (m = (g = s.appInfo) == null ? void 0 : g.aiAgentInfo) == null ? void 0 : m.templateListToken;
|
|
639
646
|
if (!l) return !1;
|
|
640
647
|
const d = t.getCachedToken();
|
|
641
648
|
return d ? l !== d : !0;
|
|
642
649
|
},
|
|
643
650
|
[t]
|
|
644
651
|
), i = P(
|
|
645
|
-
async (
|
|
652
|
+
async (s) => {
|
|
646
653
|
try {
|
|
647
|
-
const { templates: l, token: d } = await
|
|
654
|
+
const { templates: l, token: d } = await s.aiAgent.getMessageTemplates({ limit: 20 });
|
|
648
655
|
for (const { template: g } of l) {
|
|
649
656
|
const { key: m } = Me(g);
|
|
650
657
|
t.setTemplate(m, g);
|
|
@@ -655,12 +662,12 @@ function Co({ logger: e, storage: t, children: n }) {
|
|
|
655
662
|
}
|
|
656
663
|
},
|
|
657
664
|
[t, e]
|
|
658
|
-
),
|
|
665
|
+
), a = P(() => {
|
|
659
666
|
t.clear();
|
|
660
667
|
}, [t]);
|
|
661
|
-
return /* @__PURE__ */ r.createElement(
|
|
668
|
+
return /* @__PURE__ */ r.createElement(To, { value: { shouldSyncCachedTemplate: o, syncCachedTemplates: i, clearCachedTemplates: a, storage: t } }, n);
|
|
662
669
|
}
|
|
663
|
-
function
|
|
670
|
+
function So(e) {
|
|
664
671
|
let t = "pending", n = e.then((o) => {
|
|
665
672
|
t = "resolved", n = o;
|
|
666
673
|
}).catch((o) => {
|
|
@@ -675,12 +682,12 @@ function To(e) {
|
|
|
675
682
|
};
|
|
676
683
|
}
|
|
677
684
|
const {
|
|
678
|
-
Provider:
|
|
679
|
-
useContext:
|
|
685
|
+
Provider: wo,
|
|
686
|
+
useContext: Sn
|
|
680
687
|
} = W("MessageTemplateFetching");
|
|
681
|
-
function
|
|
682
|
-
const n = D({}), o = D({}), [i,
|
|
683
|
-
|
|
688
|
+
function ko({ children: e, internalVariables: t }) {
|
|
689
|
+
const n = D({}), o = D({}), [i, a] = T({}), s = P((g, m) => {
|
|
690
|
+
a((p) => ({
|
|
684
691
|
...p,
|
|
685
692
|
[g]: { fetching: !1, error: !1, ...p[g], ...m }
|
|
686
693
|
}));
|
|
@@ -695,22 +702,22 @@ function So({ children: e, internalVariables: t }) {
|
|
|
695
702
|
if (b) return b;
|
|
696
703
|
const x = o.current[p];
|
|
697
704
|
if (x) return x;
|
|
698
|
-
h ||
|
|
705
|
+
h || s(p, { fetching: !0 });
|
|
699
706
|
const v = g(p).catch((f) => {
|
|
700
|
-
throw h ||
|
|
707
|
+
throw h || s(p, { error: !0 }), f;
|
|
701
708
|
}).finally(() => {
|
|
702
|
-
h ||
|
|
709
|
+
h || s(p, { fetching: !1 }), delete o.current[p];
|
|
703
710
|
});
|
|
704
711
|
return o.current[p] = v, v;
|
|
705
712
|
},
|
|
706
|
-
[
|
|
713
|
+
[s]
|
|
707
714
|
), d = {
|
|
708
715
|
internalVariables: t,
|
|
709
716
|
fetchTemplate: l,
|
|
710
717
|
suspend: (g, m) => {
|
|
711
718
|
if (n.current[g])
|
|
712
719
|
return n.current[g];
|
|
713
|
-
const p =
|
|
720
|
+
const p = So(m());
|
|
714
721
|
return n.current[g] = p, p;
|
|
715
722
|
},
|
|
716
723
|
getIsFetching: (g) => {
|
|
@@ -722,15 +729,15 @@ function So({ children: e, internalVariables: t }) {
|
|
|
722
729
|
return ((m = i[g]) == null ? void 0 : m.error) ?? !1;
|
|
723
730
|
}
|
|
724
731
|
};
|
|
725
|
-
return /* @__PURE__ */ r.createElement(
|
|
732
|
+
return /* @__PURE__ */ r.createElement(wo, { value: d }, e);
|
|
726
733
|
}
|
|
727
734
|
const qe = {
|
|
728
735
|
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
729
736
|
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
730
737
|
};
|
|
731
738
|
function oe({ uiTemplateString: e, variables: t = {} }) {
|
|
732
|
-
const n =
|
|
733
|
-
return
|
|
739
|
+
const n = vo(t);
|
|
740
|
+
return gt({
|
|
734
741
|
template: e,
|
|
735
742
|
variables: n,
|
|
736
743
|
variableKeyPattern: (o) => qe.VARIABLE(o)
|
|
@@ -741,29 +748,29 @@ function ie({
|
|
|
741
748
|
uiTemplateString: t,
|
|
742
749
|
colorVariables: n = {}
|
|
743
750
|
}) {
|
|
744
|
-
return
|
|
751
|
+
return gt({
|
|
745
752
|
template: t,
|
|
746
753
|
variables: n,
|
|
747
754
|
variableKeyPattern: (o) => qe.VARIABLE(o),
|
|
748
|
-
variableValueTransformer: (o) =>
|
|
755
|
+
variableValueTransformer: (o) => Eo(e, o)
|
|
749
756
|
});
|
|
750
757
|
}
|
|
751
|
-
function
|
|
758
|
+
function Ao({
|
|
752
759
|
theme: e,
|
|
753
760
|
uiTemplateString: t,
|
|
754
761
|
viewVariables: n = {},
|
|
755
762
|
aiAgentColorVariables: o,
|
|
756
763
|
internalVariables: i,
|
|
757
|
-
onRequestTemplate:
|
|
764
|
+
onRequestTemplate: a
|
|
758
765
|
}) {
|
|
759
766
|
const l = Object.values(n).flat().map((g) => g.key);
|
|
760
|
-
return [...new Set(l)].some((g) => !
|
|
767
|
+
return [...new Set(l)].some((g) => !a(g)) ? null : gt({
|
|
761
768
|
template: t,
|
|
762
769
|
variables: n,
|
|
763
770
|
variableKeyPattern: (g) => qe.VIEW_VARIABLE(g),
|
|
764
771
|
variableValueTransformer: (g) => {
|
|
765
772
|
const m = g.map(({ key: p, variables: h }) => {
|
|
766
|
-
const b =
|
|
773
|
+
const b = a(p), { ui_template: x, color_variables: v } = Me(b);
|
|
767
774
|
let f = JSON.stringify(x);
|
|
768
775
|
return f = oe({
|
|
769
776
|
uiTemplateString: f,
|
|
@@ -785,21 +792,21 @@ function wo({
|
|
|
785
792
|
}
|
|
786
793
|
});
|
|
787
794
|
}
|
|
788
|
-
async function
|
|
795
|
+
async function Io({
|
|
789
796
|
theme: e,
|
|
790
797
|
uiTemplateString: t,
|
|
791
798
|
viewVariables: n = {},
|
|
792
799
|
aiAgentColorVariables: o,
|
|
793
800
|
internalVariables: i,
|
|
794
|
-
onRequestTemplate:
|
|
801
|
+
onRequestTemplate: a
|
|
795
802
|
}) {
|
|
796
|
-
return
|
|
803
|
+
return yo({
|
|
797
804
|
template: t,
|
|
798
805
|
variables: n,
|
|
799
|
-
variableKeyPattern: (
|
|
800
|
-
variableValueTransformer: async (
|
|
801
|
-
const l =
|
|
802
|
-
const p = await
|
|
806
|
+
variableKeyPattern: (s) => qe.VIEW_VARIABLE(s),
|
|
807
|
+
variableValueTransformer: async (s) => {
|
|
808
|
+
const l = s.map(async ({ key: g, variables: m }) => {
|
|
809
|
+
const p = await a(g), { ui_template: h, color_variables: b } = Me(p);
|
|
803
810
|
let x = JSON.stringify(h);
|
|
804
811
|
return x = oe({
|
|
805
812
|
uiTemplateString: x,
|
|
@@ -821,44 +828,44 @@ async function ko({
|
|
|
821
828
|
}
|
|
822
829
|
});
|
|
823
830
|
}
|
|
824
|
-
const
|
|
831
|
+
const $o = ({
|
|
825
832
|
rawTemplate: e,
|
|
826
833
|
aiAgentColorVariables: t,
|
|
827
834
|
internalVariables: n,
|
|
828
835
|
...o
|
|
829
836
|
}) => {
|
|
830
|
-
const { ui_template: i, color_variables:
|
|
831
|
-
let
|
|
837
|
+
const { ui_template: i, color_variables: a } = Me(e);
|
|
838
|
+
let s = JSON.stringify(i);
|
|
832
839
|
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
833
|
-
const d =
|
|
840
|
+
const d = Ao({
|
|
834
841
|
...o,
|
|
835
|
-
uiTemplateString:
|
|
842
|
+
uiTemplateString: s,
|
|
836
843
|
aiAgentColorVariables: t,
|
|
837
844
|
internalVariables: n
|
|
838
845
|
});
|
|
839
846
|
if (d === null) return null;
|
|
840
|
-
|
|
847
|
+
s = d;
|
|
841
848
|
}
|
|
842
|
-
return
|
|
843
|
-
},
|
|
849
|
+
return s = oe({ ...o, uiTemplateString: s, variables: n }), s = ie({ ...o, uiTemplateString: s, colorVariables: a }), s = ie({ ...o, uiTemplateString: s, colorVariables: t }), s = oe({ ...o, uiTemplateString: s }), Ye(s);
|
|
850
|
+
}, Mo = async ({
|
|
844
851
|
rawTemplate: e,
|
|
845
852
|
aiAgentColorVariables: t,
|
|
846
853
|
internalVariables: n,
|
|
847
854
|
...o
|
|
848
855
|
}) => {
|
|
849
|
-
const { ui_template: i, color_variables:
|
|
850
|
-
let
|
|
851
|
-
return Object.keys(o.viewVariables ?? {}).length > 0 && (
|
|
856
|
+
const { ui_template: i, color_variables: a } = Me(e);
|
|
857
|
+
let s = JSON.stringify(i);
|
|
858
|
+
return Object.keys(o.viewVariables ?? {}).length > 0 && (s = await Io({
|
|
852
859
|
...o,
|
|
853
|
-
uiTemplateString:
|
|
860
|
+
uiTemplateString: s,
|
|
854
861
|
aiAgentColorVariables: t,
|
|
855
862
|
internalVariables: n
|
|
856
|
-
})),
|
|
857
|
-
},
|
|
858
|
-
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } =
|
|
859
|
-
return
|
|
863
|
+
})), s = oe({ ...o, uiTemplateString: s, variables: n }), s = ie({ ...o, uiTemplateString: s, colorVariables: a }), s = ie({ ...o, uiTemplateString: s, colorVariables: t }), s = oe({ ...o, uiTemplateString: s }), Ye(s);
|
|
864
|
+
}, Oo = (e) => {
|
|
865
|
+
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = Sn();
|
|
866
|
+
return T(() => {
|
|
860
867
|
const o = e.onGetCachedTemplate(e.templateKey);
|
|
861
|
-
return o ?
|
|
868
|
+
return o ? $o({
|
|
862
869
|
...e,
|
|
863
870
|
rawTemplate: o,
|
|
864
871
|
aiAgentColorVariables: t,
|
|
@@ -866,20 +873,20 @@ const Ao = ({
|
|
|
866
873
|
onRequestTemplate: e.onGetCachedTemplate
|
|
867
874
|
}) : null;
|
|
868
875
|
});
|
|
869
|
-
},
|
|
870
|
-
const [t] =
|
|
876
|
+
}, Lo = (e) => {
|
|
877
|
+
const [t] = Oo(e);
|
|
871
878
|
if (t) return t;
|
|
872
|
-
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend:
|
|
873
|
-
return
|
|
879
|
+
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } = Sn();
|
|
880
|
+
return a(e.templateKey, async () => {
|
|
874
881
|
const l = await i({ ...e, suspense: !0 });
|
|
875
|
-
return await
|
|
882
|
+
return await Mo({
|
|
876
883
|
...e,
|
|
877
884
|
rawTemplate: l,
|
|
878
885
|
aiAgentColorVariables: n,
|
|
879
886
|
internalVariables: o
|
|
880
887
|
});
|
|
881
888
|
}).value;
|
|
882
|
-
},
|
|
889
|
+
}, Ro = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}', Oe = "en", No = /* @__PURE__ */ new Set([
|
|
883
890
|
Oe,
|
|
884
891
|
"ko",
|
|
885
892
|
"es",
|
|
@@ -890,11 +897,11 @@ const Ao = ({
|
|
|
890
897
|
"de",
|
|
891
898
|
"tr",
|
|
892
899
|
"ja"
|
|
893
|
-
]),
|
|
900
|
+
]), Do = (e, t, n) => {
|
|
894
901
|
const o = e[t];
|
|
895
|
-
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((i,
|
|
902
|
+
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((i, a) => {
|
|
896
903
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
897
|
-
|
|
904
|
+
a.bind(
|
|
898
905
|
null,
|
|
899
906
|
new Error(
|
|
900
907
|
"Unknown variable dynamic import: " + t + (t.split("/").length !== n ? ". Note that variables only represent file names one level deep." : "")
|
|
@@ -902,7 +909,7 @@ const Ao = ({
|
|
|
902
909
|
)
|
|
903
910
|
);
|
|
904
911
|
});
|
|
905
|
-
},
|
|
912
|
+
}, Bo = wr, Po = {
|
|
906
913
|
// Channel - Common
|
|
907
914
|
CHANNEL_FROZEN: "Channel frozen",
|
|
908
915
|
PLACE_HOLDER__WRONG: "Something went wrong",
|
|
@@ -953,61 +960,61 @@ const Ao = ({
|
|
|
953
960
|
CONVERSATION_LIST__NO_CONVERSATIONS: "No conversations yet",
|
|
954
961
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: "MM/dd/yyyy",
|
|
955
962
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
|
|
956
|
-
},
|
|
963
|
+
}, pt = { language: "en", dateLocale: Bo, stringSet: Po }, Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
957
964
|
__proto__: null,
|
|
958
|
-
default:
|
|
959
|
-
}, Symbol.toStringTag, { value: "Module" })), We = /* @__PURE__ */ new Map([[Oe,
|
|
960
|
-
async function
|
|
965
|
+
default: pt
|
|
966
|
+
}, Symbol.toStringTag, { value: "Module" })), We = /* @__PURE__ */ new Map([[Oe, pt]]);
|
|
967
|
+
async function Ho(e) {
|
|
961
968
|
if (We.has(e))
|
|
962
969
|
return We.get(e);
|
|
963
|
-
const t =
|
|
970
|
+
const t = No.has(e) ? e : Oe;
|
|
964
971
|
try {
|
|
965
|
-
const { default: n } = await
|
|
972
|
+
const { default: n } = await Do(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DvjrAXLD.js"), "./languages/en.ts": () => Promise.resolve().then(() => Fo), "./languages/es.ts": () => import("./zI14HLvP.js"), "./languages/fr.ts": () => import("./B9V0T5ZP.js"), "./languages/hi.ts": () => import("./YRQ0vk5Q.js"), "./languages/it.ts": () => import("./BQWJPfGp.js"), "./languages/ja.ts": () => import("./sl-YrKkN.js"), "./languages/ko.ts": () => import("./B8c_rqvH.js"), "./languages/pt.ts": () => import("./BSz49qaD.js"), "./languages/tr.ts": () => import("./D_eZyIAR.js") }), `./languages/${t}.ts`, 3);
|
|
966
973
|
return We.set(e, n), n;
|
|
967
974
|
} catch {
|
|
968
|
-
return
|
|
975
|
+
return pt;
|
|
969
976
|
}
|
|
970
977
|
}
|
|
971
978
|
const {
|
|
972
|
-
Provider:
|
|
979
|
+
Provider: Uo,
|
|
973
980
|
useContext: M
|
|
974
981
|
} = W("Localization");
|
|
975
|
-
function
|
|
982
|
+
function zo(e) {
|
|
976
983
|
var t;
|
|
977
984
|
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Oe;
|
|
978
985
|
}
|
|
979
|
-
function
|
|
986
|
+
function Wo({
|
|
980
987
|
language: e = navigator.language,
|
|
981
988
|
logger: t,
|
|
982
989
|
stringSet: n,
|
|
983
990
|
children: o
|
|
984
991
|
}) {
|
|
985
|
-
const [i,
|
|
992
|
+
const [i, a] = T(We.get(Oe));
|
|
986
993
|
return R(() => {
|
|
987
|
-
const
|
|
988
|
-
i.language !==
|
|
994
|
+
const s = zo(e);
|
|
995
|
+
i.language !== s && (t == null || t.debug("localization.useEffect: update language", `${i.language} -> ${s}`), Ho(s).then(a));
|
|
989
996
|
}, [e]), /* @__PURE__ */ r.createElement(
|
|
990
|
-
|
|
997
|
+
Uo,
|
|
991
998
|
{
|
|
992
999
|
value: {
|
|
993
1000
|
language: i.language,
|
|
994
1001
|
stringSet: { ...i.stringSet, ...n },
|
|
995
1002
|
dateLocale: i.dateLocale,
|
|
996
|
-
format: (
|
|
1003
|
+
format: (s, l, d) => hn(s, l, { locale: i.dateLocale, ...d })
|
|
997
1004
|
}
|
|
998
1005
|
},
|
|
999
1006
|
o
|
|
1000
1007
|
);
|
|
1001
1008
|
}
|
|
1002
|
-
const Ve = "data-sb-agent-theme",
|
|
1009
|
+
const Ve = "data-sb-agent-theme", Ft = (e) => (t, ...n) => {
|
|
1003
1010
|
let o = "";
|
|
1004
|
-
return t.forEach((i,
|
|
1005
|
-
o += i + (n[
|
|
1011
|
+
return t.forEach((i, a) => {
|
|
1012
|
+
o += i + (n[a] ?? "");
|
|
1006
1013
|
}), `[${Ve}='${e}'] & { ${o} }`;
|
|
1007
1014
|
}, B = {
|
|
1008
|
-
light:
|
|
1009
|
-
dark:
|
|
1010
|
-
},
|
|
1015
|
+
light: Ft("light"),
|
|
1016
|
+
dark: Ft("dark")
|
|
1017
|
+
}, Vo = k(({ theme: e }) => {
|
|
1011
1018
|
const { palette: t } = e;
|
|
1012
1019
|
return `
|
|
1013
1020
|
:root,
|
|
@@ -1059,7 +1066,7 @@ const Ve = "data-sb-agent-theme", Pt = (e) => (t, ...n) => {
|
|
|
1059
1066
|
--sendbird-overlay-light: ${t.overlay.light};
|
|
1060
1067
|
}
|
|
1061
1068
|
`;
|
|
1062
|
-
}),
|
|
1069
|
+
}), Go = k`[${Ve}='light'] &{--sb-text-high-emphasis:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled:var(--sendbird-onlight-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-ondark-text-disabled);--sb-bg-50-600:var(--sendbird-background-50);--sb-bg-100-500:var(--sendbird-background-100);--sb-bg-200-400:var(--sendbird-background-200);--sb-primary:var(--sendbird-primary-main);--sb-secondary:var(--sendbird-secondary-main);--sb-error:var(--sendbird-error-main);--sb-information:var(--sendbird-information-light);}[${Ve}='dark'] &{--sb-text-high-emphasis:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled:var(--sendbird-ondark-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-onlight-text-disabled);--sb-bg-50-600:var(--sendbird-background-600);--sb-bg-100-500:var(--sendbird-background-500);--sb-bg-200-400:var(--sendbird-background-400);--sb-primary:var(--sendbird-primary-light);--sb-secondary:var(--sendbird-secondary-light);--sb-error:var(--sendbird-error-light);--sb-information:var(--sendbird-information-light);}`, u = {
|
|
1063
1070
|
color: {
|
|
1064
1071
|
primary: {
|
|
1065
1072
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -1100,49 +1107,49 @@ const Ve = "data-sb-agent-theme", Pt = (e) => (t, ...n) => {
|
|
|
1100
1107
|
error: "var(--sb-error)"
|
|
1101
1108
|
}
|
|
1102
1109
|
}, {
|
|
1103
|
-
Provider:
|
|
1104
|
-
useContext:
|
|
1110
|
+
Provider: jo,
|
|
1111
|
+
useContext: Ko
|
|
1105
1112
|
} = W("AIAgentTheme");
|
|
1106
|
-
function
|
|
1113
|
+
function Zo(e) {
|
|
1107
1114
|
const { theme: t, appearance: n, logger: o } = e;
|
|
1108
1115
|
return /* @__PURE__ */ r.createElement(
|
|
1109
|
-
|
|
1116
|
+
xo,
|
|
1110
1117
|
{
|
|
1111
1118
|
appearance: n,
|
|
1112
1119
|
palette: t == null ? void 0 : t.palette,
|
|
1113
1120
|
typography: t == null ? void 0 : t.typography,
|
|
1114
1121
|
logger: o
|
|
1115
1122
|
},
|
|
1116
|
-
/* @__PURE__ */ r.createElement(
|
|
1123
|
+
/* @__PURE__ */ r.createElement(Yo, { ...e })
|
|
1117
1124
|
);
|
|
1118
1125
|
}
|
|
1119
|
-
function
|
|
1120
|
-
const { theme: n, updateTheme: o } =
|
|
1126
|
+
function Yo({ rootElement: e = document.body, children: t }) {
|
|
1127
|
+
const { theme: n, updateTheme: o } = Cn();
|
|
1121
1128
|
return ge(() => {
|
|
1122
1129
|
e.setAttribute(Ve, n.selectedTheme);
|
|
1123
|
-
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(
|
|
1130
|
+
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(Cr, { theme: n }, /* @__PURE__ */ r.createElement(jo, { value: { theme: n, updateTheme: o } }, t));
|
|
1124
1131
|
}
|
|
1125
1132
|
function pe(e, t) {
|
|
1126
1133
|
const n = e.getRootNode({ composed: t });
|
|
1127
1134
|
return n instanceof ShadowRoot || n instanceof Document ? n : document;
|
|
1128
1135
|
}
|
|
1129
|
-
const
|
|
1136
|
+
const qo = (e, t) => {
|
|
1130
1137
|
R(() => {
|
|
1131
1138
|
const n = pe(t) instanceof ShadowRoot, o = pe(t, !0);
|
|
1132
1139
|
if (!(n ? t : o).querySelector(`link[href*='${e}']`)) {
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1140
|
+
const a = o.createElement("link");
|
|
1141
|
+
a.rel = "stylesheet", a.href = e, (n ? t : o.head).appendChild(a);
|
|
1135
1142
|
}
|
|
1136
1143
|
}, [e, t]);
|
|
1137
|
-
},
|
|
1144
|
+
}, Jo = (e, t = document.body) => {
|
|
1138
1145
|
R(() => {
|
|
1139
1146
|
const n = pe(t), i = n instanceof ShadowRoot ? t : n.head;
|
|
1140
1147
|
if (!i) return;
|
|
1141
|
-
const
|
|
1142
|
-
let
|
|
1143
|
-
|
|
1148
|
+
const a = `sba-${btoa(e).slice(0, 10)}`;
|
|
1149
|
+
let s = i.querySelector(`style#${a}`);
|
|
1150
|
+
s ? s.textContent !== e && (s.textContent = e) : (s = i.ownerDocument.createElement("style"), s.id = a, s.textContent = e, i.appendChild(s));
|
|
1144
1151
|
}, [e, t]);
|
|
1145
|
-
},
|
|
1152
|
+
}, ht = /iPad|iPhone|iPod/.test(navigator.userAgent), Xo = /Android/.test(navigator.userAgent), Le = (e) => ht || Xo, Z = "sb-agent", X = {
|
|
1146
1153
|
ENTRY: `${Z}-entry`,
|
|
1147
1154
|
MODAL_ROOT: `${Z}-modal-root`,
|
|
1148
1155
|
WINDOW: `${Z}-window`,
|
|
@@ -1153,13 +1160,13 @@ const Zo = (e, t) => {
|
|
|
1153
1160
|
TOOLTIP: Pe - 2,
|
|
1154
1161
|
WINDOW: Pe - 3,
|
|
1155
1162
|
LAUNCHER: Pe - 4
|
|
1156
|
-
},
|
|
1163
|
+
}, wn = {
|
|
1157
1164
|
SESSION: `@${Z}-session`,
|
|
1158
1165
|
USER_DATA: `@${Z}-udata`
|
|
1159
|
-
},
|
|
1166
|
+
}, kn = {
|
|
1160
1167
|
DEFAULT_PRIMARY: "#742ddd",
|
|
1161
1168
|
WHITE: "#ffffff"
|
|
1162
|
-
},
|
|
1169
|
+
}, An = 36, Qo = 100, ei = 25 * 1024 * 1024, In = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], ft = "noopener noreferrer nofollow", Fe = {}, q = {
|
|
1163
1170
|
getItem: (e) => {
|
|
1164
1171
|
try {
|
|
1165
1172
|
return localStorage.getItem(e);
|
|
@@ -1194,78 +1201,78 @@ const Zo = (e, t) => {
|
|
|
1194
1201
|
}
|
|
1195
1202
|
}
|
|
1196
1203
|
};
|
|
1197
|
-
function
|
|
1204
|
+
function $n(e) {
|
|
1198
1205
|
const { keyGenerator: t, keyParamsValidator: n } = e;
|
|
1199
|
-
function o(
|
|
1206
|
+
function o(s) {
|
|
1200
1207
|
try {
|
|
1201
|
-
n && n(
|
|
1202
|
-
const l = t(
|
|
1208
|
+
n && n(s);
|
|
1209
|
+
const l = t(s), d = q.getItem(l);
|
|
1203
1210
|
return d ? JSON.parse(d) : null;
|
|
1204
1211
|
} catch {
|
|
1205
1212
|
return null;
|
|
1206
1213
|
}
|
|
1207
1214
|
}
|
|
1208
|
-
function i(
|
|
1215
|
+
function i(s, l) {
|
|
1209
1216
|
try {
|
|
1210
|
-
n && n(
|
|
1211
|
-
const d = t(
|
|
1217
|
+
n && n(s);
|
|
1218
|
+
const d = t(s), g = JSON.stringify(l);
|
|
1212
1219
|
q.setItem(d, g);
|
|
1213
1220
|
} catch {
|
|
1214
1221
|
}
|
|
1215
1222
|
}
|
|
1216
|
-
function s
|
|
1223
|
+
function a(s) {
|
|
1217
1224
|
try {
|
|
1218
|
-
n && n(
|
|
1219
|
-
const l = t(
|
|
1225
|
+
n && n(s);
|
|
1226
|
+
const l = t(s);
|
|
1220
1227
|
q.deleteItem(l);
|
|
1221
1228
|
} catch {
|
|
1222
1229
|
}
|
|
1223
1230
|
}
|
|
1224
|
-
return { get: o, set: i, clear:
|
|
1231
|
+
return { get: o, set: i, clear: a };
|
|
1225
1232
|
}
|
|
1226
|
-
const et =
|
|
1233
|
+
const et = $n({
|
|
1227
1234
|
keyGenerator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1228
|
-
const o =
|
|
1229
|
-
return `${
|
|
1235
|
+
const o = ti(`${e}/${t}/${n}`);
|
|
1236
|
+
return `${wn.USER_DATA}/${o}`;
|
|
1230
1237
|
},
|
|
1231
1238
|
keyParamsValidator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1232
1239
|
if (!e || !t || !n)
|
|
1233
1240
|
throw new Error("Invalid parameters for user data cache");
|
|
1234
1241
|
}
|
|
1235
1242
|
});
|
|
1236
|
-
function
|
|
1243
|
+
function ti(e) {
|
|
1237
1244
|
let t = 0;
|
|
1238
1245
|
for (let n = 0; n < e.length; n++)
|
|
1239
1246
|
t = (t << 5) - t + e.charCodeAt(n), t |= 0;
|
|
1240
1247
|
return t.toString(16);
|
|
1241
1248
|
}
|
|
1242
|
-
const tt =
|
|
1243
|
-
keyGenerator: ({ appId: e, aiAgentId: t }) => `${
|
|
1249
|
+
const tt = $n({
|
|
1250
|
+
keyGenerator: ({ appId: e, aiAgentId: t }) => `${wn.SESSION}/${e}/${t}`
|
|
1244
1251
|
}), {
|
|
1245
|
-
Provider:
|
|
1246
|
-
Consumer:
|
|
1252
|
+
Provider: ni,
|
|
1253
|
+
Consumer: Mn,
|
|
1247
1254
|
useContext: N
|
|
1248
1255
|
} = W("Agent");
|
|
1249
|
-
function
|
|
1256
|
+
function ri({
|
|
1250
1257
|
children: e,
|
|
1251
1258
|
state: t,
|
|
1252
1259
|
enableCloseConversationButton: n = !1,
|
|
1253
1260
|
enableExpandButton: o = !0,
|
|
1254
1261
|
enableAutoDisconnectInLauncher: i = !0,
|
|
1255
|
-
...
|
|
1262
|
+
...a
|
|
1256
1263
|
}) {
|
|
1257
|
-
const
|
|
1264
|
+
const s = Ze(), [l, d] = T(!1), [g, m] = T(!1), p = {
|
|
1258
1265
|
opened: (t == null ? void 0 : t.opened) ?? l,
|
|
1259
1266
|
setOpened: (t == null ? void 0 : t.setOpened) ?? d,
|
|
1260
1267
|
expanded: (t == null ? void 0 : t.expanded) ?? g,
|
|
1261
1268
|
setExpanded: (t == null ? void 0 : t.setExpanded) ?? m
|
|
1262
1269
|
};
|
|
1263
1270
|
return /* @__PURE__ */ r.createElement(
|
|
1264
|
-
|
|
1271
|
+
ni,
|
|
1265
1272
|
{
|
|
1266
1273
|
value: {
|
|
1267
|
-
...s,
|
|
1268
1274
|
...a,
|
|
1275
|
+
...s,
|
|
1269
1276
|
state: p,
|
|
1270
1277
|
enableCloseConversationButton: n,
|
|
1271
1278
|
enableExpandButton: o,
|
|
@@ -1275,31 +1282,31 @@ function ti({
|
|
|
1275
1282
|
e
|
|
1276
1283
|
);
|
|
1277
1284
|
}
|
|
1278
|
-
function
|
|
1279
|
-
const { chatSDK: e, logger: t } = N(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } =
|
|
1285
|
+
function oi() {
|
|
1286
|
+
const { chatSDK: e, logger: t } = N(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } = _n(), a = P(
|
|
1280
1287
|
async (l, d) => {
|
|
1281
|
-
t.debug("authManager.authenticate: session:", l.userId), d && e.setSessionHandler(new
|
|
1288
|
+
t.debug("authManager.authenticate: session:", l.userId), d && e.setSessionHandler(new vr(d)), await e.connect(l.userId, l.authToken), t.debug("authManager.authenticate: user:", e.currentUser), n(e) && await o(e);
|
|
1282
1289
|
},
|
|
1283
1290
|
[e, t, n, o]
|
|
1284
|
-
),
|
|
1291
|
+
), s = P(async () => {
|
|
1285
1292
|
t.debug("authManager.deauthenticate: disconnect"), await e.disconnect(), i();
|
|
1286
1293
|
}, [e, t, i]);
|
|
1287
1294
|
return {
|
|
1288
|
-
authenticate:
|
|
1289
|
-
deauthenticate:
|
|
1295
|
+
authenticate: a,
|
|
1296
|
+
deauthenticate: s
|
|
1290
1297
|
};
|
|
1291
1298
|
}
|
|
1292
|
-
const
|
|
1293
|
-
Provider:
|
|
1299
|
+
const ii = 24 * 60 * 60 * 1e3, {
|
|
1300
|
+
Provider: si,
|
|
1294
1301
|
useContext: F
|
|
1295
1302
|
} = W("MessengerSession");
|
|
1296
|
-
function
|
|
1303
|
+
function ai({
|
|
1297
1304
|
userSessionInfo: e,
|
|
1298
1305
|
children: t
|
|
1299
1306
|
}) {
|
|
1300
|
-
const { appId: n, aiAgentId: o, chatSDK: i, agentPreviewConfigs:
|
|
1307
|
+
const { appId: n, aiAgentId: o, chatSDK: i, agentPreviewConfigs: a, state: s, logger: l, language: d, countryCode: g, context: m, handlers: p } = N(), { updateTheme: h } = Cn(), { authenticate: b, deauthenticate: x } = oi(), [v, f] = T(
|
|
1301
1308
|
void 0
|
|
1302
|
-
), [y, _] =
|
|
1309
|
+
), [y, _] = T(void 0), [w, O] = T(null), [ee, H] = T(null), [le, _e] = T(null), E = a == null ? void 0 : a.forceCreateChannel;
|
|
1303
1310
|
function U() {
|
|
1304
1311
|
if (e) {
|
|
1305
1312
|
l.debug("messengerSession.initialize: manual session info detected");
|
|
@@ -1309,7 +1316,7 @@ function ii({
|
|
|
1309
1316
|
), e;
|
|
1310
1317
|
}
|
|
1311
1318
|
const I = tt.get({ appId: n, aiAgentId: o });
|
|
1312
|
-
return I ? I.expireAt -
|
|
1319
|
+
return I ? I.expireAt - ii <= Date.now() ? (l.debug("messengerSession.initialize: auto session expired, clear cache"), tt.clear({ appId: n, aiAgentId: o }), et.clear({ appId: n, aiAgentId: o, userId: I.userId }), null) : (l.debug("messengerSession.initialize: auto session info detected"), I) : null;
|
|
1313
1320
|
}
|
|
1314
1321
|
const te = P(
|
|
1315
1322
|
(I, A) => {
|
|
@@ -1352,18 +1359,18 @@ function ii({
|
|
|
1352
1359
|
G,
|
|
1353
1360
|
te
|
|
1354
1361
|
]);
|
|
1355
|
-
return
|
|
1362
|
+
return fn(i, {
|
|
1356
1363
|
onChannelChanged: (I) => {
|
|
1357
1364
|
var A;
|
|
1358
1365
|
I.isGroupChannel() && I.url === (v == null ? void 0 : v.url) && (l.info("messengerSession.channelChanged: channel.conversation", I.conversation), f({ url: I.url, status: ((A = I.conversation) == null ? void 0 : A.status) ?? z.OPEN }));
|
|
1359
1366
|
},
|
|
1360
1367
|
async onUserJoined(I, A) {
|
|
1361
1368
|
var j, fe;
|
|
1362
|
-
if (I.conversation && I.conversation.type ===
|
|
1369
|
+
if (I.conversation && I.conversation.type === Ir.PROACTIVE && A.userId === ((j = i.currentUser) == null ? void 0 : j.userId)) {
|
|
1363
1370
|
l.info("messengerSession.onUserJoined: proactive channel joined", I.url);
|
|
1364
1371
|
const Se = ((fe = I.conversation) == null ? void 0 : fe.status) ?? z.OPEN;
|
|
1365
|
-
f({ url: I.url, status: Se }),
|
|
1366
|
-
sound: document.hidden || !
|
|
1372
|
+
f({ url: I.url, status: Se }), s.setOpened(!0), li({
|
|
1373
|
+
sound: document.hidden || !s.opened
|
|
1367
1374
|
});
|
|
1368
1375
|
}
|
|
1369
1376
|
}
|
|
@@ -1411,7 +1418,7 @@ function ii({
|
|
|
1411
1418
|
}), _e({
|
|
1412
1419
|
type: L.launcher.image_type || "default_icon",
|
|
1413
1420
|
imageUrl: L.launcher.image_url
|
|
1414
|
-
}), L.launcher.auto_open && !Le() && setTimeout(() =>
|
|
1421
|
+
}), L.launcher.auto_open && !Le() && setTimeout(() => s.setOpened(!0), 500);
|
|
1415
1422
|
}
|
|
1416
1423
|
function Se() {
|
|
1417
1424
|
f({ url: L.active_channel.channel_url, status: z.OPEN });
|
|
@@ -1428,21 +1435,21 @@ function ii({
|
|
|
1428
1435
|
}, [i, n, o, e == null ? void 0 : e.userId, e == null ? void 0 : e.authToken]), R(() => {
|
|
1429
1436
|
p != null && p.onRegisterDeauthenticateHandler && (l.debug("messengerSession: registering deauthenticate handler"), p.onRegisterDeauthenticateHandler(x));
|
|
1430
1437
|
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, x]), !w || !ee || !le ? null : /* @__PURE__ */ r.createElement(
|
|
1431
|
-
|
|
1438
|
+
si,
|
|
1432
1439
|
{
|
|
1433
1440
|
value: {
|
|
1434
1441
|
userSession: w,
|
|
1435
1442
|
activeChannel: v,
|
|
1436
1443
|
refreshActiveChannel: Xe,
|
|
1437
1444
|
connectionError: y,
|
|
1438
|
-
aiAgentInfo: { ...ee, ...
|
|
1439
|
-
launcherInfo: { ...le, ...
|
|
1445
|
+
aiAgentInfo: { ...ee, ...a == null ? void 0 : a.bot },
|
|
1446
|
+
launcherInfo: { ...le, ...a == null ? void 0 : a.launcher }
|
|
1440
1447
|
}
|
|
1441
1448
|
},
|
|
1442
1449
|
t
|
|
1443
1450
|
);
|
|
1444
1451
|
}
|
|
1445
|
-
function
|
|
1452
|
+
function li({ sound: e }) {
|
|
1446
1453
|
const t = "🔔You have received a new message", n = document.title, o = setInterval(() => {
|
|
1447
1454
|
document.title = document.title === t ? n : t;
|
|
1448
1455
|
}, 750);
|
|
@@ -1450,7 +1457,7 @@ function si({ sound: e }) {
|
|
|
1450
1457
|
new Audio(i.default).play();
|
|
1451
1458
|
});
|
|
1452
1459
|
}
|
|
1453
|
-
const
|
|
1460
|
+
const ci = ({ publishSynchronous: e = !1 }) => {
|
|
1454
1461
|
const t = /* @__PURE__ */ new Set();
|
|
1455
1462
|
return {
|
|
1456
1463
|
publish: (n) => {
|
|
@@ -1461,33 +1468,33 @@ const ai = ({ publishSynchronous: e = !1 }) => {
|
|
|
1461
1468
|
subscribe: (n) => (t.add(n), () => t.delete(n))
|
|
1462
1469
|
};
|
|
1463
1470
|
};
|
|
1464
|
-
function
|
|
1465
|
-
const n = D(null), o = D(0), i = D(0), [
|
|
1471
|
+
function di(e, t = []) {
|
|
1472
|
+
const n = D(null), o = D(0), i = D(0), [a] = T(() => ci({ publishSynchronous: !0 })), [s, l] = T(!0);
|
|
1466
1473
|
return ge(() => {
|
|
1467
1474
|
o.current = 0, i.current = 0, l(!0), n.current && (n.current.scrollTop = n.current.scrollHeight);
|
|
1468
|
-
}, t), ge(() =>
|
|
1475
|
+
}, t), ge(() => a.subscribe(({ type: d, data: g }) => {
|
|
1469
1476
|
const { resolve: m, animated: p } = g ?? {};
|
|
1470
1477
|
if (!n.current) return m == null ? void 0 : m();
|
|
1471
1478
|
if (d === "scrollToBottom" && (n.current.scroll ? n.current.scroll({
|
|
1472
1479
|
top: n.current.scrollHeight,
|
|
1473
|
-
behavior:
|
|
1480
|
+
behavior: Ht(e, p)
|
|
1474
1481
|
}) : n.current.scrollTop = n.current.scrollHeight, i.current = 0, l(!0), m == null || m()), d === "scroll") {
|
|
1475
1482
|
const h = g == null ? void 0 : g.top, { scrollTop: b, scrollHeight: x, clientHeight: v } = n.current;
|
|
1476
|
-
n.current.scroll ? n.current.scroll({ top: h, behavior:
|
|
1483
|
+
n.current.scroll ? n.current.scroll({ top: h, behavior: Ht(e, p) }) : typeof h == "number" && (n.current.scrollTop = h), i.current = Math.max(0, x - b - v), l(i.current === 0), m == null || m();
|
|
1477
1484
|
}
|
|
1478
1485
|
}), [e]), {
|
|
1479
1486
|
scrollRef: n,
|
|
1480
|
-
scrollPubSub:
|
|
1481
|
-
isScrollBottomReached:
|
|
1487
|
+
scrollPubSub: a,
|
|
1488
|
+
isScrollBottomReached: s,
|
|
1482
1489
|
setIsScrollBottomReached: l,
|
|
1483
1490
|
scrollDistanceFromBottomRef: i,
|
|
1484
1491
|
scrollPositionRef: o
|
|
1485
1492
|
};
|
|
1486
1493
|
}
|
|
1487
|
-
function
|
|
1494
|
+
function Ht(e, t) {
|
|
1488
1495
|
return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
|
|
1489
1496
|
}
|
|
1490
|
-
function
|
|
1497
|
+
function ui(e) {
|
|
1491
1498
|
return new Promise((t) => {
|
|
1492
1499
|
const n = new Image();
|
|
1493
1500
|
n.onload = function() {
|
|
@@ -1496,50 +1503,50 @@ function ci(e) {
|
|
|
1496
1503
|
}, n.src = URL.createObjectURL(e);
|
|
1497
1504
|
});
|
|
1498
1505
|
}
|
|
1499
|
-
async function
|
|
1506
|
+
async function mi(e) {
|
|
1500
1507
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
1501
|
-
const { width: t, height: n } = await
|
|
1502
|
-
return new
|
|
1503
|
-
key:
|
|
1508
|
+
const { width: t, height: n } = await ui(e.file);
|
|
1509
|
+
return new Lr({
|
|
1510
|
+
key: On,
|
|
1504
1511
|
value: [t, n]
|
|
1505
1512
|
});
|
|
1506
1513
|
}
|
|
1507
1514
|
}
|
|
1508
|
-
const
|
|
1515
|
+
const On = "KEY_IMG_ASPECT_RATIO", gi = ({ onScroll: e }) => {
|
|
1509
1516
|
const { agentPreviewConfigs: t, handlers: n } = N(), o = D(t == null ? void 0 : t.agentAttributes);
|
|
1510
1517
|
return o.current = t == null ? void 0 : t.agentAttributes, {
|
|
1511
1518
|
onBeforeSendMessage: async (i) => {
|
|
1512
|
-
const
|
|
1519
|
+
const a = await mi(i), s = {
|
|
1513
1520
|
...i,
|
|
1514
|
-
metaArrays:
|
|
1515
|
-
}, l =
|
|
1516
|
-
return l ? { ...
|
|
1521
|
+
metaArrays: a ? [a] : void 0
|
|
1522
|
+
}, l = pi(o.current);
|
|
1523
|
+
return l ? { ...s, data: JSON.stringify(l) } : s;
|
|
1517
1524
|
},
|
|
1518
1525
|
onAfterSendMessage: (i) => {
|
|
1519
|
-
var
|
|
1520
|
-
e(), (
|
|
1526
|
+
var a;
|
|
1527
|
+
e(), (a = n == null ? void 0 : n.onMessageSend) == null || a.call(n, i.message);
|
|
1521
1528
|
}
|
|
1522
1529
|
};
|
|
1523
|
-
},
|
|
1530
|
+
}, pi = (e) => {
|
|
1524
1531
|
if (!e) return null;
|
|
1525
1532
|
const t = {};
|
|
1526
1533
|
return e.ai && Object.keys(e.ai).length > 0 && (t.ai_attrs = e.ai), e.safeguard && Object.keys(e.safeguard).length > 0 && (t.safeguard_attrs = e.safeguard), typeof e.use_prompt_cache == "boolean" && (t.use_prompt_cache = e.use_prompt_cache), Object.keys(t).length > 0 ? t : null;
|
|
1527
1534
|
}, {
|
|
1528
|
-
Provider:
|
|
1535
|
+
Provider: hi,
|
|
1529
1536
|
useContext: Y
|
|
1530
|
-
} = W("Conversation"),
|
|
1537
|
+
} = W("Conversation"), fi = ({
|
|
1531
1538
|
closedChannelUrl: e,
|
|
1532
1539
|
onClearClosedChannelUrl: t,
|
|
1533
1540
|
onNavigateToConversationList: n,
|
|
1534
1541
|
children: o
|
|
1535
1542
|
}) => {
|
|
1536
|
-
const { activeChannel: i, refreshActiveChannel:
|
|
1537
|
-
setTimeout(() =>
|
|
1538
|
-
}, { onBeforeSendMessage: d, onAfterSendMessage: g } =
|
|
1539
|
-
await
|
|
1540
|
-
}, [
|
|
1543
|
+
const { activeChannel: i, refreshActiveChannel: a } = F(), s = di("smooth"), l = () => {
|
|
1544
|
+
setTimeout(() => s.scrollPubSub.publish({ type: "scrollToBottom" }), 25);
|
|
1545
|
+
}, { onBeforeSendMessage: d, onAfterSendMessage: g } = gi({ onScroll: l }), m = P(async () => {
|
|
1546
|
+
await a(), e && (t == null || t());
|
|
1547
|
+
}, [a, e, t]);
|
|
1541
1548
|
return /* @__PURE__ */ r.createElement(
|
|
1542
|
-
|
|
1549
|
+
eo,
|
|
1543
1550
|
{
|
|
1544
1551
|
channelUrl: e || (i == null ? void 0 : i.url),
|
|
1545
1552
|
onBeforeSendMessage: d,
|
|
@@ -1549,9 +1556,9 @@ const Mn = "KEY_IMG_ASPECT_RATIO", ui = ({ onScroll: e }) => {
|
|
|
1549
1556
|
onConversationClosedViaDispatcher: m
|
|
1550
1557
|
},
|
|
1551
1558
|
(p) => /* @__PURE__ */ r.createElement(
|
|
1552
|
-
|
|
1559
|
+
hi,
|
|
1553
1560
|
{
|
|
1554
|
-
value: { ...p, scrollSource:
|
|
1561
|
+
value: { ...p, scrollSource: s, goToActiveConversation: m, onNavigateToConversationList: n }
|
|
1555
1562
|
},
|
|
1556
1563
|
o
|
|
1557
1564
|
)
|
|
@@ -1559,42 +1566,42 @@ const Mn = "KEY_IMG_ASPECT_RATIO", ui = ({ onScroll: e }) => {
|
|
|
1559
1566
|
};
|
|
1560
1567
|
function Ge() {
|
|
1561
1568
|
}
|
|
1562
|
-
async function
|
|
1569
|
+
async function Ln(e) {
|
|
1563
1570
|
let t = e;
|
|
1564
1571
|
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
1565
1572
|
}
|
|
1566
|
-
function
|
|
1573
|
+
function Ut(e) {
|
|
1567
1574
|
try {
|
|
1568
1575
|
return JSON.parse(e === "" ? "{}" : e);
|
|
1569
1576
|
} catch {
|
|
1570
1577
|
return {};
|
|
1571
1578
|
}
|
|
1572
1579
|
}
|
|
1573
|
-
function
|
|
1580
|
+
function Rn(e) {
|
|
1574
1581
|
return !e || !e.conversation ? !1 : e.conversation.status === z.CLOSED;
|
|
1575
1582
|
}
|
|
1576
|
-
function
|
|
1583
|
+
function Nn(e) {
|
|
1577
1584
|
return !e || !e.conversation ? !1 : e.conversation.status === z.OPEN;
|
|
1578
1585
|
}
|
|
1579
|
-
function
|
|
1586
|
+
function bi(e) {
|
|
1580
1587
|
var o;
|
|
1581
1588
|
const t = (o = e == null ? void 0 : e.conversation) == null ? void 0 : o.handoff, n = !!(t != null && t.timestamp);
|
|
1582
|
-
return
|
|
1589
|
+
return Nn(e) && !n;
|
|
1583
1590
|
}
|
|
1584
|
-
const
|
|
1591
|
+
const bt = ye({
|
|
1585
1592
|
onDrop: Ge,
|
|
1586
1593
|
subscribe: () => Ge
|
|
1587
1594
|
}), lt = ({ children: e }) => {
|
|
1588
1595
|
const t = D(/* @__PURE__ */ new Set());
|
|
1589
1596
|
return /* @__PURE__ */ r.createElement(
|
|
1590
|
-
|
|
1597
|
+
bt.Provider,
|
|
1591
1598
|
{
|
|
1592
1599
|
value: {
|
|
1593
1600
|
onDrop: (n) => {
|
|
1594
1601
|
var o;
|
|
1595
1602
|
if (n.preventDefault(), (o = n.dataTransfer) != null && o.files) {
|
|
1596
1603
|
const i = Array.from(n.dataTransfer.files);
|
|
1597
|
-
i.length > 0 && t.current.forEach((
|
|
1604
|
+
i.length > 0 && t.current.forEach((a) => a(i));
|
|
1598
1605
|
}
|
|
1599
1606
|
},
|
|
1600
1607
|
subscribe: (n) => (t.current.add(n), () => t.current.delete(n))
|
|
@@ -1602,96 +1609,97 @@ const ft = ye({
|
|
|
1602
1609
|
},
|
|
1603
1610
|
e
|
|
1604
1611
|
);
|
|
1605
|
-
},
|
|
1606
|
-
const { subscribe: t } = J(
|
|
1612
|
+
}, xi = ({ onDropFiles: e }) => {
|
|
1613
|
+
const { subscribe: t } = J(bt);
|
|
1607
1614
|
R(() => t(e), [e]);
|
|
1608
1615
|
};
|
|
1609
1616
|
lt.Consumer = ({ children: e }) => {
|
|
1610
|
-
const { onDrop: t } = J(
|
|
1617
|
+
const { onDrop: t } = J(bt);
|
|
1611
1618
|
return e({ onDrop: t, onDragOver: (i) => i.preventDefault() });
|
|
1612
1619
|
};
|
|
1613
1620
|
const se = (e) => {
|
|
1614
1621
|
const t = e;
|
|
1615
1622
|
return typeof t == "number" ? `${t}px` : t;
|
|
1616
|
-
},
|
|
1617
|
-
spinner:
|
|
1618
|
-
chat:
|
|
1619
|
-
message:
|
|
1620
|
-
error:
|
|
1621
|
-
info:
|
|
1622
|
-
refresh:
|
|
1623
|
-
"chevron-down":
|
|
1624
|
-
"chevron-right":
|
|
1625
|
-
done:
|
|
1626
|
-
user:
|
|
1627
|
-
"file-document":
|
|
1628
|
-
download:
|
|
1629
|
-
attach:
|
|
1630
|
-
delete:
|
|
1631
|
-
close:
|
|
1632
|
-
"close-filled":
|
|
1633
|
-
send:
|
|
1634
|
-
menu:
|
|
1635
|
-
expand:
|
|
1636
|
-
collapse:
|
|
1637
|
-
agent:
|
|
1638
|
-
question:
|
|
1639
|
-
actionbook:
|
|
1640
|
-
function:
|
|
1641
|
-
"radio-on":
|
|
1642
|
-
"radio-off":
|
|
1643
|
-
confluence:
|
|
1644
|
-
zendesk:
|
|
1645
|
-
salesforce:
|
|
1646
|
-
sprinklr:
|
|
1647
|
-
website:
|
|
1648
|
-
snippet:
|
|
1649
|
-
template:
|
|
1623
|
+
}, Ei = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), vi = {
|
|
1624
|
+
spinner: C(() => import("./BcUGcaq2.js")),
|
|
1625
|
+
chat: C(() => import("./DcFCGVBm.js")),
|
|
1626
|
+
message: C(() => import("./DsGXnanX.js")),
|
|
1627
|
+
error: C(() => import("./B6fvrWGq.js")),
|
|
1628
|
+
info: C(() => import("./CAIYsKDy.js")),
|
|
1629
|
+
refresh: C(() => import("./B6xd54zt.js")),
|
|
1630
|
+
"chevron-down": C(() => import("./BsimU71m.js")),
|
|
1631
|
+
"chevron-right": C(() => import("./NmJl7zv3.js")),
|
|
1632
|
+
done: C(() => import("./D_q6g3Dd.js")),
|
|
1633
|
+
user: C(() => import("./CvqfQEhO.js")),
|
|
1634
|
+
"file-document": C(() => import("./BAr50pfO.js")),
|
|
1635
|
+
download: C(() => import("./B2CtcWp3.js")),
|
|
1636
|
+
attach: C(() => import("./DY2ULcTX.js")),
|
|
1637
|
+
delete: C(() => import("./DMruRpOm.js")),
|
|
1638
|
+
close: C(() => import("./CuaBI7kd.js")),
|
|
1639
|
+
"close-filled": C(() => import("./CxQFWLnW.js")),
|
|
1640
|
+
send: C(() => import("./DZJyDpNp.js")),
|
|
1641
|
+
menu: C(() => import("./BUYabNz7.js")),
|
|
1642
|
+
expand: C(() => import("./wBtIAuNm.js")),
|
|
1643
|
+
collapse: C(() => import("./C0RFfifL.js")),
|
|
1644
|
+
agent: C(() => import("./Cc7XmLN1.js")),
|
|
1645
|
+
question: C(() => import("./dqwvRBog.js")),
|
|
1646
|
+
actionbook: C(() => import("./CrjNuryZ.js")),
|
|
1647
|
+
function: C(() => import("./CvdSjw1c.js")),
|
|
1648
|
+
"radio-on": C(() => import("./nmdo2Fbj.js")),
|
|
1649
|
+
"radio-off": C(() => import("./BnZcRFmS.js")),
|
|
1650
|
+
confluence: C(() => import("./BOnlh2zd.js")),
|
|
1651
|
+
zendesk: C(() => import("./BAJ6LEKc.js")),
|
|
1652
|
+
salesforce: C(() => import("./CT2kv4lr.js")),
|
|
1653
|
+
sprinklr: C(() => import("./m2INcyV2.js")),
|
|
1654
|
+
website: C(() => import("./BgGVGNdg.js")),
|
|
1655
|
+
snippet: C(() => import("./BFcXPuf5.js")),
|
|
1656
|
+
template: C(() => import("./awO7aBCv.js"))
|
|
1650
1657
|
}, $ = ({ type: e, size: t = 24, className: n, color: o }) => {
|
|
1651
|
-
const i =
|
|
1658
|
+
const i = vi[e];
|
|
1652
1659
|
return /* @__PURE__ */ r.createElement(
|
|
1653
|
-
|
|
1660
|
+
Ci,
|
|
1654
1661
|
{
|
|
1655
1662
|
className: n,
|
|
1656
|
-
$rtlFlip:
|
|
1663
|
+
$rtlFlip: Ei.has(e),
|
|
1657
1664
|
$size: t,
|
|
1658
1665
|
$color: o ?? u.color.primary.main
|
|
1659
1666
|
},
|
|
1660
1667
|
/* @__PURE__ */ r.createElement($e, { fallback: null }, /* @__PURE__ */ r.createElement(i, null))
|
|
1661
1668
|
);
|
|
1662
|
-
},
|
|
1669
|
+
}, yi = k`[dir='rtl'] &{transform:scaleX(-1);}`, Ci = c.div`width:${({ $size: e }) => se(e)};height:${({ $size: e }) => se(e)};display:inline-block;&:focus{outline:none;}svg{display:block;}[class*='fill']{fill:${({ $color: e }) => e};}[class*='stroke']{stroke:${({ $color: e }) => e};stroke-width:2px;stroke-linejoin:round;}${({ $rtlFlip: e }) => e && yi};`, S = ({
|
|
1663
1670
|
as: e,
|
|
1664
1671
|
variant: t = "body1",
|
|
1665
1672
|
color: n,
|
|
1666
1673
|
className: o,
|
|
1667
1674
|
...i
|
|
1668
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
1669
|
-
let n =
|
|
1670
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1675
|
+
}) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }), zt = /* @__PURE__ */ new WeakMap(), Ti = (e, t) => {
|
|
1676
|
+
let n = zt.get(t);
|
|
1677
|
+
n || (n = /* @__PURE__ */ new Map(), zt.set(t, n));
|
|
1671
1678
|
const o = n.get(e);
|
|
1672
1679
|
if (o) return o;
|
|
1673
|
-
const i = t[e] ?? t.body1,
|
|
1680
|
+
const i = t[e] ?? t.body1, a = k`font-size:${se(i.fontSize)};font-weight:${i.fontWeight};${i.fontFamily ? `font-family: ${i.fontFamily};` : ""}
|
|
1681
|
+
${i.lineHeight ? `line-height: ${i.lineHeight};` : "line-height: 100%;"}
|
|
1674
1682
|
`;
|
|
1675
|
-
return n.set(e,
|
|
1676
|
-
},
|
|
1677
|
-
loading:
|
|
1678
|
-
error:
|
|
1679
|
-
noChannels:
|
|
1680
|
-
noMessages:
|
|
1683
|
+
return n.set(e, a), a;
|
|
1684
|
+
}, _i = c.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => Ti(e, t.typography)}color:${({ $color: e }) => e};`, Od = ({ iconSize: e = 64, icon: t, className: n, label: o, children: i }) => /* @__PURE__ */ r.createElement(wi, { className: n }, /* @__PURE__ */ r.createElement($, { type: t, size: e, color: u.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(S, { variant: "body1", color: u.themedColor.textMidEmphasis }, o), i), Si = c.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, wi = c.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, ki = {
|
|
1685
|
+
loading: C(() => import("./D_jG_XZn.js")),
|
|
1686
|
+
error: C(() => import("./CSc2-BOs.js")),
|
|
1687
|
+
noChannels: C(() => import("./DeR_25I_.js")),
|
|
1688
|
+
noMessages: C(() => import("./XE_dyn7i.js"))
|
|
1681
1689
|
}, Ee = ({ className: e, type: t = "loading", ...n }) => {
|
|
1682
|
-
const o =
|
|
1683
|
-
return /* @__PURE__ */ r.createElement(
|
|
1684
|
-
}, Re = 244,
|
|
1685
|
-
function
|
|
1690
|
+
const o = ki[t];
|
|
1691
|
+
return /* @__PURE__ */ r.createElement(Si, { className: e }, /* @__PURE__ */ r.createElement($e, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
|
|
1692
|
+
}, Re = 244, Dn = 640, je = 26, Bn = 4, Q = 12, Te = 2, Ai = 16, ae = `${Z}-incoming-msg`, Ii = `${Z}-marked-text`;
|
|
1693
|
+
function xt(e) {
|
|
1686
1694
|
switch (e) {
|
|
1687
1695
|
case "top":
|
|
1688
1696
|
case "middle":
|
|
1689
1697
|
return Te;
|
|
1690
1698
|
default:
|
|
1691
|
-
return
|
|
1699
|
+
return Ai;
|
|
1692
1700
|
}
|
|
1693
1701
|
}
|
|
1694
|
-
function
|
|
1702
|
+
function Et(e, t) {
|
|
1695
1703
|
if (t) {
|
|
1696
1704
|
const [, n] = t.split("/");
|
|
1697
1705
|
if (n)
|
|
@@ -1704,134 +1712,134 @@ function xt(e, t) {
|
|
|
1704
1712
|
}
|
|
1705
1713
|
return "FILE";
|
|
1706
1714
|
}
|
|
1707
|
-
function
|
|
1715
|
+
function Pn(e) {
|
|
1708
1716
|
return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
|
|
1709
1717
|
}
|
|
1710
|
-
function
|
|
1718
|
+
function vt({
|
|
1711
1719
|
name: e,
|
|
1712
1720
|
type: t = "FILE",
|
|
1713
1721
|
iconColor: n,
|
|
1714
1722
|
iconBackgroundColor: o,
|
|
1715
1723
|
onClick: i
|
|
1716
1724
|
}) {
|
|
1717
|
-
const { colors:
|
|
1718
|
-
return /* @__PURE__ */ r.createElement(
|
|
1725
|
+
const { colors: a } = mt();
|
|
1726
|
+
return /* @__PURE__ */ r.createElement($i, { onClick: i, $clickable: !!i }, /* @__PURE__ */ r.createElement(Oi, { $bgColor: o ?? a.base.primary }, /* @__PURE__ */ r.createElement($, { type: "file-document", size: 24, color: n ?? a.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Li, null, /* @__PURE__ */ r.createElement(Ri, { variant: "button", color: u.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(S, { color: u.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
1719
1727
|
}
|
|
1720
|
-
const
|
|
1721
|
-
function
|
|
1722
|
-
return /* @__PURE__ */ r.createElement(
|
|
1723
|
-
|
|
1728
|
+
const $i = c.div`border-radius:12px;gap:8px;width:${Re}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${u.themedColor.textDisabled};background-color:${u.themedColor.bg_50_600};${({ $clickable: e }) => e && Mi}`, Mi = k`cursor:pointer;&:hover{background-color:${u.themedColor.bg_100_500};}`, Oi = c.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Li = c.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ri = c(S)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
1729
|
+
function Ni({ file: e, children: t, onClickFile: n }) {
|
|
1730
|
+
return /* @__PURE__ */ r.createElement(Di, null, /* @__PURE__ */ r.createElement(
|
|
1731
|
+
vt,
|
|
1724
1732
|
{
|
|
1725
1733
|
name: e.name,
|
|
1726
|
-
type:
|
|
1734
|
+
type: Et(e.name, e.type),
|
|
1727
1735
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
1728
1736
|
}
|
|
1729
1737
|
), t);
|
|
1730
1738
|
}
|
|
1731
|
-
const
|
|
1732
|
-
function
|
|
1733
|
-
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(
|
|
1739
|
+
const Di = c.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`;
|
|
1740
|
+
function Bi({ file: e, onClickMedia: t, children: n }) {
|
|
1741
|
+
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Hi, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Ui, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
|
|
1734
1742
|
if (o) {
|
|
1735
1743
|
const i = {
|
|
1736
1744
|
id: `${ae}-media-body`,
|
|
1737
1745
|
onClick: () => t == null ? void 0 : t(e)
|
|
1738
1746
|
};
|
|
1739
|
-
return /* @__PURE__ */ r.createElement(
|
|
1747
|
+
return /* @__PURE__ */ r.createElement(Pi, null, /* @__PURE__ */ r.createElement(Fi, { ...i }, o()), n);
|
|
1740
1748
|
}
|
|
1741
1749
|
return null;
|
|
1742
1750
|
}
|
|
1743
|
-
const
|
|
1751
|
+
const Pi = c.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`, Fi = c.div`width:${Re}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${B.light`
|
|
1744
1752
|
background-color: ${u.color.background100};
|
|
1745
1753
|
`}
|
|
1746
1754
|
${B.dark`
|
|
1747
1755
|
background-color: ${u.color.background400};
|
|
1748
1756
|
`}
|
|
1749
|
-
`,
|
|
1750
|
-
function
|
|
1751
|
-
const t = new RegExp(`${
|
|
1752
|
-
return e.replace(t, (n) => `<span id=${
|
|
1757
|
+
`, Hi = c.img`width:100%;height:100%;object-fit:cover;`, Ui = c.video`width:100%;height:100%;object-fit:cover;`, zi = "✱";
|
|
1758
|
+
function Fn(e) {
|
|
1759
|
+
const t = new RegExp(`${zi}+`, "g");
|
|
1760
|
+
return e.replace(t, (n) => `<span id=${Ii} aria-label="masked-text">${n}</span>`);
|
|
1753
1761
|
}
|
|
1754
|
-
function
|
|
1762
|
+
function Wi(e) {
|
|
1755
1763
|
const t = /```(\w+)?\n([\s\S]*?)```/g, n = [];
|
|
1756
1764
|
let o = 0;
|
|
1757
|
-
return e.replace(t, (i, ...
|
|
1758
|
-
const [
|
|
1765
|
+
return e.replace(t, (i, ...a) => {
|
|
1766
|
+
const [s, l, d] = a;
|
|
1759
1767
|
return o < d && n.push({
|
|
1760
1768
|
type: "text",
|
|
1761
1769
|
value: e.slice(o, d).trim()
|
|
1762
1770
|
}), n.push({
|
|
1763
1771
|
type: "code",
|
|
1764
1772
|
value: l.trim(),
|
|
1765
|
-
language:
|
|
1773
|
+
language: s ? s.trim() : "plaintext"
|
|
1766
1774
|
}), o = d + i.length, i;
|
|
1767
1775
|
}), o < e.length && n.push({
|
|
1768
1776
|
type: "text",
|
|
1769
1777
|
value: e.slice(o).trim()
|
|
1770
|
-
}), n.map((i) => i.type !== "text" ? i : { ...i, value:
|
|
1778
|
+
}), n.map((i) => i.type !== "text" ? i : { ...i, value: Fn(i.value) });
|
|
1771
1779
|
}
|
|
1772
|
-
const
|
|
1773
|
-
function
|
|
1774
|
-
var i,
|
|
1775
|
-
const t = e.maxBodyWidth ?? Re, n = Ie(() =>
|
|
1780
|
+
const Vi = C(async () => ({ default: (await import("./Dde5r6cu.js")).MarkdownText })), Gi = C(async () => ({ default: (await import("./DH2PekOm.js")).CodeBlock }));
|
|
1781
|
+
function Wt(e) {
|
|
1782
|
+
var i, a;
|
|
1783
|
+
const t = e.maxBodyWidth ?? Re, n = Ie(() => Wi(e.message), [e.message]), o = {
|
|
1776
1784
|
id: `${ae}-text-body`,
|
|
1777
1785
|
$maxWidth: t,
|
|
1778
1786
|
$color: (i = e.customStyle) == null ? void 0 : i.bubbleContentColor,
|
|
1779
|
-
$bgColor: (
|
|
1787
|
+
$bgColor: (a = e.customStyle) == null ? void 0 : a.bubbleBackgroundColor
|
|
1780
1788
|
};
|
|
1781
|
-
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(
|
|
1789
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Vt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Vt, { ...o }, n.map((s, l) => s.type === "text" ? /* @__PURE__ */ r.createElement(Gt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement($e, { fallback: s.value }, /* @__PURE__ */ r.createElement(Vi, null, s.value))) : s.type === "code" ? /* @__PURE__ */ r.createElement($e, { key: l, fallback: /* @__PURE__ */ r.createElement(Gt, { variant: "body3" }, s.value) }, /* @__PURE__ */ r.createElement(Gi, { code: s.value, language: s.language })) : null), e.children);
|
|
1782
1790
|
}
|
|
1783
|
-
const
|
|
1791
|
+
const Vt = c.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => k`
|
|
1784
1792
|
color: ${t || e.colors.messageIncoming.text};
|
|
1785
1793
|
background-color: ${n || e.colors.messageIncoming.background};
|
|
1786
1794
|
`}
|
|
1787
1795
|
padding: 12px 0;
|
|
1788
1796
|
transition: max-width 0.3s;
|
|
1789
1797
|
overflow-wrap: break-word;
|
|
1790
|
-
`,
|
|
1791
|
-
function
|
|
1792
|
-
const { stringSet: t } = M(), n =
|
|
1798
|
+
`, Gt = c(S)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
1799
|
+
function ji(e) {
|
|
1800
|
+
const { stringSet: t } = M(), n = Pn(e) ? /* @__PURE__ */ r.createElement(Wt, { ...e }) : null;
|
|
1793
1801
|
if (e.messageType === "user")
|
|
1794
1802
|
return n;
|
|
1795
1803
|
if (e.messageType === "file") {
|
|
1796
1804
|
const o = e.file;
|
|
1797
|
-
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(
|
|
1805
|
+
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Bi, { ...e }, n) : /* @__PURE__ */ r.createElement(Ni, { ...e }, n);
|
|
1798
1806
|
}
|
|
1799
|
-
return /* @__PURE__ */ r.createElement(
|
|
1807
|
+
return /* @__PURE__ */ r.createElement(Wt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
1800
1808
|
}
|
|
1801
|
-
const
|
|
1802
|
-
function
|
|
1803
|
-
return /* @__PURE__ */ r.createElement(
|
|
1809
|
+
const yt = (e) => /* @__PURE__ */ r.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.0008 0.973633C10.6172 0.973633 9.49558 2.09527 9.49558 3.47888C9.49558 4.50705 10.115 5.39055 11.0009 5.77664V7.47887H13.0009V5.77653C13.8868 5.3904 14.5061 4.50696 14.5061 3.47888C14.5061 2.09527 13.3844 0.973633 12.0008 0.973633ZM0.250977 16.5788L0.250977 10.5789H2.25098L2.25098 16.5788H0.250977ZM21.7511 10.5789V16.5788H23.7511V10.5789H21.7511ZM18.251 7.47888H3.25097V18.9789C3.25097 20.3596 4.37026 21.4789 5.75097 21.4789H18.251C19.6317 21.4789 20.751 20.3596 20.751 18.9789V9.97887C20.751 8.59816 19.6317 7.47888 18.251 7.47888ZM9.78434 11.9539V15.2038C9.78434 15.7561 9.33663 16.2038 8.78434 16.2038C8.23206 16.2038 7.78434 15.7561 7.78434 15.2038V11.9539C7.78434 11.4016 8.23206 10.9539 8.78434 10.9539C9.33663 10.9539 9.78434 11.4016 9.78434 11.9539ZM16.2677 11.9539V15.2038C16.2677 15.7561 15.82 16.2038 15.2677 16.2038C14.7154 16.2038 14.2677 15.7561 14.2677 15.2038V11.9539C14.2677 11.4016 14.7154 10.9539 15.2677 10.9539C15.82 10.9539 16.2677 11.4016 16.2677 11.9539Z", fill: "#0D0D0D" }));
|
|
1810
|
+
function Ct({ id: e, src: t, size: n = 56, onClick: o, style: i }) {
|
|
1811
|
+
return /* @__PURE__ */ r.createElement(Ki, { id: e, tabIndex: 0, onClick: o, $size: se(n), style: i }, t ? /* @__PURE__ */ r.createElement(Zi, { src: t }) : /* @__PURE__ */ r.createElement($, { type: "user", size: n }));
|
|
1804
1812
|
}
|
|
1805
|
-
const
|
|
1806
|
-
function
|
|
1813
|
+
const Ki = c.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${u.themedColor.bg_100_500};&:focus{outline:none;}`, Zi = c.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
1814
|
+
function Yi({ sender: e, isBotMessage: t }) {
|
|
1807
1815
|
const n = `${ae}-sender-avatar`;
|
|
1808
|
-
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(
|
|
1816
|
+
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(qi, { id: n }, /* @__PURE__ */ r.createElement(yt, null)) : /* @__PURE__ */ r.createElement(Ct, { id: n, size: je, src: e.profileUrl });
|
|
1809
1817
|
}
|
|
1810
|
-
const
|
|
1811
|
-
function
|
|
1812
|
-
return /* @__PURE__ */ r.createElement(
|
|
1818
|
+
const qi = c.div`flex-shrink:0;width:${je}px;height:${je}px;box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary};path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}}`;
|
|
1819
|
+
function Ji({ sender: e }) {
|
|
1820
|
+
return /* @__PURE__ */ r.createElement(Xi, { id: `${ae}-sender-name`, variant: "caption1", color: u.themedColor.textMidEmphasis }, e.nickname);
|
|
1813
1821
|
}
|
|
1814
|
-
const
|
|
1815
|
-
function
|
|
1822
|
+
const Xi = c(S)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
1823
|
+
function Qi({ createdAt: e }) {
|
|
1816
1824
|
const { stringSet: t, format: n } = M();
|
|
1817
1825
|
return e ? /* @__PURE__ */ r.createElement(S, { id: `${ae}-sent-time`, variant: "caption4", color: u.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
1818
1826
|
}
|
|
1819
|
-
function
|
|
1820
|
-
return /* @__PURE__ */ r.createElement(
|
|
1827
|
+
function es({ customStyle: e }) {
|
|
1828
|
+
return /* @__PURE__ */ r.createElement(ts, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(ns, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
|
|
1821
1829
|
}
|
|
1822
|
-
const
|
|
1823
|
-
function
|
|
1830
|
+
const ts = c.div`align-items:center;border-radius:12px;display:flex;gap:6px;justify-content:center;padding:16px 12px;background-color:${({ theme: e, $bgColor: t }) => t || e.colors.messageIncoming.background};`, ns = c.span`animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px;background:${({ theme: e, $color: t }) => t || e.colors.messageIncoming.text};@keyframes blink{0%{opacity:0.12;transform:scale(1);}21.43%{opacity:0.38;transform:scale(1.2);}42.86%{opacity:0.12;transform:scale(1);}100%{opacity:0.12;transform:scale(1);}}&:nth-child(1){animation-delay:0.4s;}&:nth-child(2){animation-delay:0.6s;}&:nth-child(3){animation-delay:0.8s;}`;
|
|
1831
|
+
function rs({
|
|
1824
1832
|
extendedMessagePayload: e,
|
|
1825
|
-
onClickCTA: t = ({ url: n }) =>
|
|
1833
|
+
onClickCTA: t = ({ url: n }) => Ln(n)
|
|
1826
1834
|
}) {
|
|
1827
1835
|
const n = e == null ? void 0 : e.cta_button;
|
|
1828
|
-
return n ? /* @__PURE__ */ r.createElement(
|
|
1836
|
+
return n ? /* @__PURE__ */ r.createElement(os, { id: `${ae}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(is, { variant: "button" }, n.label)) : null;
|
|
1829
1837
|
}
|
|
1830
|
-
const
|
|
1831
|
-
function
|
|
1838
|
+
const os = c.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;background-color:${u.color.primary.main};color:${({ theme: e }) => e.colors.base.primaryContrastContent};&:hover{background-color:${u.color.primary.dark};}`, is = c(S)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
|
|
1839
|
+
function ss(e) {
|
|
1832
1840
|
return /* @__PURE__ */ r.createElement(r.Fragment, null);
|
|
1833
1841
|
}
|
|
1834
|
-
class
|
|
1842
|
+
class as extends mr {
|
|
1835
1843
|
constructor(t) {
|
|
1836
1844
|
super(t), this.state = {
|
|
1837
1845
|
hasError: !1
|
|
@@ -1844,91 +1852,91 @@ class is extends ur {
|
|
|
1844
1852
|
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement($e, { fallback: this.props.loadingFallback }, this.props.children);
|
|
1845
1853
|
}
|
|
1846
1854
|
}
|
|
1847
|
-
const
|
|
1848
|
-
parser:
|
|
1849
|
-
renderer:
|
|
1855
|
+
const ls = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: cs } = Fr({
|
|
1856
|
+
parser: Br,
|
|
1857
|
+
renderer: Dr,
|
|
1850
1858
|
Container: (e) => /* @__PURE__ */ r.createElement("div", { ...e })
|
|
1851
1859
|
});
|
|
1852
|
-
function
|
|
1860
|
+
function ds(e) {
|
|
1853
1861
|
return /* @__PURE__ */ r.createElement(
|
|
1854
|
-
|
|
1862
|
+
as,
|
|
1855
1863
|
{
|
|
1856
1864
|
errorFallback: e.messageTemplateErrorFallback,
|
|
1857
1865
|
loadingFallback: e.messageTemplateLoadingFallback
|
|
1858
1866
|
},
|
|
1859
|
-
/* @__PURE__ */ r.createElement(
|
|
1867
|
+
/* @__PURE__ */ r.createElement(us, { ...e })
|
|
1860
1868
|
);
|
|
1861
1869
|
}
|
|
1862
|
-
const
|
|
1870
|
+
const us = ({
|
|
1863
1871
|
extendedMessagePayload: e,
|
|
1864
1872
|
onGetCachedMessageTemplate: t = () => null,
|
|
1865
1873
|
onRequestMessageTemplate: n
|
|
1866
1874
|
}) => {
|
|
1867
1875
|
const o = e == null ? void 0 : e.message_template;
|
|
1868
|
-
if (!
|
|
1876
|
+
if (!ls.has((o == null ? void 0 : o.type) ?? "default")) throw new Error("Unsupported template type");
|
|
1869
1877
|
if (!n) throw new Error("onRequestMessageTemplate is required");
|
|
1870
|
-
const { theme:
|
|
1878
|
+
const { theme: a } = Ko(), s = Lo({
|
|
1871
1879
|
onRequestTemplate: n,
|
|
1872
1880
|
onGetCachedTemplate: t,
|
|
1873
|
-
theme:
|
|
1881
|
+
theme: a.selectedTheme,
|
|
1874
1882
|
templateKey: (o == null ? void 0 : o.key) ?? "invalid",
|
|
1875
1883
|
variables: o == null ? void 0 : o.variables,
|
|
1876
1884
|
viewVariables: o == null ? void 0 : o.view_variables,
|
|
1877
|
-
aiAgentColorVariables:
|
|
1885
|
+
aiAgentColorVariables: a.aiAgentColorVariables
|
|
1878
1886
|
});
|
|
1879
|
-
return /* @__PURE__ */ r.createElement(
|
|
1880
|
-
},
|
|
1881
|
-
function
|
|
1887
|
+
return /* @__PURE__ */ r.createElement(ms, { id: `${ae}-ext-message-template` }, /* @__PURE__ */ r.createElement(Pr, { message: {} }, /* @__PURE__ */ r.createElement(cs, { templateItems: s.body.items, templateVersion: s.version })));
|
|
1888
|
+
}, ms = c.div`box-sizing:border-box;overflow:hidden;width:100%;`;
|
|
1889
|
+
function gs({
|
|
1882
1890
|
extendedMessagePayload: e,
|
|
1883
1891
|
onClickSuggestedReply: t,
|
|
1884
1892
|
suggestedRepliesDirection: n = "vertical"
|
|
1885
1893
|
}) {
|
|
1886
|
-
const [o, i] =
|
|
1887
|
-
return
|
|
1888
|
-
|
|
1894
|
+
const [o, i] = T(!1), a = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
1895
|
+
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(ps, { id: `${ae}-ext-suggested-replies`, $type: n }, a.map((s, l) => /* @__PURE__ */ r.createElement(
|
|
1896
|
+
hs,
|
|
1889
1897
|
{
|
|
1890
1898
|
key: l,
|
|
1891
1899
|
$type: n,
|
|
1892
1900
|
variant: "body3",
|
|
1893
1901
|
onClick: () => {
|
|
1894
|
-
t && (t == null || t({ reply:
|
|
1902
|
+
t && (t == null || t({ reply: s }), i(!0));
|
|
1895
1903
|
}
|
|
1896
1904
|
},
|
|
1897
|
-
|
|
1905
|
+
s
|
|
1898
1906
|
)));
|
|
1899
1907
|
}
|
|
1900
|
-
const
|
|
1901
|
-
${e === "vertical" ?
|
|
1908
|
+
const ps = c.div`margin:16px 0;padding:0 ${Q}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? fs : bs};`, hs = c(S)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${u.color.primary.main};border:1px solid ${u.color.primary.main};background-color:${u.themedColor.bg_50_600};&:hover{background-color:${u.themedColor.bg_100_500};}${({ $type: e, theme: t }) => k`
|
|
1909
|
+
${e === "vertical" ? xs : Es};
|
|
1902
1910
|
&:active {
|
|
1903
1911
|
background-color: ${t.colors.base.primary};
|
|
1904
1912
|
color: ${t.colors.base.primaryContrastContent};
|
|
1905
1913
|
}
|
|
1906
1914
|
`}
|
|
1907
|
-
`,
|
|
1908
|
-
function
|
|
1915
|
+
`, fs = k`flex-direction:column;align-items:flex-end;`, bs = k`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, xs = k`max-width:calc(100% - 70px);white-space:pre-wrap;`, Es = k`white-space:nowrap;`;
|
|
1916
|
+
function Tt(e) {
|
|
1909
1917
|
return e();
|
|
1910
1918
|
}
|
|
1911
1919
|
const ve = Ce({
|
|
1912
|
-
template:
|
|
1920
|
+
template: vs,
|
|
1913
1921
|
components: {
|
|
1914
|
-
SenderName:
|
|
1915
|
-
SenderAvatar:
|
|
1916
|
-
SentTime:
|
|
1917
|
-
MessageBody:
|
|
1918
|
-
TypingIndicator:
|
|
1919
|
-
SuggestedReplies:
|
|
1920
|
-
MessageTemplate:
|
|
1921
|
-
CTAButton:
|
|
1922
|
-
MessageLogs:
|
|
1922
|
+
SenderName: Ji,
|
|
1923
|
+
SenderAvatar: Yi,
|
|
1924
|
+
SentTime: Qi,
|
|
1925
|
+
MessageBody: ji,
|
|
1926
|
+
TypingIndicator: es,
|
|
1927
|
+
SuggestedReplies: gs,
|
|
1928
|
+
MessageTemplate: ds,
|
|
1929
|
+
CTAButton: rs,
|
|
1930
|
+
MessageLogs: ss
|
|
1923
1931
|
}
|
|
1924
1932
|
});
|
|
1925
|
-
function
|
|
1926
|
-
return /* @__PURE__ */ r.createElement(
|
|
1933
|
+
function vs(e) {
|
|
1934
|
+
return /* @__PURE__ */ r.createElement(Hn, { ...e, testerMode: !1 });
|
|
1927
1935
|
}
|
|
1928
|
-
function
|
|
1936
|
+
function Hn(e) {
|
|
1929
1937
|
var p, h, b, x;
|
|
1930
|
-
const { components: t } = ve.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((p = e.extendedMessagePayload) != null && p.message_template),
|
|
1931
|
-
return /* @__PURE__ */ r.createElement(
|
|
1938
|
+
const { components: t } = ve.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((p = e.extendedMessagePayload) != null && p.message_template), a = !!((h = e.extendedMessagePayload) != null && h.cta_button), s = !!e.createdAt, l = Tt(() => e.messageType === "user" ? e.message.length > 0 : !0), d = e.groupType === "top" || e.groupType === "single", g = e.groupType === "bottom" || e.groupType === "single", m = o ? 0 : je;
|
|
1939
|
+
return /* @__PURE__ */ r.createElement(ys, { $marginBottom: n ? 0 : xt(e.groupType) }, d && /* @__PURE__ */ r.createElement(Cs, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Rt, null, /* @__PURE__ */ r.createElement(nt, { $extraStartPadding: m }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, a && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })))), i && /* @__PURE__ */ r.createElement(jt, { $startPadding: 0, $endPadding: 0, style: { marginTop: l ? Te : 0 } }, /* @__PURE__ */ r.createElement(
|
|
1932
1940
|
t.MessageTemplate,
|
|
1933
1941
|
{
|
|
1934
1942
|
...e,
|
|
@@ -1942,71 +1950,71 @@ function Fn(e) {
|
|
|
1942
1950
|
)),
|
|
1943
1951
|
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(nt, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
|
|
1944
1952
|
}
|
|
1945
|
-
))), g &&
|
|
1953
|
+
))), g && s && /* @__PURE__ */ r.createElement(Ts, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Rt, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(jt, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
|
|
1946
1954
|
}
|
|
1947
|
-
const
|
|
1955
|
+
const ys = c.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
1948
1956
|
`, Je = c.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = Q, $endPadding: t = Q, $extraStartPadding: n = 0 }) => `
|
|
1949
1957
|
padding-inline: ${e + n}px ${t}px;
|
|
1950
1958
|
`}
|
|
1951
|
-
`,
|
|
1959
|
+
`, Cs = c(Je)`display:flex;flex-direction:row;align-items:center;gap:8px;`, nt = c(Je)`display:flex;`, Ts = c(Je)`margin-top:${Bn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, jt = c(Je)`display:flex;flex-direction:column;${({ $startPadding: e = Q, $endPadding: t = Q, $extraStartPadding: n = 0 }) => `
|
|
1952
1960
|
padding-inline: ${e + n}px ${t}px;
|
|
1953
1961
|
`}
|
|
1954
1962
|
`;
|
|
1955
|
-
function
|
|
1956
|
-
return /* @__PURE__ */ r.createElement(
|
|
1957
|
-
|
|
1963
|
+
function _s({ file: e, children: t, onClickFile: n }) {
|
|
1964
|
+
return /* @__PURE__ */ r.createElement(Ss, null, /* @__PURE__ */ r.createElement(
|
|
1965
|
+
vt,
|
|
1958
1966
|
{
|
|
1959
1967
|
name: e.name,
|
|
1960
|
-
type:
|
|
1968
|
+
type: Et(e.name, e.type),
|
|
1961
1969
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
1962
1970
|
}
|
|
1963
1971
|
), t);
|
|
1964
1972
|
}
|
|
1965
|
-
const
|
|
1966
|
-
function
|
|
1967
|
-
const { aspectRatio: i, localFile:
|
|
1973
|
+
const Ss = c.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Un = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(ws, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement($, { type: "spinner", size: n })), ws = c.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => se(e)};height:${({ $size: e }) => se(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
1974
|
+
function ks({ file: e, metadata: t, onClickMedia: n, children: o }) {
|
|
1975
|
+
const { aspectRatio: i, localFile: a } = t, [s] = T(() => a instanceof File ? URL.createObjectURL(a) : e.url), [l, d] = T(!1), g = {
|
|
1968
1976
|
onClick: () => n == null ? void 0 : n(e),
|
|
1969
1977
|
$ratio: i
|
|
1970
1978
|
};
|
|
1971
|
-
return /* @__PURE__ */ r.createElement(
|
|
1979
|
+
return /* @__PURE__ */ r.createElement(As, null, /* @__PURE__ */ r.createElement(Is, { ...g }, !l && /* @__PURE__ */ r.createElement(Un, { size: 26 }, /* @__PURE__ */ r.createElement($, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement($s, { $loaded: l, src: s, alt: "image-message", onLoad: () => d(!0) })), o);
|
|
1972
1980
|
}
|
|
1973
|
-
const
|
|
1981
|
+
const As = c.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Is = c.div`width:${Re}px;border-radius:12px;overflow:hidden;cursor:pointer;height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${B.light`
|
|
1974
1982
|
background-color: ${u.color.background100};
|
|
1975
1983
|
`}
|
|
1976
1984
|
${B.dark`
|
|
1977
1985
|
background-color: ${u.color.background400};
|
|
1978
1986
|
`}
|
|
1979
|
-
`,
|
|
1980
|
-
function
|
|
1987
|
+
`, $s = c.img`position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0;object-fit:cover;opacity:${(e) => e.$loaded ? 1 : 0};transition:opacity 0.5s ease;`;
|
|
1988
|
+
function Kt(e) {
|
|
1981
1989
|
var n, o;
|
|
1982
|
-
const t = Ie(() =>
|
|
1990
|
+
const t = Ie(() => bn.sanitize(Fn(e.message)), [e.message]);
|
|
1983
1991
|
return /* @__PURE__ */ r.createElement(
|
|
1984
|
-
|
|
1992
|
+
Ms,
|
|
1985
1993
|
{
|
|
1986
1994
|
$maxWidth: e.maxBodyWidth ?? Re,
|
|
1987
1995
|
$color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
|
|
1988
1996
|
$bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
|
|
1989
1997
|
},
|
|
1990
|
-
/* @__PURE__ */ r.createElement(
|
|
1998
|
+
/* @__PURE__ */ r.createElement(Os, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
|
|
1991
1999
|
);
|
|
1992
2000
|
}
|
|
1993
|
-
const
|
|
2001
|
+
const Ms = c.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => k`
|
|
1994
2002
|
color: ${t || e.colors.messageOutgoing.text};
|
|
1995
2003
|
background-color: ${n || e.colors.messageOutgoing.background};
|
|
1996
2004
|
`}
|
|
1997
2005
|
padding: 12px 0;
|
|
1998
2006
|
transition: max-width 0.3s;
|
|
1999
2007
|
overflow-wrap: break-word;
|
|
2000
|
-
`,
|
|
2001
|
-
function
|
|
2002
|
-
const { stringSet: t } = M(), n =
|
|
2003
|
-
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(
|
|
2008
|
+
`, Os = c(S)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2009
|
+
function Ls(e) {
|
|
2010
|
+
const { stringSet: t } = M(), n = Pn(e) ? /* @__PURE__ */ r.createElement(Kt, { ...e }) : null;
|
|
2011
|
+
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(ks, { ...e }, n) : /* @__PURE__ */ r.createElement(_s, { ...e }, n) : /* @__PURE__ */ r.createElement(Kt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
2004
2012
|
}
|
|
2005
|
-
function
|
|
2006
|
-
const t =
|
|
2013
|
+
function Rs({ sendingStatus: e }) {
|
|
2014
|
+
const t = mt();
|
|
2007
2015
|
switch (e) {
|
|
2008
2016
|
case "pending":
|
|
2009
|
-
return /* @__PURE__ */ r.createElement(
|
|
2017
|
+
return /* @__PURE__ */ r.createElement(Ns, { size: 16 }, /* @__PURE__ */ r.createElement($, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
2010
2018
|
case "failed":
|
|
2011
2019
|
return /* @__PURE__ */ r.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ r.createElement($, { type: "error", color: u.themedColor.error, size: 16 }));
|
|
2012
2020
|
case "scheduled":
|
|
@@ -2016,41 +2024,41 @@ function Os({ sendingStatus: e }) {
|
|
|
2016
2024
|
return /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement($, { type: "chevron-down" }));
|
|
2017
2025
|
}
|
|
2018
2026
|
}
|
|
2019
|
-
const
|
|
2020
|
-
function
|
|
2027
|
+
const Ns = c(Un)`margin-bottom:2px;width:16px;height:16px;`;
|
|
2028
|
+
function Ds({ createdAt: e }) {
|
|
2021
2029
|
const { stringSet: t, format: n } = M();
|
|
2022
2030
|
return e ? /* @__PURE__ */ r.createElement(S, { variant: "caption4", color: u.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2023
2031
|
}
|
|
2024
|
-
const
|
|
2025
|
-
template:
|
|
2032
|
+
const _t = Ce({
|
|
2033
|
+
template: Bs,
|
|
2026
2034
|
components: {
|
|
2027
|
-
SendingStatus:
|
|
2028
|
-
SentTime:
|
|
2029
|
-
MessageBody:
|
|
2035
|
+
SendingStatus: Rs,
|
|
2036
|
+
SentTime: Ds,
|
|
2037
|
+
MessageBody: Ls
|
|
2030
2038
|
}
|
|
2031
2039
|
});
|
|
2032
|
-
function
|
|
2033
|
-
const { components: t } =
|
|
2034
|
-
return /* @__PURE__ */ r.createElement(
|
|
2040
|
+
function Bs(e) {
|
|
2041
|
+
const { components: t } = _t.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
|
|
2042
|
+
return /* @__PURE__ */ r.createElement(Ps, { $marginBottom: xt(e.groupType) }, /* @__PURE__ */ r.createElement(Fs, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(Hs, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
|
|
2035
2043
|
}
|
|
2036
|
-
const
|
|
2037
|
-
`,
|
|
2038
|
-
`,
|
|
2039
|
-
function
|
|
2040
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(
|
|
2044
|
+
const Ps = c.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2045
|
+
`, zn = c.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = Q, $endPadding: t = Q, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
|
|
2046
|
+
`, Fs = c(zn)``, Hs = c(zn)`margin-top:${Bn}px;`;
|
|
2047
|
+
function Us(e) {
|
|
2048
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(zs, null, /* @__PURE__ */ r.createElement(S, { variant: "caption2", color: u.themedColor.textMidEmphasis }, Ws(bn.sanitize(e.message))));
|
|
2041
2049
|
}
|
|
2042
|
-
const
|
|
2050
|
+
const zs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Ws = (e) => {
|
|
2043
2051
|
const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, n = [];
|
|
2044
2052
|
let o = 0;
|
|
2045
|
-
return e.replace(t, (i,
|
|
2046
|
-
/* @__PURE__ */ r.createElement("a", { key:
|
|
2053
|
+
return e.replace(t, (i, a, s, l) => (n.push(e.slice(o, l)), n.push(
|
|
2054
|
+
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel: ft }, a)
|
|
2047
2055
|
), o = l + i.length, i)), n.push(e.slice(o)), n;
|
|
2048
|
-
},
|
|
2056
|
+
}, Vs = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
|
|
2049
2057
|
const { stringSet: i } = M();
|
|
2050
2058
|
return R(() => {
|
|
2051
2059
|
typeof n > "u" && typeof t == "boolean" && (o == null || o(t));
|
|
2052
|
-
}, [n, t]), /* @__PURE__ */ r.createElement(
|
|
2053
|
-
|
|
2060
|
+
}, [n, t]), /* @__PURE__ */ r.createElement(Gs, null, /* @__PURE__ */ r.createElement(S, { variant: "caption2", color: u.themedColor.textMidEmphasis }, i.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
|
|
2061
|
+
Zt,
|
|
2054
2062
|
{
|
|
2055
2063
|
checked: n === !0,
|
|
2056
2064
|
label: i.CSAT_CRE_SOLVED,
|
|
@@ -2058,7 +2066,7 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2058
2066
|
onClick: () => o == null ? void 0 : o(!0)
|
|
2059
2067
|
}
|
|
2060
2068
|
), /* @__PURE__ */ r.createElement(
|
|
2061
|
-
|
|
2069
|
+
Zt,
|
|
2062
2070
|
{
|
|
2063
2071
|
checked: n === !1,
|
|
2064
2072
|
label: i.CSAT_CRE_NOT_SOLVED,
|
|
@@ -2066,17 +2074,17 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2066
2074
|
onClick: () => o == null ? void 0 : o(!1)
|
|
2067
2075
|
}
|
|
2068
2076
|
)));
|
|
2069
|
-
},
|
|
2070
|
-
const i = t ? u.color.primary.main : o ? u.themedColor.textDisabled : u.themedColor.textLowEmphasis,
|
|
2071
|
-
return /* @__PURE__ */ r.createElement(
|
|
2072
|
-
}, Ws = c.div`display:flex;flex-direction:column;gap:8px;`, Vs = c.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, Gs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08301 20C2.08301 10.1049 10.1046 2.08334 19.9997 2.08334C29.8948 2.08334 37.9163 10.1049 37.9163 20C37.9163 29.8952 29.8948 37.9167 19.9997 37.9167C10.1046 37.9167 2.08301 29.8952 2.08301 20Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5824 29.3328C13.1344 29.7473 13.918 29.636 14.3326 29.084C15.6269 27.3607 17.6835 26.25 19.9997 26.25C22.316 26.25 24.3727 27.3607 25.6668 29.084C26.0815 29.636 26.865 29.7473 27.4172 29.3328C27.9692 28.9182 28.0805 28.1347 27.6658 27.5825C25.9198 25.2577 23.1357 23.75 19.9997 23.75C16.8638 23.75 14.0797 25.2577 12.3336 27.5825C11.919 28.1347 12.0304 28.9182 12.5824 29.3328Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M28.4449 13.7707C29.1324 13.8328 29.64 14.4406 29.578 15.1281C29.516 15.8153 28.909 16.3221 28.2219 16.2608C28.2219 16.2608 28.0282 16.2502 27.9267 16.2487C27.7224 16.2457 27.4382 16.2509 27.1224 16.2833C26.7864 16.3177 26.4644 16.3782 26.1799 16.4662L26.304 16.86C26.7792 18.3675 25.5094 19.5813 24.2057 19.5813C23.504 19.5813 22.8319 19.2617 22.4295 18.6857C22.0025 18.0745 21.9417 17.241 22.4075 16.5344C22.7505 16.0143 23.2444 15.3831 23.8959 14.8657C24.8355 14.1195 26.0435 13.8809 26.867 13.7963C27.3024 13.7517 28.0149 13.7319 28.4449 13.7707Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M11.5553 13.7707C10.8677 13.8328 10.3601 14.4406 10.4221 15.1281C10.4842 15.8153 11.0912 16.3221 11.7782 16.2608C11.7782 16.2608 11.972 16.2502 12.0734 16.2487C12.2778 16.2457 12.562 16.2509 12.8778 16.2833C13.2137 16.3177 13.5357 16.3782 13.8203 16.4662L13.6962 16.86C13.2209 18.3675 14.4907 19.5813 15.7944 19.5813C16.4962 19.5813 17.1683 19.2617 17.5707 18.6857C17.9975 18.0745 18.0585 17.241 17.5925 16.5344C17.2497 16.0143 16.7557 15.3831 16.1043 14.8657C15.1646 14.1195 13.9566 13.8809 13.1331 13.7963C12.6978 13.7517 11.9853 13.7319 11.5553 13.7707Z", fill: "black", fillOpacity: 0.12 })), js = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08337 19.9999C2.08337 10.1048 10.1049 2.08325 20 2.08325C29.8952 2.08325 37.9167 10.1048 37.9167 19.9999C37.9167 29.8951 29.8952 37.9166 20 37.9166C10.1049 37.9166 2.08337 29.8951 2.08337 19.9999Z", fill: "url(#paint0_linear_159_173206)" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5828 29.3328C13.1348 29.7473 13.9184 29.636 14.3329 29.084C15.6272 27.3607 17.6839 26.25 20 26.25C22.3164 26.25 24.373 27.3607 25.6672 29.084C26.0819 29.636 26.8654 29.7473 27.4175 29.3328C27.9695 28.9182 28.0809 28.1347 27.6662 27.5825C25.9202 25.2577 23.136 23.75 20 23.75C16.8642 23.75 14.0801 25.2577 12.334 27.5825C11.9194 28.1347 12.0308 28.9182 12.5828 29.3328Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M28.4454 13.7707C29.1329 13.8328 29.6405 14.4406 29.5785 15.1281C29.5165 15.8153 28.9095 16.3221 28.2224 16.2608C28.2224 16.2608 28.0287 16.2502 27.9272 16.2487C27.7229 16.2457 27.4387 16.2509 27.1229 16.2833C26.7869 16.3177 26.4649 16.3782 26.1804 16.4662L26.3045 16.86C26.7797 18.3675 25.5099 19.5813 24.2062 19.5813C23.5045 19.5813 22.8324 19.2617 22.43 18.6857C22.003 18.0745 21.9422 17.241 22.408 16.5344C22.751 16.0143 23.2449 15.3831 23.8964 14.8657C24.836 14.1195 26.044 13.8809 26.8675 13.7963C27.3029 13.7517 28.0154 13.7319 28.4454 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.5549 13.7707C10.8674 13.8328 10.3597 14.4406 10.4218 15.1281C10.4838 15.8153 11.0908 16.3221 11.7779 16.2608C11.7779 16.2608 11.9716 16.2502 12.073 16.2487C12.2774 16.2457 12.5616 16.2509 12.8774 16.2833C13.2134 16.3177 13.5353 16.3782 13.8199 16.4662L13.6958 16.86C13.2205 18.3675 14.4904 19.5813 15.794 19.5813C16.4958 19.5813 17.168 19.2617 17.5703 18.6857C17.9971 18.0745 18.0581 17.241 17.5921 16.5344C17.2493 16.0143 16.7553 15.3831 16.1039 14.8657C15.1643 14.1195 13.9562 13.8809 13.1327 13.7963C12.6974 13.7517 11.9849 13.7319 11.5549 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ r.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ r.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), Ks = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M15 28.333C16.3927 27.2867 18.124 26.6667 20 26.6667C21.876 26.6667 23.6073 27.2867 25 28.333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 13.3511C11.667 13.3511 14.0161 13.139 15.3268 14.18M15.3268 14.18L14.8882 15.5711C14.7153 16.1199 15.1675 16.6667 15.7943 16.6667C16.4531 16.6667 16.8882 16.0723 16.549 15.5579C16.2483 15.102 15.8388 14.5866 15.3268 14.18ZM23.3337 13.3511C23.3337 13.3511 25.6827 13.139 26.9935 14.18M26.9935 14.18L26.555 15.5711C26.382 16.1199 26.8342 16.6667 27.461 16.6667C28.1198 16.6667 28.5548 16.0723 28.2157 15.5579C27.915 15.102 27.5055 14.5866 26.9935 14.18Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), Zs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { d: "M14.249 27.334C15.851 26.13 17.844 25.417 20 25.417c2.156 0 4.149.714 5.751 1.917.553.415.664 1.199.25 1.751-.415.552-1.199.664-1.751.25-1.183-.889-2.652-1.416-4.25-1.416s-3.067.527-4.25 1.416c-.553.414-1.336.302-1.751-.25-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M23.445 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.125-.394c-.285-.088-.607-.148-.942-.182-.316-.033-.6-.038-.804-.035-.101.002-.242.01-.294.013Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.779 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.124-.394c-.284-.088-.606-.148-.941-.182-.316-.033-.6-.038-.804-.035-.101.002-.243.01-.294.013Z", fill: "#141B34" })), Ys = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), qs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.75 26.667c0-.691.56-1.25 1.25-1.25h10c.69 0 1.25.559 1.25 1.25 0 .691-.56 1.25-1.25 1.25h-10c-.69 0-1.25-.559-1.25-1.25Z", fill: "#141B34" })), Js = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.333 25C14.8532 27.024 17.2735 28.3333 19.9997 28.3333C22.7258 28.3333 25.1462 27.024 26.6663 25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), Xs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.583 24.001c.552-.414 1.335-.302 1.75.25 1.294 1.723 3.35 2.834 5.667 2.834s4.373-1.11 5.667-2.834c.415-.552 1.199-.664 1.751-.25.552.415.664 1.199.25 1.751C25.92 28.076 23.136 29.584 20 29.584s-5.92-1.508-7.666-3.832c-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" })), Qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6663C29.2044 36.6663 36.6663 29.2044 36.6663 19.9997C36.6663 10.7949 29.2044 3.33301 19.9997 3.33301C10.7949 3.33301 3.33301 10.7949 3.33301 19.9997C3.33301 29.2044 10.7949 36.6663 19.9997 36.6663Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M19.9997 30C23.16 30 25.8145 27.867 26.56 24.9832C26.9068 23.6413 26.4033 23.3333 25.0765 23.3333H14.9228C13.5959 23.3333 13.0925 23.6413 13.4393 24.9832C14.1848 27.867 16.8393 30 19.9997 30Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.8333C11.667 14.4526 12.7863 13.3333 14.167 13.3333C15.5477 13.3333 16.667 14.4526 16.667 15.8333M23.3337 15.8333C23.3337 14.4526 24.453 13.3333 25.8337 13.3333C27.2143 13.3333 28.3337 14.4526 28.3337 15.8333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), ea = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("mask", { id: "mask0_159_173224", style: {
|
|
2077
|
+
}, Zt = ({ onClick: e, checked: t, label: n, disabled: o }) => {
|
|
2078
|
+
const i = t ? u.color.primary.main : o ? u.themedColor.textDisabled : u.themedColor.textLowEmphasis, a = t ? u.themedColor.textHighEmphasis : o ? u.themedColor.textLowEmphasis : u.themedColor.textHighEmphasis;
|
|
2079
|
+
return /* @__PURE__ */ r.createElement(js, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement($, { size: 24, type: t ? "radio-on" : "radio-off", color: i }), /* @__PURE__ */ r.createElement(S, { variant: "caption2", color: a }, n));
|
|
2080
|
+
}, Gs = c.div`display:flex;flex-direction:column;gap:8px;`, js = c.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, Ks = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08301 20C2.08301 10.1049 10.1046 2.08334 19.9997 2.08334C29.8948 2.08334 37.9163 10.1049 37.9163 20C37.9163 29.8952 29.8948 37.9167 19.9997 37.9167C10.1046 37.9167 2.08301 29.8952 2.08301 20Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5824 29.3328C13.1344 29.7473 13.918 29.636 14.3326 29.084C15.6269 27.3607 17.6835 26.25 19.9997 26.25C22.316 26.25 24.3727 27.3607 25.6668 29.084C26.0815 29.636 26.865 29.7473 27.4172 29.3328C27.9692 28.9182 28.0805 28.1347 27.6658 27.5825C25.9198 25.2577 23.1357 23.75 19.9997 23.75C16.8638 23.75 14.0797 25.2577 12.3336 27.5825C11.919 28.1347 12.0304 28.9182 12.5824 29.3328Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M28.4449 13.7707C29.1324 13.8328 29.64 14.4406 29.578 15.1281C29.516 15.8153 28.909 16.3221 28.2219 16.2608C28.2219 16.2608 28.0282 16.2502 27.9267 16.2487C27.7224 16.2457 27.4382 16.2509 27.1224 16.2833C26.7864 16.3177 26.4644 16.3782 26.1799 16.4662L26.304 16.86C26.7792 18.3675 25.5094 19.5813 24.2057 19.5813C23.504 19.5813 22.8319 19.2617 22.4295 18.6857C22.0025 18.0745 21.9417 17.241 22.4075 16.5344C22.7505 16.0143 23.2444 15.3831 23.8959 14.8657C24.8355 14.1195 26.0435 13.8809 26.867 13.7963C27.3024 13.7517 28.0149 13.7319 28.4449 13.7707Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M11.5553 13.7707C10.8677 13.8328 10.3601 14.4406 10.4221 15.1281C10.4842 15.8153 11.0912 16.3221 11.7782 16.2608C11.7782 16.2608 11.972 16.2502 12.0734 16.2487C12.2778 16.2457 12.562 16.2509 12.8778 16.2833C13.2137 16.3177 13.5357 16.3782 13.8203 16.4662L13.6962 16.86C13.2209 18.3675 14.4907 19.5813 15.7944 19.5813C16.4962 19.5813 17.1683 19.2617 17.5707 18.6857C17.9975 18.0745 18.0585 17.241 17.5925 16.5344C17.2497 16.0143 16.7557 15.3831 16.1043 14.8657C15.1646 14.1195 13.9566 13.8809 13.1331 13.7963C12.6978 13.7517 11.9853 13.7319 11.5553 13.7707Z", fill: "black", fillOpacity: 0.12 })), Zs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08337 19.9999C2.08337 10.1048 10.1049 2.08325 20 2.08325C29.8952 2.08325 37.9167 10.1048 37.9167 19.9999C37.9167 29.8951 29.8952 37.9166 20 37.9166C10.1049 37.9166 2.08337 29.8951 2.08337 19.9999Z", fill: "url(#paint0_linear_159_173206)" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5828 29.3328C13.1348 29.7473 13.9184 29.636 14.3329 29.084C15.6272 27.3607 17.6839 26.25 20 26.25C22.3164 26.25 24.373 27.3607 25.6672 29.084C26.0819 29.636 26.8654 29.7473 27.4175 29.3328C27.9695 28.9182 28.0809 28.1347 27.6662 27.5825C25.9202 25.2577 23.136 23.75 20 23.75C16.8642 23.75 14.0801 25.2577 12.334 27.5825C11.9194 28.1347 12.0308 28.9182 12.5828 29.3328Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M28.4454 13.7707C29.1329 13.8328 29.6405 14.4406 29.5785 15.1281C29.5165 15.8153 28.9095 16.3221 28.2224 16.2608C28.2224 16.2608 28.0287 16.2502 27.9272 16.2487C27.7229 16.2457 27.4387 16.2509 27.1229 16.2833C26.7869 16.3177 26.4649 16.3782 26.1804 16.4662L26.3045 16.86C26.7797 18.3675 25.5099 19.5813 24.2062 19.5813C23.5045 19.5813 22.8324 19.2617 22.43 18.6857C22.003 18.0745 21.9422 17.241 22.408 16.5344C22.751 16.0143 23.2449 15.3831 23.8964 14.8657C24.836 14.1195 26.044 13.8809 26.8675 13.7963C27.3029 13.7517 28.0154 13.7319 28.4454 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.5549 13.7707C10.8674 13.8328 10.3597 14.4406 10.4218 15.1281C10.4838 15.8153 11.0908 16.3221 11.7779 16.2608C11.7779 16.2608 11.9716 16.2502 12.073 16.2487C12.2774 16.2457 12.5616 16.2509 12.8774 16.2833C13.2134 16.3177 13.5353 16.3782 13.8199 16.4662L13.6958 16.86C13.2205 18.3675 14.4904 19.5813 15.794 19.5813C16.4958 19.5813 17.168 19.2617 17.5703 18.6857C17.9971 18.0745 18.0581 17.241 17.5921 16.5344C17.2493 16.0143 16.7553 15.3831 16.1039 14.8657C15.1643 14.1195 13.9562 13.8809 13.1327 13.7963C12.6974 13.7517 11.9849 13.7319 11.5549 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ r.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ r.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), Ys = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M15 28.333C16.3927 27.2867 18.124 26.6667 20 26.6667C21.876 26.6667 23.6073 27.2867 25 28.333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 13.3511C11.667 13.3511 14.0161 13.139 15.3268 14.18M15.3268 14.18L14.8882 15.5711C14.7153 16.1199 15.1675 16.6667 15.7943 16.6667C16.4531 16.6667 16.8882 16.0723 16.549 15.5579C16.2483 15.102 15.8388 14.5866 15.3268 14.18ZM23.3337 13.3511C23.3337 13.3511 25.6827 13.139 26.9935 14.18M26.9935 14.18L26.555 15.5711C26.382 16.1199 26.8342 16.6667 27.461 16.6667C28.1198 16.6667 28.5548 16.0723 28.2157 15.5579C27.915 15.102 27.5055 14.5866 26.9935 14.18Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), qs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { d: "M14.249 27.334C15.851 26.13 17.844 25.417 20 25.417c2.156 0 4.149.714 5.751 1.917.553.415.664 1.199.25 1.751-.415.552-1.199.664-1.751.25-1.183-.889-2.652-1.416-4.25-1.416s-3.067.527-4.25 1.416c-.553.414-1.336.302-1.751-.25-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M23.445 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.125-.394c-.285-.088-.607-.148-.942-.182-.316-.033-.6-.038-.804-.035-.101.002-.242.01-.294.013Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.779 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.124-.394c-.284-.088-.606-.148-.941-.182-.316-.033-.6-.038-.804-.035-.101.002-.243.01-.294.013Z", fill: "#141B34" })), Js = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), Xs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.75 26.667c0-.691.56-1.25 1.25-1.25h10c.69 0 1.25.559 1.25 1.25 0 .691-.56 1.25-1.25 1.25h-10c-.69 0-1.25-.559-1.25-1.25Z", fill: "#141B34" })), Qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.333 25C14.8532 27.024 17.2735 28.3333 19.9997 28.3333C22.7258 28.3333 25.1462 27.024 26.6663 25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), ea = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.583 24.001c.552-.414 1.335-.302 1.75.25 1.294 1.723 3.35 2.834 5.667 2.834s4.373-1.11 5.667-2.834c.415-.552 1.199-.664 1.751-.25.552.415.664 1.199.25 1.751C25.92 28.076 23.136 29.584 20 29.584s-5.92-1.508-7.666-3.832c-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" })), ta = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6663C29.2044 36.6663 36.6663 29.2044 36.6663 19.9997C36.6663 10.7949 29.2044 3.33301 19.9997 3.33301C10.7949 3.33301 3.33301 10.7949 3.33301 19.9997C3.33301 29.2044 10.7949 36.6663 19.9997 36.6663Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M19.9997 30C23.16 30 25.8145 27.867 26.56 24.9832C26.9068 23.6413 26.4033 23.3333 25.0765 23.3333H14.9228C13.5959 23.3333 13.0925 23.6413 13.4393 24.9832C14.1848 27.867 16.8393 30 19.9997 30Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.8333C11.667 14.4526 12.7863 13.3333 14.167 13.3333C15.5477 13.3333 16.667 14.4526 16.667 15.8333M23.3337 15.8333C23.3337 14.4526 24.453 13.3333 25.8337 13.3333C27.2143 13.3333 28.3337 14.4526 28.3337 15.8333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), na = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("mask", { id: "mask0_159_173224", style: {
|
|
2073
2081
|
maskType: "alpha"
|
|
2074
|
-
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 32.998c3.278 0 5.936-1.594 5.936-3.561 0-1.968-2.658-3.562-5.936-3.562-3.278 0-5.936 1.594-5.936 3.562 0 1.967 2.658 3.561 5.936 3.561Z", fill: "#FF493B" }))), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5M23.333 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5", stroke: "#141B34", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ r.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))),
|
|
2082
|
+
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 32.998c3.278 0 5.936-1.594 5.936-3.561 0-1.968-2.658-3.562-5.936-3.562-3.278 0-5.936 1.594-5.936 3.562 0 1.967 2.658 3.561 5.936 3.561Z", fill: "#FF493B" }))), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5M23.333 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5", stroke: "#141B34", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ r.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))), ra = [
|
|
2075
2083
|
{
|
|
2076
2084
|
value: 1,
|
|
2077
2085
|
Icon: {
|
|
2078
|
-
Active:
|
|
2079
|
-
Inactive:
|
|
2086
|
+
Active: Zs,
|
|
2087
|
+
Inactive: Ks
|
|
2080
2088
|
},
|
|
2081
2089
|
isActive: (e) => e <= 1,
|
|
2082
2090
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_1
|
|
@@ -2084,8 +2092,8 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2084
2092
|
{
|
|
2085
2093
|
value: 2,
|
|
2086
2094
|
Icon: {
|
|
2087
|
-
Active:
|
|
2088
|
-
Inactive:
|
|
2095
|
+
Active: qs,
|
|
2096
|
+
Inactive: Ys
|
|
2089
2097
|
},
|
|
2090
2098
|
isActive: (e) => e === 2,
|
|
2091
2099
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_2
|
|
@@ -2093,8 +2101,8 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2093
2101
|
{
|
|
2094
2102
|
value: 3,
|
|
2095
2103
|
Icon: {
|
|
2096
|
-
Active:
|
|
2097
|
-
Inactive:
|
|
2104
|
+
Active: Xs,
|
|
2105
|
+
Inactive: Js
|
|
2098
2106
|
},
|
|
2099
2107
|
isActive: (e) => e === 3,
|
|
2100
2108
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_3
|
|
@@ -2102,8 +2110,8 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2102
2110
|
{
|
|
2103
2111
|
value: 4,
|
|
2104
2112
|
Icon: {
|
|
2105
|
-
Active:
|
|
2106
|
-
Inactive:
|
|
2113
|
+
Active: ea,
|
|
2114
|
+
Inactive: Qs
|
|
2107
2115
|
},
|
|
2108
2116
|
isActive: (e) => e === 4,
|
|
2109
2117
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_4
|
|
@@ -2111,16 +2119,13 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2111
2119
|
{
|
|
2112
2120
|
value: 5,
|
|
2113
2121
|
Icon: {
|
|
2114
|
-
Active:
|
|
2115
|
-
Inactive:
|
|
2122
|
+
Active: na,
|
|
2123
|
+
Inactive: ta
|
|
2116
2124
|
},
|
|
2117
2125
|
isActive: (e) => 5 <= e,
|
|
2118
2126
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_5
|
|
2119
2127
|
}
|
|
2120
|
-
],
|
|
2121
|
-
const [i, s] = C(!1);
|
|
2122
|
-
return o ? t : /* @__PURE__ */ r.createElement("div", { style: { position: "relative" }, onMouseEnter: () => s(!0), onMouseLeave: () => s(!1) }, t, /* @__PURE__ */ r.createElement(ia, { $visible: i, $position: n }, /* @__PURE__ */ r.createElement(sa, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(ra, { $position: n })));
|
|
2123
|
-
}, ra = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
2128
|
+
], oa = () => ra, Wn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(ct, null, t, /* @__PURE__ */ r.createElement(aa, { $position: n }, /* @__PURE__ */ r.createElement(la, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(ia, { $position: n }))), ia = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
2124
2129
|
"svg",
|
|
2125
2130
|
{
|
|
2126
2131
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -2131,30 +2136,30 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2131
2136
|
fill: "none"
|
|
2132
2137
|
},
|
|
2133
2138
|
/* @__PURE__ */ r.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: u.themedColor.textHighEmphasis })
|
|
2134
|
-
),
|
|
2139
|
+
), sa = {
|
|
2135
2140
|
top: k`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
2136
2141
|
bottom: k`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
2137
|
-
},
|
|
2138
|
-
const { stringSet: o } = M(), i =
|
|
2139
|
-
return /* @__PURE__ */ r.createElement(
|
|
2140
|
-
|
|
2142
|
+
}, ct = c.div`position:relative;`, aa = c.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${he.TOOLTIP};${({ $position: e }) => sa[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${ct}:hover &,${ct}:focus-within &{opacity:1;}`, la = c(S)`padding:6px 8px;background:${u.themedColor.textHighEmphasis};color:${u.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, ca = ({ submitted: e, value: t, onChange: n }) => {
|
|
2143
|
+
const { stringSet: o } = M(), i = oa(), a = typeof t == "number";
|
|
2144
|
+
return /* @__PURE__ */ r.createElement(da, null, /* @__PURE__ */ r.createElement(S, { variant: "caption2", color: u.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(ua, null, i.map((s) => /* @__PURE__ */ r.createElement(Wn, { disabled: e, key: s.value, label: s.getTooltip(o) }, /* @__PURE__ */ r.createElement(
|
|
2145
|
+
ma,
|
|
2141
2146
|
{
|
|
2142
2147
|
disabled: e,
|
|
2143
|
-
onClick: () => n(
|
|
2144
|
-
$inactive:
|
|
2148
|
+
onClick: () => n(s.value),
|
|
2149
|
+
$inactive: a && !s.isActive(t)
|
|
2145
2150
|
},
|
|
2146
|
-
|
|
2151
|
+
a ? s.isActive(t) ? /* @__PURE__ */ r.createElement(s.Icon.Active, null) : /* @__PURE__ */ r.createElement(s.Icon.Inactive, null) : /* @__PURE__ */ r.createElement(s.Icon.Active, null)
|
|
2147
2152
|
)))));
|
|
2148
|
-
},
|
|
2153
|
+
}, da = c.div`display:flex;flex-direction:column;gap:8px;`, ua = c.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, ma = c.button`background-color:transparent;border:none;border-radius:4px;padding:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box;&:enabled:hover{cursor:pointer;background-color:${u.color.background200};${B.dark`
|
|
2149
2154
|
background-color: ${u.color.background500};
|
|
2150
2155
|
`}
|
|
2151
2156
|
}
|
|
2152
2157
|
|
|
2153
|
-
${({ $inactive: e, theme: t }) => e && t.
|
|
2154
|
-
`,
|
|
2158
|
+
${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" && ga};
|
|
2159
|
+
`, ga = k`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, pa = ({ submitted: e, value: t = "", onChange: n }) => {
|
|
2155
2160
|
const { stringSet: o } = M();
|
|
2156
2161
|
return e && !t ? null : /* @__PURE__ */ r.createElement(
|
|
2157
|
-
|
|
2162
|
+
ha,
|
|
2158
2163
|
{
|
|
2159
2164
|
disabled: e,
|
|
2160
2165
|
maxLength: 255,
|
|
@@ -2163,7 +2168,7 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2163
2168
|
placeholder: o.CSAT_REASON_PLACEHOLDER
|
|
2164
2169
|
}
|
|
2165
2170
|
);
|
|
2166
|
-
},
|
|
2171
|
+
}, ha = c.input`box-sizing:border-box;width:100%;border-radius:4px;padding:10px 16px;font-size:14px;font-weight:400;font-style:normal;border:unset;&:focus{outline:none;}color:${u.themedColor.textHighEmphasis};&::placeholder{color:${u.themedColor.textLowEmphasis};}background-color:${u.color.background50};${B.dark`
|
|
2167
2172
|
background-color: ${u.themedColor.textDisabled};
|
|
2168
2173
|
`}
|
|
2169
2174
|
|
|
@@ -2176,82 +2181,82 @@ const Hs = c.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2176
2181
|
background-color: ${u.themedColor.textDisabled};
|
|
2177
2182
|
`}
|
|
2178
2183
|
}
|
|
2179
|
-
`,
|
|
2184
|
+
`, fa = ({ submitted: e }) => {
|
|
2180
2185
|
const { stringSet: t } = M();
|
|
2181
2186
|
return e ? /* @__PURE__ */ r.createElement(S, { variant: "h2", color: u.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(S, { variant: "h2", color: u.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
|
|
2182
2187
|
};
|
|
2183
2188
|
var me = /* @__PURE__ */ ((e) => (e.AI_AGENT_CSAT_5 = "AI_AGENT_CSAT_5", e.AI_AGENT_CSAT_5_WITH_CRE = "AI_AGENT_CSAT_5_WITH_CRE", e))(me || {});
|
|
2184
|
-
const
|
|
2189
|
+
const ba = (e) => gr((t, n) => ({ ...t, ...n }), e), Yt = ({
|
|
2185
2190
|
type: e,
|
|
2186
2191
|
renderSubmitButton: t,
|
|
2187
2192
|
initialCsat: n,
|
|
2188
2193
|
initialCsatReason: o,
|
|
2189
2194
|
initialIsResolved: i
|
|
2190
2195
|
}) => {
|
|
2191
|
-
const [
|
|
2196
|
+
const [a, s] = ba({
|
|
2192
2197
|
csatType: e,
|
|
2193
2198
|
csat: n,
|
|
2194
2199
|
csatReason: o,
|
|
2195
2200
|
isResolved: i
|
|
2196
|
-
}), l = typeof n == "number" ? "submitted" : e === me.AI_AGENT_CSAT_5 && typeof
|
|
2197
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
2198
|
-
|
|
2201
|
+
}), l = typeof n == "number" ? "submitted" : e === me.AI_AGENT_CSAT_5 && typeof a.csat == "number" || e === me.AI_AGENT_CSAT_5_WITH_CRE && typeof a.csat == "number" && typeof a.isResolved == "boolean" ? "submittable" : "unsubmittable", d = { state: l, submitted: l === "submitted" };
|
|
2202
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(xa, null, /* @__PURE__ */ r.createElement(fa, { ...d }), e === me.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
|
|
2203
|
+
Vs,
|
|
2199
2204
|
{
|
|
2200
2205
|
...d,
|
|
2201
2206
|
defaultValue: i,
|
|
2202
|
-
value:
|
|
2203
|
-
onChange: (g) =>
|
|
2207
|
+
value: a.isResolved,
|
|
2208
|
+
onChange: (g) => s({ isResolved: g })
|
|
2204
2209
|
}
|
|
2205
|
-
), /* @__PURE__ */ r.createElement(
|
|
2206
|
-
|
|
2210
|
+
), /* @__PURE__ */ r.createElement(ca, { ...d, value: a.csat, onChange: (g) => s({ csat: g }) }), a.csat && /* @__PURE__ */ r.createElement(
|
|
2211
|
+
pa,
|
|
2207
2212
|
{
|
|
2208
2213
|
...d,
|
|
2209
|
-
value:
|
|
2210
|
-
onChange: (g) =>
|
|
2214
|
+
value: a.csatReason,
|
|
2215
|
+
onChange: (g) => s({ csatReason: g })
|
|
2211
2216
|
}
|
|
2212
|
-
)), l !== "submitted" && t({ state: l, params:
|
|
2213
|
-
},
|
|
2217
|
+
)), l !== "submitted" && t({ state: l, params: a }));
|
|
2218
|
+
}, xa = c.div`display:flex;flex-direction:column;gap:12px;`, Ea = () => {
|
|
2214
2219
|
const { stringSet: e } = M();
|
|
2215
2220
|
return /* @__PURE__ */ r.createElement(S, { variant: "body2", color: u.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
2216
|
-
},
|
|
2221
|
+
}, va = (e) => {
|
|
2217
2222
|
if (e.messageType !== "admin.csat")
|
|
2218
2223
|
throw new Error("Invalid message type");
|
|
2219
|
-
const t =
|
|
2224
|
+
const t = Mr(), { stringSet: n } = M(), { extendedMessagePayload: o, csat: i, csatReason: a, csatExpireAt: s, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: d } = e, { visibility: g, type: m } = (o == null ? void 0 : o.csat) ?? {};
|
|
2220
2225
|
if (!g || !m || !me[m]) return null;
|
|
2221
|
-
const p = m === me.AI_AGENT_CSAT_5 || m === me.AI_AGENT_CSAT_5_WITH_CRE ?
|
|
2222
|
-
b.csat && !
|
|
2226
|
+
const p = m === me.AI_AGENT_CSAT_5 || m === me.AI_AGENT_CSAT_5_WITH_CRE ? Yt : () => null, h = (b) => {
|
|
2227
|
+
b.csat && !qt(s) ? d({
|
|
2223
2228
|
csatType: b.csatType,
|
|
2224
2229
|
csat: b.csat,
|
|
2225
2230
|
csatReason: b.csatReason,
|
|
2226
2231
|
isResolved: b.isResolved
|
|
2227
2232
|
}) : t();
|
|
2228
2233
|
};
|
|
2229
|
-
return /* @__PURE__ */ r.createElement(
|
|
2234
|
+
return /* @__PURE__ */ r.createElement(ya, null, !i && qt(s) ? /* @__PURE__ */ r.createElement(Ea, null) : /* @__PURE__ */ r.createElement(
|
|
2230
2235
|
p,
|
|
2231
2236
|
{
|
|
2232
2237
|
type: m,
|
|
2233
2238
|
initialCsat: i,
|
|
2234
|
-
initialCsatReason:
|
|
2239
|
+
initialCsatReason: a,
|
|
2235
2240
|
initialIsResolved: l,
|
|
2236
|
-
renderSubmitButton: ({ state: b, params: x }) => /* @__PURE__ */ r.createElement(
|
|
2241
|
+
renderSubmitButton: ({ state: b, params: x }) => /* @__PURE__ */ r.createElement(Ca, { disabled: b !== "submittable", onClick: () => h(x) }, /* @__PURE__ */ r.createElement(S, { variant: "button" }, n.CSAT_SUBMIT_LABEL))
|
|
2237
2242
|
}
|
|
2238
2243
|
));
|
|
2239
|
-
},
|
|
2240
|
-
function
|
|
2244
|
+
}, ya = c.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Ca = c.button`all:unset;background-color:${({ theme: e }) => e.colors.base.primary};color:${({ theme: e }) => e.colors.base.primaryContrastContent};border-radius:6px;padding:10px 20px;display:flex;align-items:center;justify-content:center;cursor:pointer;&:hover{background-color:${u.color.primary.dark};}&:disabled{color:${u.color.ondark.textLowEmphasis};background-color:${u.themedColor.textDisabled};cursor:not-allowed;}`;
|
|
2245
|
+
function qt(e) {
|
|
2241
2246
|
return !!e && e < Date.now();
|
|
2242
2247
|
}
|
|
2243
|
-
const
|
|
2244
|
-
template:
|
|
2248
|
+
const St = Ce({
|
|
2249
|
+
template: Ta,
|
|
2245
2250
|
components: {
|
|
2246
|
-
AdminMessage:
|
|
2247
|
-
CSATMessage:
|
|
2251
|
+
AdminMessage: Us,
|
|
2252
|
+
CSATMessage: va
|
|
2248
2253
|
}
|
|
2249
2254
|
});
|
|
2250
|
-
function
|
|
2251
|
-
const { components: t } =
|
|
2252
|
-
return /* @__PURE__ */ r.createElement(
|
|
2255
|
+
function Ta(e) {
|
|
2256
|
+
const { components: t } = St.useContext(), n = Tt(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
|
|
2257
|
+
return /* @__PURE__ */ r.createElement(_a, { $marginBottom: xt(e.groupType) }, n);
|
|
2253
2258
|
}
|
|
2254
|
-
const
|
|
2259
|
+
const _a = c.div`padding-inline:${Q}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, Jt = {
|
|
2255
2260
|
file: "attach",
|
|
2256
2261
|
snippet: "snippet",
|
|
2257
2262
|
site: "website",
|
|
@@ -2261,14 +2266,14 @@ const Ca = c.div`padding-inline:${Q}px;margin-bottom:${({ $marginBottom: e }) =>
|
|
|
2261
2266
|
sb_zendesk: "zendesk",
|
|
2262
2267
|
sb_desk: "snippet"
|
|
2263
2268
|
// TODO: request icon
|
|
2264
|
-
},
|
|
2269
|
+
}, Sa = ({
|
|
2265
2270
|
actionbook: e,
|
|
2266
2271
|
functionCalls: t,
|
|
2267
2272
|
groundedness: n,
|
|
2268
2273
|
agentMessageTemplates: o,
|
|
2269
2274
|
onClickActionbook: i,
|
|
2270
|
-
onClickFunctionCall:
|
|
2271
|
-
onClickFunctionCallDetail:
|
|
2275
|
+
onClickFunctionCall: a,
|
|
2276
|
+
onClickFunctionCallDetail: s,
|
|
2272
2277
|
onClickGroundedness: l,
|
|
2273
2278
|
onClickAgentMessageTemplate: d,
|
|
2274
2279
|
bottomContent: g,
|
|
@@ -2279,9 +2284,9 @@ const Ca = c.div`padding-inline:${Q}px;margin-bottom:${({ $marginBottom: e }) =>
|
|
|
2279
2284
|
// Note: This component is used with the dashboard, so cssVars should not be used.
|
|
2280
2285
|
iconColor: h = "#000000",
|
|
2281
2286
|
textColor: b = "#000000",
|
|
2282
|
-
highlightColor: x =
|
|
2287
|
+
highlightColor: x = kn.DEFAULT_PRIMARY
|
|
2283
2288
|
} = p;
|
|
2284
|
-
return /* @__PURE__ */ r.createElement(
|
|
2289
|
+
return /* @__PURE__ */ r.createElement(Xt, null, e && /* @__PURE__ */ r.createElement(Xt, null, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(Ue, null, /* @__PURE__ */ r.createElement($, { size: 16, type: "actionbook", color: h })), /* @__PURE__ */ r.createElement(
|
|
2285
2290
|
He,
|
|
2286
2291
|
{
|
|
2287
2292
|
$clickable: !!i,
|
|
@@ -2298,11 +2303,11 @@ const Ca = c.div`padding-inline:${Q}px;margin-bottom:${({ $marginBottom: e }) =>
|
|
|
2298
2303
|
$highlightColor: x,
|
|
2299
2304
|
variant: "body2",
|
|
2300
2305
|
color: b,
|
|
2301
|
-
onClick: () =>
|
|
2306
|
+
onClick: () => a == null ? void 0 : a(v)
|
|
2302
2307
|
},
|
|
2303
2308
|
v.name
|
|
2304
|
-
), /* @__PURE__ */ r.createElement(
|
|
2305
|
-
default: /* @__PURE__ */ r.createElement($, { size: 16, type:
|
|
2309
|
+
), /* @__PURE__ */ r.createElement(ka, { role: "button", onClick: () => s == null ? void 0 : s(v) }, /* @__PURE__ */ r.createElement(S, { variant: "body2", color: x }, "View details"), /* @__PURE__ */ r.createElement($, { type: "chevron-right", size: 16, color: x }))))), n == null ? void 0 : n.map((v) => /* @__PURE__ */ r.createElement(rt, { key: v.id }, /* @__PURE__ */ r.createElement(Ue, null, m({
|
|
2310
|
+
default: /* @__PURE__ */ r.createElement($, { size: 16, type: Jt[v.source_type] ?? Jt.snippet, color: h }),
|
|
2306
2311
|
sourceType: v.source_type
|
|
2307
2312
|
})), /* @__PURE__ */ r.createElement(
|
|
2308
2313
|
He,
|
|
@@ -2325,47 +2330,47 @@ const Ca = c.div`padding-inline:${Q}px;margin-bottom:${({ $marginBottom: e }) =>
|
|
|
2325
2330
|
},
|
|
2326
2331
|
v.name
|
|
2327
2332
|
))), g);
|
|
2328
|
-
},
|
|
2333
|
+
}, wa = c(S)`font-weight:400;`, He = c(wa)`${({ $clickable: e, $highlightColor: t }) => e && k`
|
|
2329
2334
|
cursor: pointer;
|
|
2330
2335
|
text-decoration: underline;
|
|
2331
2336
|
&:hover {
|
|
2332
2337
|
color: ${t};
|
|
2333
2338
|
}
|
|
2334
2339
|
`}
|
|
2335
|
-
`, Ue = c.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Ke = c.div`display:flex;gap:8px;align-items:center;`,
|
|
2340
|
+
`, Ue = c.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Ke = c.div`display:flex;gap:8px;align-items:center;`, ka = c(Ke)`cursor:pointer;gap:4px;`, rt = c(Ke)`flex-direction:row;align-items:center;`, Xt = c.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Vn = ye(
|
|
2336
2341
|
null
|
|
2337
2342
|
);
|
|
2338
|
-
function
|
|
2343
|
+
function Aa({
|
|
2339
2344
|
isDashboardActionbookTester: e = !1,
|
|
2340
2345
|
children: t
|
|
2341
2346
|
}) {
|
|
2342
|
-
return /* @__PURE__ */ r.createElement(
|
|
2347
|
+
return /* @__PURE__ */ r.createElement(Vn.Provider, { value: { isDashboardActionbookTester: e } }, e && /* @__PURE__ */ r.createElement(Ia, null), t);
|
|
2343
2348
|
}
|
|
2344
|
-
const
|
|
2345
|
-
const e = J(
|
|
2349
|
+
const wt = () => {
|
|
2350
|
+
const e = J(Vn);
|
|
2346
2351
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardActionbookTesterProvider not found");
|
|
2347
2352
|
return e;
|
|
2348
|
-
},
|
|
2349
|
-
const { handlers: t } = N(), { manual: n, groundedness: o, function_calls: i, agent_message_templates:
|
|
2350
|
-
return
|
|
2351
|
-
|
|
2353
|
+
}, Ia = () => /* @__PURE__ */ r.createElement(ve.Template, { template: $a }, /* @__PURE__ */ r.createElement(ve.MessageLogs, { component: Ma })), $a = (e) => /* @__PURE__ */ r.createElement(Hn, { ...e, testerMode: !0, maxBodyWidth: Dn }), Ma = ({ extendedMessagePayload: e = {} }) => {
|
|
2354
|
+
const { handlers: t } = N(), { manual: n, groundedness: o, function_calls: i, agent_message_templates: a, is_thinking: s } = e;
|
|
2355
|
+
return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Oa, null, /* @__PURE__ */ r.createElement(La, { width: 4 }), /* @__PURE__ */ r.createElement(
|
|
2356
|
+
Sa,
|
|
2352
2357
|
{
|
|
2353
2358
|
actionbook: n,
|
|
2354
2359
|
functionCalls: i,
|
|
2355
2360
|
groundedness: o,
|
|
2356
|
-
agentMessageTemplates:
|
|
2361
|
+
agentMessageTemplates: a,
|
|
2357
2362
|
onClickFunctionCallDetail: t == null ? void 0 : t.onFunctionCallDetailClick,
|
|
2358
2363
|
style: {
|
|
2359
2364
|
iconColor: u.themedColor.textHighEmphasis,
|
|
2360
2365
|
textColor: u.themedColor.textHighEmphasis,
|
|
2361
2366
|
barColor: u.themedColor.textDisabled
|
|
2362
2367
|
},
|
|
2363
|
-
bottomContent: /* @__PURE__ */ r.createElement(
|
|
2368
|
+
bottomContent: /* @__PURE__ */ r.createElement(Ra, { variant: "caption2", color: u.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
2364
2369
|
}
|
|
2365
2370
|
));
|
|
2366
|
-
},
|
|
2371
|
+
}, Oa = c.div`display:flex;gap:16px;margin:16px ${Q}px 0;align-self:stretch;`, La = c.div`width:${({ width: e }) => e}px;background-color:${u.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Ra = c(S)`margin-top:5px;`, kt = {
|
|
2367
2372
|
isStreaming(e) {
|
|
2368
|
-
const t =
|
|
2373
|
+
const t = Ut(e.data);
|
|
2369
2374
|
return typeof t == "object" ? !!t.stream : !1;
|
|
2370
2375
|
},
|
|
2371
2376
|
isWelcomeMessage(e, t) {
|
|
@@ -2373,73 +2378,73 @@ const St = () => {
|
|
|
2373
2378
|
if (((n = e.extendedMessagePayload) == null ? void 0 : n.bot_message_type) === "welcome")
|
|
2374
2379
|
return !0;
|
|
2375
2380
|
if ((e.isUserMessage() || e.isFileMessage()) && e.sender.userId === t) {
|
|
2376
|
-
const o =
|
|
2381
|
+
const o = Ut(e.data);
|
|
2377
2382
|
return !(o != null && o.respond_mesg_id) && !(o != null && o.stream);
|
|
2378
2383
|
}
|
|
2379
2384
|
return !1;
|
|
2380
2385
|
}
|
|
2381
2386
|
};
|
|
2382
|
-
function
|
|
2387
|
+
function Na(e) {
|
|
2383
2388
|
return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
|
|
2384
2389
|
}
|
|
2385
|
-
const
|
|
2390
|
+
const Da = (e, t, n, o = !0) => {
|
|
2386
2391
|
if (!o || !e.isUserMessage() && !e.isFileMessage())
|
|
2387
2392
|
return "single";
|
|
2388
2393
|
const i = () => {
|
|
2389
2394
|
if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
|
|
2390
|
-
const d = t.sender.userId === e.sender.userId, g =
|
|
2395
|
+
const d = t.sender.userId === e.sender.userId, g = Dt(t.createdAt, e.createdAt);
|
|
2391
2396
|
return d && g;
|
|
2392
|
-
},
|
|
2397
|
+
}, a = () => {
|
|
2393
2398
|
if (!n || !n.isUserMessage() && !n.isFileMessage()) return !1;
|
|
2394
|
-
const d = n.sender.userId === e.sender.userId, g =
|
|
2399
|
+
const d = n.sender.userId === e.sender.userId, g = Dt(n.createdAt, e.createdAt);
|
|
2395
2400
|
return d && g;
|
|
2396
|
-
},
|
|
2397
|
-
return
|
|
2401
|
+
}, s = i(), l = a();
|
|
2402
|
+
return s && l ? "middle" : s ? "bottom" : l ? "top" : "single";
|
|
2398
2403
|
};
|
|
2399
|
-
function
|
|
2400
|
-
return e.filter((n) =>
|
|
2404
|
+
function Ba(e, t) {
|
|
2405
|
+
return e.filter((n) => kt.isWelcomeMessage(n, t));
|
|
2401
2406
|
}
|
|
2402
|
-
function
|
|
2403
|
-
return
|
|
2407
|
+
function Gn(e, t) {
|
|
2408
|
+
return Pa(e) === t;
|
|
2404
2409
|
}
|
|
2405
|
-
function
|
|
2410
|
+
function Pa(e) {
|
|
2406
2411
|
var t;
|
|
2407
2412
|
if (e)
|
|
2408
2413
|
return e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage() ? e.sender.userId : ((t = e == null ? void 0 : e.sender) == null ? void 0 : t.userId) ?? void 0;
|
|
2409
2414
|
}
|
|
2410
|
-
function
|
|
2415
|
+
function Fa(e) {
|
|
2411
2416
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
2412
2417
|
}
|
|
2413
|
-
const
|
|
2418
|
+
const Qt = (e) => !!e && "sender" in e, jn = (e) => e.startsWith("image/"), Kn = (e) => e.startsWith("video/"), en = (e) => jn(e) || Kn(e), ze = {
|
|
2414
2419
|
isAdmin: (e) => e.isAdminMessage(),
|
|
2415
2420
|
isCSAT: (e) => {
|
|
2416
2421
|
var t;
|
|
2417
2422
|
return e.isAdminMessage() && !!((t = e.extendedMessagePayload) != null && t.csat);
|
|
2418
2423
|
},
|
|
2419
|
-
isIncoming: (e, t) =>
|
|
2420
|
-
isOutgoing: (e, t) =>
|
|
2421
|
-
},
|
|
2424
|
+
isIncoming: (e, t) => Qt(e) && e.sender.userId !== t,
|
|
2425
|
+
isOutgoing: (e, t) => Qt(e) && (e.sender.userId === t || e.sendingStatus === Rr.PENDING)
|
|
2426
|
+
}, Zn = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
|
|
2422
2427
|
if (!t) return null;
|
|
2423
|
-
const { rootElement: i } = N(),
|
|
2424
|
-
return
|
|
2425
|
-
/* @__PURE__ */ r.createElement(
|
|
2426
|
-
|
|
2428
|
+
const { rootElement: i } = N(), a = pe(i), s = pe(i, !0);
|
|
2429
|
+
return Hr(
|
|
2430
|
+
/* @__PURE__ */ r.createElement(Ha, { onClick: n }, /* @__PURE__ */ r.createElement(Ua, { onClick: (l) => l.stopPropagation() }, o)),
|
|
2431
|
+
a.getElementById(e) ?? a.getElementById(X.MODAL_ROOT) ?? s.body
|
|
2427
2432
|
);
|
|
2428
|
-
},
|
|
2429
|
-
function
|
|
2433
|
+
}, Ha = c.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${u.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${he.MODAL};`, Ua = c.div`border-radius:4px;overflow:hidden;box-shadow:0 16px 24px 2px rgba(13,13,13,0.12),0 6px 30px 5px rgba(13,13,13,0.08),0 6px 10px -5px rgba(13,13,13,0.04);z-index:${he.MODAL};`, za = c.div`flex-shrink:0;width:${({ $size: e }) => se(e)};height:${({ $size: e }) => se(e)};background-color:${({ theme: e }) => e.colors.base.primary};box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;}`, Wa = c(yt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
|
|
2434
|
+
function Yn({ size: e }) {
|
|
2430
2435
|
const { aiAgentInfo: t } = F();
|
|
2431
|
-
return t.profileUrl ? /* @__PURE__ */ r.createElement(
|
|
2436
|
+
return t.profileUrl ? /* @__PURE__ */ r.createElement(Ct, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(za, { $size: e }, /* @__PURE__ */ r.createElement(Wa, null));
|
|
2432
2437
|
}
|
|
2433
|
-
const
|
|
2434
|
-
const { sender: o, type: i, url:
|
|
2438
|
+
const Va = c.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, Ga = c.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${u.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, ja = c.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, Ka = c.div`margin-inline-end:8px;`, Za = c.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`, Ya = c.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`, qa = c.div`display:flex;width:160px;justify-content:flex-end;`, Ja = c.div`inset-inline-end:0;display:flex;flex-direction:row;`, dt = c.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, Xa = c(dt)`border-inline-start:1px solid ${u.themedColor.textDisabled};`, Qa = c.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, el = c.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, tl = c.img`max-width:90%;max-height:90%;user-select:none;-webkit-user-drag:none;`, nl = c.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, rl = ({ message: e, onClose: t, onDownloadClick: n }) => {
|
|
2439
|
+
const { sender: o, type: i, url: a, name: s = "", threadInfo: l } = e, { profileUrl: d, nickname: g, userId: m } = o, { userSession: p, aiAgentInfo: h } = F();
|
|
2435
2440
|
return /* @__PURE__ */ r.createElement(
|
|
2436
|
-
|
|
2441
|
+
il,
|
|
2437
2442
|
{
|
|
2438
2443
|
profileUrl: d,
|
|
2439
2444
|
nickname: g,
|
|
2440
2445
|
type: i,
|
|
2441
|
-
url:
|
|
2442
|
-
name:
|
|
2446
|
+
url: a,
|
|
2447
|
+
name: s,
|
|
2443
2448
|
onClose: t,
|
|
2444
2449
|
isBotMessage: m === h.userId,
|
|
2445
2450
|
isByMe: p.userId === m,
|
|
@@ -2447,22 +2452,22 @@ const za = c.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2447
2452
|
onDownloadClick: n
|
|
2448
2453
|
}
|
|
2449
2454
|
);
|
|
2450
|
-
},
|
|
2455
|
+
}, ol = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(Yn, { size: 32 }) : /* @__PURE__ */ r.createElement(Ct, { size: 32, src: e }), il = ({
|
|
2451
2456
|
profileUrl: e,
|
|
2452
2457
|
isBotMessage: t,
|
|
2453
2458
|
nickname: n,
|
|
2454
2459
|
name: o,
|
|
2455
2460
|
type: i,
|
|
2456
|
-
url:
|
|
2457
|
-
isByMe:
|
|
2461
|
+
url: a,
|
|
2462
|
+
isByMe: s,
|
|
2458
2463
|
onClose: l,
|
|
2459
2464
|
onDelete: d,
|
|
2460
2465
|
disableDelete: g,
|
|
2461
2466
|
onDownloadClick: m
|
|
2462
2467
|
}) => {
|
|
2463
2468
|
const { stringSet: p } = M();
|
|
2464
|
-
return /* @__PURE__ */ r.createElement(
|
|
2465
|
-
|
|
2469
|
+
return /* @__PURE__ */ r.createElement(Zn, { onClose: l, visible: !0, rootElementId: X.MODAL_ROOT }, /* @__PURE__ */ r.createElement(Va, null, /* @__PURE__ */ r.createElement(Ga, null, /* @__PURE__ */ r.createElement(ja, null, /* @__PURE__ */ r.createElement(Ka, null, /* @__PURE__ */ r.createElement(ol, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(Za, null, /* @__PURE__ */ r.createElement(S, { variant: "h2", color: u.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(Ya, null, /* @__PURE__ */ r.createElement(S, { variant: "body1", color: u.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(qa, null, en(i) && /* @__PURE__ */ r.createElement(Ja, null, /* @__PURE__ */ r.createElement(dt, { as: "a", href: a, target: "_blank", rel: ft, onClick: m }, /* @__PURE__ */ r.createElement($, { type: "download", color: u.themedColor.textHighEmphasis, size: 24 })), d && s && /* @__PURE__ */ r.createElement(
|
|
2470
|
+
dt,
|
|
2466
2471
|
{
|
|
2467
2472
|
disabled: g,
|
|
2468
2473
|
onClick: () => {
|
|
@@ -2477,19 +2482,19 @@ const za = c.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2477
2482
|
size: 24
|
|
2478
2483
|
}
|
|
2479
2484
|
)
|
|
2480
|
-
)), /* @__PURE__ */ r.createElement(
|
|
2481
|
-
},
|
|
2485
|
+
)), /* @__PURE__ */ r.createElement(Xa, { onClick: l }, /* @__PURE__ */ r.createElement($, { type: "close", color: u.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(Qa, { onClick: (h) => h.currentTarget === h.target && l() }, Kn(i) && /* @__PURE__ */ r.createElement(el, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), jn(i) && /* @__PURE__ */ r.createElement(tl, { src: a, alt: o }), !en(i) && /* @__PURE__ */ r.createElement(nl, null, /* @__PURE__ */ r.createElement(S, { variant: "h1", color: u.themedColor.textHighEmphasis }, p.FILE_VIEWER__UNSUPPORT)))));
|
|
2486
|
+
}, qn = ({
|
|
2482
2487
|
className: e,
|
|
2483
2488
|
locale: t,
|
|
2484
2489
|
date: n = Date.now(),
|
|
2485
2490
|
formatString: o = "MMMM dd, yyyy",
|
|
2486
2491
|
style: i
|
|
2487
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
2492
|
+
}) => /* @__PURE__ */ r.createElement(sl, { style: i, className: e }, /* @__PURE__ */ r.createElement(S, { variant: "caption4", color: u.themedColor.textMidEmphasis }, hn(n, o, { locale: t }))), sl = c.div`display:flex;justify-content:center;align-items:center;`, al = pr(function(t, n) {
|
|
2488
2493
|
const {
|
|
2489
2494
|
messages: o,
|
|
2490
2495
|
renderMessage: i,
|
|
2491
|
-
messageTopArea:
|
|
2492
|
-
messageBottomArea:
|
|
2496
|
+
messageTopArea: a,
|
|
2497
|
+
messageBottomArea: s,
|
|
2493
2498
|
overlayArea: l,
|
|
2494
2499
|
onLoadPrev: d,
|
|
2495
2500
|
onLoadNext: g,
|
|
@@ -2508,16 +2513,16 @@ const za = c.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2508
2513
|
const _e = async () => {
|
|
2509
2514
|
if (!f.current) return;
|
|
2510
2515
|
const E = f.current;
|
|
2511
|
-
if (p(
|
|
2516
|
+
if (p(ll(E)), H.current = E.scrollHeight - E.scrollTop, le.current = H.current - E.clientHeight, w.current = E.scrollTop, y.current) return;
|
|
2512
2517
|
const U = E.clientHeight * Math.min(Math.max(0, m), 1);
|
|
2513
2518
|
E.scrollTop <= U ? (y.current = !0, _.current = "top", await d(), y.current = !1) : E.scrollHeight - E.scrollTop - E.clientHeight <= U ? (y.current = !0, _.current = "bottom", await g(), y.current = !1) : _.current = void 0;
|
|
2514
2519
|
};
|
|
2515
|
-
return /* @__PURE__ */ r.createElement(
|
|
2520
|
+
return /* @__PURE__ */ r.createElement(cl, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(dl, { id: "infinite-list-inner", ref: f, onScroll: _e }, v === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((E, U) => i({ message: E, index: U })), s), /* @__PURE__ */ r.createElement(ul, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(ml, { id: "infinite-list-overlay" }, l)));
|
|
2516
2521
|
});
|
|
2517
|
-
function
|
|
2522
|
+
function ll(e) {
|
|
2518
2523
|
return e.scrollTop <= 10 ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= 10 ? "bottom" : "middle";
|
|
2519
2524
|
}
|
|
2520
|
-
const
|
|
2525
|
+
const cl = c.div`display:flex;position:relative;flex:1;overflow:hidden;`, dl = c.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${u.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, ul = c.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, ml = c.div`pointer-events:auto;`, gl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(pl, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement($, { size: 24, type: "chevron-down", color: u.color.primary.main })), pl = c.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${B.light`
|
|
2521
2526
|
background-color: ${u.color.background50};
|
|
2522
2527
|
&:hover {
|
|
2523
2528
|
background-color: ${u.color.background100};
|
|
@@ -2539,33 +2544,33 @@ const al = c.div`display:flex;position:relative;flex:1;overflow:hidden;`, ll = c
|
|
|
2539
2544
|
&:focus {
|
|
2540
2545
|
outline: none;
|
|
2541
2546
|
}
|
|
2542
|
-
`,
|
|
2543
|
-
const { chatSDK: e } = N(), { channelSource: t } = Y(), [n, o] =
|
|
2544
|
-
return
|
|
2547
|
+
`, Jn = () => {
|
|
2548
|
+
const { chatSDK: e } = N(), { channelSource: t } = Y(), [n, o] = T([]);
|
|
2549
|
+
return fn(e, {
|
|
2545
2550
|
onTypingStatusUpdated(i) {
|
|
2546
|
-
var
|
|
2547
|
-
if (i.url === ((
|
|
2548
|
-
const
|
|
2549
|
-
o(
|
|
2551
|
+
var a;
|
|
2552
|
+
if (i.url === ((a = t.channel) == null ? void 0 : a.url)) {
|
|
2553
|
+
const s = i.getTypingUsers();
|
|
2554
|
+
o(s);
|
|
2550
2555
|
}
|
|
2551
2556
|
}
|
|
2552
2557
|
}), n;
|
|
2553
|
-
},
|
|
2554
|
-
const { agentPreviewConfigs: e = {}, aiAgentId: t } = N(), { aiAgentInfo: n } = F(), { stringSet: o, dateLocale: i } = M(), { messageSource:
|
|
2558
|
+
}, hl = () => {
|
|
2559
|
+
const { agentPreviewConfigs: e = {}, aiAgentId: t } = N(), { aiAgentInfo: n } = F(), { stringSet: o, dateLocale: i } = M(), { messageSource: a } = Y(), { Template: s } = ve.useContext(), l = e.welcomeMessages ?? [], d = a.messages, g = Ba(d, t), m = d[g.length + 1], p = g[0] ?? m;
|
|
2555
2560
|
return {
|
|
2556
2561
|
/**
|
|
2557
2562
|
* Returns a list of messages filtered according to business requirements.
|
|
2558
2563
|
*/
|
|
2559
|
-
filteredMessages: d.filter((h) =>
|
|
2564
|
+
filteredMessages: d.filter((h) => Fa(h) ? !1 : l.length > 0 ? !kt.isWelcomeMessage(h, t) : !0),
|
|
2560
2565
|
/**
|
|
2561
2566
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
2562
2567
|
*/
|
|
2563
|
-
shouldShowOriginalDate: (h) => h > 0 || l.length === 0 ? !0 : m && !
|
|
2568
|
+
shouldShowOriginalDate: (h) => h > 0 || l.length === 0 ? !0 : m && !Sr(m.createdAt, (p == null ? void 0 : p.createdAt) ?? 0),
|
|
2564
2569
|
/**
|
|
2565
2570
|
* Renders the list of welcome messages from Bot Studio.
|
|
2566
2571
|
*/
|
|
2567
2572
|
renderAgentPreviewWelcomeMessages: () => l.length === 0 ? null : /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
2568
|
-
|
|
2573
|
+
qn,
|
|
2569
2574
|
{
|
|
2570
2575
|
style: { margin: "16px 0" },
|
|
2571
2576
|
date: p == null ? void 0 : p.createdAt,
|
|
@@ -2575,7 +2580,7 @@ const al = c.div`display:flex;position:relative;flex:1;overflow:hidden;`, ll = c
|
|
|
2575
2580
|
), l.map((h, b) => {
|
|
2576
2581
|
const x = b === l.length - 1, v = g.length !== d.length, f = l.length === 1 ? "single" : b === 0 ? "top" : x || v ? "bottom" : "middle";
|
|
2577
2582
|
return /* @__PURE__ */ r.createElement(
|
|
2578
|
-
|
|
2583
|
+
s,
|
|
2579
2584
|
{
|
|
2580
2585
|
messageType: "user",
|
|
2581
2586
|
message: h.message,
|
|
@@ -2587,43 +2592,43 @@ const al = c.div`display:flex;position:relative;flex:1;overflow:hidden;`, ll = c
|
|
|
2587
2592
|
suggestedRepliesVisible: x && !v,
|
|
2588
2593
|
isBotMessage: !0,
|
|
2589
2594
|
onClickSuggestedReply: async ({ reply: y }) => {
|
|
2590
|
-
|
|
2595
|
+
a.sendUserMessage({ message: y });
|
|
2591
2596
|
}
|
|
2592
2597
|
}
|
|
2593
2598
|
);
|
|
2594
2599
|
}))
|
|
2595
2600
|
};
|
|
2596
|
-
},
|
|
2597
|
-
function
|
|
2601
|
+
}, fl = (e) => c(e).withConfig({ shouldForwardProp: Ur });
|
|
2602
|
+
function bl(e) {
|
|
2598
2603
|
var o;
|
|
2599
2604
|
const t = "remove_powered_by", n = (o = e == null ? void 0 : e.appInfo) == null ? void 0 : o.applicationAttributes;
|
|
2600
2605
|
return Array.isArray(n) && n.includes(t);
|
|
2601
2606
|
}
|
|
2602
|
-
const
|
|
2603
|
-
const { stringSet: t } = M(), { chatSDK: n } = N(), { isDashboardActionbookTester: o } =
|
|
2604
|
-
return
|
|
2605
|
-
|
|
2607
|
+
const xl = ({ style: e }) => {
|
|
2608
|
+
const { stringSet: t } = M(), { chatSDK: n } = N(), { isDashboardActionbookTester: o } = wt();
|
|
2609
|
+
return bl(n) || o ? null : /* @__PURE__ */ r.createElement(El, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
|
|
2610
|
+
vl,
|
|
2606
2611
|
{
|
|
2607
2612
|
variant: "caption2",
|
|
2608
2613
|
as: "a",
|
|
2609
2614
|
href: "https://sendbird.com?utm_medium=product&utm_source=aiagent&utm_campaign=fy26-glbl-ai-agent-poweredby",
|
|
2610
2615
|
"aria-label": "Learn more about Sendbird",
|
|
2611
|
-
rel:
|
|
2616
|
+
rel: ft,
|
|
2612
2617
|
target: "_blank"
|
|
2613
2618
|
},
|
|
2614
2619
|
"Sendbird"
|
|
2615
2620
|
));
|
|
2616
|
-
},
|
|
2621
|
+
}, El = c(S)`color:${u.themedColor.textLowEmphasis};text-align:center;`, vl = fl(S)`
|
|
2617
2622
|
color: ${u.themedColor.textLowEmphasis};
|
|
2618
2623
|
cursor: pointer;
|
|
2619
2624
|
text-decoration: none;
|
|
2620
|
-
`,
|
|
2625
|
+
`, yl = () => {
|
|
2621
2626
|
var d;
|
|
2622
|
-
const { stringSet: e } = M(), { activeChannel: t } = F(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = Y(),
|
|
2627
|
+
const { stringSet: e } = M(), { activeChannel: t } = F(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = Y(), a = Rn(n.channel), l = t && ((d = n.channel) == null ? void 0 : d.url) === (t == null ? void 0 : t.url) && a;
|
|
2623
2628
|
return ge(() => {
|
|
2624
2629
|
l && i.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2625
|
-
}, [l]), l ? /* @__PURE__ */ r.createElement(
|
|
2626
|
-
|
|
2630
|
+
}, [l]), l ? /* @__PURE__ */ r.createElement(Cl, null, /* @__PURE__ */ r.createElement(
|
|
2631
|
+
Tl,
|
|
2627
2632
|
{
|
|
2628
2633
|
variant: "button",
|
|
2629
2634
|
role: "button",
|
|
@@ -2632,17 +2637,17 @@ const fl = ({ style: e }) => {
|
|
|
2632
2637
|
},
|
|
2633
2638
|
e.START_NEW_CONVERSATION
|
|
2634
2639
|
)) : null;
|
|
2635
|
-
},
|
|
2636
|
-
const { Template: e } =
|
|
2640
|
+
}, Cl = c.div`display:flex;justify-content:center;margin:16px 0;`, Tl = c(S)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${u.themedColor.textDisabled};cursor:pointer;user-select:none;`, _l = !0, Sl = () => {
|
|
2641
|
+
const { Template: e } = _t.useContext(), { Template: t } = ve.useContext(), { Template: n } = St.useContext(), [o, i] = T(null), { userSession: a, aiAgentInfo: s } = F(), { agentPreviewConfigs: l, chatSDK: d, state: g } = N(), { stringSet: m, dateLocale: p } = M(), { conversation: h, channelSource: b, messageSource: x, scrollSource: v } = Y(), { isDashboardActionbookTester: f } = wt(), { filteredMessages: y, shouldShowOriginalDate: _, renderAgentPreviewWelcomeMessages: w } = hl(), { storage: O } = _n(), ee = Jn(), H = Tt(() => {
|
|
2637
2642
|
const E = ee[0];
|
|
2638
|
-
return E ? E.userId ===
|
|
2643
|
+
return E ? E.userId === s.userId ? s : E : null;
|
|
2639
2644
|
});
|
|
2640
2645
|
R(() => {
|
|
2641
2646
|
H && setTimeout(() => v.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } }), 25);
|
|
2642
2647
|
}, [!!H, v]);
|
|
2643
2648
|
const le = (E, U = !1) => {
|
|
2644
2649
|
var te;
|
|
2645
|
-
return U ?
|
|
2650
|
+
return U ? s : ((te = b.channel) == null ? void 0 : te.members.find((G) => G.userId === E.sender.userId)) ?? E.sender;
|
|
2646
2651
|
}, _e = () => {
|
|
2647
2652
|
if (!x.initialized)
|
|
2648
2653
|
return /* @__PURE__ */ r.createElement(Ee, { type: "loading" });
|
|
@@ -2651,7 +2656,7 @@ const fl = ({ style: e }) => {
|
|
|
2651
2656
|
return E ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, E) : /* @__PURE__ */ r.createElement(Ee, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
|
|
2652
2657
|
}
|
|
2653
2658
|
return /* @__PURE__ */ r.createElement(
|
|
2654
|
-
|
|
2659
|
+
al,
|
|
2655
2660
|
{
|
|
2656
2661
|
ref: v.scrollRef,
|
|
2657
2662
|
scrollPositionRef: v.scrollPositionRef,
|
|
@@ -2662,7 +2667,7 @@ const fl = ({ style: e }) => {
|
|
|
2662
2667
|
onLoadPrev: x.loadPrevious,
|
|
2663
2668
|
onLoadNext: x.loadNext,
|
|
2664
2669
|
depsForResetScrollPositionToBottom: [x.initialized, x.messages.length !== 0],
|
|
2665
|
-
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
2670
|
+
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(xl, { style: { marginTop: 16 } }), w()),
|
|
2666
2671
|
messageBottomArea: /* @__PURE__ */ r.createElement(r.Fragment, null, H && /* @__PURE__ */ r.createElement(
|
|
2667
2672
|
t,
|
|
2668
2673
|
{
|
|
@@ -2672,15 +2677,15 @@ const fl = ({ style: e }) => {
|
|
|
2672
2677
|
groupType: "single",
|
|
2673
2678
|
message: ""
|
|
2674
2679
|
}
|
|
2675
|
-
), /* @__PURE__ */ r.createElement(
|
|
2676
|
-
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !v.isScrollBottomReached && /* @__PURE__ */ r.createElement(
|
|
2680
|
+
), /* @__PURE__ */ r.createElement(yl, null)),
|
|
2681
|
+
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !v.isScrollBottomReached && /* @__PURE__ */ r.createElement(kl, { onClick: () => v.scrollPubSub.publish({ type: "scrollToBottom" }) })),
|
|
2677
2682
|
renderMessage: ({ message: E, index: U }) => {
|
|
2678
|
-
const te =
|
|
2683
|
+
const te = Na(E), G = y[U - 1], Xe = y[U + 1], I = y[y.length - 1], A = E === I, L = Da(E, G, Xe, _l), j = !Nr((G == null ? void 0 : G.createdAt) ?? 0, E.createdAt) && _(U) && !f, fe = () => {
|
|
2679
2684
|
E.isFileMessage() && i(E);
|
|
2680
2685
|
}, Se = () => {
|
|
2681
|
-
E.isFileMessage() &&
|
|
2686
|
+
E.isFileMessage() && Ln(E.url);
|
|
2682
2687
|
}, K = j ? /* @__PURE__ */ r.createElement(
|
|
2683
|
-
|
|
2688
|
+
qn,
|
|
2684
2689
|
{
|
|
2685
2690
|
style: { margin: "16px 0" },
|
|
2686
2691
|
date: E.createdAt,
|
|
@@ -2688,29 +2693,29 @@ const fl = ({ style: e }) => {
|
|
|
2688
2693
|
formatString: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
2689
2694
|
}
|
|
2690
2695
|
) : null, ne = {
|
|
2691
|
-
maxBodyWidth: g.expanded ?
|
|
2696
|
+
maxBodyWidth: g.expanded ? Dn : void 0,
|
|
2692
2697
|
extendedMessagePayload: E.extendedMessagePayload,
|
|
2693
2698
|
createdAt: E.createdAt,
|
|
2694
2699
|
groupType: L,
|
|
2695
2700
|
onClickMedia: fe,
|
|
2696
2701
|
onClickFile: Se
|
|
2697
2702
|
}, we = (() => {
|
|
2698
|
-
var ce,
|
|
2703
|
+
var ce, Ot;
|
|
2699
2704
|
if (ze.isAdmin(E))
|
|
2700
2705
|
return ze.isCSAT(E) ? h ? /* @__PURE__ */ r.createElement(
|
|
2701
2706
|
n,
|
|
2702
2707
|
{
|
|
2703
2708
|
...ne,
|
|
2704
2709
|
...h,
|
|
2705
|
-
isResolvedWhenDeterminedByUser:
|
|
2710
|
+
isResolvedWhenDeterminedByUser: Al(h),
|
|
2706
2711
|
messageType: "admin.csat",
|
|
2707
2712
|
onSubmitCSAT: ({ csat: re, csatType: de, csatReason: V, isResolved: be }) => {
|
|
2708
|
-
var
|
|
2709
|
-
re && ((
|
|
2713
|
+
var Lt;
|
|
2714
|
+
re && ((Lt = b.channel) == null || Lt.submitCSAT({ csat: re, csatType: de, csatReason: V, isResolved: be }));
|
|
2710
2715
|
}
|
|
2711
2716
|
}
|
|
2712
2717
|
) : null : /* @__PURE__ */ r.createElement(n, { ...ne, messageType: "admin", message: E.message });
|
|
2713
|
-
if (ze.isOutgoing(E,
|
|
2718
|
+
if (ze.isOutgoing(E, a.userId)) {
|
|
2714
2719
|
const re = {
|
|
2715
2720
|
...ne,
|
|
2716
2721
|
message: E.message,
|
|
@@ -2720,7 +2725,7 @@ const fl = ({ style: e }) => {
|
|
|
2720
2725
|
if (E.isUserMessage())
|
|
2721
2726
|
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...re });
|
|
2722
2727
|
if (E.isFileMessage()) {
|
|
2723
|
-
const [de, V] = ((ce = E.metaArrays.find((be) => be.key ===
|
|
2728
|
+
const [de, V] = ((ce = E.metaArrays.find((be) => be.key === On)) == null ? void 0 : ce.value) ?? [];
|
|
2724
2729
|
return /* @__PURE__ */ r.createElement(
|
|
2725
2730
|
e,
|
|
2726
2731
|
{
|
|
@@ -2728,15 +2733,15 @@ const fl = ({ style: e }) => {
|
|
|
2728
2733
|
file: E,
|
|
2729
2734
|
metadata: {
|
|
2730
2735
|
aspectRatio: de && V ? `${de}/${V}` : "1/1",
|
|
2731
|
-
localFile: (
|
|
2736
|
+
localFile: (Ot = E.messageParams) == null ? void 0 : Ot.file
|
|
2732
2737
|
},
|
|
2733
2738
|
...re
|
|
2734
2739
|
}
|
|
2735
2740
|
);
|
|
2736
2741
|
}
|
|
2737
2742
|
}
|
|
2738
|
-
if (ze.isIncoming(E,
|
|
2739
|
-
const re = E.sender.userId ===
|
|
2743
|
+
if (ze.isIncoming(E, a.userId)) {
|
|
2744
|
+
const re = E.sender.userId === s.userId, de = {
|
|
2740
2745
|
...ne,
|
|
2741
2746
|
sender: le(E, re),
|
|
2742
2747
|
message: E.message,
|
|
@@ -2763,49 +2768,49 @@ const fl = ({ style: e }) => {
|
|
|
2763
2768
|
}
|
|
2764
2769
|
);
|
|
2765
2770
|
};
|
|
2766
|
-
return /* @__PURE__ */ r.createElement(
|
|
2767
|
-
},
|
|
2768
|
-
function
|
|
2771
|
+
return /* @__PURE__ */ r.createElement(wl, { id: `${Z}-message-list` }, _e(), o && /* @__PURE__ */ r.createElement(rl, { onClose: () => i(null), message: o }));
|
|
2772
|
+
}, wl = c.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, kl = c(gl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
|
|
2773
|
+
function Al(e) {
|
|
2769
2774
|
var t;
|
|
2770
2775
|
if (((t = e == null ? void 0 : e.resolution) == null ? void 0 : t.determinedBy) === "user")
|
|
2771
2776
|
return e.resolution.isResolved;
|
|
2772
2777
|
}
|
|
2773
|
-
const
|
|
2778
|
+
const Il = () => {
|
|
2774
2779
|
const { stringSet: e } = M(), { connectionError: t } = F(), { channelSource: n } = Y(), o = t || n.error;
|
|
2775
2780
|
if (o) {
|
|
2776
2781
|
const i = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
|
|
2777
2782
|
return /* @__PURE__ */ r.createElement(Ee, { type: "error", label: o.message, action: i });
|
|
2778
2783
|
}
|
|
2779
|
-
return n.channel ? /* @__PURE__ */ r.createElement(
|
|
2780
|
-
},
|
|
2781
|
-
const { stringSet: e } = M(), { activeChannel: t } = F(), [n] =
|
|
2784
|
+
return n.channel ? /* @__PURE__ */ r.createElement(Sl, null) : /* @__PURE__ */ r.createElement(Ee, { type: "loading" });
|
|
2785
|
+
}, Xn = () => {
|
|
2786
|
+
const { stringSet: e } = M(), { activeChannel: t } = F(), [n] = T(() => (t == null ? void 0 : t.status) === z.OPEN);
|
|
2782
2787
|
return n ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
|
|
2783
|
-
},
|
|
2784
|
-
const { stringSet: e } = M(), { goToActiveConversation: t } = Y(), n =
|
|
2785
|
-
return /* @__PURE__ */ r.createElement(
|
|
2786
|
-
},
|
|
2788
|
+
}, $l = () => {
|
|
2789
|
+
const { stringSet: e } = M(), { goToActiveConversation: t } = Y(), n = Xn();
|
|
2790
|
+
return /* @__PURE__ */ r.createElement(Ml, null, /* @__PURE__ */ r.createElement(S, { variant: "body1", color: u.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ r.createElement(Ol, { onClick: t }, /* @__PURE__ */ r.createElement(S, { variant: "button", color: u.themedColor.textHighEmphasis }, n)));
|
|
2791
|
+
}, Ml = c.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${B.light`
|
|
2787
2792
|
background-color: ${u.color.background100};
|
|
2788
2793
|
`}
|
|
2789
2794
|
${B.dark`
|
|
2790
2795
|
background-color: ${u.color.background500};
|
|
2791
2796
|
`}
|
|
2792
|
-
`,
|
|
2797
|
+
`, Ol = c.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${u.themedColor.textDisabled};cursor:pointer;${B.light`
|
|
2793
2798
|
background-color: ${u.color.background50};
|
|
2794
2799
|
`}
|
|
2795
2800
|
${B.dark`
|
|
2796
2801
|
background-color: ${u.color.background700};
|
|
2797
2802
|
`}
|
|
2798
|
-
`,
|
|
2799
|
-
const { stringSet: t } = M(), { aiAgentInfo: n } = F(), [o, i] =
|
|
2803
|
+
`, Qn = ye(void 0), Ll = ({ children: e }) => {
|
|
2804
|
+
const { stringSet: t } = M(), { aiAgentInfo: n } = F(), [o, i] = T([]), [a, s] = T({
|
|
2800
2805
|
visible: !1,
|
|
2801
2806
|
title: "",
|
|
2802
2807
|
buttonText: t.BUTTON__OK
|
|
2803
2808
|
}), l = n == null ? void 0 : n.replyToFile, d = (p) => {
|
|
2804
2809
|
if (!l) return;
|
|
2805
|
-
const h = p.filter((b) =>
|
|
2810
|
+
const h = p.filter((b) => In.includes(b.type));
|
|
2806
2811
|
if (h.length !== 0) {
|
|
2807
|
-
if (h.some((b) => b.size >
|
|
2808
|
-
|
|
2812
|
+
if (h.some((b) => b.size > ei)) {
|
|
2813
|
+
s((b) => ({
|
|
2809
2814
|
...b,
|
|
2810
2815
|
visible: !0,
|
|
2811
2816
|
title: t.FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT.replace("%d", "25")
|
|
@@ -2813,7 +2818,7 @@ const kl = () => {
|
|
|
2813
2818
|
return;
|
|
2814
2819
|
}
|
|
2815
2820
|
if (h.length > 1 || h.length > 0 && o.length > 0) {
|
|
2816
|
-
|
|
2821
|
+
s((b) => ({
|
|
2817
2822
|
...b,
|
|
2818
2823
|
visible: !0,
|
|
2819
2824
|
title: t.FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT
|
|
@@ -2838,7 +2843,7 @@ const kl = () => {
|
|
|
2838
2843
|
i((p) => (p.forEach((h) => URL.revokeObjectURL(h.preview.url)), []));
|
|
2839
2844
|
};
|
|
2840
2845
|
return /* @__PURE__ */ r.createElement(
|
|
2841
|
-
|
|
2846
|
+
Qn.Provider,
|
|
2842
2847
|
{
|
|
2843
2848
|
value: {
|
|
2844
2849
|
files: o,
|
|
@@ -2849,27 +2854,27 @@ const kl = () => {
|
|
|
2849
2854
|
}
|
|
2850
2855
|
},
|
|
2851
2856
|
e,
|
|
2852
|
-
/* @__PURE__ */ r.createElement(
|
|
2857
|
+
/* @__PURE__ */ r.createElement(Rl, { ...a, onClose: () => s((p) => ({ ...p, visible: !1, title: "" })) })
|
|
2853
2858
|
);
|
|
2854
|
-
},
|
|
2855
|
-
const e = J(
|
|
2859
|
+
}, At = () => {
|
|
2860
|
+
const e = J(Qn);
|
|
2856
2861
|
if (!e)
|
|
2857
2862
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
2858
2863
|
return e;
|
|
2859
|
-
},
|
|
2864
|
+
}, Rl = ({
|
|
2860
2865
|
title: e,
|
|
2861
2866
|
buttonText: t,
|
|
2862
2867
|
visible: n,
|
|
2863
2868
|
onClose: o
|
|
2864
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
2865
|
-
function
|
|
2869
|
+
}) => /* @__PURE__ */ r.createElement(Zn, { rootElementId: X.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(Nl, null, /* @__PURE__ */ r.createElement(Bl, null, /* @__PURE__ */ r.createElement(S, { variant: "h1", color: u.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(Dl, null, /* @__PURE__ */ r.createElement(Pl, { onClick: o }, /* @__PURE__ */ r.createElement(S, { variant: "button", color: u.themedColor.textHighEmphasisInverse }, t))))), Nl = c.div`width:100%;height:auto;padding-block:18px 24px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, Dl = c.div`display:flex;flex-direction:row;justify-content:flex-end;`, Bl = c.div`margin-bottom:16px;`, Pl = c.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${u.themedColor.error};border:1px solid ${u.themedColor.error};padding:10px 16px;&:hover{background-color:${u.color.error.dark};border-color:${u.color.error.dark};}&:active{background-color:${u.color.error.extraDark};}`;
|
|
2870
|
+
function Fl({ blurred: e, elementRef: t, document: n = window.document }) {
|
|
2866
2871
|
const o = D(!1);
|
|
2867
2872
|
e && t.current && n.activeElement === t.current && (o.current = !0), ge(() => {
|
|
2868
2873
|
var i;
|
|
2869
2874
|
!e && o.current && ((i = t.current) == null || i.focus(), o.current = !1);
|
|
2870
2875
|
}, [e]);
|
|
2871
2876
|
}
|
|
2872
|
-
const
|
|
2877
|
+
const Hl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, Ul = c.div`display:flex;flex-shrink:0;position:relative;margin-block-start:8px;border-radius:12px;height:64px;img{border-radius:12px;object-fit:cover;width:64px;-webkit-user-drag:none;}`, zl = c.div`display:flex;align-items:center;justify-content:center;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;cursor:pointer;border-radius:50%;${B.light`
|
|
2873
2878
|
background-color: ${u.color.background50};
|
|
2874
2879
|
`}
|
|
2875
2880
|
${B.dark`
|
|
@@ -2888,19 +2893,19 @@ const Pl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2888
2893
|
circle {
|
|
2889
2894
|
stroke: ${u.themedColor.bg_50_600};
|
|
2890
2895
|
}
|
|
2891
|
-
`,
|
|
2892
|
-
const e = Le(), [t, n] =
|
|
2893
|
-
return !
|
|
2894
|
-
},
|
|
2895
|
-
const { stringSet: n } = M(), { aiAgentInfo: o } = F(), i =
|
|
2896
|
+
`, Wl = () => {
|
|
2897
|
+
const e = Le(), [t, n] = T(), { files: o, removeFile: i, isFileUploadEnabled: a } = At();
|
|
2898
|
+
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(Hl, null, o.map(({ preview: { type: s, name: l, url: d } }, g) => /* @__PURE__ */ r.createElement(Ul, { key: d, onMouseOver: () => n(g), onMouseLeave: () => n(void 0) }, (e || t === g) && /* @__PURE__ */ r.createElement(zl, { title: "Remove file", onClick: () => i(g) }, /* @__PURE__ */ r.createElement($, { type: "close-filled", color: u.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: d }) : /* @__PURE__ */ r.createElement(vt, { name: l, type: Et(l, s) }))));
|
|
2899
|
+
}, Vl = ({ channel: e, messages: t }) => {
|
|
2900
|
+
const { stringSet: n } = M(), { aiAgentInfo: o } = F(), i = Gl(), a = jl({
|
|
2896
2901
|
lastMessage: t[t.length - 1],
|
|
2897
2902
|
aiAgentUserId: o.userId
|
|
2898
2903
|
});
|
|
2899
|
-
return !e || !i ||
|
|
2900
|
-
},
|
|
2901
|
-
const e =
|
|
2904
|
+
return !e || !i || Rn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : a ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
|
|
2905
|
+
}, Gl = () => {
|
|
2906
|
+
const e = mn(), { chatSDK: t } = N(), [n, o] = T(!0);
|
|
2902
2907
|
return R(() => {
|
|
2903
|
-
const i = new
|
|
2908
|
+
const i = new ut({
|
|
2904
2909
|
onDisconnected: () => o(!1),
|
|
2905
2910
|
onConnected: () => o(!0),
|
|
2906
2911
|
onReconnectSucceeded: () => o(!0)
|
|
@@ -2909,28 +2914,28 @@ const Pl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2909
2914
|
t.removeConnectionHandler(e);
|
|
2910
2915
|
};
|
|
2911
2916
|
}, [t]), n;
|
|
2912
|
-
},
|
|
2917
|
+
}, jl = ({
|
|
2913
2918
|
lastMessage: e,
|
|
2914
2919
|
aiAgentUserId: t
|
|
2915
2920
|
}) => {
|
|
2916
|
-
const [n, o] =
|
|
2921
|
+
const [n, o] = T(!1), i = Jn();
|
|
2917
2922
|
return R(() => {
|
|
2918
2923
|
if (!e) return;
|
|
2919
|
-
const
|
|
2920
|
-
o(!!(
|
|
2924
|
+
const a = i.some((l) => l.userId === t), s = Gn(e, t) && kt.isStreaming(e);
|
|
2925
|
+
o(!!(s || a));
|
|
2921
2926
|
}, [i, e, t]), n;
|
|
2922
|
-
},
|
|
2927
|
+
}, er = {
|
|
2923
2928
|
textArea: k`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
2924
2929
|
attachIcon: k`margin-bottom:4px;`
|
|
2925
|
-
},
|
|
2926
|
-
const t = D(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled:
|
|
2927
|
-
return !
|
|
2928
|
-
|
|
2930
|
+
}, tr = c.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, Kl = c(tr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${u.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${u.themedColor.bg_200_400};}}${ht && er.attachIcon};`, Zl = c.input`display:none;`, tn = c.div`width:100%;position:relative;background-color:${u.themedColor.bg_100_500};border-radius:20px;`, nn = c.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, rn = c.textarea`all:unset;display:block;flex:1;min-width:0;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;font-size:14px;line-height:20px;color:${u.themedColor.textHighEmphasis};resize:none;width:100%;height:${An}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${ht && er.textArea};&::placeholder{color:${u.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${u.themedColor.textDisabled};}}`, on = c.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, sn = ({ disabled: e }) => {
|
|
2931
|
+
const t = D(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } = At();
|
|
2932
|
+
return !a || i.length > 0 ? null : /* @__PURE__ */ r.createElement(
|
|
2933
|
+
Kl,
|
|
2929
2934
|
{
|
|
2930
2935
|
disabled: e,
|
|
2931
2936
|
onClick: () => {
|
|
2932
|
-
var
|
|
2933
|
-
o(), (
|
|
2937
|
+
var s;
|
|
2938
|
+
o(), (s = t.current) == null || s.click();
|
|
2934
2939
|
}
|
|
2935
2940
|
},
|
|
2936
2941
|
/* @__PURE__ */ r.createElement(
|
|
@@ -2942,35 +2947,35 @@ const Pl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2942
2947
|
}
|
|
2943
2948
|
),
|
|
2944
2949
|
/* @__PURE__ */ r.createElement(
|
|
2945
|
-
|
|
2950
|
+
Zl,
|
|
2946
2951
|
{
|
|
2947
2952
|
type: "file",
|
|
2948
2953
|
ref: t,
|
|
2949
|
-
onChange: (
|
|
2950
|
-
const l =
|
|
2951
|
-
l && n(Array.from(l)),
|
|
2954
|
+
onChange: (s) => {
|
|
2955
|
+
const l = s.currentTarget.files;
|
|
2956
|
+
l && n(Array.from(l)), s.target.value = "";
|
|
2952
2957
|
},
|
|
2953
|
-
accept:
|
|
2958
|
+
accept: In.join(",")
|
|
2954
2959
|
}
|
|
2955
2960
|
)
|
|
2956
2961
|
);
|
|
2957
|
-
},
|
|
2958
|
-
const e = D(null), [t, n] =
|
|
2962
|
+
}, Yl = () => {
|
|
2963
|
+
const e = D(null), [t, n] = T(""), { rootElement: o } = N(), { channelSource: i, messageSource: a } = Y(), [s, l] = Vl({
|
|
2959
2964
|
channel: i.channel,
|
|
2960
|
-
messages:
|
|
2961
|
-
}), { files: d, addFiles: g, clearFiles: m } =
|
|
2962
|
-
|
|
2963
|
-
const p = t.trim().length > 0, h = d.length > 0, b = !
|
|
2965
|
+
messages: a.messages
|
|
2966
|
+
}), { files: d, addFiles: g, clearFiles: m } = At();
|
|
2967
|
+
xi({ onDropFiles: g }), Fl({ blurred: s, elementRef: e, document: pe(o) });
|
|
2968
|
+
const p = t.trim().length > 0, h = d.length > 0, b = !s && (p || h), x = () => {
|
|
2964
2969
|
e.current && (e.current.value = "", e.current.style.height = ""), m(), n("");
|
|
2965
2970
|
}, v = async () => {
|
|
2966
2971
|
const w = t.trim(), O = { message: w };
|
|
2967
2972
|
if (!(!w && !d.length)) {
|
|
2968
2973
|
if (d.length > 0) {
|
|
2969
2974
|
const ee = d[0].file, H = { ...O, file: ee };
|
|
2970
|
-
|
|
2975
|
+
a.sendFileMessage(H), x();
|
|
2971
2976
|
return;
|
|
2972
2977
|
}
|
|
2973
|
-
|
|
2978
|
+
a.sendUserMessage(O), x();
|
|
2974
2979
|
}
|
|
2975
2980
|
}, f = (w) => {
|
|
2976
2981
|
const O = Array.from(w.clipboardData.files);
|
|
@@ -2980,13 +2985,13 @@ const Pl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2980
2985
|
}, _ = (w) => {
|
|
2981
2986
|
if (e.current) {
|
|
2982
2987
|
e.current.style.height = "";
|
|
2983
|
-
const O = Math.min(
|
|
2984
|
-
|
|
2988
|
+
const O = Math.min(Qo, e.current.scrollHeight);
|
|
2989
|
+
An < O && (e.current.style.height = `${O}px`);
|
|
2985
2990
|
}
|
|
2986
2991
|
n(w.target.value);
|
|
2987
2992
|
};
|
|
2988
|
-
return
|
|
2989
|
-
|
|
2993
|
+
return s ? /* @__PURE__ */ r.createElement(on, null, /* @__PURE__ */ r.createElement(tn, null, /* @__PURE__ */ r.createElement(nn, null, /* @__PURE__ */ r.createElement(rn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(sn, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(on, null, /* @__PURE__ */ r.createElement(tn, null, /* @__PURE__ */ r.createElement(Wl, null), /* @__PURE__ */ r.createElement(nn, null, /* @__PURE__ */ r.createElement(
|
|
2994
|
+
rn,
|
|
2990
2995
|
{
|
|
2991
2996
|
ref: e,
|
|
2992
2997
|
role: "textbox",
|
|
@@ -2997,24 +3002,24 @@ const Pl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
2997
3002
|
onChange: _,
|
|
2998
3003
|
onPaste: f
|
|
2999
3004
|
}
|
|
3000
|
-
), /* @__PURE__ */ r.createElement(
|
|
3001
|
-
},
|
|
3005
|
+
), /* @__PURE__ */ r.createElement(sn, null))), b && /* @__PURE__ */ r.createElement(tr, { onClick: () => v() }, /* @__PURE__ */ r.createElement($, { type: "send", color: u.color.primary.main, size: 20 })));
|
|
3006
|
+
}, ql = c.div`padding:8px 16px;text-align:center;word-break:break-word;white-space:pre-wrap;line-height:1.43;letter-spacing:-0.2px;font-size:14px;font-weight:400;color:${u.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${B.light`
|
|
3002
3007
|
color: ${u.color.information.light};
|
|
3003
3008
|
`};
|
|
3004
3009
|
${B.dark`
|
|
3005
3010
|
color: ${u.color.information.main};
|
|
3006
3011
|
`};
|
|
3007
3012
|
}
|
|
3008
|
-
`,
|
|
3013
|
+
`, Jl = C(() => import("./Dde5r6cu.js").then((e) => ({ default: e.MarkdownText }))), Xl = () => {
|
|
3009
3014
|
const { aiAgentInfo: e } = F(), { messageSource: t } = Y(), { userSession: n } = F();
|
|
3010
|
-
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) =>
|
|
3011
|
-
},
|
|
3012
|
-
var
|
|
3013
|
-
const { activeChannel: e } = F(), { channelSource: t } = Y(), n = ((
|
|
3014
|
-
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(
|
|
3015
|
-
},
|
|
3015
|
+
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) => Gn(i, n.userId))) ? null : /* @__PURE__ */ r.createElement(ql, null, /* @__PURE__ */ r.createElement(Jl, null, e.specialNotice));
|
|
3016
|
+
}, Ql = () => /* @__PURE__ */ r.createElement(ec, null, /* @__PURE__ */ r.createElement(Xl, null), /* @__PURE__ */ r.createElement(Ll, null, /* @__PURE__ */ r.createElement(Yl, null))), ec = c.div`z-index:0;border:none;width:100%;`, tc = () => {
|
|
3017
|
+
var a, s, l;
|
|
3018
|
+
const { activeChannel: e } = F(), { channelSource: t } = Y(), n = ((s = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : s.status) === z.CLOSED;
|
|
3019
|
+
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement($l, null) : /* @__PURE__ */ r.createElement(Ql, null);
|
|
3020
|
+
}, nc = () => {
|
|
3016
3021
|
var _;
|
|
3017
|
-
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = N(), { stringSet:
|
|
3022
|
+
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = N(), { stringSet: a } = M(), { aiAgentInfo: s, activeChannel: l } = F(), { channelSource: d, onNavigateToConversationList: g } = Y(), m = d.channel, h = Le() ? 24 : 16, b = () => {
|
|
3018
3023
|
e.setOpened(!1);
|
|
3019
3024
|
}, x = async () => {
|
|
3020
3025
|
try {
|
|
@@ -3024,115 +3029,115 @@ const Pl = c.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3024
3029
|
t.error("conversation.handleAgentHandoff: error", w);
|
|
3025
3030
|
}
|
|
3026
3031
|
}, v = async () => {
|
|
3027
|
-
m && await i.send(
|
|
3028
|
-
}, f = l && (m == null ? void 0 : m.url) === l.url, y =
|
|
3029
|
-
return /* @__PURE__ */ r.createElement(
|
|
3030
|
-
|
|
3032
|
+
m && await i.send(Xr.CloseConversation());
|
|
3033
|
+
}, f = l && (m == null ? void 0 : m.url) === l.url, y = s.showHandoffButton && !!((_ = m == null ? void 0 : m.conversation) != null && _.handoff) && f;
|
|
3034
|
+
return /* @__PURE__ */ r.createElement(ac, null, /* @__PURE__ */ r.createElement(lc, null, g && /* @__PURE__ */ r.createElement(Ne, { onClick: () => g() }, /* @__PURE__ */ r.createElement($, { type: "menu", size: 24, color: u.themedColor.textHighEmphasis })), f && /* @__PURE__ */ r.createElement(Yn, { size: 34 }), /* @__PURE__ */ r.createElement(dc, { variant: "h2", color: u.themedColor.textHighEmphasis }, s.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ r.createElement(cc, null, y && /* @__PURE__ */ r.createElement(
|
|
3035
|
+
sc,
|
|
3031
3036
|
{
|
|
3032
|
-
tooltipLabel:
|
|
3033
|
-
disabled: !
|
|
3037
|
+
tooltipLabel: a.HEADER_BUTTON__AGENT_HANDOFF,
|
|
3038
|
+
disabled: !bi(m),
|
|
3034
3039
|
size: h,
|
|
3035
3040
|
onClick: x
|
|
3036
3041
|
}
|
|
3037
3042
|
), n && /* @__PURE__ */ r.createElement(
|
|
3038
|
-
|
|
3043
|
+
ic,
|
|
3039
3044
|
{
|
|
3040
|
-
disabled: !
|
|
3045
|
+
disabled: !Nn(m),
|
|
3041
3046
|
size: h,
|
|
3042
3047
|
onClick: v
|
|
3043
3048
|
}
|
|
3044
|
-
), o && /* @__PURE__ */ r.createElement(
|
|
3045
|
-
},
|
|
3049
|
+
), o && /* @__PURE__ */ r.createElement(rc, { size: h }), /* @__PURE__ */ r.createElement(oc, { size: h, onClick: b })));
|
|
3050
|
+
}, rc = ({ size: e, disabled: t }) => {
|
|
3046
3051
|
const { state: n } = N();
|
|
3047
3052
|
return /* @__PURE__ */ r.createElement(Ne, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement($, { type: n.expanded ? "collapse" : "expand", size: e, color: u.themedColor.textHighEmphasis }));
|
|
3048
|
-
},
|
|
3053
|
+
}, oc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ne, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement($, { type: "close", size: e, color: u.themedColor.textHighEmphasis })), ic = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ne, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
|
|
3049
3054
|
$,
|
|
3050
3055
|
{
|
|
3051
3056
|
type: "refresh",
|
|
3052
3057
|
size: e,
|
|
3053
3058
|
color: t ? u.themedColor.textDisabled : u.themedColor.textHighEmphasis
|
|
3054
3059
|
}
|
|
3055
|
-
)),
|
|
3060
|
+
)), sc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Wn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(Ne, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
|
|
3056
3061
|
$,
|
|
3057
3062
|
{
|
|
3058
3063
|
type: "agent",
|
|
3059
3064
|
size: e,
|
|
3060
3065
|
color: n ? u.themedColor.textDisabled : u.themedColor.textHighEmphasis
|
|
3061
3066
|
}
|
|
3062
|
-
))),
|
|
3063
|
-
const { isDashboardActionbookTester: e } =
|
|
3064
|
-
return e ? null : /* @__PURE__ */ r.createElement(
|
|
3065
|
-
},
|
|
3067
|
+
))), ac = c.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, lc = c.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, cc = c.div`display:flex;gap:10px;align-items:center;justify-content:center;`, dc = c(S)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ne = c.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, uc = () => {
|
|
3068
|
+
const { isDashboardActionbookTester: e } = wt();
|
|
3069
|
+
return e ? null : /* @__PURE__ */ r.createElement(nc, null);
|
|
3070
|
+
}, an = ({
|
|
3066
3071
|
children: e,
|
|
3067
3072
|
onNavigateToConversationList: t,
|
|
3068
3073
|
closedChannelUrl: n,
|
|
3069
3074
|
onClearClosedChannelUrl: o
|
|
3070
3075
|
}) => {
|
|
3071
|
-
const { Template: i } =
|
|
3076
|
+
const { Template: i } = It.useContext();
|
|
3072
3077
|
return /* @__PURE__ */ r.createElement(
|
|
3073
|
-
|
|
3078
|
+
fi,
|
|
3074
3079
|
{
|
|
3075
3080
|
onNavigateToConversationList: t,
|
|
3076
3081
|
closedChannelUrl: n,
|
|
3077
3082
|
onClearClosedChannelUrl: o
|
|
3078
3083
|
},
|
|
3079
|
-
/* @__PURE__ */ r.createElement(lt, null, /* @__PURE__ */ r.createElement(lt.Consumer, null, (
|
|
3084
|
+
/* @__PURE__ */ r.createElement(lt, null, /* @__PURE__ */ r.createElement(lt.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(gc, { ...a }, /* @__PURE__ */ r.createElement(i, null)), e)))
|
|
3080
3085
|
);
|
|
3081
|
-
},
|
|
3082
|
-
template:
|
|
3086
|
+
}, It = Ce({
|
|
3087
|
+
template: mc,
|
|
3083
3088
|
components: {
|
|
3084
|
-
Header:
|
|
3085
|
-
Body:
|
|
3086
|
-
Footer:
|
|
3089
|
+
Header: uc,
|
|
3090
|
+
Body: Il,
|
|
3091
|
+
Footer: tc
|
|
3087
3092
|
}
|
|
3088
3093
|
});
|
|
3089
|
-
function
|
|
3090
|
-
const { components: e } =
|
|
3094
|
+
function mc() {
|
|
3095
|
+
const { components: e } = It.useContext();
|
|
3091
3096
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3092
3097
|
}
|
|
3093
|
-
const
|
|
3094
|
-
Provider:
|
|
3095
|
-
useContext:
|
|
3098
|
+
const gc = c.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
3099
|
+
Provider: pc,
|
|
3100
|
+
useContext: nr
|
|
3096
3101
|
} = W("ConversationList");
|
|
3097
|
-
function
|
|
3102
|
+
function hc({
|
|
3098
3103
|
onOpenConversationView: e = Ge,
|
|
3099
3104
|
children: t
|
|
3100
3105
|
}) {
|
|
3101
|
-
return /* @__PURE__ */ r.createElement(
|
|
3106
|
+
return /* @__PURE__ */ r.createElement(oo, null, (n) => /* @__PURE__ */ r.createElement(pc, { value: { ...n, onOpenConversationView: e } }, t));
|
|
3102
3107
|
}
|
|
3103
|
-
const
|
|
3104
|
-
template:
|
|
3108
|
+
const rr = Ce({
|
|
3109
|
+
template: fc,
|
|
3105
3110
|
// Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
|
|
3106
3111
|
components: {}
|
|
3107
3112
|
});
|
|
3108
|
-
function
|
|
3113
|
+
function fc({
|
|
3109
3114
|
title: e = "",
|
|
3110
3115
|
lastMessageTimestamp: t = Date.now(),
|
|
3111
3116
|
onClick: n
|
|
3112
3117
|
}) {
|
|
3113
3118
|
const { stringSet: o, format: i } = M();
|
|
3114
|
-
return /* @__PURE__ */ r.createElement(
|
|
3119
|
+
return /* @__PURE__ */ r.createElement(bc, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(Ec, null, /* @__PURE__ */ r.createElement(vc, null, /* @__PURE__ */ r.createElement(S, { variant: "subtitle1", color: u.themedColor.textHighEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE)), /* @__PURE__ */ r.createElement(S, { variant: "caption2", color: u.themedColor.textLowEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION))), /* @__PURE__ */ r.createElement(S, { variant: "body3", color: u.themedColor.textMidEmphasis }, e || o.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ r.createElement($, { type: "chevron-right", size: 16, color: u.themedColor.textHighEmphasis }), /* @__PURE__ */ r.createElement(xc, null));
|
|
3115
3120
|
}
|
|
3116
|
-
const
|
|
3121
|
+
const bc = c.div`display:flex;flex-direction:row;align-items:center;position:relative;width:100%;padding:14px 16px;box-sizing:border-box;gap:4px;cursor:pointer;`, xc = c.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${u.themedColor.textDisabled};`, Ec = c.div`gap:4px;display:flex;flex-direction:column;flex:1;`, vc = c.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, yc = ({ items: e, renderItem: t, onEndReached: n }) => {
|
|
3117
3122
|
const o = (i) => {
|
|
3118
|
-
const
|
|
3119
|
-
|
|
3123
|
+
const a = i.target;
|
|
3124
|
+
a.scrollHeight - a.scrollTop === a.clientHeight && (n == null || n());
|
|
3120
3125
|
};
|
|
3121
|
-
return /* @__PURE__ */ r.createElement(
|
|
3122
|
-
},
|
|
3123
|
-
const { stringSet: e } = M(), { listSource: t, onOpenConversationView: n } =
|
|
3126
|
+
return /* @__PURE__ */ r.createElement(Cc, { onScroll: (i) => o(i) }, e.map((i, a) => t(i, a)));
|
|
3127
|
+
}, Cc = c.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, Tc = () => {
|
|
3128
|
+
const { stringSet: e } = M(), { listSource: t, onOpenConversationView: n } = nr(), { Template: o } = rr.useContext();
|
|
3124
3129
|
return t.initialized ? t.conversations.length === 0 ? /* @__PURE__ */ r.createElement(Ee, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ r.createElement(
|
|
3125
|
-
|
|
3130
|
+
yc,
|
|
3126
3131
|
{
|
|
3127
3132
|
items: t.conversations,
|
|
3128
|
-
renderItem: (i,
|
|
3129
|
-
var
|
|
3133
|
+
renderItem: (i, a) => {
|
|
3134
|
+
var s;
|
|
3130
3135
|
return /* @__PURE__ */ r.createElement(
|
|
3131
3136
|
o,
|
|
3132
3137
|
{
|
|
3133
|
-
key:
|
|
3138
|
+
key: a,
|
|
3134
3139
|
channelUrl: i.channelInfo.url,
|
|
3135
|
-
title: (
|
|
3140
|
+
title: (s = i.topics) == null ? void 0 : s.join(", "),
|
|
3136
3141
|
lastMessageTimestamp: i.channelInfo.lastMessageTs,
|
|
3137
3142
|
onClick: () => n(i.channelInfo.url, z.CLOSED)
|
|
3138
3143
|
}
|
|
@@ -3143,10 +3148,10 @@ const hc = c.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3143
3148
|
}
|
|
3144
3149
|
}
|
|
3145
3150
|
) : /* @__PURE__ */ r.createElement(Ee, { type: "loading" });
|
|
3146
|
-
},
|
|
3147
|
-
const { refreshActiveChannel: e } = F(), { onOpenConversationView: t } =
|
|
3151
|
+
}, _c = () => {
|
|
3152
|
+
const { refreshActiveChannel: e } = F(), { onOpenConversationView: t } = nr(), n = Xn();
|
|
3148
3153
|
return /* @__PURE__ */ r.createElement(
|
|
3149
|
-
|
|
3154
|
+
Sc,
|
|
3150
3155
|
{
|
|
3151
3156
|
role: "button",
|
|
3152
3157
|
onClick: async () => {
|
|
@@ -3154,47 +3159,47 @@ const hc = c.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3154
3159
|
t(o, z.OPEN);
|
|
3155
3160
|
}
|
|
3156
3161
|
},
|
|
3157
|
-
/* @__PURE__ */ r.createElement(
|
|
3162
|
+
/* @__PURE__ */ r.createElement(wc, { variant: "h1" }, n)
|
|
3158
3163
|
);
|
|
3159
|
-
},
|
|
3164
|
+
}, Sc = c.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, wc = c(S)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, kc = () => {
|
|
3160
3165
|
const { stringSet: e } = M();
|
|
3161
|
-
return /* @__PURE__ */ r.createElement(
|
|
3162
|
-
},
|
|
3163
|
-
const { Template: n } =
|
|
3164
|
-
return /* @__PURE__ */ r.createElement(
|
|
3165
|
-
},
|
|
3166
|
-
template:
|
|
3166
|
+
return /* @__PURE__ */ r.createElement(Ac, null, /* @__PURE__ */ r.createElement(Ic, { variant: "h2", color: u.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement($c, null));
|
|
3167
|
+
}, Ac = c.div`display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;flex-shrink:0;height:56px;position:relative;background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Ic = c(S)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, $c = c.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${u.themedColor.textDisabled};`, Mc = ({ children: e, onOpenConversationView: t }) => {
|
|
3168
|
+
const { Template: n } = $t.useContext();
|
|
3169
|
+
return /* @__PURE__ */ r.createElement(hc, { onOpenConversationView: t }, /* @__PURE__ */ r.createElement(Lc, null, /* @__PURE__ */ r.createElement(n, null)), e);
|
|
3170
|
+
}, $t = Ce({
|
|
3171
|
+
template: Oc,
|
|
3167
3172
|
components: {
|
|
3168
|
-
Header:
|
|
3169
|
-
Body:
|
|
3170
|
-
Footer:
|
|
3173
|
+
Header: kc,
|
|
3174
|
+
Body: Tc,
|
|
3175
|
+
Footer: _c
|
|
3171
3176
|
}
|
|
3172
3177
|
});
|
|
3173
|
-
function
|
|
3174
|
-
const { components: e } =
|
|
3178
|
+
function Oc() {
|
|
3179
|
+
const { components: e } = $t.useContext();
|
|
3175
3180
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3176
3181
|
}
|
|
3177
|
-
const
|
|
3178
|
-
|
|
3182
|
+
const Lc = c.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Rc = k`:where(#${X.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, Nc = [Rc, Vo, Go], Dc = (e, ...t) => Tr(e, ...Nc, ...t), Bc = Dc``, Pc = zr(
|
|
3183
|
+
It,
|
|
3179
3184
|
ve,
|
|
3180
|
-
Tt,
|
|
3181
3185
|
_t,
|
|
3182
|
-
|
|
3183
|
-
|
|
3186
|
+
St,
|
|
3187
|
+
$t,
|
|
3188
|
+
rr
|
|
3184
3189
|
);
|
|
3185
|
-
function
|
|
3190
|
+
function Fc({
|
|
3186
3191
|
appearance: e,
|
|
3187
3192
|
rootElement: t,
|
|
3188
3193
|
logger: n,
|
|
3189
3194
|
language: o,
|
|
3190
3195
|
stringSet: i,
|
|
3191
|
-
children:
|
|
3192
|
-
messageTemplate:
|
|
3196
|
+
children: a,
|
|
3197
|
+
messageTemplate: s,
|
|
3193
3198
|
theme: l
|
|
3194
3199
|
}) {
|
|
3195
|
-
return
|
|
3200
|
+
return Jo(Ro, t), /* @__PURE__ */ r.createElement(_r, { target: t }, /* @__PURE__ */ r.createElement(Zo, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(ko, { internalVariables: s == null ? void 0 : s.__internalVariables }, /* @__PURE__ */ r.createElement(Wo, { stringSet: i, logger: n, language: o }, /* @__PURE__ */ r.createElement(Pc, null, a, /* @__PURE__ */ r.createElement(Bc, null))))));
|
|
3196
3201
|
}
|
|
3197
|
-
const
|
|
3202
|
+
const ln = {
|
|
3198
3203
|
key_payment_plan_container: {
|
|
3199
3204
|
color_variables: {},
|
|
3200
3205
|
created_at: 1232,
|
|
@@ -3380,42 +3385,42 @@ const an = {
|
|
|
3380
3385
|
}
|
|
3381
3386
|
}
|
|
3382
3387
|
};
|
|
3383
|
-
function
|
|
3388
|
+
function or({
|
|
3384
3389
|
rootElement: e = document.body,
|
|
3385
|
-
logLevel: t =
|
|
3390
|
+
logLevel: t = gn.WARN,
|
|
3386
3391
|
language: n = navigator.language,
|
|
3387
3392
|
userSessionInfo: o,
|
|
3388
3393
|
children: i,
|
|
3389
|
-
...
|
|
3394
|
+
...a
|
|
3390
3395
|
}) {
|
|
3391
|
-
var
|
|
3392
|
-
return xe.level !== t && (xe.level = t),
|
|
3393
|
-
|
|
3396
|
+
var s;
|
|
3397
|
+
return xe.level !== t && (xe.level = t), qo("https://fonts.googleapis.com/css2?family=Roboto&display=swap", e), /* @__PURE__ */ r.createElement("div", { id: X.ENTRY, style: { width: "fit-content", height: "fit-content" } }, /* @__PURE__ */ r.createElement(_o, { logger: xe, storage: Uc }, /* @__PURE__ */ r.createElement(
|
|
3398
|
+
Fc,
|
|
3394
3399
|
{
|
|
3395
3400
|
logger: xe,
|
|
3396
3401
|
rootElement: e,
|
|
3397
|
-
appearance: (
|
|
3398
|
-
stringSet:
|
|
3402
|
+
appearance: (s = a.agentPreviewConfigs) == null ? void 0 : s.appearance,
|
|
3403
|
+
stringSet: a.stringSet,
|
|
3399
3404
|
language: n,
|
|
3400
|
-
messageTemplate:
|
|
3401
|
-
theme:
|
|
3405
|
+
messageTemplate: a.messageTemplate,
|
|
3406
|
+
theme: a.theme
|
|
3402
3407
|
},
|
|
3403
3408
|
/* @__PURE__ */ r.createElement(
|
|
3404
|
-
|
|
3409
|
+
Zr,
|
|
3405
3410
|
{
|
|
3406
|
-
appId:
|
|
3407
|
-
aiAgentId:
|
|
3411
|
+
appId: a.appId,
|
|
3412
|
+
aiAgentId: a.aiAgentId,
|
|
3408
3413
|
language: n,
|
|
3409
|
-
countryCode:
|
|
3410
|
-
context:
|
|
3414
|
+
countryCode: a.countryCode,
|
|
3415
|
+
context: a.context,
|
|
3411
3416
|
logger: xe,
|
|
3412
|
-
dispatcher:
|
|
3413
|
-
chatParams: { customApiHost:
|
|
3417
|
+
dispatcher: Hc,
|
|
3418
|
+
chatParams: { customApiHost: a.customApiHost, customWebSocketHost: a.customWebSocketHost }
|
|
3414
3419
|
},
|
|
3415
|
-
/* @__PURE__ */ r.createElement(
|
|
3416
|
-
|
|
3420
|
+
/* @__PURE__ */ r.createElement(ri, { rootElement: e, ...a }, /* @__PURE__ */ r.createElement(ai, { userSessionInfo: o }, /* @__PURE__ */ r.createElement(
|
|
3421
|
+
Aa,
|
|
3417
3422
|
{
|
|
3418
|
-
isDashboardActionbookTester:
|
|
3423
|
+
isDashboardActionbookTester: a._UNSAFE_INTERNAL_isActionbookTester
|
|
3419
3424
|
},
|
|
3420
3425
|
i,
|
|
3421
3426
|
/* @__PURE__ */ r.createElement("div", { id: X.MODAL_ROOT })
|
|
@@ -3423,59 +3428,59 @@ function rr({
|
|
|
3423
3428
|
)
|
|
3424
3429
|
)));
|
|
3425
3430
|
}
|
|
3426
|
-
const xe = new
|
|
3431
|
+
const xe = new vn(gn.WARN), Hc = new xn(xe), Mt = "@sba/message-template", cn = (e) => `${Mt}/templates/${e}`, dn = () => `${Mt}/token`, Uc = Co({
|
|
3427
3432
|
onSetTemplate: (e, t) => {
|
|
3428
|
-
|
|
3433
|
+
ln[e] || q.setItem(cn(e), t);
|
|
3429
3434
|
},
|
|
3430
3435
|
onGetTemplate: (e) => {
|
|
3431
|
-
const t =
|
|
3432
|
-
return t ? JSON.stringify(t) : q.getItem(
|
|
3436
|
+
const t = ln[e];
|
|
3437
|
+
return t ? JSON.stringify(t) : q.getItem(cn(e));
|
|
3433
3438
|
},
|
|
3434
3439
|
onSetCachedToken(e) {
|
|
3435
|
-
q.setItem(
|
|
3440
|
+
q.setItem(dn(), e);
|
|
3436
3441
|
},
|
|
3437
3442
|
onGetCachedToken() {
|
|
3438
|
-
return q.getItem(
|
|
3443
|
+
return q.getItem(dn());
|
|
3439
3444
|
},
|
|
3440
3445
|
onClear: () => {
|
|
3441
|
-
q.getKeys(
|
|
3446
|
+
q.getKeys(Mt).forEach(q.deleteItem);
|
|
3442
3447
|
}
|
|
3443
|
-
}),
|
|
3448
|
+
}), ir = ({ children: e, isOpened: t }) => {
|
|
3444
3449
|
const { dir: n, rootElement: o } = N(), i = pe(o, !0);
|
|
3445
3450
|
return R(() => {
|
|
3446
|
-
const
|
|
3447
|
-
return t ? i.body.classList.add(
|
|
3448
|
-
i.body.classList.remove(
|
|
3451
|
+
const a = "sb-agent-block-scroll";
|
|
3452
|
+
return t ? i.body.classList.add(a) : i.body.classList.remove(a), () => {
|
|
3453
|
+
i.body.classList.remove(a);
|
|
3449
3454
|
};
|
|
3450
|
-
}, [i, t]), /* @__PURE__ */ r.createElement(
|
|
3451
|
-
},
|
|
3452
|
-
function
|
|
3455
|
+
}, [i, t]), /* @__PURE__ */ r.createElement(zc, { dir: n, $visible: t }, e);
|
|
3456
|
+
}, zc = c.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${he.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`;
|
|
3457
|
+
function Wc({
|
|
3453
3458
|
className: e,
|
|
3454
3459
|
isOpened: t,
|
|
3455
3460
|
onClick: n,
|
|
3456
3461
|
type: o,
|
|
3457
3462
|
imageUrl: i,
|
|
3458
|
-
dir:
|
|
3459
|
-
animated:
|
|
3463
|
+
dir: a,
|
|
3464
|
+
animated: s = !0,
|
|
3460
3465
|
backgroundColor: l
|
|
3461
3466
|
}) {
|
|
3462
3467
|
const d = at(l);
|
|
3463
3468
|
return /* @__PURE__ */ r.createElement(
|
|
3464
|
-
|
|
3469
|
+
jc,
|
|
3465
3470
|
{
|
|
3466
|
-
dir:
|
|
3471
|
+
dir: a,
|
|
3467
3472
|
id: X.LAUNCHER,
|
|
3468
3473
|
className: e,
|
|
3469
3474
|
"aria-label": "Sendbird AIAgent Launcher",
|
|
3470
3475
|
onClick: n,
|
|
3471
|
-
$animated:
|
|
3476
|
+
$animated: s,
|
|
3472
3477
|
$backgroundColor: l
|
|
3473
3478
|
},
|
|
3474
|
-
/* @__PURE__ */ r.createElement(
|
|
3475
|
-
/* @__PURE__ */ r.createElement(
|
|
3479
|
+
/* @__PURE__ */ r.createElement(Kc, { $isOpened: t, $animated: s, $fillColor: d }, /* @__PURE__ */ r.createElement(un.Open, { url: i, isDefaultIcon: o === "default_icon" })),
|
|
3480
|
+
/* @__PURE__ */ r.createElement(Zc, { $isOpened: t, $animated: s, $fillColor: d }, /* @__PURE__ */ r.createElement(un.Close, null))
|
|
3476
3481
|
);
|
|
3477
3482
|
}
|
|
3478
|
-
const
|
|
3483
|
+
const Vc = k`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, Gc = k`img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-drag:none;&[data-default-icon='true']{width:32px;height:32px;filter:${({ $fillColor: e }) => e === kn.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, sr = k`svg{width:32px;height:32px;${({ $fillColor: e }) => k`
|
|
3479
3484
|
path {
|
|
3480
3485
|
fill: ${e};
|
|
3481
3486
|
}
|
|
@@ -3484,14 +3489,14 @@ const zc = k`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
3484
3489
|
}
|
|
3485
3490
|
`}
|
|
3486
3491
|
}
|
|
3487
|
-
`,
|
|
3488
|
-
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(
|
|
3492
|
+
`, jc = c.button`position:relative;padding:0;width:48px;height:48px;background:${({ $backgroundColor: e }) => e};border-radius:50%;transition:all 0.3s cubic-bezier(0.31,-0.105,0.43,1.4);border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 16px 24px 2px rgba(33,33,33,0.12),0 6px 30px 5px rgba(33,33,33,0.08),0 6px 10px -5px rgba(33,33,33,0.04);${({ $animated: e }) => e && Vc}`, ar = c.span`position:absolute;width:100%;height:100%;border-radius:50%;overflow:hidden;transition:transform 0.16s linear,opacity 0.08s linear,scale 0.16s linear;user-select:none;display:flex;justify-content:center;align-items:center;`, Kc = c(ar)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${Gc}${sr}`, Zc = c(ar)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${sr}`, un = {
|
|
3493
|
+
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(yt, null),
|
|
3489
3494
|
Close: () => /* @__PURE__ */ r.createElement($, { size: 32, type: "chevron-down" })
|
|
3490
3495
|
};
|
|
3491
|
-
function
|
|
3492
|
-
const { colors: t } =
|
|
3493
|
-
return
|
|
3494
|
-
|
|
3496
|
+
function lr({ className: e }) {
|
|
3497
|
+
const { colors: t } = mt(), { dir: n, state: o } = N(), { launcherInfo: i } = F();
|
|
3498
|
+
return qc(), /* @__PURE__ */ r.createElement(
|
|
3499
|
+
Wc,
|
|
3495
3500
|
{
|
|
3496
3501
|
dir: n,
|
|
3497
3502
|
className: e,
|
|
@@ -3503,46 +3508,46 @@ function ar({ className: e }) {
|
|
|
3503
3508
|
}
|
|
3504
3509
|
);
|
|
3505
3510
|
}
|
|
3506
|
-
const
|
|
3507
|
-
function
|
|
3511
|
+
const Yc = 1e3 * 60;
|
|
3512
|
+
function qc() {
|
|
3508
3513
|
const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: o } = N(), i = D(null);
|
|
3509
3514
|
R(() => {
|
|
3510
3515
|
if (!o) return;
|
|
3511
|
-
function
|
|
3516
|
+
function a() {
|
|
3512
3517
|
i.current && (clearTimeout(i.current), i.current = null);
|
|
3513
3518
|
}
|
|
3514
|
-
function
|
|
3515
|
-
e.connectionState ===
|
|
3519
|
+
function s() {
|
|
3520
|
+
e.connectionState === yr.CLOSED && (e.reconnect(), n.debug("useSDKInactivityTimeout: reconnected")), a(), n.debug("useSDKInactivityTimeout: clear disconnect schedule");
|
|
3516
3521
|
}
|
|
3517
3522
|
function l() {
|
|
3518
|
-
|
|
3523
|
+
a(), i.current = setTimeout(async () => {
|
|
3519
3524
|
await e.disconnectWebSocket(), n.debug("useSDKInactivityTimeout: disconnected");
|
|
3520
|
-
},
|
|
3525
|
+
}, Yc);
|
|
3521
3526
|
}
|
|
3522
|
-
t.opened ?
|
|
3527
|
+
t.opened ? s() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
|
|
3523
3528
|
}, [o, e, t.opened]);
|
|
3524
3529
|
}
|
|
3525
|
-
const
|
|
3526
|
-
function
|
|
3527
|
-
const e = J(
|
|
3530
|
+
const cr = ye(null);
|
|
3531
|
+
function Jc() {
|
|
3532
|
+
const e = J(cr);
|
|
3528
3533
|
if (!e)
|
|
3529
3534
|
throw new Error("useNavigator() must be used within <Navigator />");
|
|
3530
3535
|
return e;
|
|
3531
3536
|
}
|
|
3532
|
-
function
|
|
3533
|
-
const t =
|
|
3537
|
+
function dr({ children: e }) {
|
|
3538
|
+
const t = Jc();
|
|
3534
3539
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
|
|
3535
3540
|
}
|
|
3536
|
-
const
|
|
3541
|
+
const Xc = pn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, Qc = pn`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, ed = k`animation-name:${Xc};animation-duration:0.3s;animation-fill-mode:forwards;`, td = k``, nd = k`animation-name:${Qc};animation-duration:0.3s;animation-fill-mode:forwards;`, rd = k`visibility:hidden;`, od = c.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
3537
3542
|
switch (e) {
|
|
3538
3543
|
case "entering":
|
|
3539
|
-
return
|
|
3544
|
+
return ed;
|
|
3540
3545
|
case "entered":
|
|
3541
|
-
return
|
|
3546
|
+
return td;
|
|
3542
3547
|
case "exiting":
|
|
3543
|
-
return
|
|
3548
|
+
return nd;
|
|
3544
3549
|
case "exited":
|
|
3545
|
-
return
|
|
3550
|
+
return rd;
|
|
3546
3551
|
default:
|
|
3547
3552
|
return "";
|
|
3548
3553
|
}
|
|
@@ -3583,111 +3588,111 @@ function Ae({ initialId: e, children: t }) {
|
|
|
3583
3588
|
navigate: n,
|
|
3584
3589
|
pop: o
|
|
3585
3590
|
}
|
|
3586
|
-
}), [n, o]),
|
|
3587
|
-
(f) => f.type ===
|
|
3588
|
-
), [t]),
|
|
3591
|
+
}), [n, o]), a = Ie(() => hr.toArray(t).filter(
|
|
3592
|
+
(f) => f.type === dr
|
|
3593
|
+
), [t]), s = Ie(() => {
|
|
3589
3594
|
const f = {};
|
|
3590
|
-
return
|
|
3595
|
+
return a.forEach((y) => {
|
|
3591
3596
|
const { id: _, lazy: w, children: O } = y.props;
|
|
3592
3597
|
f[_] = { lazy: w, element: typeof O == "function" ? O(i) : O };
|
|
3593
3598
|
}), f;
|
|
3594
|
-
}, [
|
|
3599
|
+
}, [a]), [l, d] = T([e]), [g, m] = T(() => {
|
|
3595
3600
|
const f = {};
|
|
3596
|
-
return Object.entries(
|
|
3601
|
+
return Object.entries(s).forEach(([y, { lazy: _ }]) => {
|
|
3597
3602
|
_ === !1 && (f[y] = !0);
|
|
3598
3603
|
}), f[e] = !0, f;
|
|
3599
|
-
}), [p, h] =
|
|
3604
|
+
}), [p, h] = T(() => {
|
|
3600
3605
|
const f = {};
|
|
3601
|
-
return Object.keys(
|
|
3606
|
+
return Object.keys(s).forEach((y) => {
|
|
3602
3607
|
y === e ? f[y] = "entered" : f[y] = "exited";
|
|
3603
3608
|
}), f;
|
|
3604
|
-
}), [b, x] =
|
|
3605
|
-
return /* @__PURE__ */ r.createElement(
|
|
3609
|
+
}), [b, x] = T({}), v = l[l.length - 1];
|
|
3610
|
+
return /* @__PURE__ */ r.createElement(cr.Provider, { value: i }, /* @__PURE__ */ r.createElement(id, null, Object.keys(s).map((f) => {
|
|
3606
3611
|
var O;
|
|
3607
3612
|
if (!g[f]) return null;
|
|
3608
3613
|
const y = p[f] || "exited", _ = f === v, w = `${f}-${b[f] || 0}`;
|
|
3609
|
-
return /* @__PURE__ */ r.createElement(
|
|
3614
|
+
return /* @__PURE__ */ r.createElement(od, { key: w, $transitionState: y, $active: _ }, (O = s[f]) == null ? void 0 : O.element);
|
|
3610
3615
|
})));
|
|
3611
3616
|
}
|
|
3612
|
-
const
|
|
3613
|
-
Ae.Screen =
|
|
3617
|
+
const id = c.div`position:relative;width:100%;height:100%;`;
|
|
3618
|
+
Ae.Screen = dr;
|
|
3614
3619
|
const ue = {
|
|
3615
3620
|
activeConv: "active-conv",
|
|
3616
3621
|
closedConv: "closed-conv",
|
|
3617
3622
|
convList: "conv-list"
|
|
3618
|
-
},
|
|
3619
|
-
|
|
3623
|
+
}, ur = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(Ae, { initialId: ue.activeConv }, /* @__PURE__ */ r.createElement(Ae.Screen, { id: ue.activeConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(an, { onNavigateToConversationList: () => n.navigate(ue.convList, { reset: !0 }) })), /* @__PURE__ */ r.createElement(Ae.Screen, { id: ue.closedConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3624
|
+
an,
|
|
3620
3625
|
{
|
|
3621
3626
|
onNavigateToConversationList: () => n.pop(),
|
|
3622
3627
|
closedChannelUrl: t,
|
|
3623
3628
|
onClearClosedChannelUrl: () => e(void 0)
|
|
3624
3629
|
}
|
|
3625
3630
|
)), /* @__PURE__ */ r.createElement(Ae.Screen, { id: ue.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3626
|
-
|
|
3631
|
+
Mc,
|
|
3627
3632
|
{
|
|
3628
3633
|
onOpenConversationView: (o, i) => {
|
|
3629
3634
|
i === "closed" ? (e(o), n.navigate(ue.closedConv, { reset: !0 })) : n.navigate(ue.activeConv);
|
|
3630
3635
|
}
|
|
3631
3636
|
}
|
|
3632
3637
|
)));
|
|
3633
|
-
function
|
|
3638
|
+
function sd({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
|
|
3634
3639
|
const { dir: i } = N();
|
|
3635
|
-
return /* @__PURE__ */ r.createElement(
|
|
3640
|
+
return /* @__PURE__ */ r.createElement(ad, null, /* @__PURE__ */ r.createElement(ld, { dir: i, id: X.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
|
|
3636
3641
|
}
|
|
3637
|
-
const
|
|
3638
|
-
const n = Le(), [o, i] =
|
|
3639
|
-
return /* @__PURE__ */ r.createElement(
|
|
3640
|
-
|
|
3642
|
+
const ad = c.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, ld = c.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && dd};${({ $isExpanded: e }) => e && cd};`, cd = k`width:743px;height:723px;`, dd = k`z-index:${he.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, Ld = ({ children: e, ...t }) => {
|
|
3643
|
+
const n = Le(), [o, i] = T(), a = n ? ir : sd;
|
|
3644
|
+
return /* @__PURE__ */ r.createElement(or, { enableExpandButton: !n, ...t }, /* @__PURE__ */ r.createElement(Mn, null, ({ state: s }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(a, { isExpanded: s.expanded, isOpened: s.opened, launcher: /* @__PURE__ */ r.createElement(lr, null) }, /* @__PURE__ */ r.createElement(
|
|
3645
|
+
ur,
|
|
3641
3646
|
{
|
|
3642
3647
|
closedChannelUrl: o,
|
|
3643
3648
|
setClosedChannelUrl: i
|
|
3644
3649
|
}
|
|
3645
3650
|
)), e)));
|
|
3646
3651
|
};
|
|
3647
|
-
function
|
|
3648
|
-
return /* @__PURE__ */ r.createElement(
|
|
3652
|
+
function ud(e) {
|
|
3653
|
+
return /* @__PURE__ */ r.createElement(md, { ...e });
|
|
3649
3654
|
}
|
|
3650
|
-
const
|
|
3651
|
-
function
|
|
3655
|
+
const md = c(lr)`position:fixed;z-index:${he.LAUNCHER};bottom:24px;inset-inline-end:24px;`;
|
|
3656
|
+
function gd({ isExpanded: e, isOpened: t, children: n }) {
|
|
3652
3657
|
const { dir: o } = N();
|
|
3653
|
-
return /* @__PURE__ */ r.createElement(
|
|
3658
|
+
return /* @__PURE__ */ r.createElement(pd, { dir: o, id: X.WINDOW, $isExpanded: e, $isOpened: t }, n);
|
|
3654
3659
|
}
|
|
3655
|
-
const
|
|
3656
|
-
const n = Le(), [o, i] =
|
|
3657
|
-
return /* @__PURE__ */ r.createElement(
|
|
3658
|
-
|
|
3660
|
+
const pd = c.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;position:fixed;bottom:84px;inset-inline-end:20px;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && fd};${({ $isExpanded: e }) => e && hd};`, hd = k`width:743px;height:723px;`, fd = k`z-index:${he.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, Rd = ({ children: e, ...t }) => {
|
|
3661
|
+
const n = Le(), [o, i] = T(), a = n ? ir : gd;
|
|
3662
|
+
return /* @__PURE__ */ r.createElement(or, { enableExpandButton: !n, ...t }, /* @__PURE__ */ r.createElement(Mn, null, ({ state: s }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(a, { isExpanded: s.expanded, isOpened: s.opened }, /* @__PURE__ */ r.createElement(
|
|
3663
|
+
ur,
|
|
3659
3664
|
{
|
|
3660
3665
|
closedChannelUrl: o,
|
|
3661
3666
|
setClosedChannelUrl: i
|
|
3662
3667
|
}
|
|
3663
|
-
)), /* @__PURE__ */ r.createElement(
|
|
3668
|
+
)), /* @__PURE__ */ r.createElement(ud, null), e)));
|
|
3664
3669
|
};
|
|
3665
3670
|
export {
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3671
|
+
ft as A,
|
|
3672
|
+
Xr as C,
|
|
3673
|
+
Ld as D,
|
|
3674
|
+
Rd as F,
|
|
3670
3675
|
$ as I,
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
+
Un as L,
|
|
3677
|
+
Sa as M,
|
|
3678
|
+
_t as O,
|
|
3679
|
+
Od as P,
|
|
3680
|
+
St as S,
|
|
3676
3681
|
S as a,
|
|
3677
|
-
|
|
3682
|
+
or as b,
|
|
3678
3683
|
u as c,
|
|
3679
|
-
|
|
3684
|
+
Fc as d,
|
|
3680
3685
|
F as e,
|
|
3681
3686
|
M as f,
|
|
3682
|
-
|
|
3687
|
+
Wc as g,
|
|
3683
3688
|
ve as h,
|
|
3684
3689
|
me as i,
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3690
|
+
rr as j,
|
|
3691
|
+
an as k,
|
|
3692
|
+
It as l,
|
|
3693
|
+
Hc as m,
|
|
3694
|
+
Mc as n,
|
|
3695
|
+
$t as o,
|
|
3696
|
+
En as p,
|
|
3692
3697
|
N as u
|
|
3693
3698
|
};
|