@bcc-code/vue-bcc-chat-ui 7.1.58 → 7.1.59

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.
@@ -1,7 +1,7 @@
1
- import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as N, vModelText as P, vShow as F, watch as I, withCtx as L, withDirectives as ee, withKeys as R, withModifiers as z } from "vue";
2
- import { BccAvatar as B, BccButton as V, BccComponentLibrary as H, BccDialog as U, BccImage as te, BccInput as ne, BccInputText as re, BccMenu as ie, BccMessage as ae, BccProgressSpinner as W, BccTag as G } from "@bcc-code/component-library-vue";
3
- import { CometChat as K } from "@cometchat/chat-sdk-javascript";
4
- import { AddIcon as oe, ArrowBackIcon as q, AttachFileIcon as se, BarChartIcon as ce, CalendarAddOnIcon as le, CheckIcon as ue, CloseIcon as de, CodeBlocksIcon as fe, ContentCopyIcon as pe, DeleteIcon as me, DescriptionIcon as he, DoneAllIcon as ge, EditCalendarIcon as _e, EditIcon as ve, ErrorIcon as ye, FilePresentIcon as be, FolderZipIcon as xe, ForumIcon as Se, ImageIcon as Ce, KeyboardArrowDownIcon as we, KeyboardArrowUpIcon as Te, LinkIcon as Ee, MicIcon as De, OpenInNewIcon as Oe, PendingIcon as ke, PictureAsPdfIcon as Ae, ReplyIcon as je, ScheduleIcon as Me, SendIcon as Ne, TableChartIcon as Pe, TextSnippetIcon as J, TranslateIcon as Fe, VideocamIcon as Ie } from "@bcc-code/icons-vue";
1
+ import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as L, withKeys as R, withModifiers as z } from "vue";
2
+ import { BccAvatar as B, BccButton as V, BccComponentLibrary as H, BccDialog as U, BccImage as te, BccInput as W, BccInputText as ne, BccMenu as re, BccMessage as ie, BccProgressSpinner as G, BccTag as K } from "@bcc-code/component-library-vue";
3
+ import { CometChat as q } from "@cometchat/chat-sdk-javascript";
4
+ import { AddIcon as ae, ArrowBackIcon as oe, AttachFileIcon as se, BarChartIcon as ce, CalendarAddOnIcon as le, CheckIcon as ue, CloseIcon as de, CodeBlocksIcon as fe, ContentCopyIcon as pe, DeleteIcon as me, DescriptionIcon as he, DoneAllIcon as ge, EditCalendarIcon as _e, EditIcon as ve, ErrorIcon as ye, FilePresentIcon as be, FolderZipIcon as xe, ForumIcon as Se, ImageIcon as Ce, KeyboardArrowDownIcon as we, KeyboardArrowUpIcon as Te, LinkIcon as Ee, MicIcon as De, OpenInNewIcon as Oe, PendingIcon as ke, PictureAsPdfIcon as Ae, ReplyIcon as je, ScheduleIcon as Me, SendIcon as Ne, TableChartIcon as Pe, TextSnippetIcon as J, TranslateIcon as Fe, VideocamIcon as Ie } from "@bcc-code/icons-vue";
5
5
  //#region \0rolldown/runtime.js
6
6
  var Le = Object.defineProperty, Re = (e, t) => {
7
7
  let n = {};
@@ -547,7 +547,7 @@ function Qt(e) {
547
547
  }
548
548
  async function $t(e) {
549
549
  try {
550
- let t = await K.getGroup(e), n = t?.getMetadata?.(), r = t?.getHasJoined?.() ?? !1;
550
+ let t = await q.getGroup(e), n = t?.getMetadata?.(), r = t?.getHasJoined?.() ?? !1;
551
551
  return n?.isChannel === !0 && !r;
552
552
  } catch {
553
553
  return !1;
@@ -806,7 +806,7 @@ function gr() {
806
806
  }
807
807
  let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = hr();
808
808
  t.isSupported = typeof sn == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
809
- let A = nr, j = rr, M = ir, N = ar, P = or, F = cr, I = lr, L = dr, ee = sr, R = null, z = Z({}, [
809
+ let A = nr, j = rr, M = ir, ee = ar, N = or, P = cr, F = lr, I = dr, L = sr, R = null, z = Z({}, [
810
810
  ...Gn,
811
811
  ...Kn,
812
812
  ...qn,
@@ -836,7 +836,7 @@ function gr() {
836
836
  enumerable: !0,
837
837
  value: !1
838
838
  }
839
- })), U = null, te = null, ne = Object.seal(mn(null, {
839
+ })), U = null, te = null, W = Object.seal(mn(null, {
840
840
  tagCheck: {
841
841
  writable: !0,
842
842
  configurable: !1,
@@ -849,7 +849,7 @@ function gr() {
849
849
  enumerable: !0,
850
850
  value: null
851
851
  }
852
- })), re = !0, ie = !0, ae = !1, W = !0, G = !1, K = !0, oe = !1, q = !1, se = !1, ce = !1, le = !1, ue = !1, de = !0, fe = !1, pe = "user-content-", me = !0, he = !1, ge = {}, _e = null, ve = Z({}, [
852
+ })), ne = !0, re = !0, ie = !1, G = !0, K = !1, q = !0, ae = !1, oe = !1, se = !1, ce = !1, le = !1, ue = !1, de = !0, fe = !1, pe = "user-content-", me = !0, he = !1, ge = {}, _e = null, ve = Z({}, [
853
853
  "annotation-xml",
854
854
  "audio",
855
855
  "colgroup",
@@ -918,7 +918,7 @@ function gr() {
918
918
  }, Re = function() {
919
919
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
920
920
  if (Fe && Fe === e) return;
921
- (!e || typeof e != "object") && (e = {}), e = Vn(e), Ne = Pe.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = Ne === "application/xhtml+xml" ? Tn : wn, R = Pn(e, "ALLOWED_TAGS") && Cn(e.ALLOWED_TAGS) ? Z({}, e.ALLOWED_TAGS, J) : z, B = Pn(e, "ALLOWED_ATTR") && Cn(e.ALLOWED_ATTR) ? Z({}, e.ALLOWED_ATTR, J) : V, Oe = Pn(e, "ALLOWED_NAMESPACES") && Cn(e.ALLOWED_NAMESPACES) ? Z({}, e.ALLOWED_NAMESPACES, Tn) : ke, xe = Pn(e, "ADD_URI_SAFE_ATTR") && Cn(e.ADD_URI_SAFE_ATTR) ? Z(Vn(Se), e.ADD_URI_SAFE_ATTR, J) : Se, ye = Pn(e, "ADD_DATA_URI_TAGS") && Cn(e.ADD_DATA_URI_TAGS) ? Z(Vn(be), e.ADD_DATA_URI_TAGS, J) : be, _e = Pn(e, "FORBID_CONTENTS") && Cn(e.FORBID_CONTENTS) ? Z({}, e.FORBID_CONTENTS, J) : ve, U = Pn(e, "FORBID_TAGS") && Cn(e.FORBID_TAGS) ? Z({}, e.FORBID_TAGS, J) : Vn({}), te = Pn(e, "FORBID_ATTR") && Cn(e.FORBID_ATTR) ? Z({}, e.FORBID_ATTR, J) : Vn({}), ge = Pn(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Vn(e.USE_PROFILES) : e.USE_PROFILES : !1, re = e.ALLOW_ARIA_ATTR !== !1, ie = e.ALLOW_DATA_ATTR !== !1, ae = e.ALLOW_UNKNOWN_PROTOCOLS || !1, W = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = e.SAFE_FOR_TEMPLATES || !1, K = e.SAFE_FOR_XML !== !1, oe = e.WHOLE_DOCUMENT || !1, ce = e.RETURN_DOM || !1, le = e.RETURN_DOM_FRAGMENT || !1, ue = e.RETURN_TRUSTED_TYPE || !1, se = e.FORCE_BODY || !1, de = e.SANITIZE_DOM !== !1, fe = e.SANITIZE_NAMED_PROPS || !1, me = e.KEEP_CONTENT !== !1, he = e.IN_PLACE || !1, ee = Wn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : sr, Ee = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Te, Ae = Pn(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Vn(e.MATHML_TEXT_INTEGRATION_POINTS) : Z({}, [
921
+ (!e || typeof e != "object") && (e = {}), e = Vn(e), Ne = Pe.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = Ne === "application/xhtml+xml" ? Tn : wn, R = Pn(e, "ALLOWED_TAGS") && Cn(e.ALLOWED_TAGS) ? Z({}, e.ALLOWED_TAGS, J) : z, B = Pn(e, "ALLOWED_ATTR") && Cn(e.ALLOWED_ATTR) ? Z({}, e.ALLOWED_ATTR, J) : V, Oe = Pn(e, "ALLOWED_NAMESPACES") && Cn(e.ALLOWED_NAMESPACES) ? Z({}, e.ALLOWED_NAMESPACES, Tn) : ke, xe = Pn(e, "ADD_URI_SAFE_ATTR") && Cn(e.ADD_URI_SAFE_ATTR) ? Z(Vn(Se), e.ADD_URI_SAFE_ATTR, J) : Se, ye = Pn(e, "ADD_DATA_URI_TAGS") && Cn(e.ADD_DATA_URI_TAGS) ? Z(Vn(be), e.ADD_DATA_URI_TAGS, J) : be, _e = Pn(e, "FORBID_CONTENTS") && Cn(e.FORBID_CONTENTS) ? Z({}, e.FORBID_CONTENTS, J) : ve, U = Pn(e, "FORBID_TAGS") && Cn(e.FORBID_TAGS) ? Z({}, e.FORBID_TAGS, J) : Vn({}), te = Pn(e, "FORBID_ATTR") && Cn(e.FORBID_ATTR) ? Z({}, e.FORBID_ATTR, J) : Vn({}), ge = Pn(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Vn(e.USE_PROFILES) : e.USE_PROFILES : !1, ne = e.ALLOW_ARIA_ATTR !== !1, re = e.ALLOW_DATA_ATTR !== !1, ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, G = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, K = e.SAFE_FOR_TEMPLATES || !1, q = e.SAFE_FOR_XML !== !1, ae = e.WHOLE_DOCUMENT || !1, ce = e.RETURN_DOM || !1, le = e.RETURN_DOM_FRAGMENT || !1, ue = e.RETURN_TRUSTED_TYPE || !1, se = e.FORCE_BODY || !1, de = e.SANITIZE_DOM !== !1, fe = e.SANITIZE_NAMED_PROPS || !1, me = e.KEEP_CONTENT !== !1, he = e.IN_PLACE || !1, L = Wn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : sr, Ee = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Te, Ae = Pn(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Vn(e.MATHML_TEXT_INTEGRATION_POINTS) : Z({}, [
922
922
  "mi",
923
923
  "mo",
924
924
  "mn",
@@ -926,7 +926,7 @@ function gr() {
926
926
  "mtext"
927
927
  ]), je = Pn(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Vn(e.HTML_INTEGRATION_POINTS) : Z({}, ["annotation-xml"]);
928
928
  let t = Pn(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Vn(e.CUSTOM_ELEMENT_HANDLING) : mn(null);
929
- if (H = mn(null), Pn(t, "tagNameCheck") && Le(t.tagNameCheck) && (H.tagNameCheck = t.tagNameCheck), Pn(t, "attributeNameCheck") && Le(t.attributeNameCheck) && (H.attributeNameCheck = t.attributeNameCheck), Pn(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (H.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), G && (ie = !1), le && (ce = !0), ge && (R = Z({}, Zn), B = mn(null), ge.html === !0 && (Z(R, Gn), Z(B, Qn)), ge.svg === !0 && (Z(R, Kn), Z(B, $n), Z(B, tr)), ge.svgFilters === !0 && (Z(R, qn), Z(B, $n), Z(B, tr)), ge.mathMl === !0 && (Z(R, Yn), Z(B, er), Z(B, tr))), ne.tagCheck = null, ne.attributeCheck = null, Pn(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ne.tagCheck = e.ADD_TAGS : Cn(e.ADD_TAGS) && (R === z && (R = Vn(R)), Z(R, e.ADD_TAGS, J))), Pn(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ne.attributeCheck = e.ADD_ATTR : Cn(e.ADD_ATTR) && (B === V && (B = Vn(B)), Z(B, e.ADD_ATTR, J))), Pn(e, "ADD_URI_SAFE_ATTR") && Cn(e.ADD_URI_SAFE_ATTR) && Z(xe, e.ADD_URI_SAFE_ATTR, J), Pn(e, "FORBID_CONTENTS") && Cn(e.FORBID_CONTENTS) && (_e === ve && (_e = Vn(_e)), Z(_e, e.FORBID_CONTENTS, J)), Pn(e, "ADD_FORBID_CONTENTS") && Cn(e.ADD_FORBID_CONTENTS) && (_e === ve && (_e = Vn(_e)), Z(_e, e.ADD_FORBID_CONTENTS, J)), me && (R["#text"] = !0), oe && Z(R, [
929
+ if (H = mn(null), Pn(t, "tagNameCheck") && Le(t.tagNameCheck) && (H.tagNameCheck = t.tagNameCheck), Pn(t, "attributeNameCheck") && Le(t.attributeNameCheck) && (H.attributeNameCheck = t.attributeNameCheck), Pn(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (H.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K && (re = !1), le && (ce = !0), ge && (R = Z({}, Zn), B = mn(null), ge.html === !0 && (Z(R, Gn), Z(B, Qn)), ge.svg === !0 && (Z(R, Kn), Z(B, $n), Z(B, tr)), ge.svgFilters === !0 && (Z(R, qn), Z(B, $n), Z(B, tr)), ge.mathMl === !0 && (Z(R, Yn), Z(B, er), Z(B, tr))), W.tagCheck = null, W.attributeCheck = null, Pn(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? W.tagCheck = e.ADD_TAGS : Cn(e.ADD_TAGS) && (R === z && (R = Vn(R)), Z(R, e.ADD_TAGS, J))), Pn(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? W.attributeCheck = e.ADD_ATTR : Cn(e.ADD_ATTR) && (B === V && (B = Vn(B)), Z(B, e.ADD_ATTR, J))), Pn(e, "ADD_URI_SAFE_ATTR") && Cn(e.ADD_URI_SAFE_ATTR) && Z(xe, e.ADD_URI_SAFE_ATTR, J), Pn(e, "FORBID_CONTENTS") && Cn(e.FORBID_CONTENTS) && (_e === ve && (_e = Vn(_e)), Z(_e, e.FORBID_CONTENTS, J)), Pn(e, "ADD_FORBID_CONTENTS") && Cn(e.ADD_FORBID_CONTENTS) && (_e === ve && (_e = Vn(_e)), Z(_e, e.ADD_FORBID_CONTENTS, J)), me && (R["#text"] = !0), ae && Z(R, [
930
930
  "html",
931
931
  "head",
932
932
  "body"
@@ -992,7 +992,7 @@ function gr() {
992
992
  } catch {}
993
993
  }
994
994
  let a = t.body || t.documentElement;
995
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ee === Te ? D.call(t, oe ? "html" : "body")[0] : oe ? t.documentElement : a;
995
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ee === Te ? D.call(t, ae ? "html" : "body")[0] : ae ? t.documentElement : a;
996
996
  }, We = function(e) {
997
997
  return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
998
998
  }, Ge = function(e) {
@@ -1012,8 +1012,8 @@ function gr() {
1012
1012
  if (qe(k.uponSanitizeElement, e, {
1013
1013
  tagName: r,
1014
1014
  allowedTags: R
1015
- }), K && e.hasChildNodes() && !Ke(e.firstElementChild) && In(/<[/\w!]/g, e.innerHTML) && In(/<[/\w!]/g, e.textContent) || K && e.namespaceURI === Te && r === "style" && Ke(e.firstElementChild) || e.nodeType === fr.progressingInstruction || K && e.nodeType === fr.comment && In(/<[/\w]/g, e.data)) return Y(e), !0;
1016
- if (U[r] || !(ne.tagCheck instanceof Function && ne.tagCheck(r)) && !R[r]) {
1015
+ }), q && e.hasChildNodes() && !Ke(e.firstElementChild) && In(/<[/\w!]/g, e.innerHTML) && In(/<[/\w!]/g, e.textContent) || q && e.namespaceURI === Te && r === "style" && Ke(e.firstElementChild) || e.nodeType === fr.progressingInstruction || q && e.nodeType === fr.comment && In(/<[/\w]/g, e.data)) return Y(e), !0;
1016
+ if (U[r] || !(W.tagCheck instanceof Function && W.tagCheck(r)) && !R[r]) {
1017
1017
  if (!U[r] && Ze(r) && (H.tagNameCheck instanceof RegExp && In(H.tagNameCheck, r) || H.tagNameCheck instanceof Function && H.tagNameCheck(r))) return !1;
1018
1018
  if (me && !_e[r]) {
1019
1019
  let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
@@ -1027,7 +1027,7 @@ function gr() {
1027
1027
  }
1028
1028
  return Y(e), !0;
1029
1029
  }
1030
- return e instanceof c && !Ve(e) || (r === "noscript" || r === "noembed" || r === "noframes") && In(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Y(e), !0) : (G && e.nodeType === fr.text && (n = e.textContent, vn([
1030
+ return e instanceof c && !Ve(e) || (r === "noscript" || r === "noembed" || r === "noframes") && In(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Y(e), !0) : (K && e.nodeType === fr.text && (n = e.textContent, vn([
1031
1031
  A,
1032
1032
  j,
1033
1033
  M
@@ -1036,11 +1036,11 @@ function gr() {
1036
1036
  }), e.textContent !== n && (xn(t.removed, { element: e.cloneNode() }), e.textContent = n)), qe(k.afterSanitizeElements, e, null), !1);
1037
1037
  }, Ye = function(e, t, r) {
1038
1038
  if (te[t] || de && (t === "id" || t === "name") && (r in n || r in Ie)) return !1;
1039
- let i = B[t] || ne.attributeCheck instanceof Function && ne.attributeCheck(t, e);
1040
- if (!(ie && !te[t] && In(N, t)) && !(re && In(P, t))) {
1039
+ let i = B[t] || W.attributeCheck instanceof Function && W.attributeCheck(t, e);
1040
+ if (!(re && !te[t] && In(ee, t)) && !(ne && In(N, t))) {
1041
1041
  if (!i || te[t]) {
1042
1042
  if (!(Ze(e) && (H.tagNameCheck instanceof RegExp && In(H.tagNameCheck, e) || H.tagNameCheck instanceof Function && H.tagNameCheck(e)) && (H.attributeNameCheck instanceof RegExp && In(H.attributeNameCheck, t) || H.attributeNameCheck instanceof Function && H.attributeNameCheck(t, e)) || t === "is" && H.allowCustomizedBuiltInElements && (H.tagNameCheck instanceof RegExp && In(H.tagNameCheck, r) || H.tagNameCheck instanceof Function && H.tagNameCheck(r)))) return !1;
1043
- } else if (!xe[t] && !In(ee, Dn(r, I, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && On(r, "data:") === 0 && ye[e]) && !(ae && !In(F, Dn(r, I, ""))) && r) return !1;
1043
+ } else if (!xe[t] && !In(L, Dn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && On(r, "data:") === 0 && ye[e]) && !(ie && !In(P, Dn(r, F, ""))) && r) return !1;
1044
1044
  }
1045
1045
  return !0;
1046
1046
  }, Xe = Z({}, [
@@ -1053,7 +1053,7 @@ function gr() {
1053
1053
  "font-face-uri",
1054
1054
  "missing-glyph"
1055
1055
  ]), Ze = function(e) {
1056
- return !Xe[wn(e)] && In(L, e);
1056
+ return !Xe[wn(e)] && In(I, e);
1057
1057
  }, Qe = function(e) {
1058
1058
  qe(k.beforeSanitizeAttributes, e, null);
1059
1059
  let n = e.attributes;
@@ -1067,7 +1067,7 @@ function gr() {
1067
1067
  }, i = n.length;
1068
1068
  for (; i--;) {
1069
1069
  let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = J(o), u = c, d = o === "value" ? u : kn(u);
1070
- if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, qe(k.uponSanitizeAttribute, e, r), d = r.attrValue, fe && (l === "id" || l === "name") && On(d, pe) !== 0 && (He(o, e), d = pe + d), K && In(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
1070
+ if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, qe(k.uponSanitizeAttribute, e, r), d = r.attrValue, fe && (l === "id" || l === "name") && On(d, pe) !== 0 && (He(o, e), d = pe + d), q && In(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
1071
1071
  He(o, e);
1072
1072
  continue;
1073
1073
  }
@@ -1080,11 +1080,11 @@ function gr() {
1080
1080
  He(o, e);
1081
1081
  continue;
1082
1082
  }
1083
- if (!W && In(/\/>/i, d)) {
1083
+ if (!G && In(/\/>/i, d)) {
1084
1084
  He(o, e);
1085
1085
  continue;
1086
1086
  }
1087
- G && vn([
1087
+ K && vn([
1088
1088
  A,
1089
1089
  j,
1090
1090
  M
@@ -1132,7 +1132,7 @@ function gr() {
1132
1132
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
1133
1133
  if (De = !e, De && (e = "<!-->"), typeof e != "string" && !Ke(e) && (e = Hn(e), typeof e != "string")) throw Ln("dirty is not a string, aborting");
1134
1134
  if (!t.isSupported) return e;
1135
- if (q || Re(n), t.removed = [], typeof e == "string" && (he = !1), he) {
1135
+ if (oe || Re(n), t.removed = [], typeof e == "string" && (he = !1), he) {
1136
1136
  let t = e.nodeName;
1137
1137
  if (typeof t == "string") {
1138
1138
  let e = J(t);
@@ -1141,7 +1141,7 @@ function gr() {
1141
1141
  et(e);
1142
1142
  } else if (e instanceof s) i = Ue("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === fr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), et(o);
1143
1143
  else {
1144
- if (!ce && !G && !oe && e.indexOf("<") === -1) return x && ue ? x.createHTML(e) : e;
1144
+ if (!ce && !K && !ae && e.indexOf("<") === -1) return x && ue ? x.createHTML(e) : e;
1145
1145
  if (i = Ue(e), !i) return ce ? null : ue ? S : "";
1146
1146
  }
1147
1147
  i && se && Y(i.firstChild);
@@ -1149,7 +1149,7 @@ function gr() {
1149
1149
  for (; c = u.nextNode();) Je(c), Qe(c), c.content instanceof a && $e(c.content);
1150
1150
  if (he) return e;
1151
1151
  if (ce) {
1152
- if (G) {
1152
+ if (K) {
1153
1153
  i.normalize();
1154
1154
  let e = i.innerHTML;
1155
1155
  vn([
@@ -1164,8 +1164,8 @@ function gr() {
1164
1164
  else l = i;
1165
1165
  return (B.shadowroot || B.shadowrootmode) && (l = O.call(r, l, !0)), l;
1166
1166
  }
1167
- let d = oe ? i.outerHTML : i.innerHTML;
1168
- return oe && R["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && In(ur, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), G && vn([
1167
+ let d = ae ? i.outerHTML : i.innerHTML;
1168
+ return ae && R["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && In(ur, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), K && vn([
1169
1169
  A,
1170
1170
  j,
1171
1171
  M
@@ -1173,9 +1173,9 @@ function gr() {
1173
1173
  d = Dn(d, e, " ");
1174
1174
  }), x && ue ? x.createHTML(d) : d;
1175
1175
  }, t.setConfig = function() {
1176
- Re(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), q = !0;
1176
+ Re(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), oe = !0;
1177
1177
  }, t.clearConfig = function() {
1178
- Fe = null, q = !1;
1178
+ Fe = null, oe = !1;
1179
1179
  }, t.isValidAttribute = function(e, t, n) {
1180
1180
  return Fe || Re({}), Ye(J(e), J(t), n);
1181
1181
  }, t.addHook = function(e, t) {
@@ -3957,12 +3957,12 @@ function ic(e) {
3957
3957
  function ac(e, t = !1, n = !0) {
3958
3958
  if (!e) return "";
3959
3959
  if (e.getDeletedAt?.() != null) return "(Message removed)";
3960
- if (e instanceof K.TextMessage) return e.getText?.() ?? "";
3961
- if (e instanceof K.MediaMessage) {
3960
+ if (e instanceof q.TextMessage) return e.getText?.() ?? "";
3961
+ if (e instanceof q.MediaMessage) {
3962
3962
  let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
3963
3963
  return a === "image" ? `${t ? "🖼️ " : ""}${i || "Photo"}` : a === "video" ? `${t ? "🎥 " : ""}${i || r || "Video"}` : a === "audio" ? `${t ? "🎤 " : ""}${r || "Audio message"}` : a === "file" ? `${t ? "📄 " : ""}${i || r || "File"}` : `${t ? "🖼️ " : ""}${i || r || "Media message"}`;
3964
3964
  }
3965
- if (e instanceof K.Action) {
3965
+ if (e instanceof q.Action) {
3966
3966
  let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
3967
3967
  return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
3968
3968
  }
@@ -4243,25 +4243,25 @@ function _c(e) {
4243
4243
  var vc = null, yc = null;
4244
4244
  function bc({ environment: e }) {
4245
4245
  Ve(e);
4246
- let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(null), _ = w(null), v = w([]), y = w([]), b = w([]), x = w([]), S = w(!1), C = w(!1), T = w(null), E = w(null), D = w(null), O = w(null), k = w([]), A = w({}), j = n(() => k.value.length);
4247
- function M() {
4246
+ let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(!1), _ = w(null), v = w(null), y = w([]), b = w([]), x = w([]), S = w([]), C = w(!1), T = w(!1), E = w(null), D = w(null), O = w(null), k = w(null), A = w([]), j = w({}), M = n(() => A.value.length);
4247
+ function ee() {
4248
4248
  return typeof navigator < "u" ? !navigator.onLine : !1;
4249
4249
  }
4250
4250
  function N() {
4251
- let e = M();
4251
+ let e = ee();
4252
4252
  if (e !== m.value) {
4253
4253
  if (m.value = e, e) {
4254
- p.value = !1, he();
4254
+ p.value = !1, ge();
4255
4255
  return;
4256
4256
  }
4257
- ie = !0, ae || ye(!0);
4257
+ ie = !0, G || be(!0);
4258
4258
  }
4259
4259
  }
4260
4260
  function P(e) {
4261
4261
  if (!e.length) return;
4262
- let t = { ...A.value };
4262
+ let t = { ...j.value };
4263
4263
  for (let n of e) n.uid && n.displayName.trim() && (t[n.uid] = n.displayName);
4264
- A.value = t;
4264
+ j.value = t;
4265
4265
  }
4266
4266
  function F(e) {
4267
4267
  P(Object.entries(Bt(e)).map(([e, t]) => ({
@@ -4272,46 +4272,46 @@ function bc({ environment: e }) {
4272
4272
  function I(e, t) {
4273
4273
  return F(e), wc(e, t);
4274
4274
  }
4275
- let L = n(() => v.value.find((e) => e.id === T.value) ?? null), ee = `bcc-ui-connection-${crypto.randomUUID()}`, R = `bcc-ui-message-${crypto.randomUUID()}`, z = !1, B = !1, V = null, H = null, U = null, te = null, ne = 0, re = 0, ie = !1, ae = !1, W = null, G = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Set(), q = null, se = null, ce = 0;
4276
- async function le() {
4275
+ let L = n(() => y.value.find((e) => e.id === E.value) ?? null), R = `bcc-ui-connection-${crypto.randomUUID()}`, z = `bcc-ui-message-${crypto.randomUUID()}`, B = !1, V = !1, H = null, U = null, te = null, W = null, ne = 0, re = 0, ie = !1, G = !1, K = null, ae = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Set(), se = null, ce = null, le = 0;
4276
+ async function ue() {
4277
4277
  if (await xc(e), Jt(), t.value) {
4278
- await ot();
4278
+ await st();
4279
4279
  return;
4280
4280
  }
4281
- me(), st(), t.value = !0, await ot(), _.value && (ut(_.value.uid), fe(), Se(), !m.value && !ae && be());
4281
+ he(), lt(), t.value = !0, await st(), v.value && (ut(v.value.uid), pe(), Ce(), !m.value && !G && xe());
4282
4282
  }
4283
- async function ue(e) {
4284
- g.value = null, r.value = !0;
4283
+ async function de(e) {
4284
+ _.value = null, r.value = !0;
4285
4285
  try {
4286
- await le();
4286
+ await ue();
4287
4287
  let t = Ke();
4288
- await K.getLoggedinUser() && t !== e && await K.logout(), qe(e);
4288
+ await q.getLoggedinUser() && t !== e && await q.logout(), qe(e);
4289
4289
  let n = await Sc(e);
4290
- _.value = Dc(await K.login(n)), ut(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, fe(), Se(), ae || await be(), await Ee(), Wt();
4290
+ v.value = Dc(await q.login(n)), ut(v.value.uid), g.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, pe(), Ce(), G || await xe(), await De(), Gt();
4291
4291
  } catch (e) {
4292
- throw yt(), g.value = Vc(e, "Unable to sign in to chat."), e;
4292
+ throw bt(), _.value = Vc(e, "Unable to sign in to chat."), e;
4293
4293
  } finally {
4294
4294
  r.value = !1;
4295
4295
  }
4296
4296
  }
4297
- async function de() {
4298
- g.value = null;
4297
+ async function fe() {
4298
+ _.value = null;
4299
4299
  try {
4300
- qe(null), Ze(), await K.getLoggedinUser() && await K.logout();
4300
+ qe(null), Ze(), await q.getLoggedinUser() && await q.logout();
4301
4301
  } finally {
4302
- yt();
4302
+ bt();
4303
4303
  }
4304
4304
  }
4305
- function fe() {
4305
+ function pe() {
4306
4306
  let e = ct();
4307
4307
  if (!e) {
4308
- W = null, k.value = [];
4308
+ K = null, A.value = [];
4309
4309
  return;
4310
4310
  }
4311
4311
  let t = `bcc-chat:${Y().appId}:${e}`;
4312
- pe(t), W = new dc(t), k.value = W.getQueue();
4312
+ me(t), K = new dc(t), A.value = K.getQueue();
4313
4313
  }
4314
- function pe(e) {
4314
+ function me(e) {
4315
4315
  if (typeof window > "u") return;
4316
4316
  let t = `bcc-chat:${Y().appId}:`, n = [];
4317
4317
  for (let r = 0; r < window.localStorage.length; r += 1) {
@@ -4320,139 +4320,139 @@ function bc({ environment: e }) {
4320
4320
  }
4321
4321
  n.forEach((e) => window.localStorage.removeItem(e));
4322
4322
  }
4323
- function me() {
4324
- B || typeof window > "u" || (window.addEventListener("online", N), window.addEventListener("offline", N), window.addEventListener("focus", N), document.addEventListener("visibilitychange", N), B = !0, N());
4325
- }
4326
4323
  function he() {
4327
- V !== null && (clearTimeout(V), V = null);
4324
+ V || typeof window > "u" || (window.addEventListener("online", N), window.addEventListener("offline", N), window.addEventListener("focus", N), document.addEventListener("visibilitychange", N), V = !0, N());
4328
4325
  }
4329
4326
  function ge() {
4330
- ne = Date.now() + 1500;
4327
+ H !== null && (clearTimeout(H), H = null);
4331
4328
  }
4332
4329
  function _e() {
4333
- return Date.now() < ne;
4330
+ ne = Date.now() + 1500;
4334
4331
  }
4335
4332
  function ve() {
4333
+ return Date.now() < ne;
4334
+ }
4335
+ function ye() {
4336
4336
  return !!Ke();
4337
4337
  }
4338
- function ye(e = !1) {
4339
- if (V !== null || H || m.value || ae || !h.value && !ve()) return;
4338
+ function be(e = !1) {
4339
+ if (H !== null || U || m.value || G || !g.value && !ye()) return;
4340
4340
  let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(re, 4));
4341
- V = setTimeout(() => {
4342
- V = null, be();
4341
+ H = setTimeout(() => {
4342
+ H = null, xe();
4343
4343
  }, t);
4344
4344
  }
4345
- async function be() {
4346
- if (N(), !(m.value || ae || !h.value && !ve())) return H || (H = (async () => {
4347
- he();
4345
+ async function xe() {
4346
+ if (N(), !(m.value || G || !g.value && !ye())) return U || (U = (async () => {
4347
+ ge();
4348
4348
  let e = !1;
4349
4349
  try {
4350
- let e = await K.getLoggedinUser();
4350
+ let e = await q.getLoggedinUser();
4351
4351
  if (!e) {
4352
4352
  let t = Ke();
4353
4353
  if (!t) return;
4354
4354
  let n = await Sc(t);
4355
- e = await K.login(n);
4355
+ e = await q.login(n);
4356
4356
  }
4357
- _.value = Dc(e), h.value = !0, fe();
4358
- let t = K.connect;
4359
- typeof t == "function" && (await t.call(K), p.value = !0), re = 0, ie && await xe();
4357
+ v.value = Dc(e), g.value = !0, pe();
4358
+ let t = q.connect;
4359
+ typeof t == "function" && (await t.call(q), p.value = !0), re = 0, ie && await Se();
4360
4360
  } catch (t) {
4361
- p.value = !1, re += 1, Pt(t) || (g.value = Vc(t, "Unable to reconnect to chat.")), e = !0;
4361
+ p.value = !1, re += 1, Ft(t) || (_.value = Vc(t, "Unable to reconnect to chat.")), e = !0;
4362
4362
  } finally {
4363
- H = null;
4363
+ U = null;
4364
4364
  }
4365
- e && ye();
4366
- })(), H);
4365
+ e && be();
4366
+ })(), U);
4367
4367
  }
4368
- async function xe() {
4369
- return U || m.value || ae || !h.value && !ve() || (U = (async () => {
4370
- ie = !1, g.value = null;
4368
+ async function Se() {
4369
+ return te || m.value || G || !g.value && !ye() || (te = (async () => {
4370
+ ie = !1, _.value = null;
4371
4371
  try {
4372
- await Ee(), Wt();
4372
+ await De(), Gt();
4373
4373
  } finally {
4374
- U = null;
4374
+ te = null;
4375
4375
  }
4376
- })()), U;
4377
- }
4378
- function Se() {
4379
- if (!W || v.value.length > 0) return;
4380
- let e = W.getConversations();
4381
- e.length !== 0 && (v.value = Mc(e), !T.value && v.value.length > 0 && Ce(T.value));
4376
+ })()), te;
4382
4377
  }
4383
- function Ce(e) {
4384
- if (!W || !e) return y.value = [], !1;
4385
- let t = W.getMessages(e).sort(Nc);
4386
- return y.value = t, t.length > 0;
4378
+ function Ce() {
4379
+ if (!K || y.value.length > 0) return;
4380
+ let e = K.getConversations();
4381
+ e.length !== 0 && (y.value = Mc(e), !E.value && y.value.length > 0 && we(E.value));
4387
4382
  }
4388
- async function we() {
4389
- ae = !1, ie = !0, await be();
4383
+ function we(e) {
4384
+ if (!K || !e) return b.value = [], !1;
4385
+ let t = K.getMessages(e).sort(Nc);
4386
+ return b.value = t, t.length > 0;
4390
4387
  }
4391
4388
  async function Te() {
4392
- ae = !0, ie = !1, he();
4393
- let e = K.disconnect;
4394
- typeof e == "function" && await e.call(K), p.value = !1;
4389
+ G = !1, ie = !0, await xe();
4395
4390
  }
4396
4391
  async function Ee() {
4397
- if (await le(), N(), i.value = !0, g.value = null, m.value) {
4398
- v.value = Mc(W?.getConversations() ?? []), L.value && await et(), i.value = !1;
4392
+ G = !0, ie = !1, ge();
4393
+ let e = q.disconnect;
4394
+ typeof e == "function" && await e.call(q), p.value = !1;
4395
+ }
4396
+ async function De() {
4397
+ if (await ue(), N(), i.value = !0, _.value = null, m.value) {
4398
+ y.value = Mc(K?.getConversations() ?? []), L.value && await tt(), i.value = !1;
4399
4399
  return;
4400
4400
  }
4401
4401
  try {
4402
- let e = new K.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(K.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4402
+ let e = new q.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(q.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4403
4403
  do
4404
- n = await e.fetchNext(), t.push(...n.map((e) => Cc(e, _.value?.uid)));
4404
+ n = await e.fetchNext(), t.push(...n.map((e) => Cc(e, v.value?.uid)));
4405
4405
  while (n.length === 50);
4406
- let r = new Map(v.value.map((e) => [e.id, e]));
4406
+ let r = new Map(y.value.map((e) => [e.id, e]));
4407
4407
  for (let e of t) {
4408
4408
  let t = r.get(e.id);
4409
4409
  t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt), !e.lastMessage && t.lastMessage && (e.lastMessage = t.lastMessage));
4410
4410
  }
4411
- v.value = Mc(await dt(t)), W?.setConversations(v.value), L.value && await et();
4411
+ y.value = Mc(await ft(t)), K?.setConversations(y.value), L.value && await tt();
4412
4412
  } catch (e) {
4413
- let t = W?.getConversations() ?? [];
4413
+ let t = K?.getConversations() ?? [];
4414
4414
  if (t.length > 0) {
4415
- v.value = Mc(t);
4415
+ y.value = Mc(t);
4416
4416
  return;
4417
4417
  }
4418
- throw g.value = Vc(e, "Unable to load conversations."), e;
4418
+ throw _.value = Vc(e, "Unable to load conversations."), e;
4419
4419
  } finally {
4420
4420
  i.value = !1;
4421
4421
  }
4422
4422
  }
4423
- async function De(e) {
4424
- T.value = e, E.value = null, b.value = [], se = null, C.value = !1, D.value = null, O.value = null, Ce(e), await et();
4425
- }
4426
- function Oe(e) {
4427
- e && (O.value = null), D.value = e;
4423
+ async function Oe(e) {
4424
+ E.value = e, D.value = null, x.value = [], ce = null, T.value = !1, O.value = null, k.value = null, we(e), await tt();
4428
4425
  }
4429
4426
  function ke(e) {
4430
- e && (D.value = null), O.value = e;
4427
+ e && (k.value = null), O.value = e;
4431
4428
  }
4432
- async function Ae(e) {
4433
- E.value = e, se = null, C.value = !1, D.value = null, O.value = null, await nt(e.id);
4429
+ function Ae(e) {
4430
+ e && (O.value = null), k.value = e;
4434
4431
  }
4435
- function je() {
4436
- E.value = null, b.value = [], se = null, C.value = !1, D.value = null, O.value = null;
4432
+ async function je(e) {
4433
+ D.value = e, ce = null, T.value = !1, O.value = null, k.value = null, await rt(e.id);
4437
4434
  }
4438
- async function Me(e, t) {
4435
+ function Me() {
4436
+ D.value = null, x.value = [], ce = null, T.value = !1, O.value = null, k.value = null;
4437
+ }
4438
+ async function Ne(e, t) {
4439
4439
  if (u.value) return;
4440
4440
  let n = L.value;
4441
4441
  if (!n) return;
4442
4442
  let r = $s(e);
4443
4443
  if (!ec(r)) return;
4444
- if (O.value) {
4445
- await Ne(O.value, r);
4444
+ if (k.value) {
4445
+ await Pe(k.value, r);
4446
4446
  return;
4447
4447
  }
4448
- let i = E.value?.id, a = crypto.randomUUID(), o = zc(Mt(D.value, t), a);
4449
- u.value = !0, g.value = null;
4448
+ let i = D.value?.id, a = crypto.randomUUID(), o = zc(Nt(O.value, t), a);
4449
+ u.value = !0, _.value = null;
4450
4450
  try {
4451
4451
  if (m.value) {
4452
- Ft(n, r, o, i, a), D.value = null;
4452
+ It(n, r, o, i, a), O.value = null;
4453
4453
  return;
4454
4454
  }
4455
- Vt(jt({
4455
+ Ht(Mt({
4456
4456
  conversation: n,
4457
4457
  kind: "text",
4458
4458
  text: r,
@@ -4461,50 +4461,50 @@ function bc({ environment: e }) {
4461
4461
  muid: a,
4462
4462
  deliveryState: "sending"
4463
4463
  }));
4464
- let e = new K.TextMessage(n.targetId, r, Uc(n));
4464
+ let e = new q.TextMessage(n.targetId, r, Uc(n));
4465
4465
  e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
4466
- let t = await K.sendMessage(e);
4467
- xt(I(t, _.value?.uid)), pt(t), await gt(t), D.value = null;
4466
+ let t = await q.sendMessage(e);
4467
+ St(I(t, v.value?.uid)), mt(t), await X(t), O.value = null;
4468
4468
  } catch (e) {
4469
- if (Pt(e)) {
4470
- Ht("queued", a), Ft(n, r, o, E.value?.id, a), D.value = null;
4469
+ if (Ft(e)) {
4470
+ Ut("queued", a), It(n, r, o, D.value?.id, a), O.value = null;
4471
4471
  return;
4472
4472
  }
4473
- throw Ht("failed", a), g.value = Vc(e, "Unable to send the message."), e;
4473
+ throw Ut("failed", a), _.value = Vc(e, "Unable to send the message."), e;
4474
4474
  } finally {
4475
4475
  u.value = !1;
4476
4476
  }
4477
4477
  }
4478
- async function Ne(e, t) {
4478
+ async function Pe(e, t) {
4479
4479
  let n = L.value;
4480
4480
  if (!n || m.value) return;
4481
4481
  let r = $s(t);
4482
4482
  if (ec(r)) {
4483
- u.value = !0, g.value = null;
4483
+ u.value = !0, _.value = null;
4484
4484
  try {
4485
4485
  let t;
4486
- e.kind === "text" ? t = new K.TextMessage(n.targetId, r, Uc(n)) : (t = new K.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Uc(n)), t.setCaption(r)), t.setId(Number(e.id));
4487
- let i = await K.editMessage(t);
4488
- xt(I(i, _.value?.uid)), pt(i), O.value = null;
4486
+ e.kind === "text" ? t = new q.TextMessage(n.targetId, r, Uc(n)) : (t = new q.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Uc(n)), t.setCaption(r)), t.setId(Number(e.id));
4487
+ let i = await q.editMessage(t);
4488
+ St(I(i, v.value?.uid)), mt(i), k.value = null;
4489
4489
  } catch (e) {
4490
- throw g.value = Vc(e, "Unable to edit the message."), e;
4490
+ throw _.value = Vc(e, "Unable to edit the message."), e;
4491
4491
  } finally {
4492
4492
  u.value = !1;
4493
4493
  }
4494
4494
  }
4495
4495
  }
4496
- async function Pe(e, t) {
4496
+ async function J(e, t) {
4497
4497
  if (u.value) return;
4498
4498
  let n = L.value;
4499
4499
  if (!n) return;
4500
- let r = E.value?.id, i = crypto.randomUUID(), a = zc(Mt(D.value, t), i), o = qc(e.file);
4501
- u.value = !0, g.value = null;
4500
+ let r = D.value?.id, i = crypto.randomUUID(), a = zc(Nt(O.value, t), i), o = qc(e.file);
4501
+ u.value = !0, _.value = null;
4502
4502
  try {
4503
4503
  if (m.value) {
4504
- await Rt(n, e, a, r, i), D.value = null;
4504
+ await zt(n, e, a, r, i), O.value = null;
4505
4505
  return;
4506
4506
  }
4507
- Vt(jt({
4507
+ Ht(Mt({
4508
4508
  conversation: n,
4509
4509
  kind: o,
4510
4510
  text: e.caption?.trim() ?? "",
@@ -4519,37 +4519,37 @@ function bc({ environment: e }) {
4519
4519
  muid: i,
4520
4520
  deliveryState: "sending"
4521
4521
  }));
4522
- let t = new K.MediaMessage(n.targetId, e.file, o, Uc(n));
4522
+ let t = new q.MediaMessage(n.targetId, e.file, o, Uc(n));
4523
4523
  t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
4524
- let s = await K.sendMediaMessage(t);
4525
- xt(I(s, _.value?.uid)), pt(s), await gt(s), D.value = null;
4524
+ let s = await q.sendMediaMessage(t);
4525
+ St(I(s, v.value?.uid)), mt(s), await X(s), O.value = null;
4526
4526
  } catch (t) {
4527
- if (Pt(t)) {
4528
- Ht("queued", i), await Rt(n, e, a, r, i), D.value = null;
4527
+ if (Ft(t)) {
4528
+ Ut("queued", i), await zt(n, e, a, r, i), O.value = null;
4529
4529
  return;
4530
4530
  }
4531
- throw Ht("failed", i), g.value = Vc(t, "Unable to send the attachment."), t;
4531
+ throw Ut("failed", i), _.value = Vc(t, "Unable to send the attachment."), t;
4532
4532
  } finally {
4533
4533
  u.value = !1;
4534
4534
  }
4535
4535
  }
4536
- async function J(e, t) {
4536
+ async function Fe(e, t) {
4537
4537
  if (u.value) return;
4538
4538
  let n = L.value;
4539
4539
  if (!n) return;
4540
4540
  let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
4541
4541
  if (!r || i.length < 2) return;
4542
- let a = E.value?.id, o = crypto.randomUUID(), s = zc(Mt(D.value, t), o);
4543
- u.value = !0, g.value = null;
4542
+ let a = D.value?.id, o = crypto.randomUUID(), s = zc(Nt(O.value, t), o);
4543
+ u.value = !0, _.value = null;
4544
4544
  try {
4545
4545
  if (m.value) {
4546
- It(n, {
4546
+ Lt(n, {
4547
4547
  question: r,
4548
4548
  options: i
4549
- }, s, a, o), D.value = null;
4549
+ }, s, a, o), O.value = null;
4550
4550
  return;
4551
4551
  }
4552
- Vt(jt({
4552
+ Ht(Mt({
4553
4553
  conversation: n,
4554
4554
  kind: "poll",
4555
4555
  text: `Poll: ${r}`,
@@ -4566,41 +4566,41 @@ function bc({ environment: e }) {
4566
4566
  question: r,
4567
4567
  options: i,
4568
4568
  receiver: n.targetId,
4569
- receiverType: n.type === "group" ? K.RECEIVER_TYPE.GROUP : K.RECEIVER_TYPE.USER
4569
+ receiverType: n.type === "group" ? q.RECEIVER_TYPE.GROUP : q.RECEIVER_TYPE.USER
4570
4570
  };
4571
4571
  a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
4572
- let t = await K.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4573
- c ? (Ut(o), xt(I(c, _.value?.uid)), pt(c), await gt(c)) : (Ut(o), await bt()), D.value = null;
4572
+ let t = await q.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4573
+ c ? (Wt(o), St(I(c, v.value?.uid)), mt(c), await X(c)) : (Wt(o), await xt()), O.value = null;
4574
4574
  } catch (e) {
4575
- if (Pt(e)) {
4576
- Ht("queued", o), It(n, {
4575
+ if (Ft(e)) {
4576
+ Ut("queued", o), Lt(n, {
4577
4577
  question: r,
4578
4578
  options: i
4579
- }, s, a, o), D.value = null;
4579
+ }, s, a, o), O.value = null;
4580
4580
  return;
4581
4581
  }
4582
- throw Ht("failed", o), g.value = Vc(e, "Unable to send the poll."), e;
4582
+ throw Ut("failed", o), _.value = Vc(e, "Unable to send the poll."), e;
4583
4583
  } finally {
4584
4584
  u.value = !1;
4585
4585
  }
4586
4586
  }
4587
- async function Fe(e, t) {
4588
- let n = e.poll?.id ?? e.id, r = _.value?.uid;
4587
+ async function Ie(e, t) {
4588
+ let n = e.poll?.id ?? e.id, r = v.value?.uid;
4589
4589
  if (!n || !t || m.value) return;
4590
- let i = Ct(e.id, e.parentMessageId) ?? e;
4590
+ let i = wt(e.id, e.parentMessageId) ?? e;
4591
4591
  if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
4592
- g.value = null, r && xt(Ie(i, t, r));
4592
+ _.value = null, r && St(Le(i, t, r));
4593
4593
  try {
4594
- await K.callExtension("polls", "POST", "v2/vote", {
4594
+ await q.callExtension("polls", "POST", "v2/vote", {
4595
4595
  id: n,
4596
4596
  vote: t
4597
4597
  });
4598
4598
  } catch (e) {
4599
- throw xt(i), g.value = Vc(e, "Unable to cast the vote."), e;
4599
+ throw St(i), _.value = Vc(e, "Unable to cast the vote."), e;
4600
4600
  }
4601
4601
  }
4602
4602
  }
4603
- function Ie(e, t, n) {
4603
+ function Le(e, t, n) {
4604
4604
  if (!e.poll) return e;
4605
4605
  let r = e.poll, i = r.allowsMultipleAnswers, a = r.options.filter((e) => e.voters.includes(n)).map((e) => e.id), o = !i && a.length > 0, s = r.options.map((e) => o && e.voters.includes(n) && e.id !== t ? {
4606
4606
  ...e,
@@ -4620,105 +4620,105 @@ function bc({ environment: e }) {
4620
4620
  }
4621
4621
  };
4622
4622
  }
4623
- async function Le(e, t) {
4624
- g.value = null;
4625
- let n = Ct(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4626
- xt(wt(n, t));
4623
+ async function Re(e, t) {
4624
+ _.value = null;
4625
+ let n = wt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4626
+ St(Tt(n, t));
4627
4627
  try {
4628
- xt(I(r ? await K.removeReaction(Number(e.id), t) : await K.addReaction(Number(e.id), t), _.value?.uid));
4628
+ St(I(r ? await q.removeReaction(Number(e.id), t) : await q.addReaction(Number(e.id), t), v.value?.uid));
4629
4629
  } catch (e) {
4630
- throw xt(n), g.value = Vc(e, "Unable to update the reaction."), e;
4630
+ throw St(n), _.value = Vc(e, "Unable to update the reaction."), e;
4631
4631
  }
4632
4632
  }
4633
- async function Re(e) {
4634
- if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
4635
- Dt(e);
4633
+ async function ze(e) {
4634
+ if (_.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
4635
+ Ot(e);
4636
4636
  return;
4637
4637
  }
4638
4638
  if (!m.value) try {
4639
- let t = I(await K.deleteMessage(String(e.id)), _.value?.uid);
4640
- Dt(t), Ot(t);
4639
+ let t = I(await q.deleteMessage(String(e.id)), v.value?.uid);
4640
+ Ot(t), kt(t);
4641
4641
  } catch (e) {
4642
- throw g.value = Vc(e, "Unable to delete the message."), e;
4642
+ throw _.value = Vc(e, "Unable to delete the message."), e;
4643
4643
  }
4644
4644
  }
4645
- async function ze(e) {
4645
+ async function Be(e) {
4646
4646
  let t = e.source?.getText?.() ?? e.text;
4647
4647
  if (ec(t)) {
4648
- g.value = null;
4648
+ _.value = null;
4649
4649
  try {
4650
- let n = (await K.callExtension("message-translation", "POST", "v2/translate", {
4650
+ let n = (await q.callExtension("message-translation", "POST", "v2/translate", {
4651
4651
  msgId: Number(e.id),
4652
4652
  text: t,
4653
4653
  languages: typeof navigator < "u" ? navigator.languages : ["en"]
4654
4654
  })).translations?.[0]?.message_translated?.trim();
4655
4655
  if (!n) return;
4656
- St({
4656
+ Ct({
4657
4657
  ...e,
4658
4658
  translatedText: n,
4659
4659
  metadata: {
4660
4660
  ...e.metadata ?? {},
4661
4661
  translated_message: n
4662
4662
  }
4663
- }), Et();
4663
+ }), Dt();
4664
4664
  } catch (e) {
4665
- throw g.value = Vc(e, "Unable to translate the message."), e;
4665
+ throw _.value = Vc(e, "Unable to translate the message."), e;
4666
4666
  }
4667
4667
  }
4668
4668
  }
4669
- async function Be(e) {
4670
- let t = e ?? L.value?.targetId, n = _.value?.uid, r = ++ce;
4669
+ async function He(e) {
4670
+ let t = e ?? L.value?.targetId, n = v.value?.uid, r = ++le;
4671
4671
  if (!t || !n) {
4672
- r === ce && (x.value = []);
4672
+ r === le && (S.value = []);
4673
4673
  return;
4674
4674
  }
4675
4675
  if (!m.value) {
4676
- l.value = !0, g.value = null;
4676
+ l.value = !0, _.value = null;
4677
4677
  try {
4678
- let e = new K.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4678
+ let e = new q.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4679
4679
  do
4680
- a = await e.fetchPrevious(), i.push(...a.map((e) => I(e, _.value?.uid)));
4680
+ a = await e.fetchPrevious(), i.push(...a.map((e) => I(e, v.value?.uid)));
4681
4681
  while (a.length === 50);
4682
4682
  let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
4683
- if (r !== ce) return;
4684
- x.value = o;
4683
+ if (r !== le) return;
4684
+ S.value = o;
4685
4685
  } catch (e) {
4686
- if (r !== ce) return;
4686
+ if (r !== le) return;
4687
4687
  if (Hc(e)) {
4688
- x.value = [];
4688
+ S.value = [];
4689
4689
  return;
4690
4690
  }
4691
- throw g.value = Vc(e, _t("loadScheduledMessagesError")), e;
4691
+ throw _.value = Vc(e, _t("loadScheduledMessagesError")), e;
4692
4692
  } finally {
4693
- r === ce && (l.value = !1);
4693
+ r === le && (l.value = !1);
4694
4694
  }
4695
4695
  }
4696
4696
  }
4697
- async function He(e, t) {
4697
+ async function Ue(e, t) {
4698
4698
  let n = L.value;
4699
4699
  if (n) {
4700
- d.value = !0, g.value = null;
4700
+ d.value = !0, _.value = null;
4701
4701
  try {
4702
- e.file ? await Kc(n, e, t) : await Gc(n, e, t), await Be(n.targetId);
4702
+ e.file ? await Kc(n, e, t) : await Gc(n, e, t), await He(n.targetId);
4703
4703
  } catch (e) {
4704
- throw g.value = Vc(e, "Unable to schedule the message."), e;
4704
+ throw _.value = Vc(e, "Unable to schedule the message."), e;
4705
4705
  } finally {
4706
4706
  d.value = !1;
4707
4707
  }
4708
4708
  }
4709
4709
  }
4710
- async function Ue(e) {
4711
- if (g.value = null, !e.scheduled) return;
4710
+ async function We(e) {
4711
+ if (_.value = null, !e.scheduled) return;
4712
4712
  let t = e.scheduled.originalChatUid;
4713
4713
  try {
4714
- await K.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Be(t);
4714
+ await q.deleteMessage(String(e.id)), S.value = S.value.filter((t) => t.id !== e.id), await He(t);
4715
4715
  } catch (e) {
4716
- throw g.value = Vc(e, "Unable to remove the scheduled message."), e;
4716
+ throw _.value = Vc(e, "Unable to remove the scheduled message."), e;
4717
4717
  }
4718
4718
  }
4719
- async function We(e, t) {
4720
- g.value = null;
4721
- let n = _.value?.uid;
4719
+ async function Ge(e, t) {
4720
+ _.value = null;
4721
+ let n = v.value?.uid;
4722
4722
  if (!n || !e.scheduled?.muid || e.kind === "poll") return;
4723
4723
  let r = Qs(t);
4724
4724
  if (e.kind === "text" && !ec(r)) return;
@@ -4726,20 +4726,20 @@ function bc({ environment: e }) {
4726
4726
  !i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
4727
4727
  try {
4728
4728
  let t;
4729
- if (e.kind === "text") t = new K.TextMessage(n, r, K.RECEIVER_TYPE.GROUP);
4729
+ if (e.kind === "text") t = new q.TextMessage(n, r, q.RECEIVER_TYPE.GROUP);
4730
4730
  else {
4731
4731
  let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
4732
- t = new K.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, K.RECEIVER_TYPE.GROUP), t.setCaption(r);
4732
+ t = new q.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, q.RECEIVER_TYPE.GROUP), t.setCaption(r);
4733
4733
  }
4734
- Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await K.editMessage(t), await Be(e.scheduled.originalChatUid);
4734
+ Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await q.editMessage(t), await He(e.scheduled.originalChatUid);
4735
4735
  } catch (e) {
4736
- throw g.value = Vc(e, "Unable to edit the scheduled message."), e;
4736
+ throw _.value = Vc(e, "Unable to edit the scheduled message."), e;
4737
4737
  } finally {
4738
4738
  d.value = !1;
4739
4739
  }
4740
4740
  }
4741
- async function Ge(e) {
4742
- d.value = !0, g.value = null;
4741
+ async function Je(e) {
4742
+ d.value = !0, _.value = null;
4743
4743
  try {
4744
4744
  let t = Wc(), n = await fetch(`${Y().chatApiBaseUrl}/chats/rescheduleMessage`, {
4745
4745
  method: "POST",
@@ -4755,21 +4755,21 @@ function bc({ environment: e }) {
4755
4755
  })
4756
4756
  });
4757
4757
  if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
4758
- await Be(e.originalChatUid);
4758
+ await He(e.originalChatUid);
4759
4759
  } catch (e) {
4760
- throw g.value = Vc(e, "Unable to reschedule the message."), e;
4760
+ throw _.value = Vc(e, "Unable to reschedule the message."), e;
4761
4761
  } finally {
4762
4762
  d.value = !1;
4763
4763
  }
4764
4764
  }
4765
- function Je(e) {
4766
- let t = new K.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4767
- return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
4768
- }
4769
4765
  function Ye(e) {
4770
- return new K.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4766
+ let t = new q.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4767
+ return h.value && t.setCategories([q.CATEGORY_MESSAGE, q.CATEGORY_CALL]), e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
4771
4768
  }
4772
- async function Xe(e) {
4769
+ function Xe(e) {
4770
+ return new q.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4771
+ }
4772
+ async function Qe(e) {
4773
4773
  if (!e.isOwn || e.receipts.readAt) return e;
4774
4774
  let t = `bcc-chat:${Y().appId}:message_${e.id}_receiptStatus`;
4775
4775
  try {
@@ -4779,7 +4779,7 @@ function bc({ environment: e }) {
4779
4779
  if (!Number.isNaN(r.getTime()) && !Number.isNaN(i.getTime())) return e.receipts.readAt = r, e.receipts.deliveredAt = i, e;
4780
4780
  }
4781
4781
  } catch {}
4782
- let n = await vt(e);
4782
+ let n = await yt(e);
4783
4783
  for (let t of n) t.kind === "read" && t.timestamp && (!e.receipts.readAt || t.timestamp > e.receipts.readAt) && (e.receipts.readAt = t.timestamp), t.kind === "delivered" && t.timestamp && (!e.receipts.deliveredAt || t.timestamp > e.receipts.deliveredAt) && (e.receipts.deliveredAt = t.timestamp);
4784
4784
  if (e.receipts.readAt) try {
4785
4785
  localStorage.setItem(t, JSON.stringify({
@@ -4789,7 +4789,7 @@ function bc({ environment: e }) {
4789
4789
  } catch {}
4790
4790
  return e;
4791
4791
  }
4792
- async function Qe(e) {
4792
+ async function $e(e) {
4793
4793
  try {
4794
4794
  return await e.fetchPrevious();
4795
4795
  } catch (e) {
@@ -4797,209 +4797,209 @@ function bc({ environment: e }) {
4797
4797
  throw e;
4798
4798
  }
4799
4799
  }
4800
- async function $e(e) {
4800
+ async function et(e) {
4801
4801
  let t = L.value;
4802
- if (!t || m.value) return y.value = [], S.value = !1, !1;
4803
- if ((e?.reset || q?.conversationId !== t.id) && (q = {
4802
+ if (!t || m.value) return b.value = [], C.value = !1, !1;
4803
+ if ((e?.reset || se?.conversationId !== t.id) && (se = {
4804
4804
  conversationId: t.id,
4805
- request: Je(t)
4806
- }, S.value = !0), !q) return console.warn("No active messages request available for the conversation:", t.id), !1;
4807
- let n = await Qe(q.request);
4808
- e?.reset && n.length === 0 && !m.value && !ae && t.lastMessageAt && (ie = !0, await be(), q = {
4805
+ request: Ye(t)
4806
+ }, C.value = !0), !se) return console.warn("No active messages request available for the conversation:", t.id), !1;
4807
+ let n = await $e(se.request);
4808
+ e?.reset && n.length === 0 && !m.value && !G && t.lastMessageAt && (ie = !0, await xe(), se = {
4809
4809
  conversationId: t.id,
4810
- request: Je(t)
4811
- }, n = await Qe(q.request));
4812
- let r = await Promise.all(n.map((e) => I(e, _.value?.uid)).filter(Lc).sort(Nc).map(Xe));
4813
- y.value = e?.reset ? Fc(y.value.filter((e) => e.conversationId === t.id && Ic(e)), r) : Fc(y.value, r), S.value = n.length === 50, W?.setMessages(t.id, y.value);
4810
+ request: Ye(t)
4811
+ }, n = await $e(se.request));
4812
+ let r = await Promise.all(n.map((e) => I(e, v.value?.uid)).filter(Lc).sort(Nc).map(Qe));
4813
+ b.value = e?.reset ? Fc(b.value.filter((e) => e.conversationId === t.id && Ic(e)), r) : Fc(b.value, r), C.value = n.length === 50, K?.setMessages(t.id, b.value);
4814
4814
  let i = n[n.length - 1];
4815
- return i && (await X(i), await gt(i)), n.length > 0;
4815
+ return i && (await vt(i), await X(i)), n.length > 0;
4816
4816
  }
4817
- async function et() {
4817
+ async function tt() {
4818
4818
  N();
4819
4819
  let e = L.value;
4820
4820
  if (!e) {
4821
- console.warn("No active conversation to refresh messages for."), y.value = [], S.value = !1, q = null;
4821
+ console.warn("No active conversation to refresh messages for."), b.value = [], C.value = !1, se = null;
4822
4822
  return;
4823
4823
  }
4824
- let t = Ce(e.id);
4824
+ let t = we(e.id);
4825
4825
  if (a.value = !0, m.value) {
4826
- S.value = !1, q = null, a.value = !1;
4826
+ C.value = !1, se = null, a.value = !1;
4827
4827
  return;
4828
4828
  }
4829
4829
  try {
4830
- await $e({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4830
+ await et({ reset: !0 }), y.value = y.value.map((t) => t.id === e.id ? {
4831
4831
  ...t,
4832
- lastMessage: y.value.at(-1) ?? null,
4832
+ lastMessage: b.value.at(-1) ?? null,
4833
4833
  unreadCount: 0
4834
- } : t), W?.setConversations(v.value);
4834
+ } : t), K?.setConversations(y.value);
4835
4835
  } catch (n) {
4836
- let r = W?.getMessages(e.id) ?? [];
4836
+ let r = K?.getMessages(e.id) ?? [];
4837
4837
  if (r.length > 0) {
4838
- t || (y.value = r.sort(Nc));
4838
+ t || (b.value = r.sort(Nc));
4839
4839
  return;
4840
4840
  }
4841
- throw g.value = Vc(n, "Unable to load messages."), n;
4841
+ throw _.value = Vc(n, "Unable to load messages."), n;
4842
4842
  } finally {
4843
4843
  a.value = !1;
4844
4844
  }
4845
4845
  }
4846
- async function tt(e) {
4847
- let t = E.value?.id;
4848
- if (!t) return b.value = [], C.value = !1, !1;
4849
- if ((e?.reset || se?.parentMessageId !== t) && (se = {
4846
+ async function nt(e) {
4847
+ let t = D.value?.id;
4848
+ if (!t) return x.value = [], T.value = !1, !1;
4849
+ if ((e?.reset || ce?.parentMessageId !== t) && (ce = {
4850
4850
  parentMessageId: t,
4851
- request: Ye(t)
4852
- }, C.value = !0), !se) return !1;
4853
- let n = await se.request.fetchPrevious(), r = await Promise.all(n.map((e) => I(e, _.value?.uid)).filter(Lc).sort(Nc).map(Xe));
4854
- b.value = e?.reset ? Fc(b.value.filter((e) => e.parentMessageId === t && Ic(e)), r) : Fc(b.value, r), C.value = n.length === 50, W?.setThreadMessages(t, b.value);
4851
+ request: Xe(t)
4852
+ }, T.value = !0), !ce) return !1;
4853
+ let n = await ce.request.fetchPrevious(), r = await Promise.all(n.map((e) => I(e, v.value?.uid)).filter(Lc).sort(Nc).map(Qe));
4854
+ x.value = e?.reset ? Fc(x.value.filter((e) => e.parentMessageId === t && Ic(e)), r) : Fc(x.value, r), T.value = n.length === 50, K?.setThreadMessages(t, x.value);
4855
4855
  let i = n[n.length - 1];
4856
- return i && (await X(i), await gt(i)), n.length > 0;
4856
+ return i && (await vt(i), await X(i)), n.length > 0;
4857
4857
  }
4858
- async function nt(e) {
4858
+ async function rt(e) {
4859
4859
  if (o.value = !0, m.value) {
4860
- b.value = (W?.getThreadMessages(e) ?? []).sort(Nc), C.value = !1, se = null, o.value = !1;
4860
+ x.value = (K?.getThreadMessages(e) ?? []).sort(Nc), T.value = !1, ce = null, o.value = !1;
4861
4861
  return;
4862
4862
  }
4863
4863
  try {
4864
- await tt({ reset: !0 });
4864
+ await nt({ reset: !0 });
4865
4865
  } catch (t) {
4866
- let n = W?.getThreadMessages(e) ?? [];
4866
+ let n = K?.getThreadMessages(e) ?? [];
4867
4867
  if (n.length > 0) {
4868
- b.value = n.sort(Nc);
4868
+ x.value = n.sort(Nc);
4869
4869
  return;
4870
4870
  }
4871
- throw g.value = Vc(t, "Unable to load thread."), t;
4871
+ throw _.value = Vc(t, "Unable to load thread."), t;
4872
4872
  } finally {
4873
4873
  o.value = !1;
4874
4874
  }
4875
4875
  }
4876
- async function rt() {
4877
- if (a.value || s.value || !S.value) return !1;
4878
- s.value = !0, g.value = null;
4876
+ async function it() {
4877
+ if (a.value || s.value || !C.value) return !1;
4878
+ s.value = !0, _.value = null;
4879
4879
  try {
4880
- return await $e();
4880
+ return await et();
4881
4881
  } catch (e) {
4882
- throw g.value = Vc(e, "Unable to load messages."), e;
4882
+ throw _.value = Vc(e, "Unable to load messages."), e;
4883
4883
  } finally {
4884
4884
  s.value = !1;
4885
4885
  }
4886
4886
  }
4887
- async function it() {
4888
- if (o.value || c.value || !C.value) return !1;
4889
- c.value = !0, g.value = null;
4887
+ async function at() {
4888
+ if (o.value || c.value || !T.value) return !1;
4889
+ c.value = !0, _.value = null;
4890
4890
  try {
4891
- return await tt();
4891
+ return await nt();
4892
4892
  } catch (e) {
4893
- throw g.value = Vc(e, "Unable to load thread."), e;
4893
+ throw _.value = Vc(e, "Unable to load thread."), e;
4894
4894
  } finally {
4895
4895
  c.value = !1;
4896
4896
  }
4897
4897
  }
4898
- async function at(e) {
4898
+ async function ot(e) {
4899
4899
  let t = e.trim();
4900
4900
  if (!t) return !1;
4901
- let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
4901
+ let n = () => b.value.some((e) => e.id === t) || x.value.some((e) => e.id === t) || D.value?.id === t;
4902
4902
  if (n()) return !0;
4903
4903
  let r = 0;
4904
- for (; C.value && E.value && r < 100;) {
4904
+ for (; T.value && D.value && r < 100;) {
4905
4905
  r += 1;
4906
- let e = await it();
4906
+ let e = await at();
4907
4907
  if (n()) return !0;
4908
4908
  if (!e) break;
4909
4909
  }
4910
- for (; S.value && L.value && r < 100;) {
4910
+ for (; C.value && L.value && r < 100;) {
4911
4911
  r += 1;
4912
- let e = await rt();
4912
+ let e = await it();
4913
4913
  if (n()) return !0;
4914
4914
  if (!e) break;
4915
4915
  }
4916
4916
  return n();
4917
4917
  }
4918
- async function ot() {
4919
- let e = await K.getLoggedinUser();
4918
+ async function st() {
4919
+ let e = await q.getLoggedinUser();
4920
4920
  if (!e) try {
4921
- e = await K.getLoggedInUser();
4921
+ e = await q.getLoggedInUser();
4922
4922
  } catch (e) {
4923
4923
  if (e && typeof e == "object" && "code" in e && e.code === "USER_NOT_LOGED_IN") return;
4924
4924
  console.error("Error fetching logged in user:", e);
4925
4925
  }
4926
- _.value = e ? Dc(e) : null, h.value = !!e;
4926
+ v.value = e ? Dc(e) : null, g.value = !!e;
4927
4927
  }
4928
- function st() {
4929
- z ||= (K.addConnectionListener(ee, new K.ConnectionListener({
4928
+ function lt() {
4929
+ B ||= (q.addConnectionListener(R, new q.ConnectionListener({
4930
4930
  onConnected: () => {
4931
- if (p.value = !0, re = 0, he(), ie) {
4932
- xe();
4931
+ if (p.value = !0, re = 0, ge(), ie) {
4932
+ Se();
4933
4933
  return;
4934
4934
  }
4935
- Wt();
4935
+ Gt();
4936
4936
  },
4937
4937
  onDisconnected: () => {
4938
- p.value = !1, !m.value && !ae && (h.value || ve()) && (ie = !0, ye(!0));
4938
+ p.value = !1, !m.value && !G && (g.value || ye()) && (ie = !0, be(!0));
4939
4939
  }
4940
- })), K.addMessageListener(R, new K.MessageListener({
4940
+ })), q.addMessageListener(z, new q.MessageListener({
4941
4941
  onTextMessageReceived: (e) => {
4942
- lt(e);
4942
+ dt(e);
4943
4943
  },
4944
4944
  onMediaMessageReceived: (e) => {
4945
- lt(e);
4945
+ dt(e);
4946
4946
  },
4947
4947
  onCustomMessageReceived: (e) => {
4948
- lt(e);
4948
+ dt(e);
4949
4949
  },
4950
4950
  onMessagesDelivered: () => {
4951
- _e() || bt({ includeThread: !1 });
4951
+ ve() || xt({ includeThread: !1 });
4952
4952
  },
4953
4953
  onMessagesRead: () => {
4954
- _e() || bt({ includeThread: !1 });
4954
+ ve() || xt({ includeThread: !1 });
4955
4955
  },
4956
4956
  onMessageEdited: (e) => {
4957
- let t = I(e, _.value?.uid);
4958
- Lc(t) && (mt(t), pt(e));
4957
+ let t = I(e, v.value?.uid);
4958
+ Lc(t) && (ht(t), mt(e));
4959
4959
  },
4960
4960
  onMessageDeleted: (e) => {
4961
- let t = I(e, _.value?.uid);
4962
- t.parentMessageId ? Dt(t) : (Dt(t), Ot(t)), Et();
4961
+ let t = I(e, v.value?.uid);
4962
+ t.parentMessageId ? Ot(t) : (Ot(t), kt(t)), Dt();
4963
4963
  },
4964
4964
  onMessageReactionAdded: () => {
4965
- bt();
4965
+ xt();
4966
4966
  },
4967
4967
  onMessageReactionRemoved: () => {
4968
- bt();
4968
+ xt();
4969
4969
  },
4970
4970
  onMessagesDeliveredToAll: () => {
4971
- _e() || bt({ includeThread: !1 });
4971
+ ve() || xt({ includeThread: !1 });
4972
4972
  },
4973
4973
  onMessagesReadByAll: () => {
4974
- _e() || bt({ includeThread: !1 });
4974
+ ve() || xt({ includeThread: !1 });
4975
4975
  }
4976
4976
  })), !0);
4977
4977
  }
4978
- async function lt(e) {
4979
- let t = I(e, _.value?.uid);
4978
+ async function dt(e) {
4979
+ let t = I(e, v.value?.uid);
4980
4980
  if (Lc(t)) {
4981
- if (pt(e), await X(e), t.parentMessageId) {
4982
- ht(t), Tt(t.parentMessageId), Et();
4981
+ if (mt(e), await vt(e), t.parentMessageId) {
4982
+ gt(t), Et(t.parentMessageId), Dt();
4983
4983
  return;
4984
4984
  }
4985
- t.conversationId === T.value && (mt(t), Et(), await gt(e));
4985
+ t.conversationId === E.value && (ht(t), Dt(), await X(e));
4986
4986
  }
4987
4987
  }
4988
- async function dt(e) {
4988
+ async function ft(e) {
4989
4989
  return await Promise.all(e.map(async (e) => {
4990
- let t = await ft(e.targetId);
4990
+ let t = await pt(e.targetId);
4991
4991
  return {
4992
4992
  ...e,
4993
4993
  muteSettings: t ? new Date(t) : null
4994
4994
  };
4995
4995
  }));
4996
4996
  }
4997
- async function ft(e) {
4998
- let t = W?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4997
+ async function pt(e) {
4998
+ let t = K?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4999
4999
  if (t && (m.value || !n)) return t.mutedUntil;
5000
- if (m.value || !h.value) return t?.mutedUntil ?? null;
5000
+ if (m.value || !g.value) return t?.mutedUntil ?? null;
5001
5001
  try {
5002
- let n = (await K.getLoggedinUser())?.getUid?.();
5002
+ let n = (await q.getLoggedinUser())?.getUid?.();
5003
5003
  if (!n || e === n) return t?.mutedUntil ?? null;
5004
5004
  let r = Ke();
5005
5005
  if (!r) return t?.mutedUntil ?? null;
@@ -5012,7 +5012,7 @@ function bc({ environment: e }) {
5012
5012
  });
5013
5013
  if (!i.ok) return t?.mutedUntil ?? null;
5014
5014
  let a = await i.json();
5015
- return W?.storeParticipantSettings({
5015
+ return K?.storeParticipantSettings({
5016
5016
  chatUid: e,
5017
5017
  mutedUntil: a.mutedUntil ?? null,
5018
5018
  lastUpdated: Date.now()
@@ -5021,71 +5021,71 @@ function bc({ environment: e }) {
5021
5021
  return t?.mutedUntil ?? null;
5022
5022
  }
5023
5023
  }
5024
- function pt(e) {
5025
- let t = I(e, _.value?.uid);
5024
+ function mt(e) {
5025
+ let t = I(e, v.value?.uid);
5026
5026
  if (!Lc(t) || t.isDeleted) return;
5027
- let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
5027
+ let n = e.getConversationId(), r = y.value.find((e) => e.id === n);
5028
5028
  if (!r) {
5029
- Ee();
5029
+ De();
5030
5030
  return;
5031
5031
  }
5032
5032
  let i = {
5033
5033
  ...r,
5034
5034
  subtitle: lc(t),
5035
5035
  lastMessageAt: /* @__PURE__ */ new Date((e.getSentAt?.() ?? 0) * 1e3),
5036
- unreadCount: n === T.value ? 0 : r.unreadCount + 1,
5036
+ unreadCount: n === E.value ? 0 : r.unreadCount + 1,
5037
5037
  lastMessage: t
5038
5038
  };
5039
- v.value = Mc(v.value.map((e) => e.id === n ? i : e)), W?.setConversations(v.value);
5040
- }
5041
- function mt(e) {
5042
- y.value = Pc(y.value, e), T.value && W?.setMessages(T.value, y.value);
5039
+ y.value = Mc(y.value.map((e) => e.id === n ? i : e)), K?.setConversations(y.value);
5043
5040
  }
5044
5041
  function ht(e) {
5045
- e.parentMessageId === E.value?.id && (b.value = Pc(b.value, e), e.parentMessageId && W?.setThreadMessages(e.parentMessageId, b.value));
5042
+ b.value = Pc(b.value, e), E.value && K?.setMessages(E.value, b.value);
5046
5043
  }
5047
- async function gt(e) {
5048
- if (m.value) return;
5049
- let t = e.getSender?.()?.getUid?.();
5050
- !t || t === _.value?.uid || e.getReadByMeAt?.() || (ge(), await K.markAsRead(e));
5044
+ function gt(e) {
5045
+ e.parentMessageId === D.value?.id && (x.value = Pc(x.value, e), e.parentMessageId && K?.setThreadMessages(e.parentMessageId, x.value));
5051
5046
  }
5052
5047
  async function X(e) {
5053
5048
  if (m.value) return;
5054
5049
  let t = e.getSender?.()?.getUid?.();
5055
- !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (ge(), await K.markAsDelivered(e));
5050
+ !t || t === v.value?.uid || e.getReadByMeAt?.() || (_e(), await q.markAsRead(e));
5056
5051
  }
5057
5052
  async function vt(e) {
5058
- return m.value ? [] : Tc(await K.getMessageReceipts(String(e.id)));
5053
+ if (m.value) return;
5054
+ let t = e.getSender?.()?.getUid?.();
5055
+ !t || t === v.value?.uid || e.getDeliveredToMeAt?.() || (_e(), await q.markAsDelivered(e));
5059
5056
  }
5060
- function yt() {
5061
- r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, he(), re = 0, ie = !1, ae = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, q = null, se = null, oe.clear();
5057
+ async function yt(e) {
5058
+ return m.value ? [] : Tc(await q.getMessageReceipts(String(e.id)));
5062
5059
  }
5063
- async function bt(e) {
5064
- if (te) return te;
5060
+ function bt() {
5061
+ r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ge(), re = 0, ie = !1, G = !1, g.value = !1, v.value = null, y.value = [], b.value = [], x.value = [], S.value = [], D.value = null, O.value = null, k.value = null, A.value = [], E.value = null, C.value = !1, T.value = !1, se = null, ce = null, oe.clear();
5062
+ }
5063
+ async function xt(e) {
5064
+ if (W) return W;
5065
5065
  let t = e?.includeThread ?? !0;
5066
- te = (async () => {
5067
- L.value && await et(), t && E.value && await nt(E.value.id);
5066
+ W = (async () => {
5067
+ L.value && await tt(), t && D.value && await rt(D.value.id);
5068
5068
  })();
5069
5069
  try {
5070
- await te;
5070
+ await W;
5071
5071
  } finally {
5072
- te = null;
5072
+ W = null;
5073
5073
  }
5074
5074
  }
5075
- function xt(e) {
5076
- St(e), e.parentMessageId && Tt(e.parentMessageId, e.replyCount), Et();
5077
- }
5078
5075
  function St(e) {
5076
+ Ct(e), e.parentMessageId && Et(e.parentMessageId, e.replyCount), Dt();
5077
+ }
5078
+ function Ct(e) {
5079
5079
  if (e.parentMessageId) {
5080
- E.value?.id === e.parentMessageId && (b.value = Pc(b.value, e));
5080
+ D.value?.id === e.parentMessageId && (x.value = Pc(x.value, e));
5081
5081
  return;
5082
5082
  }
5083
- y.value = Pc(y.value, e), E.value?.id === e.id && (E.value = e);
5084
- }
5085
- function Ct(e, t) {
5086
- return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
5083
+ b.value = Pc(b.value, e), D.value?.id === e.id && (D.value = e);
5087
5084
  }
5088
5085
  function wt(e, t) {
5086
+ return t ? x.value.find((t) => t.id === e) ?? null : D.value?.id === e ? D.value : b.value.find((t) => t.id === e) ?? null;
5087
+ }
5088
+ function Tt(e, t) {
5089
5089
  let n = e.reactions.find((e) => e.emoji === t);
5090
5090
  return n ? n.reactedByMe && n.count === 1 ? {
5091
5091
  ...e,
@@ -5106,41 +5106,41 @@ function bc({ environment: e }) {
5106
5106
  }]
5107
5107
  };
5108
5108
  }
5109
- function Tt(e, t) {
5110
- let n = y.value.find((t) => t.id === e);
5109
+ function Et(e, t) {
5110
+ let n = b.value.find((t) => t.id === e);
5111
5111
  if (!n) return;
5112
5112
  let r = {
5113
5113
  ...n,
5114
5114
  replyCount: typeof t == "number" ? t : Math.max(n.replyCount + 1, 1)
5115
5115
  };
5116
- y.value = Pc(y.value, r), E.value?.id === e && (E.value = r);
5116
+ b.value = Pc(b.value, r), D.value?.id === e && (D.value = r);
5117
5117
  }
5118
- function Et() {
5119
- T.value && W?.setMessages(T.value, y.value), E.value && W?.setThreadMessages(E.value.id, b.value);
5118
+ function Dt() {
5119
+ E.value && K?.setMessages(E.value, b.value), D.value && K?.setThreadMessages(D.value.id, x.value);
5120
5120
  }
5121
- function Dt(e) {
5122
- if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), W?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && W?.setMessages(T.value, y.value)), e.muid) {
5123
- k.value = k.value.filter((t) => t.muid !== e.muid);
5124
- let t = W?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5125
- for (let e of t) W?.dequeue(e.id), G.delete(e.id), e.kind === "attachment" && W?.deleteQueuedAttachment(e.id);
5121
+ function Ot(e) {
5122
+ if (e.parentMessageId ? (x.value = x.value.filter((t) => t.id !== e.id), K?.setThreadMessages(e.parentMessageId, x.value)) : (b.value = b.value.filter((t) => t.id !== e.id), E.value && K?.setMessages(E.value, b.value)), e.muid) {
5123
+ A.value = A.value.filter((t) => t.muid !== e.muid);
5124
+ let t = K?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5125
+ for (let e of t) K?.dequeue(e.id), ae.delete(e.id), e.kind === "attachment" && K?.deleteQueuedAttachment(e.id);
5126
5126
  }
5127
- e.parentMessageId || kt(e.conversationId);
5127
+ e.parentMessageId || At(e.conversationId);
5128
5128
  }
5129
- function Ot(e) {
5129
+ function kt(e) {
5130
5130
  if (e.parentMessageId) return;
5131
- let t = e.conversationId, n = v.value.find((e) => e.id === t);
5131
+ let t = e.conversationId, n = y.value.find((e) => e.id === t);
5132
5132
  if (!n) return;
5133
5133
  let r = n.lastMessageAt?.getTime(), i = e.sentAt?.getTime();
5134
5134
  if (r != null && i != null && r > i) return;
5135
- let a = t === T.value, o;
5136
- if (a) for (let t = y.value.length - 1; t >= 0; t--) {
5137
- let n = y.value[t];
5135
+ let a = t === E.value, o;
5136
+ if (a) for (let t = b.value.length - 1; t >= 0; t--) {
5137
+ let n = b.value[t];
5138
5138
  if (!n.parentMessageId && n.id !== e.id && !n.isDeleted) {
5139
5139
  o = n;
5140
5140
  break;
5141
5141
  }
5142
5142
  }
5143
- v.value = Mc(v.value.map((e) => e.id === t ? o ? {
5143
+ y.value = Mc(y.value.map((e) => e.id === t ? o ? {
5144
5144
  ...e,
5145
5145
  subtitle: Bc(o),
5146
5146
  lastMessageAt: o.sentAt,
@@ -5149,35 +5149,35 @@ function bc({ environment: e }) {
5149
5149
  ...e,
5150
5150
  subtitle: "No messages yet",
5151
5151
  lastMessageAt: void 0
5152
- } : e : e)), W?.setConversations(v.value);
5152
+ } : e : e)), K?.setConversations(y.value);
5153
5153
  }
5154
- function kt(e, t) {
5155
- let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
5156
- v.value = Mc(v.value.map((t) => t.id === e ? {
5154
+ function At(e, t) {
5155
+ let n = b.value.length > 0 ? b.value[b.value.length - 1] : null, r = t ?? n;
5156
+ y.value = Mc(y.value.map((t) => t.id === e ? {
5157
5157
  ...t,
5158
5158
  subtitle: r ? Bc(r) : "No messages yet",
5159
5159
  lastMessageAt: r?.sentAt,
5160
5160
  lastMessage: r
5161
- } : t)), W?.setConversations(v.value);
5161
+ } : t)), K?.setConversations(y.value);
5162
5162
  }
5163
- function At(e) {
5164
- v.value = Mc(v.value.map((t) => t.id === e.conversationId ? {
5163
+ function jt(e) {
5164
+ y.value = Mc(y.value.map((t) => t.id === e.conversationId ? {
5165
5165
  ...t,
5166
5166
  subtitle: Bc(e),
5167
5167
  lastMessageAt: e.sentAt,
5168
5168
  lastMessage: e,
5169
5169
  unreadCount: 0
5170
- } : t)), W?.setConversations(v.value);
5170
+ } : t)), K?.setConversations(y.value);
5171
5171
  }
5172
- function jt(e) {
5173
- let t = /* @__PURE__ */ new Date(), n = Nt(e.metadata);
5172
+ function Mt(e) {
5173
+ let t = /* @__PURE__ */ new Date(), n = Pt(e.metadata);
5174
5174
  return {
5175
5175
  id: `local-${e.muid}`,
5176
5176
  muid: e.muid,
5177
5177
  conversationId: e.conversation.id,
5178
- senderId: _.value?.uid ?? "me",
5179
- senderName: Zc(_.value, e.metadata),
5180
- senderAvatar: _.value?.avatar,
5178
+ senderId: v.value?.uid ?? "me",
5179
+ senderName: Zc(v.value, e.metadata),
5180
+ senderAvatar: v.value?.avatar,
5181
5181
  text: e.text,
5182
5182
  kind: e.kind,
5183
5183
  sentAt: t,
@@ -5209,11 +5209,11 @@ function bc({ environment: e }) {
5209
5209
  source: null
5210
5210
  };
5211
5211
  }
5212
- function Mt(e, t) {
5212
+ function Nt(e, t) {
5213
5213
  let n = {};
5214
5214
  return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = oc(e), n) : n;
5215
5215
  }
5216
- function Nt(e) {
5216
+ function Pt(e) {
5217
5217
  let t = e.replyPreview;
5218
5218
  if (!t || typeof t != "object") return;
5219
5219
  let n = t;
@@ -5224,13 +5224,13 @@ function bc({ environment: e }) {
5224
5224
  kind: n.kind ?? "text"
5225
5225
  };
5226
5226
  }
5227
- function Pt(e) {
5228
- if (M() || m.value) return !0;
5227
+ function Ft(e) {
5228
+ if (ee() || m.value) return !0;
5229
5229
  let t = Vc(e, "").toLowerCase();
5230
5230
  return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
5231
5231
  }
5232
- function Ft(e, t, n, r, i) {
5233
- let a = jt({
5232
+ function It(e, t, n, r, i) {
5233
+ let a = Mt({
5234
5234
  conversation: e,
5235
5235
  kind: "text",
5236
5236
  text: t,
@@ -5239,7 +5239,7 @@ function bc({ environment: e }) {
5239
5239
  muid: i,
5240
5240
  deliveryState: "queued"
5241
5241
  });
5242
- zt(a, {
5242
+ Vt(a, {
5243
5243
  id: a.id,
5244
5244
  muid: i,
5245
5245
  conversationId: e.id,
@@ -5252,9 +5252,9 @@ function bc({ environment: e }) {
5252
5252
  createdAt: a.sentAt.toISOString()
5253
5253
  });
5254
5254
  }
5255
- function It(e, t, n, r, i) {
5256
- if (Lt(e, t, r)) return;
5257
- let a = jt({
5255
+ function Lt(e, t, n, r, i) {
5256
+ if (Rt(e, t, r)) return;
5257
+ let a = Mt({
5258
5258
  conversation: e,
5259
5259
  kind: "poll",
5260
5260
  text: `Poll: ${t.question}`,
@@ -5264,7 +5264,7 @@ function bc({ environment: e }) {
5264
5264
  muid: i,
5265
5265
  deliveryState: "queued"
5266
5266
  });
5267
- zt(a, {
5267
+ Vt(a, {
5268
5268
  id: a.id,
5269
5269
  muid: i,
5270
5270
  conversationId: e.id,
@@ -5277,16 +5277,16 @@ function bc({ environment: e }) {
5277
5277
  createdAt: a.sentAt.toISOString()
5278
5278
  });
5279
5279
  }
5280
- function Lt(e, t, n) {
5280
+ function Rt(e, t, n) {
5281
5281
  let r = Date.now(), i = (e) => e.trim().toLowerCase(), a = (e) => e.map((e) => i(e)).filter(Boolean).join("\0"), o = i(t.question), s = a(t.options);
5282
- return k.value.some((t) => {
5282
+ return A.value.some((t) => {
5283
5283
  if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
5284
5284
  let c = new Date(t.createdAt).getTime();
5285
5285
  return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
5286
5286
  });
5287
5287
  }
5288
- async function Rt(e, t, n, r, i) {
5289
- let a = qc(t.file), o = jt({
5288
+ async function zt(e, t, n, r, i) {
5289
+ let a = qc(t.file), o = Mt({
5290
5290
  conversation: e,
5291
5291
  kind: a,
5292
5292
  text: t.caption?.trim() ?? "",
@@ -5318,19 +5318,19 @@ function bc({ environment: e }) {
5318
5318
  parentMessageId: r,
5319
5319
  createdAt: o.sentAt.toISOString()
5320
5320
  };
5321
- G.set(s.id, t.file);
5321
+ ae.set(s.id, t.file);
5322
5322
  try {
5323
- await W?.storeQueuedAttachment(s.id, t.file);
5323
+ await K?.storeQueuedAttachment(s.id, t.file);
5324
5324
  } catch {}
5325
- zt(o, s);
5325
+ Vt(o, s);
5326
5326
  }
5327
- function zt(e, t) {
5328
- k.value = [...k.value, t], W?.enqueue(t), Vt(e);
5327
+ function Vt(e, t) {
5328
+ A.value = [...A.value, t], K?.enqueue(t), Ht(e);
5329
5329
  }
5330
- function Vt(e) {
5331
- e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Pc(b.value, e)), Tt(e.parentMessageId)) : y.value = Pc(y.value, e), At(e), Et();
5330
+ function Ht(e) {
5331
+ e.parentMessageId ? (D.value?.id === e.parentMessageId && (x.value = Pc(x.value, e)), Et(e.parentMessageId)) : b.value = Pc(b.value, e), jt(e), Dt();
5332
5332
  }
5333
- function Ht(e, t) {
5333
+ function Ut(e, t) {
5334
5334
  let n = (n) => n.map((n) => {
5335
5335
  let r = Rc(n);
5336
5336
  return n.muid !== t && r !== t ? n : {
@@ -5338,40 +5338,40 @@ function bc({ environment: e }) {
5338
5338
  deliveryState: e
5339
5339
  };
5340
5340
  });
5341
- y.value = n(y.value), b.value = n(b.value), Et();
5341
+ b.value = n(b.value), x.value = n(x.value), Dt();
5342
5342
  }
5343
- function Ut(e) {
5343
+ function Wt(e) {
5344
5344
  if (!e) return;
5345
- let t = [...y.value, ...b.value].filter((t) => {
5345
+ let t = [...b.value, ...x.value].filter((t) => {
5346
5346
  if (!t.id.startsWith("local-")) return !1;
5347
5347
  let n = Rc(t);
5348
5348
  return t.muid === e || n === e;
5349
5349
  });
5350
- for (let e of t) Dt(e);
5350
+ for (let e of t) Ot(e);
5351
5351
  }
5352
- async function Wt() {
5353
- if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
5352
+ async function Gt() {
5353
+ if (!(f.value || A.value.length === 0 || !g.value || m.value)) {
5354
5354
  f.value = !0;
5355
5355
  try {
5356
- let e = [...k.value].filter((e) => !oe.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5356
+ let e = [...A.value].filter((e) => !oe.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5357
5357
  for (let t of e) if (!oe.has(t.id)) {
5358
5358
  oe.add(t.id);
5359
5359
  try {
5360
- let e = await Gt(t);
5361
- k.value = k.value.filter((e) => e.id !== t.id), W?.dequeue(t.id), G.delete(t.id), t.kind === "attachment" && await W?.deleteQueuedAttachment(t.id), Ut(t.muid), e ? xt(I(e, _.value?.uid)) : await bt();
5360
+ let e = await Kt(t);
5361
+ A.value = A.value.filter((e) => e.id !== t.id), K?.dequeue(t.id), ae.delete(t.id), t.kind === "attachment" && await K?.deleteQueuedAttachment(t.id), Wt(t.muid), e ? St(I(e, v.value?.uid)) : await xt();
5362
5362
  } finally {
5363
5363
  oe.delete(t.id);
5364
5364
  }
5365
5365
  }
5366
5366
  } catch (e) {
5367
- Pt(e) || (g.value = Vc(e, "Unable to sync queued messages."));
5367
+ Ft(e) || (_.value = Vc(e, "Unable to sync queued messages."));
5368
5368
  } finally {
5369
5369
  f.value = !1;
5370
5370
  }
5371
5371
  }
5372
5372
  }
5373
- async function Gt(e) {
5374
- let t = e.receiverType === "group" ? K.RECEIVER_TYPE.GROUP : K.RECEIVER_TYPE.USER;
5373
+ async function Kt(e) {
5374
+ let t = e.receiverType === "group" ? q.RECEIVER_TYPE.GROUP : q.RECEIVER_TYPE.USER;
5375
5375
  if (e.kind === "poll" && e.poll) {
5376
5376
  let n = {
5377
5377
  question: e.poll.question,
@@ -5380,17 +5380,17 @@ function bc({ environment: e }) {
5380
5380
  receiverType: t
5381
5381
  };
5382
5382
  e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
5383
- let r = await K.callExtension("polls", "POST", "v2/create", n);
5383
+ let r = await q.callExtension("polls", "POST", "v2/create", n);
5384
5384
  return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
5385
5385
  }
5386
5386
  if (e.kind === "attachment" && e.attachment) {
5387
- let n = G.get(e.id) ?? await W?.getQueuedAttachment(e.id) ?? null;
5387
+ let n = ae.get(e.id) ?? await K?.getQueuedAttachment(e.id) ?? null;
5388
5388
  if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
5389
- let r = new K.MediaMessage(e.targetId, n, e.attachment.kind, t);
5390
- return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), K.sendMediaMessage(r);
5389
+ let r = new q.MediaMessage(e.targetId, n, e.attachment.kind, t);
5390
+ return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), q.sendMediaMessage(r);
5391
5391
  }
5392
- let n = new K.TextMessage(e.targetId, e.text ?? "", t);
5393
- return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), K.sendMessage(n);
5392
+ let n = new q.TextMessage(e.targetId, e.text ?? "", t);
5393
+ return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), q.sendMessage(n);
5394
5394
  }
5395
5395
  return {
5396
5396
  initialized: t,
@@ -5406,57 +5406,58 @@ function bc({ environment: e }) {
5406
5406
  syncingQueue: f,
5407
5407
  connected: p,
5408
5408
  offlineMode: m,
5409
- loggedIn: h,
5410
- error: g,
5411
- currentUser: _,
5412
- conversations: v,
5413
- messages: y,
5414
- threadMessages: b,
5415
- scheduledMessages: x,
5416
- hasOlderMessages: S,
5417
- hasOlderThreadMessages: C,
5418
- pendingQueueCount: j,
5419
- activeConversationId: T,
5409
+ hideGroupActions: h,
5410
+ loggedIn: g,
5411
+ error: _,
5412
+ currentUser: v,
5413
+ conversations: y,
5414
+ messages: b,
5415
+ threadMessages: x,
5416
+ scheduledMessages: S,
5417
+ hasOlderMessages: C,
5418
+ hasOlderThreadMessages: T,
5419
+ pendingQueueCount: M,
5420
+ activeConversationId: E,
5420
5421
  activeConversation: L,
5421
- activeThreadParentMessage: E,
5422
- replyToMessage: D,
5423
- editingMessage: O,
5424
- init: le,
5425
- connectRealtime: we,
5426
- disconnectRealtime: Te,
5427
- login: ue,
5428
- logout: de,
5429
- fetchConversations: Ee,
5430
- selectConversation: De,
5431
- sendTextMessage: Me,
5432
- sendAttachmentMessage: Pe,
5433
- sendPollMessage: J,
5434
- fetchScheduledMessages: Be,
5435
- loadOlderMessages: rt,
5436
- loadOlderThreadMessages: it,
5437
- ensureMessageLoaded: at,
5438
- scheduleMessage: He,
5439
- rescheduleMessage: Ge,
5440
- removeScheduledMessage: Ue,
5441
- editScheduledMessage: We,
5442
- setReplyToMessage: Oe,
5443
- setEditingMessage: ke,
5444
- openThread: Ae,
5445
- closeThread: je,
5446
- refreshVisibleMessages: bt,
5447
- fetchMessageReceipts: vt,
5448
- deleteMessage: Re,
5449
- votePoll: Fe,
5450
- toggleReaction: Le,
5451
- translateMessage: ze,
5452
- mentionDisplayNamesByUid: A,
5422
+ activeThreadParentMessage: D,
5423
+ replyToMessage: O,
5424
+ editingMessage: k,
5425
+ init: ue,
5426
+ connectRealtime: Te,
5427
+ disconnectRealtime: Ee,
5428
+ login: de,
5429
+ logout: fe,
5430
+ fetchConversations: De,
5431
+ selectConversation: Oe,
5432
+ sendTextMessage: Ne,
5433
+ sendAttachmentMessage: J,
5434
+ sendPollMessage: Fe,
5435
+ fetchScheduledMessages: He,
5436
+ loadOlderMessages: it,
5437
+ loadOlderThreadMessages: at,
5438
+ ensureMessageLoaded: ot,
5439
+ scheduleMessage: Ue,
5440
+ rescheduleMessage: Je,
5441
+ removeScheduledMessage: We,
5442
+ editScheduledMessage: Ge,
5443
+ setReplyToMessage: ke,
5444
+ setEditingMessage: Ae,
5445
+ openThread: je,
5446
+ closeThread: Me,
5447
+ refreshVisibleMessages: xt,
5448
+ fetchMessageReceipts: yt,
5449
+ deleteMessage: ze,
5450
+ votePoll: Ie,
5451
+ toggleReaction: Re,
5452
+ translateMessage: Be,
5453
+ mentionDisplayNamesByUid: j,
5453
5454
  rememberMentionDisplayNames: P
5454
5455
  };
5455
5456
  }
5456
5457
  async function xc(e) {
5457
5458
  return Ve(e), vc === e && yc || (yc = (async () => {
5458
- let t = Y(), n = new K.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(K.StorageMode.SESSION).build();
5459
- await K.init(t.appId, n), vc = e;
5459
+ let t = Y(), n = new q.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(q.StorageMode.SESSION).build();
5460
+ await q.init(t.appId, n), vc = e;
5460
5461
  })()), yc;
5461
5462
  }
5462
5463
  async function Sc(e) {
@@ -5477,7 +5478,7 @@ async function Sc(e) {
5477
5478
  }), i.token;
5478
5479
  }
5479
5480
  function Cc(e, t) {
5480
- let n = e.getConversationWith(), r = e.getConversationType() === K.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5481
+ let n = e.getConversationWith(), r = e.getConversationType() === q.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5481
5482
  if (c && e.getConversationId() === c) return {
5482
5483
  id: e.getConversationId(),
5483
5484
  targetId: o,
@@ -5576,7 +5577,7 @@ function Ac(e, t) {
5576
5577
  let n = e.getType?.(), r = e.getCategory?.(), i = ml(e);
5577
5578
  if (String(r).toLowerCase() === "action") return rl(e);
5578
5579
  if (i) return `Poll: ${i.question}`;
5579
- if (n === K.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5580
+ if (n === q.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5580
5581
  let t = tc(e.getText());
5581
5582
  if (t) return t;
5582
5583
  }
@@ -5591,7 +5592,7 @@ function jc(e, t) {
5591
5592
  let n = e.getType?.(), r = e.getCategory?.(), i = ml(e);
5592
5593
  if (String(r).toLowerCase() === "action") return rl(e);
5593
5594
  if (i) return `Poll: ${i.question}`;
5594
- if (n === K.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5595
+ if (n === q.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5595
5596
  let t = Qs(e.getText?.());
5596
5597
  if (ec(t)) return t;
5597
5598
  }
@@ -5651,7 +5652,7 @@ function Hc(e) {
5651
5652
  return t.code === "ERR_GUID_NOT_FOUND" || t.status === 404 || t.statusCode === 404;
5652
5653
  }
5653
5654
  function Uc(e) {
5654
- return e.type === "group" ? K.RECEIVER_TYPE.GROUP : K.RECEIVER_TYPE.USER;
5655
+ return e.type === "group" ? q.RECEIVER_TYPE.GROUP : q.RECEIVER_TYPE.USER;
5655
5656
  }
5656
5657
  function Wc() {
5657
5658
  let e = Ke();
@@ -5704,7 +5705,7 @@ function Jc(e) {
5704
5705
  return t;
5705
5706
  }
5706
5707
  function Yc(e, t, n, r, i, a) {
5707
- let o = new K.MediaMessage(e.targetId, t, n, Uc(e));
5708
+ let o = new q.MediaMessage(e.targetId, t, n, Uc(e));
5708
5709
  return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
5709
5710
  scheduleDate: i,
5710
5711
  file: t,
@@ -5989,9 +5990,9 @@ function Cl(e, t) {
5989
5990
  let n = t?.value?.getMetadata?.() ?? {};
5990
5991
  if (!e?.getSender?.() || n.isChannel) return "";
5991
5992
  let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
5992
- e instanceof K.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5993
+ e instanceof q.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5993
5994
  let a = i.systemDisplayName;
5994
- return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof K.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5995
+ return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof q.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5995
5996
  }
5996
5997
  function wl(e, t = 25, n) {
5997
5998
  let r = e.trim();
@@ -6014,7 +6015,7 @@ function wl(e, t = 25, n) {
6014
6015
  };
6015
6016
  }
6016
6017
  async function Tl(e) {
6017
- let t = new K.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
6018
+ let t = new q.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
6018
6019
  try {
6019
6020
  for (; n;) {
6020
6021
  let e = await t.fetchNext();
@@ -6033,7 +6034,7 @@ async function Tl(e) {
6033
6034
  }
6034
6035
  async function El(e) {
6035
6036
  await Il("failed to get muted setting. User not logged in");
6036
- let t = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await K.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
6037
+ let t = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await q.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
6037
6038
  return Nl()?.storeParticipantSettings({
6038
6039
  chatUid: e,
6039
6040
  mutedUntil: t.mutedUntil,
@@ -6042,7 +6043,7 @@ async function El(e) {
6042
6043
  }
6043
6044
  async function Dl(e, t) {
6044
6045
  await Il("failed to mute chat. User not logged in");
6045
- let n = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await K.getLoggedinUser())?.getUid?.()}`, {
6046
+ let n = await Ll(`${Y().chatApiBaseUrl}/chats/${e}/settings/${(await q.getLoggedinUser())?.getUid?.()}`, {
6046
6047
  method: "PATCH",
6047
6048
  body: JSON.stringify({ mutedUntil: t })
6048
6049
  });
@@ -6085,11 +6086,11 @@ function Pl() {
6085
6086
  return e ? `bcc-chat:${Y().appId}:${e}` : null;
6086
6087
  }
6087
6088
  function Fl() {
6088
- return K.__bccCompatLoggedInUser ?? null;
6089
+ return q.__bccCompatLoggedInUser ?? null;
6089
6090
  }
6090
6091
  async function Il(e) {
6091
- let t = await K.getLoggedinUser();
6092
- if (K.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
6092
+ let t = await q.getLoggedinUser();
6093
+ if (q.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
6093
6094
  return t;
6094
6095
  }
6095
6096
  async function Ll(e, t) {
@@ -6172,7 +6173,7 @@ async function iu(e) {
6172
6173
  if (!Zl.has(e)) {
6173
6174
  Zl.add(e);
6174
6175
  try {
6175
- let t = await K.getMessageReceipts(e);
6176
+ let t = await q.getMessageReceipts(e);
6176
6177
  Xl.value = {
6177
6178
  ...Xl.value,
6178
6179
  [e]: ru(t)
@@ -6211,7 +6212,7 @@ var ou = n(() => $.value?.connected.value ?? !1), su = n(() => Ul.value && !ou.v
6211
6212
  }),
6212
6213
  onlineStatus: n(() => $.value ? $.value.offlineMode.value || !$.value.connected.value ? "offline" : "online" : "offline")
6213
6214
  }, uu = w([]), du = "";
6214
- I([() => $.value?.conversations.value, () => nu.value], async () => {
6215
+ F([() => $.value?.conversations.value, () => nu.value], async () => {
6215
6216
  let e = crypto.randomUUID();
6216
6217
  du = e;
6217
6218
  let t = nu.value;
@@ -6227,19 +6228,19 @@ I([() => $.value?.conversations.value, () => nu.value], async () => {
6227
6228
  hasJoined: e.hasJoined ?? !0
6228
6229
  })));
6229
6230
  du === e && (uu.value = n);
6230
- }), I(() => nu.value, () => {
6231
+ }), F(() => nu.value, () => {
6231
6232
  Xl.value = {}, Zl.clear();
6232
6233
  });
6233
6234
  async function fu(e, t) {
6234
6235
  Jl.value = t.loggerCallback, gt(t.language ?? "en"), eu(t.themeMode), e.use(H);
6235
6236
  let n = e.config.globalProperties.$primevue;
6236
- n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", Uh), e.provide("theme", { theme: Bl });
6237
+ n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.provide("theme", { theme: Bl });
6237
6238
  let r = tu(t.environment);
6238
6239
  $l(Hl.INFO, "Initializing chat", {
6239
6240
  environment: t.environment,
6240
6241
  language: ft.value,
6241
6242
  themeMode: t.themeMode
6242
- }), await r.init(), Ul.value = !0, Ql?.(), p(t.accessToken) ? Ql = I(t.accessToken, async (e) => {
6243
+ }), await r.init(), Ul.value = !0, Ql?.(), p(t.accessToken) ? Ql = F(t.accessToken, async (e) => {
6243
6244
  e ? await pu(e) : await mu();
6244
6245
  }, { immediate: !0 }) : t.accessToken && await pu(t.accessToken), $l(Hl.INFO, "Chat initialized", { environment: Y().appId });
6245
6246
  }
@@ -6283,7 +6284,7 @@ function Su(e) {
6283
6284
  async function Cu(e, t = !1) {
6284
6285
  if (!cu.value) return null;
6285
6286
  try {
6286
- return await K.getGroup(e);
6287
+ return await q.getGroup(e);
6287
6288
  } catch (e) {
6288
6289
  if (e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND") return;
6289
6290
  if (t) throw e;
@@ -6300,7 +6301,7 @@ async function Tu(e) {
6300
6301
  }
6301
6302
  async function Eu(e) {
6302
6303
  try {
6303
- return cu.value && (await K.getOnlineGroupMemberCount([e]))[e] || 0;
6304
+ return cu.value && (await q.getOnlineGroupMemberCount([e]))[e] || 0;
6304
6305
  } catch {
6305
6306
  return 0;
6306
6307
  }
@@ -6841,7 +6842,7 @@ function fd(e) {
6841
6842
  return;
6842
6843
  }
6843
6844
  try {
6844
- t.value = (await new K.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6845
+ t.value = (await new q.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6845
6846
  uid: e.getUid(),
6846
6847
  displayName: e.getName(),
6847
6848
  avatar: Qe(e.getAvatar?.()) ?? "",
@@ -6858,7 +6859,7 @@ function fd(e) {
6858
6859
  uid: r.getUid(),
6859
6860
  displayName: r.getName(),
6860
6861
  avatar: Qe(r.getAvatar?.()) ?? "",
6861
- role: a ?? r.getScope?.() ?? K.GROUP_MEMBER_SCOPE.PARTICIPANT
6862
+ role: a ?? r.getScope?.() ?? q.GROUP_MEMBER_SCOPE.PARTICIPANT
6862
6863
  };
6863
6864
  i === "add" ? t.value.some((e) => e.uid === c.uid) || (t.value = [...t.value, c]) : i === "remove" ? t.value = t.value.filter((e) => e.uid !== c.uid) : t.value = t.value.map((e) => e.uid === c.uid ? {
6864
6865
  ...e,
@@ -6866,7 +6867,7 @@ function fd(e) {
6866
6867
  } : e), e.onMembersChanged(t.value);
6867
6868
  }
6868
6869
  return b(() => {
6869
- K.addGroupListener(n, new K.GroupListener({
6870
+ q.addGroupListener(n, new q.GroupListener({
6870
6871
  onGroupMemberScopeChanged: (e, t, n, r, a) => {
6871
6872
  i(a, t, "update", n);
6872
6873
  },
@@ -6890,7 +6891,7 @@ function fd(e) {
6890
6891
  }
6891
6892
  }));
6892
6893
  }), x(() => {
6893
- K.removeGroupListener(n);
6894
+ q.removeGroupListener(n);
6894
6895
  }), {
6895
6896
  groupMembers: t,
6896
6897
  fetchGroupMembers: r
@@ -7148,14 +7149,14 @@ function Ed(e, t, r, i) {
7148
7149
  getTriggers: () => f.value,
7149
7150
  onChange: () => O()
7150
7151
  });
7151
- I(() => i.getMentionCandidates?.(), () => {
7152
+ F(() => i.getMentionCandidates?.(), () => {
7152
7153
  T();
7153
7154
  }, { deep: !0 });
7154
7155
  function E(e) {
7155
7156
  let t = Is(e);
7156
7157
  return t.includes("<@uid:") ? Is(Pt(t, i.getMentionNameByUid?.() ?? {})) : t;
7157
7158
  }
7158
- I(() => i.getModelValue(), (e) => {
7159
+ F(() => i.getModelValue(), (e) => {
7159
7160
  let n = t.value, r = E(e);
7160
7161
  if (r !== c.value) {
7161
7162
  if (!n) {
@@ -7187,33 +7188,33 @@ function Ed(e, t, r, i) {
7187
7188
  function M() {
7188
7189
  return !j() || i.shouldClearSelectionOnLinkRequest?.();
7189
7190
  }
7190
- function N(e) {
7191
+ function ee(e) {
7191
7192
  let n = t.value;
7192
7193
  return !!(e && n?.contains(e.commonAncestorContainer) && e.toString().trim());
7193
7194
  }
7194
- function P(e) {
7195
+ function N(e) {
7195
7196
  u = e.cloneRange();
7196
7197
  }
7197
- function F() {
7198
+ function P() {
7198
7199
  u = null;
7199
7200
  }
7200
- function L() {
7201
- return N(u) ? u?.cloneRange() ?? null : (F(), null);
7201
+ function I() {
7202
+ return ee(u) ? u?.cloneRange() ?? null : (P(), null);
7202
7203
  }
7203
- function ee() {
7204
+ function L() {
7204
7205
  let e = window.getSelection(), n = t.value;
7205
7206
  if (!e || !n || e.rangeCount === 0 || e.isCollapsed) return null;
7206
7207
  let r = e.getRangeAt(0);
7207
- return N(r) ? r : null;
7208
+ return ee(r) ? r : null;
7208
7209
  }
7209
7210
  function R() {
7210
- return ee() ?? (M() ? L() : null);
7211
+ return L() ?? (M() ? I() : null);
7211
7212
  }
7212
7213
  function z(e) {
7213
7214
  let t = window.getSelection();
7214
7215
  t && (t.removeAllRanges(), t.addRange(e));
7215
7216
  }
7216
- function B(e = ee()) {
7217
+ function B(e = L()) {
7217
7218
  return e?.toString().trim() ?? "";
7218
7219
  }
7219
7220
  function V(e) {
@@ -7245,21 +7246,21 @@ function Ed(e, t, r, i) {
7245
7246
  let n = e ? `${e.text}|${e.href ?? ""}|${e.rect.top}|${e.rect.left}|${e.rect.width}|${e.rect.height}` : "";
7246
7247
  !t?.force && n === l.value || (l.value = n, i.onSelectionChange?.(e));
7247
7248
  }
7248
- function ne(e, t, n) {
7249
+ function W(e, t, n) {
7249
7250
  return Math.min(Math.max(e, t), n);
7250
7251
  }
7251
- function re() {
7252
+ function ne() {
7252
7253
  return window.matchMedia?.("(pointer: coarse)").matches || window.matchMedia?.("(any-pointer: coarse)").matches || navigator.maxTouchPoints > 0;
7253
7254
  }
7254
- function ie(e, n) {
7255
+ function re(e, n) {
7255
7256
  let r = t.value, i = e.getBoundingClientRect(), a = r?.getBoundingClientRect(), o = i.width || i.height ? i : a;
7256
7257
  if (!o) return;
7257
- let c = re(), l = c ? 248 : 176, u = c ? 48 : 180, d = c ? Td : 0, f = !c && !!n, p = f ? n.clientX : o.left + o.width / 2, m = f ? n.clientY : o.top, h = f ? n.clientY : o.bottom, g = l / 2 + 8, _ = ne(p, g, Math.max(g, window.innerWidth - l / 2 - 8)), v = m - 6 - 8, y = window.innerHeight - h - 6 - 8;
7258
+ let c = ne(), l = c ? 248 : 176, u = c ? 48 : 180, d = c ? Td : 0, f = !c && !!n, p = f ? n.clientX : o.left + o.width / 2, m = f ? n.clientY : o.top, h = f ? n.clientY : o.bottom, g = l / 2 + 8, _ = W(p, g, Math.max(g, window.innerWidth - l / 2 - 8)), v = m - 6 - 8, y = window.innerHeight - h - 6 - 8;
7258
7259
  if (!c && (y >= u || y >= v)) {
7259
7260
  let e = Math.max(8, window.innerHeight - u - 8);
7260
7261
  s.value = {
7261
7262
  x: Math.round(_),
7262
- y: Math.round(ne(h + 6, 8, e)),
7263
+ y: Math.round(W(h + 6, 8, e)),
7263
7264
  placement: "below"
7264
7265
  };
7265
7266
  return;
@@ -7267,60 +7268,60 @@ function Ed(e, t, r, i) {
7267
7268
  let b = u + 8, x = Math.max(b, window.innerHeight - 8 - d);
7268
7269
  s.value = {
7269
7270
  x: Math.round(_),
7270
- y: Math.round(ne(m - 6 - d, b, x)),
7271
+ y: Math.round(W(m - 6 - d, b, x)),
7271
7272
  placement: "above"
7272
7273
  };
7273
7274
  }
7274
- function ae(e) {
7275
+ function ie(e) {
7275
7276
  let n = R();
7276
- return !t.value || !n ? !1 : (k(), z(n), document.execCommand("styleWithCSS", !1, "false"), document.execCommand(e, !1), P(n), O(), A(), !0);
7277
+ return !t.value || !n ? !1 : (k(), z(n), document.execCommand("styleWithCSS", !1, "false"), document.execCommand(e, !1), N(n), O(), A(), !0);
7277
7278
  }
7278
- function W() {
7279
+ function G() {
7279
7280
  let e = R(), t = U(e);
7280
- return !e || !t || !i.requestLink ? !1 : (d = e.cloneRange(), i.requestLink(t), (re() || i.shouldClearSelectionOnLinkRequest?.()) && (window.getSelection()?.removeAllRanges(), te(null, { force: !0 })), A(), !0);
7281
+ return !e || !t || !i.requestLink ? !1 : (d = e.cloneRange(), i.requestLink(t), (ne() || i.shouldClearSelectionOnLinkRequest?.()) && (window.getSelection()?.removeAllRanges(), te(null, { force: !0 })), A(), !0);
7281
7282
  }
7282
- function G(e) {
7283
+ function K(e) {
7283
7284
  for (let t of [...e.querySelectorAll("a")]) t.replaceWith(...t.childNodes);
7284
7285
  }
7285
- function K(e) {
7286
+ function q(e) {
7286
7287
  let t = window.getSelection();
7287
7288
  if (!t) return;
7288
7289
  let n = document.createRange();
7289
7290
  n.setStartAfter(e), n.collapse(!0), t.removeAllRanges(), t.addRange(n);
7290
7291
  }
7291
- function oe(e) {
7292
+ function ae(e) {
7292
7293
  let n = Vs(e), r = t.value, i = d ?? R();
7293
7294
  if (!n || !r || !i || !r.contains(i.commonAncestorContainer)) return !1;
7294
7295
  k(), z(i);
7295
7296
  let a = document.createElement("a");
7296
7297
  a.href = n, a.target = "_blank", a.rel = "noreferrer";
7297
7298
  let o = i.extractContents();
7298
- return G(o), a.append(o), i.insertNode(a), K(a), d = null, F(), O(), A(), !0;
7299
+ return K(o), a.append(o), i.insertNode(a), q(a), d = null, P(), O(), A(), !0;
7299
7300
  }
7300
- function q() {
7301
+ function oe() {
7301
7302
  d = null;
7302
7303
  }
7303
7304
  function se() {
7304
- x(), F(), O();
7305
+ x(), P(), O();
7305
7306
  }
7306
7307
  function ce(e) {
7307
7308
  if (!S(e)) {
7308
7309
  if (!i.isTouchUI?.() && (e.ctrlKey || e.metaKey) && !e.shiftKey) {
7309
7310
  let t = e.key.toLowerCase();
7310
7311
  if (t === "b") {
7311
- e.preventDefault(), ae("bold");
7312
+ e.preventDefault(), ie("bold");
7312
7313
  return;
7313
7314
  }
7314
7315
  if (t === "i") {
7315
- e.preventDefault(), ae("italic");
7316
+ e.preventDefault(), ie("italic");
7316
7317
  return;
7317
7318
  }
7318
7319
  if (t === "u") {
7319
- e.preventDefault(), ae("underline");
7320
+ e.preventDefault(), ie("underline");
7320
7321
  return;
7321
7322
  }
7322
7323
  if (t === "k") {
7323
- e.preventDefault(), W();
7324
+ e.preventDefault(), G();
7324
7325
  return;
7325
7326
  }
7326
7327
  }
@@ -7340,12 +7341,12 @@ function Ed(e, t, r, i) {
7340
7341
  n && (document.execCommand("insertText", !1, n), O());
7341
7342
  }
7342
7343
  function ue(e) {
7343
- let t = ee();
7344
+ let t = L();
7344
7345
  if (!t) {
7345
7346
  A(), te(null);
7346
7347
  return;
7347
7348
  }
7348
- P(t), te(U(t)), j() && (e.button === 2 && e.preventDefault(), ie(t, e), o.value = !0);
7349
+ N(t), te(U(t)), j() && (e.button === 2 && e.preventDefault(), re(t, e), o.value = !0);
7349
7350
  }
7350
7351
  function de(t) {
7351
7352
  let n = t.target;
@@ -7355,15 +7356,15 @@ function Ed(e, t, r, i) {
7355
7356
  C(e), k();
7356
7357
  }
7357
7358
  function pe() {
7358
- let e = ee();
7359
+ let e = L();
7359
7360
  if (!e) {
7360
7361
  A(), te(null);
7361
7362
  return;
7362
7363
  }
7363
- P(e), te(U(e)), j() && (ie(e), o.value = !0);
7364
+ N(e), te(U(e)), j() && (re(e), o.value = !0);
7364
7365
  }
7365
7366
  function me() {
7366
- a.value += 1, A(), v(), q(), F(), c.value = "", i.updateModelValue("");
7367
+ a.value += 1, A(), v(), oe(), P(), c.value = "", i.updateModelValue("");
7367
7368
  }
7368
7369
  return b(() => {
7369
7370
  document.addEventListener("pointerdown", de), document.addEventListener("selectionchange", pe), h(() => {
@@ -7375,9 +7376,9 @@ function Ed(e, t, r, i) {
7375
7376
  }), y(() => {
7376
7377
  document.removeEventListener("pointerdown", de), document.removeEventListener("selectionchange", pe);
7377
7378
  }), {
7378
- applyLink: oe,
7379
- applyFormat: ae,
7380
- cancelLink: q,
7379
+ applyLink: ae,
7380
+ applyFormat: ie,
7381
+ cancelLink: oe,
7381
7382
  editorKey: a,
7382
7383
  focusEditor: k,
7383
7384
  formatMenuPosition: s,
@@ -7387,7 +7388,7 @@ function Ed(e, t, r, i) {
7387
7388
  handlePaste: le,
7388
7389
  hideFormatMenu: A,
7389
7390
  resetEditor: me,
7390
- requestLink: W,
7391
+ requestLink: G,
7391
7392
  getSelectionState: U,
7392
7393
  showFormatMenu: o,
7393
7394
  triggerCandidates: p,
@@ -7453,7 +7454,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7453
7454
  }), n({
7454
7455
  toggle: p,
7455
7456
  hide: m
7456
- }), (t, n) => ee((S(), a("div", {
7457
+ }), (t, n) => L((S(), a("div", {
7457
7458
  ref_key: "menuRef",
7458
7459
  ref: l,
7459
7460
  class: "composer-actions-menu",
@@ -7469,7 +7470,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7469
7470
  class: "composer-actions-menu__item",
7470
7471
  "data-testid": "composer-create-poll",
7471
7472
  onClick: g
7472
- }, [o("span", kd, [(S(), r(D(j(ce)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[F, c.value]]);
7473
+ }, [o("span", kd, [(S(), r(D(j(ce)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7473
7474
  }
7474
7475
  }), jd = (e, t) => {
7475
7476
  let n = e.__vccOpts || e;
@@ -7581,9 +7582,9 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7581
7582
  ],
7582
7583
  setup(e, { emit: t }) {
7583
7584
  let s = 0, c = e, u = t, { t: d } = X(), f = `composer-link-url-${++s}`, p = w(""), m = w(!1), g = n(() => Vs(p.value)), _ = n(() => m.value && !g.value), v = n(() => !c.disabled && !!g.value);
7584
- I(() => c.visible, async (e) => {
7585
+ F(() => c.visible, async (e) => {
7585
7586
  e && (p.value = c.initialUrl ?? "", m.value = !1, await h(), document.querySelector(`[data-link-dialog-id="${f}"]`)?.focus());
7586
- }), I(() => c.initialUrl, (e) => {
7587
+ }), F(() => c.initialUrl, (e) => {
7587
7588
  c.visible && (p.value = e ?? "", m.value = !1);
7588
7589
  });
7589
7590
  function y() {
@@ -7600,7 +7601,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7600
7601
  draggable: !1,
7601
7602
  "onUpdate:visible": b
7602
7603
  }, {
7603
- footer: L(() => [l(j(V), {
7604
+ footer: I(() => [l(j(V), {
7604
7605
  label: j(d)("cancel"),
7605
7606
  severity: "secondary",
7606
7607
  onClick: b
@@ -7614,9 +7615,9 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7614
7615
  "icon",
7615
7616
  "disabled"
7616
7617
  ])]),
7617
- default: L(() => [o("div", Jd, [e.selectedText ? (S(), a("p", Yd, k(e.selectedText), 1)) : i("", !0), o("div", Xd, [
7618
+ default: I(() => [o("div", Jd, [e.selectedText ? (S(), a("p", Yd, k(e.selectedText), 1)) : i("", !0), o("div", Xd, [
7618
7619
  o("label", Zd, k(j(d)("linkUrl")), 1),
7619
- l(j(re), {
7620
+ l(j(ne), {
7620
7621
  modelValue: p.value,
7621
7622
  "onUpdate:modelValue": n[0] ||= (e) => p.value = e,
7622
7623
  type: "url",
@@ -7678,7 +7679,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7678
7679
  draggable: !1,
7679
7680
  "onUpdate:visible": y
7680
7681
  }, {
7681
- footer: L(() => [l(j(V), {
7682
+ footer: I(() => [l(j(V), {
7682
7683
  label: j(d)("cancel"),
7683
7684
  severity: "secondary",
7684
7685
  onClick: y
@@ -7692,7 +7693,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7692
7693
  "icon",
7693
7694
  "disabled"
7694
7695
  ])]),
7695
- default: L(() => [o("div", ef, [o("div", tf, [o("label", nf, k(j(d)("question")), 1), l(j(re), {
7696
+ default: I(() => [o("div", ef, [o("div", tf, [o("label", nf, k(j(d)("question")), 1), l(j(ne), {
7696
7697
  modelValue: f.value,
7697
7698
  "onUpdate:modelValue": i[0] ||= (e) => f.value = e,
7698
7699
  fluid: "",
@@ -7702,7 +7703,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7702
7703
  (S(!0), a(e, null, T(p.value, (e, t) => (S(), a("div", {
7703
7704
  key: t,
7704
7705
  class: "center"
7705
- }, [l(j(re), {
7706
+ }, [l(j(ne), {
7706
7707
  "model-value": e,
7707
7708
  class: "poll-dialog-input w-full",
7708
7709
  placeholder: j(d)("option", { index: t + 1 }),
@@ -7725,7 +7726,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7725
7726
  ])]))), 128)),
7726
7727
  l(j(V), {
7727
7728
  label: j(d)("addOption"),
7728
- icon: j(oe),
7729
+ icon: j(ae),
7729
7730
  text: "",
7730
7731
  onClick: h
7731
7732
  }, null, 8, ["label", "icon"])
@@ -7777,7 +7778,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7777
7778
  draggable: !1,
7778
7779
  "onUpdate:visible": b
7779
7780
  }, {
7780
- footer: L(() => [l(j(V), {
7781
+ footer: I(() => [l(j(V), {
7781
7782
  label: j(c)("cancel"),
7782
7783
  severity: "secondary",
7783
7784
  onClick: b
@@ -7791,12 +7792,12 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7791
7792
  "icon",
7792
7793
  "disabled"
7793
7794
  ])]),
7794
- default: L(() => [o("div", sf, [o("div", cf, [o("label", lf, k(j(c)("sendAt")), 1), o("div", uf, [l(j(ne), {
7795
+ default: I(() => [o("div", sf, [o("div", cf, [o("label", lf, k(j(c)("sendAt")), 1), o("div", uf, [l(j(W), {
7795
7796
  modelValue: u.value,
7796
7797
  "onUpdate:modelValue": n[0] ||= (e) => u.value = e,
7797
7798
  class: "w-full flex-1",
7798
7799
  type: "date"
7799
- }, null, 8, ["modelValue"]), l(j(ne), {
7800
+ }, null, 8, ["modelValue"]), l(j(W), {
7800
7801
  modelValue: d.value,
7801
7802
  "onUpdate:modelValue": n[1] ||= (e) => d.value = e,
7802
7803
  type: "time",
@@ -7902,7 +7903,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7902
7903
  video: "video/*",
7903
7904
  audio: "audio/*",
7904
7905
  file: "*/*"
7905
- }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), C = w(""), T = w(""), E = w(!1), { t: D } = X(), { isTouchUI: O } = vd(), A = null, M = w(null), N = w(null), P = w(null), { applyLink: F, applyFormat: L, cancelLink: ee, editorKey: R, formatMenuPosition: B, focusEditor: H, handleContextMenu: U, handleInput: te, handleKeydown: ne, handlePaste: re, hideFormatMenu: ie, getSelectionState: ae, requestLink: W, resetEditor: K, showFormatMenu: q, triggerCandidates: se, triggerMenuPosition: ce, highlightedTriggerIndex: le, showTriggerMenu: fe, selectTriggerCandidate: pe } = Ed(M, N, P, {
7906
+ }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), C = w(""), T = w(""), E = w(!1), { t: D } = X(), { isTouchUI: O } = vd(), A = null, M = w(null), ee = w(null), N = w(null), { applyLink: P, applyFormat: I, cancelLink: L, editorKey: R, formatMenuPosition: B, focusEditor: H, handleContextMenu: U, handleInput: te, handleKeydown: W, handlePaste: ne, hideFormatMenu: re, getSelectionState: ie, requestLink: G, resetEditor: q, showFormatMenu: oe, triggerCandidates: se, triggerMenuPosition: ce, highlightedTriggerIndex: le, showTriggerMenu: fe, selectTriggerCandidate: pe } = Ed(M, ee, N, {
7906
7907
  getModelValue: () => u.modelValue,
7907
7908
  updateModelValue: (e) => d("update:modelValue", e),
7908
7909
  submit: () => Le(),
@@ -7927,8 +7928,8 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7927
7928
  default: return D("attachment");
7928
7929
  }
7929
7930
  }), ve = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), ye = n(() => ec(u.modelValue) || !!_.value), be = n(() => ye.value && he.value !== "file"), xe = n(() => _.value ? D("attachmentSummary", { name: _.value.name }) : tc(u.modelValue) || D("currentDraftWillBeScheduled"));
7930
- I(() => u.resetSignal, () => {
7931
- K(), _.value = null, y.value = !1, b.value = !1, x.value = !1, ee(), f.value && (f.value.value = "");
7931
+ F(() => u.resetSignal, () => {
7932
+ q(), _.value = null, y.value = !1, b.value = !1, x.value = !1, L(), f.value && (f.value.value = "");
7932
7933
  });
7933
7934
  async function Se() {
7934
7935
  await h(), H();
@@ -7958,7 +7959,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7958
7959
  e.preventDefault(), _.value = t, Ce();
7959
7960
  return;
7960
7961
  }
7961
- re(e);
7962
+ ne(e);
7962
7963
  }
7963
7964
  function De(e) {
7964
7965
  if (u.formattingMode === "external") {
@@ -7968,25 +7969,25 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
7968
7969
  T.value = e.text, C.value = e.href ?? "", x.value = !0;
7969
7970
  }
7970
7971
  function Oe(e) {
7971
- return L(e);
7972
+ return I(e);
7972
7973
  }
7973
7974
  function ke() {
7974
- return W();
7975
+ return G();
7975
7976
  }
7976
7977
  function Ae(e) {
7977
- return F(e);
7978
+ return P(e);
7978
7979
  }
7979
7980
  function je() {
7980
- ee();
7981
+ L();
7981
7982
  }
7982
7983
  function Me() {
7983
- return ae();
7984
+ return ie();
7984
7985
  }
7985
7986
  function Pe(e) {
7986
- F(e) && (x.value = !1);
7987
+ P(e) && (x.value = !1);
7987
7988
  }
7988
7989
  function J() {
7989
- ee();
7990
+ L();
7990
7991
  }
7991
7992
  function Fe() {
7992
7993
  _.value = null, f.value && (f.value.value = "");
@@ -8093,7 +8094,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
8093
8094
  disabled: e.disabled || !!e.editingMessage,
8094
8095
  "aria-label": j(D)("addToMessage"),
8095
8096
  "data-testid": "composer-actions-button",
8096
- icon: j(oe),
8097
+ icon: j(ae),
8097
8098
  onClick: Ie
8098
8099
  }, null, 8, [
8099
8100
  "class",
@@ -8104,21 +8105,21 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
8104
8105
  (S(), a("div", {
8105
8106
  key: j(R),
8106
8107
  ref_key: "composerEditorRef",
8107
- ref: N,
8108
+ ref: ee,
8108
8109
  contenteditable: "true",
8109
8110
  role: "textbox",
8110
8111
  "aria-multiline": "true",
8111
8112
  "data-placeholder": j(D)("writeMessage"),
8112
8113
  class: g(["composer-editor", e.disabled ? "pointer-events-none opacity-60" : ""]),
8113
- onFocus: n[3] ||= (...e) => j(ie) && j(ie)(...e),
8114
+ onFocus: n[3] ||= (...e) => j(re) && j(re)(...e),
8114
8115
  onInput: n[4] ||= (...e) => j(te) && j(te)(...e),
8115
8116
  onKeyup: n[5] ||= (...e) => j(te) && j(te)(...e),
8116
- onKeydown: n[6] ||= (...e) => j(ne) && j(ne)(...e),
8117
+ onKeydown: n[6] ||= (...e) => j(W) && j(W)(...e),
8117
8118
  onPaste: Ee,
8118
8119
  onContextmenu: n[7] ||= (...e) => j(U) && j(U)(...e)
8119
8120
  }, null, 42, Tf)),
8120
8121
  _.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Ef, [
8121
- e.editingMessage ? (S(), r(j(G), {
8122
+ e.editingMessage ? (S(), r(j(K), {
8122
8123
  key: 0,
8123
8124
  text: j(D)("editing"),
8124
8125
  context: "info",
@@ -8126,7 +8127,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
8126
8127
  size: "sm",
8127
8128
  class: "composer-meta-tag"
8128
8129
  }, null, 8, ["text"])) : i("", !0),
8129
- e.contextLabel ? (S(), r(j(G), {
8130
+ e.contextLabel ? (S(), r(j(K), {
8130
8131
  key: 1,
8131
8132
  text: e.contextLabel,
8132
8133
  context: "contrast",
@@ -8176,10 +8177,10 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
8176
8177
  ], 2),
8177
8178
  e.formattingMode === "external" ? i("", !0) : (S(), r(qd, {
8178
8179
  key: 1,
8179
- visible: j(q),
8180
+ visible: j(oe),
8180
8181
  position: j(B),
8181
- onFormat: n[9] ||= (e) => j(L)(e),
8182
- onLink: j(W)
8182
+ onFormat: n[9] ||= (e) => j(I)(e),
8183
+ onLink: j(G)
8183
8184
  }, null, 8, [
8184
8185
  "visible",
8185
8186
  "position",
@@ -8187,7 +8188,7 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
8187
8188
  ])),
8188
8189
  l(vf, {
8189
8190
  ref_key: "triggerMenuRef",
8190
- ref: P,
8191
+ ref: N,
8191
8192
  "highlighted-index": j(le),
8192
8193
  "onUpdate:highlightedIndex": n[10] ||= (e) => p(le) ? le.value = e : null,
8193
8194
  visible: j(fe),
@@ -8284,55 +8285,55 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
8284
8285
  function M() {
8285
8286
  m.emit("composer:cancelReply");
8286
8287
  }
8287
- function N() {
8288
+ function ee() {
8288
8289
  m.emit("composer:cancelEdit");
8289
8290
  }
8290
- function P(e) {
8291
+ function N(e) {
8291
8292
  return {
8292
8293
  ...e,
8293
8294
  target: s.target
8294
8295
  };
8295
8296
  }
8296
- function F(e) {
8297
- c("composerSelectionChange", e ? P(e) : null);
8297
+ function P(e) {
8298
+ c("composerSelectionChange", e ? N(e) : null);
8298
8299
  }
8299
- function I(e) {
8300
- c("composerLinkRequest", P(e));
8300
+ function F(e) {
8301
+ c("composerLinkRequest", N(e));
8301
8302
  }
8302
- let L = w(null);
8303
+ let I = w(null);
8303
8304
  dd(m, "ui:closeComposerActions", () => {
8304
- L.value?.hideComposerActions();
8305
+ I.value?.hideComposerActions();
8305
8306
  });
8306
- async function ee() {
8307
- await L.value?.focusEditor();
8307
+ async function L() {
8308
+ await I.value?.focusEditor();
8308
8309
  }
8309
8310
  function R(e) {
8310
- return L.value?.applyComposerFormat(e) ?? !1;
8311
+ return I.value?.applyComposerFormat(e) ?? !1;
8311
8312
  }
8312
8313
  function z() {
8313
- return L.value?.requestComposerLink() ?? !1;
8314
+ return I.value?.requestComposerLink() ?? !1;
8314
8315
  }
8315
8316
  function B(e) {
8316
- return L.value?.applyComposerLink(e) ?? !1;
8317
+ return I.value?.applyComposerLink(e) ?? !1;
8317
8318
  }
8318
8319
  function V() {
8319
- L.value?.cancelComposerLink();
8320
+ I.value?.cancelComposerLink();
8320
8321
  }
8321
8322
  function H() {
8322
- let e = L.value?.getComposerSelection() ?? null;
8323
- return e ? P(e) : null;
8323
+ let e = I.value?.getComposerSelection() ?? null;
8324
+ return e ? N(e) : null;
8324
8325
  }
8325
8326
  return t({
8326
8327
  applyComposerFormat: R,
8327
8328
  applyComposerLink: B,
8328
8329
  cancelComposerLink: V,
8329
- focusEditor: ee,
8330
+ focusEditor: L,
8330
8331
  getComposerSelection: H,
8331
8332
  requestComposerLink: z
8332
8333
  }), (t, n) => x.value ? (S(), r(kf, {
8333
8334
  key: 0,
8334
8335
  ref_key: "composerRef",
8335
- ref: L,
8336
+ ref: I,
8336
8337
  "model-value": g.value,
8337
8338
  disabled: b.value,
8338
8339
  "reset-signal": _.value,
@@ -8353,9 +8354,9 @@ var Dd = ["data-testid", "onClick"], Od = { class: "composer-actions-menu__icon"
8353
8354
  onScheduleMessage: O,
8354
8355
  onOpenScheduled: A,
8355
8356
  onCancelReply: M,
8356
- onCancelEdit: N,
8357
- onComposerSelectionChange: F,
8358
- onComposerLinkRequest: I
8357
+ onCancelEdit: ee,
8358
+ onComposerSelectionChange: P,
8359
+ onComposerLinkRequest: F
8359
8360
  }, null, 8, [
8360
8361
  "model-value",
8361
8362
  "disabled",
@@ -8543,7 +8544,7 @@ function Nf(e) {
8543
8544
  };
8544
8545
  }
8545
8546
  }
8546
- function N(t) {
8547
+ function ee(t) {
8547
8548
  if (!l(t)) return null;
8548
8549
  let n = j(t), r = e.isLoadingMessageReceipts?.(t) ?? !1;
8549
8550
  if (!n) return !t.receipts.readAt || !r ? null : {
@@ -8558,7 +8559,7 @@ function Nf(e) {
8558
8559
  loading: r
8559
8560
  } : null;
8560
8561
  }
8561
- function P(t) {
8562
+ function N(t) {
8562
8563
  return [
8563
8564
  {
8564
8565
  key: "reply",
@@ -8616,8 +8617,8 @@ function Nf(e) {
8616
8617
  reactToMessage: S,
8617
8618
  toggleInlineReaction: C,
8618
8619
  loadReceiptPreview: M,
8619
- getReceiptSummaryAction: N,
8620
- getActionItems: P
8620
+ getReceiptSummaryAction: ee,
8621
+ getActionItems: N
8621
8622
  };
8622
8623
  }
8623
8624
  //#endregion
@@ -8680,7 +8681,7 @@ function zf(e) {
8680
8681
  let s = o < r, c = Math.max(0, a.scrollHeight - o - a.clientHeight);
8681
8682
  s && c > Pf ? n = !1 : c <= Ff && (n = !0), r = o, a.scrollTop <= If && !e.isLoading() && !e.isLoadingOlder() && e.canLoadOlder() && e.onLoadOlder();
8682
8683
  }
8683
- return I(() => {
8684
+ return F(() => {
8684
8685
  let t = e.getMessages();
8685
8686
  return {
8686
8687
  conversationId: e.getConversation()?.id ?? null,
@@ -8831,7 +8832,7 @@ var Uf = { class: "w-full" }, Wf = {
8831
8832
  closable: !0,
8832
8833
  "onUpdate:visible": s
8833
8834
  }, {
8834
- default: L(() => [o("div", Uf, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", Wf, [E(t.$slots, "footer")])) : i("", !0)]),
8835
+ default: I(() => [o("div", Uf, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", Wf, [E(t.$slots, "footer")])) : i("", !0)]),
8835
8836
  _: 3
8836
8837
  }, 8, ["visible", "header"]));
8837
8838
  }
@@ -8858,15 +8859,15 @@ var Uf = { class: "w-full" }, Wf = {
8858
8859
  props: { attachment: {} },
8859
8860
  emits: ["close"],
8860
8861
  setup(t, { emit: s }) {
8861
- let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = X(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: N, handleDoubleClick: P } = Hf({
8862
+ let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = X(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = Hf({
8862
8863
  viewportRef: u,
8863
8864
  imageRef: d,
8864
8865
  isImage: () => p.value
8865
8866
  });
8866
- I(() => c.attachment?.url, () => {
8867
+ F(() => c.attachment?.url, () => {
8867
8868
  T();
8868
8869
  });
8869
- function F() {
8870
+ function P() {
8870
8871
  l("close");
8871
8872
  }
8872
8873
  return (n, s) => (S(), r(Gf, {
@@ -8875,9 +8876,9 @@ var Uf = { class: "w-full" }, Wf = {
8875
8876
  subtitle: t.attachment?.kind || "",
8876
8877
  "close-label": j(_)("close"),
8877
8878
  "close-aria-label": j(_)("closeMediaViewer"),
8878
- onClose: F
8879
+ onClose: P
8879
8880
  }, {
8880
- actions: L(() => [t.attachment?.url ? (S(), a("a", {
8881
+ actions: I(() => [t.attachment?.url ? (S(), a("a", {
8881
8882
  key: 0,
8882
8883
  href: t.attachment.url,
8883
8884
  target: "_blank",
@@ -8887,8 +8888,8 @@ var Uf = { class: "w-full" }, Wf = {
8887
8888
  class: "size-4",
8888
8889
  "aria-hidden": "true"
8889
8890
  })), o("span", null, k(j(_)("openInNewTab")), 1)], 8, Kf)) : i("", !0)]),
8890
- footer: L(() => [t.attachment ? (S(), a("div", tp, [o("div", np, [o("p", rp, k(t.attachment.name), 1), o("p", ip, k(t.attachment.kind), 1)])])) : i("", !0)]),
8891
- default: L(() => [o("div", qf, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
8891
+ footer: I(() => [t.attachment ? (S(), a("div", tp, [o("div", np, [o("p", rp, k(t.attachment.name), 1), o("p", ip, k(t.attachment.kind), 1)])])) : i("", !0)]),
8892
+ default: I(() => [o("div", qf, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
8892
8893
  key: 0,
8893
8894
  ref_key: "viewportRef",
8894
8895
  ref: u,
@@ -8898,8 +8899,8 @@ var Uf = { class: "w-full" }, Wf = {
8898
8899
  onPointerup: s[2] ||= (...e) => j(A) && j(A)(...e),
8899
8900
  onPointercancel: s[3] ||= (...e) => j(M) && j(M)(...e),
8900
8901
  onPointerleave: s[4] ||= (...e) => j(A) && j(A)(...e),
8901
- onWheel: s[5] ||= (...e) => j(N) && j(N)(...e),
8902
- onDblclick: s[6] ||= (...e) => j(P) && j(P)(...e)
8902
+ onWheel: s[5] ||= (...e) => j(ee) && j(ee)(...e),
8903
+ onDblclick: s[6] ||= (...e) => j(N) && j(N)(...e)
8903
8904
  }, [o("img", {
8904
8905
  ref_key: "imageRef",
8905
8906
  ref: d,
@@ -8979,7 +8980,7 @@ var Uf = { class: "w-full" }, Wf = {
8979
8980
  return t.url;
8980
8981
  }
8981
8982
  });
8982
- I(() => t.url, async (e) => {
8983
+ F(() => t.url, async (e) => {
8983
8984
  if (r.value = null, s.value = !1, !(!e || typeof window > "u")) {
8984
8985
  if (p(e)) {
8985
8986
  r.value = {
@@ -9261,7 +9262,7 @@ var Uf = { class: "w-full" }, Wf = {
9261
9262
  function l() {
9262
9263
  return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
9263
9264
  }
9264
- return (t, n) => (S(), a("div", Gp, [o("span", Kp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(G), {
9265
+ return (t, n) => (S(), a("div", Gp, [o("span", Kp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(K), {
9265
9266
  key: 0,
9266
9267
  text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
9267
9268
  context: "warn",
@@ -9438,8 +9439,8 @@ var Uf = { class: "w-full" }, Wf = {
9438
9439
  function y(e) {
9439
9440
  m(e.target) || u("tap", e);
9440
9441
  }
9441
- let b = N("originalBubble"), x = w("0px");
9442
- I(() => c.contextMenuOpen && c.isTouchUi, async (e) => {
9442
+ let b = ee("originalBubble"), x = w("0px");
9443
+ F(() => c.contextMenuOpen && c.isTouchUi, async (e) => {
9443
9444
  if (!e || (await h(), !b.value)) return;
9444
9445
  let t = b.value.getBoundingClientRect(), n = Math.min(t.top, window.innerHeight - 50 - t.height);
9445
9446
  x.value = `${Math.max(0, n - 32)}px`;
@@ -9580,7 +9581,7 @@ var Uf = { class: "w-full" }, Wf = {
9580
9581
  emits: ["react"],
9581
9582
  setup(t, { emit: s }) {
9582
9583
  let c = t, l = s, u = w(!1);
9583
- I(() => c.message.id, () => {
9584
+ F(() => c.message.id, () => {
9584
9585
  u.value = !1;
9585
9586
  });
9586
9587
  let d = n(() => ym);
@@ -9655,53 +9656,53 @@ var Uf = { class: "w-full" }, Wf = {
9655
9656
  top: f
9656
9657
  };
9657
9658
  }
9658
- async function N(e, t, n) {
9659
+ async function ee(e, t, n) {
9659
9660
  D = n ?? A(e), O = t ?? null, !(!D && !O) && (C.value = "actions", x.value = !0, await h(), await M());
9660
9661
  }
9661
- function P() {
9662
+ function N() {
9662
9663
  x.value && (x.value = !1, C.value = "actions", D = null, O = null, _("hide"));
9663
9664
  }
9664
- async function F() {
9665
+ async function P() {
9665
9666
  !d.receiptSummaryAction || d.receiptSummaryAction.loading || !d.receiptSummaryAction.receipts.length || (C.value = "receipts", await h(), await M());
9666
9667
  }
9667
- async function I() {
9668
+ async function F() {
9668
9669
  C.value = "actions", await h(), await M();
9669
9670
  }
9670
- function L(e) {
9671
+ function I(e) {
9671
9672
  return e ? new Intl.DateTimeFormat(m.value, {
9672
9673
  dateStyle: "medium",
9673
9674
  timeStyle: "short",
9674
9675
  hourCycle: ht()
9675
9676
  }).format(e) : "";
9676
9677
  }
9677
- function ee(e) {
9678
+ function L(e) {
9678
9679
  if (!x.value) return;
9679
9680
  let t = e.target;
9680
9681
  if (!b.value?.contains(t)) {
9681
9682
  if (D) {
9682
9683
  if (D.closest(".message-item")?.contains(t) && t instanceof HTMLElement && (t.classList.contains("message-bubble--spotlight") || t.classList.contains("message-bubble-wrapper"))) {
9683
9684
  setTimeout(() => {
9684
- P();
9685
+ N();
9685
9686
  }, 100);
9686
9687
  return;
9687
9688
  }
9688
9689
  if (D?.contains(t) || D.closest(".message-item")?.contains(t)) return;
9689
9690
  }
9690
- P();
9691
+ N();
9691
9692
  }
9692
9693
  }
9693
9694
  function R(e) {
9694
- e.key === "Escape" && P();
9695
+ e.key === "Escape" && N();
9695
9696
  }
9696
9697
  function z(e) {
9697
9698
  let t = e?.target;
9698
- e?.type === "scroll" && t instanceof Node && b.value?.contains(t) || P();
9699
+ e?.type === "scroll" && t instanceof Node && b.value?.contains(t) || N();
9699
9700
  }
9700
- return typeof window < "u" && (document.addEventListener("pointerdown", ee, !0), document.addEventListener("keydown", R), window.addEventListener("resize", z), window.addEventListener("scroll", z, !0)), y(() => {
9701
- typeof window > "u" || (document.removeEventListener("pointerdown", ee, !0), document.removeEventListener("keydown", R), window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0));
9701
+ return typeof window < "u" && (document.addEventListener("pointerdown", L, !0), document.addEventListener("keydown", R), window.addEventListener("resize", z), window.addEventListener("scroll", z, !0)), y(() => {
9702
+ typeof window > "u" || (document.removeEventListener("pointerdown", L, !0), document.removeEventListener("keydown", R), window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0));
9702
9703
  }), c({
9703
- show: N,
9704
- hide: P,
9704
+ show: ee,
9705
+ hide: N,
9705
9706
  visible: n(() => x.value)
9706
9707
  }), (n, c) => (S(), r(t, { to: "body" }, [x.value && s.message ? (S(), a("div", {
9707
9708
  key: 0,
@@ -9722,9 +9723,9 @@ var Uf = { class: "w-full" }, Wf = {
9722
9723
  key: 0,
9723
9724
  type: "button",
9724
9725
  class: "message-receipt-summary",
9725
- onClick: F
9726
+ onClick: P
9726
9727
  }, [
9727
- o("span", Dm, [s.receiptSummaryAction.loading ? (S(), r(j(W), {
9728
+ o("span", Dm, [s.receiptSummaryAction.loading ? (S(), r(j(G), {
9728
9729
  key: 0,
9729
9730
  style: {
9730
9731
  width: "1rem",
@@ -9746,7 +9747,7 @@ var Uf = { class: "w-full" }, Wf = {
9746
9747
  }, null, 8, ["image", "label"]))), 128))])) : i("", !0)
9747
9748
  ])) : i("", !0),
9748
9749
  s.receiptSummaryAction ? (S(), a("div", Am)) : i("", !0),
9749
- l(j(ie), {
9750
+ l(j(re), {
9750
9751
  model: s.actionItems,
9751
9752
  class: "message-action-list__menu"
9752
9753
  }, null, 8, ["model"])
@@ -9754,8 +9755,8 @@ var Uf = { class: "w-full" }, Wf = {
9754
9755
  o("button", {
9755
9756
  type: "button",
9756
9757
  class: "message-receipt-back",
9757
- onClick: I
9758
- }, [l(j(q), {
9758
+ onClick: F
9759
+ }, [l(j(oe), {
9759
9760
  class: "size-5",
9760
9761
  "aria-hidden": "true"
9761
9762
  }), o("span", null, k(j(g)("back")), 1)]),
@@ -9774,7 +9775,7 @@ var Uf = { class: "w-full" }, Wf = {
9774
9775
  }, null, 8, ["image", "label"]), o("div", Nm, [o("p", Pm, k(e.user.name), 1), o("p", Fm, [l(j(ge), {
9775
9776
  class: "message-receipt-row__icon text-success",
9776
9777
  "aria-hidden": "true"
9777
- }), o("span", null, k(L(e.timestamp)), 1)])])]))), 128))])
9778
+ }), o("span", null, k(I(e.timestamp)), 1)])])]))), 128))])
9778
9779
  ]))], 4)) : i("", !0)]));
9779
9780
  }
9780
9781
  }), [["__scopeId", "data-v-c561963f"]]), Lm = { class: "chat-header border-default bg-elevation-surface-default sticky top-0 z-10 flex items-center justify-between gap-3 border-b px-4 py-3 max-md:px-4 max-md:pb-3 sm:px-5 sm:py-3.5" }, Rm = {
@@ -9796,7 +9797,7 @@ var Uf = { class: "w-full" }, Wf = {
9796
9797
  label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
9797
9798
  shape: "circle",
9798
9799
  class: "chat-header__avatar shrink-0"
9799
- }, null, 8, ["image", "label"]), o("div", zm, [o("p", Bm, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Vm, [t.parentMessage ? (S(), a("span", Hm, k(t.parentMessage.senderName), 1)) : (S(), a("span", Um, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Wm, [t.conversation?.tags?.length ? (S(), a("div", Gm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(G), {
9800
+ }, null, 8, ["image", "label"]), o("div", zm, [o("p", Bm, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Vm, [t.parentMessage ? (S(), a("span", Hm, k(t.parentMessage.senderName), 1)) : (S(), a("span", Um, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Wm, [t.conversation?.tags?.length ? (S(), a("div", Gm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(K), {
9800
9801
  key: e,
9801
9802
  text: e,
9802
9803
  context: "secondary",
@@ -9829,7 +9830,7 @@ var Uf = { class: "w-full" }, Wf = {
9829
9830
  }), A = n(() => {
9830
9831
  let e = u.conversation.value;
9831
9832
  return e ? v.value ? v.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
9832
- }), M = n(() => u.conversation.value?.memberCount ?? 0), P = w(null), F = w(null), I = n(() => !!v.value), L = n(() => I.value && !b.value), ee = n(() => Bu(u.conversation.value)), R = N("threadRef"), { handleThreadScroll: z } = zf({
9833
+ }), M = n(() => u.conversation.value?.memberCount ?? 0), N = w(null), P = w(null), F = n(() => !!v.value), I = n(() => F.value && !b.value), L = n(() => Bu(u.conversation.value)), R = ee("threadRef"), { handleThreadScroll: z } = zf({
9833
9834
  getConversation: () => u.conversation.value,
9834
9835
  getParentMessage: () => v.value,
9835
9836
  getMessages: () => h.value,
@@ -9838,7 +9839,7 @@ var Uf = { class: "w-full" }, Wf = {
9838
9839
  canLoadOlder: () => x.value,
9839
9840
  onLoadOlder: () => p.emit("list:loadOlder", { target: s.target }),
9840
9841
  threadRef: R
9841
- }), B = N("actionMenuRef"), { activeActionMessage: V, handleMessageContextMenu: H, handleMessageTap: U, resetActionMenuState: te, reactToMessage: ne, toggleInlineReaction: re, getReceiptSummaryAction: ie, getActionItems: ae, isTouchUI: W } = Nf({
9842
+ }), B = ee("actionMenuRef"), { activeActionMessage: V, handleMessageContextMenu: H, handleMessageTap: U, resetActionMenuState: te, reactToMessage: W, toggleInlineReaction: ne, getReceiptSummaryAction: re, getActionItems: ie, isTouchUI: G } = Nf({
9842
9843
  canUseMessageActions: () => u.canUseMessageActions.value,
9843
9844
  canReact: () => u.canReact.value,
9844
9845
  canReply: () => u.canReply.value,
@@ -9862,21 +9863,21 @@ var Uf = { class: "w-full" }, Wf = {
9862
9863
  },
9863
9864
  onMenuOpen: () => p.emit("ui:closeComposerActions")
9864
9865
  });
9865
- function G(e) {
9866
+ function K(e) {
9866
9867
  return !!e.url && [
9867
9868
  "image",
9868
9869
  "video",
9869
9870
  "audio"
9870
9871
  ].includes(e.kind);
9871
9872
  }
9872
- function K(e) {
9873
- G(e) && (P.value = e);
9873
+ function q(e) {
9874
+ K(e) && (N.value = e);
9874
9875
  }
9875
- function oe() {
9876
- P.value = null;
9876
+ function ae() {
9877
+ N.value = null;
9877
9878
  }
9878
- async function q(e, t) {
9879
- F.value = `${e.id}:${t}`;
9879
+ async function oe(e, t) {
9880
+ P.value = `${e.id}:${t}`;
9880
9881
  try {
9881
9882
  p.emit("message:votePoll", {
9882
9883
  message: e,
@@ -9884,7 +9885,7 @@ var Uf = { class: "w-full" }, Wf = {
9884
9885
  });
9885
9886
  } finally {
9886
9887
  window.setTimeout(() => {
9887
- F.value === `${e.id}:${t}` && (F.value = null);
9888
+ P.value === `${e.id}:${t}` && (P.value = null);
9888
9889
  }, 300);
9889
9890
  }
9890
9891
  }
@@ -9899,7 +9900,7 @@ var Uf = { class: "w-full" }, Wf = {
9899
9900
  return e === 0 ? !0 : ce(t[e].sentAt, t[e - 1].sentAt);
9900
9901
  }
9901
9902
  return (t, n) => (S(), a(e, null, [
9902
- o("section", { class: g(["message-list-root", [t.$attrs.class, L.value ? "message-list--embedded-thread" : I.value ? "message-list--thread" : "message-list--main"]]) }, [b.value ? E(t.$slots, "header", {
9903
+ o("section", { class: g(["message-list-root", [t.$attrs.class, I.value ? "message-list--embedded-thread" : F.value ? "message-list--thread" : "message-list--main"]]) }, [b.value ? E(t.$slots, "header", {
9903
9904
  key: 0,
9904
9905
  conversation: j(u).conversation.value,
9905
9906
  parentMessage: v.value,
@@ -9912,11 +9913,11 @@ var Uf = { class: "w-full" }, Wf = {
9912
9913
  "parent-message": v.value
9913
9914
  }, null, 8, ["conversation", "parent-message"])], !0) : i("", !0), j(u).conversation.value ? (S(), a("div", {
9914
9915
  key: 2,
9915
- class: g(["message-list__body", L.value || I.value ? "bg-elevation-surface-overlay" : ""])
9916
+ class: g(["message-list__body", I.value || F.value ? "bg-elevation-surface-overlay" : ""])
9916
9917
  }, [o("div", {
9917
9918
  ref_key: "threadRef",
9918
9919
  ref: R,
9919
- class: g(["message-list__scroll min-h-0 flex-1", L.value ? "p-0" : I.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
9920
+ class: g(["message-list__scroll min-h-0 flex-1", I.value ? "p-0" : F.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
9920
9921
  onScroll: n[2] ||= (...e) => j(z) && j(z)(...e)
9921
9922
  }, [o("div", Jm, [
9922
9923
  v.value ? (S(), a("div", Ym, [o("p", Xm, k(v.value.senderName), 1), o("p", Zm, k(j(nc)(v.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
@@ -9928,17 +9929,17 @@ var Uf = { class: "w-full" }, Wf = {
9928
9929
  "current-user-id": j(u).currentUserId.value,
9929
9930
  "can-react": j(u).canReact.value,
9930
9931
  "can-open-thread": !v.value && y.value,
9931
- "can-show-sender-avatar": ee.value,
9932
- "pending-option-key": F.value,
9932
+ "can-show-sender-avatar": L.value,
9933
+ "pending-option-key": P.value,
9933
9934
  "action-message-class": s.actionMessageClass,
9934
9935
  "action-message-row-class": s.actionMessageRowClass,
9935
9936
  "context-menu-open": j(V)?.id === o.id,
9936
- "is-touch-ui": j(W),
9937
+ "is-touch-ui": j(G),
9937
9938
  onContextmenu: (e) => j(H)(o, e),
9938
9939
  onTap: (e) => j(U)(o, e),
9939
- onOpenMedia: K,
9940
- onVotePoll: (e) => q(o, e),
9941
- onToggleReaction: (e) => j(re)(o, e),
9940
+ onOpenMedia: q,
9941
+ onVotePoll: (e) => oe(o, e),
9942
+ onToggleReaction: (e) => j(ne)(o, e),
9942
9943
  onOpenThread: (e) => se(o),
9943
9944
  onOpenReferencedMessage: n[0] ||= (e) => j(p).emit("message:openReference", e),
9944
9945
  onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
@@ -9960,20 +9961,20 @@ var Uf = { class: "w-full" }, Wf = {
9960
9961
  "onOpenThread"
9961
9962
  ])], 64))), 128)),
9962
9963
  h.value.length === 0 && D.value && !_.value ? (S(), a("div", Qm, k(j(c)("noMessagesYetInThisGroup")), 1)) : i("", !0)
9963
- ])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", I.value ? L.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", qm, k(j(c)("selectConversationToStart")), 1))], 2),
9964
+ ])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", F.value ? I.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", qm, k(j(c)("selectConversationToStart")), 1))], 2),
9964
9965
  l(ap, {
9965
- attachment: P.value,
9966
- onClose: oe
9966
+ attachment: N.value,
9967
+ onClose: ae
9967
9968
  }, null, 8, ["attachment"]),
9968
9969
  l(Im, {
9969
9970
  ref_key: "actionMenuRef",
9970
9971
  ref: B,
9971
9972
  message: j(V),
9972
9973
  "can-react": j(u).canReact.value,
9973
- "receipt-summary-action": j(V) ? j(ie)(j(V)) : null,
9974
- "action-items": j(V) ? j(ae)(j(V)) : [],
9974
+ "receipt-summary-action": j(V) ? j(re)(j(V)) : null,
9975
+ "action-items": j(V) ? j(ie)(j(V)) : [],
9975
9976
  onHide: j(te),
9976
- onReact: n[3] ||= (e) => j(ne)(j(V), e)
9977
+ onReact: n[3] ||= (e) => j(W)(j(V), e)
9977
9978
  }, null, 8, [
9978
9979
  "message",
9979
9980
  "can-react",
@@ -10061,7 +10062,7 @@ var Uf = { class: "w-full" }, Wf = {
10061
10062
  "close-label": j(u)("close"),
10062
10063
  onClose: n[0] ||= (e) => s("close")
10063
10064
  }, {
10064
- default: L(() => [e.message ? (S(), a("div", dh, [e.loading ? (S(), a("div", fh, [l(j(W), {
10065
+ default: I(() => [e.message ? (S(), a("div", dh, [e.loading ? (S(), a("div", fh, [l(j(G), {
10065
10066
  style: {
10066
10067
  width: "2.5rem",
10067
10068
  height: "2.5rem"
@@ -10124,7 +10125,7 @@ var Uf = { class: "w-full" }, Wf = {
10124
10125
  ],
10125
10126
  setup(t, { emit: s }) {
10126
10127
  let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = X(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
10127
- I(() => c.open, (e) => {
10128
+ F(() => c.open, (e) => {
10128
10129
  e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
10129
10130
  });
10130
10131
  function x(e) {
@@ -10154,13 +10155,13 @@ var Uf = { class: "w-full" }, Wf = {
10154
10155
  function M() {
10155
10156
  d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "";
10156
10157
  }
10157
- function N(e) {
10158
+ function ee(e) {
10158
10159
  return {
10159
10160
  ...e,
10160
10161
  text: ""
10161
10162
  };
10162
10163
  }
10163
- function F() {
10164
+ function P() {
10164
10165
  p.value = !0;
10165
10166
  }
10166
10167
  function R(e) {
@@ -10197,7 +10198,7 @@ var Uf = { class: "w-full" }, Wf = {
10197
10198
  "close-label": j(v)("close"),
10198
10199
  onClose: s[3] ||= (e) => u("close")
10199
10200
  }, {
10200
- default: L(() => [o("div", _h, [t.loading ? (S(), a("div", vh, [l(j(W), {
10201
+ default: I(() => [o("div", _h, [t.loading ? (S(), a("div", vh, [l(j(G), {
10201
10202
  style: {
10202
10203
  width: "2.75rem",
10203
10204
  height: "2.75rem"
@@ -10207,17 +10208,17 @@ var Uf = { class: "w-full" }, Wf = {
10207
10208
  key: e.id,
10208
10209
  class: "border-default rounded-lg border px-4 py-3"
10209
10210
  }, [o("div", xh, [o("div", Sh, [
10210
- o("div", Ch, [o("div", wh, [e.kind === "poll" ? (S(), r(j(G), {
10211
+ o("div", Ch, [o("div", wh, [e.kind === "poll" ? (S(), r(j(K), {
10211
10212
  key: 0,
10212
10213
  text: j(v)("poll"),
10213
10214
  context: "info",
10214
10215
  rounded: ""
10215
- }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(G), {
10216
+ }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(K), {
10216
10217
  key: 1,
10217
10218
  text: D(e.attachments[0].kind),
10218
10219
  context: "info",
10219
10220
  rounded: ""
10220
- }, null, 8, ["text"])) : (S(), r(j(G), {
10221
+ }, null, 8, ["text"])) : (S(), r(j(K), {
10221
10222
  key: 2,
10222
10223
  text: j(v)("message"),
10223
10224
  context: "info",
@@ -10229,7 +10230,7 @@ var Uf = { class: "w-full" }, Wf = {
10229
10230
  onClick: (t) => H(e)
10230
10231
  }, null, 8, ["icon", "onClick"])]),
10231
10232
  o("div", Th, [o("p", Eh, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Dh, k(e.poll.question), 1)) : (S(), a("p", Oh, k(j(nc)(e, j(v)("attachment"))), 1))]),
10232
- R(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", kh, [l(Vp, { message: N(e) }, null, 8, ["message"])])) : i("", !0)
10233
+ R(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", kh, [l(Vp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
10233
10234
  ]), o("div", Ah, [e.kind === "poll" ? i("", !0) : (S(), r(j(V), {
10234
10235
  key: 0,
10235
10236
  label: j(v)("edit"),
@@ -10252,11 +10253,11 @@ var Uf = { class: "w-full" }, Wf = {
10252
10253
  "label",
10253
10254
  "icon",
10254
10255
  "onClick"
10255
- ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", jh, [o("div", Mh, [ee(o("input", {
10256
+ ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", jh, [o("div", Mh, [L(o("input", {
10256
10257
  "onUpdate:modelValue": s[0] ||= (e) => m.value = e,
10257
10258
  type: "date",
10258
10259
  class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
10259
- }, null, 512), [[P, m.value]]), ee(o("input", {
10260
+ }, null, 512), [[N, m.value]]), L(o("input", {
10260
10261
  "onUpdate:modelValue": s[1] ||= (e) => h.value = e,
10261
10262
  type: "time",
10262
10263
  inputmode: "numeric",
@@ -10264,7 +10265,7 @@ var Uf = { class: "w-full" }, Wf = {
10264
10265
  pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
10265
10266
  "aria-label": "Time (24-hour)",
10266
10267
  class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
10267
- }, null, 512), [[P, h.value]])]), o("div", Nh, [l(j(V), {
10268
+ }, null, 512), [[N, h.value]])]), o("div", Nh, [l(j(V), {
10268
10269
  label: j(v)("save"),
10269
10270
  size: "small",
10270
10271
  disabled: !m.value || !b.value,
@@ -10279,21 +10280,21 @@ var Uf = { class: "w-full" }, Wf = {
10279
10280
  text: "",
10280
10281
  onClick: M
10281
10282
  }, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", Ph, [
10282
- R(e) ? (S(), a("div", Fh, [l(Vp, { message: N(e) }, null, 8, ["message"]), o("div", Ih, [l(j(V), {
10283
+ R(e) ? (S(), a("div", Fh, [l(Vp, { message: ee(e) }, null, 8, ["message"]), o("div", Ih, [l(j(V), {
10283
10284
  icon: j(de),
10284
10285
  "aria-label": j(v)("remove"),
10285
10286
  text: "",
10286
10287
  rounded: "",
10287
10288
  severity: "secondary",
10288
10289
  size: "small",
10289
- onClick: F
10290
+ onClick: P
10290
10291
  }, null, 8, ["icon", "aria-label"])])])) : i("", !0),
10291
- ee(o("textarea", {
10292
+ L(o("textarea", {
10292
10293
  "onUpdate:modelValue": s[2] ||= (e) => g.value = e,
10293
10294
  rows: "3",
10294
10295
  class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
10295
10296
  placeholder: j(v)("writeMessage")
10296
- }, null, 8, Lh), [[P, g.value]]),
10297
+ }, null, 8, Lh), [[N, g.value]]),
10297
10298
  o("div", Rh, [l(j(V), {
10298
10299
  label: j(v)("cancel"),
10299
10300
  size: "small",
@@ -10431,7 +10432,7 @@ var Uf = { class: "w-full" }, Wf = {
10431
10432
  onMembersChanged: (e) => {
10432
10433
  p("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
10433
10434
  }
10434
- }), P = Hu({
10435
+ }), N = Hu({
10435
10436
  chatClient: T,
10436
10437
  selectedConversation: O,
10437
10438
  getPropIsReadOnly: () => f.isReadOnly,
@@ -10443,8 +10444,8 @@ var Uf = { class: "w-full" }, Wf = {
10443
10444
  currentUserId: T.value?.currentUser.value?.uid
10444
10445
  })
10445
10446
  });
10446
- Wu(P);
10447
- let F = Ku({
10447
+ Wu(N);
10448
+ let P = Ku({
10448
10449
  chatClient: T,
10449
10450
  selectedConversation: O,
10450
10451
  usesPublicContract: D,
@@ -10456,19 +10457,19 @@ var Uf = { class: "w-full" }, Wf = {
10456
10457
  getPropShowDefaultEmptyState: () => f.showDefaultEmptyState,
10457
10458
  getHideDeletedMessages: () => f.hideDeletedMessages
10458
10459
  });
10459
- Ju(F);
10460
- let ee = n(() => F.messages.value.length > 0), R = n(() => f.showHeader ?? f.showMessageHeader), z = nd({
10460
+ Ju(P);
10461
+ let L = n(() => P.messages.value.length > 0), R = n(() => f.showHeader ?? f.showMessageHeader), z = nd({
10461
10462
  chatClient: T,
10462
10463
  selectedConversation: O,
10463
- canScheduleMessages: () => !P.isReadOnly.value,
10464
+ canScheduleMessages: () => !N.isReadOnly.value,
10464
10465
  getInitialScheduledMessagesOpen: () => !!f.initialScheduledMessagesOpen,
10465
10466
  fetchErrorFallback: m("loadMessageReceiptsError")
10466
10467
  });
10467
10468
  id(z);
10468
- let B = N("mainComposerRef"), V = N("threadComposerRef"), H = Zu({
10469
+ let B = ee("mainComposerRef"), V = ee("threadComposerRef"), H = Zu({
10469
10470
  chatClient: T,
10470
- sendOptions: P.sendOptions,
10471
- mentionNameByUid: P.mentionNameByUid,
10471
+ sendOptions: N.sendOptions,
10472
+ mentionNameByUid: N.mentionNameByUid,
10472
10473
  afterSchedule: () => z.openScheduledMessages(),
10473
10474
  mainComposerRef: B,
10474
10475
  threadComposerRef: V
@@ -10476,7 +10477,7 @@ var Uf = { class: "w-full" }, Wf = {
10476
10477
  $u(H);
10477
10478
  let U = cd();
10478
10479
  ld(U), od({
10479
- conversation: P,
10480
+ conversation: N,
10480
10481
  composer: H,
10481
10482
  dialogs: z,
10482
10483
  bus: U
@@ -10485,33 +10486,35 @@ var Uf = { class: "w-full" }, Wf = {
10485
10486
  chatRootRef: h,
10486
10487
  getClient: () => T.value
10487
10488
  });
10488
- I(() => O.value?.targetId ?? null, () => {
10489
+ F(() => O.value?.targetId ?? null, () => {
10489
10490
  z.refreshScheduledMessages();
10490
- }, { immediate: !0 }), I(() => O.value?.targetId ?? null, async (e) => {
10491
+ }, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
10491
10492
  !e || O.value?.type !== "group" || await M(e);
10492
- }, { immediate: !0 }), I(() => O.value?.id, () => {
10493
+ }, { immediate: !0 }), F(() => O.value?.id, () => {
10493
10494
  H.resetMainComposer(), H.resetThreadComposer(), z.showScheduledMessages.value = !1, z.closeMessageInfo();
10494
- }), I(() => f.chatMessageGetter, (e) => {
10495
+ }), F(() => f.chatMessageGetter, (e) => {
10495
10496
  Au.setGetChatMessagesCallback(e);
10496
- }, { immediate: !0 }), I(() => f.language, (e) => {
10497
+ }, { immediate: !0 }), F(() => f.language, (e) => {
10497
10498
  e && gt(e);
10498
- }, { immediate: !0 }), I(F.isChatEmpty, (e) => {
10499
+ }, { immediate: !0 }), F([() => f.hideGroupActions, T], ([e, t]) => {
10500
+ t && (t.hideGroupActions.value = e);
10501
+ }, { immediate: !0 }), F(P.isChatEmpty, (e) => {
10499
10502
  e && p("chatEmpty");
10500
- }), I([
10503
+ }), F([
10501
10504
  () => f.chatUid,
10502
10505
  () => f.client ? f.client.initialized.value : Au.initialized.value,
10503
10506
  () => f.client ? f.client.loggedIn.value : Au.loggedIn.value,
10504
10507
  () => T.value?.conversations.value.length ?? 0
10505
10508
  ], async ([e, t, n]) => {
10506
- !D.value || !e || !t || !n || !T.value || await ne();
10507
- }, { immediate: !0 }), I([
10508
- () => F.messages.value.length,
10509
- () => F.threadMessages.value.length,
10509
+ !D.value || !e || !t || !n || !T.value || await W();
10510
+ }, { immediate: !0 }), F([
10511
+ () => P.messages.value.length,
10512
+ () => P.threadMessages.value.length,
10510
10513
  () => Au.scrollToMessageId.value
10511
10514
  ], async () => {
10512
10515
  await te();
10513
10516
  });
10514
- async function ne() {
10517
+ async function W() {
10515
10518
  let e = T.value;
10516
10519
  if (!e) {
10517
10520
  console.warn("No active client available.");
@@ -10522,7 +10525,7 @@ var Uf = { class: "w-full" }, Wf = {
10522
10525
  e.conversations.value.length === 0 && await e.fetchConversations();
10523
10526
  let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
10524
10527
  if (!t) try {
10525
- t = await re(f.chatUid, e);
10528
+ t = await ne(f.chatUid, e);
10526
10529
  } catch (e) {
10527
10530
  if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
10528
10531
  v.value = !1, C.value = !0, p("chatMembersFetched", []);
@@ -10538,7 +10541,7 @@ var Uf = { class: "w-full" }, Wf = {
10538
10541
  x.value = !1;
10539
10542
  }
10540
10543
  }
10541
- async function re(e, t) {
10544
+ async function ne(e, t) {
10542
10545
  let n = await Au.getGroup(e, !0);
10543
10546
  if (!n || typeof n != "object") return null;
10544
10547
  let r = String(n.getGuid());
@@ -10557,44 +10560,44 @@ var Uf = { class: "w-full" }, Wf = {
10557
10560
  };
10558
10561
  return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
10559
10562
  }
10560
- function ie(e, t) {
10563
+ function re(e, t) {
10561
10564
  p("linkClicked", e, t);
10562
10565
  }
10563
- let W = w(!1), G = w("main");
10564
- function K(e) {
10565
- e && (G.value = e.target), p("composerSelectionChange", e);
10566
+ let G = w(!1), K = w("main");
10567
+ function q(e) {
10568
+ e && (K.value = e.target), p("composerSelectionChange", e);
10566
10569
  }
10567
- function oe(e) {
10568
- G.value = e.target, p("composerLinkRequest", e);
10570
+ function ae(e) {
10571
+ K.value = e.target, p("composerLinkRequest", e);
10569
10572
  }
10570
- function q(e = G.value) {
10573
+ function oe(e = K.value) {
10571
10574
  return (e === "thread" ? V.value : B.value) ?? null;
10572
10575
  }
10573
10576
  function se(e, t) {
10574
- return q(t)?.applyComposerFormat?.(e) ?? !1;
10577
+ return oe(t)?.applyComposerFormat?.(e) ?? !1;
10575
10578
  }
10576
10579
  function ce(e) {
10577
- return q(e)?.requestComposerLink?.() ?? !1;
10580
+ return oe(e)?.requestComposerLink?.() ?? !1;
10578
10581
  }
10579
10582
  function le(e, t) {
10580
- return q(t)?.applyComposerLink?.(e) ?? !1;
10583
+ return oe(t)?.applyComposerLink?.(e) ?? !1;
10581
10584
  }
10582
10585
  function ue(e) {
10583
- q(e)?.cancelComposerLink?.();
10586
+ oe(e)?.cancelComposerLink?.();
10584
10587
  }
10585
10588
  function de(e) {
10586
- return q(e)?.getComposerSelection?.() ?? null;
10589
+ return oe(e)?.getComposerSelection?.() ?? null;
10587
10590
  }
10588
10591
  b(() => {
10589
10592
  setTimeout(() => {
10590
- W.value = !0;
10593
+ G.value = !0;
10591
10594
  }, 200);
10592
10595
  }), y(() => {
10593
10596
  let e = T.value;
10594
10597
  e && e.activeConversation.value === O.value && e.selectConversation(null);
10595
10598
  });
10596
10599
  async function fe(e) {
10597
- return await new Promise((e) => setTimeout(e, 100)), W.value ? te(e) : (await new Promise((e) => setTimeout(e, 110)), fe(e));
10600
+ return await new Promise((e) => setTimeout(e, 100)), G.value ? te(e) : (await new Promise((e) => setTimeout(e, 110)), fe(e));
10598
10601
  }
10599
10602
  return r({
10600
10603
  applyComposerFormat: se,
@@ -10612,12 +10615,12 @@ var Uf = { class: "w-full" }, Wf = {
10612
10615
  D.value && T.value?.error.value ? E(n.$slots, "error-message", {
10613
10616
  key: 0,
10614
10617
  message: T.value.error.value
10615
- }, () => [l(j(ae), {
10618
+ }, () => [l(j(ie), {
10616
10619
  severity: "error",
10617
10620
  closable: !1,
10618
10621
  class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
10619
10622
  }, {
10620
- default: L(() => [c(k(T.value.error.value), 1)]),
10623
+ default: I(() => [c(k(T.value.error.value), 1)]),
10621
10624
  _: 1
10622
10625
  })]) : i("", !0),
10623
10626
  T.value ? (S(), a(e, { key: 1 }, [
@@ -10628,20 +10631,20 @@ var Uf = { class: "w-full" }, Wf = {
10628
10631
  "show-header": R.value,
10629
10632
  "action-message-class": t.actionMessageClass,
10630
10633
  "action-message-row-class": t.actionMessageRowClass,
10631
- onAnchorclick: ie
10634
+ onAnchorclick: re
10632
10635
  }, s({
10633
- composer: L(() => [l(jf, {
10636
+ composer: I(() => [l(jf, {
10634
10637
  ref_key: "mainComposerRef",
10635
10638
  ref: B,
10636
10639
  target: "main",
10637
10640
  "formatting-mode": t.composerFormattingMode,
10638
- onComposerSelectionChange: K,
10639
- onComposerLinkRequest: oe
10641
+ onComposerSelectionChange: q,
10642
+ onComposerLinkRequest: ae
10640
10643
  }, null, 8, ["formatting-mode"])]),
10641
10644
  _: 2
10642
10645
  }, [n.$slots["message-header"] ? {
10643
10646
  name: "header",
10644
- fn: L((e) => [E(n.$slots, "message-header", _(d(e)))]),
10647
+ fn: I((e) => [E(n.$slots, "message-header", _(d(e)))]),
10645
10648
  key: "0"
10646
10649
  } : void 0]), 1032, [
10647
10650
  "hide-group-actions",
@@ -10651,26 +10654,26 @@ var Uf = { class: "w-full" }, Wf = {
10651
10654
  "action-message-row-class"
10652
10655
  ]),
10653
10656
  l(Gf, {
10654
- open: !!j(F).activeThreadParentMessage.value,
10655
- title: j(m)("threadWithCount", { count: j(F).activeThreadParentMessage.value?.replyCount ?? 0 }),
10657
+ open: !!j(P).activeThreadParentMessage.value,
10658
+ title: j(m)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
10656
10659
  subtitle: O.value?.title ?? "",
10657
10660
  "close-label": j(m)("close"),
10658
10661
  "close-aria-label": j(m)("closeThread"),
10659
10662
  onClose: r[0] ||= (e) => j(U).emit("ui:closeThread")
10660
10663
  }, {
10661
- default: L(() => [l($m, {
10664
+ default: I(() => [l($m, {
10662
10665
  target: "thread",
10663
10666
  class: "min-h-0 flex-1",
10664
10667
  "action-message-class": t.actionMessageClass,
10665
10668
  "action-message-row-class": t.actionMessageRowClass
10666
10669
  }, {
10667
- composer: L(() => [l(jf, {
10670
+ composer: I(() => [l(jf, {
10668
10671
  ref_key: "threadComposerRef",
10669
10672
  ref: V,
10670
10673
  target: "thread",
10671
10674
  "formatting-mode": t.composerFormattingMode,
10672
- onComposerSelectionChange: K,
10673
- onComposerLinkRequest: oe
10675
+ onComposerSelectionChange: q,
10676
+ onComposerLinkRequest: ae
10674
10677
  }, null, 8, ["formatting-mode"])]),
10675
10678
  _: 1
10676
10679
  }, 8, ["action-message-class", "action-message-row-class"])]),
@@ -10713,13 +10716,13 @@ var Uf = { class: "w-full" }, Wf = {
10713
10716
  ])
10714
10717
  ], 64)) : i("", !0),
10715
10718
  l(Hh, {
10716
- visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || x.value && !ee.value || v.value || C.value || t.displayNoMessagesText && j(F).isChatEmpty.value),
10719
+ visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || x.value && !L.value || v.value || C.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
10717
10720
  "offline-mode": !!(T.value?.offlineMode.value && !O.value),
10718
10721
  connected: !!(T.value?.connected.value || O.value),
10719
10722
  loading: x.value,
10720
10723
  "not-found": v.value,
10721
10724
  "not-a-member": C.value,
10722
- "is-empty": j(F).isChatEmpty.value,
10725
+ "is-empty": j(P).isChatEmpty.value,
10723
10726
  "show-empty-slot": t.displayNoMessagesText,
10724
10727
  messages: {
10725
10728
  waitingForNetwork: j(m)("waitingForNetwork"),
@@ -10731,11 +10734,11 @@ var Uf = { class: "w-full" }, Wf = {
10731
10734
  }
10732
10735
  }, s({ _: 2 }, [n.$slots["no-messages"] ? {
10733
10736
  name: "no-messages",
10734
- fn: L(() => [E(n.$slots, "no-messages")]),
10737
+ fn: I(() => [E(n.$slots, "no-messages")]),
10735
10738
  key: "0"
10736
10739
  } : void 0, n.$slots["not-a-member"] ? {
10737
10740
  name: "not-a-member",
10738
- fn: L(() => [E(n.$slots, "not-a-member")]),
10741
+ fn: I(() => [E(n.$slots, "not-a-member")]),
10739
10742
  key: "1"
10740
10743
  } : void 0]), 1032, [
10741
10744
  "visible",