@sendbird/ai-agent-messenger-react 1.2.2 → 1.2.4
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/{3obOzjh1.cjs → B11So7bc.cjs} +1 -1
- package/dist/cjs/{D_C06nOa.cjs → B8shwNHu.cjs} +1 -1
- package/dist/cjs/{DVFnHuzP.cjs → C1S2ZOw1.cjs} +1 -1
- package/dist/cjs/Citlpy3c.cjs +1 -0
- package/dist/cjs/{tVaciR-_.cjs → O1lLHzDh.cjs} +26 -26
- package/dist/cjs/{CdinIZGy.cjs → uUKu7Ccr.cjs} +1 -1
- package/dist/es/{BX7cHbkb.js → BJq5dAD1.js} +1 -1
- package/dist/es/{DLjpH35l.js → BoP3pcmJ.js} +607 -620
- package/dist/es/{BMNdyD6n.js → Dp6I-PiX.js} +1 -1
- package/dist/es/{PXojwkiO.js → U1Hdm8SY.js} +1 -1
- package/dist/es/{DRPdjwTV.js → W1TNi6ka.js} +1 -1
- package/dist/es/cJuIRXXl.js +32 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/Cg6k0N51.cjs +0 -1
- package/dist/es/x6g8obrl.js +0 -22
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { createContext as Te, useContext as
|
|
3
|
-
import wr, { SendbirdProduct as kr, DeviceOsPlatform as
|
|
4
|
-
import u, { css as $, ThemeProvider as Or, useTheme as
|
|
5
|
-
import { format as
|
|
2
|
+
import { createContext as Te, useContext as re, useEffect as D, useState as S, useId as bn, useRef as F, useCallback as U, useLayoutEffect as ce, forwardRef as Re, useImperativeHandle as yr, Suspense as Oe, lazy as w, useMemo as ye, Component as _r, Fragment as Bt, useReducer as Sr, Children as Tr } from "react";
|
|
3
|
+
import wr, { SendbirdProduct as kr, DeviceOsPlatform as Ft, SendbirdPlatform as Ar, ConnectionHandler as Qe, SendbirdError as Ir, SessionHandler as $r, LogLevel as xn, ConnectionState as Mr } from "@sendbird/chat";
|
|
4
|
+
import u, { css as $, ThemeProvider as Or, useTheme as Et, createGlobalStyle as Lr, StyleSheetManager as Rr, keyframes as En } from "styled-components";
|
|
5
|
+
import { format as Cn, isSameMinute as Ut, isSameDay as Dr } from "date-fns";
|
|
6
6
|
import { enUS as Nr } from "date-fns/locale/en-US";
|
|
7
7
|
import { AIAgentModule as Pr, ConversationStatus as W, ConversationType as Br } from "@sendbird/chat/aiAgent";
|
|
8
8
|
import { useGroupChannelMessages as Fr, useGroupChannelHandler as vn, useForceUpdate as Ur } from "@sendbird/uikit-tools";
|
|
9
|
-
import { GroupChannelModule as Hr, GroupChannelListOrder as
|
|
9
|
+
import { GroupChannelModule as Hr, GroupChannelListOrder as yn, GroupChannelHandler as zr } from "@sendbird/chat/groupChannel";
|
|
10
10
|
import { renderer as Vr, parser as Wr, MessageProvider as Gr } from "@sendbird/react-uikit-message-template-view";
|
|
11
11
|
import { createMessageTemplate as jr } from "@sendbird/uikit-message-template";
|
|
12
|
-
import
|
|
12
|
+
import _n from "dompurify";
|
|
13
13
|
import { MessageMetaArray as Kr, SendingStatus as Zr } from "@sendbird/chat/message";
|
|
14
14
|
import { isSameDay as Yr } from "date-fns/isSameDay";
|
|
15
15
|
import { createPortal as qr } from "react-dom";
|
|
16
16
|
import Jr from "@emotion/is-prop-valid";
|
|
17
17
|
const j = (e, t) => {
|
|
18
18
|
const n = Te(null), o = ({ children: s, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof s == "function" ? s(l) : s), i = ({ children: s }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof s == "function" ? s(l) : s : null), a = () => {
|
|
19
|
-
const s =
|
|
19
|
+
const s = re(n);
|
|
20
20
|
if (!s)
|
|
21
21
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
22
22
|
return s;
|
|
@@ -33,7 +33,7 @@ function we(e) {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
function n({ children: a }) {
|
|
36
|
-
const [s, l] =
|
|
36
|
+
const [s, l] = S(() => e.template), [c, d] = S(e.components), m = {
|
|
37
37
|
Template: s,
|
|
38
38
|
updateTemplate: (g) => l(() => g),
|
|
39
39
|
components: c,
|
|
@@ -42,7 +42,7 @@ function we(e) {
|
|
|
42
42
|
return /* @__PURE__ */ r.createElement(t.Provider, { value: m }, a);
|
|
43
43
|
}
|
|
44
44
|
function o({ template: a, children: s }) {
|
|
45
|
-
const { updateTemplate: l } =
|
|
45
|
+
const { updateTemplate: l } = re(t);
|
|
46
46
|
return D(() => {
|
|
47
47
|
a && l(a);
|
|
48
48
|
}, [a]), /* @__PURE__ */ r.createElement(r.Fragment, null, s);
|
|
@@ -50,11 +50,11 @@ function we(e) {
|
|
|
50
50
|
function i({ children: a }) {
|
|
51
51
|
return /* @__PURE__ */ r.createElement(n, null, a);
|
|
52
52
|
}
|
|
53
|
-
return i.defaults = e, i.useContext = () =>
|
|
53
|
+
return i.defaults = e, i.useContext = () => re(t), i.Context = t, i.Template = o, Object.keys(e.components).forEach((a) => {
|
|
54
54
|
i[a] = function({
|
|
55
55
|
component: l
|
|
56
56
|
}) {
|
|
57
|
-
const { updateComponent: c } =
|
|
57
|
+
const { updateComponent: c } = re(t);
|
|
58
58
|
return D(() => {
|
|
59
59
|
l && c(a, l);
|
|
60
60
|
}, [l]), null;
|
|
@@ -72,15 +72,15 @@ function Qr() {
|
|
|
72
72
|
const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
|
|
73
73
|
return e || t;
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const Ht = (e) => {
|
|
76
76
|
try {
|
|
77
77
|
return JSON.parse(e === "" ? "{}" : e);
|
|
78
78
|
} catch {
|
|
79
79
|
return {};
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, et = {
|
|
82
82
|
isStreaming(e) {
|
|
83
|
-
const t =
|
|
83
|
+
const t = Ht(e.data);
|
|
84
84
|
return typeof t == "object" && !!t.stream;
|
|
85
85
|
},
|
|
86
86
|
isWelcomeMessage(e, t) {
|
|
@@ -88,7 +88,7 @@ const zt = (e) => {
|
|
|
88
88
|
if (((n = e.extendedMessagePayload) == null ? void 0 : n.bot_message_type) === "welcome")
|
|
89
89
|
return !0;
|
|
90
90
|
if ((e.isUserMessage() || e.isFileMessage()) && e.sender.userId === t) {
|
|
91
|
-
const o =
|
|
91
|
+
const o = Ht(e.data);
|
|
92
92
|
return !(o != null && o.respond_mesg_id) && !(o != null && o.stream);
|
|
93
93
|
}
|
|
94
94
|
return !1;
|
|
@@ -98,7 +98,7 @@ const zt = (e) => {
|
|
|
98
98
|
return ((t = e.extendedMessagePayload) == null ? void 0 : t.bot_message_type) === "generated";
|
|
99
99
|
},
|
|
100
100
|
checkExtendedFieldPresence(e) {
|
|
101
|
-
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(
|
|
101
|
+
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(at.ui), i = n(at.trail), a = n(at.marking);
|
|
102
102
|
return { ui: o, trail: i, marking: a };
|
|
103
103
|
},
|
|
104
104
|
shouldScrollToBottom(e, t, n = !1) {
|
|
@@ -110,12 +110,12 @@ const zt = (e) => {
|
|
|
110
110
|
}
|
|
111
111
|
return !0;
|
|
112
112
|
}
|
|
113
|
-
},
|
|
113
|
+
}, at = {
|
|
114
114
|
ui: ["suggested_replies", "cta_button", "message_template", "csat"],
|
|
115
115
|
trail: ["groundedness", "manual", "function_calls"],
|
|
116
116
|
marking: ["is_hallucination", "is_moderated", "flagged_types"]
|
|
117
117
|
};
|
|
118
|
-
class
|
|
118
|
+
class Sn {
|
|
119
119
|
constructor(t) {
|
|
120
120
|
this.logger = t, this.subscribers = {};
|
|
121
121
|
}
|
|
@@ -142,9 +142,9 @@ const eo = () => {
|
|
|
142
142
|
return { promise: new Promise((o, i) => {
|
|
143
143
|
e = o, t = i;
|
|
144
144
|
}), resolve: e, reject: t };
|
|
145
|
-
}, to = "1.2.
|
|
146
|
-
var
|
|
147
|
-
class
|
|
145
|
+
}, to = "1.2.4", Ie = "sb-agent", no = to;
|
|
146
|
+
var Tn = /* @__PURE__ */ ((e) => (e[e.VERBOSE = 0] = "VERBOSE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.NONE = 5] = "NONE", e))(Tn || {});
|
|
147
|
+
class wn {
|
|
148
148
|
constructor(t) {
|
|
149
149
|
this.level = t;
|
|
150
150
|
}
|
|
@@ -164,7 +164,7 @@ class kn {
|
|
|
164
164
|
this.level <= 4 && console.error(`[${Ie}/error]`, ...t);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function zt(e, t, n) {
|
|
168
168
|
const o = wr.init({
|
|
169
169
|
appId: e,
|
|
170
170
|
modules: [new Hr(), new Pr()],
|
|
@@ -179,7 +179,7 @@ function Vt(e, t, n) {
|
|
|
179
179
|
}
|
|
180
180
|
const {
|
|
181
181
|
Provider: ro,
|
|
182
|
-
useContext:
|
|
182
|
+
useContext: tt
|
|
183
183
|
} = j("AIAgent");
|
|
184
184
|
function oo({
|
|
185
185
|
appId: e,
|
|
@@ -194,11 +194,11 @@ function oo({
|
|
|
194
194
|
dispatcher: d,
|
|
195
195
|
extensions: m = {
|
|
196
196
|
platform: Ar.JS,
|
|
197
|
-
deviceOSPlatform: Qr() ?
|
|
197
|
+
deviceOSPlatform: Qr() ? Ft.MOBILE_WEB : Ft.WEB
|
|
198
198
|
}
|
|
199
199
|
}) {
|
|
200
|
-
const [g, p] =
|
|
201
|
-
const x = c ?? new
|
|
200
|
+
const [g, p] = S(() => {
|
|
201
|
+
const x = c ?? new wn(Tn.WARN), f = d ?? new Sn(x);
|
|
202
202
|
return {
|
|
203
203
|
appId: e,
|
|
204
204
|
aiAgentId: t,
|
|
@@ -207,13 +207,13 @@ function oo({
|
|
|
207
207
|
context: i,
|
|
208
208
|
logger: x,
|
|
209
209
|
dispatcher: f,
|
|
210
|
-
chatSDK: a ??
|
|
210
|
+
chatSDK: a ?? zt(e, m, s)
|
|
211
211
|
};
|
|
212
212
|
});
|
|
213
213
|
return D(() => {
|
|
214
214
|
p((x) => {
|
|
215
215
|
let f = x.logger, E = x.dispatcher, b = x.chatSDK;
|
|
216
|
-
return c && c !== x.logger && (f = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? b = a : !a && x.chatSDK.appId !== e && (b =
|
|
216
|
+
return c && c !== x.logger && (f = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? b = a : !a && x.chatSDK.appId !== e && (b = zt(e, m, { newInstance: !0, ...s })), {
|
|
217
217
|
...x,
|
|
218
218
|
appId: e,
|
|
219
219
|
aiAgentId: t,
|
|
@@ -261,7 +261,7 @@ function uo({
|
|
|
261
261
|
onAfterSendMessage: l = mt
|
|
262
262
|
}) {
|
|
263
263
|
var b;
|
|
264
|
-
const { chatSDK: c, logger: d, dispatcher: m } =
|
|
264
|
+
const { chatSDK: c, logger: d, dispatcher: m } = tt(), { channel: g, channelFetchError: p, fetchChannel: x } = mo(t), f = io(c, g, {
|
|
265
265
|
shouldCountNewMessages: () => !1,
|
|
266
266
|
onChannelDeleted: n,
|
|
267
267
|
onMessagesReceived: (C) => o == null ? void 0 : o(C),
|
|
@@ -269,9 +269,9 @@ function uo({
|
|
|
269
269
|
logger: d
|
|
270
270
|
});
|
|
271
271
|
D(() => {
|
|
272
|
-
const C = async (
|
|
273
|
-
const T = typeof (
|
|
274
|
-
g && T &&
|
|
272
|
+
const C = async (y) => {
|
|
273
|
+
const T = typeof (y == null ? void 0 : y.channelUrl) == "string";
|
|
274
|
+
g && T && y.channelUrl !== g.url || (d.debug("conversation.dispatcher: try to close conversation", g), g != null && g.conversation && g.conversation.status === W.OPEN && (await g.closeConversation(), a == null || a()));
|
|
275
275
|
};
|
|
276
276
|
return m.subscribe(ht.ConversationClose, C), () => {
|
|
277
277
|
m.unsubscribe(ht.ConversationClose, C);
|
|
@@ -294,30 +294,30 @@ function uo({
|
|
|
294
294
|
if (((T = g == null ? void 0 : g.conversation) == null ? void 0 : T.status) === W.CLOSED)
|
|
295
295
|
throw new Error("Conversation is closed");
|
|
296
296
|
s && (C = await s(C));
|
|
297
|
-
const
|
|
298
|
-
return l == null || l(
|
|
297
|
+
const y = await f.sendUserMessage(C, l);
|
|
298
|
+
return l == null || l(y), y;
|
|
299
299
|
},
|
|
300
300
|
sendFileMessage: async (C) => {
|
|
301
301
|
var T;
|
|
302
302
|
if (((T = g == null ? void 0 : g.conversation) == null ? void 0 : T.status) === W.CLOSED)
|
|
303
303
|
throw new Error("Conversation is closed");
|
|
304
304
|
s && (C = await s(C));
|
|
305
|
-
const
|
|
306
|
-
return l == null || l(
|
|
305
|
+
const y = await f.sendFileMessage(C, l);
|
|
306
|
+
return l == null || l(y), y;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
};
|
|
310
310
|
return /* @__PURE__ */ r.createElement(co, { value: E }, e);
|
|
311
311
|
}
|
|
312
312
|
function mo(e) {
|
|
313
|
-
const { chatSDK: t, logger: n } =
|
|
313
|
+
const { chatSDK: t, logger: n } = tt(), [o, i] = S(void 0), [a, s] = S(void 0);
|
|
314
314
|
async function l() {
|
|
315
315
|
if (n.debug("conversation.fetchChannel: start"), i(void 0), s(void 0), e)
|
|
316
316
|
try {
|
|
317
317
|
n.debug("conversation.fetchChannel: get channel", e);
|
|
318
318
|
const c = await t.groupChannel.getChannel(e);
|
|
319
319
|
i(c);
|
|
320
|
-
const d = new
|
|
320
|
+
const d = new Qe({ onReconnectSucceeded: () => c.refresh() });
|
|
321
321
|
t.addConnectionHandler("sba-refresh", d), n.debug("conversation.fetchChannel: fetched channel", c);
|
|
322
322
|
} catch (c) {
|
|
323
323
|
c instanceof Ir && s(c), n.error("conversation.fetchChannel: error", c);
|
|
@@ -339,7 +339,7 @@ class ho {
|
|
|
339
339
|
*/
|
|
340
340
|
constructor(t, { filter: n, limit: o = 20 }) {
|
|
341
341
|
var i, a, s, l, c;
|
|
342
|
-
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order =
|
|
342
|
+
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order = yn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
|
|
343
343
|
aiAgentChannelFilter: (i = this.filter) == null ? void 0 : i.aiAgentChannelFilter,
|
|
344
344
|
aiAgentConversationStatusFilter: (a = this.filter) == null ? void 0 : a.aiAgentConversationStatusFilter,
|
|
345
345
|
aiAgentIds: (s = this.filter) == null ? void 0 : s.aiAgentIds,
|
|
@@ -353,7 +353,7 @@ class ho {
|
|
|
353
353
|
onChannelDeleted: (d) => {
|
|
354
354
|
this._removeChannelsFromView([d]);
|
|
355
355
|
}
|
|
356
|
-
}), this._connectionHandler = new
|
|
356
|
+
}), this._connectionHandler = new Qe({
|
|
357
357
|
onReconnectSucceeded: () => {
|
|
358
358
|
this._isDefaultChangelogSyncTimestampUpdated && this._syncChannelChangelogs();
|
|
359
359
|
}
|
|
@@ -446,7 +446,7 @@ class ho {
|
|
|
446
446
|
for (const b of t)
|
|
447
447
|
o.has(b.url) ? i.push(b) : a.push(b);
|
|
448
448
|
const s = this._upsertPinnedChannelsToArray(i), l = this._upsertRegularChannelsToArray(a, n), c = s.addedChannels.concat(l.addedChannels), d = s.updatedChannels.concat(l.updatedChannels), m = s.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);
|
|
449
|
-
c.length > 0 && ((x = (p = this._collectionEventHandler) == null ? void 0 : p.onChannelsAdded) == null || x.call(p, c)), d.length > 0 && ((E = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsUpdated) == null || E.call(f, d)), m.length > 0 && this._removeChannelsFromView(m);
|
|
449
|
+
c.length > 0 && ((x = (p = this._collectionEventHandler) == null ? void 0 : p.onChannelsAdded) == null || x.call(p, {}, c)), d.length > 0 && ((E = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsUpdated) == null || E.call(f, {}, d)), m.length > 0 && this._removeChannelsFromView(m);
|
|
450
450
|
}
|
|
451
451
|
/**
|
|
452
452
|
* Removes channels from the collection by their URLs.
|
|
@@ -463,7 +463,7 @@ class ho {
|
|
|
463
463
|
const c = this._channels.findIndex((d) => d.url === l);
|
|
464
464
|
c >= 0 && (o.push(l), this._channels.splice(c, 1));
|
|
465
465
|
}
|
|
466
|
-
o.length > 0 && ((s = (a = this._collectionEventHandler) == null ? void 0 : a.onChannelsDeleted) == null || s.call(a, o));
|
|
466
|
+
o.length > 0 && ((s = (a = this._collectionEventHandler) == null ? void 0 : a.onChannelsDeleted) == null || s.call(a, {}, o));
|
|
467
467
|
}
|
|
468
468
|
/**
|
|
469
469
|
* Gets all channels in the collection.
|
|
@@ -496,7 +496,7 @@ class ho {
|
|
|
496
496
|
* Sets the event handler for collection updates.
|
|
497
497
|
* @param handler - Event handler for channel collection changes
|
|
498
498
|
*/
|
|
499
|
-
|
|
499
|
+
setConversationListCollectionHandler(t) {
|
|
500
500
|
this._collectionEventHandler = t;
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
@@ -512,7 +512,7 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
512
512
|
const o = gt(e, t);
|
|
513
513
|
let i = 0, a = e.length - 1, s = Math.floor((i + a) / 2);
|
|
514
514
|
for (; i < a; ) {
|
|
515
|
-
const c =
|
|
515
|
+
const c = Vt(e[s], t, n);
|
|
516
516
|
if (c > 0)
|
|
517
517
|
a = s, s = Math.floor((i + a) / 2);
|
|
518
518
|
else if (c < 0)
|
|
@@ -520,12 +520,12 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
520
520
|
else
|
|
521
521
|
return { place: s, oldPosition: o };
|
|
522
522
|
}
|
|
523
|
-
return { place:
|
|
523
|
+
return { place: Vt(e[s], t, n) >= 0 ? s : s + 1, oldPosition: o };
|
|
524
524
|
}
|
|
525
525
|
return { place: e.length, oldPosition: -1 };
|
|
526
|
-
},
|
|
526
|
+
}, Vt = (e, t, n) => {
|
|
527
527
|
switch (n) {
|
|
528
|
-
case
|
|
528
|
+
case yn.LATEST_LAST_MESSAGE:
|
|
529
529
|
if (e.lastMessage && t.lastMessage) {
|
|
530
530
|
const o = t.lastMessage.createdAt - e.lastMessage.createdAt;
|
|
531
531
|
return o === 0 ? t.createdAt - e.createdAt : o;
|
|
@@ -535,14 +535,14 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
535
535
|
}
|
|
536
536
|
};
|
|
537
537
|
function po(e, t) {
|
|
538
|
-
var f, E, b, C,
|
|
539
|
-
const n =
|
|
538
|
+
var f, E, b, C, y, T, _, K;
|
|
539
|
+
const n = bn(), [o, i] = S(!1), [a, s] = S(null), [l, c] = S([]), [d, m] = S(null), g = F(!1), p = U(async () => {
|
|
540
540
|
if (!g.current && e.currentUser) {
|
|
541
541
|
g.current = !0, i(!1), s(null), c([]);
|
|
542
542
|
try {
|
|
543
543
|
d == null || d.dispose();
|
|
544
544
|
const L = new ho(e, t);
|
|
545
|
-
L.
|
|
545
|
+
L.setConversationListCollectionHandler({
|
|
546
546
|
onChannelsAdded: () => {
|
|
547
547
|
c(L.channels);
|
|
548
548
|
},
|
|
@@ -563,9 +563,9 @@ function po(e, t) {
|
|
|
563
563
|
e,
|
|
564
564
|
(f = t.filter) == null ? void 0 : f.aiAgentChannelFilter,
|
|
565
565
|
(b = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : b.join(),
|
|
566
|
-
(
|
|
566
|
+
(y = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : y.join(),
|
|
567
567
|
(T = t.filter) == null ? void 0 : T.deskChannelFilter,
|
|
568
|
-
(
|
|
568
|
+
(K = (_ = t.filter) == null ? void 0 : _.pinnedChannelUrls) == null ? void 0 : K.join(),
|
|
569
569
|
t.limit
|
|
570
570
|
]), x = U(async () => {
|
|
571
571
|
if (d)
|
|
@@ -575,7 +575,7 @@ function po(e, t) {
|
|
|
575
575
|
s(L);
|
|
576
576
|
}
|
|
577
577
|
}, [d]);
|
|
578
|
-
return D(() => (e.addConnectionHandler(n, new
|
|
578
|
+
return D(() => (e.addConnectionHandler(n, new Qe({ onConnected: () => p() })), () => e.removeConnectionHandler(n)), [e, n, p]), D(() => {
|
|
579
579
|
p();
|
|
580
580
|
}, [p]), D(() => () => {
|
|
581
581
|
g.current = !1, d == null || d.dispose();
|
|
@@ -590,7 +590,7 @@ const {
|
|
|
590
590
|
Provider: fo
|
|
591
591
|
} = j("AIAgentConversationList");
|
|
592
592
|
function bo({ conversationListFilter: e, children: t }) {
|
|
593
|
-
const { chatSDK: n, aiAgentId: o } =
|
|
593
|
+
const { chatSDK: n, aiAgentId: o } = tt(), i = po(n, {
|
|
594
594
|
filter: {
|
|
595
595
|
aiAgentIds: [o],
|
|
596
596
|
aiAgentConversationStatusFilter: [W.CLOSED],
|
|
@@ -611,11 +611,11 @@ const pt = {
|
|
|
611
611
|
WHITE: "#ffffff",
|
|
612
612
|
BLACK: "#000000"
|
|
613
613
|
};
|
|
614
|
-
function
|
|
614
|
+
function kn(e) {
|
|
615
615
|
return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
|
|
616
616
|
}
|
|
617
617
|
function xo(e) {
|
|
618
|
-
const t =
|
|
618
|
+
const t = kn(e);
|
|
619
619
|
return [
|
|
620
620
|
parseInt(t.slice(1, 3), 16),
|
|
621
621
|
// r
|
|
@@ -635,7 +635,7 @@ function Co(e, t, n) {
|
|
|
635
635
|
const c = (o + i) / 2;
|
|
636
636
|
return o !== i && (l = c > 0.5 ? a / (2 - o - i) : a / (o + i)), o === e ? s = (t - n) / a + (t < n ? 6 : 0) : o === t ? s = (n - e) / a + 2 : o === n && (s = (e - t) / a + 4), s /= 6, [s, l, c];
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function vo(e, t, n) {
|
|
639
639
|
let o, i, a;
|
|
640
640
|
if (t === 0)
|
|
641
641
|
o = i = a = n;
|
|
@@ -647,21 +647,21 @@ function yo(e, t, n) {
|
|
|
647
647
|
}
|
|
648
648
|
return [Math.round(o * 255), Math.round(i * 255), Math.round(a * 255)];
|
|
649
649
|
}
|
|
650
|
-
function
|
|
651
|
-
const [o, i, a] = xo(e), [s, l, c] = Co(o, i, a), d = Math.max(0, Math.min(1, c * t)), m = Math.max(0, Math.min(1, l * n)), [g, p, x] =
|
|
650
|
+
function He(e, t, n) {
|
|
651
|
+
const [o, i, a] = xo(e), [s, l, c] = Co(o, i, a), d = Math.max(0, Math.min(1, c * t)), m = Math.max(0, Math.min(1, l * n)), [g, p, x] = vo(s, m, d);
|
|
652
652
|
return Eo([Math.round(g), Math.round(p), Math.round(x)]);
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function yo(e, t = "light") {
|
|
655
655
|
return {
|
|
656
|
-
extraDark:
|
|
657
|
-
dark:
|
|
656
|
+
extraDark: He(e, 0.6, 1.2),
|
|
657
|
+
dark: He(e, 0.85, 1.1),
|
|
658
658
|
main: e,
|
|
659
|
-
light:
|
|
660
|
-
extraLight:
|
|
659
|
+
light: He(e, t === "dark" ? 1.1 : 1.5, t === "dark" ? 0.95 : 0.9),
|
|
660
|
+
extraLight: He(e, t === "dark" ? 1.2 : 1.75, t === "dark" ? 0.9 : 0.8)
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
function ft(e) {
|
|
664
|
-
const t =
|
|
664
|
+
const t = kn(e), n = 149, o = +`0x${t[1]}${t[2]}`, i = +`0x${t[3]}${t[4]}`, a = +`0x${t[5]}${t[6]}`;
|
|
665
665
|
return o * 0.299 + i * 0.587 + a * 0.114 > n ? pt.BLACK : pt.WHITE;
|
|
666
666
|
}
|
|
667
667
|
function _o(e, t, n, o, i) {
|
|
@@ -719,7 +719,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
719
719
|
csat: {
|
|
720
720
|
background: e.background400
|
|
721
721
|
}
|
|
722
|
-
}),
|
|
722
|
+
}), ze = {
|
|
723
723
|
primary: {
|
|
724
724
|
extraDark: "#491389",
|
|
725
725
|
dark: "#6211c8",
|
|
@@ -772,7 +772,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
772
772
|
dark: "rgba(0, 0, 0, 0.55)",
|
|
773
773
|
light: "rgba(22, 22, 22, 0.32)"
|
|
774
774
|
}
|
|
775
|
-
},
|
|
775
|
+
}, lt = {
|
|
776
776
|
h1: { fontSize: 18, fontWeight: 700 },
|
|
777
777
|
h2: { fontSize: 16, fontWeight: 700 },
|
|
778
778
|
subtitle1: { fontSize: 16, fontWeight: 500 },
|
|
@@ -786,7 +786,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
786
786
|
caption3: { fontSize: 11, fontWeight: 700 },
|
|
787
787
|
caption4: { fontSize: 11, fontWeight: 400 }
|
|
788
788
|
};
|
|
789
|
-
function
|
|
789
|
+
function Wt(e) {
|
|
790
790
|
const t = To(e), { colors: n, aiAgentColorVariables: o } = wo(e, t), i = Ao(e);
|
|
791
791
|
return {
|
|
792
792
|
selectedTheme: e.selectedTheme,
|
|
@@ -797,9 +797,9 @@ function Gt(e) {
|
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
function To({ selectedTheme: e, palette: t, primary: n }) {
|
|
800
|
-
const o = t != null && t.primary ? t.primary : n ? n ===
|
|
800
|
+
const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary : yo(n, e) : ze.primary;
|
|
801
801
|
return {
|
|
802
|
-
...
|
|
802
|
+
...ze,
|
|
803
803
|
primary: o,
|
|
804
804
|
...t
|
|
805
805
|
};
|
|
@@ -831,23 +831,23 @@ function ko(e, t, n) {
|
|
|
831
831
|
}
|
|
832
832
|
function Ao({ typography: e }) {
|
|
833
833
|
if (!e)
|
|
834
|
-
return
|
|
835
|
-
const t = { ...
|
|
834
|
+
return lt;
|
|
835
|
+
const t = { ...lt };
|
|
836
836
|
return Object.keys(e).forEach((n) => {
|
|
837
837
|
const o = e[n];
|
|
838
838
|
if (o && typeof o == "object") {
|
|
839
|
-
const i =
|
|
839
|
+
const i = lt[n], a = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
|
|
840
840
|
t[n] = ko(i, o, a);
|
|
841
841
|
}
|
|
842
842
|
}), t;
|
|
843
843
|
}
|
|
844
844
|
const {
|
|
845
845
|
Provider: Io,
|
|
846
|
-
useContext:
|
|
846
|
+
useContext: An
|
|
847
847
|
} = j("AIAgentTheme");
|
|
848
848
|
function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }) {
|
|
849
|
-
const [a, s] =
|
|
850
|
-
() =>
|
|
849
|
+
const [a, s] = S(
|
|
850
|
+
() => Wt({
|
|
851
851
|
selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
|
|
852
852
|
palette: t,
|
|
853
853
|
typography: n,
|
|
@@ -863,7 +863,7 @@ function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }
|
|
|
863
863
|
botMessageBackgroundContrast: void 0
|
|
864
864
|
};
|
|
865
865
|
!p.primary && (g != null && g.primaryColor) && (p.primary = g.primaryColor, p.primaryContrast = g.primaryContrastColor), !p.botMessageBackground && (g != null && g.botMessageBackgroundColor) && (p.botMessageBackground = g.botMessageBackgroundColor, p.botMessageBackgroundContrast = g.botMessageBackgroundContrastColor);
|
|
866
|
-
const x =
|
|
866
|
+
const x = Wt({ selectedTheme: m, palette: t, typography: n, ...p });
|
|
867
867
|
s(x), e == null || e.info("theme.update:", m);
|
|
868
868
|
},
|
|
869
869
|
[o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor, t, n, e]
|
|
@@ -872,14 +872,14 @@ function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }
|
|
|
872
872
|
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(a.selectedTheme);
|
|
873
873
|
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(Io, { value: { theme: a, updateTheme: l } }, i);
|
|
874
874
|
}
|
|
875
|
-
const
|
|
875
|
+
const In = (e) => {
|
|
876
876
|
try {
|
|
877
877
|
const t = JSON.parse(e);
|
|
878
878
|
return typeof t == "string" ? JSON.stringify(t).slice(1, -1) : e.trim();
|
|
879
879
|
} catch {
|
|
880
880
|
return JSON.stringify(e).slice(1, -1);
|
|
881
881
|
}
|
|
882
|
-
},
|
|
882
|
+
}, De = (e) => JSON.parse(e), nt = (e) => JSON.parse(e);
|
|
883
883
|
function Mo(e, t) {
|
|
884
884
|
const [n, o] = t.split(",").map((i) => i.trim());
|
|
885
885
|
return e === "dark" && o || n;
|
|
@@ -894,7 +894,7 @@ function Oo(e) {
|
|
|
894
894
|
}
|
|
895
895
|
return n(e), t;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Ct({
|
|
898
898
|
template: e,
|
|
899
899
|
variables: t,
|
|
900
900
|
variableKeyPattern: n,
|
|
@@ -904,7 +904,7 @@ function yt({
|
|
|
904
904
|
if (!o && !["number", "boolean", "string"].includes(typeof s))
|
|
905
905
|
throw new Error("If transformer is not provided, value must be a {string, number, or boolean}");
|
|
906
906
|
const l = o ? o(s) : String(s), c = n(a);
|
|
907
|
-
return i.replace(c,
|
|
907
|
+
return i.replace(c, In(l));
|
|
908
908
|
}, e);
|
|
909
909
|
}
|
|
910
910
|
async function Lo({
|
|
@@ -918,7 +918,7 @@ async function Lo({
|
|
|
918
918
|
const l = await o(s);
|
|
919
919
|
return { regex: n(a), transformedValue: l };
|
|
920
920
|
})
|
|
921
|
-
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s,
|
|
921
|
+
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s, In(l)), e);
|
|
922
922
|
}
|
|
923
923
|
const Ro = (e) => ({
|
|
924
924
|
setTemplate: (t, n) => e.onSetTemplate(t, n),
|
|
@@ -928,7 +928,7 @@ const Ro = (e) => ({
|
|
|
928
928
|
clear: () => e.onClear()
|
|
929
929
|
}), {
|
|
930
930
|
Provider: Do,
|
|
931
|
-
useContext:
|
|
931
|
+
useContext: $n
|
|
932
932
|
} = j("MessageCacheTemplate");
|
|
933
933
|
function No({ logger: e, storage: t, children: n }) {
|
|
934
934
|
const o = U(
|
|
@@ -945,7 +945,7 @@ function No({ logger: e, storage: t, children: n }) {
|
|
|
945
945
|
try {
|
|
946
946
|
const { templates: l, token: c } = await s.aiAgent.getMessageTemplates({ limit: 20 });
|
|
947
947
|
for (const { template: d } of l) {
|
|
948
|
-
const { key: m } =
|
|
948
|
+
const { key: m } = De(d);
|
|
949
949
|
t.setTemplate(m, d);
|
|
950
950
|
}
|
|
951
951
|
t.setCachedToken(c);
|
|
@@ -975,10 +975,10 @@ function Po(e) {
|
|
|
975
975
|
}
|
|
976
976
|
const {
|
|
977
977
|
Provider: Bo,
|
|
978
|
-
useContext:
|
|
978
|
+
useContext: Mn
|
|
979
979
|
} = j("MessageTemplateFetching");
|
|
980
980
|
function Fo({ children: e, internalVariables: t }) {
|
|
981
|
-
const n = F({}), o = F({}), [i, a] =
|
|
981
|
+
const n = F({}), o = F({}), [i, a] = S({}), s = U((d, m) => {
|
|
982
982
|
a((g) => ({
|
|
983
983
|
...g,
|
|
984
984
|
[d]: { fetching: !1, error: !1, ...g[d], ...m }
|
|
@@ -1023,27 +1023,27 @@ function Fo({ children: e, internalVariables: t }) {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
return /* @__PURE__ */ r.createElement(Bo, { value: c }, e);
|
|
1025
1025
|
}
|
|
1026
|
-
const
|
|
1026
|
+
const rt = {
|
|
1027
1027
|
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
1028
1028
|
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
1029
1029
|
};
|
|
1030
|
-
function
|
|
1030
|
+
function de({ uiTemplateString: e, variables: t = {} }) {
|
|
1031
1031
|
const n = Oo(t);
|
|
1032
|
-
return
|
|
1032
|
+
return Ct({
|
|
1033
1033
|
template: e,
|
|
1034
1034
|
variables: n,
|
|
1035
|
-
variableKeyPattern: (o) =>
|
|
1035
|
+
variableKeyPattern: (o) => rt.VARIABLE(o)
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function ue({
|
|
1039
1039
|
theme: e,
|
|
1040
1040
|
uiTemplateString: t,
|
|
1041
1041
|
colorVariables: n = {}
|
|
1042
1042
|
}) {
|
|
1043
|
-
return
|
|
1043
|
+
return Ct({
|
|
1044
1044
|
template: t,
|
|
1045
1045
|
variables: n,
|
|
1046
|
-
variableKeyPattern: (o) =>
|
|
1046
|
+
variableKeyPattern: (o) => rt.VARIABLE(o),
|
|
1047
1047
|
variableValueTransformer: (o) => Mo(e, o)
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
@@ -1056,29 +1056,29 @@ function Uo({
|
|
|
1056
1056
|
onRequestTemplate: a
|
|
1057
1057
|
}) {
|
|
1058
1058
|
const l = Object.values(n).flat().map((d) => d.key);
|
|
1059
|
-
return [...new Set(l)].some((d) => !a(d)) ? null :
|
|
1059
|
+
return [...new Set(l)].some((d) => !a(d)) ? null : Ct({
|
|
1060
1060
|
template: t,
|
|
1061
1061
|
variables: n,
|
|
1062
|
-
variableKeyPattern: (d) =>
|
|
1062
|
+
variableKeyPattern: (d) => rt.VIEW_VARIABLE(d),
|
|
1063
1063
|
variableValueTransformer: (d) => {
|
|
1064
1064
|
const m = d.map(({ key: g, variables: p }) => {
|
|
1065
|
-
const x = a(g), { ui_template: f, color_variables: E } =
|
|
1065
|
+
const x = a(g), { ui_template: f, color_variables: E } = De(x);
|
|
1066
1066
|
let b = JSON.stringify(f);
|
|
1067
|
-
return b =
|
|
1067
|
+
return b = de({
|
|
1068
1068
|
uiTemplateString: b,
|
|
1069
1069
|
variables: i
|
|
1070
|
-
}), b =
|
|
1070
|
+
}), b = ue({
|
|
1071
1071
|
theme: e,
|
|
1072
1072
|
uiTemplateString: b,
|
|
1073
1073
|
colorVariables: E
|
|
1074
|
-
}), b =
|
|
1074
|
+
}), b = ue({
|
|
1075
1075
|
theme: e,
|
|
1076
1076
|
uiTemplateString: b,
|
|
1077
1077
|
colorVariables: o
|
|
1078
|
-
}), b =
|
|
1078
|
+
}), b = de({
|
|
1079
1079
|
uiTemplateString: b,
|
|
1080
1080
|
variables: p
|
|
1081
|
-
}),
|
|
1081
|
+
}), nt(b);
|
|
1082
1082
|
});
|
|
1083
1083
|
return JSON.stringify(m);
|
|
1084
1084
|
}
|
|
@@ -1095,26 +1095,26 @@ async function Ho({
|
|
|
1095
1095
|
return Lo({
|
|
1096
1096
|
template: t,
|
|
1097
1097
|
variables: n,
|
|
1098
|
-
variableKeyPattern: (s) =>
|
|
1098
|
+
variableKeyPattern: (s) => rt.VIEW_VARIABLE(s),
|
|
1099
1099
|
variableValueTransformer: async (s) => {
|
|
1100
1100
|
const l = s.map(async ({ key: d, variables: m }) => {
|
|
1101
|
-
const g = await a(d), { ui_template: p, color_variables: x } =
|
|
1101
|
+
const g = await a(d), { ui_template: p, color_variables: x } = De(g);
|
|
1102
1102
|
let f = JSON.stringify(p);
|
|
1103
|
-
return f =
|
|
1103
|
+
return f = de({
|
|
1104
1104
|
uiTemplateString: f,
|
|
1105
1105
|
variables: i
|
|
1106
|
-
}), f =
|
|
1106
|
+
}), f = ue({
|
|
1107
1107
|
theme: e,
|
|
1108
1108
|
uiTemplateString: f,
|
|
1109
1109
|
colorVariables: x
|
|
1110
|
-
}), f =
|
|
1110
|
+
}), f = ue({
|
|
1111
1111
|
theme: e,
|
|
1112
1112
|
uiTemplateString: f,
|
|
1113
1113
|
colorVariables: o
|
|
1114
|
-
}), f =
|
|
1114
|
+
}), f = de({
|
|
1115
1115
|
uiTemplateString: f,
|
|
1116
1116
|
variables: m
|
|
1117
|
-
}),
|
|
1117
|
+
}), nt(f);
|
|
1118
1118
|
}), c = await Promise.all(l);
|
|
1119
1119
|
return JSON.stringify(c);
|
|
1120
1120
|
}
|
|
@@ -1126,7 +1126,7 @@ const zo = ({
|
|
|
1126
1126
|
internalVariables: n,
|
|
1127
1127
|
...o
|
|
1128
1128
|
}) => {
|
|
1129
|
-
const { ui_template: i, color_variables: a } =
|
|
1129
|
+
const { ui_template: i, color_variables: a } = De(e);
|
|
1130
1130
|
let s = JSON.stringify(i);
|
|
1131
1131
|
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
1132
1132
|
const c = Uo({
|
|
@@ -1138,24 +1138,24 @@ const zo = ({
|
|
|
1138
1138
|
if (c === null) return null;
|
|
1139
1139
|
s = c;
|
|
1140
1140
|
}
|
|
1141
|
-
return s =
|
|
1141
|
+
return s = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
|
|
1142
1142
|
}, Vo = async ({
|
|
1143
1143
|
rawTemplate: e,
|
|
1144
1144
|
aiAgentColorVariables: t,
|
|
1145
1145
|
internalVariables: n,
|
|
1146
1146
|
...o
|
|
1147
1147
|
}) => {
|
|
1148
|
-
const { ui_template: i, color_variables: a } =
|
|
1148
|
+
const { ui_template: i, color_variables: a } = De(e);
|
|
1149
1149
|
let s = JSON.stringify(i);
|
|
1150
1150
|
return Object.keys(o.viewVariables ?? {}).length > 0 && (s = await Ho({
|
|
1151
1151
|
...o,
|
|
1152
1152
|
uiTemplateString: s,
|
|
1153
1153
|
aiAgentColorVariables: t,
|
|
1154
1154
|
internalVariables: n
|
|
1155
|
-
})), s =
|
|
1155
|
+
})), s = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
|
|
1156
1156
|
}, Wo = (e) => {
|
|
1157
|
-
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } =
|
|
1158
|
-
return
|
|
1157
|
+
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = Mn();
|
|
1158
|
+
return S(() => {
|
|
1159
1159
|
const o = e.onGetCachedTemplate(e.templateKey);
|
|
1160
1160
|
return o ? zo({
|
|
1161
1161
|
...e,
|
|
@@ -1168,7 +1168,7 @@ const zo = ({
|
|
|
1168
1168
|
}, Go = (e) => {
|
|
1169
1169
|
const [t] = Wo(e);
|
|
1170
1170
|
if (t) return t;
|
|
1171
|
-
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } =
|
|
1171
|
+
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } = Mn();
|
|
1172
1172
|
return a(e.templateKey, async () => {
|
|
1173
1173
|
const l = await i({ ...e, suspense: !0 });
|
|
1174
1174
|
return await Vo({
|
|
@@ -1178,8 +1178,8 @@ const zo = ({
|
|
|
1178
1178
|
internalVariables: o
|
|
1179
1179
|
});
|
|
1180
1180
|
}).value;
|
|
1181
|
-
}, jo = '@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}',
|
|
1182
|
-
|
|
1181
|
+
}, jo = '@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}', Ne = "en", Ko = /* @__PURE__ */ new Set([
|
|
1182
|
+
Ne,
|
|
1183
1183
|
"ko",
|
|
1184
1184
|
"es",
|
|
1185
1185
|
"pt",
|
|
@@ -1255,14 +1255,14 @@ const zo = ({
|
|
|
1255
1255
|
}, vt = { language: "en", dateLocale: Yo, stringSet: qo }, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1256
1256
|
__proto__: null,
|
|
1257
1257
|
default: vt
|
|
1258
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1258
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne, vt]]);
|
|
1259
1259
|
async function Xo(e) {
|
|
1260
|
-
if (
|
|
1261
|
-
return
|
|
1262
|
-
const t = Ko.has(e) ? e :
|
|
1260
|
+
if (Ye.has(e))
|
|
1261
|
+
return Ye.get(e);
|
|
1262
|
+
const t = Ko.has(e) ? e : Ne;
|
|
1263
1263
|
try {
|
|
1264
1264
|
const { default: n } = await Zo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DvjrAXLD.js"), "./languages/en.ts": () => Promise.resolve().then(() => Jo), "./languages/es.ts": () => import("./zI14HLvP.js"), "./languages/fr.ts": () => import("./B9V0T5ZP.js"), "./languages/hi.ts": () => import("./YRQ0vk5Q.js"), "./languages/it.ts": () => import("./BQWJPfGp.js"), "./languages/ja.ts": () => import("./sl-YrKkN.js"), "./languages/ko.ts": () => import("./B8c_rqvH.js"), "./languages/pt.ts": () => import("./BSz49qaD.js"), "./languages/tr.ts": () => import("./D_eZyIAR.js") }), `./languages/${t}.ts`, 3);
|
|
1265
|
-
return
|
|
1265
|
+
return Ye.set(e, n), n;
|
|
1266
1266
|
} catch {
|
|
1267
1267
|
return vt;
|
|
1268
1268
|
}
|
|
@@ -1273,7 +1273,7 @@ const {
|
|
|
1273
1273
|
} = j("Localization");
|
|
1274
1274
|
function ei(e) {
|
|
1275
1275
|
var t;
|
|
1276
|
-
return ((t = e.split("-")) == null ? void 0 : t[0]) ??
|
|
1276
|
+
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Ne;
|
|
1277
1277
|
}
|
|
1278
1278
|
function ti({
|
|
1279
1279
|
language: e = navigator.language,
|
|
@@ -1281,7 +1281,7 @@ function ti({
|
|
|
1281
1281
|
stringSet: n,
|
|
1282
1282
|
children: o
|
|
1283
1283
|
}) {
|
|
1284
|
-
const [i, a] =
|
|
1284
|
+
const [i, a] = S(Ye.get(Ne));
|
|
1285
1285
|
return D(() => {
|
|
1286
1286
|
const s = ei(e);
|
|
1287
1287
|
i.language !== s && (t == null || t.debug("localization.useEffect: update language", `${i.language} -> ${s}`), Xo(s).then(a));
|
|
@@ -1292,20 +1292,20 @@ function ti({
|
|
|
1292
1292
|
language: i.language,
|
|
1293
1293
|
stringSet: { ...i.stringSet, ...n },
|
|
1294
1294
|
dateLocale: i.dateLocale,
|
|
1295
|
-
format: (s, l, c) =>
|
|
1295
|
+
format: (s, l, c) => Cn(s, l, { locale: i.dateLocale, ...c })
|
|
1296
1296
|
}
|
|
1297
1297
|
},
|
|
1298
1298
|
o
|
|
1299
1299
|
);
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1301
|
+
const qe = "data-sb-agent-theme", Gt = (e) => (t, ...n) => {
|
|
1302
1302
|
let o = "";
|
|
1303
1303
|
return t.forEach((i, a) => {
|
|
1304
1304
|
o += i + (n[a] ?? "");
|
|
1305
|
-
}), `[${
|
|
1305
|
+
}), `[${qe}='${e}'] & { ${o} }`;
|
|
1306
1306
|
}, N = {
|
|
1307
|
-
light:
|
|
1308
|
-
dark:
|
|
1307
|
+
light: Gt("light"),
|
|
1308
|
+
dark: Gt("dark")
|
|
1309
1309
|
}, ni = $(({ theme: e }) => {
|
|
1310
1310
|
const { palette: t } = e;
|
|
1311
1311
|
return `
|
|
@@ -1358,7 +1358,7 @@ const Ye = "data-sb-agent-theme", jt = (e) => (t, ...n) => {
|
|
|
1358
1358
|
--sendbird-overlay-light: ${t.overlay.light};
|
|
1359
1359
|
}
|
|
1360
1360
|
`;
|
|
1361
|
-
}), ri = $`[${
|
|
1361
|
+
}), ri = $`[${qe}='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);}[${qe}='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);}`, h = {
|
|
1362
1362
|
color: {
|
|
1363
1363
|
primary: {
|
|
1364
1364
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -1416,18 +1416,18 @@ function si(e) {
|
|
|
1416
1416
|
);
|
|
1417
1417
|
}
|
|
1418
1418
|
function ai({ rootElement: e = document.body, children: t }) {
|
|
1419
|
-
const { theme: n, updateTheme: o } =
|
|
1420
|
-
return
|
|
1421
|
-
e.setAttribute(
|
|
1419
|
+
const { theme: n, updateTheme: o } = An();
|
|
1420
|
+
return ce(() => {
|
|
1421
|
+
e.setAttribute(qe, n.selectedTheme);
|
|
1422
1422
|
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(Or, { theme: n }, /* @__PURE__ */ r.createElement(oi, { value: { theme: n, updateTheme: o } }, t));
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function fe(e, t) {
|
|
1425
1425
|
const n = e.getRootNode({ composed: t });
|
|
1426
1426
|
return n instanceof ShadowRoot || n instanceof Document ? n : document;
|
|
1427
1427
|
}
|
|
1428
1428
|
const li = (e, t) => {
|
|
1429
1429
|
D(() => {
|
|
1430
|
-
const n =
|
|
1430
|
+
const n = fe(t) instanceof ShadowRoot, o = fe(t, !0);
|
|
1431
1431
|
if (!(n ? t : o).querySelector(`link[href*='${e}']`)) {
|
|
1432
1432
|
const a = o.createElement("link");
|
|
1433
1433
|
a.rel = "stylesheet", a.href = e, (n ? t : o.head).appendChild(a);
|
|
@@ -1435,49 +1435,49 @@ const li = (e, t) => {
|
|
|
1435
1435
|
}, [e, t]);
|
|
1436
1436
|
}, ci = (e, t = document.body) => {
|
|
1437
1437
|
D(() => {
|
|
1438
|
-
const n =
|
|
1438
|
+
const n = fe(t), i = n instanceof ShadowRoot ? t : n.head;
|
|
1439
1439
|
if (!i) return;
|
|
1440
1440
|
const a = `sba-${btoa(e).slice(0, 10)}`;
|
|
1441
1441
|
let s = i.querySelector(`style#${a}`);
|
|
1442
1442
|
s ? s.textContent !== e && (s.textContent = e) : (s = i.ownerDocument.createElement("style"), s.id = a, s.textContent = e, i.appendChild(s));
|
|
1443
1443
|
}, [e, t]);
|
|
1444
|
-
},
|
|
1445
|
-
ENTRY: `${
|
|
1446
|
-
MODAL_ROOT: `${
|
|
1447
|
-
WINDOW: `${
|
|
1448
|
-
LAUNCHER: `${
|
|
1449
|
-
},
|
|
1450
|
-
MODAL:
|
|
1444
|
+
}, yt = /iPad|iPhone|iPod/.test(navigator.userAgent), di = /Android/.test(navigator.userAgent), Pe = (e) => yt || di, Q = "sb-agent", oe = {
|
|
1445
|
+
ENTRY: `${Q}-entry`,
|
|
1446
|
+
MODAL_ROOT: `${Q}-modal-root`,
|
|
1447
|
+
WINDOW: `${Q}-window`,
|
|
1448
|
+
LAUNCHER: `${Q}-launcher`
|
|
1449
|
+
}, Ve = 2147483647, be = {
|
|
1450
|
+
MODAL: Ve - 1,
|
|
1451
1451
|
// FIXME: need to cover the case where the tooltip is on the top of the modal
|
|
1452
|
-
TOOLTIP:
|
|
1453
|
-
WINDOW:
|
|
1454
|
-
LAUNCHER:
|
|
1452
|
+
TOOLTIP: Ve - 2,
|
|
1453
|
+
WINDOW: Ve - 3,
|
|
1454
|
+
LAUNCHER: Ve - 4
|
|
1455
|
+
}, On = {
|
|
1456
|
+
SESSION: `@${Q}-session`,
|
|
1457
|
+
USER_DATA: `@${Q}-udata`
|
|
1455
1458
|
}, Ln = {
|
|
1456
|
-
SESSION: `@${X}-session`,
|
|
1457
|
-
USER_DATA: `@${X}-udata`
|
|
1458
|
-
}, Rn = {
|
|
1459
1459
|
DEFAULT_PRIMARY: "#742ddd",
|
|
1460
1460
|
WHITE: "#ffffff"
|
|
1461
|
-
},
|
|
1461
|
+
}, Rn = 36, ui = 100, mi = 25 * 1024 * 1024, Dn = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], _t = "noopener noreferrer nofollow", We = {}, te = {
|
|
1462
1462
|
getItem: (e) => {
|
|
1463
1463
|
try {
|
|
1464
1464
|
return localStorage.getItem(e);
|
|
1465
1465
|
} catch {
|
|
1466
|
-
return
|
|
1466
|
+
return We[e] ?? null;
|
|
1467
1467
|
}
|
|
1468
1468
|
},
|
|
1469
1469
|
setItem: (e, t) => {
|
|
1470
1470
|
try {
|
|
1471
1471
|
localStorage.setItem(e, t);
|
|
1472
1472
|
} catch {
|
|
1473
|
-
|
|
1473
|
+
We[e] = t;
|
|
1474
1474
|
}
|
|
1475
1475
|
},
|
|
1476
1476
|
deleteItem: (e) => {
|
|
1477
1477
|
try {
|
|
1478
1478
|
localStorage.removeItem(e);
|
|
1479
1479
|
} catch {
|
|
1480
|
-
delete
|
|
1480
|
+
delete We[e];
|
|
1481
1481
|
}
|
|
1482
1482
|
},
|
|
1483
1483
|
getKeys: (e) => {
|
|
@@ -1489,16 +1489,16 @@ const li = (e, t) => {
|
|
|
1489
1489
|
}
|
|
1490
1490
|
return t;
|
|
1491
1491
|
} catch {
|
|
1492
|
-
return Object.keys(
|
|
1492
|
+
return Object.keys(We).filter((t) => t.startsWith(e));
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
};
|
|
1496
|
-
function
|
|
1496
|
+
function Nn(e) {
|
|
1497
1497
|
const { keyGenerator: t, keyParamsValidator: n } = e;
|
|
1498
1498
|
function o(s) {
|
|
1499
1499
|
try {
|
|
1500
1500
|
n && n(s);
|
|
1501
|
-
const l = t(s), c =
|
|
1501
|
+
const l = t(s), c = te.getItem(l);
|
|
1502
1502
|
return c ? JSON.parse(c) : null;
|
|
1503
1503
|
} catch {
|
|
1504
1504
|
return null;
|
|
@@ -1508,7 +1508,7 @@ function Pn(e) {
|
|
|
1508
1508
|
try {
|
|
1509
1509
|
n && n(s);
|
|
1510
1510
|
const c = t(s), d = JSON.stringify(l);
|
|
1511
|
-
|
|
1511
|
+
te.setItem(c, d);
|
|
1512
1512
|
} catch {
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
@@ -1516,16 +1516,16 @@ function Pn(e) {
|
|
|
1516
1516
|
try {
|
|
1517
1517
|
n && n(s);
|
|
1518
1518
|
const l = t(s);
|
|
1519
|
-
|
|
1519
|
+
te.deleteItem(l);
|
|
1520
1520
|
} catch {
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
1523
|
return { get: o, set: i, clear: a };
|
|
1524
1524
|
}
|
|
1525
|
-
const
|
|
1525
|
+
const $e = Nn({
|
|
1526
1526
|
keyGenerator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1527
1527
|
const o = hi(`${e}/${t}/${n}`);
|
|
1528
|
-
return `${
|
|
1528
|
+
return `${On.USER_DATA}/${o}`;
|
|
1529
1529
|
},
|
|
1530
1530
|
keyParamsValidator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1531
1531
|
if (!e || !t || !n)
|
|
@@ -1538,11 +1538,11 @@ function hi(e) {
|
|
|
1538
1538
|
t = (t << 5) - t + e.charCodeAt(n), t |= 0;
|
|
1539
1539
|
return t.toString(16);
|
|
1540
1540
|
}
|
|
1541
|
-
const
|
|
1542
|
-
keyGenerator: ({ appId: e, aiAgentId: t }) => `${
|
|
1541
|
+
const Ge = Nn({
|
|
1542
|
+
keyGenerator: ({ appId: e, aiAgentId: t }) => `${On.SESSION}/${e}/${t}`
|
|
1543
1543
|
}), {
|
|
1544
1544
|
Provider: gi,
|
|
1545
|
-
Consumer:
|
|
1545
|
+
Consumer: Pn,
|
|
1546
1546
|
useContext: P
|
|
1547
1547
|
} = j("Agent");
|
|
1548
1548
|
function pi({
|
|
@@ -1553,7 +1553,7 @@ function pi({
|
|
|
1553
1553
|
enableAutoDisconnectInLauncher: i = !0,
|
|
1554
1554
|
...a
|
|
1555
1555
|
}) {
|
|
1556
|
-
const s =
|
|
1556
|
+
const s = tt(), [l, c] = S(!1), [d, m] = S(!1), g = {
|
|
1557
1557
|
opened: (t == null ? void 0 : t.opened) ?? l,
|
|
1558
1558
|
setOpened: (t == null ? void 0 : t.setOpened) ?? c,
|
|
1559
1559
|
expanded: (t == null ? void 0 : t.expanded) ?? d,
|
|
@@ -1575,7 +1575,7 @@ function pi({
|
|
|
1575
1575
|
);
|
|
1576
1576
|
}
|
|
1577
1577
|
function fi() {
|
|
1578
|
-
const { chatSDK: e, logger: t } = P(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } =
|
|
1578
|
+
const { chatSDK: e, logger: t } = P(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } = $n(), a = U(
|
|
1579
1579
|
async (l, c, d) => {
|
|
1580
1580
|
if (t.debug("authManager.authenticate: session:", l.userId), c) {
|
|
1581
1581
|
const m = new $r({
|
|
@@ -1608,10 +1608,10 @@ function bi(e, t) {
|
|
|
1608
1608
|
const xi = 24 * 60 * 60 * 1e3, {
|
|
1609
1609
|
Provider: Ei,
|
|
1610
1610
|
useContext: z
|
|
1611
|
-
} = j("MessengerSession"), Ci =
|
|
1612
|
-
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } =
|
|
1611
|
+
} = j("MessengerSession"), Ci = Re(function({ userSessionInfo: e, children: t }, n) {
|
|
1612
|
+
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } = An(), { authenticate: f, deauthenticate: E } = fi(), [b, C] = S(
|
|
1613
1613
|
void 0
|
|
1614
|
-
), [
|
|
1614
|
+
), [y, T] = S(void 0), [_, K] = S(null), [L, se] = S(null), [xe, v] = S(null), B = s == null ? void 0 : s.forceCreateChannel;
|
|
1615
1615
|
function Ee() {
|
|
1616
1616
|
if (e && e.userId) {
|
|
1617
1617
|
c.debug("messengerSession.initialize: manual session info detected");
|
|
@@ -1620,33 +1620,33 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1620
1620
|
`messengerSession.initialize: missing required keys in userSessionInfo: ${I.join(", ")}`
|
|
1621
1621
|
), e;
|
|
1622
1622
|
}
|
|
1623
|
-
const A =
|
|
1624
|
-
return A ? A.expireAt - xi <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"),
|
|
1623
|
+
const A = Ge.get({ appId: o, aiAgentId: i });
|
|
1624
|
+
return A ? A.expireAt - xi <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"), Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: A.userId }), null) : (c.debug("messengerSession.initialize: auto session info detected"), A) : null;
|
|
1625
1625
|
}
|
|
1626
1626
|
const J = U(
|
|
1627
1627
|
(A, I) => {
|
|
1628
|
-
|
|
1628
|
+
$e.set({ appId: o, aiAgentId: i, userId: A }, { knownActiveChannelUrl: I });
|
|
1629
1629
|
},
|
|
1630
1630
|
[o, i]
|
|
1631
1631
|
), Ae = U(
|
|
1632
1632
|
(A) => {
|
|
1633
|
-
const I =
|
|
1633
|
+
const I = $e.get({ appId: o, aiAgentId: i, userId: A });
|
|
1634
1634
|
return I == null ? void 0 : I.knownActiveChannelUrl;
|
|
1635
1635
|
},
|
|
1636
1636
|
[o, i]
|
|
1637
|
-
),
|
|
1638
|
-
if (
|
|
1637
|
+
), it = U(async () => {
|
|
1638
|
+
if (_) {
|
|
1639
1639
|
c.debug("messengerSession.refreshActiveChannel: try to refresh active channel"), C(void 0);
|
|
1640
1640
|
const A = await a.aiAgent.requestMessengerSettings({
|
|
1641
1641
|
aiAgentId: i,
|
|
1642
|
-
userId:
|
|
1642
|
+
userId: _.userId,
|
|
1643
1643
|
language: d,
|
|
1644
1644
|
country: m,
|
|
1645
1645
|
context: g,
|
|
1646
1646
|
forceCreateChannel: B,
|
|
1647
|
-
knownActiveChannelUrl: Ae(
|
|
1647
|
+
knownActiveChannelUrl: Ae(_.userId)
|
|
1648
1648
|
});
|
|
1649
|
-
return J(
|
|
1649
|
+
return J(_.userId, A.active_channel.channel_url), C({ url: A.active_channel.channel_url, status: W.OPEN }), c.info(
|
|
1650
1650
|
"messengerSession.refreshActiveChannel: refreshed active channel",
|
|
1651
1651
|
A.active_channel.channel_url
|
|
1652
1652
|
), A.active_channel.channel_url;
|
|
@@ -1656,28 +1656,28 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1656
1656
|
a,
|
|
1657
1657
|
o,
|
|
1658
1658
|
i,
|
|
1659
|
-
|
|
1659
|
+
_ == null ? void 0 : _.userId,
|
|
1660
1660
|
d,
|
|
1661
1661
|
m,
|
|
1662
1662
|
g,
|
|
1663
1663
|
B,
|
|
1664
1664
|
Ae,
|
|
1665
1665
|
J
|
|
1666
|
-
]),
|
|
1666
|
+
]), st = U(
|
|
1667
1667
|
async (A) => {
|
|
1668
|
-
if (!(
|
|
1668
|
+
if (!(_ != null && _.userId))
|
|
1669
1669
|
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
1670
1670
|
const M = (await a.aiAgent.requestMessengerSettings({
|
|
1671
1671
|
...A,
|
|
1672
|
-
userId:
|
|
1672
|
+
userId: _.userId,
|
|
1673
1673
|
knownActiveChannelUrl: void 0
|
|
1674
1674
|
})).active_channel.channel_url;
|
|
1675
|
-
return
|
|
1676
|
-
{ userId:
|
|
1675
|
+
return $e.set(
|
|
1676
|
+
{ userId: _.userId, appId: o, aiAgentId: A.aiAgentId },
|
|
1677
1677
|
{ knownActiveChannelUrl: M }
|
|
1678
1678
|
), M;
|
|
1679
1679
|
},
|
|
1680
|
-
[
|
|
1680
|
+
[_ == null ? void 0 : _.userId]
|
|
1681
1681
|
);
|
|
1682
1682
|
return vn(a, {
|
|
1683
1683
|
onChannelChanged: (A) => {
|
|
@@ -1688,18 +1688,23 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1688
1688
|
var H, Ce;
|
|
1689
1689
|
if (A.conversation && A.conversation.type === Br.PROACTIVE && I.userId === ((H = a.currentUser) == null ? void 0 : H.userId)) {
|
|
1690
1690
|
c.info("messengerSession.onUserJoined: proactive channel joined", A.url);
|
|
1691
|
-
const
|
|
1692
|
-
C({ url: A.url, status:
|
|
1691
|
+
const ae = ((Ce = A.conversation) == null ? void 0 : Ce.status) ?? W.OPEN;
|
|
1692
|
+
C({ url: A.url, status: ae }), l.setOpened(!0), vi({
|
|
1693
1693
|
sound: document.hidden || !l.opened
|
|
1694
1694
|
});
|
|
1695
1695
|
}
|
|
1696
1696
|
}
|
|
1697
|
-
}),
|
|
1697
|
+
}), yr(n, () => {
|
|
1698
1698
|
const A = async () => {
|
|
1699
1699
|
if (!b) throw new Error("No active conversation. Please start a conversation first.");
|
|
1700
1700
|
return await a.groupChannel.getChannel(b.url);
|
|
1701
1701
|
};
|
|
1702
1702
|
return {
|
|
1703
|
+
activeChannel: b,
|
|
1704
|
+
chatSDK: a,
|
|
1705
|
+
deauthenticate: async () => {
|
|
1706
|
+
c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0), K(null), se(null), v(null), _ && (Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: _.userId }), c.debug("messengerSession.deauthenticate: cleared user session cache")), c.debug("messengerSession.deauthenticate: completed");
|
|
1707
|
+
},
|
|
1703
1708
|
updateContext: async (I) => {
|
|
1704
1709
|
const H = await (await A()).updateContext(i, I);
|
|
1705
1710
|
return { ...H, context: H.context ?? {} };
|
|
@@ -1713,7 +1718,7 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1713
1718
|
return { ...M, context: M.context ?? {} };
|
|
1714
1719
|
}
|
|
1715
1720
|
};
|
|
1716
|
-
}, [b, a, i]), D(() => {
|
|
1721
|
+
}, [b, E, a, o, _, i]), D(() => {
|
|
1717
1722
|
async function A() {
|
|
1718
1723
|
c.debug("messengerSession.initialize: start");
|
|
1719
1724
|
const I = Ee(), M = await a.aiAgent.requestMessengerSettings({
|
|
@@ -1728,8 +1733,8 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1728
1733
|
c.debug("messengerSession.initialize: messenger settings response", M);
|
|
1729
1734
|
let H = null;
|
|
1730
1735
|
if (M.auto_created_user) {
|
|
1731
|
-
const { user_id:
|
|
1732
|
-
|
|
1736
|
+
const { user_id: Z, session_token: X, expire_at: ee } = M.auto_created_user;
|
|
1737
|
+
Ge.set({ appId: o, aiAgentId: i }, { userId: Z, authToken: X, expireAt: ee }), H = { userId: Z, authToken: X };
|
|
1733
1738
|
} else
|
|
1734
1739
|
H = {
|
|
1735
1740
|
userId: (I == null ? void 0 : I.userId) ?? "",
|
|
@@ -1737,16 +1742,16 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1737
1742
|
};
|
|
1738
1743
|
J(H.userId, M.active_channel.channel_url);
|
|
1739
1744
|
function Ce() {
|
|
1740
|
-
const
|
|
1741
|
-
x(
|
|
1742
|
-
const G = M.appearance.themes[
|
|
1745
|
+
const Z = M.appearance.selected_theme;
|
|
1746
|
+
x(Z, (ee) => {
|
|
1747
|
+
const G = M.appearance.themes[ee];
|
|
1743
1748
|
return {
|
|
1744
1749
|
primaryColor: G.primary_color,
|
|
1745
1750
|
botMessageBackgroundColor: G.bot_message_bg_color,
|
|
1746
1751
|
primaryContrastColor: G.primary_contrast_color,
|
|
1747
1752
|
botMessageBackgroundContrastColor: G.bot_message_bg_contrast_color
|
|
1748
1753
|
};
|
|
1749
|
-
}), T(void 0),
|
|
1754
|
+
}), T(void 0), K(H), se({
|
|
1750
1755
|
userId: M.bot.bot_userid,
|
|
1751
1756
|
profileUrl: M.bot.bot_profile_url,
|
|
1752
1757
|
nickname: M.bot.bot_nickname,
|
|
@@ -1754,20 +1759,20 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1754
1759
|
specialNotice: M.bot.special_notice,
|
|
1755
1760
|
specialNoticeEnabled: M.bot.is_special_notice_enabled,
|
|
1756
1761
|
showHandoffButton: M.bot.show_handoff_button ?? !0
|
|
1757
|
-
}),
|
|
1762
|
+
}), v({
|
|
1758
1763
|
type: M.launcher.image_type || "default_icon",
|
|
1759
1764
|
imageUrl: M.launcher.image_url
|
|
1760
|
-
}), M.launcher.auto_open && !
|
|
1765
|
+
}), M.launcher.auto_open && !Pe() && setTimeout(() => l.setOpened(!0), 500);
|
|
1761
1766
|
}
|
|
1762
|
-
function
|
|
1767
|
+
function ae() {
|
|
1763
1768
|
C({ url: M.active_channel.channel_url, status: W.OPEN });
|
|
1764
1769
|
}
|
|
1765
1770
|
try {
|
|
1766
1771
|
Ce();
|
|
1767
|
-
const
|
|
1768
|
-
await f(H, e == null ? void 0 : e.sessionHandler,
|
|
1769
|
-
} catch (
|
|
1770
|
-
|
|
1772
|
+
const Z = (X) => K((ee) => ee ? { ...ee, authToken: X } : null);
|
|
1773
|
+
await f(H, e == null ? void 0 : e.sessionHandler, Z), ae();
|
|
1774
|
+
} catch (Z) {
|
|
1775
|
+
Z instanceof Error && (c.error("messengerSession.initialize: failed to connect", Z), T(Z));
|
|
1771
1776
|
}
|
|
1772
1777
|
}
|
|
1773
1778
|
A().catch((I) => {
|
|
@@ -1775,15 +1780,15 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1775
1780
|
});
|
|
1776
1781
|
}, [a, o, i, e == null ? void 0 : e.userId, e == null ? void 0 : e.authToken]), D(() => {
|
|
1777
1782
|
p != null && p.onRegisterDeauthenticateHandler && (c.debug("messengerSession: registering deauthenticate handler"), p.onRegisterDeauthenticateHandler(E));
|
|
1778
|
-
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, E]), !
|
|
1783
|
+
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, E]), !_ || !L || !xe ? null : /* @__PURE__ */ r.createElement(
|
|
1779
1784
|
Ei,
|
|
1780
1785
|
{
|
|
1781
1786
|
value: {
|
|
1782
|
-
userSession:
|
|
1787
|
+
userSession: _,
|
|
1783
1788
|
activeChannel: b,
|
|
1784
|
-
refreshActiveChannel:
|
|
1785
|
-
createConversation:
|
|
1786
|
-
connectionError:
|
|
1789
|
+
refreshActiveChannel: it,
|
|
1790
|
+
createConversation: st,
|
|
1791
|
+
connectionError: y,
|
|
1787
1792
|
aiAgentInfo: { ...L, ...s == null ? void 0 : s.bot },
|
|
1788
1793
|
launcherInfo: { ...xe, ...s == null ? void 0 : s.launcher }
|
|
1789
1794
|
}
|
|
@@ -1791,7 +1796,7 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1791
1796
|
t
|
|
1792
1797
|
);
|
|
1793
1798
|
});
|
|
1794
|
-
function
|
|
1799
|
+
function vi({ sound: e }) {
|
|
1795
1800
|
const t = "🔔You have received a new message", n = document.title, o = setInterval(() => {
|
|
1796
1801
|
document.title = document.title === t ? n : t;
|
|
1797
1802
|
}, 750);
|
|
@@ -1799,7 +1804,7 @@ function yi({ sound: e }) {
|
|
|
1799
1804
|
new Audio(i.default).play();
|
|
1800
1805
|
});
|
|
1801
1806
|
}
|
|
1802
|
-
const
|
|
1807
|
+
const Y = (e) => {
|
|
1803
1808
|
const t = e;
|
|
1804
1809
|
return typeof t == "number" ? `${t}px` : t;
|
|
1805
1810
|
}, k = ({
|
|
@@ -1808,17 +1813,17 @@ const Z = (e) => {
|
|
|
1808
1813
|
color: n,
|
|
1809
1814
|
className: o,
|
|
1810
1815
|
...i
|
|
1811
|
-
}) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }),
|
|
1812
|
-
let n =
|
|
1813
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1816
|
+
}) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }), jt = /* @__PURE__ */ new WeakMap(), yi = (e, t) => {
|
|
1817
|
+
let n = jt.get(t);
|
|
1818
|
+
n || (n = /* @__PURE__ */ new Map(), jt.set(t, n));
|
|
1814
1819
|
const o = n.get(e);
|
|
1815
1820
|
if (o) return o;
|
|
1816
|
-
const i = t[e] ?? t.body1, a = $`font-size:${
|
|
1821
|
+
const i = t[e] ?? t.body1, a = $`font-size:${Y(i.fontSize)};font-weight:${i.fontWeight};${i.fontFamily ? `font-family: ${i.fontFamily};` : ""}
|
|
1817
1822
|
${i.lineHeight ? `line-height: ${i.lineHeight};` : "line-height: 100%;"}
|
|
1818
1823
|
`;
|
|
1819
1824
|
return n.set(e, a), a;
|
|
1820
|
-
}, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) =>
|
|
1821
|
-
function
|
|
1825
|
+
}, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => yi(e, t.typography)}color:${({ $color: e }) => e};`, Be = 244, Bn = 640, Je = 26, Fn = 4, ie = 12, ke = 2, Si = 16, me = `${Q}-incoming-msg`, Ti = `${Q}-marked-text`;
|
|
1826
|
+
function St(e) {
|
|
1822
1827
|
switch (e) {
|
|
1823
1828
|
case "top":
|
|
1824
1829
|
case "middle":
|
|
@@ -1827,7 +1832,7 @@ function Tt(e) {
|
|
|
1827
1832
|
return Si;
|
|
1828
1833
|
}
|
|
1829
1834
|
}
|
|
1830
|
-
function
|
|
1835
|
+
function Tt(e, t) {
|
|
1831
1836
|
if (t) {
|
|
1832
1837
|
const [, n] = t.split("/");
|
|
1833
1838
|
if (n)
|
|
@@ -1840,7 +1845,7 @@ function wt(e, t) {
|
|
|
1840
1845
|
}
|
|
1841
1846
|
return "FILE";
|
|
1842
1847
|
}
|
|
1843
|
-
function
|
|
1848
|
+
function Un(e) {
|
|
1844
1849
|
return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
|
|
1845
1850
|
}
|
|
1846
1851
|
const wi = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), ki = {
|
|
@@ -1887,26 +1892,26 @@ const wi = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"])
|
|
|
1887
1892
|
$size: t,
|
|
1888
1893
|
$color: o ?? h.color.primary.main
|
|
1889
1894
|
},
|
|
1890
|
-
/* @__PURE__ */ r.createElement(
|
|
1895
|
+
/* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(i, null))
|
|
1891
1896
|
);
|
|
1892
|
-
}, Ai = $`[dir='rtl'] &{transform:scaleX(-1);}`, Ii = u.div`width:${({ $size: e }) =>
|
|
1893
|
-
function
|
|
1897
|
+
}, Ai = $`[dir='rtl'] &{transform:scaleX(-1);}`, Ii = u.div`width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(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 && Ai};`;
|
|
1898
|
+
function wt({
|
|
1894
1899
|
name: e,
|
|
1895
1900
|
type: t = "FILE",
|
|
1896
1901
|
iconColor: n,
|
|
1897
1902
|
iconBackgroundColor: o,
|
|
1898
1903
|
onClick: i
|
|
1899
1904
|
}) {
|
|
1900
|
-
const { colors: a } =
|
|
1905
|
+
const { colors: a } = Et();
|
|
1901
1906
|
return /* @__PURE__ */ r.createElement($i, { onClick: i, $clickable: !!i }, /* @__PURE__ */ r.createElement(Oi, { $bgColor: o ?? a.base.primary }, /* @__PURE__ */ r.createElement(O, { type: "file-document", size: 24, color: n ?? a.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Li, null, /* @__PURE__ */ r.createElement(Ri, { variant: "button", color: h.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(k, { color: h.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
1902
1907
|
}
|
|
1903
|
-
const $i = u.div`border-radius:12px;gap:8px;width:${
|
|
1908
|
+
const $i = u.div`border-radius:12px;gap:8px;width:${Be}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};${({ $clickable: e }) => e && Mi}`, Mi = $`cursor:pointer;&:hover{background-color:${h.themedColor.bg_100_500};}`, Oi = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Li = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ri = u(k)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
1904
1909
|
function Di({ file: e, children: t, onClickFile: n }) {
|
|
1905
1910
|
return /* @__PURE__ */ r.createElement(Ni, null, /* @__PURE__ */ r.createElement(
|
|
1906
|
-
|
|
1911
|
+
wt,
|
|
1907
1912
|
{
|
|
1908
1913
|
name: e.name,
|
|
1909
|
-
type:
|
|
1914
|
+
type: Tt(e.name, e.type),
|
|
1910
1915
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
1911
1916
|
}
|
|
1912
1917
|
), t);
|
|
@@ -1916,21 +1921,21 @@ function Pi({ file: e, onClickMedia: t, children: n }) {
|
|
|
1916
1921
|
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Ui, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Hi, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
|
|
1917
1922
|
if (o) {
|
|
1918
1923
|
const i = {
|
|
1919
|
-
id: `${
|
|
1924
|
+
id: `${me}-media-body`,
|
|
1920
1925
|
onClick: () => t == null ? void 0 : t(e)
|
|
1921
1926
|
};
|
|
1922
1927
|
return /* @__PURE__ */ r.createElement(Bi, null, /* @__PURE__ */ r.createElement(Fi, { ...i }, o()), n);
|
|
1923
1928
|
}
|
|
1924
1929
|
return null;
|
|
1925
1930
|
}
|
|
1926
|
-
const Bi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`, Fi = u.div`width:${
|
|
1931
|
+
const Bi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`, Fi = u.div`width:${Be}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${N.light`
|
|
1927
1932
|
background-color: ${h.color.background100};
|
|
1928
1933
|
`}
|
|
1929
1934
|
${N.dark`
|
|
1930
1935
|
background-color: ${h.color.background400};
|
|
1931
1936
|
`}
|
|
1932
1937
|
`, Ui = u.img`width:100%;height:100%;object-fit:cover;`, Hi = u.video`width:100%;height:100%;object-fit:cover;`, zi = "✱";
|
|
1933
|
-
function
|
|
1938
|
+
function Hn(e) {
|
|
1934
1939
|
const t = new RegExp(`${zi}+`, "g");
|
|
1935
1940
|
return e.replace(t, (n) => `<span id=${Ti} aria-label="masked-text">${n}</span>`);
|
|
1936
1941
|
}
|
|
@@ -1953,85 +1958,88 @@ function Wi(e) {
|
|
|
1953
1958
|
}), o < e.length && n.push({
|
|
1954
1959
|
type: "text",
|
|
1955
1960
|
value: e.slice(o).trim()
|
|
1956
|
-
}), n.map((i) => i.type !== "text" ? i : { ...i, value:
|
|
1961
|
+
}), n.map((i) => i.type !== "text" ? i : { ...i, value: Hn(i.value) });
|
|
1957
1962
|
}
|
|
1958
|
-
const Gi = w(async () => ({ default: (await import("./
|
|
1959
|
-
function
|
|
1963
|
+
const Gi = w(async () => ({ default: (await import("./cJuIRXXl.js")).MarkdownText })), ji = w(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
|
|
1964
|
+
function Kt(e) {
|
|
1960
1965
|
var i, a;
|
|
1961
|
-
const t = e.maxBodyWidth ??
|
|
1962
|
-
id: `${
|
|
1966
|
+
const t = e.maxBodyWidth ?? Be, n = ye(() => Wi(e.message), [e.message]), o = {
|
|
1967
|
+
id: `${me}-text-body`,
|
|
1963
1968
|
$maxWidth: t,
|
|
1964
1969
|
$color: (i = e.customStyle) == null ? void 0 : i.bubbleContentColor,
|
|
1965
1970
|
$bgColor: (a = e.customStyle) == null ? void 0 : a.bubbleBackgroundColor
|
|
1966
1971
|
};
|
|
1967
|
-
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(
|
|
1972
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Zt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Zt, { ...o }, n.map((s, l) => s.type === "text" ? /* @__PURE__ */ r.createElement(Yt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(Oe, { fallback: s.value }, /* @__PURE__ */ r.createElement(Gi, { onClickImage: (c) => {
|
|
1973
|
+
var d;
|
|
1974
|
+
return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
|
|
1975
|
+
} }, s.value))) : s.type === "code" ? /* @__PURE__ */ r.createElement(Oe, { key: l, fallback: /* @__PURE__ */ r.createElement(Yt, { variant: "body3" }, s.value) }, /* @__PURE__ */ r.createElement(ji, { code: s.value, language: s.language })) : null), e.children);
|
|
1968
1976
|
}
|
|
1969
|
-
const
|
|
1977
|
+
const Zt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
|
|
1970
1978
|
color: ${t || e.colors.messageIncoming.text};
|
|
1971
1979
|
background-color: ${n || e.colors.messageIncoming.background};
|
|
1972
1980
|
`}
|
|
1973
1981
|
padding: 12px 0;
|
|
1974
1982
|
transition: max-width 0.3s;
|
|
1975
1983
|
overflow-wrap: break-word;
|
|
1976
|
-
`,
|
|
1984
|
+
`, Yt = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
1977
1985
|
function Ki(e) {
|
|
1978
|
-
const { stringSet: t } = R(), n =
|
|
1986
|
+
const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Kt, { ...e }) : null;
|
|
1979
1987
|
if (e.messageType === "user")
|
|
1980
1988
|
return n;
|
|
1981
1989
|
if (e.messageType === "file") {
|
|
1982
1990
|
const o = e.file;
|
|
1983
1991
|
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Pi, { ...e }, n) : /* @__PURE__ */ r.createElement(Di, { ...e }, n);
|
|
1984
1992
|
}
|
|
1985
|
-
return /* @__PURE__ */ r.createElement(
|
|
1993
|
+
return /* @__PURE__ */ r.createElement(Kt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
1986
1994
|
}
|
|
1987
|
-
const
|
|
1988
|
-
function
|
|
1989
|
-
return /* @__PURE__ */ r.createElement(Zi, { id: e, tabIndex: 0, onClick: o, $size:
|
|
1995
|
+
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" }));
|
|
1996
|
+
function At({ id: e, src: t, size: n = 56, onClick: o, style: i }) {
|
|
1997
|
+
return /* @__PURE__ */ r.createElement(Zi, { id: e, tabIndex: 0, onClick: o, $size: Y(n), style: i }, t ? /* @__PURE__ */ r.createElement(Yi, { src: t }) : /* @__PURE__ */ r.createElement(O, { type: "user", size: n }));
|
|
1990
1998
|
}
|
|
1991
1999
|
const Zi = 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:${h.themedColor.bg_100_500};&:focus{outline:none;}`, Yi = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
1992
2000
|
function qi({ sender: e, isBotMessage: t }) {
|
|
1993
|
-
const n = `${
|
|
1994
|
-
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Ji, { id: n }, /* @__PURE__ */ r.createElement(
|
|
2001
|
+
const n = `${me}-sender-avatar`;
|
|
2002
|
+
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Ji, { id: n }, /* @__PURE__ */ r.createElement(kt, null)) : /* @__PURE__ */ r.createElement(At, { id: n, size: Je, src: e.profileUrl });
|
|
1995
2003
|
}
|
|
1996
|
-
const Ji = u.div`flex-shrink:0;width:${
|
|
2004
|
+
const Ji = u.div`flex-shrink:0;width:${Je}px;height:${Je}px;box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary};path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}}`;
|
|
1997
2005
|
function Xi({ sender: e }) {
|
|
1998
|
-
return /* @__PURE__ */ r.createElement(Qi, { id: `${
|
|
2006
|
+
return /* @__PURE__ */ r.createElement(Qi, { id: `${me}-sender-name`, variant: "caption1", color: h.themedColor.textMidEmphasis }, e.nickname);
|
|
1999
2007
|
}
|
|
2000
2008
|
const Qi = u(k)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
2001
2009
|
function es({ createdAt: e }) {
|
|
2002
2010
|
const { stringSet: t, format: n } = R();
|
|
2003
|
-
return e ? /* @__PURE__ */ r.createElement(k, { id: `${
|
|
2011
|
+
return e ? /* @__PURE__ */ r.createElement(k, { id: `${me}-sent-time`, variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2004
2012
|
}
|
|
2005
2013
|
function ts({ customStyle: e }) {
|
|
2006
2014
|
return /* @__PURE__ */ r.createElement(ns, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(rs, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
|
|
2007
2015
|
}
|
|
2008
2016
|
const ns = 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};`, rs = 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;}`;
|
|
2009
|
-
function
|
|
2017
|
+
function Le() {
|
|
2010
2018
|
}
|
|
2011
|
-
async function
|
|
2019
|
+
async function zn(e) {
|
|
2012
2020
|
let t = e;
|
|
2013
2021
|
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
2014
2022
|
}
|
|
2015
|
-
function
|
|
2023
|
+
function Vn(e) {
|
|
2016
2024
|
return !e || !e.conversation ? !1 : e.conversation.status === W.CLOSED;
|
|
2017
2025
|
}
|
|
2018
|
-
function
|
|
2026
|
+
function Wn(e) {
|
|
2019
2027
|
return !e || !e.conversation ? !1 : e.conversation.status === W.OPEN;
|
|
2020
2028
|
}
|
|
2021
|
-
function
|
|
2029
|
+
function Gn(e) {
|
|
2022
2030
|
var n;
|
|
2023
2031
|
const t = (n = e == null ? void 0 : e.conversation) == null ? void 0 : n.handoff;
|
|
2024
2032
|
return !!(t != null && t.timestamp);
|
|
2025
2033
|
}
|
|
2026
2034
|
function os(e) {
|
|
2027
|
-
return
|
|
2035
|
+
return Wn(e) && !Gn(e);
|
|
2028
2036
|
}
|
|
2029
2037
|
function is({
|
|
2030
2038
|
extendedMessagePayload: e,
|
|
2031
|
-
onClickCTA: t = ({ url: n }) =>
|
|
2039
|
+
onClickCTA: t = ({ url: n }) => zn(n)
|
|
2032
2040
|
}) {
|
|
2033
2041
|
const n = e == null ? void 0 : e.cta_button;
|
|
2034
|
-
return n ? /* @__PURE__ */ r.createElement(ss, { id: `${
|
|
2042
|
+
return n ? /* @__PURE__ */ r.createElement(ss, { id: `${me}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(as, { variant: "button" }, n.label)) : null;
|
|
2035
2043
|
}
|
|
2036
2044
|
const ss = u.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${h.themedColor.textHighEmphasis};background-color:${h.color.background50};${N.dark`
|
|
2037
2045
|
background-color: ${h.color.ondark.textDisabled};
|
|
@@ -2050,7 +2058,7 @@ class cs extends _r {
|
|
|
2050
2058
|
return { hasError: !0 };
|
|
2051
2059
|
}
|
|
2052
2060
|
render() {
|
|
2053
|
-
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(
|
|
2061
|
+
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(Oe, { fallback: this.props.loadingFallback }, this.props.children);
|
|
2054
2062
|
}
|
|
2055
2063
|
}
|
|
2056
2064
|
const ds = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: us } = jr({
|
|
@@ -2072,7 +2080,7 @@ const hs = ({
|
|
|
2072
2080
|
extendedMessagePayload: e,
|
|
2073
2081
|
onGetCachedMessageTemplate: t = () => null,
|
|
2074
2082
|
onRequestMessageTemplate: n,
|
|
2075
|
-
onHandleTemplateInternalAction: o =
|
|
2083
|
+
onHandleTemplateInternalAction: o = Le
|
|
2076
2084
|
}) => {
|
|
2077
2085
|
const i = e == null ? void 0 : e.message_template;
|
|
2078
2086
|
if (!ds.has((i == null ? void 0 : i.type) ?? "default")) throw new Error("Unsupported template type");
|
|
@@ -2086,7 +2094,7 @@ const hs = ({
|
|
|
2086
2094
|
viewVariables: i == null ? void 0 : i.view_variables,
|
|
2087
2095
|
aiAgentColorVariables: s.aiAgentColorVariables
|
|
2088
2096
|
});
|
|
2089
|
-
return /* @__PURE__ */ r.createElement(gs, { id: `${
|
|
2097
|
+
return /* @__PURE__ */ r.createElement(gs, { id: `${me}-ext-message-template` }, /* @__PURE__ */ r.createElement(
|
|
2090
2098
|
Gr,
|
|
2091
2099
|
{
|
|
2092
2100
|
handleInternalAction: (c, d) => {
|
|
@@ -2101,8 +2109,8 @@ function ps({
|
|
|
2101
2109
|
onClickSuggestedReply: t,
|
|
2102
2110
|
suggestedRepliesDirection: n = "vertical"
|
|
2103
2111
|
}) {
|
|
2104
|
-
const [o, i] =
|
|
2105
|
-
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(fs, { id: `${
|
|
2112
|
+
const [o, i] = S(!1), a = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
2113
|
+
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(fs, { id: `${me}-ext-suggested-replies`, $type: n }, a.map((s, l) => /* @__PURE__ */ r.createElement(
|
|
2106
2114
|
bs,
|
|
2107
2115
|
{
|
|
2108
2116
|
key: l,
|
|
@@ -2115,19 +2123,19 @@ function ps({
|
|
|
2115
2123
|
s
|
|
2116
2124
|
)));
|
|
2117
2125
|
}
|
|
2118
|
-
const fs = u.div`margin:16px 0;padding:0 ${
|
|
2119
|
-
${e === "vertical" ? Cs :
|
|
2126
|
+
const fs = u.div`margin:16px 0;padding:0 ${ie}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? xs : Es};`, bs = u(k)`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:${h.color.primary.main};border:1px solid ${h.color.primary.main};background-color:${h.themedColor.bg_50_600};&:hover{background-color:${h.themedColor.bg_100_500};}${({ $type: e, theme: t }) => $`
|
|
2127
|
+
${e === "vertical" ? Cs : vs};
|
|
2120
2128
|
&:active {
|
|
2121
2129
|
background-color: ${t.colors.base.primary};
|
|
2122
2130
|
color: ${t.colors.base.primaryContrastContent};
|
|
2123
2131
|
}
|
|
2124
2132
|
`}
|
|
2125
|
-
`, xs = $`flex-direction:column;align-items:flex-end;`, Es = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cs = $`max-width:calc(100% - 70px);white-space:pre-wrap;`,
|
|
2126
|
-
function
|
|
2133
|
+
`, xs = $`flex-direction:column;align-items:flex-end;`, Es = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cs = $`max-width:calc(100% - 70px);white-space:pre-wrap;`, vs = $`white-space:nowrap;`;
|
|
2134
|
+
function It(e) {
|
|
2127
2135
|
return e();
|
|
2128
2136
|
}
|
|
2129
2137
|
const _e = we({
|
|
2130
|
-
template:
|
|
2138
|
+
template: ys,
|
|
2131
2139
|
components: {
|
|
2132
2140
|
SenderName: Xi,
|
|
2133
2141
|
SenderAvatar: qi,
|
|
@@ -2140,13 +2148,13 @@ const _e = we({
|
|
|
2140
2148
|
MessageLogs: ls
|
|
2141
2149
|
}
|
|
2142
2150
|
});
|
|
2143
|
-
function
|
|
2144
|
-
return /* @__PURE__ */ r.createElement(
|
|
2151
|
+
function ys(e) {
|
|
2152
|
+
return /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !1 });
|
|
2145
2153
|
}
|
|
2146
|
-
function
|
|
2154
|
+
function jn(e) {
|
|
2147
2155
|
var g, p, x, f;
|
|
2148
|
-
const { components: t } = _e.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((g = e.extendedMessagePayload) != null && g.message_template), a = !!((p = e.extendedMessagePayload) != null && p.cta_button), s = !!e.createdAt, l =
|
|
2149
|
-
return /* @__PURE__ */ r.createElement(_s, { $marginBottom: n ? 0 :
|
|
2156
|
+
const { components: t } = _e.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((g = e.extendedMessagePayload) != null && g.message_template), a = !!((p = e.extendedMessagePayload) != null && p.cta_button), s = !!e.createdAt, l = It(() => e.messageType === "user" ? e.message.length > 0 : !0), c = e.groupType === "top" || e.groupType === "single", d = e.groupType === "bottom" || e.groupType === "single", m = o ? 0 : Je;
|
|
2157
|
+
return /* @__PURE__ */ r.createElement(_s, { $marginBottom: n ? 0 : St(e.groupType) }, c && /* @__PURE__ */ r.createElement(Ss, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, /* @__PURE__ */ r.createElement(ct, { $extraStartPadding: m }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, a && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })))), i && /* @__PURE__ */ r.createElement(qt, { $startPadding: 0, $endPadding: 0, style: { marginTop: l ? ke : 0 } }, /* @__PURE__ */ r.createElement(
|
|
2150
2158
|
t.MessageTemplate,
|
|
2151
2159
|
{
|
|
2152
2160
|
...e,
|
|
@@ -2160,51 +2168,51 @@ function Kn(e) {
|
|
|
2160
2168
|
)),
|
|
2161
2169
|
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(ct, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
|
|
2162
2170
|
}
|
|
2163
|
-
))), d && s && /* @__PURE__ */ r.createElement(Ts, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(
|
|
2171
|
+
))), d && s && /* @__PURE__ */ r.createElement(Ts, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(qt, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
|
|
2164
2172
|
}
|
|
2165
2173
|
const _s = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2166
|
-
`,
|
|
2174
|
+
`, ot = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2167
2175
|
padding-inline: ${e + n}px ${t}px;
|
|
2168
2176
|
`}
|
|
2169
|
-
`, Ss = u(
|
|
2177
|
+
`, Ss = u(ot)`display:flex;flex-direction:row;align-items:center;gap:8px;`, ct = u(ot)`display:flex;`, Ts = u(ot)`margin-top:${Fn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, qt = u(ot)`display:flex;flex-direction:column;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2170
2178
|
padding-inline: ${e + n}px ${t}px;
|
|
2171
2179
|
`}
|
|
2172
2180
|
`;
|
|
2173
2181
|
function ws({ file: e, children: t, onClickFile: n }) {
|
|
2174
2182
|
return /* @__PURE__ */ r.createElement(ks, null, /* @__PURE__ */ r.createElement(
|
|
2175
|
-
|
|
2183
|
+
wt,
|
|
2176
2184
|
{
|
|
2177
2185
|
name: e.name,
|
|
2178
|
-
type:
|
|
2186
|
+
type: Tt(e.name, e.type),
|
|
2179
2187
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
2180
2188
|
}
|
|
2181
2189
|
), t);
|
|
2182
2190
|
}
|
|
2183
|
-
const ks = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`,
|
|
2191
|
+
const ks = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Kn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(As, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(O, { type: "spinner", size: n })), As = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
2184
2192
|
function Is({ file: e, metadata: t, onClickMedia: n, children: o }) {
|
|
2185
|
-
const { aspectRatio: i, localFile: a } = t, [s] =
|
|
2193
|
+
const { aspectRatio: i, localFile: a } = t, [s] = S(() => a instanceof File ? URL.createObjectURL(a) : e.url), [l, c] = S(!1), d = {
|
|
2186
2194
|
onClick: () => n == null ? void 0 : n(e),
|
|
2187
2195
|
$ratio: i
|
|
2188
2196
|
};
|
|
2189
|
-
return /* @__PURE__ */ r.createElement($s, null, /* @__PURE__ */ r.createElement(Ms, { ...d }, !l && /* @__PURE__ */ r.createElement(
|
|
2197
|
+
return /* @__PURE__ */ r.createElement($s, null, /* @__PURE__ */ r.createElement(Ms, { ...d }, !l && /* @__PURE__ */ r.createElement(Kn, { size: 26 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Os, { $loaded: l, src: s, alt: "image-message", onLoad: () => c(!0) })), o);
|
|
2190
2198
|
}
|
|
2191
|
-
const $s = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Ms = u.div`width:${
|
|
2199
|
+
const $s = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Ms = u.div`width:${Be}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;${N.light`
|
|
2192
2200
|
background-color: ${h.color.background100};
|
|
2193
2201
|
`}
|
|
2194
2202
|
${N.dark`
|
|
2195
2203
|
background-color: ${h.color.background400};
|
|
2196
2204
|
`}
|
|
2197
2205
|
`, Os = 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;`;
|
|
2198
|
-
function
|
|
2206
|
+
function Jt(e) {
|
|
2199
2207
|
var n, o;
|
|
2200
|
-
const t =
|
|
2201
|
-
const i = Vi(
|
|
2202
|
-
return
|
|
2208
|
+
const t = ye(() => {
|
|
2209
|
+
const i = Vi(Hn(e.message));
|
|
2210
|
+
return _n.sanitize(i);
|
|
2203
2211
|
}, [e.message]);
|
|
2204
2212
|
return /* @__PURE__ */ r.createElement(
|
|
2205
2213
|
Ls,
|
|
2206
2214
|
{
|
|
2207
|
-
$maxWidth: e.maxBodyWidth ??
|
|
2215
|
+
$maxWidth: e.maxBodyWidth ?? Be,
|
|
2208
2216
|
$color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
|
|
2209
2217
|
$bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
|
|
2210
2218
|
},
|
|
@@ -2220,11 +2228,11 @@ const Ls = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:
|
|
|
2220
2228
|
overflow-wrap: break-word;
|
|
2221
2229
|
`, Rs = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2222
2230
|
function Ds(e) {
|
|
2223
|
-
const { stringSet: t } = R(), n =
|
|
2224
|
-
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Is, { ...e }, n) : /* @__PURE__ */ r.createElement(ws, { ...e }, n) : /* @__PURE__ */ r.createElement(
|
|
2231
|
+
const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Jt, { ...e }) : null;
|
|
2232
|
+
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Is, { ...e }, n) : /* @__PURE__ */ r.createElement(ws, { ...e }, n) : /* @__PURE__ */ r.createElement(Jt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
2225
2233
|
}
|
|
2226
2234
|
function Ns({ sendingStatus: e }) {
|
|
2227
|
-
const t =
|
|
2235
|
+
const t = Et();
|
|
2228
2236
|
switch (e) {
|
|
2229
2237
|
case "pending":
|
|
2230
2238
|
return /* @__PURE__ */ r.createElement(Ps, { size: 16 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
@@ -2237,12 +2245,12 @@ function Ns({ sendingStatus: e }) {
|
|
|
2237
2245
|
return /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(O, { type: "chevron-down" }));
|
|
2238
2246
|
}
|
|
2239
2247
|
}
|
|
2240
|
-
const Ps = u(
|
|
2248
|
+
const Ps = u(Kn)`margin-bottom:2px;width:16px;height:16px;`;
|
|
2241
2249
|
function Bs({ createdAt: e }) {
|
|
2242
2250
|
const { stringSet: t, format: n } = R();
|
|
2243
2251
|
return e ? /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2244
2252
|
}
|
|
2245
|
-
const
|
|
2253
|
+
const $t = we({
|
|
2246
2254
|
template: Fs,
|
|
2247
2255
|
components: {
|
|
2248
2256
|
SendingStatus: Ns,
|
|
@@ -2251,27 +2259,27 @@ const Mt = we({
|
|
|
2251
2259
|
}
|
|
2252
2260
|
});
|
|
2253
2261
|
function Fs(e) {
|
|
2254
|
-
const { components: t } =
|
|
2255
|
-
return /* @__PURE__ */ r.createElement(Us, { $marginBottom:
|
|
2262
|
+
const { components: t } = $t.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
|
|
2263
|
+
return /* @__PURE__ */ r.createElement(Us, { $marginBottom: St(e.groupType) }, /* @__PURE__ */ r.createElement(Hs, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(zs, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
|
|
2256
2264
|
}
|
|
2257
2265
|
const Us = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2258
|
-
`,
|
|
2259
|
-
`, Hs = u(
|
|
2266
|
+
`, Zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = ie, $endPadding: t = ie, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
|
|
2267
|
+
`, Hs = u(Zn)``, zs = u(Zn)`margin-top:${Fn}px;`;
|
|
2260
2268
|
function Vs(e) {
|
|
2261
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ws, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, Gs(
|
|
2269
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ws, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, Gs(_n.sanitize(e.message))));
|
|
2262
2270
|
}
|
|
2263
2271
|
const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Gs = (e) => {
|
|
2264
2272
|
const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, n = [];
|
|
2265
2273
|
let o = 0;
|
|
2266
2274
|
return e.replace(t, (i, a, s, l) => (n.push(e.slice(o, l)), n.push(
|
|
2267
|
-
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel:
|
|
2275
|
+
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel: _t }, a)
|
|
2268
2276
|
), o = l + i.length, i)), n.push(e.slice(o)), n;
|
|
2269
2277
|
}, js = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
|
|
2270
2278
|
const { stringSet: i } = R();
|
|
2271
2279
|
return D(() => {
|
|
2272
2280
|
typeof n > "u" && typeof t == "boolean" && (o == null || o(t));
|
|
2273
2281
|
}, [n, t]), /* @__PURE__ */ r.createElement(Ks, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, i.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
|
|
2274
|
-
|
|
2282
|
+
Xt,
|
|
2275
2283
|
{
|
|
2276
2284
|
checked: n === !0,
|
|
2277
2285
|
label: i.CSAT_CRE_SOLVED,
|
|
@@ -2279,7 +2287,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2279
2287
|
onClick: () => o == null ? void 0 : o(!0)
|
|
2280
2288
|
}
|
|
2281
2289
|
), /* @__PURE__ */ r.createElement(
|
|
2282
|
-
|
|
2290
|
+
Xt,
|
|
2283
2291
|
{
|
|
2284
2292
|
checked: n === !1,
|
|
2285
2293
|
label: i.CSAT_CRE_NOT_SOLVED,
|
|
@@ -2287,7 +2295,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2287
2295
|
onClick: () => o == null ? void 0 : o(!1)
|
|
2288
2296
|
}
|
|
2289
2297
|
)));
|
|
2290
|
-
},
|
|
2298
|
+
}, Xt = ({ onClick: e, checked: t, label: n, disabled: o }) => {
|
|
2291
2299
|
const i = t ? h.color.primary.main : o ? h.themedColor.textDisabled : h.themedColor.textLowEmphasis, a = t ? h.themedColor.textHighEmphasis : o ? h.themedColor.textLowEmphasis : h.themedColor.textHighEmphasis;
|
|
2292
2300
|
return /* @__PURE__ */ r.createElement(Zs, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(O, { size: 24, type: t ? "radio-on" : "radio-off", color: i }), /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: a }, n));
|
|
2293
2301
|
}, Ks = u.div`display:flex;flex-direction:column;gap:8px;`, Zs = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, Ys = (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 })), qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "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" })))), Js = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "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" })), Xs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { 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" })), Qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.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" })), ea = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "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" })), ta = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.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" })), na = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("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" })), 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.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" })), 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("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: {
|
|
@@ -2338,7 +2346,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2338
2346
|
isActive: (e) => 5 <= e,
|
|
2339
2347
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_5
|
|
2340
2348
|
}
|
|
2341
|
-
], sa = () => ia,
|
|
2349
|
+
], sa = () => ia, Yn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(bt, null, t, /* @__PURE__ */ r.createElement(ca, { $position: n }, /* @__PURE__ */ r.createElement(da, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(aa, { $position: n }))), aa = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
2342
2350
|
"svg",
|
|
2343
2351
|
{
|
|
2344
2352
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -2352,9 +2360,9 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2352
2360
|
), la = {
|
|
2353
2361
|
top: $`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
2354
2362
|
bottom: $`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
2355
|
-
}, bt = u.div`position:relative;`, ca = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${
|
|
2363
|
+
}, bt = u.div`position:relative;`, ca = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${be.TOOLTIP};${({ $position: e }) => la[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${bt}:hover &,${bt}:focus-within &{opacity:1;}`, da = u(k)`padding:6px 8px;background:${h.themedColor.textHighEmphasis};color:${h.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, ua = ({ submitted: e, value: t, onChange: n }) => {
|
|
2356
2364
|
const { stringSet: o } = R(), i = sa(), a = typeof t == "number";
|
|
2357
|
-
return /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(ha, null, i.map((s) => /* @__PURE__ */ r.createElement(
|
|
2365
|
+
return /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(ha, null, i.map((s) => /* @__PURE__ */ r.createElement(Yn, { disabled: e, key: s.value, label: s.getTooltip(o) }, /* @__PURE__ */ r.createElement(
|
|
2358
2366
|
ga,
|
|
2359
2367
|
{
|
|
2360
2368
|
disabled: e,
|
|
@@ -2398,7 +2406,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2398
2406
|
const { stringSet: t } = R();
|
|
2399
2407
|
return e ? /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
|
|
2400
2408
|
};
|
|
2401
|
-
var
|
|
2409
|
+
var ne = /* @__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))(ne || {});
|
|
2402
2410
|
const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
2403
2411
|
type: e,
|
|
2404
2412
|
renderSubmitButton: t,
|
|
@@ -2411,8 +2419,8 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
|
2411
2419
|
csat: n,
|
|
2412
2420
|
csatReason: o,
|
|
2413
2421
|
isResolved: i
|
|
2414
|
-
}), l = typeof n == "number" ? "submitted" : (e ===
|
|
2415
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ca, null, /* @__PURE__ */ r.createElement(xa, { ...c }), e ===
|
|
2422
|
+
}), l = typeof n == "number" ? "submitted" : (e === ne.AI_AGENT_CSAT_5 || e === ne.HELPDESK_CSAT_5) && typeof a.csat == "number" || e === ne.AI_AGENT_CSAT_5_WITH_CRE && typeof a.csat == "number" && typeof a.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
|
|
2423
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ca, null, /* @__PURE__ */ r.createElement(xa, { ...c }), e === ne.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
|
|
2416
2424
|
js,
|
|
2417
2425
|
{
|
|
2418
2426
|
...c,
|
|
@@ -2428,23 +2436,23 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
|
2428
2436
|
onChange: (d) => s({ csatReason: d })
|
|
2429
2437
|
}
|
|
2430
2438
|
)), l !== "submitted" && t({ state: l, params: a }));
|
|
2431
|
-
}, Ca = u.div`display:flex;flex-direction:column;gap:12px;`,
|
|
2439
|
+
}, Ca = u.div`display:flex;flex-direction:column;gap:12px;`, va = () => {
|
|
2432
2440
|
const { stringSet: e } = R();
|
|
2433
2441
|
return /* @__PURE__ */ r.createElement(k, { variant: "body2", color: h.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
2434
|
-
},
|
|
2442
|
+
}, ya = (e) => {
|
|
2435
2443
|
if (e.messageType !== "admin.csat")
|
|
2436
2444
|
throw new Error("Invalid message type");
|
|
2437
2445
|
const t = Ur(), { stringSet: n } = R(), { extendedMessagePayload: o, csat: i, csatReason: a, csatExpireAt: s, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: m } = (o == null ? void 0 : o.csat) ?? {};
|
|
2438
|
-
if (!d || !m || !
|
|
2439
|
-
const g = m ===
|
|
2440
|
-
x.csat && !
|
|
2446
|
+
if (!d || !m || !ne[m]) return null;
|
|
2447
|
+
const g = m === ne.AI_AGENT_CSAT_5 || m === ne.AI_AGENT_CSAT_5_WITH_CRE || m === ne.HELPDESK_CSAT_5 ? dt : () => null, p = (x) => {
|
|
2448
|
+
x.csat && !Qt(s) ? c({
|
|
2441
2449
|
csatType: x.csatType,
|
|
2442
2450
|
csat: x.csat,
|
|
2443
2451
|
csatReason: x.csatReason,
|
|
2444
2452
|
isResolved: x.isResolved
|
|
2445
2453
|
}) : t();
|
|
2446
2454
|
};
|
|
2447
|
-
return /* @__PURE__ */ r.createElement(_a, null, !i &&
|
|
2455
|
+
return /* @__PURE__ */ r.createElement(_a, null, !i && Qt(s) ? /* @__PURE__ */ r.createElement(va, null) : /* @__PURE__ */ r.createElement(
|
|
2448
2456
|
g,
|
|
2449
2457
|
{
|
|
2450
2458
|
type: m,
|
|
@@ -2455,21 +2463,21 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
|
2455
2463
|
}
|
|
2456
2464
|
));
|
|
2457
2465
|
}, _a = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Sa = 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:${h.color.primary.dark};}&:disabled{color:${h.color.ondark.textLowEmphasis};background-color:${h.themedColor.textDisabled};cursor:not-allowed;}`;
|
|
2458
|
-
function
|
|
2466
|
+
function Qt(e) {
|
|
2459
2467
|
return !!e && e < Date.now();
|
|
2460
2468
|
}
|
|
2461
|
-
const
|
|
2469
|
+
const Mt = we({
|
|
2462
2470
|
template: Ta,
|
|
2463
2471
|
components: {
|
|
2464
2472
|
AdminMessage: Vs,
|
|
2465
|
-
CSATMessage:
|
|
2473
|
+
CSATMessage: ya
|
|
2466
2474
|
}
|
|
2467
2475
|
});
|
|
2468
2476
|
function Ta(e) {
|
|
2469
|
-
const { components: t } =
|
|
2470
|
-
return /* @__PURE__ */ r.createElement(wa, { $marginBottom:
|
|
2477
|
+
const { components: t } = Mt.useContext(), n = It(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
|
|
2478
|
+
return /* @__PURE__ */ r.createElement(wa, { $marginBottom: St(e.groupType) }, n);
|
|
2471
2479
|
}
|
|
2472
|
-
const wa = u.div`padding-inline:${
|
|
2480
|
+
const wa = u.div`padding-inline:${ie}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, en = {
|
|
2473
2481
|
file: "attach",
|
|
2474
2482
|
snippet: "snippet",
|
|
2475
2483
|
site: "website",
|
|
@@ -2497,10 +2505,10 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2497
2505
|
// Note: This component is used with the dashboard, so cssVars should not be used.
|
|
2498
2506
|
iconColor: p = "#000000",
|
|
2499
2507
|
textColor: x = "#000000",
|
|
2500
|
-
highlightColor: f =
|
|
2508
|
+
highlightColor: f = Ln.DEFAULT_PRIMARY
|
|
2501
2509
|
} = g;
|
|
2502
|
-
return /* @__PURE__ */ r.createElement(
|
|
2503
|
-
|
|
2510
|
+
return /* @__PURE__ */ r.createElement(tn, null, e && /* @__PURE__ */ r.createElement(tn, null, /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "actionbook", color: p })), /* @__PURE__ */ r.createElement(
|
|
2511
|
+
je,
|
|
2504
2512
|
{
|
|
2505
2513
|
$clickable: !!i,
|
|
2506
2514
|
$highlightColor: f,
|
|
@@ -2509,8 +2517,8 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2509
2517
|
onClick: () => i == null ? void 0 : i(e)
|
|
2510
2518
|
},
|
|
2511
2519
|
e.name
|
|
2512
|
-
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(
|
|
2513
|
-
|
|
2520
|
+
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "function", color: p })), /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(
|
|
2521
|
+
je,
|
|
2514
2522
|
{
|
|
2515
2523
|
$clickable: !!i,
|
|
2516
2524
|
$highlightColor: f,
|
|
@@ -2519,11 +2527,11 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2519
2527
|
onClick: () => a == null ? void 0 : a(E)
|
|
2520
2528
|
},
|
|
2521
2529
|
E.name
|
|
2522
|
-
), /* @__PURE__ */ r.createElement(Ia, { role: "button", onClick: () => s == null ? void 0 : s(E) }, /* @__PURE__ */ r.createElement(k, { variant: "body2", color: f }, "View details"), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: f }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.id }, /* @__PURE__ */ r.createElement(
|
|
2523
|
-
default: /* @__PURE__ */ r.createElement(O, { size: 16, type:
|
|
2530
|
+
), /* @__PURE__ */ r.createElement(Ia, { role: "button", onClick: () => s == null ? void 0 : s(E) }, /* @__PURE__ */ r.createElement(k, { variant: "body2", color: f }, "View details"), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: f }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.id }, /* @__PURE__ */ r.createElement(Ke, null, m({
|
|
2531
|
+
default: /* @__PURE__ */ r.createElement(O, { size: 16, type: en[E.source_type] ?? en.snippet, color: p }),
|
|
2524
2532
|
sourceType: E.source_type
|
|
2525
2533
|
})), /* @__PURE__ */ r.createElement(
|
|
2526
|
-
|
|
2534
|
+
je,
|
|
2527
2535
|
{
|
|
2528
2536
|
$clickable: !!l,
|
|
2529
2537
|
$highlightColor: f,
|
|
@@ -2532,8 +2540,8 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2532
2540
|
onClick: () => l == null ? void 0 : l(E)
|
|
2533
2541
|
},
|
|
2534
2542
|
E.preview_title
|
|
2535
|
-
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(
|
|
2536
|
-
|
|
2543
|
+
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "template", color: p })), /* @__PURE__ */ r.createElement(
|
|
2544
|
+
je,
|
|
2537
2545
|
{
|
|
2538
2546
|
$clickable: !!c,
|
|
2539
2547
|
$highlightColor: f,
|
|
@@ -2543,17 +2551,17 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2543
2551
|
},
|
|
2544
2552
|
E.name
|
|
2545
2553
|
))), d);
|
|
2546
|
-
}, Aa = u(k)`font-weight:400;`,
|
|
2554
|
+
}, Aa = u(k)`font-weight:400;`, je = u(Aa)`${({ $clickable: e, $highlightColor: t }) => e && $`
|
|
2547
2555
|
cursor: pointer;
|
|
2548
2556
|
text-decoration: underline;
|
|
2549
2557
|
&:hover {
|
|
2550
2558
|
color: ${t};
|
|
2551
2559
|
}
|
|
2552
2560
|
`}
|
|
2553
|
-
`,
|
|
2561
|
+
`, Ke = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Xe = u.div`display:flex;gap:8px;align-items:center;`, Ia = u(Xe)`cursor:pointer;gap:4px;`, ut = u(Xe)`flex-direction:row;align-items:center;`, tn = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, qn = Te(null);
|
|
2554
2562
|
function $a({ testerType: e, children: t }) {
|
|
2555
2563
|
return /* @__PURE__ */ r.createElement(
|
|
2556
|
-
|
|
2564
|
+
qn.Provider,
|
|
2557
2565
|
{
|
|
2558
2566
|
value: { testerType: e, isActionbookTester: e === "actionbook" }
|
|
2559
2567
|
},
|
|
@@ -2561,14 +2569,14 @@ function $a({ testerType: e, children: t }) {
|
|
|
2561
2569
|
t
|
|
2562
2570
|
);
|
|
2563
2571
|
}
|
|
2564
|
-
const
|
|
2565
|
-
const e =
|
|
2572
|
+
const Fe = () => {
|
|
2573
|
+
const e = re(qn);
|
|
2566
2574
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");
|
|
2567
2575
|
return e;
|
|
2568
2576
|
}, Ma = () => {
|
|
2569
|
-
const { isActionbookTester: e } =
|
|
2577
|
+
const { isActionbookTester: e } = Fe();
|
|
2570
2578
|
return /* @__PURE__ */ r.createElement(_e.Template, { template: e ? Oa : void 0 }, /* @__PURE__ */ r.createElement(_e.MessageLogs, { component: La }));
|
|
2571
|
-
}, Oa = (e) => /* @__PURE__ */ r.createElement(
|
|
2579
|
+
}, Oa = (e) => /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !0, maxBodyWidth: Bn }), La = ({ extendedMessagePayload: e = {} }) => {
|
|
2572
2580
|
const { handlers: t } = P(), { manual: n, groundedness: o, function_calls: i, agent_message_templates: a, is_thinking: s } = e;
|
|
2573
2581
|
return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Ra, null, /* @__PURE__ */ r.createElement(Da, { width: 4 }), /* @__PURE__ */ r.createElement(
|
|
2574
2582
|
ka,
|
|
@@ -2586,7 +2594,7 @@ const Be = () => {
|
|
|
2586
2594
|
bottomContent: /* @__PURE__ */ r.createElement(Na, { variant: "caption2", color: h.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
2587
2595
|
}
|
|
2588
2596
|
));
|
|
2589
|
-
}, Ra = u.div`display:flex;gap:16px;margin:16px ${
|
|
2597
|
+
}, Ra = u.div`display:flex;gap:16px;margin:16px ${ie}px 0;align-self:stretch;`, Da = u.div`width:${({ width: e }) => e}px;background-color:${h.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Na = u(k)`margin-top:5px;`, Pa = ({ publishSynchronous: e = !1 }) => {
|
|
2590
2598
|
const t = /* @__PURE__ */ new Set();
|
|
2591
2599
|
return {
|
|
2592
2600
|
publish: (n) => {
|
|
@@ -2598,18 +2606,18 @@ const Be = () => {
|
|
|
2598
2606
|
};
|
|
2599
2607
|
};
|
|
2600
2608
|
function Ba(e, t = []) {
|
|
2601
|
-
const n = F(null), o = F(0), i = F(0), [a] =
|
|
2602
|
-
return
|
|
2609
|
+
const n = F(null), o = F(0), i = F(0), [a] = S(() => Pa({ publishSynchronous: !0 })), [s, l] = S(!0);
|
|
2610
|
+
return ce(() => {
|
|
2603
2611
|
o.current = 0, i.current = 0, l(!0), n.current && (n.current.scrollTop = n.current.scrollHeight);
|
|
2604
|
-
}, t),
|
|
2612
|
+
}, t), ce(() => a.subscribe(({ type: c, data: d }) => {
|
|
2605
2613
|
const { resolve: m, animated: g } = d ?? {};
|
|
2606
2614
|
if (!n.current) return m == null ? void 0 : m();
|
|
2607
2615
|
if (c === "scrollToBottom" && (n.current.scroll ? n.current.scroll({
|
|
2608
2616
|
top: n.current.scrollHeight,
|
|
2609
|
-
behavior:
|
|
2617
|
+
behavior: nn(e, g)
|
|
2610
2618
|
}) : n.current.scrollTop = n.current.scrollHeight, i.current = 0, l(!0), m == null || m()), c === "scroll") {
|
|
2611
2619
|
const p = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: f, clientHeight: E } = n.current;
|
|
2612
|
-
n.current.scroll ? n.current.scroll({ top: p, behavior:
|
|
2620
|
+
n.current.scroll ? n.current.scroll({ top: p, behavior: nn(e, g) }) : typeof p == "number" && (n.current.scrollTop = p), i.current = Math.max(0, f - x - E), l(i.current === 0), m == null || m();
|
|
2613
2621
|
}
|
|
2614
2622
|
}), [e]), {
|
|
2615
2623
|
scrollRef: n,
|
|
@@ -2620,7 +2628,7 @@ function Ba(e, t = []) {
|
|
|
2620
2628
|
scrollPositionRef: o
|
|
2621
2629
|
};
|
|
2622
2630
|
}
|
|
2623
|
-
function
|
|
2631
|
+
function nn(e, t) {
|
|
2624
2632
|
return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
|
|
2625
2633
|
}
|
|
2626
2634
|
function Fa(e) {
|
|
@@ -2636,12 +2644,12 @@ async function Ua(e) {
|
|
|
2636
2644
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
2637
2645
|
const { width: t, height: n } = await Fa(e.file);
|
|
2638
2646
|
return new Kr({
|
|
2639
|
-
key:
|
|
2647
|
+
key: Jn,
|
|
2640
2648
|
value: [t, n]
|
|
2641
2649
|
});
|
|
2642
2650
|
}
|
|
2643
2651
|
}
|
|
2644
|
-
const
|
|
2652
|
+
const Jn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
2645
2653
|
const { agentPreviewConfigs: t, handlers: n } = P(), o = F(t == null ? void 0 : t.agentAttributes);
|
|
2646
2654
|
return o.current = t == null ? void 0 : t.agentAttributes, {
|
|
2647
2655
|
onBeforeSendMessage: async (i) => {
|
|
@@ -2669,13 +2677,13 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2669
2677
|
onNavigateToConversationList: n,
|
|
2670
2678
|
children: o
|
|
2671
2679
|
}) => {
|
|
2672
|
-
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } =
|
|
2680
|
+
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } = Fe(), c = Ba("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: m } = Ha({
|
|
2673
2681
|
onScrollAfterSendMessage: () => {
|
|
2674
2682
|
c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !1 } });
|
|
2675
2683
|
}
|
|
2676
2684
|
}), g = (x) => {
|
|
2677
2685
|
const f = x[x.length - 1];
|
|
2678
|
-
f &&
|
|
2686
|
+
f && et.shouldScrollToBottom(f, i.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom" }), 25);
|
|
2679
2687
|
}, p = U(async () => {
|
|
2680
2688
|
await s(), e && (t == null || t());
|
|
2681
2689
|
}, [s, e, t]);
|
|
@@ -2698,13 +2706,13 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2698
2706
|
o
|
|
2699
2707
|
)
|
|
2700
2708
|
);
|
|
2701
|
-
},
|
|
2702
|
-
onDrop:
|
|
2703
|
-
subscribe: () =>
|
|
2709
|
+
}, Ot = Te({
|
|
2710
|
+
onDrop: Le,
|
|
2711
|
+
subscribe: () => Le
|
|
2704
2712
|
}), xt = ({ children: e }) => {
|
|
2705
2713
|
const t = F(/* @__PURE__ */ new Set());
|
|
2706
2714
|
return /* @__PURE__ */ r.createElement(
|
|
2707
|
-
|
|
2715
|
+
Ot.Provider,
|
|
2708
2716
|
{
|
|
2709
2717
|
value: {
|
|
2710
2718
|
onDrop: (n) => {
|
|
@@ -2720,21 +2728,21 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2720
2728
|
e
|
|
2721
2729
|
);
|
|
2722
2730
|
}, Ga = ({ onDropFiles: e }) => {
|
|
2723
|
-
const { subscribe: t } =
|
|
2731
|
+
const { subscribe: t } = re(Ot);
|
|
2724
2732
|
D(() => t(e), [e]);
|
|
2725
2733
|
};
|
|
2726
2734
|
xt.Consumer = ({ children: e }) => {
|
|
2727
|
-
const { onDrop: t } =
|
|
2735
|
+
const { onDrop: t } = re(Ot);
|
|
2728
2736
|
return e({ onDrop: t, onDragOver: (i) => i.preventDefault() });
|
|
2729
2737
|
};
|
|
2730
2738
|
const Jd = ({ iconSize: e = 64, icon: t, className: n, label: o, children: i }) => /* @__PURE__ */ r.createElement(Ka, { className: n }, /* @__PURE__ */ r.createElement(O, { type: t, size: e, color: h.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.themedColor.textMidEmphasis }, o), i), ja = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Ka = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Za = {
|
|
2731
|
-
loading: w(() => import("./
|
|
2732
|
-
error: w(() => import("./
|
|
2733
|
-
noChannels: w(() => import("./
|
|
2734
|
-
noMessages: w(() => import("./
|
|
2739
|
+
loading: w(() => import("./U1Hdm8SY.js")),
|
|
2740
|
+
error: w(() => import("./W1TNi6ka.js")),
|
|
2741
|
+
noChannels: w(() => import("./Dp6I-PiX.js")),
|
|
2742
|
+
noMessages: w(() => import("./BJq5dAD1.js"))
|
|
2735
2743
|
}, Se = ({ className: e, type: t = "loading", ...n }) => {
|
|
2736
2744
|
const o = Za[t];
|
|
2737
|
-
return /* @__PURE__ */ r.createElement(ja, { className: e }, /* @__PURE__ */ r.createElement(
|
|
2745
|
+
return /* @__PURE__ */ r.createElement(ja, { className: e }, /* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
|
|
2738
2746
|
};
|
|
2739
2747
|
function Ya(e) {
|
|
2740
2748
|
return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
|
|
@@ -2744,19 +2752,19 @@ const qa = (e, t, n, o = !0) => {
|
|
|
2744
2752
|
return "single";
|
|
2745
2753
|
const i = () => {
|
|
2746
2754
|
if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
|
|
2747
|
-
const c = t.sender.userId === e.sender.userId, d =
|
|
2755
|
+
const c = t.sender.userId === e.sender.userId, d = Ut(t.createdAt, e.createdAt);
|
|
2748
2756
|
return c && d;
|
|
2749
2757
|
}, a = () => {
|
|
2750
2758
|
if (!n || !n.isUserMessage() && !n.isFileMessage()) return !1;
|
|
2751
|
-
const c = n.sender.userId === e.sender.userId, d =
|
|
2759
|
+
const c = n.sender.userId === e.sender.userId, d = Ut(n.createdAt, e.createdAt);
|
|
2752
2760
|
return c && d;
|
|
2753
2761
|
}, s = i(), l = a();
|
|
2754
2762
|
return s && l ? "middle" : s ? "bottom" : l ? "top" : "single";
|
|
2755
2763
|
};
|
|
2756
2764
|
function Ja(e, t) {
|
|
2757
|
-
return e.filter((n) =>
|
|
2765
|
+
return e.filter((n) => et.isWelcomeMessage(n, t));
|
|
2758
2766
|
}
|
|
2759
|
-
function
|
|
2767
|
+
function Xn(e, t) {
|
|
2760
2768
|
return Xa(e) === t;
|
|
2761
2769
|
}
|
|
2762
2770
|
function Xa(e) {
|
|
@@ -2767,81 +2775,60 @@ function Xa(e) {
|
|
|
2767
2775
|
function Qa(e) {
|
|
2768
2776
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
2769
2777
|
}
|
|
2770
|
-
const
|
|
2778
|
+
const rn = (e) => !!e && "sender" in e, Qn = (e) => e.startsWith("image/"), er = (e) => e.startsWith("video/"), on = (e) => Qn(e) || er(e), Ze = {
|
|
2771
2779
|
isAdmin: (e) => e.isAdminMessage(),
|
|
2772
2780
|
isCSAT: (e) => {
|
|
2773
2781
|
var t;
|
|
2774
2782
|
return e.isAdminMessage() && !!((t = e.extendedMessagePayload) != null && t.csat);
|
|
2775
2783
|
},
|
|
2776
|
-
isIncoming: (e, t) =>
|
|
2777
|
-
isOutgoing: (e, t) =>
|
|
2778
|
-
},
|
|
2784
|
+
isIncoming: (e, t) => rn(e) && e.sender.userId !== t,
|
|
2785
|
+
isOutgoing: (e, t) => rn(e) && (e.sender.userId === t || e.sendingStatus === Zr.PENDING)
|
|
2786
|
+
}, tr = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
|
|
2779
2787
|
if (!t) return null;
|
|
2780
|
-
const { rootElement: i } = P(), a =
|
|
2788
|
+
const { rootElement: i } = P(), a = fe(i), s = fe(i, !0);
|
|
2781
2789
|
return qr(
|
|
2782
2790
|
/* @__PURE__ */ r.createElement(el, { onClick: n }, /* @__PURE__ */ r.createElement(tl, { onClick: (l) => l.stopPropagation() }, o)),
|
|
2783
|
-
a.getElementById(e) ?? a.getElementById(
|
|
2791
|
+
a.getElementById(e) ?? a.getElementById(oe.MODAL_ROOT) ?? s.body
|
|
2784
2792
|
);
|
|
2785
|
-
}, el = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${h.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${
|
|
2786
|
-
function
|
|
2793
|
+
}, el = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${h.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${be.MODAL};`, tl = 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:${be.MODAL};`, nl = u.div`flex-shrink:0;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(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;}`, rl = u(kt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
|
|
2794
|
+
function nr({ size: e }) {
|
|
2787
2795
|
const { aiAgentInfo: t } = z();
|
|
2788
|
-
return t.profileUrl ? /* @__PURE__ */ r.createElement(
|
|
2796
|
+
return t.profileUrl ? /* @__PURE__ */ r.createElement(At, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(nl, { $size: e }, /* @__PURE__ */ r.createElement(rl, null));
|
|
2789
2797
|
}
|
|
2790
|
-
const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, il = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, sl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, al = u.div`margin-inline-end:8px;`, ll = 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);}`, cl = 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;}`, dl = u.div`display:flex;width:160px;justify-content:flex-end;`, ul = u.div`inset-inline-end:0;display:flex;flex-direction:row;`,
|
|
2791
|
-
const {
|
|
2798
|
+
const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, il = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, sl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, al = u.div`margin-inline-end:8px;`, ll = 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);}`, cl = 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;}`, dl = u.div`display:flex;width:160px;justify-content:flex-end;`, ul = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, rr = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, ml = u(rr)`border-inline-start:1px solid ${h.themedColor.textDisabled};`, hl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, gl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, pl = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, fl = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, bl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
|
|
2799
|
+
const { type: i, url: a, name: s = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: m } = z();
|
|
2792
2800
|
return /* @__PURE__ */ r.createElement(
|
|
2793
2801
|
El,
|
|
2794
2802
|
{
|
|
2795
|
-
profileUrl:
|
|
2796
|
-
nickname:
|
|
2803
|
+
profileUrl: l ?? "",
|
|
2804
|
+
nickname: c ?? "",
|
|
2797
2805
|
type: i,
|
|
2798
2806
|
url: a,
|
|
2799
2807
|
name: s,
|
|
2800
|
-
onClose:
|
|
2801
|
-
isBotMessage:
|
|
2802
|
-
|
|
2803
|
-
disableDelete: l != null && l.replyCount ? l.replyCount > 0 : !1,
|
|
2804
|
-
onDownloadClick: n
|
|
2808
|
+
onClose: n,
|
|
2809
|
+
isBotMessage: d === m.userId,
|
|
2810
|
+
onDownloadClick: o
|
|
2805
2811
|
}
|
|
2806
2812
|
);
|
|
2807
|
-
}, xl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(
|
|
2813
|
+
}, xl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(nr, { size: 32 }) : /* @__PURE__ */ r.createElement(At, { size: 32, src: e }), El = ({
|
|
2808
2814
|
profileUrl: e,
|
|
2809
2815
|
isBotMessage: t,
|
|
2810
2816
|
nickname: n,
|
|
2811
2817
|
name: o,
|
|
2812
2818
|
type: i,
|
|
2813
2819
|
url: a,
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
onDelete: c,
|
|
2817
|
-
disableDelete: d,
|
|
2818
|
-
onDownloadClick: m
|
|
2820
|
+
onClose: s,
|
|
2821
|
+
onDownloadClick: l
|
|
2819
2822
|
}) => {
|
|
2820
|
-
const { stringSet:
|
|
2821
|
-
return /* @__PURE__ */ r.createElement(
|
|
2822
|
-
Et,
|
|
2823
|
-
{
|
|
2824
|
-
disabled: d,
|
|
2825
|
-
onClick: () => {
|
|
2826
|
-
d || c();
|
|
2827
|
-
}
|
|
2828
|
-
},
|
|
2829
|
-
/* @__PURE__ */ r.createElement(
|
|
2830
|
-
O,
|
|
2831
|
-
{
|
|
2832
|
-
type: "delete",
|
|
2833
|
-
color: d ? "gray" : h.themedColor.textHighEmphasis,
|
|
2834
|
-
size: 24
|
|
2835
|
-
}
|
|
2836
|
-
)
|
|
2837
|
-
)), /* @__PURE__ */ r.createElement(ml, { onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "close", color: h.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(hl, { onClick: (p) => p.currentTarget === p.target && l() }, tr(i) && /* @__PURE__ */ r.createElement(gl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), er(i) && /* @__PURE__ */ r.createElement(pl, { src: a, alt: o }), !sn(i) && /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, g.FILE_VIEWER__UNSUPPORT)))));
|
|
2823
|
+
const { stringSet: c } = R();
|
|
2824
|
+
return /* @__PURE__ */ r.createElement(tr, { onClose: s, visible: !0, rootElementId: oe.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ol, null, /* @__PURE__ */ r.createElement(il, null, /* @__PURE__ */ r.createElement(sl, null, /* @__PURE__ */ r.createElement(al, null, /* @__PURE__ */ r.createElement(xl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(ll, null, /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(cl, null, /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(dl, null, on(i) && /* @__PURE__ */ r.createElement(ul, null, /* @__PURE__ */ r.createElement(rr, { as: "a", href: a, target: "_blank", rel: _t, onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "download", color: h.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(ml, { onClick: s }, /* @__PURE__ */ r.createElement(O, { type: "close", color: h.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(hl, { onClick: (d) => d.currentTarget === d.target && s() }, er(i) && /* @__PURE__ */ r.createElement(gl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), Qn(i) && /* @__PURE__ */ r.createElement(pl, { src: a, alt: o }), !on(i) && /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
|
|
2838
2825
|
}, or = ({
|
|
2839
2826
|
className: e,
|
|
2840
2827
|
locale: t,
|
|
2841
2828
|
date: n = Date.now(),
|
|
2842
2829
|
formatString: o = "MMMM dd, yyyy",
|
|
2843
2830
|
style: i
|
|
2844
|
-
}) => /* @__PURE__ */ r.createElement(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis },
|
|
2831
|
+
}) => /* @__PURE__ */ r.createElement(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), Cl = u.div`display:flex;justify-content:center;align-items:center;`, vl = Re(function(t, n) {
|
|
2845
2832
|
const {
|
|
2846
2833
|
messages: o,
|
|
2847
2834
|
renderMessage: i,
|
|
@@ -2851,28 +2838,28 @@ const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2851
2838
|
onLoadPrev: c,
|
|
2852
2839
|
onLoadNext: d,
|
|
2853
2840
|
loadThreshold: m = 0.05,
|
|
2854
|
-
onScrollPosition: g =
|
|
2841
|
+
onScrollPosition: g = Le,
|
|
2855
2842
|
depsForResetScrollPositionToBottom: p,
|
|
2856
2843
|
scrollPositionRef: x,
|
|
2857
2844
|
scrollDistanceFromBottomRef: f,
|
|
2858
2845
|
stackDirection: E = "top"
|
|
2859
|
-
} = t, b = n && "current" in n ? n : { current: null }, C = F(!1),
|
|
2860
|
-
|
|
2846
|
+
} = t, b = n && "current" in n ? n : { current: null }, C = F(!1), y = F(void 0), T = F(0), _ = F(0), K = F(0), L = x ?? _, se = f ?? K;
|
|
2847
|
+
ce(() => {
|
|
2861
2848
|
b.current && (b.current.scrollTop = b.current.scrollHeight);
|
|
2862
|
-
}, p),
|
|
2863
|
-
b.current && (
|
|
2849
|
+
}, p), ce(() => {
|
|
2850
|
+
b.current && (y.current === "top" && (b.current.scrollTop = b.current.scrollHeight - L.current), y.current === "bottom" && (b.current.scrollTop = T.current), y.current = void 0);
|
|
2864
2851
|
}, [b.current, o.length]);
|
|
2865
2852
|
const xe = async () => {
|
|
2866
2853
|
if (!b.current) return;
|
|
2867
|
-
const
|
|
2868
|
-
if (g(
|
|
2869
|
-
const B =
|
|
2870
|
-
|
|
2854
|
+
const v = b.current;
|
|
2855
|
+
if (g(yl(v)), L.current = v.scrollHeight - v.scrollTop, se.current = L.current - v.clientHeight, T.current = v.scrollTop, C.current) return;
|
|
2856
|
+
const B = v.clientHeight * Math.min(Math.max(0, m), 1);
|
|
2857
|
+
v.scrollTop <= B ? (C.current = !0, y.current = "top", await c(), C.current = !1) : v.scrollHeight - v.scrollTop - v.clientHeight <= B ? (C.current = !0, y.current = "bottom", await d(), C.current = !1) : y.current = void 0;
|
|
2871
2858
|
};
|
|
2872
|
-
return /* @__PURE__ */ r.createElement(_l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Sl, { id: "infinite-list-inner", ref: b, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((
|
|
2873
|
-
}),
|
|
2874
|
-
function
|
|
2875
|
-
return e.scrollTop <=
|
|
2859
|
+
return /* @__PURE__ */ r.createElement(_l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Sl, { id: "infinite-list-inner", ref: b, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((v, B) => i({ message: v, index: B })), s), /* @__PURE__ */ r.createElement(Tl, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(wl, { id: "infinite-list-overlay" }, l)));
|
|
2860
|
+
}), sn = 50;
|
|
2861
|
+
function yl(e) {
|
|
2862
|
+
return e.scrollTop <= sn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= sn ? "bottom" : "middle";
|
|
2876
2863
|
}
|
|
2877
2864
|
const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${h.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Tl = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, wl = u.div`pointer-events:auto;`, kl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Al, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(O, { size: 24, type: "chevron-down", color: h.color.primary.main })), Al = 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);${N.light`
|
|
2878
2865
|
background-color: ${h.color.background50};
|
|
@@ -2897,7 +2884,7 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
|
|
|
2897
2884
|
outline: none;
|
|
2898
2885
|
}
|
|
2899
2886
|
`, ir = () => {
|
|
2900
|
-
const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] =
|
|
2887
|
+
const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] = S([]);
|
|
2901
2888
|
return vn(e, {
|
|
2902
2889
|
onTypingStatusUpdated(i) {
|
|
2903
2890
|
var a;
|
|
@@ -2913,7 +2900,7 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
|
|
|
2913
2900
|
/**
|
|
2914
2901
|
* Returns a list of messages filtered according to business requirements.
|
|
2915
2902
|
*/
|
|
2916
|
-
filteredMessages: c.filter((p) => Qa(p) ? !1 : l.length > 0 ? !
|
|
2903
|
+
filteredMessages: c.filter((p) => Qa(p) ? !1 : l.length > 0 ? !et.isWelcomeMessage(p, t) : !0),
|
|
2917
2904
|
/**
|
|
2918
2905
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
2919
2906
|
*/
|
|
@@ -2957,7 +2944,7 @@ function Ml(e) {
|
|
|
2957
2944
|
return Array.isArray(n) && n.includes(t);
|
|
2958
2945
|
}
|
|
2959
2946
|
const Ol = ({ style: e }) => {
|
|
2960
|
-
const { stringSet: t } = R(), { chatSDK: n } = P(), { isActionbookTester: o } =
|
|
2947
|
+
const { stringSet: t } = R(), { chatSDK: n } = P(), { isActionbookTester: o } = Fe();
|
|
2961
2948
|
return Ml(n) || o ? null : /* @__PURE__ */ r.createElement(Ll, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
|
|
2962
2949
|
Rl,
|
|
2963
2950
|
{
|
|
@@ -2965,7 +2952,7 @@ const Ol = ({ style: e }) => {
|
|
|
2965
2952
|
as: "a",
|
|
2966
2953
|
href: "https://sendbird.com?utm_medium=product&utm_source=aiagent&utm_campaign=fy26-glbl-ai-agent-poweredby",
|
|
2967
2954
|
"aria-label": "Learn more about Sendbird",
|
|
2968
|
-
rel:
|
|
2955
|
+
rel: _t,
|
|
2969
2956
|
target: "_blank"
|
|
2970
2957
|
},
|
|
2971
2958
|
"Sendbird"
|
|
@@ -2976,8 +2963,8 @@ const Ol = ({ style: e }) => {
|
|
|
2976
2963
|
text-decoration: none;
|
|
2977
2964
|
`, Dl = () => {
|
|
2978
2965
|
var c;
|
|
2979
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = q(), a =
|
|
2980
|
-
return
|
|
2966
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = q(), a = Vn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && a;
|
|
2967
|
+
return ce(() => {
|
|
2981
2968
|
l && i.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2982
2969
|
}, [l]), l ? /* @__PURE__ */ r.createElement(Nl, null, /* @__PURE__ */ r.createElement(
|
|
2983
2970
|
Pl,
|
|
@@ -2990,32 +2977,32 @@ const Ol = ({ style: e }) => {
|
|
|
2990
2977
|
e.START_NEW_CONVERSATION
|
|
2991
2978
|
)) : null;
|
|
2992
2979
|
}, Nl = u.div`display:flex;justify-content:center;margin:16px 0;`, Pl = u(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${h.themedColor.textDisabled};cursor:pointer;user-select:none;`, Bl = !0, Fl = () => {
|
|
2993
|
-
const { Template: e } =
|
|
2994
|
-
const
|
|
2995
|
-
if (!
|
|
2996
|
-
const B =
|
|
2997
|
-
return { user: B ? s :
|
|
2980
|
+
const { Template: e } = $t.useContext(), { Template: t } = _e.useContext(), { Template: n } = Mt.useContext(), [o, i] = S(null), { userSession: a, aiAgentInfo: s } = z(), { agentPreviewConfigs: l, chatSDK: c, state: d } = P(), { stringSet: m, dateLocale: g } = R(), { conversation: p, channelSource: x, messageSource: f, scrollSource: E } = q(), { isActionbookTester: b } = Fe(), { filteredMessages: C, shouldShowOriginalDate: y, renderAgentPreviewWelcomeMessages: T } = Il(), { storage: _ } = $n(), K = ir(), L = It(() => {
|
|
2981
|
+
const v = K[0];
|
|
2982
|
+
if (!v) return null;
|
|
2983
|
+
const B = v.userId === s.userId;
|
|
2984
|
+
return { user: B ? s : v, isBot: B };
|
|
2998
2985
|
});
|
|
2999
2986
|
D(() => {
|
|
3000
2987
|
L && E.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
3001
2988
|
}, [!!L, E.scrollPubSub.publish]);
|
|
3002
|
-
const
|
|
2989
|
+
const se = (v, B = !1) => {
|
|
3003
2990
|
var Ee;
|
|
3004
|
-
return B ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((J) => J.userId ===
|
|
2991
|
+
return B ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((J) => J.userId === v.sender.userId)) ?? v.sender;
|
|
3005
2992
|
}, xe = () => {
|
|
3006
2993
|
if (!f.initialized)
|
|
3007
2994
|
return /* @__PURE__ */ r.createElement(Se, { type: "loading" });
|
|
3008
2995
|
if (f.messages.length === 0) {
|
|
3009
|
-
const
|
|
3010
|
-
return
|
|
2996
|
+
const v = T();
|
|
2997
|
+
return v ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, v) : /* @__PURE__ */ r.createElement(Se, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
|
|
3011
2998
|
}
|
|
3012
2999
|
return /* @__PURE__ */ r.createElement(
|
|
3013
|
-
|
|
3000
|
+
vl,
|
|
3014
3001
|
{
|
|
3015
3002
|
ref: E.scrollRef,
|
|
3016
3003
|
scrollPositionRef: E.scrollPositionRef,
|
|
3017
3004
|
scrollDistanceFromBottomRef: E.scrollDistanceFromBottomRef,
|
|
3018
|
-
onScrollPosition: (
|
|
3005
|
+
onScrollPosition: (v) => E.setIsScrollBottomReached(v === "bottom"),
|
|
3019
3006
|
stackDirection: l == null ? void 0 : l.messageStackDirection,
|
|
3020
3007
|
messages: C,
|
|
3021
3008
|
onLoadPrev: f.loadPrevious,
|
|
@@ -3034,102 +3021,102 @@ const Ol = ({ style: e }) => {
|
|
|
3034
3021
|
}
|
|
3035
3022
|
), /* @__PURE__ */ r.createElement(Dl, null)),
|
|
3036
3023
|
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(Hl, { onClick: () => E.scrollPubSub.publish({ type: "scrollToBottom" }) })),
|
|
3037
|
-
renderMessage: ({ message:
|
|
3038
|
-
const Ee = Ya(
|
|
3039
|
-
|
|
3024
|
+
renderMessage: ({ message: v, index: B }) => {
|
|
3025
|
+
const Ee = Ya(v), J = C[B - 1], Ae = C[B + 1], it = C[C.length - 1], st = v === it, A = qa(v, J, Ae, Bl), I = !Yr((J == null ? void 0 : J.createdAt) ?? 0, v.createdAt) && y(B) && !b, M = (X) => {
|
|
3026
|
+
(v.isFileMessage() || v.isUserMessage()) && i({ file: X, sender: se(v, v.sender.userId === s.userId) });
|
|
3040
3027
|
}, H = () => {
|
|
3041
|
-
|
|
3028
|
+
v.isFileMessage() && zn(v.url);
|
|
3042
3029
|
}, Ce = I ? /* @__PURE__ */ r.createElement(
|
|
3043
3030
|
or,
|
|
3044
3031
|
{
|
|
3045
3032
|
style: { margin: "16px 0" },
|
|
3046
|
-
date:
|
|
3033
|
+
date: v.createdAt,
|
|
3047
3034
|
locale: g,
|
|
3048
3035
|
formatString: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
3049
3036
|
}
|
|
3050
|
-
) : null,
|
|
3051
|
-
maxBodyWidth: d.expanded ?
|
|
3052
|
-
extendedMessagePayload:
|
|
3053
|
-
createdAt:
|
|
3037
|
+
) : null, ae = {
|
|
3038
|
+
maxBodyWidth: d.expanded ? Bn : void 0,
|
|
3039
|
+
extendedMessagePayload: v.extendedMessagePayload,
|
|
3040
|
+
createdAt: v.createdAt,
|
|
3054
3041
|
groupType: A,
|
|
3055
3042
|
onClickMedia: M,
|
|
3056
3043
|
onClickFile: H
|
|
3057
|
-
},
|
|
3058
|
-
var
|
|
3059
|
-
if (
|
|
3060
|
-
return
|
|
3044
|
+
}, Z = (() => {
|
|
3045
|
+
var X, ee;
|
|
3046
|
+
if (Ze.isAdmin(v))
|
|
3047
|
+
return Ze.isCSAT(v) ? p ? /* @__PURE__ */ r.createElement(
|
|
3061
3048
|
n,
|
|
3062
3049
|
{
|
|
3063
|
-
...
|
|
3050
|
+
...ae,
|
|
3064
3051
|
...p,
|
|
3065
3052
|
isResolvedWhenDeterminedByUser: zl(p),
|
|
3066
3053
|
messageType: "admin.csat",
|
|
3067
|
-
onSubmitCSAT: ({ csat: G, csatType:
|
|
3068
|
-
var
|
|
3069
|
-
G && ((
|
|
3054
|
+
onSubmitCSAT: ({ csat: G, csatType: he, csatReason: V, isResolved: le }) => {
|
|
3055
|
+
var ge;
|
|
3056
|
+
G && ((ge = x.channel) == null || ge.submitCSAT({ csat: G, csatType: he, csatReason: V, isResolved: le }));
|
|
3070
3057
|
}
|
|
3071
3058
|
}
|
|
3072
|
-
) : null : /* @__PURE__ */ r.createElement(n, { ...
|
|
3073
|
-
if (
|
|
3059
|
+
) : null : /* @__PURE__ */ r.createElement(n, { ...ae, messageType: "admin", message: v.message });
|
|
3060
|
+
if (Ze.isOutgoing(v, a.userId)) {
|
|
3074
3061
|
const G = {
|
|
3075
|
-
...
|
|
3076
|
-
message:
|
|
3077
|
-
sender:
|
|
3078
|
-
sendingStatus:
|
|
3062
|
+
...ae,
|
|
3063
|
+
message: v.message,
|
|
3064
|
+
sender: se(v),
|
|
3065
|
+
sendingStatus: v.sendingStatus
|
|
3079
3066
|
};
|
|
3080
|
-
if (
|
|
3067
|
+
if (v.isUserMessage())
|
|
3081
3068
|
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...G });
|
|
3082
|
-
if (
|
|
3083
|
-
const [
|
|
3069
|
+
if (v.isFileMessage()) {
|
|
3070
|
+
const [he, V] = ((X = v.metaArrays.find((le) => le.key === Jn)) == null ? void 0 : X.value) ?? [];
|
|
3084
3071
|
return /* @__PURE__ */ r.createElement(
|
|
3085
3072
|
e,
|
|
3086
3073
|
{
|
|
3087
3074
|
messageType: "file",
|
|
3088
|
-
file:
|
|
3075
|
+
file: v,
|
|
3089
3076
|
metadata: {
|
|
3090
|
-
aspectRatio:
|
|
3091
|
-
localFile: (
|
|
3077
|
+
aspectRatio: he && V ? `${he}/${V}` : "1/1",
|
|
3078
|
+
localFile: (ee = v.messageParams) == null ? void 0 : ee.file
|
|
3092
3079
|
},
|
|
3093
3080
|
...G
|
|
3094
3081
|
}
|
|
3095
3082
|
);
|
|
3096
3083
|
}
|
|
3097
3084
|
}
|
|
3098
|
-
if (
|
|
3099
|
-
const G =
|
|
3100
|
-
...
|
|
3101
|
-
sender:
|
|
3102
|
-
message:
|
|
3103
|
-
suggestedRepliesVisible:
|
|
3085
|
+
if (Ze.isIncoming(v, a.userId)) {
|
|
3086
|
+
const G = v.sender.userId === s.userId, he = {
|
|
3087
|
+
...ae,
|
|
3088
|
+
sender: se(v, G),
|
|
3089
|
+
message: v.message,
|
|
3090
|
+
suggestedRepliesVisible: st,
|
|
3104
3091
|
suggestedRepliesDirection: l == null ? void 0 : l.suggestedRepliesDirection,
|
|
3105
3092
|
isBotMessage: G,
|
|
3106
3093
|
onClickSuggestedReply: async ({ reply: V }) => {
|
|
3107
3094
|
f.sendUserMessage({ message: V });
|
|
3108
3095
|
},
|
|
3109
3096
|
onRequestMessageTemplate: async (V) => {
|
|
3110
|
-
const { template:
|
|
3111
|
-
return
|
|
3097
|
+
const { template: le } = await c.aiAgent.getMessageTemplate(V);
|
|
3098
|
+
return _.setTemplate(V, le), le;
|
|
3112
3099
|
},
|
|
3113
|
-
onGetCachedMessageTemplate: (V) =>
|
|
3100
|
+
onGetCachedMessageTemplate: (V) => _.getTemplate(V),
|
|
3114
3101
|
onHandleTemplateInternalAction: (V) => {
|
|
3115
3102
|
if (V.type === "internal" && V.internalData) {
|
|
3116
|
-
const { method:
|
|
3117
|
-
|
|
3103
|
+
const { method: le, payload: ge } = V.internalData;
|
|
3104
|
+
le === "message.send" && (ge != null && ge.message) && f.sendUserMessage({ message: ge.message });
|
|
3118
3105
|
}
|
|
3119
3106
|
}
|
|
3120
3107
|
};
|
|
3121
|
-
if (
|
|
3122
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...
|
|
3123
|
-
if (
|
|
3124
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file:
|
|
3108
|
+
if (v.isUserMessage())
|
|
3109
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...he });
|
|
3110
|
+
if (v.isFileMessage())
|
|
3111
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: v, ...he });
|
|
3125
3112
|
}
|
|
3126
3113
|
})();
|
|
3127
|
-
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${
|
|
3114
|
+
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${Q}-message-item` }, Ce, Z);
|
|
3128
3115
|
}
|
|
3129
3116
|
}
|
|
3130
3117
|
);
|
|
3131
3118
|
};
|
|
3132
|
-
return /* @__PURE__ */ r.createElement(Ul, { id: `${
|
|
3119
|
+
return /* @__PURE__ */ r.createElement(Ul, { id: `${Q}-message-list` }, xe(), o && /* @__PURE__ */ r.createElement(bl, { onClose: () => i(null), sender: o.sender, file: o.file }));
|
|
3133
3120
|
}, Ul = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Hl = u(kl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
|
|
3134
3121
|
function zl(e) {
|
|
3135
3122
|
var t;
|
|
@@ -3144,7 +3131,7 @@ const Vl = () => {
|
|
|
3144
3131
|
}
|
|
3145
3132
|
return n.channel ? /* @__PURE__ */ r.createElement(Fl, null) : /* @__PURE__ */ r.createElement(Se, { type: "loading" });
|
|
3146
3133
|
}, sr = () => {
|
|
3147
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] =
|
|
3134
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] = S(() => (t == null ? void 0 : t.status) === W.OPEN);
|
|
3148
3135
|
return n ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
|
|
3149
3136
|
}, Wl = () => {
|
|
3150
3137
|
const { stringSet: e } = R(), { goToActiveConversation: t } = q(), n = sr();
|
|
@@ -3162,13 +3149,13 @@ const Vl = () => {
|
|
|
3162
3149
|
background-color: ${h.color.background700};
|
|
3163
3150
|
`}
|
|
3164
3151
|
`, ar = Te(void 0), Kl = ({ children: e }) => {
|
|
3165
|
-
const { stringSet: t } = R(), { aiAgentInfo: n } = z(), { channelSource: o } = q(), [i, a] =
|
|
3152
|
+
const { stringSet: t } = R(), { aiAgentInfo: n } = z(), { channelSource: o } = q(), [i, a] = S([]), [s, l] = S({
|
|
3166
3153
|
visible: !1,
|
|
3167
3154
|
title: "",
|
|
3168
3155
|
buttonText: t.BUTTON__OK
|
|
3169
|
-
}), c = (n == null ? void 0 : n.replyToFile) ||
|
|
3156
|
+
}), c = (n == null ? void 0 : n.replyToFile) || Gn(o.channel), d = (p) => {
|
|
3170
3157
|
if (!c) return;
|
|
3171
|
-
const x = p.filter((f) =>
|
|
3158
|
+
const x = p.filter((f) => Dn.includes(f.type));
|
|
3172
3159
|
if (x.length !== 0) {
|
|
3173
3160
|
if (x.some((f) => f.size > mi)) {
|
|
3174
3161
|
l((f) => ({
|
|
@@ -3217,8 +3204,8 @@ const Vl = () => {
|
|
|
3217
3204
|
e,
|
|
3218
3205
|
/* @__PURE__ */ r.createElement(Zl, { ...s, onClose: () => l((p) => ({ ...p, visible: !1, title: "" })) })
|
|
3219
3206
|
);
|
|
3220
|
-
},
|
|
3221
|
-
const e =
|
|
3207
|
+
}, Lt = () => {
|
|
3208
|
+
const e = re(ar);
|
|
3222
3209
|
if (!e)
|
|
3223
3210
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
3224
3211
|
return e;
|
|
@@ -3227,10 +3214,10 @@ const Vl = () => {
|
|
|
3227
3214
|
buttonText: t,
|
|
3228
3215
|
visible: n,
|
|
3229
3216
|
onClose: o
|
|
3230
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
3217
|
+
}) => /* @__PURE__ */ r.createElement(tr, { rootElementId: oe.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(Yl, null, /* @__PURE__ */ r.createElement(Jl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(ql, null, /* @__PURE__ */ r.createElement(Xl, { onClick: o }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: h.themedColor.textHighEmphasisInverse }, t))))), Yl = 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};`, ql = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, Jl = u.div`margin-bottom:16px;`, Xl = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${h.themedColor.error};border:1px solid ${h.themedColor.error};padding:10px 16px;&:hover{background-color:${h.color.error.dark};border-color:${h.color.error.dark};}&:active{background-color:${h.color.error.extraDark};}`;
|
|
3231
3218
|
function Ql({ blurred: e, elementRef: t, document: n = window.document }) {
|
|
3232
3219
|
const o = F(!1);
|
|
3233
|
-
e && t.current && n.activeElement === t.current && (o.current = !0),
|
|
3220
|
+
e && t.current && n.activeElement === t.current && (o.current = !0), ce(() => {
|
|
3234
3221
|
var i;
|
|
3235
3222
|
!e && o.current && ((i = t.current) == null || i.focus(), o.current = !1);
|
|
3236
3223
|
}, [e]);
|
|
@@ -3255,18 +3242,18 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3255
3242
|
stroke: ${h.themedColor.bg_50_600};
|
|
3256
3243
|
}
|
|
3257
3244
|
`, rc = () => {
|
|
3258
|
-
const e =
|
|
3259
|
-
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(ec, null, o.map(({ preview: { type: s, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(tc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(nc, { title: "Remove file", onClick: () => i(d) }, /* @__PURE__ */ r.createElement(O, { type: "close-filled", color: h.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(
|
|
3245
|
+
const e = Pe(), [t, n] = S(), { files: o, removeFile: i, isFileUploadEnabled: a } = Lt();
|
|
3246
|
+
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(ec, null, o.map(({ preview: { type: s, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(tc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(nc, { title: "Remove file", onClick: () => i(d) }, /* @__PURE__ */ r.createElement(O, { type: "close-filled", color: h.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(wt, { name: l, type: Tt(l, s) }))));
|
|
3260
3247
|
}, oc = ({ channel: e, messages: t }) => {
|
|
3261
3248
|
const { stringSet: n } = R(), { aiAgentInfo: o } = z(), i = ic(), a = sc({
|
|
3262
3249
|
lastMessage: t[t.length - 1],
|
|
3263
3250
|
aiAgentUserId: o.userId
|
|
3264
3251
|
});
|
|
3265
|
-
return !e || !i ||
|
|
3252
|
+
return !e || !i || Vn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : a ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
|
|
3266
3253
|
}, ic = () => {
|
|
3267
|
-
const e =
|
|
3254
|
+
const e = bn(), { chatSDK: t } = P(), [n, o] = S(!0);
|
|
3268
3255
|
return D(() => {
|
|
3269
|
-
const i = new
|
|
3256
|
+
const i = new Qe({
|
|
3270
3257
|
onDisconnected: () => o(!1),
|
|
3271
3258
|
onConnected: () => o(!0),
|
|
3272
3259
|
onReconnectSucceeded: () => o(!0)
|
|
@@ -3279,17 +3266,17 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3279
3266
|
lastMessage: e,
|
|
3280
3267
|
aiAgentUserId: t
|
|
3281
3268
|
}) => {
|
|
3282
|
-
const [n, o] =
|
|
3269
|
+
const [n, o] = S(!1), i = ir();
|
|
3283
3270
|
return D(() => {
|
|
3284
3271
|
if (!e) return;
|
|
3285
|
-
const a = i.some((l) => l.userId === t), s =
|
|
3272
|
+
const a = i.some((l) => l.userId === t), s = Xn(e, t) && et.isStreaming(e);
|
|
3286
3273
|
o(!!(s || a));
|
|
3287
3274
|
}, [i, e, t]), n;
|
|
3288
3275
|
}, lr = {
|
|
3289
3276
|
textArea: $`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
3290
3277
|
attachIcon: $`margin-bottom:4px;`
|
|
3291
|
-
}, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${
|
|
3292
|
-
const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } =
|
|
3278
|
+
}, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${yt && lr.attachIcon};`, lc = u.input`display:none;`, an = u.div`width:100%;position:relative;background-color:${h.themedColor.bg_100_500};border-radius:20px;`, ln = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, cn = 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:${h.themedColor.textHighEmphasis};resize:none;width:100%;height:${Rn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${yt && lr.textArea};&::placeholder{color:${h.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${h.themedColor.textDisabled};}}`, dn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, un = ({ disabled: e }) => {
|
|
3279
|
+
const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } = Lt();
|
|
3293
3280
|
return !a || i.length > 0 ? null : /* @__PURE__ */ r.createElement(
|
|
3294
3281
|
ac,
|
|
3295
3282
|
{
|
|
@@ -3316,43 +3303,43 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3316
3303
|
const l = s.currentTarget.files;
|
|
3317
3304
|
l && n(Array.from(l)), s.target.value = "";
|
|
3318
3305
|
},
|
|
3319
|
-
accept:
|
|
3306
|
+
accept: Dn.join(",")
|
|
3320
3307
|
}
|
|
3321
3308
|
)
|
|
3322
3309
|
);
|
|
3323
3310
|
}, cc = () => {
|
|
3324
|
-
const e = F(null), [t, n] =
|
|
3311
|
+
const e = F(null), [t, n] = S(""), { rootElement: o } = P(), { channelSource: i, messageSource: a } = q(), [s, l] = oc({
|
|
3325
3312
|
channel: i.channel,
|
|
3326
3313
|
messages: a.messages
|
|
3327
|
-
}), { files: c, addFiles: d, clearFiles: m } =
|
|
3328
|
-
Ga({ onDropFiles: d }), Ql({ blurred: s, elementRef: e, document:
|
|
3314
|
+
}), { files: c, addFiles: d, clearFiles: m } = Lt();
|
|
3315
|
+
Ga({ onDropFiles: d }), Ql({ blurred: s, elementRef: e, document: fe(o) });
|
|
3329
3316
|
const g = t.trim().length > 0, p = c.length > 0, x = !s && (g || p), f = () => {
|
|
3330
3317
|
e.current && (e.current.value = "", e.current.style.height = ""), m(), n("");
|
|
3331
3318
|
}, E = async () => {
|
|
3332
|
-
const T = t.trim(),
|
|
3319
|
+
const T = t.trim(), _ = { message: T };
|
|
3333
3320
|
if (!(!T && !c.length)) {
|
|
3334
3321
|
if (c.length > 0) {
|
|
3335
|
-
const
|
|
3322
|
+
const K = c[0].file, L = { ..._, file: K };
|
|
3336
3323
|
a.sendFileMessage(L), f();
|
|
3337
3324
|
return;
|
|
3338
3325
|
}
|
|
3339
|
-
a.sendUserMessage(
|
|
3326
|
+
a.sendUserMessage(_), f();
|
|
3340
3327
|
}
|
|
3341
3328
|
}, b = (T) => {
|
|
3342
|
-
const
|
|
3343
|
-
|
|
3329
|
+
const _ = Array.from(T.clipboardData.files);
|
|
3330
|
+
_.length > 0 && (T.preventDefault(), d(_));
|
|
3344
3331
|
}, C = (T) => {
|
|
3345
3332
|
T.key !== "Enter" || T.nativeEvent.isComposing || T.shiftKey || (T.preventDefault(), E());
|
|
3346
|
-
},
|
|
3333
|
+
}, y = (T) => {
|
|
3347
3334
|
if (e.current) {
|
|
3348
3335
|
e.current.style.height = "";
|
|
3349
|
-
const
|
|
3350
|
-
|
|
3336
|
+
const _ = Math.min(ui, e.current.scrollHeight);
|
|
3337
|
+
Rn < _ && (e.current.style.height = `${_}px`);
|
|
3351
3338
|
}
|
|
3352
3339
|
n(T.target.value);
|
|
3353
3340
|
};
|
|
3354
|
-
return s ? /* @__PURE__ */ r.createElement(
|
|
3355
|
-
|
|
3341
|
+
return s ? /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(cn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(un, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(rc, null), /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(
|
|
3342
|
+
cn,
|
|
3356
3343
|
{
|
|
3357
3344
|
ref: e,
|
|
3358
3345
|
role: "textbox",
|
|
@@ -3360,10 +3347,10 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3360
3347
|
placeholder: l,
|
|
3361
3348
|
maxLength: 5e3,
|
|
3362
3349
|
onKeyDown: C,
|
|
3363
|
-
onChange:
|
|
3350
|
+
onChange: y,
|
|
3364
3351
|
onPaste: b
|
|
3365
3352
|
}
|
|
3366
|
-
), /* @__PURE__ */ r.createElement(
|
|
3353
|
+
), /* @__PURE__ */ r.createElement(un, null))), x && /* @__PURE__ */ r.createElement(cr, { onClick: () => E() }, /* @__PURE__ */ r.createElement(O, { type: "send", color: h.color.primary.main, size: 20 })));
|
|
3367
3354
|
}, dc = 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:${h.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${N.light`
|
|
3368
3355
|
color: ${h.color.information.light};
|
|
3369
3356
|
`};
|
|
@@ -3371,16 +3358,16 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3371
3358
|
color: ${h.color.information.main};
|
|
3372
3359
|
`};
|
|
3373
3360
|
}
|
|
3374
|
-
`, uc = w(() => import("./
|
|
3361
|
+
`, uc = w(() => import("./cJuIRXXl.js").then((e) => ({ default: e.MarkdownText }))), mc = () => {
|
|
3375
3362
|
const { aiAgentInfo: e } = z(), { messageSource: t } = q(), { userSession: n } = z();
|
|
3376
|
-
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) =>
|
|
3363
|
+
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) => Xn(i, n.userId))) ? null : /* @__PURE__ */ r.createElement(dc, null, /* @__PURE__ */ r.createElement(uc, null, e.specialNotice));
|
|
3377
3364
|
}, hc = () => /* @__PURE__ */ r.createElement(gc, null, /* @__PURE__ */ r.createElement(mc, null), /* @__PURE__ */ r.createElement(Kl, null, /* @__PURE__ */ r.createElement(cc, null))), gc = u.div`z-index:0;border:none;width:100%;`, pc = () => {
|
|
3378
3365
|
var a, s, l;
|
|
3379
3366
|
const { activeChannel: e } = z(), { channelSource: t } = q(), n = ((s = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : s.status) === W.CLOSED;
|
|
3380
3367
|
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Wl, null) : /* @__PURE__ */ r.createElement(hc, null);
|
|
3381
3368
|
}, fc = () => {
|
|
3382
|
-
var
|
|
3383
|
-
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p =
|
|
3369
|
+
var y;
|
|
3370
|
+
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p = Pe() ? 24 : 16, x = () => {
|
|
3384
3371
|
e.setOpened(!1);
|
|
3385
3372
|
}, f = async () => {
|
|
3386
3373
|
try {
|
|
@@ -3391,8 +3378,8 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3391
3378
|
}
|
|
3392
3379
|
}, E = async () => {
|
|
3393
3380
|
m && await i.send(ao.CloseConversation({ channelUrl: m.url }));
|
|
3394
|
-
}, b = l && (m == null ? void 0 : m.url) === l.url, C = s.showHandoffButton && !!((
|
|
3395
|
-
return /* @__PURE__ */ r.createElement(
|
|
3381
|
+
}, b = l && (m == null ? void 0 : m.url) === l.url, C = s.showHandoffButton && !!((y = m == null ? void 0 : m.conversation) != null && y.handoff) && b;
|
|
3382
|
+
return /* @__PURE__ */ r.createElement(vc, null, /* @__PURE__ */ r.createElement(yc, null, d && /* @__PURE__ */ r.createElement(Ue, { onClick: () => d() }, /* @__PURE__ */ r.createElement(O, { type: "menu", size: 24, color: h.themedColor.textHighEmphasis })), b && /* @__PURE__ */ r.createElement(nr, { size: 34 }), /* @__PURE__ */ r.createElement(Sc, { variant: "h2", color: h.themedColor.textHighEmphasis }, s.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ r.createElement(_c, null, C && /* @__PURE__ */ r.createElement(
|
|
3396
3383
|
Cc,
|
|
3397
3384
|
{
|
|
3398
3385
|
tooltipLabel: a.HEADER_BUTTON__AGENT_HANDOFF,
|
|
@@ -3403,38 +3390,38 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3403
3390
|
), n && /* @__PURE__ */ r.createElement(
|
|
3404
3391
|
Ec,
|
|
3405
3392
|
{
|
|
3406
|
-
disabled: !
|
|
3393
|
+
disabled: !Wn(m),
|
|
3407
3394
|
size: p,
|
|
3408
3395
|
onClick: E
|
|
3409
3396
|
}
|
|
3410
3397
|
), o && /* @__PURE__ */ r.createElement(bc, { size: p }), /* @__PURE__ */ r.createElement(xc, { size: p, onClick: x })));
|
|
3411
3398
|
}, bc = ({ size: e, disabled: t }) => {
|
|
3412
3399
|
const { state: n } = P();
|
|
3413
|
-
return /* @__PURE__ */ r.createElement(
|
|
3414
|
-
}, xc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(
|
|
3400
|
+
return /* @__PURE__ */ r.createElement(Ue, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(O, { type: n.expanded ? "collapse" : "expand", size: e, color: h.themedColor.textHighEmphasis }));
|
|
3401
|
+
}, xc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(O, { type: "close", size: e, color: h.themedColor.textHighEmphasis })), Ec = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
|
|
3415
3402
|
O,
|
|
3416
3403
|
{
|
|
3417
3404
|
type: "refresh",
|
|
3418
3405
|
size: e,
|
|
3419
3406
|
color: t ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
|
|
3420
3407
|
}
|
|
3421
|
-
)), Cc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(
|
|
3408
|
+
)), Cc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Yn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(Ue, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
|
|
3422
3409
|
O,
|
|
3423
3410
|
{
|
|
3424
3411
|
type: "agent",
|
|
3425
3412
|
size: e,
|
|
3426
3413
|
color: n ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
|
|
3427
3414
|
}
|
|
3428
|
-
))),
|
|
3429
|
-
const { isActionbookTester: e } =
|
|
3415
|
+
))), vc = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, yc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, _c = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Sc = u(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ue = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Tc = () => {
|
|
3416
|
+
const { isActionbookTester: e } = Fe();
|
|
3430
3417
|
return e ? null : /* @__PURE__ */ r.createElement(fc, null);
|
|
3431
|
-
},
|
|
3418
|
+
}, mn = ({
|
|
3432
3419
|
children: e,
|
|
3433
3420
|
onNavigateToConversationList: t,
|
|
3434
3421
|
closedChannelUrl: n,
|
|
3435
3422
|
onClearClosedChannelUrl: o
|
|
3436
3423
|
}) => {
|
|
3437
|
-
const { Template: i } =
|
|
3424
|
+
const { Template: i } = Rt.useContext();
|
|
3438
3425
|
return /* @__PURE__ */ r.createElement(
|
|
3439
3426
|
Wa,
|
|
3440
3427
|
{
|
|
@@ -3444,7 +3431,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3444
3431
|
},
|
|
3445
3432
|
/* @__PURE__ */ r.createElement(xt, null, /* @__PURE__ */ r.createElement(xt.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(kc, { ...a }, /* @__PURE__ */ r.createElement(i, null)), e)))
|
|
3446
3433
|
);
|
|
3447
|
-
},
|
|
3434
|
+
}, Rt = we({
|
|
3448
3435
|
template: wc,
|
|
3449
3436
|
components: {
|
|
3450
3437
|
Header: Tc,
|
|
@@ -3453,7 +3440,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3453
3440
|
}
|
|
3454
3441
|
});
|
|
3455
3442
|
function wc() {
|
|
3456
|
-
const { components: e } =
|
|
3443
|
+
const { components: e } = Rt.useContext();
|
|
3457
3444
|
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));
|
|
3458
3445
|
}
|
|
3459
3446
|
const kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
@@ -3462,7 +3449,7 @@ const kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:
|
|
|
3462
3449
|
} = j("ConversationList");
|
|
3463
3450
|
function Ic({
|
|
3464
3451
|
conversationListFilter: e,
|
|
3465
|
-
onOpenConversationView: t =
|
|
3452
|
+
onOpenConversationView: t = Le,
|
|
3466
3453
|
children: n
|
|
3467
3454
|
}) {
|
|
3468
3455
|
return /* @__PURE__ */ r.createElement(bo, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(Ac, { value: { ...o, onOpenConversationView: t } }, n));
|
|
@@ -3528,7 +3515,7 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3528
3515
|
const { stringSet: e } = R();
|
|
3529
3516
|
return /* @__PURE__ */ r.createElement(zc, null, /* @__PURE__ */ r.createElement(Vc, { variant: "h2", color: h.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Wc, null));
|
|
3530
3517
|
}, zc = 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};`, Vc = u(k)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Wc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${h.themedColor.textDisabled};`, Gc = ({ conversationListFilter: e, children: t, onOpenConversationView: n }) => {
|
|
3531
|
-
const { Template: o } =
|
|
3518
|
+
const { Template: o } = Dt.useContext();
|
|
3532
3519
|
return /* @__PURE__ */ r.createElement(
|
|
3533
3520
|
Ic,
|
|
3534
3521
|
{
|
|
@@ -3538,7 +3525,7 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3538
3525
|
/* @__PURE__ */ r.createElement(Kc, null, /* @__PURE__ */ r.createElement(o, null)),
|
|
3539
3526
|
t
|
|
3540
3527
|
);
|
|
3541
|
-
},
|
|
3528
|
+
}, Dt = we({
|
|
3542
3529
|
template: jc,
|
|
3543
3530
|
components: {
|
|
3544
3531
|
Header: Hc,
|
|
@@ -3547,15 +3534,15 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3547
3534
|
}
|
|
3548
3535
|
});
|
|
3549
3536
|
function jc() {
|
|
3550
|
-
const { components: e } =
|
|
3537
|
+
const { components: e } = Dt.useContext();
|
|
3551
3538
|
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));
|
|
3552
3539
|
}
|
|
3553
|
-
const Kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Zc = $`:where(#${
|
|
3554
|
-
|
|
3540
|
+
const Kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Zc = $`:where(#${oe.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, Yc = [Zc, ni, ri], qc = (e, ...t) => Lr(e, ...Yc, ...t), Jc = qc``, Xc = Xr(
|
|
3541
|
+
Rt,
|
|
3555
3542
|
_e,
|
|
3543
|
+
$t,
|
|
3556
3544
|
Mt,
|
|
3557
|
-
|
|
3558
|
-
Nt,
|
|
3545
|
+
Dt,
|
|
3559
3546
|
ur
|
|
3560
3547
|
);
|
|
3561
3548
|
function Qc({
|
|
@@ -3570,7 +3557,7 @@ function Qc({
|
|
|
3570
3557
|
}) {
|
|
3571
3558
|
return ci(jo, t), /* @__PURE__ */ r.createElement(Rr, { target: t }, /* @__PURE__ */ r.createElement(si, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Fo, { internalVariables: s == null ? void 0 : s.__internalVariables }, /* @__PURE__ */ r.createElement(ti, { stringSet: i, logger: n, language: o }, /* @__PURE__ */ r.createElement(Xc, null, a, /* @__PURE__ */ r.createElement(Jc, null))))));
|
|
3572
3559
|
}
|
|
3573
|
-
const
|
|
3560
|
+
const hn = {
|
|
3574
3561
|
key_payment_plan_container: {
|
|
3575
3562
|
color_variables: {},
|
|
3576
3563
|
created_at: 1232,
|
|
@@ -3755,19 +3742,19 @@ const gn = {
|
|
|
3755
3742
|
}
|
|
3756
3743
|
}
|
|
3757
3744
|
}
|
|
3758
|
-
}, mr =
|
|
3745
|
+
}, mr = Re(function({
|
|
3759
3746
|
rootElement: t = document.body,
|
|
3760
|
-
logLevel: n =
|
|
3747
|
+
logLevel: n = xn.WARN,
|
|
3761
3748
|
language: o = navigator.language,
|
|
3762
3749
|
userSessionInfo: i,
|
|
3763
3750
|
children: a,
|
|
3764
3751
|
...s
|
|
3765
3752
|
}, l) {
|
|
3766
3753
|
var c;
|
|
3767
|
-
return
|
|
3754
|
+
return ve.level !== n && (ve.level = n), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: oe.ENTRY, style: { width: "fit-content", height: "fit-content", ...s.entryStyle } }, /* @__PURE__ */ r.createElement(No, { logger: ve, storage: td }, /* @__PURE__ */ r.createElement(
|
|
3768
3755
|
Qc,
|
|
3769
3756
|
{
|
|
3770
|
-
logger:
|
|
3757
|
+
logger: ve,
|
|
3771
3758
|
rootElement: t,
|
|
3772
3759
|
appearance: (c = s.agentPreviewConfigs) == null ? void 0 : c.appearance,
|
|
3773
3760
|
stringSet: s.stringSet,
|
|
@@ -3783,39 +3770,39 @@ const gn = {
|
|
|
3783
3770
|
language: o,
|
|
3784
3771
|
countryCode: s.countryCode,
|
|
3785
3772
|
context: s.context,
|
|
3786
|
-
logger:
|
|
3773
|
+
logger: ve,
|
|
3787
3774
|
dispatcher: ed,
|
|
3788
3775
|
chatParams: { customApiHost: s.customApiHost, customWebSocketHost: s.customWebSocketHost }
|
|
3789
3776
|
},
|
|
3790
|
-
/* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement($a, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id:
|
|
3777
|
+
/* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement($a, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id: oe.MODAL_ROOT }))))
|
|
3791
3778
|
)
|
|
3792
3779
|
)));
|
|
3793
|
-
}),
|
|
3780
|
+
}), ve = new wn(xn.WARN), ed = new Sn(ve), Nt = "@sba/message-template", gn = (e) => `${Nt}/templates/${e}`, pn = () => `${Nt}/token`, td = Ro({
|
|
3794
3781
|
onSetTemplate: (e, t) => {
|
|
3795
|
-
|
|
3782
|
+
hn[e] || te.setItem(gn(e), t);
|
|
3796
3783
|
},
|
|
3797
3784
|
onGetTemplate: (e) => {
|
|
3798
|
-
const t =
|
|
3799
|
-
return t ? JSON.stringify(t) :
|
|
3785
|
+
const t = hn[e];
|
|
3786
|
+
return t ? JSON.stringify(t) : te.getItem(gn(e));
|
|
3800
3787
|
},
|
|
3801
3788
|
onSetCachedToken(e) {
|
|
3802
|
-
|
|
3789
|
+
te.setItem(pn(), e);
|
|
3803
3790
|
},
|
|
3804
3791
|
onGetCachedToken() {
|
|
3805
|
-
return
|
|
3792
|
+
return te.getItem(pn());
|
|
3806
3793
|
},
|
|
3807
3794
|
onClear: () => {
|
|
3808
|
-
|
|
3795
|
+
te.getKeys(Nt).forEach(te.deleteItem);
|
|
3809
3796
|
}
|
|
3810
3797
|
}), hr = ({ children: e, isOpened: t }) => {
|
|
3811
|
-
const { dir: n, rootElement: o } = P(), i =
|
|
3798
|
+
const { dir: n, rootElement: o } = P(), i = fe(o, !0);
|
|
3812
3799
|
return D(() => {
|
|
3813
3800
|
const a = "sb-agent-block-scroll";
|
|
3814
3801
|
return t ? i.body.classList.add(a) : i.body.classList.remove(a), () => {
|
|
3815
3802
|
i.body.classList.remove(a);
|
|
3816
3803
|
};
|
|
3817
3804
|
}, [i, t]), /* @__PURE__ */ r.createElement(nd, { dir: n, $visible: t }, e);
|
|
3818
|
-
}, nd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${
|
|
3805
|
+
}, nd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${be.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, rd = 48, od = 2 / 3;
|
|
3819
3806
|
function id({
|
|
3820
3807
|
className: e,
|
|
3821
3808
|
isOpened: t,
|
|
@@ -3832,7 +3819,7 @@ function id({
|
|
|
3832
3819
|
ld,
|
|
3833
3820
|
{
|
|
3834
3821
|
dir: a,
|
|
3835
|
-
id:
|
|
3822
|
+
id: oe.LAUNCHER,
|
|
3836
3823
|
className: e,
|
|
3837
3824
|
"aria-label": "Sendbird AIAgent Launcher",
|
|
3838
3825
|
onClick: n,
|
|
@@ -3840,11 +3827,11 @@ function id({
|
|
|
3840
3827
|
$backgroundColor: l,
|
|
3841
3828
|
$size: c
|
|
3842
3829
|
},
|
|
3843
|
-
/* @__PURE__ */ r.createElement(cd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(
|
|
3844
|
-
/* @__PURE__ */ r.createElement(dd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(
|
|
3830
|
+
/* @__PURE__ */ r.createElement(cd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Open, { url: i, isDefaultIcon: o === "default_icon" })),
|
|
3831
|
+
/* @__PURE__ */ r.createElement(dd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Close, { size: m }))
|
|
3845
3832
|
);
|
|
3846
3833
|
}
|
|
3847
|
-
const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, ad = $`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 ===
|
|
3834
|
+
const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, ad = $`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 === Ln.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, gr = $`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => $`
|
|
3848
3835
|
path {
|
|
3849
3836
|
fill: ${e};
|
|
3850
3837
|
}
|
|
@@ -3853,12 +3840,12 @@ const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
3853
3840
|
}
|
|
3854
3841
|
`}
|
|
3855
3842
|
}
|
|
3856
|
-
`, ld = 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 && sd}`, pr = 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;`, cd = u(pr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${ad}${gr}`, dd = u(pr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${gr}`,
|
|
3857
|
-
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(
|
|
3843
|
+
`, ld = 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 && sd}`, pr = 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;`, cd = u(pr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${ad}${gr}`, dd = u(pr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${gr}`, fn = {
|
|
3844
|
+
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(kt, null),
|
|
3858
3845
|
Close: ({ size: e }) => /* @__PURE__ */ r.createElement(O, { size: e, type: "chevron-down" })
|
|
3859
3846
|
};
|
|
3860
3847
|
function fr({ className: e, size: t }) {
|
|
3861
|
-
const { colors: n } =
|
|
3848
|
+
const { colors: n } = Et(), { dir: o, state: i } = P(), { launcherInfo: a } = z();
|
|
3862
3849
|
return md(), /* @__PURE__ */ r.createElement(
|
|
3863
3850
|
id,
|
|
3864
3851
|
{
|
|
@@ -3894,7 +3881,7 @@ function md() {
|
|
|
3894
3881
|
}
|
|
3895
3882
|
const br = Te(null);
|
|
3896
3883
|
function hd() {
|
|
3897
|
-
const e =
|
|
3884
|
+
const e = re(br);
|
|
3898
3885
|
if (!e)
|
|
3899
3886
|
throw new Error("useNavigator() must be used within <Navigator />");
|
|
3900
3887
|
return e;
|
|
@@ -3903,7 +3890,7 @@ function xr({ children: e }) {
|
|
|
3903
3890
|
const t = hd();
|
|
3904
3891
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
|
|
3905
3892
|
}
|
|
3906
|
-
const gd =
|
|
3893
|
+
const gd = En`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, pd = En`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, fd = $`animation-name:${gd};animation-duration:0.3s;animation-fill-mode:forwards;`, bd = $``, xd = $`animation-name:${pd};animation-duration:0.3s;animation-fill-mode:forwards;`, Ed = $`visibility:hidden;`, Cd = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
3907
3894
|
switch (e) {
|
|
3908
3895
|
case "entering":
|
|
3909
3896
|
return fd;
|
|
@@ -3920,17 +3907,17 @@ const gd = Cn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
|
|
|
3920
3907
|
z-index: 999;
|
|
3921
3908
|
` : $`z-index:1;pointer-events:none;`}
|
|
3922
3909
|
`;
|
|
3923
|
-
function
|
|
3910
|
+
function Me({ initialId: e, children: t }) {
|
|
3924
3911
|
const n = U((b, C) => {
|
|
3925
|
-
c((
|
|
3926
|
-
...
|
|
3927
|
-
[b]: (
|
|
3928
|
-
})), p((
|
|
3929
|
-
...
|
|
3912
|
+
c((y) => [...y, b]), m((y) => ({ ...y, [b]: !0 })), C != null && C.reset && f((y) => ({
|
|
3913
|
+
...y,
|
|
3914
|
+
[b]: (y[b] || 0) + 1
|
|
3915
|
+
})), p((y) => ({
|
|
3916
|
+
...y,
|
|
3930
3917
|
[b]: "entering"
|
|
3931
3918
|
})), setTimeout(() => {
|
|
3932
|
-
p((
|
|
3933
|
-
...
|
|
3919
|
+
p((y) => ({
|
|
3920
|
+
...y,
|
|
3934
3921
|
[b]: "entered"
|
|
3935
3922
|
}));
|
|
3936
3923
|
}, 300);
|
|
@@ -3938,75 +3925,75 @@ function $e({ initialId: e, children: t }) {
|
|
|
3938
3925
|
c((b) => {
|
|
3939
3926
|
if (b.length <= 1) return b;
|
|
3940
3927
|
const C = b[b.length - 1];
|
|
3941
|
-
return p((
|
|
3942
|
-
...
|
|
3928
|
+
return p((y) => ({
|
|
3929
|
+
...y,
|
|
3943
3930
|
[C]: "exiting"
|
|
3944
3931
|
})), setTimeout(() => {
|
|
3945
|
-
p((
|
|
3946
|
-
...
|
|
3932
|
+
p((y) => ({
|
|
3933
|
+
...y,
|
|
3947
3934
|
[C]: "exited"
|
|
3948
|
-
})), c((
|
|
3935
|
+
})), c((y) => y.slice(0, -1));
|
|
3949
3936
|
}, 300), b;
|
|
3950
3937
|
});
|
|
3951
|
-
}, []), i =
|
|
3938
|
+
}, []), i = ye(() => ({
|
|
3952
3939
|
navigation: {
|
|
3953
3940
|
navigate: n,
|
|
3954
3941
|
pop: o
|
|
3955
3942
|
}
|
|
3956
|
-
}), [n, o]), a =
|
|
3943
|
+
}), [n, o]), a = ye(() => Tr.toArray(t).filter(
|
|
3957
3944
|
(b) => b.type === xr
|
|
3958
|
-
), [t]), s =
|
|
3945
|
+
), [t]), s = ye(() => {
|
|
3959
3946
|
const b = {};
|
|
3960
3947
|
return a.forEach((C) => {
|
|
3961
|
-
const { id:
|
|
3962
|
-
b[
|
|
3948
|
+
const { id: y, lazy: T, children: _ } = C.props;
|
|
3949
|
+
b[y] = { lazy: T, element: typeof _ == "function" ? _(i) : _ };
|
|
3963
3950
|
}), b;
|
|
3964
|
-
}, [a]), [l, c] =
|
|
3951
|
+
}, [a]), [l, c] = S([e]), [d, m] = S(() => {
|
|
3965
3952
|
const b = {};
|
|
3966
|
-
return Object.entries(s).forEach(([C, { lazy:
|
|
3967
|
-
|
|
3953
|
+
return Object.entries(s).forEach(([C, { lazy: y }]) => {
|
|
3954
|
+
y === !1 && (b[C] = !0);
|
|
3968
3955
|
}), b[e] = !0, b;
|
|
3969
|
-
}), [g, p] =
|
|
3956
|
+
}), [g, p] = S(() => {
|
|
3970
3957
|
const b = {};
|
|
3971
3958
|
return Object.keys(s).forEach((C) => {
|
|
3972
3959
|
C === e ? b[C] = "entered" : b[C] = "exited";
|
|
3973
3960
|
}), b;
|
|
3974
|
-
}), [x, f] =
|
|
3975
|
-
return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(
|
|
3976
|
-
var
|
|
3961
|
+
}), [x, f] = S({}), E = l[l.length - 1];
|
|
3962
|
+
return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(vd, null, Object.keys(s).map((b) => {
|
|
3963
|
+
var _;
|
|
3977
3964
|
if (!d[b]) return null;
|
|
3978
|
-
const C = g[b] || "exited",
|
|
3979
|
-
return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active:
|
|
3965
|
+
const C = g[b] || "exited", y = b === E, T = `${b}-${x[b] || 0}`;
|
|
3966
|
+
return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active: y }, (_ = s[b]) == null ? void 0 : _.element);
|
|
3980
3967
|
})));
|
|
3981
3968
|
}
|
|
3982
|
-
const
|
|
3983
|
-
|
|
3984
|
-
const
|
|
3969
|
+
const vd = u.div`position:relative;width:100%;height:100%;`;
|
|
3970
|
+
Me.Screen = xr;
|
|
3971
|
+
const pe = {
|
|
3985
3972
|
activeConv: "active-conv",
|
|
3986
3973
|
closedConv: "closed-conv",
|
|
3987
3974
|
convList: "conv-list"
|
|
3988
|
-
}, Er = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(
|
|
3989
|
-
|
|
3975
|
+
}, Er = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(Me, { initialId: pe.activeConv }, /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.activeConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(mn, { onNavigateToConversationList: () => n.navigate(pe.convList, { reset: !0 }) })), /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.closedConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3976
|
+
mn,
|
|
3990
3977
|
{
|
|
3991
3978
|
onNavigateToConversationList: () => n.pop(),
|
|
3992
3979
|
closedChannelUrl: t,
|
|
3993
3980
|
onClearClosedChannelUrl: () => e(void 0)
|
|
3994
3981
|
}
|
|
3995
|
-
)), /* @__PURE__ */ r.createElement(
|
|
3982
|
+
)), /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3996
3983
|
Gc,
|
|
3997
3984
|
{
|
|
3998
3985
|
onOpenConversationView: (o, i) => {
|
|
3999
|
-
i === "closed" ? (e(o), n.navigate(
|
|
3986
|
+
i === "closed" ? (e(o), n.navigate(pe.closedConv, { reset: !0 })) : n.navigate(pe.activeConv);
|
|
4000
3987
|
}
|
|
4001
3988
|
}
|
|
4002
3989
|
)));
|
|
4003
|
-
function
|
|
3990
|
+
function yd({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
|
|
4004
3991
|
const { dir: i } = P();
|
|
4005
|
-
return /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Sd, { dir: i, id:
|
|
3992
|
+
return /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Sd, { dir: i, id: oe.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
|
|
4006
3993
|
}
|
|
4007
|
-
const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Sd = 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 && wd};${({ $isExpanded: e }) => e && Td};`, Td = $`width:743px;height:723px;`, wd = $`z-index:${
|
|
4008
|
-
const o =
|
|
4009
|
-
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(
|
|
3994
|
+
const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Sd = 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 && wd};${({ $isExpanded: e }) => e && Td};`, Td = $`width:743px;height:723px;`, wd = $`z-index:${be.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;`, Xd = Re(function({ children: e, ...t }, n) {
|
|
3995
|
+
const o = Pe(), [i, a] = S(), s = o ? hr : yd;
|
|
3996
|
+
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(s, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(fr, null) }, /* @__PURE__ */ r.createElement(
|
|
4010
3997
|
Er,
|
|
4011
3998
|
{
|
|
4012
3999
|
closedChannelUrl: i,
|
|
@@ -4015,41 +4002,41 @@ const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end
|
|
|
4015
4002
|
)), e)));
|
|
4016
4003
|
}), {
|
|
4017
4004
|
Provider: kd,
|
|
4018
|
-
useContext:
|
|
4005
|
+
useContext: Pt
|
|
4019
4006
|
} = j("FixedMessengerStyle");
|
|
4020
4007
|
function Cr(e, t, n, o = 0) {
|
|
4021
4008
|
const { top: i, bottom: a, start: s, end: l } = n;
|
|
4022
4009
|
let c = "", d = "";
|
|
4023
4010
|
switch (e) {
|
|
4024
4011
|
case "start":
|
|
4025
|
-
d = `inset-inline-start: ${
|
|
4012
|
+
d = `inset-inline-start: ${Y(s)}`;
|
|
4026
4013
|
break;
|
|
4027
4014
|
case "end":
|
|
4028
|
-
d = `inset-inline-end: ${
|
|
4015
|
+
d = `inset-inline-end: ${Y(l)}`;
|
|
4029
4016
|
break;
|
|
4030
4017
|
}
|
|
4031
4018
|
switch (t) {
|
|
4032
4019
|
case "top":
|
|
4033
|
-
c = `top: calc(${
|
|
4020
|
+
c = `top: calc(${Y(i)} + ${o}px)`;
|
|
4034
4021
|
break;
|
|
4035
4022
|
case "bottom":
|
|
4036
|
-
c = `bottom: calc(${
|
|
4023
|
+
c = `bottom: calc(${Y(a)} + ${o}px)`;
|
|
4037
4024
|
break;
|
|
4038
4025
|
}
|
|
4039
4026
|
return $`${c};${d};`;
|
|
4040
4027
|
}
|
|
4041
4028
|
function Ad(e) {
|
|
4042
|
-
const { horizontal: t, vertical: n, margin: o, launcherSize: i } =
|
|
4029
|
+
const { horizontal: t, vertical: n, margin: o, launcherSize: i } = Pt();
|
|
4043
4030
|
return /* @__PURE__ */ r.createElement(Id, { ...e, size: i, $horizontal: t, $vertical: n, $margin: o });
|
|
4044
4031
|
}
|
|
4045
|
-
const Id = u(fr)`position:fixed;z-index:${
|
|
4032
|
+
const Id = u(fr)`position:fixed;z-index:${be.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => Cr(e, t, n)};`;
|
|
4046
4033
|
function $d({ isExpanded: e, isOpened: t, children: n }) {
|
|
4047
|
-
const { dir: o } = P(), { horizontal: i, vertical: a, margin: s, launcherSize: l } =
|
|
4034
|
+
const { dir: o } = P(), { horizontal: i, vertical: a, margin: s, launcherSize: l } = Pt();
|
|
4048
4035
|
return /* @__PURE__ */ r.createElement(
|
|
4049
4036
|
Md,
|
|
4050
4037
|
{
|
|
4051
4038
|
dir: o,
|
|
4052
|
-
id:
|
|
4039
|
+
id: oe.WINDOW,
|
|
4053
4040
|
$isExpanded: e,
|
|
4054
4041
|
$isOpened: t,
|
|
4055
4042
|
$horizontal: i,
|
|
@@ -4068,12 +4055,12 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4068
4055
|
|
|
4069
4056
|
${({ $isOpened: e }) => e && Ld};
|
|
4070
4057
|
${({ $isExpanded: e }) => e && Od};
|
|
4071
|
-
`, Od = $`width:743px;height:723px;`, Ld = $`z-index:${
|
|
4072
|
-
const [o, i] =
|
|
4058
|
+
`, Od = $`width:743px;height:723px;`, Ld = $`z-index:${be.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;`, vr = { top: 24, bottom: 24, start: 24, end: 24 }, Rd = Re(function({ children: e, ...t }, n) {
|
|
4059
|
+
const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(vr), [d, m] = S(48), g = Pe(), p = g ? hr : $d, { horizontal: x, vertical: f } = ye(() => {
|
|
4073
4060
|
const [E, b] = a.split("-");
|
|
4074
4061
|
return { horizontal: E === "start" ? "start" : "end", vertical: b === "top" ? "top" : "bottom" };
|
|
4075
4062
|
}, [a]);
|
|
4076
|
-
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(
|
|
4063
|
+
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: E }) => /* @__PURE__ */ r.createElement(
|
|
4077
4064
|
kd,
|
|
4078
4065
|
{
|
|
4079
4066
|
value: { horizontal: x, vertical: f, margin: l, launcherSize: d, setPosition: s, setMargin: c, setLauncherSize: m }
|
|
@@ -4090,9 +4077,9 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4090
4077
|
)));
|
|
4091
4078
|
}), Dd = (e) => {
|
|
4092
4079
|
var i, a, s, l;
|
|
4093
|
-
const { setPosition: t, setMargin: n, setLauncherSize: o } =
|
|
4094
|
-
return
|
|
4095
|
-
e.position && t(e.position), e.margin && n({ ...
|
|
4080
|
+
const { setPosition: t, setMargin: n, setLauncherSize: o } = Pt();
|
|
4081
|
+
return ce(() => {
|
|
4082
|
+
e.position && t(e.position), e.margin && n({ ...vr, ...e.margin }), e.launcherSize && o(e.launcherSize);
|
|
4096
4083
|
}, [
|
|
4097
4084
|
e.position,
|
|
4098
4085
|
(i = e.margin) == null ? void 0 : i.top,
|
|
@@ -4105,16 +4092,16 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4105
4092
|
Style: Dd
|
|
4106
4093
|
});
|
|
4107
4094
|
export {
|
|
4108
|
-
|
|
4095
|
+
_t as A,
|
|
4109
4096
|
ao as C,
|
|
4110
4097
|
Xd as D,
|
|
4111
4098
|
Qd as F,
|
|
4112
4099
|
O as I,
|
|
4113
|
-
|
|
4100
|
+
Kn as L,
|
|
4114
4101
|
ka as M,
|
|
4115
|
-
|
|
4102
|
+
$t as O,
|
|
4116
4103
|
Jd as P,
|
|
4117
|
-
|
|
4104
|
+
Mt as S,
|
|
4118
4105
|
k as a,
|
|
4119
4106
|
mr as b,
|
|
4120
4107
|
h as c,
|
|
@@ -4123,13 +4110,13 @@ export {
|
|
|
4123
4110
|
R as f,
|
|
4124
4111
|
id as g,
|
|
4125
4112
|
_e as h,
|
|
4126
|
-
|
|
4113
|
+
ne as i,
|
|
4127
4114
|
ur as j,
|
|
4128
|
-
|
|
4129
|
-
|
|
4115
|
+
mn as k,
|
|
4116
|
+
Rt as l,
|
|
4130
4117
|
ed as m,
|
|
4131
4118
|
Gc as n,
|
|
4132
|
-
|
|
4133
|
-
|
|
4119
|
+
Dt as o,
|
|
4120
|
+
Tn as p,
|
|
4134
4121
|
P as u
|
|
4135
4122
|
};
|