@sendbird/ai-agent-messenger-react 1.2.5 → 1.2.6
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/{DowWpnG0.cjs → 6xTfJrmg.cjs} +1 -1
- package/dist/cjs/{CrKG9A2m.cjs → B4mujFdj.cjs} +1 -1
- package/dist/cjs/{FrkbUcen.cjs → BCrcyCls.cjs} +1 -1
- package/dist/cjs/{CMUqnGWo.cjs → BIDOBNC3.cjs} +1 -1
- package/dist/cjs/{D6uDjEGT.cjs → Bj3vMYQU.cjs} +1 -1
- package/dist/cjs/{FdyX1U8o.cjs → BzMiZszH.cjs} +1 -1
- package/dist/cjs/{CeP-jUfc.cjs → C43J7_wK.cjs} +1 -1
- package/dist/cjs/Cu22Ciyx.cjs +207 -0
- package/dist/cjs/{C1Vn3mTH.cjs → D5dT1ruo.cjs} +1 -1
- package/dist/cjs/{CKKH64uB.cjs → DdQV23MS.cjs} +1 -1
- package/dist/cjs/{CXRPEuG-.cjs → DiTa1fsb.cjs} +1 -1
- package/dist/cjs/{DMo1MF5p.cjs → VJMogId3.cjs} +1 -1
- package/dist/cjs/{B5U4XbGK.cjs → a-ksyTwP.cjs} +1 -1
- package/dist/cjs/{BvIqSXsB.cjs → eFpF2Osy.cjs} +1 -1
- package/dist/cjs/{B-7iTaEa.cjs → kTWMrzTz.cjs} +1 -1
- package/dist/cjs/yVmX6iux.cjs +1 -0
- package/dist/es/{B9V0T5ZP.js → B1s75De5.js} +3 -1
- package/dist/es/{DvjrAXLD.js → BAebVbLs.js} +3 -1
- package/dist/es/{zI14HLvP.js → BKSUGIyL.js} +5 -3
- package/dist/es/{mlHVKYk3.js → C9gbyXV9.js} +1 -1
- package/dist/es/{BQWJPfGp.js → CA1gVgSD.js} +3 -1
- package/dist/es/{BsmWumox.js → CgVCSnu0.js} +1 -1
- package/dist/es/{YRQ0vk5Q.js → D0QwWNMF.js} +3 -1
- package/dist/es/{DPH4j4kU.js → D6MCYXvz.js} +1 -1
- package/dist/es/{ClNlgaQQ.js → D9B38Bwj.js} +1 -1
- package/dist/es/{D_eZyIAR.js → DYR8UT_l.js} +3 -1
- package/dist/es/{7Dvv5RpD.js → DZK-INdk.js} +1 -1
- package/dist/es/{sl-YrKkN.js → DcqbdvlW.js} +3 -1
- package/dist/es/{B8c_rqvH.js → Dxrtj2R8.js} +3 -1
- package/dist/es/{BSz49qaD.js → EylKxx4d.js} +5 -3
- package/dist/es/_EVMCh6Y.js +5 -0
- package/dist/es/{DX0dsMPA.js → xCNV_S78.js} +1266 -1225
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -0
- package/dist/index.js +19 -18
- package/package.json +2 -2
- package/dist/cjs/BokUvJrm.cjs +0 -207
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import
|
|
4
|
-
import u, { css as $, ThemeProvider as
|
|
5
|
-
import { format as
|
|
6
|
-
import { enUS as
|
|
7
|
-
import { AIAgentModule as
|
|
8
|
-
import { useGroupChannelMessages as
|
|
9
|
-
import { GroupChannelModule as
|
|
10
|
-
import { renderer as
|
|
11
|
-
import { createMessageTemplate as
|
|
12
|
-
import
|
|
13
|
-
import { MessageMetaArray as
|
|
14
|
-
import { isSameDay as
|
|
15
|
-
import { createPortal as
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import { createContext as Se, useContext as ne, useEffect as D, useState as S, useId as Cn, useRef as U, useCallback as H, useLayoutEffect as de, forwardRef as Re, useImperativeHandle as _r, lazy as T, Suspense as Oe, useMemo as pe, Component as Sr, Fragment as Ht, useReducer as Tr, Children as wr } from "react";
|
|
3
|
+
import kr, { SendbirdProduct as Ar, DeviceOsPlatform as zt, SendbirdPlatform as Ir, ConnectionHandler as Qe, SendbirdError as $r, SessionHandler as Mr, LogLevel as vn, ConnectionState as Or } from "@sendbird/chat";
|
|
4
|
+
import u, { css as $, ThemeProvider as Lr, useTheme as Ct, createGlobalStyle as Rr, StyleSheetManager as Dr, keyframes as yn } from "styled-components";
|
|
5
|
+
import { format as _n, isSameMinute as Vt, isSameDay as Nr } from "date-fns";
|
|
6
|
+
import { enUS as Pr } from "date-fns/locale/en-US";
|
|
7
|
+
import { AIAgentModule as Fr, ConversationStatus as j, ConversationType as Br } from "@sendbird/chat/aiAgent";
|
|
8
|
+
import { useGroupChannelMessages as Ur, useGroupChannelHandler as Sn, useForceUpdate as Hr } from "@sendbird/uikit-tools";
|
|
9
|
+
import { GroupChannelModule as zr, GroupChannelListOrder as Tn, GroupChannelHandler as Vr } from "@sendbird/chat/groupChannel";
|
|
10
|
+
import { renderer as Wr, parser as Gr, MessageProvider as jr } from "@sendbird/react-uikit-message-template-view";
|
|
11
|
+
import { createMessageTemplate as Kr } from "@sendbird/uikit-message-template";
|
|
12
|
+
import wn from "dompurify";
|
|
13
|
+
import { MessageMetaArray as Zr, SendingStatus as Yr } from "@sendbird/chat/message";
|
|
14
|
+
import { isSameDay as qr } from "date-fns/isSameDay";
|
|
15
|
+
import { createPortal as Jr } from "react-dom";
|
|
16
|
+
import Xr from "@emotion/is-prop-valid";
|
|
17
|
+
var re = /* @__PURE__ */ ((e) => (e.OFF = "off", e.ALWAYS = "always", e.HANDED_OFF_ONLY = "handed_off_only", e))(re || {});
|
|
18
|
+
const Z = (e, t) => {
|
|
19
|
+
const n = Se(null), o = ({ children: s, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof s == "function" ? s(l) : s), i = ({ children: s }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof s == "function" ? s(l) : s : null), a = () => {
|
|
20
|
+
const s = ne(n);
|
|
20
21
|
if (!s)
|
|
21
22
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
22
23
|
return s;
|
|
23
24
|
};
|
|
24
25
|
return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, i.displayName = `${e}Consumer`, a.displayName = `use${e}Context`, { Context: n, Provider: o, Consumer: i, useContext: a };
|
|
25
26
|
};
|
|
26
|
-
function
|
|
27
|
-
const t =
|
|
27
|
+
function Te(e) {
|
|
28
|
+
const t = Se({
|
|
28
29
|
Template: e.template,
|
|
29
30
|
updateTemplate: () => {
|
|
30
31
|
},
|
|
@@ -33,16 +34,16 @@ function we(e) {
|
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
function n({ children: a }) {
|
|
36
|
-
const [s, l] = S(() => e.template), [c, d] = S(e.components),
|
|
37
|
+
const [s, l] = S(() => e.template), [c, d] = S(e.components), h = {
|
|
37
38
|
Template: s,
|
|
38
39
|
updateTemplate: (g) => l(() => g),
|
|
39
40
|
components: c,
|
|
40
41
|
updateComponent: (g, p) => d((x) => ({ ...x, [g]: p }))
|
|
41
42
|
};
|
|
42
|
-
return /* @__PURE__ */ r.createElement(t.Provider, { value:
|
|
43
|
+
return /* @__PURE__ */ r.createElement(t.Provider, { value: h }, a);
|
|
43
44
|
}
|
|
44
45
|
function o({ template: a, children: s }) {
|
|
45
|
-
const { updateTemplate: l } =
|
|
46
|
+
const { updateTemplate: l } = ne(t);
|
|
46
47
|
return D(() => {
|
|
47
48
|
a && l(a);
|
|
48
49
|
}, [a]), /* @__PURE__ */ r.createElement(r.Fragment, null, s);
|
|
@@ -50,29 +51,29 @@ function we(e) {
|
|
|
50
51
|
function i({ children: a }) {
|
|
51
52
|
return /* @__PURE__ */ r.createElement(n, null, a);
|
|
52
53
|
}
|
|
53
|
-
return i.defaults = e, i.useContext = () =>
|
|
54
|
+
return i.defaults = e, i.useContext = () => ne(t), i.Context = t, i.Template = o, Object.keys(e.components).forEach((a) => {
|
|
54
55
|
i[a] = function({
|
|
55
56
|
component: l
|
|
56
57
|
}) {
|
|
57
|
-
const { updateComponent: c } =
|
|
58
|
+
const { updateComponent: c } = ne(t);
|
|
58
59
|
return D(() => {
|
|
59
60
|
l && c(a, l);
|
|
60
61
|
}, [l]), null;
|
|
61
62
|
};
|
|
62
63
|
}), i;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function Qr(...e) {
|
|
65
66
|
return function({ children: n }) {
|
|
66
67
|
return e.reduce((o, i) => /* @__PURE__ */ r.createElement(i, null, o), n);
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function ht() {
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function eo() {
|
|
72
73
|
const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
|
|
73
74
|
return e || t;
|
|
74
75
|
}
|
|
75
|
-
const
|
|
76
|
+
const Wt = (e) => {
|
|
76
77
|
try {
|
|
77
78
|
return JSON.parse(e === "" ? "{}" : e);
|
|
78
79
|
} catch {
|
|
@@ -80,7 +81,7 @@ const Ht = (e) => {
|
|
|
80
81
|
}
|
|
81
82
|
}, et = {
|
|
82
83
|
isStreaming(e) {
|
|
83
|
-
const t =
|
|
84
|
+
const t = Wt(e.data);
|
|
84
85
|
return typeof t == "object" && !!t.stream;
|
|
85
86
|
},
|
|
86
87
|
isWelcomeMessage(e, t) {
|
|
@@ -88,7 +89,7 @@ const Ht = (e) => {
|
|
|
88
89
|
if (((n = e.extendedMessagePayload) == null ? void 0 : n.bot_message_type) === "welcome")
|
|
89
90
|
return !0;
|
|
90
91
|
if ((e.isUserMessage() || e.isFileMessage()) && e.sender.userId === t) {
|
|
91
|
-
const o =
|
|
92
|
+
const o = Wt(e.data);
|
|
92
93
|
return !(o != null && o.respond_mesg_id) && !(o != null && o.stream);
|
|
93
94
|
}
|
|
94
95
|
return !1;
|
|
@@ -98,7 +99,7 @@ const Ht = (e) => {
|
|
|
98
99
|
return ((t = e.extendedMessagePayload) == null ? void 0 : t.bot_message_type) === "generated";
|
|
99
100
|
},
|
|
100
101
|
checkExtendedFieldPresence(e) {
|
|
101
|
-
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(
|
|
102
|
+
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(lt.ui), i = n(lt.trail), a = n(lt.marking);
|
|
102
103
|
return { ui: o, trail: i, marking: a };
|
|
103
104
|
},
|
|
104
105
|
shouldScrollToBottom(e, t, n = !1) {
|
|
@@ -110,17 +111,17 @@ const Ht = (e) => {
|
|
|
110
111
|
}
|
|
111
112
|
return !0;
|
|
112
113
|
}
|
|
113
|
-
},
|
|
114
|
+
}, lt = {
|
|
114
115
|
ui: ["suggested_replies", "cta_button", "message_template", "csat"],
|
|
115
116
|
trail: ["groundedness", "manual", "function_calls"],
|
|
116
117
|
marking: ["is_hallucination", "is_moderated", "flagged_types"]
|
|
117
118
|
};
|
|
118
|
-
class
|
|
119
|
+
class kn {
|
|
119
120
|
constructor(t) {
|
|
120
121
|
this.logger = t, this.subscribers = {};
|
|
121
122
|
}
|
|
122
123
|
async send(t) {
|
|
123
|
-
const n =
|
|
124
|
+
const n = to(), o = this.subscribers[t.type];
|
|
124
125
|
if (o) {
|
|
125
126
|
this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`, t.payload);
|
|
126
127
|
const i = o.map((a) => a(t.payload));
|
|
@@ -137,14 +138,14 @@ class Sn {
|
|
|
137
138
|
this.subscribers[t] && (this.subscribers[t] = this.subscribers[t].filter((o) => o !== n));
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
|
-
const
|
|
141
|
-
let e =
|
|
141
|
+
const to = () => {
|
|
142
|
+
let e = ht, t = ht;
|
|
142
143
|
return { promise: new Promise((o, i) => {
|
|
143
144
|
e = o, t = i;
|
|
144
145
|
}), resolve: e, reject: t };
|
|
145
|
-
},
|
|
146
|
-
var
|
|
147
|
-
class
|
|
146
|
+
}, no = "1.2.6", Ie = "sb-agent", ro = no;
|
|
147
|
+
var An = /* @__PURE__ */ ((e) => (e[e.VERBOSE = 0] = "VERBOSE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.NONE = 5] = "NONE", e))(An || {});
|
|
148
|
+
class In {
|
|
148
149
|
constructor(t) {
|
|
149
150
|
this.level = t;
|
|
150
151
|
}
|
|
@@ -164,24 +165,24 @@ class wn {
|
|
|
164
165
|
this.level <= 4 && console.error(`[${Ie}/error]`, ...t);
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
-
const o =
|
|
168
|
+
function Gt(e, t, n) {
|
|
169
|
+
const o = kr.init({
|
|
169
170
|
appId: e,
|
|
170
|
-
modules: [new
|
|
171
|
+
modules: [new zr(), new Fr()],
|
|
171
172
|
localCacheEnabled: !0,
|
|
172
173
|
...n
|
|
173
174
|
});
|
|
174
175
|
return o.addSendbirdExtensions(
|
|
175
|
-
[{ version:
|
|
176
|
+
[{ version: ro, product: Ar.AI_AGENT, platform: t.platform }],
|
|
176
177
|
{ platform: t.deviceOSPlatform, version: t.deviceOSVersion },
|
|
177
178
|
t.customData
|
|
178
179
|
) || console.warn("Invalid Sendbird Extensions", t), o;
|
|
179
180
|
}
|
|
180
181
|
const {
|
|
181
|
-
Provider:
|
|
182
|
+
Provider: oo,
|
|
182
183
|
useContext: tt
|
|
183
|
-
} =
|
|
184
|
-
function
|
|
184
|
+
} = Z("AIAgent");
|
|
185
|
+
function io({
|
|
185
186
|
appId: e,
|
|
186
187
|
aiAgentId: t,
|
|
187
188
|
language: n,
|
|
@@ -192,13 +193,13 @@ function oo({
|
|
|
192
193
|
children: l,
|
|
193
194
|
logger: c,
|
|
194
195
|
dispatcher: d,
|
|
195
|
-
extensions:
|
|
196
|
-
platform:
|
|
197
|
-
deviceOSPlatform:
|
|
196
|
+
extensions: h = {
|
|
197
|
+
platform: Ir.JS,
|
|
198
|
+
deviceOSPlatform: eo() ? zt.MOBILE_WEB : zt.WEB
|
|
198
199
|
}
|
|
199
200
|
}) {
|
|
200
201
|
const [g, p] = S(() => {
|
|
201
|
-
const x = c ?? new
|
|
202
|
+
const x = c ?? new In(An.WARN), b = d ?? new kn(x);
|
|
202
203
|
return {
|
|
203
204
|
appId: e,
|
|
204
205
|
aiAgentId: t,
|
|
@@ -206,32 +207,32 @@ function oo({
|
|
|
206
207
|
countryCode: o,
|
|
207
208
|
context: i,
|
|
208
209
|
logger: x,
|
|
209
|
-
dispatcher:
|
|
210
|
-
chatSDK: a ??
|
|
210
|
+
dispatcher: b,
|
|
211
|
+
chatSDK: a ?? Gt(e, h, s)
|
|
211
212
|
};
|
|
212
213
|
});
|
|
213
214
|
return D(() => {
|
|
214
215
|
p((x) => {
|
|
215
|
-
let
|
|
216
|
-
return c && c !== x.logger && (
|
|
216
|
+
let b = x.logger, E = x.dispatcher, f = x.chatSDK;
|
|
217
|
+
return c && c !== x.logger && (b = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? f = a : !a && x.chatSDK.appId !== e && (f = Gt(e, h, { newInstance: !0, ...s })), {
|
|
217
218
|
...x,
|
|
218
219
|
appId: e,
|
|
219
220
|
aiAgentId: t,
|
|
220
221
|
language: n,
|
|
221
222
|
countryCode: o,
|
|
222
223
|
context: i,
|
|
223
|
-
logger:
|
|
224
|
+
logger: b,
|
|
224
225
|
dispatcher: E,
|
|
225
|
-
chatSDK:
|
|
226
|
+
chatSDK: f
|
|
226
227
|
};
|
|
227
228
|
});
|
|
228
229
|
}, [e, t, n, o, i, c, d, a]), D(() => () => {
|
|
229
230
|
g.chatSDK.disconnectWebSocket();
|
|
230
|
-
}, [g.chatSDK]), /* @__PURE__ */ r.createElement(
|
|
231
|
+
}, [g.chatSDK]), /* @__PURE__ */ r.createElement(oo, { value: g }, l);
|
|
231
232
|
}
|
|
232
|
-
const
|
|
233
|
-
var
|
|
234
|
-
class
|
|
233
|
+
const so = (e, t, n) => Ur(e, t, { ...n, strictStreamingOrder: !0 });
|
|
234
|
+
var gt = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(gt || {});
|
|
235
|
+
class ao {
|
|
235
236
|
constructor(t = {}) {
|
|
236
237
|
this.payload = t;
|
|
237
238
|
}
|
|
@@ -239,18 +240,18 @@ class so {
|
|
|
239
240
|
return JSON.stringify({ type: this.type, payload: this.payload });
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
|
-
const
|
|
243
|
-
CloseConversation: (e) => new
|
|
243
|
+
const lo = {
|
|
244
|
+
CloseConversation: (e) => new co(e)
|
|
244
245
|
};
|
|
245
|
-
class
|
|
246
|
+
class co extends ao {
|
|
246
247
|
constructor() {
|
|
247
248
|
super(...arguments), this.type = "conv.close";
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
251
|
const {
|
|
251
|
-
Provider:
|
|
252
|
-
} =
|
|
253
|
-
function
|
|
252
|
+
Provider: uo
|
|
253
|
+
} = Z("AIAgentConversation");
|
|
254
|
+
function mo({
|
|
254
255
|
children: e,
|
|
255
256
|
channelUrl: t,
|
|
256
257
|
onChannelDeleted: n,
|
|
@@ -258,10 +259,10 @@ function uo({
|
|
|
258
259
|
onMessagesUpdated: i,
|
|
259
260
|
onConversationClosedViaDispatcher: a,
|
|
260
261
|
onBeforeSendMessage: s,
|
|
261
|
-
onAfterSendMessage: l =
|
|
262
|
+
onAfterSendMessage: l = ht
|
|
262
263
|
}) {
|
|
263
|
-
var
|
|
264
|
-
const { chatSDK: c, logger: d, dispatcher:
|
|
264
|
+
var f;
|
|
265
|
+
const { chatSDK: c, logger: d, dispatcher: h } = tt(), { channel: g, channelFetchError: p, fetchChannel: x } = ho(t), b = so(c, g, {
|
|
265
266
|
shouldCountNewMessages: () => !1,
|
|
266
267
|
onChannelDeleted: n,
|
|
267
268
|
onMessagesReceived: (C) => o == null ? void 0 : o(C),
|
|
@@ -270,13 +271,13 @@ function uo({
|
|
|
270
271
|
});
|
|
271
272
|
D(() => {
|
|
272
273
|
const C = async (y) => {
|
|
273
|
-
const
|
|
274
|
-
g &&
|
|
274
|
+
const k = typeof (y == null ? void 0 : y.channelUrl) == "string";
|
|
275
|
+
g && k && y.channelUrl !== g.url || (d.debug("conversation.dispatcher: try to close conversation", g), g != null && g.conversation && g.conversation.status === j.OPEN && (await g.closeConversation(), a == null || a()));
|
|
275
276
|
};
|
|
276
|
-
return
|
|
277
|
-
|
|
277
|
+
return h.subscribe(gt.ConversationClose, C), () => {
|
|
278
|
+
h.unsubscribe(gt.ConversationClose, C);
|
|
278
279
|
};
|
|
279
|
-
}, [
|
|
280
|
+
}, [h, (f = g == null ? void 0 : g.conversation) == null ? void 0 : f.status, a]);
|
|
280
281
|
const E = {
|
|
281
282
|
conversation: (g == null ? void 0 : g.conversation) ?? void 0,
|
|
282
283
|
channelSource: {
|
|
@@ -285,31 +286,31 @@ function uo({
|
|
|
285
286
|
refetch: () => x()
|
|
286
287
|
},
|
|
287
288
|
messageSource: {
|
|
288
|
-
messages:
|
|
289
|
-
initialized:
|
|
290
|
-
loadPrevious: () =>
|
|
291
|
-
loadNext: () =>
|
|
289
|
+
messages: b.messages,
|
|
290
|
+
initialized: b.initialized,
|
|
291
|
+
loadPrevious: () => b.loadPrevious(),
|
|
292
|
+
loadNext: () => b.loadNext(),
|
|
292
293
|
sendUserMessage: async (C) => {
|
|
293
|
-
var
|
|
294
|
-
if (((
|
|
294
|
+
var k;
|
|
295
|
+
if (((k = g == null ? void 0 : g.conversation) == null ? void 0 : k.status) === j.CLOSED)
|
|
295
296
|
throw new Error("Conversation is closed");
|
|
296
297
|
s && (C = await s(C));
|
|
297
|
-
const y = await
|
|
298
|
+
const y = await b.sendUserMessage(C, l);
|
|
298
299
|
return l == null || l(y), y;
|
|
299
300
|
},
|
|
300
301
|
sendFileMessage: async (C) => {
|
|
301
|
-
var
|
|
302
|
-
if (((
|
|
302
|
+
var k;
|
|
303
|
+
if (((k = g == null ? void 0 : g.conversation) == null ? void 0 : k.status) === j.CLOSED)
|
|
303
304
|
throw new Error("Conversation is closed");
|
|
304
305
|
s && (C = await s(C));
|
|
305
|
-
const y = await
|
|
306
|
+
const y = await b.sendFileMessage(C, l);
|
|
306
307
|
return l == null || l(y), y;
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
310
|
};
|
|
310
|
-
return /* @__PURE__ */ r.createElement(
|
|
311
|
+
return /* @__PURE__ */ r.createElement(uo, { value: E }, e);
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
+
function ho(e) {
|
|
313
314
|
const { chatSDK: t, logger: n } = tt(), [o, i] = S(void 0), [a, s] = S(void 0);
|
|
314
315
|
async function l() {
|
|
315
316
|
if (n.debug("conversation.fetchChannel: start"), i(void 0), s(void 0), e)
|
|
@@ -320,7 +321,7 @@ function mo(e) {
|
|
|
320
321
|
const d = new Qe({ onReconnectSucceeded: () => c.refresh() });
|
|
321
322
|
t.addConnectionHandler("sba-refresh", d), n.debug("conversation.fetchChannel: fetched channel", c);
|
|
322
323
|
} catch (c) {
|
|
323
|
-
c instanceof
|
|
324
|
+
c instanceof $r && s(c), n.error("conversation.fetchChannel: error", c);
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
327
|
return D(() => {
|
|
@@ -331,7 +332,7 @@ function mo(e) {
|
|
|
331
332
|
fetchChannel: l
|
|
332
333
|
};
|
|
333
334
|
}
|
|
334
|
-
class
|
|
335
|
+
class go {
|
|
335
336
|
/**
|
|
336
337
|
* Creates a new ConversationListCollection instance.
|
|
337
338
|
* @param sdk - The Sendbird Chat SDK instance
|
|
@@ -339,14 +340,14 @@ class ho {
|
|
|
339
340
|
*/
|
|
340
341
|
constructor(t, { filter: n, limit: o = 20 }) {
|
|
341
342
|
var i, a, s, l, c;
|
|
342
|
-
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order =
|
|
343
|
+
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order = Tn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
|
|
343
344
|
aiAgentChannelFilter: (i = this.filter) == null ? void 0 : i.aiAgentChannelFilter,
|
|
344
345
|
aiAgentConversationStatusFilter: (a = this.filter) == null ? void 0 : a.aiAgentConversationStatusFilter,
|
|
345
346
|
aiAgentIds: (s = this.filter) == null ? void 0 : s.aiAgentIds,
|
|
346
347
|
deskChannelFilter: (l = this.filter) == null ? void 0 : l.deskChannelFilter,
|
|
347
348
|
pinnedChannelUrls: (c = this.filter) == null ? void 0 : c.pinnedChannelUrls,
|
|
348
349
|
limit: this._limit
|
|
349
|
-
}), this._token = "", this._timestamp = Number.MAX_SAFE_INTEGER, this._isSyncing = !1, this._channelHandler = new
|
|
350
|
+
}), this._token = "", this._timestamp = Number.MAX_SAFE_INTEGER, this._isSyncing = !1, this._channelHandler = new Vr({
|
|
350
351
|
onChannelChanged: (d) => {
|
|
351
352
|
d.isGroupChannel() && (this._query.belongsTo(d) ? this._addChannelsToView([d], !1) : this._removeChannelsFromView([d.url]));
|
|
352
353
|
},
|
|
@@ -408,9 +409,9 @@ class ho {
|
|
|
408
409
|
}
|
|
409
410
|
const d = o.get(c.url);
|
|
410
411
|
if (d === void 0) continue;
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
const p = this._pinnedChannels.findIndex((
|
|
412
|
+
const h = pt(this._pinnedChannels, c);
|
|
413
|
+
h >= 0 ? (this._pinnedChannels.splice(h, 1), a.push(c)) : i.push(c);
|
|
414
|
+
const p = this._pinnedChannels.findIndex((b) => (o.get(b.url) ?? 1 / 0) > d), x = p === -1 ? this._pinnedChannels.length : p;
|
|
414
415
|
this._pinnedChannels.splice(x, 0, c);
|
|
415
416
|
}
|
|
416
417
|
return { addedChannels: i, updatedChannels: a, unmatchedChannelUrls: s };
|
|
@@ -428,10 +429,10 @@ class ho {
|
|
|
428
429
|
o.push(s.url);
|
|
429
430
|
continue;
|
|
430
431
|
}
|
|
431
|
-
const l =
|
|
432
|
+
const l = pt(this._channels, s), c = l < 0;
|
|
432
433
|
!c && this._channels.splice(l, 1);
|
|
433
|
-
const
|
|
434
|
-
c ? g ? (n || !this.hasMore) && (this._channels.push(s), i.push(s)) : (this._channels.splice(
|
|
434
|
+
const h = po(this._channels, s, this._order).place, g = h === this._channels.length;
|
|
435
|
+
c ? g ? (n || !this.hasMore) && (this._channels.push(s), i.push(s)) : (this._channels.splice(h, 0, s), i.push(s)) : (this._channels.splice(h, 0, s), a.push(s));
|
|
435
436
|
}
|
|
436
437
|
return { addedChannels: i, updatedChannels: a, unmatchedChannelUrls: o };
|
|
437
438
|
}
|
|
@@ -441,12 +442,12 @@ class ho {
|
|
|
441
442
|
* @param forceAppend - Whether to force append channels at the end
|
|
442
443
|
*/
|
|
443
444
|
_addChannelsToView(t, n = !1) {
|
|
444
|
-
var g, p, x,
|
|
445
|
+
var g, p, x, b, E;
|
|
445
446
|
const o = new Set(((g = this.filter) == null ? void 0 : g.pinnedChannelUrls) ?? []), i = [], a = [];
|
|
446
|
-
for (const
|
|
447
|
-
o.has(
|
|
448
|
-
const s = this._upsertPinnedChannelsToArray(i), l = this._upsertRegularChannelsToArray(a, n), c = s.addedChannels.concat(l.addedChannels), d = s.updatedChannels.concat(l.updatedChannels),
|
|
449
|
-
c.length > 0 && ((x = (p = this._collectionEventHandler) == null ? void 0 : p.onChannelsAdded) == null || x.call(p, {}, c)), d.length > 0 && ((E = (
|
|
447
|
+
for (const f of t)
|
|
448
|
+
o.has(f.url) ? i.push(f) : a.push(f);
|
|
449
|
+
const s = this._upsertPinnedChannelsToArray(i), l = this._upsertRegularChannelsToArray(a, n), c = s.addedChannels.concat(l.addedChannels), d = s.updatedChannels.concat(l.updatedChannels), h = s.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);
|
|
450
|
+
c.length > 0 && ((x = (p = this._collectionEventHandler) == null ? void 0 : p.onChannelsAdded) == null || x.call(p, {}, c)), d.length > 0 && ((E = (b = this._collectionEventHandler) == null ? void 0 : b.onChannelsUpdated) == null || E.call(b, {}, d)), h.length > 0 && this._removeChannelsFromView(h);
|
|
450
451
|
}
|
|
451
452
|
/**
|
|
452
453
|
* Removes channels from the collection by their URLs.
|
|
@@ -507,12 +508,12 @@ class ho {
|
|
|
507
508
|
this._isDisposed || (this._isDisposed = !0, this._collectionEventHandler = void 0, this._sdk.removeConnectionHandler(this._handlerId), this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId), this._pinnedChannels.length = 0, this._channels.length = 0);
|
|
508
509
|
}
|
|
509
510
|
}
|
|
510
|
-
const
|
|
511
|
+
const pt = (e, t) => e.findIndex((n) => n.isIdentical(t)), po = (e, t, n) => {
|
|
511
512
|
if (e.length > 0) {
|
|
512
|
-
const o =
|
|
513
|
+
const o = pt(e, t);
|
|
513
514
|
let i = 0, a = e.length - 1, s = Math.floor((i + a) / 2);
|
|
514
515
|
for (; i < a; ) {
|
|
515
|
-
const c =
|
|
516
|
+
const c = jt(e[s], t, n);
|
|
516
517
|
if (c > 0)
|
|
517
518
|
a = s, s = Math.floor((i + a) / 2);
|
|
518
519
|
else if (c < 0)
|
|
@@ -520,12 +521,12 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
520
521
|
else
|
|
521
522
|
return { place: s, oldPosition: o };
|
|
522
523
|
}
|
|
523
|
-
return { place:
|
|
524
|
+
return { place: jt(e[s], t, n) >= 0 ? s : s + 1, oldPosition: o };
|
|
524
525
|
}
|
|
525
526
|
return { place: e.length, oldPosition: -1 };
|
|
526
|
-
},
|
|
527
|
+
}, jt = (e, t, n) => {
|
|
527
528
|
switch (n) {
|
|
528
|
-
case
|
|
529
|
+
case Tn.LATEST_LAST_MESSAGE:
|
|
529
530
|
if (e.lastMessage && t.lastMessage) {
|
|
530
531
|
const o = t.lastMessage.createdAt - e.lastMessage.createdAt;
|
|
531
532
|
return o === 0 ? t.createdAt - e.createdAt : o;
|
|
@@ -534,14 +535,14 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
534
535
|
return 0;
|
|
535
536
|
}
|
|
536
537
|
};
|
|
537
|
-
function
|
|
538
|
-
var
|
|
539
|
-
const n =
|
|
538
|
+
function fo(e, t) {
|
|
539
|
+
var b, E, f, C, y, k, _, Y;
|
|
540
|
+
const n = Cn(), [o, i] = S(!1), [a, s] = S(null), [l, c] = S([]), [d, h] = S(null), g = U(!1), p = H(async () => {
|
|
540
541
|
if (!g.current && e.currentUser) {
|
|
541
542
|
g.current = !0, i(!1), s(null), c([]);
|
|
542
543
|
try {
|
|
543
544
|
d == null || d.dispose();
|
|
544
|
-
const L = new
|
|
545
|
+
const L = new go(e, t);
|
|
545
546
|
L.setConversationListCollectionHandler({
|
|
546
547
|
onChannelsAdded: () => {
|
|
547
548
|
c(L.channels);
|
|
@@ -552,22 +553,22 @@ function po(e, t) {
|
|
|
552
553
|
onChannelsDeleted: () => {
|
|
553
554
|
c(L.channels);
|
|
554
555
|
}
|
|
555
|
-
}), await L.loadMore(),
|
|
556
|
+
}), await L.loadMore(), h(L), s(null);
|
|
556
557
|
} catch (L) {
|
|
557
|
-
|
|
558
|
+
h(null), s(L);
|
|
558
559
|
} finally {
|
|
559
560
|
i(!0), g.current = !1;
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
563
|
}, [
|
|
563
564
|
e,
|
|
564
|
-
(
|
|
565
|
-
(
|
|
565
|
+
(b = t.filter) == null ? void 0 : b.aiAgentChannelFilter,
|
|
566
|
+
(f = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : f.join(),
|
|
566
567
|
(y = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : y.join(),
|
|
567
|
-
(
|
|
568
|
-
(
|
|
568
|
+
(k = t.filter) == null ? void 0 : k.deskChannelFilter,
|
|
569
|
+
(Y = (_ = t.filter) == null ? void 0 : _.pinnedChannelUrls) == null ? void 0 : Y.join(),
|
|
569
570
|
t.limit
|
|
570
|
-
]), x =
|
|
571
|
+
]), x = H(async () => {
|
|
571
572
|
if (d)
|
|
572
573
|
try {
|
|
573
574
|
await d.loadMore();
|
|
@@ -587,13 +588,13 @@ function po(e, t) {
|
|
|
587
588
|
};
|
|
588
589
|
}
|
|
589
590
|
const {
|
|
590
|
-
Provider:
|
|
591
|
-
} =
|
|
592
|
-
function
|
|
593
|
-
const { chatSDK: n, aiAgentId: o } = tt(), i =
|
|
591
|
+
Provider: bo
|
|
592
|
+
} = Z("AIAgentConversationList");
|
|
593
|
+
function xo({ conversationListFilter: e, children: t }) {
|
|
594
|
+
const { chatSDK: n, aiAgentId: o } = tt(), i = fo(n, {
|
|
594
595
|
filter: {
|
|
595
596
|
aiAgentIds: [o],
|
|
596
|
-
aiAgentConversationStatusFilter: [
|
|
597
|
+
aiAgentConversationStatusFilter: [j.CLOSED],
|
|
597
598
|
...e
|
|
598
599
|
}
|
|
599
600
|
}), a = {
|
|
@@ -604,18 +605,18 @@ function bo({ conversationListFilter: e, children: t }) {
|
|
|
604
605
|
loadMore: () => i.loadMore()
|
|
605
606
|
}
|
|
606
607
|
};
|
|
607
|
-
return /* @__PURE__ */ r.createElement(
|
|
608
|
+
return /* @__PURE__ */ r.createElement(bo, { value: a }, t);
|
|
608
609
|
}
|
|
609
|
-
const
|
|
610
|
+
const ft = {
|
|
610
611
|
DEFAULT_BOT_MSG_BG: "#eeeeee",
|
|
611
612
|
WHITE: "#ffffff",
|
|
612
613
|
BLACK: "#000000"
|
|
613
614
|
};
|
|
614
|
-
function
|
|
615
|
+
function $n(e) {
|
|
615
616
|
return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
-
const t =
|
|
618
|
+
function Eo(e) {
|
|
619
|
+
const t = $n(e);
|
|
619
620
|
return [
|
|
620
621
|
parseInt(t.slice(1, 3), 16),
|
|
621
622
|
// r
|
|
@@ -625,33 +626,33 @@ function xo(e) {
|
|
|
625
626
|
// b
|
|
626
627
|
];
|
|
627
628
|
}
|
|
628
|
-
function
|
|
629
|
+
function Co(e) {
|
|
629
630
|
return `#${e.map((t) => t.toString(16).padStart(2, "0")).join("")}`;
|
|
630
631
|
}
|
|
631
|
-
function
|
|
632
|
+
function vo(e, t, n) {
|
|
632
633
|
e /= 255, t /= 255, n /= 255;
|
|
633
634
|
const o = Math.max(e, t, n), i = Math.min(e, t, n), a = o - i;
|
|
634
635
|
let s = 0, l = 0;
|
|
635
636
|
const c = (o + i) / 2;
|
|
636
637
|
return o !== i && (l = c > 0.5 ? a / (2 - o - i) : a / (o + i)), o === e ? s = (t - n) / a + (t < n ? 6 : 0) : o === t ? s = (n - e) / a + 2 : o === n && (s = (e - t) / a + 4), s /= 6, [s, l, c];
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
+
function yo(e, t, n) {
|
|
639
640
|
let o, i, a;
|
|
640
641
|
if (t === 0)
|
|
641
642
|
o = i = a = n;
|
|
642
643
|
else {
|
|
643
|
-
const s = function(
|
|
644
|
-
return p < 0 && (p += 1), p > 1 && (p -= 1), p < 0.16666666666666666 ?
|
|
644
|
+
const s = function(h, g, p) {
|
|
645
|
+
return p < 0 && (p += 1), p > 1 && (p -= 1), p < 0.16666666666666666 ? h + (g - h) * 6 * p : p < 0.5 ? g : p < 0.6666666666666666 ? h + (g - h) * (0.6666666666666666 - p) * 6 : h;
|
|
645
646
|
}, l = n < 0.5 ? n * (1 + t) : n + t - n * t, c = 2 * n - l;
|
|
646
647
|
o = s(c, l, e + 1 / 3), i = s(c, l, e), a = s(c, l, e - 1 / 3);
|
|
647
648
|
}
|
|
648
649
|
return [Math.round(o * 255), Math.round(i * 255), Math.round(a * 255)];
|
|
649
650
|
}
|
|
650
651
|
function He(e, t, n) {
|
|
651
|
-
const [o, i, a] =
|
|
652
|
-
return
|
|
652
|
+
const [o, i, a] = Eo(e), [s, l, c] = vo(o, i, a), d = Math.max(0, Math.min(1, c * t)), h = Math.max(0, Math.min(1, l * n)), [g, p, x] = yo(s, h, d);
|
|
653
|
+
return Co([Math.round(g), Math.round(p), Math.round(x)]);
|
|
653
654
|
}
|
|
654
|
-
function
|
|
655
|
+
function _o(e, t = "light") {
|
|
655
656
|
return {
|
|
656
657
|
extraDark: He(e, 0.6, 1.2),
|
|
657
658
|
dark: He(e, 0.85, 1.1),
|
|
@@ -660,11 +661,11 @@ function yo(e, t = "light") {
|
|
|
660
661
|
extraLight: He(e, t === "dark" ? 1.2 : 1.75, t === "dark" ? 0.9 : 0.8)
|
|
661
662
|
};
|
|
662
663
|
}
|
|
663
|
-
function
|
|
664
|
-
const t =
|
|
665
|
-
return o * 0.299 + i * 0.587 + a * 0.114 > n ?
|
|
664
|
+
function bt(e) {
|
|
665
|
+
const t = $n(e), n = 149, o = +`0x${t[1]}${t[2]}`, i = +`0x${t[3]}${t[4]}`, a = +`0x${t[5]}${t[6]}`;
|
|
666
|
+
return o * 0.299 + i * 0.587 + a * 0.114 > n ? ft.BLACK : ft.WHITE;
|
|
666
667
|
}
|
|
667
|
-
function
|
|
668
|
+
function So(e, t, n, o, i) {
|
|
668
669
|
return {
|
|
669
670
|
base: {
|
|
670
671
|
primary: t,
|
|
@@ -693,7 +694,7 @@ function _o(e, t, n, o, i) {
|
|
|
693
694
|
}
|
|
694
695
|
};
|
|
695
696
|
}
|
|
696
|
-
const
|
|
697
|
+
const To = (e, t, n, o, i) => ({
|
|
697
698
|
base: {
|
|
698
699
|
primary: t,
|
|
699
700
|
primaryContrastContent: n,
|
|
@@ -772,7 +773,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
772
773
|
dark: "rgba(0, 0, 0, 0.55)",
|
|
773
774
|
light: "rgba(22, 22, 22, 0.32)"
|
|
774
775
|
}
|
|
775
|
-
},
|
|
776
|
+
}, ct = {
|
|
776
777
|
h1: { fontSize: 18, fontWeight: 700 },
|
|
777
778
|
h2: { fontSize: 16, fontWeight: 700 },
|
|
778
779
|
subtitle1: { fontSize: 16, fontWeight: 500 },
|
|
@@ -786,8 +787,8 @@ const So = (e, t, n, o, i) => ({
|
|
|
786
787
|
caption3: { fontSize: 11, fontWeight: 700 },
|
|
787
788
|
caption4: { fontSize: 11, fontWeight: 400 }
|
|
788
789
|
};
|
|
789
|
-
function
|
|
790
|
-
const t =
|
|
790
|
+
function Kt(e) {
|
|
791
|
+
const t = wo(e), { colors: n, aiAgentColorVariables: o } = ko(e, t), i = Io(e);
|
|
791
792
|
return {
|
|
792
793
|
selectedTheme: e.selectedTheme,
|
|
793
794
|
palette: t,
|
|
@@ -796,18 +797,18 @@ function Wt(e) {
|
|
|
796
797
|
typography: i
|
|
797
798
|
};
|
|
798
799
|
}
|
|
799
|
-
function
|
|
800
|
-
const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary :
|
|
800
|
+
function wo({ selectedTheme: e, palette: t, primary: n }) {
|
|
801
|
+
const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary : _o(n, e) : ze.primary;
|
|
801
802
|
return {
|
|
802
803
|
...ze,
|
|
803
804
|
primary: o,
|
|
804
805
|
...t
|
|
805
806
|
};
|
|
806
807
|
}
|
|
807
|
-
function
|
|
808
|
-
const a = i.primary.main, s = t ??
|
|
808
|
+
function ko({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, i) {
|
|
809
|
+
const a = i.primary.main, s = t ?? bt(a), l = n ?? ft.DEFAULT_BOT_MSG_BG, c = o ?? bt(l);
|
|
809
810
|
return {
|
|
810
|
-
colors: (e === "light" ?
|
|
811
|
+
colors: (e === "light" ? So : To)(
|
|
811
812
|
i,
|
|
812
813
|
a,
|
|
813
814
|
s,
|
|
@@ -822,57 +823,57 @@ function wo({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, bot
|
|
|
822
823
|
}
|
|
823
824
|
};
|
|
824
825
|
}
|
|
825
|
-
function
|
|
826
|
+
function Ao(e, t, n) {
|
|
826
827
|
const o = { ...e };
|
|
827
828
|
return n.forEach((i) => {
|
|
828
829
|
const a = t[i];
|
|
829
830
|
a != null && (o[i] = a);
|
|
830
831
|
}), o;
|
|
831
832
|
}
|
|
832
|
-
function
|
|
833
|
+
function Io({ typography: e }) {
|
|
833
834
|
if (!e)
|
|
834
|
-
return
|
|
835
|
-
const t = { ...
|
|
835
|
+
return ct;
|
|
836
|
+
const t = { ...ct };
|
|
836
837
|
return Object.keys(e).forEach((n) => {
|
|
837
838
|
const o = e[n];
|
|
838
839
|
if (o && typeof o == "object") {
|
|
839
|
-
const i =
|
|
840
|
-
t[n] =
|
|
840
|
+
const i = ct[n], a = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
|
|
841
|
+
t[n] = Ao(i, o, a);
|
|
841
842
|
}
|
|
842
843
|
}), t;
|
|
843
844
|
}
|
|
844
845
|
const {
|
|
845
|
-
Provider:
|
|
846
|
-
useContext:
|
|
847
|
-
} =
|
|
848
|
-
function
|
|
846
|
+
Provider: $o,
|
|
847
|
+
useContext: vt
|
|
848
|
+
} = Z("AIAgentTheme");
|
|
849
|
+
function Mo({ logger: e, palette: t, typography: n, appearance: o, children: i }) {
|
|
849
850
|
const [a, s] = S(
|
|
850
|
-
() =>
|
|
851
|
+
() => Kt({
|
|
851
852
|
selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
|
|
852
853
|
palette: t,
|
|
853
854
|
typography: n,
|
|
854
855
|
primary: o == null ? void 0 : o.primaryColor,
|
|
855
856
|
botMessageBackground: o == null ? void 0 : o.botMessageBackgroundColor
|
|
856
857
|
})
|
|
857
|
-
), l =
|
|
858
|
+
), l = H(
|
|
858
859
|
(c, d) => {
|
|
859
|
-
const
|
|
860
|
+
const h = (o == null ? void 0 : o.theme) ?? c, g = d == null ? void 0 : d(h), p = {
|
|
860
861
|
primary: o == null ? void 0 : o.primaryColor,
|
|
861
862
|
primaryContrast: void 0,
|
|
862
863
|
botMessageBackground: o == null ? void 0 : o.botMessageBackgroundColor,
|
|
863
864
|
botMessageBackgroundContrast: void 0
|
|
864
865
|
};
|
|
865
866
|
!p.primary && (g != null && g.primaryColor) && (p.primary = g.primaryColor, p.primaryContrast = g.primaryContrastColor), !p.botMessageBackground && (g != null && g.botMessageBackgroundColor) && (p.botMessageBackground = g.botMessageBackgroundColor, p.botMessageBackgroundContrast = g.botMessageBackgroundContrastColor);
|
|
866
|
-
const x =
|
|
867
|
-
s(x), e == null || e.info("theme.update:",
|
|
867
|
+
const x = Kt({ selectedTheme: h, palette: t, typography: n, ...p });
|
|
868
|
+
s(x), e == null || e.info("theme.update:", h);
|
|
868
869
|
},
|
|
869
870
|
[o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor, t, n, e]
|
|
870
871
|
);
|
|
871
872
|
return D(() => {
|
|
872
873
|
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(a.selectedTheme);
|
|
873
|
-
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(
|
|
874
|
+
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement($o, { value: { theme: a, updateTheme: l } }, i);
|
|
874
875
|
}
|
|
875
|
-
const
|
|
876
|
+
const Mn = (e) => {
|
|
876
877
|
try {
|
|
877
878
|
const t = JSON.parse(e);
|
|
878
879
|
return typeof t == "string" ? JSON.stringify(t).slice(1, -1) : e.trim();
|
|
@@ -880,11 +881,11 @@ const In = (e) => {
|
|
|
880
881
|
return JSON.stringify(e).slice(1, -1);
|
|
881
882
|
}
|
|
882
883
|
}, De = (e) => JSON.parse(e), nt = (e) => JSON.parse(e);
|
|
883
|
-
function
|
|
884
|
+
function Oo(e, t) {
|
|
884
885
|
const [n, o] = t.split(",").map((i) => i.trim());
|
|
885
886
|
return e === "dark" && o || n;
|
|
886
887
|
}
|
|
887
|
-
function
|
|
888
|
+
function Lo(e) {
|
|
888
889
|
const t = {};
|
|
889
890
|
function n(o, i = "") {
|
|
890
891
|
for (const [a, s] of Object.entries(o)) {
|
|
@@ -894,7 +895,7 @@ function Oo(e) {
|
|
|
894
895
|
}
|
|
895
896
|
return n(e), t;
|
|
896
897
|
}
|
|
897
|
-
function
|
|
898
|
+
function yt({
|
|
898
899
|
template: e,
|
|
899
900
|
variables: t,
|
|
900
901
|
variableKeyPattern: n,
|
|
@@ -902,12 +903,12 @@ function Ct({
|
|
|
902
903
|
}) {
|
|
903
904
|
return Object.entries(t).reduce((i, [a, s]) => {
|
|
904
905
|
if (!o && !["number", "boolean", "string"].includes(typeof s))
|
|
905
|
-
throw new Error(
|
|
906
|
+
throw new Error(`If transformer is not provided, value(${a}:${s}) must be a {string, number, or boolean}`);
|
|
906
907
|
const l = o ? o(s) : String(s), c = n(a);
|
|
907
|
-
return i.replace(c,
|
|
908
|
+
return i.replace(c, Mn(l));
|
|
908
909
|
}, e);
|
|
909
910
|
}
|
|
910
|
-
async function
|
|
911
|
+
async function Ro({
|
|
911
912
|
template: e,
|
|
912
913
|
variables: t,
|
|
913
914
|
variableKeyPattern: n,
|
|
@@ -918,35 +919,35 @@ async function Lo({
|
|
|
918
919
|
const l = await o(s);
|
|
919
920
|
return { regex: n(a), transformedValue: l };
|
|
920
921
|
})
|
|
921
|
-
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s,
|
|
922
|
+
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s, Mn(l)), e);
|
|
922
923
|
}
|
|
923
|
-
const
|
|
924
|
+
const Do = (e) => ({
|
|
924
925
|
setTemplate: (t, n) => e.onSetTemplate(t, n),
|
|
925
926
|
getTemplate: (t) => e.onGetTemplate(t),
|
|
926
927
|
setCachedToken: (t) => e.onSetCachedToken(t),
|
|
927
928
|
getCachedToken: () => e.onGetCachedToken(),
|
|
928
929
|
clear: () => e.onClear()
|
|
929
930
|
}), {
|
|
930
|
-
Provider:
|
|
931
|
-
useContext:
|
|
932
|
-
} =
|
|
933
|
-
function
|
|
934
|
-
const o =
|
|
931
|
+
Provider: No,
|
|
932
|
+
useContext: On
|
|
933
|
+
} = Z("MessageCacheTemplate");
|
|
934
|
+
function Po({ logger: e, storage: t, children: n }) {
|
|
935
|
+
const o = H(
|
|
935
936
|
(s) => {
|
|
936
|
-
var d,
|
|
937
|
-
const l = (
|
|
937
|
+
var d, h;
|
|
938
|
+
const l = (h = (d = s.appInfo) == null ? void 0 : d.aiAgentInfo) == null ? void 0 : h.templateListToken;
|
|
938
939
|
if (!l) return !1;
|
|
939
940
|
const c = t.getCachedToken();
|
|
940
941
|
return c ? l !== c : !0;
|
|
941
942
|
},
|
|
942
943
|
[t]
|
|
943
|
-
), i =
|
|
944
|
+
), i = H(
|
|
944
945
|
async (s) => {
|
|
945
946
|
try {
|
|
946
947
|
const { templates: l, token: c } = await s.aiAgent.getMessageTemplates({ limit: 20 });
|
|
947
948
|
for (const { template: d } of l) {
|
|
948
|
-
const { key:
|
|
949
|
-
t.setTemplate(
|
|
949
|
+
const { key: h } = De(d);
|
|
950
|
+
t.setTemplate(h, d);
|
|
950
951
|
}
|
|
951
952
|
t.setCachedToken(c);
|
|
952
953
|
} catch (l) {
|
|
@@ -954,12 +955,12 @@ function No({ logger: e, storage: t, children: n }) {
|
|
|
954
955
|
}
|
|
955
956
|
},
|
|
956
957
|
[t, e]
|
|
957
|
-
), a =
|
|
958
|
+
), a = H(() => {
|
|
958
959
|
t.clear();
|
|
959
960
|
}, [t]);
|
|
960
|
-
return /* @__PURE__ */ r.createElement(
|
|
961
|
+
return /* @__PURE__ */ r.createElement(No, { value: { shouldSyncCachedTemplate: o, syncCachedTemplates: i, clearCachedTemplates: a, storage: t } }, n);
|
|
961
962
|
}
|
|
962
|
-
function
|
|
963
|
+
function Fo(e) {
|
|
963
964
|
let t = "pending", n = e.then((o) => {
|
|
964
965
|
t = "resolved", n = o;
|
|
965
966
|
}).catch((o) => {
|
|
@@ -975,28 +976,28 @@ function Po(e) {
|
|
|
975
976
|
}
|
|
976
977
|
const {
|
|
977
978
|
Provider: Bo,
|
|
978
|
-
useContext:
|
|
979
|
-
} =
|
|
980
|
-
function
|
|
981
|
-
const n =
|
|
979
|
+
useContext: Ln
|
|
980
|
+
} = Z("MessageTemplateFetching");
|
|
981
|
+
function Uo({ children: e, internalVariables: t }) {
|
|
982
|
+
const n = U({}), o = U({}), [i, a] = S({}), s = H((d, h) => {
|
|
982
983
|
a((g) => ({
|
|
983
984
|
...g,
|
|
984
|
-
[d]: { fetching: !1, error: !1, ...g[d], ...
|
|
985
|
+
[d]: { fetching: !1, error: !1, ...g[d], ...h }
|
|
985
986
|
}));
|
|
986
|
-
}, []), l =
|
|
987
|
+
}, []), l = H(
|
|
987
988
|
async ({
|
|
988
989
|
onRequestTemplate: d,
|
|
989
|
-
onGetCachedTemplate:
|
|
990
|
+
onGetCachedTemplate: h,
|
|
990
991
|
templateKey: g,
|
|
991
992
|
suspense: p = !1
|
|
992
993
|
}) => {
|
|
993
|
-
const x =
|
|
994
|
+
const x = h(g);
|
|
994
995
|
if (x) return x;
|
|
995
|
-
const
|
|
996
|
-
if (
|
|
996
|
+
const b = o.current[g];
|
|
997
|
+
if (b) return b;
|
|
997
998
|
p || s(g, { fetching: !0 });
|
|
998
|
-
const E = d(g).catch((
|
|
999
|
-
throw p || s(g, { error: !0 }),
|
|
999
|
+
const E = d(g).catch((f) => {
|
|
1000
|
+
throw p || s(g, { error: !0 }), f;
|
|
1000
1001
|
}).finally(() => {
|
|
1001
1002
|
p || s(g, { fetching: !1 }), delete o.current[g];
|
|
1002
1003
|
});
|
|
@@ -1006,19 +1007,19 @@ function Fo({ children: e, internalVariables: t }) {
|
|
|
1006
1007
|
), c = {
|
|
1007
1008
|
internalVariables: t,
|
|
1008
1009
|
fetchTemplate: l,
|
|
1009
|
-
suspend: (d,
|
|
1010
|
+
suspend: (d, h) => {
|
|
1010
1011
|
if (n.current[d])
|
|
1011
1012
|
return n.current[d];
|
|
1012
|
-
const g =
|
|
1013
|
+
const g = Fo(h());
|
|
1013
1014
|
return n.current[d] = g, g;
|
|
1014
1015
|
},
|
|
1015
1016
|
getIsFetching: (d) => {
|
|
1016
|
-
var
|
|
1017
|
-
return ((
|
|
1017
|
+
var h;
|
|
1018
|
+
return ((h = i[d]) == null ? void 0 : h.fetching) ?? !1;
|
|
1018
1019
|
},
|
|
1019
1020
|
getHasError: (d) => {
|
|
1020
|
-
var
|
|
1021
|
-
return ((
|
|
1021
|
+
var h;
|
|
1022
|
+
return ((h = i[d]) == null ? void 0 : h.error) ?? !1;
|
|
1022
1023
|
}
|
|
1023
1024
|
};
|
|
1024
1025
|
return /* @__PURE__ */ r.createElement(Bo, { value: c }, e);
|
|
@@ -1027,27 +1028,27 @@ const rt = {
|
|
|
1027
1028
|
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
1028
1029
|
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
1029
1030
|
};
|
|
1030
|
-
function
|
|
1031
|
-
const n =
|
|
1032
|
-
return
|
|
1031
|
+
function ue({ uiTemplateString: e, variables: t = {} }) {
|
|
1032
|
+
const n = Lo(t);
|
|
1033
|
+
return yt({
|
|
1033
1034
|
template: e,
|
|
1034
1035
|
variables: n,
|
|
1035
1036
|
variableKeyPattern: (o) => rt.VARIABLE(o)
|
|
1036
1037
|
});
|
|
1037
1038
|
}
|
|
1038
|
-
function
|
|
1039
|
+
function me({
|
|
1039
1040
|
theme: e,
|
|
1040
1041
|
uiTemplateString: t,
|
|
1041
1042
|
colorVariables: n = {}
|
|
1042
1043
|
}) {
|
|
1043
|
-
return
|
|
1044
|
+
return yt({
|
|
1044
1045
|
template: t,
|
|
1045
1046
|
variables: n,
|
|
1046
1047
|
variableKeyPattern: (o) => rt.VARIABLE(o),
|
|
1047
|
-
variableValueTransformer: (o) =>
|
|
1048
|
+
variableValueTransformer: (o) => Oo(e, o)
|
|
1048
1049
|
});
|
|
1049
1050
|
}
|
|
1050
|
-
function
|
|
1051
|
+
function Ho({
|
|
1051
1052
|
theme: e,
|
|
1052
1053
|
uiTemplateString: t,
|
|
1053
1054
|
viewVariables: n = {},
|
|
@@ -1056,35 +1057,35 @@ function Uo({
|
|
|
1056
1057
|
onRequestTemplate: a
|
|
1057
1058
|
}) {
|
|
1058
1059
|
const l = Object.values(n).flat().map((d) => d.key);
|
|
1059
|
-
return [...new Set(l)].some((d) => !a(d)) ? null :
|
|
1060
|
+
return [...new Set(l)].some((d) => !a(d)) ? null : yt({
|
|
1060
1061
|
template: t,
|
|
1061
1062
|
variables: n,
|
|
1062
1063
|
variableKeyPattern: (d) => rt.VIEW_VARIABLE(d),
|
|
1063
1064
|
variableValueTransformer: (d) => {
|
|
1064
|
-
const
|
|
1065
|
-
const x = a(g), { ui_template:
|
|
1066
|
-
let
|
|
1067
|
-
return
|
|
1068
|
-
uiTemplateString:
|
|
1065
|
+
const h = d.map(({ key: g, variables: p }) => {
|
|
1066
|
+
const x = a(g), { ui_template: b, color_variables: E } = De(x);
|
|
1067
|
+
let f = JSON.stringify(b);
|
|
1068
|
+
return f = ue({
|
|
1069
|
+
uiTemplateString: f,
|
|
1069
1070
|
variables: i
|
|
1070
|
-
}),
|
|
1071
|
+
}), f = me({
|
|
1071
1072
|
theme: e,
|
|
1072
|
-
uiTemplateString:
|
|
1073
|
+
uiTemplateString: f,
|
|
1073
1074
|
colorVariables: E
|
|
1074
|
-
}),
|
|
1075
|
+
}), f = me({
|
|
1075
1076
|
theme: e,
|
|
1076
|
-
uiTemplateString:
|
|
1077
|
+
uiTemplateString: f,
|
|
1077
1078
|
colorVariables: o
|
|
1078
|
-
}),
|
|
1079
|
-
uiTemplateString:
|
|
1079
|
+
}), f = ue({
|
|
1080
|
+
uiTemplateString: f,
|
|
1080
1081
|
variables: p
|
|
1081
|
-
}), nt(
|
|
1082
|
+
}), nt(f);
|
|
1082
1083
|
});
|
|
1083
|
-
return JSON.stringify(
|
|
1084
|
+
return JSON.stringify(h);
|
|
1084
1085
|
}
|
|
1085
1086
|
});
|
|
1086
1087
|
}
|
|
1087
|
-
async function
|
|
1088
|
+
async function zo({
|
|
1088
1089
|
theme: e,
|
|
1089
1090
|
uiTemplateString: t,
|
|
1090
1091
|
viewVariables: n = {},
|
|
@@ -1092,35 +1093,35 @@ async function Ho({
|
|
|
1092
1093
|
internalVariables: i,
|
|
1093
1094
|
onRequestTemplate: a
|
|
1094
1095
|
}) {
|
|
1095
|
-
return
|
|
1096
|
+
return Ro({
|
|
1096
1097
|
template: t,
|
|
1097
1098
|
variables: n,
|
|
1098
1099
|
variableKeyPattern: (s) => rt.VIEW_VARIABLE(s),
|
|
1099
1100
|
variableValueTransformer: async (s) => {
|
|
1100
|
-
const l = s.map(async ({ key: d, variables:
|
|
1101
|
+
const l = s.map(async ({ key: d, variables: h }) => {
|
|
1101
1102
|
const g = await a(d), { ui_template: p, color_variables: x } = De(g);
|
|
1102
|
-
let
|
|
1103
|
-
return
|
|
1104
|
-
uiTemplateString:
|
|
1103
|
+
let b = JSON.stringify(p);
|
|
1104
|
+
return b = ue({
|
|
1105
|
+
uiTemplateString: b,
|
|
1105
1106
|
variables: i
|
|
1106
|
-
}),
|
|
1107
|
+
}), b = me({
|
|
1107
1108
|
theme: e,
|
|
1108
|
-
uiTemplateString:
|
|
1109
|
+
uiTemplateString: b,
|
|
1109
1110
|
colorVariables: x
|
|
1110
|
-
}),
|
|
1111
|
+
}), b = me({
|
|
1111
1112
|
theme: e,
|
|
1112
|
-
uiTemplateString:
|
|
1113
|
+
uiTemplateString: b,
|
|
1113
1114
|
colorVariables: o
|
|
1114
|
-
}),
|
|
1115
|
-
uiTemplateString:
|
|
1116
|
-
variables:
|
|
1117
|
-
}), nt(
|
|
1115
|
+
}), b = ue({
|
|
1116
|
+
uiTemplateString: b,
|
|
1117
|
+
variables: h
|
|
1118
|
+
}), nt(b);
|
|
1118
1119
|
}), c = await Promise.all(l);
|
|
1119
1120
|
return JSON.stringify(c);
|
|
1120
1121
|
}
|
|
1121
1122
|
});
|
|
1122
1123
|
}
|
|
1123
|
-
const
|
|
1124
|
+
const Vo = ({
|
|
1124
1125
|
rawTemplate: e,
|
|
1125
1126
|
aiAgentColorVariables: t,
|
|
1126
1127
|
internalVariables: n,
|
|
@@ -1129,7 +1130,7 @@ const zo = ({
|
|
|
1129
1130
|
const { ui_template: i, color_variables: a } = De(e);
|
|
1130
1131
|
let s = JSON.stringify(i);
|
|
1131
1132
|
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
1132
|
-
const c =
|
|
1133
|
+
const c = Ho({
|
|
1133
1134
|
...o,
|
|
1134
1135
|
uiTemplateString: s,
|
|
1135
1136
|
aiAgentColorVariables: t,
|
|
@@ -1138,8 +1139,8 @@ const zo = ({
|
|
|
1138
1139
|
if (c === null) return null;
|
|
1139
1140
|
s = c;
|
|
1140
1141
|
}
|
|
1141
|
-
return s =
|
|
1142
|
-
},
|
|
1142
|
+
return s = ue({ ...o, uiTemplateString: s, variables: n }), s = me({ ...o, uiTemplateString: s, colorVariables: a }), s = me({ ...o, uiTemplateString: s, colorVariables: t }), s = ue({ ...o, uiTemplateString: s }), nt(s);
|
|
1143
|
+
}, Wo = async ({
|
|
1143
1144
|
rawTemplate: e,
|
|
1144
1145
|
aiAgentColorVariables: t,
|
|
1145
1146
|
internalVariables: n,
|
|
@@ -1147,17 +1148,17 @@ const zo = ({
|
|
|
1147
1148
|
}) => {
|
|
1148
1149
|
const { ui_template: i, color_variables: a } = De(e);
|
|
1149
1150
|
let s = JSON.stringify(i);
|
|
1150
|
-
return Object.keys(o.viewVariables ?? {}).length > 0 && (s = await
|
|
1151
|
+
return Object.keys(o.viewVariables ?? {}).length > 0 && (s = await zo({
|
|
1151
1152
|
...o,
|
|
1152
1153
|
uiTemplateString: s,
|
|
1153
1154
|
aiAgentColorVariables: t,
|
|
1154
1155
|
internalVariables: n
|
|
1155
|
-
})), s =
|
|
1156
|
-
},
|
|
1157
|
-
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } =
|
|
1156
|
+
})), s = ue({ ...o, uiTemplateString: s, variables: n }), s = me({ ...o, uiTemplateString: s, colorVariables: a }), s = me({ ...o, uiTemplateString: s, colorVariables: t }), s = ue({ ...o, uiTemplateString: s }), nt(s);
|
|
1157
|
+
}, Go = (e) => {
|
|
1158
|
+
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = Ln();
|
|
1158
1159
|
return S(() => {
|
|
1159
1160
|
const o = e.onGetCachedTemplate(e.templateKey);
|
|
1160
|
-
return o ?
|
|
1161
|
+
return o ? Vo({
|
|
1161
1162
|
...e,
|
|
1162
1163
|
rawTemplate: o,
|
|
1163
1164
|
aiAgentColorVariables: t,
|
|
@@ -1165,20 +1166,20 @@ const zo = ({
|
|
|
1165
1166
|
onRequestTemplate: e.onGetCachedTemplate
|
|
1166
1167
|
}) : null;
|
|
1167
1168
|
});
|
|
1168
|
-
},
|
|
1169
|
-
const [t] =
|
|
1169
|
+
}, jo = (e) => {
|
|
1170
|
+
const [t] = Go(e);
|
|
1170
1171
|
if (t) return t;
|
|
1171
|
-
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } =
|
|
1172
|
+
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } = Ln();
|
|
1172
1173
|
return a(e.templateKey, async () => {
|
|
1173
1174
|
const l = await i({ ...e, suspense: !0 });
|
|
1174
|
-
return await
|
|
1175
|
+
return await Wo({
|
|
1175
1176
|
...e,
|
|
1176
1177
|
rawTemplate: l,
|
|
1177
1178
|
aiAgentColorVariables: n,
|
|
1178
1179
|
internalVariables: o
|
|
1179
1180
|
});
|
|
1180
1181
|
}).value;
|
|
1181
|
-
},
|
|
1182
|
+
}, Ko = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}', Ne = "en", Zo = /* @__PURE__ */ new Set([
|
|
1182
1183
|
Ne,
|
|
1183
1184
|
"ko",
|
|
1184
1185
|
"es",
|
|
@@ -1189,7 +1190,7 @@ const zo = ({
|
|
|
1189
1190
|
"de",
|
|
1190
1191
|
"tr",
|
|
1191
1192
|
"ja"
|
|
1192
|
-
]),
|
|
1193
|
+
]), Yo = (e, t, n) => {
|
|
1193
1194
|
const o = e[t];
|
|
1194
1195
|
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((i, a) => {
|
|
1195
1196
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
@@ -1201,7 +1202,7 @@ const zo = ({
|
|
|
1201
1202
|
)
|
|
1202
1203
|
);
|
|
1203
1204
|
});
|
|
1204
|
-
},
|
|
1205
|
+
}, qo = Pr, Jo = {
|
|
1205
1206
|
// Channel - Common
|
|
1206
1207
|
CHANNEL_FROZEN: "Channel frozen",
|
|
1207
1208
|
PLACE_HOLDER__WRONG: "Something went wrong",
|
|
@@ -1251,31 +1252,33 @@ const zo = ({
|
|
|
1251
1252
|
CONVERSATION_LIST__TOPICS_FALLBACK: "No category",
|
|
1252
1253
|
CONVERSATION_LIST__NO_CONVERSATIONS: "No conversations yet",
|
|
1253
1254
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: "MM/dd/yyyy",
|
|
1254
|
-
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
|
|
1255
|
-
|
|
1255
|
+
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma",
|
|
1256
|
+
// Citation
|
|
1257
|
+
CITATION_SOURCE_TITLE: "Source"
|
|
1258
|
+
}, _t = { language: "en", dateLocale: qo, stringSet: Jo }, Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1256
1259
|
__proto__: null,
|
|
1257
|
-
default:
|
|
1258
|
-
}, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne,
|
|
1259
|
-
async function
|
|
1260
|
+
default: _t
|
|
1261
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne, _t]]);
|
|
1262
|
+
async function Qo(e) {
|
|
1260
1263
|
if (Ye.has(e))
|
|
1261
1264
|
return Ye.get(e);
|
|
1262
|
-
const t =
|
|
1265
|
+
const t = Zo.has(e) ? e : Ne;
|
|
1263
1266
|
try {
|
|
1264
|
-
const { default: n } = await
|
|
1267
|
+
const { default: n } = await Yo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./BAebVbLs.js"), "./languages/en.ts": () => Promise.resolve().then(() => Xo), "./languages/es.ts": () => import("./BKSUGIyL.js"), "./languages/fr.ts": () => import("./B1s75De5.js"), "./languages/hi.ts": () => import("./D0QwWNMF.js"), "./languages/it.ts": () => import("./CA1gVgSD.js"), "./languages/ja.ts": () => import("./DcqbdvlW.js"), "./languages/ko.ts": () => import("./Dxrtj2R8.js"), "./languages/pt.ts": () => import("./EylKxx4d.js"), "./languages/tr.ts": () => import("./DYR8UT_l.js") }), `./languages/${t}.ts`, 3);
|
|
1265
1268
|
return Ye.set(e, n), n;
|
|
1266
1269
|
} catch {
|
|
1267
|
-
return
|
|
1270
|
+
return _t;
|
|
1268
1271
|
}
|
|
1269
1272
|
}
|
|
1270
1273
|
const {
|
|
1271
|
-
Provider:
|
|
1274
|
+
Provider: ei,
|
|
1272
1275
|
useContext: R
|
|
1273
|
-
} =
|
|
1274
|
-
function
|
|
1276
|
+
} = Z("Localization");
|
|
1277
|
+
function ti(e) {
|
|
1275
1278
|
var t;
|
|
1276
1279
|
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Ne;
|
|
1277
1280
|
}
|
|
1278
|
-
function
|
|
1281
|
+
function ni({
|
|
1279
1282
|
language: e = navigator.language,
|
|
1280
1283
|
logger: t,
|
|
1281
1284
|
stringSet: n,
|
|
@@ -1283,30 +1286,30 @@ function ti({
|
|
|
1283
1286
|
}) {
|
|
1284
1287
|
const [i, a] = S(Ye.get(Ne));
|
|
1285
1288
|
return D(() => {
|
|
1286
|
-
const s =
|
|
1287
|
-
i.language !== s && (t == null || t.debug("localization.useEffect: update language", `${i.language} -> ${s}`),
|
|
1289
|
+
const s = ti(e);
|
|
1290
|
+
i.language !== s && (t == null || t.debug("localization.useEffect: update language", `${i.language} -> ${s}`), Qo(s).then(a));
|
|
1288
1291
|
}, [e]), /* @__PURE__ */ r.createElement(
|
|
1289
|
-
|
|
1292
|
+
ei,
|
|
1290
1293
|
{
|
|
1291
1294
|
value: {
|
|
1292
1295
|
language: i.language,
|
|
1293
1296
|
stringSet: { ...i.stringSet, ...n },
|
|
1294
1297
|
dateLocale: i.dateLocale,
|
|
1295
|
-
format: (s, l, c) =>
|
|
1298
|
+
format: (s, l, c) => _n(s, l, { locale: i.dateLocale, ...c })
|
|
1296
1299
|
}
|
|
1297
1300
|
},
|
|
1298
1301
|
o
|
|
1299
1302
|
);
|
|
1300
1303
|
}
|
|
1301
|
-
const qe = "data-sb-agent-theme",
|
|
1304
|
+
const qe = "data-sb-agent-theme", Zt = (e) => (t, ...n) => {
|
|
1302
1305
|
let o = "";
|
|
1303
1306
|
return t.forEach((i, a) => {
|
|
1304
1307
|
o += i + (n[a] ?? "");
|
|
1305
1308
|
}), `[${qe}='${e}'] & { ${o} }`;
|
|
1306
|
-
},
|
|
1307
|
-
light:
|
|
1308
|
-
dark:
|
|
1309
|
-
},
|
|
1309
|
+
}, F = {
|
|
1310
|
+
light: Zt("light"),
|
|
1311
|
+
dark: Zt("dark")
|
|
1312
|
+
}, ri = $(({ theme: e }) => {
|
|
1310
1313
|
const { palette: t } = e;
|
|
1311
1314
|
return `
|
|
1312
1315
|
:root,
|
|
@@ -1358,7 +1361,7 @@ const qe = "data-sb-agent-theme", Gt = (e) => (t, ...n) => {
|
|
|
1358
1361
|
--sendbird-overlay-light: ${t.overlay.light};
|
|
1359
1362
|
}
|
|
1360
1363
|
`;
|
|
1361
|
-
}),
|
|
1364
|
+
}), oi = $`[${qe}='light'] &{--sb-text-high-emphasis:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled:var(--sendbird-onlight-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-ondark-text-disabled);--sb-bg-50-600:var(--sendbird-background-50);--sb-bg-100-500:var(--sendbird-background-100);--sb-bg-200-400:var(--sendbird-background-200);--sb-primary:var(--sendbird-primary-main);--sb-secondary:var(--sendbird-secondary-main);--sb-error:var(--sendbird-error-main);--sb-information:var(--sendbird-information-light);}[${qe}='dark'] &{--sb-text-high-emphasis:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled:var(--sendbird-ondark-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-onlight-text-disabled);--sb-bg-50-600:var(--sendbird-background-600);--sb-bg-100-500:var(--sendbird-background-500);--sb-bg-200-400:var(--sendbird-background-400);--sb-primary:var(--sendbird-primary-light);--sb-secondary:var(--sendbird-secondary-light);--sb-error:var(--sendbird-error-light);--sb-information:var(--sendbird-information-light);}`, m = {
|
|
1362
1365
|
color: {
|
|
1363
1366
|
primary: {
|
|
1364
1367
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -1399,33 +1402,33 @@ const qe = "data-sb-agent-theme", Gt = (e) => (t, ...n) => {
|
|
|
1399
1402
|
error: "var(--sb-error)"
|
|
1400
1403
|
}
|
|
1401
1404
|
}, {
|
|
1402
|
-
Provider:
|
|
1403
|
-
useContext:
|
|
1404
|
-
} =
|
|
1405
|
-
function
|
|
1405
|
+
Provider: ii,
|
|
1406
|
+
useContext: si
|
|
1407
|
+
} = Z("AIAgentTheme");
|
|
1408
|
+
function ai(e) {
|
|
1406
1409
|
const { theme: t, appearance: n, logger: o } = e;
|
|
1407
1410
|
return /* @__PURE__ */ r.createElement(
|
|
1408
|
-
|
|
1411
|
+
Mo,
|
|
1409
1412
|
{
|
|
1410
1413
|
appearance: n,
|
|
1411
1414
|
palette: t == null ? void 0 : t.palette,
|
|
1412
1415
|
typography: t == null ? void 0 : t.typography,
|
|
1413
1416
|
logger: o
|
|
1414
1417
|
},
|
|
1415
|
-
/* @__PURE__ */ r.createElement(
|
|
1418
|
+
/* @__PURE__ */ r.createElement(li, { ...e })
|
|
1416
1419
|
);
|
|
1417
1420
|
}
|
|
1418
|
-
function
|
|
1419
|
-
const { theme: n, updateTheme: o } =
|
|
1420
|
-
return
|
|
1421
|
+
function li({ rootElement: e = document.body, children: t }) {
|
|
1422
|
+
const { theme: n, updateTheme: o } = vt();
|
|
1423
|
+
return de(() => {
|
|
1421
1424
|
e.setAttribute(qe, n.selectedTheme);
|
|
1422
|
-
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(
|
|
1425
|
+
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(Lr, { theme: n }, /* @__PURE__ */ r.createElement(ii, { value: { theme: n, updateTheme: o } }, t));
|
|
1423
1426
|
}
|
|
1424
1427
|
function fe(e, t) {
|
|
1425
1428
|
const n = e.getRootNode({ composed: t });
|
|
1426
1429
|
return n instanceof ShadowRoot || n instanceof Document ? n : document;
|
|
1427
1430
|
}
|
|
1428
|
-
const
|
|
1431
|
+
const ci = (e, t) => {
|
|
1429
1432
|
D(() => {
|
|
1430
1433
|
const n = fe(t) instanceof ShadowRoot, o = fe(t, !0);
|
|
1431
1434
|
if (!(n ? t : o).querySelector(`link[href*='${e}']`)) {
|
|
@@ -1433,7 +1436,7 @@ const li = (e, t) => {
|
|
|
1433
1436
|
a.rel = "stylesheet", a.href = e, (n ? t : o.head).appendChild(a);
|
|
1434
1437
|
}
|
|
1435
1438
|
}, [e, t]);
|
|
1436
|
-
},
|
|
1439
|
+
}, di = (e, t = document.body) => {
|
|
1437
1440
|
D(() => {
|
|
1438
1441
|
const n = fe(t), i = n instanceof ShadowRoot ? t : n.head;
|
|
1439
1442
|
if (!i) return;
|
|
@@ -1441,7 +1444,7 @@ const li = (e, t) => {
|
|
|
1441
1444
|
let s = i.querySelector(`style#${a}`);
|
|
1442
1445
|
s ? s.textContent !== e && (s.textContent = e) : (s = i.ownerDocument.createElement("style"), s.id = a, s.textContent = e, i.appendChild(s));
|
|
1443
1446
|
}, [e, t]);
|
|
1444
|
-
},
|
|
1447
|
+
}, St = /iPad|iPhone|iPod/.test(navigator.userAgent), ui = /Android/.test(navigator.userAgent), Pe = (e) => St || ui, Q = "sb-agent", oe = {
|
|
1445
1448
|
ENTRY: `${Q}-entry`,
|
|
1446
1449
|
MODAL_ROOT: `${Q}-modal-root`,
|
|
1447
1450
|
WINDOW: `${Q}-window`,
|
|
@@ -1452,13 +1455,13 @@ const li = (e, t) => {
|
|
|
1452
1455
|
TOOLTIP: Ve - 2,
|
|
1453
1456
|
WINDOW: Ve - 3,
|
|
1454
1457
|
LAUNCHER: Ve - 4
|
|
1455
|
-
},
|
|
1458
|
+
}, Rn = {
|
|
1456
1459
|
SESSION: `@${Q}-session`,
|
|
1457
1460
|
USER_DATA: `@${Q}-udata`
|
|
1458
|
-
},
|
|
1461
|
+
}, Dn = {
|
|
1459
1462
|
DEFAULT_PRIMARY: "#742ddd",
|
|
1460
1463
|
WHITE: "#ffffff"
|
|
1461
|
-
},
|
|
1464
|
+
}, Nn = 36, mi = 100, hi = 25 * 1024 * 1024, Pn = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], Tt = "noopener noreferrer nofollow", We = {}, ee = {
|
|
1462
1465
|
getItem: (e) => {
|
|
1463
1466
|
try {
|
|
1464
1467
|
return localStorage.getItem(e);
|
|
@@ -1493,12 +1496,12 @@ const li = (e, t) => {
|
|
|
1493
1496
|
}
|
|
1494
1497
|
}
|
|
1495
1498
|
};
|
|
1496
|
-
function
|
|
1499
|
+
function Fn(e) {
|
|
1497
1500
|
const { keyGenerator: t, keyParamsValidator: n } = e;
|
|
1498
1501
|
function o(s) {
|
|
1499
1502
|
try {
|
|
1500
1503
|
n && n(s);
|
|
1501
|
-
const l = t(s), c =
|
|
1504
|
+
const l = t(s), c = ee.getItem(l);
|
|
1502
1505
|
return c ? JSON.parse(c) : null;
|
|
1503
1506
|
} catch {
|
|
1504
1507
|
return null;
|
|
@@ -1508,7 +1511,7 @@ function Nn(e) {
|
|
|
1508
1511
|
try {
|
|
1509
1512
|
n && n(s);
|
|
1510
1513
|
const c = t(s), d = JSON.stringify(l);
|
|
1511
|
-
|
|
1514
|
+
ee.setItem(c, d);
|
|
1512
1515
|
} catch {
|
|
1513
1516
|
}
|
|
1514
1517
|
}
|
|
@@ -1516,36 +1519,36 @@ function Nn(e) {
|
|
|
1516
1519
|
try {
|
|
1517
1520
|
n && n(s);
|
|
1518
1521
|
const l = t(s);
|
|
1519
|
-
|
|
1522
|
+
ee.deleteItem(l);
|
|
1520
1523
|
} catch {
|
|
1521
1524
|
}
|
|
1522
1525
|
}
|
|
1523
1526
|
return { get: o, set: i, clear: a };
|
|
1524
1527
|
}
|
|
1525
|
-
const $e =
|
|
1528
|
+
const $e = Fn({
|
|
1526
1529
|
keyGenerator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1527
|
-
const o =
|
|
1528
|
-
return `${
|
|
1530
|
+
const o = gi(`${e}/${t}/${n}`);
|
|
1531
|
+
return `${Rn.USER_DATA}/${o}`;
|
|
1529
1532
|
},
|
|
1530
1533
|
keyParamsValidator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1531
1534
|
if (!e || !t || !n)
|
|
1532
1535
|
throw new Error("Invalid parameters for user data cache");
|
|
1533
1536
|
}
|
|
1534
1537
|
});
|
|
1535
|
-
function
|
|
1538
|
+
function gi(e) {
|
|
1536
1539
|
let t = 0;
|
|
1537
1540
|
for (let n = 0; n < e.length; n++)
|
|
1538
1541
|
t = (t << 5) - t + e.charCodeAt(n), t |= 0;
|
|
1539
1542
|
return t.toString(16);
|
|
1540
1543
|
}
|
|
1541
|
-
const Ge =
|
|
1542
|
-
keyGenerator: ({ appId: e, aiAgentId: t }) => `${
|
|
1544
|
+
const Ge = Fn({
|
|
1545
|
+
keyGenerator: ({ appId: e, aiAgentId: t }) => `${Rn.SESSION}/${e}/${t}`
|
|
1543
1546
|
}), {
|
|
1544
|
-
Provider:
|
|
1545
|
-
Consumer:
|
|
1546
|
-
useContext:
|
|
1547
|
-
} =
|
|
1548
|
-
function
|
|
1547
|
+
Provider: pi,
|
|
1548
|
+
Consumer: Bn,
|
|
1549
|
+
useContext: B
|
|
1550
|
+
} = Z("Agent");
|
|
1551
|
+
function fi({
|
|
1549
1552
|
children: e,
|
|
1550
1553
|
state: t,
|
|
1551
1554
|
enableCloseConversationButton: n = !1,
|
|
@@ -1553,14 +1556,14 @@ function pi({
|
|
|
1553
1556
|
enableAutoDisconnectInLauncher: i = !0,
|
|
1554
1557
|
...a
|
|
1555
1558
|
}) {
|
|
1556
|
-
const s = tt(), [l, c] = S(!1), [d,
|
|
1559
|
+
const s = tt(), [l, c] = S(!1), [d, h] = S(!1), g = {
|
|
1557
1560
|
opened: (t == null ? void 0 : t.opened) ?? l,
|
|
1558
1561
|
setOpened: (t == null ? void 0 : t.setOpened) ?? c,
|
|
1559
1562
|
expanded: (t == null ? void 0 : t.expanded) ?? d,
|
|
1560
|
-
setExpanded: (t == null ? void 0 : t.setExpanded) ??
|
|
1563
|
+
setExpanded: (t == null ? void 0 : t.setExpanded) ?? h
|
|
1561
1564
|
};
|
|
1562
1565
|
return /* @__PURE__ */ r.createElement(
|
|
1563
|
-
|
|
1566
|
+
pi,
|
|
1564
1567
|
{
|
|
1565
1568
|
value: {
|
|
1566
1569
|
...a,
|
|
@@ -1574,20 +1577,20 @@ function pi({
|
|
|
1574
1577
|
e
|
|
1575
1578
|
);
|
|
1576
1579
|
}
|
|
1577
|
-
function
|
|
1578
|
-
const { chatSDK: e, logger: t } =
|
|
1580
|
+
function bi() {
|
|
1581
|
+
const { chatSDK: e, logger: t } = B(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } = On(), a = H(
|
|
1579
1582
|
async (l, c, d) => {
|
|
1580
1583
|
if (t.debug("authManager.authenticate: session:", l.userId), c) {
|
|
1581
|
-
const
|
|
1584
|
+
const h = new Mr({
|
|
1582
1585
|
...c,
|
|
1583
|
-
onSessionTokenRequired:
|
|
1586
|
+
onSessionTokenRequired: xi(c.onSessionTokenRequired, d)
|
|
1584
1587
|
});
|
|
1585
|
-
e.setSessionHandler(
|
|
1588
|
+
e.setSessionHandler(h);
|
|
1586
1589
|
}
|
|
1587
1590
|
await e.connect(l.userId, l.authToken), t.debug("authManager.authenticate: user:", e.currentUser), n(e) && await o(e);
|
|
1588
1591
|
},
|
|
1589
1592
|
[e, t, n, o]
|
|
1590
|
-
), s =
|
|
1593
|
+
), s = H(async () => {
|
|
1591
1594
|
t.debug("authManager.deauthenticate: disconnect"), await e.disconnect(), i();
|
|
1592
1595
|
}, [e, t, i]);
|
|
1593
1596
|
return {
|
|
@@ -1595,7 +1598,7 @@ function fi() {
|
|
|
1595
1598
|
deauthenticate: s
|
|
1596
1599
|
};
|
|
1597
1600
|
}
|
|
1598
|
-
function
|
|
1601
|
+
function xi(e, t) {
|
|
1599
1602
|
if (e)
|
|
1600
1603
|
return async (n, o) => {
|
|
1601
1604
|
new Promise((i, a) => e == null ? void 0 : e(i, a)).then((i) => {
|
|
@@ -1605,14 +1608,18 @@ function bi(e, t) {
|
|
|
1605
1608
|
});
|
|
1606
1609
|
};
|
|
1607
1610
|
}
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1611
|
+
const Ei = 24 * 60 * 60 * 1e3, Ci = {
|
|
1612
|
+
off: re.OFF,
|
|
1613
|
+
always: re.ALWAYS,
|
|
1614
|
+
handed_off_only: re.HANDED_OFF_ONLY
|
|
1615
|
+
}, {
|
|
1616
|
+
Provider: vi,
|
|
1610
1617
|
useContext: z
|
|
1611
|
-
} =
|
|
1612
|
-
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode:
|
|
1618
|
+
} = Z("MessengerSession"), yi = Re(function({ userSessionInfo: e, children: t }, n) {
|
|
1619
|
+
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: h, context: g, handlers: p } = B(), { updateTheme: x } = vt(), { authenticate: b, deauthenticate: E } = bi(), [f, C] = S(
|
|
1613
1620
|
void 0
|
|
1614
|
-
), [y,
|
|
1615
|
-
function
|
|
1621
|
+
), [y, k] = S(void 0), [_, Y] = S(null), [L, ae] = S(null), [xe, v] = S(null), [V, Ee] = S(re.HANDED_OFF_ONLY), X = s == null ? void 0 : s.forceCreateChannel;
|
|
1622
|
+
function it() {
|
|
1616
1623
|
if (e && e.userId) {
|
|
1617
1624
|
c.debug("messengerSession.initialize: manual session info detected");
|
|
1618
1625
|
const I = ["authToken", "sessionHandler"].filter((M) => !(M in e));
|
|
@@ -1621,32 +1628,32 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1621
1628
|
), e;
|
|
1622
1629
|
}
|
|
1623
1630
|
const A = Ge.get({ appId: o, aiAgentId: i });
|
|
1624
|
-
return A ? A.expireAt -
|
|
1631
|
+
return A ? A.expireAt - Ei <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"), Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: A.userId }), null) : (c.debug("messengerSession.initialize: auto session info detected"), A) : null;
|
|
1625
1632
|
}
|
|
1626
|
-
const
|
|
1633
|
+
const ke = H(
|
|
1627
1634
|
(A, I) => {
|
|
1628
1635
|
$e.set({ appId: o, aiAgentId: i, userId: A }, { knownActiveChannelUrl: I });
|
|
1629
1636
|
},
|
|
1630
1637
|
[o, i]
|
|
1631
|
-
), Ae =
|
|
1638
|
+
), Ae = H(
|
|
1632
1639
|
(A) => {
|
|
1633
1640
|
const I = $e.get({ appId: o, aiAgentId: i, userId: A });
|
|
1634
1641
|
return I == null ? void 0 : I.knownActiveChannelUrl;
|
|
1635
1642
|
},
|
|
1636
1643
|
[o, i]
|
|
1637
|
-
),
|
|
1644
|
+
), st = H(async () => {
|
|
1638
1645
|
if (_) {
|
|
1639
1646
|
c.debug("messengerSession.refreshActiveChannel: try to refresh active channel"), C(void 0);
|
|
1640
1647
|
const A = await a.aiAgent.requestMessengerSettings({
|
|
1641
1648
|
aiAgentId: i,
|
|
1642
1649
|
userId: _.userId,
|
|
1643
1650
|
language: d,
|
|
1644
|
-
country:
|
|
1651
|
+
country: h,
|
|
1645
1652
|
context: g,
|
|
1646
|
-
forceCreateChannel:
|
|
1653
|
+
forceCreateChannel: X,
|
|
1647
1654
|
knownActiveChannelUrl: Ae(_.userId)
|
|
1648
1655
|
});
|
|
1649
|
-
return
|
|
1656
|
+
return ke(_.userId, A.active_channel.channel_url), C({ url: A.active_channel.channel_url, status: j.OPEN }), c.info(
|
|
1650
1657
|
"messengerSession.refreshActiveChannel: refreshed active channel",
|
|
1651
1658
|
A.active_channel.channel_url
|
|
1652
1659
|
), A.active_channel.channel_url;
|
|
@@ -1658,12 +1665,12 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1658
1665
|
i,
|
|
1659
1666
|
_ == null ? void 0 : _.userId,
|
|
1660
1667
|
d,
|
|
1661
|
-
|
|
1668
|
+
h,
|
|
1662
1669
|
g,
|
|
1663
|
-
|
|
1670
|
+
X,
|
|
1664
1671
|
Ae,
|
|
1665
|
-
|
|
1666
|
-
]),
|
|
1672
|
+
ke
|
|
1673
|
+
]), at = H(
|
|
1667
1674
|
async (A) => {
|
|
1668
1675
|
if (!(_ != null && _.userId))
|
|
1669
1676
|
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
@@ -1679,79 +1686,79 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1679
1686
|
},
|
|
1680
1687
|
[_ == null ? void 0 : _.userId]
|
|
1681
1688
|
);
|
|
1682
|
-
return
|
|
1689
|
+
return Sn(a, {
|
|
1683
1690
|
onChannelChanged: (A) => {
|
|
1684
1691
|
var I;
|
|
1685
|
-
A.isGroupChannel() && A.url === (
|
|
1692
|
+
A.isGroupChannel() && A.url === (f == null ? void 0 : f.url) && (c.info("messengerSession.channelChanged: channel.conversation", A.conversation), C({ url: A.url, status: ((I = A.conversation) == null ? void 0 : I.status) ?? j.OPEN }));
|
|
1686
1693
|
},
|
|
1687
1694
|
async onUserJoined(A, I) {
|
|
1688
|
-
var
|
|
1689
|
-
if (A.conversation && A.conversation.type === Br.PROACTIVE && I.userId === ((
|
|
1695
|
+
var P, Ce;
|
|
1696
|
+
if (A.conversation && A.conversation.type === Br.PROACTIVE && I.userId === ((P = a.currentUser) == null ? void 0 : P.userId)) {
|
|
1690
1697
|
c.info("messengerSession.onUserJoined: proactive channel joined", A.url);
|
|
1691
|
-
const
|
|
1692
|
-
C({ url: A.url, status:
|
|
1698
|
+
const le = ((Ce = A.conversation) == null ? void 0 : Ce.status) ?? j.OPEN;
|
|
1699
|
+
C({ url: A.url, status: le }), l.setOpened(!0), _i({
|
|
1693
1700
|
sound: document.hidden || !l.opened
|
|
1694
1701
|
});
|
|
1695
1702
|
}
|
|
1696
1703
|
}
|
|
1697
|
-
}),
|
|
1704
|
+
}), _r(n, () => {
|
|
1698
1705
|
const A = async () => {
|
|
1699
|
-
if (!
|
|
1700
|
-
return await a.groupChannel.getChannel(
|
|
1706
|
+
if (!f) throw new Error("No active conversation. Please start a conversation first.");
|
|
1707
|
+
return await a.groupChannel.getChannel(f.url);
|
|
1701
1708
|
};
|
|
1702
1709
|
return {
|
|
1703
|
-
activeChannel:
|
|
1710
|
+
activeChannel: f,
|
|
1704
1711
|
chatSDK: a,
|
|
1705
1712
|
deauthenticate: async () => {
|
|
1706
|
-
c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0),
|
|
1713
|
+
c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0), Y(null), ae(null), v(null), _ && (Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: _.userId }), c.debug("messengerSession.deauthenticate: cleared user session cache")), c.debug("messengerSession.deauthenticate: completed");
|
|
1707
1714
|
},
|
|
1708
1715
|
updateContext: async (I) => {
|
|
1709
|
-
const
|
|
1710
|
-
return { ...
|
|
1716
|
+
const P = await (await A()).updateContext(i, I);
|
|
1717
|
+
return { ...P, context: P.context ?? {} };
|
|
1711
1718
|
},
|
|
1712
1719
|
patchContext: async (I) => {
|
|
1713
|
-
const
|
|
1714
|
-
return { ...
|
|
1720
|
+
const P = await (await A()).patchContext(i, I);
|
|
1721
|
+
return { ...P, context: P.context ?? {} };
|
|
1715
1722
|
},
|
|
1716
1723
|
getContextObject: async () => {
|
|
1717
1724
|
const M = await (await A()).getContextObject(i);
|
|
1718
1725
|
return { ...M, context: M.context ?? {} };
|
|
1719
1726
|
}
|
|
1720
1727
|
};
|
|
1721
|
-
}, [
|
|
1728
|
+
}, [f, E, a, o, _, i]), D(() => {
|
|
1722
1729
|
async function A() {
|
|
1723
1730
|
c.debug("messengerSession.initialize: start");
|
|
1724
|
-
const I =
|
|
1731
|
+
const I = it(), M = await a.aiAgent.requestMessengerSettings({
|
|
1725
1732
|
aiAgentId: i,
|
|
1726
1733
|
userId: I == null ? void 0 : I.userId,
|
|
1727
1734
|
language: d,
|
|
1728
|
-
country:
|
|
1735
|
+
country: h,
|
|
1729
1736
|
context: g,
|
|
1730
|
-
forceCreateChannel:
|
|
1737
|
+
forceCreateChannel: X,
|
|
1731
1738
|
knownActiveChannelUrl: Ae(I == null ? void 0 : I.userId)
|
|
1732
1739
|
});
|
|
1733
1740
|
c.debug("messengerSession.initialize: messenger settings response", M);
|
|
1734
|
-
let
|
|
1741
|
+
let P = null;
|
|
1735
1742
|
if (M.auto_created_user) {
|
|
1736
|
-
const { user_id:
|
|
1737
|
-
Ge.set({ appId: o, aiAgentId: i }, { userId:
|
|
1743
|
+
const { user_id: K, session_token: W, expire_at: G } = M.auto_created_user;
|
|
1744
|
+
Ge.set({ appId: o, aiAgentId: i }, { userId: K, authToken: W, expireAt: G }), P = { userId: K, authToken: W };
|
|
1738
1745
|
} else
|
|
1739
|
-
|
|
1746
|
+
P = {
|
|
1740
1747
|
userId: (I == null ? void 0 : I.userId) ?? "",
|
|
1741
1748
|
authToken: (I == null ? void 0 : I.authToken) ?? ""
|
|
1742
1749
|
};
|
|
1743
|
-
|
|
1750
|
+
ke(P.userId, M.active_channel.channel_url);
|
|
1744
1751
|
function Ce() {
|
|
1745
|
-
const
|
|
1746
|
-
x(
|
|
1747
|
-
const
|
|
1752
|
+
const K = M.appearance.selected_theme;
|
|
1753
|
+
x(K, (G) => {
|
|
1754
|
+
const N = M.appearance.themes[G];
|
|
1748
1755
|
return {
|
|
1749
|
-
primaryColor:
|
|
1750
|
-
botMessageBackgroundColor:
|
|
1751
|
-
primaryContrastColor:
|
|
1752
|
-
botMessageBackgroundContrastColor:
|
|
1756
|
+
primaryColor: N.primary_color,
|
|
1757
|
+
botMessageBackgroundColor: N.bot_message_bg_color,
|
|
1758
|
+
primaryContrastColor: N.primary_contrast_color,
|
|
1759
|
+
botMessageBackgroundContrastColor: N.bot_message_bg_contrast_color
|
|
1753
1760
|
};
|
|
1754
|
-
}),
|
|
1761
|
+
}), k(void 0), Y(P), ae({
|
|
1755
1762
|
userId: M.bot.bot_userid,
|
|
1756
1763
|
profileUrl: M.bot.bot_profile_url,
|
|
1757
1764
|
nickname: M.bot.bot_nickname,
|
|
@@ -1762,17 +1769,19 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1762
1769
|
}), v({
|
|
1763
1770
|
type: M.launcher.image_type || "default_icon",
|
|
1764
1771
|
imageUrl: M.launcher.image_url
|
|
1765
|
-
}),
|
|
1772
|
+
}), Ee(
|
|
1773
|
+
Ci[M.active_channel.attachment_mode] ?? re.HANDED_OFF_ONLY
|
|
1774
|
+
), M.launcher.auto_open && !Pe() && setTimeout(() => l.setOpened(!0), 500);
|
|
1766
1775
|
}
|
|
1767
|
-
function
|
|
1768
|
-
C({ url: M.active_channel.channel_url, status:
|
|
1776
|
+
function le() {
|
|
1777
|
+
C({ url: M.active_channel.channel_url, status: j.OPEN });
|
|
1769
1778
|
}
|
|
1770
1779
|
try {
|
|
1771
1780
|
Ce();
|
|
1772
|
-
const
|
|
1773
|
-
await
|
|
1774
|
-
} catch (
|
|
1775
|
-
|
|
1781
|
+
const K = (W) => Y((G) => G ? { ...G, authToken: W } : null);
|
|
1782
|
+
await b(P, e == null ? void 0 : e.sessionHandler, K), le();
|
|
1783
|
+
} catch (K) {
|
|
1784
|
+
K instanceof Error && (c.error("messengerSession.initialize: failed to connect", K), k(K));
|
|
1776
1785
|
}
|
|
1777
1786
|
}
|
|
1778
1787
|
A().catch((I) => {
|
|
@@ -1781,22 +1790,23 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1781
1790
|
}, [a, o, i, e == null ? void 0 : e.userId, e == null ? void 0 : e.authToken]), D(() => {
|
|
1782
1791
|
p != null && p.onRegisterDeauthenticateHandler && (c.debug("messengerSession: registering deauthenticate handler"), p.onRegisterDeauthenticateHandler(E));
|
|
1783
1792
|
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, E]), !_ || !L || !xe ? null : /* @__PURE__ */ r.createElement(
|
|
1784
|
-
|
|
1793
|
+
vi,
|
|
1785
1794
|
{
|
|
1786
1795
|
value: {
|
|
1787
1796
|
userSession: _,
|
|
1788
|
-
activeChannel:
|
|
1789
|
-
refreshActiveChannel:
|
|
1790
|
-
createConversation:
|
|
1797
|
+
activeChannel: f,
|
|
1798
|
+
refreshActiveChannel: st,
|
|
1799
|
+
createConversation: at,
|
|
1791
1800
|
connectionError: y,
|
|
1792
1801
|
aiAgentInfo: { ...L, ...s == null ? void 0 : s.bot },
|
|
1793
|
-
launcherInfo: { ...xe, ...s == null ? void 0 : s.launcher }
|
|
1802
|
+
launcherInfo: { ...xe, ...s == null ? void 0 : s.launcher },
|
|
1803
|
+
attachmentMode: V
|
|
1794
1804
|
}
|
|
1795
1805
|
},
|
|
1796
1806
|
t
|
|
1797
1807
|
);
|
|
1798
1808
|
});
|
|
1799
|
-
function
|
|
1809
|
+
function _i({ sound: e }) {
|
|
1800
1810
|
const t = "🔔You have received a new message", n = document.title, o = setInterval(() => {
|
|
1801
1811
|
document.title = document.title === t ? n : t;
|
|
1802
1812
|
}, 750);
|
|
@@ -1804,35 +1814,35 @@ function vi({ sound: e }) {
|
|
|
1804
1814
|
new Audio(i.default).play();
|
|
1805
1815
|
});
|
|
1806
1816
|
}
|
|
1807
|
-
const
|
|
1817
|
+
const q = (e) => {
|
|
1808
1818
|
const t = e;
|
|
1809
1819
|
return typeof t == "number" ? `${t}px` : t;
|
|
1810
|
-
},
|
|
1820
|
+
}, w = ({
|
|
1811
1821
|
as: e,
|
|
1812
1822
|
variant: t = "body1",
|
|
1813
1823
|
color: n,
|
|
1814
1824
|
className: o,
|
|
1815
1825
|
...i
|
|
1816
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
1817
|
-
let n =
|
|
1818
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1826
|
+
}) => /* @__PURE__ */ r.createElement(Ti, { as: e, $variant: t, className: o, $color: n, ...i }), Yt = /* @__PURE__ */ new WeakMap(), Si = (e, t) => {
|
|
1827
|
+
let n = Yt.get(t);
|
|
1828
|
+
n || (n = /* @__PURE__ */ new Map(), Yt.set(t, n));
|
|
1819
1829
|
const o = n.get(e);
|
|
1820
1830
|
if (o) return o;
|
|
1821
|
-
const i = t[e] ?? t.body1, a = $`font-size:${
|
|
1831
|
+
const i = t[e] ?? t.body1, a = $`font-size:${q(i.fontSize)};font-weight:${i.fontWeight};${i.fontFamily ? `font-family: ${i.fontFamily};` : ""}
|
|
1822
1832
|
${i.lineHeight ? `line-height: ${i.lineHeight};` : "line-height: 100%;"}
|
|
1823
1833
|
`;
|
|
1824
1834
|
return n.set(e, a), a;
|
|
1825
|
-
},
|
|
1826
|
-
function
|
|
1835
|
+
}, Ti = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => Si(e, t.typography)}color:${({ $color: e }) => e};`, Fe = 244, Un = 640, Je = 26, Hn = 4, ie = 12, we = 2, wi = 16, se = `${Q}-incoming-msg`, ki = `${Q}-marked-text`;
|
|
1836
|
+
function wt(e) {
|
|
1827
1837
|
switch (e) {
|
|
1828
1838
|
case "top":
|
|
1829
1839
|
case "middle":
|
|
1830
|
-
return
|
|
1840
|
+
return we;
|
|
1831
1841
|
default:
|
|
1832
|
-
return
|
|
1842
|
+
return wi;
|
|
1833
1843
|
}
|
|
1834
1844
|
}
|
|
1835
|
-
function
|
|
1845
|
+
function kt(e, t) {
|
|
1836
1846
|
if (t) {
|
|
1837
1847
|
const [, n] = t.split("/");
|
|
1838
1848
|
if (n)
|
|
@@ -1845,104 +1855,105 @@ function Tt(e, t) {
|
|
|
1845
1855
|
}
|
|
1846
1856
|
return "FILE";
|
|
1847
1857
|
}
|
|
1848
|
-
function
|
|
1858
|
+
function zn(e) {
|
|
1849
1859
|
return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
|
|
1850
1860
|
}
|
|
1851
|
-
const
|
|
1852
|
-
spinner:
|
|
1853
|
-
chat:
|
|
1854
|
-
message:
|
|
1855
|
-
error:
|
|
1856
|
-
info:
|
|
1857
|
-
refresh:
|
|
1858
|
-
"chevron-down":
|
|
1859
|
-
"chevron-right":
|
|
1860
|
-
done:
|
|
1861
|
-
user:
|
|
1862
|
-
"file-document":
|
|
1863
|
-
download:
|
|
1864
|
-
attach:
|
|
1865
|
-
delete:
|
|
1866
|
-
close:
|
|
1867
|
-
"close-filled":
|
|
1868
|
-
send:
|
|
1869
|
-
menu:
|
|
1870
|
-
expand:
|
|
1871
|
-
collapse:
|
|
1872
|
-
agent:
|
|
1873
|
-
question:
|
|
1874
|
-
actionbook:
|
|
1875
|
-
function:
|
|
1876
|
-
"radio-on":
|
|
1877
|
-
"radio-off":
|
|
1878
|
-
confluence:
|
|
1879
|
-
zendesk:
|
|
1880
|
-
salesforce:
|
|
1881
|
-
sprinklr:
|
|
1882
|
-
website:
|
|
1883
|
-
snippet:
|
|
1884
|
-
template:
|
|
1861
|
+
const Ai = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), Ii = {
|
|
1862
|
+
spinner: T(() => import("./BcUGcaq2.js")),
|
|
1863
|
+
chat: T(() => import("./DcFCGVBm.js")),
|
|
1864
|
+
message: T(() => import("./DsGXnanX.js")),
|
|
1865
|
+
error: T(() => import("./B6fvrWGq.js")),
|
|
1866
|
+
info: T(() => import("./CAIYsKDy.js")),
|
|
1867
|
+
refresh: T(() => import("./B6xd54zt.js")),
|
|
1868
|
+
"chevron-down": T(() => import("./BsimU71m.js")),
|
|
1869
|
+
"chevron-right": T(() => import("./NmJl7zv3.js")),
|
|
1870
|
+
done: T(() => import("./D_q6g3Dd.js")),
|
|
1871
|
+
user: T(() => import("./CvqfQEhO.js")),
|
|
1872
|
+
"file-document": T(() => import("./BAr50pfO.js")),
|
|
1873
|
+
download: T(() => import("./B2CtcWp3.js")),
|
|
1874
|
+
attach: T(() => import("./DY2ULcTX.js")),
|
|
1875
|
+
delete: T(() => import("./DMruRpOm.js")),
|
|
1876
|
+
close: T(() => import("./CuaBI7kd.js")),
|
|
1877
|
+
"close-filled": T(() => import("./CxQFWLnW.js")),
|
|
1878
|
+
send: T(() => import("./DZJyDpNp.js")),
|
|
1879
|
+
menu: T(() => import("./BUYabNz7.js")),
|
|
1880
|
+
expand: T(() => import("./wBtIAuNm.js")),
|
|
1881
|
+
collapse: T(() => import("./C0RFfifL.js")),
|
|
1882
|
+
agent: T(() => import("./Cc7XmLN1.js")),
|
|
1883
|
+
question: T(() => import("./dqwvRBog.js")),
|
|
1884
|
+
actionbook: T(() => import("./CrjNuryZ.js")),
|
|
1885
|
+
function: T(() => import("./CvdSjw1c.js")),
|
|
1886
|
+
"radio-on": T(() => import("./nmdo2Fbj.js")),
|
|
1887
|
+
"radio-off": T(() => import("./BnZcRFmS.js")),
|
|
1888
|
+
confluence: T(() => import("./BOnlh2zd.js")),
|
|
1889
|
+
zendesk: T(() => import("./BAJ6LEKc.js")),
|
|
1890
|
+
salesforce: T(() => import("./CT2kv4lr.js")),
|
|
1891
|
+
sprinklr: T(() => import("./m2INcyV2.js")),
|
|
1892
|
+
website: T(() => import("./BgGVGNdg.js")),
|
|
1893
|
+
snippet: T(() => import("./BFcXPuf5.js")),
|
|
1894
|
+
template: T(() => import("./awO7aBCv.js")),
|
|
1895
|
+
source: T(() => import("./_EVMCh6Y.js"))
|
|
1885
1896
|
}, O = ({ type: e, size: t = 24, className: n, color: o }) => {
|
|
1886
|
-
const i =
|
|
1897
|
+
const i = Ii[e];
|
|
1887
1898
|
return /* @__PURE__ */ r.createElement(
|
|
1888
|
-
|
|
1899
|
+
Mi,
|
|
1889
1900
|
{
|
|
1890
1901
|
className: n,
|
|
1891
|
-
$rtlFlip:
|
|
1902
|
+
$rtlFlip: Ai.has(e),
|
|
1892
1903
|
$size: t,
|
|
1893
|
-
$color: o ??
|
|
1904
|
+
$color: o ?? m.color.primary.main
|
|
1894
1905
|
},
|
|
1895
1906
|
/* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(i, null))
|
|
1896
1907
|
);
|
|
1897
|
-
},
|
|
1898
|
-
function
|
|
1908
|
+
}, $i = $`[dir='rtl'] &{transform:scaleX(-1);}`, Mi = u.div`width:${({ $size: e }) => q(e)};height:${({ $size: e }) => q(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 && $i};`;
|
|
1909
|
+
function At({
|
|
1899
1910
|
name: e,
|
|
1900
1911
|
type: t = "FILE",
|
|
1901
1912
|
iconColor: n,
|
|
1902
1913
|
iconBackgroundColor: o,
|
|
1903
1914
|
onClick: i
|
|
1904
1915
|
}) {
|
|
1905
|
-
const { colors: a } =
|
|
1906
|
-
return /* @__PURE__ */ r.createElement(
|
|
1916
|
+
const { colors: a } = Ct();
|
|
1917
|
+
return /* @__PURE__ */ r.createElement(Oi, { onClick: i, $clickable: !!i }, /* @__PURE__ */ r.createElement(Ri, { $bgColor: o ?? a.base.primary }, /* @__PURE__ */ r.createElement(O, { type: "file-document", size: 24, color: n ?? a.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Di, null, /* @__PURE__ */ r.createElement(Ni, { variant: "button", color: m.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(w, { color: m.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
1907
1918
|
}
|
|
1908
|
-
const
|
|
1909
|
-
function
|
|
1910
|
-
return /* @__PURE__ */ r.createElement(
|
|
1911
|
-
|
|
1919
|
+
const Oi = u.div`border-radius:12px;gap:8px;width:${Fe}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 && Li}`, Li = $`cursor:pointer;&:hover{background-color:${m.themedColor.bg_100_500};}`, Ri = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Di = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ni = u(w)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
1920
|
+
function Pi({ file: e, children: t, onClickFile: n }) {
|
|
1921
|
+
return /* @__PURE__ */ r.createElement(Fi, null, /* @__PURE__ */ r.createElement(
|
|
1922
|
+
At,
|
|
1912
1923
|
{
|
|
1913
1924
|
name: e.name,
|
|
1914
|
-
type:
|
|
1925
|
+
type: kt(e.name, e.type),
|
|
1915
1926
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
1916
1927
|
}
|
|
1917
1928
|
), t);
|
|
1918
1929
|
}
|
|
1919
|
-
const
|
|
1920
|
-
function
|
|
1921
|
-
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(
|
|
1930
|
+
const Fi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${we}px;`;
|
|
1931
|
+
function Bi({ file: e, onClickMedia: t, children: n }) {
|
|
1932
|
+
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(zi, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Vi, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
|
|
1922
1933
|
if (o) {
|
|
1923
1934
|
const i = {
|
|
1924
|
-
id: `${
|
|
1935
|
+
id: `${se}-media-body`,
|
|
1925
1936
|
onClick: () => t == null ? void 0 : t(e)
|
|
1926
1937
|
};
|
|
1927
|
-
return /* @__PURE__ */ r.createElement(
|
|
1938
|
+
return /* @__PURE__ */ r.createElement(Ui, null, /* @__PURE__ */ r.createElement(Hi, { ...i }, o()), n);
|
|
1928
1939
|
}
|
|
1929
1940
|
return null;
|
|
1930
1941
|
}
|
|
1931
|
-
const
|
|
1932
|
-
background-color: ${
|
|
1942
|
+
const Ui = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${we}px;`, Hi = u.div`width:${Fe}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${F.light`
|
|
1943
|
+
background-color: ${m.color.background100};
|
|
1933
1944
|
`}
|
|
1934
|
-
${
|
|
1935
|
-
background-color: ${
|
|
1945
|
+
${F.dark`
|
|
1946
|
+
background-color: ${m.color.background400};
|
|
1936
1947
|
`}
|
|
1937
|
-
`,
|
|
1938
|
-
function
|
|
1939
|
-
const t = new RegExp(`${
|
|
1940
|
-
return e.replace(t, (n) => `<span id=${
|
|
1948
|
+
`, zi = u.img`width:100%;height:100%;object-fit:cover;`, Vi = u.video`width:100%;height:100%;object-fit:cover;`, Wi = "✱";
|
|
1949
|
+
function Vn(e) {
|
|
1950
|
+
const t = new RegExp(`${Wi}+`, "g");
|
|
1951
|
+
return e.replace(t, (n) => `<span id=${ki} aria-label="masked-text">${n}</span>`);
|
|
1941
1952
|
}
|
|
1942
|
-
function
|
|
1953
|
+
function Gi(e) {
|
|
1943
1954
|
return e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>");
|
|
1944
1955
|
}
|
|
1945
|
-
function
|
|
1956
|
+
function ji(e) {
|
|
1946
1957
|
const t = /```(\w+)?\n([\s\S]*?)```/g, n = [];
|
|
1947
1958
|
let o = 0;
|
|
1948
1959
|
return e.replace(t, (i, ...a) => {
|
|
@@ -1958,97 +1969,114 @@ function Wi(e) {
|
|
|
1958
1969
|
}), o < e.length && n.push({
|
|
1959
1970
|
type: "text",
|
|
1960
1971
|
value: e.slice(o).trim()
|
|
1961
|
-
}), n.map((i) => i.type !== "text" ? i : { ...i, value:
|
|
1972
|
+
}), n.map((i) => i.type !== "text" ? i : { ...i, value: Vn(i.value) });
|
|
1962
1973
|
}
|
|
1963
|
-
const
|
|
1964
|
-
function
|
|
1974
|
+
const Ki = T(async () => ({ default: (await import("./DZK-INdk.js")).MarkdownText })), Zi = T(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
|
|
1975
|
+
function qt(e) {
|
|
1965
1976
|
var i, a;
|
|
1966
|
-
const t = e.maxBodyWidth ??
|
|
1967
|
-
id: `${
|
|
1977
|
+
const t = e.maxBodyWidth ?? Fe, n = pe(() => ji(e.message), [e.message]), o = {
|
|
1978
|
+
id: `${se}-text-body`,
|
|
1968
1979
|
$maxWidth: t,
|
|
1969
1980
|
$color: (i = e.customStyle) == null ? void 0 : i.bubbleContentColor,
|
|
1970
1981
|
$bgColor: (a = e.customStyle) == null ? void 0 : a.bubbleBackgroundColor
|
|
1971
1982
|
};
|
|
1972
|
-
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(
|
|
1983
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Jt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Jt, { ...o }, n.map((s, l) => s.type === "text" ? /* @__PURE__ */ r.createElement(Xt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(Oe, { fallback: s.value }, /* @__PURE__ */ r.createElement(Ki, { onClickImage: (c) => {
|
|
1973
1984
|
var d;
|
|
1974
1985
|
return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
|
|
1975
|
-
} }, s.value))) : s.type === "code" ? /* @__PURE__ */ r.createElement(Oe, { key: l, fallback: /* @__PURE__ */ r.createElement(
|
|
1986
|
+
} }, s.value))) : s.type === "code" ? /* @__PURE__ */ r.createElement(Oe, { key: l, fallback: /* @__PURE__ */ r.createElement(Xt, { variant: "body3" }, s.value) }, /* @__PURE__ */ r.createElement(Zi, { code: s.value, language: s.language })) : null), e.children);
|
|
1976
1987
|
}
|
|
1977
|
-
const
|
|
1988
|
+
const Jt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
|
|
1978
1989
|
color: ${t || e.colors.messageIncoming.text};
|
|
1979
1990
|
background-color: ${n || e.colors.messageIncoming.background};
|
|
1980
1991
|
`}
|
|
1981
1992
|
padding: 12px 0;
|
|
1982
1993
|
transition: max-width 0.3s;
|
|
1983
1994
|
overflow-wrap: break-word;
|
|
1984
|
-
`,
|
|
1985
|
-
function
|
|
1986
|
-
const { stringSet: t } = R(), n =
|
|
1995
|
+
`, Xt = u(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
1996
|
+
function Yi(e) {
|
|
1997
|
+
const { stringSet: t } = R(), n = zn(e) ? /* @__PURE__ */ r.createElement(qt, { ...e }) : null;
|
|
1987
1998
|
if (e.messageType === "user")
|
|
1988
1999
|
return n;
|
|
1989
2000
|
if (e.messageType === "file") {
|
|
1990
2001
|
const o = e.file;
|
|
1991
|
-
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(
|
|
2002
|
+
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Bi, { ...e }, n) : /* @__PURE__ */ r.createElement(Pi, { ...e }, n);
|
|
1992
2003
|
}
|
|
1993
|
-
return /* @__PURE__ */ r.createElement(
|
|
2004
|
+
return /* @__PURE__ */ r.createElement(qt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
1994
2005
|
}
|
|
1995
|
-
const
|
|
1996
|
-
function
|
|
1997
|
-
return /* @__PURE__ */ r.createElement(
|
|
2006
|
+
const It = (e) => /* @__PURE__ */ r.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.0008 0.973633C10.6172 0.973633 9.49558 2.09527 9.49558 3.47888C9.49558 4.50705 10.115 5.39055 11.0009 5.77664V7.47887H13.0009V5.77653C13.8868 5.3904 14.5061 4.50696 14.5061 3.47888C14.5061 2.09527 13.3844 0.973633 12.0008 0.973633ZM0.250977 16.5788L0.250977 10.5789H2.25098L2.25098 16.5788H0.250977ZM21.7511 10.5789V16.5788H23.7511V10.5789H21.7511ZM18.251 7.47888H3.25097V18.9789C3.25097 20.3596 4.37026 21.4789 5.75097 21.4789H18.251C19.6317 21.4789 20.751 20.3596 20.751 18.9789V9.97887C20.751 8.59816 19.6317 7.47888 18.251 7.47888ZM9.78434 11.9539V15.2038C9.78434 15.7561 9.33663 16.2038 8.78434 16.2038C8.23206 16.2038 7.78434 15.7561 7.78434 15.2038V11.9539C7.78434 11.4016 8.23206 10.9539 8.78434 10.9539C9.33663 10.9539 9.78434 11.4016 9.78434 11.9539ZM16.2677 11.9539V15.2038C16.2677 15.7561 15.82 16.2038 15.2677 16.2038C14.7154 16.2038 14.2677 15.7561 14.2677 15.2038V11.9539C14.2677 11.4016 14.7154 10.9539 15.2677 10.9539C15.82 10.9539 16.2677 11.4016 16.2677 11.9539Z", fill: "#0D0D0D" }));
|
|
2007
|
+
function $t({ id: e, src: t, size: n = 56, onClick: o, style: i }) {
|
|
2008
|
+
return /* @__PURE__ */ r.createElement(qi, { id: e, tabIndex: 0, onClick: o, $size: q(n), style: i }, t ? /* @__PURE__ */ r.createElement(Ji, { src: t }) : /* @__PURE__ */ r.createElement(O, { type: "user", size: n }));
|
|
1998
2009
|
}
|
|
1999
|
-
const
|
|
2000
|
-
function
|
|
2001
|
-
const n = `${
|
|
2002
|
-
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(
|
|
2010
|
+
const qi = u.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${m.themedColor.bg_100_500};&:focus{outline:none;}`, Ji = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
2011
|
+
function Xi({ sender: e, isBotMessage: t }) {
|
|
2012
|
+
const n = `${se}-sender-avatar`;
|
|
2013
|
+
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Qi, { id: n }, /* @__PURE__ */ r.createElement(It, null)) : /* @__PURE__ */ r.createElement($t, { id: n, size: Je, src: e.profileUrl });
|
|
2003
2014
|
}
|
|
2004
|
-
const
|
|
2005
|
-
function
|
|
2006
|
-
return /* @__PURE__ */ r.createElement(
|
|
2015
|
+
const Qi = u.div`flex-shrink:0;width:${Je}px;height:${Je}px;box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary};path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}}`;
|
|
2016
|
+
function es({ sender: e }) {
|
|
2017
|
+
return /* @__PURE__ */ r.createElement(ts, { id: `${se}-sender-name`, variant: "caption1", color: m.themedColor.textMidEmphasis }, e.nickname);
|
|
2007
2018
|
}
|
|
2008
|
-
const
|
|
2009
|
-
function
|
|
2019
|
+
const ts = u(w)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
2020
|
+
function ns({ createdAt: e }) {
|
|
2010
2021
|
const { stringSet: t, format: n } = R();
|
|
2011
|
-
return e ? /* @__PURE__ */ r.createElement(
|
|
2022
|
+
return e ? /* @__PURE__ */ r.createElement(w, { id: `${se}-sent-time`, variant: "caption4", color: m.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2012
2023
|
}
|
|
2013
|
-
function
|
|
2014
|
-
return /* @__PURE__ */ r.createElement(
|
|
2024
|
+
function rs({ customStyle: e }) {
|
|
2025
|
+
return /* @__PURE__ */ r.createElement(os, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(is, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
|
|
2015
2026
|
}
|
|
2016
|
-
const
|
|
2027
|
+
const os = u.div`align-items:center;border-radius:12px;display:flex;gap:6px;justify-content:center;padding:16px 12px;background-color:${({ theme: e, $bgColor: t }) => t || e.colors.messageIncoming.background};`, is = u.span`animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px;background:${({ theme: e, $color: t }) => t || e.colors.messageIncoming.text};@keyframes blink{0%{opacity:0.12;transform:scale(1);}21.43%{opacity:0.38;transform:scale(1.2);}42.86%{opacity:0.12;transform:scale(1);}100%{opacity:0.12;transform:scale(1);}}&:nth-child(1){animation-delay:0.4s;}&:nth-child(2){animation-delay:0.6s;}&:nth-child(3){animation-delay:0.8s;}`;
|
|
2017
2028
|
function Le() {
|
|
2018
2029
|
}
|
|
2019
|
-
async function
|
|
2030
|
+
async function Mt(e) {
|
|
2020
2031
|
let t = e;
|
|
2021
2032
|
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
2022
2033
|
}
|
|
2023
|
-
function Vn(e) {
|
|
2024
|
-
return !e || !e.conversation ? !1 : e.conversation.status === W.CLOSED;
|
|
2025
|
-
}
|
|
2026
2034
|
function Wn(e) {
|
|
2027
|
-
return !e || !e.conversation ? !1 : e.conversation.status ===
|
|
2035
|
+
return !e || !e.conversation ? !1 : e.conversation.status === j.CLOSED;
|
|
2028
2036
|
}
|
|
2029
2037
|
function Gn(e) {
|
|
2038
|
+
return !e || !e.conversation ? !1 : e.conversation.status === j.OPEN;
|
|
2039
|
+
}
|
|
2040
|
+
function jn(e) {
|
|
2030
2041
|
var n;
|
|
2031
2042
|
const t = (n = e == null ? void 0 : e.conversation) == null ? void 0 : n.handoff;
|
|
2032
2043
|
return !!(t != null && t.timestamp);
|
|
2033
2044
|
}
|
|
2034
|
-
function
|
|
2035
|
-
return
|
|
2045
|
+
function ss(e) {
|
|
2046
|
+
return Gn(e) && !jn(e);
|
|
2036
2047
|
}
|
|
2037
|
-
function
|
|
2048
|
+
function as({
|
|
2038
2049
|
extendedMessagePayload: e,
|
|
2039
|
-
onClickCTA: t = ({ url: n }) =>
|
|
2050
|
+
onClickCTA: t = ({ url: n }) => Mt(n)
|
|
2040
2051
|
}) {
|
|
2041
2052
|
const n = e == null ? void 0 : e.cta_button;
|
|
2042
|
-
return n ? /* @__PURE__ */ r.createElement(
|
|
2053
|
+
return n ? /* @__PURE__ */ r.createElement(ls, { id: `${se}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(cs, { variant: "button" }, n.label)) : null;
|
|
2043
2054
|
}
|
|
2044
|
-
const
|
|
2045
|
-
background-color: ${
|
|
2055
|
+
const ls = u.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`
|
|
2056
|
+
background-color: ${m.color.ondark.textDisabled};
|
|
2046
2057
|
`}
|
|
2047
|
-
`,
|
|
2048
|
-
function
|
|
2058
|
+
`, cs = u(w)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
|
|
2059
|
+
function ds({
|
|
2060
|
+
extendedMessagePayload: e,
|
|
2061
|
+
onClickCitation: t = (n) => Mt(n.link)
|
|
2062
|
+
}) {
|
|
2063
|
+
const { stringSet: n } = R(), { theme: o } = vt(), i = e == null ? void 0 : e.citations;
|
|
2064
|
+
return !i || i.length === 0 ? null : /* @__PURE__ */ r.createElement(us, { id: `${se}-ext-citation` }, /* @__PURE__ */ r.createElement(ms, { variant: "caption1", color: o.colors.messageIncoming.text }, n.CITATION_SOURCE_TITLE), /* @__PURE__ */ r.createElement(hs, null, i.map((a, s) => /* @__PURE__ */ r.createElement(
|
|
2065
|
+
ps,
|
|
2066
|
+
{
|
|
2067
|
+
key: `${a.embedding_id}-${s}`,
|
|
2068
|
+
role: "button",
|
|
2069
|
+
onClick: () => t(a)
|
|
2070
|
+
},
|
|
2071
|
+
/* @__PURE__ */ r.createElement(O, { type: "source", size: 16, color: o.colors.messageIncoming.text }),
|
|
2072
|
+
/* @__PURE__ */ r.createElement(gs, { variant: "body3", color: o.colors.messageIncoming.text }, a.title)
|
|
2073
|
+
))));
|
|
2074
|
+
}
|
|
2075
|
+
const us = u.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;padding:8px 12px 6px;`, ms = u(w)`opacity:0.5;`, hs = u.div`display:flex;flex-direction:column;gap:8px;`, gs = u(w)`text-decoration:underline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, ps = u.div`display:flex;align-items:center;gap:4px;cursor:pointer;&:hover{opacity:0.5;}`;
|
|
2076
|
+
function fs(e) {
|
|
2049
2077
|
return /* @__PURE__ */ r.createElement(r.Fragment, null);
|
|
2050
2078
|
}
|
|
2051
|
-
class
|
|
2079
|
+
class bs extends Sr {
|
|
2052
2080
|
constructor(t) {
|
|
2053
2081
|
super(t), this.state = {
|
|
2054
2082
|
hasError: !1
|
|
@@ -2061,31 +2089,31 @@ class cs extends _r {
|
|
|
2061
2089
|
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(Oe, { fallback: this.props.loadingFallback }, this.props.children);
|
|
2062
2090
|
}
|
|
2063
2091
|
}
|
|
2064
|
-
const
|
|
2065
|
-
parser:
|
|
2066
|
-
renderer:
|
|
2092
|
+
const xs = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: Es } = Kr({
|
|
2093
|
+
parser: Gr,
|
|
2094
|
+
renderer: Wr,
|
|
2067
2095
|
Container: (e) => /* @__PURE__ */ r.createElement("div", { ...e })
|
|
2068
2096
|
});
|
|
2069
|
-
function
|
|
2097
|
+
function Cs(e) {
|
|
2070
2098
|
return /* @__PURE__ */ r.createElement(
|
|
2071
|
-
|
|
2099
|
+
bs,
|
|
2072
2100
|
{
|
|
2073
2101
|
errorFallback: e.messageTemplateErrorFallback,
|
|
2074
2102
|
loadingFallback: e.messageTemplateLoadingFallback
|
|
2075
2103
|
},
|
|
2076
|
-
/* @__PURE__ */ r.createElement(
|
|
2104
|
+
/* @__PURE__ */ r.createElement(vs, { ...e })
|
|
2077
2105
|
);
|
|
2078
2106
|
}
|
|
2079
|
-
const
|
|
2107
|
+
const vs = ({
|
|
2080
2108
|
extendedMessagePayload: e,
|
|
2081
2109
|
onGetCachedMessageTemplate: t = () => null,
|
|
2082
2110
|
onRequestMessageTemplate: n,
|
|
2083
2111
|
onHandleTemplateInternalAction: o = Le
|
|
2084
2112
|
}) => {
|
|
2085
2113
|
const i = e == null ? void 0 : e.message_template;
|
|
2086
|
-
if (!
|
|
2114
|
+
if (!xs.has((i == null ? void 0 : i.type) ?? "default")) throw new Error("Unsupported template type");
|
|
2087
2115
|
if (!n) throw new Error("onRequestMessageTemplate is required");
|
|
2088
|
-
const { theme: s } =
|
|
2116
|
+
const { theme: s } = si(), l = jo({
|
|
2089
2117
|
onRequestTemplate: n,
|
|
2090
2118
|
onGetCachedTemplate: t,
|
|
2091
2119
|
theme: s.selectedTheme,
|
|
@@ -2094,24 +2122,24 @@ const hs = ({
|
|
|
2094
2122
|
viewVariables: i == null ? void 0 : i.view_variables,
|
|
2095
2123
|
aiAgentColorVariables: s.aiAgentColorVariables
|
|
2096
2124
|
});
|
|
2097
|
-
return /* @__PURE__ */ r.createElement(
|
|
2098
|
-
|
|
2125
|
+
return /* @__PURE__ */ r.createElement(ys, { id: `${se}-ext-message-template` }, /* @__PURE__ */ r.createElement(
|
|
2126
|
+
jr,
|
|
2099
2127
|
{
|
|
2100
2128
|
handleInternalAction: (c, d) => {
|
|
2101
2129
|
c.stopPropagation(), o == null || o(d);
|
|
2102
2130
|
}
|
|
2103
2131
|
},
|
|
2104
|
-
/* @__PURE__ */ r.createElement(
|
|
2132
|
+
/* @__PURE__ */ r.createElement(Es, { templateItems: l.body.items, templateVersion: l.version })
|
|
2105
2133
|
));
|
|
2106
|
-
},
|
|
2107
|
-
function
|
|
2134
|
+
}, ys = u.div`box-sizing:border-box;overflow:hidden;width:100%;`;
|
|
2135
|
+
function _s({
|
|
2108
2136
|
extendedMessagePayload: e,
|
|
2109
2137
|
onClickSuggestedReply: t,
|
|
2110
2138
|
suggestedRepliesDirection: n = "vertical"
|
|
2111
2139
|
}) {
|
|
2112
2140
|
const [o, i] = S(!1), a = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
2113
|
-
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(
|
|
2114
|
-
|
|
2141
|
+
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(Ss, { id: `${se}-ext-suggested-replies`, $type: n }, a.map((s, l) => /* @__PURE__ */ r.createElement(
|
|
2142
|
+
Ts,
|
|
2115
2143
|
{
|
|
2116
2144
|
key: l,
|
|
2117
2145
|
$type: n,
|
|
@@ -2123,121 +2151,122 @@ function ps({
|
|
|
2123
2151
|
s
|
|
2124
2152
|
)));
|
|
2125
2153
|
}
|
|
2126
|
-
const
|
|
2127
|
-
${e === "vertical" ?
|
|
2154
|
+
const Ss = u.div`margin:16px 0;padding:0 ${ie}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? ws : ks};`, Ts = u(w)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${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 }) => $`
|
|
2155
|
+
${e === "vertical" ? As : Is};
|
|
2128
2156
|
&:active {
|
|
2129
2157
|
background-color: ${t.colors.base.primary};
|
|
2130
2158
|
color: ${t.colors.base.primaryContrastContent};
|
|
2131
2159
|
}
|
|
2132
2160
|
`}
|
|
2133
|
-
`,
|
|
2134
|
-
function
|
|
2161
|
+
`, ws = $`flex-direction:column;align-items:flex-end;`, ks = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, As = $`max-width:calc(100% - 70px);white-space:pre-wrap;`, Is = $`white-space:nowrap;`;
|
|
2162
|
+
function Ot(e) {
|
|
2135
2163
|
return e();
|
|
2136
2164
|
}
|
|
2137
|
-
const
|
|
2138
|
-
template:
|
|
2165
|
+
const ye = Te({
|
|
2166
|
+
template: $s,
|
|
2139
2167
|
components: {
|
|
2140
|
-
SenderName:
|
|
2141
|
-
SenderAvatar:
|
|
2142
|
-
SentTime:
|
|
2143
|
-
MessageBody:
|
|
2144
|
-
TypingIndicator:
|
|
2145
|
-
SuggestedReplies:
|
|
2146
|
-
MessageTemplate:
|
|
2147
|
-
CTAButton:
|
|
2148
|
-
|
|
2168
|
+
SenderName: es,
|
|
2169
|
+
SenderAvatar: Xi,
|
|
2170
|
+
SentTime: ns,
|
|
2171
|
+
MessageBody: Yi,
|
|
2172
|
+
TypingIndicator: rs,
|
|
2173
|
+
SuggestedReplies: _s,
|
|
2174
|
+
MessageTemplate: Cs,
|
|
2175
|
+
CTAButton: as,
|
|
2176
|
+
Citation: ds,
|
|
2177
|
+
MessageLogs: fs
|
|
2149
2178
|
}
|
|
2150
2179
|
});
|
|
2151
|
-
function
|
|
2152
|
-
return /* @__PURE__ */ r.createElement(
|
|
2180
|
+
function $s(e) {
|
|
2181
|
+
return /* @__PURE__ */ r.createElement(Kn, { ...e, testerMode: !1 });
|
|
2153
2182
|
}
|
|
2154
|
-
function
|
|
2155
|
-
var
|
|
2156
|
-
const { components: t } =
|
|
2157
|
-
return /* @__PURE__ */ r.createElement(
|
|
2183
|
+
function Kn(e) {
|
|
2184
|
+
var p, x, b, E, f;
|
|
2185
|
+
const { components: t } = ye.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((p = e.extendedMessagePayload) != null && p.message_template), a = !!((x = e.extendedMessagePayload) != null && x.cta_button), s = !!((b = e.extendedMessagePayload) != null && b.citations) && e.extendedMessagePayload.citations.length > 0, l = !!e.createdAt, c = Ot(() => e.messageType === "user" ? e.message.length > 0 : !0), d = e.groupType === "top" || e.groupType === "single", h = e.groupType === "bottom" || e.groupType === "single", g = o ? 0 : Je;
|
|
2186
|
+
return /* @__PURE__ */ r.createElement(Ms, { $marginBottom: n ? 0 : wt(e.groupType) }, d && /* @__PURE__ */ r.createElement(Os, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Ht, null, /* @__PURE__ */ r.createElement(dt, { $extraStartPadding: g }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, a && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })), s && /* @__PURE__ */ r.createElement(t.Citation, { ...e }))), i && /* @__PURE__ */ r.createElement(Qt, { $startPadding: 0, $endPadding: 0, style: { marginTop: c ? we : 0 } }, /* @__PURE__ */ r.createElement(
|
|
2158
2187
|
t.MessageTemplate,
|
|
2159
2188
|
{
|
|
2160
2189
|
...e,
|
|
2161
|
-
messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(
|
|
2190
|
+
messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(dt, { $extraStartPadding: g }, /* @__PURE__ */ r.createElement(
|
|
2162
2191
|
t.MessageBody,
|
|
2163
2192
|
{
|
|
2164
2193
|
...e,
|
|
2165
2194
|
messageType: "user",
|
|
2166
|
-
message: ((f = (
|
|
2195
|
+
message: ((f = (E = e.extendedMessagePayload) == null ? void 0 : E.message_template) == null ? void 0 : f.fallback_message) ?? "Cannot read this template."
|
|
2167
2196
|
}
|
|
2168
2197
|
)),
|
|
2169
|
-
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(
|
|
2198
|
+
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(dt, { $extraStartPadding: g }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
|
|
2170
2199
|
}
|
|
2171
|
-
))),
|
|
2200
|
+
))), h && l && /* @__PURE__ */ r.createElement(Ls, { $extraStartPadding: g + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Ht, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(Qt, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
|
|
2172
2201
|
}
|
|
2173
|
-
const
|
|
2202
|
+
const Ms = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2174
2203
|
`, ot = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2175
2204
|
padding-inline: ${e + n}px ${t}px;
|
|
2176
2205
|
`}
|
|
2177
|
-
`,
|
|
2206
|
+
`, Os = u(ot)`display:flex;flex-direction:row;align-items:center;gap:8px;`, dt = u(ot)`display:flex;`, Ls = u(ot)`margin-top:${Hn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, Qt = u(ot)`display:flex;flex-direction:column;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2178
2207
|
padding-inline: ${e + n}px ${t}px;
|
|
2179
2208
|
`}
|
|
2180
2209
|
`;
|
|
2181
|
-
function
|
|
2182
|
-
return /* @__PURE__ */ r.createElement(
|
|
2183
|
-
|
|
2210
|
+
function Rs({ file: e, children: t, onClickFile: n }) {
|
|
2211
|
+
return /* @__PURE__ */ r.createElement(Ds, null, /* @__PURE__ */ r.createElement(
|
|
2212
|
+
At,
|
|
2184
2213
|
{
|
|
2185
2214
|
name: e.name,
|
|
2186
|
-
type:
|
|
2215
|
+
type: kt(e.name, e.type),
|
|
2187
2216
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
2188
2217
|
}
|
|
2189
2218
|
), t);
|
|
2190
2219
|
}
|
|
2191
|
-
const
|
|
2192
|
-
function
|
|
2220
|
+
const Ds = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${we}px;`, Zn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(Ns, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(O, { type: "spinner", size: n })), Ns = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => q(e)};height:${({ $size: e }) => q(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
2221
|
+
function Ps({ file: e, metadata: t, onClickMedia: n, children: o }) {
|
|
2193
2222
|
const { aspectRatio: i, localFile: a } = t, [s] = S(() => a instanceof File ? URL.createObjectURL(a) : e.url), [l, c] = S(!1), d = {
|
|
2194
2223
|
onClick: () => n == null ? void 0 : n(e),
|
|
2195
2224
|
$ratio: i
|
|
2196
2225
|
};
|
|
2197
|
-
return /* @__PURE__ */ r.createElement(
|
|
2226
|
+
return /* @__PURE__ */ r.createElement(Fs, null, /* @__PURE__ */ r.createElement(Bs, { ...d }, !l && /* @__PURE__ */ r.createElement(Zn, { size: 26 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Us, { $loaded: l, src: s, alt: "image-message", onLoad: () => c(!0) })), o);
|
|
2198
2227
|
}
|
|
2199
|
-
const
|
|
2200
|
-
background-color: ${
|
|
2228
|
+
const Fs = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${we}px;`, Bs = u.div`width:${Fe}px;border-radius:12px;overflow:hidden;cursor:pointer;height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${F.light`
|
|
2229
|
+
background-color: ${m.color.background100};
|
|
2201
2230
|
`}
|
|
2202
|
-
${
|
|
2203
|
-
background-color: ${
|
|
2231
|
+
${F.dark`
|
|
2232
|
+
background-color: ${m.color.background400};
|
|
2204
2233
|
`}
|
|
2205
|
-
`,
|
|
2206
|
-
function
|
|
2234
|
+
`, Us = u.img`position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0;object-fit:cover;opacity:${(e) => e.$loaded ? 1 : 0};transition:opacity 0.5s ease;`;
|
|
2235
|
+
function en(e) {
|
|
2207
2236
|
var n, o;
|
|
2208
|
-
const t =
|
|
2209
|
-
const i =
|
|
2210
|
-
return
|
|
2237
|
+
const t = pe(() => {
|
|
2238
|
+
const i = Gi(Vn(e.message));
|
|
2239
|
+
return wn.sanitize(i);
|
|
2211
2240
|
}, [e.message]);
|
|
2212
2241
|
return /* @__PURE__ */ r.createElement(
|
|
2213
|
-
|
|
2242
|
+
Hs,
|
|
2214
2243
|
{
|
|
2215
|
-
$maxWidth: e.maxBodyWidth ??
|
|
2244
|
+
$maxWidth: e.maxBodyWidth ?? Fe,
|
|
2216
2245
|
$color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
|
|
2217
2246
|
$bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
|
|
2218
2247
|
},
|
|
2219
|
-
/* @__PURE__ */ r.createElement(
|
|
2248
|
+
/* @__PURE__ */ r.createElement(zs, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
|
|
2220
2249
|
);
|
|
2221
2250
|
}
|
|
2222
|
-
const
|
|
2251
|
+
const Hs = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
|
|
2223
2252
|
color: ${t || e.colors.messageOutgoing.text};
|
|
2224
2253
|
background-color: ${n || e.colors.messageOutgoing.background};
|
|
2225
2254
|
`}
|
|
2226
2255
|
padding: 12px 0;
|
|
2227
2256
|
transition: max-width 0.3s;
|
|
2228
2257
|
overflow-wrap: break-word;
|
|
2229
|
-
`,
|
|
2230
|
-
function
|
|
2231
|
-
const { stringSet: t } = R(), n =
|
|
2232
|
-
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(
|
|
2258
|
+
`, zs = u(w)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2259
|
+
function Vs(e) {
|
|
2260
|
+
const { stringSet: t } = R(), n = zn(e) ? /* @__PURE__ */ r.createElement(en, { ...e }) : null;
|
|
2261
|
+
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Ps, { ...e }, n) : /* @__PURE__ */ r.createElement(Rs, { ...e }, n) : /* @__PURE__ */ r.createElement(en, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
2233
2262
|
}
|
|
2234
|
-
function
|
|
2235
|
-
const t =
|
|
2263
|
+
function Ws({ sendingStatus: e }) {
|
|
2264
|
+
const t = Ct();
|
|
2236
2265
|
switch (e) {
|
|
2237
2266
|
case "pending":
|
|
2238
|
-
return /* @__PURE__ */ r.createElement(
|
|
2267
|
+
return /* @__PURE__ */ r.createElement(Gs, { size: 16 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
2239
2268
|
case "failed":
|
|
2240
|
-
return /* @__PURE__ */ r.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ r.createElement(O, { type: "error", color:
|
|
2269
|
+
return /* @__PURE__ */ r.createElement("div", { style: { marginBottom: 2 } }, /* @__PURE__ */ r.createElement(O, { type: "error", color: m.themedColor.error, size: 16 }));
|
|
2241
2270
|
case "scheduled":
|
|
2242
2271
|
case "canceled":
|
|
2243
2272
|
return null;
|
|
@@ -2245,41 +2274,41 @@ function Ns({ sendingStatus: e }) {
|
|
|
2245
2274
|
return /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(O, { type: "chevron-down" }));
|
|
2246
2275
|
}
|
|
2247
2276
|
}
|
|
2248
|
-
const
|
|
2249
|
-
function
|
|
2277
|
+
const Gs = u(Zn)`margin-bottom:2px;width:16px;height:16px;`;
|
|
2278
|
+
function js({ createdAt: e }) {
|
|
2250
2279
|
const { stringSet: t, format: n } = R();
|
|
2251
|
-
return e ? /* @__PURE__ */ r.createElement(
|
|
2280
|
+
return e ? /* @__PURE__ */ r.createElement(w, { variant: "caption4", color: m.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2252
2281
|
}
|
|
2253
|
-
const
|
|
2254
|
-
template:
|
|
2282
|
+
const Lt = Te({
|
|
2283
|
+
template: Ks,
|
|
2255
2284
|
components: {
|
|
2256
|
-
SendingStatus:
|
|
2257
|
-
SentTime:
|
|
2258
|
-
MessageBody:
|
|
2285
|
+
SendingStatus: Ws,
|
|
2286
|
+
SentTime: js,
|
|
2287
|
+
MessageBody: Vs
|
|
2259
2288
|
}
|
|
2260
2289
|
});
|
|
2261
|
-
function
|
|
2262
|
-
const { components: t } =
|
|
2263
|
-
return /* @__PURE__ */ r.createElement(
|
|
2290
|
+
function Ks(e) {
|
|
2291
|
+
const { components: t } = Lt.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
|
|
2292
|
+
return /* @__PURE__ */ r.createElement(Zs, { $marginBottom: wt(e.groupType) }, /* @__PURE__ */ r.createElement(Ys, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(qs, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
|
|
2264
2293
|
}
|
|
2265
|
-
const
|
|
2266
|
-
`,
|
|
2267
|
-
`,
|
|
2268
|
-
function
|
|
2269
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(
|
|
2294
|
+
const Zs = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2295
|
+
`, Yn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = ie, $endPadding: t = ie, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
|
|
2296
|
+
`, Ys = u(Yn)``, qs = u(Yn)`margin-top:${Hn}px;`;
|
|
2297
|
+
function Js(e) {
|
|
2298
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Xs, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: m.themedColor.textMidEmphasis }, Qs(wn.sanitize(e.message))));
|
|
2270
2299
|
}
|
|
2271
|
-
const
|
|
2300
|
+
const Xs = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Qs = (e) => {
|
|
2272
2301
|
const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, n = [];
|
|
2273
2302
|
let o = 0;
|
|
2274
2303
|
return e.replace(t, (i, a, s, l) => (n.push(e.slice(o, l)), n.push(
|
|
2275
|
-
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel:
|
|
2304
|
+
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel: Tt }, a)
|
|
2276
2305
|
), o = l + i.length, i)), n.push(e.slice(o)), n;
|
|
2277
|
-
},
|
|
2306
|
+
}, ea = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
|
|
2278
2307
|
const { stringSet: i } = R();
|
|
2279
2308
|
return D(() => {
|
|
2280
2309
|
typeof n > "u" && typeof t == "boolean" && (o == null || o(t));
|
|
2281
|
-
}, [n, t]), /* @__PURE__ */ r.createElement(
|
|
2282
|
-
|
|
2310
|
+
}, [n, t]), /* @__PURE__ */ r.createElement(ta, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: m.themedColor.textMidEmphasis }, i.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
|
|
2311
|
+
tn,
|
|
2283
2312
|
{
|
|
2284
2313
|
checked: n === !0,
|
|
2285
2314
|
label: i.CSAT_CRE_SOLVED,
|
|
@@ -2287,7 +2316,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2287
2316
|
onClick: () => o == null ? void 0 : o(!0)
|
|
2288
2317
|
}
|
|
2289
2318
|
), /* @__PURE__ */ r.createElement(
|
|
2290
|
-
|
|
2319
|
+
tn,
|
|
2291
2320
|
{
|
|
2292
2321
|
checked: n === !1,
|
|
2293
2322
|
label: i.CSAT_CRE_NOT_SOLVED,
|
|
@@ -2295,17 +2324,17 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2295
2324
|
onClick: () => o == null ? void 0 : o(!1)
|
|
2296
2325
|
}
|
|
2297
2326
|
)));
|
|
2298
|
-
},
|
|
2299
|
-
const i = t ?
|
|
2300
|
-
return /* @__PURE__ */ r.createElement(
|
|
2301
|
-
}, Ks = u.div`display:flex;flex-direction:column;gap:8px;`, Zs = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, Ys = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08301 20C2.08301 10.1049 10.1046 2.08334 19.9997 2.08334C29.8948 2.08334 37.9163 10.1049 37.9163 20C37.9163 29.8952 29.8948 37.9167 19.9997 37.9167C10.1046 37.9167 2.08301 29.8952 2.08301 20Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5824 29.3328C13.1344 29.7473 13.918 29.636 14.3326 29.084C15.6269 27.3607 17.6835 26.25 19.9997 26.25C22.316 26.25 24.3727 27.3607 25.6668 29.084C26.0815 29.636 26.865 29.7473 27.4172 29.3328C27.9692 28.9182 28.0805 28.1347 27.6658 27.5825C25.9198 25.2577 23.1357 23.75 19.9997 23.75C16.8638 23.75 14.0797 25.2577 12.3336 27.5825C11.919 28.1347 12.0304 28.9182 12.5824 29.3328Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M28.4449 13.7707C29.1324 13.8328 29.64 14.4406 29.578 15.1281C29.516 15.8153 28.909 16.3221 28.2219 16.2608C28.2219 16.2608 28.0282 16.2502 27.9267 16.2487C27.7224 16.2457 27.4382 16.2509 27.1224 16.2833C26.7864 16.3177 26.4644 16.3782 26.1799 16.4662L26.304 16.86C26.7792 18.3675 25.5094 19.5813 24.2057 19.5813C23.504 19.5813 22.8319 19.2617 22.4295 18.6857C22.0025 18.0745 21.9417 17.241 22.4075 16.5344C22.7505 16.0143 23.2444 15.3831 23.8959 14.8657C24.8355 14.1195 26.0435 13.8809 26.867 13.7963C27.3024 13.7517 28.0149 13.7319 28.4449 13.7707Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M11.5553 13.7707C10.8677 13.8328 10.3601 14.4406 10.4221 15.1281C10.4842 15.8153 11.0912 16.3221 11.7782 16.2608C11.7782 16.2608 11.972 16.2502 12.0734 16.2487C12.2778 16.2457 12.562 16.2509 12.8778 16.2833C13.2137 16.3177 13.5357 16.3782 13.8203 16.4662L13.6962 16.86C13.2209 18.3675 14.4907 19.5813 15.7944 19.5813C16.4962 19.5813 17.1683 19.2617 17.5707 18.6857C17.9975 18.0745 18.0585 17.241 17.5925 16.5344C17.2497 16.0143 16.7557 15.3831 16.1043 14.8657C15.1646 14.1195 13.9566 13.8809 13.1331 13.7963C12.6978 13.7517 11.9853 13.7319 11.5553 13.7707Z", fill: "black", fillOpacity: 0.12 })), qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08337 19.9999C2.08337 10.1048 10.1049 2.08325 20 2.08325C29.8952 2.08325 37.9167 10.1048 37.9167 19.9999C37.9167 29.8951 29.8952 37.9166 20 37.9166C10.1049 37.9166 2.08337 29.8951 2.08337 19.9999Z", fill: "url(#paint0_linear_159_173206)" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5828 29.3328C13.1348 29.7473 13.9184 29.636 14.3329 29.084C15.6272 27.3607 17.6839 26.25 20 26.25C22.3164 26.25 24.373 27.3607 25.6672 29.084C26.0819 29.636 26.8654 29.7473 27.4175 29.3328C27.9695 28.9182 28.0809 28.1347 27.6662 27.5825C25.9202 25.2577 23.136 23.75 20 23.75C16.8642 23.75 14.0801 25.2577 12.334 27.5825C11.9194 28.1347 12.0308 28.9182 12.5828 29.3328Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M28.4454 13.7707C29.1329 13.8328 29.6405 14.4406 29.5785 15.1281C29.5165 15.8153 28.9095 16.3221 28.2224 16.2608C28.2224 16.2608 28.0287 16.2502 27.9272 16.2487C27.7229 16.2457 27.4387 16.2509 27.1229 16.2833C26.7869 16.3177 26.4649 16.3782 26.1804 16.4662L26.3045 16.86C26.7797 18.3675 25.5099 19.5813 24.2062 19.5813C23.5045 19.5813 22.8324 19.2617 22.43 18.6857C22.003 18.0745 21.9422 17.241 22.408 16.5344C22.751 16.0143 23.2449 15.3831 23.8964 14.8657C24.836 14.1195 26.044 13.8809 26.8675 13.7963C27.3029 13.7517 28.0154 13.7319 28.4454 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.5549 13.7707C10.8674 13.8328 10.3597 14.4406 10.4218 15.1281C10.4838 15.8153 11.0908 16.3221 11.7779 16.2608C11.7779 16.2608 11.9716 16.2502 12.073 16.2487C12.2774 16.2457 12.5616 16.2509 12.8774 16.2833C13.2134 16.3177 13.5353 16.3782 13.8199 16.4662L13.6958 16.86C13.2205 18.3675 14.4904 19.5813 15.794 19.5813C16.4958 19.5813 17.168 19.2617 17.5703 18.6857C17.9971 18.0745 18.0581 17.241 17.5921 16.5344C17.2493 16.0143 16.7553 15.3831 16.1039 14.8657C15.1643 14.1195 13.9562 13.8809 13.1327 13.7963C12.6974 13.7517 11.9849 13.7319 11.5549 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ r.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ r.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), Js = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M15 28.333C16.3927 27.2867 18.124 26.6667 20 26.6667C21.876 26.6667 23.6073 27.2867 25 28.333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 13.3511C11.667 13.3511 14.0161 13.139 15.3268 14.18M15.3268 14.18L14.8882 15.5711C14.7153 16.1199 15.1675 16.6667 15.7943 16.6667C16.4531 16.6667 16.8882 16.0723 16.549 15.5579C16.2483 15.102 15.8388 14.5866 15.3268 14.18ZM23.3337 13.3511C23.3337 13.3511 25.6827 13.139 26.9935 14.18M26.9935 14.18L26.555 15.5711C26.382 16.1199 26.8342 16.6667 27.461 16.6667C28.1198 16.6667 28.5548 16.0723 28.2157 15.5579C27.915 15.102 27.5055 14.5866 26.9935 14.18Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), Xs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { d: "M14.249 27.334C15.851 26.13 17.844 25.417 20 25.417c2.156 0 4.149.714 5.751 1.917.553.415.664 1.199.25 1.751-.415.552-1.199.664-1.751.25-1.183-.889-2.652-1.416-4.25-1.416s-3.067.527-4.25 1.416c-.553.414-1.336.302-1.751-.25-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M23.445 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.125-.394c-.285-.088-.607-.148-.942-.182-.316-.033-.6-.038-.804-.035-.101.002-.242.01-.294.013Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.779 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.124-.394c-.284-.088-.606-.148-.941-.182-.316-.033-.6-.038-.804-.035-.101.002-.243.01-.294.013Z", fill: "#141B34" })), Qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), ea = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.75 26.667c0-.691.56-1.25 1.25-1.25h10c.69 0 1.25.559 1.25 1.25 0 .691-.56 1.25-1.25 1.25h-10c-.69 0-1.25-.559-1.25-1.25Z", fill: "#141B34" })), ta = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.333 25C14.8532 27.024 17.2735 28.3333 19.9997 28.3333C22.7258 28.3333 25.1462 27.024 26.6663 25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), na = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.583 24.001c.552-.414 1.335-.302 1.75.25 1.294 1.723 3.35 2.834 5.667 2.834s4.373-1.11 5.667-2.834c.415-.552 1.199-.664 1.751-.25.552.415.664 1.199.25 1.751C25.92 28.076 23.136 29.584 20 29.584s-5.92-1.508-7.666-3.832c-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" })), ra = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6663C29.2044 36.6663 36.6663 29.2044 36.6663 19.9997C36.6663 10.7949 29.2044 3.33301 19.9997 3.33301C10.7949 3.33301 3.33301 10.7949 3.33301 19.9997C3.33301 29.2044 10.7949 36.6663 19.9997 36.6663Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M19.9997 30C23.16 30 25.8145 27.867 26.56 24.9832C26.9068 23.6413 26.4033 23.3333 25.0765 23.3333H14.9228C13.5959 23.3333 13.0925 23.6413 13.4393 24.9832C14.1848 27.867 16.8393 30 19.9997 30Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.8333C11.667 14.4526 12.7863 13.3333 14.167 13.3333C15.5477 13.3333 16.667 14.4526 16.667 15.8333M23.3337 15.8333C23.3337 14.4526 24.453 13.3333 25.8337 13.3333C27.2143 13.3333 28.3337 14.4526 28.3337 15.8333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), oa = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("mask", { id: "mask0_159_173224", style: {
|
|
2327
|
+
}, tn = ({ onClick: e, checked: t, label: n, disabled: o }) => {
|
|
2328
|
+
const i = t ? m.color.primary.main : o ? m.themedColor.textDisabled : m.themedColor.textLowEmphasis, a = t ? m.themedColor.textHighEmphasis : o ? m.themedColor.textLowEmphasis : m.themedColor.textHighEmphasis;
|
|
2329
|
+
return /* @__PURE__ */ r.createElement(na, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(O, { size: 24, type: t ? "radio-on" : "radio-off", color: i }), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: a }, n));
|
|
2330
|
+
}, ta = u.div`display:flex;flex-direction:column;gap:8px;`, na = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, ra = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08301 20C2.08301 10.1049 10.1046 2.08334 19.9997 2.08334C29.8948 2.08334 37.9163 10.1049 37.9163 20C37.9163 29.8952 29.8948 37.9167 19.9997 37.9167C10.1046 37.9167 2.08301 29.8952 2.08301 20Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5824 29.3328C13.1344 29.7473 13.918 29.636 14.3326 29.084C15.6269 27.3607 17.6835 26.25 19.9997 26.25C22.316 26.25 24.3727 27.3607 25.6668 29.084C26.0815 29.636 26.865 29.7473 27.4172 29.3328C27.9692 28.9182 28.0805 28.1347 27.6658 27.5825C25.9198 25.2577 23.1357 23.75 19.9997 23.75C16.8638 23.75 14.0797 25.2577 12.3336 27.5825C11.919 28.1347 12.0304 28.9182 12.5824 29.3328Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M28.4449 13.7707C29.1324 13.8328 29.64 14.4406 29.578 15.1281C29.516 15.8153 28.909 16.3221 28.2219 16.2608C28.2219 16.2608 28.0282 16.2502 27.9267 16.2487C27.7224 16.2457 27.4382 16.2509 27.1224 16.2833C26.7864 16.3177 26.4644 16.3782 26.1799 16.4662L26.304 16.86C26.7792 18.3675 25.5094 19.5813 24.2057 19.5813C23.504 19.5813 22.8319 19.2617 22.4295 18.6857C22.0025 18.0745 21.9417 17.241 22.4075 16.5344C22.7505 16.0143 23.2444 15.3831 23.8959 14.8657C24.8355 14.1195 26.0435 13.8809 26.867 13.7963C27.3024 13.7517 28.0149 13.7319 28.4449 13.7707Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M11.5553 13.7707C10.8677 13.8328 10.3601 14.4406 10.4221 15.1281C10.4842 15.8153 11.0912 16.3221 11.7782 16.2608C11.7782 16.2608 11.972 16.2502 12.0734 16.2487C12.2778 16.2457 12.562 16.2509 12.8778 16.2833C13.2137 16.3177 13.5357 16.3782 13.8203 16.4662L13.6962 16.86C13.2209 18.3675 14.4907 19.5813 15.7944 19.5813C16.4962 19.5813 17.1683 19.2617 17.5707 18.6857C17.9975 18.0745 18.0585 17.241 17.5925 16.5344C17.2497 16.0143 16.7557 15.3831 16.1043 14.8657C15.1646 14.1195 13.9566 13.8809 13.1331 13.7963C12.6978 13.7517 11.9853 13.7319 11.5553 13.7707Z", fill: "black", fillOpacity: 0.12 })), oa = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08337 19.9999C2.08337 10.1048 10.1049 2.08325 20 2.08325C29.8952 2.08325 37.9167 10.1048 37.9167 19.9999C37.9167 29.8951 29.8952 37.9166 20 37.9166C10.1049 37.9166 2.08337 29.8951 2.08337 19.9999Z", fill: "url(#paint0_linear_159_173206)" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5828 29.3328C13.1348 29.7473 13.9184 29.636 14.3329 29.084C15.6272 27.3607 17.6839 26.25 20 26.25C22.3164 26.25 24.373 27.3607 25.6672 29.084C26.0819 29.636 26.8654 29.7473 27.4175 29.3328C27.9695 28.9182 28.0809 28.1347 27.6662 27.5825C25.9202 25.2577 23.136 23.75 20 23.75C16.8642 23.75 14.0801 25.2577 12.334 27.5825C11.9194 28.1347 12.0308 28.9182 12.5828 29.3328Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M28.4454 13.7707C29.1329 13.8328 29.6405 14.4406 29.5785 15.1281C29.5165 15.8153 28.9095 16.3221 28.2224 16.2608C28.2224 16.2608 28.0287 16.2502 27.9272 16.2487C27.7229 16.2457 27.4387 16.2509 27.1229 16.2833C26.7869 16.3177 26.4649 16.3782 26.1804 16.4662L26.3045 16.86C26.7797 18.3675 25.5099 19.5813 24.2062 19.5813C23.5045 19.5813 22.8324 19.2617 22.43 18.6857C22.003 18.0745 21.9422 17.241 22.408 16.5344C22.751 16.0143 23.2449 15.3831 23.8964 14.8657C24.836 14.1195 26.044 13.8809 26.8675 13.7963C27.3029 13.7517 28.0154 13.7319 28.4454 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.5549 13.7707C10.8674 13.8328 10.3597 14.4406 10.4218 15.1281C10.4838 15.8153 11.0908 16.3221 11.7779 16.2608C11.7779 16.2608 11.9716 16.2502 12.073 16.2487C12.2774 16.2457 12.5616 16.2509 12.8774 16.2833C13.2134 16.3177 13.5353 16.3782 13.8199 16.4662L13.6958 16.86C13.2205 18.3675 14.4904 19.5813 15.794 19.5813C16.4958 19.5813 17.168 19.2617 17.5703 18.6857C17.9971 18.0745 18.0581 17.241 17.5921 16.5344C17.2493 16.0143 16.7553 15.3831 16.1039 14.8657C15.1643 14.1195 13.9562 13.8809 13.1327 13.7963C12.6974 13.7517 11.9849 13.7319 11.5549 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ r.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ r.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), ia = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M15 28.333C16.3927 27.2867 18.124 26.6667 20 26.6667C21.876 26.6667 23.6073 27.2867 25 28.333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 13.3511C11.667 13.3511 14.0161 13.139 15.3268 14.18M15.3268 14.18L14.8882 15.5711C14.7153 16.1199 15.1675 16.6667 15.7943 16.6667C16.4531 16.6667 16.8882 16.0723 16.549 15.5579C16.2483 15.102 15.8388 14.5866 15.3268 14.18ZM23.3337 13.3511C23.3337 13.3511 25.6827 13.139 26.9935 14.18M26.9935 14.18L26.555 15.5711C26.382 16.1199 26.8342 16.6667 27.461 16.6667C28.1198 16.6667 28.5548 16.0723 28.2157 15.5579C27.915 15.102 27.5055 14.5866 26.9935 14.18Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), sa = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { d: "M14.249 27.334C15.851 26.13 17.844 25.417 20 25.417c2.156 0 4.149.714 5.751 1.917.553.415.664 1.199.25 1.751-.415.552-1.199.664-1.751.25-1.183-.889-2.652-1.416-4.25-1.416s-3.067.527-4.25 1.416c-.553.414-1.336.302-1.751-.25-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M23.445 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.125-.394c-.285-.088-.607-.148-.942-.182-.316-.033-.6-.038-.804-.035-.101.002-.242.01-.294.013Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.779 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.124-.394c-.284-.088-.606-.148-.941-.182-.316-.033-.6-.038-.804-.035-.101.002-.243.01-.294.013Z", fill: "#141B34" })), aa = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), la = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.75 26.667c0-.691.56-1.25 1.25-1.25h10c.69 0 1.25.559 1.25 1.25 0 .691-.56 1.25-1.25 1.25h-10c-.69 0-1.25-.559-1.25-1.25Z", fill: "#141B34" })), ca = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.333 25C14.8532 27.024 17.2735 28.3333 19.9997 28.3333C22.7258 28.3333 25.1462 27.024 26.6663 25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), da = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.583 24.001c.552-.414 1.335-.302 1.75.25 1.294 1.723 3.35 2.834 5.667 2.834s4.373-1.11 5.667-2.834c.415-.552 1.199-.664 1.751-.25.552.415.664 1.199.25 1.751C25.92 28.076 23.136 29.584 20 29.584s-5.92-1.508-7.666-3.832c-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" })), ua = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6663C29.2044 36.6663 36.6663 29.2044 36.6663 19.9997C36.6663 10.7949 29.2044 3.33301 19.9997 3.33301C10.7949 3.33301 3.33301 10.7949 3.33301 19.9997C3.33301 29.2044 10.7949 36.6663 19.9997 36.6663Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M19.9997 30C23.16 30 25.8145 27.867 26.56 24.9832C26.9068 23.6413 26.4033 23.3333 25.0765 23.3333H14.9228C13.5959 23.3333 13.0925 23.6413 13.4393 24.9832C14.1848 27.867 16.8393 30 19.9997 30Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.8333C11.667 14.4526 12.7863 13.3333 14.167 13.3333C15.5477 13.3333 16.667 14.4526 16.667 15.8333M23.3337 15.8333C23.3337 14.4526 24.453 13.3333 25.8337 13.3333C27.2143 13.3333 28.3337 14.4526 28.3337 15.8333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), ma = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("mask", { id: "mask0_159_173224", style: {
|
|
2302
2331
|
maskType: "alpha"
|
|
2303
|
-
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 32.998c3.278 0 5.936-1.594 5.936-3.561 0-1.968-2.658-3.562-5.936-3.562-3.278 0-5.936 1.594-5.936 3.562 0 1.967 2.658 3.561 5.936 3.561Z", fill: "#FF493B" }))), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5M23.333 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5", stroke: "#141B34", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ r.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))),
|
|
2332
|
+
}, maskUnits: "userSpaceOnUse", x: 12, y: 22, width: 16, height: 9 }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("g", { mask: "url(#mask0_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 32.998c3.278 0 5.936-1.594 5.936-3.561 0-1.968-2.658-3.562-5.936-3.562-3.278 0-5.936 1.594-5.936 3.562 0 1.967 2.658 3.561 5.936 3.561Z", fill: "#FF493B" }))), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5M23.333 15.833c0-1.381 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5", stroke: "#141B34", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ r.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: 15.83, height: 7.915, fill: "white", transform: "translate(12.085 22.709)" })))), ha = [
|
|
2304
2333
|
{
|
|
2305
2334
|
value: 1,
|
|
2306
2335
|
Icon: {
|
|
2307
|
-
Active:
|
|
2308
|
-
Inactive:
|
|
2336
|
+
Active: oa,
|
|
2337
|
+
Inactive: ra
|
|
2309
2338
|
},
|
|
2310
2339
|
isActive: (e) => e <= 1,
|
|
2311
2340
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_1
|
|
@@ -2313,8 +2342,8 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2313
2342
|
{
|
|
2314
2343
|
value: 2,
|
|
2315
2344
|
Icon: {
|
|
2316
|
-
Active:
|
|
2317
|
-
Inactive:
|
|
2345
|
+
Active: sa,
|
|
2346
|
+
Inactive: ia
|
|
2318
2347
|
},
|
|
2319
2348
|
isActive: (e) => e === 2,
|
|
2320
2349
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_2
|
|
@@ -2322,8 +2351,8 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2322
2351
|
{
|
|
2323
2352
|
value: 3,
|
|
2324
2353
|
Icon: {
|
|
2325
|
-
Active:
|
|
2326
|
-
Inactive:
|
|
2354
|
+
Active: la,
|
|
2355
|
+
Inactive: aa
|
|
2327
2356
|
},
|
|
2328
2357
|
isActive: (e) => e === 3,
|
|
2329
2358
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_3
|
|
@@ -2331,8 +2360,8 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2331
2360
|
{
|
|
2332
2361
|
value: 4,
|
|
2333
2362
|
Icon: {
|
|
2334
|
-
Active:
|
|
2335
|
-
Inactive:
|
|
2363
|
+
Active: da,
|
|
2364
|
+
Inactive: ca
|
|
2336
2365
|
},
|
|
2337
2366
|
isActive: (e) => e === 4,
|
|
2338
2367
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_4
|
|
@@ -2340,13 +2369,13 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2340
2369
|
{
|
|
2341
2370
|
value: 5,
|
|
2342
2371
|
Icon: {
|
|
2343
|
-
Active:
|
|
2344
|
-
Inactive:
|
|
2372
|
+
Active: ma,
|
|
2373
|
+
Inactive: ua
|
|
2345
2374
|
},
|
|
2346
2375
|
isActive: (e) => 5 <= e,
|
|
2347
2376
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_5
|
|
2348
2377
|
}
|
|
2349
|
-
],
|
|
2378
|
+
], ga = () => ha, qn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(xt, null, t, /* @__PURE__ */ r.createElement(ba, { $position: n }, /* @__PURE__ */ r.createElement(xa, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(pa, { $position: n }))), pa = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
2350
2379
|
"svg",
|
|
2351
2380
|
{
|
|
2352
2381
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -2356,14 +2385,14 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2356
2385
|
viewBox: "0 0 12 6",
|
|
2357
2386
|
fill: "none"
|
|
2358
2387
|
},
|
|
2359
|
-
/* @__PURE__ */ r.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill:
|
|
2360
|
-
),
|
|
2388
|
+
/* @__PURE__ */ r.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: m.themedColor.textHighEmphasis })
|
|
2389
|
+
), fa = {
|
|
2361
2390
|
top: $`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
2362
2391
|
bottom: $`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
2363
|
-
},
|
|
2364
|
-
const { stringSet: o } = R(), i =
|
|
2365
|
-
return /* @__PURE__ */ r.createElement(
|
|
2366
|
-
|
|
2392
|
+
}, xt = u.div`position:relative;`, ba = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${be.TOOLTIP};${({ $position: e }) => fa[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${xt}:hover &,${xt}:focus-within &{opacity:1;}`, xa = u(w)`padding:6px 8px;background:${m.themedColor.textHighEmphasis};color:${m.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, Ea = ({ submitted: e, value: t, onChange: n }) => {
|
|
2393
|
+
const { stringSet: o } = R(), i = ga(), a = typeof t == "number";
|
|
2394
|
+
return /* @__PURE__ */ r.createElement(Ca, null, /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: m.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(va, null, i.map((s) => /* @__PURE__ */ r.createElement(qn, { disabled: e, key: s.value, label: s.getTooltip(o) }, /* @__PURE__ */ r.createElement(
|
|
2395
|
+
ya,
|
|
2367
2396
|
{
|
|
2368
2397
|
disabled: e,
|
|
2369
2398
|
onClick: () => n(s.value),
|
|
@@ -2371,16 +2400,16 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2371
2400
|
},
|
|
2372
2401
|
a ? s.isActive(t) ? /* @__PURE__ */ r.createElement(s.Icon.Active, null) : /* @__PURE__ */ r.createElement(s.Icon.Inactive, null) : /* @__PURE__ */ r.createElement(s.Icon.Active, null)
|
|
2373
2402
|
)))));
|
|
2374
|
-
},
|
|
2375
|
-
background-color: ${
|
|
2403
|
+
}, Ca = u.div`display:flex;flex-direction:column;gap:8px;`, va = u.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, ya = u.button`background-color:transparent;border:none;border-radius:4px;padding:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box;&:enabled:hover{cursor:pointer;background-color:${m.color.background200};${F.dark`
|
|
2404
|
+
background-color: ${m.color.background500};
|
|
2376
2405
|
`}
|
|
2377
2406
|
}
|
|
2378
2407
|
|
|
2379
|
-
${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" &&
|
|
2380
|
-
`,
|
|
2408
|
+
${({ $inactive: e, theme: t }) => e && t.selectedTheme === "dark" && _a};
|
|
2409
|
+
`, _a = $`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, Sa = ({ submitted: e, value: t = "", onChange: n }) => {
|
|
2381
2410
|
const { stringSet: o } = R();
|
|
2382
2411
|
return e && !t ? null : /* @__PURE__ */ r.createElement(
|
|
2383
|
-
|
|
2412
|
+
Ta,
|
|
2384
2413
|
{
|
|
2385
2414
|
disabled: e,
|
|
2386
2415
|
maxLength: 255,
|
|
@@ -2389,95 +2418,95 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2389
2418
|
placeholder: o.CSAT_REASON_PLACEHOLDER
|
|
2390
2419
|
}
|
|
2391
2420
|
);
|
|
2392
|
-
},
|
|
2393
|
-
background-color: ${
|
|
2421
|
+
}, Ta = u.input`box-sizing:border-box;width:100%;border-radius:4px;padding:10px 16px;font-size:14px;font-weight:400;font-style:normal;border:unset;&:focus{outline:none;}color:${m.themedColor.textHighEmphasis};&::placeholder{color:${m.themedColor.textLowEmphasis};}background-color:${m.color.background50};${F.dark`
|
|
2422
|
+
background-color: ${m.themedColor.textDisabled};
|
|
2394
2423
|
`}
|
|
2395
2424
|
|
|
2396
2425
|
&:disabled {
|
|
2397
2426
|
cursor: not-allowed;
|
|
2398
|
-
color: ${
|
|
2399
|
-
background-color: ${
|
|
2400
|
-
${
|
|
2401
|
-
color: ${
|
|
2402
|
-
background-color: ${
|
|
2427
|
+
color: ${m.themedColor.textLowEmphasis};
|
|
2428
|
+
background-color: ${m.color.background200};
|
|
2429
|
+
${F.dark`
|
|
2430
|
+
color: ${m.color.ondark.textDisabled};
|
|
2431
|
+
background-color: ${m.themedColor.textDisabled};
|
|
2403
2432
|
`}
|
|
2404
2433
|
}
|
|
2405
|
-
`,
|
|
2434
|
+
`, wa = ({ submitted: e }) => {
|
|
2406
2435
|
const { stringSet: t } = R();
|
|
2407
|
-
return e ? /* @__PURE__ */ r.createElement(
|
|
2436
|
+
return e ? /* @__PURE__ */ r.createElement(w, { variant: "h2", color: m.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(w, { variant: "h2", color: m.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
|
|
2408
2437
|
};
|
|
2409
|
-
var
|
|
2410
|
-
const
|
|
2438
|
+
var te = /* @__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))(te || {});
|
|
2439
|
+
const ka = (e) => Tr((t, n) => ({ ...t, ...n }), e), ut = ({
|
|
2411
2440
|
type: e,
|
|
2412
2441
|
renderSubmitButton: t,
|
|
2413
2442
|
initialCsat: n,
|
|
2414
2443
|
initialCsatReason: o,
|
|
2415
2444
|
initialIsResolved: i
|
|
2416
2445
|
}) => {
|
|
2417
|
-
const [a, s] =
|
|
2446
|
+
const [a, s] = ka({
|
|
2418
2447
|
csatType: e,
|
|
2419
2448
|
csat: n,
|
|
2420
2449
|
csatReason: o,
|
|
2421
2450
|
isResolved: i
|
|
2422
|
-
}), l = typeof n == "number" ? "submitted" : (e ===
|
|
2423
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
2424
|
-
|
|
2451
|
+
}), l = typeof n == "number" ? "submitted" : (e === te.AI_AGENT_CSAT_5 || e === te.HELPDESK_CSAT_5) && typeof a.csat == "number" || e === te.AI_AGENT_CSAT_5_WITH_CRE && typeof a.csat == "number" && typeof a.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
|
|
2452
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Aa, null, /* @__PURE__ */ r.createElement(wa, { ...c }), e === te.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
|
|
2453
|
+
ea,
|
|
2425
2454
|
{
|
|
2426
2455
|
...c,
|
|
2427
2456
|
defaultValue: i,
|
|
2428
2457
|
value: a.isResolved,
|
|
2429
2458
|
onChange: (d) => s({ isResolved: d })
|
|
2430
2459
|
}
|
|
2431
|
-
), /* @__PURE__ */ r.createElement(
|
|
2432
|
-
|
|
2460
|
+
), /* @__PURE__ */ r.createElement(Ea, { ...c, value: a.csat, onChange: (d) => s({ csat: d }) }), a.csat && /* @__PURE__ */ r.createElement(
|
|
2461
|
+
Sa,
|
|
2433
2462
|
{
|
|
2434
2463
|
...c,
|
|
2435
2464
|
value: a.csatReason,
|
|
2436
2465
|
onChange: (d) => s({ csatReason: d })
|
|
2437
2466
|
}
|
|
2438
2467
|
)), l !== "submitted" && t({ state: l, params: a }));
|
|
2439
|
-
},
|
|
2468
|
+
}, Aa = u.div`display:flex;flex-direction:column;gap:12px;`, Ia = () => {
|
|
2440
2469
|
const { stringSet: e } = R();
|
|
2441
|
-
return /* @__PURE__ */ r.createElement(
|
|
2442
|
-
},
|
|
2470
|
+
return /* @__PURE__ */ r.createElement(w, { variant: "body2", color: m.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
|
|
2471
|
+
}, $a = (e) => {
|
|
2443
2472
|
if (e.messageType !== "admin.csat")
|
|
2444
2473
|
throw new Error("Invalid message type");
|
|
2445
|
-
const t =
|
|
2446
|
-
if (!d || !
|
|
2447
|
-
const g =
|
|
2448
|
-
x.csat && !
|
|
2474
|
+
const t = Hr(), { stringSet: n } = R(), { extendedMessagePayload: o, csat: i, csatReason: a, csatExpireAt: s, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: h } = (o == null ? void 0 : o.csat) ?? {};
|
|
2475
|
+
if (!d || !h || !te[h]) return null;
|
|
2476
|
+
const g = h === te.AI_AGENT_CSAT_5 || h === te.AI_AGENT_CSAT_5_WITH_CRE || h === te.HELPDESK_CSAT_5 ? ut : () => null, p = (x) => {
|
|
2477
|
+
x.csat && !nn(s) ? c({
|
|
2449
2478
|
csatType: x.csatType,
|
|
2450
2479
|
csat: x.csat,
|
|
2451
2480
|
csatReason: x.csatReason,
|
|
2452
2481
|
isResolved: x.isResolved
|
|
2453
2482
|
}) : t();
|
|
2454
2483
|
};
|
|
2455
|
-
return /* @__PURE__ */ r.createElement(
|
|
2484
|
+
return /* @__PURE__ */ r.createElement(Ma, null, !i && nn(s) ? /* @__PURE__ */ r.createElement(Ia, null) : /* @__PURE__ */ r.createElement(
|
|
2456
2485
|
g,
|
|
2457
2486
|
{
|
|
2458
|
-
type:
|
|
2487
|
+
type: h,
|
|
2459
2488
|
initialCsat: i,
|
|
2460
2489
|
initialCsatReason: a,
|
|
2461
2490
|
initialIsResolved: l,
|
|
2462
|
-
renderSubmitButton: ({ state: x, params:
|
|
2491
|
+
renderSubmitButton: ({ state: x, params: b }) => /* @__PURE__ */ r.createElement(Oa, { disabled: x !== "submittable", onClick: () => p(b) }, /* @__PURE__ */ r.createElement(w, { variant: "button" }, n.CSAT_SUBMIT_LABEL))
|
|
2463
2492
|
}
|
|
2464
2493
|
));
|
|
2465
|
-
},
|
|
2466
|
-
function
|
|
2494
|
+
}, Ma = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Oa = u.button`all:unset;background-color:${({ theme: e }) => e.colors.base.primary};color:${({ theme: e }) => e.colors.base.primaryContrastContent};border-radius:6px;padding:10px 20px;display:flex;align-items:center;justify-content:center;cursor:pointer;&:hover{background-color:${m.color.primary.dark};}&:disabled{color:${m.color.ondark.textLowEmphasis};background-color:${m.themedColor.textDisabled};cursor:not-allowed;}`;
|
|
2495
|
+
function nn(e) {
|
|
2467
2496
|
return !!e && e < Date.now();
|
|
2468
2497
|
}
|
|
2469
|
-
const
|
|
2470
|
-
template:
|
|
2498
|
+
const Rt = Te({
|
|
2499
|
+
template: La,
|
|
2471
2500
|
components: {
|
|
2472
|
-
AdminMessage:
|
|
2473
|
-
CSATMessage:
|
|
2501
|
+
AdminMessage: Js,
|
|
2502
|
+
CSATMessage: $a
|
|
2474
2503
|
}
|
|
2475
2504
|
});
|
|
2476
|
-
function
|
|
2477
|
-
const { components: t } =
|
|
2478
|
-
return /* @__PURE__ */ r.createElement(
|
|
2505
|
+
function La(e) {
|
|
2506
|
+
const { components: t } = Rt.useContext(), n = Ot(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
|
|
2507
|
+
return /* @__PURE__ */ r.createElement(Ra, { $marginBottom: wt(e.groupType) }, n);
|
|
2479
2508
|
}
|
|
2480
|
-
const
|
|
2509
|
+
const Ra = u.div`padding-inline:${ie}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, rn = {
|
|
2481
2510
|
file: "attach",
|
|
2482
2511
|
snippet: "snippet",
|
|
2483
2512
|
site: "website",
|
|
@@ -2487,7 +2516,7 @@ const wa = u.div`padding-inline:${ie}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2487
2516
|
sb_zendesk: "zendesk",
|
|
2488
2517
|
sb_desk: "snippet"
|
|
2489
2518
|
// TODO: request icon
|
|
2490
|
-
},
|
|
2519
|
+
}, Da = ({
|
|
2491
2520
|
actionbook: e,
|
|
2492
2521
|
functionCalls: t,
|
|
2493
2522
|
groundedness: n,
|
|
@@ -2498,88 +2527,88 @@ const wa = u.div`padding-inline:${ie}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2498
2527
|
onClickGroundedness: l,
|
|
2499
2528
|
onClickAgentMessageTemplate: c,
|
|
2500
2529
|
bottomContent: d,
|
|
2501
|
-
renderCustomGroundednessIcon:
|
|
2530
|
+
renderCustomGroundednessIcon: h = (p) => p.default,
|
|
2502
2531
|
style: g = {}
|
|
2503
2532
|
}) => {
|
|
2504
2533
|
const {
|
|
2505
2534
|
// Note: This component is used with the dashboard, so cssVars should not be used.
|
|
2506
2535
|
iconColor: p = "#000000",
|
|
2507
2536
|
textColor: x = "#000000",
|
|
2508
|
-
highlightColor:
|
|
2537
|
+
highlightColor: b = Dn.DEFAULT_PRIMARY
|
|
2509
2538
|
} = g;
|
|
2510
|
-
return /* @__PURE__ */ r.createElement(
|
|
2539
|
+
return /* @__PURE__ */ r.createElement(on, null, e && /* @__PURE__ */ r.createElement(on, null, /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "actionbook", color: p })), /* @__PURE__ */ r.createElement(
|
|
2511
2540
|
je,
|
|
2512
2541
|
{
|
|
2513
2542
|
$clickable: !!i,
|
|
2514
|
-
$highlightColor:
|
|
2543
|
+
$highlightColor: b,
|
|
2515
2544
|
variant: "body2",
|
|
2516
2545
|
color: x,
|
|
2517
2546
|
onClick: () => i == null ? void 0 : i(e)
|
|
2518
2547
|
},
|
|
2519
2548
|
e.name
|
|
2520
|
-
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(
|
|
2549
|
+
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(mt, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "function", color: p })), /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(
|
|
2521
2550
|
je,
|
|
2522
2551
|
{
|
|
2523
2552
|
$clickable: !!i,
|
|
2524
|
-
$highlightColor:
|
|
2553
|
+
$highlightColor: b,
|
|
2525
2554
|
variant: "body2",
|
|
2526
2555
|
color: x,
|
|
2527
2556
|
onClick: () => a == null ? void 0 : a(E)
|
|
2528
2557
|
},
|
|
2529
2558
|
E.name
|
|
2530
|
-
), /* @__PURE__ */ r.createElement(
|
|
2531
|
-
default: /* @__PURE__ */ r.createElement(O, { size: 16, type:
|
|
2559
|
+
), /* @__PURE__ */ r.createElement(Pa, { role: "button", onClick: () => s == null ? void 0 : s(E) }, /* @__PURE__ */ r.createElement(w, { variant: "body2", color: b }, "View details"), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: b }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(mt, { key: E.id }, /* @__PURE__ */ r.createElement(Ke, null, h({
|
|
2560
|
+
default: /* @__PURE__ */ r.createElement(O, { size: 16, type: rn[E.source_type] ?? rn.snippet, color: p }),
|
|
2532
2561
|
sourceType: E.source_type
|
|
2533
2562
|
})), /* @__PURE__ */ r.createElement(
|
|
2534
2563
|
je,
|
|
2535
2564
|
{
|
|
2536
2565
|
$clickable: !!l,
|
|
2537
|
-
$highlightColor:
|
|
2566
|
+
$highlightColor: b,
|
|
2538
2567
|
variant: "body2",
|
|
2539
2568
|
color: x,
|
|
2540
2569
|
onClick: () => l == null ? void 0 : l(E)
|
|
2541
2570
|
},
|
|
2542
2571
|
E.preview_title
|
|
2543
|
-
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(
|
|
2572
|
+
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(mt, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "template", color: p })), /* @__PURE__ */ r.createElement(
|
|
2544
2573
|
je,
|
|
2545
2574
|
{
|
|
2546
2575
|
$clickable: !!c,
|
|
2547
|
-
$highlightColor:
|
|
2576
|
+
$highlightColor: b,
|
|
2548
2577
|
variant: "body2",
|
|
2549
2578
|
color: x,
|
|
2550
2579
|
onClick: () => c == null ? void 0 : c(E)
|
|
2551
2580
|
},
|
|
2552
2581
|
E.name
|
|
2553
2582
|
))), d);
|
|
2554
|
-
},
|
|
2583
|
+
}, Na = u(w)`font-weight:400;`, je = u(Na)`${({ $clickable: e, $highlightColor: t }) => e && $`
|
|
2555
2584
|
cursor: pointer;
|
|
2556
2585
|
text-decoration: underline;
|
|
2557
2586
|
&:hover {
|
|
2558
2587
|
color: ${t};
|
|
2559
2588
|
}
|
|
2560
2589
|
`}
|
|
2561
|
-
`, Ke = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Xe = u.div`display:flex;gap:8px;align-items:center;`,
|
|
2562
|
-
function
|
|
2590
|
+
`, Ke = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Xe = u.div`display:flex;gap:8px;align-items:center;`, Pa = u(Xe)`cursor:pointer;gap:4px;`, mt = u(Xe)`flex-direction:row;align-items:center;`, on = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Jn = Se(null);
|
|
2591
|
+
function Fa({ testerType: e, children: t }) {
|
|
2563
2592
|
return /* @__PURE__ */ r.createElement(
|
|
2564
|
-
|
|
2593
|
+
Jn.Provider,
|
|
2565
2594
|
{
|
|
2566
2595
|
value: { testerType: e, isActionbookTester: e === "actionbook" }
|
|
2567
2596
|
},
|
|
2568
|
-
e && /* @__PURE__ */ r.createElement(
|
|
2597
|
+
e && /* @__PURE__ */ r.createElement(Ba, null),
|
|
2569
2598
|
t
|
|
2570
2599
|
);
|
|
2571
2600
|
}
|
|
2572
|
-
const
|
|
2573
|
-
const e =
|
|
2601
|
+
const Be = () => {
|
|
2602
|
+
const e = ne(Jn);
|
|
2574
2603
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");
|
|
2575
2604
|
return e;
|
|
2576
|
-
},
|
|
2577
|
-
const { isActionbookTester: e } =
|
|
2578
|
-
return /* @__PURE__ */ r.createElement(
|
|
2579
|
-
},
|
|
2580
|
-
const { handlers: t } =
|
|
2581
|
-
return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(
|
|
2582
|
-
|
|
2605
|
+
}, Ba = () => {
|
|
2606
|
+
const { isActionbookTester: e } = Be();
|
|
2607
|
+
return /* @__PURE__ */ r.createElement(ye.Template, { template: e ? Ua : void 0 }, /* @__PURE__ */ r.createElement(ye.MessageLogs, { component: Ha }));
|
|
2608
|
+
}, Ua = (e) => /* @__PURE__ */ r.createElement(Kn, { ...e, testerMode: !0, maxBodyWidth: Un }), Ha = ({ extendedMessagePayload: e = {} }) => {
|
|
2609
|
+
const { handlers: t } = B(), { manual: n, groundedness: o, function_calls: i, agent_message_templates: a, is_thinking: s } = e;
|
|
2610
|
+
return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(za, null, /* @__PURE__ */ r.createElement(Va, { width: 4 }), /* @__PURE__ */ r.createElement(
|
|
2611
|
+
Da,
|
|
2583
2612
|
{
|
|
2584
2613
|
actionbook: n,
|
|
2585
2614
|
functionCalls: i,
|
|
@@ -2587,14 +2616,14 @@ const Fe = () => {
|
|
|
2587
2616
|
agentMessageTemplates: a,
|
|
2588
2617
|
onClickFunctionCallDetail: t == null ? void 0 : t.onFunctionCallDetailClick,
|
|
2589
2618
|
style: {
|
|
2590
|
-
iconColor:
|
|
2591
|
-
textColor:
|
|
2592
|
-
barColor:
|
|
2619
|
+
iconColor: m.themedColor.textHighEmphasis,
|
|
2620
|
+
textColor: m.themedColor.textHighEmphasis,
|
|
2621
|
+
barColor: m.themedColor.textDisabled
|
|
2593
2622
|
},
|
|
2594
|
-
bottomContent: /* @__PURE__ */ r.createElement(
|
|
2623
|
+
bottomContent: /* @__PURE__ */ r.createElement(Wa, { variant: "caption2", color: m.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
2595
2624
|
}
|
|
2596
2625
|
));
|
|
2597
|
-
},
|
|
2626
|
+
}, za = u.div`display:flex;gap:16px;margin:16px ${ie}px 0;align-self:stretch;`, Va = u.div`width:${({ width: e }) => e}px;background-color:${m.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Wa = u(w)`margin-top:5px;`, Ga = ({ publishSynchronous: e = !1 }) => {
|
|
2598
2627
|
const t = /* @__PURE__ */ new Set();
|
|
2599
2628
|
return {
|
|
2600
2629
|
publish: (n) => {
|
|
@@ -2605,19 +2634,19 @@ const Fe = () => {
|
|
|
2605
2634
|
subscribe: (n) => (t.add(n), () => t.delete(n))
|
|
2606
2635
|
};
|
|
2607
2636
|
};
|
|
2608
|
-
function
|
|
2609
|
-
const n =
|
|
2610
|
-
return
|
|
2637
|
+
function ja(e, t = []) {
|
|
2638
|
+
const n = U(null), o = U(0), i = U(0), [a] = S(() => Ga({ publishSynchronous: !0 })), [s, l] = S(!0);
|
|
2639
|
+
return de(() => {
|
|
2611
2640
|
o.current = 0, i.current = 0, l(!0), n.current && (n.current.scrollTop = n.current.scrollHeight);
|
|
2612
|
-
}, t),
|
|
2613
|
-
const { resolve:
|
|
2614
|
-
if (!n.current) return
|
|
2641
|
+
}, t), de(() => a.subscribe(({ type: c, data: d }) => {
|
|
2642
|
+
const { resolve: h, animated: g } = d ?? {};
|
|
2643
|
+
if (!n.current) return h == null ? void 0 : h();
|
|
2615
2644
|
if (c === "scrollToBottom" && (n.current.scroll ? n.current.scroll({
|
|
2616
2645
|
top: n.current.scrollHeight,
|
|
2617
|
-
behavior:
|
|
2618
|
-
}) : n.current.scrollTop = n.current.scrollHeight, i.current = 0, l(!0),
|
|
2619
|
-
const p = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight:
|
|
2620
|
-
n.current.scroll ? n.current.scroll({ top: p, behavior:
|
|
2646
|
+
behavior: sn(e, g)
|
|
2647
|
+
}) : n.current.scrollTop = n.current.scrollHeight, i.current = 0, l(!0), h == null || h()), c === "scroll") {
|
|
2648
|
+
const p = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: b, clientHeight: E } = n.current;
|
|
2649
|
+
n.current.scroll ? n.current.scroll({ top: p, behavior: sn(e, g) }) : typeof p == "number" && (n.current.scrollTop = p), i.current = Math.max(0, b - x - E), l(i.current === 0), h == null || h();
|
|
2621
2650
|
}
|
|
2622
2651
|
}), [e]), {
|
|
2623
2652
|
scrollRef: n,
|
|
@@ -2628,10 +2657,10 @@ function Ba(e, t = []) {
|
|
|
2628
2657
|
scrollPositionRef: o
|
|
2629
2658
|
};
|
|
2630
2659
|
}
|
|
2631
|
-
function
|
|
2660
|
+
function sn(e, t) {
|
|
2632
2661
|
return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
|
|
2633
2662
|
}
|
|
2634
|
-
function
|
|
2663
|
+
function Ka(e) {
|
|
2635
2664
|
return new Promise((t) => {
|
|
2636
2665
|
const n = new Image();
|
|
2637
2666
|
n.onload = function() {
|
|
@@ -2640,23 +2669,23 @@ function Fa(e) {
|
|
|
2640
2669
|
}, n.src = URL.createObjectURL(e);
|
|
2641
2670
|
});
|
|
2642
2671
|
}
|
|
2643
|
-
async function
|
|
2672
|
+
async function Za(e) {
|
|
2644
2673
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
2645
|
-
const { width: t, height: n } = await
|
|
2646
|
-
return new
|
|
2647
|
-
key:
|
|
2674
|
+
const { width: t, height: n } = await Ka(e.file);
|
|
2675
|
+
return new Zr({
|
|
2676
|
+
key: Xn,
|
|
2648
2677
|
value: [t, n]
|
|
2649
2678
|
});
|
|
2650
2679
|
}
|
|
2651
2680
|
}
|
|
2652
|
-
const
|
|
2653
|
-
const { agentPreviewConfigs: t, handlers: n } =
|
|
2681
|
+
const Xn = "KEY_IMG_ASPECT_RATIO", Ya = ({ onScrollAfterSendMessage: e }) => {
|
|
2682
|
+
const { agentPreviewConfigs: t, handlers: n } = B(), o = U(t == null ? void 0 : t.agentAttributes);
|
|
2654
2683
|
return o.current = t == null ? void 0 : t.agentAttributes, {
|
|
2655
2684
|
onBeforeSendMessage: async (i) => {
|
|
2656
|
-
const a = await
|
|
2685
|
+
const a = await Za(i), s = {
|
|
2657
2686
|
...i,
|
|
2658
2687
|
metaArrays: a ? [a] : void 0
|
|
2659
|
-
}, l =
|
|
2688
|
+
}, l = qa(o.current);
|
|
2660
2689
|
return l ? { ...s, data: JSON.stringify(l) } : s;
|
|
2661
2690
|
},
|
|
2662
2691
|
onAfterSendMessage: (i) => {
|
|
@@ -2664,55 +2693,55 @@ const Jn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2664
2693
|
e(), (a = n == null ? void 0 : n.onMessageSend) == null || a.call(n, i.message);
|
|
2665
2694
|
}
|
|
2666
2695
|
};
|
|
2667
|
-
},
|
|
2696
|
+
}, qa = (e) => {
|
|
2668
2697
|
if (!e) return null;
|
|
2669
2698
|
const t = {};
|
|
2670
2699
|
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;
|
|
2671
2700
|
}, {
|
|
2672
|
-
Provider:
|
|
2673
|
-
useContext:
|
|
2674
|
-
} =
|
|
2701
|
+
Provider: Ja,
|
|
2702
|
+
useContext: J
|
|
2703
|
+
} = Z("Conversation"), Xa = ({
|
|
2675
2704
|
closedChannelUrl: e,
|
|
2676
2705
|
onClearClosedChannelUrl: t,
|
|
2677
2706
|
onNavigateToConversationList: n,
|
|
2678
2707
|
children: o
|
|
2679
2708
|
}) => {
|
|
2680
|
-
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } =
|
|
2709
|
+
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } = Be(), c = ja("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: h } = Ya({
|
|
2681
2710
|
onScrollAfterSendMessage: () => {
|
|
2682
2711
|
c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !1 } });
|
|
2683
2712
|
}
|
|
2684
2713
|
}), g = (x) => {
|
|
2685
|
-
const
|
|
2686
|
-
|
|
2687
|
-
}, p =
|
|
2714
|
+
const b = x[x.length - 1];
|
|
2715
|
+
b && et.shouldScrollToBottom(b, i.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } }), 100);
|
|
2716
|
+
}, p = H(async () => {
|
|
2688
2717
|
await s(), e && (t == null || t());
|
|
2689
2718
|
}, [s, e, t]);
|
|
2690
2719
|
return /* @__PURE__ */ r.createElement(
|
|
2691
|
-
|
|
2720
|
+
mo,
|
|
2692
2721
|
{
|
|
2693
2722
|
channelUrl: e || (a == null ? void 0 : a.url),
|
|
2694
2723
|
onBeforeSendMessage: d,
|
|
2695
|
-
onAfterSendMessage:
|
|
2724
|
+
onAfterSendMessage: h,
|
|
2696
2725
|
onMessagesUpdated: g,
|
|
2697
2726
|
onMessagesReceived: g,
|
|
2698
2727
|
onChannelDeleted: p,
|
|
2699
2728
|
onConversationClosedViaDispatcher: p
|
|
2700
2729
|
},
|
|
2701
2730
|
(x) => /* @__PURE__ */ r.createElement(
|
|
2702
|
-
|
|
2731
|
+
Ja,
|
|
2703
2732
|
{
|
|
2704
2733
|
value: { ...x, scrollSource: c, goToActiveConversation: p, onNavigateToConversationList: n }
|
|
2705
2734
|
},
|
|
2706
2735
|
o
|
|
2707
2736
|
)
|
|
2708
2737
|
);
|
|
2709
|
-
},
|
|
2738
|
+
}, Dt = Se({
|
|
2710
2739
|
onDrop: Le,
|
|
2711
2740
|
subscribe: () => Le
|
|
2712
|
-
}),
|
|
2713
|
-
const t =
|
|
2741
|
+
}), Et = ({ children: e }) => {
|
|
2742
|
+
const t = U(/* @__PURE__ */ new Set());
|
|
2714
2743
|
return /* @__PURE__ */ r.createElement(
|
|
2715
|
-
|
|
2744
|
+
Dt.Provider,
|
|
2716
2745
|
{
|
|
2717
2746
|
value: {
|
|
2718
2747
|
onDrop: (n) => {
|
|
@@ -2727,78 +2756,78 @@ const Jn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2727
2756
|
},
|
|
2728
2757
|
e
|
|
2729
2758
|
);
|
|
2730
|
-
},
|
|
2731
|
-
const { subscribe: t } =
|
|
2759
|
+
}, Qa = ({ onDropFiles: e }) => {
|
|
2760
|
+
const { subscribe: t } = ne(Dt);
|
|
2732
2761
|
D(() => t(e), [e]);
|
|
2733
2762
|
};
|
|
2734
|
-
|
|
2735
|
-
const { onDrop: t } =
|
|
2763
|
+
Et.Consumer = ({ children: e }) => {
|
|
2764
|
+
const { onDrop: t } = ne(Dt);
|
|
2736
2765
|
return e({ onDrop: t, onDragOver: (i) => i.preventDefault() });
|
|
2737
2766
|
};
|
|
2738
|
-
const
|
|
2739
|
-
loading:
|
|
2740
|
-
error:
|
|
2741
|
-
noChannels:
|
|
2742
|
-
noMessages:
|
|
2743
|
-
},
|
|
2744
|
-
const o =
|
|
2745
|
-
return /* @__PURE__ */ r.createElement(
|
|
2767
|
+
const iu = ({ iconSize: e = 64, icon: t, className: n, label: o, children: i }) => /* @__PURE__ */ r.createElement(tl, { className: n }, /* @__PURE__ */ r.createElement(O, { type: t, size: e, color: m.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(w, { variant: "body1", color: m.themedColor.textMidEmphasis }, o), i), el = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, tl = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, nl = {
|
|
2768
|
+
loading: T(() => import("./CgVCSnu0.js")),
|
|
2769
|
+
error: T(() => import("./C9gbyXV9.js")),
|
|
2770
|
+
noChannels: T(() => import("./D9B38Bwj.js")),
|
|
2771
|
+
noMessages: T(() => import("./D6MCYXvz.js"))
|
|
2772
|
+
}, _e = ({ className: e, type: t = "loading", ...n }) => {
|
|
2773
|
+
const o = nl[t];
|
|
2774
|
+
return /* @__PURE__ */ r.createElement(el, { className: e }, /* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
|
|
2746
2775
|
};
|
|
2747
|
-
function
|
|
2776
|
+
function rl(e) {
|
|
2748
2777
|
return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
|
|
2749
2778
|
}
|
|
2750
|
-
const
|
|
2779
|
+
const ol = (e, t, n, o = !0) => {
|
|
2751
2780
|
if (!o || !e.isUserMessage() && !e.isFileMessage())
|
|
2752
2781
|
return "single";
|
|
2753
2782
|
const i = () => {
|
|
2754
2783
|
if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
|
|
2755
|
-
const c = t.sender.userId === e.sender.userId, d =
|
|
2784
|
+
const c = t.sender.userId === e.sender.userId, d = Vt(t.createdAt, e.createdAt);
|
|
2756
2785
|
return c && d;
|
|
2757
2786
|
}, a = () => {
|
|
2758
2787
|
if (!n || !n.isUserMessage() && !n.isFileMessage()) return !1;
|
|
2759
|
-
const c = n.sender.userId === e.sender.userId, d =
|
|
2788
|
+
const c = n.sender.userId === e.sender.userId, d = Vt(n.createdAt, e.createdAt);
|
|
2760
2789
|
return c && d;
|
|
2761
2790
|
}, s = i(), l = a();
|
|
2762
2791
|
return s && l ? "middle" : s ? "bottom" : l ? "top" : "single";
|
|
2763
2792
|
};
|
|
2764
|
-
function
|
|
2793
|
+
function il(e, t) {
|
|
2765
2794
|
return e.filter((n) => et.isWelcomeMessage(n, t));
|
|
2766
2795
|
}
|
|
2767
|
-
function
|
|
2768
|
-
return
|
|
2796
|
+
function Qn(e, t) {
|
|
2797
|
+
return sl(e) === t;
|
|
2769
2798
|
}
|
|
2770
|
-
function
|
|
2799
|
+
function sl(e) {
|
|
2771
2800
|
var t;
|
|
2772
2801
|
if (e)
|
|
2773
2802
|
return e.isUserMessage() || e.isFileMessage() || e.isMultipleFilesMessage() ? e.sender.userId : ((t = e == null ? void 0 : e.sender) == null ? void 0 : t.userId) ?? void 0;
|
|
2774
2803
|
}
|
|
2775
|
-
function
|
|
2804
|
+
function al(e) {
|
|
2776
2805
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
2777
2806
|
}
|
|
2778
|
-
const
|
|
2807
|
+
const an = (e) => !!e && "sender" in e, er = (e) => e.startsWith("image/"), tr = (e) => e.startsWith("video/"), ln = (e) => er(e) || tr(e), Ze = {
|
|
2779
2808
|
isAdmin: (e) => e.isAdminMessage(),
|
|
2780
2809
|
isCSAT: (e) => {
|
|
2781
2810
|
var t;
|
|
2782
2811
|
return e.isAdminMessage() && !!((t = e.extendedMessagePayload) != null && t.csat);
|
|
2783
2812
|
},
|
|
2784
|
-
isIncoming: (e, t) =>
|
|
2785
|
-
isOutgoing: (e, t) =>
|
|
2786
|
-
},
|
|
2813
|
+
isIncoming: (e, t) => an(e) && e.sender.userId !== t,
|
|
2814
|
+
isOutgoing: (e, t) => an(e) && (e.sender.userId === t || e.sendingStatus === Yr.PENDING)
|
|
2815
|
+
}, nr = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
|
|
2787
2816
|
if (!t) return null;
|
|
2788
|
-
const { rootElement: i } =
|
|
2789
|
-
return
|
|
2790
|
-
/* @__PURE__ */ r.createElement(
|
|
2817
|
+
const { rootElement: i } = B(), a = fe(i), s = fe(i, !0);
|
|
2818
|
+
return Jr(
|
|
2819
|
+
/* @__PURE__ */ r.createElement(ll, { onClick: n }, /* @__PURE__ */ r.createElement(cl, { onClick: (l) => l.stopPropagation() }, o)),
|
|
2791
2820
|
a.getElementById(e) ?? a.getElementById(oe.MODAL_ROOT) ?? s.body
|
|
2792
2821
|
);
|
|
2793
|
-
},
|
|
2794
|
-
function
|
|
2822
|
+
}, ll = u.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:${be.MODAL};`, cl = u.div`border-radius:4px;overflow:hidden;box-shadow:0 16px 24px 2px rgba(13,13,13,0.12),0 6px 30px 5px rgba(13,13,13,0.08),0 6px 10px -5px rgba(13,13,13,0.04);z-index:${be.MODAL};`, dl = u.div`flex-shrink:0;width:${({ $size: e }) => q(e)};height:${({ $size: e }) => q(e)};background-color:${({ theme: e }) => e.colors.base.primary};box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;}`, ul = u(It)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
|
|
2823
|
+
function rr({ size: e }) {
|
|
2795
2824
|
const { aiAgentInfo: t } = z();
|
|
2796
|
-
return t.profileUrl ? /* @__PURE__ */ r.createElement(
|
|
2825
|
+
return t.profileUrl ? /* @__PURE__ */ r.createElement($t, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(dl, { $size: e }, /* @__PURE__ */ r.createElement(ul, null));
|
|
2797
2826
|
}
|
|
2798
|
-
const
|
|
2799
|
-
const { type: i, url: a, name: s = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo:
|
|
2827
|
+
const ml = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, hl = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${m.themedColor.textDisabled};background-color:${m.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, gl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, pl = u.div`margin-inline-end:8px;`, fl = u.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`, bl = u.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`, xl = u.div`display:flex;width:160px;justify-content:flex-end;`, El = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, or = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, Cl = u(or)`border-inline-start:1px solid ${m.themedColor.textDisabled};`, vl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, yl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, _l = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, Sl = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, Tl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
|
|
2828
|
+
const { type: i, url: a, name: s = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: h } = z();
|
|
2800
2829
|
return /* @__PURE__ */ r.createElement(
|
|
2801
|
-
|
|
2830
|
+
kl,
|
|
2802
2831
|
{
|
|
2803
2832
|
profileUrl: l ?? "",
|
|
2804
2833
|
nickname: c ?? "",
|
|
@@ -2806,11 +2835,11 @@ const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2806
2835
|
url: a,
|
|
2807
2836
|
name: s,
|
|
2808
2837
|
onClose: n,
|
|
2809
|
-
isBotMessage: d ===
|
|
2838
|
+
isBotMessage: d === h.userId,
|
|
2810
2839
|
onDownloadClick: o
|
|
2811
2840
|
}
|
|
2812
2841
|
);
|
|
2813
|
-
},
|
|
2842
|
+
}, wl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(rr, { size: 32 }) : /* @__PURE__ */ r.createElement($t, { size: 32, src: e }), kl = ({
|
|
2814
2843
|
profileUrl: e,
|
|
2815
2844
|
isBotMessage: t,
|
|
2816
2845
|
nickname: n,
|
|
@@ -2821,14 +2850,14 @@ const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2821
2850
|
onDownloadClick: l
|
|
2822
2851
|
}) => {
|
|
2823
2852
|
const { stringSet: c } = R();
|
|
2824
|
-
return /* @__PURE__ */ r.createElement(
|
|
2825
|
-
},
|
|
2853
|
+
return /* @__PURE__ */ r.createElement(nr, { onClose: s, visible: !0, rootElementId: oe.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ml, null, /* @__PURE__ */ r.createElement(hl, null, /* @__PURE__ */ r.createElement(gl, null, /* @__PURE__ */ r.createElement(pl, null, /* @__PURE__ */ r.createElement(wl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(w, { variant: "h2", color: m.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(bl, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: m.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(xl, null, ln(i) && /* @__PURE__ */ r.createElement(El, null, /* @__PURE__ */ r.createElement(or, { as: "a", href: a, target: "_blank", rel: Tt, onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "download", color: m.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(Cl, { onClick: s }, /* @__PURE__ */ r.createElement(O, { type: "close", color: m.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(vl, { onClick: (d) => d.currentTarget === d.target && s() }, tr(i) && /* @__PURE__ */ r.createElement(yl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), er(i) && /* @__PURE__ */ r.createElement(_l, { src: a, alt: o }), !ln(i) && /* @__PURE__ */ r.createElement(Sl, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: m.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
|
|
2854
|
+
}, ir = ({
|
|
2826
2855
|
className: e,
|
|
2827
2856
|
locale: t,
|
|
2828
2857
|
date: n = Date.now(),
|
|
2829
2858
|
formatString: o = "MMMM dd, yyyy",
|
|
2830
2859
|
style: i
|
|
2831
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
2860
|
+
}) => /* @__PURE__ */ r.createElement(Al, { style: i, className: e }, /* @__PURE__ */ r.createElement(w, { variant: "caption4", color: m.themedColor.textMidEmphasis }, _n(n, o, { locale: t }))), Al = u.div`display:flex;justify-content:center;align-items:center;`, Il = Re(function(t, n) {
|
|
2832
2861
|
const {
|
|
2833
2862
|
messages: o,
|
|
2834
2863
|
renderMessage: i,
|
|
@@ -2837,55 +2866,55 @@ const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2837
2866
|
overlayArea: l,
|
|
2838
2867
|
onLoadPrev: c,
|
|
2839
2868
|
onLoadNext: d,
|
|
2840
|
-
loadThreshold:
|
|
2869
|
+
loadThreshold: h = 0.05,
|
|
2841
2870
|
onScrollPosition: g = Le,
|
|
2842
2871
|
depsForResetScrollPositionToBottom: p,
|
|
2843
2872
|
scrollPositionRef: x,
|
|
2844
|
-
scrollDistanceFromBottomRef:
|
|
2873
|
+
scrollDistanceFromBottomRef: b,
|
|
2845
2874
|
stackDirection: E = "top"
|
|
2846
|
-
} = t,
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
}, p),
|
|
2850
|
-
|
|
2851
|
-
}, [
|
|
2875
|
+
} = t, f = n && "current" in n ? n : { current: null }, C = U(!1), y = U(void 0), k = U(0), _ = U(0), Y = U(0), L = x ?? _, ae = b ?? Y;
|
|
2876
|
+
de(() => {
|
|
2877
|
+
f.current && (f.current.scrollTop = f.current.scrollHeight);
|
|
2878
|
+
}, p), de(() => {
|
|
2879
|
+
f.current && (y.current === "top" && (f.current.scrollTop = f.current.scrollHeight - L.current), y.current === "bottom" && (f.current.scrollTop = k.current), y.current = void 0);
|
|
2880
|
+
}, [f.current, o.length]);
|
|
2852
2881
|
const xe = async () => {
|
|
2853
|
-
if (!
|
|
2854
|
-
const v =
|
|
2855
|
-
if (g(
|
|
2856
|
-
const
|
|
2857
|
-
v.scrollTop <=
|
|
2882
|
+
if (!f.current) return;
|
|
2883
|
+
const v = f.current;
|
|
2884
|
+
if (g($l(v)), L.current = v.scrollHeight - v.scrollTop, ae.current = L.current - v.clientHeight, k.current = v.scrollTop, C.current) return;
|
|
2885
|
+
const V = v.clientHeight * Math.min(Math.max(0, h), 1);
|
|
2886
|
+
v.scrollTop <= V ? (C.current = !0, y.current = "top", await c(), C.current = !1) : v.scrollHeight - v.scrollTop - v.clientHeight <= V ? (C.current = !0, y.current = "bottom", await d(), C.current = !1) : y.current = void 0;
|
|
2858
2887
|
};
|
|
2859
|
-
return /* @__PURE__ */ r.createElement(
|
|
2860
|
-
}),
|
|
2861
|
-
function
|
|
2862
|
-
return e.scrollTop <=
|
|
2888
|
+
return /* @__PURE__ */ r.createElement(Ml, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Ol, { id: "infinite-list-inner", ref: f, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((v, V) => i({ message: v, index: V })), s), /* @__PURE__ */ r.createElement(Ll, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(Rl, { id: "infinite-list-overlay" }, l)));
|
|
2889
|
+
}), cn = 50;
|
|
2890
|
+
function $l(e) {
|
|
2891
|
+
return e.scrollTop <= cn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= cn ? "bottom" : "middle";
|
|
2863
2892
|
}
|
|
2864
|
-
const
|
|
2865
|
-
background-color: ${
|
|
2893
|
+
const Ml = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Ol = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${m.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Ll = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, Rl = u.div`pointer-events:auto;`, Dl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Nl, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(O, { size: 24, type: "chevron-down", color: m.color.primary.main })), Nl = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${F.light`
|
|
2894
|
+
background-color: ${m.color.background50};
|
|
2866
2895
|
&:hover {
|
|
2867
|
-
background-color: ${
|
|
2896
|
+
background-color: ${m.color.background100};
|
|
2868
2897
|
}
|
|
2869
2898
|
&:active {
|
|
2870
|
-
background-color: ${
|
|
2899
|
+
background-color: ${m.color.background200};
|
|
2871
2900
|
}
|
|
2872
2901
|
`}
|
|
2873
|
-
${
|
|
2874
|
-
background-color: ${
|
|
2902
|
+
${F.dark`
|
|
2903
|
+
background-color: ${m.color.background400};
|
|
2875
2904
|
&:hover {
|
|
2876
|
-
background-color: ${
|
|
2905
|
+
background-color: ${m.color.background500};
|
|
2877
2906
|
}
|
|
2878
2907
|
&:active {
|
|
2879
|
-
background-color: ${
|
|
2908
|
+
background-color: ${m.color.background700};
|
|
2880
2909
|
}
|
|
2881
2910
|
`}
|
|
2882
2911
|
|
|
2883
2912
|
&:focus {
|
|
2884
2913
|
outline: none;
|
|
2885
2914
|
}
|
|
2886
|
-
`,
|
|
2887
|
-
const { chatSDK: e } =
|
|
2888
|
-
return
|
|
2915
|
+
`, sr = () => {
|
|
2916
|
+
const { chatSDK: e } = B(), { channelSource: t } = J(), [n, o] = S([]);
|
|
2917
|
+
return Sn(e, {
|
|
2889
2918
|
onTypingStatusUpdated(i) {
|
|
2890
2919
|
var a;
|
|
2891
2920
|
if (i.url === ((a = t.channel) == null ? void 0 : a.url)) {
|
|
@@ -2894,22 +2923,22 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
|
|
|
2894
2923
|
}
|
|
2895
2924
|
}
|
|
2896
2925
|
}), n;
|
|
2897
|
-
},
|
|
2898
|
-
const { agentPreviewConfigs: e = {}, aiAgentId: t } =
|
|
2926
|
+
}, Pl = () => {
|
|
2927
|
+
const { agentPreviewConfigs: e = {}, aiAgentId: t } = B(), { aiAgentInfo: n } = z(), { stringSet: o, dateLocale: i } = R(), { messageSource: a } = J(), { Template: s } = ye.useContext(), l = e.welcomeMessages ?? [], c = a.messages, d = il(c, t), h = c[d.length + 1], g = d[0] ?? h;
|
|
2899
2928
|
return {
|
|
2900
2929
|
/**
|
|
2901
2930
|
* Returns a list of messages filtered according to business requirements.
|
|
2902
2931
|
*/
|
|
2903
|
-
filteredMessages: c.filter((p) =>
|
|
2932
|
+
filteredMessages: c.filter((p) => al(p) ? !1 : l.length > 0 ? !et.isWelcomeMessage(p, t) : !0),
|
|
2904
2933
|
/**
|
|
2905
2934
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
2906
2935
|
*/
|
|
2907
|
-
shouldShowOriginalDate: (p) => p > 0 || l.length === 0 ? !0 :
|
|
2936
|
+
shouldShowOriginalDate: (p) => p > 0 || l.length === 0 ? !0 : h && !Nr(h.createdAt, (g == null ? void 0 : g.createdAt) ?? 0),
|
|
2908
2937
|
/**
|
|
2909
2938
|
* Renders the list of welcome messages from Bot Studio.
|
|
2910
2939
|
*/
|
|
2911
2940
|
renderAgentPreviewWelcomeMessages: () => l.length === 0 ? null : /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
2912
|
-
|
|
2941
|
+
ir,
|
|
2913
2942
|
{
|
|
2914
2943
|
style: { margin: "16px 0" },
|
|
2915
2944
|
date: g == null ? void 0 : g.createdAt,
|
|
@@ -2917,18 +2946,18 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
|
|
|
2917
2946
|
formatString: o.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
2918
2947
|
}
|
|
2919
2948
|
), l.map((p, x) => {
|
|
2920
|
-
const
|
|
2949
|
+
const b = x === l.length - 1, E = d.length !== c.length, f = l.length === 1 ? "single" : x === 0 ? "top" : b || E ? "bottom" : "middle";
|
|
2921
2950
|
return /* @__PURE__ */ r.createElement(
|
|
2922
2951
|
s,
|
|
2923
2952
|
{
|
|
2924
2953
|
messageType: "user",
|
|
2925
2954
|
message: p.message,
|
|
2926
2955
|
sender: n,
|
|
2927
|
-
groupType:
|
|
2956
|
+
groupType: f,
|
|
2928
2957
|
createdAt: (g == null ? void 0 : g.createdAt) ?? Date.now(),
|
|
2929
2958
|
extendedMessagePayload: { suggested_replies: p.suggestedReplies },
|
|
2930
2959
|
suggestedRepliesDirection: e.suggestedRepliesDirection,
|
|
2931
|
-
suggestedRepliesVisible:
|
|
2960
|
+
suggestedRepliesVisible: b && !E,
|
|
2932
2961
|
isBotMessage: !0,
|
|
2933
2962
|
onClickSuggestedReply: async ({ reply: C }) => {
|
|
2934
2963
|
a.sendUserMessage({ message: C });
|
|
@@ -2937,67 +2966,67 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
|
|
|
2937
2966
|
);
|
|
2938
2967
|
}))
|
|
2939
2968
|
};
|
|
2940
|
-
},
|
|
2941
|
-
function
|
|
2969
|
+
}, Fl = (e) => u(e).withConfig({ shouldForwardProp: Xr });
|
|
2970
|
+
function Bl(e) {
|
|
2942
2971
|
var o;
|
|
2943
2972
|
const t = "remove_powered_by", n = (o = e == null ? void 0 : e.appInfo) == null ? void 0 : o.applicationAttributes;
|
|
2944
2973
|
return Array.isArray(n) && n.includes(t);
|
|
2945
2974
|
}
|
|
2946
|
-
const
|
|
2947
|
-
const { stringSet: t } = R(), { chatSDK: n } =
|
|
2948
|
-
return
|
|
2949
|
-
|
|
2975
|
+
const Ul = ({ style: e }) => {
|
|
2976
|
+
const { stringSet: t } = R(), { chatSDK: n } = B(), { isActionbookTester: o } = Be();
|
|
2977
|
+
return Bl(n) || o ? null : /* @__PURE__ */ r.createElement(Hl, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
|
|
2978
|
+
zl,
|
|
2950
2979
|
{
|
|
2951
2980
|
variant: "caption2",
|
|
2952
2981
|
as: "a",
|
|
2953
2982
|
href: "https://sendbird.com?utm_medium=product&utm_source=aiagent&utm_campaign=fy26-glbl-ai-agent-poweredby",
|
|
2954
2983
|
"aria-label": "Learn more about Sendbird",
|
|
2955
|
-
rel:
|
|
2984
|
+
rel: Tt,
|
|
2956
2985
|
target: "_blank"
|
|
2957
2986
|
},
|
|
2958
2987
|
"Sendbird"
|
|
2959
2988
|
));
|
|
2960
|
-
},
|
|
2961
|
-
color: ${
|
|
2989
|
+
}, Hl = u(w)`color:${m.themedColor.textLowEmphasis};text-align:center;`, zl = Fl(w)`
|
|
2990
|
+
color: ${m.themedColor.textLowEmphasis};
|
|
2962
2991
|
cursor: pointer;
|
|
2963
2992
|
text-decoration: none;
|
|
2964
|
-
`,
|
|
2993
|
+
`, Vl = () => {
|
|
2965
2994
|
var c;
|
|
2966
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } =
|
|
2967
|
-
return
|
|
2995
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = J(), a = Wn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && a;
|
|
2996
|
+
return de(() => {
|
|
2968
2997
|
l && i.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2969
|
-
}, [l]), l ? /* @__PURE__ */ r.createElement(
|
|
2970
|
-
|
|
2998
|
+
}, [l]), l ? /* @__PURE__ */ r.createElement(Wl, null, /* @__PURE__ */ r.createElement(
|
|
2999
|
+
Gl,
|
|
2971
3000
|
{
|
|
2972
3001
|
variant: "button",
|
|
2973
3002
|
role: "button",
|
|
2974
|
-
color:
|
|
3003
|
+
color: m.themedColor.textHighEmphasis,
|
|
2975
3004
|
onClick: () => o()
|
|
2976
3005
|
},
|
|
2977
3006
|
e.START_NEW_CONVERSATION
|
|
2978
3007
|
)) : null;
|
|
2979
|
-
},
|
|
2980
|
-
const { Template: e } =
|
|
2981
|
-
const v =
|
|
3008
|
+
}, Wl = u.div`display:flex;justify-content:center;margin:16px 0;`, Gl = u(w)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${m.themedColor.textDisabled};cursor:pointer;user-select:none;`, jl = !0, Kl = () => {
|
|
3009
|
+
const { Template: e } = Lt.useContext(), { Template: t } = ye.useContext(), { Template: n } = Rt.useContext(), [o, i] = S(null), { userSession: a, aiAgentInfo: s } = z(), { agentPreviewConfigs: l, chatSDK: c, state: d } = B(), { stringSet: h, dateLocale: g } = R(), { conversation: p, channelSource: x, messageSource: b, scrollSource: E } = J(), { isActionbookTester: f } = Be(), { filteredMessages: C, shouldShowOriginalDate: y, renderAgentPreviewWelcomeMessages: k } = Pl(), { storage: _ } = On(), Y = sr(), L = Ot(() => {
|
|
3010
|
+
const v = Y[0];
|
|
2982
3011
|
if (!v) return null;
|
|
2983
|
-
const
|
|
2984
|
-
return { user:
|
|
3012
|
+
const V = v.userId === s.userId;
|
|
3013
|
+
return { user: V ? s : v, isBot: V };
|
|
2985
3014
|
});
|
|
2986
3015
|
D(() => {
|
|
2987
3016
|
L && E.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2988
3017
|
}, [!!L, E.scrollPubSub.publish]);
|
|
2989
|
-
const
|
|
3018
|
+
const ae = (v, V = !1) => {
|
|
2990
3019
|
var Ee;
|
|
2991
|
-
return
|
|
3020
|
+
return V ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((X) => X.userId === v.sender.userId)) ?? v.sender;
|
|
2992
3021
|
}, xe = () => {
|
|
2993
|
-
if (!
|
|
2994
|
-
return /* @__PURE__ */ r.createElement(
|
|
2995
|
-
if (
|
|
2996
|
-
const v =
|
|
2997
|
-
return v ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, v) : /* @__PURE__ */ r.createElement(
|
|
3022
|
+
if (!b.initialized)
|
|
3023
|
+
return /* @__PURE__ */ r.createElement(_e, { type: "loading" });
|
|
3024
|
+
if (b.messages.length === 0) {
|
|
3025
|
+
const v = k();
|
|
3026
|
+
return v ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, v) : /* @__PURE__ */ r.createElement(_e, { type: "noMessages", label: h.PLACE_HOLDER__NO_MESSAGES });
|
|
2998
3027
|
}
|
|
2999
3028
|
return /* @__PURE__ */ r.createElement(
|
|
3000
|
-
|
|
3029
|
+
Il,
|
|
3001
3030
|
{
|
|
3002
3031
|
ref: E.scrollRef,
|
|
3003
3032
|
scrollPositionRef: E.scrollPositionRef,
|
|
@@ -3005,10 +3034,10 @@ const Ol = ({ style: e }) => {
|
|
|
3005
3034
|
onScrollPosition: (v) => E.setIsScrollBottomReached(v === "bottom"),
|
|
3006
3035
|
stackDirection: l == null ? void 0 : l.messageStackDirection,
|
|
3007
3036
|
messages: C,
|
|
3008
|
-
onLoadPrev:
|
|
3009
|
-
onLoadNext:
|
|
3010
|
-
depsForResetScrollPositionToBottom: [
|
|
3011
|
-
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
3037
|
+
onLoadPrev: b.loadPrevious,
|
|
3038
|
+
onLoadNext: b.loadNext,
|
|
3039
|
+
depsForResetScrollPositionToBottom: [b.initialized, b.messages.length !== 0],
|
|
3040
|
+
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ul, { style: { marginTop: 16 } }), k()),
|
|
3012
3041
|
messageBottomArea: /* @__PURE__ */ r.createElement(r.Fragment, null, L && /* @__PURE__ */ r.createElement(
|
|
3013
3042
|
t,
|
|
3014
3043
|
{
|
|
@@ -3019,239 +3048,250 @@ const Ol = ({ style: e }) => {
|
|
|
3019
3048
|
groupType: "single",
|
|
3020
3049
|
message: ""
|
|
3021
3050
|
}
|
|
3022
|
-
), /* @__PURE__ */ r.createElement(
|
|
3023
|
-
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(
|
|
3024
|
-
renderMessage: ({ message: v, index:
|
|
3025
|
-
const Ee =
|
|
3026
|
-
(v.isFileMessage() || v.isUserMessage()) && i({ file:
|
|
3027
|
-
},
|
|
3028
|
-
v.isFileMessage() &&
|
|
3029
|
-
},
|
|
3030
|
-
|
|
3051
|
+
), /* @__PURE__ */ r.createElement(Vl, null)),
|
|
3052
|
+
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(Yl, { onClick: () => E.scrollPubSub.publish({ type: "scrollToBottom" }) })),
|
|
3053
|
+
renderMessage: ({ message: v, index: V }) => {
|
|
3054
|
+
const Ee = rl(v), X = C[V - 1], it = C[V + 1], ke = C[C.length - 1], Ae = v === ke, st = ol(v, X, it, jl), at = !qr((X == null ? void 0 : X.createdAt) ?? 0, v.createdAt) && y(V) && !f, A = (le) => {
|
|
3055
|
+
(v.isFileMessage() || v.isUserMessage()) && i({ file: le, sender: ae(v, v.sender.userId === s.userId) });
|
|
3056
|
+
}, I = () => {
|
|
3057
|
+
v.isFileMessage() && Mt(v.url);
|
|
3058
|
+
}, M = at ? /* @__PURE__ */ r.createElement(
|
|
3059
|
+
ir,
|
|
3031
3060
|
{
|
|
3032
3061
|
style: { margin: "16px 0" },
|
|
3033
3062
|
date: v.createdAt,
|
|
3034
3063
|
locale: g,
|
|
3035
|
-
formatString:
|
|
3064
|
+
formatString: h.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
3036
3065
|
}
|
|
3037
|
-
) : null,
|
|
3038
|
-
maxBodyWidth: d.expanded ?
|
|
3066
|
+
) : null, P = {
|
|
3067
|
+
maxBodyWidth: d.expanded ? Un : void 0,
|
|
3039
3068
|
extendedMessagePayload: v.extendedMessagePayload,
|
|
3040
3069
|
createdAt: v.createdAt,
|
|
3041
|
-
groupType:
|
|
3042
|
-
onClickMedia:
|
|
3043
|
-
onClickFile:
|
|
3044
|
-
},
|
|
3045
|
-
var
|
|
3070
|
+
groupType: st,
|
|
3071
|
+
onClickMedia: A,
|
|
3072
|
+
onClickFile: I
|
|
3073
|
+
}, Ce = (() => {
|
|
3074
|
+
var le, K;
|
|
3046
3075
|
if (Ze.isAdmin(v))
|
|
3047
3076
|
return Ze.isCSAT(v) ? p ? /* @__PURE__ */ r.createElement(
|
|
3048
3077
|
n,
|
|
3049
3078
|
{
|
|
3050
|
-
...
|
|
3079
|
+
...P,
|
|
3051
3080
|
...p,
|
|
3052
|
-
isResolvedWhenDeterminedByUser:
|
|
3081
|
+
isResolvedWhenDeterminedByUser: ql(p),
|
|
3053
3082
|
messageType: "admin.csat",
|
|
3054
|
-
onSubmitCSAT: ({ csat:
|
|
3055
|
-
var
|
|
3056
|
-
|
|
3083
|
+
onSubmitCSAT: ({ csat: W, csatType: G, csatReason: N, isResolved: ce }) => {
|
|
3084
|
+
var he;
|
|
3085
|
+
W && ((he = x.channel) == null || he.submitCSAT({ csat: W, csatType: G, csatReason: N, isResolved: ce }));
|
|
3057
3086
|
}
|
|
3058
3087
|
}
|
|
3059
|
-
) : null : /* @__PURE__ */ r.createElement(n, { ...
|
|
3088
|
+
) : null : /* @__PURE__ */ r.createElement(n, { ...P, messageType: "admin", message: v.message });
|
|
3060
3089
|
if (Ze.isOutgoing(v, a.userId)) {
|
|
3061
|
-
const
|
|
3062
|
-
...
|
|
3090
|
+
const W = {
|
|
3091
|
+
...P,
|
|
3063
3092
|
message: v.message,
|
|
3064
|
-
sender:
|
|
3093
|
+
sender: ae(v),
|
|
3065
3094
|
sendingStatus: v.sendingStatus
|
|
3066
3095
|
};
|
|
3067
3096
|
if (v.isUserMessage())
|
|
3068
|
-
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...
|
|
3097
|
+
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...W });
|
|
3069
3098
|
if (v.isFileMessage()) {
|
|
3070
|
-
const [
|
|
3099
|
+
const [G, N] = ((le = v.metaArrays.find((ce) => ce.key === Xn)) == null ? void 0 : le.value) ?? [];
|
|
3071
3100
|
return /* @__PURE__ */ r.createElement(
|
|
3072
3101
|
e,
|
|
3073
3102
|
{
|
|
3074
3103
|
messageType: "file",
|
|
3075
3104
|
file: v,
|
|
3076
3105
|
metadata: {
|
|
3077
|
-
aspectRatio:
|
|
3078
|
-
localFile: (
|
|
3106
|
+
aspectRatio: G && N ? `${G}/${N}` : "1/1",
|
|
3107
|
+
localFile: (K = v.messageParams) == null ? void 0 : K.file
|
|
3079
3108
|
},
|
|
3080
|
-
...
|
|
3109
|
+
...W
|
|
3081
3110
|
}
|
|
3082
3111
|
);
|
|
3083
3112
|
}
|
|
3084
3113
|
}
|
|
3085
3114
|
if (Ze.isIncoming(v, a.userId)) {
|
|
3086
|
-
const
|
|
3087
|
-
...
|
|
3088
|
-
sender:
|
|
3115
|
+
const W = v.sender.userId === s.userId, G = {
|
|
3116
|
+
...P,
|
|
3117
|
+
sender: ae(v, W),
|
|
3089
3118
|
message: v.message,
|
|
3090
|
-
suggestedRepliesVisible:
|
|
3119
|
+
suggestedRepliesVisible: Ae,
|
|
3091
3120
|
suggestedRepliesDirection: l == null ? void 0 : l.suggestedRepliesDirection,
|
|
3092
|
-
isBotMessage:
|
|
3093
|
-
onClickSuggestedReply: async ({ reply:
|
|
3094
|
-
|
|
3121
|
+
isBotMessage: W,
|
|
3122
|
+
onClickSuggestedReply: async ({ reply: N }) => {
|
|
3123
|
+
b.sendUserMessage({ message: N });
|
|
3095
3124
|
},
|
|
3096
|
-
onRequestMessageTemplate: async (
|
|
3097
|
-
const { template:
|
|
3098
|
-
return _.setTemplate(
|
|
3125
|
+
onRequestMessageTemplate: async (N) => {
|
|
3126
|
+
const { template: ce } = await c.aiAgent.getMessageTemplate(N);
|
|
3127
|
+
return _.setTemplate(N, ce), ce;
|
|
3099
3128
|
},
|
|
3100
|
-
onGetCachedMessageTemplate: (
|
|
3101
|
-
onHandleTemplateInternalAction: (
|
|
3102
|
-
if (
|
|
3103
|
-
const { method:
|
|
3104
|
-
|
|
3129
|
+
onGetCachedMessageTemplate: (N) => _.getTemplate(N),
|
|
3130
|
+
onHandleTemplateInternalAction: (N) => {
|
|
3131
|
+
if (N.type === "internal" && N.internalData) {
|
|
3132
|
+
const { method: ce, payload: he } = N.internalData;
|
|
3133
|
+
ce === "message.send" && (he != null && he.message) && b.sendUserMessage({ message: he.message });
|
|
3105
3134
|
}
|
|
3106
3135
|
}
|
|
3107
3136
|
};
|
|
3108
3137
|
if (v.isUserMessage())
|
|
3109
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...
|
|
3138
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...G });
|
|
3110
3139
|
if (v.isFileMessage())
|
|
3111
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: v, ...
|
|
3140
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: v, ...G });
|
|
3112
3141
|
}
|
|
3113
3142
|
})();
|
|
3114
|
-
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${Q}-message-item` },
|
|
3143
|
+
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${Q}-message-item` }, M, Ce);
|
|
3115
3144
|
}
|
|
3116
3145
|
}
|
|
3117
3146
|
);
|
|
3118
3147
|
};
|
|
3119
|
-
return /* @__PURE__ */ r.createElement(
|
|
3120
|
-
},
|
|
3121
|
-
function
|
|
3148
|
+
return /* @__PURE__ */ r.createElement(Zl, { id: `${Q}-message-list` }, xe(), o && /* @__PURE__ */ r.createElement(Tl, { onClose: () => i(null), sender: o.sender, file: o.file }));
|
|
3149
|
+
}, Zl = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Yl = u(Dl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
|
|
3150
|
+
function ql(e) {
|
|
3122
3151
|
var t;
|
|
3123
3152
|
if (((t = e == null ? void 0 : e.resolution) == null ? void 0 : t.determinedBy) === "user")
|
|
3124
3153
|
return e.resolution.isResolved;
|
|
3125
3154
|
}
|
|
3126
|
-
const
|
|
3127
|
-
const { stringSet: e } = R(), { connectionError: t } = z(), { channelSource: n } =
|
|
3155
|
+
const Jl = () => {
|
|
3156
|
+
const { stringSet: e } = R(), { connectionError: t } = z(), { channelSource: n } = J(), o = t || n.error;
|
|
3128
3157
|
if (o) {
|
|
3129
3158
|
const i = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
|
|
3130
|
-
return /* @__PURE__ */ r.createElement(
|
|
3159
|
+
return /* @__PURE__ */ r.createElement(_e, { type: "error", label: o.message, action: i });
|
|
3131
3160
|
}
|
|
3132
|
-
return n.channel ? /* @__PURE__ */ r.createElement(
|
|
3133
|
-
},
|
|
3134
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] = S(() => (t == null ? void 0 : t.status) ===
|
|
3161
|
+
return n.channel ? /* @__PURE__ */ r.createElement(Kl, null) : /* @__PURE__ */ r.createElement(_e, { type: "loading" });
|
|
3162
|
+
}, ar = () => {
|
|
3163
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] = S(() => (t == null ? void 0 : t.status) === j.OPEN);
|
|
3135
3164
|
return n ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
|
|
3136
|
-
},
|
|
3137
|
-
const { stringSet: e } = R(), { goToActiveConversation: t } =
|
|
3138
|
-
return /* @__PURE__ */ r.createElement(
|
|
3139
|
-
},
|
|
3140
|
-
background-color: ${
|
|
3165
|
+
}, Xl = () => {
|
|
3166
|
+
const { stringSet: e } = R(), { goToActiveConversation: t } = J(), n = ar();
|
|
3167
|
+
return /* @__PURE__ */ r.createElement(Ql, null, /* @__PURE__ */ r.createElement(w, { variant: "body1", color: m.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ r.createElement(ec, { onClick: t }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: m.themedColor.textHighEmphasis }, n)));
|
|
3168
|
+
}, Ql = u.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${F.light`
|
|
3169
|
+
background-color: ${m.color.background100};
|
|
3141
3170
|
`}
|
|
3142
|
-
${
|
|
3143
|
-
background-color: ${
|
|
3171
|
+
${F.dark`
|
|
3172
|
+
background-color: ${m.color.background500};
|
|
3144
3173
|
`}
|
|
3145
|
-
`,
|
|
3146
|
-
background-color: ${
|
|
3174
|
+
`, ec = u.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${m.themedColor.textDisabled};cursor:pointer;${F.light`
|
|
3175
|
+
background-color: ${m.color.background50};
|
|
3147
3176
|
`}
|
|
3148
|
-
${
|
|
3149
|
-
background-color: ${
|
|
3177
|
+
${F.dark`
|
|
3178
|
+
background-color: ${m.color.background700};
|
|
3150
3179
|
`}
|
|
3151
|
-
`,
|
|
3152
|
-
const { stringSet: t } = R(), {
|
|
3180
|
+
`, lr = Se(void 0), tc = ({ children: e }) => {
|
|
3181
|
+
const { stringSet: t } = R(), { attachmentMode: n } = z(), { channelSource: o } = J(), [i, a] = S([]), [s, l] = S({
|
|
3153
3182
|
visible: !1,
|
|
3154
3183
|
title: "",
|
|
3155
3184
|
buttonText: t.BUTTON__OK
|
|
3156
|
-
}), c = (
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3185
|
+
}), c = jn(o.channel), d = pe(() => {
|
|
3186
|
+
switch (n) {
|
|
3187
|
+
case re.OFF:
|
|
3188
|
+
return !1;
|
|
3189
|
+
case re.ALWAYS:
|
|
3190
|
+
return !0;
|
|
3191
|
+
case re.HANDED_OFF_ONLY:
|
|
3192
|
+
return c;
|
|
3193
|
+
default:
|
|
3194
|
+
return c;
|
|
3195
|
+
}
|
|
3196
|
+
}, [n, c]), h = (x) => {
|
|
3197
|
+
if (!d) return;
|
|
3198
|
+
const b = x.filter((E) => Pn.includes(E.type));
|
|
3199
|
+
if (b.length !== 0) {
|
|
3200
|
+
if (b.some((E) => E.size > hi)) {
|
|
3201
|
+
l((E) => ({
|
|
3202
|
+
...E,
|
|
3163
3203
|
visible: !0,
|
|
3164
3204
|
title: t.FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT.replace("%d", "25")
|
|
3165
3205
|
}));
|
|
3166
3206
|
return;
|
|
3167
3207
|
}
|
|
3168
|
-
if (
|
|
3169
|
-
l((
|
|
3170
|
-
...
|
|
3208
|
+
if (b.length > 1 || b.length > 0 && i.length > 0) {
|
|
3209
|
+
l((E) => ({
|
|
3210
|
+
...E,
|
|
3171
3211
|
visible: !0,
|
|
3172
3212
|
title: t.FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT
|
|
3173
3213
|
}));
|
|
3174
3214
|
return;
|
|
3175
3215
|
}
|
|
3176
|
-
a((
|
|
3177
|
-
...
|
|
3178
|
-
...
|
|
3179
|
-
file:
|
|
3180
|
-
preview: { url: URL.createObjectURL(
|
|
3216
|
+
a((E) => [
|
|
3217
|
+
...E,
|
|
3218
|
+
...b.map((f) => ({
|
|
3219
|
+
file: f,
|
|
3220
|
+
preview: { url: URL.createObjectURL(f), type: f.type, name: f.name }
|
|
3181
3221
|
}))
|
|
3182
3222
|
]);
|
|
3183
3223
|
}
|
|
3184
|
-
},
|
|
3185
|
-
a((
|
|
3186
|
-
var
|
|
3187
|
-
const
|
|
3188
|
-
return
|
|
3224
|
+
}, g = (x) => {
|
|
3225
|
+
a((b) => {
|
|
3226
|
+
var f;
|
|
3227
|
+
const E = (f = b[x]) == null ? void 0 : f.preview;
|
|
3228
|
+
return E && URL.revokeObjectURL(E.url), b.filter((C, y) => y !== x);
|
|
3189
3229
|
});
|
|
3190
|
-
},
|
|
3191
|
-
a((
|
|
3230
|
+
}, p = () => {
|
|
3231
|
+
a((x) => (x.forEach((b) => URL.revokeObjectURL(b.preview.url)), []));
|
|
3192
3232
|
};
|
|
3193
3233
|
return /* @__PURE__ */ r.createElement(
|
|
3194
|
-
|
|
3234
|
+
lr.Provider,
|
|
3195
3235
|
{
|
|
3196
3236
|
value: {
|
|
3197
3237
|
files: i,
|
|
3198
|
-
addFiles:
|
|
3199
|
-
removeFile:
|
|
3200
|
-
clearFiles:
|
|
3201
|
-
isFileUploadEnabled:
|
|
3238
|
+
addFiles: h,
|
|
3239
|
+
removeFile: g,
|
|
3240
|
+
clearFiles: p,
|
|
3241
|
+
isFileUploadEnabled: d
|
|
3202
3242
|
}
|
|
3203
3243
|
},
|
|
3204
3244
|
e,
|
|
3205
|
-
/* @__PURE__ */ r.createElement(
|
|
3245
|
+
/* @__PURE__ */ r.createElement(nc, { ...s, onClose: () => l((x) => ({ ...x, visible: !1, title: "" })) })
|
|
3206
3246
|
);
|
|
3207
|
-
},
|
|
3208
|
-
const e =
|
|
3247
|
+
}, Nt = () => {
|
|
3248
|
+
const e = ne(lr);
|
|
3209
3249
|
if (!e)
|
|
3210
3250
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
3211
3251
|
return e;
|
|
3212
|
-
},
|
|
3252
|
+
}, nc = ({
|
|
3213
3253
|
title: e,
|
|
3214
3254
|
buttonText: t,
|
|
3215
3255
|
visible: n,
|
|
3216
3256
|
onClose: o
|
|
3217
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
3218
|
-
function
|
|
3219
|
-
const o =
|
|
3220
|
-
e && t.current && n.activeElement === t.current && (o.current = !0),
|
|
3257
|
+
}) => /* @__PURE__ */ r.createElement(nr, { rootElementId: oe.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(rc, null, /* @__PURE__ */ r.createElement(ic, null, /* @__PURE__ */ r.createElement(w, { variant: "h1", color: m.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(oc, null, /* @__PURE__ */ r.createElement(sc, { onClick: o }, /* @__PURE__ */ r.createElement(w, { variant: "button", color: m.themedColor.textHighEmphasisInverse }, t))))), rc = u.div`width:100%;height:auto;padding-block:18px 24px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, oc = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, ic = u.div`margin-bottom:16px;`, sc = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${m.themedColor.error};border:1px solid ${m.themedColor.error};padding:10px 16px;&:hover{background-color:${m.color.error.dark};border-color:${m.color.error.dark};}&:active{background-color:${m.color.error.extraDark};}`;
|
|
3258
|
+
function ac({ blurred: e, elementRef: t, document: n = window.document }) {
|
|
3259
|
+
const o = U(!1);
|
|
3260
|
+
e && t.current && n.activeElement === t.current && (o.current = !0), de(() => {
|
|
3221
3261
|
var i;
|
|
3222
3262
|
!e && o.current && ((i = t.current) == null || i.focus(), o.current = !1);
|
|
3223
3263
|
}, [e]);
|
|
3224
3264
|
}
|
|
3225
|
-
const
|
|
3226
|
-
background-color: ${
|
|
3265
|
+
const lc = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, cc = u.div`display:flex;flex-shrink:0;position:relative;margin-block-start:8px;border-radius:12px;height:64px;img{border-radius:12px;object-fit:cover;width:64px;-webkit-user-drag:none;}`, dc = u.div`display:flex;align-items:center;justify-content:center;position:absolute;inset-inline-end:-8px;inset-block-start:-8px;cursor:pointer;border-radius:50%;${F.light`
|
|
3266
|
+
background-color: ${m.color.background50};
|
|
3227
3267
|
`}
|
|
3228
|
-
${
|
|
3229
|
-
background-color: ${
|
|
3268
|
+
${F.dark`
|
|
3269
|
+
background-color: ${m.color.background500};
|
|
3230
3270
|
`}
|
|
3231
3271
|
path {
|
|
3232
|
-
fill: ${
|
|
3272
|
+
fill: ${m.themedColor.textMidEmphasis};
|
|
3233
3273
|
}
|
|
3234
3274
|
|
|
3235
3275
|
&:hover {
|
|
3236
3276
|
path {
|
|
3237
|
-
fill: ${
|
|
3277
|
+
fill: ${m.themedColor.textHighEmphasis};
|
|
3238
3278
|
}
|
|
3239
3279
|
}
|
|
3240
3280
|
|
|
3241
3281
|
circle {
|
|
3242
|
-
stroke: ${
|
|
3282
|
+
stroke: ${m.themedColor.bg_50_600};
|
|
3243
3283
|
}
|
|
3244
|
-
`,
|
|
3245
|
-
const e = Pe(), [t, n] = S(), { files: o, removeFile: i, isFileUploadEnabled: a } =
|
|
3246
|
-
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(
|
|
3247
|
-
},
|
|
3248
|
-
const { stringSet: n } = R(), { aiAgentInfo: o } = z(), i =
|
|
3284
|
+
`, uc = () => {
|
|
3285
|
+
const e = Pe(), [t, n] = S(), { files: o, removeFile: i, isFileUploadEnabled: a } = Nt();
|
|
3286
|
+
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(lc, null, o.map(({ preview: { type: s, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(cc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(dc, { title: "Remove file", onClick: () => i(d) }, /* @__PURE__ */ r.createElement(O, { type: "close-filled", color: m.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(At, { name: l, type: kt(l, s) }))));
|
|
3287
|
+
}, mc = ({ channel: e, messages: t }) => {
|
|
3288
|
+
const { stringSet: n } = R(), { aiAgentInfo: o } = z(), i = hc(), a = gc({
|
|
3249
3289
|
lastMessage: t[t.length - 1],
|
|
3250
3290
|
aiAgentUserId: o.userId
|
|
3251
3291
|
});
|
|
3252
|
-
return !e || !i ||
|
|
3253
|
-
},
|
|
3254
|
-
const e =
|
|
3292
|
+
return !e || !i || Wn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : a ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
|
|
3293
|
+
}, hc = () => {
|
|
3294
|
+
const e = Cn(), { chatSDK: t } = B(), [n, o] = S(!0);
|
|
3255
3295
|
return D(() => {
|
|
3256
3296
|
const i = new Qe({
|
|
3257
3297
|
onDisconnected: () => o(!1),
|
|
@@ -3262,23 +3302,23 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3262
3302
|
t.removeConnectionHandler(e);
|
|
3263
3303
|
};
|
|
3264
3304
|
}, [t]), n;
|
|
3265
|
-
},
|
|
3305
|
+
}, gc = ({
|
|
3266
3306
|
lastMessage: e,
|
|
3267
3307
|
aiAgentUserId: t
|
|
3268
3308
|
}) => {
|
|
3269
|
-
const [n, o] = S(!1), i =
|
|
3309
|
+
const [n, o] = S(!1), i = sr();
|
|
3270
3310
|
return D(() => {
|
|
3271
3311
|
if (!e) return;
|
|
3272
|
-
const a = i.some((l) => l.userId === t), s =
|
|
3312
|
+
const a = i.some((l) => l.userId === t), s = Qn(e, t) && et.isStreaming(e);
|
|
3273
3313
|
o(!!(s || a));
|
|
3274
3314
|
}, [i, e, t]), n;
|
|
3275
|
-
},
|
|
3315
|
+
}, cr = {
|
|
3276
3316
|
textArea: $`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
3277
3317
|
attachIcon: $`margin-bottom:4px;`
|
|
3278
|
-
},
|
|
3279
|
-
const t =
|
|
3318
|
+
}, dr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, pc = u(dr)`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};}}${St && cr.attachIcon};`, fc = u.input`display:none;`, dn = u.div`width:100%;position:relative;background-color:${m.themedColor.bg_100_500};border-radius:20px;`, un = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, mn = u.textarea`all:unset;display:block;flex:1;min-width:0;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;font-size:14px;line-height:20px;color:${m.themedColor.textHighEmphasis};resize:none;width:100%;height:${Nn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${St && cr.textArea};&::placeholder{color:${m.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${m.themedColor.textDisabled};}}`, hn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, gn = ({ disabled: e }) => {
|
|
3319
|
+
const t = U(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } = Nt();
|
|
3280
3320
|
return !a || i.length > 0 ? null : /* @__PURE__ */ r.createElement(
|
|
3281
|
-
|
|
3321
|
+
pc,
|
|
3282
3322
|
{
|
|
3283
3323
|
disabled: e,
|
|
3284
3324
|
onClick: () => {
|
|
@@ -3290,12 +3330,12 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3290
3330
|
O,
|
|
3291
3331
|
{
|
|
3292
3332
|
type: "attach",
|
|
3293
|
-
color: e ?
|
|
3333
|
+
color: e ? m.themedColor.textDisabled : m.themedColor.textMidEmphasis,
|
|
3294
3334
|
size: 16
|
|
3295
3335
|
}
|
|
3296
3336
|
),
|
|
3297
3337
|
/* @__PURE__ */ r.createElement(
|
|
3298
|
-
|
|
3338
|
+
fc,
|
|
3299
3339
|
{
|
|
3300
3340
|
type: "file",
|
|
3301
3341
|
ref: t,
|
|
@@ -3303,43 +3343,43 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3303
3343
|
const l = s.currentTarget.files;
|
|
3304
3344
|
l && n(Array.from(l)), s.target.value = "";
|
|
3305
3345
|
},
|
|
3306
|
-
accept:
|
|
3346
|
+
accept: Pn.join(",")
|
|
3307
3347
|
}
|
|
3308
3348
|
)
|
|
3309
3349
|
);
|
|
3310
|
-
},
|
|
3311
|
-
const e =
|
|
3350
|
+
}, bc = () => {
|
|
3351
|
+
const e = U(null), [t, n] = S(""), { rootElement: o } = B(), { channelSource: i, messageSource: a } = J(), [s, l] = mc({
|
|
3312
3352
|
channel: i.channel,
|
|
3313
3353
|
messages: a.messages
|
|
3314
|
-
}), { files: c, addFiles: d, clearFiles:
|
|
3315
|
-
|
|
3316
|
-
const g = t.trim().length > 0, p = c.length > 0, x = !s && (g || p),
|
|
3317
|
-
e.current && (e.current.value = "", e.current.style.height = ""),
|
|
3354
|
+
}), { files: c, addFiles: d, clearFiles: h } = Nt();
|
|
3355
|
+
Qa({ onDropFiles: d }), ac({ blurred: s, elementRef: e, document: fe(o) });
|
|
3356
|
+
const g = t.trim().length > 0, p = c.length > 0, x = !s && (g || p), b = () => {
|
|
3357
|
+
e.current && (e.current.value = "", e.current.style.height = ""), h(), n("");
|
|
3318
3358
|
}, E = async () => {
|
|
3319
|
-
const
|
|
3320
|
-
if (!(!
|
|
3359
|
+
const k = t.trim(), _ = { message: k };
|
|
3360
|
+
if (!(!k && !c.length)) {
|
|
3321
3361
|
if (c.length > 0) {
|
|
3322
|
-
const
|
|
3323
|
-
a.sendFileMessage(L),
|
|
3362
|
+
const Y = c[0].file, L = { ..._, file: Y };
|
|
3363
|
+
a.sendFileMessage(L), b();
|
|
3324
3364
|
return;
|
|
3325
3365
|
}
|
|
3326
|
-
a.sendUserMessage(_),
|
|
3366
|
+
a.sendUserMessage(_), b();
|
|
3327
3367
|
}
|
|
3328
|
-
},
|
|
3329
|
-
const _ = Array.from(
|
|
3330
|
-
_.length > 0 && (
|
|
3331
|
-
}, C = (
|
|
3332
|
-
|
|
3333
|
-
}, y = (
|
|
3368
|
+
}, f = (k) => {
|
|
3369
|
+
const _ = Array.from(k.clipboardData.files);
|
|
3370
|
+
_.length > 0 && (k.preventDefault(), d(_));
|
|
3371
|
+
}, C = (k) => {
|
|
3372
|
+
k.key !== "Enter" || k.nativeEvent.isComposing || k.shiftKey || (k.preventDefault(), E());
|
|
3373
|
+
}, y = (k) => {
|
|
3334
3374
|
if (e.current) {
|
|
3335
3375
|
e.current.style.height = "";
|
|
3336
|
-
const _ = Math.min(
|
|
3337
|
-
|
|
3376
|
+
const _ = Math.min(mi, e.current.scrollHeight);
|
|
3377
|
+
Nn < _ && (e.current.style.height = `${_}px`);
|
|
3338
3378
|
}
|
|
3339
|
-
n(
|
|
3379
|
+
n(k.target.value);
|
|
3340
3380
|
};
|
|
3341
|
-
return s ? /* @__PURE__ */ r.createElement(
|
|
3342
|
-
|
|
3381
|
+
return s ? /* @__PURE__ */ r.createElement(hn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(mn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(gn, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(hn, null, /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(uc, null), /* @__PURE__ */ r.createElement(un, null, /* @__PURE__ */ r.createElement(
|
|
3382
|
+
mn,
|
|
3343
3383
|
{
|
|
3344
3384
|
ref: e,
|
|
3345
3385
|
role: "textbox",
|
|
@@ -3348,135 +3388,135 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3348
3388
|
maxLength: 5e3,
|
|
3349
3389
|
onKeyDown: C,
|
|
3350
3390
|
onChange: y,
|
|
3351
|
-
onPaste:
|
|
3391
|
+
onPaste: f
|
|
3352
3392
|
}
|
|
3353
|
-
), /* @__PURE__ */ r.createElement(
|
|
3354
|
-
},
|
|
3355
|
-
color: ${
|
|
3393
|
+
), /* @__PURE__ */ r.createElement(gn, null))), x && /* @__PURE__ */ r.createElement(dr, { onClick: () => E() }, /* @__PURE__ */ r.createElement(O, { type: "send", color: m.color.primary.main, size: 20 })));
|
|
3394
|
+
}, xc = u.div`padding:8px 16px;text-align:center;word-break:break-word;white-space:pre-wrap;line-height:1.43;letter-spacing:-0.2px;font-size:14px;font-weight:400;color:${m.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${F.light`
|
|
3395
|
+
color: ${m.color.information.light};
|
|
3356
3396
|
`};
|
|
3357
|
-
${
|
|
3358
|
-
color: ${
|
|
3397
|
+
${F.dark`
|
|
3398
|
+
color: ${m.color.information.main};
|
|
3359
3399
|
`};
|
|
3360
3400
|
}
|
|
3361
|
-
`,
|
|
3362
|
-
const { aiAgentInfo: e } = z(), { messageSource: t } =
|
|
3363
|
-
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) =>
|
|
3364
|
-
},
|
|
3401
|
+
`, Ec = T(() => import("./DZK-INdk.js").then((e) => ({ default: e.MarkdownText }))), Cc = () => {
|
|
3402
|
+
const { aiAgentInfo: e } = z(), { messageSource: t } = J(), { userSession: n } = z();
|
|
3403
|
+
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) => Qn(i, n.userId))) ? null : /* @__PURE__ */ r.createElement(xc, null, /* @__PURE__ */ r.createElement(Ec, null, e.specialNotice));
|
|
3404
|
+
}, vc = () => /* @__PURE__ */ r.createElement(yc, null, /* @__PURE__ */ r.createElement(Cc, null), /* @__PURE__ */ r.createElement(tc, null, /* @__PURE__ */ r.createElement(bc, null))), yc = u.div`z-index:0;border:none;width:100%;`, _c = () => {
|
|
3365
3405
|
var a, s, l;
|
|
3366
|
-
const { activeChannel: e } = z(), { channelSource: t } =
|
|
3367
|
-
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(
|
|
3368
|
-
},
|
|
3406
|
+
const { activeChannel: e } = z(), { channelSource: t } = J(), n = ((s = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : s.status) === j.CLOSED;
|
|
3407
|
+
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Xl, null) : /* @__PURE__ */ r.createElement(vc, null);
|
|
3408
|
+
}, Sc = () => {
|
|
3369
3409
|
var y;
|
|
3370
|
-
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } =
|
|
3410
|
+
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = B(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = J(), h = c.channel, p = Pe() ? 24 : 16, x = () => {
|
|
3371
3411
|
e.setOpened(!1);
|
|
3372
|
-
},
|
|
3412
|
+
}, b = async () => {
|
|
3373
3413
|
try {
|
|
3374
|
-
const
|
|
3375
|
-
t.info("conversation.handleAgentHandoff: success",
|
|
3376
|
-
} catch (
|
|
3377
|
-
t.error("conversation.handleAgentHandoff: error",
|
|
3414
|
+
const k = await (h == null ? void 0 : h.markConversationAsHandoff());
|
|
3415
|
+
t.info("conversation.handleAgentHandoff: success", k);
|
|
3416
|
+
} catch (k) {
|
|
3417
|
+
t.error("conversation.handleAgentHandoff: error", k);
|
|
3378
3418
|
}
|
|
3379
3419
|
}, E = async () => {
|
|
3380
|
-
|
|
3381
|
-
},
|
|
3382
|
-
return /* @__PURE__ */ r.createElement(
|
|
3383
|
-
|
|
3420
|
+
h && await i.send(lo.CloseConversation({ channelUrl: h.url }));
|
|
3421
|
+
}, f = l && (h == null ? void 0 : h.url) === l.url, C = s.showHandoffButton && !!((y = h == null ? void 0 : h.conversation) != null && y.handoff) && f;
|
|
3422
|
+
return /* @__PURE__ */ r.createElement(Ic, null, /* @__PURE__ */ r.createElement($c, null, d && /* @__PURE__ */ r.createElement(Ue, { onClick: () => d() }, /* @__PURE__ */ r.createElement(O, { type: "menu", size: 24, color: m.themedColor.textHighEmphasis })), f && /* @__PURE__ */ r.createElement(rr, { size: 34 }), /* @__PURE__ */ r.createElement(Oc, { variant: "h2", color: m.themedColor.textHighEmphasis }, s.nickname || (h == null ? void 0 : h.name))), /* @__PURE__ */ r.createElement(Mc, null, C && /* @__PURE__ */ r.createElement(
|
|
3423
|
+
Ac,
|
|
3384
3424
|
{
|
|
3385
3425
|
tooltipLabel: a.HEADER_BUTTON__AGENT_HANDOFF,
|
|
3386
|
-
disabled: !
|
|
3426
|
+
disabled: !ss(h),
|
|
3387
3427
|
size: p,
|
|
3388
|
-
onClick:
|
|
3428
|
+
onClick: b
|
|
3389
3429
|
}
|
|
3390
3430
|
), n && /* @__PURE__ */ r.createElement(
|
|
3391
|
-
|
|
3431
|
+
kc,
|
|
3392
3432
|
{
|
|
3393
|
-
disabled: !
|
|
3433
|
+
disabled: !Gn(h),
|
|
3394
3434
|
size: p,
|
|
3395
3435
|
onClick: E
|
|
3396
3436
|
}
|
|
3397
|
-
), o && /* @__PURE__ */ r.createElement(
|
|
3398
|
-
},
|
|
3399
|
-
const { state: n } =
|
|
3400
|
-
return /* @__PURE__ */ r.createElement(Ue, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(O, { type: n.expanded ? "collapse" : "expand", size: e, color:
|
|
3401
|
-
},
|
|
3437
|
+
), o && /* @__PURE__ */ r.createElement(Tc, { size: p }), /* @__PURE__ */ r.createElement(wc, { size: p, onClick: x })));
|
|
3438
|
+
}, Tc = ({ size: e, disabled: t }) => {
|
|
3439
|
+
const { state: n } = B();
|
|
3440
|
+
return /* @__PURE__ */ r.createElement(Ue, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(O, { type: n.expanded ? "collapse" : "expand", size: e, color: m.themedColor.textHighEmphasis }));
|
|
3441
|
+
}, wc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(O, { type: "close", size: e, color: m.themedColor.textHighEmphasis })), kc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
|
|
3402
3442
|
O,
|
|
3403
3443
|
{
|
|
3404
3444
|
type: "refresh",
|
|
3405
3445
|
size: e,
|
|
3406
|
-
color: t ?
|
|
3446
|
+
color: t ? m.themedColor.textDisabled : m.themedColor.textHighEmphasis
|
|
3407
3447
|
}
|
|
3408
|
-
)),
|
|
3448
|
+
)), Ac = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(qn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(Ue, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
|
|
3409
3449
|
O,
|
|
3410
3450
|
{
|
|
3411
3451
|
type: "agent",
|
|
3412
3452
|
size: e,
|
|
3413
|
-
color: n ?
|
|
3453
|
+
color: n ? m.themedColor.textDisabled : m.themedColor.textHighEmphasis
|
|
3414
3454
|
}
|
|
3415
|
-
))),
|
|
3416
|
-
const { isActionbookTester: e } =
|
|
3417
|
-
return e ? null : /* @__PURE__ */ r.createElement(
|
|
3418
|
-
},
|
|
3455
|
+
))), Ic = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${m.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, $c = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, Mc = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Oc = u(w)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ue = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Lc = () => {
|
|
3456
|
+
const { isActionbookTester: e } = Be();
|
|
3457
|
+
return e ? null : /* @__PURE__ */ r.createElement(Sc, null);
|
|
3458
|
+
}, pn = ({
|
|
3419
3459
|
children: e,
|
|
3420
3460
|
onNavigateToConversationList: t,
|
|
3421
3461
|
closedChannelUrl: n,
|
|
3422
3462
|
onClearClosedChannelUrl: o
|
|
3423
3463
|
}) => {
|
|
3424
|
-
const { Template: i } =
|
|
3464
|
+
const { Template: i } = Pt.useContext();
|
|
3425
3465
|
return /* @__PURE__ */ r.createElement(
|
|
3426
|
-
|
|
3466
|
+
Xa,
|
|
3427
3467
|
{
|
|
3428
3468
|
onNavigateToConversationList: t,
|
|
3429
3469
|
closedChannelUrl: n,
|
|
3430
3470
|
onClearClosedChannelUrl: o
|
|
3431
3471
|
},
|
|
3432
|
-
/* @__PURE__ */ r.createElement(
|
|
3472
|
+
/* @__PURE__ */ r.createElement(Et, null, /* @__PURE__ */ r.createElement(Et.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Dc, { ...a }, /* @__PURE__ */ r.createElement(i, null)), e)))
|
|
3433
3473
|
);
|
|
3434
|
-
},
|
|
3435
|
-
template:
|
|
3474
|
+
}, Pt = Te({
|
|
3475
|
+
template: Rc,
|
|
3436
3476
|
components: {
|
|
3437
|
-
Header:
|
|
3438
|
-
Body:
|
|
3439
|
-
Footer:
|
|
3477
|
+
Header: Lc,
|
|
3478
|
+
Body: Jl,
|
|
3479
|
+
Footer: _c
|
|
3440
3480
|
}
|
|
3441
3481
|
});
|
|
3442
|
-
function
|
|
3443
|
-
const { components: e } =
|
|
3482
|
+
function Rc() {
|
|
3483
|
+
const { components: e } = Pt.useContext();
|
|
3444
3484
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3445
3485
|
}
|
|
3446
|
-
const
|
|
3447
|
-
Provider:
|
|
3448
|
-
useContext:
|
|
3449
|
-
} =
|
|
3450
|
-
function
|
|
3486
|
+
const Dc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
3487
|
+
Provider: Nc,
|
|
3488
|
+
useContext: ur
|
|
3489
|
+
} = Z("ConversationList");
|
|
3490
|
+
function Pc({
|
|
3451
3491
|
conversationListFilter: e,
|
|
3452
3492
|
onOpenConversationView: t = Le,
|
|
3453
3493
|
children: n
|
|
3454
3494
|
}) {
|
|
3455
|
-
return /* @__PURE__ */ r.createElement(
|
|
3495
|
+
return /* @__PURE__ */ r.createElement(xo, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(Nc, { value: { ...o, onOpenConversationView: t } }, n));
|
|
3456
3496
|
}
|
|
3457
|
-
const
|
|
3458
|
-
template:
|
|
3497
|
+
const mr = Te({
|
|
3498
|
+
template: Fc,
|
|
3459
3499
|
// Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
|
|
3460
3500
|
components: {}
|
|
3461
3501
|
});
|
|
3462
|
-
function
|
|
3502
|
+
function Fc({
|
|
3463
3503
|
title: e = "",
|
|
3464
3504
|
lastMessageTimestamp: t = Date.now(),
|
|
3465
3505
|
onClick: n
|
|
3466
3506
|
}) {
|
|
3467
3507
|
const { stringSet: o, format: i } = R();
|
|
3468
|
-
return /* @__PURE__ */ r.createElement(
|
|
3508
|
+
return /* @__PURE__ */ r.createElement(Bc, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(Hc, null, /* @__PURE__ */ r.createElement(zc, null, /* @__PURE__ */ r.createElement(w, { variant: "subtitle1", color: m.themedColor.textHighEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE)), /* @__PURE__ */ r.createElement(w, { variant: "caption2", color: m.themedColor.textLowEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION))), /* @__PURE__ */ r.createElement(w, { variant: "body3", color: m.themedColor.textMidEmphasis }, e || o.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: m.themedColor.textHighEmphasis }), /* @__PURE__ */ r.createElement(Uc, null));
|
|
3469
3509
|
}
|
|
3470
|
-
const
|
|
3510
|
+
const Bc = u.div`display:flex;flex-direction:row;align-items:center;position:relative;width:100%;padding:14px 16px;box-sizing:border-box;gap:4px;cursor:pointer;`, Uc = u.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${m.themedColor.textDisabled};`, Hc = u.div`gap:4px;display:flex;flex-direction:column;flex:1;`, zc = u.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, Vc = ({ items: e, renderItem: t, onEndReached: n }) => {
|
|
3471
3511
|
const o = (i) => {
|
|
3472
3512
|
const a = i.target;
|
|
3473
3513
|
a.scrollHeight - a.scrollTop === a.clientHeight && (n == null || n());
|
|
3474
3514
|
};
|
|
3475
|
-
return /* @__PURE__ */ r.createElement(
|
|
3476
|
-
},
|
|
3477
|
-
const { stringSet: e } = R(), { listSource: t, onOpenConversationView: n } =
|
|
3478
|
-
return t.initialized ? t.channels.length === 0 ? /* @__PURE__ */ r.createElement(
|
|
3479
|
-
|
|
3515
|
+
return /* @__PURE__ */ r.createElement(Wc, { onScroll: (i) => o(i) }, e.map((i, a) => t(i, a)));
|
|
3516
|
+
}, Wc = u.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, Gc = () => {
|
|
3517
|
+
const { stringSet: e } = R(), { listSource: t, onOpenConversationView: n } = ur(), { Template: o } = mr.useContext();
|
|
3518
|
+
return t.initialized ? t.channels.length === 0 ? /* @__PURE__ */ r.createElement(_e, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ r.createElement(
|
|
3519
|
+
Vc,
|
|
3480
3520
|
{
|
|
3481
3521
|
items: t.channels,
|
|
3482
3522
|
renderItem: (i) => {
|
|
@@ -3488,7 +3528,7 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3488
3528
|
channelUrl: i.url,
|
|
3489
3529
|
title: (s = (a = i.conversation) == null ? void 0 : a.topics) == null ? void 0 : s.join(", "),
|
|
3490
3530
|
lastMessageTimestamp: (l = i.lastMessage) == null ? void 0 : l.createdAt,
|
|
3491
|
-
onClick: () => n(i.url,
|
|
3531
|
+
onClick: () => n(i.url, j.CLOSED),
|
|
3492
3532
|
channel: i
|
|
3493
3533
|
}
|
|
3494
3534
|
);
|
|
@@ -3497,55 +3537,55 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3497
3537
|
t.loadMore();
|
|
3498
3538
|
}
|
|
3499
3539
|
}
|
|
3500
|
-
) : /* @__PURE__ */ r.createElement(
|
|
3501
|
-
},
|
|
3502
|
-
const { refreshActiveChannel: e } = z(), { onOpenConversationView: t } =
|
|
3540
|
+
) : /* @__PURE__ */ r.createElement(_e, { type: "loading" });
|
|
3541
|
+
}, jc = () => {
|
|
3542
|
+
const { refreshActiveChannel: e } = z(), { onOpenConversationView: t } = ur(), n = ar();
|
|
3503
3543
|
return /* @__PURE__ */ r.createElement(
|
|
3504
|
-
|
|
3544
|
+
Kc,
|
|
3505
3545
|
{
|
|
3506
3546
|
role: "button",
|
|
3507
3547
|
onClick: async () => {
|
|
3508
3548
|
const o = await e();
|
|
3509
|
-
t(o,
|
|
3549
|
+
t(o, j.OPEN);
|
|
3510
3550
|
}
|
|
3511
3551
|
},
|
|
3512
|
-
/* @__PURE__ */ r.createElement(
|
|
3552
|
+
/* @__PURE__ */ r.createElement(Zc, { variant: "h1" }, n)
|
|
3513
3553
|
);
|
|
3514
|
-
},
|
|
3554
|
+
}, Kc = u.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, Zc = u(w)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, Yc = () => {
|
|
3515
3555
|
const { stringSet: e } = R();
|
|
3516
|
-
return /* @__PURE__ */ r.createElement(
|
|
3517
|
-
},
|
|
3518
|
-
const { Template: o } =
|
|
3556
|
+
return /* @__PURE__ */ r.createElement(qc, null, /* @__PURE__ */ r.createElement(Jc, { variant: "h2", color: m.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Xc, null));
|
|
3557
|
+
}, qc = u.div`display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;flex-shrink:0;height:56px;position:relative;background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Jc = u(w)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Xc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${m.themedColor.textDisabled};`, Qc = ({ conversationListFilter: e, children: t, onOpenConversationView: n }) => {
|
|
3558
|
+
const { Template: o } = Ft.useContext();
|
|
3519
3559
|
return /* @__PURE__ */ r.createElement(
|
|
3520
|
-
|
|
3560
|
+
Pc,
|
|
3521
3561
|
{
|
|
3522
3562
|
conversationListFilter: e,
|
|
3523
3563
|
onOpenConversationView: n
|
|
3524
3564
|
},
|
|
3525
|
-
/* @__PURE__ */ r.createElement(
|
|
3565
|
+
/* @__PURE__ */ r.createElement(td, null, /* @__PURE__ */ r.createElement(o, null)),
|
|
3526
3566
|
t
|
|
3527
3567
|
);
|
|
3528
|
-
},
|
|
3529
|
-
template:
|
|
3568
|
+
}, Ft = Te({
|
|
3569
|
+
template: ed,
|
|
3530
3570
|
components: {
|
|
3531
|
-
Header:
|
|
3532
|
-
Body:
|
|
3533
|
-
Footer:
|
|
3571
|
+
Header: Yc,
|
|
3572
|
+
Body: Gc,
|
|
3573
|
+
Footer: jc
|
|
3534
3574
|
}
|
|
3535
3575
|
});
|
|
3536
|
-
function
|
|
3537
|
-
const { components: e } =
|
|
3576
|
+
function ed() {
|
|
3577
|
+
const { components: e } = Ft.useContext();
|
|
3538
3578
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3539
3579
|
}
|
|
3540
|
-
const
|
|
3580
|
+
const td = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, nd = $`:where(#${oe.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, rd = [nd, ri, oi], od = (e, ...t) => Rr(e, ...rd, ...t), id = od``, sd = Qr(
|
|
3581
|
+
Pt,
|
|
3582
|
+
ye,
|
|
3583
|
+
Lt,
|
|
3541
3584
|
Rt,
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
Mt,
|
|
3545
|
-
Dt,
|
|
3546
|
-
ur
|
|
3585
|
+
Ft,
|
|
3586
|
+
mr
|
|
3547
3587
|
);
|
|
3548
|
-
function
|
|
3588
|
+
function ad({
|
|
3549
3589
|
appearance: e,
|
|
3550
3590
|
rootElement: t,
|
|
3551
3591
|
logger: n,
|
|
@@ -3555,9 +3595,9 @@ function Qc({
|
|
|
3555
3595
|
messageTemplate: s,
|
|
3556
3596
|
theme: l
|
|
3557
3597
|
}) {
|
|
3558
|
-
return
|
|
3598
|
+
return di(Ko, t), /* @__PURE__ */ r.createElement(Dr, { target: t }, /* @__PURE__ */ r.createElement(ai, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Uo, { internalVariables: s == null ? void 0 : s.__internalVariables }, /* @__PURE__ */ r.createElement(ni, { stringSet: i, logger: n, language: o }, /* @__PURE__ */ r.createElement(sd, null, a, /* @__PURE__ */ r.createElement(id, null))))));
|
|
3559
3599
|
}
|
|
3560
|
-
const
|
|
3600
|
+
const fn = {
|
|
3561
3601
|
key_payment_plan_container: {
|
|
3562
3602
|
color_variables: {},
|
|
3563
3603
|
created_at: 1232,
|
|
@@ -3742,17 +3782,17 @@ const hn = {
|
|
|
3742
3782
|
}
|
|
3743
3783
|
}
|
|
3744
3784
|
}
|
|
3745
|
-
},
|
|
3785
|
+
}, hr = Re(function({
|
|
3746
3786
|
rootElement: t = document.body,
|
|
3747
|
-
logLevel: n =
|
|
3787
|
+
logLevel: n = vn.WARN,
|
|
3748
3788
|
language: o = navigator.language,
|
|
3749
3789
|
userSessionInfo: i,
|
|
3750
3790
|
children: a,
|
|
3751
3791
|
...s
|
|
3752
3792
|
}, l) {
|
|
3753
3793
|
var c;
|
|
3754
|
-
return ve.level !== n && (ve.level = n),
|
|
3755
|
-
|
|
3794
|
+
return ve.level !== n && (ve.level = n), ci("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: oe.ENTRY, style: { width: "fit-content", height: "fit-content", ...s.entryStyle } }, /* @__PURE__ */ r.createElement(Po, { logger: ve, storage: cd }, /* @__PURE__ */ r.createElement(
|
|
3795
|
+
ad,
|
|
3756
3796
|
{
|
|
3757
3797
|
logger: ve,
|
|
3758
3798
|
rootElement: t,
|
|
@@ -3763,7 +3803,7 @@ const hn = {
|
|
|
3763
3803
|
theme: s.theme
|
|
3764
3804
|
},
|
|
3765
3805
|
/* @__PURE__ */ r.createElement(
|
|
3766
|
-
|
|
3806
|
+
io,
|
|
3767
3807
|
{
|
|
3768
3808
|
appId: s.appId,
|
|
3769
3809
|
aiAgentId: s.aiAgentId,
|
|
@@ -3771,39 +3811,39 @@ const hn = {
|
|
|
3771
3811
|
countryCode: s.countryCode,
|
|
3772
3812
|
context: s.context,
|
|
3773
3813
|
logger: ve,
|
|
3774
|
-
dispatcher:
|
|
3814
|
+
dispatcher: ld,
|
|
3775
3815
|
chatParams: { customApiHost: s.customApiHost, customWebSocketHost: s.customWebSocketHost }
|
|
3776
3816
|
},
|
|
3777
|
-
/* @__PURE__ */ r.createElement(
|
|
3817
|
+
/* @__PURE__ */ r.createElement(fi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(yi, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement(Fa, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id: oe.MODAL_ROOT }))))
|
|
3778
3818
|
)
|
|
3779
3819
|
)));
|
|
3780
|
-
}), ve = new
|
|
3820
|
+
}), ve = new In(vn.WARN), ld = new kn(ve), Bt = "@sba/message-template", bn = (e) => `${Bt}/templates/${e}`, xn = () => `${Bt}/token`, cd = Do({
|
|
3781
3821
|
onSetTemplate: (e, t) => {
|
|
3782
|
-
|
|
3822
|
+
fn[e] || ee.setItem(bn(e), t);
|
|
3783
3823
|
},
|
|
3784
3824
|
onGetTemplate: (e) => {
|
|
3785
|
-
const t =
|
|
3786
|
-
return t ? JSON.stringify(t) :
|
|
3825
|
+
const t = fn[e];
|
|
3826
|
+
return t ? JSON.stringify(t) : ee.getItem(bn(e));
|
|
3787
3827
|
},
|
|
3788
3828
|
onSetCachedToken(e) {
|
|
3789
|
-
|
|
3829
|
+
ee.setItem(xn(), e);
|
|
3790
3830
|
},
|
|
3791
3831
|
onGetCachedToken() {
|
|
3792
|
-
return
|
|
3832
|
+
return ee.getItem(xn());
|
|
3793
3833
|
},
|
|
3794
3834
|
onClear: () => {
|
|
3795
|
-
|
|
3835
|
+
ee.getKeys(Bt).forEach(ee.deleteItem);
|
|
3796
3836
|
}
|
|
3797
|
-
}),
|
|
3798
|
-
const { dir: n, rootElement: o } =
|
|
3837
|
+
}), gr = ({ children: e, isOpened: t }) => {
|
|
3838
|
+
const { dir: n, rootElement: o } = B(), i = fe(o, !0);
|
|
3799
3839
|
return D(() => {
|
|
3800
3840
|
const a = "sb-agent-block-scroll";
|
|
3801
3841
|
return t ? i.body.classList.add(a) : i.body.classList.remove(a), () => {
|
|
3802
3842
|
i.body.classList.remove(a);
|
|
3803
3843
|
};
|
|
3804
|
-
}, [i, t]), /* @__PURE__ */ r.createElement(
|
|
3805
|
-
},
|
|
3806
|
-
function
|
|
3844
|
+
}, [i, t]), /* @__PURE__ */ r.createElement(dd, { dir: n, $visible: t }, e);
|
|
3845
|
+
}, dd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${be.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, ud = 48, md = 2 / 3;
|
|
3846
|
+
function hd({
|
|
3807
3847
|
className: e,
|
|
3808
3848
|
isOpened: t,
|
|
3809
3849
|
onClick: n,
|
|
@@ -3812,11 +3852,11 @@ function id({
|
|
|
3812
3852
|
dir: a,
|
|
3813
3853
|
animated: s = !0,
|
|
3814
3854
|
backgroundColor: l,
|
|
3815
|
-
size: c =
|
|
3855
|
+
size: c = ud
|
|
3816
3856
|
}) {
|
|
3817
|
-
const d =
|
|
3857
|
+
const d = bt(l), h = Math.round(c * md);
|
|
3818
3858
|
return /* @__PURE__ */ r.createElement(
|
|
3819
|
-
|
|
3859
|
+
fd,
|
|
3820
3860
|
{
|
|
3821
3861
|
dir: a,
|
|
3822
3862
|
id: oe.LAUNCHER,
|
|
@@ -3827,11 +3867,11 @@ function id({
|
|
|
3827
3867
|
$backgroundColor: l,
|
|
3828
3868
|
$size: c
|
|
3829
3869
|
},
|
|
3830
|
-
/* @__PURE__ */ r.createElement(
|
|
3831
|
-
/* @__PURE__ */ r.createElement(
|
|
3870
|
+
/* @__PURE__ */ r.createElement(bd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: h }, /* @__PURE__ */ r.createElement(En.Open, { url: i, isDefaultIcon: o === "default_icon" })),
|
|
3871
|
+
/* @__PURE__ */ r.createElement(xd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: h }, /* @__PURE__ */ r.createElement(En.Close, { size: h }))
|
|
3832
3872
|
);
|
|
3833
3873
|
}
|
|
3834
|
-
const
|
|
3874
|
+
const gd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, pd = $`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 === Dn.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, pr = $`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => $`
|
|
3835
3875
|
path {
|
|
3836
3876
|
fill: ${e};
|
|
3837
3877
|
}
|
|
@@ -3840,14 +3880,14 @@ const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
3840
3880
|
}
|
|
3841
3881
|
`}
|
|
3842
3882
|
}
|
|
3843
|
-
`,
|
|
3844
|
-
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(
|
|
3883
|
+
`, fd = u.button`position:relative;padding:0;width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;background:${({ $backgroundColor: e }) => e};border-radius:50%;transition:all 0.3s cubic-bezier(0.31,-0.105,0.43,1.4);border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 16px 24px 2px rgba(33,33,33,0.12),0 6px 30px 5px rgba(33,33,33,0.08),0 6px 10px -5px rgba(33,33,33,0.04);${({ $animated: e }) => e && gd}`, fr = u.span`position:absolute;width:100%;height:100%;border-radius:50%;overflow:hidden;transition:transform 0.16s linear,opacity 0.08s linear,scale 0.16s linear;user-select:none;display:flex;justify-content:center;align-items:center;`, bd = u(fr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${pd}${pr}`, xd = u(fr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${pr}`, En = {
|
|
3884
|
+
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(It, null),
|
|
3845
3885
|
Close: ({ size: e }) => /* @__PURE__ */ r.createElement(O, { size: e, type: "chevron-down" })
|
|
3846
3886
|
};
|
|
3847
|
-
function
|
|
3848
|
-
const { colors: n } =
|
|
3849
|
-
return
|
|
3850
|
-
|
|
3887
|
+
function br({ className: e, size: t }) {
|
|
3888
|
+
const { colors: n } = Ct(), { dir: o, state: i } = B(), { launcherInfo: a } = z();
|
|
3889
|
+
return Cd(), /* @__PURE__ */ r.createElement(
|
|
3890
|
+
hd,
|
|
3851
3891
|
{
|
|
3852
3892
|
dir: o,
|
|
3853
3893
|
className: e,
|
|
@@ -3860,46 +3900,46 @@ function fr({ className: e, size: t }) {
|
|
|
3860
3900
|
}
|
|
3861
3901
|
);
|
|
3862
3902
|
}
|
|
3863
|
-
const
|
|
3864
|
-
function
|
|
3865
|
-
const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: o } =
|
|
3903
|
+
const Ed = 1e3 * 60;
|
|
3904
|
+
function Cd() {
|
|
3905
|
+
const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: o } = B(), i = U(null);
|
|
3866
3906
|
D(() => {
|
|
3867
3907
|
if (!o) return;
|
|
3868
3908
|
function a() {
|
|
3869
3909
|
i.current && (clearTimeout(i.current), i.current = null);
|
|
3870
3910
|
}
|
|
3871
3911
|
function s() {
|
|
3872
|
-
e.connectionState ===
|
|
3912
|
+
e.connectionState === Or.CLOSED && (e.reconnect(), n.debug("useSDKInactivityTimeout: reconnected")), a(), n.debug("useSDKInactivityTimeout: clear disconnect schedule");
|
|
3873
3913
|
}
|
|
3874
3914
|
function l() {
|
|
3875
3915
|
a(), i.current = setTimeout(async () => {
|
|
3876
3916
|
await e.disconnectWebSocket(), n.debug("useSDKInactivityTimeout: disconnected");
|
|
3877
|
-
},
|
|
3917
|
+
}, Ed);
|
|
3878
3918
|
}
|
|
3879
3919
|
t.opened ? s() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
|
|
3880
3920
|
}, [o, e, t.opened]);
|
|
3881
3921
|
}
|
|
3882
|
-
const
|
|
3883
|
-
function
|
|
3884
|
-
const e =
|
|
3922
|
+
const xr = Se(null);
|
|
3923
|
+
function vd() {
|
|
3924
|
+
const e = ne(xr);
|
|
3885
3925
|
if (!e)
|
|
3886
3926
|
throw new Error("useNavigator() must be used within <Navigator />");
|
|
3887
3927
|
return e;
|
|
3888
3928
|
}
|
|
3889
|
-
function
|
|
3890
|
-
const t =
|
|
3929
|
+
function Er({ children: e }) {
|
|
3930
|
+
const t = vd();
|
|
3891
3931
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
|
|
3892
3932
|
}
|
|
3893
|
-
const
|
|
3933
|
+
const yd = yn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, _d = yn`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, Sd = $`animation-name:${yd};animation-duration:0.3s;animation-fill-mode:forwards;`, Td = $``, wd = $`animation-name:${_d};animation-duration:0.3s;animation-fill-mode:forwards;`, kd = $`visibility:hidden;`, Ad = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
3894
3934
|
switch (e) {
|
|
3895
3935
|
case "entering":
|
|
3896
|
-
return
|
|
3936
|
+
return Sd;
|
|
3897
3937
|
case "entered":
|
|
3898
|
-
return
|
|
3938
|
+
return Td;
|
|
3899
3939
|
case "exiting":
|
|
3900
|
-
return
|
|
3940
|
+
return wd;
|
|
3901
3941
|
case "exited":
|
|
3902
|
-
return
|
|
3942
|
+
return kd;
|
|
3903
3943
|
default:
|
|
3904
3944
|
return "";
|
|
3905
3945
|
}
|
|
@@ -3908,23 +3948,23 @@ const gd = En`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
|
|
|
3908
3948
|
` : $`z-index:1;pointer-events:none;`}
|
|
3909
3949
|
`;
|
|
3910
3950
|
function Me({ initialId: e, children: t }) {
|
|
3911
|
-
const n =
|
|
3912
|
-
c((y) => [...y,
|
|
3951
|
+
const n = H((f, C) => {
|
|
3952
|
+
c((y) => [...y, f]), h((y) => ({ ...y, [f]: !0 })), C != null && C.reset && b((y) => ({
|
|
3913
3953
|
...y,
|
|
3914
|
-
[
|
|
3954
|
+
[f]: (y[f] || 0) + 1
|
|
3915
3955
|
})), p((y) => ({
|
|
3916
3956
|
...y,
|
|
3917
|
-
[
|
|
3957
|
+
[f]: "entering"
|
|
3918
3958
|
})), setTimeout(() => {
|
|
3919
3959
|
p((y) => ({
|
|
3920
3960
|
...y,
|
|
3921
|
-
[
|
|
3961
|
+
[f]: "entered"
|
|
3922
3962
|
}));
|
|
3923
3963
|
}, 300);
|
|
3924
|
-
}, []), o =
|
|
3925
|
-
c((
|
|
3926
|
-
if (
|
|
3927
|
-
const C =
|
|
3964
|
+
}, []), o = H(() => {
|
|
3965
|
+
c((f) => {
|
|
3966
|
+
if (f.length <= 1) return f;
|
|
3967
|
+
const C = f[f.length - 1];
|
|
3928
3968
|
return p((y) => ({
|
|
3929
3969
|
...y,
|
|
3930
3970
|
[C]: "exiting"
|
|
@@ -3933,107 +3973,107 @@ function Me({ initialId: e, children: t }) {
|
|
|
3933
3973
|
...y,
|
|
3934
3974
|
[C]: "exited"
|
|
3935
3975
|
})), c((y) => y.slice(0, -1));
|
|
3936
|
-
}, 300),
|
|
3976
|
+
}, 300), f;
|
|
3937
3977
|
});
|
|
3938
|
-
}, []), i =
|
|
3978
|
+
}, []), i = pe(() => ({
|
|
3939
3979
|
navigation: {
|
|
3940
3980
|
navigate: n,
|
|
3941
3981
|
pop: o
|
|
3942
3982
|
}
|
|
3943
|
-
}), [n, o]), a =
|
|
3944
|
-
(
|
|
3945
|
-
), [t]), s =
|
|
3946
|
-
const
|
|
3983
|
+
}), [n, o]), a = pe(() => wr.toArray(t).filter(
|
|
3984
|
+
(f) => f.type === Er
|
|
3985
|
+
), [t]), s = pe(() => {
|
|
3986
|
+
const f = {};
|
|
3947
3987
|
return a.forEach((C) => {
|
|
3948
|
-
const { id: y, lazy:
|
|
3949
|
-
|
|
3950
|
-
}),
|
|
3951
|
-
}, [a]), [l, c] = S([e]), [d,
|
|
3952
|
-
const
|
|
3988
|
+
const { id: y, lazy: k, children: _ } = C.props;
|
|
3989
|
+
f[y] = { lazy: k, element: typeof _ == "function" ? _(i) : _ };
|
|
3990
|
+
}), f;
|
|
3991
|
+
}, [a]), [l, c] = S([e]), [d, h] = S(() => {
|
|
3992
|
+
const f = {};
|
|
3953
3993
|
return Object.entries(s).forEach(([C, { lazy: y }]) => {
|
|
3954
|
-
y === !1 && (
|
|
3955
|
-
}),
|
|
3994
|
+
y === !1 && (f[C] = !0);
|
|
3995
|
+
}), f[e] = !0, f;
|
|
3956
3996
|
}), [g, p] = S(() => {
|
|
3957
|
-
const
|
|
3997
|
+
const f = {};
|
|
3958
3998
|
return Object.keys(s).forEach((C) => {
|
|
3959
|
-
C === e ?
|
|
3960
|
-
}),
|
|
3961
|
-
}), [x,
|
|
3962
|
-
return /* @__PURE__ */ r.createElement(
|
|
3999
|
+
C === e ? f[C] = "entered" : f[C] = "exited";
|
|
4000
|
+
}), f;
|
|
4001
|
+
}), [x, b] = S({}), E = l[l.length - 1];
|
|
4002
|
+
return /* @__PURE__ */ r.createElement(xr.Provider, { value: i }, /* @__PURE__ */ r.createElement(Id, null, Object.keys(s).map((f) => {
|
|
3963
4003
|
var _;
|
|
3964
|
-
if (!d[
|
|
3965
|
-
const C = g[
|
|
3966
|
-
return /* @__PURE__ */ r.createElement(
|
|
4004
|
+
if (!d[f]) return null;
|
|
4005
|
+
const C = g[f] || "exited", y = f === E, k = `${f}-${x[f] || 0}`;
|
|
4006
|
+
return /* @__PURE__ */ r.createElement(Ad, { key: k, $transitionState: C, $active: y }, (_ = s[f]) == null ? void 0 : _.element);
|
|
3967
4007
|
})));
|
|
3968
4008
|
}
|
|
3969
|
-
const
|
|
3970
|
-
Me.Screen =
|
|
3971
|
-
const
|
|
4009
|
+
const Id = u.div`position:relative;width:100%;height:100%;`;
|
|
4010
|
+
Me.Screen = Er;
|
|
4011
|
+
const ge = {
|
|
3972
4012
|
activeConv: "active-conv",
|
|
3973
4013
|
closedConv: "closed-conv",
|
|
3974
4014
|
convList: "conv-list"
|
|
3975
|
-
},
|
|
3976
|
-
|
|
4015
|
+
}, Cr = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(Me, { initialId: ge.activeConv }, /* @__PURE__ */ r.createElement(Me.Screen, { id: ge.activeConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(pn, { onNavigateToConversationList: () => n.navigate(ge.convList, { reset: !0 }) })), /* @__PURE__ */ r.createElement(Me.Screen, { id: ge.closedConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
4016
|
+
pn,
|
|
3977
4017
|
{
|
|
3978
4018
|
onNavigateToConversationList: () => n.pop(),
|
|
3979
4019
|
closedChannelUrl: t,
|
|
3980
4020
|
onClearClosedChannelUrl: () => e(void 0)
|
|
3981
4021
|
}
|
|
3982
|
-
)), /* @__PURE__ */ r.createElement(Me.Screen, { id:
|
|
3983
|
-
|
|
4022
|
+
)), /* @__PURE__ */ r.createElement(Me.Screen, { id: ge.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
4023
|
+
Qc,
|
|
3984
4024
|
{
|
|
3985
4025
|
onOpenConversationView: (o, i) => {
|
|
3986
|
-
i === "closed" ? (e(o), n.navigate(
|
|
4026
|
+
i === "closed" ? (e(o), n.navigate(ge.closedConv, { reset: !0 })) : n.navigate(ge.activeConv);
|
|
3987
4027
|
}
|
|
3988
4028
|
}
|
|
3989
4029
|
)));
|
|
3990
|
-
function
|
|
3991
|
-
const { dir: i } =
|
|
3992
|
-
return /* @__PURE__ */ r.createElement(
|
|
4030
|
+
function $d({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
|
|
4031
|
+
const { dir: i } = B();
|
|
4032
|
+
return /* @__PURE__ */ r.createElement(Md, null, /* @__PURE__ */ r.createElement(Od, { dir: i, id: oe.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
|
|
3993
4033
|
}
|
|
3994
|
-
const
|
|
3995
|
-
const o = Pe(), [i, a] = S(), s = o ?
|
|
3996
|
-
return /* @__PURE__ */ r.createElement(
|
|
3997
|
-
|
|
4034
|
+
const Md = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Od = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && Rd};${({ $isExpanded: e }) => e && Ld};`, Ld = $`width:743px;height:723px;`, Rd = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, su = Re(function({ children: e, ...t }, n) {
|
|
4035
|
+
const o = Pe(), [i, a] = S(), s = o ? gr : $d;
|
|
4036
|
+
return /* @__PURE__ */ r.createElement(hr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(Bn, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(s, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(br, null) }, /* @__PURE__ */ r.createElement(
|
|
4037
|
+
Cr,
|
|
3998
4038
|
{
|
|
3999
4039
|
closedChannelUrl: i,
|
|
4000
4040
|
setClosedChannelUrl: a
|
|
4001
4041
|
}
|
|
4002
4042
|
)), e)));
|
|
4003
4043
|
}), {
|
|
4004
|
-
Provider:
|
|
4005
|
-
useContext:
|
|
4006
|
-
} =
|
|
4007
|
-
function
|
|
4044
|
+
Provider: Dd,
|
|
4045
|
+
useContext: Ut
|
|
4046
|
+
} = Z("FixedMessengerStyle");
|
|
4047
|
+
function vr(e, t, n, o = 0) {
|
|
4008
4048
|
const { top: i, bottom: a, start: s, end: l } = n;
|
|
4009
4049
|
let c = "", d = "";
|
|
4010
4050
|
switch (e) {
|
|
4011
4051
|
case "start":
|
|
4012
|
-
d = `inset-inline-start: ${
|
|
4052
|
+
d = `inset-inline-start: ${q(s)}`;
|
|
4013
4053
|
break;
|
|
4014
4054
|
case "end":
|
|
4015
|
-
d = `inset-inline-end: ${
|
|
4055
|
+
d = `inset-inline-end: ${q(l)}`;
|
|
4016
4056
|
break;
|
|
4017
4057
|
}
|
|
4018
4058
|
switch (t) {
|
|
4019
4059
|
case "top":
|
|
4020
|
-
c = `top: calc(${
|
|
4060
|
+
c = `top: calc(${q(i)} + ${o}px)`;
|
|
4021
4061
|
break;
|
|
4022
4062
|
case "bottom":
|
|
4023
|
-
c = `bottom: calc(${
|
|
4063
|
+
c = `bottom: calc(${q(a)} + ${o}px)`;
|
|
4024
4064
|
break;
|
|
4025
4065
|
}
|
|
4026
4066
|
return $`${c};${d};`;
|
|
4027
4067
|
}
|
|
4028
|
-
function
|
|
4029
|
-
const { horizontal: t, vertical: n, margin: o, launcherSize: i } =
|
|
4030
|
-
return /* @__PURE__ */ r.createElement(
|
|
4068
|
+
function Nd(e) {
|
|
4069
|
+
const { horizontal: t, vertical: n, margin: o, launcherSize: i } = Ut();
|
|
4070
|
+
return /* @__PURE__ */ r.createElement(Pd, { ...e, size: i, $horizontal: t, $vertical: n, $margin: o });
|
|
4031
4071
|
}
|
|
4032
|
-
const
|
|
4033
|
-
function
|
|
4034
|
-
const { dir: o } =
|
|
4072
|
+
const Pd = u(br)`position:fixed;z-index:${be.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => vr(e, t, n)};`;
|
|
4073
|
+
function Fd({ isExpanded: e, isOpened: t, children: n }) {
|
|
4074
|
+
const { dir: o } = B(), { horizontal: i, vertical: a, margin: s, launcherSize: l } = Ut();
|
|
4035
4075
|
return /* @__PURE__ */ r.createElement(
|
|
4036
|
-
|
|
4076
|
+
Bd,
|
|
4037
4077
|
{
|
|
4038
4078
|
dir: o,
|
|
4039
4079
|
id: oe.WINDOW,
|
|
@@ -4047,39 +4087,39 @@ function $d({ isExpanded: e, isOpened: t, children: n }) {
|
|
|
4047
4087
|
n
|
|
4048
4088
|
);
|
|
4049
4089
|
}
|
|
4050
|
-
const
|
|
4090
|
+
const Bd = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;position:fixed;${({ $horizontal: e, $vertical: t, $margin: n, $launcherSize: o }) => vr(e, t, n, o + 12)};height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "left" : "right"} ${t}`};
|
|
4051
4091
|
[dir='rtl'] &:not([dir='ltr']),
|
|
4052
4092
|
&[dir='rtl'] {
|
|
4053
4093
|
transform-origin: ${({ $horizontal: e, $vertical: t }) => `${e === "start" ? "right" : "left"} ${t}`};
|
|
4054
4094
|
}
|
|
4055
4095
|
|
|
4056
|
-
${({ $isOpened: e }) => e &&
|
|
4057
|
-
${({ $isExpanded: e }) => e &&
|
|
4058
|
-
`,
|
|
4059
|
-
const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(
|
|
4060
|
-
const [E,
|
|
4061
|
-
return { horizontal: E === "start" ? "start" : "end", vertical:
|
|
4096
|
+
${({ $isOpened: e }) => e && Hd};
|
|
4097
|
+
${({ $isExpanded: e }) => e && Ud};
|
|
4098
|
+
`, Ud = $`width:743px;height:723px;`, Hd = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, yr = { top: 24, bottom: 24, start: 24, end: 24 }, zd = Re(function({ children: e, ...t }, n) {
|
|
4099
|
+
const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(yr), [d, h] = S(48), g = Pe(), p = g ? gr : Fd, { horizontal: x, vertical: b } = pe(() => {
|
|
4100
|
+
const [E, f] = a.split("-");
|
|
4101
|
+
return { horizontal: E === "start" ? "start" : "end", vertical: f === "top" ? "top" : "bottom" };
|
|
4062
4102
|
}, [a]);
|
|
4063
|
-
return /* @__PURE__ */ r.createElement(
|
|
4064
|
-
|
|
4103
|
+
return /* @__PURE__ */ r.createElement(hr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(Bn, null, ({ state: E }) => /* @__PURE__ */ r.createElement(
|
|
4104
|
+
Dd,
|
|
4065
4105
|
{
|
|
4066
|
-
value: { horizontal: x, vertical:
|
|
4106
|
+
value: { horizontal: x, vertical: b, margin: l, launcherSize: d, setPosition: s, setMargin: c, setLauncherSize: h }
|
|
4067
4107
|
},
|
|
4068
4108
|
/* @__PURE__ */ r.createElement(p, { isExpanded: E.expanded, isOpened: E.opened }, /* @__PURE__ */ r.createElement(
|
|
4069
|
-
|
|
4109
|
+
Cr,
|
|
4070
4110
|
{
|
|
4071
4111
|
closedChannelUrl: o,
|
|
4072
4112
|
setClosedChannelUrl: i
|
|
4073
4113
|
}
|
|
4074
4114
|
)),
|
|
4075
|
-
/* @__PURE__ */ r.createElement(
|
|
4115
|
+
/* @__PURE__ */ r.createElement(Nd, null),
|
|
4076
4116
|
e
|
|
4077
4117
|
)));
|
|
4078
|
-
}),
|
|
4118
|
+
}), Vd = (e) => {
|
|
4079
4119
|
var i, a, s, l;
|
|
4080
|
-
const { setPosition: t, setMargin: n, setLauncherSize: o } =
|
|
4081
|
-
return
|
|
4082
|
-
e.position && t(e.position), e.margin && n({ ...
|
|
4120
|
+
const { setPosition: t, setMargin: n, setLauncherSize: o } = Ut();
|
|
4121
|
+
return de(() => {
|
|
4122
|
+
e.position && t(e.position), e.margin && n({ ...yr, ...e.margin }), e.launcherSize && o(e.launcherSize);
|
|
4083
4123
|
}, [
|
|
4084
4124
|
e.position,
|
|
4085
4125
|
(i = e.margin) == null ? void 0 : i.top,
|
|
@@ -4088,35 +4128,36 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4088
4128
|
(l = e.margin) == null ? void 0 : l.end,
|
|
4089
4129
|
e.launcherSize
|
|
4090
4130
|
]), null;
|
|
4091
|
-
},
|
|
4092
|
-
Style:
|
|
4131
|
+
}, au = Object.assign(zd, {
|
|
4132
|
+
Style: Vd
|
|
4093
4133
|
});
|
|
4094
4134
|
export {
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4135
|
+
Tt as A,
|
|
4136
|
+
lo as C,
|
|
4137
|
+
su as D,
|
|
4138
|
+
au as F,
|
|
4099
4139
|
O as I,
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4140
|
+
Zn as L,
|
|
4141
|
+
Da as M,
|
|
4142
|
+
Lt as O,
|
|
4143
|
+
iu as P,
|
|
4144
|
+
Rt as S,
|
|
4145
|
+
w as a,
|
|
4146
|
+
hr as b,
|
|
4147
|
+
m as c,
|
|
4148
|
+
ad as d,
|
|
4109
4149
|
z as e,
|
|
4110
4150
|
R as f,
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4151
|
+
hd as g,
|
|
4152
|
+
ye as h,
|
|
4153
|
+
te as i,
|
|
4154
|
+
mr as j,
|
|
4155
|
+
pn as k,
|
|
4156
|
+
Pt as l,
|
|
4157
|
+
ld as m,
|
|
4158
|
+
Qc as n,
|
|
4159
|
+
Ft as o,
|
|
4160
|
+
An as p,
|
|
4161
|
+
re as q,
|
|
4162
|
+
B as u
|
|
4122
4163
|
};
|