@sendbird/ai-agent-messenger-react 1.13.1 → 1.14.0
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/{BdwWrAAp.cjs → B1tLGMir.cjs} +1 -1
- package/dist/cjs/{BKGMHnw9.cjs → BBx-8cm_.cjs} +1 -1
- package/dist/cjs/{BPwCUUtB.cjs → BgVlF21n.cjs} +1 -1
- package/dist/cjs/{PZ2du4si.cjs → Cid7OVHf.cjs} +1 -1
- package/dist/cjs/DKMWo-NT.cjs +306 -0
- package/dist/cjs/{C0ghQ00S.cjs → DRYp-Aeq.cjs} +1 -1
- package/dist/cjs/{CgKaFsNM.cjs → Da-SU-eO.cjs} +1 -1
- package/dist/cjs/{Cfl_OFPL.cjs → Zam2SMxN.cjs} +1 -1
- package/dist/cjs/{DHKyBmS2.cjs → _2AhSWhf.cjs} +1 -1
- package/dist/cjs/{C6epASKA.cjs → awgtpOfn.cjs} +1 -1
- package/dist/cjs/{DEtHXyvH.cjs → yj3YM6ag.cjs} +1 -1
- package/dist/es/{yBEMlNSs.js → BJNTmQ2V.js} +1 -1
- package/dist/es/{YUOGDsml.js → BW6o50qt.js} +1 -1
- package/dist/es/{CFFZNjOj.js → Bw9xvmqB.js} +1 -1
- package/dist/es/{By2XFBR_.js → C1Zy5PCq.js} +1019 -1006
- package/dist/es/{-WWqhsdP.js → C66w0Vo6.js} +1 -1
- package/dist/es/{Bsb8urZu.js → DvF4h9BU.js} +1 -1
- package/dist/es/{C3PP_RTM.js → FYaa05gN.js} +1 -1
- package/dist/es/{DIrWtn8H.js → Ge_YPjjg.js} +1 -1
- package/dist/es/{7nVEVfxl.js → TXpETEfV.js} +1 -1
- package/dist/es/{nGzMJZzZ.js → b3j3zOSP.js} +1 -1
- package/dist/es/{BDvtEnu9.js → t-xO5mFL.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +1 -1
- package/package.json +9 -9
- package/dist/cjs/DwrHbIrU.cjs +0 -306
|
@@ -2,23 +2,23 @@ var lo = Object.defineProperty;
|
|
|
2
2
|
var co = (e, t, n) => t in e ? lo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var z = (e, t, n) => co(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as o from "react";
|
|
5
|
-
import { createContext as
|
|
5
|
+
import { createContext as We, useContext as xe, useLayoutEffect as se, useState as C, useEffect as P, useRef as B, useCallback as L, useMemo as ae, forwardRef as Ge, useImperativeHandle as uo, useId as Gt, useReducer as mo, PureComponent as go, Suspense as ho, lazy as R, Fragment as rr, Children as po } from "react";
|
|
6
6
|
import fo, { SendbirdChatOptions as bo, SendbirdProduct as Eo, DeviceOsPlatform as xn, SendbirdPlatform as xo, SessionHandler as vo, ConnectionHandler as xt, SendbirdError as _o, LogLevel as or, ConnectionState as yo } from "@sendbird/chat";
|
|
7
7
|
import h, { css as I, ThemeProvider as Co, useTheme as Je, createGlobalStyle as So, StyleSheetManager as To, keyframes as sr } from "styled-components";
|
|
8
8
|
import { differenceInMinutes as Ao, isToday as wo, differenceInHours as Io, isSameMinute as vn, format as ir, isSameDay as ko } from "date-fns";
|
|
9
9
|
import { enUS as $o } from "date-fns/locale/en-US";
|
|
10
|
-
import { SendingStatus as Pe, ReplyType as Mo, MessageMetaArray as
|
|
11
|
-
import { ConversationStatus as Q, AIAgentModule as
|
|
10
|
+
import { SendingStatus as Pe, ReplyType as Mo, MessageMetaArray as Oo } from "@sendbird/chat/message";
|
|
11
|
+
import { ConversationStatus as Q, AIAgentModule as Lo, AIAgentMessageFeedbackRating as _n, ConversationType as Do } from "@sendbird/chat/aiAgent";
|
|
12
12
|
import { GroupChannelModule as Ro, GroupChannelListOrder as ar, GroupChannelHandler as No } from "@sendbird/chat/groupChannel";
|
|
13
13
|
import { createPortal as Bo } from "react-dom";
|
|
14
14
|
import { renderer as Fo, parser as Po, MessageProvider as Uo } from "@sendbird/react-uikit-message-template-view";
|
|
15
15
|
import { createMessageTemplate as Ho } from "@sendbird/uikit-message-template";
|
|
16
16
|
import { useGroupChannelMessages as Vo, useGroupChannelHandler as vt, useForceUpdate as zo } from "@sendbird/uikit-tools";
|
|
17
17
|
import lr from "dompurify";
|
|
18
|
-
import { isSameDay as
|
|
19
|
-
import
|
|
18
|
+
import { isSameDay as Wo } from "date-fns/isSameDay";
|
|
19
|
+
import Go from "@emotion/is-prop-valid";
|
|
20
20
|
const ee = (e, t) => {
|
|
21
|
-
const n =
|
|
21
|
+
const n = We(null), r = ({ children: a, value: l }) => /* @__PURE__ */ o.createElement(n.Provider, { value: l }, typeof a == "function" ? a(l) : a), s = ({ children: a }) => /* @__PURE__ */ o.createElement(n.Consumer, null, (l) => l ? typeof a == "function" ? a(l) : a : null), i = () => {
|
|
22
22
|
const a = xe(n);
|
|
23
23
|
if (!a)
|
|
24
24
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
@@ -27,7 +27,7 @@ const ee = (e, t) => {
|
|
|
27
27
|
return n.displayName = `${e}Context`, r.displayName = `${e}Provider`, s.displayName = `${e}Consumer`, i.displayName = `use${e}Context`, { Context: n, Provider: r, Consumer: s, useContext: i };
|
|
28
28
|
};
|
|
29
29
|
function ye(e) {
|
|
30
|
-
const t =
|
|
30
|
+
const t = We({
|
|
31
31
|
Template: e.template,
|
|
32
32
|
updateTemplate: () => {
|
|
33
33
|
},
|
|
@@ -46,7 +46,7 @@ function ye(e) {
|
|
|
46
46
|
}
|
|
47
47
|
function r({ template: i, children: a }) {
|
|
48
48
|
const { updateTemplate: l } = xe(t);
|
|
49
|
-
return
|
|
49
|
+
return se(() => {
|
|
50
50
|
i && l(i);
|
|
51
51
|
}, [i]), /* @__PURE__ */ o.createElement(o.Fragment, null, a);
|
|
52
52
|
}
|
|
@@ -58,7 +58,7 @@ function ye(e) {
|
|
|
58
58
|
component: l
|
|
59
59
|
}) {
|
|
60
60
|
const { updateComponent: c } = xe(t);
|
|
61
|
-
return
|
|
61
|
+
return se(() => {
|
|
62
62
|
l && c(i, l);
|
|
63
63
|
}, [l]), null;
|
|
64
64
|
};
|
|
@@ -130,7 +130,8 @@ function Yo(e, t) {
|
|
|
130
130
|
{
|
|
131
131
|
response_type: "free_text",
|
|
132
132
|
scores: [1, 2, 3, 4, 5],
|
|
133
|
-
question: t.followUp.question
|
|
133
|
+
question: t.followUp.question,
|
|
134
|
+
always_visible: !1
|
|
134
135
|
}
|
|
135
136
|
],
|
|
136
137
|
csat_submit_label: t.submit_label,
|
|
@@ -215,7 +216,7 @@ const Fe = "sb-agent", cr = "KEY_IMG_ASPECT_RATIO", Jo = "*/*", V = {
|
|
|
215
216
|
type: "text",
|
|
216
217
|
value: e.slice(s).trim()
|
|
217
218
|
}), t ? r.map((i) => i.type !== "text" ? i : { ...i, value: t(i.value) }) : r;
|
|
218
|
-
}, ns = (e) => e.replace(/\[([^\]]+)\](?!\()/g, "\\[$1\\]"), rs = (e) => e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g, "$1\\_"), os = (e) => e.replace(/~~/g, "\\~\\~"),
|
|
219
|
+
}, ns = (e) => e.replace(/\[([^\]]+)\](?!\()/g, "\\[$1\\]"), rs = (e) => e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g, "$1\\_"), os = (e) => e.replace(/~~/g, "\\~\\~"), xh = (e) => {
|
|
219
220
|
let t = e;
|
|
220
221
|
return t = ns(t), t = rs(t), t = os(t), t;
|
|
221
222
|
}, ss = typeof navigator < "u" && navigator.product === "ReactNative", Cn = (e, t) => {
|
|
@@ -382,7 +383,7 @@ class pr {
|
|
|
382
383
|
function Tn(e, t, n, r) {
|
|
383
384
|
const s = fo.init({
|
|
384
385
|
appId: e,
|
|
385
|
-
modules: [new Ro(), new
|
|
386
|
+
modules: [new Ro(), new Lo()],
|
|
386
387
|
localCacheEnabled: !0,
|
|
387
388
|
options: new bo({ typingIndicatorInvalidateTime: 2e4 }),
|
|
388
389
|
...r
|
|
@@ -487,17 +488,17 @@ function ms({
|
|
|
487
488
|
});
|
|
488
489
|
return P(() => {
|
|
489
490
|
p((x) => {
|
|
490
|
-
let y = x.logger, k = x.dispatcher,
|
|
491
|
-
return b && b !== x.logger && (y = b), v && v !== x.dispatcher && (k = v), d && d !== x.chatSDK ?
|
|
491
|
+
let y = x.logger, k = x.dispatcher, T = x.chatSDK;
|
|
492
|
+
return b && b !== x.logger && (y = b), v && v !== x.dispatcher && (k = v), d && d !== x.chatSDK ? T = d : !d && x.chatSDK.appId !== e && (T = Tn(e, E, _, { newInstance: !0, ...g })), {
|
|
492
493
|
...x,
|
|
493
494
|
logger: y,
|
|
494
495
|
dispatcher: k,
|
|
495
|
-
chatSDK:
|
|
496
|
+
chatSDK: T,
|
|
496
497
|
cache: Sn({ appId: e, aiAgentId: t, storage: n })
|
|
497
498
|
};
|
|
498
499
|
});
|
|
499
500
|
}, [e, t, b, v, d, n]), P(() => () => {
|
|
500
|
-
u.chatSDK.disconnectWebSocket();
|
|
501
|
+
u.chatSDK.connectionState === "OPEN" && u.chatSDK.disconnectWebSocket();
|
|
501
502
|
}, [u.chatSDK]), cs(u.chatSDK), /* @__PURE__ */ o.createElement(
|
|
502
503
|
us,
|
|
503
504
|
{
|
|
@@ -620,9 +621,6 @@ function ys(e, t, n, r, s) {
|
|
|
620
621
|
headerBackground: e.background50,
|
|
621
622
|
modalContentBackground: e.background50
|
|
622
623
|
},
|
|
623
|
-
metadata: {
|
|
624
|
-
errorContent: e.ondark.textHighEmphasis
|
|
625
|
-
},
|
|
626
624
|
messageInput: {
|
|
627
625
|
text: e.onlight.textHighEmphasis,
|
|
628
626
|
placeholderText: e.onlight.textLowEmphasis,
|
|
@@ -649,9 +647,6 @@ const Cs = (e, t, n, r, s) => ({
|
|
|
649
647
|
headerBackground: e.background500,
|
|
650
648
|
modalContentBackground: e.background500
|
|
651
649
|
},
|
|
652
|
-
metadata: {
|
|
653
|
-
errorContent: e.ondark.textHighEmphasis
|
|
654
|
-
},
|
|
655
650
|
messageInput: {
|
|
656
651
|
text: e.ondark.textHighEmphasis,
|
|
657
652
|
placeholderText: e.ondark.textLowEmphasis,
|
|
@@ -903,13 +898,13 @@ function Er() {
|
|
|
903
898
|
[e, t]
|
|
904
899
|
);
|
|
905
900
|
}
|
|
906
|
-
function
|
|
901
|
+
function Os() {
|
|
907
902
|
const { chatSDK: e, logger: t } = X(), n = L(
|
|
908
903
|
async (s, i, a) => {
|
|
909
904
|
if (t.debug("useChatConnection.connect: start, session", s.userId), i) {
|
|
910
905
|
const l = new vo({
|
|
911
906
|
...i,
|
|
912
|
-
onSessionTokenRequired:
|
|
907
|
+
onSessionTokenRequired: Ls(i.onSessionTokenRequired, a)
|
|
913
908
|
});
|
|
914
909
|
e.setSessionHandler(l);
|
|
915
910
|
}
|
|
@@ -932,7 +927,7 @@ function Ls() {
|
|
|
932
927
|
}, [e, t]);
|
|
933
928
|
return { connect: n, disconnect: r };
|
|
934
929
|
}
|
|
935
|
-
function
|
|
930
|
+
function Ls(e, t) {
|
|
936
931
|
if (e)
|
|
937
932
|
return async (n, r) => {
|
|
938
933
|
new Promise((s, i) => e == null ? void 0 : e(s, i)).then((s) => {
|
|
@@ -975,7 +970,7 @@ const Bs = 1440 * 60 * 1e3, Fs = (e) => {
|
|
|
975
970
|
`useUserSessionCandidate.getManualSessionInfo: missing required keys in userSessionInfo: ${i.join(", ")}`
|
|
976
971
|
), t.debug("useUserSessionCandidate.getManualSessionInfo: manual session info detected"), e;
|
|
977
972
|
};
|
|
978
|
-
return
|
|
973
|
+
return ae(() => e instanceof Ns ? { type: "manual", userSessionCandidate: s() } : e instanceof In ? { type: "anonymous", userSessionCandidate: r() } : e && typeof e == "object" ? (t.warn("Please use ManualSessionInfo instead of the old userSessionInfo format."), { type: "manual", userSessionCandidate: s() }) : e === void 0 ? (t.warn("Please use AnonymousSessionInfo instead of undefined userSessionInfo."), { type: "anonymous", userSessionCandidate: r() }) : { type: "anonymous", userSessionCandidate: null }, [
|
|
979
974
|
t,
|
|
980
975
|
e == null ? void 0 : e.userId,
|
|
981
976
|
e == null ? void 0 : e.authToken,
|
|
@@ -994,41 +989,41 @@ function Ps({
|
|
|
994
989
|
onPostDeauth: a,
|
|
995
990
|
forceCreateChannel: l
|
|
996
991
|
}) {
|
|
997
|
-
const { aiAgentId: c, language: d, context: g, countryCode: f, logger: b, cache: v } = X(), { connect: _, disconnect: E } =
|
|
998
|
-
var
|
|
992
|
+
const { aiAgentId: c, language: d, context: g, countryCode: f, logger: b, cache: v } = X(), { connect: _, disconnect: E } = Os(), { type: u, userSessionCandidate: p } = Fs(e), x = Er(), y = L(async () => {
|
|
993
|
+
var O;
|
|
999
994
|
b.debug("useAuthentication.authenticate: start");
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
const
|
|
995
|
+
const T = p != null && p.userId ? v.messenger.getSettings(p.userId) : null;
|
|
996
|
+
T != null && T.bot && (t(T), b.debug("useAuthentication.authenticate: cached messenger settings", T));
|
|
997
|
+
const D = await x({
|
|
1003
998
|
aiAgentId: c,
|
|
1004
999
|
userId: p == null ? void 0 : p.userId,
|
|
1005
1000
|
language: d,
|
|
1006
1001
|
country: f,
|
|
1007
1002
|
context: g,
|
|
1008
1003
|
forceCreateChannel: l,
|
|
1009
|
-
knownActiveChannelUrl: (
|
|
1004
|
+
knownActiveChannelUrl: (O = T == null ? void 0 : T.active_channel) == null ? void 0 : O.channel_url
|
|
1010
1005
|
});
|
|
1011
|
-
b.debug("useAuthentication.authenticate: messenger settings response",
|
|
1012
|
-
let
|
|
1013
|
-
if (
|
|
1006
|
+
b.debug("useAuthentication.authenticate: messenger settings response", D);
|
|
1007
|
+
let M = null;
|
|
1008
|
+
if (D.auto_created_user)
|
|
1014
1009
|
if (u === "manual")
|
|
1015
|
-
b.warn("Received auto created user info but current session is manual. Ignoring auto created user info."),
|
|
1010
|
+
b.warn("Received auto created user info but current session is manual. Ignoring auto created user info."), M = { userId: p.userId, authToken: p.authToken };
|
|
1016
1011
|
else {
|
|
1017
|
-
const { user_id: N, session_token: j, expire_at:
|
|
1018
|
-
v.messenger.setAnonUser({ userId: N, authToken: j, expireAt:
|
|
1012
|
+
const { user_id: N, session_token: j, expire_at: q } = D.auto_created_user;
|
|
1013
|
+
v.messenger.setAnonUser({ userId: N, authToken: j, expireAt: q }), M = { userId: N, authToken: j };
|
|
1019
1014
|
}
|
|
1020
1015
|
else
|
|
1021
|
-
|
|
1016
|
+
M = {
|
|
1022
1017
|
userId: (p == null ? void 0 : p.userId) ?? "",
|
|
1023
1018
|
authToken: (p == null ? void 0 : p.authToken) ?? ""
|
|
1024
1019
|
};
|
|
1025
|
-
v.messenger.setSettings(
|
|
1020
|
+
v.messenger.setSettings(M.userId, D), t(D);
|
|
1026
1021
|
try {
|
|
1027
|
-
await n(
|
|
1022
|
+
await n(D, M), await _(M, p == null ? void 0 : p.sessionHandler, i), await r(D, M);
|
|
1028
1023
|
} catch (N) {
|
|
1029
1024
|
throw N instanceof Error && (s(N), b.error("useAuthentication.authenticate: failed to connect", N)), N;
|
|
1030
1025
|
}
|
|
1031
|
-
return
|
|
1026
|
+
return D;
|
|
1032
1027
|
}, [
|
|
1033
1028
|
x,
|
|
1034
1029
|
_,
|
|
@@ -1130,71 +1125,71 @@ const zs = () => {
|
|
|
1130
1125
|
syncCachedTemplates: s
|
|
1131
1126
|
};
|
|
1132
1127
|
}, {
|
|
1133
|
-
Provider:
|
|
1128
|
+
Provider: Ws,
|
|
1134
1129
|
useContext: yt
|
|
1135
|
-
} = ee("AIAgentMessengerSession"),
|
|
1130
|
+
} = ee("AIAgentMessengerSession"), Gs = Ge(
|
|
1136
1131
|
function({ userSessionInfo: e, forceCreateChannel: t, children: n }, r) {
|
|
1137
1132
|
const { appId: s, aiAgentId: i, chatSDK: a, language: l, countryCode: c, context: d, cache: g, logger: f } = X(), { updateTheme: b } = Yt(), [v, _] = C(void 0), [E, u] = C(
|
|
1138
1133
|
void 0
|
|
1139
|
-
), [p, x] = C(null), [y, k] = C(null), [
|
|
1134
|
+
), [p, x] = C(null), [y, k] = C(null), [T, D] = C(null), [M, O] = C(null), { updateBaseAttachmentRules: N, createAttachmentRules: j } = Ms(), { shouldSyncCachedTemplate: q, syncCachedTemplates: Se } = zs(), Te = Er(), { authenticate: Le, deauthenticate: Z } = Ps({
|
|
1140
1135
|
userSessionInfo: e,
|
|
1141
1136
|
forceCreateChannel: t,
|
|
1142
1137
|
onUpdateMessengerSettings: L(
|
|
1143
|
-
(
|
|
1144
|
-
const { appearance:
|
|
1145
|
-
b(
|
|
1146
|
-
userId:
|
|
1147
|
-
profileUrl:
|
|
1148
|
-
nickname:
|
|
1149
|
-
replyToFile:
|
|
1150
|
-
specialNotice:
|
|
1151
|
-
specialNoticeEnabled:
|
|
1152
|
-
showHandoffButton:
|
|
1153
|
-
isMultipleActiveConversationsEnabled:
|
|
1154
|
-
isUserFeedbackEnabled:
|
|
1155
|
-
isUserFeedbackCommentOptionEnabled:
|
|
1156
|
-
}),
|
|
1157
|
-
type:
|
|
1158
|
-
imageUrl:
|
|
1159
|
-
}), N(
|
|
1138
|
+
(S) => {
|
|
1139
|
+
const { appearance: $, bot: U, launcher: K } = S;
|
|
1140
|
+
b($.selected_theme, $), D({
|
|
1141
|
+
userId: U.bot_userid,
|
|
1142
|
+
profileUrl: U.bot_profile_url,
|
|
1143
|
+
nickname: U.bot_nickname,
|
|
1144
|
+
replyToFile: U.reply_to_file,
|
|
1145
|
+
specialNotice: U.special_notice,
|
|
1146
|
+
specialNoticeEnabled: U.is_special_notice_enabled,
|
|
1147
|
+
showHandoffButton: U.show_handoff_button ?? !0,
|
|
1148
|
+
isMultipleActiveConversationsEnabled: U.is_multiple_active_conversations_enabled ?? !0,
|
|
1149
|
+
isUserFeedbackEnabled: S.bot.is_user_feedback_enabled ?? !1,
|
|
1150
|
+
isUserFeedbackCommentOptionEnabled: S.bot.is_user_feedback_comment_option_enabled ?? !1
|
|
1151
|
+
}), O({
|
|
1152
|
+
type: K.image_type || "default_icon",
|
|
1153
|
+
imageUrl: K.image_url
|
|
1154
|
+
}), N(S);
|
|
1160
1155
|
},
|
|
1161
1156
|
[b]
|
|
1162
1157
|
),
|
|
1163
|
-
onPreAuth: L((
|
|
1164
|
-
_(void 0), k(
|
|
1158
|
+
onPreAuth: L((S, $) => {
|
|
1159
|
+
_(void 0), k($);
|
|
1165
1160
|
}, []),
|
|
1166
1161
|
onPostAuth: L(
|
|
1167
|
-
async (
|
|
1168
|
-
x(a.currentUser),
|
|
1162
|
+
async (S) => {
|
|
1163
|
+
x(a.currentUser), q() && await Se(), u({ url: S.active_channel.channel_url, status: Q.OPEN });
|
|
1169
1164
|
},
|
|
1170
|
-
[a,
|
|
1165
|
+
[a, q, Se]
|
|
1171
1166
|
),
|
|
1172
|
-
onErrorAuth: L((
|
|
1173
|
-
_(
|
|
1167
|
+
onErrorAuth: L((S) => {
|
|
1168
|
+
_(S);
|
|
1174
1169
|
}, []),
|
|
1175
|
-
onAuthTokenRefreshed: L((
|
|
1176
|
-
k((
|
|
1170
|
+
onAuthTokenRefreshed: L((S) => {
|
|
1171
|
+
k(($) => $ ? { ...$, authToken: S } : null);
|
|
1177
1172
|
}, []),
|
|
1178
1173
|
onPostDeauth: L(() => {
|
|
1179
|
-
g.template.clear(), g.messenger.clear(y == null ? void 0 : y.userId), x(null), u(void 0), k(null),
|
|
1174
|
+
g.template.clear(), g.messenger.clear(y == null ? void 0 : y.userId), x(null), u(void 0), k(null), D(null), O(null);
|
|
1180
1175
|
}, [g.template.clear, g.messenger.clear, y])
|
|
1181
|
-
}),
|
|
1182
|
-
var
|
|
1176
|
+
}), le = L(async () => {
|
|
1177
|
+
var S;
|
|
1183
1178
|
if (y) {
|
|
1184
1179
|
f.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"), u(void 0);
|
|
1185
|
-
const
|
|
1180
|
+
const $ = await Te({
|
|
1186
1181
|
aiAgentId: i,
|
|
1187
1182
|
userId: y.userId,
|
|
1188
1183
|
language: l,
|
|
1189
1184
|
country: c,
|
|
1190
1185
|
context: d,
|
|
1191
1186
|
forceCreateChannel: t,
|
|
1192
|
-
knownActiveChannelUrl: (
|
|
1187
|
+
knownActiveChannelUrl: (S = g.messenger.getSettings(y.userId)) == null ? void 0 : S.active_channel.channel_url
|
|
1193
1188
|
});
|
|
1194
|
-
return g.messenger.setSettings(y.userId,
|
|
1189
|
+
return g.messenger.setSettings(y.userId, $), u({ url: $.active_channel.channel_url, status: Q.OPEN }), f.info(
|
|
1195
1190
|
"agentMessengerSession.refreshActiveChannel: refreshed active channel",
|
|
1196
|
-
|
|
1197
|
-
),
|
|
1191
|
+
$.active_channel.channel_url
|
|
1192
|
+
), $.active_channel.channel_url;
|
|
1198
1193
|
} else
|
|
1199
1194
|
throw f.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"), new Error("userSession is not ready");
|
|
1200
1195
|
}, [
|
|
@@ -1209,58 +1204,77 @@ const zs = () => {
|
|
|
1209
1204
|
g.messenger.getSettings,
|
|
1210
1205
|
g.messenger.setSettings
|
|
1211
1206
|
]), Ae = L(
|
|
1212
|
-
async (
|
|
1207
|
+
async (S) => {
|
|
1213
1208
|
if (!(y != null && y.userId))
|
|
1214
1209
|
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
1215
|
-
const
|
|
1216
|
-
...
|
|
1210
|
+
const $ = await Te({
|
|
1211
|
+
...S,
|
|
1217
1212
|
userId: y.userId,
|
|
1218
1213
|
knownActiveChannelUrl: void 0
|
|
1219
|
-
}),
|
|
1220
|
-
return g.messenger.setSettings(y.userId,
|
|
1214
|
+
}), U = $.active_channel.channel_url;
|
|
1215
|
+
return g.messenger.setSettings(y.userId, $), U;
|
|
1221
1216
|
},
|
|
1222
1217
|
[y == null ? void 0 : y.userId, Te]
|
|
1223
|
-
),
|
|
1218
|
+
), A = L(
|
|
1219
|
+
async (S) => {
|
|
1220
|
+
if (!a.currentUser)
|
|
1221
|
+
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
1222
|
+
if (Object.entries(S.context).length === 0)
|
|
1223
|
+
return [];
|
|
1224
|
+
const $ = a.aiAgent.createConversationListQuery({
|
|
1225
|
+
aiAgentId: i,
|
|
1226
|
+
status: Q.OPEN,
|
|
1227
|
+
limit: 100
|
|
1228
|
+
}), U = [];
|
|
1229
|
+
for (; $.hasNext; ) {
|
|
1230
|
+
const K = await $.next();
|
|
1231
|
+
for (const te of K)
|
|
1232
|
+
js(te.context ?? {}, S.context) && U.push(te.channelInfo.url);
|
|
1233
|
+
}
|
|
1234
|
+
return U;
|
|
1235
|
+
},
|
|
1236
|
+
[a, i]
|
|
1237
|
+
), [he] = C(
|
|
1224
1238
|
() => fr(
|
|
1225
|
-
(
|
|
1226
|
-
var
|
|
1227
|
-
f.info("agentMessengerSession.channelChanged: channel.conversation",
|
|
1239
|
+
(S) => {
|
|
1240
|
+
var $;
|
|
1241
|
+
f.info("agentMessengerSession.channelChanged: channel.conversation", S.conversation), u({ url: S.url, status: (($ = S.conversation) == null ? void 0 : $.status) ?? Q.OPEN });
|
|
1228
1242
|
},
|
|
1229
1243
|
250,
|
|
1230
1244
|
{ trailing: !1, leading: !0 }
|
|
1231
1245
|
)
|
|
1232
1246
|
);
|
|
1233
1247
|
return vt(a, {
|
|
1234
|
-
onChannelChanged: (
|
|
1235
|
-
|
|
1248
|
+
onChannelChanged: (S) => {
|
|
1249
|
+
S.isGroupChannel() && S.url === (E == null ? void 0 : E.url) && he(S);
|
|
1236
1250
|
}
|
|
1237
1251
|
}), P(() => () => {
|
|
1238
|
-
|
|
1239
|
-
}, [
|
|
1240
|
-
const
|
|
1252
|
+
he.cancel();
|
|
1253
|
+
}, [he]), uo(r, () => {
|
|
1254
|
+
const S = async () => {
|
|
1241
1255
|
if (!E) throw new Error("No active conversation. Please start a conversation first.");
|
|
1242
1256
|
return await a.groupChannel.getChannel(E.url);
|
|
1243
1257
|
};
|
|
1244
1258
|
return {
|
|
1245
1259
|
activeChannel: E,
|
|
1246
1260
|
chatSDK: a,
|
|
1247
|
-
authenticate:
|
|
1261
|
+
authenticate: Le,
|
|
1248
1262
|
deauthenticate: Z,
|
|
1249
|
-
updateContext: async (
|
|
1250
|
-
const
|
|
1251
|
-
return { ...
|
|
1263
|
+
updateContext: async ($) => {
|
|
1264
|
+
const K = await (await S()).updateContext(i, $);
|
|
1265
|
+
return { ...K, context: K.context ?? {} };
|
|
1252
1266
|
},
|
|
1253
|
-
patchContext: async (
|
|
1254
|
-
const
|
|
1255
|
-
return { ...
|
|
1267
|
+
patchContext: async ($) => {
|
|
1268
|
+
const K = await (await S()).patchContext(i, $);
|
|
1269
|
+
return { ...K, context: K.context ?? {} };
|
|
1256
1270
|
},
|
|
1257
1271
|
getContextObject: async () => {
|
|
1258
|
-
const
|
|
1259
|
-
return { ...
|
|
1272
|
+
const U = await (await S()).getContextObject(i);
|
|
1273
|
+
return { ...U, context: U.context ?? {} };
|
|
1260
1274
|
}
|
|
1261
1275
|
};
|
|
1262
|
-
}, [
|
|
1263
|
-
|
|
1276
|
+
}, [Le, Z, E, a, i, f]), /* @__PURE__ */ o.createElement(
|
|
1277
|
+
Ws,
|
|
1264
1278
|
{
|
|
1265
1279
|
value: {
|
|
1266
1280
|
sdkUser: p,
|
|
@@ -1268,12 +1282,13 @@ const zs = () => {
|
|
|
1268
1282
|
userSession: y,
|
|
1269
1283
|
activeChannel: E,
|
|
1270
1284
|
setActiveChannel: u,
|
|
1271
|
-
refreshActiveChannel:
|
|
1285
|
+
refreshActiveChannel: le,
|
|
1272
1286
|
createConversation: Ae,
|
|
1287
|
+
searchConversation: A,
|
|
1273
1288
|
connectionError: v,
|
|
1274
|
-
aiAgentInfo:
|
|
1275
|
-
launcherInfo:
|
|
1276
|
-
authenticate:
|
|
1289
|
+
aiAgentInfo: T,
|
|
1290
|
+
launcherInfo: M,
|
|
1291
|
+
authenticate: Le,
|
|
1277
1292
|
deauthenticate: Z,
|
|
1278
1293
|
createAttachmentRules: j
|
|
1279
1294
|
}
|
|
@@ -1281,8 +1296,8 @@ const zs = () => {
|
|
|
1281
1296
|
n
|
|
1282
1297
|
);
|
|
1283
1298
|
}
|
|
1284
|
-
), js = () => {
|
|
1285
|
-
const e =
|
|
1299
|
+
), js = (e, t) => Object.entries(t).every(([n, r]) => e[n] === r), qs = () => {
|
|
1300
|
+
const e = Gt(), { chatSDK: t, networkStateAdapter: n } = X(), [r, s] = C(() => n ? n.isOnline() ? "connected" : "reconnecting" : "connected");
|
|
1286
1301
|
return P(() => {
|
|
1287
1302
|
const i = new xt({
|
|
1288
1303
|
onDisconnected: () => s("disconnected"),
|
|
@@ -1311,13 +1326,13 @@ const zs = () => {
|
|
|
1311
1326
|
}
|
|
1312
1327
|
}
|
|
1313
1328
|
}), n;
|
|
1314
|
-
},
|
|
1315
|
-
const { aiAgentInfo: r, userSession: s } = yt(), i =
|
|
1329
|
+
}, Ks = ({ channel: e, messages: t, isStreamAnimating: n }) => {
|
|
1330
|
+
const { aiAgentInfo: r, userSession: s } = yt(), i = qs(), a = Ys({
|
|
1316
1331
|
channel: e,
|
|
1317
1332
|
lastMessage: Cn(t, [Pe.SUCCEEDED]),
|
|
1318
1333
|
aiAgentUserId: (r == null ? void 0 : r.userId) ?? "",
|
|
1319
1334
|
isStreamAnimating: n
|
|
1320
|
-
}), l =
|
|
1335
|
+
}), l = Qs({
|
|
1321
1336
|
shouldApply: !!(e != null && e.isAIAgent) && !He(e),
|
|
1322
1337
|
isDisabledWhileAIResponding: a,
|
|
1323
1338
|
lastMessage: Cn(t, [Pe.PENDING, Pe.SUCCEEDED]),
|
|
@@ -1329,11 +1344,11 @@ const zs = () => {
|
|
|
1329
1344
|
return { disabled: !0, disabledBy: "reconnecting" };
|
|
1330
1345
|
if (ke(e))
|
|
1331
1346
|
return { disabled: !0, disabledBy: "conversation_closed" };
|
|
1332
|
-
if (
|
|
1347
|
+
if (Zs(e))
|
|
1333
1348
|
return { disabled: !0, disabledBy: "form_active" };
|
|
1334
|
-
const c =
|
|
1349
|
+
const c = Xs(e);
|
|
1335
1350
|
return c ? { disabled: !0, disabledBy: c } : a || l ? { disabled: !0, disabledBy: "ai_responding" } : { disabled: !1, disabledBy: "" };
|
|
1336
|
-
},
|
|
1351
|
+
}, Ys = ({
|
|
1337
1352
|
channel: e,
|
|
1338
1353
|
lastMessage: t,
|
|
1339
1354
|
aiAgentUserId: n,
|
|
@@ -1345,16 +1360,16 @@ const zs = () => {
|
|
|
1345
1360
|
const l = a.some((d) => d.userId === n), c = Qe(t, n) && (Ie.isStreaming(t) || r);
|
|
1346
1361
|
i(!!(c || l));
|
|
1347
1362
|
}, [a, t, n, r]), s;
|
|
1348
|
-
},
|
|
1363
|
+
}, Zs = (e) => {
|
|
1349
1364
|
var a;
|
|
1350
1365
|
const t = e == null ? void 0 : e.lastMessage;
|
|
1351
1366
|
if (!t || !e) return !1;
|
|
1352
1367
|
const n = t.extendedMessagePayload, r = n == null ? void 0 : n.form, s = r && !r.submitted_at && !r.canceled_at, i = e.isAIAgent && !!((a = e.conversation) != null && a.handedOverAt);
|
|
1353
1368
|
return s && !i;
|
|
1354
|
-
},
|
|
1369
|
+
}, Xs = (e) => {
|
|
1355
1370
|
const t = e == null ? void 0 : e.lastMessage, n = t == null ? void 0 : t.extendedMessagePayload;
|
|
1356
1371
|
return n == null ? void 0 : n.user_input_disabled_by;
|
|
1357
|
-
},
|
|
1372
|
+
}, Js = 3e4, Qs = ({
|
|
1358
1373
|
shouldApply: e,
|
|
1359
1374
|
lastMessage: t,
|
|
1360
1375
|
isDisabledWhileAIResponding: n,
|
|
@@ -1368,12 +1383,12 @@ const zs = () => {
|
|
|
1368
1383
|
a.current && clearTimeout(a.current), i(!0), a.current = setTimeout(() => {
|
|
1369
1384
|
i(!1), a.current = null;
|
|
1370
1385
|
}, b);
|
|
1371
|
-
}, g = Date.now() - l, f =
|
|
1386
|
+
}, g = Date.now() - l, f = Js - g;
|
|
1372
1387
|
return n || f <= 0 ? c() : d(f), () => {
|
|
1373
1388
|
a.current && clearTimeout(a.current);
|
|
1374
1389
|
};
|
|
1375
1390
|
}, [n, l]), s && e;
|
|
1376
|
-
},
|
|
1391
|
+
}, ei = () => {
|
|
1377
1392
|
const [e, t] = C(/* @__PURE__ */ new Set()), n = L((s) => {
|
|
1378
1393
|
t((i) => {
|
|
1379
1394
|
if (i.has(s)) return i;
|
|
@@ -1393,9 +1408,9 @@ const zs = () => {
|
|
|
1393
1408
|
stop: r
|
|
1394
1409
|
};
|
|
1395
1410
|
}, {
|
|
1396
|
-
Provider:
|
|
1411
|
+
Provider: ti
|
|
1397
1412
|
} = ee("AIAgentConversation");
|
|
1398
|
-
function
|
|
1413
|
+
function ni({
|
|
1399
1414
|
children: e,
|
|
1400
1415
|
channelUrl: t,
|
|
1401
1416
|
onChannelDeleted: n,
|
|
@@ -1409,8 +1424,8 @@ function ti({
|
|
|
1409
1424
|
shouldCountNewMessages: g = () => !1,
|
|
1410
1425
|
sortComparator: f
|
|
1411
1426
|
}) {
|
|
1412
|
-
var
|
|
1413
|
-
const b = () => d && (u == null ? void 0 : u.markAsRead()), { chatSDK: v, logger: _, dispatcher: E } = X(), { channel: u, channelFetchError: p, fetchChannel: x } =
|
|
1427
|
+
var O;
|
|
1428
|
+
const b = () => d && (u == null ? void 0 : u.markAsRead()), { chatSDK: v, logger: _, dispatcher: E } = X(), { channel: u, channelFetchError: p, fetchChannel: x } = ri(t), y = gs(v, u, {
|
|
1414
1429
|
replyType: Mo.ONLY_REPLY_TO_CHANNEL,
|
|
1415
1430
|
shouldCountNewMessages: g,
|
|
1416
1431
|
onChannelDeleted: n,
|
|
@@ -1419,7 +1434,7 @@ function ti({
|
|
|
1419
1434
|
logger: _,
|
|
1420
1435
|
markAsRead: b,
|
|
1421
1436
|
sortComparator: f
|
|
1422
|
-
}), k =
|
|
1437
|
+
}), k = ei(), T = Ks({
|
|
1423
1438
|
channel: u,
|
|
1424
1439
|
messages: y.messages,
|
|
1425
1440
|
isStreamAnimating: k.isAnimating
|
|
@@ -1427,19 +1442,19 @@ function ti({
|
|
|
1427
1442
|
P(() => {
|
|
1428
1443
|
b();
|
|
1429
1444
|
}, [d]);
|
|
1430
|
-
const
|
|
1445
|
+
const D = ke(u);
|
|
1431
1446
|
P(() => {
|
|
1432
|
-
i == null || i(
|
|
1433
|
-
}, [
|
|
1447
|
+
i == null || i(D);
|
|
1448
|
+
}, [D, i]), P(() => {
|
|
1434
1449
|
const N = async (j) => {
|
|
1435
|
-
const
|
|
1436
|
-
u &&
|
|
1450
|
+
const q = typeof (j == null ? void 0 : j.channelUrl) == "string";
|
|
1451
|
+
u && q && j.channelUrl !== u.url || (_.debug("conversation.dispatcher: try to close conversation", u), u != null && u.conversation && u.conversation.status === Q.OPEN && (await u.closeConversation(), a == null || a()));
|
|
1437
1452
|
};
|
|
1438
1453
|
return E.subscribe(Rt.ConversationClose, N), () => {
|
|
1439
1454
|
E.unsubscribe(Rt.ConversationClose, N);
|
|
1440
1455
|
};
|
|
1441
|
-
}, [E, (
|
|
1442
|
-
const
|
|
1456
|
+
}, [E, (O = u == null ? void 0 : u.conversation) == null ? void 0 : O.status, a]);
|
|
1457
|
+
const M = {
|
|
1443
1458
|
conversation: (u == null ? void 0 : u.conversation) ?? void 0,
|
|
1444
1459
|
channelSource: {
|
|
1445
1460
|
channel: u,
|
|
@@ -1459,16 +1474,16 @@ function ti({
|
|
|
1459
1474
|
resendMessage: (N) => y.resendMessage(N),
|
|
1460
1475
|
resetNewMessages: () => y.resetNewMessages(),
|
|
1461
1476
|
sendUserMessage: async (N) => {
|
|
1462
|
-
var
|
|
1463
|
-
if (((
|
|
1477
|
+
var q;
|
|
1478
|
+
if (((q = u == null ? void 0 : u.conversation) == null ? void 0 : q.status) === Q.CLOSED)
|
|
1464
1479
|
throw new Error("Conversation is closed");
|
|
1465
1480
|
l && (N = await l(N));
|
|
1466
1481
|
const j = await y.sendUserMessage(N, c);
|
|
1467
1482
|
return c == null || c(j), j;
|
|
1468
1483
|
},
|
|
1469
1484
|
sendFileMessage: async (N) => {
|
|
1470
|
-
var
|
|
1471
|
-
if (((
|
|
1485
|
+
var q;
|
|
1486
|
+
if (((q = u == null ? void 0 : u.conversation) == null ? void 0 : q.status) === Q.CLOSED)
|
|
1472
1487
|
throw new Error("Conversation is closed");
|
|
1473
1488
|
l && (N = await l(N));
|
|
1474
1489
|
const j = await y.sendFileMessage(N, c);
|
|
@@ -1477,12 +1492,12 @@ function ti({
|
|
|
1477
1492
|
},
|
|
1478
1493
|
state: {
|
|
1479
1494
|
streamAnimation: k,
|
|
1480
|
-
input:
|
|
1495
|
+
input: T
|
|
1481
1496
|
}
|
|
1482
1497
|
};
|
|
1483
|
-
return /* @__PURE__ */ o.createElement(
|
|
1498
|
+
return /* @__PURE__ */ o.createElement(ti, { value: M }, e);
|
|
1484
1499
|
}
|
|
1485
|
-
function
|
|
1500
|
+
function ri(e) {
|
|
1486
1501
|
const { chatSDK: t, logger: n } = X(), { sdkUser: r } = yt(), [s, i] = C(void 0), [a, l] = C(void 0);
|
|
1487
1502
|
async function c() {
|
|
1488
1503
|
if (!r) {
|
|
@@ -1498,7 +1513,7 @@ function ni(e) {
|
|
|
1498
1513
|
d instanceof _o && l(d), n.error("conversation.fetchChannel: error", d);
|
|
1499
1514
|
}
|
|
1500
1515
|
}
|
|
1501
|
-
return
|
|
1516
|
+
return oi(s), P(() => {
|
|
1502
1517
|
c();
|
|
1503
1518
|
}, [t, r, e]), {
|
|
1504
1519
|
channel: s,
|
|
@@ -1506,8 +1521,8 @@ function ni(e) {
|
|
|
1506
1521
|
fetchChannel: c
|
|
1507
1522
|
};
|
|
1508
1523
|
}
|
|
1509
|
-
function
|
|
1510
|
-
const { chatSDK: t } = X(), { activeChannel: n, setActiveChannel: r } = yt(), s =
|
|
1524
|
+
function oi(e) {
|
|
1525
|
+
const { chatSDK: t } = X(), { activeChannel: n, setActiveChannel: r } = yt(), s = Gt();
|
|
1511
1526
|
P(() => {
|
|
1512
1527
|
if (!e || !n) return;
|
|
1513
1528
|
const i = new xt({
|
|
@@ -1525,7 +1540,7 @@ function ri(e) {
|
|
|
1525
1540
|
};
|
|
1526
1541
|
}, [t, e, n]);
|
|
1527
1542
|
}
|
|
1528
|
-
class
|
|
1543
|
+
class si {
|
|
1529
1544
|
/**
|
|
1530
1545
|
* Creates a new ConversationListCollection instance.
|
|
1531
1546
|
* @param sdk - The Sendbird Chat SDK instance
|
|
@@ -1647,7 +1662,7 @@ class oi {
|
|
|
1647
1662
|
}
|
|
1648
1663
|
const l = Bt(this._channels, a), c = l < 0;
|
|
1649
1664
|
!c && this._channels.splice(l, 1);
|
|
1650
|
-
const g =
|
|
1665
|
+
const g = ii(this._channels, a, this._order).place, f = g === this._channels.length;
|
|
1651
1666
|
c ? f ? (n || !this.hasMore) && (this._channels.push(a), s.push(a)) : (this._channels.splice(g, 0, a), s.push(a)) : (this._channels.splice(g, 0, a), i.push(a));
|
|
1652
1667
|
}
|
|
1653
1668
|
return { addedChannels: s, updatedChannels: i, unmatchedChannelUrls: r };
|
|
@@ -1724,7 +1739,7 @@ class oi {
|
|
|
1724
1739
|
this._isDisposed || (this._isDisposed = !0, this._throttledOnChannelChanged.cancel(), this._collectionEventHandler = void 0, this._sdk.removeConnectionHandler(this._handlerId), this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId), this._pinnedChannels.length = 0, this._channels.length = 0);
|
|
1725
1740
|
}
|
|
1726
1741
|
}
|
|
1727
|
-
const Bt = (e, t) => e.findIndex((n) => n.isIdentical(t)),
|
|
1742
|
+
const Bt = (e, t) => e.findIndex((n) => n.isIdentical(t)), ii = (e, t, n) => {
|
|
1728
1743
|
if (e.length > 0) {
|
|
1729
1744
|
const r = Bt(e, t);
|
|
1730
1745
|
let s = 0, i = e.length - 1, a = Math.floor((s + i) / 2);
|
|
@@ -1751,27 +1766,27 @@ const Bt = (e, t) => e.findIndex((n) => n.isIdentical(t)), si = (e, t, n) => {
|
|
|
1751
1766
|
return 0;
|
|
1752
1767
|
}
|
|
1753
1768
|
};
|
|
1754
|
-
function
|
|
1755
|
-
var _, E, u, p, x, y, k,
|
|
1756
|
-
const n =
|
|
1769
|
+
function ai(e, t) {
|
|
1770
|
+
var _, E, u, p, x, y, k, T, D, M;
|
|
1771
|
+
const n = Gt(), [r, s] = C(!1), [i, a] = C(null), [l, c] = C([]), [d, g] = C(null), f = B(!1), b = L(async () => {
|
|
1757
1772
|
if (!f.current && e.currentUser) {
|
|
1758
1773
|
f.current = !0, s(!1), a(null), c([]);
|
|
1759
1774
|
try {
|
|
1760
1775
|
d == null || d.dispose();
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1776
|
+
const O = new si(e, t);
|
|
1777
|
+
O.setConversationListCollectionHandler({
|
|
1763
1778
|
onChannelsAdded: () => {
|
|
1764
|
-
c(
|
|
1779
|
+
c(O.channels);
|
|
1765
1780
|
},
|
|
1766
1781
|
onChannelsUpdated: () => {
|
|
1767
|
-
c(
|
|
1782
|
+
c(O.channels);
|
|
1768
1783
|
},
|
|
1769
1784
|
onChannelsDeleted: () => {
|
|
1770
|
-
c(
|
|
1785
|
+
c(O.channels);
|
|
1771
1786
|
}
|
|
1772
|
-
}), await
|
|
1773
|
-
} catch (
|
|
1774
|
-
g(null), a(
|
|
1787
|
+
}), await O.loadMore(), g(O), a(null);
|
|
1788
|
+
} catch (O) {
|
|
1789
|
+
g(null), a(O);
|
|
1775
1790
|
} finally {
|
|
1776
1791
|
s(!0), f.current = !1;
|
|
1777
1792
|
}
|
|
@@ -1783,16 +1798,16 @@ function ii(e, t) {
|
|
|
1783
1798
|
(u = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : u.join(),
|
|
1784
1799
|
(x = (p = t.filter) == null ? void 0 : p.aiAgentIds) == null ? void 0 : x.join(),
|
|
1785
1800
|
(y = t.filter) == null ? void 0 : y.deskChannelFilter,
|
|
1786
|
-
(
|
|
1787
|
-
(
|
|
1788
|
-
(
|
|
1801
|
+
(T = (k = t.filter) == null ? void 0 : k.pinnedChannelUrls) == null ? void 0 : T.join(),
|
|
1802
|
+
(D = t.filter) == null ? void 0 : D.copilotConversationOnly,
|
|
1803
|
+
(M = t.filter) == null ? void 0 : M.copilotSupportChannelUrl,
|
|
1789
1804
|
t.limit
|
|
1790
1805
|
]), v = L(async () => {
|
|
1791
1806
|
if (d)
|
|
1792
1807
|
try {
|
|
1793
1808
|
await d.loadMore();
|
|
1794
|
-
} catch (
|
|
1795
|
-
a(
|
|
1809
|
+
} catch (O) {
|
|
1810
|
+
a(O);
|
|
1796
1811
|
}
|
|
1797
1812
|
}, [d]);
|
|
1798
1813
|
return P(() => (e.addConnectionHandler(n, new xt({ onConnected: () => b() })), () => e.removeConnectionHandler(n)), [e, n, b]), P(() => {
|
|
@@ -1807,9 +1822,9 @@ function ii(e, t) {
|
|
|
1807
1822
|
};
|
|
1808
1823
|
}
|
|
1809
1824
|
const {
|
|
1810
|
-
Provider:
|
|
1825
|
+
Provider: li
|
|
1811
1826
|
} = ee("AIAgentConversationList");
|
|
1812
|
-
function
|
|
1827
|
+
function ci({
|
|
1813
1828
|
conversationListLimit: e,
|
|
1814
1829
|
conversationListFilter: t,
|
|
1815
1830
|
children: n
|
|
@@ -1822,7 +1837,7 @@ function li({
|
|
|
1822
1837
|
...a,
|
|
1823
1838
|
...(b = i == null ? void 0 : i.conversationListParams) == null ? void 0 : b.filter,
|
|
1824
1839
|
...t
|
|
1825
|
-
}, d =
|
|
1840
|
+
}, d = ai(r, { limit: l, filter: c }), g = {
|
|
1826
1841
|
listSource: {
|
|
1827
1842
|
initialized: d.initialized,
|
|
1828
1843
|
error: d.error ?? void 0,
|
|
@@ -1830,9 +1845,9 @@ function li({
|
|
|
1830
1845
|
loadMore: () => d.loadMore()
|
|
1831
1846
|
}
|
|
1832
1847
|
};
|
|
1833
|
-
return /* @__PURE__ */ o.createElement(
|
|
1848
|
+
return /* @__PURE__ */ o.createElement(li, { value: g }, n);
|
|
1834
1849
|
}
|
|
1835
|
-
function
|
|
1850
|
+
function di(e) {
|
|
1836
1851
|
let t = "pending", n = e.then((r) => {
|
|
1837
1852
|
t = "resolved", n = r;
|
|
1838
1853
|
}).catch((r) => {
|
|
@@ -1847,10 +1862,10 @@ function ci(e) {
|
|
|
1847
1862
|
};
|
|
1848
1863
|
}
|
|
1849
1864
|
const {
|
|
1850
|
-
Provider:
|
|
1865
|
+
Provider: ui,
|
|
1851
1866
|
useContext: _r
|
|
1852
1867
|
} = ee("MessageTemplateFetching");
|
|
1853
|
-
function
|
|
1868
|
+
function mi({ children: e, internalVariables: t }) {
|
|
1854
1869
|
const n = B({}), r = B({}), [s, i] = C({}), a = L((d, g) => {
|
|
1855
1870
|
i((f) => ({
|
|
1856
1871
|
...f,
|
|
@@ -1882,7 +1897,7 @@ function ui({ children: e, internalVariables: t }) {
|
|
|
1882
1897
|
suspend: (d, g) => {
|
|
1883
1898
|
if (n.current[d])
|
|
1884
1899
|
return n.current[d];
|
|
1885
|
-
const f =
|
|
1900
|
+
const f = di(g());
|
|
1886
1901
|
return n.current[d] = f, f;
|
|
1887
1902
|
},
|
|
1888
1903
|
getIsFetching: (d) => {
|
|
@@ -1894,7 +1909,7 @@ function ui({ children: e, internalVariables: t }) {
|
|
|
1894
1909
|
return ((g = s[d]) == null ? void 0 : g.error) ?? !1;
|
|
1895
1910
|
}
|
|
1896
1911
|
};
|
|
1897
|
-
return /* @__PURE__ */ o.createElement(
|
|
1912
|
+
return /* @__PURE__ */ o.createElement(ui, { value: c }, e);
|
|
1898
1913
|
}
|
|
1899
1914
|
const Ct = {
|
|
1900
1915
|
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
@@ -1920,7 +1935,7 @@ function Me({
|
|
|
1920
1935
|
variableValueTransformer: (r) => Us(e, r)
|
|
1921
1936
|
});
|
|
1922
1937
|
}
|
|
1923
|
-
function
|
|
1938
|
+
function gi({
|
|
1924
1939
|
theme: e,
|
|
1925
1940
|
uiTemplateString: t,
|
|
1926
1941
|
viewVariables: n = {},
|
|
@@ -1957,7 +1972,7 @@ function mi({
|
|
|
1957
1972
|
}
|
|
1958
1973
|
});
|
|
1959
1974
|
}
|
|
1960
|
-
async function
|
|
1975
|
+
async function hi({
|
|
1961
1976
|
theme: e,
|
|
1962
1977
|
uiTemplateString: t,
|
|
1963
1978
|
viewVariables: n = {},
|
|
@@ -1993,7 +2008,7 @@ async function gi({
|
|
|
1993
2008
|
}
|
|
1994
2009
|
});
|
|
1995
2010
|
}
|
|
1996
|
-
const
|
|
2011
|
+
const pi = ({
|
|
1997
2012
|
rawTemplate: e,
|
|
1998
2013
|
aiAgentColorVariables: t,
|
|
1999
2014
|
internalVariables: n,
|
|
@@ -2002,7 +2017,7 @@ const hi = ({
|
|
|
2002
2017
|
const { ui_template: s, color_variables: i } = et(e);
|
|
2003
2018
|
let a = JSON.stringify(s);
|
|
2004
2019
|
if (Object.keys(r.viewVariables ?? {}).length > 0) {
|
|
2005
|
-
const c =
|
|
2020
|
+
const c = gi({
|
|
2006
2021
|
...r,
|
|
2007
2022
|
uiTemplateString: a,
|
|
2008
2023
|
aiAgentColorVariables: t,
|
|
@@ -2012,7 +2027,7 @@ const hi = ({
|
|
|
2012
2027
|
a = c;
|
|
2013
2028
|
}
|
|
2014
2029
|
return a = $e({ ...r, uiTemplateString: a, variables: n }), a = Me({ ...r, uiTemplateString: a, colorVariables: i }), a = Me({ ...r, uiTemplateString: a, colorVariables: t }), a = $e({ ...r, uiTemplateString: a }), _t(a);
|
|
2015
|
-
},
|
|
2030
|
+
}, fi = async ({
|
|
2016
2031
|
rawTemplate: e,
|
|
2017
2032
|
aiAgentColorVariables: t,
|
|
2018
2033
|
internalVariables: n,
|
|
@@ -2020,17 +2035,17 @@ const hi = ({
|
|
|
2020
2035
|
}) => {
|
|
2021
2036
|
const { ui_template: s, color_variables: i } = et(e);
|
|
2022
2037
|
let a = JSON.stringify(s);
|
|
2023
|
-
return Object.keys(r.viewVariables ?? {}).length > 0 && (a = await
|
|
2038
|
+
return Object.keys(r.viewVariables ?? {}).length > 0 && (a = await hi({
|
|
2024
2039
|
...r,
|
|
2025
2040
|
uiTemplateString: a,
|
|
2026
2041
|
aiAgentColorVariables: t,
|
|
2027
2042
|
internalVariables: n
|
|
2028
2043
|
})), a = $e({ ...r, uiTemplateString: a, variables: n }), a = Me({ ...r, uiTemplateString: a, colorVariables: i }), a = Me({ ...r, uiTemplateString: a, colorVariables: t }), a = $e({ ...r, uiTemplateString: a }), _t(a);
|
|
2029
|
-
},
|
|
2044
|
+
}, bi = (e) => {
|
|
2030
2045
|
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = _r();
|
|
2031
2046
|
return C(() => {
|
|
2032
2047
|
const r = e.onGetCachedTemplate(e.templateKey);
|
|
2033
|
-
return r ?
|
|
2048
|
+
return r ? pi({
|
|
2034
2049
|
...e,
|
|
2035
2050
|
rawTemplate: r,
|
|
2036
2051
|
aiAgentColorVariables: t,
|
|
@@ -2038,20 +2053,20 @@ const hi = ({
|
|
|
2038
2053
|
onRequestTemplate: e.onGetCachedTemplate
|
|
2039
2054
|
}) : null;
|
|
2040
2055
|
});
|
|
2041
|
-
},
|
|
2042
|
-
const [t] =
|
|
2056
|
+
}, Ei = (e) => {
|
|
2057
|
+
const [t] = bi(e);
|
|
2043
2058
|
if (t) return t;
|
|
2044
2059
|
const { aiAgentColorVariables: n = {} } = e, { internalVariables: r, fetchTemplate: s, suspend: i } = _r();
|
|
2045
2060
|
return i(e.templateKey, async () => {
|
|
2046
2061
|
const l = await s({ ...e, suspense: !0 });
|
|
2047
|
-
return await
|
|
2062
|
+
return await fi({
|
|
2048
2063
|
...e,
|
|
2049
2064
|
rawTemplate: l,
|
|
2050
2065
|
aiAgentColorVariables: n,
|
|
2051
2066
|
internalVariables: r
|
|
2052
2067
|
});
|
|
2053
2068
|
}).value;
|
|
2054
|
-
},
|
|
2069
|
+
}, xi = "remove_powered_by", Xt = (e, t) => {
|
|
2055
2070
|
var s, i;
|
|
2056
2071
|
const { chatSDK: n } = X(), { aiAgentInfo: r } = yt();
|
|
2057
2072
|
if (e === "handoff-button") {
|
|
@@ -2062,10 +2077,10 @@ const hi = ({
|
|
|
2062
2077
|
return !!(t != null && t.isAIAgent) && !!(r != null && r.specialNoticeEnabled) && !!(r != null && r.specialNotice);
|
|
2063
2078
|
if (e === "powered-by") {
|
|
2064
2079
|
const a = (i = n == null ? void 0 : n.appInfo) == null ? void 0 : i.applicationAttributes;
|
|
2065
|
-
return
|
|
2080
|
+
return ae(() => !(Array.isArray(a) && a.includes(xi)), [a]);
|
|
2066
2081
|
}
|
|
2067
2082
|
throw new Error("Unsupported feature");
|
|
2068
|
-
},
|
|
2083
|
+
}, vi = {
|
|
2069
2084
|
required: "This question is required",
|
|
2070
2085
|
minLength: (e) => `Minimum ${e} characters required`,
|
|
2071
2086
|
maxLength: (e) => `Maximum ${e} characters allowed`,
|
|
@@ -2075,7 +2090,7 @@ const hi = ({
|
|
|
2075
2090
|
maxSelect: (e) => `Select at most ${e} options`,
|
|
2076
2091
|
regex: "Invalid format",
|
|
2077
2092
|
invalidSelection: "Invalid selection"
|
|
2078
|
-
},
|
|
2093
|
+
}, _i = {
|
|
2079
2094
|
getValueOrDefault: (e) => e.value ?? e.default_value ?? null,
|
|
2080
2095
|
validate: (e, t, n) => {
|
|
2081
2096
|
const r = t;
|
|
@@ -2106,7 +2121,7 @@ const hi = ({
|
|
|
2106
2121
|
}
|
|
2107
2122
|
return { isValid: !0 };
|
|
2108
2123
|
}
|
|
2109
|
-
},
|
|
2124
|
+
}, yi = {
|
|
2110
2125
|
getValueOrDefault: (e) => e.value ?? e.default_value ?? null,
|
|
2111
2126
|
validate: (e, t, n) => {
|
|
2112
2127
|
const r = t;
|
|
@@ -2132,7 +2147,7 @@ const hi = ({
|
|
|
2132
2147
|
}
|
|
2133
2148
|
return { isValid: !0 };
|
|
2134
2149
|
}
|
|
2135
|
-
},
|
|
2150
|
+
}, Ci = {
|
|
2136
2151
|
getValueOrDefault: (e) => e.value ?? e.default_value ?? null,
|
|
2137
2152
|
validate: (e, t, n) => {
|
|
2138
2153
|
const r = t;
|
|
@@ -2144,7 +2159,7 @@ const hi = ({
|
|
|
2144
2159
|
error: n.invalidSelection
|
|
2145
2160
|
} : { isValid: !0 };
|
|
2146
2161
|
}
|
|
2147
|
-
},
|
|
2162
|
+
}, Si = {
|
|
2148
2163
|
getValueOrDefault: (e) => e.values ?? e.default_values ?? null,
|
|
2149
2164
|
validate: (e, t, n) => {
|
|
2150
2165
|
const r = t;
|
|
@@ -2175,32 +2190,32 @@ const hi = ({
|
|
|
2175
2190
|
}
|
|
2176
2191
|
return { isValid: !0 };
|
|
2177
2192
|
}
|
|
2178
|
-
}, Si = {
|
|
2179
|
-
text: vi,
|
|
2180
|
-
number: _i,
|
|
2181
|
-
"single-select": yi,
|
|
2182
|
-
"multi-select": Ci
|
|
2183
2193
|
}, Ti = {
|
|
2194
|
+
text: _i,
|
|
2195
|
+
number: yi,
|
|
2196
|
+
"single-select": Ci,
|
|
2197
|
+
"multi-select": Si
|
|
2198
|
+
}, Ai = {
|
|
2184
2199
|
getValueOrDefault: () => null,
|
|
2185
2200
|
validate: () => ({ isValid: !1 })
|
|
2186
2201
|
};
|
|
2187
2202
|
function yr(e) {
|
|
2188
|
-
return
|
|
2203
|
+
return Ti[e.type] || Ai;
|
|
2189
2204
|
}
|
|
2190
2205
|
function $n(e) {
|
|
2191
2206
|
return yr(e).getValueOrDefault(e);
|
|
2192
2207
|
}
|
|
2193
|
-
function
|
|
2194
|
-
const r = { ...
|
|
2208
|
+
function wi(e, t, n = {}) {
|
|
2209
|
+
const r = { ...vi, ...n };
|
|
2195
2210
|
return yr(e).validate(e, t, r);
|
|
2196
2211
|
}
|
|
2197
|
-
const
|
|
2212
|
+
const Ii = (e, t = {}) => {
|
|
2198
2213
|
const { labels: n = {}, onSubmit: r, onCancel: s } = t, [i, a] = C({}), [l, c] = C(() => {
|
|
2199
2214
|
const E = {};
|
|
2200
2215
|
return e.fields.forEach((u) => {
|
|
2201
2216
|
E[u.key] = $n(u);
|
|
2202
2217
|
}), E;
|
|
2203
|
-
}), d =
|
|
2218
|
+
}), d = ae(() => e.submitted_at ? "submitted" : e.canceled_at ? "canceled" : "draft", [e.submitted_at, e.canceled_at]);
|
|
2204
2219
|
P(() => {
|
|
2205
2220
|
if (d === "submitted" || d === "canceled") {
|
|
2206
2221
|
const E = {};
|
|
@@ -2259,7 +2274,7 @@ const wi = (e, t = {}) => {
|
|
|
2259
2274
|
const E = {};
|
|
2260
2275
|
let u = !1;
|
|
2261
2276
|
for (const p of e.fields) {
|
|
2262
|
-
const x = l[p.key] ?? null, y =
|
|
2277
|
+
const x = l[p.key] ?? null, y = wi(p, x, n);
|
|
2263
2278
|
y.isValid || (E[p.key] = y.error, u = !0);
|
|
2264
2279
|
}
|
|
2265
2280
|
if (a(E), !u && r) {
|
|
@@ -2293,20 +2308,16 @@ const wi = (e, t = {}) => {
|
|
|
2293
2308
|
return e.isAIAgent ? He(e) ? s.human("agent") : s.ai("delight") : e.isDesk ? s.human("agent") : s.channel("user");
|
|
2294
2309
|
}, Mn = (e) => mo((t, n) => ({ ...t, ...n }), e);
|
|
2295
2310
|
var Ee = /* @__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))(Ee || {});
|
|
2296
|
-
const
|
|
2311
|
+
const ki = /* @__PURE__ */ new Set(["free_text", "single_choice"]), $i = ({ csatPayload: e, type: t, initialCsat: n, initialCsatReason: r, initialIsResolved: s }) => {
|
|
2297
2312
|
const [i, a] = Mn({
|
|
2298
2313
|
csatType: t,
|
|
2299
2314
|
csat: n,
|
|
2300
2315
|
csatReason: r,
|
|
2301
2316
|
isResolved: s
|
|
2302
|
-
}), [l, c] = Mn({ followUpItem: !1 }), d =
|
|
2303
|
-
var
|
|
2304
|
-
const v = i.csat;
|
|
2305
|
-
if (
|
|
2306
|
-
const _ = (E = e.follow_up) == null ? void 0 : E.find(
|
|
2307
|
-
(u) => u.scores.includes(v)
|
|
2308
|
-
);
|
|
2309
|
-
if (Ii.has(_ == null ? void 0 : _.response_type)) return _;
|
|
2317
|
+
}), [l, c] = Mn({ followUpItem: !1 }), d = ae(() => {
|
|
2318
|
+
var u;
|
|
2319
|
+
const v = i.csat, _ = typeof v == "number", E = (u = e.follow_up) == null ? void 0 : u.find((p) => _ ? p.scores.includes(v) : p.always_visible ?? !1);
|
|
2320
|
+
if (ki.has(E == null ? void 0 : E.response_type)) return E;
|
|
2310
2321
|
}, [i.csat, e.follow_up]), g = (() => {
|
|
2311
2322
|
var v;
|
|
2312
2323
|
if (typeof n == "number")
|
|
@@ -2335,8 +2346,8 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2335
2346
|
submitted: g === "submitted"
|
|
2336
2347
|
}
|
|
2337
2348
|
};
|
|
2338
|
-
}, kt = 5,
|
|
2339
|
-
const { text: t, enabled: n = !1, onAnimationStart: r, onAnimationProgress: s, onAnimationComplete: i } = e, [a, l] = C(() =>
|
|
2349
|
+
}, kt = 5, Mi = 250, Oi = 50, On = (e) => Math.max(0, e - Oi), Li = (e) => e < 1e3 ? { speed: kt * 0.5, chunkSize: 2 } : e < 2e3 ? { speed: kt * 0.8, chunkSize: 2 } : { speed: kt * 0.6, chunkSize: 3 }, Di = (e) => {
|
|
2350
|
+
const { text: t, enabled: n = !1, onAnimationStart: r, onAnimationProgress: s, onAnimationComplete: i } = e, [a, l] = C(() => On(t.length)), c = B(null), d = B({
|
|
2340
2351
|
startTime: 0,
|
|
2341
2352
|
lastUpdate: 0,
|
|
2342
2353
|
lastProgressCall: 0
|
|
@@ -2352,20 +2363,20 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2352
2363
|
textLength: t.length,
|
|
2353
2364
|
enabled: n
|
|
2354
2365
|
}).current, v = n, _ = a < t.length, E = b.initialEnabled && (v || _);
|
|
2355
|
-
return
|
|
2366
|
+
return se(() => {
|
|
2356
2367
|
g.onStart = r, g.onProgress = s, g.onComplete = i, b.textLength = t.length, b.enabled = n;
|
|
2357
|
-
}),
|
|
2368
|
+
}), se(() => {
|
|
2358
2369
|
var u;
|
|
2359
2370
|
b.initialEnabled && (f.startCalled || (f.startCalled = !0, (u = g.onStart) == null || u.call(g)), l((p) => t.length < p ? t.length : p));
|
|
2360
2371
|
}, [t]), P(() => {
|
|
2361
2372
|
if (!b.initialEnabled) return;
|
|
2362
|
-
let u =
|
|
2373
|
+
let u = On(t.length);
|
|
2363
2374
|
d.lastUpdate = 0, d.startTime = 0, d.lastProgressCall = 0;
|
|
2364
2375
|
const p = (x) => {
|
|
2365
2376
|
var j;
|
|
2366
2377
|
d.lastUpdate === 0 && (d.lastUpdate = x, d.startTime = x, d.lastProgressCall = x);
|
|
2367
|
-
const y = b.textLength, k = x - d.lastUpdate,
|
|
2368
|
-
k >=
|
|
2378
|
+
const y = b.textLength, k = x - d.lastUpdate, T = x - d.startTime, { speed: D, chunkSize: M } = Li(T), O = D * M;
|
|
2379
|
+
k >= O && u < y && (u = Math.min(u + M, y), l(u), d.lastUpdate = x), x - d.lastProgressCall >= Mi && (d.lastProgressCall = x, (j = g.onProgress) == null || j.call(g)), (u < y || b.enabled) && (c.current = requestAnimationFrame(p));
|
|
2369
2380
|
};
|
|
2370
2381
|
return c.current = requestAnimationFrame(p), () => {
|
|
2371
2382
|
c.current && cancelAnimationFrame(c.current);
|
|
@@ -2378,7 +2389,7 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2378
2389
|
streamText: b.initialEnabled ? t.slice(0, a) : t,
|
|
2379
2390
|
isAnimating: E
|
|
2380
2391
|
};
|
|
2381
|
-
},
|
|
2392
|
+
}, Ri = '@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;right:0;bottom:0;left: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}', Ni = {
|
|
2382
2393
|
conversation: {
|
|
2383
2394
|
input_placeholder: "Ask a question",
|
|
2384
2395
|
input_placeholder_disabled: "Chat is unavailable in this channel",
|
|
@@ -2447,9 +2458,9 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2447
2458
|
}
|
|
2448
2459
|
}, Ft = {
|
|
2449
2460
|
language: "en",
|
|
2450
|
-
strings:
|
|
2461
|
+
strings: Ni,
|
|
2451
2462
|
dateLocale: $o
|
|
2452
|
-
},
|
|
2463
|
+
}, Bi = (e) => ({
|
|
2453
2464
|
// Message Input
|
|
2454
2465
|
MESSAGE_INPUT__PLACE_HOLDER: e.conversation.input_placeholder,
|
|
2455
2466
|
MESSAGE_INPUT__PLACE_HOLDER__DISABLED: e.conversation.input_placeholder_disabled,
|
|
@@ -2513,10 +2524,10 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2513
2524
|
A11Y_OPEN_CONVERSATION_LIST: e.conversation.a11y_open_conversation_list,
|
|
2514
2525
|
// Scroll
|
|
2515
2526
|
SCROLL_TO_NEW_MESSAGES_LABEL: e.conversation.scroll_to_new_messages_label
|
|
2516
|
-
}),
|
|
2527
|
+
}), Fi = (e) => {
|
|
2517
2528
|
var t;
|
|
2518
2529
|
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? St;
|
|
2519
|
-
}, St = "en",
|
|
2530
|
+
}, St = "en", Pi = /* @__PURE__ */ new Set([St, "ko", "es", "pt", "fr", "hi", "it", "de", "tr", "ja"]), Ui = (e, t, n) => {
|
|
2520
2531
|
const r = e[t];
|
|
2521
2532
|
return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((s, i) => {
|
|
2522
2533
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
@@ -2528,8 +2539,8 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2528
2539
|
)
|
|
2529
2540
|
);
|
|
2530
2541
|
});
|
|
2531
|
-
},
|
|
2532
|
-
...
|
|
2542
|
+
}, Ln = Bi(Ft.strings), Hi = {
|
|
2543
|
+
...Ln,
|
|
2533
2544
|
// Channel Header
|
|
2534
2545
|
HEADER_BUTTON__AGENT_HANDOFF: "Connect with an agent",
|
|
2535
2546
|
// Message Input
|
|
@@ -2561,7 +2572,7 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2561
2572
|
FORM_VALIDATION_MAX_SELECT: (e) => `Select at most ${e} options`,
|
|
2562
2573
|
FORM_VALIDATION_REGEX_FAILED: "Invalid format",
|
|
2563
2574
|
/** @deprecated Please use DATE_FORMAT__DATE_SHORT instead. **/
|
|
2564
|
-
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:
|
|
2575
|
+
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: Ln.DATE_FORMAT__DATE_SHORT,
|
|
2565
2576
|
/** @deprecated Unused string **/
|
|
2566
2577
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma",
|
|
2567
2578
|
/** @deprecated Unused string **/
|
|
@@ -2583,17 +2594,17 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
|
|
|
2583
2594
|
}, pt = {
|
|
2584
2595
|
language: Ft.language,
|
|
2585
2596
|
dateLocale: Ft.dateLocale,
|
|
2586
|
-
stringSet:
|
|
2587
|
-
},
|
|
2597
|
+
stringSet: Hi
|
|
2598
|
+
}, Vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2588
2599
|
__proto__: null,
|
|
2589
2600
|
default: pt
|
|
2590
2601
|
}, Symbol.toStringTag, { value: "Module" })), Pt = /* @__PURE__ */ new Map([[St, pt]]);
|
|
2591
|
-
async function
|
|
2602
|
+
async function zi(e) {
|
|
2592
2603
|
const t = Pt.get(e);
|
|
2593
2604
|
if (t) return t;
|
|
2594
2605
|
try {
|
|
2595
|
-
if (
|
|
2596
|
-
const { default: n } = await
|
|
2606
|
+
if (Pi.has(e)) {
|
|
2607
|
+
const { default: n } = await Ui(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./BW6o50qt.js"), "./languages/en.ts": () => Promise.resolve().then(() => Vi), "./languages/es.ts": () => import("./Bw9xvmqB.js"), "./languages/fr.ts": () => import("./C66w0Vo6.js"), "./languages/hi.ts": () => import("./DvF4h9BU.js"), "./languages/it.ts": () => import("./FYaa05gN.js"), "./languages/ja.ts": () => import("./BJNTmQ2V.js"), "./languages/ko.ts": () => import("./t-xO5mFL.js"), "./languages/pt.ts": () => import("./b3j3zOSP.js"), "./languages/tr.ts": () => import("./Ge_YPjjg.js") }), `./languages/${e}.ts`, 3);
|
|
2597
2608
|
return Pt.set(e, n), n;
|
|
2598
2609
|
}
|
|
2599
2610
|
return pt;
|
|
@@ -2602,8 +2613,8 @@ async function Vi(e) {
|
|
|
2602
2613
|
}
|
|
2603
2614
|
}
|
|
2604
2615
|
const {
|
|
2605
|
-
Provider:
|
|
2606
|
-
useContext:
|
|
2616
|
+
Provider: Wi,
|
|
2617
|
+
useContext: W
|
|
2607
2618
|
} = ee("Localization"), Gi = ({
|
|
2608
2619
|
language: e = navigator.language,
|
|
2609
2620
|
logger: t,
|
|
@@ -2612,10 +2623,10 @@ const {
|
|
|
2612
2623
|
}) => {
|
|
2613
2624
|
const [s, i] = C(Pt.get(St));
|
|
2614
2625
|
return P(() => {
|
|
2615
|
-
const a =
|
|
2616
|
-
s.language !== a && (t == null || t.debug("localization.useEffect: update language", { from: s.language, to: a }),
|
|
2626
|
+
const a = Fi(e);
|
|
2627
|
+
s.language !== a && (t == null || t.debug("localization.useEffect: update language", { from: s.language, to: a }), zi(a).then(i));
|
|
2617
2628
|
}, [e, t]), /* @__PURE__ */ o.createElement(
|
|
2618
|
-
|
|
2629
|
+
Wi,
|
|
2619
2630
|
{
|
|
2620
2631
|
value: {
|
|
2621
2632
|
language: s.language,
|
|
@@ -2634,7 +2645,7 @@ const {
|
|
|
2634
2645
|
}, F = {
|
|
2635
2646
|
light: Dn("light"),
|
|
2636
2647
|
dark: Dn("dark")
|
|
2637
|
-
},
|
|
2648
|
+
}, ji = I(({ theme: e }) => {
|
|
2638
2649
|
const { palette: t } = e;
|
|
2639
2650
|
return `
|
|
2640
2651
|
:root,
|
|
@@ -2686,7 +2697,7 @@ const {
|
|
|
2686
2697
|
--sendbird-overlay-light: ${t.overlay.light};
|
|
2687
2698
|
}
|
|
2688
2699
|
`;
|
|
2689
|
-
}),
|
|
2700
|
+
}), qi = I`[${ft}='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);}[${ft}='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);}`, m = {
|
|
2690
2701
|
color: {
|
|
2691
2702
|
primary: {
|
|
2692
2703
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -2730,10 +2741,10 @@ const {
|
|
|
2730
2741
|
secondary: "var(--sb-secondary)"
|
|
2731
2742
|
}
|
|
2732
2743
|
}, {
|
|
2733
|
-
Provider:
|
|
2744
|
+
Provider: Ki,
|
|
2734
2745
|
useContext: Sr
|
|
2735
2746
|
} = ee("MessengerTheme");
|
|
2736
|
-
function
|
|
2747
|
+
function Yi(e) {
|
|
2737
2748
|
const { theme: t, appearance: n, logger: r } = e;
|
|
2738
2749
|
return /* @__PURE__ */ o.createElement(
|
|
2739
2750
|
ks,
|
|
@@ -2743,20 +2754,20 @@ function Ki(e) {
|
|
|
2743
2754
|
typography: t == null ? void 0 : t.typography,
|
|
2744
2755
|
logger: r
|
|
2745
2756
|
},
|
|
2746
|
-
/* @__PURE__ */ o.createElement(
|
|
2757
|
+
/* @__PURE__ */ o.createElement(Zi, { ...e })
|
|
2747
2758
|
);
|
|
2748
2759
|
}
|
|
2749
|
-
function
|
|
2760
|
+
function Zi({ rootElement: e = document.body, children: t }) {
|
|
2750
2761
|
const { theme: n, updateTheme: r } = Yt();
|
|
2751
|
-
return
|
|
2762
|
+
return se(() => {
|
|
2752
2763
|
e.setAttribute(ft, n.selectedTheme);
|
|
2753
|
-
}, [e, n.selectedTheme]), /* @__PURE__ */ o.createElement(Co, { theme: n }, /* @__PURE__ */ o.createElement(
|
|
2764
|
+
}, [e, n.selectedTheme]), /* @__PURE__ */ o.createElement(Co, { theme: n }, /* @__PURE__ */ o.createElement(Ki, { value: { theme: n, updateTheme: r, rootElement: e } }, t));
|
|
2754
2765
|
}
|
|
2755
2766
|
function Re(e, t) {
|
|
2756
2767
|
const n = e.getRootNode({ composed: t });
|
|
2757
2768
|
return n instanceof ShadowRoot || n instanceof Document ? n : document;
|
|
2758
2769
|
}
|
|
2759
|
-
const
|
|
2770
|
+
const Xi = (e, t) => {
|
|
2760
2771
|
P(() => {
|
|
2761
2772
|
const n = Re(t) instanceof ShadowRoot, r = Re(t, !0);
|
|
2762
2773
|
if (!(n ? t : r).querySelector(`link[href*='${e}']`)) {
|
|
@@ -2764,7 +2775,7 @@ const Zi = (e, t) => {
|
|
|
2764
2775
|
i.rel = "stylesheet", i.href = e, (n ? t : r.head).appendChild(i);
|
|
2765
2776
|
}
|
|
2766
2777
|
}, [e, t]);
|
|
2767
|
-
},
|
|
2778
|
+
}, Ji = (e, t = document.body) => {
|
|
2768
2779
|
P(() => {
|
|
2769
2780
|
const n = Re(t), s = n instanceof ShadowRoot ? t : n.head;
|
|
2770
2781
|
if (!s) return;
|
|
@@ -2773,11 +2784,11 @@ const Zi = (e, t) => {
|
|
|
2773
2784
|
a ? a.textContent !== e && (a.textContent = e) : (a = s.ownerDocument.createElement("style"), a.id = i, a.textContent = e, s.appendChild(a));
|
|
2774
2785
|
}, [e, t]);
|
|
2775
2786
|
}, {
|
|
2776
|
-
Provider:
|
|
2787
|
+
Provider: Qi,
|
|
2777
2788
|
Consumer: Tr,
|
|
2778
2789
|
useContext: Y
|
|
2779
2790
|
} = ee("Messenger");
|
|
2780
|
-
function
|
|
2791
|
+
function ea({
|
|
2781
2792
|
children: e,
|
|
2782
2793
|
state: t,
|
|
2783
2794
|
enableCloseConversationButton: n = !1,
|
|
@@ -2792,7 +2803,7 @@ function Qi({
|
|
|
2792
2803
|
setExpanded: (t == null ? void 0 : t.setExpanded) ?? d
|
|
2793
2804
|
};
|
|
2794
2805
|
return /* @__PURE__ */ o.createElement(ms, { ...i }, (f) => /* @__PURE__ */ o.createElement(
|
|
2795
|
-
|
|
2806
|
+
Qi,
|
|
2796
2807
|
{
|
|
2797
2808
|
value: {
|
|
2798
2809
|
...i,
|
|
@@ -2817,7 +2828,7 @@ const ge = (e) => {
|
|
|
2817
2828
|
className: s,
|
|
2818
2829
|
...i
|
|
2819
2830
|
}) => /* @__PURE__ */ o.createElement(
|
|
2820
|
-
|
|
2831
|
+
ra,
|
|
2821
2832
|
{
|
|
2822
2833
|
as: e,
|
|
2823
2834
|
$variant: t,
|
|
@@ -2826,7 +2837,7 @@ const ge = (e) => {
|
|
|
2826
2837
|
$maxTextLines: r,
|
|
2827
2838
|
...i
|
|
2828
2839
|
}
|
|
2829
|
-
), Rn = /* @__PURE__ */ new WeakMap(),
|
|
2840
|
+
), Rn = /* @__PURE__ */ new WeakMap(), ta = (e, t) => {
|
|
2830
2841
|
let n = Rn.get(t);
|
|
2831
2842
|
n || (n = /* @__PURE__ */ new Map(), Rn.set(t, n));
|
|
2832
2843
|
const r = n.get(e);
|
|
@@ -2835,7 +2846,7 @@ const ge = (e) => {
|
|
|
2835
2846
|
${s.lineHeight ? `line-height: ${s.lineHeight};` : "line-height: 100%;"}
|
|
2836
2847
|
`;
|
|
2837
2848
|
return n.set(e, i), i;
|
|
2838
|
-
},
|
|
2849
|
+
}, na = (e) => e ? I`display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:${e};overflow:hidden;` : "", ra = h.span`font-stretch:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => ta(e, t.typography)}color:${({ $color: e }) => e};${({ $maxTextLines: e }) => na(e)}`;
|
|
2839
2850
|
class bt extends go {
|
|
2840
2851
|
constructor(t) {
|
|
2841
2852
|
super(t), this.state = {
|
|
@@ -2850,7 +2861,7 @@ class bt extends go {
|
|
|
2850
2861
|
return this.state.hasError ? n : /* @__PURE__ */ o.createElement(ho, { fallback: r }, s);
|
|
2851
2862
|
}
|
|
2852
2863
|
}
|
|
2853
|
-
const
|
|
2864
|
+
const oa = (e) => /* @__PURE__ */ o.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", ...e }, /* @__PURE__ */ o.createElement("path", { className: "fill", d: "M52.552 11.448a2.666 2.666 0 0 1 .222 3.52l-.222.251-16.781 16.78 16.781 16.782a2.665 2.665 0 0 1 0 3.771 2.666 2.666 0 0 1-3.52.222l-.251-.222L32 35.771 15.219 52.552a2.665 2.665 0 0 1-3.771 0 2.666 2.666 0 0 1-.222-3.52l.222-.251L28.228 32l-16.78-16.781a2.665 2.665 0 0 1 0-3.771 2.666 2.666 0 0 1 3.52-.222l.251.222 16.78 16.78 16.782-16.78a2.665 2.665 0 0 1 3.771 0z", fill: "#000", fillRule: "evenodd" })), sa = (e) => /* @__PURE__ */ o.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", ...e }, /* @__PURE__ */ o.createElement("path", { className: "fill", d: "M7.33348 7.3335L2.00015 7.3335L2.00015 6.00016H5.05735L1.3335 2.27631L2.27631 1.3335L6.00015 5.05734V2.00016L7.33348 2.00016L7.33348 7.3335ZM8.66683 8.66683H14.0002V10.0002L10.943 10.0002L14.6668 13.724L13.724 14.6668L10.0002 10.943V14.0002H8.66683L8.66683 8.66683Z", fill: "#000", fillRule: "evenodd" })), ia = (e) => /* @__PURE__ */ o.createElement("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ o.createElement("path", { className: "fill", fillRule: "evenodd", clipRule: "evenodd", d: "M2 2H7.33333V3.33333L4.27613 3.33333L7.99999 7.05719L7.05718 8L3.33333 4.27616L3.33333 7.33333H2V2ZM14 14H8.66667V12.6667H11.7239L8.00001 8.94281L8.94282 8L12.6667 11.7238V8.66667H14V14Z", fill: "#000" })), aa = (e) => /* @__PURE__ */ o.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", fill: "evenodd", ...e }, /* @__PURE__ */ o.createElement("path", { className: "fill", fill: "#0D0D0D", d: "M50.667 18.667H13.333v-5.334h37.334zM50.667 34.667H13.333v-5.334h37.334zM13.333 50.667h37.334v-5.334H13.333z" })), la = (e) => /* @__PURE__ */ o.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", ...e }, /* @__PURE__ */ o.createElement("path", { fill: "#000", fillRule: "evenodd", d: "M59.795 29.43 7.329 2.979C4.691 1.802 1.76 4.153 2.932 6.798l6.925 18.609a2 2 0 0 0 1.544 1.275l32.273 5.394L11.4 37.47a1.998 1.998 0 0 0-1.544 1.275L2.932 57.353c-.879 2.645 1.76 4.997 4.397 3.527l52.466-26.453c2.051-.882 2.051-3.82 0-4.996z", className: "fill" })), ca = /* @__PURE__ */ new Set([
|
|
2854
2865
|
"send",
|
|
2855
2866
|
"chat",
|
|
2856
2867
|
"message",
|
|
@@ -2859,64 +2870,64 @@ const ra = (e) => /* @__PURE__ */ o.createElement("svg", { xmlns: "http://www.w3
|
|
|
2859
2870
|
"good-filled",
|
|
2860
2871
|
"bad",
|
|
2861
2872
|
"bad-filled"
|
|
2862
|
-
]),
|
|
2863
|
-
close:
|
|
2864
|
-
send:
|
|
2865
|
-
menu:
|
|
2866
|
-
expand:
|
|
2867
|
-
collapse:
|
|
2868
|
-
spinner:
|
|
2869
|
-
chat:
|
|
2870
|
-
message:
|
|
2871
|
-
error:
|
|
2872
|
-
info:
|
|
2873
|
-
refresh:
|
|
2874
|
-
"chevron-down":
|
|
2875
|
-
"chevron-right":
|
|
2876
|
-
done:
|
|
2877
|
-
user:
|
|
2878
|
-
"file-document":
|
|
2879
|
-
download:
|
|
2880
|
-
attach:
|
|
2881
|
-
delete:
|
|
2882
|
-
"close-filled":
|
|
2883
|
-
agent:
|
|
2884
|
-
question:
|
|
2885
|
-
actionbook:
|
|
2886
|
-
function:
|
|
2887
|
-
"radio-on":
|
|
2888
|
-
"radio-off":
|
|
2889
|
-
confluence:
|
|
2890
|
-
zendesk:
|
|
2891
|
-
salesforce:
|
|
2892
|
-
sprinklr:
|
|
2893
|
-
website:
|
|
2894
|
-
snippet:
|
|
2895
|
-
template:
|
|
2896
|
-
source:
|
|
2897
|
-
bot:
|
|
2898
|
-
"bot-filled":
|
|
2899
|
-
copy:
|
|
2900
|
-
show:
|
|
2901
|
-
mute:
|
|
2902
|
-
good:
|
|
2903
|
-
bad:
|
|
2904
|
-
"good-filled":
|
|
2905
|
-
"bad-filled":
|
|
2906
|
-
delight:
|
|
2873
|
+
]), da = {
|
|
2874
|
+
close: oa,
|
|
2875
|
+
send: la,
|
|
2876
|
+
menu: aa,
|
|
2877
|
+
expand: ia,
|
|
2878
|
+
collapse: sa,
|
|
2879
|
+
spinner: R(() => import("./BcUGcaq2.js")),
|
|
2880
|
+
chat: R(() => import("./DcFCGVBm.js")),
|
|
2881
|
+
message: R(() => import("./DsGXnanX.js")),
|
|
2882
|
+
error: R(() => import("./B6fvrWGq.js")),
|
|
2883
|
+
info: R(() => import("./CAIYsKDy.js")),
|
|
2884
|
+
refresh: R(() => import("./B6xd54zt.js")),
|
|
2885
|
+
"chevron-down": R(() => import("./BsimU71m.js")),
|
|
2886
|
+
"chevron-right": R(() => import("./NmJl7zv3.js")),
|
|
2887
|
+
done: R(() => import("./D_q6g3Dd.js")),
|
|
2888
|
+
user: R(() => import("./CvqfQEhO.js")),
|
|
2889
|
+
"file-document": R(() => import("./BAr50pfO.js")),
|
|
2890
|
+
download: R(() => import("./B2CtcWp3.js")),
|
|
2891
|
+
attach: R(() => import("./DY2ULcTX.js")),
|
|
2892
|
+
delete: R(() => import("./DMruRpOm.js")),
|
|
2893
|
+
"close-filled": R(() => import("./CxQFWLnW.js")),
|
|
2894
|
+
agent: R(() => import("./Cc7XmLN1.js")),
|
|
2895
|
+
question: R(() => import("./dqwvRBog.js")),
|
|
2896
|
+
actionbook: R(() => import("./CrjNuryZ.js")),
|
|
2897
|
+
function: R(() => import("./CvdSjw1c.js")),
|
|
2898
|
+
"radio-on": R(() => import("./nmdo2Fbj.js")),
|
|
2899
|
+
"radio-off": R(() => import("./BnZcRFmS.js")),
|
|
2900
|
+
confluence: R(() => import("./BOnlh2zd.js")),
|
|
2901
|
+
zendesk: R(() => import("./BAJ6LEKc.js")),
|
|
2902
|
+
salesforce: R(() => import("./CT2kv4lr.js")),
|
|
2903
|
+
sprinklr: R(() => import("./m2INcyV2.js")),
|
|
2904
|
+
website: R(() => import("./BgGVGNdg.js")),
|
|
2905
|
+
snippet: R(() => import("./BFcXPuf5.js")),
|
|
2906
|
+
template: R(() => import("./awO7aBCv.js")),
|
|
2907
|
+
source: R(() => import("./_EVMCh6Y.js")),
|
|
2908
|
+
bot: R(() => import("./CZXPLnTx.js")),
|
|
2909
|
+
"bot-filled": R(() => import("./DHVHq9Fo.js")),
|
|
2910
|
+
copy: R(() => import("./Y-x39_PW.js")),
|
|
2911
|
+
show: R(() => import("./oD5rM94o.js")),
|
|
2912
|
+
mute: R(() => import("./CBd3y0FA.js")),
|
|
2913
|
+
good: R(() => import("./CahwXcIy.js")),
|
|
2914
|
+
bad: R(() => import("./BqCoQ9H8.js")),
|
|
2915
|
+
"good-filled": R(() => import("./CPplUQmT.js")),
|
|
2916
|
+
"bad-filled": R(() => import("./TGxZjxbr.js")),
|
|
2917
|
+
delight: R(() => import("./DLpq94a9.js"))
|
|
2907
2918
|
}, H = ({ type: e, size: t = 24, className: n, color: r }) => {
|
|
2908
|
-
const s =
|
|
2919
|
+
const s = da[e];
|
|
2909
2920
|
return /* @__PURE__ */ o.createElement(
|
|
2910
|
-
|
|
2921
|
+
ma,
|
|
2911
2922
|
{
|
|
2912
2923
|
className: n,
|
|
2913
|
-
$rtlFlip:
|
|
2924
|
+
$rtlFlip: ca.has(e),
|
|
2914
2925
|
$size: t,
|
|
2915
2926
|
$color: r ?? m.color.primary.main
|
|
2916
2927
|
},
|
|
2917
|
-
/* @__PURE__ */ o.createElement(bt, { errorFallback: /* @__PURE__ */ o.createElement(
|
|
2928
|
+
/* @__PURE__ */ o.createElement(bt, { errorFallback: /* @__PURE__ */ o.createElement(ga, null) }, /* @__PURE__ */ o.createElement(s, null))
|
|
2918
2929
|
);
|
|
2919
|
-
},
|
|
2930
|
+
}, ua = I`[dir='rtl'] &{transform:scaleX(-1);}`, ma = h.div`width:${({ $size: e }) => ge(e)};height:${({ $size: e }) => ge(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 && ua};`, ga = () => /* @__PURE__ */ o.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64" }, /* @__PURE__ */ o.createElement("rect", { x: "8", y: "8", width: "48", height: "48", fill: "none", className: "stroke", rx: "4" }), /* @__PURE__ */ o.createElement("line", { x1: "20", y1: "20", x2: "44", y2: "44", className: "stroke" }), /* @__PURE__ */ o.createElement("line", { x1: "44", y1: "20", x2: "20", y2: "44", className: "stroke" }));
|
|
2920
2931
|
function Jt({
|
|
2921
2932
|
name: e,
|
|
2922
2933
|
type: t = "FILE",
|
|
@@ -2925,11 +2936,11 @@ function Jt({
|
|
|
2925
2936
|
onClick: s
|
|
2926
2937
|
}) {
|
|
2927
2938
|
const { colors: i } = Je();
|
|
2928
|
-
return /* @__PURE__ */ o.createElement(
|
|
2939
|
+
return /* @__PURE__ */ o.createElement(ha, { onClick: s, $clickable: !!s }, /* @__PURE__ */ o.createElement(fa, { $bgColor: r ?? i.base.primary }, /* @__PURE__ */ o.createElement(H, { type: "file-document", size: 24, color: n ?? i.base.primaryContrastContent })), /* @__PURE__ */ o.createElement(ba, null, /* @__PURE__ */ o.createElement(Ea, { variant: "button", color: m.themedColor.textHighEmphasis }, e), /* @__PURE__ */ o.createElement(w, { color: m.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
2929
2940
|
}
|
|
2930
|
-
const
|
|
2931
|
-
function
|
|
2932
|
-
return /* @__PURE__ */ o.createElement(
|
|
2941
|
+
const ha = h.div`border-radius:12px;gap:8px;width:${V.BODY_MAX_WIDTH}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${m.themedColor.textDisabled};background-color:${m.themedColor.bg_50_600};${({ $clickable: e }) => e && pa}`, pa = I`cursor:pointer;&:hover{background-color:${m.themedColor.bg_100_500};}`, fa = h.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, ba = h.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ea = h(w)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
2942
|
+
function xa({ file: e, children: t, onClickFile: n }) {
|
|
2943
|
+
return /* @__PURE__ */ o.createElement(va, null, /* @__PURE__ */ o.createElement(
|
|
2933
2944
|
Jt,
|
|
2934
2945
|
{
|
|
2935
2946
|
name: e.name,
|
|
@@ -2938,7 +2949,7 @@ function Ea({ file: e, children: t, onClickFile: n }) {
|
|
|
2938
2949
|
}
|
|
2939
2950
|
), t);
|
|
2940
2951
|
}
|
|
2941
|
-
const
|
|
2952
|
+
const va = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:${V.GAP_GROUPED}px;`, _a = "1.14.0", ce = "sb-agent", de = {
|
|
2942
2953
|
ENTRY: `${ce}-entry`,
|
|
2943
2954
|
MODAL_ROOT: `${ce}-modal-root`,
|
|
2944
2955
|
WINDOW: `${ce}-window`,
|
|
@@ -2949,37 +2960,37 @@ const xa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
|
|
|
2949
2960
|
TOOLTIP: lt - 2,
|
|
2950
2961
|
WINDOW: lt - 3,
|
|
2951
2962
|
LAUNCHER: lt - 4
|
|
2952
|
-
}, Ar = 36,
|
|
2953
|
-
function
|
|
2954
|
-
const r = () => e.type.startsWith("image") ? /* @__PURE__ */ o.createElement(
|
|
2963
|
+
}, Ar = 36, ya = 100, Ca = _a, wr = "noopener noreferrer nofollow", Ce = `${ce}-incoming-msg`, Sa = `${ce}-marked-text`;
|
|
2964
|
+
function Ta({ file: e, onClickMedia: t, children: n }) {
|
|
2965
|
+
const r = () => e.type.startsWith("image") ? /* @__PURE__ */ o.createElement(Ia, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ o.createElement(ka, { controls: !0 }, /* @__PURE__ */ o.createElement("source", { src: e.url }), /* @__PURE__ */ o.createElement("track", { kind: "captions" })) : null;
|
|
2955
2966
|
if (r) {
|
|
2956
2967
|
const s = {
|
|
2957
2968
|
id: `${Ce}-media-body`,
|
|
2958
2969
|
onClick: () => t == null ? void 0 : t(e)
|
|
2959
2970
|
};
|
|
2960
|
-
return /* @__PURE__ */ o.createElement(
|
|
2971
|
+
return /* @__PURE__ */ o.createElement(Aa, null, /* @__PURE__ */ o.createElement(wa, { ...s }, r()), n);
|
|
2961
2972
|
}
|
|
2962
2973
|
return null;
|
|
2963
2974
|
}
|
|
2964
|
-
const
|
|
2975
|
+
const Aa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:${V.GAP_GROUPED}px;`, wa = h.div`width:${V.BODY_MAX_WIDTH}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${F.light`
|
|
2965
2976
|
background-color: ${m.color.background100};
|
|
2966
2977
|
`}
|
|
2967
2978
|
${F.dark`
|
|
2968
2979
|
background-color: ${m.color.background400};
|
|
2969
2980
|
`}
|
|
2970
|
-
`,
|
|
2971
|
-
const t = new RegExp(`(\`+)([^\`]+?)\\1|(${
|
|
2972
|
-
return e.replace(t, (n, r, s, i) => r ? n : i ? `<span id=${
|
|
2973
|
-
},
|
|
2981
|
+
`, Ia = h.img`width:100%;height:100%;object-fit:cover;`, ka = h.video`width:100%;height:100%;object-fit:cover;`, $a = "✱", Ir = (e) => {
|
|
2982
|
+
const t = new RegExp(`(\`+)([^\`]+?)\\1|(${$a}+)`, "g");
|
|
2983
|
+
return e.replace(t, (n, r, s, i) => r ? n : i ? `<span id=${Sa} aria-label="masked-text">${i}</span>` : n);
|
|
2984
|
+
}, Ma = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Oa = R(async () => ({ default: (await import("./TXpETEfV.js")).MarkdownText })), La = R(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
|
|
2974
2985
|
function Nn(e) {
|
|
2975
2986
|
var s, i;
|
|
2976
|
-
const t = e.maxBodyWidth ?? V.BODY_MAX_WIDTH, n =
|
|
2987
|
+
const t = e.maxBodyWidth ?? V.BODY_MAX_WIDTH, n = ae(() => ts(e.message, Ir), [e.message]), r = {
|
|
2977
2988
|
id: `${Ce}-text-body`,
|
|
2978
2989
|
$maxWidth: t,
|
|
2979
2990
|
$color: (s = e.customStyle) == null ? void 0 : s.bubbleContentColor,
|
|
2980
2991
|
$bgColor: (i = e.customStyle) == null ? void 0 : i.bubbleBackgroundColor
|
|
2981
2992
|
};
|
|
2982
|
-
return n.length === 0 ? e.children ? /* @__PURE__ */ o.createElement(Bn, { ...r }, e.children) : null : /* @__PURE__ */ o.createElement(Bn, { ...r }, n.map((a, l) => a.type === "text" ? /* @__PURE__ */ o.createElement(Fn, { key: l, variant: "body3" }, /* @__PURE__ */ o.createElement(bt, { fallback: a.value }, /* @__PURE__ */ o.createElement(
|
|
2993
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ o.createElement(Bn, { ...r }, e.children) : null : /* @__PURE__ */ o.createElement(Bn, { ...r }, n.map((a, l) => a.type === "text" ? /* @__PURE__ */ o.createElement(Fn, { key: l, variant: "body3" }, /* @__PURE__ */ o.createElement(bt, { fallback: a.value }, /* @__PURE__ */ o.createElement(Oa, { onClickImage: (c) => {
|
|
2983
2994
|
var d;
|
|
2984
2995
|
return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
|
|
2985
2996
|
} }, a.value))) : a.type === "code" ? /* @__PURE__ */ o.createElement(bt, { key: l, fallback: /* @__PURE__ */ o.createElement(Fn, { variant: "body3" }, a.value) }, /* @__PURE__ */ o.createElement(La, { code: a.value, language: a.language })) : null), e.children);
|
|
@@ -2992,37 +3003,37 @@ const Bn = h.div`display:flex;flex-direction:column;border-radius:12px;overflow:
|
|
|
2992
3003
|
transition: max-width 0.3s;
|
|
2993
3004
|
overflow-wrap: break-word;
|
|
2994
3005
|
`, Fn = h(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2995
|
-
function
|
|
2996
|
-
const { stringSet: t } =
|
|
3006
|
+
function Da(e) {
|
|
3007
|
+
const { stringSet: t } = W(), n = mr(e) ? /* @__PURE__ */ o.createElement(Nn, { ...e }) : null;
|
|
2997
3008
|
if (e.messageType === "user")
|
|
2998
3009
|
return n;
|
|
2999
3010
|
if (e.messageType === "file") {
|
|
3000
3011
|
const r = e.file;
|
|
3001
|
-
return r.type.startsWith("image") || r.type.startsWith("video") ? /* @__PURE__ */ o.createElement(
|
|
3012
|
+
return r.type.startsWith("image") || r.type.startsWith("video") ? /* @__PURE__ */ o.createElement(Ta, { ...e }, n) : /* @__PURE__ */ o.createElement(xa, { ...e }, n);
|
|
3002
3013
|
}
|
|
3003
3014
|
return /* @__PURE__ */ o.createElement(Nn, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
3004
3015
|
}
|
|
3005
3016
|
function Qt({ id: e, src: t, size: n = 56, onClick: r, style: s }) {
|
|
3006
|
-
return /* @__PURE__ */ o.createElement(
|
|
3017
|
+
return /* @__PURE__ */ o.createElement(Ra, { id: e, tabIndex: 0, onClick: r, $size: ge(n), style: s }, t ? /* @__PURE__ */ o.createElement(Na, { src: t }) : /* @__PURE__ */ o.createElement(H, { type: "user", size: n }));
|
|
3007
3018
|
}
|
|
3008
|
-
const
|
|
3009
|
-
function
|
|
3019
|
+
const Ra = h.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${m.themedColor.bg_100_500};&:focus{outline:none;}`, Na = h.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
3020
|
+
function Ba({ sender: e, isBotMessage: t }) {
|
|
3010
3021
|
const n = `${Ce}-sender-avatar`;
|
|
3011
|
-
return t && !e.profileUrl ? /* @__PURE__ */ o.createElement(
|
|
3022
|
+
return t && !e.profileUrl ? /* @__PURE__ */ o.createElement(Fa, { id: n }, /* @__PURE__ */ o.createElement(H, { type: "delight", size: "100%" })) : /* @__PURE__ */ o.createElement(Qt, { id: n, size: V.AVATAR_SIZE, src: e.profileUrl });
|
|
3012
3023
|
}
|
|
3013
|
-
const
|
|
3014
|
-
function
|
|
3015
|
-
return /* @__PURE__ */ o.createElement(
|
|
3024
|
+
const Fa = h.div`flex-shrink:0;width:${V.AVATAR_SIZE}px;height:${V.AVATAR_SIZE}px;box-sizing:border-box;padding:4px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary}!important;ellipse,path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent}!important;}}`;
|
|
3025
|
+
function Pa({ sender: e }) {
|
|
3026
|
+
return /* @__PURE__ */ o.createElement(Ua, { id: `${Ce}-sender-name`, variant: "caption1", color: m.themedColor.textMidEmphasis }, e.nickname);
|
|
3016
3027
|
}
|
|
3017
|
-
const
|
|
3018
|
-
function
|
|
3019
|
-
const { stringSet: t, format: n } =
|
|
3028
|
+
const Ua = h(w)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
3029
|
+
function Ha({ createdAt: e }) {
|
|
3030
|
+
const { stringSet: t, format: n } = W();
|
|
3020
3031
|
return e ? /* @__PURE__ */ o.createElement(w, { id: `${Ce}-sent-time`, variant: "caption4", color: m.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
3021
3032
|
}
|
|
3022
|
-
function
|
|
3023
|
-
return /* @__PURE__ */ o.createElement(
|
|
3033
|
+
function Va({ customStyle: e }) {
|
|
3034
|
+
return /* @__PURE__ */ o.createElement(za, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ o.createElement(Wa, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
|
|
3024
3035
|
}
|
|
3025
|
-
const
|
|
3036
|
+
const za = h.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};`, Wa = h.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;}`;
|
|
3026
3037
|
async function en(e) {
|
|
3027
3038
|
let t = e;
|
|
3028
3039
|
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
@@ -3034,50 +3045,50 @@ function Ga(e) {
|
|
|
3034
3045
|
});
|
|
3035
3046
|
});
|
|
3036
3047
|
}
|
|
3037
|
-
function
|
|
3048
|
+
function ja({
|
|
3038
3049
|
extendedMessagePayload: e,
|
|
3039
3050
|
onClickCTA: t = ({ url: n }) => en(n)
|
|
3040
3051
|
}) {
|
|
3041
3052
|
const n = e == null ? void 0 : e.cta_button;
|
|
3042
|
-
return n ? /* @__PURE__ */ o.createElement(
|
|
3053
|
+
return n ? /* @__PURE__ */ o.createElement(qa, { id: `${Ce}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ o.createElement(Ka, { variant: "button" }, n.label)) : null;
|
|
3043
3054
|
}
|
|
3044
|
-
const
|
|
3055
|
+
const qa = h.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${m.themedColor.textHighEmphasis};background-color:${m.color.background50};${F.dark`
|
|
3045
3056
|
background-color: ${m.color.ondark.textDisabled};
|
|
3046
3057
|
`}
|
|
3047
|
-
`,
|
|
3048
|
-
function
|
|
3058
|
+
`, Ka = h(w)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
|
|
3059
|
+
function Ya({
|
|
3049
3060
|
extendedMessagePayload: e,
|
|
3050
3061
|
onClickCitation: t = (n) => en(n.link)
|
|
3051
3062
|
}) {
|
|
3052
|
-
const { stringSet: n } =
|
|
3053
|
-
return !s || s.length === 0 ? null : /* @__PURE__ */ o.createElement(
|
|
3054
|
-
|
|
3063
|
+
const { stringSet: n } = W(), { theme: r } = Yt(), s = e == null ? void 0 : e.citations;
|
|
3064
|
+
return !s || s.length === 0 ? null : /* @__PURE__ */ o.createElement(Za, { id: `${Ce}-ext-citation` }, /* @__PURE__ */ o.createElement(Xa, { variant: "caption1", color: r.colors.messageIncoming.text }, n.CITATION_SOURCE_TITLE), /* @__PURE__ */ o.createElement(Ja, null, s.map((i, a) => /* @__PURE__ */ o.createElement(
|
|
3065
|
+
el,
|
|
3055
3066
|
{
|
|
3056
3067
|
key: `${i.embedding_id}-${a}`,
|
|
3057
3068
|
role: "button",
|
|
3058
3069
|
onClick: () => t(i)
|
|
3059
3070
|
},
|
|
3060
3071
|
/* @__PURE__ */ o.createElement(H, { type: "source", size: 16, color: r.colors.messageIncoming.text }),
|
|
3061
|
-
/* @__PURE__ */ o.createElement(
|
|
3072
|
+
/* @__PURE__ */ o.createElement(Qa, { variant: "body3", color: r.colors.messageIncoming.text }, i.title)
|
|
3062
3073
|
))));
|
|
3063
3074
|
}
|
|
3064
|
-
const
|
|
3065
|
-
function
|
|
3075
|
+
const Za = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;padding:8px 12px 6px;`, Xa = h(w)`opacity:0.5;`, Ja = h.div`display:flex;flex-direction:column;gap:8px;`, Qa = h(w)`text-decoration:underline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, el = h.div`display:flex;align-items:center;gap:4px;cursor:pointer;&:hover{opacity:0.5;}`;
|
|
3076
|
+
function tl(e) {
|
|
3066
3077
|
return /* @__PURE__ */ o.createElement(o.Fragment, null);
|
|
3067
3078
|
}
|
|
3068
3079
|
const Tt = ({ style: e, rootElementId: t, visible: n, onClose: r, children: s }) => {
|
|
3069
3080
|
if (!n) return null;
|
|
3070
3081
|
const { rootElement: i } = Sr(), a = Re(i), l = Re(i, !0);
|
|
3071
3082
|
return Bo(
|
|
3072
|
-
/* @__PURE__ */ o.createElement(
|
|
3083
|
+
/* @__PURE__ */ o.createElement(nl, { onClick: r, style: e }, /* @__PURE__ */ o.createElement(rl, { onClick: (c) => c.stopPropagation() }, s)),
|
|
3073
3084
|
a.getElementById(t) ?? a.getElementById(de.MODAL_ROOT) ?? l.body
|
|
3074
3085
|
);
|
|
3075
|
-
},
|
|
3076
|
-
ActionItem:
|
|
3077
|
-
}),
|
|
3086
|
+
}, nl = h.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${m.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${Ne.MODAL};`, rl = h.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:${Ne.MODAL};`, ol = ({ visible: e, onClose: t, children: n }) => /* @__PURE__ */ o.createElement(Tt, { rootElementId: de.WINDOW, visible: e, onClose: t }, /* @__PURE__ */ o.createElement(al, null, n)), sl = ({ onClick: e, destructive: t, children: n }) => /* @__PURE__ */ o.createElement(il, { onClick: e, $destructive: t }, n), Ue = Object.assign(ol, {
|
|
3087
|
+
ActionItem: sl
|
|
3088
|
+
}), il = h.button`all:unset;width:100%;padding:14px 24px;text-align:start;cursor:pointer;color:${({ $destructive: e }) => e ? m.themedColor.error : m.themedColor.textHighEmphasis};`, al = h.div`position:absolute;left:0;right:0;bottom:0;border-radius:12px 12px 0 0;flex-direction:column;align-items:flex-end;margin:0 auto;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, Ut = (e) => `${e}-filled`, ll = (e) => e === "good" ? _n.GOOD : _n.BAD, kr = I`&:hover{opacity:0.8;}&:active{opacity:0.6;}`, Pn = {
|
|
3078
3089
|
good: m.themedColor.secondary,
|
|
3079
3090
|
bad: m.themedColor.error
|
|
3080
|
-
},
|
|
3091
|
+
}, cl = ({
|
|
3081
3092
|
visible: e,
|
|
3082
3093
|
onClose: t,
|
|
3083
3094
|
isEdit: n,
|
|
@@ -3086,8 +3097,8 @@ const Tt = ({ style: e, rootElementId: t, visible: n, onClose: r, children: s })
|
|
|
3086
3097
|
onSubmit: i,
|
|
3087
3098
|
isCommentEnabled: a = !1
|
|
3088
3099
|
}) => {
|
|
3089
|
-
const { stringSet: l } =
|
|
3090
|
-
|
|
3100
|
+
const { stringSet: l } = W(), [c, d] = C(r), [g, f] = C(s);
|
|
3101
|
+
se(() => {
|
|
3091
3102
|
e ? (d(r), f(s)) : (d(void 0), f(""));
|
|
3092
3103
|
}, [e, r, s]);
|
|
3093
3104
|
const b = () => {
|
|
@@ -3095,10 +3106,10 @@ const Tt = ({ style: e, rootElementId: t, visible: n, onClose: r, children: s })
|
|
|
3095
3106
|
}, v = () => {
|
|
3096
3107
|
t();
|
|
3097
3108
|
};
|
|
3098
|
-
return e ? /* @__PURE__ */ o.createElement(Tt, { rootElementId: de.WINDOW, visible: e, onClose: v }, /* @__PURE__ */ o.createElement(
|
|
3109
|
+
return e ? /* @__PURE__ */ o.createElement(Tt, { rootElementId: de.WINDOW, visible: e, onClose: v }, /* @__PURE__ */ o.createElement(dl, null, /* @__PURE__ */ o.createElement(ul, null, /* @__PURE__ */ o.createElement(w, { variant: "h2", color: m.themedColor.textHighEmphasis }, l.FEEDBACK_TITLE)), /* @__PURE__ */ o.createElement(ml, null, /* @__PURE__ */ o.createElement(gl, null, ["good", "bad"].map((_) => {
|
|
3099
3110
|
const E = c === _, u = _ === "good" ? l.FEEDBACK_GOOD : l.FEEDBACK_BAD;
|
|
3100
3111
|
return /* @__PURE__ */ o.createElement(
|
|
3101
|
-
|
|
3112
|
+
hl,
|
|
3102
3113
|
{
|
|
3103
3114
|
key: _,
|
|
3104
3115
|
$selected: E,
|
|
@@ -3122,16 +3133,16 @@ const Tt = ({ style: e, rootElementId: t, visible: n, onClose: r, children: s })
|
|
|
3122
3133
|
u
|
|
3123
3134
|
)
|
|
3124
3135
|
);
|
|
3125
|
-
})), a && /* @__PURE__ */ o.createElement(
|
|
3126
|
-
|
|
3136
|
+
})), a && /* @__PURE__ */ o.createElement(pl, null, /* @__PURE__ */ o.createElement(w, { variant: "caption3", color: m.themedColor.textHighEmphasis }, l.FEEDBACK_COMMENT_LABEL), /* @__PURE__ */ o.createElement(
|
|
3137
|
+
fl,
|
|
3127
3138
|
{
|
|
3128
3139
|
placeholder: l.FEEDBACK_COMMENT_PLACEHOLDER,
|
|
3129
3140
|
value: g,
|
|
3130
3141
|
onChange: (_) => f(_.target.value),
|
|
3131
3142
|
maxLength: 100
|
|
3132
3143
|
}
|
|
3133
|
-
))), /* @__PURE__ */ o.createElement(
|
|
3134
|
-
},
|
|
3144
|
+
))), /* @__PURE__ */ o.createElement(bl, null, /* @__PURE__ */ o.createElement(El, { onClick: v }, /* @__PURE__ */ o.createElement(w, { variant: "button", color: m.themedColor.textHighEmphasis }, l.FEEDBACK_CANCEL)), /* @__PURE__ */ o.createElement(xl, { onClick: b, disabled: !c }, /* @__PURE__ */ o.createElement(w, { variant: "button" }, n ? l.FEEDBACK_SAVE : l.FEEDBACK_SUBMIT))))) : null;
|
|
3145
|
+
}, dl = h.div`width:280px;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};border-radius:12px;overflow:hidden;`, ul = h.div`padding:24px;`, ml = h.div`padding-inline:24px;display:flex;flex-direction:column;gap:24px;`, gl = h.div`display:flex;gap:4px;`, hl = h.button`width:114px;height:64px;border-radius:12px;border:1px solid ${m.themedColor.textDisabled};box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;gap:0;transition:background-color 0.2s;background-color:${({ $selected: e }) => e ? m.color.background100 : "transparent"};${({ $selected: e }) => F.dark`
|
|
3135
3146
|
background-color: ${e ? m.color.background600 : "transparent"};
|
|
3136
3147
|
`}
|
|
3137
3148
|
|
|
@@ -3142,11 +3153,11 @@ const Tt = ({ style: e, rootElementId: t, visible: n, onClose: r, children: s })
|
|
|
3142
3153
|
&:active {
|
|
3143
3154
|
opacity: 0.6;
|
|
3144
3155
|
}
|
|
3145
|
-
`,
|
|
3156
|
+
`, pl = h.div`display:flex;flex-direction:column;gap:6px;`, fl = h.textarea`font-family:inherit;font-size:12px;line-height:16px;border:1px solid ${m.themedColor.textDisabled};border-radius:4px;padding:6px 12px;color:${m.themedColor.textHighEmphasis};background-color:${m.themedColor.textLowEmphasisInverse};resize:none;field-sizing:content;min-height:28px;max-height:118px;overflow-y:auto;&::placeholder{color:${m.themedColor.textLowEmphasis};}&:focus{outline:none;}`, bl = h.div`padding-inline:24px;padding-block:16px;display:flex;justify-content:flex-end;gap:4px;`, $r = h.button`width:86px;height:40px;border-radius:20px;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s;`, El = h($r)`${kr}`, xl = h($r)`cursor:${({ disabled: e }) => e ? "not-allowed" : "pointer"};opacity:${({ disabled: e }) => e ? 0.4 : 1};&:hover:not(:disabled){opacity:0.8;}&:active:not(:disabled){opacity:0.6;}background-color:${({ theme: e }) => e.colors.base.primary};span{color:${({ theme: e }) => e.colors.base.primaryContrastContent};}`, Un = {
|
|
3146
3157
|
good: m.themedColor.secondary,
|
|
3147
3158
|
bad: m.themedColor.error
|
|
3148
3159
|
};
|
|
3149
|
-
function
|
|
3160
|
+
function vl({
|
|
3150
3161
|
isBotMessage: e,
|
|
3151
3162
|
isConversationClosed: t,
|
|
3152
3163
|
isStreaming: n,
|
|
@@ -3155,50 +3166,50 @@ function xl({
|
|
|
3155
3166
|
extendedMessagePayload: i,
|
|
3156
3167
|
onFeedbackUpdate: a
|
|
3157
3168
|
}) {
|
|
3158
|
-
const { stringSet: l } =
|
|
3169
|
+
const { stringSet: l } = W(), [c, d] = C(!1), [g, f] = C(!1), [b, v] = C(void 0), [_, E] = C(""), u = i == null ? void 0 : i.feedback, p = (u == null ? void 0 : u.rating) ?? "none";
|
|
3159
3170
|
if (p !== "none" ? !1 : !!(n || !e || !r || (i == null ? void 0 : i.bot_message_type) !== "generated" || t)) return null;
|
|
3160
|
-
const y = (
|
|
3161
|
-
p === "none" ? (v(
|
|
3171
|
+
const y = (M) => {
|
|
3172
|
+
p === "none" ? (v(M), E(""), d(!0)) : f(!0);
|
|
3162
3173
|
}, k = () => {
|
|
3163
3174
|
a == null || a(null), f(!1);
|
|
3164
|
-
},
|
|
3175
|
+
}, T = () => {
|
|
3165
3176
|
f(!1), v(u == null ? void 0 : u.rating), E((u == null ? void 0 : u.comment) ?? ""), d(!0);
|
|
3166
|
-
},
|
|
3167
|
-
a == null || a(
|
|
3177
|
+
}, D = (M) => {
|
|
3178
|
+
a == null || a(M);
|
|
3168
3179
|
};
|
|
3169
|
-
return t && p !== "none" ? /* @__PURE__ */ o.createElement(Hn, { $horizontal: !0 }, /* @__PURE__ */ o.createElement(
|
|
3170
|
-
const
|
|
3180
|
+
return t && p !== "none" ? /* @__PURE__ */ o.createElement(Hn, { $horizontal: !0 }, /* @__PURE__ */ o.createElement(_l, null, /* @__PURE__ */ o.createElement(H, { type: Ut(p), size: 12, color: Un[p] })), (u == null ? void 0 : u.comment) && /* @__PURE__ */ o.createElement(Vn, { variant: "caption2", style: { lineHeight: "16px" } }, u.comment)) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Hn, null, /* @__PURE__ */ o.createElement(yl, null, ["good", "bad"].map((M) => {
|
|
3181
|
+
const O = p === M;
|
|
3171
3182
|
return /* @__PURE__ */ o.createElement(
|
|
3172
|
-
|
|
3183
|
+
Cl,
|
|
3173
3184
|
{
|
|
3174
|
-
key:
|
|
3175
|
-
$selected:
|
|
3176
|
-
$rating:
|
|
3177
|
-
onClick: () => y(
|
|
3185
|
+
key: M,
|
|
3186
|
+
$selected: O,
|
|
3187
|
+
$rating: M,
|
|
3188
|
+
onClick: () => y(M)
|
|
3178
3189
|
},
|
|
3179
3190
|
/* @__PURE__ */ o.createElement(
|
|
3180
3191
|
H,
|
|
3181
3192
|
{
|
|
3182
|
-
type:
|
|
3193
|
+
type: O ? Ut(M) : M,
|
|
3183
3194
|
size: 14,
|
|
3184
|
-
color:
|
|
3195
|
+
color: O ? Un[M] : m.themedColor.textMidEmphasis
|
|
3185
3196
|
}
|
|
3186
3197
|
)
|
|
3187
3198
|
);
|
|
3188
|
-
})), p !== "none" && (u == null ? void 0 : u.comment) && /* @__PURE__ */ o.createElement(Vn, { variant: "caption2" }, u.comment)), /* @__PURE__ */ o.createElement(Ue, { visible: g, onClose: () => f(!1) }, /* @__PURE__ */ o.createElement(Ue.ActionItem, { onClick:
|
|
3189
|
-
|
|
3199
|
+
})), p !== "none" && (u == null ? void 0 : u.comment) && /* @__PURE__ */ o.createElement(Vn, { variant: "caption2" }, u.comment)), /* @__PURE__ */ o.createElement(Ue, { visible: g, onClose: () => f(!1) }, /* @__PURE__ */ o.createElement(Ue.ActionItem, { onClick: T }, l.FEEDBACK_EDIT), /* @__PURE__ */ o.createElement(Ue.ActionItem, { onClick: k, destructive: !0 }, l.FEEDBACK_REMOVE)), /* @__PURE__ */ o.createElement(
|
|
3200
|
+
cl,
|
|
3190
3201
|
{
|
|
3191
3202
|
visible: c,
|
|
3192
3203
|
onClose: () => d(!1),
|
|
3193
3204
|
isEdit: p !== "none",
|
|
3194
3205
|
initialRating: b,
|
|
3195
3206
|
initialComment: _,
|
|
3196
|
-
onSubmit:
|
|
3207
|
+
onSubmit: D,
|
|
3197
3208
|
isCommentEnabled: s
|
|
3198
3209
|
}
|
|
3199
3210
|
));
|
|
3200
3211
|
}
|
|
3201
|
-
const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row" : "column"};align-items:${({ $horizontal: e }) => e ? "flex-start" : "stretch"};gap:4px;margin-top:8px;word-break:break-word;max-width:${V.BODY_MAX_WIDTH}px;`,
|
|
3212
|
+
const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row" : "column"};align-items:${({ $horizontal: e }) => e ? "flex-start" : "stretch"};gap:4px;margin-top:8px;word-break:break-word;max-width:${V.BODY_MAX_WIDTH}px;`, _l = h.div`padding:2px;flex-shrink:0;display:flex;align-items:center;`, yl = h.div`display:flex;gap:2px;`, Cl = h.button`width:38px;height:20px;border-radius:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:opacity 0.2s;border:1px solid ${m.color.background200};background-color:${({ $selected: e }) => e ? m.color.background100 : "transparent"};${({ $selected: e }) => F.dark`
|
|
3202
3213
|
border: 1px solid ${m.color.background400};
|
|
3203
3214
|
background-color: ${e ? m.color.background500 : "transparent"};
|
|
3204
3215
|
`}
|
|
@@ -3211,8 +3222,8 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3211
3222
|
const a = () => {
|
|
3212
3223
|
s == null || s(), i();
|
|
3213
3224
|
};
|
|
3214
|
-
return /* @__PURE__ */ o.createElement(Tt, { rootElementId: de.WINDOW, visible: e, onClose: i }, /* @__PURE__ */ o.createElement(
|
|
3215
|
-
},
|
|
3225
|
+
return /* @__PURE__ */ o.createElement(Tt, { rootElementId: de.WINDOW, visible: e, onClose: i }, /* @__PURE__ */ o.createElement(Sl, null, /* @__PURE__ */ o.createElement(Tl, null, t && /* @__PURE__ */ o.createElement(w, { variant: "h1", color: m.themedColor.textHighEmphasis }, t), n && /* @__PURE__ */ o.createElement(Al, null, /* @__PURE__ */ o.createElement(w, { variant: "subtitle2", color: m.themedColor.textHighEmphasis }, n))), /* @__PURE__ */ o.createElement(wl, null, /* @__PURE__ */ o.createElement(Il, { onClick: a }, /* @__PURE__ */ o.createElement(w, { variant: "button", color: m.themedColor.primary }, r)))));
|
|
3226
|
+
}, Sl = h.div`width:360px;height:auto;padding-block:24px 12px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, Tl = h.div`margin-bottom:16px;`, Al = h.div`margin-top:8px;`, wl = h.div`display:flex;flex-direction:row;justify-content:flex-end;`, Il = h.button`all:unset;display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:transparent;padding:10px 16px;`, nn = I`width:100%;height:36px;border-radius:6px;cursor:pointer;transition:all 0.2s ease;padding:0 12px;border:none;outline:none;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, zn = h.button`${nn};background-color:${m.themedColor.primary};color:${m.themedColor.textHighEmphasis};&:hover:not(:disabled){opacity:0.9;}`, kl = h.button`${nn};color:${m.themedColor.primary};${F.light`
|
|
3216
3227
|
background-color: ${m.color.background50};
|
|
3217
3228
|
`};
|
|
3218
3229
|
${F.dark`
|
|
@@ -3222,18 +3233,18 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3222
3233
|
&:hover:not(:disabled) {
|
|
3223
3234
|
opacity: 0.9;
|
|
3224
3235
|
}
|
|
3225
|
-
`,
|
|
3236
|
+
`, $l = h.button`${nn};background-color:transparent;color:${m.themedColor.textHighEmphasis};&:hover:not(:disabled){opacity:0.7;}`, Ml = (e) => {
|
|
3226
3237
|
switch (e) {
|
|
3227
3238
|
case "primary":
|
|
3228
3239
|
return zn;
|
|
3229
3240
|
case "secondary":
|
|
3230
|
-
return Il;
|
|
3231
|
-
case "clear":
|
|
3232
3241
|
return kl;
|
|
3242
|
+
case "clear":
|
|
3243
|
+
return $l;
|
|
3233
3244
|
default:
|
|
3234
3245
|
return zn;
|
|
3235
3246
|
}
|
|
3236
|
-
},
|
|
3247
|
+
}, Ol = h.div`animation:1s infinite linear;animation-name:rotate;display:flex;align-items:center;justify-content:center;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`, Ll = ({
|
|
3237
3248
|
children: e,
|
|
3238
3249
|
onClick: t,
|
|
3239
3250
|
variant: n = "primary",
|
|
@@ -3252,12 +3263,12 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3252
3263
|
default:
|
|
3253
3264
|
return m.themedColor.textHighEmphasisInverse;
|
|
3254
3265
|
}
|
|
3255
|
-
}, l =
|
|
3256
|
-
return /* @__PURE__ */ o.createElement(l, { onClick: t, disabled: r || s, className: i }, s ? /* @__PURE__ */ o.createElement(
|
|
3257
|
-
},
|
|
3258
|
-
const { stringSet: s } =
|
|
3266
|
+
}, l = Ml(n);
|
|
3267
|
+
return /* @__PURE__ */ o.createElement(l, { onClick: t, disabled: r || s, className: i }, s ? /* @__PURE__ */ o.createElement(Ol, null, /* @__PURE__ */ o.createElement(H, { type: "spinner", size: 22, color: a() })) : /* @__PURE__ */ o.createElement(w, { variant: "button", color: a() }, e));
|
|
3268
|
+
}, Dl = ({ children: e, className: t, style: n }) => /* @__PURE__ */ o.createElement(w, { variant: "caption4", color: m.themedColor.error, className: t, style: n }, e), Rl = ({ children: e, className: t, style: n, required: r }) => {
|
|
3269
|
+
const { stringSet: s } = W();
|
|
3259
3270
|
return /* @__PURE__ */ o.createElement(w, { variant: "caption3", color: m.themedColor.textMidEmphasis, className: t, style: n }, e, !r && /* @__PURE__ */ o.createElement("span", { style: { color: m.themedColor.textLowEmphasis } }, ` (${s.OPTIONAL})`));
|
|
3260
|
-
},
|
|
3271
|
+
}, Nl = ({
|
|
3261
3272
|
value: e,
|
|
3262
3273
|
onChange: t,
|
|
3263
3274
|
placeholder: n,
|
|
@@ -3281,7 +3292,7 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3281
3292
|
}
|
|
3282
3293
|
}, d = e == null ? "" : String(e);
|
|
3283
3294
|
return /* @__PURE__ */ o.createElement(
|
|
3284
|
-
|
|
3295
|
+
Hl,
|
|
3285
3296
|
{
|
|
3286
3297
|
type: "text",
|
|
3287
3298
|
value: d,
|
|
@@ -3294,7 +3305,7 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3294
3305
|
$submitted: s
|
|
3295
3306
|
}
|
|
3296
3307
|
);
|
|
3297
|
-
},
|
|
3308
|
+
}, Bl = I`width:100%;height:36px;padding:8px 12px;border-radius:6px;font-size:14px;font-weight:400;line-height:1.43;outline:none;transition:all 0.2s ease;&::placeholder{color:${m.themedColor.textLowEmphasis};}&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}`, Fl = I`color:${m.themedColor.textHighEmphasis};border:1px solid transparent;cursor:not-allowed;${F.light`
|
|
3298
3309
|
background-color: ${m.color.ondark.textMidEmphasis};
|
|
3299
3310
|
`}
|
|
3300
3311
|
${F.dark`
|
|
@@ -3304,13 +3315,13 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3304
3315
|
&::placeholder {
|
|
3305
3316
|
color: ${m.themedColor.textLowEmphasis};
|
|
3306
3317
|
}
|
|
3307
|
-
`,
|
|
3318
|
+
`, Pl = I`border:1px solid ${m.themedColor.error};color:${m.themedColor.textHighEmphasis};${F.light`
|
|
3308
3319
|
background-color: ${m.color.background50};
|
|
3309
3320
|
`}
|
|
3310
3321
|
${F.dark`
|
|
3311
3322
|
background-color: ${m.color.onlight.textLowEmphasis};
|
|
3312
3323
|
`}
|
|
3313
|
-
`,
|
|
3324
|
+
`, Ul = I`border:1px solid ${m.themedColor.textDisabled};color:${m.themedColor.textHighEmphasis};${F.light`
|
|
3314
3325
|
background-color: ${m.color.background50};
|
|
3315
3326
|
`}
|
|
3316
3327
|
${F.dark`
|
|
@@ -3320,7 +3331,7 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3320
3331
|
&:focus {
|
|
3321
3332
|
border-color: ${m.themedColor.primary};
|
|
3322
3333
|
}
|
|
3323
|
-
`,
|
|
3334
|
+
`, Hl = h.input`${Bl}${({ $error: e, $submitted: t }) => t ? Fl : e ? Pl : Ul}`, Vl = (e) => {
|
|
3324
3335
|
if (e.multiple) {
|
|
3325
3336
|
const { value: t = [], onChange: n, maxSelect: r, submitted: s = !1 } = e;
|
|
3326
3337
|
return {
|
|
@@ -3350,11 +3361,11 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3350
3361
|
};
|
|
3351
3362
|
}
|
|
3352
3363
|
}, Mr = (e) => {
|
|
3353
|
-
const { options: t, submitted: n = !1, error: r = !1, className: s } = e, { selectedValues: i, handleOptionClick: a } =
|
|
3354
|
-
return /* @__PURE__ */ o.createElement(
|
|
3364
|
+
const { options: t, submitted: n = !1, error: r = !1, className: s } = e, { selectedValues: i, handleOptionClick: a } = Vl(e);
|
|
3365
|
+
return /* @__PURE__ */ o.createElement(Wl, { className: s }, t.map((l) => {
|
|
3355
3366
|
const c = i.includes(l.value);
|
|
3356
3367
|
return /* @__PURE__ */ o.createElement(
|
|
3357
|
-
|
|
3368
|
+
Xl,
|
|
3358
3369
|
{
|
|
3359
3370
|
key: l.value,
|
|
3360
3371
|
$active: c,
|
|
@@ -3362,15 +3373,15 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3362
3373
|
$error: r,
|
|
3363
3374
|
onClick: () => a(l.value)
|
|
3364
3375
|
},
|
|
3365
|
-
/* @__PURE__ */ o.createElement(w, { variant: "caption1", color:
|
|
3376
|
+
/* @__PURE__ */ o.createElement(w, { variant: "caption1", color: zl(c, n) }, l.label)
|
|
3366
3377
|
);
|
|
3367
3378
|
}));
|
|
3368
|
-
},
|
|
3379
|
+
}, zl = (e, t) => t ? e ? m.themedColor.textHighEmphasis : m.themedColor.textDisabled : e ? m.themedColor.primary : m.themedColor.textMidEmphasis, Wl = h.div`display:flex;flex-wrap:wrap;gap:4px 2px;`, Gl = I`display:inline-flex;align-items:center;padding:8px 12px;border-radius:15px;transition:all 0.2s ease;`, jl = I`cursor:default;background-color:${m.color.ondark.textMidEmphasis};color:${m.themedColor.textHighEmphasis};${F.dark`
|
|
3369
3380
|
background-color: transparent;
|
|
3370
3381
|
border: 1px solid white;
|
|
3371
3382
|
color: white;
|
|
3372
3383
|
`}
|
|
3373
|
-
`,
|
|
3384
|
+
`, ql = I`cursor:default;${F.light`
|
|
3374
3385
|
background-color: ${m.color.ondark.textMidEmphasis};
|
|
3375
3386
|
color: ${m.themedColor.textDisabled};
|
|
3376
3387
|
`}
|
|
@@ -3379,7 +3390,7 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3379
3390
|
border: 1px solid ${m.color.onlight.textLowEmphasis};
|
|
3380
3391
|
color: ${m.themedColor.textDisabled};
|
|
3381
3392
|
`}
|
|
3382
|
-
`,
|
|
3393
|
+
`, Kl = I`cursor:pointer;border:1px solid ${m.themedColor.primary};${F.light`
|
|
3383
3394
|
background-color: ${m.color.background50};
|
|
3384
3395
|
color: ${m.themedColor.primary};
|
|
3385
3396
|
`}
|
|
@@ -3387,7 +3398,7 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3387
3398
|
background-color: ${m.color.onlight.textLowEmphasis};
|
|
3388
3399
|
color: ${m.themedColor.primary};
|
|
3389
3400
|
`}
|
|
3390
|
-
`,
|
|
3401
|
+
`, Yl = I`cursor:pointer;border:1px solid ${m.themedColor.textDisabled};${F.light`
|
|
3391
3402
|
background-color: ${m.color.background50};
|
|
3392
3403
|
color: ${m.themedColor.textMidEmphasis};
|
|
3393
3404
|
`}
|
|
@@ -3395,15 +3406,15 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3395
3406
|
background-color: ${m.color.onlight.textLowEmphasis};
|
|
3396
3407
|
color: ${m.themedColor.textMidEmphasis};
|
|
3397
3408
|
`}
|
|
3398
|
-
`,
|
|
3409
|
+
`, Zl = I`border-color:${m.themedColor.error}!important;`, Xl = h.div`${Gl}${({ $active: e, $submitted: t, $error: n }) => {
|
|
3399
3410
|
if (t)
|
|
3400
|
-
return e ?
|
|
3401
|
-
const r = e ?
|
|
3411
|
+
return e ? jl : ql;
|
|
3412
|
+
const r = e ? Kl : Yl;
|
|
3402
3413
|
return n ? I`
|
|
3403
|
-
${r} ${
|
|
3414
|
+
${r} ${Zl}
|
|
3404
3415
|
` : r;
|
|
3405
3416
|
}}
|
|
3406
|
-
`,
|
|
3417
|
+
`, Jl = (e) => /* @__PURE__ */ o.createElement(Mr, { ...e, multiple: !1 }), Ql = (e) => /* @__PURE__ */ o.createElement(Mr, { ...e, multiple: !0 }), ec = h.div`width:100%;height:1px;background-color:${m.themedColor.textDisabled};`, tc = ({ className: e }) => /* @__PURE__ */ o.createElement(ec, { className: e }), nc = ({
|
|
3407
3418
|
value: e = "",
|
|
3408
3419
|
onChange: t,
|
|
3409
3420
|
placeholder: n,
|
|
@@ -3427,8 +3438,8 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3427
3438
|
$error: s,
|
|
3428
3439
|
$submitted: i
|
|
3429
3440
|
};
|
|
3430
|
-
return r === "multi-line" ? /* @__PURE__ */ o.createElement(
|
|
3431
|
-
},
|
|
3441
|
+
return r === "multi-line" ? /* @__PURE__ */ o.createElement(oc, { ...g }) : /* @__PURE__ */ o.createElement(rc, { ...g });
|
|
3442
|
+
}, Or = I`width:100%;padding:8px 12px;border-radius:6px;font-size:14px;font-weight:400;line-height:1.43;outline:none;transition:all 0.2s ease;&::placeholder{color:${m.themedColor.textLowEmphasis};}`, Lr = I`color:${m.themedColor.textHighEmphasis};border:1px solid transparent;cursor:not-allowed;${F.light`
|
|
3432
3443
|
background-color: ${m.color.ondark.textMidEmphasis};
|
|
3433
3444
|
`}
|
|
3434
3445
|
${F.dark`
|
|
@@ -3454,23 +3465,23 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3454
3465
|
&:focus {
|
|
3455
3466
|
border-color: ${m.themedColor.primary};
|
|
3456
3467
|
}
|
|
3457
|
-
`,
|
|
3458
|
-
Title:
|
|
3459
|
-
Label:
|
|
3460
|
-
ErrorLabel:
|
|
3461
|
-
Separator:
|
|
3468
|
+
`, rc = h.input`${Or};height:36px;${({ $error: e, $submitted: t }) => t ? Lr : e ? Dr : Rr}`, oc = h.textarea`${Or};height:96px;resize:none;font-family:inherit;${({ $error: e, $submitted: t }) => t ? Lr : e ? Dr : Rr}`, sc = ({ children: e, className: t, style: n }) => /* @__PURE__ */ o.createElement(w, { variant: "button", color: m.themedColor.textHighEmphasis, className: t, style: n }, e), J = {
|
|
3469
|
+
Title: sc,
|
|
3470
|
+
Label: Rl,
|
|
3471
|
+
ErrorLabel: Dl,
|
|
3472
|
+
Separator: tc,
|
|
3462
3473
|
Button: Ll,
|
|
3463
|
-
TextInput:
|
|
3464
|
-
NumberInput:
|
|
3465
|
-
SingleSelect:
|
|
3466
|
-
MultiSelect:
|
|
3467
|
-
},
|
|
3474
|
+
TextInput: nc,
|
|
3475
|
+
NumberInput: Nl,
|
|
3476
|
+
SingleSelect: Jl,
|
|
3477
|
+
MultiSelect: Ql
|
|
3478
|
+
}, ic = 1, ac = /* @__PURE__ */ new Set(["text", "number", "single-select", "multi-select"]), lc = (e) => {
|
|
3468
3479
|
var u;
|
|
3469
3480
|
const t = (u = e.extendedMessagePayload) == null ? void 0 : u.form;
|
|
3470
3481
|
if (!t) throw new Error("Form is not provided");
|
|
3471
|
-
const { stringSet: n } =
|
|
3482
|
+
const { stringSet: n } = W(), [r, s] = C({ submitting: !1, canceling: !1 }), [i, a] = C({
|
|
3472
3483
|
visible: !1
|
|
3473
|
-
}), { state: l, fields: c, submit: d, cancel: g, updateFieldValue: f } =
|
|
3484
|
+
}), { state: l, fields: c, submit: d, cancel: g, updateFieldValue: f } = Ii(t, {
|
|
3474
3485
|
labels: {
|
|
3475
3486
|
required: n.FORM_VALIDATION_REQUIRED,
|
|
3476
3487
|
regex: n.FORM_VALIDATION_REGEX_FAILED,
|
|
@@ -3513,11 +3524,11 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3513
3524
|
} finally {
|
|
3514
3525
|
s((p) => ({ ...p, canceling: !1 }));
|
|
3515
3526
|
}
|
|
3516
|
-
}, E =
|
|
3517
|
-
const p = () => t.version >
|
|
3527
|
+
}, E = ae(() => {
|
|
3528
|
+
const p = () => t.version > ic, x = () => t.fields.some((y) => !ac.has(y.type));
|
|
3518
3529
|
return p() || x() ? { visible: !1, cancelable: !0, reason: n.FORM_NOT_SUPPORTED } : l === "draft" && (e.isHandedOff || e.isConversationClosed) ? { visible: !1, cancelable: !1, reason: n.FORM_UNAVAILABLE } : { visible: !0, cancelable: !0, reason: "" };
|
|
3519
3530
|
}, [t.version, t.fields, l, e.isHandedOff, e.isConversationClosed]);
|
|
3520
|
-
return l === "canceled" ? null : E.visible ? /* @__PURE__ */ o.createElement(rr, null, /* @__PURE__ */ o.createElement(
|
|
3531
|
+
return l === "canceled" ? null : E.visible ? /* @__PURE__ */ o.createElement(rr, null, /* @__PURE__ */ o.createElement(Wn, { $maxWidth: e.maxBodyWidth ?? V.BODY_MAX_WIDTH }, /* @__PURE__ */ o.createElement(J.Title, null, t.title), /* @__PURE__ */ o.createElement(cc, null, c.map((p) => /* @__PURE__ */ o.createElement(dc, { key: p.key }, /* @__PURE__ */ o.createElement(J.Label, { style: { marginBottom: "6px" }, required: p.required }, p.label), p.type === "text" && /* @__PURE__ */ o.createElement(
|
|
3521
3532
|
J.TextInput,
|
|
3522
3533
|
{
|
|
3523
3534
|
value: p.value || "",
|
|
@@ -3557,7 +3568,7 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3557
3568
|
submitted: b,
|
|
3558
3569
|
maxSelect: p.maxSelect
|
|
3559
3570
|
}
|
|
3560
|
-
), p.error && /* @__PURE__ */ o.createElement(J.ErrorLabel, { style: { marginTop: "4px" } }, p.error)))), /* @__PURE__ */ o.createElement(J.Separator, null), /* @__PURE__ */ o.createElement(
|
|
3571
|
+
), p.error && /* @__PURE__ */ o.createElement(J.ErrorLabel, { style: { marginTop: "4px" } }, p.error)))), /* @__PURE__ */ o.createElement(J.Separator, null), /* @__PURE__ */ o.createElement(uc, null, /* @__PURE__ */ o.createElement(
|
|
3561
3572
|
J.Button,
|
|
3562
3573
|
{
|
|
3563
3574
|
variant: b ? "clear" : "primary",
|
|
@@ -3575,43 +3586,43 @@ const Hn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
|
|
|
3575
3586
|
loading: r.canceling
|
|
3576
3587
|
},
|
|
3577
3588
|
n.BUTTON__CANCEL
|
|
3578
|
-
))), /* @__PURE__ */ o.createElement(tn, { ...i, onClose: () => a({ visible: !1, title: "" }) })) : /* @__PURE__ */ o.createElement(
|
|
3579
|
-
},
|
|
3589
|
+
))), /* @__PURE__ */ o.createElement(tn, { ...i, onClose: () => a({ visible: !1, title: "" }) })) : /* @__PURE__ */ o.createElement(Wn, { $maxWidth: e.maxBodyWidth ?? V.BODY_MAX_WIDTH }, /* @__PURE__ */ o.createElement(w, { variant: "body3" }, E.reason), E.cancelable && /* @__PURE__ */ o.createElement(J.Button, { variant: "primary", onClick: _, loading: r.canceling }, n.BUTTON__CANCEL));
|
|
3590
|
+
}, Wn = h.div`display:flex;flex-direction:column;gap:12px;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e }) => I`
|
|
3580
3591
|
color: ${e.colors.messageIncoming.text};
|
|
3581
3592
|
background-color: ${e.colors.messageIncoming.background};
|
|
3582
3593
|
`}
|
|
3583
3594
|
padding: 16px 12px;
|
|
3584
3595
|
transition: max-width 0.3s;
|
|
3585
3596
|
overflow-wrap: break-word;
|
|
3586
|
-
`,
|
|
3587
|
-
function
|
|
3597
|
+
`, cc = h.div`display:flex;flex-direction:column;gap:12px;`, dc = h.div`display:flex;flex-direction:column;`, uc = h.div`display:flex;flex-direction:column;gap:8px;`;
|
|
3598
|
+
function mc(e) {
|
|
3588
3599
|
return /* @__PURE__ */ o.createElement(o.Fragment, null);
|
|
3589
3600
|
}
|
|
3590
|
-
const
|
|
3601
|
+
const gc = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: hc } = Ho({
|
|
3591
3602
|
parser: Po,
|
|
3592
3603
|
renderer: Fo,
|
|
3593
3604
|
Container: (e) => /* @__PURE__ */ o.createElement("div", { ...e })
|
|
3594
3605
|
});
|
|
3595
|
-
function
|
|
3606
|
+
function pc(e) {
|
|
3596
3607
|
return /* @__PURE__ */ o.createElement(
|
|
3597
3608
|
bt,
|
|
3598
3609
|
{
|
|
3599
3610
|
errorFallback: e.messageTemplateErrorFallback,
|
|
3600
3611
|
loadingFallback: e.messageTemplateLoadingFallback
|
|
3601
3612
|
},
|
|
3602
|
-
/* @__PURE__ */ o.createElement(
|
|
3613
|
+
/* @__PURE__ */ o.createElement(fc, { ...e })
|
|
3603
3614
|
);
|
|
3604
3615
|
}
|
|
3605
|
-
const
|
|
3616
|
+
const fc = ({
|
|
3606
3617
|
extendedMessagePayload: e,
|
|
3607
3618
|
onGetCachedMessageTemplate: t = () => null,
|
|
3608
3619
|
onRequestMessageTemplate: n,
|
|
3609
3620
|
onHandleTemplateInternalAction: r = _e
|
|
3610
3621
|
}) => {
|
|
3611
3622
|
const s = e == null ? void 0 : e.message_template;
|
|
3612
|
-
if (!
|
|
3623
|
+
if (!gc.has((s == null ? void 0 : s.type) ?? "default")) throw new Error("Unsupported template type");
|
|
3613
3624
|
if (!n) throw new Error("onRequestMessageTemplate is required");
|
|
3614
|
-
const { theme: a } = Sr(), l =
|
|
3625
|
+
const { theme: a } = Sr(), l = Ei({
|
|
3615
3626
|
onRequestTemplate: n,
|
|
3616
3627
|
onGetCachedTemplate: t,
|
|
3617
3628
|
theme: a.selectedTheme,
|
|
@@ -3620,24 +3631,24 @@ const pc = ({
|
|
|
3620
3631
|
viewVariables: s == null ? void 0 : s.view_variables,
|
|
3621
3632
|
aiAgentColorVariables: a.aiAgentColorVariables
|
|
3622
3633
|
});
|
|
3623
|
-
return /* @__PURE__ */ o.createElement(
|
|
3634
|
+
return /* @__PURE__ */ o.createElement(bc, { id: `${Ce}-ext-message-template` }, /* @__PURE__ */ o.createElement(
|
|
3624
3635
|
Uo,
|
|
3625
3636
|
{
|
|
3626
3637
|
handleInternalAction: (c, d) => {
|
|
3627
3638
|
c.stopPropagation(), r == null || r(d);
|
|
3628
3639
|
}
|
|
3629
3640
|
},
|
|
3630
|
-
/* @__PURE__ */ o.createElement(
|
|
3641
|
+
/* @__PURE__ */ o.createElement(hc, { templateItems: l.body.items, templateVersion: l.version })
|
|
3631
3642
|
));
|
|
3632
|
-
},
|
|
3633
|
-
function
|
|
3643
|
+
}, bc = h.div`box-sizing:border-box;overflow:hidden;width:100%;`;
|
|
3644
|
+
function Ec({
|
|
3634
3645
|
extendedMessagePayload: e,
|
|
3635
3646
|
onClickSuggestedReply: t,
|
|
3636
3647
|
suggestedRepliesDirection: n = "vertical"
|
|
3637
3648
|
}) {
|
|
3638
3649
|
const [r, s] = C(!1), i = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
3639
|
-
return i.length === 0 || r ? null : /* @__PURE__ */ o.createElement(
|
|
3640
|
-
|
|
3650
|
+
return i.length === 0 || r ? null : /* @__PURE__ */ o.createElement(xc, { id: `${Ce}-ext-suggested-replies`, $type: n }, i.map((a, l) => /* @__PURE__ */ o.createElement(
|
|
3651
|
+
vc,
|
|
3641
3652
|
{
|
|
3642
3653
|
key: l,
|
|
3643
3654
|
$type: n,
|
|
@@ -3649,37 +3660,37 @@ function bc({
|
|
|
3649
3660
|
a
|
|
3650
3661
|
)));
|
|
3651
3662
|
}
|
|
3652
|
-
const
|
|
3653
|
-
${e === "vertical" ?
|
|
3663
|
+
const xc = h.div`margin:16px 0;padding:0 ${V.HORIZONTAL_PADDING}px;position:relative;display:flex;align-self:stretch;gap:8px;${({ $type: e }) => e === "vertical" ? _c : yc};`, vc = h(w)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${m.color.primary.main};border:1px solid ${m.color.primary.main};background-color:${m.themedColor.bg_50_600};&:hover{background-color:${m.themedColor.bg_100_500};}${({ $type: e, theme: t }) => I`
|
|
3664
|
+
${e === "vertical" ? Cc : Sc};
|
|
3654
3665
|
&:active {
|
|
3655
3666
|
background-color: ${t.colors.base.primary};
|
|
3656
3667
|
color: ${t.colors.base.primaryContrastContent};
|
|
3657
3668
|
}
|
|
3658
3669
|
`}
|
|
3659
|
-
`,
|
|
3660
|
-
template:
|
|
3670
|
+
`, _c = I`flex-direction:column;align-items:flex-end;`, yc = I`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cc = I`max-width:calc(100% - 70px);white-space:pre-wrap;`, Sc = I`white-space:nowrap;`, Ve = ye({
|
|
3671
|
+
template: Tc,
|
|
3661
3672
|
components: {
|
|
3662
|
-
SenderName:
|
|
3663
|
-
SenderAvatar:
|
|
3664
|
-
SentTime:
|
|
3665
|
-
MessageBody:
|
|
3666
|
-
TypingIndicator:
|
|
3667
|
-
SuggestedReplies:
|
|
3668
|
-
MessageTemplate:
|
|
3669
|
-
CustomMessageTemplate:
|
|
3670
|
-
CTAButton:
|
|
3671
|
-
Citation:
|
|
3672
|
-
Form:
|
|
3673
|
-
Feedback:
|
|
3674
|
-
MessageLogs:
|
|
3673
|
+
SenderName: Pa,
|
|
3674
|
+
SenderAvatar: Ba,
|
|
3675
|
+
SentTime: Ha,
|
|
3676
|
+
MessageBody: Da,
|
|
3677
|
+
TypingIndicator: Va,
|
|
3678
|
+
SuggestedReplies: Ec,
|
|
3679
|
+
MessageTemplate: pc,
|
|
3680
|
+
CustomMessageTemplate: tl,
|
|
3681
|
+
CTAButton: ja,
|
|
3682
|
+
Citation: Ya,
|
|
3683
|
+
Form: lc,
|
|
3684
|
+
Feedback: vl,
|
|
3685
|
+
MessageLogs: mc
|
|
3675
3686
|
}
|
|
3676
3687
|
});
|
|
3677
|
-
function
|
|
3688
|
+
function Tc(e) {
|
|
3678
3689
|
return /* @__PURE__ */ o.createElement(Nr, { ...e, testerMode: !1 });
|
|
3679
3690
|
}
|
|
3680
3691
|
function Nr(e) {
|
|
3681
|
-
var u, p, x, y, k,
|
|
3682
|
-
const { components: t } = Ve.useContext(), { streamText: n, isAnimating: r } =
|
|
3692
|
+
var u, p, x, y, k, T, D;
|
|
3693
|
+
const { components: t } = Ve.useContext(), { streamText: n, isAnimating: r } = Di({
|
|
3683
3694
|
text: e.message,
|
|
3684
3695
|
enabled: e.isStreaming,
|
|
3685
3696
|
onAnimationStart: e.onStreamAnimationStart,
|
|
@@ -3690,7 +3701,7 @@ function Nr(e) {
|
|
|
3690
3701
|
message: n,
|
|
3691
3702
|
extendedMessagePayload: r ? {} : e.extendedMessagePayload
|
|
3692
3703
|
}, i = !!s.isTyping, a = s.testerMode, l = !!s.isSenderAvatarVisible, c = !!((u = s.extendedMessagePayload) != null && u.form) && !((p = s.extendedMessagePayload) != null && p.form.canceled_at), d = !!((x = s.extendedMessagePayload) != null && x.message_template), g = !!((y = s.extendedMessagePayload) != null && y.cta_button), f = !!((k = s.extendedMessagePayload) != null && k.citations) && s.extendedMessagePayload.citations.length > 0, b = !!s.createdAt, v = s.groupType === "top" || s.groupType === "single", _ = s.groupType === "bottom" || s.groupType === "single", E = a || !l ? 0 : V.AVATAR_SIZE;
|
|
3693
|
-
return /* @__PURE__ */ o.createElement(
|
|
3704
|
+
return /* @__PURE__ */ o.createElement(Ac, { $marginBottom: i ? 0 : Kt(s.groupType) }, v && /* @__PURE__ */ o.createElement(wc, null, !a && l && /* @__PURE__ */ o.createElement(t.SenderAvatar, { ...s }), /* @__PURE__ */ o.createElement(t.SenderName, { ...s })), /* @__PURE__ */ o.createElement(kc, null, /* @__PURE__ */ o.createElement($t, { $extraStartPadding: E }, i ? /* @__PURE__ */ o.createElement(t.TypingIndicator, { ...s }) : /* @__PURE__ */ o.createElement(t.MessageBody, { ...s }, g && /* @__PURE__ */ o.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ o.createElement(t.CTAButton, { ...s })), f && /* @__PURE__ */ o.createElement(t.Citation, { ...s }))), d && /* @__PURE__ */ o.createElement(Gn, { $startPadding: 0, $endPadding: 0 }, /* @__PURE__ */ o.createElement(
|
|
3694
3705
|
t.MessageTemplate,
|
|
3695
3706
|
{
|
|
3696
3707
|
...s,
|
|
@@ -3699,29 +3710,29 @@ function Nr(e) {
|
|
|
3699
3710
|
{
|
|
3700
3711
|
...s,
|
|
3701
3712
|
messageType: "user",
|
|
3702
|
-
message: ((
|
|
3713
|
+
message: ((D = (T = s.extendedMessagePayload) == null ? void 0 : T.message_template) == null ? void 0 : D.fallback_message) ?? "Cannot read this template."
|
|
3703
3714
|
}
|
|
3704
3715
|
)),
|
|
3705
3716
|
messageTemplateLoadingFallback: s.messageTemplateLoadingFallback ?? /* @__PURE__ */ o.createElement($t, { $extraStartPadding: E }, /* @__PURE__ */ o.createElement(t.TypingIndicator, { ...s }))
|
|
3706
3717
|
}
|
|
3707
|
-
)), /* @__PURE__ */ o.createElement(t.CustomMessageTemplate, { ...s }), c && /* @__PURE__ */ o.createElement(
|
|
3718
|
+
)), /* @__PURE__ */ o.createElement(t.CustomMessageTemplate, { ...s }), c && /* @__PURE__ */ o.createElement(Gn, { $extraStartPadding: E }, /* @__PURE__ */ o.createElement(t.Form, { ...s }))), _ && b && /* @__PURE__ */ o.createElement(Ic, { $extraStartPadding: E + 8 }, /* @__PURE__ */ o.createElement(t.SentTime, { ...s })), /* @__PURE__ */ o.createElement(rr, null, !i && /* @__PURE__ */ o.createElement(tt, { $extraStartPadding: E + 8 }, /* @__PURE__ */ o.createElement(t.Feedback, { ...s })), s.suggestedRepliesVisible && /* @__PURE__ */ o.createElement(t.SuggestedReplies, { ...s }), /* @__PURE__ */ o.createElement(t.MessageLogs, { ...s })));
|
|
3708
3719
|
}
|
|
3709
|
-
const
|
|
3720
|
+
const Ac = h.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
3710
3721
|
`, tt = h.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = V.HORIZONTAL_PADDING, $endPadding: t = V.HORIZONTAL_PADDING, $extraStartPadding: n = 0 }) => `
|
|
3711
3722
|
padding-inline: ${e + n}px ${t}px;
|
|
3712
3723
|
`}
|
|
3713
|
-
`,
|
|
3724
|
+
`, wc = h(tt)`display:flex;flex-direction:row;align-items:center;gap:8px;`, $t = h(tt)`display:flex;`, Ic = h(tt)`margin-top:${V.BODY_TIME_GAP}px;display:flex;align-items:flex-start;justify-content:flex-start;`, Gn = h(tt)`display:flex;${({ $startPadding: e = V.HORIZONTAL_PADDING, $endPadding: t = V.HORIZONTAL_PADDING, $extraStartPadding: n = 0 }) => `
|
|
3714
3725
|
padding-inline: ${e + n}px ${t}px;
|
|
3715
3726
|
`}
|
|
3716
|
-
`,
|
|
3717
|
-
function
|
|
3727
|
+
`, kc = h.div`display:flex;flex-direction:column;gap:${V.GAP_GROUPED}px;`;
|
|
3728
|
+
function $c({ file: e, children: t, onClickFile: n, sendingStatus: r }) {
|
|
3718
3729
|
const s = (() => {
|
|
3719
3730
|
if (!(!n || r === "failed"))
|
|
3720
3731
|
return () => n == null ? void 0 : n(e);
|
|
3721
3732
|
})();
|
|
3722
|
-
return /* @__PURE__ */ o.createElement(
|
|
3733
|
+
return /* @__PURE__ */ o.createElement(Mc, null, /* @__PURE__ */ o.createElement(Jt, { name: e.name, type: qt(e.name, e.type), onClick: s }), t);
|
|
3723
3734
|
}
|
|
3724
|
-
const
|
|
3735
|
+
const Mc = h.div`display:flex;flex-direction:column;align-items:flex-end;gap:${V.GAP_GROUPED}px;`, rn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ o.createElement(Oc, { className: e, $size: n }, t ?? /* @__PURE__ */ o.createElement(H, { type: "spinner", size: n })), Oc = h.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => ge(e)};height:${({ $size: e }) => ge(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
3725
3736
|
function Lc({
|
|
3726
3737
|
sendingStatus: e,
|
|
3727
3738
|
file: t,
|
|
@@ -3737,43 +3748,43 @@ function Lc({
|
|
|
3737
3748
|
$ratio: i,
|
|
3738
3749
|
$clickable: !!g
|
|
3739
3750
|
};
|
|
3740
|
-
return /* @__PURE__ */ o.createElement(
|
|
3751
|
+
return /* @__PURE__ */ o.createElement(Dc, null, /* @__PURE__ */ o.createElement(Rc, { ...f }, !c && /* @__PURE__ */ o.createElement(rn, { size: 26 }, /* @__PURE__ */ o.createElement(H, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ o.createElement(Nc, { $loaded: c, src: l, alt: "image-message", onLoad: () => d(!0) })), s);
|
|
3741
3752
|
}
|
|
3742
|
-
const
|
|
3753
|
+
const Dc = h.div`display:flex;flex-direction:column;align-items:flex-end;gap:${V.GAP_GROUPED}px;`, Rc = h.div`width:${V.BODY_MAX_WIDTH}px;border-radius:12px;overflow:hidden;cursor:${(e) => e.$clickable ? "pointer" : "default"};height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${F.light`
|
|
3743
3754
|
background-color: ${m.color.background100};
|
|
3744
3755
|
`}
|
|
3745
3756
|
${F.dark`
|
|
3746
3757
|
background-color: ${m.color.background400};
|
|
3747
3758
|
`}
|
|
3748
|
-
`,
|
|
3759
|
+
`, Nc = h.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;`;
|
|
3749
3760
|
function jn(e) {
|
|
3750
3761
|
var n, r;
|
|
3751
|
-
const t =
|
|
3752
|
-
const s =
|
|
3762
|
+
const t = ae(() => {
|
|
3763
|
+
const s = Ma(Ir(e.message));
|
|
3753
3764
|
return lr.sanitize(s);
|
|
3754
3765
|
}, [e.message]);
|
|
3755
3766
|
return /* @__PURE__ */ o.createElement(
|
|
3756
|
-
|
|
3767
|
+
Bc,
|
|
3757
3768
|
{
|
|
3758
3769
|
$maxWidth: e.maxBodyWidth ?? V.BODY_MAX_WIDTH,
|
|
3759
3770
|
$color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
|
|
3760
3771
|
$bgColor: (r = e.customStyle) == null ? void 0 : r.bubbleBackgroundColor
|
|
3761
3772
|
},
|
|
3762
|
-
/* @__PURE__ */ o.createElement(
|
|
3773
|
+
/* @__PURE__ */ o.createElement(Fc, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
|
|
3763
3774
|
);
|
|
3764
3775
|
}
|
|
3765
|
-
const
|
|
3776
|
+
const Bc = h.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
|
|
3766
3777
|
color: ${t || e.colors.messageOutgoing.text};
|
|
3767
3778
|
background-color: ${n || e.colors.messageOutgoing.background};
|
|
3768
3779
|
`}
|
|
3769
3780
|
padding: 12px 0;
|
|
3770
3781
|
transition: max-width 0.3s;
|
|
3771
3782
|
overflow-wrap: break-word;
|
|
3772
|
-
`,
|
|
3773
|
-
function
|
|
3774
|
-
const { stringSet: t } =
|
|
3783
|
+
`, Fc = h(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
3784
|
+
function Pc(e) {
|
|
3785
|
+
const { stringSet: t } = W(), n = () => {
|
|
3775
3786
|
const i = mr(e) ? /* @__PURE__ */ o.createElement(jn, { ...e }) : null;
|
|
3776
|
-
return e.messageType === "user" ? i : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ o.createElement(Lc, { ...e }, i) : /* @__PURE__ */ o.createElement(
|
|
3787
|
+
return e.messageType === "user" ? i : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ o.createElement(Lc, { ...e }, i) : /* @__PURE__ */ o.createElement($c, { ...e }, i) : /* @__PURE__ */ o.createElement(jn, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
3777
3788
|
}, r = e.sendingStatus === "failed" && e.onClickFailedMessage, s = (i) => {
|
|
3778
3789
|
var a;
|
|
3779
3790
|
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), (a = e.onClickFailedMessage) == null || a.call(e));
|
|
@@ -3792,11 +3803,11 @@ function Fc(e) {
|
|
|
3792
3803
|
n()
|
|
3793
3804
|
);
|
|
3794
3805
|
}
|
|
3795
|
-
function
|
|
3806
|
+
function Uc({ sendingStatus: e }) {
|
|
3796
3807
|
const t = Je();
|
|
3797
3808
|
switch (e) {
|
|
3798
3809
|
case "pending":
|
|
3799
|
-
return /* @__PURE__ */ o.createElement(
|
|
3810
|
+
return /* @__PURE__ */ o.createElement(Hc, { size: 16 }, /* @__PURE__ */ o.createElement(H, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
3800
3811
|
case "failed":
|
|
3801
3812
|
return /* @__PURE__ */ o.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ o.createElement(H, { type: "error", color: m.themedColor.error, size: 16 }));
|
|
3802
3813
|
case "scheduled":
|
|
@@ -3806,30 +3817,30 @@ function Pc({ sendingStatus: e }) {
|
|
|
3806
3817
|
return /* @__PURE__ */ o.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ o.createElement(H, { type: "done", color: m.themedColor.secondary, size: 16 }));
|
|
3807
3818
|
}
|
|
3808
3819
|
}
|
|
3809
|
-
const
|
|
3810
|
-
function
|
|
3811
|
-
const { stringSet: t, format: n } =
|
|
3820
|
+
const Hc = h(rn)`margin-bottom:2px;width:16px;height:16px;`;
|
|
3821
|
+
function Vc({ createdAt: e }) {
|
|
3822
|
+
const { stringSet: t, format: n } = W();
|
|
3812
3823
|
return e ? /* @__PURE__ */ o.createElement(w, { variant: "caption4", color: m.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
3813
3824
|
}
|
|
3814
3825
|
const on = ye({
|
|
3815
|
-
template:
|
|
3826
|
+
template: zc,
|
|
3816
3827
|
components: {
|
|
3817
|
-
SendingStatus:
|
|
3818
|
-
SentTime:
|
|
3819
|
-
MessageBody:
|
|
3828
|
+
SendingStatus: Uc,
|
|
3829
|
+
SentTime: Vc,
|
|
3830
|
+
MessageBody: Pc
|
|
3820
3831
|
}
|
|
3821
3832
|
});
|
|
3822
|
-
function
|
|
3833
|
+
function zc(e) {
|
|
3823
3834
|
const { components: t } = on.useContext(), n = e.sendingStatus === "succeeded", r = e.groupType === "bottom" || e.groupType === "single";
|
|
3824
|
-
return /* @__PURE__ */ o.createElement(
|
|
3835
|
+
return /* @__PURE__ */ o.createElement(Wc, { $marginBottom: Kt(e.groupType) }, /* @__PURE__ */ o.createElement(Gc, null, /* @__PURE__ */ o.createElement(t.MessageBody, { ...e })), r && /* @__PURE__ */ o.createElement(jc, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ o.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ o.createElement(t.SendingStatus, { ...e })));
|
|
3825
3836
|
}
|
|
3826
|
-
const
|
|
3837
|
+
const Wc = h.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
3827
3838
|
`, Br = h.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = V.HORIZONTAL_PADDING, $endPadding: t = V.HORIZONTAL_PADDING, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
|
|
3828
|
-
`, Gc = h(Br)``,
|
|
3829
|
-
function
|
|
3830
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ o.createElement(
|
|
3839
|
+
`, Gc = h(Br)``, jc = h(Br)`margin-top:${V.BODY_TIME_GAP}px;`;
|
|
3840
|
+
function qc(e) {
|
|
3841
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ o.createElement(Kc, null, /* @__PURE__ */ o.createElement(w, { variant: "caption2", color: m.themedColor.textMidEmphasis }, Yc(lr.sanitize(e.message))));
|
|
3831
3842
|
}
|
|
3832
|
-
const
|
|
3843
|
+
const Kc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;padding-inline:${V.HORIZONTAL_PADDING}px;a{text-decoration:underline;color:inherit;}`, Yc = (e) => {
|
|
3833
3844
|
try {
|
|
3834
3845
|
const t = [];
|
|
3835
3846
|
let n = e, r = 0;
|
|
@@ -3855,10 +3866,10 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
3855
3866
|
}
|
|
3856
3867
|
}, Fr = ({ onClick: e, checked: t, label: n, disabled: r, labelVariant: s = "caption2" }) => {
|
|
3857
3868
|
const i = t ? m.themedColor.primary : r ? m.themedColor.textDisabled : m.themedColor.textLowEmphasis, a = t ? m.themedColor.textHighEmphasis : r ? m.themedColor.textLowEmphasis : m.themedColor.textHighEmphasis;
|
|
3858
|
-
return /* @__PURE__ */ o.createElement(
|
|
3859
|
-
},
|
|
3869
|
+
return /* @__PURE__ */ o.createElement(Jc, { onClick: e, disabled: r }, /* @__PURE__ */ o.createElement(Zc, null, /* @__PURE__ */ o.createElement(H, { size: 20, type: t ? "radio-on" : "radio-off", color: i })), /* @__PURE__ */ o.createElement(Xc, { variant: s, color: a }, n));
|
|
3870
|
+
}, Zc = h.div`width:20px;height:20px;`, Xc = h(w)`line-height:20px;word-break:break-word;`, Jc = h.button`all:unset;display:flex;align-items:flex-start;justify-content:flex-start;gap:2px;&:enabled{cursor:pointer;}`, Qc = ({ csatPayload: e, submitted: t, defaultValue: n, value: r, onChange: s }) => (P(() => {
|
|
3860
3871
|
typeof r > "u" && typeof n == "boolean" && (s == null || s(n));
|
|
3861
|
-
}, [r, n]), e.cre ? /* @__PURE__ */ o.createElement(
|
|
3872
|
+
}, [r, n]), e.cre ? /* @__PURE__ */ o.createElement(ed, null, /* @__PURE__ */ o.createElement(J.Label, { required: e.cre.required }, e.cre.question), /* @__PURE__ */ o.createElement(td, null, [
|
|
3862
3873
|
{ label: e.cre.positive_label, value: !0 },
|
|
3863
3874
|
{ label: e.cre.negative_label, value: !1 }
|
|
3864
3875
|
].map((i) => /* @__PURE__ */ o.createElement(
|
|
@@ -3870,15 +3881,15 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
3870
3881
|
disabled: t,
|
|
3871
3882
|
onClick: () => s == null ? void 0 : s(i.value)
|
|
3872
3883
|
}
|
|
3873
|
-
)))) : null),
|
|
3884
|
+
)))) : null), ed = h.div`display:flex;flex-direction:column;gap:8px;`, td = h.div`display:flex;flex-direction:column;gap:8px;`, nd = ({
|
|
3874
3885
|
followUpItem: e,
|
|
3875
3886
|
submitted: t,
|
|
3876
3887
|
value: n = "",
|
|
3877
3888
|
onChange: r,
|
|
3878
3889
|
hasError: s
|
|
3879
3890
|
}) => {
|
|
3880
|
-
const { stringSet: i } =
|
|
3881
|
-
return /* @__PURE__ */ o.createElement(
|
|
3891
|
+
const { stringSet: i } = W();
|
|
3892
|
+
return /* @__PURE__ */ o.createElement(rd, null, /* @__PURE__ */ o.createElement(J.Label, { required: e.required }, e.question), e.response_type === "free_text" && /* @__PURE__ */ o.createElement(
|
|
3882
3893
|
J.TextInput,
|
|
3883
3894
|
{
|
|
3884
3895
|
variant: "multi-line",
|
|
@@ -3889,7 +3900,7 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
3889
3900
|
onChange: (a) => r(a),
|
|
3890
3901
|
error: s
|
|
3891
3902
|
}
|
|
3892
|
-
), e.response_type === "single_choice" && /* @__PURE__ */ o.createElement(
|
|
3903
|
+
), e.response_type === "single_choice" && /* @__PURE__ */ o.createElement(od, null, e.options.map((a) => /* @__PURE__ */ o.createElement(
|
|
3893
3904
|
Fr,
|
|
3894
3905
|
{
|
|
3895
3906
|
key: a,
|
|
@@ -3900,7 +3911,7 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
3900
3911
|
labelVariant: "body3"
|
|
3901
3912
|
}
|
|
3902
3913
|
))), s && /* @__PURE__ */ o.createElement(J.ErrorLabel, null, i.FORM_VALIDATION_REQUIRED));
|
|
3903
|
-
},
|
|
3914
|
+
}, rd = h.div`display:flex;flex-direction:column;gap:8px;`, od = h.div`display:flex;flex-direction:column;gap:8px;`, sd = ({ value: e, selected: t, label: n }) => /* @__PURE__ */ o.createElement(id, { $selected: t, "aria-label": n }, ad[e - 1]), id = h.div`user-select:none;-webkit-user-drag:none;width:40px;height:40px;aspect-ratio:1;opacity:${({ $selected: e }) => e ? 1 : 0.38};`, ad = [
|
|
3904
3915
|
/* @__PURE__ */ o.createElement("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ o.createElement(
|
|
3905
3916
|
"path",
|
|
3906
3917
|
{
|
|
@@ -4057,11 +4068,11 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
4057
4068
|
strokeLinejoin: "round"
|
|
4058
4069
|
}
|
|
4059
4070
|
), /* @__PURE__ */ o.createElement("defs", null, /* @__PURE__ */ o.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ o.createElement("rect", { width: "15.83", height: "7.915", fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ o.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ o.createElement("rect", { width: "15.83", height: "7.915", fill: "white", transform: "translate(12.085 22.709)" }))))
|
|
4060
|
-
],
|
|
4071
|
+
], ld = ({ csatPayload: e, submitted: t, value: n, onChange: r }) => {
|
|
4061
4072
|
const s = typeof n > "u";
|
|
4062
|
-
return /* @__PURE__ */ o.createElement(
|
|
4073
|
+
return /* @__PURE__ */ o.createElement(dd, null, /* @__PURE__ */ o.createElement(w, { variant: "caption3", color: m.themedColor.textMidEmphasis }, e.csat_question), /* @__PURE__ */ o.createElement(ud, null, e.csat_scores.map(({ label: i, image_url: a }, l) => {
|
|
4063
4074
|
const c = l + 1, d = n === c;
|
|
4064
|
-
return /* @__PURE__ */ o.createElement(
|
|
4075
|
+
return /* @__PURE__ */ o.createElement(md, { key: l, disabled: t, onClick: () => r(c) }, /* @__PURE__ */ o.createElement(cd, { value: c, selected: s || d, label: i, src: a }), !!i && /* @__PURE__ */ o.createElement(
|
|
4065
4076
|
w,
|
|
4066
4077
|
{
|
|
4067
4078
|
color: d ? m.themedColor.textHighEmphasis : m.themedColor.textLowEmphasis,
|
|
@@ -4070,19 +4081,19 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
4070
4081
|
i
|
|
4071
4082
|
));
|
|
4072
4083
|
})));
|
|
4073
|
-
},
|
|
4084
|
+
}, cd = ({
|
|
4074
4085
|
value: e,
|
|
4075
4086
|
src: t,
|
|
4076
4087
|
label: n,
|
|
4077
4088
|
selected: r
|
|
4078
4089
|
}) => {
|
|
4079
|
-
const [s, i] = C(!1), a = s ? /* @__PURE__ */ o.createElement(
|
|
4080
|
-
return /* @__PURE__ */ o.createElement(
|
|
4081
|
-
},
|
|
4090
|
+
const [s, i] = C(!1), a = s ? /* @__PURE__ */ o.createElement(sd, { value: e, selected: r, label: n }) : /* @__PURE__ */ o.createElement(hd, { $selected: r, "aria-label": n, src: t, onError: () => i(!0) });
|
|
4091
|
+
return /* @__PURE__ */ o.createElement(gd, null, a);
|
|
4092
|
+
}, dd = h.div`display:flex;flex-direction:column;gap:8px;`, ud = h.div`display:flex;justify-content:space-between;align-self:center;width:100%;max-width:400px;gap:16px;`, md = h.button`background-color:transparent;border:none;gap:4px;display:flex;flex-direction:column;align-items:center;justify-content:start;box-sizing:border-box;min-width:48px;max-width:68px;&:hover:not(:disabled) span{color:${m.themedColor.textHighEmphasis};}`, gd = h.div`button:hover:not(:disabled) &{border-radius:4px;cursor:pointer;background-color:${m.color.background200};${F.dark`
|
|
4082
4093
|
background-color: ${m.color.background500};
|
|
4083
4094
|
`}
|
|
4084
4095
|
}
|
|
4085
|
-
`,
|
|
4096
|
+
`, hd = h.img`user-select:none;-webkit-user-drag:none;width:40px;height:40px;aspect-ratio:1;opacity:${({ $selected: e }) => e ? 1 : 0.38};`, pd = ({ csatPayload: e }) => /* @__PURE__ */ o.createElement(w, { variant: "button", color: m.themedColor.textHighEmphasis }, e.title), Mt = ({
|
|
4086
4097
|
csatPayload: e,
|
|
4087
4098
|
type: t,
|
|
4088
4099
|
renderSubmitButton: n,
|
|
@@ -4090,23 +4101,23 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
4090
4101
|
initialCsatReason: s,
|
|
4091
4102
|
initialIsResolved: i
|
|
4092
4103
|
}) => {
|
|
4093
|
-
const { params: a, setParams: l, error: c, setError: d, followUpItem: g, state: f, validateParams: b, itemProps: v } =
|
|
4104
|
+
const { params: a, setParams: l, error: c, setError: d, followUpItem: g, state: f, validateParams: b, itemProps: v } = $i({
|
|
4094
4105
|
csatPayload: e,
|
|
4095
4106
|
type: t,
|
|
4096
4107
|
initialCsat: r,
|
|
4097
4108
|
initialCsatReason: s,
|
|
4098
4109
|
initialIsResolved: i
|
|
4099
4110
|
});
|
|
4100
|
-
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
4101
|
-
|
|
4111
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(fd, null, /* @__PURE__ */ o.createElement(pd, { ...v }), t === Ee.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ o.createElement(
|
|
4112
|
+
Qc,
|
|
4102
4113
|
{
|
|
4103
4114
|
...v,
|
|
4104
4115
|
defaultValue: i,
|
|
4105
4116
|
value: a.isResolved,
|
|
4106
4117
|
onChange: (_) => l({ isResolved: _ })
|
|
4107
4118
|
}
|
|
4108
|
-
), /* @__PURE__ */ o.createElement(
|
|
4109
|
-
|
|
4119
|
+
), /* @__PURE__ */ o.createElement(ld, { ...v, value: a.csat, onChange: (_) => l({ csat: _ }) }), g && /* @__PURE__ */ o.createElement(
|
|
4120
|
+
nd,
|
|
4110
4121
|
{
|
|
4111
4122
|
...v,
|
|
4112
4123
|
followUpItem: g,
|
|
@@ -4117,8 +4128,8 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
4117
4128
|
hasError: c.followUpItem
|
|
4118
4129
|
}
|
|
4119
4130
|
)), f !== "unsubmittable" && /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(J.Separator, null), n({ state: f, params: a, validateParams: b })));
|
|
4120
|
-
},
|
|
4121
|
-
const { stringSet: t } =
|
|
4131
|
+
}, fd = h.div`display:flex;flex-direction:column;gap:12px;`, bd = (e) => {
|
|
4132
|
+
const { stringSet: t } = W();
|
|
4122
4133
|
return Yo(e, {
|
|
4123
4134
|
title: t.CSAT_TITLE_UNSUBMITTED,
|
|
4124
4135
|
question: t.CSAT_RATING_TITLE,
|
|
@@ -4133,16 +4144,16 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
4133
4144
|
submit_label: t.CSAT_SUBMIT_LABEL,
|
|
4134
4145
|
submitted_label: t.CSAT_TITLE_SUBMITTED
|
|
4135
4146
|
});
|
|
4136
|
-
},
|
|
4137
|
-
const { stringSet: e } =
|
|
4147
|
+
}, Ed = () => {
|
|
4148
|
+
const { stringSet: e } = W();
|
|
4138
4149
|
return /* @__PURE__ */ o.createElement(w, { variant: "body2", color: m.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
4139
|
-
},
|
|
4150
|
+
}, xd = (e) => {
|
|
4140
4151
|
if (e.messageType !== "admin.csat")
|
|
4141
4152
|
throw new Error("Invalid message type");
|
|
4142
|
-
const { extendedMessagePayload: t, onSubmitCSAT: n } = e, { csat: r, csatReason: s, csatExpireAt: i, isResolvedWhenDeterminedByUser: a } = e, l = zo(), c =
|
|
4153
|
+
const { extendedMessagePayload: t, onSubmitCSAT: n } = e, { csat: r, csatReason: s, csatExpireAt: i, isResolvedWhenDeterminedByUser: a } = e, l = zo(), c = bd(t == null ? void 0 : t.csat), d = B(!1);
|
|
4143
4154
|
if (!c || !c.visibility || !Ee[c.type]) return null;
|
|
4144
4155
|
const g = c.type === Ee.AI_AGENT_CSAT_5 || c.type === Ee.AI_AGENT_CSAT_5_WITH_CRE || c.type === Ee.HELPDESK_CSAT_5 ? Mt : () => null;
|
|
4145
|
-
return /* @__PURE__ */ o.createElement(
|
|
4156
|
+
return /* @__PURE__ */ o.createElement(vd, null, !r && yn(i) ? /* @__PURE__ */ o.createElement(Ed, null) : /* @__PURE__ */ o.createElement(
|
|
4146
4157
|
g,
|
|
4147
4158
|
{
|
|
4148
4159
|
csatPayload: c,
|
|
@@ -4151,7 +4162,7 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
4151
4162
|
initialCsatReason: s,
|
|
4152
4163
|
initialIsResolved: a,
|
|
4153
4164
|
renderSubmitButton: ({ state: f, params: b, validateParams: v }) => /* @__PURE__ */ o.createElement(
|
|
4154
|
-
|
|
4165
|
+
_d,
|
|
4155
4166
|
{
|
|
4156
4167
|
$state: f,
|
|
4157
4168
|
disabled: f === "submitted",
|
|
@@ -4165,18 +4176,18 @@ const qc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
|
|
|
4165
4176
|
)
|
|
4166
4177
|
}
|
|
4167
4178
|
));
|
|
4168
|
-
},
|
|
4169
|
-
template:
|
|
4179
|
+
}, vd = h.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:16px;`, _d = h.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;text-align:center;word-break:break-word;&:hover{background-color:${m.color.primary.dark};}&:disabled{color:${({ $state: e }) => e === "submitted" ? m.themedColor.textHighEmphasis : m.color.ondark.textLowEmphasis};background-color:${m.themedColor.textDisabled};cursor:not-allowed;}`, sn = ye({
|
|
4180
|
+
template: yd,
|
|
4170
4181
|
components: {
|
|
4171
|
-
AdminMessage:
|
|
4172
|
-
CSATMessage:
|
|
4182
|
+
AdminMessage: qc,
|
|
4183
|
+
CSATMessage: xd
|
|
4173
4184
|
}
|
|
4174
4185
|
});
|
|
4175
|
-
function
|
|
4186
|
+
function yd(e) {
|
|
4176
4187
|
const { components: t } = sn.useContext(), n = e.messageType === "admin" ? /* @__PURE__ */ o.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ o.createElement(t.CSATMessage, { ...e }) : null;
|
|
4177
|
-
return /* @__PURE__ */ o.createElement(
|
|
4188
|
+
return /* @__PURE__ */ o.createElement(Cd, { $marginBottom: Kt(e.groupType) }, n);
|
|
4178
4189
|
}
|
|
4179
|
-
const
|
|
4190
|
+
const Cd = h.div`padding-inline:${V.HORIZONTAL_PADDING}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, qn = {
|
|
4180
4191
|
file: "attach",
|
|
4181
4192
|
snippet: "snippet",
|
|
4182
4193
|
site: "website",
|
|
@@ -4186,7 +4197,7 @@ const yd = h.div`padding-inline:${V.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
|
|
|
4186
4197
|
sb_zendesk: "zendesk",
|
|
4187
4198
|
sb_desk: "snippet"
|
|
4188
4199
|
// TODO: request icon
|
|
4189
|
-
},
|
|
4200
|
+
}, Sd = ({
|
|
4190
4201
|
actionbook: e,
|
|
4191
4202
|
functionCalls: t,
|
|
4192
4203
|
groundedness: n,
|
|
@@ -4217,7 +4228,7 @@ const yd = h.div`padding-inline:${V.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
|
|
|
4217
4228
|
maxTextLines: 1
|
|
4218
4229
|
},
|
|
4219
4230
|
e.name
|
|
4220
|
-
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ o.createElement(
|
|
4231
|
+
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ o.createElement(Ot, { key: E.key }, /* @__PURE__ */ o.createElement(dt, null, /* @__PURE__ */ o.createElement(H, { size: 16, type: "function", color: b })), /* @__PURE__ */ o.createElement(Et, null, /* @__PURE__ */ o.createElement(
|
|
4221
4232
|
ct,
|
|
4222
4233
|
{
|
|
4223
4234
|
$clickable: !!i,
|
|
@@ -4228,7 +4239,7 @@ const yd = h.div`padding-inline:${V.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
|
|
|
4228
4239
|
maxTextLines: 1
|
|
4229
4240
|
},
|
|
4230
4241
|
E.name
|
|
4231
|
-
), a && /* @__PURE__ */ o.createElement(
|
|
4242
|
+
), a && /* @__PURE__ */ o.createElement(Ad, { role: "button", onClick: () => a == null ? void 0 : a(E) }, /* @__PURE__ */ o.createElement(w, { variant: "body2", color: _ }, "View details"), /* @__PURE__ */ o.createElement(H, { type: "chevron-right", size: 16, color: _ }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ o.createElement(Ot, { key: E.id }, /* @__PURE__ */ o.createElement(dt, null, g({
|
|
4232
4243
|
default: /* @__PURE__ */ o.createElement(H, { size: 16, type: qn[E.source_type] ?? qn.snippet, color: b }),
|
|
4233
4244
|
sourceType: E.source_type
|
|
4234
4245
|
})), /* @__PURE__ */ o.createElement(
|
|
@@ -4242,7 +4253,7 @@ const yd = h.div`padding-inline:${V.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
|
|
|
4242
4253
|
maxTextLines: 1
|
|
4243
4254
|
},
|
|
4244
4255
|
E.preview_title
|
|
4245
|
-
))), r == null ? void 0 : r.map((E) => /* @__PURE__ */ o.createElement(
|
|
4256
|
+
))), r == null ? void 0 : r.map((E) => /* @__PURE__ */ o.createElement(Ot, { key: E.key }, /* @__PURE__ */ o.createElement(dt, null, /* @__PURE__ */ o.createElement(H, { size: 16, type: "template", color: b })), /* @__PURE__ */ o.createElement(
|
|
4246
4257
|
ct,
|
|
4247
4258
|
{
|
|
4248
4259
|
$clickable: !!c,
|
|
@@ -4254,15 +4265,15 @@ const yd = h.div`padding-inline:${V.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
|
|
|
4254
4265
|
},
|
|
4255
4266
|
E.name
|
|
4256
4267
|
))), d);
|
|
4257
|
-
},
|
|
4268
|
+
}, Td = h(w)`font-weight:400;`, ct = h(Td)`${({ $clickable: e, $highlightColor: t }) => e && I`
|
|
4258
4269
|
cursor: pointer;
|
|
4259
4270
|
text-decoration: underline;
|
|
4260
4271
|
&:hover {
|
|
4261
4272
|
color: ${t};
|
|
4262
4273
|
}
|
|
4263
4274
|
`}
|
|
4264
|
-
`, dt = h.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Et = h.div`display:flex;gap:8px;align-items:center;word-break:break-word;`,
|
|
4265
|
-
function
|
|
4275
|
+
`, dt = h.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Et = h.div`display:flex;gap:8px;align-items:center;word-break:break-word;`, Ad = h(Et)`cursor:pointer;gap:4px;`, Ot = h(Et)`flex-direction:row;align-items:center;`, Kn = h.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Pr = We(null);
|
|
4276
|
+
function wd({
|
|
4266
4277
|
testerType: e,
|
|
4267
4278
|
origin: t,
|
|
4268
4279
|
children: n
|
|
@@ -4272,7 +4283,7 @@ function Ad({
|
|
|
4272
4283
|
{
|
|
4273
4284
|
value: { testerType: e, isActionbookTester: e === "actionbook", origin: t }
|
|
4274
4285
|
},
|
|
4275
|
-
e && /* @__PURE__ */ o.createElement(
|
|
4286
|
+
e && /* @__PURE__ */ o.createElement(Id, null),
|
|
4276
4287
|
n
|
|
4277
4288
|
);
|
|
4278
4289
|
}
|
|
@@ -4280,13 +4291,13 @@ const je = () => {
|
|
|
4280
4291
|
const e = xe(Pr);
|
|
4281
4292
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");
|
|
4282
4293
|
return e;
|
|
4283
|
-
},
|
|
4294
|
+
}, Id = () => {
|
|
4284
4295
|
const { isActionbookTester: e } = je();
|
|
4285
|
-
return /* @__PURE__ */ o.createElement(Ve.Template, { template: e ?
|
|
4286
|
-
},
|
|
4296
|
+
return /* @__PURE__ */ o.createElement(Ve.Template, { template: e ? kd : void 0 }, /* @__PURE__ */ o.createElement(Ve.MessageLogs, { component: $d }));
|
|
4297
|
+
}, kd = (e) => /* @__PURE__ */ o.createElement(Nr, { ...e, testerMode: !0, maxBodyWidth: V.WIDE_BODY_MAX_WIDTH }), $d = ({ extendedMessagePayload: e = {} }) => {
|
|
4287
4298
|
const { handlers: t } = Y(), { manual: n, groundedness: r, function_calls: s, agent_message_templates: i, is_thinking: a } = e;
|
|
4288
|
-
return a || !n && !(r != null && r.length) && !(s != null && s.length) && !(i != null && i.length) ? /* @__PURE__ */ o.createElement(o.Fragment, null) : /* @__PURE__ */ o.createElement(
|
|
4289
|
-
|
|
4299
|
+
return a || !n && !(r != null && r.length) && !(s != null && s.length) && !(i != null && i.length) ? /* @__PURE__ */ o.createElement(o.Fragment, null) : /* @__PURE__ */ o.createElement(Md, null, /* @__PURE__ */ o.createElement(Od, { width: 4 }), /* @__PURE__ */ o.createElement(
|
|
4300
|
+
Sd,
|
|
4290
4301
|
{
|
|
4291
4302
|
actionbook: n,
|
|
4292
4303
|
functionCalls: s,
|
|
@@ -4301,12 +4312,12 @@ const je = () => {
|
|
|
4301
4312
|
bottomContent: /* @__PURE__ */ o.createElement(Ld, { variant: "caption2", color: m.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
4302
4313
|
}
|
|
4303
4314
|
));
|
|
4304
|
-
},
|
|
4315
|
+
}, Md = h.div`display:flex;gap:16px;margin:16px ${V.HORIZONTAL_PADDING}px 0;align-self:stretch;`, Od = h.div`width:${({ width: e }) => e}px;background-color:${m.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Ld = h(w)`margin-top:5px;`, an = ({ start: e, title: t, titleAlign: n = "start", end: r }) => {
|
|
4305
4316
|
const s = B(null), i = B(null), [a, l] = C(0), [c, d] = C(0);
|
|
4306
|
-
return
|
|
4317
|
+
return se(() => {
|
|
4307
4318
|
s.current && l(s.current.offsetWidth), i.current && d(i.current.offsetWidth);
|
|
4308
|
-
}, [e, r]), /* @__PURE__ */ o.createElement(
|
|
4309
|
-
},
|
|
4319
|
+
}, [e, r]), /* @__PURE__ */ o.createElement(Dd, null, /* @__PURE__ */ o.createElement(Rd, null, n === "center" && t && /* @__PURE__ */ o.createElement(Nd, { $sideWidth: Math.max(a, c) }, /* @__PURE__ */ o.createElement(Bd, null, t)), /* @__PURE__ */ o.createElement(Fd, null, /* @__PURE__ */ o.createElement(Pd, { ref: s }, e), (n === "start" || n === "end") && t && /* @__PURE__ */ o.createElement(Hd, { $align: n, $hasStart: !!e, $hasEnd: !!r }, t), /* @__PURE__ */ o.createElement(Ud, { ref: i }, r))));
|
|
4320
|
+
}, Dd = h.div`position:relative;width:100%;background-color:${({ theme: e }) => e.colors.base.headerBackground};border-bottom:1px solid ${m.themedColor.textDisabled};`, Rd = h.div`position:relative;height:56px;padding:11px 12px;`, Nd = h.div`position:absolute;left:${({ $sideWidth: e }) => e}px;right:${({ $sideWidth: e }) => e}px;top:0;bottom:0;display:flex;align-items:center;justify-content:center;`, Bd = h.div`max-width:100%;overflow:hidden;`, Fd = h.div`display:flex;flex-direction:row;align-items:center;justify-content:space-between;height:100%;z-index:1;`, Pd = h.div`flex-shrink:0;display:flex;align-items:center;`, Ud = h.div`flex-shrink:0;display:flex;align-items:center;`, Hd = h.div`flex:1;overflow:hidden;display:flex;align-items:${({ $align: e }) => e === "start" ? "flex-start" : "flex-end"};margin-left:${({ $hasStart: e }) => e ? 8 : 0}px;margin-right:${({ $hasEnd: e }) => e ? 8 : 0}px;`, Oe = ({
|
|
4310
4321
|
as: e,
|
|
4311
4322
|
type: t,
|
|
4312
4323
|
size: n = 16,
|
|
@@ -4315,26 +4326,26 @@ const je = () => {
|
|
|
4315
4326
|
...i
|
|
4316
4327
|
}) => {
|
|
4317
4328
|
const a = s ? m.themedColor.textDisabled : m.themedColor.textHighEmphasis;
|
|
4318
|
-
return /* @__PURE__ */ o.createElement(
|
|
4319
|
-
},
|
|
4329
|
+
return /* @__PURE__ */ o.createElement(Vd, { as: e, disabled: s, ...i }, /* @__PURE__ */ o.createElement(H, { type: t, size: n, color: r ?? a }));
|
|
4330
|
+
}, Vd = h.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, ln = /iPad|iPhone|iPod/.test(navigator.userAgent), zd = /Android/.test(navigator.userAgent), nt = (e) => ln || zd, qe = () => nt() ? 24 : 16, Wd = () => {
|
|
4320
4331
|
const { state: e } = Y(), t = qe(), n = () => {
|
|
4321
4332
|
e.setOpened(!1);
|
|
4322
4333
|
};
|
|
4323
|
-
return /* @__PURE__ */ o.createElement(
|
|
4334
|
+
return /* @__PURE__ */ o.createElement(Oe, { "aria-label": "close messenger", type: "close", size: t, onClick: n });
|
|
4324
4335
|
}, {
|
|
4325
4336
|
Provider: Gd,
|
|
4326
|
-
useContext:
|
|
4327
|
-
} = ee("MessengerSession"),
|
|
4328
|
-
return /* @__PURE__ */ o.createElement(
|
|
4329
|
-
}),
|
|
4337
|
+
useContext: re
|
|
4338
|
+
} = ee("MessengerSession"), jd = Ge(function({ children: e, ...t }, n) {
|
|
4339
|
+
return /* @__PURE__ */ o.createElement(Gs, { ref: n, ...t }, (r) => /* @__PURE__ */ o.createElement(qd, { ...r }, e));
|
|
4340
|
+
}), qd = ({ children: e, ...t }) => {
|
|
4330
4341
|
const { chatSDK: n, logger: r, appId: s, aiAgentId: i, agentPreviewConfigs: a, state: l, handlers: c } = Y(), { userSessionInfo: d, authenticate: g, setActiveChannel: f, userSession: b, aiAgentInfo: v, launcherInfo: _ } = t, E = B(null);
|
|
4331
4342
|
return vt(n, {
|
|
4332
4343
|
async onUserJoined(u, p) {
|
|
4333
|
-
var y, k,
|
|
4344
|
+
var y, k, T;
|
|
4334
4345
|
if (u.conversation && u.conversation.type === Do.PROACTIVE && p.userId === ((y = n.currentUser) == null ? void 0 : y.userId)) {
|
|
4335
4346
|
r.info("messengerSession.onUserJoined: proactive channel joined", u.url);
|
|
4336
|
-
const
|
|
4337
|
-
f({ url: u.url, status:
|
|
4347
|
+
const D = ((k = u.conversation) == null ? void 0 : k.status) ?? Q.OPEN;
|
|
4348
|
+
f({ url: u.url, status: D }), l.setOpened(!0), Kd({ sound: document.hidden || !l.opened }), (T = E.current) == null || T.call(E, { channel: u });
|
|
4338
4349
|
}
|
|
4339
4350
|
}
|
|
4340
4351
|
}), P(() => {
|
|
@@ -4358,7 +4369,7 @@ const je = () => {
|
|
|
4358
4369
|
e
|
|
4359
4370
|
);
|
|
4360
4371
|
};
|
|
4361
|
-
function
|
|
4372
|
+
function Kd({ sound: e }) {
|
|
4362
4373
|
const t = "🔔You have received a new message", n = document.title, r = setInterval(() => {
|
|
4363
4374
|
document.title = document.title === t ? n : t;
|
|
4364
4375
|
}, 750);
|
|
@@ -4366,8 +4377,8 @@ function qd({ sound: e }) {
|
|
|
4366
4377
|
new Audio(s.default).play();
|
|
4367
4378
|
});
|
|
4368
4379
|
}
|
|
4369
|
-
const
|
|
4370
|
-
const { chatSDK: t, handlers: n, logger: r } = Y(), { aiAgentInfo: s } =
|
|
4380
|
+
const Yd = (e) => {
|
|
4381
|
+
const { chatSDK: t, handlers: n, logger: r } = Y(), { aiAgentInfo: s } = re(), i = B(/* @__PURE__ */ new Set()), a = (g) => {
|
|
4371
4382
|
if (!(n != null && n.onCustomEvent)) return;
|
|
4372
4383
|
ve(g) && g.sender.userId === s.userId && !Ie.isStreaming(g) && !i.current.has(g.messageId) && (r.debug("useCustomEventForMessageReceive: bot-message-received", g), n.onCustomEvent({ type: "bot-message-received", data: { message: g } }), i.current.add(g.messageId));
|
|
4373
4384
|
}, l = (g) => {
|
|
@@ -4390,7 +4401,7 @@ const Kd = (e) => {
|
|
|
4390
4401
|
checkForUserActionRequired: d
|
|
4391
4402
|
};
|
|
4392
4403
|
};
|
|
4393
|
-
function
|
|
4404
|
+
function Zd(e) {
|
|
4394
4405
|
return new Promise((t) => {
|
|
4395
4406
|
const n = new Image();
|
|
4396
4407
|
n.onload = function() {
|
|
@@ -4399,23 +4410,23 @@ function Yd(e) {
|
|
|
4399
4410
|
}, n.src = URL.createObjectURL(e);
|
|
4400
4411
|
});
|
|
4401
4412
|
}
|
|
4402
|
-
async function
|
|
4413
|
+
async function Xd(e) {
|
|
4403
4414
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
4404
|
-
const { width: t, height: n } = await
|
|
4405
|
-
return new
|
|
4415
|
+
const { width: t, height: n } = await Zd(e.file);
|
|
4416
|
+
return new Oo({
|
|
4406
4417
|
key: cr,
|
|
4407
4418
|
value: [t, n]
|
|
4408
4419
|
});
|
|
4409
4420
|
}
|
|
4410
4421
|
}
|
|
4411
|
-
const
|
|
4422
|
+
const Jd = ({ onScrollAfterSendMessage: e }) => {
|
|
4412
4423
|
const { agentPreviewConfigs: t, handlers: n } = Y(), r = B(t == null ? void 0 : t.agentAttributes);
|
|
4413
4424
|
return r.current = t == null ? void 0 : t.agentAttributes, {
|
|
4414
4425
|
onBeforeSendMessage: async (s) => {
|
|
4415
|
-
const i = await
|
|
4426
|
+
const i = await Xd(s), a = {
|
|
4416
4427
|
...s,
|
|
4417
4428
|
metaArrays: i ? [i] : void 0
|
|
4418
|
-
}, l =
|
|
4429
|
+
}, l = Qd(r.current);
|
|
4419
4430
|
return l ? { ...a, data: JSON.stringify(l) } : a;
|
|
4420
4431
|
},
|
|
4421
4432
|
onAfterSendMessage: (s) => {
|
|
@@ -4423,13 +4434,13 @@ const Xd = ({ onScrollAfterSendMessage: e }) => {
|
|
|
4423
4434
|
e(), (i = n == null ? void 0 : n.onMessageSend) == null || i.call(n, s.message), s.sendingStatus === Pe.SUCCEEDED ? (a = n == null ? void 0 : n.onCustomEvent) == null || a.call(n, { type: "message-sent-succeeded", data: { message: s } }) : s.sendingStatus === Pe.PENDING && ((l = n == null ? void 0 : n.onCustomEvent) == null || l.call(n, { type: "message-sent-pending", data: { message: s } }));
|
|
4424
4435
|
}
|
|
4425
4436
|
};
|
|
4426
|
-
},
|
|
4437
|
+
}, Qd = (e) => {
|
|
4427
4438
|
if (!e) return null;
|
|
4428
4439
|
const t = {};
|
|
4429
4440
|
return e.ai && Object.keys(e.ai).length > 0 && (t.ai_attrs = e.ai), e.safeguard && Object.keys(e.safeguard).length > 0 && (t.safeguard_attrs = e.safeguard), typeof e.use_prompt_cache == "boolean" && (t.use_prompt_cache = e.use_prompt_cache), Object.keys(t).length > 0 ? t : null;
|
|
4430
|
-
}, gt = 50,
|
|
4431
|
-
Provider:
|
|
4432
|
-
useContext:
|
|
4441
|
+
}, gt = 50, Lt = gt - 40, {
|
|
4442
|
+
Provider: eu,
|
|
4443
|
+
useContext: tu
|
|
4433
4444
|
} = ee("ConversationScroll"), Yn = {
|
|
4434
4445
|
viewport: 0,
|
|
4435
4446
|
contentHeight: 0,
|
|
@@ -4437,122 +4448,122 @@ const Xd = ({ onScrollAfterSendMessage: e }) => {
|
|
|
4437
4448
|
shouldRecalc: !1,
|
|
4438
4449
|
shouldUpdate: !1
|
|
4439
4450
|
};
|
|
4440
|
-
function
|
|
4441
|
-
const n = B(null), r = B(null), s = B(Yn), i = B(!1), a = B(null), l = B(0), c = B(0), d = B(!1), [g, f] = C(0), [b, v] = C(0), [_, E] = C(!1), [u, p] = C(!1), x =
|
|
4451
|
+
function nu({ scrollMode: e, children: t }) {
|
|
4452
|
+
const n = B(null), r = B(null), s = B(Yn), i = B(!1), a = B(null), l = B(0), c = B(0), d = B(!1), [g, f] = C(0), [b, v] = C(0), [_, E] = C(!1), [u, p] = C(!1), x = ae(
|
|
4442
4453
|
() => _ ? "auto" : e,
|
|
4443
4454
|
[_, e]
|
|
4444
4455
|
), y = () => {
|
|
4445
4456
|
s.current.contentSnapshotHeight = s.current.contentHeight, s.current.shouldUpdate = !0, s.current.shouldRecalc = !0;
|
|
4446
4457
|
}, k = () => {
|
|
4447
|
-
const
|
|
4448
|
-
!
|
|
4458
|
+
const S = n.current;
|
|
4459
|
+
!S || !s.current.shouldUpdate || f(($) => {
|
|
4449
4460
|
s.current.shouldUpdate = !1;
|
|
4450
|
-
const { contentHeight:
|
|
4451
|
-
if (
|
|
4452
|
-
return
|
|
4453
|
-
const pe = S
|
|
4461
|
+
const { contentHeight: U, contentSnapshotHeight: K, shouldRecalc: te } = s.current, ne = S.clientHeight;
|
|
4462
|
+
if (K > U)
|
|
4463
|
+
return $;
|
|
4464
|
+
const pe = T(S, { messageType: "outgoing" });
|
|
4454
4465
|
let ue = 0;
|
|
4455
4466
|
if (pe) {
|
|
4456
|
-
const me = pe.message.offsetTop -
|
|
4457
|
-
ue = Math.max(0, me -
|
|
4467
|
+
const me = pe.message.offsetTop - Lt + ne;
|
|
4468
|
+
ue = Math.max(0, me - U);
|
|
4458
4469
|
} else {
|
|
4459
|
-
const me =
|
|
4470
|
+
const me = U - K, Ye = ne - Lt;
|
|
4460
4471
|
ue = Math.max(0, me - Ye);
|
|
4461
4472
|
}
|
|
4462
|
-
return
|
|
4473
|
+
return $ === 0 || ue !== $ || te ? (s.current.shouldRecalc = !1, ue) : $;
|
|
4463
4474
|
});
|
|
4464
|
-
},
|
|
4465
|
-
(
|
|
4466
|
-
const { messageType:
|
|
4467
|
-
let
|
|
4468
|
-
|
|
4469
|
-
const
|
|
4470
|
-
if (!
|
|
4471
|
-
const pe =
|
|
4475
|
+
}, T = L(
|
|
4476
|
+
(S, $) => {
|
|
4477
|
+
const { messageType: U = "all" } = $ ?? {}, K = Array.from(S.querySelectorAll(`#${ce}-message-item`));
|
|
4478
|
+
let te = K;
|
|
4479
|
+
U === "outgoing" && (te = K.filter((At) => At.getAttribute("data-layout-id") === "outgoingmessage"));
|
|
4480
|
+
const ne = te[te.length - 1];
|
|
4481
|
+
if (!ne) return null;
|
|
4482
|
+
const pe = S.getBoundingClientRect(), ue = ne.getBoundingClientRect(), me = S.scrollTop + (ue.top - pe.top), Ye = me + ne.offsetHeight;
|
|
4472
4483
|
return {
|
|
4473
|
-
message:
|
|
4484
|
+
message: ne,
|
|
4474
4485
|
scrollTop: me,
|
|
4475
4486
|
lastMessageBottom: Ye
|
|
4476
4487
|
};
|
|
4477
4488
|
},
|
|
4478
4489
|
[]
|
|
4479
|
-
),
|
|
4480
|
-
const
|
|
4481
|
-
if (!
|
|
4482
|
-
const
|
|
4483
|
-
s.current.contentHeight = (
|
|
4484
|
-
const
|
|
4485
|
-
v(
|
|
4486
|
-
}, [x,
|
|
4490
|
+
), D = L(() => {
|
|
4491
|
+
const S = n.current;
|
|
4492
|
+
if (!S || x !== "fixed") return;
|
|
4493
|
+
const $ = T(S);
|
|
4494
|
+
s.current.contentHeight = ($ == null ? void 0 : $.lastMessageBottom) ?? S.scrollHeight, !i.current && s.current.contentSnapshotHeight > 0 && y();
|
|
4495
|
+
const U = Math.max(0, S.scrollHeight - S.scrollTop - S.clientHeight);
|
|
4496
|
+
v(U), k();
|
|
4497
|
+
}, [x, T]), M = L(() => {
|
|
4487
4498
|
r.current && (r.current.disconnect(), r.current = null), s.current = Yn, f(0), v(0);
|
|
4488
|
-
}, []),
|
|
4499
|
+
}, []), O = L((S = !0) => {
|
|
4489
4500
|
d.current = !1, Ga(() => {
|
|
4490
|
-
const
|
|
4491
|
-
|
|
4492
|
-
top:
|
|
4493
|
-
behavior:
|
|
4501
|
+
const $ = n.current;
|
|
4502
|
+
$ && $.scrollTo({
|
|
4503
|
+
top: $.scrollHeight,
|
|
4504
|
+
behavior: S ? "smooth" : "auto"
|
|
4494
4505
|
});
|
|
4495
4506
|
});
|
|
4496
4507
|
}, []), N = L(
|
|
4497
|
-
(
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
}), r.current.observe(
|
|
4508
|
+
(S) => {
|
|
4509
|
+
S && (n.current = S, x === "fixed" && (M(), s.current.viewport = S.clientHeight, r.current = new MutationObserver(() => {
|
|
4510
|
+
D();
|
|
4511
|
+
}), r.current.observe(S, {
|
|
4501
4512
|
childList: !0,
|
|
4502
4513
|
subtree: !0
|
|
4503
4514
|
})));
|
|
4504
4515
|
},
|
|
4505
|
-
[x,
|
|
4516
|
+
[x, D, M]
|
|
4506
4517
|
), j = L(() => {
|
|
4507
|
-
const
|
|
4508
|
-
if (!
|
|
4509
|
-
const
|
|
4510
|
-
|
|
4511
|
-
top:
|
|
4518
|
+
const S = n.current;
|
|
4519
|
+
if (!S) return;
|
|
4520
|
+
const $ = T(S, { messageType: "outgoing" });
|
|
4521
|
+
$ && (S.scrollTo({
|
|
4522
|
+
top: $.message.offsetTop - Lt,
|
|
4512
4523
|
behavior: "smooth"
|
|
4513
4524
|
}), a.current && clearTimeout(a.current), a.current = setTimeout(() => {
|
|
4514
4525
|
p(!1);
|
|
4515
4526
|
}, 500));
|
|
4516
|
-
}, [
|
|
4517
|
-
const { scrollHeight:
|
|
4518
|
-
ue && !pe && (d.current = !0), me && pe && (d.current = !1), c.current =
|
|
4527
|
+
}, [T]), q = (S) => {
|
|
4528
|
+
const { scrollHeight: $, scrollTop: U, clientHeight: K } = S.currentTarget, te = Math.max(0, $ - U - K), ne = c.current, pe = te <= gt, ue = U < ne, me = U > ne;
|
|
4529
|
+
ue && !pe && (d.current = !0), me && pe && (d.current = !1), c.current = U, l.current = te, v(te);
|
|
4519
4530
|
}, Se = L(() => {
|
|
4520
4531
|
x === "fixed" && (p(!0), y());
|
|
4521
4532
|
}, [x]), Te = L(() => {
|
|
4522
|
-
x === "fixed" ? setTimeout(() => j(), 300) :
|
|
4523
|
-
}, [x, j]),
|
|
4524
|
-
(
|
|
4525
|
-
i.current =
|
|
4533
|
+
x === "fixed" ? setTimeout(() => j(), 300) : O();
|
|
4534
|
+
}, [x, j]), Le = L(
|
|
4535
|
+
(S) => {
|
|
4536
|
+
i.current = S, x === "fixed" ? y() : d.current || O();
|
|
4526
4537
|
},
|
|
4527
|
-
[x,
|
|
4528
|
-
), Z = L((
|
|
4529
|
-
E(
|
|
4530
|
-
}, []),
|
|
4531
|
-
(
|
|
4532
|
-
x === "auto" &&
|
|
4538
|
+
[x, O]
|
|
4539
|
+
), Z = L((S) => {
|
|
4540
|
+
E(S), S && (f(0), r.current && (r.current.disconnect(), r.current = null));
|
|
4541
|
+
}, []), le = L(
|
|
4542
|
+
(S) => {
|
|
4543
|
+
x === "auto" && S && !d.current && O();
|
|
4533
4544
|
},
|
|
4534
|
-
[x,
|
|
4535
|
-
), A = !(b <= gt) && !u,
|
|
4545
|
+
[x, O]
|
|
4546
|
+
), A = !(b <= gt) && !u, he = L(() => l.current > gt, []);
|
|
4536
4547
|
return /* @__PURE__ */ o.createElement(
|
|
4537
|
-
|
|
4548
|
+
eu,
|
|
4538
4549
|
{
|
|
4539
4550
|
value: {
|
|
4540
4551
|
ref: N,
|
|
4541
4552
|
state: {
|
|
4542
4553
|
bottomSpace: g,
|
|
4543
4554
|
isAwayFromBottom: A,
|
|
4544
|
-
shouldCountNewMessages:
|
|
4555
|
+
shouldCountNewMessages: he
|
|
4545
4556
|
},
|
|
4546
4557
|
props: {
|
|
4547
|
-
onScroll:
|
|
4558
|
+
onScroll: q
|
|
4548
4559
|
},
|
|
4549
4560
|
actions: {
|
|
4550
|
-
scrollToBottom:
|
|
4561
|
+
scrollToBottom: O,
|
|
4551
4562
|
onBeforeMessageSend: Se,
|
|
4552
4563
|
onAfterMessageSend: Te,
|
|
4553
|
-
onStreamingUpdate:
|
|
4564
|
+
onStreamingUpdate: Le,
|
|
4554
4565
|
onConversationClosed: Z,
|
|
4555
|
-
onTypingIndicatorUpdate:
|
|
4566
|
+
onTypingIndicatorUpdate: le
|
|
4556
4567
|
}
|
|
4557
4568
|
}
|
|
4558
4569
|
},
|
|
@@ -4560,25 +4571,25 @@ function tu({ scrollMode: e, children: t }) {
|
|
|
4560
4571
|
);
|
|
4561
4572
|
}
|
|
4562
4573
|
const {
|
|
4563
|
-
Provider:
|
|
4564
|
-
Context:
|
|
4565
|
-
useContext:
|
|
4566
|
-
} = ee("Conversation"),
|
|
4574
|
+
Provider: ru,
|
|
4575
|
+
Context: vh,
|
|
4576
|
+
useContext: oe
|
|
4577
|
+
} = ee("Conversation"), ou = ({ children: e }) => {
|
|
4567
4578
|
var s;
|
|
4568
|
-
const { channelSource: t } =
|
|
4579
|
+
const { channelSource: t } = oe(), n = (s = t.channel) == null ? void 0 : s.url, { checkForUserActionRequired: r } = Yd(n);
|
|
4569
4580
|
return P(() => {
|
|
4570
4581
|
var a;
|
|
4571
4582
|
const i = (a = t.channel) == null ? void 0 : a.lastMessage;
|
|
4572
4583
|
i && r(i);
|
|
4573
4584
|
}, [t.channel, r]), /* @__PURE__ */ o.createElement(o.Fragment, null, e);
|
|
4574
|
-
},
|
|
4585
|
+
}, su = ({
|
|
4575
4586
|
channelUrl: e,
|
|
4576
4587
|
onClearChannelUrl: t,
|
|
4577
4588
|
onNavigateToConversationList: n,
|
|
4578
4589
|
shouldMarkAsRead: r,
|
|
4579
4590
|
children: s
|
|
4580
4591
|
}) => {
|
|
4581
|
-
const { activeChannel: i, refreshActiveChannel: a } =
|
|
4592
|
+
const { activeChannel: i, refreshActiveChannel: a } = re(), l = tu(), { onBeforeSendMessage: c, onAfterSendMessage: d } = Jd({
|
|
4582
4593
|
onScrollAfterSendMessage: () => {
|
|
4583
4594
|
l.actions.onAfterMessageSend();
|
|
4584
4595
|
}
|
|
@@ -4595,7 +4606,7 @@ const {
|
|
|
4595
4606
|
await a(), e && (t == null || t());
|
|
4596
4607
|
}, [a, e, t]);
|
|
4597
4608
|
return /* @__PURE__ */ o.createElement(
|
|
4598
|
-
|
|
4609
|
+
ni,
|
|
4599
4610
|
{
|
|
4600
4611
|
key: g,
|
|
4601
4612
|
channelUrl: g,
|
|
@@ -4609,28 +4620,28 @@ const {
|
|
|
4609
4620
|
shouldCountNewMessages: l.state.shouldCountNewMessages
|
|
4610
4621
|
},
|
|
4611
4622
|
(_) => /* @__PURE__ */ o.createElement(
|
|
4612
|
-
|
|
4623
|
+
ru,
|
|
4613
4624
|
{
|
|
4614
4625
|
value: { ..._, scrollSource: l, goToActiveConversation: v, onNavigateToConversationList: n }
|
|
4615
4626
|
},
|
|
4616
|
-
/* @__PURE__ */ o.createElement(
|
|
4627
|
+
/* @__PURE__ */ o.createElement(ou, null, s)
|
|
4617
4628
|
)
|
|
4618
4629
|
);
|
|
4619
|
-
},
|
|
4630
|
+
}, iu = ({ children: e, ...t }) => {
|
|
4620
4631
|
var s;
|
|
4621
4632
|
const { config: n } = X(), r = ((s = n == null ? void 0 : n.conversation) == null ? void 0 : s.scrollMode) ?? "auto";
|
|
4622
|
-
return /* @__PURE__ */ o.createElement(
|
|
4623
|
-
},
|
|
4624
|
-
const { enableCloseConversationButton: e, dispatcher: t } = Y(), { channelSource: n } =
|
|
4633
|
+
return /* @__PURE__ */ o.createElement(nu, { scrollMode: r }, /* @__PURE__ */ o.createElement(su, { ...t }, e));
|
|
4634
|
+
}, au = () => {
|
|
4635
|
+
const { enableCloseConversationButton: e, dispatcher: t } = Y(), { channelSource: n } = oe(), r = n.channel, s = qe(), i = (r == null ? void 0 : r.isAIAgent) && e, a = !jt(r);
|
|
4625
4636
|
if (!i) return null;
|
|
4626
4637
|
const l = async () => {
|
|
4627
4638
|
r && await t.send(ps.CloseConversation({ channelUrl: r.url }));
|
|
4628
4639
|
};
|
|
4629
|
-
return /* @__PURE__ */ o.createElement(
|
|
4630
|
-
},
|
|
4640
|
+
return /* @__PURE__ */ o.createElement(Oe, { "aria-label": "close conversation", type: "mute", size: s, disabled: a, onClick: l });
|
|
4641
|
+
}, lu = () => {
|
|
4631
4642
|
const { state: e, enableExpandButton: t } = Y(), n = qe();
|
|
4632
4643
|
return t ? /* @__PURE__ */ o.createElement(
|
|
4633
|
-
|
|
4644
|
+
Oe,
|
|
4634
4645
|
{
|
|
4635
4646
|
"aria-label": "expand",
|
|
4636
4647
|
type: e.expanded ? "collapse" : "expand",
|
|
@@ -4638,7 +4649,7 @@ const {
|
|
|
4638
4649
|
onClick: () => e.setExpanded(!e.expanded)
|
|
4639
4650
|
}
|
|
4640
4651
|
) : null;
|
|
4641
|
-
},
|
|
4652
|
+
}, cu = ({ label: e, children: t, position: n = "top", disabled: r }) => r ? t : /* @__PURE__ */ o.createElement(Ht, null, t, /* @__PURE__ */ o.createElement(mu, { $position: n }, /* @__PURE__ */ o.createElement(gu, { variant: "caption1" }, e), /* @__PURE__ */ o.createElement(du, { $position: n }))), du = ({ $position: e }) => /* @__PURE__ */ o.createElement(
|
|
4642
4653
|
"svg",
|
|
4643
4654
|
{
|
|
4644
4655
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -4649,11 +4660,11 @@ const {
|
|
|
4649
4660
|
fill: "none"
|
|
4650
4661
|
},
|
|
4651
4662
|
/* @__PURE__ */ o.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: m.themedColor.textHighEmphasis })
|
|
4652
|
-
),
|
|
4663
|
+
), uu = {
|
|
4653
4664
|
top: I`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
4654
4665
|
bottom: I`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
4655
|
-
}, Ht = h.div`position:relative;`,
|
|
4656
|
-
const { logger: e } = Y(), { stringSet: t } =
|
|
4666
|
+
}, Ht = h.div`position:relative;`, mu = h.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Ne.TOOLTIP};${({ $position: e }) => uu[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Ht}:hover &,${Ht}:focus-within &{opacity:1;}`, gu = h(w)`padding:6px 8px;background:${m.themedColor.textHighEmphasis};color:${m.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, hu = () => {
|
|
4667
|
+
const { logger: e } = Y(), { stringSet: t } = W(), { channelSource: n } = oe(), r = n.channel, s = qe(), i = Xt("handoff-button", r), a = !jt(r) || He(r), l = async () => {
|
|
4657
4668
|
try {
|
|
4658
4669
|
const c = await (r == null ? void 0 : r.markConversationAsHandoff());
|
|
4659
4670
|
e.info("conversation.handleAgentHandoff: success", c);
|
|
@@ -4661,11 +4672,11 @@ const {
|
|
|
4661
4672
|
e.error("conversation.handleAgentHandoff: error", c);
|
|
4662
4673
|
}
|
|
4663
4674
|
};
|
|
4664
|
-
return i ? /* @__PURE__ */ o.createElement(
|
|
4665
|
-
},
|
|
4666
|
-
const { stringSet: e } =
|
|
4675
|
+
return i ? /* @__PURE__ */ o.createElement(cu, { label: t.HEADER_BUTTON__AGENT_HANDOFF, position: "bottom", disabled: a }, /* @__PURE__ */ o.createElement(Oe, { "aria-label": "request handoff", type: "agent", size: s, disabled: a, onClick: l })) : null;
|
|
4676
|
+
}, pu = () => {
|
|
4677
|
+
const { stringSet: e } = W(), { onNavigateToConversationList: t } = oe();
|
|
4667
4678
|
return t ? /* @__PURE__ */ o.createElement(
|
|
4668
|
-
|
|
4679
|
+
Oe,
|
|
4669
4680
|
{
|
|
4670
4681
|
type: "menu",
|
|
4671
4682
|
size: 24,
|
|
@@ -4674,13 +4685,13 @@ const {
|
|
|
4674
4685
|
}
|
|
4675
4686
|
) : null;
|
|
4676
4687
|
}, Ur = ({ channel: e, size: t = 40 }) => {
|
|
4677
|
-
const { userSession: n, aiAgentInfo: r } =
|
|
4678
|
-
return i ? /* @__PURE__ */ o.createElement(Qt, { src: i, size: t }) : /* @__PURE__ */ o.createElement(
|
|
4679
|
-
},
|
|
4688
|
+
const { userSession: n, aiAgentInfo: r } = re(), { fallbackIcon: s, url: i } = Cr({ channel: e, aiAgentInfo: r, userSession: n }), a = Je();
|
|
4689
|
+
return i ? /* @__PURE__ */ o.createElement(Qt, { src: i, size: t }) : /* @__PURE__ */ o.createElement(fu, { $size: t, $bgColor: a.colors.base.primary }, /* @__PURE__ */ o.createElement(H, { type: s, size: t * 0.55, color: a.colors.base.primaryContrastContent }));
|
|
4690
|
+
}, fu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;border-radius:50%;background-color:${({ $bgColor: e }) => e};display:flex;align-items:center;justify-content:center;flex-shrink:0;`, bu = () => {
|
|
4680
4691
|
var l, c;
|
|
4681
|
-
const { channelSource: e } =
|
|
4682
|
-
return /* @__PURE__ */ o.createElement(
|
|
4683
|
-
},
|
|
4692
|
+
const { channelSource: e } = oe(), { aiAgentInfo: t, userSession: n } = re(), { config: r } = X(), s = e.channel, i = Cr({ channel: s, userSession: n, aiAgentInfo: t }), a = (c = (l = r == null ? void 0 : r.conversation) == null ? void 0 : l.header) == null ? void 0 : c.avatarEnabled;
|
|
4693
|
+
return /* @__PURE__ */ o.createElement(Eu, null, a && /* @__PURE__ */ o.createElement(Ur, { channel: s, size: 34 }), /* @__PURE__ */ o.createElement(xu, { variant: "h2", color: m.themedColor.textHighEmphasis }, i.title));
|
|
4694
|
+
}, Eu = h.div`display:flex;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, xu = h(w)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, vu = (e) => {
|
|
4684
4695
|
const { components: t } = Ke.useContext();
|
|
4685
4696
|
return /* @__PURE__ */ o.createElement(
|
|
4686
4697
|
an,
|
|
@@ -4691,32 +4702,32 @@ const {
|
|
|
4691
4702
|
end: /* @__PURE__ */ o.createElement(t.EndArea, null)
|
|
4692
4703
|
}
|
|
4693
4704
|
);
|
|
4694
|
-
},
|
|
4705
|
+
}, _u = () => {
|
|
4695
4706
|
const { components: e } = Ke.useContext();
|
|
4696
4707
|
return /* @__PURE__ */ o.createElement(e.MenuButton, null);
|
|
4697
|
-
},
|
|
4708
|
+
}, yu = () => {
|
|
4698
4709
|
const { components: e } = Ke.useContext();
|
|
4699
4710
|
return /* @__PURE__ */ o.createElement(e.Title, null);
|
|
4700
|
-
},
|
|
4711
|
+
}, Cu = () => {
|
|
4701
4712
|
const { components: e } = Ke.useContext();
|
|
4702
|
-
return /* @__PURE__ */ o.createElement(
|
|
4713
|
+
return /* @__PURE__ */ o.createElement(Tu, null, /* @__PURE__ */ o.createElement(e.HandoffButton, null), /* @__PURE__ */ o.createElement(e.ConversationCloseButton, null), /* @__PURE__ */ o.createElement(e.ExpandButton, null), /* @__PURE__ */ o.createElement(e.CloseButton, null));
|
|
4703
4714
|
}, Ke = ye({
|
|
4704
|
-
template:
|
|
4715
|
+
template: vu,
|
|
4705
4716
|
components: {
|
|
4706
|
-
StartArea:
|
|
4707
|
-
TitleArea:
|
|
4708
|
-
EndArea:
|
|
4709
|
-
MenuButton:
|
|
4710
|
-
Title:
|
|
4711
|
-
HandoffButton:
|
|
4712
|
-
ConversationCloseButton:
|
|
4713
|
-
ExpandButton:
|
|
4714
|
-
CloseButton:
|
|
4717
|
+
StartArea: _u,
|
|
4718
|
+
TitleArea: yu,
|
|
4719
|
+
EndArea: Cu,
|
|
4720
|
+
MenuButton: pu,
|
|
4721
|
+
Title: bu,
|
|
4722
|
+
HandoffButton: hu,
|
|
4723
|
+
ConversationCloseButton: au,
|
|
4724
|
+
ExpandButton: lu,
|
|
4725
|
+
CloseButton: Wd
|
|
4715
4726
|
}
|
|
4716
|
-
}),
|
|
4727
|
+
}), Su = () => {
|
|
4717
4728
|
const { isActionbookTester: e } = je(), { Template: t } = Ke.useContext();
|
|
4718
4729
|
return e ? null : /* @__PURE__ */ o.createElement(t, { titleAlign: "start" });
|
|
4719
|
-
},
|
|
4730
|
+
}, Tu = h.div`display:flex;gap:10px;align-items:center;justify-content:center;`, cn = We({
|
|
4720
4731
|
onDrop: _e,
|
|
4721
4732
|
subscribe: () => _e
|
|
4722
4733
|
}), Vt = ({ children: e }) => {
|
|
@@ -4737,7 +4748,7 @@ const {
|
|
|
4737
4748
|
},
|
|
4738
4749
|
e
|
|
4739
4750
|
);
|
|
4740
|
-
},
|
|
4751
|
+
}, Au = ({ onDropFiles: e }) => {
|
|
4741
4752
|
const { subscribe: t } = xe(cn);
|
|
4742
4753
|
P(() => t(e), [e]);
|
|
4743
4754
|
};
|
|
@@ -4745,40 +4756,40 @@ Vt.Consumer = ({ children: e }) => {
|
|
|
4745
4756
|
const { onDrop: t } = xe(cn);
|
|
4746
4757
|
return e({ onDrop: t, onDragOver: (s) => s.preventDefault() });
|
|
4747
4758
|
};
|
|
4748
|
-
const dn = ({ iconSize: e = 64, icon: t, className: n, label: r, children: s }) => /* @__PURE__ */ o.createElement(
|
|
4759
|
+
const dn = ({ iconSize: e = 64, icon: t, className: n, label: r, children: s }) => /* @__PURE__ */ o.createElement(Iu, { className: n }, t && /* @__PURE__ */ o.createElement(H, { type: t, size: e, color: m.themedColor.textLowEmphasis }), r && /* @__PURE__ */ o.createElement(w, { variant: "body1", color: m.themedColor.textMidEmphasis }, r), s), wu = h.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Iu = h.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, ku = ({
|
|
4749
4760
|
label: e = "Something went wrong",
|
|
4750
4761
|
icon: t = "error",
|
|
4751
4762
|
action: n,
|
|
4752
4763
|
...r
|
|
4753
|
-
}) => /* @__PURE__ */ o.createElement(dn, { icon: t, label: e, ...r }, n && /* @__PURE__ */ o.createElement(
|
|
4764
|
+
}) => /* @__PURE__ */ o.createElement(dn, { icon: t, label: e, ...r }, n && /* @__PURE__ */ o.createElement($u, { onClick: n.onClick, label: n.label ?? "Retry" })), $u = ({ label: e, onClick: t }) => /* @__PURE__ */ o.createElement(Mu, { tabIndex: 0, onClick: t }, /* @__PURE__ */ o.createElement(H, { type: "refresh", size: 20 }), /* @__PURE__ */ o.createElement(w, { variant: "button", color: m.color.primary.main }, e)), Mu = h.button`all:unset;display:flex;cursor:pointer;gap:4px;align-items:center;justify-content:center;`, Ou = ({ iconSize: e = 48, className: t }) => /* @__PURE__ */ o.createElement(rn, { size: e, className: t }), Lu = ({ label: e = "No channels", icon: t = "chat", ...n }) => /* @__PURE__ */ o.createElement(dn, { icon: t, label: e, ...n }), Du = ({
|
|
4754
4765
|
label: e = "No messages",
|
|
4755
4766
|
icon: t = "message",
|
|
4756
4767
|
...n
|
|
4757
|
-
}) => /* @__PURE__ */ o.createElement(dn, { icon: t, label: e, ...n }),
|
|
4768
|
+
}) => /* @__PURE__ */ o.createElement(dn, { icon: t, label: e, ...n }), Ru = (e) => {
|
|
4758
4769
|
const { components: t } = un.useContext(), n = e.type === "loading" ? /* @__PURE__ */ o.createElement(t.Loading, { ...e }) : e.type === "error" ? /* @__PURE__ */ o.createElement(t.Error, { ...e }) : e.type === "noChannels" ? /* @__PURE__ */ o.createElement(t.NoChannels, { ...e }) : e.type === "noMessages" ? /* @__PURE__ */ o.createElement(t.NoMessages, { ...e }) : null;
|
|
4759
|
-
return n && /* @__PURE__ */ o.createElement(
|
|
4770
|
+
return n && /* @__PURE__ */ o.createElement(wu, null, n);
|
|
4760
4771
|
}, un = ye({
|
|
4761
|
-
template:
|
|
4772
|
+
template: Ru,
|
|
4762
4773
|
components: {
|
|
4763
|
-
Loading:
|
|
4764
|
-
Error:
|
|
4774
|
+
Loading: Ou,
|
|
4775
|
+
Error: ku,
|
|
4765
4776
|
NoChannels: Lu,
|
|
4766
|
-
NoMessages:
|
|
4777
|
+
NoMessages: Du
|
|
4767
4778
|
}
|
|
4768
4779
|
}), ze = (e) => {
|
|
4769
4780
|
const { Template: t } = un.useContext();
|
|
4770
4781
|
return /* @__PURE__ */ o.createElement(t, { ...e });
|
|
4771
4782
|
}, Zn = (e) => dr(e) || ur(e);
|
|
4772
|
-
function
|
|
4783
|
+
function Nu(e) {
|
|
4773
4784
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
4774
4785
|
}
|
|
4775
|
-
function
|
|
4786
|
+
function Bu(e, t) {
|
|
4776
4787
|
return e.filter((n) => Ie.isWelcomeMessage(n, t));
|
|
4777
4788
|
}
|
|
4778
|
-
const
|
|
4779
|
-
const { type: r, url: s, name: i = "" } = e, { profileUrl: a, userId: l } = t, { aiAgentInfo: c } =
|
|
4789
|
+
const Fu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:${({ theme: e }) => e.colors.base.primary}!important;ellipse,path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent}!important;}`, Pu = h.div`position:fixed;inset:0;outline:none;display:flex;flex-direction:column;`, Uu = h.div`display:flex;gap:10px;align-items:center;`, Hu = h.div`flex:1;min-height:0;display:flex;align-items:center;justify-content:center;`, Vu = h.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, zu = h.img`max-width:100%;max-height:100%;padding:40px;box-sizing:border-box;object-fit:contain;user-select:none;-webkit-user-drag:none;`, Wu = h.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, Gu = ({ file: e, sender: t = {}, onClose: n }) => {
|
|
4790
|
+
const { type: r, url: s, name: i = "" } = e, { profileUrl: a, userId: l } = t, { aiAgentInfo: c } = re();
|
|
4780
4791
|
return /* @__PURE__ */ o.createElement(
|
|
4781
|
-
|
|
4792
|
+
ju,
|
|
4782
4793
|
{
|
|
4783
4794
|
profileUrl: a ?? "",
|
|
4784
4795
|
type: r,
|
|
@@ -4788,16 +4799,16 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4788
4799
|
isBotMessage: l === c.userId
|
|
4789
4800
|
}
|
|
4790
4801
|
);
|
|
4791
|
-
},
|
|
4802
|
+
}, ju = ({ profileUrl: e, isBotMessage: t, name: n, type: r, url: s, onClose: i }) => {
|
|
4792
4803
|
var d, g;
|
|
4793
|
-
const { stringSet: a } =
|
|
4794
|
-
return /* @__PURE__ */ o.createElement(Tt, { onClose: i, visible: !0, rootElementId: de.MODAL_ROOT }, /* @__PURE__ */ o.createElement(
|
|
4804
|
+
const { stringSet: a } = W(), l = qe(), { config: c } = Y();
|
|
4805
|
+
return /* @__PURE__ */ o.createElement(Tt, { onClose: i, visible: !0, rootElementId: de.MODAL_ROOT }, /* @__PURE__ */ o.createElement(Pu, null, /* @__PURE__ */ o.createElement(
|
|
4795
4806
|
an,
|
|
4796
4807
|
{
|
|
4797
|
-
start: /* @__PURE__ */ o.createElement(
|
|
4808
|
+
start: /* @__PURE__ */ o.createElement(qu, { profileUrl: e, isBotMessage: t }),
|
|
4798
4809
|
title: /* @__PURE__ */ o.createElement(w, { variant: "h2", color: m.themedColor.textHighEmphasis, maxTextLines: 1 }, n),
|
|
4799
|
-
end: /* @__PURE__ */ o.createElement(
|
|
4800
|
-
|
|
4810
|
+
end: /* @__PURE__ */ o.createElement(Uu, null, Zn(r) && ((g = (d = c == null ? void 0 : c.conversation) == null ? void 0 : d.fileViewer) == null ? void 0 : g.downloadEnabled) && /* @__PURE__ */ o.createElement(
|
|
4811
|
+
Oe,
|
|
4801
4812
|
{
|
|
4802
4813
|
as: "a",
|
|
4803
4814
|
href: s,
|
|
@@ -4806,16 +4817,16 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4806
4817
|
type: "download",
|
|
4807
4818
|
size: l
|
|
4808
4819
|
}
|
|
4809
|
-
), /* @__PURE__ */ o.createElement(
|
|
4820
|
+
), /* @__PURE__ */ o.createElement(Oe, { "aria-label": "close file viewer", type: "close", size: l, onClick: i }))
|
|
4810
4821
|
}
|
|
4811
|
-
), /* @__PURE__ */ o.createElement(
|
|
4812
|
-
},
|
|
4822
|
+
), /* @__PURE__ */ o.createElement(Hu, { onClick: (f) => f.currentTarget === f.target && i() }, ur(r) && /* @__PURE__ */ o.createElement(Vu, { controls: !0 }, /* @__PURE__ */ o.createElement("source", { src: s, type: r })), dr(r) && /* @__PURE__ */ o.createElement(zu, { src: s, alt: n }), !Zn(r) && /* @__PURE__ */ o.createElement(Wu, null, /* @__PURE__ */ o.createElement(w, { variant: "h1", color: m.themedColor.textHighEmphasis }, a.FILE_VIEWER__UNSUPPORT)))));
|
|
4823
|
+
}, qu = ({ profileUrl: e, isBotMessage: t }) => t && !e ? /* @__PURE__ */ o.createElement(Fu, { $size: 32 }, /* @__PURE__ */ o.createElement(H, { type: "delight", size: 20 })) : /* @__PURE__ */ o.createElement(Qt, { size: 32, src: e }), Hr = ({
|
|
4813
4824
|
className: e,
|
|
4814
4825
|
locale: t,
|
|
4815
4826
|
date: n = Date.now(),
|
|
4816
4827
|
formatString: r = "MMMM dd, yyyy",
|
|
4817
4828
|
style: s
|
|
4818
|
-
}) => /* @__PURE__ */ o.createElement(
|
|
4829
|
+
}) => /* @__PURE__ */ o.createElement(Ku, { id: `${ce}-date-separator`, style: s, className: e }, /* @__PURE__ */ o.createElement(w, { variant: "caption4", color: m.themedColor.textMidEmphasis }, ir(n, r, { locale: t }))), Ku = h.div`display:flex;justify-content:center;align-items:center;text-align:center;word-break:break-word;`, Yu = Ge(function(t, n) {
|
|
4819
4830
|
const {
|
|
4820
4831
|
messages: r,
|
|
4821
4832
|
renderMessage: s,
|
|
@@ -4831,42 +4842,42 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4831
4842
|
bottomSpacerHeight: _ = 0,
|
|
4832
4843
|
ariaLabel: E
|
|
4833
4844
|
} = t, u = B(null), p = L(
|
|
4834
|
-
(
|
|
4835
|
-
u.current =
|
|
4845
|
+
(M) => {
|
|
4846
|
+
u.current = M, n && (typeof n == "function" ? n(M) : n.current = M);
|
|
4836
4847
|
},
|
|
4837
4848
|
[n]
|
|
4838
|
-
), x = B(!1), y = B(void 0), k = B(0),
|
|
4839
|
-
|
|
4849
|
+
), x = B(!1), y = B(void 0), k = B(0), T = B(0);
|
|
4850
|
+
se(() => {
|
|
4840
4851
|
u.current && (u.current.scrollTop = u.current.scrollHeight);
|
|
4841
|
-
}, b),
|
|
4842
|
-
u.current && (y.current === "top" && (u.current.scrollTop = u.current.scrollHeight -
|
|
4852
|
+
}, b), se(() => {
|
|
4853
|
+
u.current && (y.current === "top" && (u.current.scrollTop = u.current.scrollHeight - T.current), y.current === "bottom" && (u.current.scrollTop = k.current), y.current = void 0);
|
|
4843
4854
|
}, [u.current, r.length]);
|
|
4844
|
-
const
|
|
4845
|
-
if (f == null || f(
|
|
4846
|
-
const
|
|
4847
|
-
if (
|
|
4848
|
-
const N =
|
|
4849
|
-
|
|
4855
|
+
const D = async (M) => {
|
|
4856
|
+
if (f == null || f(M), !u.current) return;
|
|
4857
|
+
const O = u.current;
|
|
4858
|
+
if (T.current = O.scrollHeight - O.scrollTop, k.current = O.scrollTop, x.current) return;
|
|
4859
|
+
const N = O.clientHeight * Math.min(Math.max(0, g), 1);
|
|
4860
|
+
O.scrollTop <= N ? (x.current = !0, y.current = "top", await c(), x.current = !1) : O.scrollHeight - O.scrollTop - O.clientHeight <= N ? (x.current = !0, y.current = "bottom", await d(), x.current = !1) : y.current = void 0;
|
|
4850
4861
|
};
|
|
4851
|
-
return /* @__PURE__ */ o.createElement(
|
|
4852
|
-
|
|
4862
|
+
return /* @__PURE__ */ o.createElement(Zu, { id: "infinite-list-container" }, /* @__PURE__ */ o.createElement(
|
|
4863
|
+
Xu,
|
|
4853
4864
|
{
|
|
4854
4865
|
id: "infinite-list-inner",
|
|
4855
4866
|
ref: p,
|
|
4856
|
-
onScroll:
|
|
4867
|
+
onScroll: D,
|
|
4857
4868
|
role: "list",
|
|
4858
4869
|
"aria-label": E
|
|
4859
4870
|
},
|
|
4860
4871
|
v === "bottom" && /* @__PURE__ */ o.createElement("div", { style: { flexGrow: 1 } }),
|
|
4861
4872
|
i,
|
|
4862
|
-
r.map((
|
|
4873
|
+
r.map((M, O) => s({ message: M, index: O })),
|
|
4863
4874
|
a,
|
|
4864
4875
|
_ > 0 && /* @__PURE__ */ o.createElement("div", { style: { minHeight: _ } })
|
|
4865
|
-
), /* @__PURE__ */ o.createElement(
|
|
4866
|
-
}),
|
|
4876
|
+
), /* @__PURE__ */ o.createElement(Ju, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ o.createElement(Qu, { id: "infinite-list-overlay" }, l)));
|
|
4877
|
+
}), Zu = h.div`display:flex;position:relative;flex:1;overflow:hidden;`, Xu = h.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:${m.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Ju = h.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, Qu = h.div`pointer-events:auto;`, em = ({ className: e, label: t, ariaLabel: n, onClick: r }) => {
|
|
4867
4878
|
const { colors: s } = Je();
|
|
4868
|
-
return /* @__PURE__ */ o.createElement(
|
|
4869
|
-
},
|
|
4879
|
+
return /* @__PURE__ */ o.createElement(tm, { className: e, onClick: r, "aria-label": n }, /* @__PURE__ */ o.createElement(w, { variant: "button", color: s.base.primaryContrastContent }, t), /* @__PURE__ */ o.createElement(H, { size: 16, type: "chevron-down", color: s.base.primaryContrastContent }));
|
|
4880
|
+
}, tm = h.button`all:unset;cursor:pointer;display:flex;align-items:center;gap:4px;padding:10px 12px 10px 16px;border-radius:24px;background-color:${({ theme: e }) => e.colors.base.primary};box-shadow:0 8px 10px 1px rgba(13,13,13,0.12),0 3px 14px 2px rgba(13,13,13,0.08),0 3px 5px -3px rgba(13,13,13,0.04);&:focus{outline:none;}`, nm = ({ className: e, onClick: t, ariaLabel: n }) => /* @__PURE__ */ o.createElement(rm, { className: e, onClick: t, tabIndex: 0, "aria-label": n }, /* @__PURE__ */ o.createElement(H, { size: 24, type: "chevron-down", color: m.color.primary.main })), rm = h.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);${F.light`
|
|
4870
4881
|
background-color: ${m.color.background50};
|
|
4871
4882
|
&:hover {
|
|
4872
4883
|
background-color: ${m.color.background100};
|
|
@@ -4888,13 +4899,13 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4888
4899
|
&:focus {
|
|
4889
4900
|
outline: none;
|
|
4890
4901
|
}
|
|
4891
|
-
`,
|
|
4892
|
-
const { agentPreviewConfigs: e = {}, aiAgentId: t } = Y(), { aiAgentInfo: n } =
|
|
4902
|
+
`, om = () => {
|
|
4903
|
+
const { agentPreviewConfigs: e = {}, aiAgentId: t } = Y(), { aiAgentInfo: n } = re(), { stringSet: r, dateLocale: s } = W(), { messageSource: i } = oe(), { Template: a } = Ve.useContext(), l = e.welcomeMessages ?? [], c = i.messages, d = Bu(c, t), g = c[d.length + 1], f = d[0] ?? g;
|
|
4893
4904
|
return {
|
|
4894
4905
|
/**
|
|
4895
4906
|
* Returns a list of messages filtered according to business requirements.
|
|
4896
4907
|
*/
|
|
4897
|
-
filteredMessages: c.filter((b) =>
|
|
4908
|
+
filteredMessages: c.filter((b) => Nu(b) ? !1 : l.length > 0 ? !Ie.isWelcomeMessage(b, t) : !0),
|
|
4898
4909
|
/**
|
|
4899
4910
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
4900
4911
|
*/
|
|
@@ -4931,10 +4942,10 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4931
4942
|
);
|
|
4932
4943
|
}))
|
|
4933
4944
|
};
|
|
4934
|
-
},
|
|
4935
|
-
const { stringSet: t } =
|
|
4936
|
-
return !Xt("powered-by") || n ? null : /* @__PURE__ */ o.createElement(
|
|
4937
|
-
|
|
4945
|
+
}, sm = (e) => h(e).withConfig({ shouldForwardProp: Go }), im = ({ style: e }) => {
|
|
4946
|
+
const { stringSet: t } = W(), { isActionbookTester: n } = je();
|
|
4947
|
+
return !Xt("powered-by") || n ? null : /* @__PURE__ */ o.createElement(am, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ o.createElement(
|
|
4948
|
+
lm,
|
|
4938
4949
|
{
|
|
4939
4950
|
variant: "caption2",
|
|
4940
4951
|
as: "a",
|
|
@@ -4945,13 +4956,13 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4945
4956
|
},
|
|
4946
4957
|
"Sendbird"
|
|
4947
4958
|
));
|
|
4948
|
-
},
|
|
4959
|
+
}, am = h(w)`color:${m.themedColor.textLowEmphasis};text-align:center;`, lm = sm(w)`
|
|
4949
4960
|
color: ${m.themedColor.textLowEmphasis};
|
|
4950
4961
|
cursor: pointer;
|
|
4951
4962
|
text-decoration: none;
|
|
4952
|
-
`,
|
|
4963
|
+
`, cm = () => {
|
|
4953
4964
|
var a;
|
|
4954
|
-
const { stringSet: e } =
|
|
4965
|
+
const { stringSet: e } = W(), { channelSource: t, goToActiveConversation: n, scrollSource: r } = oe(), s = ke(t.channel), i = B(s);
|
|
4955
4966
|
return P(() => {
|
|
4956
4967
|
if (!i.current && s) {
|
|
4957
4968
|
const d = setTimeout(() => {
|
|
@@ -4960,8 +4971,8 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4960
4971
|
return () => clearTimeout(d);
|
|
4961
4972
|
}
|
|
4962
4973
|
i.current = s;
|
|
4963
|
-
}, [s, r.actions.scrollToBottom]), !((a = t.channel) != null && a.isAIAgent) || !s ? null : /* @__PURE__ */ o.createElement(
|
|
4964
|
-
|
|
4974
|
+
}, [s, r.actions.scrollToBottom]), !((a = t.channel) != null && a.isAIAgent) || !s ? null : /* @__PURE__ */ o.createElement(dm, null, /* @__PURE__ */ o.createElement(
|
|
4975
|
+
um,
|
|
4965
4976
|
{
|
|
4966
4977
|
variant: "button",
|
|
4967
4978
|
role: "button",
|
|
@@ -4970,32 +4981,32 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
4970
4981
|
},
|
|
4971
4982
|
e.TALK_TO_AGENT
|
|
4972
4983
|
));
|
|
4973
|
-
},
|
|
4974
|
-
const { Template: e } = on.useContext(), { Template: t } = Ve.useContext(), { Template: n } = sn.useContext(), [r, s] = C(null), [i, a] = C(null), { userSession: l, aiAgentInfo: c } =
|
|
4984
|
+
}, dm = h.div`display:flex;justify-content:center;margin-bottom:16px;`, um = h(w)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${m.themedColor.textDisabled};cursor:pointer;user-select:none;`, mm = () => {
|
|
4985
|
+
const { Template: e } = on.useContext(), { Template: t } = Ve.useContext(), { Template: n } = sn.useContext(), [r, s] = C(null), [i, a] = C(null), { userSession: l, aiAgentInfo: c } = re(), { cache: d, agentPreviewConfigs: g, chatSDK: f, state: b } = Y(), { config: v } = X(), { stringSet: _, dateLocale: E } = W(), {
|
|
4975
4986
|
conversation: u,
|
|
4976
4987
|
channelSource: p,
|
|
4977
4988
|
messageSource: x,
|
|
4978
4989
|
scrollSource: y,
|
|
4979
|
-
state: { input: k, streamAnimation:
|
|
4980
|
-
} =
|
|
4990
|
+
state: { input: k, streamAnimation: T }
|
|
4991
|
+
} = oe(), { isActionbookTester: D } = je(), { filteredMessages: M, shouldShowOriginalDate: O, renderAgentPreviewWelcomeMessages: N } = om(), j = vr(p.channel), q = (() => {
|
|
4981
4992
|
const Z = j[0];
|
|
4982
4993
|
if (!Z) return null;
|
|
4983
|
-
const
|
|
4984
|
-
return { user:
|
|
4994
|
+
const le = Z.userId === c.userId;
|
|
4995
|
+
return { user: le ? c : Z, isBot: le };
|
|
4985
4996
|
})();
|
|
4986
4997
|
P(() => {
|
|
4987
|
-
y.actions.onTypingIndicatorUpdate(!!
|
|
4988
|
-
}, [!!
|
|
4998
|
+
y.actions.onTypingIndicatorUpdate(!!q);
|
|
4999
|
+
}, [!!q, y.actions.onTypingIndicatorUpdate]), P(() => {
|
|
4989
5000
|
y.state.isAwayFromBottom || x.resetNewMessages();
|
|
4990
5001
|
}, [y.state.isAwayFromBottom]);
|
|
4991
|
-
const Se = (Z,
|
|
5002
|
+
const Se = (Z, le = !1) => {
|
|
4992
5003
|
var Ae;
|
|
4993
|
-
return
|
|
5004
|
+
return le ? c : ((Ae = p.channel) == null ? void 0 : Ae.members.find((A) => A.userId === Z.sender.userId)) ?? Z.sender;
|
|
4994
5005
|
}, Te = (Z) => {
|
|
4995
5006
|
if (Z.sendingStatus === "failed" && !k.disabled)
|
|
4996
5007
|
return () => a(Z);
|
|
4997
|
-
},
|
|
4998
|
-
var Z,
|
|
5008
|
+
}, Le = () => {
|
|
5009
|
+
var Z, le, Ae;
|
|
4999
5010
|
if (!x.initialized)
|
|
5000
5011
|
return /* @__PURE__ */ o.createElement(ze, { type: "loading" });
|
|
5001
5012
|
if (x.messages.length === 0) {
|
|
@@ -5003,46 +5014,46 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5003
5014
|
return A ? /* @__PURE__ */ o.createElement("div", { style: { width: "100%" } }, A) : /* @__PURE__ */ o.createElement(ze, { type: "noMessages", label: _.PLACE_HOLDER__NO_MESSAGES });
|
|
5004
5015
|
}
|
|
5005
5016
|
return /* @__PURE__ */ o.createElement(
|
|
5006
|
-
|
|
5017
|
+
Yu,
|
|
5007
5018
|
{
|
|
5008
5019
|
ref: y.ref,
|
|
5009
5020
|
onScroll: y.props.onScroll,
|
|
5010
5021
|
stackDirection: g == null ? void 0 : g.messageStackDirection,
|
|
5011
|
-
messages:
|
|
5022
|
+
messages: M,
|
|
5012
5023
|
onLoadPrev: x.loadPrevious,
|
|
5013
5024
|
onLoadNext: x.loadNext,
|
|
5014
5025
|
depsForResetScrollPositionToBottom: [x.initialized, x.messages.length !== 0],
|
|
5015
5026
|
bottomSpacerHeight: y.state.bottomSpace,
|
|
5016
5027
|
ariaLabel: _.A11Y_MESSAGE_LIST,
|
|
5017
|
-
messageTopArea: /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
5018
|
-
messageBottomArea: /* @__PURE__ */ o.createElement(o.Fragment, null,
|
|
5028
|
+
messageTopArea: /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(im, { style: { marginTop: 16 } }), N()),
|
|
5029
|
+
messageBottomArea: /* @__PURE__ */ o.createElement(o.Fragment, null, q && /* @__PURE__ */ o.createElement("div", { id: `${ce}-message-item`, role: "listitem" }, /* @__PURE__ */ o.createElement(
|
|
5019
5030
|
t,
|
|
5020
5031
|
{
|
|
5021
5032
|
isTyping: !0,
|
|
5022
|
-
isBotMessage:
|
|
5023
|
-
sender:
|
|
5033
|
+
isBotMessage: q.isBot,
|
|
5034
|
+
sender: q.user,
|
|
5024
5035
|
messageType: "user",
|
|
5025
5036
|
groupType: "single",
|
|
5026
5037
|
message: "",
|
|
5027
5038
|
isSenderAvatarVisible: (Z = v == null ? void 0 : v.conversation) == null ? void 0 : Z.senderAvatarEnabled
|
|
5028
5039
|
}
|
|
5029
|
-
)), ((
|
|
5040
|
+
)), ((le = v == null ? void 0 : v.conversation) == null ? void 0 : le.isTalkToAgentViewEnabled) && /* @__PURE__ */ o.createElement(cm, null)),
|
|
5030
5041
|
overlayArea: /* @__PURE__ */ o.createElement(o.Fragment, null, ((Ae = v == null ? void 0 : v.conversation) == null ? void 0 : Ae.newMessageIndicatorEnabled) && y.state.isAwayFromBottom && x.newMessages.length > 0 && /* @__PURE__ */ o.createElement(
|
|
5031
|
-
|
|
5042
|
+
pm,
|
|
5032
5043
|
{
|
|
5033
5044
|
label: _.SCROLL_TO_NEW_MESSAGES_LABEL(x.newMessages),
|
|
5034
5045
|
ariaLabel: _.A11Y_SCROLL_TO_NEW_MESSAGES,
|
|
5035
5046
|
onClick: () => y.actions.scrollToBottom()
|
|
5036
5047
|
}
|
|
5037
|
-
), y.state.isAwayFromBottom && x.newMessages.length === 0 && !
|
|
5038
|
-
|
|
5048
|
+
), y.state.isAwayFromBottom && x.newMessages.length === 0 && !q && /* @__PURE__ */ o.createElement(
|
|
5049
|
+
hm,
|
|
5039
5050
|
{
|
|
5040
5051
|
ariaLabel: _.A11Y_SCROLL_TO_BOTTOM,
|
|
5041
5052
|
onClick: () => y.actions.scrollToBottom()
|
|
5042
5053
|
}
|
|
5043
5054
|
)),
|
|
5044
|
-
renderMessage: ({ message: A, index:
|
|
5045
|
-
const
|
|
5055
|
+
renderMessage: ({ message: A, index: he }) => {
|
|
5056
|
+
const S = Qo(A), $ = M[he - 1], U = M[he + 1], K = M[M.length - 1], te = A === K, ne = Qe(A, c.userId), pe = !(c.isUserFeedbackEnabled && ne && !Ie.isWelcomeMessage(A)), ue = es(A, $, U, pe), me = !Wo(($ == null ? void 0 : $.createdAt) ?? 0, A.createdAt) && O(he) && !D, Ye = (st) => {
|
|
5046
5057
|
(A.isFileMessage() || A.isUserMessage()) && s({ file: st, sender: Se(A, A.sender.userId === c.userId) });
|
|
5047
5058
|
}, At = () => {
|
|
5048
5059
|
A.isFileMessage() && en(A.url);
|
|
@@ -5078,8 +5089,8 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5078
5089
|
isResolvedWhenDeterminedByUser: qo(u),
|
|
5079
5090
|
messageType: "admin.csat",
|
|
5080
5091
|
onSubmitCSAT: async (De) => {
|
|
5081
|
-
var
|
|
5082
|
-
await ((
|
|
5092
|
+
var G;
|
|
5093
|
+
await ((G = p.channel) == null ? void 0 : G.submitCSAT(De));
|
|
5083
5094
|
}
|
|
5084
5095
|
}
|
|
5085
5096
|
) : null : /* @__PURE__ */ o.createElement(n, { ...ot, messageType: "admin", message: A.message });
|
|
@@ -5094,14 +5105,14 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5094
5105
|
if (A.isUserMessage())
|
|
5095
5106
|
return /* @__PURE__ */ o.createElement(e, { messageType: "user", ...De });
|
|
5096
5107
|
if (A.isFileMessage()) {
|
|
5097
|
-
const [
|
|
5108
|
+
const [G, ie] = ((st = A.metaArrays.find((fe) => fe.key === cr)) == null ? void 0 : st.value) ?? [];
|
|
5098
5109
|
return /* @__PURE__ */ o.createElement(
|
|
5099
5110
|
e,
|
|
5100
5111
|
{
|
|
5101
5112
|
messageType: "file",
|
|
5102
5113
|
file: A,
|
|
5103
5114
|
metadata: {
|
|
5104
|
-
aspectRatio:
|
|
5115
|
+
aspectRatio: G && ie ? `${G}/${ie}` : "1/1",
|
|
5105
5116
|
localFile: (bn = A.messageParams) == null ? void 0 : bn.file
|
|
5106
5117
|
},
|
|
5107
5118
|
...De
|
|
@@ -5112,60 +5123,60 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5112
5123
|
if (Be.isIncoming(A, l.userId)) {
|
|
5113
5124
|
const De = {
|
|
5114
5125
|
...ot,
|
|
5115
|
-
sender: Se(A,
|
|
5126
|
+
sender: Se(A, ne),
|
|
5116
5127
|
message: A.message,
|
|
5117
|
-
suggestedRepliesVisible:
|
|
5128
|
+
suggestedRepliesVisible: te,
|
|
5118
5129
|
suggestedRepliesDirection: g == null ? void 0 : g.suggestedRepliesDirection,
|
|
5119
|
-
isBotMessage:
|
|
5130
|
+
isBotMessage: ne,
|
|
5120
5131
|
isStreaming: Ie.isStreaming(A),
|
|
5121
5132
|
isHandedOff: He(p.channel),
|
|
5122
5133
|
isConversationClosed: ke(p.channel),
|
|
5123
5134
|
isFeedbackEnabled: c.isUserFeedbackEnabled,
|
|
5124
5135
|
isFeedbackCommentEnabled: c.isUserFeedbackCommentOptionEnabled,
|
|
5125
5136
|
isSenderAvatarVisible: (En = v == null ? void 0 : v.conversation) == null ? void 0 : En.senderAvatarEnabled,
|
|
5126
|
-
onClickSuggestedReply: async ({ reply:
|
|
5127
|
-
x.sendUserMessage({ message:
|
|
5137
|
+
onClickSuggestedReply: async ({ reply: G }) => {
|
|
5138
|
+
x.sendUserMessage({ message: G });
|
|
5128
5139
|
},
|
|
5129
|
-
onRequestMessageTemplate: async (
|
|
5130
|
-
const { template:
|
|
5131
|
-
return d.template.set(
|
|
5140
|
+
onRequestMessageTemplate: async (G) => {
|
|
5141
|
+
const { template: ie } = await f.aiAgent.getMessageTemplate(G);
|
|
5142
|
+
return d.template.set(G, ie), ie;
|
|
5132
5143
|
},
|
|
5133
|
-
onGetCachedMessageTemplate: (
|
|
5134
|
-
onHandleTemplateInternalAction: (
|
|
5135
|
-
if (
|
|
5136
|
-
const { method:
|
|
5137
|
-
|
|
5144
|
+
onGetCachedMessageTemplate: (G) => d.template.get(G),
|
|
5145
|
+
onHandleTemplateInternalAction: (G) => {
|
|
5146
|
+
if (G.type === "internal" && G.internalData) {
|
|
5147
|
+
const { method: ie, payload: fe } = G.internalData;
|
|
5148
|
+
ie === "message.send" && (fe != null && fe.message) && x.sendUserMessage({ message: fe.message });
|
|
5138
5149
|
}
|
|
5139
5150
|
},
|
|
5140
|
-
onFeedbackUpdate: (
|
|
5141
|
-
const
|
|
5151
|
+
onFeedbackUpdate: (G) => {
|
|
5152
|
+
const ie = {
|
|
5142
5153
|
messageId: A.messageId,
|
|
5143
5154
|
channelUrl: A.channelUrl
|
|
5144
5155
|
};
|
|
5145
|
-
if (!
|
|
5146
|
-
return f.aiAgent.deleteMessageFeedback(
|
|
5147
|
-
const fe = { ...
|
|
5156
|
+
if (!G)
|
|
5157
|
+
return f.aiAgent.deleteMessageFeedback(ie);
|
|
5158
|
+
const fe = { ...ie, rating: ll(G.rating), comment: G.comment };
|
|
5148
5159
|
return Ie.hasFeedback(A) ? f.aiAgent.updateMessageFeedback(fe) : f.aiAgent.createMessageFeedback(fe);
|
|
5149
5160
|
},
|
|
5150
|
-
onSubmitForm: ({ key:
|
|
5161
|
+
onSubmitForm: ({ key: G, data: ie }) => f.aiAgent.submitForm({
|
|
5151
5162
|
messageId: A.messageId,
|
|
5152
5163
|
channelUrl: A.channelUrl,
|
|
5153
|
-
formKey:
|
|
5154
|
-
formData:
|
|
5164
|
+
formKey: G,
|
|
5165
|
+
formData: ie
|
|
5155
5166
|
}),
|
|
5156
|
-
onCancelForm: ({ key:
|
|
5167
|
+
onCancelForm: ({ key: G }) => f.aiAgent.cancelForm({
|
|
5157
5168
|
messageId: A.messageId,
|
|
5158
5169
|
channelUrl: A.channelUrl,
|
|
5159
|
-
formKey:
|
|
5170
|
+
formKey: G
|
|
5160
5171
|
}),
|
|
5161
5172
|
onStreamAnimationStart: () => {
|
|
5162
|
-
|
|
5173
|
+
T.start(A.messageId);
|
|
5163
5174
|
},
|
|
5164
5175
|
onStreamAnimationProgress: () => {
|
|
5165
5176
|
y.actions.onStreamingUpdate(!0);
|
|
5166
5177
|
},
|
|
5167
5178
|
onStreamAnimationComplete: () => {
|
|
5168
|
-
|
|
5179
|
+
T.stop(A.messageId), y.actions.onStreamingUpdate(!1);
|
|
5169
5180
|
}
|
|
5170
5181
|
};
|
|
5171
5182
|
if (A.isUserMessage())
|
|
@@ -5174,12 +5185,12 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5174
5185
|
return /* @__PURE__ */ o.createElement(t, { messageType: "file", file: A, ...De });
|
|
5175
5186
|
}
|
|
5176
5187
|
})();
|
|
5177
|
-
return /* @__PURE__ */ o.createElement("div", { key:
|
|
5188
|
+
return /* @__PURE__ */ o.createElement("div", { key: S, id: `${ce}-message-item`, role: "listitem", "data-layout-id": io() }, so, ao);
|
|
5178
5189
|
}
|
|
5179
5190
|
}
|
|
5180
5191
|
);
|
|
5181
5192
|
};
|
|
5182
|
-
return /* @__PURE__ */ o.createElement(
|
|
5193
|
+
return /* @__PURE__ */ o.createElement(gm, { id: `${ce}-message-list` }, Le(), r && /* @__PURE__ */ o.createElement(Gu, { onClose: () => s(null), sender: r.sender, file: r.file }), i && /* @__PURE__ */ o.createElement(Ue, { visible: !0, onClose: () => a(null) }, /* @__PURE__ */ o.createElement(
|
|
5183
5194
|
Ue.ActionItem,
|
|
5184
5195
|
{
|
|
5185
5196
|
onClick: () => {
|
|
@@ -5197,17 +5208,17 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5197
5208
|
},
|
|
5198
5209
|
_.FAILED_MESSAGE_REMOVE
|
|
5199
5210
|
)));
|
|
5200
|
-
},
|
|
5201
|
-
const { stringSet: e } =
|
|
5211
|
+
}, gm = h.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, hm = h(nm)`position:absolute;bottom:12px;inset-inline-end:16px;`, pm = h(em)`position:absolute;bottom:12px;left:50%;transform:translateX(-50%);`, fm = () => {
|
|
5212
|
+
const { stringSet: e } = W(), { connectionError: t } = re(), { channelSource: n } = oe(), r = t || n.error;
|
|
5202
5213
|
if (r) {
|
|
5203
5214
|
const s = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
|
|
5204
5215
|
return /* @__PURE__ */ o.createElement(ze, { type: "error", label: r.message, action: s });
|
|
5205
5216
|
}
|
|
5206
|
-
return n.channel ? /* @__PURE__ */ o.createElement(
|
|
5207
|
-
},
|
|
5217
|
+
return n.channel ? /* @__PURE__ */ o.createElement(mm, null) : /* @__PURE__ */ o.createElement(ze, { type: "loading" });
|
|
5218
|
+
}, bm = () => {
|
|
5208
5219
|
var s;
|
|
5209
|
-
const { origin: e } = je(), { appId: t, aiAgentId: n } = X(), { channelSource: r } =
|
|
5210
|
-
return (s = r.channel) != null && s.conversation ? /* @__PURE__ */ o.createElement(
|
|
5220
|
+
const { origin: e } = je(), { appId: t, aiAgentId: n } = X(), { channelSource: r } = oe();
|
|
5221
|
+
return (s = r.channel) != null && s.conversation ? /* @__PURE__ */ o.createElement(Em, null, /* @__PURE__ */ o.createElement(zt, { style: { gap: 4 } }, /* @__PURE__ */ o.createElement(H, { color: m.themedColor.textLowEmphasis, size: 12, type: "show" }), /* @__PURE__ */ o.createElement(w, { as: "i", color: m.themedColor.textLowEmphasis, variant: "caption2" }, "Only visible in the tester")), /* @__PURE__ */ o.createElement(
|
|
5211
5222
|
zt,
|
|
5212
5223
|
{
|
|
5213
5224
|
role: "button",
|
|
@@ -5221,9 +5232,9 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5221
5232
|
/* @__PURE__ */ o.createElement(w, { variant: "body3", color: m.themedColor.textHighEmphasis }, "Copy ", /* @__PURE__ */ o.createElement("span", { style: { color: m.themedColor.primary } }, "conversation link")),
|
|
5222
5233
|
/* @__PURE__ */ o.createElement(H, { color: m.themedColor.primary, size: 14, type: "copy" })
|
|
5223
5234
|
)) : null;
|
|
5224
|
-
}, zt = h.div`display:flex;justify-content:center;align-items:center;`,
|
|
5235
|
+
}, zt = h.div`display:flex;justify-content:center;align-items:center;`, Em = h(zt)`flex-direction:column;padding-block:16px;background-color:${m.themedColor.bg_100_500};gap:8px;`, Vr = We(void 0), xm = ({ children: e }) => {
|
|
5225
5236
|
var E;
|
|
5226
|
-
const { chatSDK: t } = Y(), { createAttachmentRules: n } =
|
|
5237
|
+
const { chatSDK: t } = Y(), { createAttachmentRules: n } = re(), { stringSet: r } = W(), { channelSource: s } = oe(), [i, a] = C([]), [l, c] = C({
|
|
5227
5238
|
visible: !1,
|
|
5228
5239
|
title: ""
|
|
5229
5240
|
}), d = n({
|
|
@@ -5254,16 +5265,16 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5254
5265
|
}
|
|
5255
5266
|
a((k) => [
|
|
5256
5267
|
...k,
|
|
5257
|
-
...p.map((
|
|
5258
|
-
file:
|
|
5259
|
-
preview: { url: URL.createObjectURL(
|
|
5268
|
+
...p.map((T) => ({
|
|
5269
|
+
file: T,
|
|
5270
|
+
preview: { url: URL.createObjectURL(T), type: T.type, name: T.name }
|
|
5260
5271
|
}))
|
|
5261
5272
|
]);
|
|
5262
5273
|
}, v = (u) => {
|
|
5263
5274
|
a((p) => {
|
|
5264
5275
|
var y;
|
|
5265
5276
|
const x = (y = p[u]) == null ? void 0 : y.preview;
|
|
5266
|
-
return x && URL.revokeObjectURL(x.url), p.filter((k,
|
|
5277
|
+
return x && URL.revokeObjectURL(x.url), p.filter((k, T) => T !== u);
|
|
5267
5278
|
});
|
|
5268
5279
|
}, _ = () => {
|
|
5269
5280
|
a((u) => (u.forEach((p) => URL.revokeObjectURL(p.preview.url)), []));
|
|
@@ -5289,18 +5300,18 @@ const Bu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;
|
|
|
5289
5300
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
5290
5301
|
return e;
|
|
5291
5302
|
};
|
|
5292
|
-
function
|
|
5303
|
+
function vm({ blurred: e, elementRef: t, document: n = window.document }) {
|
|
5293
5304
|
const r = B(!1);
|
|
5294
|
-
e && t.current && n.activeElement === t.current && (r.current = !0),
|
|
5305
|
+
e && t.current && n.activeElement === t.current && (r.current = !0), se(() => {
|
|
5295
5306
|
var s;
|
|
5296
5307
|
!e && r.current && ((s = t.current) == null || s.focus(), r.current = !1);
|
|
5297
5308
|
}, [e]);
|
|
5298
5309
|
}
|
|
5299
|
-
const
|
|
5310
|
+
const _m = (e, t) => {
|
|
5300
5311
|
P(() => {
|
|
5301
5312
|
t ? e == null || e.startTyping() : e == null || e.endTyping();
|
|
5302
5313
|
}, [e, t]);
|
|
5303
|
-
},
|
|
5314
|
+
}, ym = h.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, Cm = h.div`display:flex;flex-shrink:0;position:relative;margin-block-start:8px;border-radius:12px;height:64px;img{border-radius:12px;object-fit:cover;width:64px;-webkit-user-drag:none;}`, Sm = h.div`display:flex;align-items:center;justify-content:center;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;cursor:pointer;border-radius:50%;${F.light`
|
|
5304
5315
|
background-color: ${m.color.background50};
|
|
5305
5316
|
`}
|
|
5306
5317
|
${F.dark`
|
|
@@ -5319,16 +5330,16 @@ const vm = (e, t) => {
|
|
|
5319
5330
|
circle {
|
|
5320
5331
|
stroke: ${m.themedColor.bg_50_600};
|
|
5321
5332
|
}
|
|
5322
|
-
`,
|
|
5333
|
+
`, Tm = () => {
|
|
5323
5334
|
const e = nt(), [t, n] = C(), { files: r, removeFile: s, isFileUploadEnabled: i } = mn();
|
|
5324
|
-
return !i || r.length === 0 ? null : /* @__PURE__ */ o.createElement(
|
|
5335
|
+
return !i || r.length === 0 ? null : /* @__PURE__ */ o.createElement(ym, null, r.map(({ preview: { type: a, name: l, url: c } }, d) => /* @__PURE__ */ o.createElement(Cm, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ o.createElement(Sm, { title: "Remove file", onClick: () => s(d) }, /* @__PURE__ */ o.createElement(H, { type: "close-filled", color: m.themedColor.textMidEmphasis })), a.startsWith("image/") ? /* @__PURE__ */ o.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ o.createElement(Jt, { name: l, type: qt(l, a) }))));
|
|
5325
5336
|
}, zr = {
|
|
5326
5337
|
textArea: I`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
5327
5338
|
attachIcon: I`margin-bottom:4px;`
|
|
5328
|
-
},
|
|
5329
|
-
const { stringSet: t } =
|
|
5339
|
+
}, Wr = h.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, Am = h(Wr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${m.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${m.themedColor.bg_200_400};}}${ln && zr.attachIcon};`, wm = h.input`display:none;`, Xn = h.div`width:100%;position:relative;background-color:${({ theme: e }) => e.colors.messageInput.background};border-radius:20px;`, Jn = h.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, Qn = h.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:${({ theme: e }) => e.colors.messageInput.text};resize:none;width:100%;height:${Ar}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${ln && zr.textArea};&::placeholder{color:${({ theme: e }) => e.colors.messageInput.placeholderText};}&:disabled{cursor:not-allowed;&::placeholder{color:${m.themedColor.textDisabled};}}`, er = h.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, tr = ({ disabled: e }) => {
|
|
5340
|
+
const { stringSet: t } = W(), n = B(null), [r, s] = C(!1), { addFiles: i, clearFiles: a, files: l, isFileUploadEnabled: c, acceptableMimeTypes: d } = mn();
|
|
5330
5341
|
return !c || l.length > 0 ? null : /* @__PURE__ */ o.createElement(
|
|
5331
|
-
|
|
5342
|
+
Am,
|
|
5332
5343
|
{
|
|
5333
5344
|
disabled: e,
|
|
5334
5345
|
onClick: () => {
|
|
@@ -5347,7 +5358,7 @@ const vm = (e, t) => {
|
|
|
5347
5358
|
}
|
|
5348
5359
|
),
|
|
5349
5360
|
/* @__PURE__ */ o.createElement(
|
|
5350
|
-
|
|
5361
|
+
wm,
|
|
5351
5362
|
{
|
|
5352
5363
|
type: "file",
|
|
5353
5364
|
ref: n,
|
|
@@ -5367,8 +5378,8 @@ const vm = (e, t) => {
|
|
|
5367
5378
|
}
|
|
5368
5379
|
)
|
|
5369
5380
|
);
|
|
5370
|
-
},
|
|
5371
|
-
const e = B(null), [t, n] = C(""), { stringSet: r } =
|
|
5381
|
+
}, Im = () => {
|
|
5382
|
+
const e = B(null), [t, n] = C(""), { stringSet: r } = W(), { rootElement: s } = Y(), { channelSource: i, messageSource: a, state: l } = oe(), { files: c, addFiles: d, clearFiles: g } = mn(), f = l.input.disabled, b = (() => {
|
|
5372
5383
|
if (!f) return r.MESSAGE_INPUT__PLACE_HOLDER;
|
|
5373
5384
|
switch (l.input.disabledBy) {
|
|
5374
5385
|
case "form_active":
|
|
@@ -5385,33 +5396,33 @@ const vm = (e, t) => {
|
|
|
5385
5396
|
return r.MESSAGE_INPUT__PLACE_HOLDER__DISABLED;
|
|
5386
5397
|
}
|
|
5387
5398
|
})();
|
|
5388
|
-
|
|
5399
|
+
Au({ onDropFiles: d }), vm({ blurred: f, elementRef: e, document: Re(s) }), _m(i.channel, t);
|
|
5389
5400
|
const v = t.trim().length > 0, _ = c.length > 0, E = !f && (v || _), u = () => {
|
|
5390
5401
|
e.current && (e.current.value = "", e.current.style.height = ""), g(), n("");
|
|
5391
5402
|
}, p = async () => {
|
|
5392
|
-
const
|
|
5393
|
-
if (!(!
|
|
5403
|
+
const T = t.trim(), D = { message: T };
|
|
5404
|
+
if (!(!T && !c.length)) {
|
|
5394
5405
|
if (c.length > 0) {
|
|
5395
|
-
const
|
|
5396
|
-
a.sendFileMessage(
|
|
5406
|
+
const M = c[0].file, O = { ...D, file: M };
|
|
5407
|
+
a.sendFileMessage(O), u();
|
|
5397
5408
|
return;
|
|
5398
5409
|
}
|
|
5399
|
-
a.sendUserMessage(
|
|
5410
|
+
a.sendUserMessage(D), u();
|
|
5400
5411
|
}
|
|
5401
|
-
}, x = (
|
|
5402
|
-
const
|
|
5403
|
-
|
|
5404
|
-
}, y = (
|
|
5405
|
-
|
|
5406
|
-
}, k = (
|
|
5412
|
+
}, x = (T) => {
|
|
5413
|
+
const D = Array.from(T.clipboardData.files);
|
|
5414
|
+
D.length > 0 && (T.preventDefault(), d(D));
|
|
5415
|
+
}, y = (T) => {
|
|
5416
|
+
T.key !== "Enter" || T.nativeEvent.isComposing || T.shiftKey || (T.preventDefault(), p());
|
|
5417
|
+
}, k = (T) => {
|
|
5407
5418
|
if (e.current) {
|
|
5408
5419
|
e.current.style.height = "";
|
|
5409
|
-
const
|
|
5410
|
-
Ar <
|
|
5420
|
+
const D = Math.min(ya, e.current.scrollHeight);
|
|
5421
|
+
Ar < D && (e.current.style.height = `${D}px`);
|
|
5411
5422
|
}
|
|
5412
|
-
n(
|
|
5423
|
+
n(T.target.value);
|
|
5413
5424
|
};
|
|
5414
|
-
return f ? /* @__PURE__ */ o.createElement(er, null, /* @__PURE__ */ o.createElement(Xn, null, /* @__PURE__ */ o.createElement(Jn, null, /* @__PURE__ */ o.createElement(Qn, { disabled: !0, placeholder: b }), /* @__PURE__ */ o.createElement(tr, { disabled: !0 })))) : /* @__PURE__ */ o.createElement(er, null, /* @__PURE__ */ o.createElement(Xn, null, /* @__PURE__ */ o.createElement(
|
|
5425
|
+
return f ? /* @__PURE__ */ o.createElement(er, null, /* @__PURE__ */ o.createElement(Xn, null, /* @__PURE__ */ o.createElement(Jn, null, /* @__PURE__ */ o.createElement(Qn, { disabled: !0, placeholder: b }), /* @__PURE__ */ o.createElement(tr, { disabled: !0 })))) : /* @__PURE__ */ o.createElement(er, null, /* @__PURE__ */ o.createElement(Xn, null, /* @__PURE__ */ o.createElement(Tm, null), /* @__PURE__ */ o.createElement(Jn, null, /* @__PURE__ */ o.createElement(
|
|
5415
5426
|
Qn,
|
|
5416
5427
|
{
|
|
5417
5428
|
ref: e,
|
|
@@ -5423,102 +5434,103 @@ const vm = (e, t) => {
|
|
|
5423
5434
|
onChange: k,
|
|
5424
5435
|
onPaste: x
|
|
5425
5436
|
}
|
|
5426
|
-
), /* @__PURE__ */ o.createElement(tr, null))), E && /* @__PURE__ */ o.createElement(
|
|
5427
|
-
},
|
|
5437
|
+
), /* @__PURE__ */ o.createElement(tr, null))), E && /* @__PURE__ */ o.createElement(Wr, { onClick: () => p() }, /* @__PURE__ */ o.createElement(H, { type: "send", color: m.color.primary.main, size: 20 })));
|
|
5438
|
+
}, km = h.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:${m.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${F.light`
|
|
5428
5439
|
color: ${m.color.information.light};
|
|
5429
5440
|
`};
|
|
5430
5441
|
${F.dark`
|
|
5431
5442
|
color: ${m.color.information.main};
|
|
5432
5443
|
`};
|
|
5433
5444
|
}
|
|
5434
|
-
`,
|
|
5435
|
-
const { aiAgentInfo: e, userSession: t } =
|
|
5445
|
+
`, $m = R(() => import("./TXpETEfV.js").then((e) => ({ default: e.MarkdownText }))), Mm = () => {
|
|
5446
|
+
const { aiAgentInfo: e, userSession: t } = re(), { messageSource: n, channelSource: r } = oe(), [s, i] = C(null), a = Xt("special-notice", r.channel), l = L(() => r.channel ? a ? n.messages.some((c) => Qe(c, (t == null ? void 0 : t.userId) ?? "")) : !0 : null, [r.channel, a, n.messages, t == null ? void 0 : t.userId]);
|
|
5436
5447
|
return P(() => {
|
|
5437
5448
|
s || i(l());
|
|
5438
|
-
}, [l, s]), s || !e.specialNotice ? null : /* @__PURE__ */ o.createElement(
|
|
5439
|
-
},
|
|
5449
|
+
}, [l, s]), s || !e.specialNotice ? null : /* @__PURE__ */ o.createElement(km, null, /* @__PURE__ */ o.createElement($m, null, e.specialNotice));
|
|
5450
|
+
}, Om = () => /* @__PURE__ */ o.createElement(Lm, null, /* @__PURE__ */ o.createElement(Mm, null), /* @__PURE__ */ o.createElement(xm, null, /* @__PURE__ */ o.createElement(Im, null))), Lm = h.div`z-index:0;border:none;width:100%;`, Dm = () => {
|
|
5440
5451
|
var s;
|
|
5441
|
-
const { testerType: e } = je(), { channelSource: t } =
|
|
5442
|
-
return n && r ? /* @__PURE__ */ o.createElement(
|
|
5443
|
-
},
|
|
5452
|
+
const { testerType: e } = je(), { channelSource: t } = oe(), n = ke(t.channel), r = !!e && ((s = t.channel) == null ? void 0 : s.isAIAgent);
|
|
5453
|
+
return n && r ? /* @__PURE__ */ o.createElement(bm, null) : /* @__PURE__ */ o.createElement(Om, null);
|
|
5454
|
+
}, Rm = ({
|
|
5444
5455
|
children: e,
|
|
5445
5456
|
onNavigateToConversationList: t,
|
|
5446
5457
|
channelUrl: n,
|
|
5447
5458
|
onClearChannelUrl: r,
|
|
5448
5459
|
shouldMarkAsRead: s,
|
|
5449
|
-
|
|
5450
|
-
|
|
5460
|
+
style: i,
|
|
5461
|
+
closedChannelUrl: a,
|
|
5462
|
+
onClearClosedChannelUrl: l
|
|
5451
5463
|
}) => {
|
|
5452
|
-
const { Template:
|
|
5464
|
+
const { Template: c } = gn.useContext();
|
|
5453
5465
|
return /* @__PURE__ */ o.createElement(
|
|
5454
|
-
|
|
5466
|
+
iu,
|
|
5455
5467
|
{
|
|
5456
5468
|
onNavigateToConversationList: t,
|
|
5457
|
-
channelUrl: n ??
|
|
5458
|
-
onClearChannelUrl: r ??
|
|
5469
|
+
channelUrl: n ?? a,
|
|
5470
|
+
onClearChannelUrl: r ?? l,
|
|
5459
5471
|
shouldMarkAsRead: s
|
|
5460
5472
|
},
|
|
5461
|
-
/* @__PURE__ */ o.createElement(Vt, null, /* @__PURE__ */ o.createElement(Vt.Consumer, null, (
|
|
5473
|
+
/* @__PURE__ */ o.createElement(Vt, null, /* @__PURE__ */ o.createElement(Vt.Consumer, null, (d) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Bm, { style: i, ...d }, /* @__PURE__ */ o.createElement(c, null)), e)))
|
|
5462
5474
|
);
|
|
5463
5475
|
}, gn = ye({
|
|
5464
|
-
template:
|
|
5476
|
+
template: Nm,
|
|
5465
5477
|
components: {
|
|
5466
|
-
Header:
|
|
5467
|
-
Body:
|
|
5468
|
-
Footer:
|
|
5478
|
+
Header: Su,
|
|
5479
|
+
Body: fm,
|
|
5480
|
+
Footer: Dm
|
|
5469
5481
|
}
|
|
5470
5482
|
});
|
|
5471
|
-
function
|
|
5483
|
+
function Nm() {
|
|
5472
5484
|
const { components: e } = gn.useContext();
|
|
5473
5485
|
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(e.Header, null), /* @__PURE__ */ o.createElement(e.Body, null), /* @__PURE__ */ o.createElement(e.Footer, null));
|
|
5474
5486
|
}
|
|
5475
|
-
const
|
|
5476
|
-
Provider:
|
|
5477
|
-
Context:
|
|
5478
|
-
useContext:
|
|
5487
|
+
const Bm = h.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
5488
|
+
Provider: Fm,
|
|
5489
|
+
Context: _h,
|
|
5490
|
+
useContext: Gr
|
|
5479
5491
|
} = ee("ConversationList");
|
|
5480
|
-
function
|
|
5492
|
+
function Pm({
|
|
5481
5493
|
conversationListLimit: e,
|
|
5482
5494
|
conversationListFilter: t,
|
|
5483
5495
|
onOpenConversationView: n = _e,
|
|
5484
5496
|
children: r
|
|
5485
5497
|
}) {
|
|
5486
5498
|
return /* @__PURE__ */ o.createElement(
|
|
5487
|
-
|
|
5499
|
+
ci,
|
|
5488
5500
|
{
|
|
5489
5501
|
conversationListLimit: e,
|
|
5490
5502
|
conversationListFilter: t
|
|
5491
5503
|
},
|
|
5492
|
-
(s) => /* @__PURE__ */ o.createElement(
|
|
5504
|
+
(s) => /* @__PURE__ */ o.createElement(Fm, { value: { ...s, onOpenConversationView: n } }, r)
|
|
5493
5505
|
);
|
|
5494
5506
|
}
|
|
5495
|
-
const
|
|
5496
|
-
template:
|
|
5507
|
+
const Um = ({ channel: e }) => /* @__PURE__ */ o.createElement(Ur, { channel: e }), jr = ye({
|
|
5508
|
+
template: Hm,
|
|
5497
5509
|
// Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
|
|
5498
5510
|
components: {}
|
|
5499
|
-
}),
|
|
5500
|
-
function
|
|
5501
|
-
const { channel: t, onClick: n } = e, { stringSet: r, format: s } =
|
|
5511
|
+
}), Wt = 99;
|
|
5512
|
+
function Hm(e) {
|
|
5513
|
+
const { channel: t, onClick: n } = e, { stringSet: r, format: s } = W(), i = Zo(t), a = Xo(t, s, {
|
|
5502
5514
|
justNow: r.DATE_FORMAT__JUST_NOW,
|
|
5503
5515
|
minutesAgo: r.DATE_FORMAT__MINUTES_AGO,
|
|
5504
5516
|
hoursAgo: r.DATE_FORMAT__HOURS_AGO,
|
|
5505
5517
|
dateShortFormat: r.DATE_FORMAT__DATE_SHORT
|
|
5506
5518
|
}), l = t.unreadMessageCount;
|
|
5507
|
-
return /* @__PURE__ */ o.createElement(
|
|
5519
|
+
return /* @__PURE__ */ o.createElement(Vm, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ o.createElement(zm, null, /* @__PURE__ */ o.createElement(Um, { ...e })), /* @__PURE__ */ o.createElement(Wm, null, /* @__PURE__ */ o.createElement(Gm, null, /* @__PURE__ */ o.createElement(w, { variant: "subtitle1", color: m.themedColor.textHighEmphasis, maxTextLines: 1 }, i), /* @__PURE__ */ o.createElement(jm, null, ke(t) && /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(w, { variant: "caption1", color: m.themedColor.textMidEmphasis, maxTextLines: 1 }, r.CONVERSATION_LIST__ENDED), /* @__PURE__ */ o.createElement(qm, null)), /* @__PURE__ */ o.createElement(w, { variant: "caption2", color: m.themedColor.textLowEmphasis, maxTextLines: 1 }, a))), l > 0 && /* @__PURE__ */ o.createElement(Km, { $count: l }, /* @__PURE__ */ o.createElement(w, { variant: "caption3", color: m.themedColor.textHighEmphasisInverse }, l <= Wt ? l : `${Wt}+`))));
|
|
5508
5520
|
}
|
|
5509
|
-
const
|
|
5521
|
+
const Vm = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:center;position:relative;width:100%;height:72px;box-sizing:border-box;gap:16px;cursor:pointer;`, zm = h.div`display:flex;align-items:center;justify-content:center;padding-inline-start:16px;`, Wm = h.div`display:flex;flex-direction:row;align-items:center;flex:1;padding-inline-end:16px;height:100%;gap:8px;border-bottom:1px solid ${m.themedColor.textDisabled};`, Gm = h.div`display:flex;flex-direction:column;justify-content:center;flex:1;gap:4px;word-break:break-word;overflow-wrap:break-word;`, jm = h.div`display:flex;align-items:center;gap:6px;`, qm = h.div`width:2px;height:2px;border-radius:1px;background-color:${m.themedColor.textLowEmphasis};`, Km = h.div`display:flex;align-items:center;justify-content:center;height:20px;padding:4px;border-radius:10px;background-color:${m.themedColor.error};${({ $count: e }) => e <= Wt && I`
|
|
5510
5522
|
width: 20px;
|
|
5511
5523
|
`}
|
|
5512
|
-
`,
|
|
5524
|
+
`, Ym = ({ items: e, renderItem: t, onEndReached: n }) => {
|
|
5513
5525
|
const r = (s) => {
|
|
5514
5526
|
const i = s.target;
|
|
5515
5527
|
i.scrollHeight - i.scrollTop === i.clientHeight && (n == null || n());
|
|
5516
5528
|
};
|
|
5517
|
-
return /* @__PURE__ */ o.createElement(
|
|
5518
|
-
},
|
|
5519
|
-
const { stringSet: e } =
|
|
5529
|
+
return /* @__PURE__ */ o.createElement(Zm, { onScroll: (s) => r(s) }, e.map((s, i) => t(s, i)));
|
|
5530
|
+
}, Zm = h.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;overscroll-behavior:contain;`, Xm = () => {
|
|
5531
|
+
const { stringSet: e } = W(), { listSource: t, onOpenConversationView: n } = Gr(), { Template: r } = jr.useContext();
|
|
5520
5532
|
return t.initialized ? t.channels.length === 0 ? /* @__PURE__ */ o.createElement(ze, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ o.createElement(
|
|
5521
|
-
|
|
5533
|
+
Ym,
|
|
5522
5534
|
{
|
|
5523
5535
|
items: t.channels,
|
|
5524
5536
|
renderItem: (s) => {
|
|
@@ -5540,10 +5552,10 @@ const Hm = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
|
|
|
5540
5552
|
}
|
|
5541
5553
|
}
|
|
5542
5554
|
) : /* @__PURE__ */ o.createElement(ze, { type: "loading" });
|
|
5543
|
-
},
|
|
5544
|
-
const { stringSet: e } =
|
|
5555
|
+
}, Jm = () => {
|
|
5556
|
+
const { stringSet: e } = W(), { language: t, countryCode: n, context: r } = Y(), { aiAgentInfo: s, refreshActiveChannel: i, createConversation: a, setActiveChannel: l } = re(), { onOpenConversationView: c } = Gr();
|
|
5545
5557
|
return /* @__PURE__ */ o.createElement(
|
|
5546
|
-
|
|
5558
|
+
Qm,
|
|
5547
5559
|
{
|
|
5548
5560
|
role: "button",
|
|
5549
5561
|
onClick: async () => {
|
|
@@ -5561,17 +5573,17 @@ const Hm = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
|
|
|
5561
5573
|
}
|
|
5562
5574
|
}
|
|
5563
5575
|
},
|
|
5564
|
-
/* @__PURE__ */ o.createElement(
|
|
5576
|
+
/* @__PURE__ */ o.createElement(eg, { variant: "h1" }, e.TALK_TO_AGENT)
|
|
5565
5577
|
);
|
|
5566
|
-
},
|
|
5578
|
+
}, Qm = h.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, eg = h(w)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, tg = () => {
|
|
5567
5579
|
const { state: e } = Y(), t = qe(), n = () => {
|
|
5568
5580
|
e.setOpened(!1);
|
|
5569
5581
|
};
|
|
5570
|
-
return /* @__PURE__ */ o.createElement(
|
|
5571
|
-
},
|
|
5572
|
-
const { stringSet: e } =
|
|
5573
|
-
return /* @__PURE__ */ o.createElement(
|
|
5574
|
-
},
|
|
5582
|
+
return /* @__PURE__ */ o.createElement(Oe, { "aria-label": "close messenger", type: "close", size: t, onClick: n });
|
|
5583
|
+
}, ng = () => {
|
|
5584
|
+
const { stringSet: e } = W();
|
|
5585
|
+
return /* @__PURE__ */ o.createElement(rg, { variant: "h2", color: m.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE);
|
|
5586
|
+
}, rg = h(w)`padding:0 4px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, og = (e) => {
|
|
5575
5587
|
const { components: t } = rt.useContext();
|
|
5576
5588
|
return /* @__PURE__ */ o.createElement(
|
|
5577
5589
|
an,
|
|
@@ -5582,54 +5594,55 @@ const Hm = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
|
|
|
5582
5594
|
end: /* @__PURE__ */ o.createElement(t.EndArea, null)
|
|
5583
5595
|
}
|
|
5584
5596
|
);
|
|
5585
|
-
},
|
|
5597
|
+
}, sg = () => null, ig = () => {
|
|
5586
5598
|
const { components: e } = rt.useContext();
|
|
5587
5599
|
return /* @__PURE__ */ o.createElement(e.Title, null);
|
|
5588
|
-
},
|
|
5600
|
+
}, ag = () => {
|
|
5589
5601
|
const { components: e } = rt.useContext();
|
|
5590
5602
|
return /* @__PURE__ */ o.createElement(e.CloseButton, null);
|
|
5591
5603
|
}, rt = ye({
|
|
5592
|
-
template:
|
|
5604
|
+
template: og,
|
|
5593
5605
|
components: {
|
|
5594
|
-
StartArea:
|
|
5595
|
-
TitleArea:
|
|
5596
|
-
EndArea:
|
|
5597
|
-
Title:
|
|
5598
|
-
CloseButton:
|
|
5606
|
+
StartArea: sg,
|
|
5607
|
+
TitleArea: ig,
|
|
5608
|
+
EndArea: ag,
|
|
5609
|
+
Title: ng,
|
|
5610
|
+
CloseButton: tg
|
|
5599
5611
|
}
|
|
5600
|
-
}),
|
|
5612
|
+
}), lg = () => {
|
|
5601
5613
|
const { Template: e } = rt.useContext();
|
|
5602
5614
|
return /* @__PURE__ */ o.createElement(e, { titleAlign: "start" });
|
|
5603
|
-
},
|
|
5615
|
+
}, cg = ({
|
|
5604
5616
|
conversationListLimit: e,
|
|
5605
5617
|
conversationListFilter: t,
|
|
5606
5618
|
children: n,
|
|
5607
|
-
onOpenConversationView: r
|
|
5619
|
+
onOpenConversationView: r,
|
|
5620
|
+
style: s
|
|
5608
5621
|
}) => {
|
|
5609
|
-
const { Template:
|
|
5622
|
+
const { Template: i } = hn.useContext();
|
|
5610
5623
|
return /* @__PURE__ */ o.createElement(
|
|
5611
|
-
|
|
5624
|
+
Pm,
|
|
5612
5625
|
{
|
|
5613
5626
|
conversationListLimit: e,
|
|
5614
5627
|
conversationListFilter: t,
|
|
5615
5628
|
onOpenConversationView: r
|
|
5616
5629
|
},
|
|
5617
|
-
/* @__PURE__ */ o.createElement(
|
|
5630
|
+
/* @__PURE__ */ o.createElement(ug, { style: s }, /* @__PURE__ */ o.createElement(i, null)),
|
|
5618
5631
|
n
|
|
5619
5632
|
);
|
|
5620
5633
|
}, hn = ye({
|
|
5621
|
-
template:
|
|
5634
|
+
template: dg,
|
|
5622
5635
|
components: {
|
|
5623
|
-
Header:
|
|
5624
|
-
Body:
|
|
5625
|
-
Footer:
|
|
5636
|
+
Header: lg,
|
|
5637
|
+
Body: Xm,
|
|
5638
|
+
Footer: Jm
|
|
5626
5639
|
}
|
|
5627
5640
|
});
|
|
5628
|
-
function
|
|
5641
|
+
function dg() {
|
|
5629
5642
|
const { components: e } = hn.useContext();
|
|
5630
5643
|
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(e.Header, null), /* @__PURE__ */ o.createElement(e.Body, null), /* @__PURE__ */ o.createElement(e.Footer, null));
|
|
5631
5644
|
}
|
|
5632
|
-
const
|
|
5645
|
+
const ug = h.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, mg = I`:where(#${de.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, gg = [mg, ji, qi], hg = (e, ...t) => So(e, ...gg, ...t), pg = hg``, fg = jo(
|
|
5633
5646
|
gn,
|
|
5634
5647
|
Ve,
|
|
5635
5648
|
on,
|
|
@@ -5640,7 +5653,7 @@ const dg = h.div`height:100%;width:100%;display:flex;flex-direction:column;flex:
|
|
|
5640
5653
|
rt,
|
|
5641
5654
|
un
|
|
5642
5655
|
);
|
|
5643
|
-
function
|
|
5656
|
+
function bg({
|
|
5644
5657
|
appearance: e,
|
|
5645
5658
|
rootElement: t,
|
|
5646
5659
|
logger: n,
|
|
@@ -5650,9 +5663,9 @@ function fg({
|
|
|
5650
5663
|
messageTemplate: a,
|
|
5651
5664
|
theme: l
|
|
5652
5665
|
}) {
|
|
5653
|
-
return
|
|
5666
|
+
return Ji(Ri, t), /* @__PURE__ */ o.createElement(To, { target: t }, /* @__PURE__ */ o.createElement(Yi, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ o.createElement(mi, { internalVariables: a == null ? void 0 : a.__internalVariables }, /* @__PURE__ */ o.createElement(Gi, { stringSet: s, logger: n, language: r }, /* @__PURE__ */ o.createElement(fg, null, i, /* @__PURE__ */ o.createElement(pg, null))))));
|
|
5654
5667
|
}
|
|
5655
|
-
const
|
|
5668
|
+
const Eg = {
|
|
5656
5669
|
isOnline: () => typeof window > "u" ? !0 : navigator.onLine,
|
|
5657
5670
|
subscribe: (e) => {
|
|
5658
5671
|
if (typeof window > "u")
|
|
@@ -5696,7 +5709,7 @@ const bg = {
|
|
|
5696
5709
|
return Object.keys(ut).filter((t) => t.startsWith(e));
|
|
5697
5710
|
}
|
|
5698
5711
|
}
|
|
5699
|
-
}, qr =
|
|
5712
|
+
}, qr = Ge(function({
|
|
5700
5713
|
rootElement: t = document.body,
|
|
5701
5714
|
logLevel: n = or.WARN,
|
|
5702
5715
|
language: r = navigator.language,
|
|
@@ -5706,8 +5719,8 @@ const bg = {
|
|
|
5706
5719
|
...l
|
|
5707
5720
|
}, c) {
|
|
5708
5721
|
var d, g;
|
|
5709
|
-
return Ze.level !== n && (Ze.level = n),
|
|
5710
|
-
|
|
5722
|
+
return Ze.level !== n && (Ze.level = n), Xi("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ o.createElement("div", { id: de.ENTRY, style: { width: "fit-content", height: "fit-content", ...l.entryStyle } }, /* @__PURE__ */ o.createElement(
|
|
5723
|
+
bg,
|
|
5711
5724
|
{
|
|
5712
5725
|
logger: Ze,
|
|
5713
5726
|
rootElement: t,
|
|
@@ -5718,7 +5731,7 @@ const bg = {
|
|
|
5718
5731
|
theme: l.theme
|
|
5719
5732
|
},
|
|
5720
5733
|
/* @__PURE__ */ o.createElement(
|
|
5721
|
-
|
|
5734
|
+
ea,
|
|
5722
5735
|
{
|
|
5723
5736
|
rootElement: t,
|
|
5724
5737
|
keyValueStorage: {
|
|
@@ -5727,37 +5740,37 @@ const bg = {
|
|
|
5727
5740
|
delete: mt.deleteItem,
|
|
5728
5741
|
getKeys: mt.getKeys
|
|
5729
5742
|
},
|
|
5730
|
-
networkStateAdapter:
|
|
5743
|
+
networkStateAdapter: Eg,
|
|
5731
5744
|
language: r,
|
|
5732
5745
|
logger: Ze,
|
|
5733
|
-
dispatcher:
|
|
5746
|
+
dispatcher: xg,
|
|
5734
5747
|
chatParams: {
|
|
5735
5748
|
...a,
|
|
5736
|
-
customApiHost: l.customApiHost,
|
|
5737
|
-
customWebSocketHost: l.customWebSocketHost
|
|
5749
|
+
...l.customApiHost && { customApiHost: l.customApiHost },
|
|
5750
|
+
...l.customWebSocketHost && { customWebSocketHost: l.customWebSocketHost }
|
|
5738
5751
|
},
|
|
5739
5752
|
chatSDK: l.customChatSDK,
|
|
5740
|
-
messengerVersion:
|
|
5753
|
+
messengerVersion: Ca,
|
|
5741
5754
|
...l
|
|
5742
5755
|
},
|
|
5743
5756
|
/* @__PURE__ */ o.createElement(
|
|
5744
|
-
|
|
5757
|
+
jd,
|
|
5745
5758
|
{
|
|
5746
5759
|
ref: c,
|
|
5747
5760
|
userSessionInfo: s,
|
|
5748
5761
|
forceCreateChannel: (g = l.agentPreviewConfigs) == null ? void 0 : g.forceCreateChannel
|
|
5749
5762
|
},
|
|
5750
|
-
/* @__PURE__ */ o.createElement(
|
|
5763
|
+
/* @__PURE__ */ o.createElement(wd, { ...l._UNSAFE_INTERNAL_dashboardTester }, i, /* @__PURE__ */ o.createElement("div", { id: de.MODAL_ROOT, dir: l.dir }))
|
|
5751
5764
|
)
|
|
5752
5765
|
)
|
|
5753
5766
|
));
|
|
5754
|
-
}), Ze = new pr(or.WARN),
|
|
5755
|
-
Provider:
|
|
5767
|
+
}), Ze = new pr(or.WARN), xg = new gr(Ze), {
|
|
5768
|
+
Provider: vg,
|
|
5756
5769
|
useContext: pn
|
|
5757
5770
|
} = ee("PageChildren"), Kr = ({ children: e }) => {
|
|
5758
5771
|
const [t, n] = C(null), [r, s] = C(null);
|
|
5759
5772
|
return /* @__PURE__ */ o.createElement(
|
|
5760
|
-
|
|
5773
|
+
vg,
|
|
5761
5774
|
{
|
|
5762
5775
|
value: {
|
|
5763
5776
|
conversationChildren: t,
|
|
@@ -5775,9 +5788,9 @@ const bg = {
|
|
|
5775
5788
|
return t ? s.body.classList.add(i) : s.body.classList.remove(i), () => {
|
|
5776
5789
|
s.body.classList.remove(i);
|
|
5777
5790
|
};
|
|
5778
|
-
}, [s, t]), /* @__PURE__ */ o.createElement(
|
|
5779
|
-
},
|
|
5780
|
-
function
|
|
5791
|
+
}, [s, t]), /* @__PURE__ */ o.createElement(_g, { dir: n, $visible: t }, e);
|
|
5792
|
+
}, _g = h.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${Ne.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, yg = 48, Cg = 2 / 3;
|
|
5793
|
+
function Sg({
|
|
5781
5794
|
className: e,
|
|
5782
5795
|
isOpened: t,
|
|
5783
5796
|
onClick: n,
|
|
@@ -5786,11 +5799,11 @@ function Cg({
|
|
|
5786
5799
|
dir: i,
|
|
5787
5800
|
animated: a = !0,
|
|
5788
5801
|
backgroundColor: l,
|
|
5789
|
-
size: c =
|
|
5802
|
+
size: c = yg
|
|
5790
5803
|
}) {
|
|
5791
|
-
const d = Nt(l), g = Math.round(c *
|
|
5804
|
+
const d = Nt(l), g = Math.round(c * Cg);
|
|
5792
5805
|
return /* @__PURE__ */ o.createElement(
|
|
5793
|
-
|
|
5806
|
+
wg,
|
|
5794
5807
|
{
|
|
5795
5808
|
dir: i,
|
|
5796
5809
|
id: de.LAUNCHER,
|
|
@@ -5801,11 +5814,11 @@ function Cg({
|
|
|
5801
5814
|
$backgroundColor: l,
|
|
5802
5815
|
$size: c
|
|
5803
5816
|
},
|
|
5804
|
-
/* @__PURE__ */ o.createElement(
|
|
5805
|
-
/* @__PURE__ */ o.createElement(
|
|
5817
|
+
/* @__PURE__ */ o.createElement(Ig, { $isOpened: t, $animated: a, $fillColor: d, $iconSize: g }, /* @__PURE__ */ o.createElement(nr.Open, { url: s, isDefaultIcon: r === "default_icon", size: g })),
|
|
5818
|
+
/* @__PURE__ */ o.createElement(kg, { $isOpened: t, $animated: a, $fillColor: d, $iconSize: g }, /* @__PURE__ */ o.createElement(nr.Close, { size: g }))
|
|
5806
5819
|
);
|
|
5807
5820
|
}
|
|
5808
|
-
const
|
|
5821
|
+
const Tg = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, Ag = I`img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-drag:none;&[data-default-icon='true']{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;filter:${({ $fillColor: e }) => e === Xe.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, Zr = I`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => I`
|
|
5809
5822
|
ellipse,
|
|
5810
5823
|
path {
|
|
5811
5824
|
fill: ${e};
|
|
@@ -5815,14 +5828,14 @@ const Sg = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
5815
5828
|
}
|
|
5816
5829
|
`}
|
|
5817
5830
|
}
|
|
5818
|
-
`,
|
|
5831
|
+
`, wg = h.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 && Tg}`, Xr = h.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;`, Ig = h(Xr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${Ag}${Zr}`, kg = h(Xr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${Zr}`, nr = {
|
|
5819
5832
|
Open: (e) => e.url ? /* @__PURE__ */ o.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ o.createElement(H, { size: e.size, type: "delight" }),
|
|
5820
5833
|
Close: ({ size: e }) => /* @__PURE__ */ o.createElement(H, { size: e, type: "chevron-down" })
|
|
5821
5834
|
};
|
|
5822
5835
|
function Jr({ className: e, size: t }) {
|
|
5823
|
-
const { colors: n } = Je(), { dir: r, state: s } = Y(), { launcherInfo: i } =
|
|
5824
|
-
return
|
|
5825
|
-
|
|
5836
|
+
const { colors: n } = Je(), { dir: r, state: s } = Y(), { launcherInfo: i } = re();
|
|
5837
|
+
return Mg(), /* @__PURE__ */ o.createElement(
|
|
5838
|
+
Sg,
|
|
5826
5839
|
{
|
|
5827
5840
|
dir: r,
|
|
5828
5841
|
className: e,
|
|
@@ -5835,8 +5848,8 @@ function Jr({ className: e, size: t }) {
|
|
|
5835
5848
|
}
|
|
5836
5849
|
);
|
|
5837
5850
|
}
|
|
5838
|
-
const
|
|
5839
|
-
function
|
|
5851
|
+
const $g = 1e3 * 60;
|
|
5852
|
+
function Mg() {
|
|
5840
5853
|
const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: r } = Y(), s = B(null);
|
|
5841
5854
|
P(() => {
|
|
5842
5855
|
if (!r) return;
|
|
@@ -5849,12 +5862,12 @@ function $g() {
|
|
|
5849
5862
|
function l() {
|
|
5850
5863
|
i(), s.current = setTimeout(async () => {
|
|
5851
5864
|
await e.disconnectWebSocket(), n.debug("useSDKInactivityTimeout: disconnected");
|
|
5852
|
-
},
|
|
5865
|
+
}, $g);
|
|
5853
5866
|
}
|
|
5854
5867
|
t.opened ? a() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
|
|
5855
5868
|
}, [r, e, t.opened]);
|
|
5856
5869
|
}
|
|
5857
|
-
const Qr =
|
|
5870
|
+
const Qr = We(null);
|
|
5858
5871
|
function eo() {
|
|
5859
5872
|
const e = xe(Qr);
|
|
5860
5873
|
if (!e)
|
|
@@ -5865,16 +5878,16 @@ function to({ children: e }) {
|
|
|
5865
5878
|
const t = eo();
|
|
5866
5879
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ o.createElement(o.Fragment, null, e);
|
|
5867
5880
|
}
|
|
5868
|
-
const
|
|
5881
|
+
const Og = sr`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, Lg = sr`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, Dg = I`animation-name:${Og};animation-duration:0.3s;animation-fill-mode:forwards;`, Rg = I``, Ng = I`animation-name:${Lg};animation-duration:0.3s;animation-fill-mode:forwards;`, Bg = I`visibility:hidden;`, Fg = h.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
5869
5882
|
switch (e) {
|
|
5870
5883
|
case "entering":
|
|
5871
|
-
return Og;
|
|
5872
|
-
case "entered":
|
|
5873
5884
|
return Dg;
|
|
5874
|
-
case "
|
|
5885
|
+
case "entered":
|
|
5875
5886
|
return Rg;
|
|
5876
|
-
case "
|
|
5887
|
+
case "exiting":
|
|
5877
5888
|
return Ng;
|
|
5889
|
+
case "exited":
|
|
5890
|
+
return Bg;
|
|
5878
5891
|
default:
|
|
5879
5892
|
return "";
|
|
5880
5893
|
}
|
|
@@ -5910,15 +5923,15 @@ function ht({ initialId: e, children: t }) {
|
|
|
5910
5923
|
})), r((x) => x.slice(0, -1));
|
|
5911
5924
|
}, 300), u;
|
|
5912
5925
|
});
|
|
5913
|
-
}, []), l =
|
|
5926
|
+
}, []), l = ae(() => ({
|
|
5914
5927
|
navigation: {
|
|
5915
5928
|
navigate: i,
|
|
5916
5929
|
pop: a
|
|
5917
5930
|
},
|
|
5918
5931
|
activeScreenId: s
|
|
5919
|
-
}), [i, a, s]), c =
|
|
5932
|
+
}), [i, a, s]), c = ae(() => po.toArray(t).filter(
|
|
5920
5933
|
(u) => u.type === to
|
|
5921
|
-
), [t]), d =
|
|
5934
|
+
), [t]), d = ae(() => {
|
|
5922
5935
|
const u = {};
|
|
5923
5936
|
return c.forEach((p) => {
|
|
5924
5937
|
const { id: x, lazy: y, children: k } = p.props;
|
|
@@ -5935,14 +5948,14 @@ function ht({ initialId: e, children: t }) {
|
|
|
5935
5948
|
p === e ? u[p] = "entered" : u[p] = "exited";
|
|
5936
5949
|
}), u;
|
|
5937
5950
|
}), [_, E] = C({});
|
|
5938
|
-
return /* @__PURE__ */ o.createElement(Qr.Provider, { value: l }, /* @__PURE__ */ o.createElement(
|
|
5951
|
+
return /* @__PURE__ */ o.createElement(Qr.Provider, { value: l }, /* @__PURE__ */ o.createElement(Pg, null, Object.keys(d).map((u) => {
|
|
5939
5952
|
var k;
|
|
5940
5953
|
if (!g[u]) return null;
|
|
5941
5954
|
const p = b[u] || "exited", x = u === s, y = `${u}-${_[u] || 0}`;
|
|
5942
|
-
return /* @__PURE__ */ o.createElement(
|
|
5955
|
+
return /* @__PURE__ */ o.createElement(Fg, { key: y, $transitionState: p, $active: x }, (k = d[u]) == null ? void 0 : k.element);
|
|
5943
5956
|
})));
|
|
5944
5957
|
}
|
|
5945
|
-
const
|
|
5958
|
+
const Pg = h.div`position:relative;width:100%;height:100%;`;
|
|
5946
5959
|
ht.Screen = to;
|
|
5947
5960
|
const be = {
|
|
5948
5961
|
conv: "conv",
|
|
@@ -5957,9 +5970,9 @@ const be = {
|
|
|
5957
5970
|
default:
|
|
5958
5971
|
return be.conv;
|
|
5959
5972
|
}
|
|
5960
|
-
})(), l = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
5973
|
+
})(), l = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Ug, { onOpenConversationView: r }));
|
|
5961
5974
|
return /* @__PURE__ */ o.createElement(ht, { initialId: a }, /* @__PURE__ */ o.createElement(ht.Screen, { id: be.conv }, ({ navigation: c, activeScreenId: d }) => /* @__PURE__ */ o.createElement(
|
|
5962
|
-
|
|
5975
|
+
Rm,
|
|
5963
5976
|
{
|
|
5964
5977
|
key: n,
|
|
5965
5978
|
channelUrl: n,
|
|
@@ -5970,7 +5983,7 @@ const be = {
|
|
|
5970
5983
|
l,
|
|
5971
5984
|
s
|
|
5972
5985
|
)), /* @__PURE__ */ o.createElement(ht.Screen, { id: be.convList, lazy: !0 }, ({ navigation: c }) => /* @__PURE__ */ o.createElement(
|
|
5973
|
-
|
|
5986
|
+
cg,
|
|
5974
5987
|
{
|
|
5975
5988
|
onOpenConversationView: (d) => {
|
|
5976
5989
|
r(d), c.navigate(be.conv);
|
|
@@ -5979,18 +5992,18 @@ const be = {
|
|
|
5979
5992
|
l,
|
|
5980
5993
|
i
|
|
5981
5994
|
)));
|
|
5982
|
-
},
|
|
5983
|
-
const { registerOnJoinedProactiveConversation: t } =
|
|
5995
|
+
}, Ug = ({ onOpenConversationView: e }) => {
|
|
5996
|
+
const { registerOnJoinedProactiveConversation: t } = re(), { navigation: n } = eo();
|
|
5984
5997
|
return t(({ channel: r }) => {
|
|
5985
5998
|
e(r.url), n.navigate(be.conv);
|
|
5986
5999
|
}), null;
|
|
5987
6000
|
};
|
|
5988
|
-
function
|
|
6001
|
+
function Hg({ isExpanded: e, isOpened: t, children: n, launcher: r }) {
|
|
5989
6002
|
const { dir: s } = Y();
|
|
5990
|
-
return /* @__PURE__ */ o.createElement(
|
|
6003
|
+
return /* @__PURE__ */ o.createElement(Vg, null, /* @__PURE__ */ o.createElement(zg, { dir: s, id: de.WINDOW, $isExpanded: e, $isOpened: t }, n), r);
|
|
5991
6004
|
}
|
|
5992
|
-
const
|
|
5993
|
-
const s = nt(), [i, a] = C(t), l = s ? Yr :
|
|
6005
|
+
const Vg = h.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, zg = h.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 && Gg};${({ $isExpanded: e }) => e && Wg};`, Wg = I`width:743px;height:723px;`, Gg = I`z-index:${Ne.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;`, yh = Ge(function({ children: e, initialChannelUrl: t, ...n }, r) {
|
|
6006
|
+
const s = nt(), [i, a] = C(t), l = s ? Yr : Hg;
|
|
5994
6007
|
return /* @__PURE__ */ o.createElement(qr, { enableExpandButton: !s, ref: r, ...n }, /* @__PURE__ */ o.createElement(Tr, null, ({ state: c }) => /* @__PURE__ */ o.createElement(Kr, null, /* @__PURE__ */ o.createElement(l, { isExpanded: c.expanded, isOpened: c.opened, launcher: /* @__PURE__ */ o.createElement(Jr, null) }, /* @__PURE__ */ o.createElement(
|
|
5995
6008
|
no,
|
|
5996
6009
|
{
|
|
@@ -6001,7 +6014,7 @@ const Hg = h.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end
|
|
|
6001
6014
|
}
|
|
6002
6015
|
)), e)));
|
|
6003
6016
|
}), {
|
|
6004
|
-
Provider:
|
|
6017
|
+
Provider: jg,
|
|
6005
6018
|
useContext: fn
|
|
6006
6019
|
} = ee("FixedMessengerStyle");
|
|
6007
6020
|
function ro(e, t, n, r = 0) {
|
|
@@ -6025,15 +6038,15 @@ function ro(e, t, n, r = 0) {
|
|
|
6025
6038
|
}
|
|
6026
6039
|
return I`${c};${d};`;
|
|
6027
6040
|
}
|
|
6028
|
-
function
|
|
6041
|
+
function qg(e) {
|
|
6029
6042
|
const { horizontal: t, vertical: n, margin: r, launcherSize: s } = fn();
|
|
6030
|
-
return /* @__PURE__ */ o.createElement(
|
|
6043
|
+
return /* @__PURE__ */ o.createElement(Kg, { ...e, size: s, $horizontal: t, $vertical: n, $margin: r });
|
|
6031
6044
|
}
|
|
6032
|
-
const
|
|
6033
|
-
function
|
|
6045
|
+
const Kg = h(Jr)`position:fixed;z-index:${Ne.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => ro(e, t, n)};`;
|
|
6046
|
+
function Yg({ isExpanded: e, isOpened: t, children: n }) {
|
|
6034
6047
|
const { dir: r } = Y(), { horizontal: s, vertical: i, margin: a, launcherSize: l } = fn();
|
|
6035
6048
|
return /* @__PURE__ */ o.createElement(
|
|
6036
|
-
|
|
6049
|
+
Zg,
|
|
6037
6050
|
{
|
|
6038
6051
|
dir: r,
|
|
6039
6052
|
id: de.WINDOW,
|
|
@@ -6047,21 +6060,21 @@ function Kg({ isExpanded: e, isOpened: t, children: n }) {
|
|
|
6047
6060
|
n
|
|
6048
6061
|
);
|
|
6049
6062
|
}
|
|
6050
|
-
const
|
|
6063
|
+
const Zg = h.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;position:fixed;${({ $horizontal: e, $vertical: t, $margin: n, $launcherSize: r }) => ro(e, t, n, r + 12)};height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "left" : "right"} ${t}`};
|
|
6051
6064
|
[dir='rtl'] &:not([dir='ltr']),
|
|
6052
6065
|
&[dir='rtl'] {
|
|
6053
6066
|
transform-origin: ${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "right" : "left"} ${t}`};
|
|
6054
6067
|
}
|
|
6055
6068
|
|
|
6056
|
-
${({ $isOpened: e }) => e &&
|
|
6057
|
-
${({ $isExpanded: e }) => e &&
|
|
6058
|
-
`,
|
|
6059
|
-
const [s, i] = C(t), [a, l] = C("end-bottom"), [c, d] = C(oo), [g, f] = C(48), b = nt(), v = b ? Yr :
|
|
6069
|
+
${({ $isOpened: e }) => e && Jg};
|
|
6070
|
+
${({ $isExpanded: e }) => e && Xg};
|
|
6071
|
+
`, Xg = I`width:743px;height:723px;`, Jg = I`z-index:${Ne.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;`, oo = { top: 24, bottom: 24, start: 24, end: 24 }, Qg = Ge(function({ children: e, initialChannelUrl: t, ...n }, r) {
|
|
6072
|
+
const [s, i] = C(t), [a, l] = C("end-bottom"), [c, d] = C(oo), [g, f] = C(48), b = nt(), v = b ? Yr : Yg, { horizontal: _, vertical: E } = ae(() => {
|
|
6060
6073
|
const [u, p] = a.split("-");
|
|
6061
6074
|
return { horizontal: u === "start" ? "start" : "end", vertical: p === "top" ? "top" : "bottom" };
|
|
6062
6075
|
}, [a]);
|
|
6063
6076
|
return /* @__PURE__ */ o.createElement(qr, { enableExpandButton: !b, ref: r, ...n }, /* @__PURE__ */ o.createElement(Tr, null, ({ state: u }) => /* @__PURE__ */ o.createElement(
|
|
6064
|
-
|
|
6077
|
+
jg,
|
|
6065
6078
|
{
|
|
6066
6079
|
value: { horizontal: _, vertical: E, margin: c, launcherSize: g, setPosition: l, setMargin: d, setLauncherSize: f }
|
|
6067
6080
|
},
|
|
@@ -6073,12 +6086,12 @@ const Yg = h.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
6073
6086
|
selectedChannelUrl: s,
|
|
6074
6087
|
setSelectedChannelUrl: i
|
|
6075
6088
|
}
|
|
6076
|
-
)), /* @__PURE__ */ o.createElement(
|
|
6089
|
+
)), /* @__PURE__ */ o.createElement(qg, null), e)
|
|
6077
6090
|
)));
|
|
6078
|
-
}),
|
|
6091
|
+
}), eh = (e) => {
|
|
6079
6092
|
var s, i, a, l;
|
|
6080
6093
|
const { setPosition: t, setMargin: n, setLauncherSize: r } = fn();
|
|
6081
|
-
return
|
|
6094
|
+
return se(() => {
|
|
6082
6095
|
e.position && t(e.position), e.margin && n({ ...oo, ...e.margin }), e.launcherSize && r(e.launcherSize);
|
|
6083
6096
|
}, [
|
|
6084
6097
|
e.position,
|
|
@@ -6088,18 +6101,18 @@ const Yg = h.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
6088
6101
|
(l = e.margin) == null ? void 0 : l.end,
|
|
6089
6102
|
e.launcherSize
|
|
6090
6103
|
]), null;
|
|
6091
|
-
}, eh = ({ children: e }) => {
|
|
6092
|
-
const { setConversationChildren: t } = pn();
|
|
6093
|
-
return oe(() => (t(e), () => t(null)), [e]), null;
|
|
6094
6104
|
}, th = ({ children: e }) => {
|
|
6105
|
+
const { setConversationChildren: t } = pn();
|
|
6106
|
+
return se(() => (t(e), () => t(null)), [e]), null;
|
|
6107
|
+
}, nh = ({ children: e }) => {
|
|
6095
6108
|
const { setConversationListChildren: t } = pn();
|
|
6096
|
-
return
|
|
6097
|
-
},
|
|
6098
|
-
Style:
|
|
6099
|
-
ConversationChildren:
|
|
6100
|
-
ConversationListChildren:
|
|
6101
|
-
}),
|
|
6102
|
-
const { refreshActiveChannel: t } =
|
|
6109
|
+
return se(() => (t(e), () => t(null)), [e]), null;
|
|
6110
|
+
}, Ch = Object.assign(Qg, {
|
|
6111
|
+
Style: eh,
|
|
6112
|
+
ConversationChildren: th,
|
|
6113
|
+
ConversationListChildren: nh
|
|
6114
|
+
}), Sh = (e) => {
|
|
6115
|
+
const { refreshActiveChannel: t } = re(), [n, r] = C(!1), s = B(null), i = B(null);
|
|
6103
6116
|
return P(() => {
|
|
6104
6117
|
n && t().then(() => {
|
|
6105
6118
|
var a;
|
|
@@ -6117,36 +6130,36 @@ export {
|
|
|
6117
6130
|
In as B,
|
|
6118
6131
|
jr as C,
|
|
6119
6132
|
ps as D,
|
|
6120
|
-
|
|
6133
|
+
Ch as F,
|
|
6121
6134
|
Ve as I,
|
|
6122
|
-
|
|
6123
|
-
|
|
6135
|
+
Sg as L,
|
|
6136
|
+
Sd as M,
|
|
6124
6137
|
on as O,
|
|
6125
6138
|
un as P,
|
|
6126
6139
|
sn as S,
|
|
6127
6140
|
qr as a,
|
|
6128
|
-
|
|
6141
|
+
bg as b,
|
|
6129
6142
|
m as c,
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6143
|
+
re as d,
|
|
6144
|
+
xh as e,
|
|
6145
|
+
W as f,
|
|
6146
|
+
xg as g,
|
|
6147
|
+
yh as h,
|
|
6148
|
+
Sh as i,
|
|
6149
|
+
Rm as j,
|
|
6137
6150
|
gn as k,
|
|
6138
6151
|
Ke as l,
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6152
|
+
Bi as m,
|
|
6153
|
+
vh as n,
|
|
6154
|
+
iu as o,
|
|
6155
|
+
oe as p,
|
|
6156
|
+
cg as q,
|
|
6144
6157
|
hn as r,
|
|
6145
6158
|
rt as s,
|
|
6146
|
-
|
|
6159
|
+
_h as t,
|
|
6147
6160
|
Y as u,
|
|
6148
|
-
|
|
6149
|
-
|
|
6161
|
+
Pm as v,
|
|
6162
|
+
Gr as w,
|
|
6150
6163
|
Ee as x,
|
|
6151
6164
|
hr as y,
|
|
6152
6165
|
Ns as z
|