@sendbird/ai-agent-messenger-react 1.2.5 → 1.2.7

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.
Files changed (37) hide show
  1. package/dist/cjs/{CXRPEuG-.cjs → 6Ljq47GZ.cjs} +1 -1
  2. package/dist/cjs/{DowWpnG0.cjs → 6xTfJrmg.cjs} +1 -1
  3. package/dist/cjs/{CrKG9A2m.cjs → B4mujFdj.cjs} +1 -1
  4. package/dist/cjs/{CMUqnGWo.cjs → BIDOBNC3.cjs} +1 -1
  5. package/dist/cjs/{B5U4XbGK.cjs → BZQfpGF3.cjs} +1 -1
  6. package/dist/cjs/{FdyX1U8o.cjs → BzMiZszH.cjs} +1 -1
  7. package/dist/cjs/{C1Vn3mTH.cjs → D5dT1ruo.cjs} +1 -1
  8. package/dist/cjs/{D6uDjEGT.cjs → D8KSxdhT.cjs} +1 -1
  9. package/dist/cjs/DdCvhwdF.cjs +207 -0
  10. package/dist/cjs/{CKKH64uB.cjs → DdQV23MS.cjs} +1 -1
  11. package/dist/cjs/{FrkbUcen.cjs → GZl6LE-p.cjs} +1 -1
  12. package/dist/cjs/{CeP-jUfc.cjs → MsdK6ffU.cjs} +1 -1
  13. package/dist/cjs/{DMo1MF5p.cjs → VJMogId3.cjs} +1 -1
  14. package/dist/cjs/{BvIqSXsB.cjs → eFpF2Osy.cjs} +1 -1
  15. package/dist/cjs/{B-7iTaEa.cjs → kTWMrzTz.cjs} +1 -1
  16. package/dist/cjs/yVmX6iux.cjs +1 -0
  17. package/dist/es/{mlHVKYk3.js → 7464aa--.js} +1 -1
  18. package/dist/es/{B9V0T5ZP.js → B1s75De5.js} +3 -1
  19. package/dist/es/{DvjrAXLD.js → BAebVbLs.js} +3 -1
  20. package/dist/es/{zI14HLvP.js → BKSUGIyL.js} +5 -3
  21. package/dist/es/{BsmWumox.js → BKhgSuql.js} +1 -1
  22. package/dist/es/{ClNlgaQQ.js → BUIIulLp.js} +1 -1
  23. package/dist/es/{DPH4j4kU.js → BV3rSe2G.js} +1 -1
  24. package/dist/es/{DX0dsMPA.js → BaBU5Xlk.js} +1266 -1225
  25. package/dist/es/{BQWJPfGp.js → CA1gVgSD.js} +3 -1
  26. package/dist/es/{YRQ0vk5Q.js → D0QwWNMF.js} +3 -1
  27. package/dist/es/{7Dvv5RpD.js → D4Vk_6v3.js} +1 -1
  28. package/dist/es/{D_eZyIAR.js → DYR8UT_l.js} +3 -1
  29. package/dist/es/{sl-YrKkN.js → DcqbdvlW.js} +3 -1
  30. package/dist/es/{B8c_rqvH.js → Dxrtj2R8.js} +3 -1
  31. package/dist/es/{BSz49qaD.js → EylKxx4d.js} +5 -3
  32. package/dist/es/_EVMCh6Y.js +5 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.ts +26 -0
  35. package/dist/index.js +19 -18
  36. package/package.json +2 -2
  37. package/dist/cjs/BokUvJrm.cjs +0 -207
@@ -1,30 +1,31 @@
1
1
  import * as r from "react";
2
- import { createContext as Te, useContext as re, useEffect as D, useState as S, useId as bn, useRef as F, useCallback as U, useLayoutEffect as ce, forwardRef as Re, useImperativeHandle as yr, lazy as w, Suspense as Oe, useMemo as ye, Component as _r, Fragment as Bt, useReducer as Sr, Children as Tr } from "react";
3
- import wr, { SendbirdProduct as kr, DeviceOsPlatform as Ft, SendbirdPlatform as Ar, ConnectionHandler as Qe, SendbirdError as Ir, SessionHandler as $r, LogLevel as xn, ConnectionState as Mr } from "@sendbird/chat";
4
- import u, { css as $, ThemeProvider as Or, useTheme as Et, createGlobalStyle as Lr, StyleSheetManager as Rr, keyframes as En } from "styled-components";
5
- import { format as Cn, isSameMinute as Ut, isSameDay as Dr } from "date-fns";
6
- import { enUS as Nr } from "date-fns/locale/en-US";
7
- import { AIAgentModule as Pr, ConversationStatus as W, ConversationType as Br } from "@sendbird/chat/aiAgent";
8
- import { useGroupChannelMessages as Fr, useGroupChannelHandler as vn, useForceUpdate as Ur } from "@sendbird/uikit-tools";
9
- import { GroupChannelModule as Hr, GroupChannelListOrder as yn, GroupChannelHandler as zr } from "@sendbird/chat/groupChannel";
10
- import { renderer as Vr, parser as Wr, MessageProvider as Gr } from "@sendbird/react-uikit-message-template-view";
11
- import { createMessageTemplate as jr } from "@sendbird/uikit-message-template";
12
- import _n from "dompurify";
13
- import { MessageMetaArray as Kr, SendingStatus as Zr } from "@sendbird/chat/message";
14
- import { isSameDay as Yr } from "date-fns/isSameDay";
15
- import { createPortal as qr } from "react-dom";
16
- import Jr from "@emotion/is-prop-valid";
17
- const j = (e, t) => {
18
- const n = Te(null), o = ({ children: s, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof s == "function" ? s(l) : s), i = ({ children: s }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof s == "function" ? s(l) : s : null), a = () => {
19
- const s = re(n);
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, Suspense as Oe, lazy as T, 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 we(e) {
27
- const t = Te({
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), m = {
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: m }, a);
43
+ return /* @__PURE__ */ r.createElement(t.Provider, { value: h }, a);
43
44
  }
44
45
  function o({ template: a, children: s }) {
45
- const { updateTemplate: l } = re(t);
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 = () => re(t), i.Context = t, i.Template = o, Object.keys(e.components).forEach((a) => {
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 } = re(t);
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 Xr(...e) {
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 mt() {
70
+ function ht() {
70
71
  }
71
- function Qr() {
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 Ht = (e) => {
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 = Ht(e.data);
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 = Ht(e.data);
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(at.ui), i = n(at.trail), a = n(at.marking);
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
- }, at = {
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 Sn {
119
+ class kn {
119
120
  constructor(t) {
120
121
  this.logger = t, this.subscribers = {};
121
122
  }
122
123
  async send(t) {
123
- const n = eo(), o = this.subscribers[t.type];
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 eo = () => {
141
- let e = mt, t = mt;
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
- }, to = "1.2.5", Ie = "sb-agent", no = to;
146
- var Tn = /* @__PURE__ */ ((e) => (e[e.VERBOSE = 0] = "VERBOSE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.NONE = 5] = "NONE", e))(Tn || {});
147
- class wn {
146
+ }, no = "1.2.7", 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 zt(e, t, n) {
168
- const o = wr.init({
168
+ function Gt(e, t, n) {
169
+ const o = kr.init({
169
170
  appId: e,
170
- modules: [new Hr(), new Pr()],
171
+ modules: [new zr(), new Fr()],
171
172
  localCacheEnabled: !0,
172
173
  ...n
173
174
  });
174
175
  return o.addSendbirdExtensions(
175
- [{ version: no, product: kr.AI_AGENT, platform: t.platform }],
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: ro,
182
+ Provider: oo,
182
183
  useContext: tt
183
- } = j("AIAgent");
184
- function oo({
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: m = {
196
- platform: Ar.JS,
197
- deviceOSPlatform: Qr() ? Ft.MOBILE_WEB : Ft.WEB
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 wn(Tn.WARN), f = d ?? new Sn(x);
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: f,
210
- chatSDK: a ?? zt(e, m, s)
210
+ dispatcher: b,
211
+ chatSDK: a ?? Gt(e, h, s)
211
212
  };
212
213
  });
213
214
  return D(() => {
214
215
  p((x) => {
215
- let f = x.logger, E = x.dispatcher, b = x.chatSDK;
216
- return c && c !== x.logger && (f = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? b = a : !a && x.chatSDK.appId !== e && (b = zt(e, m, { newInstance: !0, ...s })), {
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: f,
224
+ logger: b,
224
225
  dispatcher: E,
225
- chatSDK: b
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(ro, { value: g }, l);
231
+ }, [g.chatSDK]), /* @__PURE__ */ r.createElement(oo, { value: g }, l);
231
232
  }
232
- const io = (e, t, n) => Fr(e, t, { ...n, strictStreamingOrder: !0 });
233
- var ht = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(ht || {});
234
- class so {
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 ao = {
243
- CloseConversation: (e) => new lo(e)
243
+ const lo = {
244
+ CloseConversation: (e) => new co(e)
244
245
  };
245
- class lo extends so {
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: co
252
- } = j("AIAgentConversation");
253
- function uo({
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 = mt
262
+ onAfterSendMessage: l = ht
262
263
  }) {
263
- var b;
264
- const { chatSDK: c, logger: d, dispatcher: m } = tt(), { channel: g, channelFetchError: p, fetchChannel: x } = mo(t), f = io(c, g, {
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 T = typeof (y == null ? void 0 : y.channelUrl) == "string";
274
- g && T && y.channelUrl !== g.url || (d.debug("conversation.dispatcher: try to close conversation", g), g != null && g.conversation && g.conversation.status === W.OPEN && (await g.closeConversation(), a == null || a()));
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 m.subscribe(ht.ConversationClose, C), () => {
277
- m.unsubscribe(ht.ConversationClose, C);
277
+ return h.subscribe(gt.ConversationClose, C), () => {
278
+ h.unsubscribe(gt.ConversationClose, C);
278
279
  };
279
- }, [m, (b = g == null ? void 0 : g.conversation) == null ? void 0 : b.status, a]);
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: f.messages,
289
- initialized: f.initialized,
290
- loadPrevious: () => f.loadPrevious(),
291
- loadNext: () => f.loadNext(),
289
+ messages: b.messages,
290
+ initialized: b.initialized,
291
+ loadPrevious: () => b.loadPrevious(),
292
+ loadNext: () => b.loadNext(),
292
293
  sendUserMessage: async (C) => {
293
- var T;
294
- if (((T = g == null ? void 0 : g.conversation) == null ? void 0 : T.status) === W.CLOSED)
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 f.sendUserMessage(C, l);
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 T;
302
- if (((T = g == null ? void 0 : g.conversation) == null ? void 0 : T.status) === W.CLOSED)
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 f.sendFileMessage(C, l);
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(co, { value: E }, e);
311
+ return /* @__PURE__ */ r.createElement(uo, { value: E }, e);
311
312
  }
312
- function mo(e) {
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 Ir && s(c), n.error("conversation.fetchChannel: error", c);
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 ho {
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 = yn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
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 zr({
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 m = gt(this._pinnedChannels, c);
412
- m >= 0 ? (this._pinnedChannels.splice(m, 1), a.push(c)) : i.push(c);
413
- const p = this._pinnedChannels.findIndex((f) => (o.get(f.url) ?? 1 / 0) > d), x = p === -1 ? this._pinnedChannels.length : p;
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 = gt(this._channels, s), c = l < 0;
432
+ const l = pt(this._channels, s), c = l < 0;
432
433
  !c && this._channels.splice(l, 1);
433
- const m = go(this._channels, s, this._order).place, g = m === this._channels.length;
434
- c ? g ? (n || !this.hasMore) && (this._channels.push(s), i.push(s)) : (this._channels.splice(m, 0, s), i.push(s)) : (this._channels.splice(m, 0, s), a.push(s));
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, f, E;
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 b of t)
447
- o.has(b.url) ? i.push(b) : a.push(b);
448
- const s = this._upsertPinnedChannelsToArray(i), l = this._upsertRegularChannelsToArray(a, n), c = s.addedChannels.concat(l.addedChannels), d = s.updatedChannels.concat(l.updatedChannels), m = s.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);
449
- c.length > 0 && ((x = (p = this._collectionEventHandler) == null ? void 0 : p.onChannelsAdded) == null || x.call(p, {}, c)), d.length > 0 && ((E = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsUpdated) == null || E.call(f, {}, d)), m.length > 0 && this._removeChannelsFromView(m);
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 gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
511
+ const pt = (e, t) => e.findIndex((n) => n.isIdentical(t)), po = (e, t, n) => {
511
512
  if (e.length > 0) {
512
- const o = gt(e, t);
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 = Vt(e[s], t, n);
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: Vt(e[s], t, n) >= 0 ? s : s + 1, oldPosition: o };
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
- }, Vt = (e, t, n) => {
527
+ }, jt = (e, t, n) => {
527
528
  switch (n) {
528
- case yn.LATEST_LAST_MESSAGE:
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 po(e, t) {
538
- var f, E, b, C, y, T, _, K;
539
- const n = bn(), [o, i] = S(!1), [a, s] = S(null), [l, c] = S([]), [d, m] = S(null), g = F(!1), p = U(async () => {
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 ho(e, t);
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(), m(L), s(null);
556
+ }), await L.loadMore(), h(L), s(null);
556
557
  } catch (L) {
557
- m(null), s(L);
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
- (f = t.filter) == null ? void 0 : f.aiAgentChannelFilter,
565
- (b = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : b.join(),
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
- (T = t.filter) == null ? void 0 : T.deskChannelFilter,
568
- (K = (_ = t.filter) == null ? void 0 : _.pinnedChannelUrls) == null ? void 0 : K.join(),
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 = U(async () => {
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: fo
591
- } = j("AIAgentConversationList");
592
- function bo({ conversationListFilter: e, children: t }) {
593
- const { chatSDK: n, aiAgentId: o } = tt(), i = po(n, {
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: [W.CLOSED],
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(fo, { value: a }, t);
608
+ return /* @__PURE__ */ r.createElement(bo, { value: a }, t);
608
609
  }
609
- const pt = {
610
+ const ft = {
610
611
  DEFAULT_BOT_MSG_BG: "#eeeeee",
611
612
  WHITE: "#ffffff",
612
613
  BLACK: "#000000"
613
614
  };
614
- function kn(e) {
615
+ function $n(e) {
615
616
  return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
616
617
  }
617
- function xo(e) {
618
- const t = kn(e);
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 Eo(e) {
629
+ function Co(e) {
629
630
  return `#${e.map((t) => t.toString(16).padStart(2, "0")).join("")}`;
630
631
  }
631
- function Co(e, t, n) {
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 vo(e, t, n) {
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(m, g, p) {
644
- return p < 0 && (p += 1), p > 1 && (p -= 1), p < 0.16666666666666666 ? m + (g - m) * 6 * p : p < 0.5 ? g : p < 0.6666666666666666 ? m + (g - m) * (0.6666666666666666 - p) * 6 : m;
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] = xo(e), [s, l, c] = Co(o, i, a), d = Math.max(0, Math.min(1, c * t)), m = Math.max(0, Math.min(1, l * n)), [g, p, x] = vo(s, m, d);
652
- return Eo([Math.round(g), Math.round(p), Math.round(x)]);
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 yo(e, t = "light") {
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 ft(e) {
664
- const t = kn(e), n = 149, o = +`0x${t[1]}${t[2]}`, i = +`0x${t[3]}${t[4]}`, a = +`0x${t[5]}${t[6]}`;
665
- return o * 0.299 + i * 0.587 + a * 0.114 > n ? pt.BLACK : pt.WHITE;
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 _o(e, t, n, o, i) {
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 So = (e, t, n, o, i) => ({
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
- }, lt = {
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 Wt(e) {
790
- const t = To(e), { colors: n, aiAgentColorVariables: o } = wo(e, t), i = Ao(e);
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 To({ selectedTheme: e, palette: t, primary: n }) {
800
- const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary : yo(n, e) : 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 wo({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, i) {
808
- const a = i.primary.main, s = t ?? ft(a), l = n ?? pt.DEFAULT_BOT_MSG_BG, c = o ?? ft(l);
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" ? _o : So)(
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 ko(e, t, n) {
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 Ao({ typography: e }) {
833
+ function Io({ typography: e }) {
833
834
  if (!e)
834
- return lt;
835
- const t = { ...lt };
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 = lt[n], a = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
840
- t[n] = ko(i, o, a);
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: Io,
846
- useContext: An
847
- } = j("AIAgentTheme");
848
- function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }) {
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
- () => Wt({
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 = U(
858
+ ), l = H(
858
859
  (c, d) => {
859
- const m = (o == null ? void 0 : o.theme) ?? c, g = d == null ? void 0 : d(m), p = {
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 = Wt({ selectedTheme: m, palette: t, typography: n, ...p });
867
- s(x), e == null || e.info("theme.update:", m);
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(Io, { value: { theme: a, updateTheme: l } }, i);
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 In = (e) => {
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 Mo(e, t) {
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 Oo(e) {
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 Ct({
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("If transformer is not provided, value must be a {string, number, or boolean}");
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, In(l));
908
+ return i.replace(c, Mn(l));
908
909
  }, e);
909
910
  }
910
- async function Lo({
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, In(l)), e);
922
+ )).reduce((a, { regex: s, transformedValue: l }) => a.replace(s, Mn(l)), e);
922
923
  }
923
- const Ro = (e) => ({
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: Do,
931
- useContext: $n
932
- } = j("MessageCacheTemplate");
933
- function No({ logger: e, storage: t, children: n }) {
934
- const o = U(
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, m;
937
- const l = (m = (d = s.appInfo) == null ? void 0 : d.aiAgentInfo) == null ? void 0 : m.templateListToken;
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 = U(
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: m } = De(d);
949
- t.setTemplate(m, d);
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 = U(() => {
958
+ ), a = H(() => {
958
959
  t.clear();
959
960
  }, [t]);
960
- return /* @__PURE__ */ r.createElement(Do, { value: { shouldSyncCachedTemplate: o, syncCachedTemplates: i, clearCachedTemplates: a, storage: t } }, n);
961
+ return /* @__PURE__ */ r.createElement(No, { value: { shouldSyncCachedTemplate: o, syncCachedTemplates: i, clearCachedTemplates: a, storage: t } }, n);
961
962
  }
962
- function Po(e) {
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: Mn
979
- } = j("MessageTemplateFetching");
980
- function Fo({ children: e, internalVariables: t }) {
981
- const n = F({}), o = F({}), [i, a] = S({}), s = U((d, m) => {
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], ...m }
985
+ [d]: { fetching: !1, error: !1, ...g[d], ...h }
985
986
  }));
986
- }, []), l = U(
987
+ }, []), l = H(
987
988
  async ({
988
989
  onRequestTemplate: d,
989
- onGetCachedTemplate: m,
990
+ onGetCachedTemplate: h,
990
991
  templateKey: g,
991
992
  suspense: p = !1
992
993
  }) => {
993
- const x = m(g);
994
+ const x = h(g);
994
995
  if (x) return x;
995
- const f = o.current[g];
996
- if (f) return f;
996
+ const b = o.current[g];
997
+ if (b) return b;
997
998
  p || s(g, { fetching: !0 });
998
- const E = d(g).catch((b) => {
999
- throw p || s(g, { error: !0 }), b;
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, m) => {
1010
+ suspend: (d, h) => {
1010
1011
  if (n.current[d])
1011
1012
  return n.current[d];
1012
- const g = Po(m());
1013
+ const g = Fo(h());
1013
1014
  return n.current[d] = g, g;
1014
1015
  },
1015
1016
  getIsFetching: (d) => {
1016
- var m;
1017
- return ((m = i[d]) == null ? void 0 : m.fetching) ?? !1;
1017
+ var h;
1018
+ return ((h = i[d]) == null ? void 0 : h.fetching) ?? !1;
1018
1019
  },
1019
1020
  getHasError: (d) => {
1020
- var m;
1021
- return ((m = i[d]) == null ? void 0 : m.error) ?? !1;
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 de({ uiTemplateString: e, variables: t = {} }) {
1031
- const n = Oo(t);
1032
- return Ct({
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 ue({
1039
+ function me({
1039
1040
  theme: e,
1040
1041
  uiTemplateString: t,
1041
1042
  colorVariables: n = {}
1042
1043
  }) {
1043
- return Ct({
1044
+ return yt({
1044
1045
  template: t,
1045
1046
  variables: n,
1046
1047
  variableKeyPattern: (o) => rt.VARIABLE(o),
1047
- variableValueTransformer: (o) => Mo(e, o)
1048
+ variableValueTransformer: (o) => Oo(e, o)
1048
1049
  });
1049
1050
  }
1050
- function Uo({
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 : Ct({
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 m = d.map(({ key: g, variables: p }) => {
1065
- const x = a(g), { ui_template: f, color_variables: E } = De(x);
1066
- let b = JSON.stringify(f);
1067
- return b = de({
1068
- uiTemplateString: b,
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
- }), b = ue({
1071
+ }), f = me({
1071
1072
  theme: e,
1072
- uiTemplateString: b,
1073
+ uiTemplateString: f,
1073
1074
  colorVariables: E
1074
- }), b = ue({
1075
+ }), f = me({
1075
1076
  theme: e,
1076
- uiTemplateString: b,
1077
+ uiTemplateString: f,
1077
1078
  colorVariables: o
1078
- }), b = de({
1079
- uiTemplateString: b,
1079
+ }), f = ue({
1080
+ uiTemplateString: f,
1080
1081
  variables: p
1081
- }), nt(b);
1082
+ }), nt(f);
1082
1083
  });
1083
- return JSON.stringify(m);
1084
+ return JSON.stringify(h);
1084
1085
  }
1085
1086
  });
1086
1087
  }
1087
- async function Ho({
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 Lo({
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: m }) => {
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 f = JSON.stringify(p);
1103
- return f = de({
1104
- uiTemplateString: f,
1103
+ let b = JSON.stringify(p);
1104
+ return b = ue({
1105
+ uiTemplateString: b,
1105
1106
  variables: i
1106
- }), f = ue({
1107
+ }), b = me({
1107
1108
  theme: e,
1108
- uiTemplateString: f,
1109
+ uiTemplateString: b,
1109
1110
  colorVariables: x
1110
- }), f = ue({
1111
+ }), b = me({
1111
1112
  theme: e,
1112
- uiTemplateString: f,
1113
+ uiTemplateString: b,
1113
1114
  colorVariables: o
1114
- }), f = de({
1115
- uiTemplateString: f,
1116
- variables: m
1117
- }), nt(f);
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 zo = ({
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 = Uo({
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 = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
1142
- }, Vo = async ({
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 Ho({
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 = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
1156
- }, Wo = (e) => {
1157
- const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = Mn();
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 ? zo({
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
- }, Go = (e) => {
1169
- const [t] = Wo(e);
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 } = Mn();
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 Vo({
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
- }, jo = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}', Ne = "en", Ko = /* @__PURE__ */ new Set([
1182
+ }, 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
- ]), Zo = (e, t, n) => {
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
- }, Yo = Nr, qo = {
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
- }, vt = { language: "en", dateLocale: Yo, stringSet: qo }, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
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: vt
1258
- }, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne, vt]]);
1259
- async function Xo(e) {
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 = Ko.has(e) ? e : Ne;
1265
+ const t = Zo.has(e) ? e : Ne;
1263
1266
  try {
1264
- const { default: n } = await Zo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DvjrAXLD.js"), "./languages/en.ts": () => Promise.resolve().then(() => Jo), "./languages/es.ts": () => import("./zI14HLvP.js"), "./languages/fr.ts": () => import("./B9V0T5ZP.js"), "./languages/hi.ts": () => import("./YRQ0vk5Q.js"), "./languages/it.ts": () => import("./BQWJPfGp.js"), "./languages/ja.ts": () => import("./sl-YrKkN.js"), "./languages/ko.ts": () => import("./B8c_rqvH.js"), "./languages/pt.ts": () => import("./BSz49qaD.js"), "./languages/tr.ts": () => import("./D_eZyIAR.js") }), `./languages/${t}.ts`, 3);
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 vt;
1270
+ return _t;
1268
1271
  }
1269
1272
  }
1270
1273
  const {
1271
- Provider: Qo,
1274
+ Provider: ei,
1272
1275
  useContext: R
1273
- } = j("Localization");
1274
- function ei(e) {
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 ti({
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 = ei(e);
1287
- i.language !== s && (t == null || t.debug("localization.useEffect: update language", `${i.language} -> ${s}`), Xo(s).then(a));
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
- Qo,
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) => Cn(s, l, { locale: i.dateLocale, ...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", Gt = (e) => (t, ...n) => {
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
- }, N = {
1307
- light: Gt("light"),
1308
- dark: Gt("dark")
1309
- }, ni = $(({ theme: e }) => {
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
- }), ri = $`[${qe}='light'] &{--sb-text-high-emphasis:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled:var(--sendbird-onlight-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-ondark-text-disabled);--sb-bg-50-600:var(--sendbird-background-50);--sb-bg-100-500:var(--sendbird-background-100);--sb-bg-200-400:var(--sendbird-background-200);--sb-primary:var(--sendbird-primary-main);--sb-secondary:var(--sendbird-secondary-main);--sb-error:var(--sendbird-error-main);--sb-information:var(--sendbird-information-light);}[${qe}='dark'] &{--sb-text-high-emphasis:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled:var(--sendbird-ondark-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-onlight-text-disabled);--sb-bg-50-600:var(--sendbird-background-600);--sb-bg-100-500:var(--sendbird-background-500);--sb-bg-200-400:var(--sendbird-background-400);--sb-primary:var(--sendbird-primary-light);--sb-secondary:var(--sendbird-secondary-light);--sb-error:var(--sendbird-error-light);--sb-information:var(--sendbird-information-light);}`, h = {
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: oi,
1403
- useContext: ii
1404
- } = j("AIAgentTheme");
1405
- function si(e) {
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
- $o,
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(ai, { ...e })
1418
+ /* @__PURE__ */ r.createElement(li, { ...e })
1416
1419
  );
1417
1420
  }
1418
- function ai({ rootElement: e = document.body, children: t }) {
1419
- const { theme: n, updateTheme: o } = An();
1420
- return ce(() => {
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(Or, { theme: n }, /* @__PURE__ */ r.createElement(oi, { value: { theme: n, updateTheme: o } }, t));
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 li = (e, t) => {
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
- }, ci = (e, t = document.body) => {
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
- }, yt = /iPad|iPhone|iPod/.test(navigator.userAgent), di = /Android/.test(navigator.userAgent), Pe = (e) => yt || di, Q = "sb-agent", oe = {
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
- }, On = {
1458
+ }, Rn = {
1456
1459
  SESSION: `@${Q}-session`,
1457
1460
  USER_DATA: `@${Q}-udata`
1458
- }, Ln = {
1461
+ }, Dn = {
1459
1462
  DEFAULT_PRIMARY: "#742ddd",
1460
1463
  WHITE: "#ffffff"
1461
- }, Rn = 36, ui = 100, mi = 25 * 1024 * 1024, Dn = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], _t = "noopener noreferrer nofollow", We = {}, te = {
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 Nn(e) {
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 = te.getItem(l);
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
- te.setItem(c, d);
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
- te.deleteItem(l);
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 = Nn({
1528
+ const $e = Fn({
1526
1529
  keyGenerator: ({ appId: e, aiAgentId: t, userId: n }) => {
1527
- const o = hi(`${e}/${t}/${n}`);
1528
- return `${On.USER_DATA}/${o}`;
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 hi(e) {
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 = Nn({
1542
- keyGenerator: ({ appId: e, aiAgentId: t }) => `${On.SESSION}/${e}/${t}`
1544
+ const Ge = Fn({
1545
+ keyGenerator: ({ appId: e, aiAgentId: t }) => `${Rn.SESSION}/${e}/${t}`
1543
1546
  }), {
1544
- Provider: gi,
1545
- Consumer: Pn,
1546
- useContext: P
1547
- } = j("Agent");
1548
- function pi({
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, m] = S(!1), g = {
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) ?? m
1563
+ setExpanded: (t == null ? void 0 : t.setExpanded) ?? h
1561
1564
  };
1562
1565
  return /* @__PURE__ */ r.createElement(
1563
- gi,
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 fi() {
1578
- const { chatSDK: e, logger: t } = P(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } = $n(), a = U(
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 m = new $r({
1584
+ const h = new Mr({
1582
1585
  ...c,
1583
- onSessionTokenRequired: bi(c.onSessionTokenRequired, d)
1586
+ onSessionTokenRequired: xi(c.onSessionTokenRequired, d)
1584
1587
  });
1585
- e.setSessionHandler(m);
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 = U(async () => {
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 bi(e, t) {
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 xi = 24 * 60 * 60 * 1e3, {
1609
- Provider: Ei,
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
- } = j("MessengerSession"), Ci = Re(function({ userSessionInfo: e, children: t }, n) {
1612
- const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } = An(), { authenticate: f, deauthenticate: E } = fi(), [b, C] = S(
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, T] = S(void 0), [_, K] = S(null), [L, se] = S(null), [xe, v] = S(null), B = s == null ? void 0 : s.forceCreateChannel;
1615
- function Ee() {
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 - xi <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"), Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: A.userId }), null) : (c.debug("messengerSession.initialize: auto session info detected"), A) : null;
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 J = U(
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 = U(
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
- ), it = U(async () => {
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: m,
1651
+ country: h,
1645
1652
  context: g,
1646
- forceCreateChannel: B,
1653
+ forceCreateChannel: X,
1647
1654
  knownActiveChannelUrl: Ae(_.userId)
1648
1655
  });
1649
- return J(_.userId, A.active_channel.channel_url), C({ url: A.active_channel.channel_url, status: W.OPEN }), c.info(
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
- m,
1668
+ h,
1662
1669
  g,
1663
- B,
1670
+ X,
1664
1671
  Ae,
1665
- J
1666
- ]), st = U(
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 vn(a, {
1689
+ return Sn(a, {
1683
1690
  onChannelChanged: (A) => {
1684
1691
  var I;
1685
- A.isGroupChannel() && A.url === (b == null ? void 0 : b.url) && (c.info("messengerSession.channelChanged: channel.conversation", A.conversation), C({ url: A.url, status: ((I = A.conversation) == null ? void 0 : I.status) ?? W.OPEN }));
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 H, Ce;
1689
- if (A.conversation && A.conversation.type === Br.PROACTIVE && I.userId === ((H = a.currentUser) == null ? void 0 : H.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 ae = ((Ce = A.conversation) == null ? void 0 : Ce.status) ?? W.OPEN;
1692
- C({ url: A.url, status: ae }), l.setOpened(!0), vi({
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
- }), yr(n, () => {
1704
+ }), _r(n, () => {
1698
1705
  const A = async () => {
1699
- if (!b) throw new Error("No active conversation. Please start a conversation first.");
1700
- return await a.groupChannel.getChannel(b.url);
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: b,
1710
+ activeChannel: f,
1704
1711
  chatSDK: a,
1705
1712
  deauthenticate: async () => {
1706
- c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0), K(null), se(null), v(null), _ && (Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: _.userId }), c.debug("messengerSession.deauthenticate: cleared user session cache")), c.debug("messengerSession.deauthenticate: completed");
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 H = await (await A()).updateContext(i, I);
1710
- return { ...H, context: H.context ?? {} };
1716
+ const P = await (await A()).updateContext(i, I);
1717
+ return { ...P, context: P.context ?? {} };
1711
1718
  },
1712
1719
  patchContext: async (I) => {
1713
- const H = await (await A()).patchContext(i, I);
1714
- return { ...H, context: H.context ?? {} };
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
- }, [b, E, a, o, _, i]), D(() => {
1728
+ }, [f, E, a, o, _, i]), D(() => {
1722
1729
  async function A() {
1723
1730
  c.debug("messengerSession.initialize: start");
1724
- const I = Ee(), M = await a.aiAgent.requestMessengerSettings({
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: m,
1735
+ country: h,
1729
1736
  context: g,
1730
- forceCreateChannel: B,
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 H = null;
1741
+ let P = null;
1735
1742
  if (M.auto_created_user) {
1736
- const { user_id: Z, session_token: X, expire_at: ee } = M.auto_created_user;
1737
- Ge.set({ appId: o, aiAgentId: i }, { userId: Z, authToken: X, expireAt: ee }), H = { userId: Z, authToken: X };
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
- H = {
1746
+ P = {
1740
1747
  userId: (I == null ? void 0 : I.userId) ?? "",
1741
1748
  authToken: (I == null ? void 0 : I.authToken) ?? ""
1742
1749
  };
1743
- J(H.userId, M.active_channel.channel_url);
1750
+ ke(P.userId, M.active_channel.channel_url);
1744
1751
  function Ce() {
1745
- const Z = M.appearance.selected_theme;
1746
- x(Z, (ee) => {
1747
- const G = M.appearance.themes[ee];
1752
+ const K = M.appearance.selected_theme;
1753
+ x(K, (G) => {
1754
+ const N = M.appearance.themes[G];
1748
1755
  return {
1749
- primaryColor: G.primary_color,
1750
- botMessageBackgroundColor: G.bot_message_bg_color,
1751
- primaryContrastColor: G.primary_contrast_color,
1752
- botMessageBackgroundContrastColor: G.bot_message_bg_contrast_color
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
- }), T(void 0), K(H), se({
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
- }), M.launcher.auto_open && !Pe() && setTimeout(() => l.setOpened(!0), 500);
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 ae() {
1768
- C({ url: M.active_channel.channel_url, status: W.OPEN });
1776
+ function le() {
1777
+ C({ url: M.active_channel.channel_url, status: j.OPEN });
1769
1778
  }
1770
1779
  try {
1771
1780
  Ce();
1772
- const Z = (X) => K((ee) => ee ? { ...ee, authToken: X } : null);
1773
- await f(H, e == null ? void 0 : e.sessionHandler, Z), ae();
1774
- } catch (Z) {
1775
- Z instanceof Error && (c.error("messengerSession.initialize: failed to connect", Z), T(Z));
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
- Ei,
1793
+ vi,
1785
1794
  {
1786
1795
  value: {
1787
1796
  userSession: _,
1788
- activeChannel: b,
1789
- refreshActiveChannel: it,
1790
- createConversation: st,
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 vi({ sound: e }) {
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 Y = (e) => {
1817
+ const q = (e) => {
1808
1818
  const t = e;
1809
1819
  return typeof t == "number" ? `${t}px` : t;
1810
- }, k = ({
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(_i, { as: e, $variant: t, className: o, $color: n, ...i }), jt = /* @__PURE__ */ new WeakMap(), yi = (e, t) => {
1817
- let n = jt.get(t);
1818
- n || (n = /* @__PURE__ */ new Map(), jt.set(t, n));
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:${Y(i.fontSize)};font-weight:${i.fontWeight};${i.fontFamily ? `font-family: ${i.fontFamily};` : ""}
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
- }, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => yi(e, t.typography)}color:${({ $color: e }) => e};`, Be = 244, Bn = 640, Je = 26, Fn = 4, ie = 12, ke = 2, Si = 16, me = `${Q}-incoming-msg`, Ti = `${Q}-marked-text`;
1826
- function St(e) {
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 ke;
1840
+ return we;
1831
1841
  default:
1832
- return Si;
1842
+ return wi;
1833
1843
  }
1834
1844
  }
1835
- function Tt(e, t) {
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 Un(e) {
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 wi = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), ki = {
1852
- spinner: w(() => import("./BcUGcaq2.js")),
1853
- chat: w(() => import("./DcFCGVBm.js")),
1854
- message: w(() => import("./DsGXnanX.js")),
1855
- error: w(() => import("./B6fvrWGq.js")),
1856
- info: w(() => import("./CAIYsKDy.js")),
1857
- refresh: w(() => import("./B6xd54zt.js")),
1858
- "chevron-down": w(() => import("./BsimU71m.js")),
1859
- "chevron-right": w(() => import("./NmJl7zv3.js")),
1860
- done: w(() => import("./D_q6g3Dd.js")),
1861
- user: w(() => import("./CvqfQEhO.js")),
1862
- "file-document": w(() => import("./BAr50pfO.js")),
1863
- download: w(() => import("./B2CtcWp3.js")),
1864
- attach: w(() => import("./DY2ULcTX.js")),
1865
- delete: w(() => import("./DMruRpOm.js")),
1866
- close: w(() => import("./CuaBI7kd.js")),
1867
- "close-filled": w(() => import("./CxQFWLnW.js")),
1868
- send: w(() => import("./DZJyDpNp.js")),
1869
- menu: w(() => import("./BUYabNz7.js")),
1870
- expand: w(() => import("./wBtIAuNm.js")),
1871
- collapse: w(() => import("./C0RFfifL.js")),
1872
- agent: w(() => import("./Cc7XmLN1.js")),
1873
- question: w(() => import("./dqwvRBog.js")),
1874
- actionbook: w(() => import("./CrjNuryZ.js")),
1875
- function: w(() => import("./CvdSjw1c.js")),
1876
- "radio-on": w(() => import("./nmdo2Fbj.js")),
1877
- "radio-off": w(() => import("./BnZcRFmS.js")),
1878
- confluence: w(() => import("./BOnlh2zd.js")),
1879
- zendesk: w(() => import("./BAJ6LEKc.js")),
1880
- salesforce: w(() => import("./CT2kv4lr.js")),
1881
- sprinklr: w(() => import("./m2INcyV2.js")),
1882
- website: w(() => import("./BgGVGNdg.js")),
1883
- snippet: w(() => import("./BFcXPuf5.js")),
1884
- template: w(() => import("./awO7aBCv.js"))
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 = ki[e];
1897
+ const i = Ii[e];
1887
1898
  return /* @__PURE__ */ r.createElement(
1888
- Ii,
1899
+ Mi,
1889
1900
  {
1890
1901
  className: n,
1891
- $rtlFlip: wi.has(e),
1902
+ $rtlFlip: Ai.has(e),
1892
1903
  $size: t,
1893
- $color: o ?? h.color.primary.main
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
- }, Ai = $`[dir='rtl'] &{transform:scaleX(-1);}`, Ii = u.div`width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};display:inline-block;&:focus{outline:none;}svg{display:block;}[class*='fill']{fill:${({ $color: e }) => e};}[class*='stroke']{stroke:${({ $color: e }) => e};stroke-width:2px;stroke-linejoin:round;}${({ $rtlFlip: e }) => e && Ai};`;
1898
- function wt({
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 } = Et();
1906
- return /* @__PURE__ */ r.createElement($i, { onClick: i, $clickable: !!i }, /* @__PURE__ */ r.createElement(Oi, { $bgColor: o ?? a.base.primary }, /* @__PURE__ */ r.createElement(O, { type: "file-document", size: 24, color: n ?? a.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Li, null, /* @__PURE__ */ r.createElement(Ri, { variant: "button", color: h.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(k, { color: h.themedColor.textMidEmphasis, variant: "caption3" }, t)));
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 $i = u.div`border-radius:12px;gap:8px;width:${Be}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};${({ $clickable: e }) => e && Mi}`, Mi = $`cursor:pointer;&:hover{background-color:${h.themedColor.bg_100_500};}`, Oi = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Li = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ri = u(k)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
1909
- function Di({ file: e, children: t, onClickFile: n }) {
1910
- return /* @__PURE__ */ r.createElement(Ni, null, /* @__PURE__ */ r.createElement(
1911
- wt,
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: Tt(e.name, e.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 Ni = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`;
1920
- function Pi({ file: e, onClickMedia: t, children: n }) {
1921
- const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Ui, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Hi, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
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: `${me}-media-body`,
1935
+ id: `${se}-media-body`,
1925
1936
  onClick: () => t == null ? void 0 : t(e)
1926
1937
  };
1927
- return /* @__PURE__ */ r.createElement(Bi, null, /* @__PURE__ */ r.createElement(Fi, { ...i }, o()), n);
1938
+ return /* @__PURE__ */ r.createElement(Ui, null, /* @__PURE__ */ r.createElement(Hi, { ...i }, o()), n);
1928
1939
  }
1929
1940
  return null;
1930
1941
  }
1931
- const Bi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`, Fi = u.div`width:${Be}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${N.light`
1932
- background-color: ${h.color.background100};
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
- ${N.dark`
1935
- background-color: ${h.color.background400};
1945
+ ${F.dark`
1946
+ background-color: ${m.color.background400};
1936
1947
  `}
1937
- `, Ui = u.img`width:100%;height:100%;object-fit:cover;`, Hi = u.video`width:100%;height:100%;object-fit:cover;`, zi = "✱";
1938
- function Hn(e) {
1939
- const t = new RegExp(`${zi}+`, "g");
1940
- return e.replace(t, (n) => `<span id=${Ti} aria-label="masked-text">${n}</span>`);
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 Vi(e) {
1953
+ function Gi(e) {
1943
1954
  return e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>");
1944
1955
  }
1945
- function Wi(e) {
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: Hn(i.value) });
1972
+ }), n.map((i) => i.type !== "text" ? i : { ...i, value: Vn(i.value) });
1962
1973
  }
1963
- const Gi = w(async () => ({ default: (await import("./7Dvv5RpD.js")).MarkdownText })), ji = w(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
1964
- function Kt(e) {
1974
+ const Ki = T(async () => ({ default: (await import("./D4Vk_6v3.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 ?? Be, n = ye(() => Wi(e.message), [e.message]), o = {
1967
- id: `${me}-text-body`,
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(Zt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Zt, { ...o }, n.map((s, l) => s.type === "text" ? /* @__PURE__ */ r.createElement(Yt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(Oe, { fallback: s.value }, /* @__PURE__ */ r.createElement(Gi, { onClickImage: (c) => {
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(Yt, { variant: "body3" }, s.value) }, /* @__PURE__ */ r.createElement(ji, { code: s.value, language: s.language })) : null), e.children);
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 Zt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
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
- `, Yt = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
1985
- function Ki(e) {
1986
- const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Kt, { ...e }) : null;
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(Pi, { ...e }, n) : /* @__PURE__ */ r.createElement(Di, { ...e }, n);
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(Kt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
2004
+ return /* @__PURE__ */ r.createElement(qt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
1994
2005
  }
1995
- const kt = (e) => /* @__PURE__ */ r.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.0008 0.973633C10.6172 0.973633 9.49558 2.09527 9.49558 3.47888C9.49558 4.50705 10.115 5.39055 11.0009 5.77664V7.47887H13.0009V5.77653C13.8868 5.3904 14.5061 4.50696 14.5061 3.47888C14.5061 2.09527 13.3844 0.973633 12.0008 0.973633ZM0.250977 16.5788L0.250977 10.5789H2.25098L2.25098 16.5788H0.250977ZM21.7511 10.5789V16.5788H23.7511V10.5789H21.7511ZM18.251 7.47888H3.25097V18.9789C3.25097 20.3596 4.37026 21.4789 5.75097 21.4789H18.251C19.6317 21.4789 20.751 20.3596 20.751 18.9789V9.97887C20.751 8.59816 19.6317 7.47888 18.251 7.47888ZM9.78434 11.9539V15.2038C9.78434 15.7561 9.33663 16.2038 8.78434 16.2038C8.23206 16.2038 7.78434 15.7561 7.78434 15.2038V11.9539C7.78434 11.4016 8.23206 10.9539 8.78434 10.9539C9.33663 10.9539 9.78434 11.4016 9.78434 11.9539ZM16.2677 11.9539V15.2038C16.2677 15.7561 15.82 16.2038 15.2677 16.2038C14.7154 16.2038 14.2677 15.7561 14.2677 15.2038V11.9539C14.2677 11.4016 14.7154 10.9539 15.2677 10.9539C15.82 10.9539 16.2677 11.4016 16.2677 11.9539Z", fill: "#0D0D0D" }));
1996
- function At({ id: e, src: t, size: n = 56, onClick: o, style: i }) {
1997
- return /* @__PURE__ */ r.createElement(Zi, { id: e, tabIndex: 0, onClick: o, $size: Y(n), style: i }, t ? /* @__PURE__ */ r.createElement(Yi, { src: t }) : /* @__PURE__ */ r.createElement(O, { type: "user", size: n }));
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 Zi = u.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${h.themedColor.bg_100_500};&:focus{outline:none;}`, Yi = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
2000
- function qi({ sender: e, isBotMessage: t }) {
2001
- const n = `${me}-sender-avatar`;
2002
- return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Ji, { id: n }, /* @__PURE__ */ r.createElement(kt, null)) : /* @__PURE__ */ r.createElement(At, { id: n, size: Je, src: e.profileUrl });
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 Ji = u.div`flex-shrink:0;width:${Je}px;height:${Je}px;box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary};path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}}`;
2005
- function Xi({ sender: e }) {
2006
- return /* @__PURE__ */ r.createElement(Qi, { id: `${me}-sender-name`, variant: "caption1", color: h.themedColor.textMidEmphasis }, e.nickname);
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 Qi = u(k)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
2009
- function es({ createdAt: e }) {
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(k, { id: `${me}-sent-time`, variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
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 ts({ customStyle: e }) {
2014
- return /* @__PURE__ */ r.createElement(ns, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(rs, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
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 ns = u.div`align-items:center;border-radius:12px;display:flex;gap:6px;justify-content:center;padding:16px 12px;background-color:${({ theme: e, $bgColor: t }) => t || e.colors.messageIncoming.background};`, rs = u.span`animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px;background:${({ theme: e, $color: t }) => t || e.colors.messageIncoming.text};@keyframes blink{0%{opacity:0.12;transform:scale(1);}21.43%{opacity:0.38;transform:scale(1.2);}42.86%{opacity:0.12;transform:scale(1);}100%{opacity:0.12;transform:scale(1);}}&:nth-child(1){animation-delay:0.4s;}&:nth-child(2){animation-delay:0.6s;}&:nth-child(3){animation-delay:0.8s;}`;
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 zn(e) {
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 === W.OPEN;
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 os(e) {
2035
- return Wn(e) && !Gn(e);
2045
+ function ss(e) {
2046
+ return Gn(e) && !jn(e);
2036
2047
  }
2037
- function is({
2048
+ function as({
2038
2049
  extendedMessagePayload: e,
2039
- onClickCTA: t = ({ url: n }) => zn(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(ss, { id: `${me}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(as, { variant: "button" }, n.label)) : null;
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 ss = u.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${h.themedColor.textHighEmphasis};background-color:${h.color.background50};${N.dark`
2045
- background-color: ${h.color.ondark.textDisabled};
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
- `, as = u(k)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
2048
- function ls(e) {
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 cs extends _r {
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 ds = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: us } = jr({
2065
- parser: Wr,
2066
- renderer: Vr,
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 ms(e) {
2097
+ function Cs(e) {
2070
2098
  return /* @__PURE__ */ r.createElement(
2071
- cs,
2099
+ bs,
2072
2100
  {
2073
2101
  errorFallback: e.messageTemplateErrorFallback,
2074
2102
  loadingFallback: e.messageTemplateLoadingFallback
2075
2103
  },
2076
- /* @__PURE__ */ r.createElement(hs, { ...e })
2104
+ /* @__PURE__ */ r.createElement(vs, { ...e })
2077
2105
  );
2078
2106
  }
2079
- const hs = ({
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 (!ds.has((i == null ? void 0 : i.type) ?? "default")) throw new Error("Unsupported template type");
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 } = ii(), l = Go({
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(gs, { id: `${me}-ext-message-template` }, /* @__PURE__ */ r.createElement(
2098
- Gr,
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(us, { templateItems: l.body.items, templateVersion: l.version })
2132
+ /* @__PURE__ */ r.createElement(Es, { templateItems: l.body.items, templateVersion: l.version })
2105
2133
  ));
2106
- }, gs = u.div`box-sizing:border-box;overflow:hidden;width:100%;`;
2107
- function ps({
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(fs, { id: `${me}-ext-suggested-replies`, $type: n }, a.map((s, l) => /* @__PURE__ */ r.createElement(
2114
- bs,
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 fs = u.div`margin:16px 0;padding:0 ${ie}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? xs : Es};`, bs = u(k)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${h.color.primary.main};border:1px solid ${h.color.primary.main};background-color:${h.themedColor.bg_50_600};&:hover{background-color:${h.themedColor.bg_100_500};}${({ $type: e, theme: t }) => $`
2127
- ${e === "vertical" ? Cs : vs};
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
- `, xs = $`flex-direction:column;align-items:flex-end;`, Es = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cs = $`max-width:calc(100% - 70px);white-space:pre-wrap;`, vs = $`white-space:nowrap;`;
2134
- function It(e) {
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 _e = we({
2138
- template: ys,
2165
+ const ye = Te({
2166
+ template: $s,
2139
2167
  components: {
2140
- SenderName: Xi,
2141
- SenderAvatar: qi,
2142
- SentTime: es,
2143
- MessageBody: Ki,
2144
- TypingIndicator: ts,
2145
- SuggestedReplies: ps,
2146
- MessageTemplate: ms,
2147
- CTAButton: is,
2148
- MessageLogs: ls
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 ys(e) {
2152
- return /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !1 });
2180
+ function $s(e) {
2181
+ return /* @__PURE__ */ r.createElement(Kn, { ...e, testerMode: !1 });
2153
2182
  }
2154
- function jn(e) {
2155
- var g, p, x, f;
2156
- const { components: t } = _e.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((g = e.extendedMessagePayload) != null && g.message_template), a = !!((p = e.extendedMessagePayload) != null && p.cta_button), s = !!e.createdAt, l = It(() => e.messageType === "user" ? e.message.length > 0 : !0), c = e.groupType === "top" || e.groupType === "single", d = e.groupType === "bottom" || e.groupType === "single", m = o ? 0 : Je;
2157
- return /* @__PURE__ */ r.createElement(_s, { $marginBottom: n ? 0 : St(e.groupType) }, c && /* @__PURE__ */ r.createElement(Ss, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, /* @__PURE__ */ r.createElement(ct, { $extraStartPadding: m }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, a && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })))), i && /* @__PURE__ */ r.createElement(qt, { $startPadding: 0, $endPadding: 0, style: { marginTop: l ? ke : 0 } }, /* @__PURE__ */ r.createElement(
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(ct, { $extraStartPadding: m }, /* @__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 = (x = e.extendedMessagePayload) == null ? void 0 : x.message_template) == null ? void 0 : f.fallback_message) ?? "Cannot read this template."
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(ct, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
2198
+ messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(dt, { $extraStartPadding: g }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
2170
2199
  }
2171
- ))), d && s && /* @__PURE__ */ r.createElement(Ts, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(qt, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
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 _s = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
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
- `, Ss = u(ot)`display:flex;flex-direction:row;align-items:center;gap:8px;`, ct = u(ot)`display:flex;`, Ts = u(ot)`margin-top:${Fn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, qt = u(ot)`display:flex;flex-direction:column;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
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 ws({ file: e, children: t, onClickFile: n }) {
2182
- return /* @__PURE__ */ r.createElement(ks, null, /* @__PURE__ */ r.createElement(
2183
- wt,
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: Tt(e.name, e.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 ks = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Kn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(As, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(O, { type: "spinner", size: n })), As = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
2192
- function Is({ file: e, metadata: t, onClickMedia: n, children: o }) {
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($s, null, /* @__PURE__ */ r.createElement(Ms, { ...d }, !l && /* @__PURE__ */ r.createElement(Kn, { size: 26 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Os, { $loaded: l, src: s, alt: "image-message", onLoad: () => c(!0) })), o);
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 $s = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Ms = u.div`width:${Be}px;border-radius:12px;overflow:hidden;cursor:pointer;height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${N.light`
2200
- background-color: ${h.color.background100};
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
- ${N.dark`
2203
- background-color: ${h.color.background400};
2231
+ ${F.dark`
2232
+ background-color: ${m.color.background400};
2204
2233
  `}
2205
- `, Os = u.img`position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0;object-fit:cover;opacity:${(e) => e.$loaded ? 1 : 0};transition:opacity 0.5s ease;`;
2206
- function Jt(e) {
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 = ye(() => {
2209
- const i = Vi(Hn(e.message));
2210
- return _n.sanitize(i);
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
- Ls,
2242
+ Hs,
2214
2243
  {
2215
- $maxWidth: e.maxBodyWidth ?? Be,
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(Rs, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
2248
+ /* @__PURE__ */ r.createElement(zs, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
2220
2249
  );
2221
2250
  }
2222
- const Ls = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
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
- `, Rs = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
2230
- function Ds(e) {
2231
- const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Jt, { ...e }) : null;
2232
- return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Is, { ...e }, n) : /* @__PURE__ */ r.createElement(ws, { ...e }, n) : /* @__PURE__ */ r.createElement(Jt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
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 Ns({ sendingStatus: e }) {
2235
- const t = Et();
2263
+ function Ws({ sendingStatus: e }) {
2264
+ const t = Ct();
2236
2265
  switch (e) {
2237
2266
  case "pending":
2238
- return /* @__PURE__ */ r.createElement(Ps, { size: 16 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
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: h.themedColor.error, size: 16 }));
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 Ps = u(Kn)`margin-bottom:2px;width:16px;height:16px;`;
2249
- function Bs({ createdAt: e }) {
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(k, { variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
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 $t = we({
2254
- template: Fs,
2282
+ const Lt = Te({
2283
+ template: Ks,
2255
2284
  components: {
2256
- SendingStatus: Ns,
2257
- SentTime: Bs,
2258
- MessageBody: Ds
2285
+ SendingStatus: Ws,
2286
+ SentTime: js,
2287
+ MessageBody: Vs
2259
2288
  }
2260
2289
  });
2261
- function Fs(e) {
2262
- const { components: t } = $t.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
2263
- return /* @__PURE__ */ r.createElement(Us, { $marginBottom: St(e.groupType) }, /* @__PURE__ */ r.createElement(Hs, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(zs, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
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 Us = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
2266
- `, Zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = ie, $endPadding: t = ie, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
2267
- `, Hs = u(Zn)``, zs = u(Zn)`margin-top:${Fn}px;`;
2268
- function Vs(e) {
2269
- return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ws, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, Gs(_n.sanitize(e.message))));
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 Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Gs = (e) => {
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: _t }, a)
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
- }, js = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
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(Ks, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, i.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
2282
- Xt,
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
- Xt,
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
- }, Xt = ({ onClick: e, checked: t, label: n, disabled: o }) => {
2299
- const i = t ? h.color.primary.main : o ? h.themedColor.textDisabled : h.themedColor.textLowEmphasis, a = t ? h.themedColor.textHighEmphasis : o ? h.themedColor.textLowEmphasis : h.themedColor.textHighEmphasis;
2300
- return /* @__PURE__ */ r.createElement(Zs, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(O, { size: 24, type: t ? "radio-on" : "radio-off", color: i }), /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: a }, n));
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)" })))), ia = [
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: qs,
2308
- Inactive: Ys
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: Xs,
2317
- Inactive: Js
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: ea,
2326
- Inactive: Qs
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: na,
2335
- Inactive: ta
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: oa,
2344
- Inactive: ra
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
- ], sa = () => ia, Yn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(bt, null, t, /* @__PURE__ */ r.createElement(ca, { $position: n }, /* @__PURE__ */ r.createElement(da, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(aa, { $position: n }))), aa = ({ $position: e }) => /* @__PURE__ */ r.createElement(
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: h.themedColor.textHighEmphasis })
2360
- ), la = {
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
- }, bt = u.div`position:relative;`, ca = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${be.TOOLTIP};${({ $position: e }) => la[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${bt}:hover &,${bt}:focus-within &{opacity:1;}`, da = u(k)`padding:6px 8px;background:${h.themedColor.textHighEmphasis};color:${h.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, ua = ({ submitted: e, value: t, onChange: n }) => {
2364
- const { stringSet: o } = R(), i = sa(), a = typeof t == "number";
2365
- return /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(ha, null, i.map((s) => /* @__PURE__ */ r.createElement(Yn, { disabled: e, key: s.value, label: s.getTooltip(o) }, /* @__PURE__ */ r.createElement(
2366
- ga,
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
- }, ma = u.div`display:flex;flex-direction:column;gap:8px;`, ha = u.div`display:flex;justify-content:space-between;width:100%;max-width:320px;`, ga = 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:${h.color.background200};${N.dark`
2375
- background-color: ${h.color.background500};
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" && pa};
2380
- `, pa = $`[fill]{fill:white;fill-opacity:0.12;}[stroke]{stroke:white;stroke-opacity:0.12;}`, fa = ({ submitted: e, value: t = "", onChange: n }) => {
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
- ba,
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
- }, ba = 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:${h.themedColor.textHighEmphasis};&::placeholder{color:${h.themedColor.textLowEmphasis};}background-color:${h.color.background50};${N.dark`
2393
- background-color: ${h.themedColor.textDisabled};
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: ${h.themedColor.textLowEmphasis};
2399
- background-color: ${h.color.background200};
2400
- ${N.dark`
2401
- color: ${h.color.ondark.textDisabled};
2402
- background-color: ${h.themedColor.textDisabled};
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
- `, xa = ({ submitted: e }) => {
2434
+ `, wa = ({ submitted: e }) => {
2406
2435
  const { stringSet: t } = R();
2407
- return e ? /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
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 ne = /* @__PURE__ */ ((e) => (e.AI_AGENT_CSAT_5 = "AI_AGENT_CSAT_5", e.AI_AGENT_CSAT_5_WITH_CRE = "AI_AGENT_CSAT_5_WITH_CRE", e.HELPDESK_CSAT_5 = "HELPDESK_CSAT_5", e))(ne || {});
2410
- const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
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] = Ea({
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 === ne.AI_AGENT_CSAT_5 || e === ne.HELPDESK_CSAT_5) && typeof a.csat == "number" || e === ne.AI_AGENT_CSAT_5_WITH_CRE && typeof a.csat == "number" && typeof a.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
2423
- return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ca, null, /* @__PURE__ */ r.createElement(xa, { ...c }), e === ne.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
2424
- js,
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(ua, { ...c, value: a.csat, onChange: (d) => s({ csat: d }) }), a.csat && /* @__PURE__ */ r.createElement(
2432
- fa,
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
- }, Ca = u.div`display:flex;flex-direction:column;gap:12px;`, va = () => {
2468
+ }, Aa = u.div`display:flex;flex-direction:column;gap:12px;`, Ia = () => {
2440
2469
  const { stringSet: e } = R();
2441
- return /* @__PURE__ */ r.createElement(k, { variant: "body2", color: h.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
2442
- }, ya = (e) => {
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 = Ur(), { stringSet: n } = R(), { extendedMessagePayload: o, csat: i, csatReason: a, csatExpireAt: s, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: m } = (o == null ? void 0 : o.csat) ?? {};
2446
- if (!d || !m || !ne[m]) return null;
2447
- const g = m === ne.AI_AGENT_CSAT_5 || m === ne.AI_AGENT_CSAT_5_WITH_CRE || m === ne.HELPDESK_CSAT_5 ? dt : () => null, p = (x) => {
2448
- x.csat && !Qt(s) ? c({
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(_a, null, !i && Qt(s) ? /* @__PURE__ */ r.createElement(va, null) : /* @__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: m,
2487
+ type: h,
2459
2488
  initialCsat: i,
2460
2489
  initialCsatReason: a,
2461
2490
  initialIsResolved: l,
2462
- renderSubmitButton: ({ state: x, params: f }) => /* @__PURE__ */ r.createElement(Sa, { disabled: x !== "submittable", onClick: () => p(f) }, /* @__PURE__ */ r.createElement(k, { variant: "button" }, n.CSAT_SUBMIT_LABEL))
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
- }, _a = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Sa = u.button`all:unset;background-color:${({ theme: e }) => e.colors.base.primary};color:${({ theme: e }) => e.colors.base.primaryContrastContent};border-radius:6px;padding:10px 20px;display:flex;align-items:center;justify-content:center;cursor:pointer;&:hover{background-color:${h.color.primary.dark};}&:disabled{color:${h.color.ondark.textLowEmphasis};background-color:${h.themedColor.textDisabled};cursor:not-allowed;}`;
2466
- function Qt(e) {
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 Mt = we({
2470
- template: Ta,
2498
+ const Rt = Te({
2499
+ template: La,
2471
2500
  components: {
2472
- AdminMessage: Vs,
2473
- CSATMessage: ya
2501
+ AdminMessage: Js,
2502
+ CSATMessage: $a
2474
2503
  }
2475
2504
  });
2476
- function Ta(e) {
2477
- const { components: t } = Mt.useContext(), n = It(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
2478
- return /* @__PURE__ */ r.createElement(wa, { $marginBottom: St(e.groupType) }, n);
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 wa = u.div`padding-inline:${ie}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, en = {
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
- }, ka = ({
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: m = (p) => p.default,
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: f = Ln.DEFAULT_PRIMARY
2537
+ highlightColor: b = Dn.DEFAULT_PRIMARY
2509
2538
  } = g;
2510
- return /* @__PURE__ */ r.createElement(tn, null, e && /* @__PURE__ */ r.createElement(tn, null, /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "actionbook", color: p })), /* @__PURE__ */ r.createElement(
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: f,
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(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "function", color: p })), /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(
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: f,
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(Ia, { role: "button", onClick: () => s == null ? void 0 : s(E) }, /* @__PURE__ */ r.createElement(k, { variant: "body2", color: f }, "View details"), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: f }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.id }, /* @__PURE__ */ r.createElement(Ke, null, m({
2531
- default: /* @__PURE__ */ r.createElement(O, { size: 16, type: en[E.source_type] ?? en.snippet, color: p }),
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: f,
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(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "template", color: p })), /* @__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: f,
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
- }, Aa = u(k)`font-weight:400;`, je = u(Aa)`${({ $clickable: e, $highlightColor: t }) => e && $`
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;`, Ia = u(Xe)`cursor:pointer;gap:4px;`, ut = u(Xe)`flex-direction:row;align-items:center;`, tn = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, qn = Te(null);
2562
- function $a({ testerType: e, children: t }) {
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
- qn.Provider,
2593
+ Jn.Provider,
2565
2594
  {
2566
2595
  value: { testerType: e, isActionbookTester: e === "actionbook" }
2567
2596
  },
2568
- e && /* @__PURE__ */ r.createElement(Ma, null),
2597
+ e && /* @__PURE__ */ r.createElement(Ba, null),
2569
2598
  t
2570
2599
  );
2571
2600
  }
2572
- const Fe = () => {
2573
- const e = re(qn);
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
- }, Ma = () => {
2577
- const { isActionbookTester: e } = Fe();
2578
- return /* @__PURE__ */ r.createElement(_e.Template, { template: e ? Oa : void 0 }, /* @__PURE__ */ r.createElement(_e.MessageLogs, { component: La }));
2579
- }, Oa = (e) => /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !0, maxBodyWidth: Bn }), La = ({ extendedMessagePayload: e = {} }) => {
2580
- const { handlers: t } = P(), { manual: n, groundedness: o, function_calls: i, agent_message_templates: a, is_thinking: s } = e;
2581
- return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Ra, null, /* @__PURE__ */ r.createElement(Da, { width: 4 }), /* @__PURE__ */ r.createElement(
2582
- ka,
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: h.themedColor.textHighEmphasis,
2591
- textColor: h.themedColor.textHighEmphasis,
2592
- barColor: h.themedColor.textDisabled
2619
+ iconColor: m.themedColor.textHighEmphasis,
2620
+ textColor: m.themedColor.textHighEmphasis,
2621
+ barColor: m.themedColor.textDisabled
2593
2622
  },
2594
- bottomContent: /* @__PURE__ */ r.createElement(Na, { variant: "caption2", color: h.themedColor.textLowEmphasis }, "Only visible in the tester")
2623
+ bottomContent: /* @__PURE__ */ r.createElement(Wa, { variant: "caption2", color: m.themedColor.textLowEmphasis }, "Only visible in the tester")
2595
2624
  }
2596
2625
  ));
2597
- }, Ra = u.div`display:flex;gap:16px;margin:16px ${ie}px 0;align-self:stretch;`, Da = u.div`width:${({ width: e }) => e}px;background-color:${h.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Na = u(k)`margin-top:5px;`, Pa = ({ publishSynchronous: e = !1 }) => {
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 Ba(e, t = []) {
2609
- const n = F(null), o = F(0), i = F(0), [a] = S(() => Pa({ publishSynchronous: !0 })), [s, l] = S(!0);
2610
- return ce(() => {
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), ce(() => a.subscribe(({ type: c, data: d }) => {
2613
- const { resolve: m, animated: g } = d ?? {};
2614
- if (!n.current) return m == null ? void 0 : m();
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: nn(e, g)
2618
- }) : n.current.scrollTop = n.current.scrollHeight, i.current = 0, l(!0), m == null || m()), c === "scroll") {
2619
- const p = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: f, clientHeight: E } = n.current;
2620
- n.current.scroll ? n.current.scroll({ top: p, behavior: nn(e, g) }) : typeof p == "number" && (n.current.scrollTop = p), i.current = Math.max(0, f - x - E), l(i.current === 0), m == null || m();
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 nn(e, t) {
2660
+ function sn(e, t) {
2632
2661
  return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
2633
2662
  }
2634
- function Fa(e) {
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 Ua(e) {
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 Fa(e.file);
2646
- return new Kr({
2647
- key: Jn,
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 Jn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
2653
- const { agentPreviewConfigs: t, handlers: n } = P(), o = F(t == null ? void 0 : t.agentAttributes);
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 Ua(i), s = {
2685
+ const a = await Za(i), s = {
2657
2686
  ...i,
2658
2687
  metaArrays: a ? [a] : void 0
2659
- }, l = za(o.current);
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
- }, za = (e) => {
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: Va,
2673
- useContext: q
2674
- } = j("Conversation"), Wa = ({
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 } = Fe(), c = Ba("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: m } = Ha({
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 f = x[x.length - 1];
2686
- f && et.shouldScrollToBottom(f, i.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom" }), 25);
2687
- }, p = U(async () => {
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
- uo,
2720
+ mo,
2692
2721
  {
2693
2722
  channelUrl: e || (a == null ? void 0 : a.url),
2694
2723
  onBeforeSendMessage: d,
2695
- onAfterSendMessage: m,
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
- Va,
2731
+ Ja,
2703
2732
  {
2704
2733
  value: { ...x, scrollSource: c, goToActiveConversation: p, onNavigateToConversationList: n }
2705
2734
  },
2706
2735
  o
2707
2736
  )
2708
2737
  );
2709
- }, Ot = Te({
2738
+ }, Dt = Se({
2710
2739
  onDrop: Le,
2711
2740
  subscribe: () => Le
2712
- }), xt = ({ children: e }) => {
2713
- const t = F(/* @__PURE__ */ new Set());
2741
+ }), Et = ({ children: e }) => {
2742
+ const t = U(/* @__PURE__ */ new Set());
2714
2743
  return /* @__PURE__ */ r.createElement(
2715
- Ot.Provider,
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
- }, Ga = ({ onDropFiles: e }) => {
2731
- const { subscribe: t } = re(Ot);
2759
+ }, Qa = ({ onDropFiles: e }) => {
2760
+ const { subscribe: t } = ne(Dt);
2732
2761
  D(() => t(e), [e]);
2733
2762
  };
2734
- xt.Consumer = ({ children: e }) => {
2735
- const { onDrop: t } = re(Ot);
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 Jd = ({ iconSize: e = 64, icon: t, className: n, label: o, children: i }) => /* @__PURE__ */ r.createElement(Ka, { className: n }, /* @__PURE__ */ r.createElement(O, { type: t, size: e, color: h.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.themedColor.textMidEmphasis }, o), i), ja = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Ka = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Za = {
2739
- loading: w(() => import("./BsmWumox.js")),
2740
- error: w(() => import("./mlHVKYk3.js")),
2741
- noChannels: w(() => import("./ClNlgaQQ.js")),
2742
- noMessages: w(() => import("./DPH4j4kU.js"))
2743
- }, Se = ({ className: e, type: t = "loading", ...n }) => {
2744
- const o = Za[t];
2745
- return /* @__PURE__ */ r.createElement(ja, { className: e }, /* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
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("./BKhgSuql.js")),
2769
+ error: T(() => import("./7464aa--.js")),
2770
+ noChannels: T(() => import("./BUIIulLp.js")),
2771
+ noMessages: T(() => import("./BV3rSe2G.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 Ya(e) {
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 qa = (e, t, n, o = !0) => {
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 = Ut(t.createdAt, e.createdAt);
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 = Ut(n.createdAt, e.createdAt);
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 Ja(e, t) {
2793
+ function il(e, t) {
2765
2794
  return e.filter((n) => et.isWelcomeMessage(n, t));
2766
2795
  }
2767
- function Xn(e, t) {
2768
- return Xa(e) === t;
2796
+ function Qn(e, t) {
2797
+ return sl(e) === t;
2769
2798
  }
2770
- function Xa(e) {
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 Qa(e) {
2804
+ function al(e) {
2776
2805
  return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
2777
2806
  }
2778
- const rn = (e) => !!e && "sender" in e, Qn = (e) => e.startsWith("image/"), er = (e) => e.startsWith("video/"), on = (e) => Qn(e) || er(e), Ze = {
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) => rn(e) && e.sender.userId !== t,
2785
- isOutgoing: (e, t) => rn(e) && (e.sender.userId === t || e.sendingStatus === Zr.PENDING)
2786
- }, tr = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
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 } = P(), a = fe(i), s = fe(i, !0);
2789
- return qr(
2790
- /* @__PURE__ */ r.createElement(el, { onClick: n }, /* @__PURE__ */ r.createElement(tl, { onClick: (l) => l.stopPropagation() }, o)),
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
- }, el = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${h.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${be.MODAL};`, tl = u.div`border-radius:4px;overflow:hidden;box-shadow:0 16px 24px 2px rgba(13,13,13,0.12),0 6px 30px 5px rgba(13,13,13,0.08),0 6px 10px -5px rgba(13,13,13,0.04);z-index:${be.MODAL};`, nl = u.div`flex-shrink:0;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};background-color:${({ theme: e }) => e.colors.base.primary};box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;}`, rl = u(kt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
2794
- function nr({ size: e }) {
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(At, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(nl, { $size: e }, /* @__PURE__ */ r.createElement(rl, null));
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 ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, il = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, sl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, al = u.div`margin-inline-end:8px;`, ll = u.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`, cl = u.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`, dl = u.div`display:flex;width:160px;justify-content:flex-end;`, ul = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, rr = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, ml = u(rr)`border-inline-start:1px solid ${h.themedColor.textDisabled};`, hl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, gl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, pl = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, fl = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, bl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
2799
- const { type: i, url: a, name: s = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: m } = z();
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
- El,
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 === m.userId,
2838
+ isBotMessage: d === h.userId,
2810
2839
  onDownloadClick: o
2811
2840
  }
2812
2841
  );
2813
- }, xl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(nr, { size: 32 }) : /* @__PURE__ */ r.createElement(At, { size: 32, src: e }), El = ({
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(tr, { onClose: s, visible: !0, rootElementId: oe.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ol, null, /* @__PURE__ */ r.createElement(il, null, /* @__PURE__ */ r.createElement(sl, null, /* @__PURE__ */ r.createElement(al, null, /* @__PURE__ */ r.createElement(xl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(ll, null, /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(cl, null, /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(dl, null, on(i) && /* @__PURE__ */ r.createElement(ul, null, /* @__PURE__ */ r.createElement(rr, { as: "a", href: a, target: "_blank", rel: _t, onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "download", color: h.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(ml, { onClick: s }, /* @__PURE__ */ r.createElement(O, { type: "close", color: h.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(hl, { onClick: (d) => d.currentTarget === d.target && s() }, er(i) && /* @__PURE__ */ r.createElement(gl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), Qn(i) && /* @__PURE__ */ r.createElement(pl, { src: a, alt: o }), !on(i) && /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
2825
- }, or = ({
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(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), Cl = u.div`display:flex;justify-content:center;align-items:center;`, vl = Re(function(t, n) {
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: m = 0.05,
2869
+ loadThreshold: h = 0.05,
2841
2870
  onScrollPosition: g = Le,
2842
2871
  depsForResetScrollPositionToBottom: p,
2843
2872
  scrollPositionRef: x,
2844
- scrollDistanceFromBottomRef: f,
2873
+ scrollDistanceFromBottomRef: b,
2845
2874
  stackDirection: E = "top"
2846
- } = t, b = n && "current" in n ? n : { current: null }, C = F(!1), y = F(void 0), T = F(0), _ = F(0), K = F(0), L = x ?? _, se = f ?? K;
2847
- ce(() => {
2848
- b.current && (b.current.scrollTop = b.current.scrollHeight);
2849
- }, p), ce(() => {
2850
- b.current && (y.current === "top" && (b.current.scrollTop = b.current.scrollHeight - L.current), y.current === "bottom" && (b.current.scrollTop = T.current), y.current = void 0);
2851
- }, [b.current, o.length]);
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 (!b.current) return;
2854
- const v = b.current;
2855
- if (g(yl(v)), L.current = v.scrollHeight - v.scrollTop, se.current = L.current - v.clientHeight, T.current = v.scrollTop, C.current) return;
2856
- const B = v.clientHeight * Math.min(Math.max(0, m), 1);
2857
- v.scrollTop <= B ? (C.current = !0, y.current = "top", await c(), C.current = !1) : v.scrollHeight - v.scrollTop - v.clientHeight <= B ? (C.current = !0, y.current = "bottom", await d(), C.current = !1) : y.current = void 0;
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(_l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Sl, { id: "infinite-list-inner", ref: b, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((v, B) => i({ message: v, index: B })), s), /* @__PURE__ */ r.createElement(Tl, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(wl, { id: "infinite-list-overlay" }, l)));
2860
- }), sn = 50;
2861
- function yl(e) {
2862
- return e.scrollTop <= sn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= sn ? "bottom" : "middle";
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 _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${h.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Tl = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, wl = u.div`pointer-events:auto;`, kl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Al, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(O, { size: 24, type: "chevron-down", color: h.color.primary.main })), Al = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${N.light`
2865
- background-color: ${h.color.background50};
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: ${h.color.background100};
2896
+ background-color: ${m.color.background100};
2868
2897
  }
2869
2898
  &:active {
2870
- background-color: ${h.color.background200};
2899
+ background-color: ${m.color.background200};
2871
2900
  }
2872
2901
  `}
2873
- ${N.dark`
2874
- background-color: ${h.color.background400};
2902
+ ${F.dark`
2903
+ background-color: ${m.color.background400};
2875
2904
  &:hover {
2876
- background-color: ${h.color.background500};
2905
+ background-color: ${m.color.background500};
2877
2906
  }
2878
2907
  &:active {
2879
- background-color: ${h.color.background700};
2908
+ background-color: ${m.color.background700};
2880
2909
  }
2881
2910
  `}
2882
2911
 
2883
2912
  &:focus {
2884
2913
  outline: none;
2885
2914
  }
2886
- `, ir = () => {
2887
- const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] = S([]);
2888
- return vn(e, {
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
- }, Il = () => {
2898
- const { agentPreviewConfigs: e = {}, aiAgentId: t } = P(), { aiAgentInfo: n } = z(), { stringSet: o, dateLocale: i } = R(), { messageSource: a } = q(), { Template: s } = _e.useContext(), l = e.welcomeMessages ?? [], c = a.messages, d = Ja(c, t), m = c[d.length + 1], g = d[0] ?? m;
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) => Qa(p) ? !1 : l.length > 0 ? !et.isWelcomeMessage(p, t) : !0),
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 : m && !Dr(m.createdAt, (g == null ? void 0 : g.createdAt) ?? 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
- or,
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 f = x === l.length - 1, E = d.length !== c.length, b = l.length === 1 ? "single" : x === 0 ? "top" : f || E ? "bottom" : "middle";
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: b,
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: f && !E,
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
- }, $l = (e) => u(e).withConfig({ shouldForwardProp: Jr });
2941
- function Ml(e) {
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 Ol = ({ style: e }) => {
2947
- const { stringSet: t } = R(), { chatSDK: n } = P(), { isActionbookTester: o } = Fe();
2948
- return Ml(n) || o ? null : /* @__PURE__ */ r.createElement(Ll, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
2949
- Rl,
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: _t,
2984
+ rel: Tt,
2956
2985
  target: "_blank"
2957
2986
  },
2958
2987
  "Sendbird"
2959
2988
  ));
2960
- }, Ll = u(k)`color:${h.themedColor.textLowEmphasis};text-align:center;`, Rl = $l(k)`
2961
- color: ${h.themedColor.textLowEmphasis};
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
- `, Dl = () => {
2993
+ `, Vl = () => {
2965
2994
  var c;
2966
- const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = q(), a = Vn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && a;
2967
- return ce(() => {
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(Nl, null, /* @__PURE__ */ r.createElement(
2970
- Pl,
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: h.themedColor.textHighEmphasis,
3003
+ color: m.themedColor.textHighEmphasis,
2975
3004
  onClick: () => o()
2976
3005
  },
2977
3006
  e.START_NEW_CONVERSATION
2978
3007
  )) : null;
2979
- }, Nl = u.div`display:flex;justify-content:center;margin:16px 0;`, Pl = u(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${h.themedColor.textDisabled};cursor:pointer;user-select:none;`, Bl = !0, Fl = () => {
2980
- const { Template: e } = $t.useContext(), { Template: t } = _e.useContext(), { Template: n } = Mt.useContext(), [o, i] = S(null), { userSession: a, aiAgentInfo: s } = z(), { agentPreviewConfigs: l, chatSDK: c, state: d } = P(), { stringSet: m, dateLocale: g } = R(), { conversation: p, channelSource: x, messageSource: f, scrollSource: E } = q(), { isActionbookTester: b } = Fe(), { filteredMessages: C, shouldShowOriginalDate: y, renderAgentPreviewWelcomeMessages: T } = Il(), { storage: _ } = $n(), K = ir(), L = It(() => {
2981
- const v = K[0];
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 B = v.userId === s.userId;
2984
- return { user: B ? s : v, isBot: B };
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 se = (v, B = !1) => {
3018
+ const ae = (v, V = !1) => {
2990
3019
  var Ee;
2991
- return B ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((J) => J.userId === v.sender.userId)) ?? v.sender;
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 (!f.initialized)
2994
- return /* @__PURE__ */ r.createElement(Se, { type: "loading" });
2995
- if (f.messages.length === 0) {
2996
- const v = T();
2997
- return v ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, v) : /* @__PURE__ */ r.createElement(Se, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
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
- vl,
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: f.loadPrevious,
3009
- onLoadNext: f.loadNext,
3010
- depsForResetScrollPositionToBottom: [f.initialized, f.messages.length !== 0],
3011
- messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ol, { style: { marginTop: 16 } }), T()),
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(Dl, null)),
3023
- overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(Hl, { onClick: () => E.scrollPubSub.publish({ type: "scrollToBottom" }) })),
3024
- renderMessage: ({ message: v, index: B }) => {
3025
- const Ee = Ya(v), J = C[B - 1], Ae = C[B + 1], it = C[C.length - 1], st = v === it, A = qa(v, J, Ae, Bl), I = !Yr((J == null ? void 0 : J.createdAt) ?? 0, v.createdAt) && y(B) && !b, M = (X) => {
3026
- (v.isFileMessage() || v.isUserMessage()) && i({ file: X, sender: se(v, v.sender.userId === s.userId) });
3027
- }, H = () => {
3028
- v.isFileMessage() && zn(v.url);
3029
- }, Ce = I ? /* @__PURE__ */ r.createElement(
3030
- or,
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: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
3064
+ formatString: h.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
3036
3065
  }
3037
- ) : null, ae = {
3038
- maxBodyWidth: d.expanded ? Bn : void 0,
3066
+ ) : null, P = {
3067
+ maxBodyWidth: d.expanded ? Un : void 0,
3039
3068
  extendedMessagePayload: v.extendedMessagePayload,
3040
3069
  createdAt: v.createdAt,
3041
- groupType: A,
3042
- onClickMedia: M,
3043
- onClickFile: H
3044
- }, Z = (() => {
3045
- var X, ee;
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
- ...ae,
3079
+ ...P,
3051
3080
  ...p,
3052
- isResolvedWhenDeterminedByUser: zl(p),
3081
+ isResolvedWhenDeterminedByUser: ql(p),
3053
3082
  messageType: "admin.csat",
3054
- onSubmitCSAT: ({ csat: G, csatType: he, csatReason: V, isResolved: le }) => {
3055
- var ge;
3056
- G && ((ge = x.channel) == null || ge.submitCSAT({ csat: G, csatType: he, csatReason: V, isResolved: le }));
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, { ...ae, messageType: "admin", message: v.message });
3088
+ ) : null : /* @__PURE__ */ r.createElement(n, { ...P, messageType: "admin", message: v.message });
3060
3089
  if (Ze.isOutgoing(v, a.userId)) {
3061
- const G = {
3062
- ...ae,
3090
+ const W = {
3091
+ ...P,
3063
3092
  message: v.message,
3064
- sender: se(v),
3093
+ sender: ae(v),
3065
3094
  sendingStatus: v.sendingStatus
3066
3095
  };
3067
3096
  if (v.isUserMessage())
3068
- return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...G });
3097
+ return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...W });
3069
3098
  if (v.isFileMessage()) {
3070
- const [he, V] = ((X = v.metaArrays.find((le) => le.key === Jn)) == null ? void 0 : X.value) ?? [];
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: he && V ? `${he}/${V}` : "1/1",
3078
- localFile: (ee = v.messageParams) == null ? void 0 : ee.file
3106
+ aspectRatio: G && N ? `${G}/${N}` : "1/1",
3107
+ localFile: (K = v.messageParams) == null ? void 0 : K.file
3079
3108
  },
3080
- ...G
3109
+ ...W
3081
3110
  }
3082
3111
  );
3083
3112
  }
3084
3113
  }
3085
3114
  if (Ze.isIncoming(v, a.userId)) {
3086
- const G = v.sender.userId === s.userId, he = {
3087
- ...ae,
3088
- sender: se(v, G),
3115
+ const W = v.sender.userId === s.userId, G = {
3116
+ ...P,
3117
+ sender: ae(v, W),
3089
3118
  message: v.message,
3090
- suggestedRepliesVisible: st,
3119
+ suggestedRepliesVisible: Ae,
3091
3120
  suggestedRepliesDirection: l == null ? void 0 : l.suggestedRepliesDirection,
3092
- isBotMessage: G,
3093
- onClickSuggestedReply: async ({ reply: V }) => {
3094
- f.sendUserMessage({ message: V });
3121
+ isBotMessage: W,
3122
+ onClickSuggestedReply: async ({ reply: N }) => {
3123
+ b.sendUserMessage({ message: N });
3095
3124
  },
3096
- onRequestMessageTemplate: async (V) => {
3097
- const { template: le } = await c.aiAgent.getMessageTemplate(V);
3098
- return _.setTemplate(V, le), le;
3125
+ onRequestMessageTemplate: async (N) => {
3126
+ const { template: ce } = await c.aiAgent.getMessageTemplate(N);
3127
+ return _.setTemplate(N, ce), ce;
3099
3128
  },
3100
- onGetCachedMessageTemplate: (V) => _.getTemplate(V),
3101
- onHandleTemplateInternalAction: (V) => {
3102
- if (V.type === "internal" && V.internalData) {
3103
- const { method: le, payload: ge } = V.internalData;
3104
- le === "message.send" && (ge != null && ge.message) && f.sendUserMessage({ message: ge.message });
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", ...he });
3138
+ return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...G });
3110
3139
  if (v.isFileMessage())
3111
- return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: v, ...he });
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` }, Ce, Z);
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(Ul, { id: `${Q}-message-list` }, xe(), o && /* @__PURE__ */ r.createElement(bl, { onClose: () => i(null), sender: o.sender, file: o.file }));
3120
- }, Ul = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Hl = u(kl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
3121
- function zl(e) {
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 Vl = () => {
3127
- const { stringSet: e } = R(), { connectionError: t } = z(), { channelSource: n } = q(), o = t || n.error;
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(Se, { type: "error", label: o.message, action: i });
3159
+ return /* @__PURE__ */ r.createElement(_e, { type: "error", label: o.message, action: i });
3131
3160
  }
3132
- return n.channel ? /* @__PURE__ */ r.createElement(Fl, null) : /* @__PURE__ */ r.createElement(Se, { type: "loading" });
3133
- }, sr = () => {
3134
- const { stringSet: e } = R(), { activeChannel: t } = z(), [n] = S(() => (t == null ? void 0 : t.status) === W.OPEN);
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
- }, Wl = () => {
3137
- const { stringSet: e } = R(), { goToActiveConversation: t } = q(), n = sr();
3138
- return /* @__PURE__ */ r.createElement(Gl, null, /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.themedColor.textMidEmphasis }, e.CONVERSATION_CLOSED_FOOTER_LABEL), /* @__PURE__ */ r.createElement(jl, { onClick: t }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: h.themedColor.textHighEmphasis }, n)));
3139
- }, Gl = u.div`display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 0;gap:14px;${N.light`
3140
- background-color: ${h.color.background100};
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
- ${N.dark`
3143
- background-color: ${h.color.background500};
3171
+ ${F.dark`
3172
+ background-color: ${m.color.background500};
3144
3173
  `}
3145
- `, jl = u.button`all:unset;padding:10px 20px;border-radius:6px;border:1px solid ${h.themedColor.textDisabled};cursor:pointer;${N.light`
3146
- background-color: ${h.color.background50};
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
- ${N.dark`
3149
- background-color: ${h.color.background700};
3177
+ ${F.dark`
3178
+ background-color: ${m.color.background700};
3150
3179
  `}
3151
- `, ar = Te(void 0), Kl = ({ children: e }) => {
3152
- const { stringSet: t } = R(), { aiAgentInfo: n } = z(), { channelSource: o } = q(), [i, a] = S([]), [s, l] = S({
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 = (n == null ? void 0 : n.replyToFile) || Gn(o.channel), d = (p) => {
3157
- if (!c) return;
3158
- const x = p.filter((f) => Dn.includes(f.type));
3159
- if (x.length !== 0) {
3160
- if (x.some((f) => f.size > mi)) {
3161
- l((f) => ({
3162
- ...f,
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 (x.length > 1 || x.length > 0 && i.length > 0) {
3169
- l((f) => ({
3170
- ...f,
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((f) => [
3177
- ...f,
3178
- ...x.map((E) => ({
3179
- file: E,
3180
- preview: { url: URL.createObjectURL(E), type: E.type, name: E.name }
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
- }, m = (p) => {
3185
- a((x) => {
3186
- var E;
3187
- const f = (E = x[p]) == null ? void 0 : E.preview;
3188
- return f && URL.revokeObjectURL(f.url), x.filter((b, C) => C !== p);
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
- }, g = () => {
3191
- a((p) => (p.forEach((x) => URL.revokeObjectURL(x.preview.url)), []));
3230
+ }, p = () => {
3231
+ a((x) => (x.forEach((b) => URL.revokeObjectURL(b.preview.url)), []));
3192
3232
  };
3193
3233
  return /* @__PURE__ */ r.createElement(
3194
- ar.Provider,
3234
+ lr.Provider,
3195
3235
  {
3196
3236
  value: {
3197
3237
  files: i,
3198
- addFiles: d,
3199
- removeFile: m,
3200
- clearFiles: g,
3201
- isFileUploadEnabled: c
3238
+ addFiles: h,
3239
+ removeFile: g,
3240
+ clearFiles: p,
3241
+ isFileUploadEnabled: d
3202
3242
  }
3203
3243
  },
3204
3244
  e,
3205
- /* @__PURE__ */ r.createElement(Zl, { ...s, onClose: () => l((p) => ({ ...p, visible: !1, title: "" })) })
3245
+ /* @__PURE__ */ r.createElement(nc, { ...s, onClose: () => l((x) => ({ ...x, visible: !1, title: "" })) })
3206
3246
  );
3207
- }, Lt = () => {
3208
- const e = re(ar);
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
- }, Zl = ({
3252
+ }, nc = ({
3213
3253
  title: e,
3214
3254
  buttonText: t,
3215
3255
  visible: n,
3216
3256
  onClose: o
3217
- }) => /* @__PURE__ */ r.createElement(tr, { rootElementId: oe.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(Yl, null, /* @__PURE__ */ r.createElement(Jl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(ql, null, /* @__PURE__ */ r.createElement(Xl, { onClick: o }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: h.themedColor.textHighEmphasisInverse }, t))))), Yl = u.div`width:100%;height:auto;padding-block:18px 24px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, ql = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, Jl = u.div`margin-bottom:16px;`, Xl = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${h.themedColor.error};border:1px solid ${h.themedColor.error};padding:10px 16px;&:hover{background-color:${h.color.error.dark};border-color:${h.color.error.dark};}&:active{background-color:${h.color.error.extraDark};}`;
3218
- function Ql({ blurred: e, elementRef: t, document: n = window.document }) {
3219
- const o = F(!1);
3220
- e && t.current && n.activeElement === t.current && (o.current = !0), ce(() => {
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 ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex;flex-direction:row;gap:10px;padding:8px 16px;background-color:transparent;`, tc = 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;}`, nc = 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%;${N.light`
3226
- background-color: ${h.color.background50};
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
- ${N.dark`
3229
- background-color: ${h.color.background500};
3268
+ ${F.dark`
3269
+ background-color: ${m.color.background500};
3230
3270
  `}
3231
3271
  path {
3232
- fill: ${h.themedColor.textMidEmphasis};
3272
+ fill: ${m.themedColor.textMidEmphasis};
3233
3273
  }
3234
3274
 
3235
3275
  &:hover {
3236
3276
  path {
3237
- fill: ${h.themedColor.textHighEmphasis};
3277
+ fill: ${m.themedColor.textHighEmphasis};
3238
3278
  }
3239
3279
  }
3240
3280
 
3241
3281
  circle {
3242
- stroke: ${h.themedColor.bg_50_600};
3282
+ stroke: ${m.themedColor.bg_50_600};
3243
3283
  }
3244
- `, rc = () => {
3245
- const e = Pe(), [t, n] = S(), { files: o, removeFile: i, isFileUploadEnabled: a } = Lt();
3246
- return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(ec, null, o.map(({ preview: { type: s, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(tc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(nc, { title: "Remove file", onClick: () => i(d) }, /* @__PURE__ */ r.createElement(O, { type: "close-filled", color: h.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(wt, { name: l, type: Tt(l, s) }))));
3247
- }, oc = ({ channel: e, messages: t }) => {
3248
- const { stringSet: n } = R(), { aiAgentInfo: o } = z(), i = ic(), a = sc({
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 || Vn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : a ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
3253
- }, ic = () => {
3254
- const e = bn(), { chatSDK: t } = P(), [n, o] = S(!0);
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
- }, sc = ({
3305
+ }, gc = ({
3266
3306
  lastMessage: e,
3267
3307
  aiAgentUserId: t
3268
3308
  }) => {
3269
- const [n, o] = S(!1), i = ir();
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 = Xn(e, t) && et.isStreaming(e);
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
- }, lr = {
3315
+ }, cr = {
3276
3316
  textArea: $`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
3277
3317
  attachIcon: $`margin-bottom:4px;`
3278
- }, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${yt && lr.attachIcon};`, lc = u.input`display:none;`, an = u.div`width:100%;position:relative;background-color:${h.themedColor.bg_100_500};border-radius:20px;`, ln = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, cn = u.textarea`all:unset;display:block;flex:1;min-width:0;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;font-size:14px;line-height:20px;color:${h.themedColor.textHighEmphasis};resize:none;width:100%;height:${Rn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${yt && lr.textArea};&::placeholder{color:${h.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${h.themedColor.textDisabled};}}`, dn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, un = ({ disabled: e }) => {
3279
- const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } = Lt();
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
- ac,
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 ? h.themedColor.textDisabled : h.themedColor.textMidEmphasis,
3333
+ color: e ? m.themedColor.textDisabled : m.themedColor.textMidEmphasis,
3294
3334
  size: 16
3295
3335
  }
3296
3336
  ),
3297
3337
  /* @__PURE__ */ r.createElement(
3298
- lc,
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: Dn.join(",")
3346
+ accept: Pn.join(",")
3307
3347
  }
3308
3348
  )
3309
3349
  );
3310
- }, cc = () => {
3311
- const e = F(null), [t, n] = S(""), { rootElement: o } = P(), { channelSource: i, messageSource: a } = q(), [s, l] = oc({
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: m } = Lt();
3315
- Ga({ onDropFiles: d }), Ql({ blurred: s, elementRef: e, document: fe(o) });
3316
- const g = t.trim().length > 0, p = c.length > 0, x = !s && (g || p), f = () => {
3317
- e.current && (e.current.value = "", e.current.style.height = ""), m(), n("");
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 T = t.trim(), _ = { message: T };
3320
- if (!(!T && !c.length)) {
3359
+ const k = t.trim(), _ = { message: k };
3360
+ if (!(!k && !c.length)) {
3321
3361
  if (c.length > 0) {
3322
- const K = c[0].file, L = { ..._, file: K };
3323
- a.sendFileMessage(L), f();
3362
+ const Y = c[0].file, L = { ..._, file: Y };
3363
+ a.sendFileMessage(L), b();
3324
3364
  return;
3325
3365
  }
3326
- a.sendUserMessage(_), f();
3366
+ a.sendUserMessage(_), b();
3327
3367
  }
3328
- }, b = (T) => {
3329
- const _ = Array.from(T.clipboardData.files);
3330
- _.length > 0 && (T.preventDefault(), d(_));
3331
- }, C = (T) => {
3332
- T.key !== "Enter" || T.nativeEvent.isComposing || T.shiftKey || (T.preventDefault(), E());
3333
- }, y = (T) => {
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(ui, e.current.scrollHeight);
3337
- Rn < _ && (e.current.style.height = `${_}px`);
3376
+ const _ = Math.min(mi, e.current.scrollHeight);
3377
+ Nn < _ && (e.current.style.height = `${_}px`);
3338
3378
  }
3339
- n(T.target.value);
3379
+ n(k.target.value);
3340
3380
  };
3341
- return s ? /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(cn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(un, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(rc, null), /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(
3342
- cn,
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: b
3391
+ onPaste: f
3352
3392
  }
3353
- ), /* @__PURE__ */ r.createElement(un, null))), x && /* @__PURE__ */ r.createElement(cr, { onClick: () => E() }, /* @__PURE__ */ r.createElement(O, { type: "send", color: h.color.primary.main, size: 20 })));
3354
- }, dc = u.div`padding:8px 16px;text-align:center;word-break:break-word;white-space:pre-wrap;line-height:1.43;letter-spacing:-0.2px;font-size:14px;font-weight:400;color:${h.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${N.light`
3355
- color: ${h.color.information.light};
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
- ${N.dark`
3358
- color: ${h.color.information.main};
3397
+ ${F.dark`
3398
+ color: ${m.color.information.main};
3359
3399
  `};
3360
3400
  }
3361
- `, uc = w(() => import("./7Dvv5RpD.js").then((e) => ({ default: e.MarkdownText }))), mc = () => {
3362
- const { aiAgentInfo: e } = z(), { messageSource: t } = q(), { userSession: n } = z();
3363
- return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) => Xn(i, n.userId))) ? null : /* @__PURE__ */ r.createElement(dc, null, /* @__PURE__ */ r.createElement(uc, null, e.specialNotice));
3364
- }, hc = () => /* @__PURE__ */ r.createElement(gc, null, /* @__PURE__ */ r.createElement(mc, null), /* @__PURE__ */ r.createElement(Kl, null, /* @__PURE__ */ r.createElement(cc, null))), gc = u.div`z-index:0;border:none;width:100%;`, pc = () => {
3401
+ `, Ec = T(() => import("./D4Vk_6v3.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 } = q(), n = ((s = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : s.status) === W.CLOSED;
3367
- return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Wl, null) : /* @__PURE__ */ r.createElement(hc, null);
3368
- }, fc = () => {
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 } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p = Pe() ? 24 : 16, x = () => {
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
- }, f = async () => {
3412
+ }, b = async () => {
3373
3413
  try {
3374
- const T = await (m == null ? void 0 : m.markConversationAsHandoff());
3375
- t.info("conversation.handleAgentHandoff: success", T);
3376
- } catch (T) {
3377
- t.error("conversation.handleAgentHandoff: error", T);
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
- m && await i.send(ao.CloseConversation({ channelUrl: m.url }));
3381
- }, b = l && (m == null ? void 0 : m.url) === l.url, C = s.showHandoffButton && !!((y = m == null ? void 0 : m.conversation) != null && y.handoff) && b;
3382
- return /* @__PURE__ */ r.createElement(vc, null, /* @__PURE__ */ r.createElement(yc, null, d && /* @__PURE__ */ r.createElement(Ue, { onClick: () => d() }, /* @__PURE__ */ r.createElement(O, { type: "menu", size: 24, color: h.themedColor.textHighEmphasis })), b && /* @__PURE__ */ r.createElement(nr, { size: 34 }), /* @__PURE__ */ r.createElement(Sc, { variant: "h2", color: h.themedColor.textHighEmphasis }, s.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ r.createElement(_c, null, C && /* @__PURE__ */ r.createElement(
3383
- Cc,
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: !os(m),
3426
+ disabled: !ss(h),
3387
3427
  size: p,
3388
- onClick: f
3428
+ onClick: b
3389
3429
  }
3390
3430
  ), n && /* @__PURE__ */ r.createElement(
3391
- Ec,
3431
+ kc,
3392
3432
  {
3393
- disabled: !Wn(m),
3433
+ disabled: !Gn(h),
3394
3434
  size: p,
3395
3435
  onClick: E
3396
3436
  }
3397
- ), o && /* @__PURE__ */ r.createElement(bc, { size: p }), /* @__PURE__ */ r.createElement(xc, { size: p, onClick: x })));
3398
- }, bc = ({ size: e, disabled: t }) => {
3399
- const { state: n } = P();
3400
- return /* @__PURE__ */ r.createElement(Ue, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(O, { type: n.expanded ? "collapse" : "expand", size: e, color: h.themedColor.textHighEmphasis }));
3401
- }, xc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(O, { type: "close", size: e, color: h.themedColor.textHighEmphasis })), Ec = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
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 ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
3446
+ color: t ? m.themedColor.textDisabled : m.themedColor.textHighEmphasis
3407
3447
  }
3408
- )), Cc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Yn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(Ue, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
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 ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
3453
+ color: n ? m.themedColor.textDisabled : m.themedColor.textHighEmphasis
3414
3454
  }
3415
- ))), vc = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, yc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, _c = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Sc = u(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ue = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Tc = () => {
3416
- const { isActionbookTester: e } = Fe();
3417
- return e ? null : /* @__PURE__ */ r.createElement(fc, null);
3418
- }, mn = ({
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 } = Rt.useContext();
3464
+ const { Template: i } = Pt.useContext();
3425
3465
  return /* @__PURE__ */ r.createElement(
3426
- Wa,
3466
+ Xa,
3427
3467
  {
3428
3468
  onNavigateToConversationList: t,
3429
3469
  closedChannelUrl: n,
3430
3470
  onClearClosedChannelUrl: o
3431
3471
  },
3432
- /* @__PURE__ */ r.createElement(xt, null, /* @__PURE__ */ r.createElement(xt.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(kc, { ...a }, /* @__PURE__ */ r.createElement(i, null)), e)))
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
- }, Rt = we({
3435
- template: wc,
3474
+ }, Pt = Te({
3475
+ template: Rc,
3436
3476
  components: {
3437
- Header: Tc,
3438
- Body: Vl,
3439
- Footer: pc
3477
+ Header: Lc,
3478
+ Body: Jl,
3479
+ Footer: _c
3440
3480
  }
3441
3481
  });
3442
- function wc() {
3443
- const { components: e } = Rt.useContext();
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 kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
3447
- Provider: Ac,
3448
- useContext: dr
3449
- } = j("ConversationList");
3450
- function Ic({
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(bo, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(Ac, { value: { ...o, onOpenConversationView: t } }, n));
3495
+ return /* @__PURE__ */ r.createElement(xo, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(Nc, { value: { ...o, onOpenConversationView: t } }, n));
3456
3496
  }
3457
- const ur = we({
3458
- template: $c,
3497
+ const mr = Te({
3498
+ template: Fc,
3459
3499
  // Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
3460
3500
  components: {}
3461
3501
  });
3462
- function $c({
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(Mc, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(Lc, null, /* @__PURE__ */ r.createElement(Rc, null, /* @__PURE__ */ r.createElement(k, { variant: "subtitle1", color: h.themedColor.textHighEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE)), /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textLowEmphasis }, i(t, o.DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION))), /* @__PURE__ */ r.createElement(k, { variant: "body3", color: h.themedColor.textMidEmphasis }, e || o.CONVERSATION_LIST__TOPICS_FALLBACK)), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: h.themedColor.textHighEmphasis }), /* @__PURE__ */ r.createElement(Oc, null));
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 Mc = 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;`, Oc = u.div`position:absolute;bottom:0;height:1px;width:calc(100% - 32px);background-color:${h.themedColor.textDisabled};`, Lc = u.div`gap:4px;display:flex;flex-direction:column;flex:1;`, Rc = u.div`display:flex;justify-content:flex-start;align-items:center;gap:6px;`, Dc = ({ items: e, renderItem: t, onEndReached: n }) => {
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(Nc, { onScroll: (i) => o(i) }, e.map((i, a) => t(i, a)));
3476
- }, Nc = u.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`, Pc = () => {
3477
- const { stringSet: e } = R(), { listSource: t, onOpenConversationView: n } = dr(), { Template: o } = ur.useContext();
3478
- return t.initialized ? t.channels.length === 0 ? /* @__PURE__ */ r.createElement(Se, { type: "noChannels", label: e.CONVERSATION_LIST__NO_CONVERSATIONS }) : /* @__PURE__ */ r.createElement(
3479
- Dc,
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, W.CLOSED),
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(Se, { type: "loading" });
3501
- }, Bc = () => {
3502
- const { refreshActiveChannel: e } = z(), { onOpenConversationView: t } = dr(), n = sr();
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
- Fc,
3544
+ Kc,
3505
3545
  {
3506
3546
  role: "button",
3507
3547
  onClick: async () => {
3508
3548
  const o = await e();
3509
- t(o, W.OPEN);
3549
+ t(o, j.OPEN);
3510
3550
  }
3511
3551
  },
3512
- /* @__PURE__ */ r.createElement(Uc, { variant: "h1" }, n)
3552
+ /* @__PURE__ */ r.createElement(Zc, { variant: "h1" }, n)
3513
3553
  );
3514
- }, Fc = u.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, Uc = u(k)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, Hc = () => {
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(zc, null, /* @__PURE__ */ r.createElement(Vc, { variant: "h2", color: h.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Wc, null));
3517
- }, zc = u.div`display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;flex-shrink:0;height:56px;position:relative;background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Vc = u(k)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Wc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${h.themedColor.textDisabled};`, Gc = ({ conversationListFilter: e, children: t, onOpenConversationView: n }) => {
3518
- const { Template: o } = Dt.useContext();
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
- Ic,
3560
+ Pc,
3521
3561
  {
3522
3562
  conversationListFilter: e,
3523
3563
  onOpenConversationView: n
3524
3564
  },
3525
- /* @__PURE__ */ r.createElement(Kc, null, /* @__PURE__ */ r.createElement(o, null)),
3565
+ /* @__PURE__ */ r.createElement(td, null, /* @__PURE__ */ r.createElement(o, null)),
3526
3566
  t
3527
3567
  );
3528
- }, Dt = we({
3529
- template: jc,
3568
+ }, Ft = Te({
3569
+ template: ed,
3530
3570
  components: {
3531
- Header: Hc,
3532
- Body: Pc,
3533
- Footer: Bc
3571
+ Header: Yc,
3572
+ Body: Gc,
3573
+ Footer: jc
3534
3574
  }
3535
3575
  });
3536
- function jc() {
3537
- const { components: e } = Dt.useContext();
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 Kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Zc = $`:where(#${oe.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, Yc = [Zc, ni, ri], qc = (e, ...t) => Lr(e, ...Yc, ...t), Jc = qc``, Xc = Xr(
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
- _e,
3543
- $t,
3544
- Mt,
3545
- Dt,
3546
- ur
3585
+ Ft,
3586
+ mr
3547
3587
  );
3548
- function Qc({
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 ci(jo, t), /* @__PURE__ */ r.createElement(Rr, { target: t }, /* @__PURE__ */ r.createElement(si, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Fo, { internalVariables: s == null ? void 0 : s.__internalVariables }, /* @__PURE__ */ r.createElement(ti, { stringSet: i, logger: n, language: o }, /* @__PURE__ */ r.createElement(Xc, null, a, /* @__PURE__ */ r.createElement(Jc, null))))));
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 hn = {
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
- }, mr = Re(function({
3785
+ }, hr = Re(function({
3746
3786
  rootElement: t = document.body,
3747
- logLevel: n = xn.WARN,
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), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: oe.ENTRY, style: { width: "fit-content", height: "fit-content", ...s.entryStyle } }, /* @__PURE__ */ r.createElement(No, { logger: ve, storage: td }, /* @__PURE__ */ r.createElement(
3755
- Qc,
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
- oo,
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: ed,
3814
+ dispatcher: ld,
3775
3815
  chatParams: { customApiHost: s.customApiHost, customWebSocketHost: s.customWebSocketHost }
3776
3816
  },
3777
- /* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement($a, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id: oe.MODAL_ROOT }))))
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 wn(xn.WARN), ed = new Sn(ve), Nt = "@sba/message-template", gn = (e) => `${Nt}/templates/${e}`, pn = () => `${Nt}/token`, td = Ro({
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
- hn[e] || te.setItem(gn(e), t);
3822
+ fn[e] || ee.setItem(bn(e), t);
3783
3823
  },
3784
3824
  onGetTemplate: (e) => {
3785
- const t = hn[e];
3786
- return t ? JSON.stringify(t) : te.getItem(gn(e));
3825
+ const t = fn[e];
3826
+ return t ? JSON.stringify(t) : ee.getItem(bn(e));
3787
3827
  },
3788
3828
  onSetCachedToken(e) {
3789
- te.setItem(pn(), e);
3829
+ ee.setItem(xn(), e);
3790
3830
  },
3791
3831
  onGetCachedToken() {
3792
- return te.getItem(pn());
3832
+ return ee.getItem(xn());
3793
3833
  },
3794
3834
  onClear: () => {
3795
- te.getKeys(Nt).forEach(te.deleteItem);
3835
+ ee.getKeys(Bt).forEach(ee.deleteItem);
3796
3836
  }
3797
- }), hr = ({ children: e, isOpened: t }) => {
3798
- const { dir: n, rootElement: o } = P(), i = fe(o, !0);
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(nd, { dir: n, $visible: t }, e);
3805
- }, nd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${be.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, rd = 48, od = 2 / 3;
3806
- function id({
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 = rd
3855
+ size: c = ud
3816
3856
  }) {
3817
- const d = ft(l), m = Math.round(c * od);
3857
+ const d = bt(l), h = Math.round(c * md);
3818
3858
  return /* @__PURE__ */ r.createElement(
3819
- ld,
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(cd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Open, { url: i, isDefaultIcon: o === "default_icon" })),
3831
- /* @__PURE__ */ r.createElement(dd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Close, { size: m }))
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 sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, ad = $`img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-drag:none;&[data-default-icon='true']{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;filter:${({ $fillColor: e }) => e === Ln.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, gr = $`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => $`
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
- `, ld = u.button`position:relative;padding:0;width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;background:${({ $backgroundColor: e }) => e};border-radius:50%;transition:all 0.3s cubic-bezier(0.31,-0.105,0.43,1.4);border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 16px 24px 2px rgba(33,33,33,0.12),0 6px 30px 5px rgba(33,33,33,0.08),0 6px 10px -5px rgba(33,33,33,0.04);${({ $animated: e }) => e && sd}`, pr = u.span`position:absolute;width:100%;height:100%;border-radius:50%;overflow:hidden;transition:transform 0.16s linear,opacity 0.08s linear,scale 0.16s linear;user-select:none;display:flex;justify-content:center;align-items:center;`, cd = u(pr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${ad}${gr}`, dd = u(pr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${gr}`, fn = {
3844
- Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(kt, null),
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 fr({ className: e, size: t }) {
3848
- const { colors: n } = Et(), { dir: o, state: i } = P(), { launcherInfo: a } = z();
3849
- return md(), /* @__PURE__ */ r.createElement(
3850
- id,
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 ud = 1e3 * 60;
3864
- function md() {
3865
- const { chatSDK: e, state: t, logger: n, enableAutoDisconnectInLauncher: o } = P(), i = F(null);
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 === Mr.CLOSED && (e.reconnect(), n.debug("useSDKInactivityTimeout: reconnected")), a(), n.debug("useSDKInactivityTimeout: clear disconnect schedule");
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
- }, ud);
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 br = Te(null);
3883
- function hd() {
3884
- const e = re(br);
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 xr({ children: e }) {
3890
- const t = hd();
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 gd = En`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, pd = En`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, fd = $`animation-name:${gd};animation-duration:0.3s;animation-fill-mode:forwards;`, bd = $``, xd = $`animation-name:${pd};animation-duration:0.3s;animation-fill-mode:forwards;`, Ed = $`visibility:hidden;`, Cd = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
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 fd;
3936
+ return Sd;
3897
3937
  case "entered":
3898
- return bd;
3938
+ return Td;
3899
3939
  case "exiting":
3900
- return xd;
3940
+ return wd;
3901
3941
  case "exited":
3902
- return Ed;
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 = U((b, C) => {
3912
- c((y) => [...y, b]), m((y) => ({ ...y, [b]: !0 })), C != null && C.reset && f((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
- [b]: (y[b] || 0) + 1
3954
+ [f]: (y[f] || 0) + 1
3915
3955
  })), p((y) => ({
3916
3956
  ...y,
3917
- [b]: "entering"
3957
+ [f]: "entering"
3918
3958
  })), setTimeout(() => {
3919
3959
  p((y) => ({
3920
3960
  ...y,
3921
- [b]: "entered"
3961
+ [f]: "entered"
3922
3962
  }));
3923
3963
  }, 300);
3924
- }, []), o = U(() => {
3925
- c((b) => {
3926
- if (b.length <= 1) return b;
3927
- const C = b[b.length - 1];
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), b;
3976
+ }, 300), f;
3937
3977
  });
3938
- }, []), i = ye(() => ({
3978
+ }, []), i = pe(() => ({
3939
3979
  navigation: {
3940
3980
  navigate: n,
3941
3981
  pop: o
3942
3982
  }
3943
- }), [n, o]), a = ye(() => Tr.toArray(t).filter(
3944
- (b) => b.type === xr
3945
- ), [t]), s = ye(() => {
3946
- const b = {};
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: T, children: _ } = C.props;
3949
- b[y] = { lazy: T, element: typeof _ == "function" ? _(i) : _ };
3950
- }), b;
3951
- }, [a]), [l, c] = S([e]), [d, m] = S(() => {
3952
- const b = {};
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 && (b[C] = !0);
3955
- }), b[e] = !0, b;
3994
+ y === !1 && (f[C] = !0);
3995
+ }), f[e] = !0, f;
3956
3996
  }), [g, p] = S(() => {
3957
- const b = {};
3997
+ const f = {};
3958
3998
  return Object.keys(s).forEach((C) => {
3959
- C === e ? b[C] = "entered" : b[C] = "exited";
3960
- }), b;
3961
- }), [x, f] = S({}), E = l[l.length - 1];
3962
- return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(vd, null, Object.keys(s).map((b) => {
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[b]) return null;
3965
- const C = g[b] || "exited", y = b === E, T = `${b}-${x[b] || 0}`;
3966
- return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active: y }, (_ = s[b]) == null ? void 0 : _.element);
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 vd = u.div`position:relative;width:100%;height:100%;`;
3970
- Me.Screen = xr;
3971
- const pe = {
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
- }, Er = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(Me, { initialId: pe.activeConv }, /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.activeConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(mn, { onNavigateToConversationList: () => n.navigate(pe.convList, { reset: !0 }) })), /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.closedConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
3976
- mn,
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: pe.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
3983
- Gc,
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(pe.closedConv, { reset: !0 })) : n.navigate(pe.activeConv);
4026
+ i === "closed" ? (e(o), n.navigate(ge.closedConv, { reset: !0 })) : n.navigate(ge.activeConv);
3987
4027
  }
3988
4028
  }
3989
4029
  )));
3990
- function yd({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
3991
- const { dir: i } = P();
3992
- return /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Sd, { dir: i, id: oe.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
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 _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Sd = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && wd};${({ $isExpanded: e }) => e && Td};`, Td = $`width:743px;height:723px;`, wd = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, Xd = Re(function({ children: e, ...t }, n) {
3995
- const o = Pe(), [i, a] = S(), s = o ? hr : yd;
3996
- return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(s, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(fr, null) }, /* @__PURE__ */ r.createElement(
3997
- Er,
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: kd,
4005
- useContext: Pt
4006
- } = j("FixedMessengerStyle");
4007
- function Cr(e, t, n, o = 0) {
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: ${Y(s)}`;
4052
+ d = `inset-inline-start: ${q(s)}`;
4013
4053
  break;
4014
4054
  case "end":
4015
- d = `inset-inline-end: ${Y(l)}`;
4055
+ d = `inset-inline-end: ${q(l)}`;
4016
4056
  break;
4017
4057
  }
4018
4058
  switch (t) {
4019
4059
  case "top":
4020
- c = `top: calc(${Y(i)} + ${o}px)`;
4060
+ c = `top: calc(${q(i)} + ${o}px)`;
4021
4061
  break;
4022
4062
  case "bottom":
4023
- c = `bottom: calc(${Y(a)} + ${o}px)`;
4063
+ c = `bottom: calc(${q(a)} + ${o}px)`;
4024
4064
  break;
4025
4065
  }
4026
4066
  return $`${c};${d};`;
4027
4067
  }
4028
- function Ad(e) {
4029
- const { horizontal: t, vertical: n, margin: o, launcherSize: i } = Pt();
4030
- return /* @__PURE__ */ r.createElement(Id, { ...e, size: i, $horizontal: t, $vertical: n, $margin: o });
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 Id = u(fr)`position:fixed;z-index:${be.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => Cr(e, t, n)};`;
4033
- function $d({ isExpanded: e, isOpened: t, children: n }) {
4034
- const { dir: o } = P(), { horizontal: i, vertical: a, margin: s, launcherSize: l } = Pt();
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
- Md,
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 Md = 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 }) => Cr(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}`};
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 && Ld};
4057
- ${({ $isExpanded: e }) => e && Od};
4058
- `, Od = $`width:743px;height:723px;`, Ld = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, vr = { top: 24, bottom: 24, start: 24, end: 24 }, Rd = Re(function({ children: e, ...t }, n) {
4059
- const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(vr), [d, m] = S(48), g = Pe(), p = g ? hr : $d, { horizontal: x, vertical: f } = ye(() => {
4060
- const [E, b] = a.split("-");
4061
- return { horizontal: E === "start" ? "start" : "end", vertical: b === "top" ? "top" : "bottom" };
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(mr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: E }) => /* @__PURE__ */ r.createElement(
4064
- kd,
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: f, margin: l, launcherSize: d, setPosition: s, setMargin: c, setLauncherSize: m }
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
- Er,
4109
+ Cr,
4070
4110
  {
4071
4111
  closedChannelUrl: o,
4072
4112
  setClosedChannelUrl: i
4073
4113
  }
4074
4114
  )),
4075
- /* @__PURE__ */ r.createElement(Ad, null),
4115
+ /* @__PURE__ */ r.createElement(Nd, null),
4076
4116
  e
4077
4117
  )));
4078
- }), Dd = (e) => {
4118
+ }), Vd = (e) => {
4079
4119
  var i, a, s, l;
4080
- const { setPosition: t, setMargin: n, setLauncherSize: o } = Pt();
4081
- return ce(() => {
4082
- e.position && t(e.position), e.margin && n({ ...vr, ...e.margin }), e.launcherSize && o(e.launcherSize);
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
- }, Qd = Object.assign(Rd, {
4092
- Style: Dd
4131
+ }, au = Object.assign(zd, {
4132
+ Style: Vd
4093
4133
  });
4094
4134
  export {
4095
- _t as A,
4096
- ao as C,
4097
- Xd as D,
4098
- Qd as F,
4135
+ Tt as A,
4136
+ lo as C,
4137
+ su as D,
4138
+ au as F,
4099
4139
  O as I,
4100
- Kn as L,
4101
- ka as M,
4102
- $t as O,
4103
- Jd as P,
4104
- Mt as S,
4105
- k as a,
4106
- mr as b,
4107
- h as c,
4108
- Qc as d,
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
- id as g,
4112
- _e as h,
4113
- ne as i,
4114
- ur as j,
4115
- mn as k,
4116
- Rt as l,
4117
- ed as m,
4118
- Gc as n,
4119
- Dt as o,
4120
- Tn as p,
4121
- P as u
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
  };