@sendbird/ai-agent-messenger-react 1.3.0 → 1.3.2
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/BlshmoPb.cjs +207 -0
- package/dist/cjs/{8flIqihd.cjs → CuE-R-Ab.cjs} +1 -1
- package/dist/cjs/{BvXE2Myz.cjs → D0K6vsP-.cjs} +1 -1
- package/dist/cjs/{DMxlnbEy.cjs → D7p9IHLh.cjs} +1 -1
- package/dist/cjs/{BQqygmjw.cjs → Qn-Vab7D.cjs} +1 -1
- package/dist/cjs/{B3LqSSG5.cjs → udFozCQd.cjs} +1 -1
- package/dist/es/{ccfzGnJU.js → CVCUjr3Q.js} +1 -1
- package/dist/es/{4nxZMIz3.js → D5uRw0Em.js} +1 -1
- package/dist/es/{3qBdtnlJ.js → DcGmTG3A.js} +1215 -1194
- package/dist/es/{CorQ5vL_.js → DhUBPQ6o.js} +1 -1
- package/dist/es/{DNKomW8O.js → jtdZ66dz.js} +1 -1
- package/dist/es/{DFlRbX2F.js → kE3eGJ-O.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +32 -2
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/cjs/rl6FrW6Y.cjs +0 -207
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { createContext as ve, useContext as
|
|
3
|
-
import yr, {
|
|
4
|
-
import u, { css as I, ThemeProvider as
|
|
5
|
-
import { format as Cn, isSameMinute as zt, isSameDay as
|
|
6
|
-
import { enUS as
|
|
7
|
-
import { AIAgentModule as
|
|
8
|
-
import { useGroupChannelMessages as
|
|
9
|
-
import { GroupChannelModule as
|
|
10
|
-
import { renderer as
|
|
11
|
-
import { createMessageTemplate as
|
|
2
|
+
import { createContext as ve, useContext as Q, useEffect as L, useState as _, useId as bn, useRef as N, useCallback as R, useMemo as ae, forwardRef as ye, useImperativeHandle as Er, useLayoutEffect as le, lazy as T, Suspense as ke, Component as xr, Fragment as Ut, useReducer as Cr, Children as vr } from "react";
|
|
3
|
+
import yr, { SendbirdChatOptions as _r, SendbirdProduct as Sr, DeviceOsPlatform as Ht, SendbirdPlatform as Tr, ConnectionHandler as Je, SendbirdError as wr, SessionHandler as Ar, LogLevel as En, ConnectionState as kr } from "@sendbird/chat";
|
|
4
|
+
import u, { css as I, ThemeProvider as Ir, useTheme as xt, createGlobalStyle as $r, StyleSheetManager as Mr, keyframes as xn } from "styled-components";
|
|
5
|
+
import { format as Cn, isSameMinute as zt, isSameDay as Or } from "date-fns";
|
|
6
|
+
import { enUS as Lr } from "date-fns/locale/en-US";
|
|
7
|
+
import { AIAgentModule as Rr, ConversationStatus as W, ConversationType as Dr } from "@sendbird/chat/aiAgent";
|
|
8
|
+
import { useGroupChannelMessages as Nr, useGroupChannelHandler as Xe, useForceUpdate as Pr } from "@sendbird/uikit-tools";
|
|
9
|
+
import { GroupChannelModule as Br, GroupChannelListOrder as vn, GroupChannelHandler as Fr } from "@sendbird/chat/groupChannel";
|
|
10
|
+
import { renderer as Ur, parser as Hr, MessageProvider as zr } from "@sendbird/react-uikit-message-template-view";
|
|
11
|
+
import { createMessageTemplate as Vr } from "@sendbird/uikit-message-template";
|
|
12
12
|
import yn from "dompurify";
|
|
13
|
-
import { SendingStatus as dt, MessageMetaArray as
|
|
14
|
-
import { isSameDay as
|
|
15
|
-
import { createPortal as
|
|
16
|
-
import
|
|
13
|
+
import { SendingStatus as dt, MessageMetaArray as Wr } from "@sendbird/chat/message";
|
|
14
|
+
import { isSameDay as Gr } from "date-fns/isSameDay";
|
|
15
|
+
import { createPortal as jr } from "react-dom";
|
|
16
|
+
import Kr from "@emotion/is-prop-valid";
|
|
17
17
|
const G = (e, t) => {
|
|
18
|
-
const n = ve(null), o = ({ children:
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
18
|
+
const n = ve(null), o = ({ children: a, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof a == "function" ? a(l) : a), s = ({ children: a }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof a == "function" ? a(l) : a : null), i = () => {
|
|
19
|
+
const a = Q(n);
|
|
20
|
+
if (!a)
|
|
21
21
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
22
|
-
return
|
|
22
|
+
return a;
|
|
23
23
|
};
|
|
24
|
-
return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, s.displayName = `${e}Consumer`,
|
|
24
|
+
return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, s.displayName = `${e}Consumer`, i.displayName = `use${e}Context`, { Context: n, Provider: o, Consumer: s, useContext: i };
|
|
25
25
|
};
|
|
26
26
|
function _e(e) {
|
|
27
27
|
const t = ve({
|
|
@@ -32,47 +32,47 @@ function _e(e) {
|
|
|
32
32
|
updateComponent: () => {
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
function n({ children:
|
|
36
|
-
const [
|
|
37
|
-
Template:
|
|
38
|
-
updateTemplate: (
|
|
35
|
+
function n({ children: i }) {
|
|
36
|
+
const [a, l] = _(() => e.template), [c, d] = _(e.components), h = {
|
|
37
|
+
Template: a,
|
|
38
|
+
updateTemplate: (m) => l(() => m),
|
|
39
39
|
components: c,
|
|
40
|
-
updateComponent: (
|
|
40
|
+
updateComponent: (m, f) => d((x) => ({ ...x, [m]: f }))
|
|
41
41
|
};
|
|
42
|
-
return /* @__PURE__ */ r.createElement(t.Provider, { value:
|
|
42
|
+
return /* @__PURE__ */ r.createElement(t.Provider, { value: h }, i);
|
|
43
43
|
}
|
|
44
|
-
function o({ template:
|
|
45
|
-
const { updateTemplate: l } =
|
|
44
|
+
function o({ template: i, children: a }) {
|
|
45
|
+
const { updateTemplate: l } = Q(t);
|
|
46
46
|
return L(() => {
|
|
47
|
-
|
|
48
|
-
}, [
|
|
47
|
+
i && l(i);
|
|
48
|
+
}, [i]), /* @__PURE__ */ r.createElement(r.Fragment, null, a);
|
|
49
49
|
}
|
|
50
|
-
function s({ children:
|
|
51
|
-
return /* @__PURE__ */ r.createElement(n, null,
|
|
50
|
+
function s({ children: i }) {
|
|
51
|
+
return /* @__PURE__ */ r.createElement(n, null, i);
|
|
52
52
|
}
|
|
53
|
-
return s.defaults = e, s.useContext = () =>
|
|
54
|
-
s[
|
|
53
|
+
return s.defaults = e, s.useContext = () => Q(t), s.Context = t, s.Template = o, Object.keys(e.components).forEach((i) => {
|
|
54
|
+
s[i] = function({
|
|
55
55
|
component: l
|
|
56
56
|
}) {
|
|
57
|
-
const { updateComponent: c } =
|
|
57
|
+
const { updateComponent: c } = Q(t);
|
|
58
58
|
return L(() => {
|
|
59
|
-
l && c(
|
|
59
|
+
l && c(i, l);
|
|
60
60
|
}, [l]), null;
|
|
61
61
|
};
|
|
62
62
|
}), s;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Zr(...e) {
|
|
65
65
|
return function({ children: n }) {
|
|
66
66
|
return e.reduce((o, s) => /* @__PURE__ */ r.createElement(s, null, o), n);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
function ut() {
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Yr() {
|
|
72
72
|
const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
|
|
73
73
|
return e || t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function qr(e) {
|
|
76
76
|
let t = 0;
|
|
77
77
|
for (let n = 0; n < e.length; n++)
|
|
78
78
|
t = (t << 5) - t + e.charCodeAt(n), t |= 0;
|
|
@@ -104,15 +104,15 @@ const Vt = (e) => {
|
|
|
104
104
|
return ((t = e.extendedMessagePayload) == null ? void 0 : t.bot_message_type) === "generated";
|
|
105
105
|
},
|
|
106
106
|
checkExtendedFieldPresence(e) {
|
|
107
|
-
const t = e.extendedMessagePayload || {}, n = (
|
|
108
|
-
return { ui: o, trail: s, marking:
|
|
107
|
+
const t = e.extendedMessagePayload || {}, n = (a) => a.some((l) => typeof t[l] < "u"), o = n(ot.ui), s = n(ot.trail), i = n(ot.marking);
|
|
108
|
+
return { ui: o, trail: s, marking: i };
|
|
109
109
|
},
|
|
110
110
|
shouldScrollToBottom(e, t, n = !1) {
|
|
111
111
|
if ((e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage()) && e.sender.userId === t) {
|
|
112
112
|
if (this.isGeneratedMessage(e) && this.isStreaming(e))
|
|
113
113
|
return !0;
|
|
114
|
-
const { ui:
|
|
115
|
-
return
|
|
114
|
+
const { ui: i, trail: a, marking: l } = this.checkExtendedFieldPresence(e);
|
|
115
|
+
return i ? !(!n && l) : !!(n && (a || l));
|
|
116
116
|
}
|
|
117
117
|
return !0;
|
|
118
118
|
}
|
|
@@ -120,20 +120,20 @@ const Vt = (e) => {
|
|
|
120
120
|
ui: ["suggested_replies", "cta_button", "message_template", "csat"],
|
|
121
121
|
trail: ["groundedness", "manual", "function_calls"],
|
|
122
122
|
marking: ["is_hallucination", "is_moderated", "flagged_types"]
|
|
123
|
-
},
|
|
123
|
+
}, Jr = "1.3.2", Ee = "sb-agent", Xr = Jr, st = `@${Ee}`, Wt = ({ appId: e, aiAgentId: t, storage: n }) => {
|
|
124
124
|
const o = {
|
|
125
125
|
templateBase: `${st}-template`,
|
|
126
126
|
template: (s) => `${o.templateBase}/templates/${s}`,
|
|
127
127
|
templateToken: () => `${o.templateBase}-template/message-template/tokens`,
|
|
128
128
|
messengerSession: (s) => {
|
|
129
|
-
const
|
|
130
|
-
return `${st}-udata/${
|
|
129
|
+
const i = qr(`${e}/${t}/${s}`);
|
|
130
|
+
return `${st}-udata/${i}`;
|
|
131
131
|
},
|
|
132
132
|
anonUserSession: () => `${st}-session/${e}/${t}`
|
|
133
133
|
};
|
|
134
134
|
return {
|
|
135
135
|
template: {
|
|
136
|
-
set: (s,
|
|
136
|
+
set: (s, i) => n.set(o.template(s), i),
|
|
137
137
|
get: (s) => n.get(o.template(s)),
|
|
138
138
|
setCachedToken: (s) => n.set(o.templateToken(), s),
|
|
139
139
|
getCachedToken: () => n.get(o.templateToken()),
|
|
@@ -144,16 +144,16 @@ const Vt = (e) => {
|
|
|
144
144
|
messenger: {
|
|
145
145
|
getSettings: (s) => {
|
|
146
146
|
try {
|
|
147
|
-
const
|
|
148
|
-
return
|
|
147
|
+
const i = n.get(o.messengerSession(s));
|
|
148
|
+
return i ? JSON.parse(i) : null;
|
|
149
149
|
} catch {
|
|
150
150
|
return null;
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
|
-
setSettings: (s,
|
|
153
|
+
setSettings: (s, i) => {
|
|
154
154
|
try {
|
|
155
|
-
const
|
|
156
|
-
n.set(o.messengerSession(s),
|
|
155
|
+
const a = JSON.stringify(i);
|
|
156
|
+
n.set(o.messengerSession(s), a);
|
|
157
157
|
} catch {
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
@@ -168,8 +168,8 @@ const Vt = (e) => {
|
|
|
168
168
|
},
|
|
169
169
|
setAnonUser: (s) => {
|
|
170
170
|
try {
|
|
171
|
-
const
|
|
172
|
-
n.set(o.anonUserSession(),
|
|
171
|
+
const i = JSON.stringify(s);
|
|
172
|
+
n.set(o.anonUserSession(), i);
|
|
173
173
|
} catch {
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
@@ -189,12 +189,12 @@ class _n {
|
|
|
189
189
|
this.logger = t, this.subscribers = {};
|
|
190
190
|
}
|
|
191
191
|
async send(t) {
|
|
192
|
-
const n =
|
|
192
|
+
const n = Qr(), o = this.subscribers[t.type];
|
|
193
193
|
if (o) {
|
|
194
194
|
this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`, t.payload);
|
|
195
|
-
const s = o.map((
|
|
196
|
-
await Promise.all(s).catch((
|
|
197
|
-
this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`,
|
|
195
|
+
const s = o.map((i) => i(t.payload));
|
|
196
|
+
await Promise.all(s).catch((i) => {
|
|
197
|
+
this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`, i);
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
return n.resolve(), n.promise;
|
|
@@ -206,7 +206,7 @@ class _n {
|
|
|
206
206
|
this.subscribers[t] && (this.subscribers[t] = this.subscribers[t].filter((o) => o !== n));
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
const
|
|
209
|
+
const Qr = () => {
|
|
210
210
|
let e = ut, t = ut;
|
|
211
211
|
return { promise: new Promise((o, s) => {
|
|
212
212
|
e = o, t = s;
|
|
@@ -236,76 +236,80 @@ class Tn {
|
|
|
236
236
|
function Gt(e, t, n) {
|
|
237
237
|
const o = yr.init({
|
|
238
238
|
appId: e,
|
|
239
|
-
modules: [new
|
|
239
|
+
modules: [new Br(), new Rr()],
|
|
240
240
|
localCacheEnabled: !0,
|
|
241
|
+
options: new _r({ typingIndicatorInvalidateTime: 3e4 }),
|
|
241
242
|
...n
|
|
242
243
|
});
|
|
243
244
|
return o.addSendbirdExtensions(
|
|
244
|
-
[{ version:
|
|
245
|
+
[{ version: Xr, product: Sr.AI_AGENT, platform: t.platform }],
|
|
245
246
|
{ platform: t.deviceOSPlatform, version: t.deviceOSVersion },
|
|
246
247
|
t.customData
|
|
247
248
|
) || console.warn("Invalid Sendbird Extensions", t), o;
|
|
248
249
|
}
|
|
249
250
|
const {
|
|
250
|
-
Provider:
|
|
251
|
+
Provider: eo,
|
|
251
252
|
useContext: ue
|
|
252
253
|
} = G("AIAgent");
|
|
253
|
-
function
|
|
254
|
+
function to({
|
|
254
255
|
appId: e,
|
|
255
256
|
aiAgentId: t,
|
|
256
257
|
keyValueStorage: n,
|
|
257
258
|
language: o,
|
|
258
259
|
countryCode: s,
|
|
259
|
-
context:
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
260
|
+
context: i,
|
|
261
|
+
queryParams: a,
|
|
262
|
+
chatSDK: l,
|
|
263
|
+
chatParams: c,
|
|
264
|
+
children: d,
|
|
265
|
+
logger: h,
|
|
266
|
+
dispatcher: m,
|
|
267
|
+
extensions: f = {
|
|
268
|
+
platform: Tr.JS,
|
|
269
|
+
deviceOSPlatform: Yr() ? Ht.MOBILE_WEB : Ht.WEB
|
|
268
270
|
}
|
|
269
271
|
}) {
|
|
270
|
-
const [
|
|
271
|
-
const b =
|
|
272
|
+
const [x, E] = _(() => {
|
|
273
|
+
const b = h ?? new Tn(Sn.WARN), g = m ?? new _n(b);
|
|
272
274
|
return {
|
|
273
275
|
appId: e,
|
|
274
276
|
aiAgentId: t,
|
|
275
277
|
language: o,
|
|
276
278
|
countryCode: s,
|
|
277
|
-
context:
|
|
279
|
+
context: i,
|
|
280
|
+
queryParams: a,
|
|
278
281
|
keyValueStorage: n,
|
|
279
282
|
logger: b,
|
|
280
|
-
dispatcher:
|
|
281
|
-
chatSDK:
|
|
283
|
+
dispatcher: g,
|
|
284
|
+
chatSDK: l ?? Gt(e, f, c),
|
|
282
285
|
cache: Wt({ appId: e, aiAgentId: t, storage: n })
|
|
283
286
|
};
|
|
284
287
|
});
|
|
285
288
|
return L(() => {
|
|
286
|
-
|
|
287
|
-
let
|
|
288
|
-
return
|
|
289
|
+
E((b) => {
|
|
290
|
+
let g = b.logger, C = b.dispatcher, v = b.chatSDK;
|
|
291
|
+
return h && h !== b.logger && (g = h), m && m !== b.dispatcher && (C = m), l && l !== b.chatSDK ? v = l : !l && b.chatSDK.appId !== e && (v = Gt(e, f, { newInstance: !0, ...c })), {
|
|
289
292
|
...b,
|
|
290
293
|
appId: e,
|
|
291
294
|
aiAgentId: t,
|
|
292
295
|
keyValueStorage: n,
|
|
293
296
|
language: o,
|
|
294
297
|
countryCode: s,
|
|
295
|
-
context:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
298
|
+
context: i,
|
|
299
|
+
queryParams: a,
|
|
300
|
+
logger: g,
|
|
301
|
+
dispatcher: C,
|
|
302
|
+
chatSDK: v,
|
|
299
303
|
cache: Wt({ appId: e, aiAgentId: t, storage: n })
|
|
300
304
|
};
|
|
301
305
|
});
|
|
302
|
-
}, [e, t, o, s,
|
|
303
|
-
|
|
304
|
-
}, [
|
|
306
|
+
}, [e, t, o, s, i, h, m, l]), L(() => () => {
|
|
307
|
+
x.chatSDK.disconnectWebSocket();
|
|
308
|
+
}, [x.chatSDK]), /* @__PURE__ */ r.createElement(eo, { value: x }, d);
|
|
305
309
|
}
|
|
306
|
-
const
|
|
310
|
+
const no = (e, t, n) => Nr(e, t, { ...n, strictStreamingOrder: !0 });
|
|
307
311
|
var mt = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(mt || {});
|
|
308
|
-
class
|
|
312
|
+
class ro {
|
|
309
313
|
constructor(t = {}) {
|
|
310
314
|
this.payload = t;
|
|
311
315
|
}
|
|
@@ -313,29 +317,29 @@ class no {
|
|
|
313
317
|
return JSON.stringify({ type: this.type, payload: this.payload });
|
|
314
318
|
}
|
|
315
319
|
}
|
|
316
|
-
const
|
|
317
|
-
CloseConversation: (e) => new
|
|
320
|
+
const oo = {
|
|
321
|
+
CloseConversation: (e) => new so(e)
|
|
318
322
|
};
|
|
319
|
-
class
|
|
323
|
+
class so extends ro {
|
|
320
324
|
constructor() {
|
|
321
325
|
super(...arguments), this.type = "conv.close";
|
|
322
326
|
}
|
|
323
327
|
}
|
|
324
328
|
const {
|
|
325
|
-
Provider:
|
|
329
|
+
Provider: io
|
|
326
330
|
} = G("AIAgentConversation");
|
|
327
|
-
function
|
|
331
|
+
function ao({
|
|
328
332
|
children: e,
|
|
329
333
|
channelUrl: t,
|
|
330
334
|
onChannelDeleted: n,
|
|
331
335
|
onMessagesReceived: o,
|
|
332
336
|
onMessagesUpdated: s,
|
|
333
|
-
onConversationClosedViaDispatcher:
|
|
334
|
-
onBeforeSendMessage:
|
|
337
|
+
onConversationClosedViaDispatcher: i,
|
|
338
|
+
onBeforeSendMessage: a,
|
|
335
339
|
onAfterSendMessage: l = ut
|
|
336
340
|
}) {
|
|
337
|
-
var
|
|
338
|
-
const { chatSDK: c, logger: d, dispatcher:
|
|
341
|
+
var g;
|
|
342
|
+
const { chatSDK: c, logger: d, dispatcher: h } = ue(), { channel: m, channelFetchError: f, fetchChannel: x } = lo(t), E = no(c, m, {
|
|
339
343
|
shouldCountNewMessages: () => !1,
|
|
340
344
|
onChannelDeleted: n,
|
|
341
345
|
onMessagesReceived: (C) => o == null ? void 0 : o(C),
|
|
@@ -345,48 +349,48 @@ function io({
|
|
|
345
349
|
L(() => {
|
|
346
350
|
const C = async (v) => {
|
|
347
351
|
const S = typeof (v == null ? void 0 : v.channelUrl) == "string";
|
|
348
|
-
|
|
352
|
+
m && S && v.channelUrl !== m.url || (d.debug("conversation.dispatcher: try to close conversation", m), m != null && m.conversation && m.conversation.status === W.OPEN && (await m.closeConversation(), i == null || i()));
|
|
349
353
|
};
|
|
350
|
-
return
|
|
351
|
-
|
|
354
|
+
return h.subscribe(mt.ConversationClose, C), () => {
|
|
355
|
+
h.unsubscribe(mt.ConversationClose, C);
|
|
352
356
|
};
|
|
353
|
-
}, [
|
|
354
|
-
const
|
|
355
|
-
conversation: (
|
|
357
|
+
}, [h, (g = m == null ? void 0 : m.conversation) == null ? void 0 : g.status, i]);
|
|
358
|
+
const b = {
|
|
359
|
+
conversation: (m == null ? void 0 : m.conversation) ?? void 0,
|
|
356
360
|
channelSource: {
|
|
357
|
-
channel:
|
|
361
|
+
channel: m,
|
|
358
362
|
error: f,
|
|
359
363
|
refetch: () => x()
|
|
360
364
|
},
|
|
361
365
|
messageSource: {
|
|
362
|
-
messages:
|
|
363
|
-
initialized:
|
|
364
|
-
loadPrevious: () =>
|
|
365
|
-
loadNext: () =>
|
|
366
|
+
messages: E.messages,
|
|
367
|
+
initialized: E.initialized,
|
|
368
|
+
loadPrevious: () => E.loadPrevious(),
|
|
369
|
+
loadNext: () => E.loadNext(),
|
|
366
370
|
sendUserMessage: async (C) => {
|
|
367
371
|
var S;
|
|
368
|
-
if (((S =
|
|
372
|
+
if (((S = m == null ? void 0 : m.conversation) == null ? void 0 : S.status) === W.CLOSED)
|
|
369
373
|
throw new Error("Conversation is closed");
|
|
370
|
-
|
|
371
|
-
const v = await
|
|
374
|
+
a && (C = await a(C));
|
|
375
|
+
const v = await E.sendUserMessage(C, l);
|
|
372
376
|
return l == null || l(v), v;
|
|
373
377
|
},
|
|
374
378
|
sendFileMessage: async (C) => {
|
|
375
379
|
var S;
|
|
376
|
-
if (((S =
|
|
380
|
+
if (((S = m == null ? void 0 : m.conversation) == null ? void 0 : S.status) === W.CLOSED)
|
|
377
381
|
throw new Error("Conversation is closed");
|
|
378
|
-
|
|
379
|
-
const v = await
|
|
382
|
+
a && (C = await a(C));
|
|
383
|
+
const v = await E.sendFileMessage(C, l);
|
|
380
384
|
return l == null || l(v), v;
|
|
381
385
|
}
|
|
382
386
|
}
|
|
383
387
|
};
|
|
384
|
-
return /* @__PURE__ */ r.createElement(
|
|
388
|
+
return /* @__PURE__ */ r.createElement(io, { value: b }, e);
|
|
385
389
|
}
|
|
386
|
-
function
|
|
387
|
-
const { chatSDK: t, logger: n } = ue(), [o, s] = _(void 0), [
|
|
390
|
+
function lo(e) {
|
|
391
|
+
const { chatSDK: t, logger: n } = ue(), [o, s] = _(void 0), [i, a] = _(void 0);
|
|
388
392
|
async function l() {
|
|
389
|
-
if (n.debug("conversation.fetchChannel: start"), s(void 0),
|
|
393
|
+
if (n.debug("conversation.fetchChannel: start"), s(void 0), a(void 0), e)
|
|
390
394
|
try {
|
|
391
395
|
n.debug("conversation.fetchChannel: get channel", e);
|
|
392
396
|
const c = await t.groupChannel.getChannel(e);
|
|
@@ -394,33 +398,33 @@ function ao(e) {
|
|
|
394
398
|
const d = new Je({ onReconnectSucceeded: () => c.refresh() });
|
|
395
399
|
t.addConnectionHandler(`sba-refresh-${e}`, d), n.debug("conversation.fetchChannel: fetched channel", c);
|
|
396
400
|
} catch (c) {
|
|
397
|
-
c instanceof
|
|
401
|
+
c instanceof wr && a(c), n.error("conversation.fetchChannel: error", c);
|
|
398
402
|
}
|
|
399
403
|
}
|
|
400
404
|
return L(() => {
|
|
401
405
|
l();
|
|
402
406
|
}, [e, t]), {
|
|
403
407
|
channel: o,
|
|
404
|
-
channelFetchError:
|
|
408
|
+
channelFetchError: i,
|
|
405
409
|
fetchChannel: l
|
|
406
410
|
};
|
|
407
411
|
}
|
|
408
|
-
class
|
|
412
|
+
class co {
|
|
409
413
|
/**
|
|
410
414
|
* Creates a new ConversationListCollection instance.
|
|
411
415
|
* @param sdk - The Sendbird Chat SDK instance
|
|
412
416
|
* @param params - Configuration parameters for the collection
|
|
413
417
|
*/
|
|
414
418
|
constructor(t, { filter: n, limit: o = 20 }) {
|
|
415
|
-
var s,
|
|
419
|
+
var s, i, a, l, c;
|
|
416
420
|
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order = vn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
|
|
417
421
|
aiAgentChannelFilter: (s = this.filter) == null ? void 0 : s.aiAgentChannelFilter,
|
|
418
|
-
aiAgentConversationStatusFilter: (
|
|
419
|
-
aiAgentIds: (
|
|
422
|
+
aiAgentConversationStatusFilter: (i = this.filter) == null ? void 0 : i.aiAgentConversationStatusFilter,
|
|
423
|
+
aiAgentIds: (a = this.filter) == null ? void 0 : a.aiAgentIds,
|
|
420
424
|
deskChannelFilter: (l = this.filter) == null ? void 0 : l.deskChannelFilter,
|
|
421
425
|
pinnedChannelUrls: (c = this.filter) == null ? void 0 : c.pinnedChannelUrls,
|
|
422
426
|
limit: this._limit
|
|
423
|
-
}), this._token = "", this._timestamp = Number.MAX_SAFE_INTEGER, this._isSyncing = !1, this._channelHandler = new
|
|
427
|
+
}), this._token = "", this._timestamp = Number.MAX_SAFE_INTEGER, this._isSyncing = !1, this._channelHandler = new Fr({
|
|
424
428
|
onChannelChanged: (d) => {
|
|
425
429
|
d.isGroupChannel() && (this._query.belongsTo(d) ? this._addChannelsToView([d], !1) : this._removeChannelsFromView([d.url]));
|
|
426
430
|
},
|
|
@@ -444,10 +448,10 @@ class lo {
|
|
|
444
448
|
* @param channels - Array of channels to analyze
|
|
445
449
|
*/
|
|
446
450
|
_setDefaultChangelogsSyncTimestamp(t) {
|
|
447
|
-
var
|
|
448
|
-
const n = new Set(((
|
|
451
|
+
var i, a;
|
|
452
|
+
const n = new Set(((i = this.filter) == null ? void 0 : i.pinnedChannelUrls) ?? []), o = t.find((l) => !n.has(l.url));
|
|
449
453
|
let s;
|
|
450
|
-
o ? s = ((
|
|
454
|
+
o ? s = ((a = o.lastMessage) == null ? void 0 : a.createdAt) ?? o.createdAt : s = this._query.lastResponseAt, this._timestamp > s && (this._timestamp = s);
|
|
451
455
|
}
|
|
452
456
|
/**
|
|
453
457
|
* Synchronizes channel changelogs to keep the collection up-to-date.
|
|
@@ -474,20 +478,20 @@ class lo {
|
|
|
474
478
|
*/
|
|
475
479
|
_upsertPinnedChannelsToArray(t) {
|
|
476
480
|
var l;
|
|
477
|
-
const n = ((l = this.filter) == null ? void 0 : l.pinnedChannelUrls) ?? [], o = new Map(n.map((c, d) => [c, d])), s = [],
|
|
481
|
+
const n = ((l = this.filter) == null ? void 0 : l.pinnedChannelUrls) ?? [], o = new Map(n.map((c, d) => [c, d])), s = [], i = [], a = [];
|
|
478
482
|
for (const c of t) {
|
|
479
483
|
if (!this._query.belongsTo(c)) {
|
|
480
|
-
|
|
484
|
+
a.push(c.url);
|
|
481
485
|
continue;
|
|
482
486
|
}
|
|
483
487
|
const d = o.get(c.url);
|
|
484
488
|
if (d === void 0) continue;
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
const f = this._pinnedChannels.findIndex((
|
|
489
|
+
const h = gt(this._pinnedChannels, c);
|
|
490
|
+
h >= 0 ? (this._pinnedChannels.splice(h, 1), i.push(c)) : s.push(c);
|
|
491
|
+
const f = this._pinnedChannels.findIndex((E) => (o.get(E.url) ?? 1 / 0) > d), x = f === -1 ? this._pinnedChannels.length : f;
|
|
488
492
|
this._pinnedChannels.splice(x, 0, c);
|
|
489
493
|
}
|
|
490
|
-
return { addedChannels: s, updatedChannels:
|
|
494
|
+
return { addedChannels: s, updatedChannels: i, unmatchedChannelUrls: a };
|
|
491
495
|
}
|
|
492
496
|
/**
|
|
493
497
|
* Upserts regular (non-pinned) channels with time-based sorting.
|
|
@@ -496,18 +500,18 @@ class lo {
|
|
|
496
500
|
* @returns Object containing added, updated channels and unmatched URLs
|
|
497
501
|
*/
|
|
498
502
|
_upsertRegularChannelsToArray(t, n = !1) {
|
|
499
|
-
const o = [], s = [],
|
|
500
|
-
for (const
|
|
501
|
-
if (!this._query.belongsTo(
|
|
502
|
-
o.push(
|
|
503
|
+
const o = [], s = [], i = [];
|
|
504
|
+
for (const a of t) {
|
|
505
|
+
if (!this._query.belongsTo(a)) {
|
|
506
|
+
o.push(a.url);
|
|
503
507
|
continue;
|
|
504
508
|
}
|
|
505
|
-
const l = gt(this._channels,
|
|
509
|
+
const l = gt(this._channels, a), c = l < 0;
|
|
506
510
|
!c && this._channels.splice(l, 1);
|
|
507
|
-
const
|
|
508
|
-
c ?
|
|
511
|
+
const h = uo(this._channels, a, this._order).place, m = h === this._channels.length;
|
|
512
|
+
c ? m ? (n || !this.hasMore) && (this._channels.push(a), s.push(a)) : (this._channels.splice(h, 0, a), s.push(a)) : (this._channels.splice(h, 0, a), i.push(a));
|
|
509
513
|
}
|
|
510
|
-
return { addedChannels: s, updatedChannels:
|
|
514
|
+
return { addedChannels: s, updatedChannels: i, unmatchedChannelUrls: o };
|
|
511
515
|
}
|
|
512
516
|
/**
|
|
513
517
|
* Adds or updates channels in the collection, separating pinned and non-pinned channels.
|
|
@@ -515,19 +519,19 @@ class lo {
|
|
|
515
519
|
* @param forceAppend - Whether to force append channels at the end
|
|
516
520
|
*/
|
|
517
521
|
_addChannelsToView(t, n = !1) {
|
|
518
|
-
var
|
|
519
|
-
const o = new Set(((
|
|
520
|
-
for (const
|
|
521
|
-
o.has(
|
|
522
|
-
const
|
|
523
|
-
c.length > 0 && ((x = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsAdded) == null || x.call(f, {}, c)), d.length > 0 && ((
|
|
522
|
+
var m, f, x, E, b;
|
|
523
|
+
const o = new Set(((m = this.filter) == null ? void 0 : m.pinnedChannelUrls) ?? []), s = [], i = [];
|
|
524
|
+
for (const g of t)
|
|
525
|
+
o.has(g.url) ? s.push(g) : i.push(g);
|
|
526
|
+
const a = this._upsertPinnedChannelsToArray(s), l = this._upsertRegularChannelsToArray(i, n), c = a.addedChannels.concat(l.addedChannels), d = a.updatedChannels.concat(l.updatedChannels), h = a.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);
|
|
527
|
+
c.length > 0 && ((x = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsAdded) == null || x.call(f, {}, c)), d.length > 0 && ((b = (E = this._collectionEventHandler) == null ? void 0 : E.onChannelsUpdated) == null || b.call(E, {}, d)), h.length > 0 && this._removeChannelsFromView(h);
|
|
524
528
|
}
|
|
525
529
|
/**
|
|
526
530
|
* Removes channels from the collection by their URLs.
|
|
527
531
|
* @param channelUrls - Array of channel URLs to remove
|
|
528
532
|
*/
|
|
529
533
|
_removeChannelsFromView(t) {
|
|
530
|
-
var s,
|
|
534
|
+
var s, i, a;
|
|
531
535
|
const n = new Set(((s = this.filter) == null ? void 0 : s.pinnedChannelUrls) ?? []), o = [];
|
|
532
536
|
for (const l of t)
|
|
533
537
|
if (n.has(l)) {
|
|
@@ -537,7 +541,7 @@ class lo {
|
|
|
537
541
|
const c = this._channels.findIndex((d) => d.url === l);
|
|
538
542
|
c >= 0 && (o.push(l), this._channels.splice(c, 1));
|
|
539
543
|
}
|
|
540
|
-
o.length > 0 && ((
|
|
544
|
+
o.length > 0 && ((a = (i = this._collectionEventHandler) == null ? void 0 : i.onChannelsDeleted) == null || a.call(i, {}, o));
|
|
541
545
|
}
|
|
542
546
|
/**
|
|
543
547
|
* Gets all channels in the collection.
|
|
@@ -581,20 +585,20 @@ class lo {
|
|
|
581
585
|
this._isDisposed || (this._isDisposed = !0, this._collectionEventHandler = void 0, this._sdk.removeConnectionHandler(this._handlerId), this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId), this._pinnedChannels.length = 0, this._channels.length = 0);
|
|
582
586
|
}
|
|
583
587
|
}
|
|
584
|
-
const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)),
|
|
588
|
+
const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), uo = (e, t, n) => {
|
|
585
589
|
if (e.length > 0) {
|
|
586
590
|
const o = gt(e, t);
|
|
587
|
-
let s = 0,
|
|
588
|
-
for (; s <
|
|
589
|
-
const c = jt(e[
|
|
591
|
+
let s = 0, i = e.length - 1, a = Math.floor((s + i) / 2);
|
|
592
|
+
for (; s < i; ) {
|
|
593
|
+
const c = jt(e[a], t, n);
|
|
590
594
|
if (c > 0)
|
|
591
|
-
|
|
595
|
+
i = a, a = Math.floor((s + i) / 2);
|
|
592
596
|
else if (c < 0)
|
|
593
|
-
s =
|
|
597
|
+
s = a + 1, a = Math.floor((s + i) / 2);
|
|
594
598
|
else
|
|
595
|
-
return { place:
|
|
599
|
+
return { place: a, oldPosition: o };
|
|
596
600
|
}
|
|
597
|
-
return { place: jt(e[
|
|
601
|
+
return { place: jt(e[a], t, n) >= 0 ? a : a + 1, oldPosition: o };
|
|
598
602
|
}
|
|
599
603
|
return { place: e.length, oldPosition: -1 };
|
|
600
604
|
}, jt = (e, t, n) => {
|
|
@@ -608,14 +612,14 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), co = (e, t, n) => {
|
|
|
608
612
|
return 0;
|
|
609
613
|
}
|
|
610
614
|
};
|
|
611
|
-
function
|
|
612
|
-
var
|
|
613
|
-
const n = bn(), [o, s] = _(!1), [
|
|
614
|
-
if (!
|
|
615
|
-
|
|
615
|
+
function mo(e, t) {
|
|
616
|
+
var E, b, g, C, v, S, k, F;
|
|
617
|
+
const n = bn(), [o, s] = _(!1), [i, a] = _(null), [l, c] = _([]), [d, h] = _(null), m = N(!1), f = R(async () => {
|
|
618
|
+
if (!m.current && e.currentUser) {
|
|
619
|
+
m.current = !0, s(!1), a(null), c([]);
|
|
616
620
|
try {
|
|
617
621
|
d == null || d.dispose();
|
|
618
|
-
const $ = new
|
|
622
|
+
const $ = new co(e, t);
|
|
619
623
|
$.setConversationListCollectionHandler({
|
|
620
624
|
onChannelsAdded: () => {
|
|
621
625
|
c($.channels);
|
|
@@ -626,17 +630,17 @@ function uo(e, t) {
|
|
|
626
630
|
onChannelsDeleted: () => {
|
|
627
631
|
c($.channels);
|
|
628
632
|
}
|
|
629
|
-
}), await $.loadMore(),
|
|
633
|
+
}), await $.loadMore(), h($), a(null);
|
|
630
634
|
} catch ($) {
|
|
631
|
-
|
|
635
|
+
h(null), a($);
|
|
632
636
|
} finally {
|
|
633
|
-
s(!0),
|
|
637
|
+
s(!0), m.current = !1;
|
|
634
638
|
}
|
|
635
639
|
}
|
|
636
640
|
}, [
|
|
637
641
|
e,
|
|
638
|
-
(
|
|
639
|
-
(
|
|
642
|
+
(E = t.filter) == null ? void 0 : E.aiAgentChannelFilter,
|
|
643
|
+
(g = (b = t.filter) == null ? void 0 : b.aiAgentConversationStatusFilter) == null ? void 0 : g.join(),
|
|
640
644
|
(v = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : v.join(),
|
|
641
645
|
(S = t.filter) == null ? void 0 : S.deskChannelFilter,
|
|
642
646
|
(F = (k = t.filter) == null ? void 0 : k.pinnedChannelUrls) == null ? void 0 : F.join(),
|
|
@@ -646,39 +650,42 @@ function uo(e, t) {
|
|
|
646
650
|
try {
|
|
647
651
|
await d.loadMore();
|
|
648
652
|
} catch ($) {
|
|
649
|
-
|
|
653
|
+
a($);
|
|
650
654
|
}
|
|
651
655
|
}, [d]);
|
|
652
656
|
return L(() => (e.addConnectionHandler(n, new Je({ onConnected: () => f() })), () => e.removeConnectionHandler(n)), [e, n, f]), L(() => {
|
|
653
657
|
f();
|
|
654
658
|
}, [f]), L(() => () => {
|
|
655
|
-
|
|
659
|
+
m.current = !1, d == null || d.dispose();
|
|
656
660
|
}, [d]), {
|
|
657
661
|
initialized: o,
|
|
658
|
-
error:
|
|
662
|
+
error: i,
|
|
659
663
|
channels: l,
|
|
660
664
|
loadMore: x
|
|
661
665
|
};
|
|
662
666
|
}
|
|
663
667
|
const {
|
|
664
|
-
Provider:
|
|
668
|
+
Provider: go
|
|
665
669
|
} = G("AIAgentConversationList");
|
|
666
|
-
function
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
670
|
+
function ho({
|
|
671
|
+
conversationListLimit: e,
|
|
672
|
+
conversationListFilter: t,
|
|
673
|
+
children: n
|
|
674
|
+
}) {
|
|
675
|
+
var m, f;
|
|
676
|
+
const { chatSDK: o, aiAgentId: s, queryParams: i } = ue(), a = { aiAgentIds: [s], aiAgentConversationStatusFilter: [W.CLOSED] }, l = e ?? ((m = i == null ? void 0 : i.conversationListParams) == null ? void 0 : m.limit), c = {
|
|
677
|
+
...a,
|
|
678
|
+
...(f = i == null ? void 0 : i.conversationListParams) == null ? void 0 : f.filter,
|
|
679
|
+
...t
|
|
680
|
+
}, d = mo(o, { limit: l, filter: c }), h = {
|
|
674
681
|
listSource: {
|
|
675
|
-
initialized:
|
|
676
|
-
error:
|
|
677
|
-
channels:
|
|
678
|
-
loadMore: () =>
|
|
682
|
+
initialized: d.initialized,
|
|
683
|
+
error: d.error ?? void 0,
|
|
684
|
+
channels: d.channels,
|
|
685
|
+
loadMore: () => d.loadMore()
|
|
679
686
|
}
|
|
680
687
|
};
|
|
681
|
-
return /* @__PURE__ */ r.createElement(
|
|
688
|
+
return /* @__PURE__ */ r.createElement(go, { value: h }, n);
|
|
682
689
|
}
|
|
683
690
|
const ht = {
|
|
684
691
|
DEFAULT_BOT_MSG_BG: "#eeeeee",
|
|
@@ -688,7 +695,7 @@ const ht = {
|
|
|
688
695
|
function wn(e) {
|
|
689
696
|
return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
|
|
690
697
|
}
|
|
691
|
-
function
|
|
698
|
+
function po(e) {
|
|
692
699
|
const t = wn(e);
|
|
693
700
|
return [
|
|
694
701
|
parseInt(t.slice(1, 3), 16),
|
|
@@ -699,33 +706,33 @@ function ho(e) {
|
|
|
699
706
|
// b
|
|
700
707
|
];
|
|
701
708
|
}
|
|
702
|
-
function
|
|
709
|
+
function fo(e) {
|
|
703
710
|
return `#${e.map((t) => t.toString(16).padStart(2, "0")).join("")}`;
|
|
704
711
|
}
|
|
705
|
-
function
|
|
712
|
+
function bo(e, t, n) {
|
|
706
713
|
e /= 255, t /= 255, n /= 255;
|
|
707
|
-
const o = Math.max(e, t, n), s = Math.min(e, t, n),
|
|
708
|
-
let
|
|
714
|
+
const o = Math.max(e, t, n), s = Math.min(e, t, n), i = o - s;
|
|
715
|
+
let a = 0, l = 0;
|
|
709
716
|
const c = (o + s) / 2;
|
|
710
|
-
return o !== s && (l = c > 0.5 ?
|
|
717
|
+
return o !== s && (l = c > 0.5 ? i / (2 - o - s) : i / (o + s)), o === e ? a = (t - n) / i + (t < n ? 6 : 0) : o === t ? a = (n - e) / i + 2 : o === n && (a = (e - t) / i + 4), a /= 6, [a, l, c];
|
|
711
718
|
}
|
|
712
|
-
function
|
|
713
|
-
let o, s,
|
|
719
|
+
function Eo(e, t, n) {
|
|
720
|
+
let o, s, i;
|
|
714
721
|
if (t === 0)
|
|
715
|
-
o = s =
|
|
722
|
+
o = s = i = n;
|
|
716
723
|
else {
|
|
717
|
-
const
|
|
718
|
-
return f < 0 && (f += 1), f > 1 && (f -= 1), f < 0.16666666666666666 ?
|
|
724
|
+
const a = function(h, m, f) {
|
|
725
|
+
return f < 0 && (f += 1), f > 1 && (f -= 1), f < 0.16666666666666666 ? h + (m - h) * 6 * f : f < 0.5 ? m : f < 0.6666666666666666 ? h + (m - h) * (0.6666666666666666 - f) * 6 : h;
|
|
719
726
|
}, l = n < 0.5 ? n * (1 + t) : n + t - n * t, c = 2 * n - l;
|
|
720
|
-
o =
|
|
727
|
+
o = a(c, l, e + 1 / 3), s = a(c, l, e), i = a(c, l, e - 1 / 3);
|
|
721
728
|
}
|
|
722
|
-
return [Math.round(o * 255), Math.round(s * 255), Math.round(
|
|
729
|
+
return [Math.round(o * 255), Math.round(s * 255), Math.round(i * 255)];
|
|
723
730
|
}
|
|
724
731
|
function Be(e, t, n) {
|
|
725
|
-
const [o, s,
|
|
726
|
-
return
|
|
732
|
+
const [o, s, i] = po(e), [a, l, c] = bo(o, s, i), d = Math.max(0, Math.min(1, c * t)), h = Math.max(0, Math.min(1, l * n)), [m, f, x] = Eo(a, h, d);
|
|
733
|
+
return fo([Math.round(m), Math.round(f), Math.round(x)]);
|
|
727
734
|
}
|
|
728
|
-
function
|
|
735
|
+
function xo(e, t = "light") {
|
|
729
736
|
return {
|
|
730
737
|
extraDark: Be(e, 0.6, 1.2),
|
|
731
738
|
dark: Be(e, 0.85, 1.1),
|
|
@@ -735,10 +742,10 @@ function Eo(e, t = "light") {
|
|
|
735
742
|
};
|
|
736
743
|
}
|
|
737
744
|
function pt(e) {
|
|
738
|
-
const t = wn(e), n = 149, o = +`0x${t[1]}${t[2]}`, s = +`0x${t[3]}${t[4]}`,
|
|
739
|
-
return o * 0.299 + s * 0.587 +
|
|
745
|
+
const t = wn(e), n = 149, o = +`0x${t[1]}${t[2]}`, s = +`0x${t[3]}${t[4]}`, i = +`0x${t[5]}${t[6]}`;
|
|
746
|
+
return o * 0.299 + s * 0.587 + i * 0.114 > n ? ht.BLACK : ht.WHITE;
|
|
740
747
|
}
|
|
741
|
-
function
|
|
748
|
+
function Co(e, t, n, o, s) {
|
|
742
749
|
return {
|
|
743
750
|
base: {
|
|
744
751
|
primary: t,
|
|
@@ -767,7 +774,7 @@ function xo(e, t, n, o, s) {
|
|
|
767
774
|
}
|
|
768
775
|
};
|
|
769
776
|
}
|
|
770
|
-
const
|
|
777
|
+
const vo = (e, t, n, o, s) => ({
|
|
771
778
|
base: {
|
|
772
779
|
primary: t,
|
|
773
780
|
primaryContrastContent: n,
|
|
@@ -861,7 +868,7 @@ const Co = (e, t, n, o, s) => ({
|
|
|
861
868
|
caption4: { fontSize: 11, fontWeight: 400 }
|
|
862
869
|
};
|
|
863
870
|
function Kt(e) {
|
|
864
|
-
const t =
|
|
871
|
+
const t = yo(e), { colors: n, aiAgentColorVariables: o } = _o(e, t), s = To(e);
|
|
865
872
|
return {
|
|
866
873
|
selectedTheme: e.selectedTheme,
|
|
867
874
|
palette: t,
|
|
@@ -870,57 +877,57 @@ function Kt(e) {
|
|
|
870
877
|
typography: s
|
|
871
878
|
};
|
|
872
879
|
}
|
|
873
|
-
function
|
|
874
|
-
const o = t != null && t.primary ? t.primary : n ? n === Fe.primary.main ? Fe.primary :
|
|
880
|
+
function yo({ selectedTheme: e, palette: t, primary: n }) {
|
|
881
|
+
const o = t != null && t.primary ? t.primary : n ? n === Fe.primary.main ? Fe.primary : xo(n, e) : Fe.primary;
|
|
875
882
|
return {
|
|
876
883
|
...Fe,
|
|
877
884
|
primary: o,
|
|
878
885
|
...t
|
|
879
886
|
};
|
|
880
887
|
}
|
|
881
|
-
function
|
|
882
|
-
const
|
|
888
|
+
function _o({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, s) {
|
|
889
|
+
const i = s.primary.main, a = t ?? pt(i), l = n ?? ht.DEFAULT_BOT_MSG_BG, c = o ?? pt(l);
|
|
883
890
|
return {
|
|
884
|
-
colors: (e === "light" ?
|
|
891
|
+
colors: (e === "light" ? Co : vo)(
|
|
885
892
|
s,
|
|
886
|
-
a,
|
|
887
893
|
i,
|
|
894
|
+
a,
|
|
888
895
|
l,
|
|
889
896
|
c
|
|
890
897
|
),
|
|
891
898
|
aiAgentColorVariables: {
|
|
892
|
-
primary_color:
|
|
899
|
+
primary_color: i,
|
|
893
900
|
bot_message_bg_color: l,
|
|
894
|
-
primary_contrast_color:
|
|
901
|
+
primary_contrast_color: a,
|
|
895
902
|
bot_message_bg_contrast_color: c
|
|
896
903
|
}
|
|
897
904
|
};
|
|
898
905
|
}
|
|
899
|
-
function
|
|
906
|
+
function So(e, t, n) {
|
|
900
907
|
const o = { ...e };
|
|
901
908
|
return n.forEach((s) => {
|
|
902
|
-
const
|
|
903
|
-
|
|
909
|
+
const i = t[s];
|
|
910
|
+
i != null && (o[s] = i);
|
|
904
911
|
}), o;
|
|
905
912
|
}
|
|
906
|
-
function
|
|
913
|
+
function To({ typography: e }) {
|
|
907
914
|
if (!e)
|
|
908
915
|
return it;
|
|
909
916
|
const t = { ...it };
|
|
910
917
|
return Object.keys(e).forEach((n) => {
|
|
911
918
|
const o = e[n];
|
|
912
919
|
if (o && typeof o == "object") {
|
|
913
|
-
const s = it[n],
|
|
914
|
-
t[n] =
|
|
920
|
+
const s = it[n], i = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
|
|
921
|
+
t[n] = So(s, o, i);
|
|
915
922
|
}
|
|
916
923
|
}), t;
|
|
917
924
|
}
|
|
918
925
|
const {
|
|
919
|
-
Provider:
|
|
926
|
+
Provider: wo,
|
|
920
927
|
useContext: Ct
|
|
921
928
|
} = G("AIAgentTheme");
|
|
922
|
-
function
|
|
923
|
-
const [
|
|
929
|
+
function Ao({ logger: e, palette: t, typography: n, appearance: o, children: s }) {
|
|
930
|
+
const [i, a] = _(
|
|
924
931
|
() => Kt({
|
|
925
932
|
selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
|
|
926
933
|
palette: t,
|
|
@@ -930,29 +937,29 @@ function wo({ logger: e, palette: t, typography: n, appearance: o, children: s }
|
|
|
930
937
|
})
|
|
931
938
|
), l = R(
|
|
932
939
|
(c, d) => {
|
|
933
|
-
const
|
|
940
|
+
const h = (o == null ? void 0 : o.theme) ?? c, m = d == null ? void 0 : d(h), f = {
|
|
934
941
|
primary: o == null ? void 0 : o.primaryColor,
|
|
935
942
|
primaryContrast: void 0,
|
|
936
943
|
botMessageBackground: o == null ? void 0 : o.botMessageBackgroundColor,
|
|
937
944
|
botMessageBackgroundContrast: void 0
|
|
938
945
|
};
|
|
939
|
-
!f.primary && (
|
|
940
|
-
const x = Kt({ selectedTheme:
|
|
941
|
-
|
|
946
|
+
!f.primary && (m != null && m.primaryColor) && (f.primary = m.primaryColor, f.primaryContrast = m.primaryContrastColor), !f.botMessageBackground && (m != null && m.botMessageBackgroundColor) && (f.botMessageBackground = m.botMessageBackgroundColor, f.botMessageBackgroundContrast = m.botMessageBackgroundContrastColor);
|
|
947
|
+
const x = Kt({ selectedTheme: h, palette: t, typography: n, ...f });
|
|
948
|
+
a(x), e == null || e.info("theme.update:", h);
|
|
942
949
|
},
|
|
943
950
|
[o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor, t, n, e]
|
|
944
951
|
);
|
|
945
952
|
return L(() => {
|
|
946
|
-
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(
|
|
947
|
-
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(
|
|
953
|
+
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(i.selectedTheme);
|
|
954
|
+
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(wo, { value: { theme: i, updateTheme: l } }, s);
|
|
948
955
|
}
|
|
949
|
-
function
|
|
956
|
+
function ko() {
|
|
950
957
|
const { chatSDK: e, logger: t } = ue(), n = R(
|
|
951
|
-
async (s,
|
|
952
|
-
if (t.debug("useChatConnection.connect: start, session", s.userId),
|
|
953
|
-
const l = new
|
|
954
|
-
...
|
|
955
|
-
onSessionTokenRequired:
|
|
958
|
+
async (s, i, a) => {
|
|
959
|
+
if (t.debug("useChatConnection.connect: start, session", s.userId), i) {
|
|
960
|
+
const l = new Ar({
|
|
961
|
+
...i,
|
|
962
|
+
onSessionTokenRequired: Io(i.onSessionTokenRequired, a)
|
|
956
963
|
});
|
|
957
964
|
e.setSessionHandler(l);
|
|
958
965
|
}
|
|
@@ -964,36 +971,36 @@ function Ao() {
|
|
|
964
971
|
}, [e, t]);
|
|
965
972
|
return { connect: n, disconnect: o };
|
|
966
973
|
}
|
|
967
|
-
function
|
|
974
|
+
function Io(e, t) {
|
|
968
975
|
if (e)
|
|
969
976
|
return async (n, o) => {
|
|
970
|
-
new Promise((s,
|
|
977
|
+
new Promise((s, i) => e == null ? void 0 : e(s, i)).then((s) => {
|
|
971
978
|
s && (t == null || t(s)), n(s);
|
|
972
979
|
}).catch((s) => {
|
|
973
980
|
o(s);
|
|
974
981
|
});
|
|
975
982
|
};
|
|
976
983
|
}
|
|
977
|
-
class
|
|
984
|
+
class $o {
|
|
978
985
|
constructor({ userId: t, authToken: n, sessionHandler: o }) {
|
|
979
986
|
this.userId = t, this.authToken = n, this.sessionHandler = o;
|
|
980
987
|
}
|
|
981
988
|
}
|
|
982
989
|
class Zt {
|
|
983
990
|
}
|
|
984
|
-
const
|
|
991
|
+
const Mo = 24 * 60 * 60 * 1e3, Oo = (e) => {
|
|
985
992
|
const { logger: t, cache: n } = ue(), o = () => {
|
|
986
|
-
const
|
|
987
|
-
return
|
|
993
|
+
const i = n.messenger.getAnonUser();
|
|
994
|
+
return i ? i.expireAt - Mo <= Date.now() ? (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session expired, clear cache"), n.messenger.clear(i.userId), null) : (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session info detected"), i) : null;
|
|
988
995
|
}, s = () => {
|
|
989
996
|
if (!e || e instanceof Zt)
|
|
990
997
|
throw new Error("userSessionInfo must be an instance of ManualSessionInfo");
|
|
991
|
-
const
|
|
992
|
-
return
|
|
993
|
-
`useUserSessionCandidate.getManualSessionInfo: missing required keys in userSessionInfo: ${
|
|
998
|
+
const i = ["authToken", "sessionHandler"].filter((a) => !(a in e));
|
|
999
|
+
return i.length > 0 && t.error(
|
|
1000
|
+
`useUserSessionCandidate.getManualSessionInfo: missing required keys in userSessionInfo: ${i.join(", ")}`
|
|
994
1001
|
), t.debug("useUserSessionCandidate.getManualSessionInfo: manual session info detected"), e;
|
|
995
1002
|
};
|
|
996
|
-
return ae(() => e instanceof
|
|
1003
|
+
return ae(() => e instanceof $o ? s() : e instanceof Zt ? o() : e && typeof e == "object" ? (t.warn("Please use ManualSessionInfo instead of the old userSessionInfo format."), s()) : e === void 0 ? (t.warn("Please use AnonymousSessionInfo instead of undefined userSessionInfo."), o()) : null, [
|
|
997
1004
|
t,
|
|
998
1005
|
e == null ? void 0 : e.userId,
|
|
999
1006
|
e == null ? void 0 : e.authToken,
|
|
@@ -1002,52 +1009,52 @@ const $o = 24 * 60 * 60 * 1e3, Mo = (e) => {
|
|
|
1002
1009
|
n.messenger.clear
|
|
1003
1010
|
]);
|
|
1004
1011
|
};
|
|
1005
|
-
function
|
|
1012
|
+
function Lo({
|
|
1006
1013
|
userSessionInfo: e,
|
|
1007
1014
|
onPreAuth: t,
|
|
1008
1015
|
onPostAuth: n,
|
|
1009
1016
|
onErrorAuth: o,
|
|
1010
1017
|
onAuthTokenRefreshed: s,
|
|
1011
|
-
onPostDeauth:
|
|
1012
|
-
forceCreateChannel:
|
|
1018
|
+
onPostDeauth: i,
|
|
1019
|
+
forceCreateChannel: a
|
|
1013
1020
|
}) {
|
|
1014
|
-
const { aiAgentId: l, chatSDK: c, language: d, context:
|
|
1021
|
+
const { aiAgentId: l, chatSDK: c, language: d, context: h, countryCode: m, logger: f, cache: x } = ue(), { connect: E, disconnect: b } = ko(), g = Oo(e), C = R(async () => {
|
|
1015
1022
|
var $;
|
|
1016
1023
|
f.debug("useAuthentication.authenticate: start");
|
|
1017
|
-
const S = (
|
|
1024
|
+
const S = (g == null ? void 0 : g.userId) && (($ = x.messenger.getSettings(g.userId)) == null ? void 0 : $.knownActiveChannelUrl), k = await c.aiAgent.requestMessengerSettings({
|
|
1018
1025
|
aiAgentId: l,
|
|
1019
|
-
userId:
|
|
1026
|
+
userId: g == null ? void 0 : g.userId,
|
|
1020
1027
|
language: d,
|
|
1021
|
-
country:
|
|
1022
|
-
context:
|
|
1023
|
-
forceCreateChannel:
|
|
1028
|
+
country: m,
|
|
1029
|
+
context: h,
|
|
1030
|
+
forceCreateChannel: a,
|
|
1024
1031
|
knownActiveChannelUrl: S
|
|
1025
1032
|
});
|
|
1026
1033
|
f.debug("useAuthentication.authenticate: messenger settings response", k);
|
|
1027
1034
|
let F = null;
|
|
1028
1035
|
if (k.auto_created_user) {
|
|
1029
|
-
const { user_id: V, session_token:
|
|
1030
|
-
x.messenger.setAnonUser({ userId: V, authToken:
|
|
1036
|
+
const { user_id: V, session_token: re, expire_at: y } = k.auto_created_user;
|
|
1037
|
+
x.messenger.setAnonUser({ userId: V, authToken: re, expireAt: y }), F = { userId: V, authToken: re };
|
|
1031
1038
|
} else
|
|
1032
1039
|
F = {
|
|
1033
|
-
userId: (
|
|
1034
|
-
authToken: (
|
|
1040
|
+
userId: (g == null ? void 0 : g.userId) ?? "",
|
|
1041
|
+
authToken: (g == null ? void 0 : g.authToken) ?? ""
|
|
1035
1042
|
};
|
|
1036
1043
|
x.messenger.setSettings(F.userId, {
|
|
1037
1044
|
knownActiveChannelUrl: k.active_channel.channel_url
|
|
1038
1045
|
});
|
|
1039
1046
|
try {
|
|
1040
|
-
await t(k, F), await
|
|
1047
|
+
await t(k, F), await E(F, g == null ? void 0 : g.sessionHandler, s), await n(k, F);
|
|
1041
1048
|
} catch (V) {
|
|
1042
1049
|
V instanceof Error && (o(V), f.error("useAuthentication.authenticate: failed to connect", V));
|
|
1043
1050
|
}
|
|
1044
1051
|
return k;
|
|
1045
1052
|
}, [
|
|
1046
1053
|
c,
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1054
|
+
E,
|
|
1055
|
+
g == null ? void 0 : g.userId,
|
|
1056
|
+
g == null ? void 0 : g.sessionHandler,
|
|
1057
|
+
g == null ? void 0 : g.authToken,
|
|
1051
1058
|
x.messenger.setAnonUser,
|
|
1052
1059
|
x.messenger.getSettings,
|
|
1053
1060
|
x.messenger.setSettings,
|
|
@@ -1056,12 +1063,12 @@ function Oo({
|
|
|
1056
1063
|
o,
|
|
1057
1064
|
s
|
|
1058
1065
|
]), v = R(async () => {
|
|
1059
|
-
f.debug("useAuthentication.deauthenticate: start"), await
|
|
1060
|
-
}, [
|
|
1066
|
+
f.debug("useAuthentication.deauthenticate: start"), await b(), i(), f.debug("useAuthentication.deauthenticate: completed");
|
|
1067
|
+
}, [b, f, i]);
|
|
1061
1068
|
return {
|
|
1062
1069
|
authenticate: C,
|
|
1063
1070
|
deauthenticate: v,
|
|
1064
|
-
userSessionCandidate:
|
|
1071
|
+
userSessionCandidate: g
|
|
1065
1072
|
};
|
|
1066
1073
|
}
|
|
1067
1074
|
const An = (e) => {
|
|
@@ -1072,16 +1079,16 @@ const An = (e) => {
|
|
|
1072
1079
|
return JSON.stringify(e).slice(1, -1);
|
|
1073
1080
|
}
|
|
1074
1081
|
}, $e = (e) => JSON.parse(e), Qe = (e) => JSON.parse(e);
|
|
1075
|
-
function
|
|
1082
|
+
function Ro(e, t) {
|
|
1076
1083
|
const [n, o] = t.split(",").map((s) => s.trim());
|
|
1077
1084
|
return e === "dark" && o || n;
|
|
1078
1085
|
}
|
|
1079
|
-
function
|
|
1086
|
+
function Do(e) {
|
|
1080
1087
|
const t = {};
|
|
1081
1088
|
function n(o, s = "") {
|
|
1082
|
-
for (const [
|
|
1083
|
-
const l = s ? `${s}.${
|
|
1084
|
-
|
|
1089
|
+
for (const [i, a] of Object.entries(o)) {
|
|
1090
|
+
const l = s ? `${s}.${i}` : i;
|
|
1091
|
+
a && typeof a == "object" && !Array.isArray(a) ? n(a, l) : t[l] = a;
|
|
1085
1092
|
}
|
|
1086
1093
|
}
|
|
1087
1094
|
return n(e), t;
|
|
@@ -1092,43 +1099,43 @@ function vt({
|
|
|
1092
1099
|
variableKeyPattern: n,
|
|
1093
1100
|
variableValueTransformer: o
|
|
1094
1101
|
}) {
|
|
1095
|
-
return Object.entries(t).reduce((s, [
|
|
1096
|
-
if (!o && !["number", "boolean", "string"].includes(typeof
|
|
1097
|
-
throw new Error(`If transformer is not provided, value(${
|
|
1098
|
-
const l = o ? o(
|
|
1102
|
+
return Object.entries(t).reduce((s, [i, a]) => {
|
|
1103
|
+
if (!o && !["number", "boolean", "string"].includes(typeof a))
|
|
1104
|
+
throw new Error(`If transformer is not provided, value(${i}:${a}) must be a {string, number, or boolean}`);
|
|
1105
|
+
const l = o ? o(a) : String(a), c = n(i);
|
|
1099
1106
|
return s.replace(c, An(l));
|
|
1100
1107
|
}, e);
|
|
1101
1108
|
}
|
|
1102
|
-
async function
|
|
1109
|
+
async function No({
|
|
1103
1110
|
template: e,
|
|
1104
1111
|
variables: t,
|
|
1105
1112
|
variableKeyPattern: n,
|
|
1106
1113
|
variableValueTransformer: o
|
|
1107
1114
|
}) {
|
|
1108
1115
|
return (await Promise.all(
|
|
1109
|
-
Object.entries(t).map(async ([
|
|
1110
|
-
const l = await o(
|
|
1111
|
-
return { regex: n(
|
|
1116
|
+
Object.entries(t).map(async ([i, a]) => {
|
|
1117
|
+
const l = await o(a);
|
|
1118
|
+
return { regex: n(i), transformedValue: l };
|
|
1112
1119
|
})
|
|
1113
|
-
)).reduce((
|
|
1120
|
+
)).reduce((i, { regex: a, transformedValue: l }) => i.replace(a, An(l)), e);
|
|
1114
1121
|
}
|
|
1115
|
-
const
|
|
1122
|
+
const Po = () => {
|
|
1116
1123
|
const { chatSDK: e, logger: t, cache: n } = ue(), o = R(() => {
|
|
1117
1124
|
var l, c;
|
|
1118
|
-
const
|
|
1119
|
-
if (!
|
|
1120
|
-
const
|
|
1121
|
-
return
|
|
1125
|
+
const i = (c = (l = e.appInfo) == null ? void 0 : l.aiAgentInfo) == null ? void 0 : c.templateListToken;
|
|
1126
|
+
if (!i) return !1;
|
|
1127
|
+
const a = n.template.getCachedToken();
|
|
1128
|
+
return a ? i !== a : !0;
|
|
1122
1129
|
}, [e, n.template.getCachedToken]), s = R(async () => {
|
|
1123
1130
|
try {
|
|
1124
|
-
const { templates:
|
|
1125
|
-
for (const { template: l } of
|
|
1131
|
+
const { templates: i, token: a } = await e.aiAgent.getMessageTemplates({ limit: 20 });
|
|
1132
|
+
for (const { template: l } of i) {
|
|
1126
1133
|
const { key: c } = $e(l);
|
|
1127
1134
|
n.template.set(c, l);
|
|
1128
1135
|
}
|
|
1129
|
-
n.template.setCachedToken(
|
|
1130
|
-
} catch (
|
|
1131
|
-
t == null || t.error("messageTemplateContext.syncCachedTemplates: error:",
|
|
1136
|
+
n.template.setCachedToken(a);
|
|
1137
|
+
} catch (i) {
|
|
1138
|
+
t == null || t.error("messageTemplateContext.syncCachedTemplates: error:", i);
|
|
1132
1139
|
}
|
|
1133
1140
|
}, [e, t, n.template.set, n.template.setCachedToken]);
|
|
1134
1141
|
return {
|
|
@@ -1137,21 +1144,21 @@ const No = () => {
|
|
|
1137
1144
|
};
|
|
1138
1145
|
};
|
|
1139
1146
|
var je = /* @__PURE__ */ ((e) => (e.OFF = "off", e.ALWAYS = "always", e.HANDED_OFF_ONLY = "handed_off_only", e))(je || {});
|
|
1140
|
-
const
|
|
1147
|
+
const Bo = {
|
|
1141
1148
|
off: "off",
|
|
1142
1149
|
always: "always",
|
|
1143
1150
|
handed_off_only: "handed_off_only"
|
|
1144
1151
|
/* HANDED_OFF_ONLY */
|
|
1145
1152
|
}, {
|
|
1146
|
-
Provider:
|
|
1147
|
-
} = G("AIAgentMessengerSession"),
|
|
1153
|
+
Provider: Fo
|
|
1154
|
+
} = G("AIAgentMessengerSession"), Uo = ye(
|
|
1148
1155
|
function({ userSessionInfo: e, forceCreateChannel: t, children: n }, o) {
|
|
1149
|
-
const { appId: s, aiAgentId:
|
|
1156
|
+
const { appId: s, aiAgentId: i, chatSDK: a, language: l, countryCode: c, context: d, cache: h, logger: m } = ue(), { updateTheme: f } = Ct(), [x, E] = _(void 0), [b, g] = _(
|
|
1150
1157
|
void 0
|
|
1151
|
-
), [C, v] = _(null), [S, k] = _(null), [F, $] = _(null), [V,
|
|
1158
|
+
), [C, v] = _(null), [S, k] = _(null), [F, $] = _(null), [V, re] = _(
|
|
1152
1159
|
"handed_off_only"
|
|
1153
1160
|
/* HANDED_OFF_ONLY */
|
|
1154
|
-
), { shouldSyncCachedTemplate: y, syncCachedTemplates: H } =
|
|
1161
|
+
), { shouldSyncCachedTemplate: y, syncCachedTemplates: H } = Po(), { authenticate: oe, deauthenticate: Y } = Lo({
|
|
1155
1162
|
userSessionInfo: e,
|
|
1156
1163
|
forceCreateChannel: t,
|
|
1157
1164
|
onPreAuth: R((A, D) => {
|
|
@@ -1164,7 +1171,7 @@ const Po = {
|
|
|
1164
1171
|
primaryContrastColor: be.primary_contrast_color,
|
|
1165
1172
|
botMessageBackgroundContrastColor: be.bot_message_bg_contrast_color
|
|
1166
1173
|
};
|
|
1167
|
-
}),
|
|
1174
|
+
}), E(void 0), v(D), k({
|
|
1168
1175
|
userId: A.bot.bot_userid,
|
|
1169
1176
|
profileUrl: A.bot.bot_profile_url,
|
|
1170
1177
|
nickname: A.bot.bot_nickname,
|
|
@@ -1175,113 +1182,113 @@ const Po = {
|
|
|
1175
1182
|
}), $({
|
|
1176
1183
|
type: A.launcher.image_type || "default_icon",
|
|
1177
1184
|
imageUrl: A.launcher.image_url
|
|
1178
|
-
}),
|
|
1179
|
-
|
|
1185
|
+
}), re(
|
|
1186
|
+
Bo[A.active_channel.attachment_mode] ?? "handed_off_only"
|
|
1180
1187
|
/* HANDED_OFF_ONLY */
|
|
1181
1188
|
);
|
|
1182
1189
|
}, []),
|
|
1183
1190
|
onPostAuth: R(
|
|
1184
1191
|
async (A) => {
|
|
1185
|
-
y() && await H(),
|
|
1192
|
+
y() && await H(), g({ url: A.active_channel.channel_url, status: W.OPEN });
|
|
1186
1193
|
},
|
|
1187
1194
|
[y, H]
|
|
1188
1195
|
),
|
|
1189
1196
|
onErrorAuth: R((A) => {
|
|
1190
|
-
|
|
1197
|
+
E(A);
|
|
1191
1198
|
}, []),
|
|
1192
1199
|
onAuthTokenRefreshed: R((A) => {
|
|
1193
1200
|
v((D) => D ? { ...D, authToken: A } : null);
|
|
1194
1201
|
}, []),
|
|
1195
1202
|
onPostDeauth: R(() => {
|
|
1196
|
-
|
|
1197
|
-
}, [
|
|
1203
|
+
h.template.clear(), C != null && C.userId && h.messenger.clear(C.userId), g(void 0), v(null), k(null), $(null);
|
|
1204
|
+
}, [h.template.clear, C])
|
|
1198
1205
|
}), nt = R(async () => {
|
|
1199
1206
|
var A;
|
|
1200
1207
|
if (C) {
|
|
1201
|
-
|
|
1202
|
-
const D = await
|
|
1203
|
-
aiAgentId:
|
|
1208
|
+
m.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"), g(void 0);
|
|
1209
|
+
const D = await a.aiAgent.requestMessengerSettings({
|
|
1210
|
+
aiAgentId: i,
|
|
1204
1211
|
userId: C.userId,
|
|
1205
1212
|
language: l,
|
|
1206
1213
|
country: c,
|
|
1207
1214
|
context: d,
|
|
1208
1215
|
forceCreateChannel: t,
|
|
1209
|
-
knownActiveChannelUrl: (A =
|
|
1216
|
+
knownActiveChannelUrl: (A = h.messenger.getSettings(C.userId)) == null ? void 0 : A.knownActiveChannelUrl
|
|
1210
1217
|
});
|
|
1211
|
-
return
|
|
1218
|
+
return h.messenger.setSettings(C.userId, {
|
|
1212
1219
|
knownActiveChannelUrl: D.active_channel.channel_url
|
|
1213
|
-
}),
|
|
1220
|
+
}), g({ url: D.active_channel.channel_url, status: W.OPEN }), m.info(
|
|
1214
1221
|
"agentMessengerSession.refreshActiveChannel: refreshed active channel",
|
|
1215
1222
|
D.active_channel.channel_url
|
|
1216
1223
|
), D.active_channel.channel_url;
|
|
1217
1224
|
} else
|
|
1218
|
-
throw
|
|
1225
|
+
throw m.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"), new Error("userSession is not ready");
|
|
1219
1226
|
}, [
|
|
1220
|
-
i,
|
|
1221
|
-
s,
|
|
1222
1227
|
a,
|
|
1228
|
+
s,
|
|
1229
|
+
i,
|
|
1223
1230
|
C == null ? void 0 : C.userId,
|
|
1224
1231
|
l,
|
|
1225
1232
|
c,
|
|
1226
1233
|
d,
|
|
1227
1234
|
t,
|
|
1228
|
-
|
|
1229
|
-
|
|
1235
|
+
h.messenger.getSettings,
|
|
1236
|
+
h.messenger.setSettings
|
|
1230
1237
|
]), rt = R(
|
|
1231
1238
|
async (A) => {
|
|
1232
1239
|
if (!(C != null && C.userId))
|
|
1233
1240
|
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
1234
|
-
const K = (await
|
|
1241
|
+
const K = (await a.aiAgent.requestMessengerSettings({
|
|
1235
1242
|
...A,
|
|
1236
1243
|
userId: C.userId,
|
|
1237
1244
|
knownActiveChannelUrl: void 0
|
|
1238
1245
|
})).active_channel.channel_url;
|
|
1239
|
-
return
|
|
1246
|
+
return h.messenger.setSettings(C.userId, { knownActiveChannelUrl: K }), K;
|
|
1240
1247
|
},
|
|
1241
1248
|
[C == null ? void 0 : C.userId]
|
|
1242
1249
|
);
|
|
1243
|
-
return Xe(
|
|
1250
|
+
return Xe(a, {
|
|
1244
1251
|
onChannelChanged: (A) => {
|
|
1245
1252
|
var D;
|
|
1246
|
-
A.isGroupChannel() && A.url === (
|
|
1253
|
+
A.isGroupChannel() && A.url === (b == null ? void 0 : b.url) && (m.info("agentMessengerSession.channelChanged: channel.conversation", A.conversation), g({ url: A.url, status: ((D = A.conversation) == null ? void 0 : D.status) ?? W.OPEN }));
|
|
1247
1254
|
}
|
|
1248
1255
|
}), Er(o, () => {
|
|
1249
1256
|
const A = async () => {
|
|
1250
|
-
if (!
|
|
1251
|
-
return await
|
|
1257
|
+
if (!b) throw new Error("No active conversation. Please start a conversation first.");
|
|
1258
|
+
return await a.groupChannel.getChannel(b.url);
|
|
1252
1259
|
};
|
|
1253
1260
|
return {
|
|
1254
|
-
activeChannel:
|
|
1255
|
-
chatSDK:
|
|
1256
|
-
authenticate:
|
|
1261
|
+
activeChannel: b,
|
|
1262
|
+
chatSDK: a,
|
|
1263
|
+
authenticate: oe,
|
|
1257
1264
|
deauthenticate: Y,
|
|
1258
1265
|
updateContext: async (D) => {
|
|
1259
|
-
const q = await (await A()).updateContext(
|
|
1266
|
+
const q = await (await A()).updateContext(i, D);
|
|
1260
1267
|
return { ...q, context: q.context ?? {} };
|
|
1261
1268
|
},
|
|
1262
1269
|
patchContext: async (D) => {
|
|
1263
|
-
const q = await (await A()).patchContext(
|
|
1270
|
+
const q = await (await A()).patchContext(i, D);
|
|
1264
1271
|
return { ...q, context: q.context ?? {} };
|
|
1265
1272
|
},
|
|
1266
1273
|
getContextObject: async () => {
|
|
1267
|
-
const K = await (await A()).getContextObject(
|
|
1274
|
+
const K = await (await A()).getContextObject(i);
|
|
1268
1275
|
return { ...K, context: K.context ?? {} };
|
|
1269
1276
|
}
|
|
1270
1277
|
};
|
|
1271
|
-
}, [
|
|
1272
|
-
|
|
1278
|
+
}, [oe, Y, b, a, i, m]), /* @__PURE__ */ r.createElement(
|
|
1279
|
+
Fo,
|
|
1273
1280
|
{
|
|
1274
1281
|
value: {
|
|
1275
1282
|
userSessionInfo: e,
|
|
1276
1283
|
userSession: C,
|
|
1277
|
-
activeChannel:
|
|
1278
|
-
setActiveChannel:
|
|
1284
|
+
activeChannel: b,
|
|
1285
|
+
setActiveChannel: g,
|
|
1279
1286
|
refreshActiveChannel: nt,
|
|
1280
1287
|
createConversation: rt,
|
|
1281
1288
|
connectionError: x,
|
|
1282
1289
|
aiAgentInfo: S,
|
|
1283
1290
|
launcherInfo: F,
|
|
1284
|
-
authenticate:
|
|
1291
|
+
authenticate: oe,
|
|
1285
1292
|
deauthenticate: Y,
|
|
1286
1293
|
attachmentMode: V
|
|
1287
1294
|
}
|
|
@@ -1290,7 +1297,7 @@ const Po = {
|
|
|
1290
1297
|
);
|
|
1291
1298
|
}
|
|
1292
1299
|
);
|
|
1293
|
-
function
|
|
1300
|
+
function Ho(e) {
|
|
1294
1301
|
let t = "pending", n = e.then((o) => {
|
|
1295
1302
|
t = "resolved", n = o;
|
|
1296
1303
|
}).catch((o) => {
|
|
@@ -1305,61 +1312,61 @@ function Uo(e) {
|
|
|
1305
1312
|
};
|
|
1306
1313
|
}
|
|
1307
1314
|
const {
|
|
1308
|
-
Provider:
|
|
1315
|
+
Provider: zo,
|
|
1309
1316
|
useContext: kn
|
|
1310
1317
|
} = G("MessageTemplateFetching");
|
|
1311
|
-
function
|
|
1312
|
-
const n = N({}), o = N({}), [s,
|
|
1313
|
-
|
|
1314
|
-
...
|
|
1315
|
-
[d]: { fetching: !1, error: !1, ...
|
|
1318
|
+
function Vo({ children: e, internalVariables: t }) {
|
|
1319
|
+
const n = N({}), o = N({}), [s, i] = _({}), a = R((d, h) => {
|
|
1320
|
+
i((m) => ({
|
|
1321
|
+
...m,
|
|
1322
|
+
[d]: { fetching: !1, error: !1, ...m[d], ...h }
|
|
1316
1323
|
}));
|
|
1317
1324
|
}, []), l = R(
|
|
1318
1325
|
async ({
|
|
1319
1326
|
onRequestTemplate: d,
|
|
1320
|
-
onGetCachedTemplate:
|
|
1321
|
-
templateKey:
|
|
1327
|
+
onGetCachedTemplate: h,
|
|
1328
|
+
templateKey: m,
|
|
1322
1329
|
suspense: f = !1
|
|
1323
1330
|
}) => {
|
|
1324
|
-
const x =
|
|
1331
|
+
const x = h(m);
|
|
1325
1332
|
if (x) return x;
|
|
1326
|
-
const
|
|
1327
|
-
if (
|
|
1328
|
-
f ||
|
|
1329
|
-
const
|
|
1330
|
-
throw f ||
|
|
1333
|
+
const E = o.current[m];
|
|
1334
|
+
if (E) return E;
|
|
1335
|
+
f || a(m, { fetching: !0 });
|
|
1336
|
+
const b = d(m).catch((g) => {
|
|
1337
|
+
throw f || a(m, { error: !0 }), g;
|
|
1331
1338
|
}).finally(() => {
|
|
1332
|
-
f ||
|
|
1339
|
+
f || a(m, { fetching: !1 }), delete o.current[m];
|
|
1333
1340
|
});
|
|
1334
|
-
return o.current[
|
|
1341
|
+
return o.current[m] = b, b;
|
|
1335
1342
|
},
|
|
1336
|
-
[
|
|
1343
|
+
[a]
|
|
1337
1344
|
), c = {
|
|
1338
1345
|
internalVariables: t,
|
|
1339
1346
|
fetchTemplate: l,
|
|
1340
|
-
suspend: (d,
|
|
1347
|
+
suspend: (d, h) => {
|
|
1341
1348
|
if (n.current[d])
|
|
1342
1349
|
return n.current[d];
|
|
1343
|
-
const
|
|
1344
|
-
return n.current[d] =
|
|
1350
|
+
const m = Ho(h());
|
|
1351
|
+
return n.current[d] = m, m;
|
|
1345
1352
|
},
|
|
1346
1353
|
getIsFetching: (d) => {
|
|
1347
|
-
var
|
|
1348
|
-
return ((
|
|
1354
|
+
var h;
|
|
1355
|
+
return ((h = s[d]) == null ? void 0 : h.fetching) ?? !1;
|
|
1349
1356
|
},
|
|
1350
1357
|
getHasError: (d) => {
|
|
1351
|
-
var
|
|
1352
|
-
return ((
|
|
1358
|
+
var h;
|
|
1359
|
+
return ((h = s[d]) == null ? void 0 : h.error) ?? !1;
|
|
1353
1360
|
}
|
|
1354
1361
|
};
|
|
1355
|
-
return /* @__PURE__ */ r.createElement(
|
|
1362
|
+
return /* @__PURE__ */ r.createElement(zo, { value: c }, e);
|
|
1356
1363
|
}
|
|
1357
1364
|
const et = {
|
|
1358
1365
|
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
1359
1366
|
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
1360
1367
|
};
|
|
1361
1368
|
function ce({ uiTemplateString: e, variables: t = {} }) {
|
|
1362
|
-
const n =
|
|
1369
|
+
const n = Do(t);
|
|
1363
1370
|
return vt({
|
|
1364
1371
|
template: e,
|
|
1365
1372
|
variables: n,
|
|
@@ -1375,120 +1382,120 @@ function de({
|
|
|
1375
1382
|
template: t,
|
|
1376
1383
|
variables: n,
|
|
1377
1384
|
variableKeyPattern: (o) => et.VARIABLE(o),
|
|
1378
|
-
variableValueTransformer: (o) =>
|
|
1385
|
+
variableValueTransformer: (o) => Ro(e, o)
|
|
1379
1386
|
});
|
|
1380
1387
|
}
|
|
1381
|
-
function
|
|
1388
|
+
function Wo({
|
|
1382
1389
|
theme: e,
|
|
1383
1390
|
uiTemplateString: t,
|
|
1384
1391
|
viewVariables: n = {},
|
|
1385
1392
|
aiAgentColorVariables: o,
|
|
1386
1393
|
internalVariables: s,
|
|
1387
|
-
onRequestTemplate:
|
|
1394
|
+
onRequestTemplate: i
|
|
1388
1395
|
}) {
|
|
1389
1396
|
const l = Object.values(n).flat().map((d) => d.key);
|
|
1390
|
-
return [...new Set(l)].some((d) => !
|
|
1397
|
+
return [...new Set(l)].some((d) => !i(d)) ? null : vt({
|
|
1391
1398
|
template: t,
|
|
1392
1399
|
variables: n,
|
|
1393
1400
|
variableKeyPattern: (d) => et.VIEW_VARIABLE(d),
|
|
1394
1401
|
variableValueTransformer: (d) => {
|
|
1395
|
-
const
|
|
1396
|
-
const x =
|
|
1397
|
-
let
|
|
1398
|
-
return
|
|
1399
|
-
uiTemplateString:
|
|
1402
|
+
const h = d.map(({ key: m, variables: f }) => {
|
|
1403
|
+
const x = i(m), { ui_template: E, color_variables: b } = $e(x);
|
|
1404
|
+
let g = JSON.stringify(E);
|
|
1405
|
+
return g = ce({
|
|
1406
|
+
uiTemplateString: g,
|
|
1400
1407
|
variables: s
|
|
1401
|
-
}),
|
|
1408
|
+
}), g = de({
|
|
1402
1409
|
theme: e,
|
|
1403
|
-
uiTemplateString:
|
|
1404
|
-
colorVariables:
|
|
1405
|
-
}),
|
|
1410
|
+
uiTemplateString: g,
|
|
1411
|
+
colorVariables: b
|
|
1412
|
+
}), g = de({
|
|
1406
1413
|
theme: e,
|
|
1407
|
-
uiTemplateString:
|
|
1414
|
+
uiTemplateString: g,
|
|
1408
1415
|
colorVariables: o
|
|
1409
|
-
}),
|
|
1410
|
-
uiTemplateString:
|
|
1416
|
+
}), g = ce({
|
|
1417
|
+
uiTemplateString: g,
|
|
1411
1418
|
variables: f
|
|
1412
|
-
}), Qe(
|
|
1419
|
+
}), Qe(g);
|
|
1413
1420
|
});
|
|
1414
|
-
return JSON.stringify(
|
|
1421
|
+
return JSON.stringify(h);
|
|
1415
1422
|
}
|
|
1416
1423
|
});
|
|
1417
1424
|
}
|
|
1418
|
-
async function
|
|
1425
|
+
async function Go({
|
|
1419
1426
|
theme: e,
|
|
1420
1427
|
uiTemplateString: t,
|
|
1421
1428
|
viewVariables: n = {},
|
|
1422
1429
|
aiAgentColorVariables: o,
|
|
1423
1430
|
internalVariables: s,
|
|
1424
|
-
onRequestTemplate:
|
|
1431
|
+
onRequestTemplate: i
|
|
1425
1432
|
}) {
|
|
1426
|
-
return
|
|
1433
|
+
return No({
|
|
1427
1434
|
template: t,
|
|
1428
1435
|
variables: n,
|
|
1429
|
-
variableKeyPattern: (
|
|
1430
|
-
variableValueTransformer: async (
|
|
1431
|
-
const l =
|
|
1432
|
-
const
|
|
1433
|
-
let
|
|
1434
|
-
return
|
|
1435
|
-
uiTemplateString:
|
|
1436
|
+
variableKeyPattern: (a) => et.VIEW_VARIABLE(a),
|
|
1437
|
+
variableValueTransformer: async (a) => {
|
|
1438
|
+
const l = a.map(async ({ key: d, variables: h }) => {
|
|
1439
|
+
const m = await i(d), { ui_template: f, color_variables: x } = $e(m);
|
|
1440
|
+
let E = JSON.stringify(f);
|
|
1441
|
+
return E = ce({
|
|
1442
|
+
uiTemplateString: E,
|
|
1436
1443
|
variables: s
|
|
1437
|
-
}),
|
|
1444
|
+
}), E = de({
|
|
1438
1445
|
theme: e,
|
|
1439
|
-
uiTemplateString:
|
|
1446
|
+
uiTemplateString: E,
|
|
1440
1447
|
colorVariables: x
|
|
1441
|
-
}),
|
|
1448
|
+
}), E = de({
|
|
1442
1449
|
theme: e,
|
|
1443
|
-
uiTemplateString:
|
|
1450
|
+
uiTemplateString: E,
|
|
1444
1451
|
colorVariables: o
|
|
1445
|
-
}),
|
|
1446
|
-
uiTemplateString:
|
|
1447
|
-
variables:
|
|
1448
|
-
}), Qe(
|
|
1452
|
+
}), E = ce({
|
|
1453
|
+
uiTemplateString: E,
|
|
1454
|
+
variables: h
|
|
1455
|
+
}), Qe(E);
|
|
1449
1456
|
}), c = await Promise.all(l);
|
|
1450
1457
|
return JSON.stringify(c);
|
|
1451
1458
|
}
|
|
1452
1459
|
});
|
|
1453
1460
|
}
|
|
1454
|
-
const
|
|
1461
|
+
const jo = ({
|
|
1455
1462
|
rawTemplate: e,
|
|
1456
1463
|
aiAgentColorVariables: t,
|
|
1457
1464
|
internalVariables: n,
|
|
1458
1465
|
...o
|
|
1459
1466
|
}) => {
|
|
1460
|
-
const { ui_template: s, color_variables:
|
|
1461
|
-
let
|
|
1467
|
+
const { ui_template: s, color_variables: i } = $e(e);
|
|
1468
|
+
let a = JSON.stringify(s);
|
|
1462
1469
|
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
1463
|
-
const c =
|
|
1470
|
+
const c = Wo({
|
|
1464
1471
|
...o,
|
|
1465
|
-
uiTemplateString:
|
|
1472
|
+
uiTemplateString: a,
|
|
1466
1473
|
aiAgentColorVariables: t,
|
|
1467
1474
|
internalVariables: n
|
|
1468
1475
|
});
|
|
1469
1476
|
if (c === null) return null;
|
|
1470
|
-
|
|
1477
|
+
a = c;
|
|
1471
1478
|
}
|
|
1472
|
-
return
|
|
1473
|
-
},
|
|
1479
|
+
return a = ce({ ...o, uiTemplateString: a, variables: n }), a = de({ ...o, uiTemplateString: a, colorVariables: i }), a = de({ ...o, uiTemplateString: a, colorVariables: t }), a = ce({ ...o, uiTemplateString: a }), Qe(a);
|
|
1480
|
+
}, Ko = async ({
|
|
1474
1481
|
rawTemplate: e,
|
|
1475
1482
|
aiAgentColorVariables: t,
|
|
1476
1483
|
internalVariables: n,
|
|
1477
1484
|
...o
|
|
1478
1485
|
}) => {
|
|
1479
|
-
const { ui_template: s, color_variables:
|
|
1480
|
-
let
|
|
1481
|
-
return Object.keys(o.viewVariables ?? {}).length > 0 && (
|
|
1486
|
+
const { ui_template: s, color_variables: i } = $e(e);
|
|
1487
|
+
let a = JSON.stringify(s);
|
|
1488
|
+
return Object.keys(o.viewVariables ?? {}).length > 0 && (a = await Go({
|
|
1482
1489
|
...o,
|
|
1483
|
-
uiTemplateString:
|
|
1490
|
+
uiTemplateString: a,
|
|
1484
1491
|
aiAgentColorVariables: t,
|
|
1485
1492
|
internalVariables: n
|
|
1486
|
-
})),
|
|
1487
|
-
},
|
|
1493
|
+
})), a = ce({ ...o, uiTemplateString: a, variables: n }), a = de({ ...o, uiTemplateString: a, colorVariables: i }), a = de({ ...o, uiTemplateString: a, colorVariables: t }), a = ce({ ...o, uiTemplateString: a }), Qe(a);
|
|
1494
|
+
}, Zo = (e) => {
|
|
1488
1495
|
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = kn();
|
|
1489
1496
|
return _(() => {
|
|
1490
1497
|
const o = e.onGetCachedTemplate(e.templateKey);
|
|
1491
|
-
return o ?
|
|
1498
|
+
return o ? jo({
|
|
1492
1499
|
...e,
|
|
1493
1500
|
rawTemplate: o,
|
|
1494
1501
|
aiAgentColorVariables: t,
|
|
@@ -1496,20 +1503,20 @@ const Go = ({
|
|
|
1496
1503
|
onRequestTemplate: e.onGetCachedTemplate
|
|
1497
1504
|
}) : null;
|
|
1498
1505
|
});
|
|
1499
|
-
},
|
|
1500
|
-
const [t] =
|
|
1506
|
+
}, Yo = (e) => {
|
|
1507
|
+
const [t] = Zo(e);
|
|
1501
1508
|
if (t) return t;
|
|
1502
|
-
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: s, suspend:
|
|
1503
|
-
return
|
|
1509
|
+
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: s, suspend: i } = kn();
|
|
1510
|
+
return i(e.templateKey, async () => {
|
|
1504
1511
|
const l = await s({ ...e, suspense: !0 });
|
|
1505
|
-
return await
|
|
1512
|
+
return await Ko({
|
|
1506
1513
|
...e,
|
|
1507
1514
|
rawTemplate: l,
|
|
1508
1515
|
aiAgentColorVariables: n,
|
|
1509
1516
|
internalVariables: o
|
|
1510
1517
|
});
|
|
1511
1518
|
}).value;
|
|
1512
|
-
},
|
|
1519
|
+
}, qo = '@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}', Me = "en", Jo = /* @__PURE__ */ new Set([
|
|
1513
1520
|
Me,
|
|
1514
1521
|
"ko",
|
|
1515
1522
|
"es",
|
|
@@ -1520,11 +1527,11 @@ const Go = ({
|
|
|
1520
1527
|
"de",
|
|
1521
1528
|
"tr",
|
|
1522
1529
|
"ja"
|
|
1523
|
-
]),
|
|
1530
|
+
]), Xo = (e, t, n) => {
|
|
1524
1531
|
const o = e[t];
|
|
1525
|
-
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((s,
|
|
1532
|
+
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((s, i) => {
|
|
1526
1533
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
1527
|
-
|
|
1534
|
+
i.bind(
|
|
1528
1535
|
null,
|
|
1529
1536
|
new Error(
|
|
1530
1537
|
"Unknown variable dynamic import: " + t + (t.split("/").length !== n ? ". Note that variables only represent file names one level deep." : "")
|
|
@@ -1532,7 +1539,7 @@ const Go = ({
|
|
|
1532
1539
|
)
|
|
1533
1540
|
);
|
|
1534
1541
|
});
|
|
1535
|
-
},
|
|
1542
|
+
}, Qo = Lr, es = {
|
|
1536
1543
|
// Channel - Common
|
|
1537
1544
|
CHANNEL_FROZEN: "Channel frozen",
|
|
1538
1545
|
PLACE_HOLDER__WRONG: "Something went wrong",
|
|
@@ -1585,47 +1592,47 @@ const Go = ({
|
|
|
1585
1592
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma",
|
|
1586
1593
|
// Citation
|
|
1587
1594
|
CITATION_SOURCE_TITLE: "Source"
|
|
1588
|
-
}, yt = { language: "en", dateLocale:
|
|
1595
|
+
}, yt = { language: "en", dateLocale: Qo, stringSet: es }, ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1589
1596
|
__proto__: null,
|
|
1590
1597
|
default: yt
|
|
1591
1598
|
}, Symbol.toStringTag, { value: "Module" })), Ke = /* @__PURE__ */ new Map([[Me, yt]]);
|
|
1592
|
-
async function
|
|
1599
|
+
async function ns(e) {
|
|
1593
1600
|
if (Ke.has(e))
|
|
1594
1601
|
return Ke.get(e);
|
|
1595
|
-
const t =
|
|
1602
|
+
const t = Jo.has(e) ? e : Me;
|
|
1596
1603
|
try {
|
|
1597
|
-
const { default: n } = await
|
|
1604
|
+
const { default: n } = await Xo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./BAebVbLs.js"), "./languages/en.ts": () => Promise.resolve().then(() => ts), "./languages/es.ts": () => import("./BKSUGIyL.js"), "./languages/fr.ts": () => import("./B1s75De5.js"), "./languages/hi.ts": () => import("./D0QwWNMF.js"), "./languages/it.ts": () => import("./CA1gVgSD.js"), "./languages/ja.ts": () => import("./DcqbdvlW.js"), "./languages/ko.ts": () => import("./Dxrtj2R8.js"), "./languages/pt.ts": () => import("./EylKxx4d.js"), "./languages/tr.ts": () => import("./DYR8UT_l.js") }), `./languages/${t}.ts`, 3);
|
|
1598
1605
|
return Ke.set(e, n), n;
|
|
1599
1606
|
} catch {
|
|
1600
1607
|
return yt;
|
|
1601
1608
|
}
|
|
1602
1609
|
}
|
|
1603
1610
|
const {
|
|
1604
|
-
Provider:
|
|
1611
|
+
Provider: rs,
|
|
1605
1612
|
useContext: O
|
|
1606
1613
|
} = G("Localization");
|
|
1607
|
-
function
|
|
1614
|
+
function os(e) {
|
|
1608
1615
|
var t;
|
|
1609
1616
|
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Me;
|
|
1610
1617
|
}
|
|
1611
|
-
function
|
|
1618
|
+
function ss({
|
|
1612
1619
|
language: e = navigator.language,
|
|
1613
1620
|
logger: t,
|
|
1614
1621
|
stringSet: n,
|
|
1615
1622
|
children: o
|
|
1616
1623
|
}) {
|
|
1617
|
-
const [s,
|
|
1624
|
+
const [s, i] = _(Ke.get(Me));
|
|
1618
1625
|
return L(() => {
|
|
1619
|
-
const
|
|
1620
|
-
s.language !==
|
|
1626
|
+
const a = os(e);
|
|
1627
|
+
s.language !== a && (t == null || t.debug("localization.useEffect: update language", `${s.language} -> ${a}`), ns(a).then(i));
|
|
1621
1628
|
}, [e]), /* @__PURE__ */ r.createElement(
|
|
1622
|
-
|
|
1629
|
+
rs,
|
|
1623
1630
|
{
|
|
1624
1631
|
value: {
|
|
1625
1632
|
language: s.language,
|
|
1626
1633
|
stringSet: { ...s.stringSet, ...n },
|
|
1627
1634
|
dateLocale: s.dateLocale,
|
|
1628
|
-
format: (
|
|
1635
|
+
format: (a, l, c) => Cn(a, l, { locale: s.dateLocale, ...c })
|
|
1629
1636
|
}
|
|
1630
1637
|
},
|
|
1631
1638
|
o
|
|
@@ -1633,13 +1640,13 @@ function os({
|
|
|
1633
1640
|
}
|
|
1634
1641
|
const Ze = "data-sb-agent-theme", Yt = (e) => (t, ...n) => {
|
|
1635
1642
|
let o = "";
|
|
1636
|
-
return t.forEach((s,
|
|
1637
|
-
o += s + (n[
|
|
1643
|
+
return t.forEach((s, i) => {
|
|
1644
|
+
o += s + (n[i] ?? "");
|
|
1638
1645
|
}), `[${Ze}='${e}'] & { ${o} }`;
|
|
1639
1646
|
}, P = {
|
|
1640
1647
|
light: Yt("light"),
|
|
1641
1648
|
dark: Yt("dark")
|
|
1642
|
-
},
|
|
1649
|
+
}, is = I(({ theme: e }) => {
|
|
1643
1650
|
const { palette: t } = e;
|
|
1644
1651
|
return `
|
|
1645
1652
|
:root,
|
|
@@ -1691,7 +1698,7 @@ const Ze = "data-sb-agent-theme", Yt = (e) => (t, ...n) => {
|
|
|
1691
1698
|
--sendbird-overlay-light: ${t.overlay.light};
|
|
1692
1699
|
}
|
|
1693
1700
|
`;
|
|
1694
|
-
}),
|
|
1701
|
+
}), as = I`[${Ze}='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);}[${Ze}='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);}`, p = {
|
|
1695
1702
|
color: {
|
|
1696
1703
|
primary: {
|
|
1697
1704
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -1732,74 +1739,74 @@ const Ze = "data-sb-agent-theme", Yt = (e) => (t, ...n) => {
|
|
|
1732
1739
|
error: "var(--sb-error)"
|
|
1733
1740
|
}
|
|
1734
1741
|
}, {
|
|
1735
|
-
Provider:
|
|
1736
|
-
useContext:
|
|
1742
|
+
Provider: ls,
|
|
1743
|
+
useContext: cs
|
|
1737
1744
|
} = G("MessengerTheme");
|
|
1738
|
-
function
|
|
1745
|
+
function ds(e) {
|
|
1739
1746
|
const { theme: t, appearance: n, logger: o } = e;
|
|
1740
1747
|
return /* @__PURE__ */ r.createElement(
|
|
1741
|
-
|
|
1748
|
+
Ao,
|
|
1742
1749
|
{
|
|
1743
1750
|
appearance: n,
|
|
1744
1751
|
palette: t == null ? void 0 : t.palette,
|
|
1745
1752
|
typography: t == null ? void 0 : t.typography,
|
|
1746
1753
|
logger: o
|
|
1747
1754
|
},
|
|
1748
|
-
/* @__PURE__ */ r.createElement(
|
|
1755
|
+
/* @__PURE__ */ r.createElement(us, { ...e })
|
|
1749
1756
|
);
|
|
1750
1757
|
}
|
|
1751
|
-
function
|
|
1758
|
+
function us({ rootElement: e = document.body, children: t }) {
|
|
1752
1759
|
const { theme: n, updateTheme: o } = Ct();
|
|
1753
1760
|
return le(() => {
|
|
1754
1761
|
e.setAttribute(Ze, n.selectedTheme);
|
|
1755
|
-
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(
|
|
1762
|
+
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(Ir, { theme: n }, /* @__PURE__ */ r.createElement(ls, { value: { theme: n, updateTheme: o } }, t));
|
|
1756
1763
|
}
|
|
1757
1764
|
function pe(e, t) {
|
|
1758
1765
|
const n = e.getRootNode({ composed: t });
|
|
1759
1766
|
return n instanceof ShadowRoot || n instanceof Document ? n : document;
|
|
1760
1767
|
}
|
|
1761
|
-
const
|
|
1768
|
+
const ms = (e, t) => {
|
|
1762
1769
|
L(() => {
|
|
1763
1770
|
const n = pe(t) instanceof ShadowRoot, o = pe(t, !0);
|
|
1764
1771
|
if (!(n ? t : o).querySelector(`link[href*='${e}']`)) {
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1772
|
+
const i = o.createElement("link");
|
|
1773
|
+
i.rel = "stylesheet", i.href = e, (n ? t : o.head).appendChild(i);
|
|
1767
1774
|
}
|
|
1768
1775
|
}, [e, t]);
|
|
1769
|
-
},
|
|
1776
|
+
}, gs = (e, t = document.body) => {
|
|
1770
1777
|
L(() => {
|
|
1771
1778
|
const n = pe(t), s = n instanceof ShadowRoot ? t : n.head;
|
|
1772
1779
|
if (!s) return;
|
|
1773
|
-
const
|
|
1774
|
-
let
|
|
1775
|
-
|
|
1780
|
+
const i = `sba-${btoa(e).slice(0, 10)}`;
|
|
1781
|
+
let a = s.querySelector(`style#${i}`);
|
|
1782
|
+
a ? a.textContent !== e && (a.textContent = e) : (a = s.ownerDocument.createElement("style"), a.id = i, a.textContent = e, s.appendChild(a));
|
|
1776
1783
|
}, [e, t]);
|
|
1777
|
-
}, _t = /iPad|iPhone|iPod/.test(navigator.userAgent),
|
|
1778
|
-
Provider:
|
|
1784
|
+
}, _t = /iPad|iPhone|iPod/.test(navigator.userAgent), hs = /Android/.test(navigator.userAgent), Oe = (e) => _t || hs, {
|
|
1785
|
+
Provider: ps,
|
|
1779
1786
|
Consumer: In,
|
|
1780
1787
|
useContext: B
|
|
1781
1788
|
} = G("Messenger");
|
|
1782
|
-
function
|
|
1789
|
+
function fs({
|
|
1783
1790
|
children: e,
|
|
1784
1791
|
state: t,
|
|
1785
1792
|
enableCloseConversationButton: n = !1,
|
|
1786
1793
|
enableExpandButton: o = !0,
|
|
1787
1794
|
enableAutoDisconnectInLauncher: s = !0,
|
|
1788
|
-
...
|
|
1795
|
+
...i
|
|
1789
1796
|
}) {
|
|
1790
|
-
const [
|
|
1791
|
-
opened: (t == null ? void 0 : t.opened) ??
|
|
1797
|
+
const [a, l] = _(!1), [c, d] = _(!1), h = {
|
|
1798
|
+
opened: (t == null ? void 0 : t.opened) ?? a,
|
|
1792
1799
|
setOpened: (t == null ? void 0 : t.setOpened) ?? l,
|
|
1793
1800
|
expanded: (t == null ? void 0 : t.expanded) ?? c,
|
|
1794
1801
|
setExpanded: (t == null ? void 0 : t.setExpanded) ?? d
|
|
1795
1802
|
};
|
|
1796
|
-
return /* @__PURE__ */ r.createElement(
|
|
1797
|
-
|
|
1803
|
+
return /* @__PURE__ */ r.createElement(to, { ...i }, (m) => /* @__PURE__ */ r.createElement(
|
|
1804
|
+
ps,
|
|
1798
1805
|
{
|
|
1799
1806
|
value: {
|
|
1800
|
-
...
|
|
1801
|
-
...
|
|
1802
|
-
state:
|
|
1807
|
+
...i,
|
|
1808
|
+
...m,
|
|
1809
|
+
state: h,
|
|
1803
1810
|
enableCloseConversationButton: n,
|
|
1804
1811
|
enableExpandButton: o,
|
|
1805
1812
|
enableAutoDisconnectInLauncher: s
|
|
@@ -1809,41 +1816,41 @@ function ps({
|
|
|
1809
1816
|
));
|
|
1810
1817
|
}
|
|
1811
1818
|
const {
|
|
1812
|
-
Provider:
|
|
1819
|
+
Provider: bs,
|
|
1813
1820
|
useContext: U
|
|
1814
|
-
} = G("MessengerSession"),
|
|
1815
|
-
return /* @__PURE__ */ r.createElement(
|
|
1816
|
-
}),
|
|
1817
|
-
const { chatSDK: n, logger: o, appId: s, aiAgentId:
|
|
1821
|
+
} = G("MessengerSession"), Es = ye(function({ children: e, ...t }, n) {
|
|
1822
|
+
return /* @__PURE__ */ r.createElement(Uo, { ref: n, ...t }, (o) => /* @__PURE__ */ r.createElement(xs, { ...o }, e));
|
|
1823
|
+
}), xs = ({ children: e, ...t }) => {
|
|
1824
|
+
const { chatSDK: n, logger: o, appId: s, aiAgentId: i, agentPreviewConfigs: a, state: l } = B(), { userSessionInfo: c, authenticate: d, setActiveChannel: h, userSession: m, aiAgentInfo: f, launcherInfo: x } = t;
|
|
1818
1825
|
return Xe(n, {
|
|
1819
|
-
async onUserJoined(
|
|
1826
|
+
async onUserJoined(E, b) {
|
|
1820
1827
|
var C, v;
|
|
1821
|
-
if (
|
|
1822
|
-
o.info("messengerSession.onUserJoined: proactive channel joined",
|
|
1823
|
-
const S = ((v =
|
|
1824
|
-
|
|
1828
|
+
if (E.conversation && E.conversation.type === Dr.PROACTIVE && b.userId === ((C = n.currentUser) == null ? void 0 : C.userId)) {
|
|
1829
|
+
o.info("messengerSession.onUserJoined: proactive channel joined", E.url);
|
|
1830
|
+
const S = ((v = E.conversation) == null ? void 0 : v.status) ?? W.OPEN;
|
|
1831
|
+
h({ url: E.url, status: S }), l.setOpened(!0), Cs({ sound: document.hidden || !l.opened });
|
|
1825
1832
|
}
|
|
1826
1833
|
}
|
|
1827
1834
|
}), L(() => {
|
|
1828
|
-
d().then(({ launcher:
|
|
1829
|
-
|
|
1830
|
-
}).catch((
|
|
1831
|
-
o.error("messengerSession: failed to initialize",
|
|
1835
|
+
d().then(({ launcher: E }) => {
|
|
1836
|
+
E.auto_open && !Oe() && setTimeout(() => l.setOpened(!0), 500);
|
|
1837
|
+
}).catch((E) => {
|
|
1838
|
+
o.error("messengerSession: failed to initialize", E);
|
|
1832
1839
|
});
|
|
1833
|
-
}, [n, s,
|
|
1834
|
-
|
|
1840
|
+
}, [n, s, i, c == null ? void 0 : c.userId, c == null ? void 0 : c.authToken]), !m || !f || !x ? null : /* @__PURE__ */ r.createElement(
|
|
1841
|
+
bs,
|
|
1835
1842
|
{
|
|
1836
1843
|
value: {
|
|
1837
1844
|
...t,
|
|
1838
|
-
userSession:
|
|
1839
|
-
aiAgentInfo: { ...f, ...
|
|
1840
|
-
launcherInfo: { ...x, ...
|
|
1845
|
+
userSession: m,
|
|
1846
|
+
aiAgentInfo: { ...f, ...a == null ? void 0 : a.bot },
|
|
1847
|
+
launcherInfo: { ...x, ...a == null ? void 0 : a.launcher }
|
|
1841
1848
|
}
|
|
1842
1849
|
},
|
|
1843
1850
|
e
|
|
1844
1851
|
);
|
|
1845
1852
|
};
|
|
1846
|
-
function
|
|
1853
|
+
function Cs({ sound: e }) {
|
|
1847
1854
|
const t = "🔔You have received a new message", n = document.title, o = setInterval(() => {
|
|
1848
1855
|
document.title = document.title === t ? n : t;
|
|
1849
1856
|
}, 750);
|
|
@@ -1860,20 +1867,20 @@ const j = (e) => {
|
|
|
1860
1867
|
color: n,
|
|
1861
1868
|
className: o,
|
|
1862
1869
|
...s
|
|
1863
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
1870
|
+
}) => /* @__PURE__ */ r.createElement(ys, { as: e, $variant: t, className: o, $color: n, ...s }), qt = /* @__PURE__ */ new WeakMap(), vs = (e, t) => {
|
|
1864
1871
|
let n = qt.get(t);
|
|
1865
1872
|
n || (n = /* @__PURE__ */ new Map(), qt.set(t, n));
|
|
1866
1873
|
const o = n.get(e);
|
|
1867
1874
|
if (o) return o;
|
|
1868
|
-
const s = t[e] ?? t.body1,
|
|
1875
|
+
const s = t[e] ?? t.body1, i = I`font-size:${j(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily ? `font-family: ${s.fontFamily};` : ""}
|
|
1869
1876
|
${s.lineHeight ? `line-height: ${s.lineHeight};` : "line-height: 100%;"}
|
|
1870
1877
|
`;
|
|
1871
|
-
return n.set(e,
|
|
1872
|
-
},
|
|
1873
|
-
ENTRY: `${
|
|
1874
|
-
MODAL_ROOT: `${
|
|
1875
|
-
WINDOW: `${
|
|
1876
|
-
LAUNCHER: `${
|
|
1878
|
+
return n.set(e, i), i;
|
|
1879
|
+
}, ys = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => vs(e, t.typography)}color:${({ $color: e }) => e};`, J = "sb-agent", ee = {
|
|
1880
|
+
ENTRY: `${J}-entry`,
|
|
1881
|
+
MODAL_ROOT: `${J}-modal-root`,
|
|
1882
|
+
WINDOW: `${J}-window`,
|
|
1883
|
+
LAUNCHER: `${J}-launcher`
|
|
1877
1884
|
}, Ue = 2147483647, fe = {
|
|
1878
1885
|
MODAL: Ue - 1,
|
|
1879
1886
|
// FIXME: need to cover the case where the tooltip is on the top of the modal
|
|
@@ -1883,14 +1890,14 @@ const j = (e) => {
|
|
|
1883
1890
|
}, $n = {
|
|
1884
1891
|
DEFAULT_PRIMARY: "#742ddd",
|
|
1885
1892
|
WHITE: "#ffffff"
|
|
1886
|
-
}, Mn = 36,
|
|
1893
|
+
}, Mn = 36, _s = 100, Ss = 25 * 1024 * 1024, On = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], St = "noopener noreferrer nofollow", Le = 244, Ln = 640, Ye = 26, Rn = 4, te = 12, Te = 2, Ts = 16, ne = `${J}-incoming-msg`, ws = `${J}-marked-text`;
|
|
1887
1894
|
function Tt(e) {
|
|
1888
1895
|
switch (e) {
|
|
1889
1896
|
case "top":
|
|
1890
1897
|
case "middle":
|
|
1891
1898
|
return Te;
|
|
1892
1899
|
default:
|
|
1893
|
-
return
|
|
1900
|
+
return Ts;
|
|
1894
1901
|
}
|
|
1895
1902
|
}
|
|
1896
1903
|
function wt(e, t) {
|
|
@@ -1909,7 +1916,7 @@ function wt(e, t) {
|
|
|
1909
1916
|
function Dn(e) {
|
|
1910
1917
|
return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
|
|
1911
1918
|
}
|
|
1912
|
-
const
|
|
1919
|
+
const As = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), ks = {
|
|
1913
1920
|
spinner: T(() => import("./BcUGcaq2.js")),
|
|
1914
1921
|
chat: T(() => import("./DcFCGVBm.js")),
|
|
1915
1922
|
message: T(() => import("./DsGXnanX.js")),
|
|
@@ -1945,18 +1952,18 @@ const ws = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"])
|
|
|
1945
1952
|
template: T(() => import("./awO7aBCv.js")),
|
|
1946
1953
|
source: T(() => import("./_EVMCh6Y.js"))
|
|
1947
1954
|
}, M = ({ type: e, size: t = 24, className: n, color: o }) => {
|
|
1948
|
-
const s =
|
|
1955
|
+
const s = ks[e];
|
|
1949
1956
|
return /* @__PURE__ */ r.createElement(
|
|
1950
|
-
|
|
1957
|
+
$s,
|
|
1951
1958
|
{
|
|
1952
1959
|
className: n,
|
|
1953
|
-
$rtlFlip:
|
|
1960
|
+
$rtlFlip: As.has(e),
|
|
1954
1961
|
$size: t,
|
|
1955
1962
|
$color: o ?? p.color.primary.main
|
|
1956
1963
|
},
|
|
1957
1964
|
/* @__PURE__ */ r.createElement(ke, { fallback: null }, /* @__PURE__ */ r.createElement(s, null))
|
|
1958
1965
|
);
|
|
1959
|
-
},
|
|
1966
|
+
}, Is = I`[dir='rtl'] &{transform:scaleX(-1);}`, $s = u.div`width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(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 && Is};`;
|
|
1960
1967
|
function At({
|
|
1961
1968
|
name: e,
|
|
1962
1969
|
type: t = "FILE",
|
|
@@ -1964,12 +1971,12 @@ function At({
|
|
|
1964
1971
|
iconBackgroundColor: o,
|
|
1965
1972
|
onClick: s
|
|
1966
1973
|
}) {
|
|
1967
|
-
const { colors:
|
|
1968
|
-
return /* @__PURE__ */ r.createElement(
|
|
1974
|
+
const { colors: i } = xt();
|
|
1975
|
+
return /* @__PURE__ */ r.createElement(Ms, { onClick: s, $clickable: !!s }, /* @__PURE__ */ r.createElement(Ls, { $bgColor: o ?? i.base.primary }, /* @__PURE__ */ r.createElement(M, { type: "file-document", size: 24, color: n ?? i.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Rs, null, /* @__PURE__ */ r.createElement(Ds, { variant: "button", color: p.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(w, { color: p.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
1969
1976
|
}
|
|
1970
|
-
const
|
|
1971
|
-
function
|
|
1972
|
-
return /* @__PURE__ */ r.createElement(
|
|
1977
|
+
const Ms = u.div`border-radius:12px;gap:8px;width:${Le}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${p.themedColor.textDisabled};background-color:${p.themedColor.bg_50_600};${({ $clickable: e }) => e && Os}`, Os = I`cursor:pointer;&:hover{background-color:${p.themedColor.bg_100_500};}`, Ls = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Rs = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ds = u(w)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
1978
|
+
function Ns({ file: e, children: t, onClickFile: n }) {
|
|
1979
|
+
return /* @__PURE__ */ r.createElement(Ps, null, /* @__PURE__ */ r.createElement(
|
|
1973
1980
|
At,
|
|
1974
1981
|
{
|
|
1975
1982
|
name: e.name,
|
|
@@ -1978,63 +1985,63 @@ function Ds({ file: e, children: t, onClickFile: n }) {
|
|
|
1978
1985
|
}
|
|
1979
1986
|
), t);
|
|
1980
1987
|
}
|
|
1981
|
-
const
|
|
1982
|
-
function
|
|
1983
|
-
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(
|
|
1988
|
+
const Ps = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`;
|
|
1989
|
+
function Bs({ file: e, onClickMedia: t, children: n }) {
|
|
1990
|
+
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Hs, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(zs, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
|
|
1984
1991
|
if (o) {
|
|
1985
1992
|
const s = {
|
|
1986
|
-
id: `${
|
|
1993
|
+
id: `${ne}-media-body`,
|
|
1987
1994
|
onClick: () => t == null ? void 0 : t(e)
|
|
1988
1995
|
};
|
|
1989
|
-
return /* @__PURE__ */ r.createElement(
|
|
1996
|
+
return /* @__PURE__ */ r.createElement(Fs, null, /* @__PURE__ */ r.createElement(Us, { ...s }, o()), n);
|
|
1990
1997
|
}
|
|
1991
1998
|
return null;
|
|
1992
1999
|
}
|
|
1993
|
-
const
|
|
2000
|
+
const Fs = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${Te}px;`, Us = u.div`width:${Le}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${P.light`
|
|
1994
2001
|
background-color: ${p.color.background100};
|
|
1995
2002
|
`}
|
|
1996
2003
|
${P.dark`
|
|
1997
2004
|
background-color: ${p.color.background400};
|
|
1998
2005
|
`}
|
|
1999
|
-
`,
|
|
2006
|
+
`, Hs = u.img`width:100%;height:100%;object-fit:cover;`, zs = u.video`width:100%;height:100%;object-fit:cover;`, Vs = "✱";
|
|
2000
2007
|
function Nn(e) {
|
|
2001
|
-
const t = new RegExp(`${
|
|
2002
|
-
return e.replace(t, (n) => `<span id=${
|
|
2008
|
+
const t = new RegExp(`${Vs}+`, "g");
|
|
2009
|
+
return e.replace(t, (n) => `<span id=${ws} aria-label="masked-text">${n}</span>`);
|
|
2003
2010
|
}
|
|
2004
|
-
function
|
|
2011
|
+
function Ws(e) {
|
|
2005
2012
|
return e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>");
|
|
2006
2013
|
}
|
|
2007
|
-
function
|
|
2014
|
+
function Gs(e) {
|
|
2008
2015
|
const t = /```(\w+)?\n([\s\S]*?)```/g, n = [];
|
|
2009
2016
|
let o = 0;
|
|
2010
|
-
return e.replace(t, (s, ...
|
|
2011
|
-
const [
|
|
2017
|
+
return e.replace(t, (s, ...i) => {
|
|
2018
|
+
const [a, l, c] = i;
|
|
2012
2019
|
return o < c && n.push({
|
|
2013
2020
|
type: "text",
|
|
2014
2021
|
value: e.slice(o, c).trim()
|
|
2015
2022
|
}), n.push({
|
|
2016
2023
|
type: "code",
|
|
2017
2024
|
value: l.trim(),
|
|
2018
|
-
language:
|
|
2025
|
+
language: a ? a.trim() : "plaintext"
|
|
2019
2026
|
}), o = c + s.length, s;
|
|
2020
2027
|
}), o < e.length && n.push({
|
|
2021
2028
|
type: "text",
|
|
2022
2029
|
value: e.slice(o).trim()
|
|
2023
2030
|
}), n.map((s) => s.type !== "text" ? s : { ...s, value: Nn(s.value) });
|
|
2024
2031
|
}
|
|
2025
|
-
const
|
|
2032
|
+
const js = T(async () => ({ default: (await import("./D5uRw0Em.js")).MarkdownText })), Ks = T(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
|
|
2026
2033
|
function Jt(e) {
|
|
2027
|
-
var s,
|
|
2028
|
-
const t = e.maxBodyWidth ?? Le, n = ae(() =>
|
|
2029
|
-
id: `${
|
|
2034
|
+
var s, i;
|
|
2035
|
+
const t = e.maxBodyWidth ?? Le, n = ae(() => Gs(e.message), [e.message]), o = {
|
|
2036
|
+
id: `${ne}-text-body`,
|
|
2030
2037
|
$maxWidth: t,
|
|
2031
2038
|
$color: (s = e.customStyle) == null ? void 0 : s.bubbleContentColor,
|
|
2032
|
-
$bgColor: (
|
|
2039
|
+
$bgColor: (i = e.customStyle) == null ? void 0 : i.bubbleBackgroundColor
|
|
2033
2040
|
};
|
|
2034
|
-
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Xt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Xt, { ...o }, n.map((
|
|
2041
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Xt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Xt, { ...o }, n.map((a, l) => a.type === "text" ? /* @__PURE__ */ r.createElement(Qt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(ke, { fallback: a.value }, /* @__PURE__ */ r.createElement(js, { onClickImage: (c) => {
|
|
2035
2042
|
var d;
|
|
2036
2043
|
return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
|
|
2037
|
-
} },
|
|
2044
|
+
} }, a.value))) : a.type === "code" ? /* @__PURE__ */ r.createElement(ke, { key: l, fallback: /* @__PURE__ */ r.createElement(Qt, { variant: "body3" }, a.value) }, /* @__PURE__ */ r.createElement(Ks, { code: a.value, language: a.language })) : null), e.children);
|
|
2038
2045
|
}
|
|
2039
2046
|
const Xt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
|
|
2040
2047
|
color: ${t || e.colors.messageIncoming.text};
|
|
@@ -2044,38 +2051,38 @@ const Xt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:
|
|
|
2044
2051
|
transition: max-width 0.3s;
|
|
2045
2052
|
overflow-wrap: break-word;
|
|
2046
2053
|
`, Qt = u(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2047
|
-
function
|
|
2054
|
+
function Zs(e) {
|
|
2048
2055
|
const { stringSet: t } = O(), n = Dn(e) ? /* @__PURE__ */ r.createElement(Jt, { ...e }) : null;
|
|
2049
2056
|
if (e.messageType === "user")
|
|
2050
2057
|
return n;
|
|
2051
2058
|
if (e.messageType === "file") {
|
|
2052
2059
|
const o = e.file;
|
|
2053
|
-
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(
|
|
2060
|
+
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Bs, { ...e }, n) : /* @__PURE__ */ r.createElement(Ns, { ...e }, n);
|
|
2054
2061
|
}
|
|
2055
2062
|
return /* @__PURE__ */ r.createElement(Jt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
2056
2063
|
}
|
|
2057
2064
|
const kt = (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" }));
|
|
2058
2065
|
function It({ id: e, src: t, size: n = 56, onClick: o, style: s }) {
|
|
2059
|
-
return /* @__PURE__ */ r.createElement(
|
|
2066
|
+
return /* @__PURE__ */ r.createElement(Ys, { id: e, tabIndex: 0, onClick: o, $size: j(n), style: s }, t ? /* @__PURE__ */ r.createElement(qs, { src: t }) : /* @__PURE__ */ r.createElement(M, { type: "user", size: n }));
|
|
2060
2067
|
}
|
|
2061
|
-
const
|
|
2062
|
-
function
|
|
2063
|
-
const n = `${
|
|
2064
|
-
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(
|
|
2068
|
+
const Ys = u.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${p.themedColor.bg_100_500};&:focus{outline:none;}`, qs = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
2069
|
+
function Js({ sender: e, isBotMessage: t }) {
|
|
2070
|
+
const n = `${ne}-sender-avatar`;
|
|
2071
|
+
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Xs, { id: n }, /* @__PURE__ */ r.createElement(kt, null)) : /* @__PURE__ */ r.createElement(It, { id: n, size: Ye, src: e.profileUrl });
|
|
2065
2072
|
}
|
|
2066
|
-
const
|
|
2067
|
-
function
|
|
2068
|
-
return /* @__PURE__ */ r.createElement(
|
|
2073
|
+
const Xs = u.div`flex-shrink:0;width:${Ye}px;height:${Ye}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};}}`;
|
|
2074
|
+
function Qs({ sender: e }) {
|
|
2075
|
+
return /* @__PURE__ */ r.createElement(ei, { id: `${ne}-sender-name`, variant: "caption1", color: p.themedColor.textMidEmphasis }, e.nickname);
|
|
2069
2076
|
}
|
|
2070
|
-
const
|
|
2071
|
-
function
|
|
2077
|
+
const ei = u(w)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
2078
|
+
function ti({ createdAt: e }) {
|
|
2072
2079
|
const { stringSet: t, format: n } = O();
|
|
2073
|
-
return e ? /* @__PURE__ */ r.createElement(w, { id: `${
|
|
2080
|
+
return e ? /* @__PURE__ */ r.createElement(w, { id: `${ne}-sent-time`, variant: "caption4", color: p.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2074
2081
|
}
|
|
2075
|
-
function
|
|
2076
|
-
return /* @__PURE__ */ r.createElement(
|
|
2082
|
+
function ni({ customStyle: e }) {
|
|
2083
|
+
return /* @__PURE__ */ r.createElement(ri, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(oi, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
|
|
2077
2084
|
}
|
|
2078
|
-
const
|
|
2085
|
+
const ri = u.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};`, oi = u.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;}`;
|
|
2079
2086
|
function Ie() {
|
|
2080
2087
|
}
|
|
2081
2088
|
async function $t(e) {
|
|
@@ -2093,41 +2100,41 @@ function Fn(e) {
|
|
|
2093
2100
|
const t = (n = e == null ? void 0 : e.conversation) == null ? void 0 : n.handoff;
|
|
2094
2101
|
return !!(t != null && t.timestamp);
|
|
2095
2102
|
}
|
|
2096
|
-
function
|
|
2103
|
+
function si(e) {
|
|
2097
2104
|
return Bn(e) && !Fn(e);
|
|
2098
2105
|
}
|
|
2099
|
-
function
|
|
2106
|
+
function ii({
|
|
2100
2107
|
extendedMessagePayload: e,
|
|
2101
2108
|
onClickCTA: t = ({ url: n }) => $t(n)
|
|
2102
2109
|
}) {
|
|
2103
2110
|
const n = e == null ? void 0 : e.cta_button;
|
|
2104
|
-
return n ? /* @__PURE__ */ r.createElement(
|
|
2111
|
+
return n ? /* @__PURE__ */ r.createElement(ai, { id: `${ne}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(li, { variant: "button" }, n.label)) : null;
|
|
2105
2112
|
}
|
|
2106
|
-
const
|
|
2113
|
+
const ai = u.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${p.themedColor.textHighEmphasis};background-color:${p.color.background50};${P.dark`
|
|
2107
2114
|
background-color: ${p.color.ondark.textDisabled};
|
|
2108
2115
|
`}
|
|
2109
|
-
`,
|
|
2110
|
-
function
|
|
2116
|
+
`, li = u(w)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
|
|
2117
|
+
function ci({
|
|
2111
2118
|
extendedMessagePayload: e,
|
|
2112
2119
|
onClickCitation: t = (n) => $t(n.link)
|
|
2113
2120
|
}) {
|
|
2114
2121
|
const { stringSet: n } = O(), { theme: o } = Ct(), s = e == null ? void 0 : e.citations;
|
|
2115
|
-
return !s || s.length === 0 ? null : /* @__PURE__ */ r.createElement(
|
|
2116
|
-
|
|
2122
|
+
return !s || s.length === 0 ? null : /* @__PURE__ */ r.createElement(di, { id: `${ne}-ext-citation` }, /* @__PURE__ */ r.createElement(ui, { variant: "caption1", color: o.colors.messageIncoming.text }, n.CITATION_SOURCE_TITLE), /* @__PURE__ */ r.createElement(mi, null, s.map((i, a) => /* @__PURE__ */ r.createElement(
|
|
2123
|
+
hi,
|
|
2117
2124
|
{
|
|
2118
|
-
key: `${
|
|
2125
|
+
key: `${i.embedding_id}-${a}`,
|
|
2119
2126
|
role: "button",
|
|
2120
|
-
onClick: () => t(
|
|
2127
|
+
onClick: () => t(i)
|
|
2121
2128
|
},
|
|
2122
2129
|
/* @__PURE__ */ r.createElement(M, { type: "source", size: 16, color: o.colors.messageIncoming.text }),
|
|
2123
|
-
/* @__PURE__ */ r.createElement(
|
|
2130
|
+
/* @__PURE__ */ r.createElement(gi, { variant: "body3", color: o.colors.messageIncoming.text }, i.title)
|
|
2124
2131
|
))));
|
|
2125
2132
|
}
|
|
2126
|
-
const
|
|
2127
|
-
function
|
|
2133
|
+
const di = u.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;padding:8px 12px 6px;`, ui = u(w)`opacity:0.5;`, mi = u.div`display:flex;flex-direction:column;gap:8px;`, gi = u(w)`text-decoration:underline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, hi = u.div`display:flex;align-items:center;gap:4px;cursor:pointer;&:hover{opacity:0.5;}`;
|
|
2134
|
+
function pi(e) {
|
|
2128
2135
|
return /* @__PURE__ */ r.createElement(r.Fragment, null);
|
|
2129
2136
|
}
|
|
2130
|
-
class
|
|
2137
|
+
class fi extends xr {
|
|
2131
2138
|
constructor(t) {
|
|
2132
2139
|
super(t), this.state = {
|
|
2133
2140
|
hasError: !1
|
|
@@ -2140,126 +2147,126 @@ class pi extends xr {
|
|
|
2140
2147
|
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(ke, { fallback: this.props.loadingFallback }, this.props.children);
|
|
2141
2148
|
}
|
|
2142
2149
|
}
|
|
2143
|
-
const
|
|
2144
|
-
parser:
|
|
2145
|
-
renderer:
|
|
2150
|
+
const bi = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: Ei } = Vr({
|
|
2151
|
+
parser: Hr,
|
|
2152
|
+
renderer: Ur,
|
|
2146
2153
|
Container: (e) => /* @__PURE__ */ r.createElement("div", { ...e })
|
|
2147
2154
|
});
|
|
2148
|
-
function
|
|
2155
|
+
function xi(e) {
|
|
2149
2156
|
return /* @__PURE__ */ r.createElement(
|
|
2150
|
-
|
|
2157
|
+
fi,
|
|
2151
2158
|
{
|
|
2152
2159
|
errorFallback: e.messageTemplateErrorFallback,
|
|
2153
2160
|
loadingFallback: e.messageTemplateLoadingFallback
|
|
2154
2161
|
},
|
|
2155
|
-
/* @__PURE__ */ r.createElement(
|
|
2162
|
+
/* @__PURE__ */ r.createElement(Ci, { ...e })
|
|
2156
2163
|
);
|
|
2157
2164
|
}
|
|
2158
|
-
const
|
|
2165
|
+
const Ci = ({
|
|
2159
2166
|
extendedMessagePayload: e,
|
|
2160
2167
|
onGetCachedMessageTemplate: t = () => null,
|
|
2161
2168
|
onRequestMessageTemplate: n,
|
|
2162
2169
|
onHandleTemplateInternalAction: o = Ie
|
|
2163
2170
|
}) => {
|
|
2164
2171
|
const s = e == null ? void 0 : e.message_template;
|
|
2165
|
-
if (!
|
|
2172
|
+
if (!bi.has((s == null ? void 0 : s.type) ?? "default")) throw new Error("Unsupported template type");
|
|
2166
2173
|
if (!n) throw new Error("onRequestMessageTemplate is required");
|
|
2167
|
-
const { theme:
|
|
2174
|
+
const { theme: a } = cs(), l = Yo({
|
|
2168
2175
|
onRequestTemplate: n,
|
|
2169
2176
|
onGetCachedTemplate: t,
|
|
2170
|
-
theme:
|
|
2177
|
+
theme: a.selectedTheme,
|
|
2171
2178
|
templateKey: (s == null ? void 0 : s.key) ?? "invalid",
|
|
2172
2179
|
variables: s == null ? void 0 : s.variables,
|
|
2173
2180
|
viewVariables: s == null ? void 0 : s.view_variables,
|
|
2174
|
-
aiAgentColorVariables:
|
|
2181
|
+
aiAgentColorVariables: a.aiAgentColorVariables
|
|
2175
2182
|
});
|
|
2176
|
-
return /* @__PURE__ */ r.createElement(
|
|
2177
|
-
|
|
2183
|
+
return /* @__PURE__ */ r.createElement(vi, { id: `${ne}-ext-message-template` }, /* @__PURE__ */ r.createElement(
|
|
2184
|
+
zr,
|
|
2178
2185
|
{
|
|
2179
2186
|
handleInternalAction: (c, d) => {
|
|
2180
2187
|
c.stopPropagation(), o == null || o(d);
|
|
2181
2188
|
}
|
|
2182
2189
|
},
|
|
2183
|
-
/* @__PURE__ */ r.createElement(
|
|
2190
|
+
/* @__PURE__ */ r.createElement(Ei, { templateItems: l.body.items, templateVersion: l.version })
|
|
2184
2191
|
));
|
|
2185
|
-
},
|
|
2186
|
-
function
|
|
2192
|
+
}, vi = u.div`box-sizing:border-box;overflow:hidden;width:100%;`;
|
|
2193
|
+
function yi({
|
|
2187
2194
|
extendedMessagePayload: e,
|
|
2188
2195
|
onClickSuggestedReply: t,
|
|
2189
2196
|
suggestedRepliesDirection: n = "vertical"
|
|
2190
2197
|
}) {
|
|
2191
|
-
const [o, s] = _(!1),
|
|
2192
|
-
return
|
|
2193
|
-
|
|
2198
|
+
const [o, s] = _(!1), i = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
2199
|
+
return i.length === 0 || o ? null : /* @__PURE__ */ r.createElement(_i, { id: `${ne}-ext-suggested-replies`, $type: n }, i.map((a, l) => /* @__PURE__ */ r.createElement(
|
|
2200
|
+
Si,
|
|
2194
2201
|
{
|
|
2195
2202
|
key: l,
|
|
2196
2203
|
$type: n,
|
|
2197
2204
|
variant: "body3",
|
|
2198
2205
|
onClick: () => {
|
|
2199
|
-
t && (t == null || t({ reply:
|
|
2206
|
+
t && (t == null || t({ reply: a }), s(!0));
|
|
2200
2207
|
}
|
|
2201
2208
|
},
|
|
2202
|
-
|
|
2209
|
+
a
|
|
2203
2210
|
)));
|
|
2204
2211
|
}
|
|
2205
|
-
const
|
|
2206
|
-
${e === "vertical" ?
|
|
2212
|
+
const _i = u.div`margin:16px 0;padding:0 ${te}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? Ti : wi};`, Si = u(w)`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:${p.color.primary.main};border:1px solid ${p.color.primary.main};background-color:${p.themedColor.bg_50_600};&:hover{background-color:${p.themedColor.bg_100_500};}${({ $type: e, theme: t }) => I`
|
|
2213
|
+
${e === "vertical" ? Ai : ki};
|
|
2207
2214
|
&:active {
|
|
2208
2215
|
background-color: ${t.colors.base.primary};
|
|
2209
2216
|
color: ${t.colors.base.primaryContrastContent};
|
|
2210
2217
|
}
|
|
2211
2218
|
`}
|
|
2212
|
-
`,
|
|
2219
|
+
`, Ti = I`flex-direction:column;align-items:flex-end;`, wi = I`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Ai = I`max-width:calc(100% - 70px);white-space:pre-wrap;`, ki = I`white-space:nowrap;`;
|
|
2213
2220
|
function Mt(e) {
|
|
2214
2221
|
return e();
|
|
2215
2222
|
}
|
|
2216
2223
|
const xe = _e({
|
|
2217
|
-
template:
|
|
2224
|
+
template: Ii,
|
|
2218
2225
|
components: {
|
|
2219
|
-
SenderName:
|
|
2220
|
-
SenderAvatar:
|
|
2221
|
-
SentTime:
|
|
2222
|
-
MessageBody:
|
|
2223
|
-
TypingIndicator:
|
|
2224
|
-
SuggestedReplies:
|
|
2225
|
-
MessageTemplate:
|
|
2226
|
-
CTAButton:
|
|
2227
|
-
Citation:
|
|
2228
|
-
MessageLogs:
|
|
2226
|
+
SenderName: Qs,
|
|
2227
|
+
SenderAvatar: Js,
|
|
2228
|
+
SentTime: ti,
|
|
2229
|
+
MessageBody: Zs,
|
|
2230
|
+
TypingIndicator: ni,
|
|
2231
|
+
SuggestedReplies: yi,
|
|
2232
|
+
MessageTemplate: xi,
|
|
2233
|
+
CTAButton: ii,
|
|
2234
|
+
Citation: ci,
|
|
2235
|
+
MessageLogs: pi
|
|
2229
2236
|
}
|
|
2230
2237
|
});
|
|
2231
|
-
function
|
|
2238
|
+
function Ii(e) {
|
|
2232
2239
|
return /* @__PURE__ */ r.createElement(Un, { ...e, testerMode: !1 });
|
|
2233
2240
|
}
|
|
2234
2241
|
function Un(e) {
|
|
2235
|
-
var f, x,
|
|
2236
|
-
const { components: t } = xe.useContext(), n = !!e.isTyping, o = e.testerMode, s = !!((f = e.extendedMessagePayload) != null && f.message_template),
|
|
2237
|
-
return /* @__PURE__ */ r.createElement(
|
|
2242
|
+
var f, x, E, b, g;
|
|
2243
|
+
const { components: t } = xe.useContext(), n = !!e.isTyping, o = e.testerMode, s = !!((f = e.extendedMessagePayload) != null && f.message_template), i = !!((x = e.extendedMessagePayload) != null && x.cta_button), a = !!((E = e.extendedMessagePayload) != null && E.citations) && e.extendedMessagePayload.citations.length > 0, l = !!e.createdAt, c = Mt(() => e.messageType === "user" ? e.message.length > 0 : !0), d = e.groupType === "top" || e.groupType === "single", h = e.groupType === "bottom" || e.groupType === "single", m = o ? 0 : Ye;
|
|
2244
|
+
return /* @__PURE__ */ r.createElement($i, { $marginBottom: n ? 0 : Tt(e.groupType) }, d && /* @__PURE__ */ r.createElement(Mi, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Ut, null, /* @__PURE__ */ r.createElement(at, { $extraStartPadding: m }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, i && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })), a && /* @__PURE__ */ r.createElement(t.Citation, { ...e }))), s && /* @__PURE__ */ r.createElement(en, { $startPadding: 0, $endPadding: 0, style: { marginTop: c ? Te : 0 } }, /* @__PURE__ */ r.createElement(
|
|
2238
2245
|
t.MessageTemplate,
|
|
2239
2246
|
{
|
|
2240
2247
|
...e,
|
|
2241
|
-
messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding:
|
|
2248
|
+
messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(
|
|
2242
2249
|
t.MessageBody,
|
|
2243
2250
|
{
|
|
2244
2251
|
...e,
|
|
2245
2252
|
messageType: "user",
|
|
2246
|
-
message: ((
|
|
2253
|
+
message: ((g = (b = e.extendedMessagePayload) == null ? void 0 : b.message_template) == null ? void 0 : g.fallback_message) ?? "Cannot read this template."
|
|
2247
2254
|
}
|
|
2248
2255
|
)),
|
|
2249
|
-
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding:
|
|
2256
|
+
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(at, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
|
|
2250
2257
|
}
|
|
2251
|
-
))),
|
|
2258
|
+
))), h && l && /* @__PURE__ */ r.createElement(Oi, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Ut, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(en, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
|
|
2252
2259
|
}
|
|
2253
|
-
const
|
|
2254
|
-
`, tt = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e =
|
|
2260
|
+
const $i = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2261
|
+
`, tt = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = te, $endPadding: t = te, $extraStartPadding: n = 0 }) => `
|
|
2255
2262
|
padding-inline: ${e + n}px ${t}px;
|
|
2256
2263
|
`}
|
|
2257
|
-
`,
|
|
2264
|
+
`, Mi = u(tt)`display:flex;flex-direction:row;align-items:center;gap:8px;`, at = u(tt)`display:flex;`, Oi = u(tt)`margin-top:${Rn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, en = u(tt)`display:flex;flex-direction:column;${({ $startPadding: e = te, $endPadding: t = te, $extraStartPadding: n = 0 }) => `
|
|
2258
2265
|
padding-inline: ${e + n}px ${t}px;
|
|
2259
2266
|
`}
|
|
2260
2267
|
`;
|
|
2261
|
-
function
|
|
2262
|
-
return /* @__PURE__ */ r.createElement(
|
|
2268
|
+
function Li({ file: e, children: t, onClickFile: n }) {
|
|
2269
|
+
return /* @__PURE__ */ r.createElement(Ri, null, /* @__PURE__ */ r.createElement(
|
|
2263
2270
|
At,
|
|
2264
2271
|
{
|
|
2265
2272
|
name: e.name,
|
|
@@ -2268,54 +2275,54 @@ function Oi({ file: e, children: t, onClickFile: n }) {
|
|
|
2268
2275
|
}
|
|
2269
2276
|
), t);
|
|
2270
2277
|
}
|
|
2271
|
-
const
|
|
2272
|
-
function
|
|
2273
|
-
const { aspectRatio: s, localFile:
|
|
2278
|
+
const Ri = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Hn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(Di, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(M, { type: "spinner", size: n })), Di = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
2279
|
+
function Ni({ file: e, metadata: t, onClickMedia: n, children: o }) {
|
|
2280
|
+
const { aspectRatio: s, localFile: i } = t, [a] = _(() => i instanceof File ? URL.createObjectURL(i) : e.url), [l, c] = _(!1), d = {
|
|
2274
2281
|
onClick: () => n == null ? void 0 : n(e),
|
|
2275
2282
|
$ratio: s
|
|
2276
2283
|
};
|
|
2277
|
-
return /* @__PURE__ */ r.createElement(
|
|
2284
|
+
return /* @__PURE__ */ r.createElement(Pi, null, /* @__PURE__ */ r.createElement(Bi, { ...d }, !l && /* @__PURE__ */ r.createElement(Hn, { size: 26 }, /* @__PURE__ */ r.createElement(M, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Fi, { $loaded: l, src: a, alt: "image-message", onLoad: () => c(!0) })), o);
|
|
2278
2285
|
}
|
|
2279
|
-
const
|
|
2286
|
+
const Pi = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${Te}px;`, Bi = u.div`width:${Le}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;${P.light`
|
|
2280
2287
|
background-color: ${p.color.background100};
|
|
2281
2288
|
`}
|
|
2282
2289
|
${P.dark`
|
|
2283
2290
|
background-color: ${p.color.background400};
|
|
2284
2291
|
`}
|
|
2285
|
-
`,
|
|
2292
|
+
`, Fi = u.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;`;
|
|
2286
2293
|
function tn(e) {
|
|
2287
2294
|
var n, o;
|
|
2288
2295
|
const t = ae(() => {
|
|
2289
|
-
const s =
|
|
2296
|
+
const s = Ws(Nn(e.message));
|
|
2290
2297
|
return yn.sanitize(s);
|
|
2291
2298
|
}, [e.message]);
|
|
2292
2299
|
return /* @__PURE__ */ r.createElement(
|
|
2293
|
-
|
|
2300
|
+
Ui,
|
|
2294
2301
|
{
|
|
2295
2302
|
$maxWidth: e.maxBodyWidth ?? Le,
|
|
2296
2303
|
$color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
|
|
2297
2304
|
$bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
|
|
2298
2305
|
},
|
|
2299
|
-
/* @__PURE__ */ r.createElement(
|
|
2306
|
+
/* @__PURE__ */ r.createElement(Hi, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
|
|
2300
2307
|
);
|
|
2301
2308
|
}
|
|
2302
|
-
const
|
|
2309
|
+
const Ui = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
|
|
2303
2310
|
color: ${t || e.colors.messageOutgoing.text};
|
|
2304
2311
|
background-color: ${n || e.colors.messageOutgoing.background};
|
|
2305
2312
|
`}
|
|
2306
2313
|
padding: 12px 0;
|
|
2307
2314
|
transition: max-width 0.3s;
|
|
2308
2315
|
overflow-wrap: break-word;
|
|
2309
|
-
`,
|
|
2310
|
-
function
|
|
2316
|
+
`, Hi = u(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2317
|
+
function zi(e) {
|
|
2311
2318
|
const { stringSet: t } = O(), n = Dn(e) ? /* @__PURE__ */ r.createElement(tn, { ...e }) : null;
|
|
2312
|
-
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(
|
|
2319
|
+
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Ni, { ...e }, n) : /* @__PURE__ */ r.createElement(Li, { ...e }, n) : /* @__PURE__ */ r.createElement(tn, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
2313
2320
|
}
|
|
2314
|
-
function
|
|
2321
|
+
function Vi({ sendingStatus: e }) {
|
|
2315
2322
|
const t = xt();
|
|
2316
2323
|
switch (e) {
|
|
2317
2324
|
case "pending":
|
|
2318
|
-
return /* @__PURE__ */ r.createElement(
|
|
2325
|
+
return /* @__PURE__ */ r.createElement(Wi, { size: 16 }, /* @__PURE__ */ r.createElement(M, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
2319
2326
|
case "failed":
|
|
2320
2327
|
return /* @__PURE__ */ r.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ r.createElement(M, { type: "error", color: p.themedColor.error, size: 16 }));
|
|
2321
2328
|
case "scheduled":
|
|
@@ -2325,40 +2332,40 @@ function zi({ sendingStatus: e }) {
|
|
|
2325
2332
|
return /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(M, { type: "chevron-down" }));
|
|
2326
2333
|
}
|
|
2327
2334
|
}
|
|
2328
|
-
const
|
|
2329
|
-
function
|
|
2335
|
+
const Wi = u(Hn)`margin-bottom:2px;width:16px;height:16px;`;
|
|
2336
|
+
function Gi({ createdAt: e }) {
|
|
2330
2337
|
const { stringSet: t, format: n } = O();
|
|
2331
2338
|
return e ? /* @__PURE__ */ r.createElement(w, { variant: "caption4", color: p.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2332
2339
|
}
|
|
2333
2340
|
const Ot = _e({
|
|
2334
|
-
template:
|
|
2341
|
+
template: ji,
|
|
2335
2342
|
components: {
|
|
2336
|
-
SendingStatus:
|
|
2337
|
-
SentTime:
|
|
2338
|
-
MessageBody:
|
|
2343
|
+
SendingStatus: Vi,
|
|
2344
|
+
SentTime: Gi,
|
|
2345
|
+
MessageBody: zi
|
|
2339
2346
|
}
|
|
2340
2347
|
});
|
|
2341
|
-
function
|
|
2348
|
+
function ji(e) {
|
|
2342
2349
|
const { components: t } = Ot.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
|
|
2343
|
-
return /* @__PURE__ */ r.createElement(
|
|
2350
|
+
return /* @__PURE__ */ r.createElement(Ki, { $marginBottom: Tt(e.groupType) }, /* @__PURE__ */ r.createElement(Zi, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(Yi, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
|
|
2344
2351
|
}
|
|
2345
|
-
const
|
|
2346
|
-
`, zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e =
|
|
2347
|
-
`,
|
|
2348
|
-
function
|
|
2349
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(
|
|
2352
|
+
const Ki = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2353
|
+
`, zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = te, $endPadding: t = te, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
|
|
2354
|
+
`, Zi = u(zn)``, Yi = u(zn)`margin-top:${Rn}px;`;
|
|
2355
|
+
function qi(e) {
|
|
2356
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ji, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, Xi(yn.sanitize(e.message))));
|
|
2350
2357
|
}
|
|
2351
|
-
const
|
|
2358
|
+
const Ji = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Xi = (e) => {
|
|
2352
2359
|
const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, n = [];
|
|
2353
2360
|
let o = 0;
|
|
2354
|
-
return e.replace(t, (s,
|
|
2355
|
-
/* @__PURE__ */ r.createElement("a", { key:
|
|
2361
|
+
return e.replace(t, (s, i, a, l) => (n.push(e.slice(o, l)), n.push(
|
|
2362
|
+
/* @__PURE__ */ r.createElement("a", { key: a, href: a, target: "_blank", rel: St }, i)
|
|
2356
2363
|
), o = l + s.length, s)), n.push(e.slice(o)), n;
|
|
2357
|
-
},
|
|
2364
|
+
}, Qi = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
|
|
2358
2365
|
const { stringSet: s } = O();
|
|
2359
2366
|
return L(() => {
|
|
2360
2367
|
typeof n > "u" && typeof t == "boolean" && (o == null || o(t));
|
|
2361
|
-
}, [n, t]), /* @__PURE__ */ r.createElement(
|
|
2368
|
+
}, [n, t]), /* @__PURE__ */ r.createElement(ea, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, s.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
|
|
2362
2369
|
nn,
|
|
2363
2370
|
{
|
|
2364
2371
|
checked: n === !0,
|
|
@@ -2376,16 +2383,16 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2376
2383
|
}
|
|
2377
2384
|
)));
|
|
2378
2385
|
}, nn = ({ onClick: e, checked: t, label: n, disabled: o }) => {
|
|
2379
|
-
const s = t ? p.color.primary.main : o ? p.themedColor.textDisabled : p.themedColor.textLowEmphasis,
|
|
2380
|
-
return /* @__PURE__ */ r.createElement(
|
|
2381
|
-
}, Qi = u.div`display:flex;flex-direction:column;gap:8px;`, ea = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, ta = (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 })), na = (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" })))), ra = (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" })), oa = (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" })), sa = (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" })), ia = (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" })), aa = (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" })), la = (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" })), ca = (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" })), da = (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: {
|
|
2386
|
+
const s = t ? p.color.primary.main : o ? p.themedColor.textDisabled : p.themedColor.textLowEmphasis, i = t ? p.themedColor.textHighEmphasis : o ? p.themedColor.textLowEmphasis : p.themedColor.textHighEmphasis;
|
|
2387
|
+
return /* @__PURE__ */ r.createElement(ta, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(M, { size: 24, type: t ? "radio-on" : "radio-off", color: s }), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: i }, n));
|
|
2388
|
+
}, ea = u.div`display:flex;flex-direction:column;gap:8px;`, ta = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, na = (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 })), ra = (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" })))), oa = (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" })), sa = (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" })), ia = (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" })), aa = (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" })), la = (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" })), ca = (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" })), da = (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" })), ua = (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: {
|
|
2382
2389
|
maskType: "alpha"
|
|
2383
|
-
}, 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)" })))),
|
|
2390
|
+
}, 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)" })))), ma = [
|
|
2384
2391
|
{
|
|
2385
2392
|
value: 1,
|
|
2386
2393
|
Icon: {
|
|
2387
|
-
Active:
|
|
2388
|
-
Inactive:
|
|
2394
|
+
Active: ra,
|
|
2395
|
+
Inactive: na
|
|
2389
2396
|
},
|
|
2390
2397
|
isActive: (e) => e <= 1,
|
|
2391
2398
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_1
|
|
@@ -2393,8 +2400,8 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2393
2400
|
{
|
|
2394
2401
|
value: 2,
|
|
2395
2402
|
Icon: {
|
|
2396
|
-
Active:
|
|
2397
|
-
Inactive:
|
|
2403
|
+
Active: sa,
|
|
2404
|
+
Inactive: oa
|
|
2398
2405
|
},
|
|
2399
2406
|
isActive: (e) => e === 2,
|
|
2400
2407
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_2
|
|
@@ -2402,8 +2409,8 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2402
2409
|
{
|
|
2403
2410
|
value: 3,
|
|
2404
2411
|
Icon: {
|
|
2405
|
-
Active:
|
|
2406
|
-
Inactive:
|
|
2412
|
+
Active: aa,
|
|
2413
|
+
Inactive: ia
|
|
2407
2414
|
},
|
|
2408
2415
|
isActive: (e) => e === 3,
|
|
2409
2416
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_3
|
|
@@ -2411,8 +2418,8 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2411
2418
|
{
|
|
2412
2419
|
value: 4,
|
|
2413
2420
|
Icon: {
|
|
2414
|
-
Active:
|
|
2415
|
-
Inactive:
|
|
2421
|
+
Active: ca,
|
|
2422
|
+
Inactive: la
|
|
2416
2423
|
},
|
|
2417
2424
|
isActive: (e) => e === 4,
|
|
2418
2425
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_4
|
|
@@ -2420,13 +2427,13 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2420
2427
|
{
|
|
2421
2428
|
value: 5,
|
|
2422
2429
|
Icon: {
|
|
2423
|
-
Active:
|
|
2424
|
-
Inactive:
|
|
2430
|
+
Active: ua,
|
|
2431
|
+
Inactive: da
|
|
2425
2432
|
},
|
|
2426
2433
|
isActive: (e) => 5 <= e,
|
|
2427
2434
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_5
|
|
2428
2435
|
}
|
|
2429
|
-
],
|
|
2436
|
+
], ga = () => ma, Vn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(ft, null, t, /* @__PURE__ */ r.createElement(fa, { $position: n }, /* @__PURE__ */ r.createElement(ba, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(ha, { $position: n }))), ha = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
2430
2437
|
"svg",
|
|
2431
2438
|
{
|
|
2432
2439
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -2437,30 +2444,30 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2437
2444
|
fill: "none"
|
|
2438
2445
|
},
|
|
2439
2446
|
/* @__PURE__ */ r.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: p.themedColor.textHighEmphasis })
|
|
2440
|
-
),
|
|
2447
|
+
), pa = {
|
|
2441
2448
|
top: I`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
2442
2449
|
bottom: I`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
2443
|
-
}, ft = u.div`position:relative;`,
|
|
2444
|
-
const { stringSet: o } = O(), s =
|
|
2445
|
-
return /* @__PURE__ */ r.createElement(
|
|
2446
|
-
|
|
2450
|
+
}, ft = u.div`position:relative;`, fa = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${fe.TOOLTIP};${({ $position: e }) => pa[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${ft}:hover &,${ft}:focus-within &{opacity:1;}`, ba = u(w)`padding:6px 8px;background:${p.themedColor.textHighEmphasis};color:${p.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, Ea = ({ submitted: e, value: t, onChange: n }) => {
|
|
2451
|
+
const { stringSet: o } = O(), s = ga(), i = typeof t == "number";
|
|
2452
|
+
return /* @__PURE__ */ r.createElement(xa, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(Ca, null, s.map((a) => /* @__PURE__ */ r.createElement(Vn, { disabled: e, key: a.value, label: a.getTooltip(o) }, /* @__PURE__ */ r.createElement(
|
|
2453
|
+
va,
|
|
2447
2454
|
{
|
|
2448
2455
|
disabled: e,
|
|
2449
|
-
onClick: () => n(
|
|
2450
|
-
$inactive:
|
|
2456
|
+
onClick: () => n(a.value),
|
|
2457
|
+
$inactive: i && !a.isActive(t)
|
|
2451
2458
|
},
|
|
2452
|
-
|
|
2459
|
+
i ? a.isActive(t) ? /* @__PURE__ */ r.createElement(a.Icon.Active, null) : /* @__PURE__ */ r.createElement(a.Icon.Inactive, null) : /* @__PURE__ */ r.createElement(a.Icon.Active, null)
|
|
2453
2460
|
)))));
|
|
2454
|
-
},
|
|
2461
|
+
}, xa = u.div`display:flex;flex-direction:column;gap:8px;`, Ca = u.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, va = u.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:${p.color.background200};${P.dark`
|
|
2455
2462
|
background-color: ${p.color.background500};
|
|
2456
2463
|
`}
|
|
2457
2464
|
}
|
|
2458
2465
|
|
|
2459
|
-
${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" &&
|
|
2460
|
-
`,
|
|
2466
|
+
${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" && ya};
|
|
2467
|
+
`, ya = I`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, _a = ({ submitted: e, value: t = "", onChange: n }) => {
|
|
2461
2468
|
const { stringSet: o } = O();
|
|
2462
2469
|
return e && !t ? null : /* @__PURE__ */ r.createElement(
|
|
2463
|
-
|
|
2470
|
+
Sa,
|
|
2464
2471
|
{
|
|
2465
2472
|
disabled: e,
|
|
2466
2473
|
maxLength: 255,
|
|
@@ -2469,7 +2476,7 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2469
2476
|
placeholder: o.CSAT_REASON_PLACEHOLDER
|
|
2470
2477
|
}
|
|
2471
2478
|
);
|
|
2472
|
-
},
|
|
2479
|
+
}, Sa = u.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:${p.themedColor.textHighEmphasis};&::placeholder{color:${p.themedColor.textLowEmphasis};}background-color:${p.color.background50};${P.dark`
|
|
2473
2480
|
background-color: ${p.themedColor.textDisabled};
|
|
2474
2481
|
`}
|
|
2475
2482
|
|
|
@@ -2482,82 +2489,82 @@ const qi = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2482
2489
|
background-color: ${p.themedColor.textDisabled};
|
|
2483
2490
|
`}
|
|
2484
2491
|
}
|
|
2485
|
-
`,
|
|
2492
|
+
`, Ta = ({ submitted: e }) => {
|
|
2486
2493
|
const { stringSet: t } = O();
|
|
2487
2494
|
return e ? /* @__PURE__ */ r.createElement(w, { variant: "h2", color: p.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(w, { variant: "h2", color: p.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
|
|
2488
2495
|
};
|
|
2489
|
-
var
|
|
2490
|
-
const
|
|
2496
|
+
var X = /* @__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.HELPDESK_CSAT_5 = "HELPDESK_CSAT_5", e))(X || {});
|
|
2497
|
+
const wa = (e) => Cr((t, n) => ({ ...t, ...n }), e), lt = ({
|
|
2491
2498
|
type: e,
|
|
2492
2499
|
renderSubmitButton: t,
|
|
2493
2500
|
initialCsat: n,
|
|
2494
2501
|
initialCsatReason: o,
|
|
2495
2502
|
initialIsResolved: s
|
|
2496
2503
|
}) => {
|
|
2497
|
-
const [
|
|
2504
|
+
const [i, a] = wa({
|
|
2498
2505
|
csatType: e,
|
|
2499
2506
|
csat: n,
|
|
2500
2507
|
csatReason: o,
|
|
2501
2508
|
isResolved: s
|
|
2502
|
-
}), l = typeof n == "number" ? "submitted" : (e ===
|
|
2503
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
2504
|
-
|
|
2509
|
+
}), l = typeof n == "number" ? "submitted" : (e === X.AI_AGENT_CSAT_5 || e === X.HELPDESK_CSAT_5) && typeof i.csat == "number" || e === X.AI_AGENT_CSAT_5_WITH_CRE && typeof i.csat == "number" && typeof i.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
|
|
2510
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Aa, null, /* @__PURE__ */ r.createElement(Ta, { ...c }), e === X.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
|
|
2511
|
+
Qi,
|
|
2505
2512
|
{
|
|
2506
2513
|
...c,
|
|
2507
2514
|
defaultValue: s,
|
|
2508
|
-
value:
|
|
2509
|
-
onChange: (d) =>
|
|
2515
|
+
value: i.isResolved,
|
|
2516
|
+
onChange: (d) => a({ isResolved: d })
|
|
2510
2517
|
}
|
|
2511
|
-
), /* @__PURE__ */ r.createElement(
|
|
2512
|
-
|
|
2518
|
+
), /* @__PURE__ */ r.createElement(Ea, { ...c, value: i.csat, onChange: (d) => a({ csat: d }) }), i.csat && /* @__PURE__ */ r.createElement(
|
|
2519
|
+
_a,
|
|
2513
2520
|
{
|
|
2514
2521
|
...c,
|
|
2515
|
-
value:
|
|
2516
|
-
onChange: (d) =>
|
|
2522
|
+
value: i.csatReason,
|
|
2523
|
+
onChange: (d) => a({ csatReason: d })
|
|
2517
2524
|
}
|
|
2518
|
-
)), l !== "submitted" && t({ state: l, params:
|
|
2519
|
-
},
|
|
2525
|
+
)), l !== "submitted" && t({ state: l, params: i }));
|
|
2526
|
+
}, Aa = u.div`display:flex;flex-direction:column;gap:12px;`, ka = () => {
|
|
2520
2527
|
const { stringSet: e } = O();
|
|
2521
2528
|
return /* @__PURE__ */ r.createElement(w, { variant: "body2", color: p.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
2522
|
-
},
|
|
2529
|
+
}, Ia = (e) => {
|
|
2523
2530
|
if (e.messageType !== "admin.csat")
|
|
2524
2531
|
throw new Error("Invalid message type");
|
|
2525
|
-
const t =
|
|
2526
|
-
if (!d || !
|
|
2527
|
-
const
|
|
2528
|
-
x.csat && !rn(
|
|
2532
|
+
const t = Pr(), { stringSet: n } = O(), { extendedMessagePayload: o, csat: s, csatReason: i, csatExpireAt: a, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: h } = (o == null ? void 0 : o.csat) ?? {};
|
|
2533
|
+
if (!d || !h || !X[h]) return null;
|
|
2534
|
+
const m = h === X.AI_AGENT_CSAT_5 || h === X.AI_AGENT_CSAT_5_WITH_CRE || h === X.HELPDESK_CSAT_5 ? lt : () => null, f = (x) => {
|
|
2535
|
+
x.csat && !rn(a) ? c({
|
|
2529
2536
|
csatType: x.csatType,
|
|
2530
2537
|
csat: x.csat,
|
|
2531
2538
|
csatReason: x.csatReason,
|
|
2532
2539
|
isResolved: x.isResolved
|
|
2533
2540
|
}) : t();
|
|
2534
2541
|
};
|
|
2535
|
-
return /* @__PURE__ */ r.createElement(
|
|
2536
|
-
|
|
2542
|
+
return /* @__PURE__ */ r.createElement($a, null, !s && rn(a) ? /* @__PURE__ */ r.createElement(ka, null) : /* @__PURE__ */ r.createElement(
|
|
2543
|
+
m,
|
|
2537
2544
|
{
|
|
2538
|
-
type:
|
|
2545
|
+
type: h,
|
|
2539
2546
|
initialCsat: s,
|
|
2540
|
-
initialCsatReason:
|
|
2547
|
+
initialCsatReason: i,
|
|
2541
2548
|
initialIsResolved: l,
|
|
2542
|
-
renderSubmitButton: ({ state: x, params:
|
|
2549
|
+
renderSubmitButton: ({ state: x, params: E }) => /* @__PURE__ */ r.createElement(Ma, { disabled: x !== "submittable", onClick: () => f(E) }, /* @__PURE__ */ r.createElement(w, { variant: "button" }, n.CSAT_SUBMIT_LABEL))
|
|
2543
2550
|
}
|
|
2544
2551
|
));
|
|
2545
|
-
},
|
|
2552
|
+
}, $a = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Ma = u.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:${p.color.primary.dark};}&:disabled{color:${p.color.ondark.textLowEmphasis};background-color:${p.themedColor.textDisabled};cursor:not-allowed;}`;
|
|
2546
2553
|
function rn(e) {
|
|
2547
2554
|
return !!e && e < Date.now();
|
|
2548
2555
|
}
|
|
2549
2556
|
const Lt = _e({
|
|
2550
|
-
template:
|
|
2557
|
+
template: Oa,
|
|
2551
2558
|
components: {
|
|
2552
|
-
AdminMessage:
|
|
2553
|
-
CSATMessage:
|
|
2559
|
+
AdminMessage: qi,
|
|
2560
|
+
CSATMessage: Ia
|
|
2554
2561
|
}
|
|
2555
2562
|
});
|
|
2556
|
-
function
|
|
2563
|
+
function Oa(e) {
|
|
2557
2564
|
const { components: t } = Lt.useContext(), n = Mt(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
|
|
2558
|
-
return /* @__PURE__ */ r.createElement(
|
|
2565
|
+
return /* @__PURE__ */ r.createElement(La, { $marginBottom: Tt(e.groupType) }, n);
|
|
2559
2566
|
}
|
|
2560
|
-
const
|
|
2567
|
+
const La = u.div`padding-inline:${te}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, on = {
|
|
2561
2568
|
file: "attach",
|
|
2562
2569
|
snippet: "snippet",
|
|
2563
2570
|
site: "website",
|
|
@@ -2567,143 +2574,143 @@ const Oa = u.div`padding-inline:${ee}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2567
2574
|
sb_zendesk: "zendesk",
|
|
2568
2575
|
sb_desk: "snippet"
|
|
2569
2576
|
// TODO: request icon
|
|
2570
|
-
},
|
|
2577
|
+
}, Ra = ({
|
|
2571
2578
|
actionbook: e,
|
|
2572
2579
|
functionCalls: t,
|
|
2573
2580
|
groundedness: n,
|
|
2574
2581
|
agentMessageTemplates: o,
|
|
2575
2582
|
onClickActionbook: s,
|
|
2576
|
-
onClickFunctionCall:
|
|
2577
|
-
onClickFunctionCallDetail:
|
|
2583
|
+
onClickFunctionCall: i,
|
|
2584
|
+
onClickFunctionCallDetail: a,
|
|
2578
2585
|
onClickGroundedness: l,
|
|
2579
2586
|
onClickAgentMessageTemplate: c,
|
|
2580
2587
|
bottomContent: d,
|
|
2581
|
-
renderCustomGroundednessIcon:
|
|
2582
|
-
style:
|
|
2588
|
+
renderCustomGroundednessIcon: h = (f) => f.default,
|
|
2589
|
+
style: m = {}
|
|
2583
2590
|
}) => {
|
|
2584
2591
|
const {
|
|
2585
2592
|
// Note: This component is used with the dashboard, so cssVars should not be used.
|
|
2586
2593
|
iconColor: f = "#000000",
|
|
2587
2594
|
textColor: x = "#000000",
|
|
2588
|
-
highlightColor:
|
|
2589
|
-
} =
|
|
2595
|
+
highlightColor: E = $n.DEFAULT_PRIMARY
|
|
2596
|
+
} = m;
|
|
2590
2597
|
return /* @__PURE__ */ r.createElement(sn, null, e && /* @__PURE__ */ r.createElement(sn, null, /* @__PURE__ */ r.createElement(qe, null, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "actionbook", color: f })), /* @__PURE__ */ r.createElement(
|
|
2591
2598
|
He,
|
|
2592
2599
|
{
|
|
2593
2600
|
$clickable: !!s,
|
|
2594
|
-
$highlightColor:
|
|
2601
|
+
$highlightColor: E,
|
|
2595
2602
|
variant: "body2",
|
|
2596
2603
|
color: x,
|
|
2597
2604
|
onClick: () => s == null ? void 0 : s(e)
|
|
2598
2605
|
},
|
|
2599
2606
|
e.name
|
|
2600
|
-
))), t == null ? void 0 : t.map((
|
|
2607
|
+
))), t == null ? void 0 : t.map((b) => /* @__PURE__ */ r.createElement(ct, { key: b.key }, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "function", color: f })), /* @__PURE__ */ r.createElement(qe, null, /* @__PURE__ */ r.createElement(
|
|
2601
2608
|
He,
|
|
2602
2609
|
{
|
|
2603
|
-
$clickable: !!
|
|
2604
|
-
$highlightColor:
|
|
2610
|
+
$clickable: !!i,
|
|
2611
|
+
$highlightColor: E,
|
|
2605
2612
|
variant: "body2",
|
|
2606
2613
|
color: x,
|
|
2607
|
-
onClick: () =>
|
|
2614
|
+
onClick: () => i == null ? void 0 : i(b)
|
|
2608
2615
|
},
|
|
2609
|
-
|
|
2610
|
-
),
|
|
2611
|
-
default: /* @__PURE__ */ r.createElement(M, { size: 16, type: on[
|
|
2612
|
-
sourceType:
|
|
2616
|
+
b.name
|
|
2617
|
+
), a && /* @__PURE__ */ r.createElement(Na, { role: "button", onClick: () => a == null ? void 0 : a(b) }, /* @__PURE__ */ r.createElement(w, { variant: "body2", color: E }, "View details"), /* @__PURE__ */ r.createElement(M, { type: "chevron-right", size: 16, color: E }))))), n == null ? void 0 : n.map((b) => /* @__PURE__ */ r.createElement(ct, { key: b.id }, /* @__PURE__ */ r.createElement(ze, null, h({
|
|
2618
|
+
default: /* @__PURE__ */ r.createElement(M, { size: 16, type: on[b.source_type] ?? on.snippet, color: f }),
|
|
2619
|
+
sourceType: b.source_type
|
|
2613
2620
|
})), /* @__PURE__ */ r.createElement(
|
|
2614
2621
|
He,
|
|
2615
2622
|
{
|
|
2616
2623
|
$clickable: !!l,
|
|
2617
|
-
$highlightColor:
|
|
2624
|
+
$highlightColor: E,
|
|
2618
2625
|
variant: "body2",
|
|
2619
2626
|
color: x,
|
|
2620
|
-
onClick: () => l == null ? void 0 : l(
|
|
2627
|
+
onClick: () => l == null ? void 0 : l(b)
|
|
2621
2628
|
},
|
|
2622
|
-
|
|
2623
|
-
))), o == null ? void 0 : o.map((
|
|
2629
|
+
b.preview_title
|
|
2630
|
+
))), o == null ? void 0 : o.map((b) => /* @__PURE__ */ r.createElement(ct, { key: b.key }, /* @__PURE__ */ r.createElement(ze, null, /* @__PURE__ */ r.createElement(M, { size: 16, type: "template", color: f })), /* @__PURE__ */ r.createElement(
|
|
2624
2631
|
He,
|
|
2625
2632
|
{
|
|
2626
2633
|
$clickable: !!c,
|
|
2627
|
-
$highlightColor:
|
|
2634
|
+
$highlightColor: E,
|
|
2628
2635
|
variant: "body2",
|
|
2629
2636
|
color: x,
|
|
2630
|
-
onClick: () => c == null ? void 0 : c(
|
|
2637
|
+
onClick: () => c == null ? void 0 : c(b)
|
|
2631
2638
|
},
|
|
2632
|
-
|
|
2639
|
+
b.name
|
|
2633
2640
|
))), d);
|
|
2634
|
-
},
|
|
2641
|
+
}, Da = u(w)`font-weight:400;`, He = u(Da)`${({ $clickable: e, $highlightColor: t }) => e && I`
|
|
2635
2642
|
cursor: pointer;
|
|
2636
2643
|
text-decoration: underline;
|
|
2637
2644
|
&:hover {
|
|
2638
2645
|
color: ${t};
|
|
2639
2646
|
}
|
|
2640
2647
|
`}
|
|
2641
|
-
`, ze = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, qe = u.div`display:flex;gap:8px;align-items:center;`,
|
|
2642
|
-
function
|
|
2648
|
+
`, ze = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, qe = u.div`display:flex;gap:8px;align-items:center;`, Na = u(qe)`cursor:pointer;gap:4px;`, ct = u(qe)`flex-direction:row;align-items:center;`, sn = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Wn = ve(null);
|
|
2649
|
+
function Pa({ testerType: e, children: t }) {
|
|
2643
2650
|
return /* @__PURE__ */ r.createElement(
|
|
2644
2651
|
Wn.Provider,
|
|
2645
2652
|
{
|
|
2646
2653
|
value: { testerType: e, isActionbookTester: e === "actionbook" }
|
|
2647
2654
|
},
|
|
2648
|
-
e && /* @__PURE__ */ r.createElement(
|
|
2655
|
+
e && /* @__PURE__ */ r.createElement(Ba, null),
|
|
2649
2656
|
t
|
|
2650
2657
|
);
|
|
2651
2658
|
}
|
|
2652
2659
|
const Re = () => {
|
|
2653
|
-
const e =
|
|
2660
|
+
const e = Q(Wn);
|
|
2654
2661
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");
|
|
2655
2662
|
return e;
|
|
2656
|
-
},
|
|
2663
|
+
}, Ba = () => {
|
|
2657
2664
|
const { isActionbookTester: e } = Re();
|
|
2658
|
-
return /* @__PURE__ */ r.createElement(xe.Template, { template: e ?
|
|
2659
|
-
},
|
|
2660
|
-
const { handlers: t } = B(), { manual: n, groundedness: o, function_calls: s, agent_message_templates:
|
|
2661
|
-
return
|
|
2662
|
-
|
|
2665
|
+
return /* @__PURE__ */ r.createElement(xe.Template, { template: e ? Fa : void 0 }, /* @__PURE__ */ r.createElement(xe.MessageLogs, { component: Ua }));
|
|
2666
|
+
}, Fa = (e) => /* @__PURE__ */ r.createElement(Un, { ...e, testerMode: !0, maxBodyWidth: Ln }), Ua = ({ extendedMessagePayload: e = {} }) => {
|
|
2667
|
+
const { handlers: t } = B(), { manual: n, groundedness: o, function_calls: s, agent_message_templates: i, is_thinking: a } = e;
|
|
2668
|
+
return a || !n && !(o != null && o.length) && !(s != null && s.length) && !(i != null && i.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Ha, null, /* @__PURE__ */ r.createElement(za, { width: 4 }), /* @__PURE__ */ r.createElement(
|
|
2669
|
+
Ra,
|
|
2663
2670
|
{
|
|
2664
2671
|
actionbook: n,
|
|
2665
2672
|
functionCalls: s,
|
|
2666
2673
|
groundedness: o,
|
|
2667
|
-
agentMessageTemplates:
|
|
2674
|
+
agentMessageTemplates: i,
|
|
2668
2675
|
onClickFunctionCallDetail: t == null ? void 0 : t.onFunctionCallDetailClick,
|
|
2669
2676
|
style: {
|
|
2670
2677
|
iconColor: p.themedColor.textHighEmphasis,
|
|
2671
2678
|
textColor: p.themedColor.textHighEmphasis,
|
|
2672
2679
|
barColor: p.themedColor.textDisabled
|
|
2673
2680
|
},
|
|
2674
|
-
bottomContent: /* @__PURE__ */ r.createElement(
|
|
2681
|
+
bottomContent: /* @__PURE__ */ r.createElement(Va, { variant: "caption2", color: p.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
2675
2682
|
}
|
|
2676
2683
|
));
|
|
2677
|
-
},
|
|
2678
|
-
function
|
|
2684
|
+
}, Ha = u.div`display:flex;gap:16px;margin:16px ${te}px 0;align-self:stretch;`, za = u.div`width:${({ width: e }) => e}px;background-color:${p.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Va = u(w)`margin-top:5px;`;
|
|
2685
|
+
function Wa(e) {
|
|
2679
2686
|
return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
|
|
2680
2687
|
}
|
|
2681
|
-
const
|
|
2688
|
+
const Ga = (e, t, n, o = !0) => {
|
|
2682
2689
|
if (!o || !e.isUserMessage() && !e.isFileMessage())
|
|
2683
2690
|
return "single";
|
|
2684
2691
|
const s = () => {
|
|
2685
2692
|
if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
|
|
2686
2693
|
const c = t.sender.userId === e.sender.userId, d = zt(t.createdAt, e.createdAt);
|
|
2687
2694
|
return c && d;
|
|
2688
|
-
},
|
|
2695
|
+
}, i = () => {
|
|
2689
2696
|
if (!n || !n.isUserMessage() && !n.isFileMessage()) return !1;
|
|
2690
2697
|
const c = n.sender.userId === e.sender.userId, d = zt(n.createdAt, e.createdAt);
|
|
2691
2698
|
return c && d;
|
|
2692
|
-
},
|
|
2693
|
-
return
|
|
2699
|
+
}, a = s(), l = i();
|
|
2700
|
+
return a && l ? "middle" : a ? "bottom" : l ? "top" : "single";
|
|
2694
2701
|
};
|
|
2695
|
-
function
|
|
2702
|
+
function ja(e, t) {
|
|
2696
2703
|
return e.filter((n) => Se.isWelcomeMessage(n, t));
|
|
2697
2704
|
}
|
|
2698
2705
|
function Gn(e, t) {
|
|
2699
|
-
return
|
|
2706
|
+
return Ka(e) === t;
|
|
2700
2707
|
}
|
|
2701
|
-
function
|
|
2708
|
+
function Ka(e) {
|
|
2702
2709
|
var t;
|
|
2703
2710
|
if (e)
|
|
2704
2711
|
return e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage() ? e.sender.userId : ((t = e == null ? void 0 : e.sender) == null ? void 0 : t.userId) ?? void 0;
|
|
2705
2712
|
}
|
|
2706
|
-
function
|
|
2713
|
+
function Za(e) {
|
|
2707
2714
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
2708
2715
|
}
|
|
2709
2716
|
const bt = (e) => !!e && "sender" in e, jn = (e) => e.startsWith("image/"), Kn = (e) => e.startsWith("video/"), an = (e) => jn(e) || Kn(e), Ve = {
|
|
@@ -2714,16 +2721,16 @@ const bt = (e) => !!e && "sender" in e, jn = (e) => e.startsWith("image/"), Kn =
|
|
|
2714
2721
|
},
|
|
2715
2722
|
isIncoming: (e, t) => bt(e) && e.sender.userId !== t,
|
|
2716
2723
|
isOutgoing: (e, t) => bt(e) && (e.sender.userId === t || e.sendingStatus === dt.PENDING)
|
|
2717
|
-
},
|
|
2718
|
-
const { chatSDK: t, handlers: n } = B(), { aiAgentInfo: o } = U(), s = N(/* @__PURE__ */ new Set()),
|
|
2724
|
+
}, Ya = (e) => {
|
|
2725
|
+
const { chatSDK: t, handlers: n } = B(), { aiAgentInfo: o } = U(), s = N(/* @__PURE__ */ new Set()), i = (a, l) => {
|
|
2719
2726
|
var c;
|
|
2720
|
-
|
|
2727
|
+
a.url === e && bt(l) && l.sender.userId === o.userId && !Se.isStreaming(l) && !s.current.has(l.messageId) && ((c = n == null ? void 0 : n.onCustomEvent) == null || c.call(n, { type: "bot-message-received", data: { message: l } }), s.current.add(l.messageId));
|
|
2721
2728
|
};
|
|
2722
2729
|
Xe(t, {
|
|
2723
|
-
onMessageUpdated:
|
|
2724
|
-
onMessageReceived:
|
|
2730
|
+
onMessageUpdated: i,
|
|
2731
|
+
onMessageReceived: i
|
|
2725
2732
|
});
|
|
2726
|
-
},
|
|
2733
|
+
}, qa = ({ publishSynchronous: e = !1 }) => {
|
|
2727
2734
|
const t = /* @__PURE__ */ new Set();
|
|
2728
2735
|
return {
|
|
2729
2736
|
publish: (n) => {
|
|
@@ -2734,24 +2741,24 @@ const bt = (e) => !!e && "sender" in e, jn = (e) => e.startsWith("image/"), Kn =
|
|
|
2734
2741
|
subscribe: (n) => (t.add(n), () => t.delete(n))
|
|
2735
2742
|
};
|
|
2736
2743
|
};
|
|
2737
|
-
function
|
|
2738
|
-
const n = N(null), o = N(0), s = N(0), [
|
|
2744
|
+
function Ja(e, t = []) {
|
|
2745
|
+
const n = N(null), o = N(0), s = N(0), [i] = _(() => qa({ publishSynchronous: !0 })), [a, l] = _(!0);
|
|
2739
2746
|
return le(() => {
|
|
2740
2747
|
o.current = 0, s.current = 0, l(!0), n.current && (n.current.scrollTop = n.current.scrollHeight);
|
|
2741
|
-
}, t), le(() =>
|
|
2742
|
-
const { resolve:
|
|
2743
|
-
if (!n.current) return
|
|
2748
|
+
}, t), le(() => i.subscribe(({ type: c, data: d }) => {
|
|
2749
|
+
const { resolve: h, animated: m } = d ?? {};
|
|
2750
|
+
if (!n.current) return h == null ? void 0 : h();
|
|
2744
2751
|
if (c === "scrollToBottom" && (n.current.scroll ? n.current.scroll({
|
|
2745
2752
|
top: n.current.scrollHeight,
|
|
2746
|
-
behavior: ln(e,
|
|
2747
|
-
}) : n.current.scrollTop = n.current.scrollHeight, s.current = 0, l(!0),
|
|
2748
|
-
const f = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight:
|
|
2749
|
-
n.current.scroll ? n.current.scroll({ top: f, behavior: ln(e,
|
|
2753
|
+
behavior: ln(e, m)
|
|
2754
|
+
}) : n.current.scrollTop = n.current.scrollHeight, s.current = 0, l(!0), h == null || h()), c === "scroll") {
|
|
2755
|
+
const f = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: E, clientHeight: b } = n.current;
|
|
2756
|
+
n.current.scroll ? n.current.scroll({ top: f, behavior: ln(e, m) }) : typeof f == "number" && (n.current.scrollTop = f), s.current = Math.max(0, E - x - b), l(s.current === 0), h == null || h();
|
|
2750
2757
|
}
|
|
2751
2758
|
}), [e]), {
|
|
2752
2759
|
scrollRef: n,
|
|
2753
|
-
scrollPubSub:
|
|
2754
|
-
isScrollBottomReached:
|
|
2760
|
+
scrollPubSub: i,
|
|
2761
|
+
isScrollBottomReached: a,
|
|
2755
2762
|
setIsScrollBottomReached: l,
|
|
2756
2763
|
scrollDistanceFromBottomRef: s,
|
|
2757
2764
|
scrollPositionRef: o
|
|
@@ -2760,7 +2767,7 @@ function qa(e, t = []) {
|
|
|
2760
2767
|
function ln(e, t) {
|
|
2761
2768
|
return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
|
|
2762
2769
|
}
|
|
2763
|
-
function
|
|
2770
|
+
function Xa(e) {
|
|
2764
2771
|
return new Promise((t) => {
|
|
2765
2772
|
const n = new Image();
|
|
2766
2773
|
n.onload = function() {
|
|
@@ -2769,71 +2776,71 @@ function Ja(e) {
|
|
|
2769
2776
|
}, n.src = URL.createObjectURL(e);
|
|
2770
2777
|
});
|
|
2771
2778
|
}
|
|
2772
|
-
async function
|
|
2779
|
+
async function Qa(e) {
|
|
2773
2780
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
2774
|
-
const { width: t, height: n } = await
|
|
2775
|
-
return new
|
|
2781
|
+
const { width: t, height: n } = await Xa(e.file);
|
|
2782
|
+
return new Wr({
|
|
2776
2783
|
key: Zn,
|
|
2777
2784
|
value: [t, n]
|
|
2778
2785
|
});
|
|
2779
2786
|
}
|
|
2780
2787
|
}
|
|
2781
|
-
const Zn = "KEY_IMG_ASPECT_RATIO",
|
|
2788
|
+
const Zn = "KEY_IMG_ASPECT_RATIO", el = ({ onScrollAfterSendMessage: e }) => {
|
|
2782
2789
|
const { agentPreviewConfigs: t, handlers: n } = B(), o = N(t == null ? void 0 : t.agentAttributes);
|
|
2783
2790
|
return o.current = t == null ? void 0 : t.agentAttributes, {
|
|
2784
2791
|
onBeforeSendMessage: async (s) => {
|
|
2785
|
-
const
|
|
2792
|
+
const i = await Qa(s), a = {
|
|
2786
2793
|
...s,
|
|
2787
|
-
metaArrays:
|
|
2788
|
-
}, l =
|
|
2789
|
-
return l ? { ...
|
|
2794
|
+
metaArrays: i ? [i] : void 0
|
|
2795
|
+
}, l = tl(o.current);
|
|
2796
|
+
return l ? { ...a, data: JSON.stringify(l) } : a;
|
|
2790
2797
|
},
|
|
2791
2798
|
onAfterSendMessage: (s) => {
|
|
2792
|
-
var
|
|
2793
|
-
e(), (
|
|
2799
|
+
var i, a, l;
|
|
2800
|
+
e(), (i = n == null ? void 0 : n.onMessageSend) == null || i.call(n, s.message), s.sendingStatus === dt.SUCCEEDED ? (a = n == null ? void 0 : n.onCustomEvent) == null || a.call(n, { type: "message-sent-succeeded", data: { message: s } }) : s.sendingStatus === dt.PENDING && ((l = n == null ? void 0 : n.onCustomEvent) == null || l.call(n, { type: "message-sent-pending", data: { message: s } }));
|
|
2794
2801
|
}
|
|
2795
2802
|
};
|
|
2796
|
-
},
|
|
2803
|
+
}, tl = (e) => {
|
|
2797
2804
|
if (!e) return null;
|
|
2798
2805
|
const t = {};
|
|
2799
2806
|
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;
|
|
2800
2807
|
}, {
|
|
2801
|
-
Provider:
|
|
2802
|
-
Context:
|
|
2808
|
+
Provider: nl,
|
|
2809
|
+
Context: su,
|
|
2803
2810
|
useContext: Z
|
|
2804
|
-
} = G("Conversation"),
|
|
2811
|
+
} = G("Conversation"), rl = ({
|
|
2805
2812
|
closedChannelUrl: e,
|
|
2806
2813
|
onClearClosedChannelUrl: t,
|
|
2807
2814
|
onNavigateToConversationList: n,
|
|
2808
2815
|
children: o
|
|
2809
2816
|
}) => {
|
|
2810
|
-
const { aiAgentInfo: s, activeChannel:
|
|
2817
|
+
const { aiAgentInfo: s, activeChannel: i, refreshActiveChannel: a } = U(), { testerType: l } = Re(), c = Ja("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: h } = el({
|
|
2811
2818
|
onScrollAfterSendMessage: () => {
|
|
2812
2819
|
c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !1 } });
|
|
2813
2820
|
}
|
|
2814
|
-
}),
|
|
2815
|
-
|
|
2816
|
-
const f = (
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2821
|
+
}), m = e || (i == null ? void 0 : i.url);
|
|
2822
|
+
Ya(m);
|
|
2823
|
+
const f = (E) => {
|
|
2824
|
+
const b = E[E.length - 1];
|
|
2825
|
+
b && Se.shouldScrollToBottom(b, s.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } }), 100);
|
|
2819
2826
|
}, x = R(async () => {
|
|
2820
|
-
await
|
|
2821
|
-
}, [
|
|
2827
|
+
await a(), e && (t == null || t());
|
|
2828
|
+
}, [a, e, t]);
|
|
2822
2829
|
return /* @__PURE__ */ r.createElement(
|
|
2823
|
-
|
|
2830
|
+
ao,
|
|
2824
2831
|
{
|
|
2825
|
-
channelUrl:
|
|
2832
|
+
channelUrl: m,
|
|
2826
2833
|
onBeforeSendMessage: d,
|
|
2827
|
-
onAfterSendMessage:
|
|
2834
|
+
onAfterSendMessage: h,
|
|
2828
2835
|
onMessagesUpdated: f,
|
|
2829
2836
|
onMessagesReceived: f,
|
|
2830
2837
|
onChannelDeleted: x,
|
|
2831
2838
|
onConversationClosedViaDispatcher: x
|
|
2832
2839
|
},
|
|
2833
|
-
(
|
|
2834
|
-
|
|
2840
|
+
(E) => /* @__PURE__ */ r.createElement(
|
|
2841
|
+
nl,
|
|
2835
2842
|
{
|
|
2836
|
-
value: { ...
|
|
2843
|
+
value: { ...E, scrollSource: c, goToActiveConversation: x, onNavigateToConversationList: n }
|
|
2837
2844
|
},
|
|
2838
2845
|
o
|
|
2839
2846
|
)
|
|
@@ -2851,7 +2858,7 @@ const Zn = "KEY_IMG_ASPECT_RATIO", Qa = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2851
2858
|
var o;
|
|
2852
2859
|
if (n.preventDefault(), (o = n.dataTransfer) != null && o.files) {
|
|
2853
2860
|
const s = Array.from(n.dataTransfer.files);
|
|
2854
|
-
s.length > 0 && t.current.forEach((
|
|
2861
|
+
s.length > 0 && t.current.forEach((i) => i(s));
|
|
2855
2862
|
}
|
|
2856
2863
|
},
|
|
2857
2864
|
subscribe: (n) => (t.current.add(n), () => t.current.delete(n))
|
|
@@ -2859,101 +2866,101 @@ const Zn = "KEY_IMG_ASPECT_RATIO", Qa = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2859
2866
|
},
|
|
2860
2867
|
e
|
|
2861
2868
|
);
|
|
2862
|
-
},
|
|
2863
|
-
const { subscribe: t } =
|
|
2869
|
+
}, ol = ({ onDropFiles: e }) => {
|
|
2870
|
+
const { subscribe: t } = Q(Rt);
|
|
2864
2871
|
L(() => t(e), [e]);
|
|
2865
2872
|
};
|
|
2866
2873
|
Et.Consumer = ({ children: e }) => {
|
|
2867
|
-
const { onDrop: t } =
|
|
2874
|
+
const { onDrop: t } = Q(Rt);
|
|
2868
2875
|
return e({ onDrop: t, onDragOver: (s) => s.preventDefault() });
|
|
2869
2876
|
};
|
|
2870
|
-
const
|
|
2871
|
-
loading: T(() => import("./
|
|
2872
|
-
error: T(() => import("./
|
|
2873
|
-
noChannels: T(() => import("./
|
|
2874
|
-
noMessages: T(() => import("./
|
|
2877
|
+
const iu = ({ iconSize: e = 64, icon: t, className: n, label: o, children: s }) => /* @__PURE__ */ r.createElement(il, { className: n }, /* @__PURE__ */ r.createElement(M, { type: t, size: e, color: p.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.themedColor.textMidEmphasis }, o), s), sl = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, il = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, al = {
|
|
2878
|
+
loading: T(() => import("./DhUBPQ6o.js")),
|
|
2879
|
+
error: T(() => import("./CVCUjr3Q.js")),
|
|
2880
|
+
noChannels: T(() => import("./kE3eGJ-O.js")),
|
|
2881
|
+
noMessages: T(() => import("./jtdZ66dz.js"))
|
|
2875
2882
|
}, Ce = ({ className: e, type: t = "loading", ...n }) => {
|
|
2876
|
-
const o =
|
|
2877
|
-
return /* @__PURE__ */ r.createElement(
|
|
2883
|
+
const o = al[t];
|
|
2884
|
+
return /* @__PURE__ */ r.createElement(sl, { className: e }, /* @__PURE__ */ r.createElement(ke, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
|
|
2878
2885
|
}, Yn = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
|
|
2879
2886
|
if (!t) return null;
|
|
2880
|
-
const { rootElement: s } = B(),
|
|
2881
|
-
return
|
|
2882
|
-
/* @__PURE__ */ r.createElement(
|
|
2883
|
-
|
|
2887
|
+
const { rootElement: s } = B(), i = pe(s), a = pe(s, !0);
|
|
2888
|
+
return jr(
|
|
2889
|
+
/* @__PURE__ */ r.createElement(ll, { onClick: n }, /* @__PURE__ */ r.createElement(cl, { onClick: (l) => l.stopPropagation() }, o)),
|
|
2890
|
+
i.getElementById(e) ?? i.getElementById(ee.MODAL_ROOT) ?? a.body
|
|
2884
2891
|
);
|
|
2885
|
-
},
|
|
2892
|
+
}, ll = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${p.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${fe.MODAL};`, cl = u.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:${fe.MODAL};`, dl = u.div`flex-shrink:0;width:${({ $size: e }) => j(e)};height:${({ $size: e }) => j(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;}`, ul = u(kt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
|
|
2886
2893
|
function qn({ size: e }) {
|
|
2887
2894
|
const { aiAgentInfo: t } = U();
|
|
2888
|
-
return t.profileUrl ? /* @__PURE__ */ r.createElement(It, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(
|
|
2895
|
+
return t.profileUrl ? /* @__PURE__ */ r.createElement(It, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(dl, { $size: e }, /* @__PURE__ */ r.createElement(ul, null));
|
|
2889
2896
|
}
|
|
2890
|
-
const
|
|
2891
|
-
const { type: s, url:
|
|
2897
|
+
const ml = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, gl = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${p.themedColor.textDisabled};background-color:${p.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, hl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, pl = u.div`margin-inline-end:8px;`, fl = u.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);}`, bl = u.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;}`, El = u.div`display:flex;width:160px;justify-content:flex-end;`, xl = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, Jn = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, Cl = u(Jn)`border-inline-start:1px solid ${p.themedColor.textDisabled};`, vl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, yl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, _l = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, Sl = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, Tl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
|
|
2898
|
+
const { type: s, url: i, name: a = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: h } = U();
|
|
2892
2899
|
return /* @__PURE__ */ r.createElement(
|
|
2893
|
-
|
|
2900
|
+
Al,
|
|
2894
2901
|
{
|
|
2895
2902
|
profileUrl: l ?? "",
|
|
2896
2903
|
nickname: c ?? "",
|
|
2897
2904
|
type: s,
|
|
2898
|
-
url:
|
|
2899
|
-
name:
|
|
2905
|
+
url: i,
|
|
2906
|
+
name: a,
|
|
2900
2907
|
onClose: n,
|
|
2901
|
-
isBotMessage: d ===
|
|
2908
|
+
isBotMessage: d === h.userId,
|
|
2902
2909
|
onDownloadClick: o
|
|
2903
2910
|
}
|
|
2904
2911
|
);
|
|
2905
|
-
},
|
|
2912
|
+
}, wl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(qn, { size: 32 }) : /* @__PURE__ */ r.createElement(It, { size: 32, src: e }), Al = ({
|
|
2906
2913
|
profileUrl: e,
|
|
2907
2914
|
isBotMessage: t,
|
|
2908
2915
|
nickname: n,
|
|
2909
2916
|
name: o,
|
|
2910
2917
|
type: s,
|
|
2911
|
-
url:
|
|
2912
|
-
onClose:
|
|
2918
|
+
url: i,
|
|
2919
|
+
onClose: a,
|
|
2913
2920
|
onDownloadClick: l
|
|
2914
2921
|
}) => {
|
|
2915
2922
|
const { stringSet: c } = O();
|
|
2916
|
-
return /* @__PURE__ */ r.createElement(Yn, { onClose:
|
|
2923
|
+
return /* @__PURE__ */ r.createElement(Yn, { onClose: a, visible: !0, rootElementId: ee.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ml, null, /* @__PURE__ */ r.createElement(gl, null, /* @__PURE__ */ r.createElement(hl, null, /* @__PURE__ */ r.createElement(pl, null, /* @__PURE__ */ r.createElement(wl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(w, { variant: "h2", color: p.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(bl, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(El, null, an(s) && /* @__PURE__ */ r.createElement(xl, null, /* @__PURE__ */ r.createElement(Jn, { as: "a", href: i, target: "_blank", rel: St, onClick: l }, /* @__PURE__ */ r.createElement(M, { type: "download", color: p.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(Cl, { onClick: a }, /* @__PURE__ */ r.createElement(M, { type: "close", color: p.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(vl, { onClick: (d) => d.currentTarget === d.target && a() }, Kn(s) && /* @__PURE__ */ r.createElement(yl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: i, type: s })), jn(s) && /* @__PURE__ */ r.createElement(_l, { src: i, alt: o }), !an(s) && /* @__PURE__ */ r.createElement(Sl, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: p.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
|
|
2917
2924
|
}, Xn = ({
|
|
2918
2925
|
className: e,
|
|
2919
2926
|
locale: t,
|
|
2920
2927
|
date: n = Date.now(),
|
|
2921
2928
|
formatString: o = "MMMM dd, yyyy",
|
|
2922
2929
|
style: s
|
|
2923
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
2930
|
+
}) => /* @__PURE__ */ r.createElement(kl, { id: `${J}-date-separator`, style: s, className: e }, /* @__PURE__ */ r.createElement(w, { variant: "caption4", color: p.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), kl = u.div`display:flex;justify-content:center;align-items:center;`, Il = ye(function(t, n) {
|
|
2924
2931
|
const {
|
|
2925
2932
|
messages: o,
|
|
2926
2933
|
renderMessage: s,
|
|
2927
|
-
messageTopArea:
|
|
2928
|
-
messageBottomArea:
|
|
2934
|
+
messageTopArea: i,
|
|
2935
|
+
messageBottomArea: a,
|
|
2929
2936
|
overlayArea: l,
|
|
2930
2937
|
onLoadPrev: c,
|
|
2931
2938
|
onLoadNext: d,
|
|
2932
|
-
loadThreshold:
|
|
2933
|
-
onScrollPosition:
|
|
2939
|
+
loadThreshold: h = 0.05,
|
|
2940
|
+
onScrollPosition: m = Ie,
|
|
2934
2941
|
depsForResetScrollPositionToBottom: f,
|
|
2935
2942
|
scrollPositionRef: x,
|
|
2936
|
-
scrollDistanceFromBottomRef:
|
|
2937
|
-
stackDirection:
|
|
2938
|
-
} = t,
|
|
2943
|
+
scrollDistanceFromBottomRef: E,
|
|
2944
|
+
stackDirection: b = "top"
|
|
2945
|
+
} = t, g = n && "current" in n ? n : { current: null }, C = N(!1), v = N(void 0), S = N(0), k = N(0), F = N(0), $ = x ?? k, V = E ?? F;
|
|
2939
2946
|
le(() => {
|
|
2940
|
-
|
|
2947
|
+
g.current && (g.current.scrollTop = g.current.scrollHeight);
|
|
2941
2948
|
}, f), le(() => {
|
|
2942
|
-
|
|
2943
|
-
}, [
|
|
2944
|
-
const
|
|
2945
|
-
if (!
|
|
2946
|
-
const y =
|
|
2947
|
-
if (
|
|
2948
|
-
const H = y.clientHeight * Math.min(Math.max(0,
|
|
2949
|
+
g.current && (v.current === "top" && (g.current.scrollTop = g.current.scrollHeight - $.current), v.current === "bottom" && (g.current.scrollTop = S.current), v.current = void 0);
|
|
2950
|
+
}, [g.current, o.length]);
|
|
2951
|
+
const re = async () => {
|
|
2952
|
+
if (!g.current) return;
|
|
2953
|
+
const y = g.current;
|
|
2954
|
+
if (m($l(y)), $.current = y.scrollHeight - y.scrollTop, V.current = $.current - y.clientHeight, S.current = y.scrollTop, C.current) return;
|
|
2955
|
+
const H = y.clientHeight * Math.min(Math.max(0, h), 1);
|
|
2949
2956
|
y.scrollTop <= H ? (C.current = !0, v.current = "top", await c(), C.current = !1) : y.scrollHeight - y.scrollTop - y.clientHeight <= H ? (C.current = !0, v.current = "bottom", await d(), C.current = !1) : v.current = void 0;
|
|
2950
2957
|
};
|
|
2951
|
-
return /* @__PURE__ */ r.createElement(
|
|
2958
|
+
return /* @__PURE__ */ r.createElement(Ml, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Ol, { id: "infinite-list-inner", ref: g, onScroll: re }, b === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), i, o.map((y, H) => s({ message: y, index: H })), a), /* @__PURE__ */ r.createElement(Ll, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(Rl, { id: "infinite-list-overlay" }, l)));
|
|
2952
2959
|
}), cn = 50;
|
|
2953
|
-
function
|
|
2960
|
+
function $l(e) {
|
|
2954
2961
|
return e.scrollTop <= cn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= cn ? "bottom" : "middle";
|
|
2955
2962
|
}
|
|
2956
|
-
const
|
|
2963
|
+
const Ml = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ol = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${p.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Ll = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, Rl = u.div`pointer-events:auto;`, Dl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Nl, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(M, { size: 24, type: "chevron-down", color: p.color.primary.main })), Nl = u.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);${P.light`
|
|
2957
2964
|
background-color: ${p.color.background50};
|
|
2958
2965
|
&:hover {
|
|
2959
2966
|
background-color: ${p.color.background100};
|
|
@@ -2979,24 +2986,24 @@ const $l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ml = u
|
|
|
2979
2986
|
const { chatSDK: e } = B(), { channelSource: t } = Z(), [n, o] = _([]);
|
|
2980
2987
|
return Xe(e, {
|
|
2981
2988
|
onTypingStatusUpdated(s) {
|
|
2982
|
-
var
|
|
2983
|
-
if (s.url === ((
|
|
2984
|
-
const
|
|
2985
|
-
o(
|
|
2989
|
+
var i;
|
|
2990
|
+
if (s.url === ((i = t.channel) == null ? void 0 : i.url)) {
|
|
2991
|
+
const a = s.getTypingUsers();
|
|
2992
|
+
o(a);
|
|
2986
2993
|
}
|
|
2987
2994
|
}
|
|
2988
2995
|
}), n;
|
|
2989
|
-
},
|
|
2990
|
-
const { agentPreviewConfigs: e = {}, aiAgentId: t } = B(), { aiAgentInfo: n } = U(), { stringSet: o, dateLocale: s } = O(), { messageSource:
|
|
2996
|
+
}, Pl = () => {
|
|
2997
|
+
const { agentPreviewConfigs: e = {}, aiAgentId: t } = B(), { aiAgentInfo: n } = U(), { stringSet: o, dateLocale: s } = O(), { messageSource: i } = Z(), { Template: a } = xe.useContext(), l = e.welcomeMessages ?? [], c = i.messages, d = ja(c, t), h = c[d.length + 1], m = d[0] ?? h;
|
|
2991
2998
|
return {
|
|
2992
2999
|
/**
|
|
2993
3000
|
* Returns a list of messages filtered according to business requirements.
|
|
2994
3001
|
*/
|
|
2995
|
-
filteredMessages: c.filter((f) =>
|
|
3002
|
+
filteredMessages: c.filter((f) => Za(f) ? !1 : l.length > 0 ? !Se.isWelcomeMessage(f, t) : !0),
|
|
2996
3003
|
/**
|
|
2997
3004
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
2998
3005
|
*/
|
|
2999
|
-
shouldShowOriginalDate: (f) => f > 0 || l.length === 0 ? !0 :
|
|
3006
|
+
shouldShowOriginalDate: (f) => f > 0 || l.length === 0 ? !0 : h && !Or(h.createdAt, (m == null ? void 0 : m.createdAt) ?? 0),
|
|
3000
3007
|
/**
|
|
3001
3008
|
* Renders the list of welcome messages from Bot Studio.
|
|
3002
3009
|
*/
|
|
@@ -3004,41 +3011,41 @@ const $l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ml = u
|
|
|
3004
3011
|
Xn,
|
|
3005
3012
|
{
|
|
3006
3013
|
style: { margin: "16px 0" },
|
|
3007
|
-
date:
|
|
3014
|
+
date: m == null ? void 0 : m.createdAt,
|
|
3008
3015
|
locale: s,
|
|
3009
3016
|
formatString: o.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
3010
3017
|
}
|
|
3011
3018
|
), l.map((f, x) => {
|
|
3012
|
-
const
|
|
3019
|
+
const E = x === l.length - 1, b = d.length !== c.length, g = l.length === 1 ? "single" : x === 0 ? "top" : E || b ? "bottom" : "middle";
|
|
3013
3020
|
return /* @__PURE__ */ r.createElement(
|
|
3014
|
-
|
|
3021
|
+
a,
|
|
3015
3022
|
{
|
|
3016
3023
|
messageType: "user",
|
|
3017
3024
|
message: f.message,
|
|
3018
3025
|
sender: n,
|
|
3019
|
-
groupType:
|
|
3020
|
-
createdAt: (
|
|
3026
|
+
groupType: g,
|
|
3027
|
+
createdAt: (m == null ? void 0 : m.createdAt) ?? Date.now(),
|
|
3021
3028
|
extendedMessagePayload: { suggested_replies: f.suggestedReplies },
|
|
3022
3029
|
suggestedRepliesDirection: e.suggestedRepliesDirection,
|
|
3023
|
-
suggestedRepliesVisible:
|
|
3030
|
+
suggestedRepliesVisible: E && !b,
|
|
3024
3031
|
isBotMessage: !0,
|
|
3025
3032
|
onClickSuggestedReply: async ({ reply: C }) => {
|
|
3026
|
-
|
|
3033
|
+
i.sendUserMessage({ message: C });
|
|
3027
3034
|
}
|
|
3028
3035
|
}
|
|
3029
3036
|
);
|
|
3030
3037
|
}))
|
|
3031
3038
|
};
|
|
3032
|
-
},
|
|
3033
|
-
function
|
|
3039
|
+
}, Bl = (e) => u(e).withConfig({ shouldForwardProp: Kr });
|
|
3040
|
+
function Fl(e) {
|
|
3034
3041
|
var o;
|
|
3035
3042
|
const t = "remove_powered_by", n = (o = e == null ? void 0 : e.appInfo) == null ? void 0 : o.applicationAttributes;
|
|
3036
3043
|
return Array.isArray(n) && n.includes(t);
|
|
3037
3044
|
}
|
|
3038
|
-
const
|
|
3045
|
+
const Ul = ({ style: e }) => {
|
|
3039
3046
|
const { stringSet: t } = O(), { chatSDK: n } = B(), { isActionbookTester: o } = Re();
|
|
3040
|
-
return
|
|
3041
|
-
|
|
3047
|
+
return Fl(n) || o ? null : /* @__PURE__ */ r.createElement(Hl, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
|
|
3048
|
+
zl,
|
|
3042
3049
|
{
|
|
3043
3050
|
variant: "caption2",
|
|
3044
3051
|
as: "a",
|
|
@@ -3049,17 +3056,17 @@ const Fl = ({ style: e }) => {
|
|
|
3049
3056
|
},
|
|
3050
3057
|
"Sendbird"
|
|
3051
3058
|
));
|
|
3052
|
-
},
|
|
3059
|
+
}, Hl = u(w)`color:${p.themedColor.textLowEmphasis};text-align:center;`, zl = Bl(w)`
|
|
3053
3060
|
color: ${p.themedColor.textLowEmphasis};
|
|
3054
3061
|
cursor: pointer;
|
|
3055
3062
|
text-decoration: none;
|
|
3056
|
-
`,
|
|
3063
|
+
`, Vl = () => {
|
|
3057
3064
|
var c;
|
|
3058
|
-
const { stringSet: e } = O(), { activeChannel: t } = U(), { channelSource: n, goToActiveConversation: o, scrollSource: s } = Z(),
|
|
3065
|
+
const { stringSet: e } = O(), { activeChannel: t } = U(), { channelSource: n, goToActiveConversation: o, scrollSource: s } = Z(), i = Pn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && i;
|
|
3059
3066
|
return le(() => {
|
|
3060
3067
|
l && s.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
3061
|
-
}, [l]), l ? /* @__PURE__ */ r.createElement(
|
|
3062
|
-
|
|
3068
|
+
}, [l]), l ? /* @__PURE__ */ r.createElement(Wl, null, /* @__PURE__ */ r.createElement(
|
|
3069
|
+
Gl,
|
|
3063
3070
|
{
|
|
3064
3071
|
variant: "button",
|
|
3065
3072
|
role: "button",
|
|
@@ -3068,39 +3075,39 @@ const Fl = ({ style: e }) => {
|
|
|
3068
3075
|
},
|
|
3069
3076
|
e.START_NEW_CONVERSATION
|
|
3070
3077
|
)) : null;
|
|
3071
|
-
},
|
|
3072
|
-
const { Template: e } = Ot.useContext(), { Template: t } = xe.useContext(), { Template: n } = Lt.useContext(), [o, s] = _(null), { userSession:
|
|
3078
|
+
}, Wl = u.div`display:flex;justify-content:center;margin:16px 0;`, Gl = u(w)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${p.themedColor.textDisabled};cursor:pointer;user-select:none;`, jl = !0, Kl = () => {
|
|
3079
|
+
const { Template: e } = Ot.useContext(), { Template: t } = xe.useContext(), { Template: n } = Lt.useContext(), [o, s] = _(null), { userSession: i, aiAgentInfo: a } = U(), { cache: l, agentPreviewConfigs: c, chatSDK: d, state: h } = B(), { stringSet: m, dateLocale: f } = O(), { conversation: x, channelSource: E, messageSource: b, scrollSource: g } = Z(), { isActionbookTester: C } = Re(), { filteredMessages: v, shouldShowOriginalDate: S, renderAgentPreviewWelcomeMessages: k } = Pl(), F = Qn(), $ = Mt(() => {
|
|
3073
3080
|
const y = F[0];
|
|
3074
3081
|
if (!y) return null;
|
|
3075
|
-
const H = y.userId ===
|
|
3076
|
-
return { user: H ?
|
|
3082
|
+
const H = y.userId === a.userId;
|
|
3083
|
+
return { user: H ? a : y, isBot: H };
|
|
3077
3084
|
});
|
|
3078
3085
|
L(() => {
|
|
3079
|
-
$ &&
|
|
3080
|
-
}, [!!$,
|
|
3086
|
+
$ && g.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
3087
|
+
}, [!!$, g.scrollPubSub.publish]);
|
|
3081
3088
|
const V = (y, H = !1) => {
|
|
3082
|
-
var
|
|
3083
|
-
return H ?
|
|
3084
|
-
},
|
|
3085
|
-
if (!
|
|
3089
|
+
var oe;
|
|
3090
|
+
return H ? a : ((oe = E.channel) == null ? void 0 : oe.members.find((Y) => Y.userId === y.sender.userId)) ?? y.sender;
|
|
3091
|
+
}, re = () => {
|
|
3092
|
+
if (!b.initialized)
|
|
3086
3093
|
return /* @__PURE__ */ r.createElement(Ce, { type: "loading" });
|
|
3087
|
-
if (
|
|
3094
|
+
if (b.messages.length === 0) {
|
|
3088
3095
|
const y = k();
|
|
3089
|
-
return y ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, y) : /* @__PURE__ */ r.createElement(Ce, { type: "noMessages", label:
|
|
3096
|
+
return y ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, y) : /* @__PURE__ */ r.createElement(Ce, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
|
|
3090
3097
|
}
|
|
3091
3098
|
return /* @__PURE__ */ r.createElement(
|
|
3092
|
-
|
|
3099
|
+
Il,
|
|
3093
3100
|
{
|
|
3094
|
-
ref:
|
|
3095
|
-
scrollPositionRef:
|
|
3096
|
-
scrollDistanceFromBottomRef:
|
|
3097
|
-
onScrollPosition: (y) =>
|
|
3101
|
+
ref: g.scrollRef,
|
|
3102
|
+
scrollPositionRef: g.scrollPositionRef,
|
|
3103
|
+
scrollDistanceFromBottomRef: g.scrollDistanceFromBottomRef,
|
|
3104
|
+
onScrollPosition: (y) => g.setIsScrollBottomReached(y === "bottom"),
|
|
3098
3105
|
stackDirection: c == null ? void 0 : c.messageStackDirection,
|
|
3099
3106
|
messages: v,
|
|
3100
|
-
onLoadPrev:
|
|
3101
|
-
onLoadNext:
|
|
3102
|
-
depsForResetScrollPositionToBottom: [
|
|
3103
|
-
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
3107
|
+
onLoadPrev: b.loadPrevious,
|
|
3108
|
+
onLoadNext: b.loadNext,
|
|
3109
|
+
depsForResetScrollPositionToBottom: [b.initialized, b.messages.length !== 0],
|
|
3110
|
+
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ul, { style: { marginTop: 16 } }), k()),
|
|
3104
3111
|
messageBottomArea: /* @__PURE__ */ r.createElement(r.Fragment, null, $ && /* @__PURE__ */ r.createElement(
|
|
3105
3112
|
t,
|
|
3106
3113
|
{
|
|
@@ -3111,11 +3118,11 @@ const Fl = ({ style: e }) => {
|
|
|
3111
3118
|
groupType: "single",
|
|
3112
3119
|
message: ""
|
|
3113
3120
|
}
|
|
3114
|
-
), /* @__PURE__ */ r.createElement(
|
|
3115
|
-
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !
|
|
3121
|
+
), /* @__PURE__ */ r.createElement(Vl, null)),
|
|
3122
|
+
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !g.isScrollBottomReached && /* @__PURE__ */ r.createElement(Yl, { onClick: () => g.scrollPubSub.publish({ type: "scrollToBottom" }) })),
|
|
3116
3123
|
renderMessage: ({ message: y, index: H }) => {
|
|
3117
|
-
const
|
|
3118
|
-
(y.isFileMessage() || y.isUserMessage()) && s({ file: Pe, sender: V(y, y.sender.userId ===
|
|
3124
|
+
const oe = Wa(y), Y = v[H - 1], nt = v[H + 1], rt = v[v.length - 1], A = y === rt, D = Ga(y, Y, nt, jl), K = !Gr((Y == null ? void 0 : Y.createdAt) ?? 0, y.createdAt) && S(H) && !C, q = (Pe) => {
|
|
3125
|
+
(y.isFileMessage() || y.isUserMessage()) && s({ file: Pe, sender: V(y, y.sender.userId === a.userId) });
|
|
3119
3126
|
}, be = () => {
|
|
3120
3127
|
y.isFileMessage() && $t(y.url);
|
|
3121
3128
|
}, fr = K ? /* @__PURE__ */ r.createElement(
|
|
@@ -3124,10 +3131,10 @@ const Fl = ({ style: e }) => {
|
|
|
3124
3131
|
style: { margin: "16px 0" },
|
|
3125
3132
|
date: y.createdAt,
|
|
3126
3133
|
locale: f,
|
|
3127
|
-
formatString:
|
|
3134
|
+
formatString: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
3128
3135
|
}
|
|
3129
3136
|
) : null, Ne = {
|
|
3130
|
-
maxBodyWidth:
|
|
3137
|
+
maxBodyWidth: h.expanded ? Ln : void 0,
|
|
3131
3138
|
extendedMessagePayload: y.extendedMessagePayload,
|
|
3132
3139
|
createdAt: y.createdAt,
|
|
3133
3140
|
groupType: D,
|
|
@@ -3141,25 +3148,25 @@ const Fl = ({ style: e }) => {
|
|
|
3141
3148
|
{
|
|
3142
3149
|
...Ne,
|
|
3143
3150
|
...x,
|
|
3144
|
-
isResolvedWhenDeterminedByUser:
|
|
3151
|
+
isResolvedWhenDeterminedByUser: ql(x),
|
|
3145
3152
|
messageType: "admin.csat",
|
|
3146
|
-
onSubmitCSAT: ({ csat:
|
|
3153
|
+
onSubmitCSAT: ({ csat: se, csatType: me, csatReason: z, isResolved: ie }) => {
|
|
3147
3154
|
var ge;
|
|
3148
|
-
|
|
3155
|
+
se && ((ge = E.channel) == null || ge.submitCSAT({ csat: se, csatType: me, csatReason: z, isResolved: ie }));
|
|
3149
3156
|
}
|
|
3150
3157
|
}
|
|
3151
3158
|
) : null : /* @__PURE__ */ r.createElement(n, { ...Ne, messageType: "admin", message: y.message });
|
|
3152
|
-
if (Ve.isOutgoing(y,
|
|
3153
|
-
const
|
|
3159
|
+
if (Ve.isOutgoing(y, i.userId)) {
|
|
3160
|
+
const se = {
|
|
3154
3161
|
...Ne,
|
|
3155
3162
|
message: y.message,
|
|
3156
3163
|
sender: V(y),
|
|
3157
3164
|
sendingStatus: y.sendingStatus
|
|
3158
3165
|
};
|
|
3159
3166
|
if (y.isUserMessage())
|
|
3160
|
-
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...
|
|
3167
|
+
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...se });
|
|
3161
3168
|
if (y.isFileMessage()) {
|
|
3162
|
-
const [me, z] = ((Pe = y.metaArrays.find((
|
|
3169
|
+
const [me, z] = ((Pe = y.metaArrays.find((ie) => ie.key === Zn)) == null ? void 0 : Pe.value) ?? [];
|
|
3163
3170
|
return /* @__PURE__ */ r.createElement(
|
|
3164
3171
|
e,
|
|
3165
3172
|
{
|
|
@@ -3169,32 +3176,32 @@ const Fl = ({ style: e }) => {
|
|
|
3169
3176
|
aspectRatio: me && z ? `${me}/${z}` : "1/1",
|
|
3170
3177
|
localFile: (Ft = y.messageParams) == null ? void 0 : Ft.file
|
|
3171
3178
|
},
|
|
3172
|
-
...
|
|
3179
|
+
...se
|
|
3173
3180
|
}
|
|
3174
3181
|
);
|
|
3175
3182
|
}
|
|
3176
3183
|
}
|
|
3177
|
-
if (Ve.isIncoming(y,
|
|
3178
|
-
const
|
|
3184
|
+
if (Ve.isIncoming(y, i.userId)) {
|
|
3185
|
+
const se = y.sender.userId === a.userId, me = {
|
|
3179
3186
|
...Ne,
|
|
3180
|
-
sender: V(y,
|
|
3187
|
+
sender: V(y, se),
|
|
3181
3188
|
message: y.message,
|
|
3182
3189
|
suggestedRepliesVisible: A,
|
|
3183
3190
|
suggestedRepliesDirection: c == null ? void 0 : c.suggestedRepliesDirection,
|
|
3184
|
-
isBotMessage:
|
|
3191
|
+
isBotMessage: se,
|
|
3185
3192
|
isStreaming: Se.isStreaming(y),
|
|
3186
3193
|
onClickSuggestedReply: async ({ reply: z }) => {
|
|
3187
|
-
|
|
3194
|
+
b.sendUserMessage({ message: z });
|
|
3188
3195
|
},
|
|
3189
3196
|
onRequestMessageTemplate: async (z) => {
|
|
3190
|
-
const { template:
|
|
3191
|
-
return l.template.set(z,
|
|
3197
|
+
const { template: ie } = await d.aiAgent.getMessageTemplate(z);
|
|
3198
|
+
return l.template.set(z, ie), ie;
|
|
3192
3199
|
},
|
|
3193
3200
|
onGetCachedMessageTemplate: (z) => l.template.get(z),
|
|
3194
3201
|
onHandleTemplateInternalAction: (z) => {
|
|
3195
3202
|
if (z.type === "internal" && z.internalData) {
|
|
3196
|
-
const { method:
|
|
3197
|
-
|
|
3203
|
+
const { method: ie, payload: ge } = z.internalData;
|
|
3204
|
+
ie === "message.send" && (ge != null && ge.message) && b.sendUserMessage({ message: ge.message });
|
|
3198
3205
|
}
|
|
3199
3206
|
}
|
|
3200
3207
|
};
|
|
@@ -3204,45 +3211,45 @@ const Fl = ({ style: e }) => {
|
|
|
3204
3211
|
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: y, ...me });
|
|
3205
3212
|
}
|
|
3206
3213
|
})();
|
|
3207
|
-
return /* @__PURE__ */ r.createElement("div", { key:
|
|
3214
|
+
return /* @__PURE__ */ r.createElement("div", { key: oe, id: `${J}-message-item` }, fr, br);
|
|
3208
3215
|
}
|
|
3209
3216
|
}
|
|
3210
3217
|
);
|
|
3211
3218
|
};
|
|
3212
|
-
return /* @__PURE__ */ r.createElement(
|
|
3213
|
-
},
|
|
3214
|
-
function
|
|
3219
|
+
return /* @__PURE__ */ r.createElement(Zl, { id: `${J}-message-list` }, re(), o && /* @__PURE__ */ r.createElement(Tl, { onClose: () => s(null), sender: o.sender, file: o.file }));
|
|
3220
|
+
}, Zl = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Yl = u(Dl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
|
|
3221
|
+
function ql(e) {
|
|
3215
3222
|
var t;
|
|
3216
3223
|
if (((t = e == null ? void 0 : e.resolution) == null ? void 0 : t.determinedBy) === "user")
|
|
3217
3224
|
return e.resolution.isResolved;
|
|
3218
3225
|
}
|
|
3219
|
-
const
|
|
3226
|
+
const Jl = () => {
|
|
3220
3227
|
const { stringSet: e } = O(), { connectionError: t } = U(), { channelSource: n } = Z(), o = t || n.error;
|
|
3221
3228
|
if (o) {
|
|
3222
3229
|
const s = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
|
|
3223
3230
|
return /* @__PURE__ */ r.createElement(Ce, { type: "error", label: o.message, action: s });
|
|
3224
3231
|
}
|
|
3225
|
-
return n.channel ? /* @__PURE__ */ r.createElement(
|
|
3232
|
+
return n.channel ? /* @__PURE__ */ r.createElement(Kl, null) : /* @__PURE__ */ r.createElement(Ce, { type: "loading" });
|
|
3226
3233
|
}, er = () => {
|
|
3227
3234
|
const { stringSet: e } = O(), { activeChannel: t } = U(), [n] = _(() => (t == null ? void 0 : t.status) === W.OPEN);
|
|
3228
3235
|
return n ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
|
|
3229
|
-
},
|
|
3236
|
+
}, Xl = () => {
|
|
3230
3237
|
const { stringSet: e } = O(), { goToActiveConversation: t } = Z(), n = er();
|
|
3231
|
-
return /* @__PURE__ */ r.createElement(
|
|
3232
|
-
},
|
|
3238
|
+
return /* @__PURE__ */ r.createElement(Ql, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: p.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ r.createElement(ec, { onClick: t }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: p.themedColor.textHighEmphasis }, n)));
|
|
3239
|
+
}, Ql = u.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${P.light`
|
|
3233
3240
|
background-color: ${p.color.background100};
|
|
3234
3241
|
`}
|
|
3235
3242
|
${P.dark`
|
|
3236
3243
|
background-color: ${p.color.background500};
|
|
3237
3244
|
`}
|
|
3238
|
-
`,
|
|
3245
|
+
`, ec = u.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${p.themedColor.textDisabled};cursor:pointer;${P.light`
|
|
3239
3246
|
background-color: ${p.color.background50};
|
|
3240
3247
|
`}
|
|
3241
3248
|
${P.dark`
|
|
3242
3249
|
background-color: ${p.color.background700};
|
|
3243
3250
|
`}
|
|
3244
|
-
`, tr = ve(void 0),
|
|
3245
|
-
const { stringSet: t } = O(), { attachmentMode: n } = U(), { channelSource: o } = Z(), [s,
|
|
3251
|
+
`, tr = ve(void 0), tc = ({ children: e }) => {
|
|
3252
|
+
const { stringSet: t } = O(), { attachmentMode: n } = U(), { channelSource: o } = Z(), [s, i] = _([]), [a, l] = _({
|
|
3246
3253
|
visible: !1,
|
|
3247
3254
|
title: "",
|
|
3248
3255
|
buttonText: t.BUTTON__OK
|
|
@@ -3257,80 +3264,80 @@ const ql = () => {
|
|
|
3257
3264
|
default:
|
|
3258
3265
|
return c;
|
|
3259
3266
|
}
|
|
3260
|
-
}, [n, c]),
|
|
3267
|
+
}, [n, c]), h = (x) => {
|
|
3261
3268
|
if (!d) return;
|
|
3262
|
-
const
|
|
3263
|
-
if (
|
|
3264
|
-
if (
|
|
3265
|
-
l((
|
|
3266
|
-
...
|
|
3269
|
+
const E = x.filter((b) => On.includes(b.type));
|
|
3270
|
+
if (E.length !== 0) {
|
|
3271
|
+
if (E.some((b) => b.size > Ss)) {
|
|
3272
|
+
l((b) => ({
|
|
3273
|
+
...b,
|
|
3267
3274
|
visible: !0,
|
|
3268
3275
|
title: t.FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT.replace("%d", "25")
|
|
3269
3276
|
}));
|
|
3270
3277
|
return;
|
|
3271
3278
|
}
|
|
3272
|
-
if (
|
|
3273
|
-
l((
|
|
3274
|
-
...
|
|
3279
|
+
if (E.length > 1 || E.length > 0 && s.length > 0) {
|
|
3280
|
+
l((b) => ({
|
|
3281
|
+
...b,
|
|
3275
3282
|
visible: !0,
|
|
3276
3283
|
title: t.FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT
|
|
3277
3284
|
}));
|
|
3278
3285
|
return;
|
|
3279
3286
|
}
|
|
3280
|
-
|
|
3281
|
-
...
|
|
3282
|
-
...
|
|
3283
|
-
file:
|
|
3284
|
-
preview: { url: URL.createObjectURL(
|
|
3287
|
+
i((b) => [
|
|
3288
|
+
...b,
|
|
3289
|
+
...E.map((g) => ({
|
|
3290
|
+
file: g,
|
|
3291
|
+
preview: { url: URL.createObjectURL(g), type: g.type, name: g.name }
|
|
3285
3292
|
}))
|
|
3286
3293
|
]);
|
|
3287
3294
|
}
|
|
3288
|
-
},
|
|
3289
|
-
|
|
3290
|
-
var
|
|
3291
|
-
const
|
|
3292
|
-
return
|
|
3295
|
+
}, m = (x) => {
|
|
3296
|
+
i((E) => {
|
|
3297
|
+
var g;
|
|
3298
|
+
const b = (g = E[x]) == null ? void 0 : g.preview;
|
|
3299
|
+
return b && URL.revokeObjectURL(b.url), E.filter((C, v) => v !== x);
|
|
3293
3300
|
});
|
|
3294
3301
|
}, f = () => {
|
|
3295
|
-
|
|
3302
|
+
i((x) => (x.forEach((E) => URL.revokeObjectURL(E.preview.url)), []));
|
|
3296
3303
|
};
|
|
3297
3304
|
return /* @__PURE__ */ r.createElement(
|
|
3298
3305
|
tr.Provider,
|
|
3299
3306
|
{
|
|
3300
3307
|
value: {
|
|
3301
3308
|
files: s,
|
|
3302
|
-
addFiles:
|
|
3303
|
-
removeFile:
|
|
3309
|
+
addFiles: h,
|
|
3310
|
+
removeFile: m,
|
|
3304
3311
|
clearFiles: f,
|
|
3305
3312
|
isFileUploadEnabled: d
|
|
3306
3313
|
}
|
|
3307
3314
|
},
|
|
3308
3315
|
e,
|
|
3309
|
-
/* @__PURE__ */ r.createElement(
|
|
3316
|
+
/* @__PURE__ */ r.createElement(nc, { ...a, onClose: () => l((x) => ({ ...x, visible: !1, title: "" })) })
|
|
3310
3317
|
);
|
|
3311
3318
|
}, Dt = () => {
|
|
3312
|
-
const e =
|
|
3319
|
+
const e = Q(tr);
|
|
3313
3320
|
if (!e)
|
|
3314
3321
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
3315
3322
|
return e;
|
|
3316
|
-
},
|
|
3323
|
+
}, nc = ({
|
|
3317
3324
|
title: e,
|
|
3318
3325
|
buttonText: t,
|
|
3319
3326
|
visible: n,
|
|
3320
3327
|
onClose: o
|
|
3321
|
-
}) => /* @__PURE__ */ r.createElement(Yn, { rootElementId:
|
|
3322
|
-
function
|
|
3328
|
+
}) => /* @__PURE__ */ r.createElement(Yn, { rootElementId: ee.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(rc, null, /* @__PURE__ */ r.createElement(sc, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: p.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(oc, null, /* @__PURE__ */ r.createElement(ic, { onClick: o }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: p.themedColor.textHighEmphasisInverse }, t))))), rc = u.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};`, oc = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, sc = u.div`margin-bottom:16px;`, ic = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${p.themedColor.error};border:1px solid ${p.themedColor.error};padding:10px 16px;&:hover{background-color:${p.color.error.dark};border-color:${p.color.error.dark};}&:active{background-color:${p.color.error.extraDark};}`;
|
|
3329
|
+
function ac({ blurred: e, elementRef: t, document: n = window.document }) {
|
|
3323
3330
|
const o = N(!1);
|
|
3324
3331
|
e && t.current && n.activeElement === t.current && (o.current = !0), le(() => {
|
|
3325
3332
|
var s;
|
|
3326
3333
|
!e && o.current && ((s = t.current) == null || s.focus(), o.current = !1);
|
|
3327
3334
|
}, [e]);
|
|
3328
3335
|
}
|
|
3329
|
-
const
|
|
3336
|
+
const lc = (e, t) => {
|
|
3330
3337
|
L(() => {
|
|
3331
3338
|
t ? e == null || e.startTyping() : e == null || e.endTyping();
|
|
3332
3339
|
}, [e, t]);
|
|
3333
|
-
},
|
|
3340
|
+
}, cc = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, dc = u.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;}`, uc = u.div`display:flex;align-items:center;justify-content:center;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;cursor:pointer;border-radius:50%;${P.light`
|
|
3334
3341
|
background-color: ${p.color.background50};
|
|
3335
3342
|
`}
|
|
3336
3343
|
${P.dark`
|
|
@@ -3349,16 +3356,16 @@ const ac = (e, t) => {
|
|
|
3349
3356
|
circle {
|
|
3350
3357
|
stroke: ${p.themedColor.bg_50_600};
|
|
3351
3358
|
}
|
|
3352
|
-
`,
|
|
3353
|
-
const e = Oe(), [t, n] = _(), { files: o, removeFile: s, isFileUploadEnabled:
|
|
3354
|
-
return !
|
|
3355
|
-
},
|
|
3356
|
-
const { stringSet: n } = O(), { aiAgentInfo: o } = U(), s =
|
|
3359
|
+
`, mc = () => {
|
|
3360
|
+
const e = Oe(), [t, n] = _(), { files: o, removeFile: s, isFileUploadEnabled: i } = Dt();
|
|
3361
|
+
return !i || o.length === 0 ? null : /* @__PURE__ */ r.createElement(cc, null, o.map(({ preview: { type: a, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(dc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(uc, { title: "Remove file", onClick: () => s(d) }, /* @__PURE__ */ r.createElement(M, { type: "close-filled", color: p.themedColor.textMidEmphasis })), a.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(At, { name: l, type: wt(l, a) }))));
|
|
3362
|
+
}, gc = ({ channel: e, messages: t }) => {
|
|
3363
|
+
const { stringSet: n } = O(), { aiAgentInfo: o } = U(), s = hc(), i = pc({
|
|
3357
3364
|
lastMessage: t[t.length - 1],
|
|
3358
3365
|
aiAgentUserId: o.userId
|
|
3359
3366
|
});
|
|
3360
|
-
return !e || !s || Pn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] :
|
|
3361
|
-
},
|
|
3367
|
+
return !e || !s || Pn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : i ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
|
|
3368
|
+
}, hc = () => {
|
|
3362
3369
|
const e = bn(), { chatSDK: t } = B(), [n, o] = _(!0);
|
|
3363
3370
|
return L(() => {
|
|
3364
3371
|
const s = new Je({
|
|
@@ -3370,28 +3377,28 @@ const ac = (e, t) => {
|
|
|
3370
3377
|
t.removeConnectionHandler(e);
|
|
3371
3378
|
};
|
|
3372
3379
|
}, [t]), n;
|
|
3373
|
-
},
|
|
3380
|
+
}, pc = ({
|
|
3374
3381
|
lastMessage: e,
|
|
3375
3382
|
aiAgentUserId: t
|
|
3376
3383
|
}) => {
|
|
3377
3384
|
const [n, o] = _(!1), s = Qn();
|
|
3378
3385
|
return L(() => {
|
|
3379
3386
|
if (!e) return;
|
|
3380
|
-
const
|
|
3381
|
-
o(!!(
|
|
3387
|
+
const i = s.some((l) => l.userId === t), a = Gn(e, t) && Se.isStreaming(e);
|
|
3388
|
+
o(!!(a || i));
|
|
3382
3389
|
}, [s, e, t]), n;
|
|
3383
3390
|
}, nr = {
|
|
3384
3391
|
textArea: I`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
3385
3392
|
attachIcon: I`margin-bottom:4px;`
|
|
3386
|
-
}, rr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`,
|
|
3387
|
-
const t = N(null), { addFiles: n, clearFiles: o, files: s, isFileUploadEnabled:
|
|
3388
|
-
return !
|
|
3389
|
-
|
|
3393
|
+
}, rr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, fc = u(rr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${p.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${p.themedColor.bg_200_400};}}${_t && nr.attachIcon};`, bc = u.input`display:none;`, dn = u.div`width:100%;position:relative;background-color:${p.themedColor.bg_100_500};border-radius:20px;`, un = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, mn = u.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:${p.themedColor.textHighEmphasis};resize:none;width:100%;height:${Mn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${_t && nr.textArea};&::placeholder{color:${p.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${p.themedColor.textDisabled};}}`, gn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, hn = ({ disabled: e }) => {
|
|
3394
|
+
const t = N(null), { addFiles: n, clearFiles: o, files: s, isFileUploadEnabled: i } = Dt();
|
|
3395
|
+
return !i || s.length > 0 ? null : /* @__PURE__ */ r.createElement(
|
|
3396
|
+
fc,
|
|
3390
3397
|
{
|
|
3391
3398
|
disabled: e,
|
|
3392
3399
|
onClick: () => {
|
|
3393
|
-
var
|
|
3394
|
-
o(), (
|
|
3400
|
+
var a;
|
|
3401
|
+
o(), (a = t.current) == null || a.click();
|
|
3395
3402
|
}
|
|
3396
3403
|
},
|
|
3397
3404
|
/* @__PURE__ */ r.createElement(
|
|
@@ -3403,50 +3410,50 @@ const ac = (e, t) => {
|
|
|
3403
3410
|
}
|
|
3404
3411
|
),
|
|
3405
3412
|
/* @__PURE__ */ r.createElement(
|
|
3406
|
-
|
|
3413
|
+
bc,
|
|
3407
3414
|
{
|
|
3408
3415
|
type: "file",
|
|
3409
3416
|
ref: t,
|
|
3410
|
-
onChange: (
|
|
3411
|
-
const l =
|
|
3412
|
-
l && n(Array.from(l)),
|
|
3417
|
+
onChange: (a) => {
|
|
3418
|
+
const l = a.currentTarget.files;
|
|
3419
|
+
l && n(Array.from(l)), a.target.value = "";
|
|
3413
3420
|
},
|
|
3414
3421
|
accept: On.join(",")
|
|
3415
3422
|
}
|
|
3416
3423
|
)
|
|
3417
3424
|
);
|
|
3418
|
-
},
|
|
3419
|
-
const e = N(null), [t, n] = _(""), { rootElement: o } = B(), { channelSource: s, messageSource:
|
|
3425
|
+
}, Ec = () => {
|
|
3426
|
+
const e = N(null), [t, n] = _(""), { rootElement: o } = B(), { channelSource: s, messageSource: i } = Z(), [a, l] = gc({
|
|
3420
3427
|
channel: s.channel,
|
|
3421
|
-
messages:
|
|
3422
|
-
}), { files: c, addFiles: d, clearFiles:
|
|
3423
|
-
|
|
3424
|
-
const
|
|
3425
|
-
e.current && (e.current.value = "", e.current.style.height = ""),
|
|
3426
|
-
},
|
|
3428
|
+
messages: i.messages
|
|
3429
|
+
}), { files: c, addFiles: d, clearFiles: h } = Dt();
|
|
3430
|
+
ol({ onDropFiles: d }), ac({ blurred: a, elementRef: e, document: pe(o) }), lc(s.channel, t);
|
|
3431
|
+
const m = t.trim().length > 0, f = c.length > 0, x = !a && (m || f), E = () => {
|
|
3432
|
+
e.current && (e.current.value = "", e.current.style.height = ""), h(), n("");
|
|
3433
|
+
}, b = async () => {
|
|
3427
3434
|
const S = t.trim(), k = { message: S };
|
|
3428
3435
|
if (!(!S && !c.length)) {
|
|
3429
3436
|
if (c.length > 0) {
|
|
3430
3437
|
const F = c[0].file, $ = { ...k, file: F };
|
|
3431
|
-
|
|
3438
|
+
i.sendFileMessage($), E();
|
|
3432
3439
|
return;
|
|
3433
3440
|
}
|
|
3434
|
-
|
|
3441
|
+
i.sendUserMessage(k), E();
|
|
3435
3442
|
}
|
|
3436
|
-
},
|
|
3443
|
+
}, g = (S) => {
|
|
3437
3444
|
const k = Array.from(S.clipboardData.files);
|
|
3438
3445
|
k.length > 0 && (S.preventDefault(), d(k));
|
|
3439
3446
|
}, C = (S) => {
|
|
3440
|
-
S.key !== "Enter" || S.nativeEvent.isComposing || S.shiftKey || (S.preventDefault(),
|
|
3447
|
+
S.key !== "Enter" || S.nativeEvent.isComposing || S.shiftKey || (S.preventDefault(), b());
|
|
3441
3448
|
}, v = (S) => {
|
|
3442
3449
|
if (e.current) {
|
|
3443
3450
|
e.current.style.height = "";
|
|
3444
|
-
const k = Math.min(
|
|
3451
|
+
const k = Math.min(_s, e.current.scrollHeight);
|
|
3445
3452
|
Mn < k && (e.current.style.height = `${k}px`);
|
|
3446
3453
|
}
|
|
3447
3454
|
n(S.target.value);
|
|
3448
3455
|
};
|
|
3449
|
-
return
|
|
3456
|
+
return a ? /* @__PURE__ */ r.createElement(gn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(mn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(hn, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(gn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(mc, null), /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(
|
|
3450
3457
|
mn,
|
|
3451
3458
|
{
|
|
3452
3459
|
ref: e,
|
|
@@ -3456,73 +3463,73 @@ const ac = (e, t) => {
|
|
|
3456
3463
|
maxLength: 5e3,
|
|
3457
3464
|
onKeyDown: C,
|
|
3458
3465
|
onChange: v,
|
|
3459
|
-
onPaste:
|
|
3466
|
+
onPaste: g
|
|
3460
3467
|
}
|
|
3461
|
-
), /* @__PURE__ */ r.createElement(hn, null))), x && /* @__PURE__ */ r.createElement(rr, { onClick: () =>
|
|
3462
|
-
},
|
|
3468
|
+
), /* @__PURE__ */ r.createElement(hn, null))), x && /* @__PURE__ */ r.createElement(rr, { onClick: () => b() }, /* @__PURE__ */ r.createElement(M, { type: "send", color: p.color.primary.main, size: 20 })));
|
|
3469
|
+
}, xc = u.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:${p.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${P.light`
|
|
3463
3470
|
color: ${p.color.information.light};
|
|
3464
3471
|
`};
|
|
3465
3472
|
${P.dark`
|
|
3466
3473
|
color: ${p.color.information.main};
|
|
3467
3474
|
`};
|
|
3468
3475
|
}
|
|
3469
|
-
`,
|
|
3476
|
+
`, Cc = T(() => import("./D5uRw0Em.js").then((e) => ({ default: e.MarkdownText }))), vc = () => {
|
|
3470
3477
|
const { aiAgentInfo: e } = U(), { messageSource: t } = Z(), { userSession: n } = U();
|
|
3471
|
-
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((s) => Gn(s, n.userId))) ? null : /* @__PURE__ */ r.createElement(
|
|
3472
|
-
},
|
|
3473
|
-
var
|
|
3474
|
-
const { activeChannel: e } = U(), { channelSource: t } = Z(), n = ((
|
|
3475
|
-
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(
|
|
3476
|
-
},
|
|
3478
|
+
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((s) => Gn(s, n.userId))) ? null : /* @__PURE__ */ r.createElement(xc, null, /* @__PURE__ */ r.createElement(Cc, null, e.specialNotice));
|
|
3479
|
+
}, yc = () => /* @__PURE__ */ r.createElement(_c, null, /* @__PURE__ */ r.createElement(vc, null), /* @__PURE__ */ r.createElement(tc, null, /* @__PURE__ */ r.createElement(Ec, null))), _c = u.div`z-index:0;border:none;width:100%;`, Sc = () => {
|
|
3480
|
+
var i, a, l;
|
|
3481
|
+
const { activeChannel: e } = U(), { channelSource: t } = Z(), n = ((a = (i = t.channel) == null ? void 0 : i.conversation) == null ? void 0 : a.status) === W.CLOSED;
|
|
3482
|
+
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Xl, null) : /* @__PURE__ */ r.createElement(yc, null);
|
|
3483
|
+
}, Tc = () => {
|
|
3477
3484
|
var v;
|
|
3478
|
-
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: s } = B(), { stringSet:
|
|
3485
|
+
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: s } = B(), { stringSet: i } = O(), { aiAgentInfo: a, activeChannel: l } = U(), { channelSource: c, onNavigateToConversationList: d } = Z(), h = c.channel, f = Oe() ? 24 : 16, x = () => {
|
|
3479
3486
|
e.setOpened(!1);
|
|
3480
|
-
},
|
|
3487
|
+
}, E = async () => {
|
|
3481
3488
|
try {
|
|
3482
|
-
const S = await (
|
|
3489
|
+
const S = await (h == null ? void 0 : h.markConversationAsHandoff());
|
|
3483
3490
|
t.info("conversation.handleAgentHandoff: success", S);
|
|
3484
3491
|
} catch (S) {
|
|
3485
3492
|
t.error("conversation.handleAgentHandoff: error", S);
|
|
3486
3493
|
}
|
|
3487
|
-
},
|
|
3488
|
-
|
|
3489
|
-
},
|
|
3490
|
-
return /* @__PURE__ */ r.createElement(
|
|
3491
|
-
|
|
3494
|
+
}, b = async () => {
|
|
3495
|
+
h && await s.send(oo.CloseConversation({ channelUrl: h.url }));
|
|
3496
|
+
}, g = l && (h == null ? void 0 : h.url) === l.url, C = a.showHandoffButton && !!((v = h == null ? void 0 : h.conversation) != null && v.handoff) && g;
|
|
3497
|
+
return /* @__PURE__ */ r.createElement($c, null, /* @__PURE__ */ r.createElement(Mc, null, d && /* @__PURE__ */ r.createElement(De, { onClick: () => d() }, /* @__PURE__ */ r.createElement(M, { type: "menu", size: 24, color: p.themedColor.textHighEmphasis })), g && /* @__PURE__ */ r.createElement(qn, { size: 34 }), /* @__PURE__ */ r.createElement(Lc, { variant: "h2", color: p.themedColor.textHighEmphasis }, a.nickname || (h == null ? void 0 : h.name))), /* @__PURE__ */ r.createElement(Oc, null, C && /* @__PURE__ */ r.createElement(
|
|
3498
|
+
Ic,
|
|
3492
3499
|
{
|
|
3493
|
-
tooltipLabel:
|
|
3494
|
-
disabled: !
|
|
3500
|
+
tooltipLabel: i.HEADER_BUTTON__AGENT_HANDOFF,
|
|
3501
|
+
disabled: !si(h),
|
|
3495
3502
|
size: f,
|
|
3496
|
-
onClick:
|
|
3503
|
+
onClick: E
|
|
3497
3504
|
}
|
|
3498
3505
|
), n && /* @__PURE__ */ r.createElement(
|
|
3499
|
-
|
|
3506
|
+
kc,
|
|
3500
3507
|
{
|
|
3501
|
-
disabled: !Bn(
|
|
3508
|
+
disabled: !Bn(h),
|
|
3502
3509
|
size: f,
|
|
3503
|
-
onClick:
|
|
3510
|
+
onClick: b
|
|
3504
3511
|
}
|
|
3505
|
-
), o && /* @__PURE__ */ r.createElement(
|
|
3506
|
-
},
|
|
3512
|
+
), o && /* @__PURE__ */ r.createElement(wc, { size: f }), /* @__PURE__ */ r.createElement(Ac, { size: f, onClick: x })));
|
|
3513
|
+
}, wc = ({ size: e, disabled: t }) => {
|
|
3507
3514
|
const { state: n } = B();
|
|
3508
3515
|
return /* @__PURE__ */ r.createElement(De, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(M, { type: n.expanded ? "collapse" : "expand", size: e, color: p.themedColor.textHighEmphasis }));
|
|
3509
|
-
},
|
|
3516
|
+
}, Ac = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(De, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(M, { type: "close", size: e, color: p.themedColor.textHighEmphasis })), kc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(De, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
|
|
3510
3517
|
M,
|
|
3511
3518
|
{
|
|
3512
3519
|
type: "refresh",
|
|
3513
3520
|
size: e,
|
|
3514
3521
|
color: t ? p.themedColor.textDisabled : p.themedColor.textHighEmphasis
|
|
3515
3522
|
}
|
|
3516
|
-
)),
|
|
3523
|
+
)), Ic = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Vn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(De, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
|
|
3517
3524
|
M,
|
|
3518
3525
|
{
|
|
3519
3526
|
type: "agent",
|
|
3520
3527
|
size: e,
|
|
3521
3528
|
color: n ? p.themedColor.textDisabled : p.themedColor.textHighEmphasis
|
|
3522
3529
|
}
|
|
3523
|
-
))),
|
|
3530
|
+
))), $c = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${p.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Mc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, Oc = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Lc = u(w)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, De = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Rc = () => {
|
|
3524
3531
|
const { isActionbookTester: e } = Re();
|
|
3525
|
-
return e ? null : /* @__PURE__ */ r.createElement(
|
|
3532
|
+
return e ? null : /* @__PURE__ */ r.createElement(Tc, null);
|
|
3526
3533
|
}, pn = ({
|
|
3527
3534
|
children: e,
|
|
3528
3535
|
onNavigateToConversationList: t,
|
|
@@ -3531,71 +3538,79 @@ const ac = (e, t) => {
|
|
|
3531
3538
|
}) => {
|
|
3532
3539
|
const { Template: s } = Nt.useContext();
|
|
3533
3540
|
return /* @__PURE__ */ r.createElement(
|
|
3534
|
-
|
|
3541
|
+
rl,
|
|
3535
3542
|
{
|
|
3536
3543
|
onNavigateToConversationList: t,
|
|
3537
3544
|
closedChannelUrl: n,
|
|
3538
3545
|
onClearClosedChannelUrl: o
|
|
3539
3546
|
},
|
|
3540
|
-
/* @__PURE__ */ r.createElement(Et, null, /* @__PURE__ */ r.createElement(Et.Consumer, null, (
|
|
3547
|
+
/* @__PURE__ */ r.createElement(Et, null, /* @__PURE__ */ r.createElement(Et.Consumer, null, (i) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Nc, { ...i }, /* @__PURE__ */ r.createElement(s, null)), e)))
|
|
3541
3548
|
);
|
|
3542
3549
|
}, Nt = _e({
|
|
3543
|
-
template:
|
|
3550
|
+
template: Dc,
|
|
3544
3551
|
components: {
|
|
3545
|
-
Header:
|
|
3546
|
-
Body:
|
|
3547
|
-
Footer:
|
|
3552
|
+
Header: Rc,
|
|
3553
|
+
Body: Jl,
|
|
3554
|
+
Footer: Sc
|
|
3548
3555
|
}
|
|
3549
3556
|
});
|
|
3550
|
-
function
|
|
3557
|
+
function Dc() {
|
|
3551
3558
|
const { components: e } = Nt.useContext();
|
|
3552
3559
|
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));
|
|
3553
3560
|
}
|
|
3554
|
-
const
|
|
3555
|
-
Provider:
|
|
3556
|
-
Context:
|
|
3561
|
+
const Nc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
3562
|
+
Provider: Pc,
|
|
3563
|
+
Context: au,
|
|
3557
3564
|
useContext: or
|
|
3558
3565
|
} = G("ConversationList");
|
|
3559
|
-
function
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3566
|
+
function Bc({
|
|
3567
|
+
conversationListLimit: e,
|
|
3568
|
+
conversationListFilter: t,
|
|
3569
|
+
onOpenConversationView: n = Ie,
|
|
3570
|
+
children: o
|
|
3563
3571
|
}) {
|
|
3564
|
-
return /* @__PURE__ */ r.createElement(
|
|
3572
|
+
return /* @__PURE__ */ r.createElement(
|
|
3573
|
+
ho,
|
|
3574
|
+
{
|
|
3575
|
+
conversationListLimit: e,
|
|
3576
|
+
conversationListFilter: t
|
|
3577
|
+
},
|
|
3578
|
+
(s) => /* @__PURE__ */ r.createElement(Pc, { value: { ...s, onOpenConversationView: n } }, o)
|
|
3579
|
+
);
|
|
3565
3580
|
}
|
|
3566
3581
|
const sr = _e({
|
|
3567
|
-
template:
|
|
3582
|
+
template: Fc,
|
|
3568
3583
|
// Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
|
|
3569
3584
|
components: {}
|
|
3570
3585
|
});
|
|
3571
|
-
function
|
|
3586
|
+
function Fc({
|
|
3572
3587
|
title: e = "",
|
|
3573
3588
|
lastMessageTimestamp: t = Date.now(),
|
|
3574
3589
|
onClick: n
|
|
3575
3590
|
}) {
|
|
3576
3591
|
const { stringSet: o, format: s } = O();
|
|
3577
|
-
return /* @__PURE__ */ r.createElement(
|
|
3592
|
+
return /* @__PURE__ */ r.createElement(Uc, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(zc, null, /* @__PURE__ */ r.createElement(Vc, null, /* @__PURE__ */ r.createElement(w, { variant: "subtitle1", color: p.themedColor.textHighEmphasis }, s(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE)), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: p.themedColor.textLowEmphasis }, s(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION))), /* @__PURE__ */ r.createElement(w, { variant: "body3", color: p.themedColor.textMidEmphasis }, e || o.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ r.createElement(M, { type: "chevron-right", size: 16, color: p.themedColor.textHighEmphasis }), /* @__PURE__ */ r.createElement(Hc, null));
|
|
3578
3593
|
}
|
|
3579
|
-
const
|
|
3594
|
+
const Uc = u.div`display:flex;flex-direction:row;align-items:center;position:relative;width:100%;padding:14px 16px;box-sizing:border-box;gap:4px;cursor:pointer;`, Hc = u.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${p.themedColor.textDisabled};`, zc = u.div`gap:4px;display:flex;flex-direction:column;flex:1;`, Vc = u.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, Wc = ({ items: e, renderItem: t, onEndReached: n }) => {
|
|
3580
3595
|
const o = (s) => {
|
|
3581
|
-
const
|
|
3582
|
-
|
|
3596
|
+
const i = s.target;
|
|
3597
|
+
i.scrollHeight - i.scrollTop === i.clientHeight && (n == null || n());
|
|
3583
3598
|
};
|
|
3584
|
-
return /* @__PURE__ */ r.createElement(
|
|
3585
|
-
},
|
|
3599
|
+
return /* @__PURE__ */ r.createElement(Gc, { onScroll: (s) => o(s) }, e.map((s, i) => t(s, i)));
|
|
3600
|
+
}, Gc = u.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, jc = () => {
|
|
3586
3601
|
const { stringSet: e } = O(), { listSource: t, onOpenConversationView: n } = or(), { Template: o } = sr.useContext();
|
|
3587
3602
|
return t.initialized ? t.channels.length === 0 ? /* @__PURE__ */ r.createElement(Ce, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ r.createElement(
|
|
3588
|
-
|
|
3603
|
+
Wc,
|
|
3589
3604
|
{
|
|
3590
3605
|
items: t.channels,
|
|
3591
3606
|
renderItem: (s) => {
|
|
3592
|
-
var
|
|
3607
|
+
var i, a, l;
|
|
3593
3608
|
return /* @__PURE__ */ r.createElement(
|
|
3594
3609
|
o,
|
|
3595
3610
|
{
|
|
3596
3611
|
key: s.url,
|
|
3597
3612
|
channelUrl: s.url,
|
|
3598
|
-
title: (
|
|
3613
|
+
title: (a = (i = s.conversation) == null ? void 0 : i.topics) == null ? void 0 : a.join(", "),
|
|
3599
3614
|
lastMessageTimestamp: (l = s.lastMessage) == null ? void 0 : l.createdAt,
|
|
3600
3615
|
onClick: () => n(s.url, W.CLOSED),
|
|
3601
3616
|
channel: s
|
|
@@ -3607,10 +3622,10 @@ const Fc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3607
3622
|
}
|
|
3608
3623
|
}
|
|
3609
3624
|
) : /* @__PURE__ */ r.createElement(Ce, { type: "loading" });
|
|
3610
|
-
},
|
|
3625
|
+
}, Kc = () => {
|
|
3611
3626
|
const { refreshActiveChannel: e } = U(), { onOpenConversationView: t } = or(), n = er();
|
|
3612
3627
|
return /* @__PURE__ */ r.createElement(
|
|
3613
|
-
|
|
3628
|
+
Zc,
|
|
3614
3629
|
{
|
|
3615
3630
|
role: "button",
|
|
3616
3631
|
onClick: async () => {
|
|
@@ -3618,35 +3633,41 @@ const Fc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3618
3633
|
t(o, W.OPEN);
|
|
3619
3634
|
}
|
|
3620
3635
|
},
|
|
3621
|
-
/* @__PURE__ */ r.createElement(
|
|
3636
|
+
/* @__PURE__ */ r.createElement(Yc, { variant: "h1" }, n)
|
|
3622
3637
|
);
|
|
3623
|
-
},
|
|
3638
|
+
}, Zc = u.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, Yc = u(w)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, qc = () => {
|
|
3624
3639
|
const { stringSet: e } = O();
|
|
3625
|
-
return /* @__PURE__ */ r.createElement(
|
|
3626
|
-
},
|
|
3627
|
-
|
|
3640
|
+
return /* @__PURE__ */ r.createElement(Jc, null, /* @__PURE__ */ r.createElement(Xc, { variant: "h2", color: p.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Qc, null));
|
|
3641
|
+
}, Jc = u.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};`, Xc = u(w)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Qc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${p.themedColor.textDisabled};`, ed = ({
|
|
3642
|
+
conversationListLimit: e,
|
|
3643
|
+
conversationListFilter: t,
|
|
3644
|
+
children: n,
|
|
3645
|
+
onOpenConversationView: o
|
|
3646
|
+
}) => {
|
|
3647
|
+
const { Template: s } = Pt.useContext();
|
|
3628
3648
|
return /* @__PURE__ */ r.createElement(
|
|
3629
|
-
|
|
3649
|
+
Bc,
|
|
3630
3650
|
{
|
|
3631
|
-
|
|
3632
|
-
|
|
3651
|
+
conversationListLimit: e,
|
|
3652
|
+
conversationListFilter: t,
|
|
3653
|
+
onOpenConversationView: o
|
|
3633
3654
|
},
|
|
3634
|
-
/* @__PURE__ */ r.createElement(
|
|
3635
|
-
|
|
3655
|
+
/* @__PURE__ */ r.createElement(nd, null, /* @__PURE__ */ r.createElement(s, null)),
|
|
3656
|
+
n
|
|
3636
3657
|
);
|
|
3637
3658
|
}, Pt = _e({
|
|
3638
|
-
template:
|
|
3659
|
+
template: td,
|
|
3639
3660
|
components: {
|
|
3640
|
-
Header:
|
|
3641
|
-
Body:
|
|
3642
|
-
Footer:
|
|
3661
|
+
Header: qc,
|
|
3662
|
+
Body: jc,
|
|
3663
|
+
Footer: Kc
|
|
3643
3664
|
}
|
|
3644
3665
|
});
|
|
3645
|
-
function
|
|
3666
|
+
function td() {
|
|
3646
3667
|
const { components: e } = Pt.useContext();
|
|
3647
3668
|
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));
|
|
3648
3669
|
}
|
|
3649
|
-
const
|
|
3670
|
+
const nd = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, rd = I`:where(#${ee.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, od = [rd, is, as], sd = (e, ...t) => $r(e, ...od, ...t), id = sd``, ad = Zr(
|
|
3650
3671
|
Nt,
|
|
3651
3672
|
xe,
|
|
3652
3673
|
Ot,
|
|
@@ -3654,17 +3675,17 @@ const td = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:
|
|
|
3654
3675
|
Pt,
|
|
3655
3676
|
sr
|
|
3656
3677
|
);
|
|
3657
|
-
function
|
|
3678
|
+
function ld({
|
|
3658
3679
|
appearance: e,
|
|
3659
3680
|
rootElement: t,
|
|
3660
3681
|
logger: n,
|
|
3661
3682
|
language: o,
|
|
3662
3683
|
stringSet: s,
|
|
3663
|
-
children:
|
|
3664
|
-
messageTemplate:
|
|
3684
|
+
children: i,
|
|
3685
|
+
messageTemplate: a,
|
|
3665
3686
|
theme: l
|
|
3666
3687
|
}) {
|
|
3667
|
-
return
|
|
3688
|
+
return gs(qo, t), /* @__PURE__ */ r.createElement(Mr, { target: t }, /* @__PURE__ */ r.createElement(ds, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Vo, { internalVariables: a == null ? void 0 : a.__internalVariables }, /* @__PURE__ */ r.createElement(ss, { stringSet: s, logger: n, language: o }, /* @__PURE__ */ r.createElement(ad, null, i, /* @__PURE__ */ r.createElement(id, null))))));
|
|
3668
3689
|
}
|
|
3669
3690
|
const We = {}, Ge = {
|
|
3670
3691
|
getItem: (e) => {
|
|
@@ -3705,23 +3726,23 @@ const We = {}, Ge = {
|
|
|
3705
3726
|
logLevel: n = En.WARN,
|
|
3706
3727
|
language: o = navigator.language,
|
|
3707
3728
|
userSessionInfo: s,
|
|
3708
|
-
children:
|
|
3709
|
-
...
|
|
3729
|
+
children: i,
|
|
3730
|
+
...a
|
|
3710
3731
|
}, l) {
|
|
3711
3732
|
var c, d;
|
|
3712
|
-
return we.level !== n && (we.level = n),
|
|
3713
|
-
|
|
3733
|
+
return we.level !== n && (we.level = n), ms("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: ee.ENTRY, style: { width: "fit-content", height: "fit-content", ...a.entryStyle } }, /* @__PURE__ */ r.createElement(
|
|
3734
|
+
ld,
|
|
3714
3735
|
{
|
|
3715
3736
|
logger: we,
|
|
3716
3737
|
rootElement: t,
|
|
3717
|
-
appearance: (c =
|
|
3718
|
-
stringSet:
|
|
3738
|
+
appearance: (c = a.agentPreviewConfigs) == null ? void 0 : c.appearance,
|
|
3739
|
+
stringSet: a.stringSet,
|
|
3719
3740
|
language: o,
|
|
3720
|
-
messageTemplate:
|
|
3721
|
-
theme:
|
|
3741
|
+
messageTemplate: a.messageTemplate,
|
|
3742
|
+
theme: a.theme
|
|
3722
3743
|
},
|
|
3723
3744
|
/* @__PURE__ */ r.createElement(
|
|
3724
|
-
|
|
3745
|
+
fs,
|
|
3725
3746
|
{
|
|
3726
3747
|
rootElement: t,
|
|
3727
3748
|
keyValueStorage: {
|
|
@@ -3732,59 +3753,59 @@ const We = {}, Ge = {
|
|
|
3732
3753
|
},
|
|
3733
3754
|
language: o,
|
|
3734
3755
|
logger: we,
|
|
3735
|
-
dispatcher:
|
|
3736
|
-
chatParams: { customApiHost:
|
|
3737
|
-
...
|
|
3756
|
+
dispatcher: cd,
|
|
3757
|
+
chatParams: { customApiHost: a.customApiHost, customWebSocketHost: a.customWebSocketHost },
|
|
3758
|
+
...a
|
|
3738
3759
|
},
|
|
3739
3760
|
/* @__PURE__ */ r.createElement(
|
|
3740
|
-
|
|
3761
|
+
Es,
|
|
3741
3762
|
{
|
|
3742
3763
|
ref: l,
|
|
3743
3764
|
userSessionInfo: s,
|
|
3744
|
-
forceCreateChannel: (d =
|
|
3765
|
+
forceCreateChannel: (d = a.agentPreviewConfigs) == null ? void 0 : d.forceCreateChannel
|
|
3745
3766
|
},
|
|
3746
|
-
/* @__PURE__ */ r.createElement(
|
|
3767
|
+
/* @__PURE__ */ r.createElement(Pa, { ...a._UNSAFE_INTERNAL_dashboardTester }, i, /* @__PURE__ */ r.createElement("div", { id: ee.MODAL_ROOT }))
|
|
3747
3768
|
)
|
|
3748
3769
|
)
|
|
3749
3770
|
));
|
|
3750
|
-
}), we = new Tn(En.WARN),
|
|
3771
|
+
}), we = new Tn(En.WARN), cd = new _n(we), ar = ({ children: e, isOpened: t }) => {
|
|
3751
3772
|
const { dir: n, rootElement: o } = B(), s = pe(o, !0);
|
|
3752
3773
|
return L(() => {
|
|
3753
|
-
const
|
|
3754
|
-
return t ? s.body.classList.add(
|
|
3755
|
-
s.body.classList.remove(
|
|
3774
|
+
const i = "sb-agent-block-scroll";
|
|
3775
|
+
return t ? s.body.classList.add(i) : s.body.classList.remove(i), () => {
|
|
3776
|
+
s.body.classList.remove(i);
|
|
3756
3777
|
};
|
|
3757
|
-
}, [s, t]), /* @__PURE__ */ r.createElement(
|
|
3758
|
-
},
|
|
3759
|
-
function
|
|
3778
|
+
}, [s, t]), /* @__PURE__ */ r.createElement(dd, { dir: n, $visible: t }, e);
|
|
3779
|
+
}, dd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${fe.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, ud = 48, md = 2 / 3;
|
|
3780
|
+
function gd({
|
|
3760
3781
|
className: e,
|
|
3761
3782
|
isOpened: t,
|
|
3762
3783
|
onClick: n,
|
|
3763
3784
|
type: o,
|
|
3764
3785
|
imageUrl: s,
|
|
3765
|
-
dir:
|
|
3766
|
-
animated:
|
|
3786
|
+
dir: i,
|
|
3787
|
+
animated: a = !0,
|
|
3767
3788
|
backgroundColor: l,
|
|
3768
|
-
size: c =
|
|
3789
|
+
size: c = ud
|
|
3769
3790
|
}) {
|
|
3770
|
-
const d = pt(l),
|
|
3791
|
+
const d = pt(l), h = Math.round(c * md);
|
|
3771
3792
|
return /* @__PURE__ */ r.createElement(
|
|
3772
|
-
|
|
3793
|
+
fd,
|
|
3773
3794
|
{
|
|
3774
|
-
dir:
|
|
3775
|
-
id:
|
|
3795
|
+
dir: i,
|
|
3796
|
+
id: ee.LAUNCHER,
|
|
3776
3797
|
className: e,
|
|
3777
3798
|
"aria-label": "Sendbird AIAgent Launcher",
|
|
3778
3799
|
onClick: n,
|
|
3779
|
-
$animated:
|
|
3800
|
+
$animated: a,
|
|
3780
3801
|
$backgroundColor: l,
|
|
3781
3802
|
$size: c
|
|
3782
3803
|
},
|
|
3783
|
-
/* @__PURE__ */ r.createElement(
|
|
3784
|
-
/* @__PURE__ */ r.createElement(
|
|
3804
|
+
/* @__PURE__ */ r.createElement(bd, { $isOpened: t, $animated: a, $fillColor: d, $iconSize: h }, /* @__PURE__ */ r.createElement(fn.Open, { url: s, isDefaultIcon: o === "default_icon" })),
|
|
3805
|
+
/* @__PURE__ */ r.createElement(Ed, { $isOpened: t, $animated: a, $fillColor: d, $iconSize: h }, /* @__PURE__ */ r.createElement(fn.Close, { size: h }))
|
|
3785
3806
|
);
|
|
3786
3807
|
}
|
|
3787
|
-
const
|
|
3808
|
+
const hd = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, pd = I`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:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;filter:${({ $fillColor: e }) => e === $n.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, lr = I`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => I`
|
|
3788
3809
|
path {
|
|
3789
3810
|
fill: ${e};
|
|
3790
3811
|
}
|
|
@@ -3793,66 +3814,66 @@ const gd = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
3793
3814
|
}
|
|
3794
3815
|
`}
|
|
3795
3816
|
}
|
|
3796
|
-
`,
|
|
3817
|
+
`, fd = u.button`position:relative;padding:0;width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;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 && hd}`, cr = u.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;`, bd = u(cr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${pd}${lr}`, Ed = u(cr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${lr}`, fn = {
|
|
3797
3818
|
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(kt, null),
|
|
3798
3819
|
Close: ({ size: e }) => /* @__PURE__ */ r.createElement(M, { size: e, type: "chevron-down" })
|
|
3799
3820
|
};
|
|
3800
3821
|
function dr({ className: e, size: t }) {
|
|
3801
|
-
const { colors: n } = xt(), { dir: o, state: s } = B(), { launcherInfo:
|
|
3802
|
-
return
|
|
3803
|
-
|
|
3822
|
+
const { colors: n } = xt(), { dir: o, state: s } = B(), { launcherInfo: i } = U();
|
|
3823
|
+
return Cd(), /* @__PURE__ */ r.createElement(
|
|
3824
|
+
gd,
|
|
3804
3825
|
{
|
|
3805
3826
|
dir: o,
|
|
3806
3827
|
className: e,
|
|
3807
3828
|
isOpened: s.opened,
|
|
3808
3829
|
onClick: () => s.setOpened(!s.opened),
|
|
3809
|
-
type:
|
|
3810
|
-
imageUrl:
|
|
3830
|
+
type: i.type,
|
|
3831
|
+
imageUrl: i.imageUrl,
|
|
3811
3832
|
backgroundColor: n.base.primary,
|
|
3812
3833
|
size: t
|
|
3813
3834
|
}
|
|
3814
3835
|
);
|
|
3815
3836
|
}
|
|
3816
|
-
const
|
|
3817
|
-
function
|
|
3837
|
+
const xd = 1e3 * 60;
|
|
3838
|
+
function Cd() {
|
|
3818
3839
|
const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: o } = B(), s = N(null);
|
|
3819
3840
|
L(() => {
|
|
3820
3841
|
if (!o) return;
|
|
3821
|
-
function
|
|
3842
|
+
function i() {
|
|
3822
3843
|
s.current && (clearTimeout(s.current), s.current = null);
|
|
3823
3844
|
}
|
|
3824
|
-
function
|
|
3825
|
-
e.connectionState ===
|
|
3845
|
+
function a() {
|
|
3846
|
+
e.connectionState === kr.CLOSED && (e.reconnect(), n.debug("useSDKInactivityTimeout: reconnected")), i(), n.debug("useSDKInactivityTimeout: clear disconnect schedule");
|
|
3826
3847
|
}
|
|
3827
3848
|
function l() {
|
|
3828
|
-
|
|
3849
|
+
i(), s.current = setTimeout(async () => {
|
|
3829
3850
|
await e.disconnectWebSocket(), n.debug("useSDKInactivityTimeout: disconnected");
|
|
3830
|
-
},
|
|
3851
|
+
}, xd);
|
|
3831
3852
|
}
|
|
3832
|
-
t.opened ?
|
|
3853
|
+
t.opened ? a() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
|
|
3833
3854
|
}, [o, e, t.opened]);
|
|
3834
3855
|
}
|
|
3835
3856
|
const ur = ve(null);
|
|
3836
|
-
function
|
|
3837
|
-
const e =
|
|
3857
|
+
function vd() {
|
|
3858
|
+
const e = Q(ur);
|
|
3838
3859
|
if (!e)
|
|
3839
3860
|
throw new Error("useNavigator() must be used within <Navigator />");
|
|
3840
3861
|
return e;
|
|
3841
3862
|
}
|
|
3842
3863
|
function mr({ children: e }) {
|
|
3843
|
-
const t =
|
|
3864
|
+
const t = vd();
|
|
3844
3865
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
|
|
3845
3866
|
}
|
|
3846
|
-
const
|
|
3867
|
+
const yd = xn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, _d = xn`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, Sd = I`animation-name:${yd};animation-duration:0.3s;animation-fill-mode:forwards;`, Td = I``, wd = I`animation-name:${_d};animation-duration:0.3s;animation-fill-mode:forwards;`, Ad = I`visibility:hidden;`, kd = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
3847
3868
|
switch (e) {
|
|
3848
3869
|
case "entering":
|
|
3849
|
-
return _d;
|
|
3850
|
-
case "entered":
|
|
3851
3870
|
return Sd;
|
|
3852
|
-
case "
|
|
3871
|
+
case "entered":
|
|
3853
3872
|
return Td;
|
|
3854
|
-
case "
|
|
3873
|
+
case "exiting":
|
|
3855
3874
|
return wd;
|
|
3875
|
+
case "exited":
|
|
3876
|
+
return Ad;
|
|
3856
3877
|
default:
|
|
3857
3878
|
return "";
|
|
3858
3879
|
}
|
|
@@ -3861,23 +3882,23 @@ const vd = xn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
|
|
|
3861
3882
|
` : I`z-index:1;pointer-events:none;`}
|
|
3862
3883
|
`;
|
|
3863
3884
|
function Ae({ initialId: e, children: t }) {
|
|
3864
|
-
const n = R((
|
|
3865
|
-
c((v) => [...v,
|
|
3885
|
+
const n = R((g, C) => {
|
|
3886
|
+
c((v) => [...v, g]), h((v) => ({ ...v, [g]: !0 })), C != null && C.reset && E((v) => ({
|
|
3866
3887
|
...v,
|
|
3867
|
-
[
|
|
3888
|
+
[g]: (v[g] || 0) + 1
|
|
3868
3889
|
})), f((v) => ({
|
|
3869
3890
|
...v,
|
|
3870
|
-
[
|
|
3891
|
+
[g]: "entering"
|
|
3871
3892
|
})), setTimeout(() => {
|
|
3872
3893
|
f((v) => ({
|
|
3873
3894
|
...v,
|
|
3874
|
-
[
|
|
3895
|
+
[g]: "entered"
|
|
3875
3896
|
}));
|
|
3876
3897
|
}, 300);
|
|
3877
3898
|
}, []), o = R(() => {
|
|
3878
|
-
c((
|
|
3879
|
-
if (
|
|
3880
|
-
const C =
|
|
3899
|
+
c((g) => {
|
|
3900
|
+
if (g.length <= 1) return g;
|
|
3901
|
+
const C = g[g.length - 1];
|
|
3881
3902
|
return f((v) => ({
|
|
3882
3903
|
...v,
|
|
3883
3904
|
[C]: "exiting"
|
|
@@ -3886,40 +3907,40 @@ function Ae({ initialId: e, children: t }) {
|
|
|
3886
3907
|
...v,
|
|
3887
3908
|
[C]: "exited"
|
|
3888
3909
|
})), c((v) => v.slice(0, -1));
|
|
3889
|
-
}, 300),
|
|
3910
|
+
}, 300), g;
|
|
3890
3911
|
});
|
|
3891
3912
|
}, []), s = ae(() => ({
|
|
3892
3913
|
navigation: {
|
|
3893
3914
|
navigate: n,
|
|
3894
3915
|
pop: o
|
|
3895
3916
|
}
|
|
3896
|
-
}), [n, o]),
|
|
3897
|
-
(
|
|
3898
|
-
), [t]),
|
|
3899
|
-
const
|
|
3900
|
-
return
|
|
3917
|
+
}), [n, o]), i = ae(() => vr.toArray(t).filter(
|
|
3918
|
+
(g) => g.type === mr
|
|
3919
|
+
), [t]), a = ae(() => {
|
|
3920
|
+
const g = {};
|
|
3921
|
+
return i.forEach((C) => {
|
|
3901
3922
|
const { id: v, lazy: S, children: k } = C.props;
|
|
3902
|
-
|
|
3903
|
-
}),
|
|
3904
|
-
}, [
|
|
3905
|
-
const
|
|
3906
|
-
return Object.entries(
|
|
3907
|
-
v === !1 && (
|
|
3908
|
-
}),
|
|
3909
|
-
}), [
|
|
3910
|
-
const
|
|
3911
|
-
return Object.keys(
|
|
3912
|
-
C === e ?
|
|
3913
|
-
}),
|
|
3914
|
-
}), [x,
|
|
3915
|
-
return /* @__PURE__ */ r.createElement(ur.Provider, { value: s }, /* @__PURE__ */ r.createElement(
|
|
3923
|
+
g[v] = { lazy: S, element: typeof k == "function" ? k(s) : k };
|
|
3924
|
+
}), g;
|
|
3925
|
+
}, [i]), [l, c] = _([e]), [d, h] = _(() => {
|
|
3926
|
+
const g = {};
|
|
3927
|
+
return Object.entries(a).forEach(([C, { lazy: v }]) => {
|
|
3928
|
+
v === !1 && (g[C] = !0);
|
|
3929
|
+
}), g[e] = !0, g;
|
|
3930
|
+
}), [m, f] = _(() => {
|
|
3931
|
+
const g = {};
|
|
3932
|
+
return Object.keys(a).forEach((C) => {
|
|
3933
|
+
C === e ? g[C] = "entered" : g[C] = "exited";
|
|
3934
|
+
}), g;
|
|
3935
|
+
}), [x, E] = _({}), b = l[l.length - 1];
|
|
3936
|
+
return /* @__PURE__ */ r.createElement(ur.Provider, { value: s }, /* @__PURE__ */ r.createElement(Id, null, Object.keys(a).map((g) => {
|
|
3916
3937
|
var k;
|
|
3917
|
-
if (!d[
|
|
3918
|
-
const C =
|
|
3919
|
-
return /* @__PURE__ */ r.createElement(
|
|
3938
|
+
if (!d[g]) return null;
|
|
3939
|
+
const C = m[g] || "exited", v = g === b, S = `${g}-${x[g] || 0}`;
|
|
3940
|
+
return /* @__PURE__ */ r.createElement(kd, { key: S, $transitionState: C, $active: v }, (k = a[g]) == null ? void 0 : k.element);
|
|
3920
3941
|
})));
|
|
3921
3942
|
}
|
|
3922
|
-
const
|
|
3943
|
+
const Id = u.div`position:relative;width:100%;height:100%;`;
|
|
3923
3944
|
Ae.Screen = mr;
|
|
3924
3945
|
const he = {
|
|
3925
3946
|
activeConv: "active-conv",
|
|
@@ -3933,36 +3954,36 @@ const he = {
|
|
|
3933
3954
|
onClearClosedChannelUrl: () => e(void 0)
|
|
3934
3955
|
}
|
|
3935
3956
|
)), /* @__PURE__ */ r.createElement(Ae.Screen, { id: he.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3936
|
-
|
|
3957
|
+
ed,
|
|
3937
3958
|
{
|
|
3938
3959
|
onOpenConversationView: (o, s) => {
|
|
3939
3960
|
s === "closed" ? (e(o), n.navigate(he.closedConv, { reset: !0 })) : n.navigate(he.activeConv);
|
|
3940
3961
|
}
|
|
3941
3962
|
}
|
|
3942
3963
|
)));
|
|
3943
|
-
function
|
|
3964
|
+
function $d({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
|
|
3944
3965
|
const { dir: s } = B();
|
|
3945
|
-
return /* @__PURE__ */ r.createElement(
|
|
3966
|
+
return /* @__PURE__ */ r.createElement(Md, null, /* @__PURE__ */ r.createElement(Od, { dir: s, id: ee.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
|
|
3946
3967
|
}
|
|
3947
|
-
const
|
|
3948
|
-
const o = Oe(), [s,
|
|
3949
|
-
return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(In, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
3968
|
+
const Md = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Od = u.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 && Rd};${({ $isExpanded: e }) => e && Ld};`, Ld = I`width:743px;height:723px;`, Rd = I`z-index:${fe.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;`, lu = ye(function({ children: e, ...t }, n) {
|
|
3969
|
+
const o = Oe(), [s, i] = _(), a = o ? ar : $d;
|
|
3970
|
+
return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(In, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(a, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(dr, null) }, /* @__PURE__ */ r.createElement(
|
|
3950
3971
|
gr,
|
|
3951
3972
|
{
|
|
3952
3973
|
closedChannelUrl: s,
|
|
3953
|
-
setClosedChannelUrl:
|
|
3974
|
+
setClosedChannelUrl: i
|
|
3954
3975
|
}
|
|
3955
3976
|
)), e)));
|
|
3956
3977
|
}), {
|
|
3957
|
-
Provider:
|
|
3978
|
+
Provider: Dd,
|
|
3958
3979
|
useContext: Bt
|
|
3959
3980
|
} = G("FixedMessengerStyle");
|
|
3960
3981
|
function hr(e, t, n, o = 0) {
|
|
3961
|
-
const { top: s, bottom:
|
|
3982
|
+
const { top: s, bottom: i, start: a, end: l } = n;
|
|
3962
3983
|
let c = "", d = "";
|
|
3963
3984
|
switch (e) {
|
|
3964
3985
|
case "start":
|
|
3965
|
-
d = `inset-inline-start: ${j(
|
|
3986
|
+
d = `inset-inline-start: ${j(a)}`;
|
|
3966
3987
|
break;
|
|
3967
3988
|
case "end":
|
|
3968
3989
|
d = `inset-inline-end: ${j(l)}`;
|
|
@@ -3973,111 +3994,111 @@ function hr(e, t, n, o = 0) {
|
|
|
3973
3994
|
c = `top: calc(${j(s)} + ${o}px)`;
|
|
3974
3995
|
break;
|
|
3975
3996
|
case "bottom":
|
|
3976
|
-
c = `bottom: calc(${j(
|
|
3997
|
+
c = `bottom: calc(${j(i)} + ${o}px)`;
|
|
3977
3998
|
break;
|
|
3978
3999
|
}
|
|
3979
4000
|
return I`${c};${d};`;
|
|
3980
4001
|
}
|
|
3981
|
-
function
|
|
4002
|
+
function Nd(e) {
|
|
3982
4003
|
const { horizontal: t, vertical: n, margin: o, launcherSize: s } = Bt();
|
|
3983
|
-
return /* @__PURE__ */ r.createElement(
|
|
4004
|
+
return /* @__PURE__ */ r.createElement(Pd, { ...e, size: s, $horizontal: t, $vertical: n, $margin: o });
|
|
3984
4005
|
}
|
|
3985
|
-
const
|
|
3986
|
-
function
|
|
3987
|
-
const { dir: o } = B(), { horizontal: s, vertical:
|
|
4006
|
+
const Pd = u(dr)`position:fixed;z-index:${fe.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => hr(e, t, n)};`;
|
|
4007
|
+
function Bd({ isExpanded: e, isOpened: t, children: n }) {
|
|
4008
|
+
const { dir: o } = B(), { horizontal: s, vertical: i, margin: a, launcherSize: l } = Bt();
|
|
3988
4009
|
return /* @__PURE__ */ r.createElement(
|
|
3989
|
-
|
|
4010
|
+
Fd,
|
|
3990
4011
|
{
|
|
3991
4012
|
dir: o,
|
|
3992
|
-
id:
|
|
4013
|
+
id: ee.WINDOW,
|
|
3993
4014
|
$isExpanded: e,
|
|
3994
4015
|
$isOpened: t,
|
|
3995
4016
|
$horizontal: s,
|
|
3996
|
-
$vertical:
|
|
3997
|
-
$margin:
|
|
4017
|
+
$vertical: i,
|
|
4018
|
+
$margin: a,
|
|
3998
4019
|
$launcherSize: l
|
|
3999
4020
|
},
|
|
4000
4021
|
n
|
|
4001
4022
|
);
|
|
4002
4023
|
}
|
|
4003
|
-
const
|
|
4024
|
+
const Fd = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;position:fixed;${({ $horizontal: e, $vertical: t, $margin: n, $launcherSize: o }) => hr(e, t, n, o + 12)};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:${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "left" : "right"} ${t}`};
|
|
4004
4025
|
[dir='rtl'] &:not([dir='ltr']),
|
|
4005
4026
|
&[dir='rtl'] {
|
|
4006
4027
|
transform-origin: ${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "right" : "left"} ${t}`};
|
|
4007
4028
|
}
|
|
4008
4029
|
|
|
4009
|
-
${({ $isOpened: e }) => e &&
|
|
4010
|
-
${({ $isExpanded: e }) => e &&
|
|
4011
|
-
`,
|
|
4012
|
-
const [o, s] = _(), [
|
|
4013
|
-
const [
|
|
4014
|
-
return { horizontal:
|
|
4015
|
-
}, [
|
|
4016
|
-
return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !
|
|
4017
|
-
|
|
4030
|
+
${({ $isOpened: e }) => e && Hd};
|
|
4031
|
+
${({ $isExpanded: e }) => e && Ud};
|
|
4032
|
+
`, Ud = I`width:743px;height:723px;`, Hd = I`z-index:${fe.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;`, pr = { top: 24, bottom: 24, start: 24, end: 24 }, zd = ye(function({ children: e, ...t }, n) {
|
|
4033
|
+
const [o, s] = _(), [i, a] = _("end-bottom"), [l, c] = _(pr), [d, h] = _(48), m = Oe(), f = m ? ar : Bd, { horizontal: x, vertical: E } = ae(() => {
|
|
4034
|
+
const [b, g] = i.split("-");
|
|
4035
|
+
return { horizontal: b === "start" ? "start" : "end", vertical: g === "top" ? "top" : "bottom" };
|
|
4036
|
+
}, [i]);
|
|
4037
|
+
return /* @__PURE__ */ r.createElement(ir, { enableExpandButton: !m, ref: n, ...t }, /* @__PURE__ */ r.createElement(In, null, ({ state: b }) => /* @__PURE__ */ r.createElement(
|
|
4038
|
+
Dd,
|
|
4018
4039
|
{
|
|
4019
|
-
value: { horizontal: x, vertical:
|
|
4040
|
+
value: { horizontal: x, vertical: E, margin: l, launcherSize: d, setPosition: a, setMargin: c, setLauncherSize: h }
|
|
4020
4041
|
},
|
|
4021
|
-
/* @__PURE__ */ r.createElement(f, { isExpanded:
|
|
4042
|
+
/* @__PURE__ */ r.createElement(f, { isExpanded: b.expanded, isOpened: b.opened }, /* @__PURE__ */ r.createElement(
|
|
4022
4043
|
gr,
|
|
4023
4044
|
{
|
|
4024
4045
|
closedChannelUrl: o,
|
|
4025
4046
|
setClosedChannelUrl: s
|
|
4026
4047
|
}
|
|
4027
4048
|
)),
|
|
4028
|
-
/* @__PURE__ */ r.createElement(
|
|
4049
|
+
/* @__PURE__ */ r.createElement(Nd, null),
|
|
4029
4050
|
e
|
|
4030
4051
|
)));
|
|
4031
|
-
}),
|
|
4032
|
-
var s,
|
|
4052
|
+
}), Vd = (e) => {
|
|
4053
|
+
var s, i, a, l;
|
|
4033
4054
|
const { setPosition: t, setMargin: n, setLauncherSize: o } = Bt();
|
|
4034
4055
|
return le(() => {
|
|
4035
4056
|
e.position && t(e.position), e.margin && n({ ...pr, ...e.margin }), e.launcherSize && o(e.launcherSize);
|
|
4036
4057
|
}, [
|
|
4037
4058
|
e.position,
|
|
4038
4059
|
(s = e.margin) == null ? void 0 : s.top,
|
|
4039
|
-
(
|
|
4040
|
-
(
|
|
4060
|
+
(i = e.margin) == null ? void 0 : i.bottom,
|
|
4061
|
+
(a = e.margin) == null ? void 0 : a.start,
|
|
4041
4062
|
(l = e.margin) == null ? void 0 : l.end,
|
|
4042
4063
|
e.launcherSize
|
|
4043
4064
|
]), null;
|
|
4044
|
-
},
|
|
4045
|
-
Style:
|
|
4065
|
+
}, cu = Object.assign(zd, {
|
|
4066
|
+
Style: Vd
|
|
4046
4067
|
});
|
|
4047
4068
|
export {
|
|
4048
4069
|
St as A,
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4070
|
+
oo as C,
|
|
4071
|
+
lu as D,
|
|
4072
|
+
cu as F,
|
|
4052
4073
|
M as I,
|
|
4053
4074
|
Hn as L,
|
|
4054
|
-
|
|
4075
|
+
Ra as M,
|
|
4055
4076
|
Ot as O,
|
|
4056
|
-
|
|
4077
|
+
iu as P,
|
|
4057
4078
|
Lt as S,
|
|
4058
4079
|
w as a,
|
|
4059
4080
|
ir as b,
|
|
4060
4081
|
p as c,
|
|
4061
|
-
|
|
4082
|
+
ld as d,
|
|
4062
4083
|
U as e,
|
|
4063
4084
|
O as f,
|
|
4064
|
-
|
|
4085
|
+
gd as g,
|
|
4065
4086
|
xe as h,
|
|
4066
|
-
|
|
4087
|
+
X as i,
|
|
4067
4088
|
sr as j,
|
|
4068
4089
|
pn as k,
|
|
4069
4090
|
Nt as l,
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4091
|
+
cd as m,
|
|
4092
|
+
su as n,
|
|
4093
|
+
rl as o,
|
|
4073
4094
|
Z as p,
|
|
4074
|
-
|
|
4095
|
+
ed as q,
|
|
4075
4096
|
Pt as r,
|
|
4076
|
-
|
|
4077
|
-
|
|
4097
|
+
au as s,
|
|
4098
|
+
Bc as t,
|
|
4078
4099
|
B as u,
|
|
4079
4100
|
or as v,
|
|
4080
4101
|
Sn as w,
|
|
4081
|
-
|
|
4102
|
+
$o as x,
|
|
4082
4103
|
Zt as y
|
|
4083
4104
|
};
|