@sendbird/ai-agent-messenger-react-native 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,29 +2,29 @@ var Fo = Object.defineProperty;
2
2
  var $o = (e, t, n) => t in e ? Fo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var k = (e, t, n) => $o(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { StyleSheet as Q, View as Ie, Animated as N, Alert as ke, Image as Ye, Modal as jo, I18nManager as Ve, Text as Dt, TouchableOpacity as Go, Pressable as Jt, PanResponder as Vo, Easing as fe, FlatList as Wo, Linking as Ee, useWindowDimensions as qo, ScrollView as to, KeyboardAvoidingView as no, TextInput as Qt, Platform as te, Keyboard as dt, BackHandler as Yo } from "react-native";
5
- import Ko, { ConnectionHandler as oo, SendbirdError as $e, SendbirdChatOptions as Xo, SendbirdProduct as Zo, DeviceOsPlatform as Ae, SendbirdPlatform as en, SessionHandler as Jo, LogLevel as Qo } from "@sendbird/chat";
5
+ import Ko, { ConnectionHandler as oo, SendbirdError as $e, SendbirdChatOptions as Xo, SendbirdProduct as Zo, DeviceOsPlatform as Ae, SendbirdPlatform as en, SessionHandler as Jo, ConnectionState as Qo, LogLevel as er } from "@sendbird/chat";
6
6
  import * as a from "react";
7
- import { createContext as tn, useContext as je, useLayoutEffect as me, useState as C, useEffect as L, useRef as j, useCallback as w, useMemo as J, forwardRef as mt, useImperativeHandle as er, useId as tr, useReducer as nr, memo as Ke, isValidElement as or, Fragment as rr, Children as sr } from "react";
8
- import { useSafeAreaInsets as gt, SafeAreaProvider as ar, SafeAreaInsetsContext as ro } from "react-native-safe-area-context";
9
- import { ConversationStatus as _e, AIAgentModule as ir, AIAgentMessageFeedbackRating as Tn } from "@sendbird/chat/aiAgent";
10
- import { useGroupChannelMessages as lr, useGroupChannelHandler as nn, useForceUpdate as cr } from "@sendbird/uikit-tools";
11
- import { isSameMinute as wn, differenceInMinutes as ur, isToday as dr, differenceInHours as mr, format as gr } from "date-fns";
12
- import { SendingStatus as lt, ReplyType as hr, MessageMetaArray as pr } from "@sendbird/chat/message";
13
- import { GroupChannelListOrder as so, GroupChannelHandler as fr, GroupChannelModule as _r } from "@sendbird/chat/groupChannel";
14
- import { isSameDay as yr } from "date-fns/isSameDay";
15
- import { de as br } from "date-fns/locale/de";
16
- import { enUS as Er } from "date-fns/locale/en-US";
17
- import { es as vr } from "date-fns/locale/es";
18
- import { fr as Cr } from "date-fns/locale/fr";
19
- import { hi as Sr } from "date-fns/locale/hi";
20
- import { it as Ar } from "date-fns/locale/it";
21
- import { ja as Tr } from "date-fns/locale/ja";
22
- import { ko as wr } from "date-fns/locale/ko";
23
- import { pt as xr } from "date-fns/locale/pt";
24
- import { tr as Ir } from "date-fns/locale/tr";
25
- import kr from "@react-native-clipboard/clipboard";
26
- import Mr from "react-native-code-highlighter";
27
- import Rr from "react-native-markdown-display";
7
+ import { createContext as tn, useContext as je, useLayoutEffect as me, useState as C, useEffect as L, useRef as j, useCallback as w, useMemo as J, forwardRef as mt, useImperativeHandle as tr, useId as nr, useReducer as or, memo as Ke, isValidElement as rr, Fragment as sr, Children as ar } from "react";
8
+ import { useSafeAreaInsets as gt, SafeAreaProvider as ir, SafeAreaInsetsContext as ro } from "react-native-safe-area-context";
9
+ import { ConversationStatus as _e, AIAgentModule as lr, AIAgentMessageFeedbackRating as Tn } from "@sendbird/chat/aiAgent";
10
+ import { useGroupChannelMessages as cr, useGroupChannelHandler as nn, useForceUpdate as ur } from "@sendbird/uikit-tools";
11
+ import { isSameMinute as wn, differenceInMinutes as dr, isToday as mr, differenceInHours as gr, format as hr } from "date-fns";
12
+ import { SendingStatus as lt, ReplyType as pr, MessageMetaArray as fr } from "@sendbird/chat/message";
13
+ import { GroupChannelListOrder as so, GroupChannelHandler as _r, GroupChannelModule as yr } from "@sendbird/chat/groupChannel";
14
+ import { isSameDay as br } from "date-fns/isSameDay";
15
+ import { de as Er } from "date-fns/locale/de";
16
+ import { enUS as vr } from "date-fns/locale/en-US";
17
+ import { es as Cr } from "date-fns/locale/es";
18
+ import { fr as Sr } from "date-fns/locale/fr";
19
+ import { hi as Ar } from "date-fns/locale/hi";
20
+ import { it as Tr } from "date-fns/locale/it";
21
+ import { ja as wr } from "date-fns/locale/ja";
22
+ import { ko as xr } from "date-fns/locale/ko";
23
+ import { pt as Ir } from "date-fns/locale/pt";
24
+ import { tr as kr } from "date-fns/locale/tr";
25
+ import Mr from "@react-native-clipboard/clipboard";
26
+ import Rr from "react-native-code-highlighter";
27
+ import Lr from "react-native-markdown-display";
28
28
  const Re = "sb-agent", ao = "KEY_IMG_ASPECT_RATIO", io = "*/*", P = {
29
29
  BODY_MAX_WIDTH: 244,
30
30
  AVATAR_SIZE: 26,
@@ -32,7 +32,7 @@ const Re = "sb-agent", ao = "KEY_IMG_ASPECT_RATIO", io = "*/*", P = {
32
32
  HORIZONTAL_PADDING: 12,
33
33
  GAP_GROUPED: 2,
34
34
  GAP_UNGROUPED: 16
35
- }, de = (e) => !!e && "sender" in e, Lr = (e) => de(e) ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId), Dr = (e, t, n, o = !0) => {
35
+ }, de = (e) => !!e && "sender" in e, Dr = (e) => de(e) ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId), Pr = (e, t, n, o = !0) => {
36
36
  if (!o || !de(e))
37
37
  return "single";
38
38
  const r = () => {
@@ -56,7 +56,7 @@ const Re = "sb-agent", ao = "KEY_IMG_ASPECT_RATIO", io = "*/*", P = {
56
56
  },
57
57
  isIncoming: (e, t) => de(e) && e.sender.userId !== t,
58
58
  isOutgoing: (e, t) => de(e) && (e.sender.userId === t || e.sendingStatus === lt.PENDING)
59
- }, Pr = (e) => e.startsWith("image/"), on = (e, t) => {
59
+ }, Or = (e) => e.startsWith("image/"), on = (e, t) => {
60
60
  if (e && !e.startsWith(".")) {
61
61
  const n = e.split(".").pop();
62
62
  if (n && n !== e)
@@ -79,7 +79,7 @@ const Re = "sb-agent", ao = "KEY_IMG_ASPECT_RATIO", io = "*/*", P = {
79
79
  default:
80
80
  return P.GAP_UNGROUPED;
81
81
  }
82
- }, Or = (e, t) => {
82
+ }, Nr = (e, t) => {
83
83
  const n = /```(\w+)?\n([\s\S]*?)```/g, o = [];
84
84
  let r = 0;
85
85
  return e.replace(n, (s, ...i) => {
@@ -96,20 +96,20 @@ const Re = "sb-agent", ao = "KEY_IMG_ASPECT_RATIO", io = "*/*", P = {
96
96
  type: "text",
97
97
  value: e.slice(r).trim()
98
98
  }), o;
99
- }, Nr = (e) => e.replace(/\[([^\]]+)\](?!\()/g, "\\[$1\\]"), Br = (e) => e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g, "$1\\_"), Hr = (e) => e.replace(/~~/g, "\\~\\~"), zr = (e) => {
99
+ }, Br = (e) => e.replace(/\[([^\]]+)\](?!\()/g, "\\[$1\\]"), Hr = (e) => e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g, "$1\\_"), zr = (e) => e.replace(/~~/g, "\\~\\~"), Ur = (e) => {
100
100
  let t = e;
101
- return t = Nr(t), t = Br(t), t = Hr(t), t;
102
- }, Ur = typeof navigator < "u" && navigator.product === "ReactNative", xn = (e, t) => {
101
+ return t = Br(t), t = Hr(t), t = zr(t), t;
102
+ }, Fr = typeof navigator < "u" && navigator.product === "ReactNative", xn = (e, t) => {
103
103
  const n = (o) => !t || t.length === 0 ? !0 : de(o) && t.includes(o.sendingStatus);
104
- return Ur ? e.find(n) : e.findLast(n);
104
+ return Fr ? e.find(n) : e.findLast(n);
105
105
  };
106
106
  function Pt() {
107
107
  }
108
- function Fr() {
108
+ function $r() {
109
109
  const e = typeof navigator < "u" ? navigator.userAgent : "", t = /iPad|iPhone|iPod/.test(e), n = /Android/.test(e);
110
110
  return t || n;
111
111
  }
112
- function $r(e) {
112
+ function jr(e) {
113
113
  let t = 0;
114
114
  for (let n = 0; n < e.length; n++)
115
115
  t = (t << 5) - t + e.charCodeAt(n), t |= 0;
@@ -150,7 +150,7 @@ const In = (e) => {
150
150
  template: (r) => `${o.templateBase}/templates/${r}`,
151
151
  templateToken: () => `${o.templateBase}/tokens`,
152
152
  messengerSession: (r) => {
153
- const s = $r(`${e}/${t}/${r}`);
153
+ const s = jr(`${e}/${t}/${r}`);
154
154
  return `${ft}-udata/${s}`;
155
155
  },
156
156
  anonUserSession: () => `${ft}-session/${e}/${t}`
@@ -225,7 +225,7 @@ const In = (e) => {
225
225
  o && (clearTimeout(o), o = null), r = null, s = null;
226
226
  }, c;
227
227
  };
228
- class jr {
228
+ class Gr {
229
229
  /**
230
230
  * Creates a new ConversationListCollection instance.
231
231
  * @param sdk - The Sendbird Chat SDK instance
@@ -265,7 +265,7 @@ class jr {
265
265
  },
266
266
  250,
267
267
  { trailing: !1, leading: !0 }
268
- ), this._channelHandler = new fr({
268
+ ), this._channelHandler = new _r({
269
269
  onChannelChanged: (g) => {
270
270
  g.isGroupChannel() && this._throttledOnChannelChanged(g);
271
271
  },
@@ -349,7 +349,7 @@ class jr {
349
349
  }
350
350
  const l = Ot(this._channels, i), c = l < 0;
351
351
  !c && this._channels.splice(l, 1);
352
- const d = Gr(this._channels, i, this._order).place, g = d === this._channels.length;
352
+ const d = Vr(this._channels, i, this._order).place, g = d === this._channels.length;
353
353
  c ? g ? (n || !this.hasMore) && (this._channels.push(i), r.push(i)) : (this._channels.splice(d, 0, i), r.push(i)) : (this._channels.splice(d, 0, i), s.push(i));
354
354
  }
355
355
  return { addedChannels: r, updatedChannels: s, unmatchedChannelUrls: o };
@@ -426,7 +426,7 @@ class jr {
426
426
  this._isDisposed || (this._isDisposed = !0, this._throttledOnChannelChanged.cancel(), this._collectionEventHandler = void 0, this._sdk.removeConnectionHandler(this._handlerId), this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId), this._pinnedChannels.length = 0, this._channels.length = 0);
427
427
  }
428
428
  }
429
- const Ot = (e, t) => e.findIndex((n) => n.isIdentical(t)), Gr = (e, t, n) => {
429
+ const Ot = (e, t) => e.findIndex((n) => n.isIdentical(t)), Vr = (e, t, n) => {
430
430
  if (e.length > 0) {
431
431
  const o = Ot(e, t);
432
432
  let r = 0, s = e.length - 1, i = Math.floor((r + s) / 2);
@@ -453,13 +453,13 @@ const Ot = (e, t) => e.findIndex((n) => n.isIdentical(t)), Gr = (e, t, n) => {
453
453
  return 0;
454
454
  }
455
455
  };
456
- class Vr {
456
+ class Wr {
457
457
  constructor(t) {
458
458
  k(this, "subscribers", {});
459
459
  this.logger = t;
460
460
  }
461
461
  async send(t) {
462
- const n = Wr(), o = this.subscribers[t.type];
462
+ const n = qr(), o = this.subscribers[t.type];
463
463
  if (o) {
464
464
  this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`, t.payload);
465
465
  const r = o.map(
@@ -479,7 +479,7 @@ class Vr {
479
479
  o && (this.subscribers[t] = o.filter((r) => r !== n));
480
480
  }
481
481
  }
482
- const Wr = () => {
482
+ const qr = () => {
483
483
  let e = Pt, t = Pt;
484
484
  return { promise: new Promise((o, r) => {
485
485
  e = o, t = r;
@@ -495,31 +495,31 @@ class ht {
495
495
  return JSON.stringify({ type: this.type, payload: this.payload });
496
496
  }
497
497
  }
498
- const qr = {
499
- CloseConversation: (e) => new Yr(e),
500
- MessengerSettingsUpdated: (e) => new Kr(e),
501
- ActiveChannelUpdated: (e) => new Xr(e),
502
- AnonymousSessionTokenExpired: () => new Zr()
498
+ const Yr = {
499
+ CloseConversation: (e) => new Kr(e),
500
+ MessengerSettingsUpdated: (e) => new Xr(e),
501
+ ActiveChannelUpdated: (e) => new Zr(e),
502
+ AnonymousSessionTokenExpired: () => new Jr()
503
503
  };
504
- class Yr extends ht {
504
+ class Kr extends ht {
505
505
  constructor() {
506
506
  super(...arguments);
507
507
  k(this, "type", "conv.close");
508
508
  }
509
509
  }
510
- class Kr extends ht {
510
+ class Xr extends ht {
511
511
  constructor() {
512
512
  super(...arguments);
513
513
  k(this, "type", "messenger.settings.updated");
514
514
  }
515
515
  }
516
- class Xr extends ht {
516
+ class Zr extends ht {
517
517
  constructor() {
518
518
  super(...arguments);
519
519
  k(this, "type", "active.channel.updated");
520
520
  }
521
521
  }
522
- class Zr extends ht {
522
+ class Jr extends ht {
523
523
  constructor() {
524
524
  super(...arguments);
525
525
  k(this, "type", "anon.token.expired");
@@ -562,13 +562,13 @@ class Nt {
562
562
  k(this, "sessionHandler");
563
563
  }
564
564
  }
565
- const Jr = (e) => ({
565
+ const Qr = (e) => ({
566
566
  onSessionTokenRequired: (t) => {
567
- t(null), e.send(qr.AnonymousSessionTokenExpired());
567
+ t(null), e.send(Yr.AnonymousSessionTokenExpired());
568
568
  }
569
- }), Qr = "ai_agent:stats", es = "conversation_initial_render", ts = 800220;
569
+ }), es = "ai_agent:stats", ts = "conversation_initial_render", ns = 800220;
570
570
  var Z = /* @__PURE__ */ ((e) => (e.AUTH = "auth_duration", e.GET_CHANNEL = "get_channel_duration", e.GET_MESSAGES = "get_messages_duration", e.TOTAL_DURATION = "total_duration", e.TOTAL_DURATION_FROM_CACHE = "total_duration_from_cache", e))(Z || {});
571
- class ns {
571
+ class os {
572
572
  constructor() {
573
573
  k(this, "timers", /* @__PURE__ */ new Map());
574
574
  k(this, "committed", !1);
@@ -589,7 +589,7 @@ class ns {
589
589
  return this.setExtra("channel_url", t), this;
590
590
  }
591
591
  setError(t, n) {
592
- return this.errorCode = t ?? ts, this.errorDescription = n, this;
592
+ return this.errorCode = t ?? ns, this.errorDescription = n, this;
593
593
  }
594
594
  setExtra(t, n) {
595
595
  return n != null && (this.extraData[t] = n), this;
@@ -615,10 +615,10 @@ class ns {
615
615
  if (this.committed || !this.commitCallback)
616
616
  return !1;
617
617
  const t = this.buildPayload();
618
- return t ? (this.committed = !0, this.commitCallback(Qr, t)) : !1;
618
+ return t ? (this.committed = !0, this.commitCallback(es, t)) : !1;
619
619
  }
620
620
  }
621
- class os extends ns {
621
+ class rs extends os {
622
622
  constructor() {
623
623
  super(...arguments);
624
624
  k(this, "presentMethod", "direct_present");
@@ -627,7 +627,7 @@ class os extends ns {
627
627
  return this.presentMethod = n, this;
628
628
  }
629
629
  getMetricKey() {
630
- return es;
630
+ return ts;
631
631
  }
632
632
  buildPayload() {
633
633
  const n = this.getDuration(Z.AUTH), o = this.getDuration(Z.GET_CHANNEL), r = this.getDuration(Z.GET_MESSAGES), s = this.getDuration(Z.TOTAL_DURATION_FROM_CACHE), i = this.getDuration(Z.TOTAL_DURATION), l = {
@@ -645,7 +645,7 @@ class os extends ns {
645
645
  return this.conversationId !== null && (c.conversation_id = this.conversationId), this.errorCode !== null && (c.error_code = this.errorCode), this.errorDescription !== null && (c.error_description = this.errorDescription), Object.keys(l).length > 0 && (c.extra = l), c;
646
646
  }
647
647
  }
648
- class rs {
648
+ class ss {
649
649
  constructor(t) {
650
650
  k(this, "commitCallback");
651
651
  k(this, "presentMethod", "direct_present");
@@ -653,7 +653,7 @@ class rs {
653
653
  this.commitCallback = t;
654
654
  }
655
655
  getOrCreateStats() {
656
- return (!this.stats || this.stats.isCommitted()) && (this.stats = new os().setCommitCallback(this.commitCallback).setPresentMethod(this.presentMethod)), this.stats;
656
+ return (!this.stats || this.stats.isCommitted()) && (this.stats = new rs().setCommitCallback(this.commitCallback).setPresentMethod(this.presentMethod)), this.stats;
657
657
  }
658
658
  onAuthStart() {
659
659
  this.getOrCreateStats().startTimer(Z.TOTAL_DURATION).startTimer(Z.TOTAL_DURATION_FROM_CACHE).startTimer(Z.AUTH);
@@ -720,7 +720,7 @@ const Se = {
720
720
  downloadEnabled: !0
721
721
  }
722
722
  }
723
- }, ss = (e) => {
723
+ }, as = (e) => {
724
724
  var t, n, o, r, s, i, l, c, u, d, g, m, p, f;
725
725
  return e ? {
726
726
  ...Se,
@@ -761,7 +761,7 @@ function De(e) {
761
761
  var n, o, r;
762
762
  return typeof (((n = e == null ? void 0 : e.conversation) == null ? void 0 : n.handedOverAt) ?? ((r = (o = e == null ? void 0 : e.conversation) == null ? void 0 : o.handoff) == null ? void 0 : r.timestamp)) == "number";
763
763
  }
764
- function as(e) {
764
+ function is(e) {
765
765
  var t;
766
766
  if (((t = e == null ? void 0 : e.resolution) == null ? void 0 : t.determinedBy) === "user")
767
767
  return e.resolution.isResolved;
@@ -769,13 +769,13 @@ function as(e) {
769
769
  function Rn(e) {
770
770
  return !!e && e < Date.now();
771
771
  }
772
- function is(e) {
772
+ function ls(e) {
773
773
  return !e.title;
774
774
  }
775
- function ls(e, t) {
775
+ function cs(e, t) {
776
776
  var n;
777
777
  if (e)
778
- return is(e) ? {
778
+ return ls(e) ? {
779
779
  ...e,
780
780
  title: t.title,
781
781
  csat_question: t.question,
@@ -819,17 +819,17 @@ function ls(e, t) {
819
819
  csat_submitted_label: t.submitted_label
820
820
  } : e;
821
821
  }
822
- const cs = (e) => JSON.parse(e);
822
+ const us = (e) => JSON.parse(e);
823
823
  var Bt = /* @__PURE__ */ ((e) => (e[e.EXTERNAL_AUTH_TOKEN_EXPIRED = 1] = "EXTERNAL_AUTH_TOKEN_EXPIRED", e))(Bt || {});
824
- const po = (e) => typeof e == "object" && e !== null, Ln = (e, t) => t in e && typeof e[t] == "string" && e[t] !== "", us = (e) => !po(e) || !Ln(e, "channel_url") || !Ln(e, "ai_agent_id") ? null : {
824
+ const po = (e) => typeof e == "object" && e !== null, Ln = (e, t) => t in e && typeof e[t] == "string" && e[t] !== "", ds = (e) => !po(e) || !Ln(e, "channel_url") || !Ln(e, "ai_agent_id") ? null : {
825
825
  channelUrl: e.channel_url,
826
826
  aiAgentId: e.ai_agent_id
827
- }, ds = {
828
- 1: us
827
+ }, ms = {
828
+ 1: ds
829
829
  };
830
- function ms(e) {
830
+ function gs(e) {
831
831
  if (!po(e) || !("cat" in e) || typeof e.cat != "number" || !("data" in e)) return null;
832
- const t = e.cat, n = ds[t];
832
+ const t = e.cat, n = ms[t];
833
833
  if (!n) return null;
834
834
  const o = n(e.data);
835
835
  return o ? { category: t, data: o } : null;
@@ -837,7 +837,7 @@ function ms(e) {
837
837
  function Dn(e, t, n, o) {
838
838
  const r = Ko.init({
839
839
  appId: e,
840
- modules: [new _r(), new ir()],
840
+ modules: [new yr(), new lr()],
841
841
  localCacheEnabled: !0,
842
842
  options: new Xo({ typingIndicatorInvalidateTime: 2e4 }),
843
843
  ...o
@@ -848,13 +848,13 @@ function Dn(e, t, n, o) {
848
848
  t.customData
849
849
  ) || console.warn("Invalid Sendbird Extensions", t), r;
850
850
  }
851
- function gs(e) {
851
+ function hs(e) {
852
852
  const t = (n) => {
853
853
  throw new Error(`Please initialize chat sdk with ${n}`);
854
854
  };
855
855
  typeof e.groupChannel != "object" && t("GroupChannelModule"), typeof e.aiAgent != "object" && t("AIAgentModule");
856
856
  }
857
- const et = /* @__PURE__ */ new Map(), hs = {
857
+ const et = /* @__PURE__ */ new Map(), ps = {
858
858
  set: (e, t) => {
859
859
  et.set(e, t);
860
860
  },
@@ -873,7 +873,7 @@ const et = /* @__PURE__ */ new Map(), hs = {
873
873
  return { platform: t[0], ...t[1] };
874
874
  }
875
875
  };
876
- function ps() {
876
+ function fs() {
877
877
  const e = {};
878
878
  return {
879
879
  get: (t) => e[t] ?? null,
@@ -886,7 +886,7 @@ function ps() {
886
886
  getKeys: (t) => Object.keys(e).filter((n) => n.startsWith(t))
887
887
  };
888
888
  }
889
- function fs(e) {
889
+ function _s(e) {
890
890
  return {
891
891
  get: (t) => e.getString(t) ?? null,
892
892
  set: (t, n) => {
@@ -945,12 +945,12 @@ function ce(e) {
945
945
  };
946
946
  }), r;
947
947
  }
948
- function _s(...e) {
948
+ function ys(...e) {
949
949
  return function({ children: n }) {
950
950
  return e.reduce((o, r) => /* @__PURE__ */ a.createElement(r, null, o), n);
951
951
  };
952
952
  }
953
- function ys(e, t) {
953
+ function bs(e, t) {
954
954
  var o;
955
955
  const n = e.lastMessage;
956
956
  if (n != null && n.isUserMessage() || n != null && n.isAdminMessage())
@@ -965,16 +965,16 @@ function ys(e, t) {
965
965
  }
966
966
  return e.name;
967
967
  }
968
- function bs(e, t, n) {
968
+ function Es(e, t, n) {
969
969
  var i;
970
- const o = /* @__PURE__ */ new Date(), r = new Date(((i = e.lastMessage) == null ? void 0 : i.createdAt) || e.createdAt), s = ur(o, r);
971
- return s < 1 ? n.justNow : s < 60 ? n.minutesAgo(s) : dr(r) ? n.hoursAgo(mr(o, r)) : t(r, n.dateShortFormat);
970
+ const o = /* @__PURE__ */ new Date(), r = new Date(((i = e.lastMessage) == null ? void 0 : i.createdAt) || e.createdAt), s = dr(o, r);
971
+ return s < 1 ? n.justNow : s < 60 ? n.minutesAgo(s) : mr(r) ? n.hoursAgo(gr(o, r)) : t(r, n.dateShortFormat);
972
972
  }
973
973
  const {
974
- Provider: Es,
974
+ Provider: vs,
975
975
  useContext: ee
976
976
  } = ne("AIAgent");
977
- function vs({
977
+ function Cs({
978
978
  appId: e,
979
979
  aiAgentId: t,
980
980
  keyValueStorage: n,
@@ -992,11 +992,11 @@ function vs({
992
992
  messengerVersion: f,
993
993
  extensions: E = {
994
994
  platform: en.JS,
995
- deviceOSPlatform: Fr() ? Ae.MOBILE_WEB : Ae.WEB
995
+ deviceOSPlatform: $r() ? Ae.MOBILE_WEB : Ae.WEB
996
996
  }
997
997
  }) {
998
998
  const [h, v] = C(() => {
999
- const _ = m ?? new mo(uo.WARN), b = p ?? new Vr(_);
999
+ const _ = m ?? new mo(uo.WARN), b = p ?? new Wr(_);
1000
1000
  return {
1001
1001
  logger: _,
1002
1002
  dispatcher: b,
@@ -1017,8 +1017,8 @@ function vs({
1017
1017
  });
1018
1018
  }, [e, t, m, p, u, n]), L(() => () => {
1019
1019
  h.chatSDK.connectionState === "OPEN" && h.chatSDK.disconnectWebSocket();
1020
- }, [h.chatSDK]), gs(h.chatSDK), /* @__PURE__ */ a.createElement(
1021
- Es,
1020
+ }, [h.chatSDK]), hs(h.chatSDK), /* @__PURE__ */ a.createElement(
1021
+ vs,
1022
1022
  {
1023
1023
  value: {
1024
1024
  ...h,
@@ -1028,14 +1028,14 @@ function vs({
1028
1028
  language: r,
1029
1029
  countryCode: s,
1030
1030
  queryParams: l,
1031
- config: ss(c),
1031
+ config: as(c),
1032
1032
  networkStateAdapter: o
1033
1033
  }
1034
1034
  },
1035
1035
  g
1036
1036
  );
1037
1037
  }
1038
- const Cs = (e, t, n) => lr(e, t, { ...n, strictStreamingOrder: !0 }), Ht = {
1038
+ const Ss = (e, t, n) => cr(e, t, { ...n, strictStreamingOrder: !0 }), Ht = {
1039
1039
  DEFAULT_BOT_MSG_BG: "#ECECEC",
1040
1040
  WHITE: "#ffffff",
1041
1041
  BLACK: "#000000"
@@ -1043,7 +1043,7 @@ const Cs = (e, t, n) => lr(e, t, { ...n, strictStreamingOrder: !0 }), Ht = {
1043
1043
  function fo(e) {
1044
1044
  return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
1045
1045
  }
1046
- function Ss(e) {
1046
+ function As(e) {
1047
1047
  const t = fo(e);
1048
1048
  return [
1049
1049
  parseInt(t.slice(1, 3), 16),
@@ -1054,17 +1054,17 @@ function Ss(e) {
1054
1054
  // b
1055
1055
  ];
1056
1056
  }
1057
- function As(e) {
1057
+ function Ts(e) {
1058
1058
  return `#${e.map((t) => t.toString(16).padStart(2, "0")).join("")}`;
1059
1059
  }
1060
- function Ts(e, t, n) {
1060
+ function ws(e, t, n) {
1061
1061
  e /= 255, t /= 255, n /= 255;
1062
1062
  const o = Math.max(e, t, n), r = Math.min(e, t, n), s = o - r;
1063
1063
  let i = 0, l = 0;
1064
1064
  const c = (o + r) / 2;
1065
1065
  return o !== r && (l = c > 0.5 ? s / (2 - o - r) : s / (o + r)), o === e ? i = (t - n) / s + (t < n ? 6 : 0) : o === t ? i = (n - e) / s + 2 : o === n && (i = (e - t) / s + 4), i /= 6, [i, l, c];
1066
1066
  }
1067
- function ws(e, t, n) {
1067
+ function xs(e, t, n) {
1068
1068
  let o, r, s;
1069
1069
  if (t === 0)
1070
1070
  o = r = s = n;
@@ -1077,10 +1077,10 @@ function ws(e, t, n) {
1077
1077
  return [Math.round(o * 255), Math.round(r * 255), Math.round(s * 255)];
1078
1078
  }
1079
1079
  function tt(e, t, n) {
1080
- const [o, r, s] = Ss(e), [i, l, c] = Ts(o, r, s), u = Math.max(0, Math.min(1, c * t)), d = Math.max(0, Math.min(1, l * n)), [g, m, p] = ws(i, d, u);
1081
- return As([Math.round(g), Math.round(m), Math.round(p)]);
1080
+ const [o, r, s] = As(e), [i, l, c] = ws(o, r, s), u = Math.max(0, Math.min(1, c * t)), d = Math.max(0, Math.min(1, l * n)), [g, m, p] = xs(i, d, u);
1081
+ return Ts([Math.round(g), Math.round(m), Math.round(p)]);
1082
1082
  }
1083
- function xs(e, t = "light") {
1083
+ function Is(e, t = "light") {
1084
1084
  return {
1085
1085
  extraDark: tt(e, 0.6, 1.2),
1086
1086
  dark: tt(e, 0.85, 1.1),
@@ -1093,7 +1093,7 @@ function Pn(e) {
1093
1093
  const t = fo(e), n = 149, o = +`0x${t[1]}${t[2]}`, r = +`0x${t[3]}${t[4]}`, s = +`0x${t[5]}${t[6]}`;
1094
1094
  return o * 0.299 + r * 0.587 + s * 0.114 > n ? Ht.BLACK : Ht.WHITE;
1095
1095
  }
1096
- function Is(e, t, n, o, r) {
1096
+ function ks(e, t, n, o, r) {
1097
1097
  return {
1098
1098
  base: {
1099
1099
  primary: t,
@@ -1120,7 +1120,7 @@ function Is(e, t, n, o, r) {
1120
1120
  }
1121
1121
  };
1122
1122
  }
1123
- const ks = (e, t, n, o, r) => ({
1123
+ const Ms = (e, t, n, o, r) => ({
1124
1124
  base: {
1125
1125
  primary: t,
1126
1126
  primaryContrastContent: n,
@@ -1212,7 +1212,7 @@ const ks = (e, t, n, o, r) => ({
1212
1212
  caption4: { fontSize: 11, fontWeight: 400 }
1213
1213
  };
1214
1214
  function On(e) {
1215
- const t = Ms(e), { colors: n, aiAgentColorVariables: o } = Rs(e, t), r = Ds(e);
1215
+ const t = Rs(e), { colors: n, aiAgentColorVariables: o } = Ls(e, t), r = Ps(e);
1216
1216
  return {
1217
1217
  selectedTheme: e.selectedTheme,
1218
1218
  palette: t,
@@ -1221,18 +1221,18 @@ function On(e) {
1221
1221
  typography: r
1222
1222
  };
1223
1223
  }
1224
- function Ms({ selectedTheme: e, palette: t, primary: n }) {
1225
- const o = t != null && t.primary ? t.primary : n ? n === nt.primary.main ? nt.primary : xs(n, e) : nt.primary;
1224
+ function Rs({ selectedTheme: e, palette: t, primary: n }) {
1225
+ const o = t != null && t.primary ? t.primary : n ? n === nt.primary.main ? nt.primary : Is(n, e) : nt.primary;
1226
1226
  return {
1227
1227
  ...nt,
1228
1228
  primary: o,
1229
1229
  ...t
1230
1230
  };
1231
1231
  }
1232
- function Rs({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, r) {
1232
+ function Ls({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, r) {
1233
1233
  const s = r.primary.main, i = t ?? Pn(s), l = n ?? Ht.DEFAULT_BOT_MSG_BG, c = o ?? Pn(l);
1234
1234
  return {
1235
- colors: (e === "light" ? Is : ks)(
1235
+ colors: (e === "light" ? ks : Ms)(
1236
1236
  r,
1237
1237
  s,
1238
1238
  i,
@@ -1247,14 +1247,14 @@ function Rs({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, bot
1247
1247
  }
1248
1248
  };
1249
1249
  }
1250
- function Ls(e, t, n) {
1250
+ function Ds(e, t, n) {
1251
1251
  const o = { ...e };
1252
1252
  return n.forEach((r) => {
1253
1253
  const s = t[r];
1254
1254
  s != null && (o[r] = s);
1255
1255
  }), o;
1256
1256
  }
1257
- function Ds({ typography: e }) {
1257
+ function Ps({ typography: e }) {
1258
1258
  if (!e)
1259
1259
  return _t;
1260
1260
  const t = { ..._t };
@@ -1262,15 +1262,15 @@ function Ds({ typography: e }) {
1262
1262
  const o = e[n];
1263
1263
  if (o && typeof o == "object") {
1264
1264
  const r = _t[n], s = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
1265
- t[n] = Ls(r, o, s);
1265
+ t[n] = Ds(r, o, s);
1266
1266
  }
1267
1267
  }), t;
1268
1268
  }
1269
1269
  const {
1270
- Provider: Ps,
1271
- useContext: Os
1270
+ Provider: Os,
1271
+ useContext: Ns
1272
1272
  } = ne("AIAgentTheme");
1273
- function Ns({ logger: e, palette: t, typography: n, appearance: o, children: r }) {
1273
+ function Bs({ logger: e, palette: t, typography: n, appearance: o, children: r }) {
1274
1274
  const s = j(null), [i, l] = C(
1275
1275
  () => On({
1276
1276
  selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
@@ -1296,14 +1296,14 @@ function Ns({ logger: e, palette: t, typography: n, appearance: o, children: r }
1296
1296
  );
1297
1297
  return L(() => {
1298
1298
  (o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && c(i.selectedTheme);
1299
- }, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ a.createElement(Ps, { value: { theme: i, updateTheme: c } }, r);
1299
+ }, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ a.createElement(Os, { value: { theme: i, updateTheme: c } }, r);
1300
1300
  }
1301
- const yt = 25 * 1024 * 1024, Nn = 1, Bn = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg"]), Hn = /* @__PURE__ */ new Set(["application/pdf"]), Bs = {
1301
+ const yt = 25 * 1024 * 1024, Nn = 1, Bn = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/jpg"]), Hn = /* @__PURE__ */ new Set(["application/pdf"]), Hs = {
1302
1302
  off: "off",
1303
1303
  always: "always",
1304
1304
  handed_off_only: "handed_off_only"
1305
1305
  /* HANDED_OFF_ONLY */
1306
- }, Hs = () => {
1306
+ }, zs = () => {
1307
1307
  const [e, t] = C(() => ({
1308
1308
  maxAttachmentCount: Nn,
1309
1309
  attachmentMode: "handed_off_only",
@@ -1314,7 +1314,7 @@ const yt = 25 * 1024 * 1024, Nn = 1, Bn = /* @__PURE__ */ new Set(["image/png",
1314
1314
  })), n = w(({ active_channel: r, upload_restriction: s }) => {
1315
1315
  t({
1316
1316
  maxAttachmentCount: (s == null ? void 0 : s.max_attachment_count) ?? Nn,
1317
- attachmentMode: Bs[r.attachment_mode] ?? "handed_off_only",
1317
+ attachmentMode: Hs[r.attachment_mode] ?? "handed_off_only",
1318
1318
  defaultUploadSizeLimit: (s == null ? void 0 : s.default_upload_size_limit) ?? yt,
1319
1319
  uploadSizeLimitPerType: new Map(Object.entries((s == null ? void 0 : s.upload_size_limit_per_type) ?? [])),
1320
1320
  supportedImageMimeTypes: new Set(
@@ -1379,18 +1379,18 @@ function _o() {
1379
1379
  [e, t]
1380
1380
  );
1381
1381
  }
1382
- function zs() {
1382
+ function Us() {
1383
1383
  const { chatSDK: e, logger: t } = ee(), n = w(
1384
1384
  async (r, s, i) => {
1385
1385
  if (t.debug("useChatConnection.connect: start, session", r.userId), s) {
1386
1386
  const l = new Jo({
1387
1387
  ...s,
1388
- onSessionTokenRequired: Us(s.onSessionTokenRequired, i)
1388
+ onSessionTokenRequired: Fs(s.onSessionTokenRequired, i)
1389
1389
  });
1390
1390
  e.setSessionHandler(l), e.aiAgent.addEventHandler(Bt.EXTERNAL_AUTH_TOKEN_EXPIRED.toString(), (c) => {
1391
1391
  var d;
1392
1392
  t.debug("useChatConnection: EXTERNAL_AUTH_TOKEN_EXPIRED event received", c);
1393
- const u = ms(c);
1393
+ const u = gs(c);
1394
1394
  (u == null ? void 0 : u.category) === Bt.EXTERNAL_AUTH_TOKEN_EXPIRED && (t.debug("useChatConnection: calling onExternalAuthTokenExpired handler", u.data), (d = s == null ? void 0 : s.onExternalAuthTokenExpired) == null || d.call(s, u.data));
1395
1395
  });
1396
1396
  }
@@ -1399,7 +1399,7 @@ function zs() {
1399
1399
  } catch (l) {
1400
1400
  const c = l;
1401
1401
  if (e.isCacheEnabled) {
1402
- if ($s(c))
1402
+ if (js(c))
1403
1403
  t.warn("useChatConnection.connect", "offline connect restricted", c.message, c.code), t.warn("useChatConnection.connect", "clear cached-data"), await e.clearCachedData().catch((u) => t.warn("useChatConnection.connect", "clear cached-data failure", u));
1404
1404
  else if (e.currentUser)
1405
1405
  return t.debug("useChatConnection.connect: end (offline), currentUser", e.currentUser), e.currentUser;
@@ -1413,7 +1413,7 @@ function zs() {
1413
1413
  }, [e, t]);
1414
1414
  return { connect: n, disconnect: o };
1415
1415
  }
1416
- function Us(e, t) {
1416
+ function Fs(e, t) {
1417
1417
  if (e)
1418
1418
  return async (n, o) => {
1419
1419
  new Promise((r, s) => e == null ? void 0 : e(r, s)).then((r) => {
@@ -1423,14 +1423,14 @@ function Us(e, t) {
1423
1423
  });
1424
1424
  };
1425
1425
  }
1426
- const Fs = [400300, 400301, 400302, 400310];
1427
- function $s(e) {
1428
- return Fs.some((t) => e.code === t);
1426
+ const $s = [400300, 400301, 400302, 400310];
1427
+ function js(e) {
1428
+ return $s.some((t) => e.code === t);
1429
1429
  }
1430
- const js = 1440 * 60 * 1e3, Gs = (e) => {
1430
+ const Gs = 1440 * 60 * 1e3, Vs = (e) => {
1431
1431
  const { logger: t, cache: n } = ee(), o = () => {
1432
1432
  const s = n.messenger.getAnonUser();
1433
- return s ? s.expireAt - js <= Date.now() ? (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session expired, clear cache"), n.messenger.clear(s.userId), null) : (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session info detected"), s) : null;
1433
+ return s ? s.expireAt - Gs <= Date.now() ? (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session expired, clear cache"), n.messenger.clear(s.userId), null) : (t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session info detected"), s) : null;
1434
1434
  }, r = () => {
1435
1435
  if (!e || e instanceof Nt)
1436
1436
  throw new Error("userSessionInfo must be an instance of ManualSessionInfo");
@@ -1450,7 +1450,7 @@ const js = 1440 * 60 * 1e3, Gs = (e) => {
1450
1450
  n.messenger.clear
1451
1451
  ]);
1452
1452
  };
1453
- function Vs({
1453
+ function Ws({
1454
1454
  userSessionInfo: e,
1455
1455
  onUpdateMessengerSettings: t,
1456
1456
  onPreAuth: n,
@@ -1460,7 +1460,7 @@ function Vs({
1460
1460
  onPostDeauth: i,
1461
1461
  forceCreateChannel: l
1462
1462
  }) {
1463
- const { aiAgentId: c, language: u, context: d, countryCode: g, logger: m, cache: p, dispatcher: f } = ee(), { connect: E, disconnect: h } = zs(), { type: v, userSessionCandidate: _ } = Gs(e), b = _o(), S = w(async () => {
1463
+ const { aiAgentId: c, language: u, context: d, countryCode: g, logger: m, cache: p, dispatcher: f } = ee(), { connect: E, disconnect: h } = Us(), { type: v, userSessionCandidate: _ } = Vs(e), b = _o(), S = w(async () => {
1464
1464
  var Y;
1465
1465
  m.debug("useAuthentication.authenticate: start");
1466
1466
  const x = _ != null && _.userId ? p.messenger.getSettings(_.userId) : null;
@@ -1491,7 +1491,7 @@ function Vs({
1491
1491
  p.messenger.setSettings(q.userId, D), t(D);
1492
1492
  try {
1493
1493
  await n(D, q);
1494
- const V = v === "anonymous" ? Jr(f) : _ == null ? void 0 : _.sessionHandler;
1494
+ const V = v === "anonymous" ? Qr(f) : _ == null ? void 0 : _.sessionHandler;
1495
1495
  await E(q, V, s), await o(D, q);
1496
1496
  } catch (V) {
1497
1497
  throw V instanceof Error && (r(V), m.error("useAuthentication.authenticate: failed to connect", V)), V;
@@ -1526,7 +1526,7 @@ function Vs({
1526
1526
  userSessionCandidate: _
1527
1527
  };
1528
1528
  }
1529
- const Ws = () => {
1529
+ const qs = () => {
1530
1530
  const { chatSDK: e, logger: t, cache: n } = ee(), o = w(() => {
1531
1531
  var l, c;
1532
1532
  const s = (c = (l = e.appInfo) == null ? void 0 : l.aiAgentInfo) == null ? void 0 : c.templateListToken;
@@ -1537,7 +1537,7 @@ const Ws = () => {
1537
1537
  try {
1538
1538
  const { templates: s, token: i } = await e.aiAgent.getMessageTemplates({ limit: 20 });
1539
1539
  for (const { template: l } of s) {
1540
- const { key: c } = cs(l);
1540
+ const { key: c } = us(l);
1541
1541
  n.template.set(c, l);
1542
1542
  }
1543
1543
  n.template.setCachedToken(i);
@@ -1560,13 +1560,13 @@ const Ws = () => {
1560
1560
  ...e,
1561
1561
  context: e.context ?? {}
1562
1562
  }), {
1563
- Provider: qs,
1563
+ Provider: Ys,
1564
1564
  useContext: Ze
1565
- } = ne("AIAgentMessengerSession"), Ys = mt(
1565
+ } = ne("AIAgentMessengerSession"), Ks = mt(
1566
1566
  function({ userSessionInfo: e, forceCreateChannel: t, children: n }, o) {
1567
- const { appId: r, aiAgentId: s, chatSDK: i, language: l, countryCode: c, context: u, cache: d, logger: g } = ee(), { updateTheme: m } = Os(), [p, f] = C(void 0), [E, h] = C(void 0), [v, _] = C(null), [b, S] = C(null), [T, x] = C(null), [D, q] = C(null), [Y] = C(() => ({
1568
- initialRender: new rs((I, z) => i.aiAgent.appendStat(I, z))
1569
- })), { updateBaseAttachmentRules: V, createAttachmentRules: R } = Hs(), { shouldSyncCachedTemplate: $, syncCachedTemplates: A } = Ws(), H = _o(), { authenticate: K, deauthenticate: oe } = Vs({
1567
+ const { appId: r, aiAgentId: s, chatSDK: i, language: l, countryCode: c, context: u, cache: d, logger: g } = ee(), { updateTheme: m } = Ns(), [p, f] = C(void 0), [E, h] = C(void 0), [v, _] = C(null), [b, S] = C(null), [T, x] = C(null), [D, q] = C(null), [Y] = C(() => ({
1568
+ initialRender: new ss((I, z) => i.aiAgent.appendStat(I, z))
1569
+ })), { updateBaseAttachmentRules: V, createAttachmentRules: R } = zs(), { shouldSyncCachedTemplate: $, syncCachedTemplates: A } = qs(), H = _o(), { authenticate: K, deauthenticate: oe } = Ws({
1570
1570
  userSessionInfo: e,
1571
1571
  forceCreateChannel: t,
1572
1572
  onUpdateMessengerSettings: w(
@@ -1670,7 +1670,7 @@ const Ws = () => {
1670
1670
  for (; z.hasNext; ) {
1671
1671
  const ae = await z.next();
1672
1672
  for (const re of ae)
1673
- Ks(re.context ?? {}, I.context) && F.push(re.channelInfo.url);
1673
+ Xs(re.context ?? {}, I.context) && F.push(re.channelInfo.url);
1674
1674
  }
1675
1675
  return F;
1676
1676
  },
@@ -1695,7 +1695,7 @@ const Ws = () => {
1695
1695
  }
1696
1696
  }), L(() => () => {
1697
1697
  Te.cancel();
1698
- }, [Te]), er(o, () => {
1698
+ }, [Te]), tr(o, () => {
1699
1699
  const I = async () => {
1700
1700
  if (!E) throw new Error("No active conversation. Please start a conversation first.");
1701
1701
  return await i.groupChannel.getChannel(E.url);
@@ -1737,7 +1737,7 @@ const Ws = () => {
1737
1737
  }
1738
1738
  };
1739
1739
  }, [K, oe, E, i, s, g]), /* @__PURE__ */ a.createElement(
1740
- qs,
1740
+ Ys,
1741
1741
  {
1742
1742
  value: {
1743
1743
  sdkUser: v,
@@ -1760,8 +1760,8 @@ const Ws = () => {
1760
1760
  n
1761
1761
  );
1762
1762
  }
1763
- ), Ks = (e, t) => Object.entries(t).every(([n, o]) => e[n] === o), sn = (e, t) => {
1764
- const n = tr(), o = j(t);
1763
+ ), Xs = (e, t) => Object.entries(t).every(([n, o]) => e[n] === o), sn = (e, t) => {
1764
+ const n = nr(), o = j(t);
1765
1765
  me(() => {
1766
1766
  o.current = t;
1767
1767
  }), L(() => {
@@ -1800,8 +1800,8 @@ const Ws = () => {
1800
1800
  };
1801
1801
  }, [e, n]);
1802
1802
  };
1803
- function Xs(e) {
1804
- const { chatSDK: t, logger: n, aiAgentId: o } = ee(), { sdkUser: r, activeChannel: s, setActiveChannel: i, statsTrackers: l } = Ze(), c = cr(), [u, d] = C(void 0), [g, m] = C(void 0), [p, f] = C(!1);
1803
+ function Zs(e) {
1804
+ const { chatSDK: t, logger: n, aiAgentId: o } = ee(), { sdkUser: r, activeChannel: s, setActiveChannel: i, statsTrackers: l } = Ze(), c = ur(), [u, d] = C(void 0), [g, m] = C(void 0), [p, f] = C(!1);
1805
1805
  function E(v) {
1806
1806
  if (v.isAIAgent && !v.conversation) {
1807
1807
  f(!0);
@@ -1854,16 +1854,16 @@ function Xs(e) {
1854
1854
  isInitializingConversation: p
1855
1855
  };
1856
1856
  }
1857
- const Zs = (e) => {
1857
+ const Js = (e) => {
1858
1858
  const t = e == null ? void 0 : e.lastMessage, n = t == null ? void 0 : t.extendedMessagePayload;
1859
1859
  return n == null ? void 0 : n.user_input_disabled_by;
1860
- }, Js = (e) => {
1860
+ }, Qs = (e) => {
1861
1861
  var i;
1862
1862
  const t = e == null ? void 0 : e.lastMessage;
1863
1863
  if (!t || !e) return !1;
1864
1864
  const n = t.extendedMessagePayload, o = n == null ? void 0 : n.form, r = !!o && !o.submitted_at && !o.canceled_at, s = e.isAIAgent && !!((i = e.conversation) != null && i.handedOverAt);
1865
1865
  return r && !s;
1866
- }, Qs = () => {
1866
+ }, ea = () => {
1867
1867
  const { chatSDK: e, networkStateAdapter: t } = ee(), [n, o] = C(() => t ? t.isOnline() ? "connected" : "reconnecting" : "connected");
1868
1868
  return sn(e, {
1869
1869
  onConnected: () => o("connected"),
@@ -1874,11 +1874,15 @@ const Zs = (e) => {
1874
1874
  onConnectionLost: () => o("reconnecting")
1875
1875
  }), L(() => {
1876
1876
  if (t)
1877
- return t.subscribe(() => {
1878
- o("reconnecting");
1877
+ return t.subscribe((r) => {
1878
+ if (!r) {
1879
+ o("reconnecting");
1880
+ return;
1881
+ }
1882
+ o((s) => s === "reconnecting" && e.connectionState === Qo.OPEN ? "connected" : s);
1879
1883
  });
1880
- }, [t]), n;
1881
- }, ea = 3e4, ta = ({
1884
+ }, [t, e]), n;
1885
+ }, ta = 3e4, na = ({
1882
1886
  shouldApply: e,
1883
1887
  lastMessage: t,
1884
1888
  isBlockedWhileAIResponding: n,
@@ -1892,7 +1896,7 @@ const Zs = (e) => {
1892
1896
  i.current && clearTimeout(i.current), s(!0), i.current = setTimeout(() => {
1893
1897
  s(!1), i.current = null;
1894
1898
  }, m);
1895
- }, d = Date.now() - l, g = ea - d;
1899
+ }, d = Date.now() - l, g = ta - d;
1896
1900
  return n || g <= 0 ? c() : u(g), () => {
1897
1901
  i.current && clearTimeout(i.current);
1898
1902
  };
@@ -1907,25 +1911,25 @@ const Zs = (e) => {
1907
1911
  }
1908
1912
  }
1909
1913
  }), n;
1910
- }, na = ({ channel: e, lastMessage: t, aiAgentUserId: n, isStreamAnimating: o }) => {
1914
+ }, oa = ({ channel: e, lastMessage: t, aiAgentUserId: n, isStreamAnimating: o }) => {
1911
1915
  const [r, s] = C(!1), i = yo(e);
1912
1916
  return L(() => {
1913
1917
  if (!t) return;
1914
1918
  const l = i.some((u) => u.userId === n), c = Xe(t, n) && (ct.isStreaming(t) || o);
1915
1919
  s(c || l);
1916
1920
  }, [i, t, n, o]), r;
1917
- }, oa = ({
1921
+ }, ra = ({
1918
1922
  channel: e,
1919
1923
  messages: t,
1920
1924
  isStreamAnimating: n,
1921
1925
  isInitializingConversation: o
1922
1926
  }) => {
1923
- const { aiAgentInfo: r, userSession: s } = Ze(), i = Qs(), l = na({
1927
+ const { aiAgentInfo: r, userSession: s } = Ze(), i = ea(), l = oa({
1924
1928
  channel: e,
1925
1929
  lastMessage: xn(t, [lt.SUCCEEDED]),
1926
1930
  aiAgentUserId: (r == null ? void 0 : r.userId) ?? "",
1927
1931
  isStreamAnimating: n
1928
- }), c = ta({
1932
+ }), c = na({
1929
1933
  shouldApply: !!(e != null && e.isAIAgent) && !De(e),
1930
1934
  isBlockedWhileAIResponding: l,
1931
1935
  lastMessage: xn(t, [lt.PENDING, lt.SUCCEEDED]),
@@ -1937,11 +1941,11 @@ const Zs = (e) => {
1937
1941
  return { disabled: !0, disabledBy: "reconnecting" };
1938
1942
  if (ge(e))
1939
1943
  return { disabled: !0, disabledBy: "conversation_closed" };
1940
- if (Js(e))
1944
+ if (Qs(e))
1941
1945
  return { disabled: !0, disabledBy: "form_active" };
1942
- const u = Zs(e);
1946
+ const u = Js(e);
1943
1947
  return u ? { disabled: !0, disabledBy: u } : l || c || o ? { disabled: !0, disabledBy: "ai_responding" } : { disabled: !1, disabledBy: "" };
1944
- }, ra = () => {
1948
+ }, sa = () => {
1945
1949
  const [e, t] = C(/* @__PURE__ */ new Set()), n = w((r) => {
1946
1950
  t((s) => {
1947
1951
  if (s.has(r)) return s;
@@ -1961,9 +1965,9 @@ const Zs = (e) => {
1961
1965
  stop: o
1962
1966
  };
1963
1967
  }, {
1964
- Provider: sa
1968
+ Provider: aa
1965
1969
  } = ne("AIAgentConversation");
1966
- function aa({
1970
+ function ia({
1967
1971
  children: e,
1968
1972
  channelUrl: t,
1969
1973
  onChannelDeleted: n,
@@ -1978,15 +1982,15 @@ function aa({
1978
1982
  sortComparator: g
1979
1983
  }) {
1980
1984
  var V;
1981
- const m = () => u && (h == null ? void 0 : h.markAsRead()), { chatSDK: p, logger: f, dispatcher: E } = ee(), { channel: h, channelFetchError: v, getChannel: _, isInitializingConversation: b } = Xs(t), { statsTrackers: S } = Ze();
1985
+ const m = () => u && (h == null ? void 0 : h.markAsRead()), { chatSDK: p, logger: f, dispatcher: E } = ee(), { channel: h, channelFetchError: v, getChannel: _, isInitializingConversation: b } = Zs(t), { statsTrackers: S } = Ze();
1982
1986
  L(() => {
1983
1987
  if (t)
1984
1988
  return S.initialRender.setChannelUrl(t), () => {
1985
1989
  S.initialRender.cleanup();
1986
1990
  };
1987
1991
  }, [t, S]);
1988
- const T = Cs(p, h, {
1989
- replyType: hr.ONLY_REPLY_TO_CHANNEL,
1992
+ const T = Ss(p, h, {
1993
+ replyType: pr.ONLY_REPLY_TO_CHANNEL,
1990
1994
  shouldCountNewMessages: d,
1991
1995
  onChannelDeleted: n,
1992
1996
  onMessagesReceived: (R) => o == null ? void 0 : o(R),
@@ -1996,7 +2000,7 @@ function aa({
1996
2000
  logger: f,
1997
2001
  markAsRead: m,
1998
2002
  sortComparator: g
1999
- }), x = ra(), D = oa({
2003
+ }), x = sa(), D = ra({
2000
2004
  channel: h,
2001
2005
  messages: T.messages,
2002
2006
  isStreamAnimating: x.isAnimating,
@@ -2066,16 +2070,16 @@ function aa({
2066
2070
  input: D
2067
2071
  }
2068
2072
  };
2069
- return /* @__PURE__ */ a.createElement(sa, { value: Y }, e);
2073
+ return /* @__PURE__ */ a.createElement(aa, { value: Y }, e);
2070
2074
  }
2071
- function ia(e, t) {
2075
+ function la(e, t) {
2072
2076
  var p, f, E, h, v, _, b, S, T, x;
2073
2077
  const [n, o] = C(!1), [r, s] = C(null), [i, l] = C([]), [c, u] = C(null), d = j(!1), g = w(async () => {
2074
2078
  if (!d.current && e.currentUser) {
2075
2079
  d.current = !0, o(!1), s(null), l([]);
2076
2080
  try {
2077
2081
  c == null || c.dispose();
2078
- const D = new jr(e, t);
2082
+ const D = new Gr(e, t);
2079
2083
  D.setConversationListCollectionHandler({
2080
2084
  onChannelsAdded: () => {
2081
2085
  l(D.channels);
@@ -2126,9 +2130,9 @@ function ia(e, t) {
2126
2130
  };
2127
2131
  }
2128
2132
  const {
2129
- Provider: la
2133
+ Provider: ca
2130
2134
  } = ne("AIAgentConversationList");
2131
- function ca({
2135
+ function ua({
2132
2136
  conversationListLimit: e,
2133
2137
  conversationListFilter: t,
2134
2138
  children: n
@@ -2141,7 +2145,7 @@ function ca({
2141
2145
  ...i,
2142
2146
  ...(m = s == null ? void 0 : s.conversationListParams) == null ? void 0 : m.filter,
2143
2147
  ...t
2144
- }, u = ia(o, { limit: l, filter: c }), d = {
2148
+ }, u = la(o, { limit: l, filter: c }), d = {
2145
2149
  listSource: {
2146
2150
  initialized: u.initialized,
2147
2151
  error: u.error ?? void 0,
@@ -2149,9 +2153,9 @@ function ca({
2149
2153
  loadMore: () => u.loadMore()
2150
2154
  }
2151
2155
  };
2152
- return /* @__PURE__ */ a.createElement(la, { value: d }, n);
2156
+ return /* @__PURE__ */ a.createElement(ca, { value: d }, n);
2153
2157
  }
2154
- function ua(e) {
2158
+ function da(e) {
2155
2159
  let t = "pending", n = e.then((o) => {
2156
2160
  t = "resolved", n = o;
2157
2161
  }).catch((o) => {
@@ -2166,9 +2170,9 @@ function ua(e) {
2166
2170
  };
2167
2171
  }
2168
2172
  const {
2169
- Provider: da
2173
+ Provider: ma
2170
2174
  } = ne("MessageTemplateFetching");
2171
- function ma({ children: e, internalVariables: t }) {
2175
+ function ga({ children: e, internalVariables: t }) {
2172
2176
  const n = j({}), o = j({}), [r, s] = C({}), i = w((u, d) => {
2173
2177
  s((g) => ({
2174
2178
  ...g,
@@ -2200,7 +2204,7 @@ function ma({ children: e, internalVariables: t }) {
2200
2204
  suspend: (u, d) => {
2201
2205
  if (n.current[u])
2202
2206
  return n.current[u];
2203
- const g = ua(d());
2207
+ const g = da(d());
2204
2208
  return n.current[u] = g, g;
2205
2209
  },
2206
2210
  getIsFetching: (u) => {
@@ -2212,9 +2216,9 @@ function ma({ children: e, internalVariables: t }) {
2212
2216
  return ((d = r[u]) == null ? void 0 : d.error) ?? !1;
2213
2217
  }
2214
2218
  };
2215
- return /* @__PURE__ */ a.createElement(da, { value: c }, e);
2219
+ return /* @__PURE__ */ a.createElement(ma, { value: c }, e);
2216
2220
  }
2217
- const ga = "remove_powered_by", an = (e, t) => {
2221
+ const ha = "remove_powered_by", an = (e, t) => {
2218
2222
  var r, s;
2219
2223
  const { chatSDK: n } = ee(), { aiAgentInfo: o } = Ze();
2220
2224
  if (e === "handoff-button") {
@@ -2225,10 +2229,10 @@ const ga = "remove_powered_by", an = (e, t) => {
2225
2229
  return !!(t != null && t.isAIAgent) && !!(o != null && o.specialNoticeEnabled) && !!(o != null && o.specialNotice);
2226
2230
  if (e === "powered-by") {
2227
2231
  const i = (s = n == null ? void 0 : n.appInfo) == null ? void 0 : s.applicationAttributes;
2228
- return J(() => !(Array.isArray(i) && i.includes(ga)), [i]);
2232
+ return J(() => !(Array.isArray(i) && i.includes(ha)), [i]);
2229
2233
  }
2230
2234
  throw new Error("Unsupported feature");
2231
- }, ha = (e) => {
2235
+ }, pa = (e) => {
2232
2236
  const { aiAgentInfo: t } = Ze(), o = yo(e)[0];
2233
2237
  if (!o) return null;
2234
2238
  const r = o.userId === (t == null ? void 0 : t.userId);
@@ -2251,9 +2255,9 @@ const ga = "remove_powered_by", an = (e, t) => {
2251
2255
  }
2252
2256
  };
2253
2257
  return e.isAIAgent ? De(e) ? r.human("agent") : r.ai("delight") : e.isDesk ? r.human("agent") : r.channel("user");
2254
- }, zt = (e) => nr((t, n) => ({ ...t, ...n }), e);
2258
+ }, zt = (e) => or((t, n) => ({ ...t, ...n }), e);
2255
2259
  var ye = /* @__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))(ye || {});
2256
- const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csatPayload: e, type: t, initialCsat: n, initialCsatReason: o, initialIsResolved: r }) => {
2260
+ const fa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _a = ({ csatPayload: e, type: t, initialCsat: n, initialCsatReason: o, initialIsResolved: r }) => {
2257
2261
  const [s, i] = zt({
2258
2262
  csatType: t,
2259
2263
  csat: n,
@@ -2262,7 +2266,7 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2262
2266
  }), [l, c] = zt({ followUpItem: !1 }), u = J(() => {
2263
2267
  var h;
2264
2268
  const p = s.csat, f = typeof p == "number", E = (h = e.follow_up) == null ? void 0 : h.find((v) => f ? v.scores.includes(p) : v.always_visible ?? !1);
2265
- if (pa.has(E == null ? void 0 : E.response_type)) return E;
2269
+ if (fa.has(E == null ? void 0 : E.response_type)) return E;
2266
2270
  }, [s.csat, e.follow_up]), d = (() => {
2267
2271
  var p;
2268
2272
  if (typeof n == "number")
@@ -2291,7 +2295,7 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2291
2295
  submitted: d === "submitted"
2292
2296
  }
2293
2297
  };
2294
- }, bt = 5, _a = 250, ya = 50, Un = (e) => Math.max(0, e - ya), ba = (e) => e < 1e3 ? { speed: bt * 0.5, chunkSize: 2 } : e < 2e3 ? { speed: bt * 0.8, chunkSize: 2 } : { speed: bt * 0.6, chunkSize: 3 }, Ea = (e) => {
2298
+ }, bt = 5, ya = 250, ba = 50, Un = (e) => Math.max(0, e - ba), Ea = (e) => e < 1e3 ? { speed: bt * 0.5, chunkSize: 2 } : e < 2e3 ? { speed: bt * 0.8, chunkSize: 2 } : { speed: bt * 0.6, chunkSize: 3 }, va = (e) => {
2295
2299
  const { text: t, enabled: n = !1, onAnimationStart: o, onAnimationProgress: r, onAnimationComplete: s } = e, [i, l] = C(() => Un(t.length)), c = j(null), u = j({
2296
2300
  startTime: 0,
2297
2301
  lastUpdate: 0,
@@ -2320,8 +2324,8 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2320
2324
  const v = (_) => {
2321
2325
  var V;
2322
2326
  u.lastUpdate === 0 && (u.lastUpdate = _, u.startTime = _, u.lastProgressCall = _);
2323
- const b = m.textLength, S = _ - u.lastUpdate, T = _ - u.startTime, { speed: x, chunkSize: D } = ba(T), q = x * D;
2324
- S >= q && h < b && (h = Math.min(h + D, b), l(h), u.lastUpdate = _), _ - u.lastProgressCall >= _a && (u.lastProgressCall = _, (V = d.onProgress) == null || V.call(d)), (h < b || m.enabled) && (c.current = requestAnimationFrame(v));
2327
+ const b = m.textLength, S = _ - u.lastUpdate, T = _ - u.startTime, { speed: x, chunkSize: D } = Ea(T), q = x * D;
2328
+ S >= q && h < b && (h = Math.min(h + D, b), l(h), u.lastUpdate = _), _ - u.lastProgressCall >= ya && (u.lastProgressCall = _, (V = d.onProgress) == null || V.call(d)), (h < b || m.enabled) && (c.current = requestAnimationFrame(v));
2325
2329
  };
2326
2330
  return c.current = requestAnimationFrame(v), () => {
2327
2331
  c.current && cancelAnimationFrame(c.current);
@@ -2334,7 +2338,7 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2334
2338
  streamText: m.initialEnabled ? t.slice(0, i) : t,
2335
2339
  isAnimating: E
2336
2340
  };
2337
- }, va = "1.8.0", Eo = va, Ca = {
2341
+ }, Ca = "1.8.1", Eo = Ca, Sa = {
2338
2342
  conversation: {
2339
2343
  input_placeholder: "Ask a question",
2340
2344
  input_placeholder_disabled: "Chat is unavailable in this channel",
@@ -2404,9 +2408,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2404
2408
  }
2405
2409
  }, Ut = {
2406
2410
  language: "en",
2407
- strings: Ca,
2408
- dateLocale: Er
2409
- }, Sa = {
2411
+ strings: Sa,
2412
+ dateLocale: vr
2413
+ }, Aa = {
2410
2414
  conversation: {
2411
2415
  input_placeholder: "질문하기",
2412
2416
  input_placeholder_disabled: "이 채널에서는 채팅을 사용할 수 없습니다.",
@@ -2476,9 +2480,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2476
2480
  }
2477
2481
  }, Ft = {
2478
2482
  language: "ko",
2479
- strings: Sa,
2480
- dateLocale: wr
2481
- }, Aa = {
2483
+ strings: Aa,
2484
+ dateLocale: xr
2485
+ }, Ta = {
2482
2486
  conversation: {
2483
2487
  input_placeholder: "質問する",
2484
2488
  input_placeholder_disabled: "このチャンネルではチャットを利用できません",
@@ -2548,9 +2552,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2548
2552
  }
2549
2553
  }, $t = {
2550
2554
  language: "ja",
2551
- strings: Aa,
2552
- dateLocale: Tr
2553
- }, Ta = {
2555
+ strings: Ta,
2556
+ dateLocale: wr
2557
+ }, wa = {
2554
2558
  conversation: {
2555
2559
  input_placeholder: "Hacer una pregunta",
2556
2560
  input_placeholder_disabled: "El chat no está disponible en este canal",
@@ -2620,9 +2624,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2620
2624
  }
2621
2625
  }, jt = {
2622
2626
  language: "es",
2623
- strings: Ta,
2624
- dateLocale: vr
2625
- }, wa = {
2627
+ strings: wa,
2628
+ dateLocale: Cr
2629
+ }, xa = {
2626
2630
  conversation: {
2627
2631
  input_placeholder: "Fazer uma pergunta",
2628
2632
  input_placeholder_disabled: "O chat não está disponível neste canal",
@@ -2692,9 +2696,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2692
2696
  }
2693
2697
  }, Gt = {
2694
2698
  language: "pt",
2695
- strings: wa,
2696
- dateLocale: xr
2697
- }, xa = {
2699
+ strings: xa,
2700
+ dateLocale: Ir
2701
+ }, Ia = {
2698
2702
  conversation: {
2699
2703
  input_placeholder: "Poser une question",
2700
2704
  input_placeholder_disabled: "Le chat n'est pas disponible dans ce canal",
@@ -2764,9 +2768,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2764
2768
  }
2765
2769
  }, Vt = {
2766
2770
  language: "fr",
2767
- strings: xa,
2768
- dateLocale: Cr
2769
- }, Ia = {
2771
+ strings: Ia,
2772
+ dateLocale: Sr
2773
+ }, ka = {
2770
2774
  conversation: {
2771
2775
  input_placeholder: "एक प्रश्न पूछें",
2772
2776
  input_placeholder_disabled: "इस चैनल में चैट उपलब्ध नहीं है",
@@ -2836,9 +2840,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2836
2840
  }
2837
2841
  }, Wt = {
2838
2842
  language: "hi",
2839
- strings: Ia,
2840
- dateLocale: Sr
2841
- }, ka = {
2843
+ strings: ka,
2844
+ dateLocale: Ar
2845
+ }, Ma = {
2842
2846
  conversation: {
2843
2847
  input_placeholder: "Fai una domanda",
2844
2848
  input_placeholder_disabled: "La chat non è disponibile in questo canale",
@@ -2908,9 +2912,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2908
2912
  }
2909
2913
  }, qt = {
2910
2914
  language: "it",
2911
- strings: ka,
2912
- dateLocale: Ar
2913
- }, Ma = {
2915
+ strings: Ma,
2916
+ dateLocale: Tr
2917
+ }, Ra = {
2914
2918
  conversation: {
2915
2919
  input_placeholder: "Eine Frage stellen",
2916
2920
  input_placeholder_disabled: "Chat ist in diesem Kanal nicht verfügbar",
@@ -2980,9 +2984,9 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
2980
2984
  }
2981
2985
  }, Yt = {
2982
2986
  language: "de",
2983
- strings: Ma,
2984
- dateLocale: br
2985
- }, Ra = {
2987
+ strings: Ra,
2988
+ dateLocale: Er
2989
+ }, La = {
2986
2990
  conversation: {
2987
2991
  input_placeholder: "Bir soru sor",
2988
2992
  input_placeholder_disabled: "Bu kanalda sohbet mevcut değil",
@@ -3052,8 +3056,8 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
3052
3056
  }
3053
3057
  }, Kt = {
3054
3058
  language: "tr",
3055
- strings: Ra,
3056
- dateLocale: Ir
3059
+ strings: La,
3060
+ dateLocale: kr
3057
3061
  }, he = (e) => ({
3058
3062
  conversation: e.conversation,
3059
3063
  conversation_list: e.conversation_list,
@@ -3071,24 +3075,24 @@ const pa = /* @__PURE__ */ new Set(["free_text", "single_choice"]), fa = ({ csat
3071
3075
  }, y = ({ debug: e = !1, style: t, children: n, ...o }) => /* @__PURE__ */ a.createElement(Ie, { style: [t, o, e && ln], ...o }, n);
3072
3076
  y.Animated = ({ debug: e = !1, style: t, children: n, ...o }) => /* @__PURE__ */ a.createElement(N.View, { style: [t, o, e && ln], ...o }, n);
3073
3077
  const {
3074
- Provider: La,
3078
+ Provider: Da,
3075
3079
  useContext: ue
3076
- } = ne("MessengerSession"), Da = mt(function({ children: e, ...t }, n) {
3080
+ } = ne("MessengerSession"), Pa = mt(function({ children: e, ...t }, n) {
3077
3081
  if (!t.userSessionInfo || !(t.userSessionInfo instanceof Nt || t.userSessionInfo instanceof go))
3078
3082
  throw new Error(`Invalid userSessionInfo: ${t.userSessionInfo}`);
3079
- return /* @__PURE__ */ a.createElement(Ys, { ref: n, ...t }, (o) => /* @__PURE__ */ a.createElement(Pa, { ...o }, e));
3080
- }), Pa = ({ children: e, ...t }) => {
3083
+ return /* @__PURE__ */ a.createElement(Ks, { ref: n, ...t }, (o) => /* @__PURE__ */ a.createElement(Oa, { ...o }, e));
3084
+ }), Oa = ({ children: e, ...t }) => {
3081
3085
  const { dispatcher: n } = ee(), { userSession: o, aiAgentInfo: r, launcherInfo: s, deauthenticate: i } = t;
3082
3086
  return L(() => {
3083
3087
  const l = () => {
3084
3088
  ke.alert("Session timed out", "Start a new conversation.", [{ text: "OK", onPress: () => i() }]);
3085
3089
  };
3086
3090
  return n.subscribe(We.AnonymousSessionTokenExpired, l), () => n.unsubscribe(We.AnonymousSessionTokenExpired, l);
3087
- }, [n, i]), /* @__PURE__ */ a.createElement(La, { value: { ...t, userSession: o, aiAgentInfo: r, launcherInfo: s } }, e);
3091
+ }, [n, i]), /* @__PURE__ */ a.createElement(Da, { value: { ...t, userSession: o, aiAgentInfo: r, launcherInfo: s } }, e);
3088
3092
  }, ot = 50, {
3089
- Provider: Oa,
3090
- useContext: Na
3091
- } = ne("ConversationScroll"), Ba = ({ children: e }) => {
3093
+ Provider: Na,
3094
+ useContext: Ba
3095
+ } = ne("ConversationScroll"), Ha = ({ children: e }) => {
3092
3096
  var A;
3093
3097
  const { config: t } = ee(), n = ((A = t == null ? void 0 : t.conversation) == null ? void 0 : A.scrollMode) ?? "auto", o = j(null), r = j({
3094
3098
  viewport: 0,
@@ -3134,7 +3138,7 @@ const {
3134
3138
  p(H);
3135
3139
  }, []), V = c <= ot, R = d && !V, $ = w(() => s.current > ot, []);
3136
3140
  return /* @__PURE__ */ a.createElement(
3137
- Oa,
3141
+ Na,
3138
3142
  {
3139
3143
  value: {
3140
3144
  ref: o,
@@ -3175,14 +3179,14 @@ function vo(e) {
3175
3179
  );
3176
3180
  });
3177
3181
  }
3178
- async function Ha(e) {
3182
+ async function za(e) {
3179
3183
  var t;
3180
3184
  if ("file" in e && e.file && typeof e.file == "object") {
3181
3185
  const n = e.file;
3182
3186
  if (n.uri && ((t = n.type) != null && t.startsWith("image/")))
3183
3187
  try {
3184
3188
  const { width: o, height: r } = await vo(n.uri);
3185
- return new pr({
3189
+ return new fr({
3186
3190
  key: ao,
3187
3191
  value: [o, r]
3188
3192
  });
@@ -3191,15 +3195,15 @@ async function Ha(e) {
3191
3195
  }
3192
3196
  }
3193
3197
  }
3194
- function za(e, t) {
3198
+ function Ua(e, t) {
3195
3199
  let n = 0, o = 0;
3196
3200
  return de(e) && e.sendingStatus !== "succeeded" && (n = Number.MAX_SAFE_INTEGER), de(t) && t.sendingStatus !== "succeeded" && (o = Number.MAX_SAFE_INTEGER), t.createdAt + o - (e.createdAt + n);
3197
3201
  }
3198
3202
  const {
3199
- Provider: Ua,
3200
- Context: gd,
3203
+ Provider: Fa,
3204
+ Context: hd,
3201
3205
  useContext: ve
3202
- } = ne("Conversation"), Fa = (e) => /* @__PURE__ */ a.createElement(Ba, null, /* @__PURE__ */ a.createElement($a, { ...e })), $a = ({
3206
+ } = ne("Conversation"), $a = (e) => /* @__PURE__ */ a.createElement(Ha, null, /* @__PURE__ */ a.createElement(ja, { ...e })), ja = ({
3203
3207
  channelUrl: e,
3204
3208
  onClearChannelUrl: t,
3205
3209
  onClose: n,
@@ -3207,14 +3211,14 @@ const {
3207
3211
  shouldMarkAsRead: r,
3208
3212
  children: s
3209
3213
  }) => {
3210
- const i = Na(), { activeChannel: l, refreshActiveChannel: c, sdkUser: u, authenticate: d } = ue();
3214
+ const i = Ba(), { activeChannel: l, refreshActiveChannel: c, sdkUser: u, authenticate: d } = ue();
3211
3215
  L(() => {
3212
3216
  u || d();
3213
3217
  }, []);
3214
3218
  const g = w(
3215
3219
  async (E) => {
3216
3220
  i.actions.onBeforeMessageSend();
3217
- const h = await Ha(E);
3221
+ const h = await za(E);
3218
3222
  return {
3219
3223
  ...E,
3220
3224
  metaArrays: h ? [h] : void 0
@@ -3227,7 +3231,7 @@ const {
3227
3231
  await c(), e && (t == null || t());
3228
3232
  }, [c, e, t]), f = e ?? (l == null ? void 0 : l.url);
3229
3233
  return /* @__PURE__ */ a.createElement(
3230
- aa,
3234
+ ia,
3231
3235
  {
3232
3236
  key: f,
3233
3237
  channelUrl: f,
@@ -3237,13 +3241,13 @@ const {
3237
3241
  onMessagesReceived: i.actions.onStreamingUpdate,
3238
3242
  onChannelDeleted: p,
3239
3243
  onConversationClosedStatusChanged: i.actions.onConversationClosed,
3240
- sortComparator: za,
3244
+ sortComparator: Ua,
3241
3245
  shouldMarkAsRead: r,
3242
3246
  shouldCountNewMessages: i.state.shouldCountNewMessages
3243
3247
  },
3244
- (E) => /* @__PURE__ */ a.createElement(Ua, { value: { ...E, scrollSource: i, onClose: n, onNavigateToConversationList: o, updateActiveChannel: p } }, s)
3248
+ (E) => /* @__PURE__ */ a.createElement(Fa, { value: { ...E, scrollSource: i, onClose: n, onNavigateToConversationList: o, updateActiveChannel: p } }, s)
3245
3249
  );
3246
- }, Et = he(Yt.strings), ja = {
3250
+ }, Et = he(Yt.strings), Ga = {
3247
3251
  ...Et,
3248
3252
  conversation: {
3249
3253
  ...Et.conversation,
@@ -3257,11 +3261,11 @@ const {
3257
3261
  conversation_list: {
3258
3262
  ...Et.conversation_list
3259
3263
  }
3260
- }, Ga = {
3264
+ }, Va = {
3261
3265
  language: Yt.language,
3262
3266
  dateLocale: Yt.dateLocale,
3263
- strings: ja
3264
- }, vt = he(Ut.strings), Va = {
3267
+ strings: Ga
3268
+ }, vt = he(Ut.strings), Wa = {
3265
3269
  ...vt,
3266
3270
  conversation: {
3267
3271
  ...vt.conversation,
@@ -3275,11 +3279,11 @@ const {
3275
3279
  conversation_list: {
3276
3280
  ...vt.conversation_list
3277
3281
  }
3278
- }, Wa = {
3282
+ }, qa = {
3279
3283
  language: Ut.language,
3280
3284
  dateLocale: Ut.dateLocale,
3281
- strings: Va
3282
- }, Ct = he(jt.strings), qa = {
3285
+ strings: Wa
3286
+ }, Ct = he(jt.strings), Ya = {
3283
3287
  ...Ct,
3284
3288
  conversation: {
3285
3289
  ...Ct.conversation,
@@ -3293,11 +3297,11 @@ const {
3293
3297
  conversation_list: {
3294
3298
  ...Ct.conversation_list
3295
3299
  }
3296
- }, Ya = {
3300
+ }, Ka = {
3297
3301
  language: jt.language,
3298
3302
  dateLocale: jt.dateLocale,
3299
- strings: qa
3300
- }, St = he(Vt.strings), Ka = {
3303
+ strings: Ya
3304
+ }, St = he(Vt.strings), Xa = {
3301
3305
  ...St,
3302
3306
  conversation: {
3303
3307
  ...St.conversation,
@@ -3311,11 +3315,11 @@ const {
3311
3315
  conversation_list: {
3312
3316
  ...St.conversation_list
3313
3317
  }
3314
- }, Xa = {
3318
+ }, Za = {
3315
3319
  language: Vt.language,
3316
3320
  dateLocale: Vt.dateLocale,
3317
- strings: Ka
3318
- }, At = he(Wt.strings), Za = {
3321
+ strings: Xa
3322
+ }, At = he(Wt.strings), Ja = {
3319
3323
  ...At,
3320
3324
  conversation: {
3321
3325
  ...At.conversation,
@@ -3329,11 +3333,11 @@ const {
3329
3333
  conversation_list: {
3330
3334
  ...At.conversation_list
3331
3335
  }
3332
- }, Ja = {
3336
+ }, Qa = {
3333
3337
  language: Wt.language,
3334
3338
  dateLocale: Wt.dateLocale,
3335
- strings: Za
3336
- }, Tt = he(qt.strings), Qa = {
3339
+ strings: Ja
3340
+ }, Tt = he(qt.strings), ei = {
3337
3341
  ...Tt,
3338
3342
  conversation: {
3339
3343
  ...Tt.conversation,
@@ -3347,11 +3351,11 @@ const {
3347
3351
  conversation_list: {
3348
3352
  ...Tt.conversation_list
3349
3353
  }
3350
- }, ei = {
3354
+ }, ti = {
3351
3355
  language: qt.language,
3352
3356
  dateLocale: qt.dateLocale,
3353
- strings: Qa
3354
- }, wt = he($t.strings), ti = {
3357
+ strings: ei
3358
+ }, wt = he($t.strings), ni = {
3355
3359
  ...wt,
3356
3360
  conversation: {
3357
3361
  ...wt.conversation,
@@ -3365,11 +3369,11 @@ const {
3365
3369
  conversation_list: {
3366
3370
  ...wt.conversation_list
3367
3371
  }
3368
- }, ni = {
3372
+ }, oi = {
3369
3373
  language: $t.language,
3370
3374
  dateLocale: $t.dateLocale,
3371
- strings: ti
3372
- }, xt = he(Ft.strings), oi = {
3375
+ strings: ni
3376
+ }, xt = he(Ft.strings), ri = {
3373
3377
  ...xt,
3374
3378
  conversation: {
3375
3379
  ...xt.conversation,
@@ -3383,11 +3387,11 @@ const {
3383
3387
  conversation_list: {
3384
3388
  ...xt.conversation_list
3385
3389
  }
3386
- }, ri = {
3390
+ }, si = {
3387
3391
  language: Ft.language,
3388
3392
  dateLocale: Ft.dateLocale,
3389
- strings: oi
3390
- }, It = he(Gt.strings), si = {
3393
+ strings: ri
3394
+ }, It = he(Gt.strings), ai = {
3391
3395
  ...It,
3392
3396
  conversation: {
3393
3397
  ...It.conversation,
@@ -3401,11 +3405,11 @@ const {
3401
3405
  conversation_list: {
3402
3406
  ...It.conversation_list
3403
3407
  }
3404
- }, ai = {
3408
+ }, ii = {
3405
3409
  language: Gt.language,
3406
3410
  dateLocale: Gt.dateLocale,
3407
- strings: si
3408
- }, kt = he(Kt.strings), ii = {
3411
+ strings: ai
3412
+ }, kt = he(Kt.strings), li = {
3409
3413
  ...kt,
3410
3414
  conversation: {
3411
3415
  ...kt.conversation,
@@ -3419,22 +3423,22 @@ const {
3419
3423
  conversation_list: {
3420
3424
  ...kt.conversation_list
3421
3425
  }
3422
- }, li = {
3426
+ }, ci = {
3423
3427
  language: Kt.language,
3424
3428
  dateLocale: Kt.dateLocale,
3425
- strings: ii
3429
+ strings: li
3426
3430
  }, $n = /* @__PURE__ */ new Map([
3427
- ["en", Wa],
3428
- ["ko", ri],
3429
- ["ja", ni],
3430
- ["es", Ya],
3431
- ["pt", ai],
3432
- ["fr", Xa],
3433
- ["hi", Ja],
3434
- ["it", ei],
3435
- ["de", Ga],
3436
- ["tr", li]
3437
- ]), jn = (e) => $n.get(e) ?? $n.get(pt), ci = (e, t) => t ? {
3431
+ ["en", qa],
3432
+ ["ko", si],
3433
+ ["ja", oi],
3434
+ ["es", Ka],
3435
+ ["pt", ii],
3436
+ ["fr", Za],
3437
+ ["hi", Qa],
3438
+ ["it", ti],
3439
+ ["de", Va],
3440
+ ["tr", ci]
3441
+ ]), jn = (e) => $n.get(e) ?? $n.get(pt), ui = (e, t) => t ? {
3438
3442
  conversation: {
3439
3443
  ...e.conversation,
3440
3444
  ...t.conversation
@@ -3464,9 +3468,9 @@ const {
3464
3468
  ...t.feedback
3465
3469
  }
3466
3470
  } : e, {
3467
- Provider: ui,
3471
+ Provider: di,
3468
3472
  useContext: G
3469
- } = ne("Localization"), di = ({
3473
+ } = ne("Localization"), mi = ({
3470
3474
  language: e = pt,
3471
3475
  logger: t,
3472
3476
  strings: n,
@@ -3484,22 +3488,22 @@ const {
3484
3488
  s(c), (l = t == null ? void 0 : t.info) == null || l.call(t, "Language changed", { from: r.language, to: c.language });
3485
3489
  }
3486
3490
  }, [e, t]), /* @__PURE__ */ a.createElement(
3487
- ui,
3491
+ di,
3488
3492
  {
3489
3493
  value: {
3490
3494
  language: r.language,
3491
- strings: ci(r.strings, n),
3495
+ strings: ui(r.strings, n),
3492
3496
  dateLocale: r.dateLocale,
3493
- format: (i, l, c) => gr(i, l, { locale: r.dateLocale, ...c })
3497
+ format: (i, l, c) => hr(i, l, { locale: r.dateLocale, ...c })
3494
3498
  }
3495
3499
  },
3496
3500
  o
3497
3501
  );
3498
3502
  }, {
3499
- Provider: mi,
3503
+ Provider: gi,
3500
3504
  useContext: cn
3501
3505
  } = ne("Modal");
3502
- function gi({ children: e }) {
3506
+ function hi({ children: e }) {
3503
3507
  const [t, n] = C([]), [o, r] = C(null), s = j(0);
3504
3508
  L(() => {
3505
3509
  if (!o && t.length > 0) {
@@ -3520,7 +3524,7 @@ function gi({ children: e }) {
3520
3524
  openModal: i,
3521
3525
  currentModal: o
3522
3526
  };
3523
- return /* @__PURE__ */ a.createElement(mi, { value: c }, e, o && /* @__PURE__ */ a.createElement(
3527
+ return /* @__PURE__ */ a.createElement(gi, { value: c }, e, o && /* @__PURE__ */ a.createElement(
3524
3528
  jo,
3525
3529
  {
3526
3530
  visible: !0,
@@ -3534,13 +3538,13 @@ function gi({ children: e }) {
3534
3538
  ));
3535
3539
  }
3536
3540
  const {
3537
- Provider: hi,
3541
+ Provider: pi,
3538
3542
  useContext: W
3539
- } = ne("MessengerTheme"), pi = ({ children: e, ...t }) => /* @__PURE__ */ a.createElement(Ns, { ...t, appearance: { theme: t.mode ?? "light" } }, (n) => {
3540
- const o = fi(n.theme);
3541
- return /* @__PURE__ */ a.createElement(hi, { value: { ...n, themedColor: o } }, e);
3543
+ } = ne("MessengerTheme"), fi = ({ children: e, ...t }) => /* @__PURE__ */ a.createElement(Bs, { ...t, appearance: { theme: t.mode ?? "light" } }, (n) => {
3544
+ const o = _i(n.theme);
3545
+ return /* @__PURE__ */ a.createElement(pi, { value: { ...n, themedColor: o } }, e);
3542
3546
  });
3543
- function fi(e) {
3547
+ function _i(e) {
3544
3548
  const t = (n) => n[e.selectedTheme];
3545
3549
  return {
3546
3550
  textHighEmphasis: t({
@@ -3627,7 +3631,7 @@ const O = {
3627
3631
  }
3628
3632
  };
3629
3633
  }
3630
- }, _i = {
3634
+ }, yi = {
3631
3635
  ltr: {
3632
3636
  left: "paddingStart",
3633
3637
  right: "paddingEnd",
@@ -3644,12 +3648,12 @@ const O = {
3644
3648
  const n = gt();
3645
3649
  return e.reduce(
3646
3650
  (o, r) => {
3647
- const s = _i[t][r];
3651
+ const s = yi[t][r];
3648
3652
  return o[s] = n[r], o;
3649
3653
  },
3650
3654
  {}
3651
3655
  );
3652
- }, yi = {
3656
+ }, bi = {
3653
3657
  send: require("./icons/icon-send.png"),
3654
3658
  close: require("./icons/icon-close.png"),
3655
3659
  menu: require("./icons/icon-menu.png"),
@@ -3680,7 +3684,7 @@ const O = {
3680
3684
  "bad-filled": require("./icons/icon-bad-filled.png"),
3681
3685
  delight: require("./icons/icon-delight.png"),
3682
3686
  "thumbnail-none": require("./icons/icon-thumbnail-none.png")
3683
- }, bi = {
3687
+ }, Ei = {
3684
3688
  send: !0,
3685
3689
  chat: !0,
3686
3690
  message: !0,
@@ -3689,16 +3693,16 @@ const O = {
3689
3693
  "good-filled": !0,
3690
3694
  "bad-filled": !0
3691
3695
  }, U = ({ customSource: e, type: t, color: n, size: o = 24, style: r }) => {
3692
- const s = Ei.use(), i = Ve.isRTL && !!bi[t];
3696
+ const s = vi.use(), i = Ve.isRTL && !!Ei[t];
3693
3697
  return /* @__PURE__ */ a.createElement(y, { alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ a.createElement(
3694
3698
  Ye,
3695
3699
  {
3696
3700
  resizeMode: "contain",
3697
- source: e ?? yi[t],
3701
+ source: e ?? bi[t],
3698
3702
  style: [s.icon({ color: n, size: o, mirror: i }), r]
3699
3703
  }
3700
3704
  ));
3701
- }, Ei = O.create(({ theme: e, themedColor: t }) => ({
3705
+ }, vi = O.create(({ theme: e, themedColor: t }) => ({
3702
3706
  icon: (n) => ({
3703
3707
  tintColor: typeof n.color == "function" ? n.color({ theme: e, themedColor: t }) : n.color ?? e.colors.base.primary,
3704
3708
  width: n.size,
@@ -3712,16 +3716,16 @@ const O = {
3712
3716
  if (n.length === 0)
3713
3717
  return !1;
3714
3718
  const o = e === "start" ? Array.from(n)[0] : Array.from(n).pop(), r = o == null ? void 0 : o.codePointAt(0);
3715
- return r === void 0 ? !1 : Si(r);
3716
- }, Co = (e) => un("start", e), vi = (e) => un("end", e), Ci = (e) => {
3719
+ return r === void 0 ? !1 : Ai(r);
3720
+ }, Co = (e) => un("start", e), Ci = (e) => un("end", e), Si = (e) => {
3717
3721
  const { text: t, style: n, isTextInput: o } = e;
3718
3722
  return n != null && n.textAlign && n.textAlign !== "left" && n.textAlign !== "right" ? n.textAlign : Ve.isRTL && typeof t == "string" && Co(t) ? o ? "right" : Ve.doLeftAndRightSwapInRTL ? "left" : "right" : n == null ? void 0 : n.textAlign;
3719
- }, Si = (e) => {
3720
- for (const [t, n] of Ai)
3723
+ }, Ai = (e) => {
3724
+ for (const [t, n] of Ti)
3721
3725
  if (e >= t && e <= n)
3722
3726
  return !0;
3723
3727
  return !1;
3724
- }, Ai = [
3728
+ }, Ti = [
3725
3729
  [1424, 1535],
3726
3730
  // Hebrew
3727
3731
  [1536, 1791],
@@ -3738,9 +3742,9 @@ const O = {
3738
3742
  // Arabic Mathematical Alphabetic Symbols
3739
3743
  ], dn = {
3740
3744
  isStartsWithRTL: Co,
3741
- isEndsWithRTL: vi,
3745
+ isEndsWithRTL: Ci,
3742
3746
  isRTLString: un,
3743
- useTextAlign: Ci
3747
+ useTextAlign: Si
3744
3748
  }, M = ({ variant: e = "body1", color: t, style: n, ...o }) => {
3745
3749
  const { theme: r, themedColor: s } = W(), i = J(() => {
3746
3750
  if (typeof t == "function")
@@ -3757,7 +3761,7 @@ const O = {
3757
3761
  ]);
3758
3762
  }, [e, i, r.typography, s.textHighEmphasis]), c = dn.useTextAlign({ text: o.children, style: l });
3759
3763
  return /* @__PURE__ */ a.createElement(Dt, { style: [l, { textAlign: c }], ...o });
3760
- }, So = 350, Ti = ({ children: e, ...t }) => /* @__PURE__ */ a.createElement(Jt, { disabled: !t.onPress && !t.onLongPress, delayLongPress: So, ...t }, (n) => typeof e == "function" ? e(n) : e), wi = ({ children: e, style: t, ...n }) => {
3764
+ }, So = 350, wi = ({ children: e, ...t }) => /* @__PURE__ */ a.createElement(Jt, { disabled: !t.onPress && !t.onLongPress, delayLongPress: So, ...t }, (n) => typeof e == "function" ? e(n) : e), xi = ({ children: e, style: t, ...n }) => {
3761
3765
  const [o, r] = C(!1), s = { pressed: o };
3762
3766
  return /* @__PURE__ */ a.createElement(
3763
3767
  Go,
@@ -3771,11 +3775,11 @@ const O = {
3771
3775
  },
3772
3776
  typeof e == "function" ? e(s) : e
3773
3777
  );
3774
- }, B = (e) => e.activeOpacity && e.activeOpacity < 1 ? /* @__PURE__ */ a.createElement(wi, { ...e }) : /* @__PURE__ */ a.createElement(Ti, { ...e }), {
3775
- Provider: xi,
3778
+ }, B = (e) => e.activeOpacity && e.activeOpacity < 1 ? /* @__PURE__ */ a.createElement(xi, { ...e }) : /* @__PURE__ */ a.createElement(wi, { ...e }), {
3779
+ Provider: Ii,
3776
3780
  useContext: Ao
3777
3781
  } = ne("BottomSheetAnimation");
3778
- function Ii({ onClose: e, children: t }) {
3782
+ function ki({ onClose: e, children: t }) {
3779
3783
  const n = j(new N.Value(500)).current;
3780
3784
  L(() => {
3781
3785
  N.timing(n, {
@@ -3820,9 +3824,9 @@ function Ii({ onClose: e, children: t }) {
3820
3824
  }
3821
3825
  })
3822
3826
  ).current;
3823
- return /* @__PURE__ */ a.createElement(xi, { value: { wrapWithAnimation: o, translateY: n, panHandlers: r.panHandlers } }, t);
3827
+ return /* @__PURE__ */ a.createElement(Ii, { value: { wrapWithAnimation: o, translateY: n, panHandlers: r.panHandlers } }, t);
3824
3828
  }
3825
- const ki = ({
3829
+ const Mi = ({
3826
3830
  icon: e,
3827
3831
  label: t = "",
3828
3832
  destructive: n = !1,
@@ -3830,17 +3834,17 @@ const ki = ({
3830
3834
  }) => {
3831
3835
  const r = To.use(), { themedColor: s } = W();
3832
3836
  return /* @__PURE__ */ a.createElement(B, { onPress: o, style: r.actionItem, activeOpacity: 0.75 }, e && /* @__PURE__ */ a.createElement(U, { type: e, size: 24, color: s.primary }), /* @__PURE__ */ a.createElement(M, { variant: "body3", color: n ? s.error : s.textHighEmphasis, numberOfLines: 1 }, t));
3833
- }, Mi = ({ onClose: e, children: t }) => {
3837
+ }, Ri = ({ onClose: e, children: t }) => {
3834
3838
  const n = To.use(), { translateY: o, panHandlers: r, wrapWithAnimation: s } = Ao(), i = Oe(["left", "right"]);
3835
3839
  return /* @__PURE__ */ a.createElement(B, { onPress: s(e), style: n.overlay }, /* @__PURE__ */ a.createElement(y.Animated, { style: [n.container, i, { transform: [{ translateY: o }] }], ...r }, t));
3836
3840
  }, mn = ce({
3837
- template: Mi,
3841
+ template: Ri,
3838
3842
  components: {
3839
- ActionItem: ki
3843
+ ActionItem: Mi
3840
3844
  }
3841
3845
  }), le = (e) => {
3842
3846
  const { Template: t } = mn.useContext();
3843
- return /* @__PURE__ */ a.createElement(Ii, { onClose: e.onClose }, /* @__PURE__ */ a.createElement(t, { ...e }));
3847
+ return /* @__PURE__ */ a.createElement(ki, { onClose: e.onClose }, /* @__PURE__ */ a.createElement(t, { ...e }));
3844
3848
  };
3845
3849
  le.ActionItem = (e) => {
3846
3850
  const { components: t } = mn.useContext(), { wrapWithAnimation: n } = Ao();
@@ -3867,8 +3871,8 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
3867
3871
  gap: 24,
3868
3872
  paddingHorizontal: 16
3869
3873
  }
3870
- })), Ri = ({ style: e, label: t, accessibilityLabel: n, onPress: o }) => {
3871
- const r = Li.use(), { theme: s } = W();
3874
+ })), Li = ({ style: e, label: t, accessibilityLabel: n, onPress: o }) => {
3875
+ const r = Di.use(), { theme: s } = W();
3872
3876
  return /* @__PURE__ */ a.createElement(
3873
3877
  B,
3874
3878
  {
@@ -3879,7 +3883,7 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
3879
3883
  },
3880
3884
  /* @__PURE__ */ a.createElement(y, { flexDirection: "row", alignItems: "center", gap: 4 }, /* @__PURE__ */ a.createElement(M, { variant: "button", color: s.colors.base.primaryContrastContent }, t), /* @__PURE__ */ a.createElement(U, { size: 16, type: "chevron-down", color: s.colors.base.primaryContrastContent }))
3881
3885
  );
3882
- }, Li = O.create(({ theme: e }) => ({
3886
+ }, Di = O.create(({ theme: e }) => ({
3883
3887
  button: {
3884
3888
  flexDirection: "row",
3885
3889
  alignItems: "center",
@@ -3897,7 +3901,7 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
3897
3901
  })), gn = ({ iconSize: e = 64, icon: t, style: n, label: o, children: r }) => {
3898
3902
  const { themedColor: s } = W();
3899
3903
  return /* @__PURE__ */ a.createElement(y, { style: [wo.body, n] }, t && /* @__PURE__ */ a.createElement(U, { type: t, size: e, color: s.textLowEmphasis }), o && /* @__PURE__ */ a.createElement(M, { variant: "body1", color: s.textMidEmphasis }, o), r);
3900
- }, Di = ({ children: e }) => {
3904
+ }, Pi = ({ children: e }) => {
3901
3905
  const { theme: t } = W();
3902
3906
  return /* @__PURE__ */ a.createElement(y, { backgroundColor: t.colors.base.background, style: wo.container }, e);
3903
3907
  }, wo = Q.create({
@@ -3913,26 +3917,26 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
3913
3917
  alignItems: "center",
3914
3918
  gap: 20
3915
3919
  }
3916
- }), Pi = ({ label: e, icon: t = "error", action: n, ...o }) => {
3920
+ }), Oi = ({ label: e, icon: t = "error", action: n, ...o }) => {
3917
3921
  const { strings: r } = G();
3918
3922
  return /* @__PURE__ */ a.createElement(gn, { icon: t, label: e ?? r.common.placeholder_something_went_wrong, ...o }, n && /* @__PURE__ */ a.createElement(
3919
- Oi,
3923
+ Ni,
3920
3924
  {
3921
3925
  onPress: n.onPress,
3922
3926
  label: n.label ?? r.common.placeholder_something_went_wrong_retry_label
3923
3927
  }
3924
3928
  ));
3925
- }, Oi = ({ label: e, onPress: t }) => {
3929
+ }, Ni = ({ label: e, onPress: t }) => {
3926
3930
  const { themedColor: n } = W();
3927
- return /* @__PURE__ */ a.createElement(B, { onPress: t }, /* @__PURE__ */ a.createElement(y, { style: Ni.button }, /* @__PURE__ */ a.createElement(U, { type: "refresh", size: 20 }), /* @__PURE__ */ a.createElement(M, { variant: "button", color: n.primary }, e)));
3928
- }, Ni = Q.create({
3931
+ return /* @__PURE__ */ a.createElement(B, { onPress: t }, /* @__PURE__ */ a.createElement(y, { style: Bi.button }, /* @__PURE__ */ a.createElement(U, { type: "refresh", size: 20 }), /* @__PURE__ */ a.createElement(M, { variant: "button", color: n.primary }, e)));
3932
+ }, Bi = Q.create({
3929
3933
  button: {
3930
3934
  flexDirection: "row",
3931
3935
  gap: 4,
3932
3936
  alignItems: "center",
3933
3937
  justifyContent: "center"
3934
3938
  }
3935
- }), Bi = ({ iconSize: e = 48, style: t }) => {
3939
+ }), Hi = ({ iconSize: e = 48, style: t }) => {
3936
3940
  const n = j(new N.Value(0)).current;
3937
3941
  L(() => {
3938
3942
  const r = N.loop(
@@ -3952,27 +3956,27 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
3952
3956
  outputRange: ["0deg", "360deg"]
3953
3957
  });
3954
3958
  return /* @__PURE__ */ a.createElement(y.Animated, { style: [{ transform: [{ rotate: o }] }, t] }, /* @__PURE__ */ a.createElement(U, { type: "spinner", size: e }));
3955
- }, Hi = ({ label: e, icon: t = "chat", ...n }) => {
3959
+ }, zi = ({ label: e, icon: t = "chat", ...n }) => {
3956
3960
  const { strings: o } = G();
3957
3961
  return /* @__PURE__ */ a.createElement(gn, { icon: t, label: e ?? o.common.placeholder_no_conversations, ...n });
3958
- }, zi = ({ label: e, icon: t = "message", ...n }) => {
3962
+ }, Ui = ({ label: e, icon: t = "message", ...n }) => {
3959
3963
  const { strings: o } = G();
3960
3964
  return /* @__PURE__ */ a.createElement(gn, { icon: t, label: e ?? o.common.placeholder_no_messages, ...n });
3961
- }, Ui = (e) => {
3965
+ }, Fi = (e) => {
3962
3966
  const { components: t } = hn.useContext(), n = e.type === "loading" ? /* @__PURE__ */ a.createElement(t.Loading, { ...e }) : e.type === "error" ? /* @__PURE__ */ a.createElement(t.Error, { ...e }) : e.type === "noChannels" ? /* @__PURE__ */ a.createElement(t.NoChannels, { ...e }) : e.type === "noMessages" ? /* @__PURE__ */ a.createElement(t.NoMessages, { ...e }) : null;
3963
- return n && /* @__PURE__ */ a.createElement(Di, null, n);
3967
+ return n && /* @__PURE__ */ a.createElement(Pi, null, n);
3964
3968
  }, hn = ce({
3965
- template: Ui,
3969
+ template: Fi,
3966
3970
  components: {
3967
- Loading: Bi,
3968
- Error: Pi,
3969
- NoChannels: Hi,
3970
- NoMessages: zi
3971
+ Loading: Hi,
3972
+ Error: Oi,
3973
+ NoChannels: zi,
3974
+ NoMessages: Ui
3971
3975
  }
3972
3976
  }), Le = (e) => {
3973
3977
  const { Template: t } = hn.useContext();
3974
3978
  return /* @__PURE__ */ a.createElement(t, { ...e });
3975
- }, Fi = ({
3979
+ }, $i = ({
3976
3980
  loading: e,
3977
3981
  error: t,
3978
3982
  empty: n,
@@ -4010,8 +4014,8 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4010
4014
  emptyContainer: {
4011
4015
  flex: 1
4012
4016
  }
4013
- }), xo = Ke(mt(Fi)), pn = ({ name: e, type: t = "FILE", onPress: n }) => {
4014
- const o = $i.use();
4017
+ }), xo = Ke(mt($i)), pn = ({ name: e, type: t = "FILE", onPress: n }) => {
4018
+ const o = ji.use();
4015
4019
  return /* @__PURE__ */ a.createElement(B, { onPress: n, style: o.container, activeOpacity: 0.75 }, /* @__PURE__ */ a.createElement(y, { style: o.iconWrapper }, /* @__PURE__ */ a.createElement(U, { type: "file-document", size: 24, color: o.icon.tintColor })), /* @__PURE__ */ a.createElement(y, { flex: 1, flexDirection: "column", gap: 4, style: o.info }, /* @__PURE__ */ a.createElement(
4016
4020
  M,
4017
4021
  {
@@ -4022,7 +4026,7 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4022
4026
  },
4023
4027
  e
4024
4028
  ), /* @__PURE__ */ a.createElement(M, { variant: "caption3", color: ({ themedColor: r }) => r.textMidEmphasis }, t)));
4025
- }, $i = O.create(({ theme: e, themedColor: t }) => ({
4029
+ }, ji = O.create(({ theme: e, themedColor: t }) => ({
4026
4030
  container: {
4027
4031
  width: 220,
4028
4032
  borderRadius: 12,
@@ -4050,7 +4054,7 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4050
4054
  alignItems: "flex-start",
4051
4055
  minWidth: 0
4052
4056
  }
4053
- })), ji = ({
4057
+ })), Gi = ({
4054
4058
  file: e,
4055
4059
  children: t,
4056
4060
  onClickFile: n = ({ url: o }) => Ee.openURL(o)
@@ -4061,14 +4065,14 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4061
4065
  type: on(e.name, e.type),
4062
4066
  onPress: n ? () => n == null ? void 0 : n(e) : void 0
4063
4067
  }
4064
- ), t), Pe = ({ style: e, ...t }) => /* @__PURE__ */ a.createElement(Ye, { style: [e, t], ...t }), Gi = ({
4068
+ ), t), Pe = ({ style: e, ...t }) => /* @__PURE__ */ a.createElement(Ye, { style: [e, t], ...t }), Vi = ({
4065
4069
  file: e,
4066
4070
  onClickMedia: t = ({ url: o }) => Ee.openURL(o),
4067
4071
  children: n
4068
4072
  }) => {
4069
- const o = Vi.use();
4073
+ const o = Wi.use();
4070
4074
  return /* @__PURE__ */ a.createElement(y, { gap: P.GAP_GROUPED }, /* @__PURE__ */ a.createElement(B, { style: o.mediaContainer, onPress: () => t == null ? void 0 : t(e) }, /* @__PURE__ */ a.createElement(Pe, { source: { uri: e.url }, style: o.media, resizeMode: "cover" })), n);
4071
- }, Vi = O.create(({ select: e, theme: t }) => ({
4075
+ }, Wi = O.create(({ select: e, theme: t }) => ({
4072
4076
  mediaContainer: {
4073
4077
  width: P.BODY_MAX_WIDTH,
4074
4078
  height: 160,
@@ -4085,12 +4089,12 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4085
4089
  }
4086
4090
  })), Io = ({ code: e, language: t }) => {
4087
4091
  const [n, o] = C(!1), r = async () => {
4088
- kr.setString(e), o(!0), setTimeout(() => o(!1), 2e3);
4092
+ Mr.setString(e), o(!0), setTimeout(() => o(!1), 2e3);
4089
4093
  };
4090
4094
  return /* @__PURE__ */ a.createElement(y, { style: rt.container, flexDirection: "row" }, /* @__PURE__ */ a.createElement(Jt, { style: rt.copyButton, onPress: r }, /* @__PURE__ */ a.createElement(U, { type: n ? "done" : "copy", size: 16, color: "#fff" })), /* @__PURE__ */ a.createElement(y, null, /* @__PURE__ */ a.createElement(
4091
- Mr,
4095
+ Rr,
4092
4096
  {
4093
- hljsStyle: Wi,
4097
+ hljsStyle: qi,
4094
4098
  scrollViewProps: {
4095
4099
  contentContainerStyle: rt.codeContainer,
4096
4100
  bounces: !1
@@ -4128,7 +4132,7 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4128
4132
  fontSize: 13,
4129
4133
  lineHeight: 19
4130
4134
  }
4131
- }), Wi = {
4135
+ }), qi = {
4132
4136
  hljs: {
4133
4137
  display: "block",
4134
4138
  overflowX: "auto",
@@ -4269,11 +4273,11 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4269
4273
  fontWeight: "bold"
4270
4274
  }
4271
4275
  }, ko = Ke(({ src: e, onPress: t }) => {
4272
- const [n, o] = C("1/1"), [r, s] = C(!1), i = qi.use();
4276
+ const [n, o] = C("1/1"), [r, s] = C(!1), i = Yi.use();
4273
4277
  return me(() => {
4274
4278
  e && vo(e).then(({ width: l, height: c }) => o(`${l}/${c}`));
4275
4279
  }, [e]), /* @__PURE__ */ a.createElement(Jt, { style: { marginTop: 8 }, onPress: t }, /* @__PURE__ */ a.createElement(y, { style: [i.container, { aspectRatio: n }] }, r ? /* @__PURE__ */ a.createElement(U, { size: 28, type: "thumbnail-none", color: ({ themedColor: l }) => l.textHighEmphasisInverse }) : /* @__PURE__ */ a.createElement(Ye, { source: { uri: e }, style: Q.absoluteFillObject, onError: () => s(!0) })));
4276
- }), qi = O.create(({ themedColor: e }) => ({
4280
+ }), Yi = O.create(({ themedColor: e }) => ({
4277
4281
  container: {
4278
4282
  width: "100%",
4279
4283
  backgroundColor: e.textDisabled,
@@ -4284,7 +4288,7 @@ const To = O.create(({ theme: e, edgeInsets: t }) => ({
4284
4288
  }
4285
4289
  }));
4286
4290
  ko.displayName = "MarkdownImage";
4287
- const Ue = (e) => or(e) && "children" in e.props, Xt = (e = 0.75) => `rgba(0, 0, 0, ${e})`, Yi = ({ children: e }) => {
4291
+ const Ue = (e) => rr(e) && "children" in e.props, Xt = (e = 0.75) => `rgba(0, 0, 0, ${e})`, Ki = ({ children: e }) => {
4288
4292
  var i;
4289
4293
  const t = qo(), n = Xt(0.3), o = J(() => {
4290
4294
  try {
@@ -4395,13 +4399,13 @@ const Ue = (e) => or(e) && "children" in e.props, Xt = (e = 0.75) => `rgba(0, 0,
4395
4399
  nestedScrollEnabled: !0,
4396
4400
  persistentScrollbar: !0
4397
4401
  },
4398
- /* @__PURE__ */ a.createElement(Yi, null, p)
4402
+ /* @__PURE__ */ a.createElement(Ki, null, p)
4399
4403
  ))
4400
4404
  }),
4401
4405
  [o]
4402
4406
  );
4403
4407
  return /* @__PURE__ */ a.createElement(y, { flexDirection: "row", marginTop: -8 }, /* @__PURE__ */ a.createElement(
4404
- Rr,
4408
+ Lr,
4405
4409
  {
4406
4410
  style: {
4407
4411
  body: {
@@ -4561,7 +4565,7 @@ const Ue = (e) => or(e) && "children" in e.props, Xt = (e = 0.75) => `rgba(0, 0,
4561
4565
  },
4562
4566
  rules: g
4563
4567
  },
4564
- zr(e)
4568
+ Ur(e)
4565
4569
  ));
4566
4570
  });
4567
4571
  fn.displayName = "MarkdownText";
@@ -4571,7 +4575,7 @@ const Vn = ({
4571
4575
  message: n,
4572
4576
  children: o
4573
4577
  }) => {
4574
- const r = Ki.use(), s = e ?? P.BODY_MAX_WIDTH, i = J(() => Or(n), [n]), l = w((c) => Ee.openURL(c), []);
4578
+ const r = Xi.use(), s = e ?? P.BODY_MAX_WIDTH, i = J(() => Nr(n), [n]), l = w((c) => Ee.openURL(c), []);
4575
4579
  return i.length === 0 && !o ? null : /* @__PURE__ */ a.createElement(
4576
4580
  y,
4577
4581
  {
@@ -4587,25 +4591,25 @@ const Vn = ({
4587
4591
  i.map((c, u) => c.type === "text" ? /* @__PURE__ */ a.createElement(y, { key: u, paddingHorizontal: 12 }, /* @__PURE__ */ a.createElement(fn, { onPressImage: l, textStyle: r.text }, c.value)) : c.type === "code" ? /* @__PURE__ */ a.createElement(Io, { key: u, code: c.value, language: c.language }) : null),
4588
4592
  o
4589
4593
  );
4590
- }, Ki = O.create(({ theme: e }) => ({
4594
+ }, Xi = O.create(({ theme: e }) => ({
4591
4595
  container: {
4592
4596
  backgroundColor: e.colors.messageIncoming.background
4593
4597
  },
4594
4598
  text: {
4595
4599
  color: e.colors.messageIncoming.text
4596
4600
  }
4597
- })), Xi = (e) => {
4601
+ })), Zi = (e) => {
4598
4602
  const { strings: t } = G(), n = () => {
4599
4603
  const o = lo(e) ? /* @__PURE__ */ a.createElement(Vn, { ...e }) : null;
4600
- return e.messageType === "user" ? o : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ a.createElement(Gi, { ...e }, o) : /* @__PURE__ */ a.createElement(ji, { ...e }, o) : /* @__PURE__ */ a.createElement(Vn, { ...e, message: t.conversation.unknown_message_type });
4604
+ return e.messageType === "user" ? o : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ a.createElement(Vi, { ...e }, o) : /* @__PURE__ */ a.createElement(Gi, { ...e }, o) : /* @__PURE__ */ a.createElement(Vn, { ...e, message: t.conversation.unknown_message_type });
4601
4605
  };
4602
4606
  return /* @__PURE__ */ a.createElement(y, { style: e.containerStyle }, n());
4603
4607
  };
4604
4608
  function Mo({ id: e, src: t, size: n = 56, onClick: o, style: r }) {
4605
- const s = Zi.use(), i = /* @__PURE__ */ a.createElement(Ie, { style: [s.container(n), r], testID: e }, t ? /* @__PURE__ */ a.createElement(Ye, { source: { uri: t }, style: s.image }) : /* @__PURE__ */ a.createElement(U, { type: "user", size: n }));
4609
+ const s = Ji.use(), i = /* @__PURE__ */ a.createElement(Ie, { style: [s.container(n), r], testID: e }, t ? /* @__PURE__ */ a.createElement(Ye, { source: { uri: t }, style: s.image }) : /* @__PURE__ */ a.createElement(U, { type: "user", size: n }));
4606
4610
  return o ? /* @__PURE__ */ a.createElement(B, { onPress: o, activeOpacity: 0.75 }, i) : i;
4607
4611
  }
4608
- const Zi = O.create(({ themedColor: e }) => ({
4612
+ const Ji = O.create(({ themedColor: e }) => ({
4609
4613
  container: (t) => ({
4610
4614
  borderRadius: t / 2,
4611
4615
  overflow: "hidden",
@@ -4621,11 +4625,11 @@ const Zi = O.create(({ themedColor: e }) => ({
4621
4625
  height: "100%",
4622
4626
  position: "absolute"
4623
4627
  }
4624
- })), Ji = ({
4628
+ })), Qi = ({
4625
4629
  sender: e,
4626
4630
  isBotMessage: t
4627
4631
  }) => {
4628
- const n = Qi.use();
4632
+ const n = el.use();
4629
4633
  return t && !e.profileUrl ? /* @__PURE__ */ a.createElement(y, { style: n.botContainer }, /* @__PURE__ */ a.createElement(
4630
4634
  U,
4631
4635
  {
@@ -4634,7 +4638,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4634
4638
  size: P.AVATAR_SIZE - 8
4635
4639
  }
4636
4640
  )) : /* @__PURE__ */ a.createElement(Mo, { src: e.profileUrl, size: P.AVATAR_SIZE });
4637
- }, Qi = O.create(({ theme: e }) => ({
4641
+ }, el = O.create(({ theme: e }) => ({
4638
4642
  botContainer: {
4639
4643
  width: P.AVATAR_SIZE,
4640
4644
  height: P.AVATAR_SIZE,
@@ -4644,11 +4648,11 @@ const Zi = O.create(({ themedColor: e }) => ({
4644
4648
  justifyContent: "center",
4645
4649
  backgroundColor: e.colors.base.primary
4646
4650
  }
4647
- })), el = ({ sender: e }) => /* @__PURE__ */ a.createElement(y, { flex: 1, paddingVertical: 5, paddingStart: 0, paddingEnd: 7, alignItems: "flex-start" }, /* @__PURE__ */ a.createElement(M, { variant: "caption1", color: ({ themedColor: t }) => t.textMidEmphasis, numberOfLines: 1 }, e.nickname)), tl = ({ createdAt: e, containerStyle: t }) => {
4651
+ })), tl = ({ sender: e }) => /* @__PURE__ */ a.createElement(y, { flex: 1, paddingVertical: 5, paddingStart: 0, paddingEnd: 7, alignItems: "flex-start" }, /* @__PURE__ */ a.createElement(M, { variant: "caption1", color: ({ themedColor: t }) => t.textMidEmphasis, numberOfLines: 1 }, e.nickname)), nl = ({ createdAt: e, containerStyle: t }) => {
4648
4652
  const { strings: n, format: o } = G();
4649
4653
  return e ? /* @__PURE__ */ a.createElement(y, { alignItems: "flex-start", style: t }, /* @__PURE__ */ a.createElement(M, { variant: "caption4", color: ({ themedColor: r }) => r.textLowEmphasis }, o(e, n.date_format.message_timestamp))) : null;
4650
- }, nl = ({ customStyle: e, containerStyle: t }) => {
4651
- const { theme: n } = W(), o = j(new N.Value(0)).current, r = ol.map(
4654
+ }, ol = ({ customStyle: e, containerStyle: t }) => {
4655
+ const { theme: n } = W(), o = j(new N.Value(0)).current, r = rl.map(
4652
4656
  ([s, i, l]) => [
4653
4657
  o.interpolate({ inputRange: s, outputRange: i, extrapolate: "clamp" }),
4654
4658
  o.interpolate({ inputRange: s, outputRange: l, extrapolate: "clamp" })
@@ -4676,7 +4680,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4676
4680
  {
4677
4681
  key: l,
4678
4682
  style: [
4679
- rl.dot,
4683
+ sl.dot,
4680
4684
  {
4681
4685
  marginEnd: l === r.length - 1 ? 0 : 6,
4682
4686
  opacity: i,
@@ -4687,7 +4691,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4687
4691
  }
4688
4692
  ))
4689
4693
  ));
4690
- }, ol = [
4694
+ }, rl = [
4691
4695
  [
4692
4696
  [0.4, 0.7, 1],
4693
4697
  [1, 1.2, 1],
@@ -4703,19 +4707,19 @@ const Zi = O.create(({ themedColor: e }) => ({
4703
4707
  [1, 1.2, 1],
4704
4708
  [0.12, 0.38, 0.12]
4705
4709
  ]
4706
- ], rl = Q.create({
4710
+ ], sl = Q.create({
4707
4711
  dot: {
4708
4712
  width: 8,
4709
4713
  height: 8,
4710
4714
  borderRadius: 4
4711
4715
  }
4712
- }), sl = ({
4716
+ }), al = ({
4713
4717
  extendedMessagePayload: e,
4714
4718
  onClickCTA: t = ({ url: n }) => Ee.openURL(n)
4715
4719
  }) => {
4716
- const n = al.use(), o = e == null ? void 0 : e.cta_button;
4720
+ const n = il.use(), o = e == null ? void 0 : e.cta_button;
4717
4721
  return o ? /* @__PURE__ */ a.createElement(B, { onPress: () => t(o), activeOpacity: 0.75, style: n.button }, /* @__PURE__ */ a.createElement(M, { variant: "button", color: ({ themedColor: r }) => r.textHighEmphasis, numberOfLines: 1 }, o.label)) : null;
4718
- }, al = O.create(({ select: e, themedColor: t }) => ({
4722
+ }, il = O.create(({ select: e, themedColor: t }) => ({
4719
4723
  button: {
4720
4724
  alignItems: "center",
4721
4725
  justifyContent: "center",
@@ -4727,7 +4731,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4727
4731
  dark: t.textDisabled
4728
4732
  })
4729
4733
  }
4730
- })), il = ({
4734
+ })), ll = ({
4731
4735
  extendedMessagePayload: e,
4732
4736
  onClickCitation: t = (n) => Ee.openURL(n.link)
4733
4737
  }) => {
@@ -4749,14 +4753,14 @@ const Zi = O.create(({ themedColor: e }) => ({
4749
4753
  citationText: {
4750
4754
  textDecorationLine: "underline"
4751
4755
  }
4752
- }), ll = (e) => /* @__PURE__ */ a.createElement(a.Fragment, null), Zt = (e) => `${e}-filled`, cl = (e) => e === "good" ? Tn.GOOD : Tn.BAD, qn = ({
4756
+ }), cl = (e) => /* @__PURE__ */ a.createElement(a.Fragment, null), Zt = (e) => `${e}-filled`, ul = (e) => e === "good" ? Tn.GOOD : Tn.BAD, qn = ({
4753
4757
  onClose: e,
4754
4758
  isEdit: t,
4755
4759
  initialRating: n,
4756
4760
  initialComment: o = "",
4757
4761
  isCommentEnabled: r = !1
4758
4762
  }) => {
4759
- const { strings: s } = G(), { themedColor: i, theme: l } = W(), c = ul.use(), [u, d] = C(o), [g, m] = C(n), p = () => {
4763
+ const { strings: s } = G(), { themedColor: i, theme: l } = W(), c = dl.use(), [u, d] = C(o), [g, m] = C(n), p = () => {
4760
4764
  g && e({ rating: g, comment: u.trim() || void 0 });
4761
4765
  }, f = () => {
4762
4766
  e();
@@ -4817,7 +4821,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4817
4821
  /* @__PURE__ */ a.createElement(M, { variant: "button", color: l.colors.base.primaryContrastContent }, t ? s.feedback.save : s.feedback.submit)
4818
4822
  ))
4819
4823
  )));
4820
- }, ul = O.create(({ select: e, theme: t, themedColor: n }) => ({
4824
+ }, dl = O.create(({ select: e, theme: t, themedColor: n }) => ({
4821
4825
  overlay: {
4822
4826
  flex: 1,
4823
4827
  backgroundColor: t.palette.overlay.dark,
@@ -4865,7 +4869,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4865
4869
  backgroundColor: t.colors.base.primary,
4866
4870
  opacity: o ? 0.4 : 1
4867
4871
  })
4868
- })), dl = ({
4872
+ })), ml = ({
4869
4873
  isBotMessage: e,
4870
4874
  isConversationClosed: t,
4871
4875
  isStreaming: n,
@@ -4875,7 +4879,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4875
4879
  onFeedbackUpdate: i,
4876
4880
  containerStyle: l
4877
4881
  }) => {
4878
- const { strings: c } = G(), { themedColor: u } = W(), { openModal: d } = cn(), g = ml.use(), m = s == null ? void 0 : s.feedback, p = (m == null ? void 0 : m.rating) ?? "none";
4882
+ const { strings: c } = G(), { themedColor: u } = W(), { openModal: d } = cn(), g = gl.use(), m = s == null ? void 0 : s.feedback, p = (m == null ? void 0 : m.rating) ?? "none";
4879
4883
  if (p !== "none" ? !1 : !!(n || !e || !o || (s == null ? void 0 : s.bot_message_type) !== "generated" || t)) return null;
4880
4884
  const E = {
4881
4885
  good: u.secondary,
@@ -4930,7 +4934,7 @@ const Zi = O.create(({ themedColor: e }) => ({
4930
4934
  );
4931
4935
  })), p !== "none" && (m == null ? void 0 : m.comment) && /* @__PURE__ */ a.createElement(M, { variant: "caption2", style: g.commentText }, m.comment));
4932
4936
  return /* @__PURE__ */ a.createElement(y, { style: l }, _());
4933
- }, ml = O.create(({ select: e, theme: t, themedColor: n }) => ({
4937
+ }, gl = O.create(({ select: e, theme: t, themedColor: n }) => ({
4934
4938
  feedbackButton: (o) => ({
4935
4939
  width: 38,
4936
4940
  height: 20,
@@ -4945,10 +4949,10 @@ const Zi = O.create(({ themedColor: e }) => ({
4945
4949
  lineHeight: 16,
4946
4950
  color: e({ light: n.textMidEmphasis, dark: n.textHighEmphasis })
4947
4951
  }
4948
- })), gl = (e) => {
4952
+ })), hl = (e) => {
4949
4953
  var n;
4950
4954
  return (n = e.extendedMessagePayload) == null ? void 0 : n.form, null;
4951
- }, hl = (e) => null, Ro = ({
4955
+ }, pl = (e) => null, Ro = ({
4952
4956
  debug: e = !1,
4953
4957
  style: t,
4954
4958
  showsHorizontalScrollIndicator: n = !1,
@@ -4962,19 +4966,19 @@ const Zi = O.create(({ themedColor: e }) => ({
4962
4966
  ...r
4963
4967
  },
4964
4968
  o
4965
- ), pl = ({
4969
+ ), fl = ({
4966
4970
  extendedMessagePayload: e,
4967
4971
  onClickSuggestedReply: t,
4968
4972
  suggestedRepliesDirection: n = "vertical"
4969
4973
  }) => {
4970
- const o = fl.use(), [r, s] = C(!1), i = (e == null ? void 0 : e.suggested_replies) ?? [];
4974
+ const o = _l.use(), [r, s] = C(!1), i = (e == null ? void 0 : e.suggested_replies) ?? [];
4971
4975
  if (i.length === 0 || r)
4972
4976
  return null;
4973
4977
  const l = n === "vertical", c = (d) => {
4974
4978
  t == null || t({ reply: d }), s(!0);
4975
4979
  }, u = () => i.map((d, g) => /* @__PURE__ */ a.createElement(B, { key: g, style: o.itemContainer, onPress: () => c(d) }, /* @__PURE__ */ a.createElement(M, { variant: "body3", color: ({ themedColor: m }) => m.primary }, d)));
4976
4980
  return l ? /* @__PURE__ */ a.createElement(y, { alignItems: "flex-end", gap: 8, marginVertical: 16, paddingHorizontal: P.HORIZONTAL_PADDING }, u()) : /* @__PURE__ */ a.createElement(Ro, { horizontal: !0, showsHorizontalScrollIndicator: !1, contentContainerStyle: o.horizontalContainer }, u());
4977
- }, fl = O.create(({ themedColor: e }) => ({
4981
+ }, _l = O.create(({ themedColor: e }) => ({
4978
4982
  itemContainer: {
4979
4983
  maxWidth: 336,
4980
4984
  paddingHorizontal: 12,
@@ -4989,9 +4993,9 @@ const Zi = O.create(({ themedColor: e }) => ({
4989
4993
  paddingHorizontal: P.HORIZONTAL_PADDING,
4990
4994
  paddingVertical: 16
4991
4995
  }
4992
- })), _l = (e) => {
4996
+ })), yl = (e) => {
4993
4997
  var h, v, _, b, S, T, x;
4994
- const { components: t } = _n.useContext(), { streamText: n, isAnimating: o } = Ea({
4998
+ const { components: t } = _n.useContext(), { streamText: n, isAnimating: o } = va({
4995
4999
  text: e.message,
4996
5000
  enabled: e.isStreaming,
4997
5001
  onAnimationStart: e.onStreamAnimationStart,
@@ -5001,7 +5005,7 @@ const Zi = O.create(({ themedColor: e }) => ({
5001
5005
  ...e,
5002
5006
  message: n,
5003
5007
  extendedMessagePayload: o ? {} : e.extendedMessagePayload
5004
- }, s = !!r.isTyping, i = !!r.isSenderAvatarVisible, l = !!((h = r.extendedMessagePayload) != null && h.form) && !((v = r.extendedMessagePayload) != null && v.form.canceled_at), c = !!((_ = r.extendedMessagePayload) != null && _.message_template), u = !!((b = r.extendedMessagePayload) != null && b.cta_button), d = !!((S = r.extendedMessagePayload) != null && S.citations) && r.extendedMessagePayload.citations.length > 0, g = !!r.createdAt, m = r.groupType === "top" || r.groupType === "single", p = r.groupType === "bottom" || r.groupType === "single", f = i ? P.AVATAR_SIZE : 0, E = yl.use();
5008
+ }, s = !!r.isTyping, i = !!r.isSenderAvatarVisible, l = !!((h = r.extendedMessagePayload) != null && h.form) && !((v = r.extendedMessagePayload) != null && v.form.canceled_at), c = !!((_ = r.extendedMessagePayload) != null && _.message_template), u = !!((b = r.extendedMessagePayload) != null && b.cta_button), d = !!((S = r.extendedMessagePayload) != null && S.citations) && r.extendedMessagePayload.citations.length > 0, g = !!r.createdAt, m = r.groupType === "top" || r.groupType === "single", p = r.groupType === "bottom" || r.groupType === "single", f = i ? P.AVATAR_SIZE : 0, E = bl.use();
5005
5009
  return /* @__PURE__ */ a.createElement(y, { marginBottom: s ? 0 : rn(r.groupType) }, m && /* @__PURE__ */ a.createElement(y, { flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: P.HORIZONTAL_PADDING }, i && /* @__PURE__ */ a.createElement(t.SenderAvatar, { ...r }), /* @__PURE__ */ a.createElement(t.SenderName, { ...r })), /* @__PURE__ */ a.createElement(y, { gap: P.GAP_GROUPED }, s ? /* @__PURE__ */ a.createElement(t.TypingIndicator, { ...r, containerStyle: E.middleArea(f) }) : /* @__PURE__ */ a.createElement(t.MessageBody, { ...r, containerStyle: E.middleArea(f) }, u && /* @__PURE__ */ a.createElement(y, { marginTop: 12, marginHorizontal: 12 }, /* @__PURE__ */ a.createElement(t.CTAButton, { ...r })), d && /* @__PURE__ */ a.createElement(t.Citation, { ...r })), c && /* @__PURE__ */ a.createElement(
5006
5010
  t.MessageTemplate,
5007
5011
  {
@@ -5017,24 +5021,24 @@ const Zi = O.create(({ themedColor: e }) => ({
5017
5021
  ),
5018
5022
  messageTemplateLoadingFallback: r.messageTemplateLoadingFallback ?? /* @__PURE__ */ a.createElement(t.TypingIndicator, { ...r, containerStyle: E.middleArea(f) })
5019
5023
  }
5020
- ), /* @__PURE__ */ a.createElement(t.CustomMessageTemplate, { ...r }), l && /* @__PURE__ */ a.createElement(t.Form, { ...r, containerStyle: E.middleArea(f) })), p && g && /* @__PURE__ */ a.createElement(t.SentTime, { ...r, containerStyle: E.bottomArea(f) }), /* @__PURE__ */ a.createElement(rr, null, !s && /* @__PURE__ */ a.createElement(t.Feedback, { ...r, containerStyle: E.feedbackArea(f) }), r.suggestedRepliesVisible && /* @__PURE__ */ a.createElement(t.SuggestedReplies, { ...r })));
5024
+ ), /* @__PURE__ */ a.createElement(t.CustomMessageTemplate, { ...r }), l && /* @__PURE__ */ a.createElement(t.Form, { ...r, containerStyle: E.middleArea(f) })), p && g && /* @__PURE__ */ a.createElement(t.SentTime, { ...r, containerStyle: E.bottomArea(f) }), /* @__PURE__ */ a.createElement(sr, null, !s && /* @__PURE__ */ a.createElement(t.Feedback, { ...r, containerStyle: E.feedbackArea(f) }), r.suggestedRepliesVisible && /* @__PURE__ */ a.createElement(t.SuggestedReplies, { ...r })));
5021
5025
  }, _n = ce({
5022
- template: _l,
5026
+ template: yl,
5023
5027
  components: {
5024
- SenderName: el,
5025
- SenderAvatar: Ji,
5026
- SentTime: tl,
5027
- MessageBody: Xi,
5028
- TypingIndicator: nl,
5029
- SuggestedReplies: pl,
5030
- MessageTemplate: hl,
5031
- CustomMessageTemplate: ll,
5032
- CTAButton: sl,
5033
- Citation: il,
5034
- Form: gl,
5035
- Feedback: dl
5036
- }
5037
- }), yl = O.create(() => ({
5028
+ SenderName: tl,
5029
+ SenderAvatar: Qi,
5030
+ SentTime: nl,
5031
+ MessageBody: Zi,
5032
+ TypingIndicator: ol,
5033
+ SuggestedReplies: fl,
5034
+ MessageTemplate: pl,
5035
+ CustomMessageTemplate: cl,
5036
+ CTAButton: al,
5037
+ Citation: ll,
5038
+ Form: hl,
5039
+ Feedback: ml
5040
+ }
5041
+ }), bl = O.create(() => ({
5038
5042
  middleArea: (e) => ({
5039
5043
  paddingStart: P.HORIZONTAL_PADDING + e,
5040
5044
  paddingEnd: P.HORIZONTAL_PADDING
@@ -5049,7 +5053,7 @@ const Zi = O.create(({ themedColor: e }) => ({
5049
5053
  paddingStart: P.HORIZONTAL_PADDING + e + 8,
5050
5054
  paddingEnd: P.HORIZONTAL_PADDING
5051
5055
  })
5052
- })), bl = ({
5056
+ })), El = ({
5053
5057
  file: e,
5054
5058
  children: t,
5055
5059
  sendingStatus: n,
@@ -5104,17 +5108,17 @@ const Zi = O.create(({ themedColor: e }) => ({
5104
5108
  t ?? /* @__PURE__ */ a.createElement(U, { type: "spinner", size: e })
5105
5109
  );
5106
5110
  };
5107
- function El(e) {
5111
+ function vl(e) {
5108
5112
  return typeof e == "object" && e !== null && "uri" in e;
5109
5113
  }
5110
- const vl = ({
5114
+ const Cl = ({
5111
5115
  file: e,
5112
5116
  metadata: t,
5113
5117
  sendingStatus: n,
5114
5118
  onClickMedia: o = ({ url: s }) => Ee.openURL(s),
5115
5119
  children: r
5116
5120
  }) => {
5117
- const s = Cl.use(), { aspectRatio: i, localFile: l } = t, [c] = C(() => El(l) ? l.uri : e.url), [u, d] = C(!1), g = (() => {
5121
+ const s = Sl.use(), { aspectRatio: i, localFile: l } = t, [c] = C(() => vl(l) ? l.uri : e.url), [u, d] = C(!1), g = (() => {
5118
5122
  if (!(!o || n !== "succeeded"))
5119
5123
  return () => o(e);
5120
5124
  })();
@@ -5127,7 +5131,7 @@ const vl = ({
5127
5131
  onLoad: () => d(!0)
5128
5132
  }
5129
5133
  )), r);
5130
- }, Cl = O.create(({ themedColor: e }) => ({
5134
+ }, Sl = O.create(({ themedColor: e }) => ({
5131
5135
  imageContainer: {
5132
5136
  width: P.BODY_MAX_WIDTH,
5133
5137
  borderRadius: 12,
@@ -5146,7 +5150,7 @@ const vl = ({
5146
5150
  }
5147
5151
  })), Yn = (e) => {
5148
5152
  var n, o;
5149
- const t = Sl.use();
5153
+ const t = Al.use();
5150
5154
  return /* @__PURE__ */ a.createElement(
5151
5155
  y,
5152
5156
  {
@@ -5164,7 +5168,7 @@ const vl = ({
5164
5168
  e.message
5165
5169
  )
5166
5170
  );
5167
- }, Sl = O.create(({ theme: e }) => ({
5171
+ }, Al = O.create(({ theme: e }) => ({
5168
5172
  container: (t) => ({
5169
5173
  flexDirection: "column",
5170
5174
  borderRadius: 12,
@@ -5179,13 +5183,13 @@ const vl = ({
5179
5183
  paddingHorizontal: 12,
5180
5184
  color: e.colors.messageOutgoing.text
5181
5185
  }
5182
- })), Al = (e) => {
5186
+ })), Tl = (e) => {
5183
5187
  const { strings: t } = G(), n = () => {
5184
5188
  const o = lo(e) ? /* @__PURE__ */ a.createElement(Yn, { ...e }) : null;
5185
- return e.messageType === "user" ? o : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ a.createElement(vl, { ...e }, o) : /* @__PURE__ */ a.createElement(bl, { ...e }, o) : /* @__PURE__ */ a.createElement(Yn, { ...e, message: t.unknown_message_type });
5189
+ return e.messageType === "user" ? o : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ a.createElement(Cl, { ...e }, o) : /* @__PURE__ */ a.createElement(El, { ...e }, o) : /* @__PURE__ */ a.createElement(Yn, { ...e, message: t.unknown_message_type });
5186
5190
  };
5187
5191
  return /* @__PURE__ */ a.createElement(B, { onPress: e.sendingStatus === "failed" ? e.onClickFailedMessage : void 0, activeOpacity: 0.75 }, /* @__PURE__ */ a.createElement(y, { style: e.containerStyle }, n()));
5188
- }, Tl = ({ sendingStatus: e, containerStyle: t }) => {
5192
+ }, wl = ({ sendingStatus: e, containerStyle: t }) => {
5189
5193
  const { themedColor: n } = W(), o = () => {
5190
5194
  switch (e) {
5191
5195
  case "pending":
@@ -5200,10 +5204,10 @@ const vl = ({
5200
5204
  }
5201
5205
  };
5202
5206
  return /* @__PURE__ */ a.createElement(y, { style: t }, o());
5203
- }, wl = ({ createdAt: e, containerStyle: t }) => {
5207
+ }, xl = ({ createdAt: e, containerStyle: t }) => {
5204
5208
  const { format: n, strings: o } = G();
5205
5209
  return e ? /* @__PURE__ */ a.createElement(y, { style: t }, /* @__PURE__ */ a.createElement(M, { variant: "caption4", color: ({ themedColor: r }) => r.textLowEmphasis }, n(e, o.date_format.message_timestamp))) : null;
5206
- }, xl = (e) => {
5210
+ }, Il = (e) => {
5207
5211
  const { components: t } = yn.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
5208
5212
  return /* @__PURE__ */ a.createElement(
5209
5213
  y,
@@ -5217,11 +5221,11 @@ const vl = ({
5217
5221
  o && (n ? /* @__PURE__ */ a.createElement(t.SentTime, { ...e, containerStyle: Mt.bottomArea }) : /* @__PURE__ */ a.createElement(t.SendingStatus, { ...e, containerStyle: Mt.bottomArea }))
5218
5222
  );
5219
5223
  }, yn = ce({
5220
- template: xl,
5224
+ template: Il,
5221
5225
  components: {
5222
- SendingStatus: Tl,
5223
- SentTime: wl,
5224
- MessageBody: Al
5226
+ SendingStatus: wl,
5227
+ SentTime: xl,
5228
+ MessageBody: Tl
5225
5229
  }
5226
5230
  }), Mt = Q.create({
5227
5231
  middleArea: {
@@ -5238,15 +5242,15 @@ const vl = ({
5238
5242
  paddingEnd: P.HORIZONTAL_PADDING + 8,
5239
5243
  marginTop: P.BODY_TIME_GAP
5240
5244
  }
5241
- }), Il = (e) => e.messageType !== "admin" ? null : /* @__PURE__ */ a.createElement(
5245
+ }), kl = (e) => e.messageType !== "admin" ? null : /* @__PURE__ */ a.createElement(
5242
5246
  M,
5243
5247
  {
5244
5248
  variant: "caption2",
5245
5249
  color: ({ themedColor: t }) => t.textMidEmphasis,
5246
5250
  style: { textAlign: "center" }
5247
5251
  },
5248
- kl(e.message)
5249
- ), kl = (e) => {
5252
+ Ml(e.message)
5253
+ ), Ml = (e) => {
5250
5254
  try {
5251
5255
  const t = [];
5252
5256
  let n = e, o = 0;
@@ -5280,19 +5284,19 @@ const vl = ({
5280
5284
  } catch {
5281
5285
  return [e];
5282
5286
  }
5283
- }, Ml = ({ children: e, style: t }) => /* @__PURE__ */ a.createElement(M, { variant: "caption4", color: ({ themedColor: n }) => n.error, style: t }, e), Rl = ({ children: e, style: t, required: n }) => {
5287
+ }, Rl = ({ children: e, style: t }) => /* @__PURE__ */ a.createElement(M, { variant: "caption4", color: ({ themedColor: n }) => n.error, style: t }, e), Ll = ({ children: e, style: t, required: n }) => {
5284
5288
  const { strings: o } = G();
5285
5289
  return /* @__PURE__ */ a.createElement(M, { variant: "caption3", color: ({ themedColor: r }) => r.textMidEmphasis, style: t }, e, !n && /* @__PURE__ */ a.createElement(M, { variant: "caption3", color: ({ themedColor: r }) => r.textLowEmphasis }, ` (${o.form.optional_label})`));
5286
- }, Ll = ({ style: e }) => {
5287
- const t = Dl.use();
5290
+ }, Dl = ({ style: e }) => {
5291
+ const t = Pl.use();
5288
5292
  return /* @__PURE__ */ a.createElement(y, { style: [t.separator, e] });
5289
- }, Dl = O.create(({ themedColor: e }) => ({
5293
+ }, Pl = O.create(({ themedColor: e }) => ({
5290
5294
  separator: {
5291
5295
  width: "100%",
5292
5296
  height: 1,
5293
5297
  backgroundColor: e.textDisabled
5294
5298
  }
5295
- })), Pl = ({
5299
+ })), Ol = ({
5296
5300
  value: e = "",
5297
5301
  onChange: t,
5298
5302
  placeholder: n,
@@ -5303,7 +5307,7 @@ const vl = ({
5303
5307
  disabled: l = !1,
5304
5308
  maxLength: c
5305
5309
  }) => {
5306
- const [u, d] = C(!1), g = Ol.use(), { themedColor: m } = W(), p = (f) => {
5310
+ const [u, d] = C(!1), g = Nl.use(), { themedColor: m } = W(), p = (f) => {
5307
5311
  c && f.length > c || t == null || t(f);
5308
5312
  };
5309
5313
  return /* @__PURE__ */ a.createElement(
@@ -5321,7 +5325,7 @@ const vl = ({
5321
5325
  onBlur: () => d(!1)
5322
5326
  }
5323
5327
  );
5324
- }, Ol = O.create(({ select: e, theme: t, themedColor: n }) => ({
5328
+ }, Nl = O.create(({ select: e, theme: t, themedColor: n }) => ({
5325
5329
  input: (o, r, s, i) => {
5326
5330
  let l, c;
5327
5331
  s ? (l = "transparent", c = e({
@@ -5357,14 +5361,14 @@ const vl = ({
5357
5361
  };
5358
5362
  }
5359
5363
  })), Ge = {
5360
- Label: Rl,
5361
- ErrorLabel: Ml,
5362
- TextInput: Pl,
5363
- Separator: Ll
5364
+ Label: Ll,
5365
+ ErrorLabel: Rl,
5366
+ TextInput: Ol,
5367
+ Separator: Dl
5364
5368
  }, Do = ({ onClick: e, checked: t, label: n, disabled: o, labelVariant: r = "caption2" }) => {
5365
- const { themedColor: s } = W(), i = Nl.use(), l = t ? s.primary : o ? s.textDisabled : s.textLowEmphasis;
5369
+ const { themedColor: s } = W(), i = Bl.use(), l = t ? s.primary : o ? s.textDisabled : s.textLowEmphasis;
5366
5370
  return /* @__PURE__ */ a.createElement(B, { disabled: o || !e, onPress: e }, /* @__PURE__ */ a.createElement(y, { style: i.container }, /* @__PURE__ */ a.createElement(y, { style: i.iconContainer }, /* @__PURE__ */ a.createElement(U, { size: 20, type: t ? "radio-on" : "radio-off", color: l })), /* @__PURE__ */ a.createElement(M, { variant: r, style: i.label(t, o) }, n)));
5367
- }, Nl = O.create(({ themedColor: e }) => ({
5371
+ }, Bl = O.create(({ themedColor: e }) => ({
5368
5372
  container: {
5369
5373
  flexDirection: "row",
5370
5374
  alignItems: "flex-start",
@@ -5384,7 +5388,7 @@ const vl = ({
5384
5388
  lineHeight: 20
5385
5389
  };
5386
5390
  }
5387
- })), Bl = ({ csatPayload: e, submitted: t, defaultValue: n, value: o, onChange: r }) => (L(() => {
5391
+ })), Hl = ({ csatPayload: e, submitted: t, defaultValue: n, value: o, onChange: r }) => (L(() => {
5388
5392
  typeof o > "u" && typeof n == "boolean" && (r == null || r(n));
5389
5393
  }, [o, n, r]), e.cre ? /* @__PURE__ */ a.createElement(y, { flexDirection: "column", gap: 8, alignItems: "flex-start" }, /* @__PURE__ */ a.createElement(Ge.Label, { required: e.cre.required }, e.cre.question), /* @__PURE__ */ a.createElement(y, { flexDirection: "column", gap: 8, width: "100%" }, [
5390
5394
  { label: e.cre.positive_label, value: !0 },
@@ -5398,7 +5402,7 @@ const vl = ({
5398
5402
  disabled: t,
5399
5403
  onClick: () => r == null ? void 0 : r(s.value)
5400
5404
  }
5401
- )))) : null), Hl = ({
5405
+ )))) : null), zl = ({
5402
5406
  followUpItem: e,
5403
5407
  submitted: t,
5404
5408
  value: n = "",
@@ -5428,7 +5432,7 @@ const vl = ({
5428
5432
  labelVariant: "body3"
5429
5433
  }
5430
5434
  ))), r && /* @__PURE__ */ a.createElement(Ge.ErrorLabel, null, s.form.validation_required));
5431
- }, zl = (e) => null, Ul = ({ csatPayload: e, submitted: t, value: n, onChange: o }) => {
5435
+ }, Ul = (e) => null, Fl = ({ csatPayload: e, submitted: t, value: n, onChange: o }) => {
5432
5436
  const r = typeof n > "u", s = Po.use(), [i, l] = C(16);
5433
5437
  return /* @__PURE__ */ a.createElement(
5434
5438
  y,
@@ -5443,7 +5447,7 @@ const vl = ({
5443
5447
  /* @__PURE__ */ a.createElement(M, { variant: "caption3", color: ({ themedColor: c }) => c.textMidEmphasis }, e.csat_question),
5444
5448
  /* @__PURE__ */ a.createElement(y, { style: [s.scoresContainer, { gap: i }] }, e.csat_scores.map(({ label: c, image_url: u }, d) => {
5445
5449
  const g = d + 1, m = n === g;
5446
- return /* @__PURE__ */ a.createElement(B, { key: d, disabled: t, onPress: () => o(g), style: s.scoreButton }, /* @__PURE__ */ a.createElement(Fl, { value: g, selected: r || m, label: c, src: u }), !!c && /* @__PURE__ */ a.createElement(
5450
+ return /* @__PURE__ */ a.createElement(B, { key: d, disabled: t, onPress: () => o(g), style: s.scoreButton }, /* @__PURE__ */ a.createElement($l, { value: g, selected: r || m, label: c, src: u }), !!c && /* @__PURE__ */ a.createElement(
5447
5451
  M,
5448
5452
  {
5449
5453
  style: { textAlign: "center" },
@@ -5456,14 +5460,14 @@ const vl = ({
5456
5460
  ));
5457
5461
  }))
5458
5462
  );
5459
- }, Fl = ({
5463
+ }, $l = ({
5460
5464
  value: e,
5461
5465
  src: t,
5462
5466
  label: n,
5463
5467
  selected: o
5464
5468
  }) => {
5465
5469
  const [r, s] = C(!1), i = Po.use();
5466
- return r ? /* @__PURE__ */ a.createElement(zl, { value: e, selected: o, label: n }) : /* @__PURE__ */ a.createElement(
5470
+ return r ? /* @__PURE__ */ a.createElement(Ul, { value: e, selected: o, label: n }) : /* @__PURE__ */ a.createElement(
5467
5471
  Pe,
5468
5472
  {
5469
5473
  source: { uri: t },
@@ -5495,7 +5499,7 @@ const vl = ({
5495
5499
  height: 40,
5496
5500
  opacity: e ? 1 : 0.38
5497
5501
  })
5498
- })), $l = ({ csatPayload: e }) => /* @__PURE__ */ a.createElement(M, { style: { textAlign: "left" }, variant: "button", color: ({ themedColor: t }) => t.textHighEmphasis }, e.title), Rt = ({
5502
+ })), jl = ({ csatPayload: e }) => /* @__PURE__ */ a.createElement(M, { style: { textAlign: "left" }, variant: "button", color: ({ themedColor: t }) => t.textHighEmphasis }, e.title), Rt = ({
5499
5503
  csatPayload: e,
5500
5504
  type: t,
5501
5505
  renderSubmitButton: n,
@@ -5503,23 +5507,23 @@ const vl = ({
5503
5507
  initialCsatReason: r,
5504
5508
  initialIsResolved: s
5505
5509
  }) => {
5506
- const { params: i, setParams: l, error: c, setError: u, followUpItem: d, state: g, validateParams: m, itemProps: p } = fa({
5510
+ const { params: i, setParams: l, error: c, setError: u, followUpItem: d, state: g, validateParams: m, itemProps: p } = _a({
5507
5511
  csatPayload: e,
5508
5512
  type: t,
5509
5513
  initialCsat: o,
5510
5514
  initialCsatReason: r,
5511
5515
  initialIsResolved: s
5512
5516
  });
5513
- return /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(y, { flexDirection: "column", gap: 12 }, /* @__PURE__ */ a.createElement($l, { ...p }), t === ye.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ a.createElement(
5514
- Bl,
5517
+ return /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(y, { flexDirection: "column", gap: 12 }, /* @__PURE__ */ a.createElement(jl, { ...p }), t === ye.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ a.createElement(
5518
+ Hl,
5515
5519
  {
5516
5520
  ...p,
5517
5521
  defaultValue: s,
5518
5522
  value: i.isResolved,
5519
5523
  onChange: (f) => l({ isResolved: f })
5520
5524
  }
5521
- ), /* @__PURE__ */ a.createElement(Ul, { ...p, value: i.csat, onChange: (f) => l({ csat: f }) }), d && /* @__PURE__ */ a.createElement(
5522
- Hl,
5525
+ ), /* @__PURE__ */ a.createElement(Fl, { ...p, value: i.csat, onChange: (f) => l({ csat: f }) }), d && /* @__PURE__ */ a.createElement(
5526
+ zl,
5523
5527
  {
5524
5528
  ...p,
5525
5529
  followUpItem: d,
@@ -5530,9 +5534,9 @@ const vl = ({
5530
5534
  hasError: c.followUpItem
5531
5535
  }
5532
5536
  )), g !== "unsubmittable" && /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(Ge.Separator, null), n({ state: g, params: i, validateParams: m })));
5533
- }, jl = (e) => {
5537
+ }, Gl = (e) => {
5534
5538
  const { strings: t } = G();
5535
- return ls(e, {
5539
+ return cs(e, {
5536
5540
  title: t.csat.title,
5537
5541
  question: t.csat.question,
5538
5542
  cre: {
@@ -5546,18 +5550,18 @@ const vl = ({
5546
5550
  submit_label: t.csat.submit_label,
5547
5551
  submitted_label: t.csat.submitted_label
5548
5552
  });
5549
- }, Gl = () => {
5553
+ }, Vl = () => {
5550
5554
  const { strings: e } = G();
5551
5555
  return /* @__PURE__ */ a.createElement(M, { variant: "body2", color: ({ themedColor: t }) => t.textMidEmphasis, style: { textAlign: "center" } }, e.csat.submission_expired);
5552
- }, Vl = ({ onMount: e, children: t }) => (L(() => {
5556
+ }, Wl = ({ onMount: e, children: t }) => (L(() => {
5553
5557
  e == null || e();
5554
- }, []), /* @__PURE__ */ a.createElement(a.Fragment, null, t)), Wl = (e) => {
5558
+ }, []), /* @__PURE__ */ a.createElement(a.Fragment, null, t)), ql = (e) => {
5555
5559
  if (e.messageType !== "admin.csat")
5556
5560
  throw new Error("Invalid message type");
5557
- const { extendedMessagePayload: t, onSubmitCSAT: n, onScrollToBottom: o } = e, { csat: r, csatReason: s, csatExpireAt: i, isResolvedWhenDeterminedByUser: l } = e, [, c] = C(0), u = jl(t == null ? void 0 : t.csat), d = j(!1), g = ql.use();
5561
+ const { extendedMessagePayload: t, onSubmitCSAT: n, onScrollToBottom: o } = e, { csat: r, csatReason: s, csatExpireAt: i, isResolvedWhenDeterminedByUser: l } = e, [, c] = C(0), u = Gl(t == null ? void 0 : t.csat), d = j(!1), g = Yl.use();
5558
5562
  if (!u || !u.visibility || !ye[u.type]) return null;
5559
5563
  const m = u.type === ye.AI_AGENT_CSAT_5 || u.type === ye.AI_AGENT_CSAT_5_WITH_CRE || u.type === ye.HELPDESK_CSAT_5 ? Rt : () => null;
5560
- return /* @__PURE__ */ a.createElement(y, { style: g.container }, !r && Rn(i) ? /* @__PURE__ */ a.createElement(Gl, null) : /* @__PURE__ */ a.createElement(
5564
+ return /* @__PURE__ */ a.createElement(y, { style: g.container }, !r && Rn(i) ? /* @__PURE__ */ a.createElement(Vl, null) : /* @__PURE__ */ a.createElement(
5561
5565
  m,
5562
5566
  {
5563
5567
  csatPayload: u,
@@ -5565,7 +5569,7 @@ const vl = ({
5565
5569
  initialCsat: r,
5566
5570
  initialCsatReason: s,
5567
5571
  initialIsResolved: l,
5568
- renderSubmitButton: ({ state: p, params: f, validateParams: E }) => /* @__PURE__ */ a.createElement(Vl, { onMount: o }, /* @__PURE__ */ a.createElement(
5572
+ renderSubmitButton: ({ state: p, params: f, validateParams: E }) => /* @__PURE__ */ a.createElement(Wl, { onMount: o }, /* @__PURE__ */ a.createElement(
5569
5573
  B,
5570
5574
  {
5571
5575
  activeOpacity: 0.75,
@@ -5581,7 +5585,7 @@ const vl = ({
5581
5585
  ))
5582
5586
  }
5583
5587
  ));
5584
- }, ql = O.create(({ theme: e, themedColor: t }) => ({
5588
+ }, Yl = O.create(({ theme: e, themedColor: t }) => ({
5585
5589
  container: {
5586
5590
  flexDirection: "column",
5587
5591
  backgroundColor: e.colors.csat.background,
@@ -5604,16 +5608,16 @@ const vl = ({
5604
5608
  let o;
5605
5609
  return n === "submitted" ? o = t.textHighEmphasis : n === "unsubmittable" ? o = t.textLowEmphasis : o = e.colors.base.primaryContrastContent, { color: o };
5606
5610
  }
5607
- })), Yl = (e) => {
5611
+ })), Kl = (e) => {
5608
5612
  const { components: t } = bn.useContext(), n = e.messageType === "admin" ? /* @__PURE__ */ a.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ a.createElement(t.CSATMessage, { ...e }) : null;
5609
5613
  return /* @__PURE__ */ a.createElement(y, { paddingHorizontal: P.HORIZONTAL_PADDING, marginBottom: rn(e.groupType) }, n);
5610
5614
  }, bn = ce({
5611
- template: Yl,
5615
+ template: Kl,
5612
5616
  components: {
5613
- AdminMessage: Il,
5614
- CSATMessage: Wl
5617
+ AdminMessage: kl,
5618
+ CSATMessage: ql
5615
5619
  }
5616
- }), Kl = ({ style: e, ...t }) => {
5620
+ }), Xl = ({ style: e, ...t }) => {
5617
5621
  const { strings: n } = G();
5618
5622
  if (!an("powered-by")) return null;
5619
5623
  const r = () => {
@@ -5621,21 +5625,21 @@ const vl = ({
5621
5625
  "https://delight.ai?utm_medium=product&utm_source=aiagent&utm_campaign=fy26-glbl-ai-agent-poweredby"
5622
5626
  );
5623
5627
  };
5624
- return /* @__PURE__ */ a.createElement(y, { style: [Xl.container, e], ...t }, /* @__PURE__ */ a.createElement(M, { variant: "caption2", color: ({ themedColor: s }) => s.textLowEmphasis }, n.conversation.powered_by + " "), /* @__PURE__ */ a.createElement(B, { onPress: r }, /* @__PURE__ */ a.createElement(M, { variant: "caption2", color: ({ themedColor: s }) => s.textLowEmphasis }, "Sendbird")));
5625
- }, Xl = Q.create({
5628
+ return /* @__PURE__ */ a.createElement(y, { style: [Zl.container, e], ...t }, /* @__PURE__ */ a.createElement(M, { variant: "caption2", color: ({ themedColor: s }) => s.textLowEmphasis }, n.conversation.powered_by + " "), /* @__PURE__ */ a.createElement(B, { onPress: r }, /* @__PURE__ */ a.createElement(M, { variant: "caption2", color: ({ themedColor: s }) => s.textLowEmphasis }, "Sendbird")));
5629
+ }, Zl = Q.create({
5626
5630
  container: {
5627
5631
  flexDirection: "row",
5628
5632
  justifyContent: "center",
5629
5633
  alignItems: "center"
5630
5634
  }
5631
- }), Zl = () => {
5635
+ }), Jl = () => {
5632
5636
  var l;
5633
- const { strings: e } = G(), { channelSource: t, scrollSource: n, updateActiveChannel: o } = ve(), r = Jl.use(), s = ge(t.channel), i = j(s);
5637
+ const { strings: e } = G(), { channelSource: t, scrollSource: n, updateActiveChannel: o } = ve(), r = Ql.use(), s = ge(t.channel), i = j(s);
5634
5638
  return L(() => {
5635
5639
  const c = i.current;
5636
5640
  i.current = s, !c && s && n.actions.scrollToBottom();
5637
5641
  }, [s, n]), !((l = t.channel) != null && l.isAIAgent) || !s ? null : /* @__PURE__ */ a.createElement(y, { justifyContent: "center", flexDirection: "row", style: r.wrapper }, /* @__PURE__ */ a.createElement(B, { activeOpacity: 0.75, onPress: () => o(), style: r.button }, /* @__PURE__ */ a.createElement(M, { variant: "button", role: "button", color: ({ themedColor: c }) => c.textHighEmphasis }, e.conversation.start_new_conversation_label)));
5638
- }, Jl = O.create(({ themedColor: e }) => ({
5642
+ }, Ql = O.create(({ themedColor: e }) => ({
5639
5643
  wrapper: {
5640
5644
  marginBottom: 16
5641
5645
  },
@@ -5646,13 +5650,13 @@ const vl = ({
5646
5650
  borderWidth: 1,
5647
5651
  borderColor: e.textDisabled
5648
5652
  }
5649
- })), Ql = ({ date: e = Date.now(), style: t, ...n }) => {
5653
+ })), ec = ({ date: e = Date.now(), style: t, ...n }) => {
5650
5654
  const { format: o, strings: r } = G();
5651
5655
  return /* @__PURE__ */ a.createElement(y, { flexDirection: "row", justifyContent: "center", alignItems: "center", style: t, ...n }, /* @__PURE__ */ a.createElement(M, { variant: "caption4", color: ({ themedColor: s }) => s.textMidEmphasis }, o(e, r.date_format.date_separator)));
5652
- }, ec = ({ style: e, onPress: t }) => {
5653
- const n = tc.use(), { theme: o } = W();
5656
+ }, tc = ({ style: e, onPress: t }) => {
5657
+ const n = nc.use(), { theme: o } = W();
5654
5658
  return /* @__PURE__ */ a.createElement(B, { style: [n.button, e], onPress: t }, /* @__PURE__ */ a.createElement(y, { alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ a.createElement(U, { size: 24, type: "chevron-down", color: o.colors.base.primary })));
5655
- }, tc = O.create(({ select: e, theme: t }) => ({
5659
+ }, nc = O.create(({ select: e, theme: t }) => ({
5656
5660
  button: {
5657
5661
  width: 40,
5658
5662
  height: 40,
@@ -5680,13 +5684,13 @@ const vl = ({
5680
5684
  }
5681
5685
  ]
5682
5686
  }
5683
- })), nc = () => null, Oo = ce({
5684
- template: nc,
5687
+ })), oc = () => null, Oo = ce({
5688
+ template: oc,
5685
5689
  components: {
5686
- DateSeparator: Ql,
5687
- ScrollToBottomButton: ec
5690
+ DateSeparator: ec,
5691
+ ScrollToBottomButton: tc
5688
5692
  }
5689
- }), oc = (e, t) => !yr((t == null ? void 0 : t.createdAt) ?? 0, e.createdAt), rc = ({
5693
+ }), rc = (e, t) => !br((t == null ? void 0 : t.createdAt) ?? 0, e.createdAt), sc = ({
5690
5694
  messageStackDirection: e = "top"
5691
5695
  }) => {
5692
5696
  var R, $;
@@ -5696,7 +5700,7 @@ const vl = ({
5696
5700
  channelSource: E,
5697
5701
  scrollSource: h,
5698
5702
  state: { input: v, streamAnimation: _ }
5699
- } = ve(), b = sc.use(), S = Oe(["left", "right"]), T = ha(E.channel);
5703
+ } = ve(), b = ac.use(), S = Oe(["left", "right"]), T = pa(E.channel);
5700
5704
  L(() => {
5701
5705
  h.state.isAwayFromBottom || f.resetNewMessages();
5702
5706
  }, [h.state.isAwayFromBottom]);
@@ -5728,7 +5732,7 @@ const vl = ({
5728
5732
  }, q = ({ item: A, index: H }) => {
5729
5733
  const K = f.messages[H + 1], oe = f.messages[H - 1], Me = (() => {
5730
5734
  var z, F, ae;
5731
- const Ce = !(d != null && d.isUserFeedbackEnabled && Xe(A, d == null ? void 0 : d.userId) && !ct.isWelcomeMessage(A)), Te = Dr(A, K, oe, Ce), I = {
5735
+ const Ce = !(d != null && d.isUserFeedbackEnabled && Xe(A, d == null ? void 0 : d.userId) && !ct.isWelcomeMessage(A)), Te = Pr(A, K, oe, Ce), I = {
5732
5736
  data: A.data,
5733
5737
  extendedMessagePayload: A.extendedMessagePayload,
5734
5738
  message: A.message,
@@ -5742,7 +5746,7 @@ const vl = ({
5742
5746
  ...I,
5743
5747
  ...p,
5744
5748
  messageType: "admin.csat",
5745
- isResolvedWhenDeterminedByUser: as(p),
5749
+ isResolvedWhenDeterminedByUser: is(p),
5746
5750
  onSubmitCSAT: async (re) => {
5747
5751
  var ie;
5748
5752
  await ((ie = E.channel) == null ? void 0 : ie.submitCSAT(re));
@@ -5808,7 +5812,7 @@ const vl = ({
5808
5812
  };
5809
5813
  if (!X)
5810
5814
  return u.aiAgent.deleteMessageFeedback(pe);
5811
- const we = { ...pe, rating: cl(X.rating), comment: X.comment };
5815
+ const we = { ...pe, rating: ul(X.rating), comment: X.comment };
5812
5816
  return ct.hasFeedback(A) ? u.aiAgent.updateMessageFeedback(we) : u.aiAgent.createMessageFeedback(we);
5813
5817
  },
5814
5818
  onSubmitForm: ({ key: X, data: pe }) => u.aiAgent.submitForm({
@@ -5838,9 +5842,9 @@ const vl = ({
5838
5842
  return /* @__PURE__ */ a.createElement(t, { ...He, messageType: "file", file: A });
5839
5843
  }
5840
5844
  return null;
5841
- })(), Be = oc(A, K) && /* @__PURE__ */ a.createElement(r.DateSeparator, { date: A.createdAt, style: b.dateSeparator });
5845
+ })(), Be = rc(A, K) && /* @__PURE__ */ a.createElement(r.DateSeparator, { date: A.createdAt, style: b.dateSeparator });
5842
5846
  return /* @__PURE__ */ a.createElement(y, null, Be, Me);
5843
- }, Y = () => /* @__PURE__ */ a.createElement(Kl, { style: b.poweredBy }), V = () => {
5847
+ }, Y = () => /* @__PURE__ */ a.createElement(Xl, { style: b.poweredBy }), V = () => {
5844
5848
  var A, H;
5845
5849
  return /* @__PURE__ */ a.createElement(a.Fragment, null, T && /* @__PURE__ */ a.createElement(y, { marginTop: f.messages.length === 0 ? 8 : 0 }, /* @__PURE__ */ a.createElement(
5846
5850
  t,
@@ -5853,7 +5857,7 @@ const vl = ({
5853
5857
  message: "",
5854
5858
  isSenderAvatarVisible: (A = l == null ? void 0 : l.conversation) == null ? void 0 : A.senderAvatarEnabled
5855
5859
  }
5856
- )), ((H = l == null ? void 0 : l.conversation) == null ? void 0 : H.isTalkToAgentViewEnabled) && /* @__PURE__ */ a.createElement(Zl, null), h.state.bottomSpace ? /* @__PURE__ */ a.createElement(y, { height: h.state.bottomSpace }) : null);
5860
+ )), ((H = l == null ? void 0 : l.conversation) == null ? void 0 : H.isTalkToAgentViewEnabled) && /* @__PURE__ */ a.createElement(Jl, null), h.state.bottomSpace ? /* @__PURE__ */ a.createElement(y, { height: h.state.bottomSpace }) : null);
5857
5861
  };
5858
5862
  return /* @__PURE__ */ a.createElement(y, { flex: 1 }, /* @__PURE__ */ a.createElement(
5859
5863
  xo,
@@ -5864,7 +5868,7 @@ const vl = ({
5864
5868
  stackDirection: e,
5865
5869
  data: f.messages,
5866
5870
  onEndReached: f.loadPrevious,
5867
- keyExtractor: Lr,
5871
+ keyExtractor: Dr,
5868
5872
  renderItem: q,
5869
5873
  loading: !f.initialized || !E.channel,
5870
5874
  empty: f.messages.length === 0 && !T,
@@ -5888,7 +5892,7 @@ const vl = ({
5888
5892
  ...h.props
5889
5893
  }
5890
5894
  ), (($ = l == null ? void 0 : l.conversation) == null ? void 0 : $.newMessageIndicatorEnabled) && h.state.isAwayFromBottom && f.newMessages.length > 0 && /* @__PURE__ */ a.createElement(y, { style: b.newMessagesButtonContainer }, /* @__PURE__ */ a.createElement(
5891
- Ri,
5895
+ Li,
5892
5896
  {
5893
5897
  label: i.conversation.scroll_to_new_messages_label(f.newMessages),
5894
5898
  accessibilityLabel: i.conversation.a11y_scroll_to_new_messages,
@@ -5901,7 +5905,7 @@ const vl = ({
5901
5905
  onPress: () => h.actions.scrollToBottom()
5902
5906
  }
5903
5907
  ));
5904
- }, sc = O.create(({ theme: e }) => ({
5908
+ }, ac = O.create(({ theme: e }) => ({
5905
5909
  list: {
5906
5910
  flex: 1,
5907
5911
  backgroundColor: e.colors.base.background
@@ -5931,7 +5935,7 @@ const vl = ({
5931
5935
  IMAGE_PICKER_NOT_CONFIGURED: "Image picker is not configured. Please provide imagePicker in NativeAdapterConfig to use camera or gallery features.",
5932
5936
  DOCUMENT_PICKER_NOT_CONFIGURED: "Document picker is not configured. Please provide documentPicker in NativeAdapterConfig to use file selection features."
5933
5937
  };
5934
- function ac(e) {
5938
+ function ic(e) {
5935
5939
  return {
5936
5940
  captureCamera: async () => {
5937
5941
  if (e.requestCameraPermissionsAsync && !(await e.requestCameraPermissionsAsync()).granted)
@@ -5955,7 +5959,7 @@ function ac(e) {
5955
5959
  }
5956
5960
  };
5957
5961
  }
5958
- function ic(e, t) {
5962
+ function lc(e, t) {
5959
5963
  const n = async () => {
5960
5964
  const r = te.select({
5961
5965
  ios: t.PERMISSIONS.IOS.CAMERA,
@@ -6006,18 +6010,18 @@ function ic(e, t) {
6006
6010
  }
6007
6011
  };
6008
6012
  }
6009
- function lc(e) {
6013
+ function cc(e) {
6010
6014
  return {
6011
6015
  selectFile: async (t) => {
6012
6016
  const n = (t == null ? void 0 : t.mimeTypes) ?? ["*/*"], o = await e.getDocumentAsync({
6013
6017
  multiple: t != null && t.selectionLimit ? t.selectionLimit > 1 : !1,
6014
6018
  type: n
6015
6019
  });
6016
- return o.canceled || !o.assets || o.assets.length === 0 ? null : o.assets.map(uc);
6020
+ return o.canceled || !o.assets || o.assets.length === 0 ? null : o.assets.map(dc);
6017
6021
  }
6018
6022
  };
6019
6023
  }
6020
- function cc(e) {
6024
+ function uc(e) {
6021
6025
  return {
6022
6026
  selectFile: async (t) => {
6023
6027
  try {
@@ -6026,7 +6030,7 @@ function cc(e) {
6026
6030
  allowMultiSelection: t != null && t.selectionLimit ? t.selectionLimit > 1 : !1,
6027
6031
  type: o
6028
6032
  });
6029
- return (Array.isArray(r) ? r : [r]).map(dc);
6033
+ return (Array.isArray(r) ? r : [r]).map(mc);
6030
6034
  } catch (n) {
6031
6035
  if (n && typeof n == "object" && "message" in n) {
6032
6036
  const o = String(n.message).toLowerCase();
@@ -6049,7 +6053,7 @@ function Kn(e) {
6049
6053
  height: e.height
6050
6054
  };
6051
6055
  }
6052
- function uc(e) {
6056
+ function dc(e) {
6053
6057
  return {
6054
6058
  uri: e.uri,
6055
6059
  type: e.mimeType || "application/octet-stream",
@@ -6067,7 +6071,7 @@ function Xn(e) {
6067
6071
  height: e.height
6068
6072
  };
6069
6073
  }
6070
- function dc(e) {
6074
+ function mc(e) {
6071
6075
  return {
6072
6076
  uri: e.uri,
6073
6077
  type: e.type || "application/octet-stream",
@@ -6075,7 +6079,7 @@ function dc(e) {
6075
6079
  name: e.name || "document"
6076
6080
  };
6077
6081
  }
6078
- function mc() {
6082
+ function gc() {
6079
6083
  return {
6080
6084
  captureCamera: async () => {
6081
6085
  throw new Error(be.IMAGE_PICKER_NOT_CONFIGURED);
@@ -6085,49 +6089,49 @@ function mc() {
6085
6089
  }
6086
6090
  };
6087
6091
  }
6088
- function gc() {
6092
+ function hc() {
6089
6093
  return {
6090
6094
  selectFile: async () => {
6091
6095
  throw new Error(be.DOCUMENT_PICKER_NOT_CONFIGURED);
6092
6096
  }
6093
6097
  };
6094
6098
  }
6095
- const { Provider: hc, useContext: pc } = ne("NativeAdapter"), fc = ({ config: e, children: t }) => {
6099
+ const { Provider: pc, useContext: fc } = ne("NativeAdapter"), _c = ({ config: e, children: t }) => {
6096
6100
  const n = J(() => {
6097
- const { imagePicker: o, documentPicker: r, mmkv: s } = e, i = o ? (_c(e), "launchCameraAsync" in o ? ac(o) : ic(o, e.permissions)) : mc(), l = r ? "getDocumentAsync" in r ? lc(r) : cc(r) : gc();
6101
+ const { imagePicker: o, documentPicker: r, mmkv: s } = e, i = o ? (yc(e), "launchCameraAsync" in o ? ic(o) : lc(o, e.permissions)) : gc(), l = r ? "getDocumentAsync" in r ? cc(r) : uc(r) : hc();
6098
6102
  return {
6099
6103
  ...i,
6100
6104
  ...l,
6101
- keyValueStorage: fs(s)
6105
+ keyValueStorage: _s(s)
6102
6106
  };
6103
6107
  }, [e.imagePicker, e.documentPicker, e.mmkv, e.permissions]);
6104
- return /* @__PURE__ */ a.createElement(hc, { value: n }, t);
6108
+ return /* @__PURE__ */ a.createElement(pc, { value: n }, t);
6105
6109
  };
6106
- function _c(e) {
6110
+ function yc(e) {
6107
6111
  if (!e.imagePicker) return;
6108
6112
  if (!("launchCameraAsync" in e.imagePicker) && !e.permissions)
6109
6113
  throw new Error(
6110
6114
  "react-native-permissions is required when using react-native-image-picker. Please install react-native-permissions and provide it in nativeModules.permissions"
6111
6115
  );
6112
6116
  }
6113
- const yc = ({ onPressAddAttachment: e, disabled: t }) => /* @__PURE__ */ a.createElement(B, { disabled: t, style: bc.container, activeOpacity: 0.75, onPress: e }, /* @__PURE__ */ a.createElement(
6117
+ const bc = ({ onPressAddAttachment: e, disabled: t }) => /* @__PURE__ */ a.createElement(B, { disabled: t, style: Ec.container, activeOpacity: 0.75, onPress: e }, /* @__PURE__ */ a.createElement(
6114
6118
  U,
6115
6119
  {
6116
6120
  type: "add",
6117
6121
  size: 24,
6118
6122
  color: ({ themedColor: n }) => t ? n.textDisabled : n.primary
6119
6123
  }
6120
- )), bc = Q.create({
6124
+ )), Ec = Q.create({
6121
6125
  container: {
6122
6126
  width: 32,
6123
6127
  height: 32,
6124
6128
  justifyContent: "center",
6125
6129
  alignItems: "center"
6126
6130
  }
6127
- }), Ec = ({ name: e, type: t, url: n, onRemove: o }) => {
6128
- const r = vc.use();
6129
- return /* @__PURE__ */ a.createElement(y, { style: r.wrapper }, Pr(t) ? /* @__PURE__ */ a.createElement(Pe, { source: { uri: n }, style: r.image, resizeMode: "cover" }) : /* @__PURE__ */ a.createElement(pn, { name: e, type: on(e, t) }), o && /* @__PURE__ */ a.createElement(B, { onPress: o, style: r.removeButton }, /* @__PURE__ */ a.createElement(U, { type: "remove", size: 20, color: r.removeIcon.tintColor })));
6130
- }, st = 7, vc = O.create(({ themedColor: e }) => ({
6131
+ }), vc = ({ name: e, type: t, url: n, onRemove: o }) => {
6132
+ const r = Cc.use();
6133
+ return /* @__PURE__ */ a.createElement(y, { style: r.wrapper }, Or(t) ? /* @__PURE__ */ a.createElement(Pe, { source: { uri: n }, style: r.image, resizeMode: "cover" }) : /* @__PURE__ */ a.createElement(pn, { name: e, type: on(e, t) }), o && /* @__PURE__ */ a.createElement(B, { onPress: o, style: r.removeButton }, /* @__PURE__ */ a.createElement(U, { type: "remove", size: 20, color: r.removeIcon.tintColor })));
6134
+ }, st = 7, Cc = O.create(({ themedColor: e }) => ({
6131
6135
  wrapper: {
6132
6136
  marginTop: st,
6133
6137
  marginRight: st,
@@ -6153,8 +6157,8 @@ const yc = ({ onPressAddAttachment: e, disabled: t }) => /* @__PURE__ */ a.creat
6153
6157
  removeIcon: {
6154
6158
  tintColor: e.textMidEmphasis
6155
6159
  }
6156
- })), Cc = (e) => {
6157
- const { theme: t, themedColor: n } = W(), o = Sc.use(), r = dn.useTextAlign({
6160
+ })), Sc = (e) => {
6161
+ const { theme: t, themedColor: n } = W(), o = Ac.use(), r = dn.useTextAlign({
6158
6162
  text: e.value ?? e.placeholder,
6159
6163
  style: o.input,
6160
6164
  isTextInput: !0
@@ -6168,7 +6172,7 @@ const yc = ({ onPressAddAttachment: e, disabled: t }) => /* @__PURE__ */ a.creat
6168
6172
  ...e
6169
6173
  }
6170
6174
  )));
6171
- }, Sc = O.create(({ theme: e }) => ({
6175
+ }, Ac = O.create(({ theme: e }) => ({
6172
6176
  container: {
6173
6177
  backgroundColor: e.colors.messageInput.background,
6174
6178
  gap: 16,
@@ -6180,7 +6184,7 @@ const yc = ({ onPressAddAttachment: e, disabled: t }) => /* @__PURE__ */ a.creat
6180
6184
  minHeight: 36
6181
6185
  },
6182
6186
  input: {
6183
- ...Ac(e.typography.body3),
6187
+ ...Tc(e.typography.body3),
6184
6188
  color: e.colors.messageInput.text,
6185
6189
  includeFontPadding: !1,
6186
6190
  padding: 0,
@@ -6188,25 +6192,25 @@ const yc = ({ onPressAddAttachment: e, disabled: t }) => /* @__PURE__ */ a.creat
6188
6192
  textAlignVertical: "center"
6189
6193
  }
6190
6194
  }));
6191
- function Ac(e) {
6195
+ function Tc(e) {
6192
6196
  const t = {
6193
6197
  maxHeight: 52
6194
6198
  };
6195
6199
  return e.fontFamily && (t.fontFamily = e.fontFamily), typeof e.fontSize == "number" && (t.fontSize = e.fontSize, t.maxHeight = e.fontSize * 3.5), typeof e.lineHeight == "number" && (t.lineHeight = e.lineHeight, t.maxHeight = e.lineHeight * 3.5), e.fontWeight && (t.fontWeight = e.fontWeight), t;
6196
6200
  }
6197
- const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: wc.container, activeOpacity: 0.75, onPress: e }, /* @__PURE__ */ a.createElement(U, { type: "send", size: 24 })), wc = Q.create({
6201
+ const wc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: xc.container, activeOpacity: 0.75, onPress: e }, /* @__PURE__ */ a.createElement(U, { type: "send", size: 24 })), xc = Q.create({
6198
6202
  container: {
6199
6203
  width: 32,
6200
6204
  height: 32,
6201
6205
  justifyContent: "center",
6202
6206
  alignItems: "center"
6203
6207
  }
6204
- }), xc = () => {
6205
- const e = Ic.use(), { aiAgentInfo: t, userSession: n } = ue(), { messageSource: o, channelSource: r } = ve(), [s, i] = C(null), l = an("special-notice", r.channel), c = w(() => r.channel ? l ? o.messages.some((u) => Xe(u, (n == null ? void 0 : n.userId) ?? "")) : !0 : null, [r.channel, l, o.messages, n == null ? void 0 : n.userId]);
6208
+ }), Ic = () => {
6209
+ const e = kc.use(), { aiAgentInfo: t, userSession: n } = ue(), { messageSource: o, channelSource: r } = ve(), [s, i] = C(null), l = an("special-notice", r.channel), c = w(() => r.channel ? l ? o.messages.some((u) => Xe(u, (n == null ? void 0 : n.userId) ?? "")) : !0 : null, [r.channel, l, o.messages, n == null ? void 0 : n.userId]);
6206
6210
  return L(() => {
6207
6211
  s || i(c());
6208
6212
  }, [c, s]), s || !(t != null && t.specialNotice) ? null : /* @__PURE__ */ a.createElement(y, { style: e.container }, /* @__PURE__ */ a.createElement(fn, { textStyle: e.text, linkStyle: e.link }, (t == null ? void 0 : t.specialNotice) ?? ""));
6209
- }, Ic = O.create(({ theme: e, themedColor: t, select: n }) => ({
6213
+ }, kc = O.create(({ theme: e, themedColor: t, select: n }) => ({
6210
6214
  container: {
6211
6215
  backgroundColor: e.colors.base.background,
6212
6216
  paddingVertical: 8,
@@ -6226,7 +6230,7 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6226
6230
  dark: e.palette.information.main
6227
6231
  })
6228
6232
  }
6229
- })), kc = () => {
6233
+ })), Mc = () => {
6230
6234
  var E;
6231
6235
  const { chatSDK: e } = ee(), { strings: t } = G(), { createAttachmentRules: n } = ue(), { channelSource: o, state: r } = ve(), [s, i] = C(""), [l, c] = C([]), u = n({
6232
6236
  channel: o.channel,
@@ -6286,8 +6290,8 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6286
6290
  acceptableMimeTypes: u.supportedMimeTypes,
6287
6291
  maxAttachmentCount: u.maxAttachmentCount
6288
6292
  };
6289
- }, Mc = () => {
6290
- const { config: e } = ee(), t = pc(), { strings: n } = G(), { messageSource: o } = ve(), { openModal: r } = cn(), s = Oe(["left", "right", "bottom"]), i = Rc.use(), {
6293
+ }, Rc = () => {
6294
+ const { config: e } = ee(), t = fc(), { strings: n } = G(), { messageSource: o } = ve(), { openModal: r } = cn(), s = Oe(["left", "right", "bottom"]), i = Lc.use(), {
6291
6295
  maxAttachmentCount: l,
6292
6296
  sendButtonVisible: c,
6293
6297
  addAttachmentButtonVisible: u,
@@ -6296,7 +6300,7 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6296
6300
  hasImageMimeTypes: m,
6297
6301
  hasFileMimeTypes: p,
6298
6302
  ...f
6299
- } = kc(), v = {
6303
+ } = Mc(), v = {
6300
6304
  ...f,
6301
6305
  onPressAddAttachment: async () => {
6302
6306
  const _ = await r((b) => {
@@ -6355,13 +6359,13 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6355
6359
  }), f.clearFiles(), f.onChangeText("");
6356
6360
  }
6357
6361
  };
6358
- return /* @__PURE__ */ a.createElement(no, { behavior: "padding", keyboardVerticalOffset: -s.paddingBottom }, /* @__PURE__ */ a.createElement(xc, null), /* @__PURE__ */ a.createElement(y, { style: i.container(s) }, u && /* @__PURE__ */ a.createElement(yc, { ...v, disabled: d }), /* @__PURE__ */ a.createElement(
6359
- Cc,
6362
+ return /* @__PURE__ */ a.createElement(no, { behavior: "padding", keyboardVerticalOffset: -s.paddingBottom }, /* @__PURE__ */ a.createElement(Ic, null), /* @__PURE__ */ a.createElement(y, { style: i.container(s) }, u && /* @__PURE__ */ a.createElement(bc, { ...v, disabled: d }), /* @__PURE__ */ a.createElement(
6363
+ Sc,
6360
6364
  {
6361
6365
  ...v,
6362
6366
  value: v.editable ? v.value : "",
6363
6367
  attachments: v.files.length === 0 ? null : v.files.map((_, b) => /* @__PURE__ */ a.createElement(
6364
- Ec,
6368
+ vc,
6365
6369
  {
6366
6370
  key: b,
6367
6371
  name: _.name,
@@ -6371,8 +6375,8 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6371
6375
  }
6372
6376
  ))
6373
6377
  }
6374
- ), c && /* @__PURE__ */ a.createElement(Tc, { ...v })));
6375
- }, Rc = O.create(({ theme: e }) => ({
6378
+ ), c && /* @__PURE__ */ a.createElement(wc, { ...v })));
6379
+ }, Lc = O.create(({ theme: e }) => ({
6376
6380
  container: ({ paddingStart: t, paddingEnd: n, paddingBottom: o }) => ({
6377
6381
  alignItems: "center",
6378
6382
  flexDirection: "row",
@@ -6388,9 +6392,9 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6388
6392
  i(m.nativeEvent.layout.width);
6389
6393
  }, d = (m) => {
6390
6394
  c(m.nativeEvent.layout.width);
6391
- }, g = Lc.use();
6395
+ }, g = Dc.use();
6392
6396
  return /* @__PURE__ */ a.createElement(y, { style: g.container }, /* @__PURE__ */ a.createElement(y, { height: r.paddingTop }), /* @__PURE__ */ a.createElement(y, { style: g.contentContainer(r) }, n === "center" && t && /* @__PURE__ */ a.createElement(y, { style: g.centerTitleContainer(Math.max(s, l)) }, /* @__PURE__ */ a.createElement(y, { style: g.centerTitle }, t)), /* @__PURE__ */ a.createElement(y, { style: g.rowContainer }, /* @__PURE__ */ a.createElement(y, { style: g.startSide, onLayout: u }, e), (n === "start" || n === "end") && t && /* @__PURE__ */ a.createElement(y, { style: g.titleSide(n, e, o) }, t), /* @__PURE__ */ a.createElement(y, { style: g.endSide, onLayout: d }, o))));
6393
- }, Lc = O.create(({ theme: e, themedColor: t }) => ({
6397
+ }, Dc = O.create(({ theme: e, themedColor: t }) => ({
6394
6398
  container: {
6395
6399
  width: "100%",
6396
6400
  backgroundColor: e.colors.base.headerBackground,
@@ -6436,10 +6440,10 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6436
6440
  marginStart: o ? 8 : 0,
6437
6441
  marginEnd: r ? 8 : 0
6438
6442
  })
6439
- })), Dc = () => {
6443
+ })), Pc = () => {
6440
6444
  const { themedColor: e } = W(), { onClose: t } = ve();
6441
6445
  return t ? /* @__PURE__ */ a.createElement(B, { hitSlop: 4, onPress: t, activeOpacity: 0.75 }, /* @__PURE__ */ a.createElement(U, { color: e.textHighEmphasis, type: "close", size: 24 })) : null;
6442
- }, Pc = () => {
6446
+ }, Oc = () => {
6443
6447
  const { themedColor: e } = W(), {
6444
6448
  channelSource: { channel: t }
6445
6449
  } = ve(), n = an("handoff-button", t), o = !ho(t) || De(t);
@@ -6460,7 +6464,7 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6460
6464
  }
6461
6465
  )
6462
6466
  ) : null;
6463
- }, Oc = () => {
6467
+ }, Nc = () => {
6464
6468
  const { strings: e } = G(), { themedColor: t } = W(), { onNavigateToConversationList: n } = ve();
6465
6469
  return n ? /* @__PURE__ */ a.createElement(
6466
6470
  B,
@@ -6487,13 +6491,13 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6487
6491
  },
6488
6492
  /* @__PURE__ */ a.createElement(U, { type: r, size: t * 0.55, color: i.colors.base.primaryContrastContent })
6489
6493
  );
6490
- }, Nc = () => {
6494
+ }, Bc = () => {
6491
6495
  var i, l;
6492
6496
  const {
6493
6497
  channelSource: { channel: e }
6494
6498
  } = ve(), { userSession: t, aiAgentInfo: n } = ue(), { config: o } = ee(), r = bo({ channel: e, userSession: t, aiAgentInfo: n }), s = (l = (i = o == null ? void 0 : o.conversation) == null ? void 0 : i.header) == null ? void 0 : l.avatarEnabled;
6495
6499
  return /* @__PURE__ */ a.createElement(y, { gap: 6, flexDirection: "row", alignItems: "center", maxWidth: "100%" }, s && /* @__PURE__ */ a.createElement(Bo, { channel: e, size: 34 }), /* @__PURE__ */ a.createElement(y, { flexShrink: 1 }, /* @__PURE__ */ a.createElement(M, { numberOfLines: 1, variant: "h1" }, r.title)));
6496
- }, Bc = (e) => {
6500
+ }, Hc = (e) => {
6497
6501
  const { components: t } = Ne.useContext();
6498
6502
  return /* @__PURE__ */ a.createElement(
6499
6503
  No,
@@ -6504,47 +6508,47 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6504
6508
  end: /* @__PURE__ */ a.createElement(t.EndArea, null)
6505
6509
  }
6506
6510
  );
6507
- }, Hc = () => {
6511
+ }, zc = () => {
6508
6512
  const { components: e } = Ne.useContext();
6509
6513
  return /* @__PURE__ */ a.createElement(e.MenuButton, null);
6510
- }, zc = () => {
6514
+ }, Uc = () => {
6511
6515
  const { components: e } = Ne.useContext();
6512
6516
  return /* @__PURE__ */ a.createElement(e.Title, null);
6513
- }, Uc = () => {
6517
+ }, Fc = () => {
6514
6518
  const { components: e } = Ne.useContext();
6515
6519
  return /* @__PURE__ */ a.createElement(y, { flexDirection: "row", alignItems: "center", gap: 10 }, /* @__PURE__ */ a.createElement(e.HandoffButton, null), /* @__PURE__ */ a.createElement(e.CloseButton, null));
6516
6520
  }, Ne = ce({
6517
- template: Bc,
6521
+ template: Hc,
6518
6522
  components: {
6519
- StartArea: Hc,
6520
- TitleArea: zc,
6521
- EndArea: Uc,
6522
- MenuButton: Oc,
6523
- Title: Nc,
6524
- HandoffButton: Pc,
6525
- CloseButton: Dc
6526
- }
6527
- }), Fc = () => {
6523
+ StartArea: zc,
6524
+ TitleArea: Uc,
6525
+ EndArea: Fc,
6526
+ MenuButton: Nc,
6527
+ Title: Bc,
6528
+ HandoffButton: Oc,
6529
+ CloseButton: Pc
6530
+ }
6531
+ }), $c = () => {
6528
6532
  const { Template: e } = Ne.useContext();
6529
6533
  return /* @__PURE__ */ a.createElement(e, { titleAlign: "start" });
6530
- }, $c = (e) => {
6534
+ }, jc = (e) => {
6531
6535
  const { components: t } = En.useContext();
6532
6536
  return /* @__PURE__ */ a.createElement(y, { flex: 1 }, /* @__PURE__ */ a.createElement(t.Header, null), /* @__PURE__ */ a.createElement(t.Body, null), /* @__PURE__ */ a.createElement(t.Footer, null));
6533
6537
  }, En = ce({
6534
- template: $c,
6538
+ template: jc,
6535
6539
  components: {
6536
- Header: Fc,
6537
- Body: rc,
6538
- Footer: Mc
6540
+ Header: $c,
6541
+ Body: sc,
6542
+ Footer: Rc
6539
6543
  }
6540
- }), jc = ({ children: e, ...t }) => {
6544
+ }), Gc = ({ children: e, ...t }) => {
6541
6545
  const { Template: n } = En.useContext();
6542
- return /* @__PURE__ */ a.createElement(Fa, { ...t }, /* @__PURE__ */ a.createElement(n, null), e);
6546
+ return /* @__PURE__ */ a.createElement($a, { ...t }, /* @__PURE__ */ a.createElement(n, null), e);
6543
6547
  }, {
6544
- Provider: Gc,
6545
- Context: hd,
6548
+ Provider: Vc,
6549
+ Context: pd,
6546
6550
  useContext: vn
6547
- } = ne("ConversationList"), Vc = ({
6551
+ } = ne("ConversationList"), Wc = ({
6548
6552
  conversationListLimit: e,
6549
6553
  conversationListFilter: t,
6550
6554
  onNavigateToConversation: n,
@@ -6555,17 +6559,17 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6555
6559
  return L(() => {
6556
6560
  s || i();
6557
6561
  }, []), /* @__PURE__ */ a.createElement(
6558
- ca,
6562
+ ua,
6559
6563
  {
6560
6564
  conversationListLimit: e,
6561
6565
  conversationListFilter: t
6562
6566
  },
6563
- (l) => /* @__PURE__ */ a.createElement(Gc, { value: { ...l, onClose: o, onNavigateToConversation: n } }, r)
6567
+ (l) => /* @__PURE__ */ a.createElement(Vc, { value: { ...l, onClose: o, onNavigateToConversation: n } }, r)
6564
6568
  );
6565
- }, Lt = 99, Wc = Ke(function(t) {
6566
- const { channel: n, onClick: o } = t, { strings: r, format: s } = G(), { themedColor: i } = W(), l = Yc.use(), c = ys(n, {
6569
+ }, Lt = 99, qc = Ke(function(t) {
6570
+ const { channel: n, onClick: o } = t, { strings: r, format: s } = G(), { themedColor: i } = W(), l = Kc.use(), c = bs(n, {
6567
6571
  formatMultipleFilesCount: r.conversation_list.multiple_files_count
6568
- }), u = bs(n, s, {
6572
+ }), u = Es(n, s, {
6569
6573
  justNow: r.date_format.just_now,
6570
6574
  minutesAgo: r.date_format.minutes_ago,
6571
6575
  hoursAgo: r.date_format.hours_ago,
@@ -6597,17 +6601,17 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6597
6601
  /* @__PURE__ */ a.createElement(M, { variant: "caption3", color: i.textHighEmphasisInverse, style: { lineHeight: 12 } }, d <= Lt ? d : `${Lt}+`)
6598
6602
  )
6599
6603
  )));
6600
- }), qc = ce({
6601
- template: Wc,
6604
+ }), Yc = ce({
6605
+ template: qc,
6602
6606
  components: {}
6603
- }), Yc = O.create(({ themedColor: e }) => ({
6607
+ }), Kc = O.create(({ themedColor: e }) => ({
6604
6608
  rightContainer: {
6605
6609
  borderBottomWidth: 1,
6606
6610
  borderBottomColor: e.textDisabled
6607
6611
  }
6608
- })), Kc = () => {
6612
+ })), Xc = () => {
6609
6613
  var l;
6610
- const { Template: e } = qc.useContext(), { strings: t } = G(), { connectionError: n } = ue(), { listSource: o, onNavigateToConversation: r } = vn(), s = Oe(["left", "right"]), i = Xc.use();
6614
+ const { Template: e } = Yc.useContext(), { strings: t } = G(), { connectionError: n } = ue(), { listSource: o, onNavigateToConversation: r } = vn(), s = Oe(["left", "right"]), i = Zc.use();
6611
6615
  return /* @__PURE__ */ a.createElement(
6612
6616
  xo,
6613
6617
  {
@@ -6634,7 +6638,7 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6634
6638
  ErrorComponent: /* @__PURE__ */ a.createElement(Le, { type: "error", label: (n == null ? void 0 : n.message) ?? ((l = o.error) == null ? void 0 : l.message) })
6635
6639
  }
6636
6640
  );
6637
- }, Xc = O.create(({ theme: e }) => ({
6641
+ }, Zc = O.create(({ theme: e }) => ({
6638
6642
  list: {
6639
6643
  flex: 1,
6640
6644
  backgroundColor: e.colors.base.background
@@ -6642,8 +6646,8 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6642
6646
  listContent: {
6643
6647
  backgroundColor: e.colors.base.background
6644
6648
  }
6645
- })), Zc = () => {
6646
- const { strings: e } = G(), { language: t, countryCode: n, context: o } = ee(), { aiAgentInfo: r, refreshActiveChannel: s, createConversation: i, setActiveChannel: l, sdkUser: c } = ue(), { onNavigateToConversation: u } = vn(), d = Oe(["left", "right", "bottom"]), g = Jc.use();
6649
+ })), Jc = () => {
6650
+ const { strings: e } = G(), { language: t, countryCode: n, context: o } = ee(), { aiAgentInfo: r, refreshActiveChannel: s, createConversation: i, setActiveChannel: l, sdkUser: c } = ue(), { onNavigateToConversation: u } = vn(), d = Oe(["left", "right", "bottom"]), g = Qc.use();
6647
6651
  return /* @__PURE__ */ a.createElement(
6648
6652
  B,
6649
6653
  {
@@ -6676,20 +6680,20 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6676
6680
  /* @__PURE__ */ a.createElement(M, { variant: "h1", color: ({ themedColor: m }) => m.textHighEmphasisInverse, numberOfLines: 1 }, e.conversation_list.footer_title)
6677
6681
  )
6678
6682
  );
6679
- }, Jc = O.create(({ themedColor: e }) => ({
6683
+ }, Qc = O.create(({ themedColor: e }) => ({
6680
6684
  container: {
6681
6685
  backgroundColor: e.primary
6682
6686
  }
6683
- })), Qc = () => {
6687
+ })), eu = () => {
6684
6688
  const { aiAgentInfo: e } = ue();
6685
- return e ? /* @__PURE__ */ a.createElement(Zc, null) : null;
6686
- }, eu = () => {
6689
+ return e ? /* @__PURE__ */ a.createElement(Jc, null) : null;
6690
+ }, tu = () => {
6687
6691
  const { themedColor: e } = W(), { onClose: t } = vn();
6688
6692
  return t ? /* @__PURE__ */ a.createElement(B, { hitSlop: 4, onPress: t, activeOpacity: 0.75 }, /* @__PURE__ */ a.createElement(U, { color: e.textHighEmphasis, type: "close", size: 24 })) : null;
6689
- }, tu = () => {
6693
+ }, nu = () => {
6690
6694
  const { strings: e } = G();
6691
6695
  return /* @__PURE__ */ a.createElement(M, { numberOfLines: 1, variant: "h1" }, e.conversation_list.header_title);
6692
- }, nu = (e) => {
6696
+ }, ou = (e) => {
6693
6697
  const { components: t } = Je.useContext();
6694
6698
  return /* @__PURE__ */ a.createElement(
6695
6699
  No,
@@ -6700,40 +6704,40 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6700
6704
  end: /* @__PURE__ */ a.createElement(t.EndArea, null)
6701
6705
  }
6702
6706
  );
6703
- }, ou = () => null, ru = () => {
6707
+ }, ru = () => null, su = () => {
6704
6708
  const { components: e } = Je.useContext();
6705
6709
  return /* @__PURE__ */ a.createElement(e.Title, null);
6706
- }, su = () => {
6710
+ }, au = () => {
6707
6711
  const { components: e } = Je.useContext();
6708
6712
  return /* @__PURE__ */ a.createElement(e.CloseButton, null);
6709
6713
  }, Je = ce({
6710
- template: nu,
6714
+ template: ou,
6711
6715
  components: {
6712
- StartArea: ou,
6713
- TitleArea: ru,
6714
- EndArea: su,
6715
- Title: tu,
6716
- CloseButton: eu
6716
+ StartArea: ru,
6717
+ TitleArea: su,
6718
+ EndArea: au,
6719
+ Title: nu,
6720
+ CloseButton: tu
6717
6721
  }
6718
- }), au = () => {
6722
+ }), iu = () => {
6719
6723
  const { Template: e } = Je.useContext();
6720
6724
  return /* @__PURE__ */ a.createElement(e, { titleAlign: "start" });
6721
- }, iu = () => {
6725
+ }, lu = () => {
6722
6726
  const { components: e } = Cn.useContext();
6723
6727
  return /* @__PURE__ */ a.createElement(y, { flex: 1 }, /* @__PURE__ */ a.createElement(e.Header, null), /* @__PURE__ */ a.createElement(e.Body, null), /* @__PURE__ */ a.createElement(e.Footer, null));
6724
6728
  }, Cn = ce({
6725
- template: iu,
6729
+ template: lu,
6726
6730
  components: {
6727
- Header: au,
6728
- Body: Kc,
6729
- Footer: Qc
6731
+ Header: iu,
6732
+ Body: Xc,
6733
+ Footer: eu
6730
6734
  }
6731
- }), lu = ({ children: e, ...t }) => {
6735
+ }), cu = ({ children: e, ...t }) => {
6732
6736
  const { Template: n } = Cn.useContext();
6733
- return /* @__PURE__ */ a.createElement(Vc, { ...t }, /* @__PURE__ */ a.createElement(n, null), e);
6734
- }, pd = mt(
6737
+ return /* @__PURE__ */ a.createElement(Wc, { ...t }, /* @__PURE__ */ a.createElement(n, null), e);
6738
+ }, fd = mt(
6735
6739
  function({
6736
- logLevel: t = Qo.WARN,
6740
+ logLevel: t = er.WARN,
6737
6741
  language: n = pt,
6738
6742
  userSessionInfo: o,
6739
6743
  children: r,
@@ -6743,10 +6747,10 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6743
6747
  const [c] = C(() => new mo(t));
6744
6748
  c.level !== t && (c.level = t);
6745
6749
  const { nativeModules: u, chatParams: d = {}, ...g } = i;
6746
- return /* @__PURE__ */ a.createElement(fc, { config: u }, ({ keyValueStorage: m }) => {
6750
+ return /* @__PURE__ */ a.createElement(_c, { config: u }, ({ keyValueStorage: m }) => {
6747
6751
  var p, f;
6748
- return /* @__PURE__ */ a.createElement(uu, { logger: c, theme: g.theme, language: n, strings: s }, /* @__PURE__ */ a.createElement(
6749
- vs,
6752
+ return /* @__PURE__ */ a.createElement(du, { logger: c, theme: g.theme, language: n, strings: s }, /* @__PURE__ */ a.createElement(
6753
+ Cs,
6750
6754
  {
6751
6755
  language: n,
6752
6756
  logger: c,
@@ -6768,11 +6772,11 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6768
6772
  },
6769
6773
  ...g
6770
6774
  },
6771
- /* @__PURE__ */ a.createElement(Da, { ref: l, userSessionInfo: o }, r)
6775
+ /* @__PURE__ */ a.createElement(Pa, { ref: l, userSessionInfo: o }, r)
6772
6776
  ));
6773
6777
  });
6774
6778
  }
6775
- ), cu = _s(
6779
+ ), uu = ys(
6776
6780
  En,
6777
6781
  Ne,
6778
6782
  Oo,
@@ -6783,16 +6787,16 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6783
6787
  _n,
6784
6788
  yn,
6785
6789
  bn
6786
- ), uu = ({
6790
+ ), du = ({
6787
6791
  children: e,
6788
6792
  logger: t,
6789
6793
  theme: n,
6790
6794
  language: o,
6791
6795
  strings: r
6792
- }) => /* @__PURE__ */ a.createElement(ar, null, /* @__PURE__ */ a.createElement(pi, { logger: t, ...n }, /* @__PURE__ */ a.createElement(di, { language: o, logger: t, strings: r }, /* @__PURE__ */ a.createElement(gi, null, /* @__PURE__ */ a.createElement(ma, null, /* @__PURE__ */ a.createElement(cu, null, e)))))), {
6793
- Provider: du,
6796
+ }) => /* @__PURE__ */ a.createElement(ir, null, /* @__PURE__ */ a.createElement(fi, { logger: t, ...n }, /* @__PURE__ */ a.createElement(mi, { language: o, logger: t, strings: r }, /* @__PURE__ */ a.createElement(hi, null, /* @__PURE__ */ a.createElement(ga, null, /* @__PURE__ */ a.createElement(uu, null, e)))))), {
6797
+ Provider: mu,
6794
6798
  useContext: Sn
6795
- } = ne("FixedMessengerStyle"), mu = {
6799
+ } = ne("FixedMessengerStyle"), gu = {
6796
6800
  useNativeDriver: !0
6797
6801
  }, at = {
6798
6802
  OPEN_START: "0deg",
@@ -6802,13 +6806,13 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6802
6806
  }, it = {
6803
6807
  VISIBLE: 1,
6804
6808
  HIDDEN: 0
6805
- }, gu = ({ isOpened: e }) => {
6809
+ }, hu = ({ isOpened: e }) => {
6806
6810
  const t = j(new N.Value(e ? 1 : 0)).current;
6807
6811
  L(() => {
6808
6812
  const r = e ? 1 : 0;
6809
6813
  N.spring(t, {
6810
6814
  toValue: r,
6811
- ...mu
6815
+ ...gu
6812
6816
  }).start();
6813
6817
  }, [e, t]);
6814
6818
  const n = {
@@ -6846,27 +6850,27 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6846
6850
  openIconStyle: n,
6847
6851
  closeIconStyle: o
6848
6852
  };
6849
- }, hu = 2 / 3, pu = ({ isOpened: e, onPress: t }) => {
6850
- const n = yu.use(), { launcherInfo: o, statsTrackers: r } = ue();
6853
+ }, pu = 2 / 3, fu = ({ isOpened: e, onPress: t }) => {
6854
+ const n = bu.use(), { launcherInfo: o, statsTrackers: r } = ue();
6851
6855
  me(() => {
6852
6856
  r.initialRender.setPresentMethod("launcher_toggle");
6853
6857
  }, [r]);
6854
- const { theme: s } = W(), { launcherSize: i, horizontal: l } = Sn(), c = Math.round(i * hu), u = s.colors.base.primary, d = s.colors.base.primaryContrastContent, { openIconStyle: g, closeIconStyle: m } = gu({ isOpened: e });
6858
+ const { theme: s } = W(), { launcherSize: i, horizontal: l } = Sn(), c = Math.round(i * pu), u = s.colors.base.primary, d = s.colors.base.primaryContrastContent, { openIconStyle: g, closeIconStyle: m } = hu({ isOpened: e });
6855
6859
  return /* @__PURE__ */ a.createElement(y, { alignSelf: l === "start" ? "flex-start" : "flex-end" }, /* @__PURE__ */ a.createElement(B, { onPress: t, activeOpacity: 0.8 }, ({ pressed: p }) => /* @__PURE__ */ a.createElement(y, { style: [n.container({ backgroundColor: u, size: i }), p && n.pressed] }, /* @__PURE__ */ a.createElement(y.Animated, { style: [n.iconWrapper, g] }, /* @__PURE__ */ a.createElement(
6856
- fu,
6860
+ _u,
6857
6861
  {
6858
6862
  url: (o == null ? void 0 : o.imageUrl) ?? "",
6859
6863
  isDefaultIcon: (o == null ? void 0 : o.type) === "default_icon",
6860
6864
  size: c,
6861
6865
  fillColor: d
6862
6866
  }
6863
- )), /* @__PURE__ */ a.createElement(y.Animated, { style: [n.iconWrapper, m] }, /* @__PURE__ */ a.createElement(_u, { size: c, fillColor: d })))));
6864
- }, fu = ({
6867
+ )), /* @__PURE__ */ a.createElement(y.Animated, { style: [n.iconWrapper, m] }, /* @__PURE__ */ a.createElement(yu, { size: c, fillColor: d })))));
6868
+ }, _u = ({
6865
6869
  url: e,
6866
6870
  isDefaultIcon: t,
6867
6871
  size: n,
6868
6872
  fillColor: o
6869
- }) => e ? t ? /* @__PURE__ */ a.createElement(Pe, { source: { uri: e }, width: n, height: n, tintColor: o, resizeMode: "contain" }) : /* @__PURE__ */ a.createElement(Pe, { source: { uri: e }, width: n, height: n, resizeMode: "cover" }) : /* @__PURE__ */ a.createElement(U, { type: "delight", size: n, color: o }), _u = ({ size: e, fillColor: t }) => /* @__PURE__ */ a.createElement(U, { type: "chevron-down", size: e, color: t }), yu = O.create(() => ({
6873
+ }) => e ? t ? /* @__PURE__ */ a.createElement(Pe, { source: { uri: e }, width: n, height: n, tintColor: o, resizeMode: "contain" }) : /* @__PURE__ */ a.createElement(Pe, { source: { uri: e }, width: n, height: n, resizeMode: "cover" }) : /* @__PURE__ */ a.createElement(U, { type: "delight", size: n, color: o }), yu = ({ size: e, fillColor: t }) => /* @__PURE__ */ a.createElement(U, { type: "chevron-down", size: e, color: t }), bu = O.create(() => ({
6870
6874
  container: (e) => ({
6871
6875
  position: "relative",
6872
6876
  width: e.size,
@@ -6892,8 +6896,8 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6892
6896
  DURATION: 300,
6893
6897
  OPACITY_DURATION: 83,
6894
6898
  EASING: fe.out(fe.ease)
6895
- }, bu = (e) => e === "entered" ? 0 : se.TRANSLATE_OFFSET, Eu = (e) => e === "entered" ? 1 : 0, vu = ({ transitionState: e, isActive: t }) => {
6896
- const [n, o] = C(!1), r = j(new N.Value(bu(e))).current, s = j(new N.Value(Eu(e))).current;
6899
+ }, Eu = (e) => e === "entered" ? 0 : se.TRANSLATE_OFFSET, vu = (e) => e === "entered" ? 1 : 0, Cu = ({ transitionState: e, isActive: t }) => {
6900
+ const [n, o] = C(!1), r = j(new N.Value(Eu(e))).current, s = j(new N.Value(vu(e))).current;
6897
6901
  return L(() => {
6898
6902
  if (!n) {
6899
6903
  e === "entered" ? (r.setValue(0), s.setValue(1)) : e === "exited" && (r.setValue(se.TRANSLATE_OFFSET), s.setValue(0)), o(!0);
@@ -6941,16 +6945,16 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6941
6945
  }),
6942
6946
  [r, s, t, e]
6943
6947
  );
6944
- }, Ho = tn(null), Cu = () => {
6948
+ }, Ho = tn(null), Su = () => {
6945
6949
  const e = je(Ho);
6946
6950
  if (!e)
6947
6951
  throw new Error("useNavigatorContext() must be used within <Navigator />");
6948
6952
  return e;
6949
6953
  }, zo = ({ children: e }) => {
6950
- const t = Cu();
6954
+ const t = Su();
6951
6955
  return typeof e == "function" ? /* @__PURE__ */ a.createElement(a.Fragment, null, e(t)) : /* @__PURE__ */ a.createElement(a.Fragment, null, e);
6952
- }, Su = Ke(({ transitionState: e, isActive: t, children: n }) => {
6953
- const o = vu({ transitionState: e, isActive: t });
6956
+ }, Au = Ke(({ transitionState: e, isActive: t, children: n }) => {
6957
+ const o = Cu({ transitionState: e, isActive: t });
6954
6958
  return /* @__PURE__ */ a.createElement(N.View, { style: o }, n);
6955
6959
  }), Zn = 300, ut = ({ initialId: e, children: t }) => {
6956
6960
  const [n, o] = C([e]), r = n[n.length - 1], s = w((h, v) => {
@@ -6986,7 +6990,7 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
6986
6990
  pop: i
6987
6991
  },
6988
6992
  activeScreenId: r
6989
- }), [s, i, r]), c = J(() => sr.toArray(t).filter(
6993
+ }), [s, i, r]), c = J(() => ar.toArray(t).filter(
6990
6994
  (h) => h.type === zo
6991
6995
  ), [t]), u = J(() => {
6992
6996
  const h = {};
@@ -7012,17 +7016,17 @@ const Tc = ({ onPressSend: e }) => /* @__PURE__ */ a.createElement(B, { style: w
7012
7016
  var S;
7013
7017
  if (!d[h]) return null;
7014
7018
  const v = m[h] || "exited", _ = h === r, b = `${h}-${f[h] || 0}`;
7015
- return /* @__PURE__ */ a.createElement(Su, { key: b, transitionState: v, isActive: _ }, (S = u[h]) == null ? void 0 : S.element);
7019
+ return /* @__PURE__ */ a.createElement(Au, { key: b, transitionState: v, isActive: _ }, (S = u[h]) == null ? void 0 : S.element);
7016
7020
  })));
7017
7021
  };
7018
7022
  ut.Screen = zo;
7019
7023
  const {
7020
- Provider: Au,
7024
+ Provider: Tu,
7021
7025
  useContext: An
7022
- } = ne("PageChildren"), Tu = ({ children: e }) => {
7026
+ } = ne("PageChildren"), wu = ({ children: e }) => {
7023
7027
  const [t, n] = C(null), [o, r] = C(null);
7024
7028
  return /* @__PURE__ */ a.createElement(
7025
- Au,
7029
+ Tu,
7026
7030
  {
7027
7031
  value: {
7028
7032
  conversationChildren: t,
@@ -7036,7 +7040,7 @@ const {
7036
7040
  }, xe = {
7037
7041
  conv: "conv",
7038
7042
  convList: "conv-list"
7039
- }, wu = ({
7043
+ }, xu = ({
7040
7044
  isOpened: e,
7041
7045
  entryPoint: t,
7042
7046
  selectedChannelUrl: n,
@@ -7045,7 +7049,7 @@ const {
7045
7049
  }) => {
7046
7050
  const { conversationChildren: s, conversationListChildren: i } = An(), l = t === "ConversationList" ? xe.convList : xe.conv;
7047
7051
  return /* @__PURE__ */ a.createElement(ut, { initialId: l }, /* @__PURE__ */ a.createElement(ut.Screen, { id: xe.conv }, ({ navigation: c, activeScreenId: u }) => /* @__PURE__ */ a.createElement(
7048
- jc,
7052
+ Gc,
7049
7053
  {
7050
7054
  channelUrl: n,
7051
7055
  onClearChannelUrl: () => o(void 0),
@@ -7055,7 +7059,7 @@ const {
7055
7059
  },
7056
7060
  s
7057
7061
  )), /* @__PURE__ */ a.createElement(ut.Screen, { id: xe.convList, lazy: !0 }, ({ navigation: c }) => /* @__PURE__ */ a.createElement(
7058
- lu,
7062
+ cu,
7059
7063
  {
7060
7064
  onNavigateToConversation: (u) => {
7061
7065
  o(u), c.navigate(xe.conv, { reset: !0 });
@@ -7064,16 +7068,16 @@ const {
7064
7068
  },
7065
7069
  i
7066
7070
  )));
7067
- }, qe = 0.15, xu = 150, Jn = (e, t) => e.interpolate({
7071
+ }, qe = 0.15, Iu = 150, Jn = (e, t) => e.interpolate({
7068
7072
  inputRange: [qe, 1],
7069
7073
  outputRange: [t, 0],
7070
7074
  extrapolate: "clamp"
7071
- }), Iu = (e, t) => {
7075
+ }), ku = (e, t) => {
7072
7076
  if (e <= 0) return 0;
7073
7077
  const n = (1 - qe) * e / 2, o = t === "start" ? -1 : 1, r = Ve.isRTL ? -1 : 1;
7074
7078
  return n * o * r;
7075
- }, ku = (e, t) => e <= 0 ? 0 : (1 - qe) * e / 2 * (t === "top" ? -1 : 1), Mu = ({ isOpened: e, horizontal: t, vertical: n }) => {
7076
- const [o, r] = C({ width: 0, height: 0 }), s = j(new N.Value(e ? 1 : qe)).current, i = j(new N.Value(e ? 1 : 0)).current, l = J(() => Iu(o.width, t), [o.width, t]), c = J(() => ku(o.height, n), [o.height, n]), { translateXInterpolation: u, translateYInterpolation: d } = J(
7079
+ }, Mu = (e, t) => e <= 0 ? 0 : (1 - qe) * e / 2 * (t === "top" ? -1 : 1), Ru = ({ isOpened: e, horizontal: t, vertical: n }) => {
7080
+ const [o, r] = C({ width: 0, height: 0 }), s = j(new N.Value(e ? 1 : qe)).current, i = j(new N.Value(e ? 1 : 0)).current, l = J(() => ku(o.width, t), [o.width, t]), c = J(() => Mu(o.height, n), [o.height, n]), { translateXInterpolation: u, translateYInterpolation: d } = J(
7077
7081
  () => ({
7078
7082
  translateXInterpolation: Jn(s, l),
7079
7083
  translateYInterpolation: Jn(s, c)
@@ -7082,7 +7086,7 @@ const {
7082
7086
  );
7083
7087
  L(() => {
7084
7088
  const p = e ? "open" : "close", f = p === "open" ? 1 : qe, E = p === "open" ? 1 : 0, h = p === "open" ? fe.out(fe.quad) : fe.in(fe.quad), v = {
7085
- duration: xu,
7089
+ duration: Iu,
7086
7090
  useNativeDriver: !0,
7087
7091
  easing: h
7088
7092
  };
@@ -7113,14 +7117,14 @@ const {
7113
7117
  handleLayout: m,
7114
7118
  pointerEvents: e ? "auto" : "none"
7115
7119
  };
7116
- }, Ru = { top: 0, left: 0, right: 0, bottom: 0 }, Lu = ({ children: e, isOpened: t }) => {
7117
- const n = Du.use(), { horizontal: o, vertical: r } = Sn(), { animatedStyle: s, handleLayout: i, pointerEvents: l } = Mu({
7120
+ }, Lu = { top: 0, left: 0, right: 0, bottom: 0 }, Du = ({ children: e, isOpened: t }) => {
7121
+ const n = Pu.use(), { horizontal: o, vertical: r } = Sn(), { animatedStyle: s, handleLayout: i, pointerEvents: l } = Ru({
7118
7122
  isOpened: t,
7119
7123
  horizontal: o,
7120
7124
  vertical: r
7121
7125
  });
7122
- return /* @__PURE__ */ a.createElement(ro.Provider, { value: Ru }, /* @__PURE__ */ a.createElement(y, { flex: 1 }, /* @__PURE__ */ a.createElement(y.Animated, { pointerEvents: l, onLayout: i, style: s }, /* @__PURE__ */ a.createElement(y, { style: n.windowContainer }, e))));
7123
- }, Du = O.create(({ theme: e }) => ({
7126
+ return /* @__PURE__ */ a.createElement(ro.Provider, { value: Lu }, /* @__PURE__ */ a.createElement(y, { flex: 1 }, /* @__PURE__ */ a.createElement(y.Animated, { pointerEvents: l, onLayout: i, style: s }, /* @__PURE__ */ a.createElement(y, { style: n.windowContainer }, e))));
7127
+ }, Pu = O.create(({ theme: e }) => ({
7124
7128
  windowContainer: {
7125
7129
  width: "100%",
7126
7130
  height: "100%",
@@ -7143,7 +7147,7 @@ const {
7143
7147
  r.remove(), s.remove();
7144
7148
  };
7145
7149
  }, []), e;
7146
- }, Pu = (e) => {
7150
+ }, Ou = (e) => {
7147
7151
  const t = j(new N.Value(0)).current, [n, o] = C(!1);
7148
7152
  return L(() => {
7149
7153
  const s = e ? "open" : "close", i = {
@@ -7161,12 +7165,12 @@ const {
7161
7165
  },
7162
7166
  pointerEvents: e ? "auto" : "none"
7163
7167
  };
7164
- }, Ou = ({
7168
+ }, Nu = ({
7165
7169
  children: e,
7166
7170
  insets: t,
7167
7171
  isOpened: n
7168
7172
  }) => {
7169
- const o = Nu.use(), s = { ...gt(), ...t }, i = Uo(), { windowAnimatedStyle: l, pointerEvents: c } = Pu(n);
7173
+ const o = Bu.use(), s = { ...gt(), ...t }, i = Uo(), { windowAnimatedStyle: l, pointerEvents: c } = Ou(n);
7170
7174
  return /* @__PURE__ */ a.createElement(ro.Provider, { value: s }, /* @__PURE__ */ a.createElement(y.Animated, { flex: 1, style: [o.bg, l], pointerEvents: c }, /* @__PURE__ */ a.createElement(y, { flex: 1 }, e), /* @__PURE__ */ a.createElement(
7171
7175
  y,
7172
7176
  {
@@ -7174,13 +7178,13 @@ const {
7174
7178
  style: o.bg
7175
7179
  }
7176
7180
  )));
7177
- }, Nu = O.create(({ theme: e }) => ({
7181
+ }, Bu = O.create(({ theme: e }) => ({
7178
7182
  bg: {
7179
7183
  backgroundColor: e.colors.base.background
7180
7184
  }
7181
- })), Bu = "end-bottom", Fe = { top: 24, bottom: 24, start: 24, end: 24 }, Hu = ({ mode: e, edgeToEdgeEnabled: t }) => {
7182
- const n = e === "floating" ? Lu : Ou, [o, r] = zt({
7183
- position: Bu,
7185
+ })), Hu = "end-bottom", Fe = { top: 24, bottom: 24, start: 24, end: 24 }, zu = ({ mode: e, edgeToEdgeEnabled: t }) => {
7186
+ const n = e === "floating" ? Du : Nu, [o, r] = zt({
7187
+ position: Hu,
7184
7188
  margin: Fe,
7185
7189
  launcherSize: 48,
7186
7190
  spacing: 12
@@ -7235,7 +7239,7 @@ const {
7235
7239
  setSpacing: (m) => r({ spacing: m })
7236
7240
  }
7237
7241
  };
7238
- }, zu = (e) => {
7242
+ }, Uu = (e) => {
7239
7243
  var s, i, l, c;
7240
7244
  const { setPosition: t, setMargin: n, setLauncherSize: o, setSpacing: r } = Sn();
7241
7245
  return me(() => {
@@ -7249,13 +7253,13 @@ const {
7249
7253
  e.launcherSize,
7250
7254
  e.spacing
7251
7255
  ]), null;
7252
- }, Uu = ({ children: e }) => {
7256
+ }, Fu = ({ children: e }) => {
7253
7257
  const { setConversationChildren: t } = An();
7254
7258
  return me(() => (t(e), () => t(null)), [e]), null;
7255
- }, Fu = ({ children: e }) => {
7259
+ }, $u = ({ children: e }) => {
7256
7260
  const { setConversationListChildren: t } = An();
7257
7261
  return me(() => (t(e), () => t(null)), [e]), null;
7258
- }, $u = ({
7262
+ }, ju = ({
7259
7263
  entryPoint: e = "Conversation",
7260
7264
  edgeToEdgeEnabled: t = !0,
7261
7265
  windowMode: n = "floating",
@@ -7264,14 +7268,14 @@ const {
7264
7268
  windowContainerProps: s,
7265
7269
  children: i
7266
7270
  }) => {
7267
- const [l, c] = C(!1), [u, d] = C(r), { Window: g, windowContainerStyle: m, launcherContainerStyle: p, styleContext: f } = Hu({
7271
+ const [l, c] = C(!1), [u, d] = C(r), { Window: g, windowContainerStyle: m, launcherContainerStyle: p, styleContext: f } = zu({
7268
7272
  mode: n,
7269
7273
  edgeToEdgeEnabled: t
7270
7274
  });
7271
7275
  return L(() => {
7272
7276
  const E = Yo.addEventListener("hardwareBackPress", () => l ? (c(!1), !0) : !1);
7273
7277
  return () => E.remove();
7274
- }, [l]), /* @__PURE__ */ a.createElement(du, { value: f }, /* @__PURE__ */ a.createElement(Tu, null, /* @__PURE__ */ a.createElement(
7278
+ }, [l]), /* @__PURE__ */ a.createElement(mu, { value: f }, /* @__PURE__ */ a.createElement(wu, null, /* @__PURE__ */ a.createElement(
7275
7279
  y,
7276
7280
  {
7277
7281
  style: m,
@@ -7280,7 +7284,7 @@ const {
7280
7284
  ...s
7281
7285
  },
7282
7286
  /* @__PURE__ */ a.createElement(g, { isOpened: l, insets: o }, /* @__PURE__ */ a.createElement(
7283
- wu,
7287
+ xu,
7284
7288
  {
7285
7289
  isOpened: l,
7286
7290
  entryPoint: e,
@@ -7289,14 +7293,14 @@ const {
7289
7293
  onClose: () => c(!1)
7290
7294
  }
7291
7295
  ))
7292
- ), /* @__PURE__ */ a.createElement(y, { style: p, backgroundColor: "transparent", pointerEvents: "box-none" }, /* @__PURE__ */ a.createElement(pu, { isOpened: l, onPress: () => c(!l) })), i));
7293
- }, fd = Object.assign($u, {
7294
- Style: zu,
7295
- ConversationChildren: Uu,
7296
- ConversationListChildren: Fu
7296
+ ), /* @__PURE__ */ a.createElement(y, { style: p, backgroundColor: "transparent", pointerEvents: "box-none" }, /* @__PURE__ */ a.createElement(fu, { isOpened: l, onPress: () => c(!l) })), i));
7297
+ }, _d = Object.assign(ju, {
7298
+ Style: Uu,
7299
+ ConversationChildren: Fu,
7300
+ ConversationListChildren: $u
7297
7301
  });
7298
7302
  var Qn, eo;
7299
- hs.set(en.REACT_NATIVE, {
7303
+ ps.set(en.REACT_NATIVE, {
7300
7304
  deviceOSPlatform: (Qn = te) == null ? void 0 : Qn.select({
7301
7305
  ios: Ae.IOS,
7302
7306
  android: Ae.ANDROID,
@@ -7304,29 +7308,29 @@ hs.set(en.REACT_NATIVE, {
7304
7308
  }),
7305
7309
  deviceOSVersion: (eo = te) != null && eo.Version ? String(te.Version) : void 0,
7306
7310
  messengerVersion: Eo,
7307
- keyValueStorage: ps()
7311
+ keyValueStorage: fs()
7308
7312
  });
7309
7313
  export {
7310
- pd as AIAgentProviderContainer,
7314
+ fd as AIAgentProviderContainer,
7311
7315
  Nt as AnonymousSessionInfo,
7312
7316
  le as BottomSheet,
7313
7317
  mn as BottomSheetLayout,
7314
- jc as Conversation,
7315
- gd as ConversationContext,
7316
- Fa as ConversationContextProvider,
7318
+ Gc as Conversation,
7319
+ hd as ConversationContext,
7320
+ $a as ConversationContextProvider,
7317
7321
  Ne as ConversationHeaderLayout,
7318
7322
  En as ConversationLayout,
7319
- lu as ConversationList,
7320
- hd as ConversationListContext,
7321
- Vc as ConversationListContextProvider,
7323
+ cu as ConversationList,
7324
+ pd as ConversationListContext,
7325
+ Wc as ConversationListContextProvider,
7322
7326
  Je as ConversationListHeaderLayout,
7323
7327
  Cn as ConversationListLayout,
7324
- fd as FixedMessenger,
7328
+ _d as FixedMessenger,
7325
7329
  _n as IncomingMessageLayout,
7326
7330
  go as ManualSessionInfo,
7327
7331
  Oo as MessageListUILayout,
7328
- gi as ModalProvider,
7329
- fc as NativeAdapterProvider,
7332
+ hi as ModalProvider,
7333
+ _c as NativeAdapterProvider,
7330
7334
  yn as OutgoingMessageLayout,
7331
7335
  hn as PlaceholderLayout,
7332
7336
  bn as SystemMessageLayout,
@@ -7334,5 +7338,5 @@ export {
7334
7338
  vn as useConversationListContext,
7335
7339
  ue as useMessengerSessionContext,
7336
7340
  cn as useModalContext,
7337
- pc as useNativeAdapterContext
7341
+ fc as useNativeAdapterContext
7338
7342
  };