@codingfactory/messenger-client 0.4.13 → 0.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { ref as N, getCurrentInstance as Ds, computed as C, watch as We, onUnmounted as Nt, toValue as or, onMounted as Yt, nextTick as ct, defineComponent as ot, openBlock as m, createElementBlock as b, normalizeStyle as at, normalizeClass as xe, createElementVNode as c, toDisplayString as Q, useAttrs as Qa, onBeforeUnmount as Us, Fragment as ze, mergeProps as lr, unref as Lt, renderList as ut, withModifiers as Ve, createCommentVNode as Y, createTextVNode as yt, withKeys as Dt, createVNode as $e, createBlock as it, Teleport as ns, resolveDynamicComponent as cr, withCtx as rt, Transition as Wt, renderSlot as Vn, createStaticVNode as eo, withDirectives as un, vModelText as dn, TransitionGroup as to } from "vue";
1
+ import { ref as N, getCurrentInstance as Us, computed as C, watch as We, onUnmounted as Nt, toValue as or, onMounted as Yt, nextTick as ct, defineComponent as ot, openBlock as m, createElementBlock as b, normalizeStyle as at, normalizeClass as xe, createElementVNode as c, toDisplayString as Q, useAttrs as Qa, onBeforeUnmount as Fs, Fragment as ze, mergeProps as lr, unref as Lt, renderList as ut, withModifiers as Ve, createCommentVNode as Y, createTextVNode as yt, withKeys as Dt, createVNode as $e, createBlock as it, Teleport as ss, resolveDynamicComponent as cr, withCtx as rt, Transition as Wt, renderSlot as Vn, createStaticVNode as eo, withDirectives as un, vModelText as dn, TransitionGroup as to } from "vue";
2
2
  import { defineStore as ur, storeToRefs as no } from "pinia";
3
- import Fs, { isAxiosError as so, AxiosHeaders as bi } from "axios";
3
+ import Ns, { isAxiosError as so, AxiosHeaders as bi } from "axios";
4
4
  import { isAxiosError as Jg } from "axios";
5
- import { useRoute as dr, useRouter as ss } from "vue-router";
5
+ import { useRoute as dr, useRouter as is } from "vue-router";
6
6
  import { isToday as hr, isYesterday as fr, format as cn, isSameDay as io, parseISO as Kn } from "date-fns";
7
7
  const mr = () => () => {
8
8
  }, pr = () => () => {
@@ -30,7 +30,7 @@ const mr = () => () => {
30
30
  unsubscribeFromConversation: yr,
31
31
  subscribeToTyping: Cr,
32
32
  unsubscribeFromTyping: _r
33
- }, Pn = () => Ue.ECHO_INITIALIZED_EVENT, Zt = () => Ue.getEcho(), Sr = async () => Ue.waitForEcho(), Tr = () => Ue.getConnectionStatus(), yi = () => Tr(), $s = () => Ue.getAccessState(), is = (e) => Ue.onConnectionStatusChange(e), ro = (e) => Ue.onAccessStateChange(e), ao = async () => {
33
+ }, Pn = () => Ue.ECHO_INITIALIZED_EVENT, Zt = () => Ue.getEcho(), Sr = async () => Ue.waitForEcho(), Tr = () => Ue.getConnectionStatus(), yi = () => Tr(), Rs = () => Ue.getAccessState(), rs = (e) => Ue.onConnectionStatusChange(e), ro = (e) => Ue.onAccessStateChange(e), ao = async () => {
34
34
  await Ue.reconnect();
35
35
  }, oo = (e) => Ue.subscribeToPresenceStatus(e), lo = () => Ue.unsubscribeFromPresenceStatus(), co = (e, t) => Ue.subscribeToConversation(e, t), uo = (e) => Ue.unsubscribeFromConversation(e), ho = (e, t) => Ue.subscribeToTyping(e, t), fo = (e) => Ue.unsubscribeFromTyping(e);
36
36
  function mo(e) {
@@ -60,27 +60,27 @@ function _o(e) {
60
60
  function wo(e) {
61
61
  return an(e) && typeof e.conversation_id == "string";
62
62
  }
63
- const Mr = Fs;
64
- let Ns = Mr;
63
+ const Mr = Ns;
64
+ let zs = Mr;
65
65
  function Fe() {
66
- return Ns;
66
+ return zs;
67
67
  }
68
68
  function Co(e) {
69
- Ns = e;
69
+ zs = e;
70
70
  }
71
71
  function ko() {
72
- Ns = Mr;
72
+ zs = Mr;
73
73
  }
74
- const xr = Fs;
75
- let zs = xr;
76
- function js() {
77
- return zs;
74
+ const xr = Ns;
75
+ let js = xr;
76
+ function Jn() {
77
+ return js;
78
78
  }
79
79
  function So(e) {
80
- zs = e;
80
+ js = e;
81
81
  }
82
82
  function To() {
83
- zs = xr;
83
+ js = xr;
84
84
  }
85
85
  const Er = {
86
86
  currentUser: null
@@ -146,7 +146,7 @@ function _i(e, t) {
146
146
  throw new Error(`Invalid messaging folder payload: ${t} must be a string or null`);
147
147
  return n;
148
148
  }
149
- function ys(e, t) {
149
+ function _s(e, t) {
150
150
  const n = e[t];
151
151
  if (typeof n == "number" && Number.isFinite(n))
152
152
  return n;
@@ -157,7 +157,7 @@ function ys(e, t) {
157
157
  }
158
158
  throw new Error(`Invalid messaging folder payload: missing numeric ${t}`);
159
159
  }
160
- function Rs(e) {
160
+ function Ps(e) {
161
161
  if (!$r(e))
162
162
  throw new Error("Invalid messaging folder payload: expected object");
163
163
  return {
@@ -165,9 +165,9 @@ function Rs(e) {
165
165
  name: Wn(e, "name"),
166
166
  color: _i(e, "color"),
167
167
  icon: _i(e, "icon"),
168
- sort_order: ys(e, "sort_order"),
169
- conversation_count: ys(e, "conversation_count"),
170
- unread_count: ys(e, "unread_count"),
168
+ sort_order: _s(e, "sort_order"),
169
+ conversation_count: _s(e, "conversation_count"),
170
+ unread_count: _s(e, "unread_count"),
171
171
  created_at: Wn(e, "created_at"),
172
172
  updated_at: Wn(e, "updated_at")
173
173
  };
@@ -175,7 +175,7 @@ function Rs(e) {
175
175
  function Po(e) {
176
176
  if (!Array.isArray(e))
177
177
  throw new Error("Invalid messaging folder payload: expected array");
178
- return e.map((t) => Rs(t));
178
+ return e.map((t) => Ps(t));
179
179
  }
180
180
  function wi(e) {
181
181
  if (!Ro(e))
@@ -189,11 +189,11 @@ const sn = {
189
189
  },
190
190
  async createFolder(e) {
191
191
  const t = await Fe().post("/v1/messaging/folders", e);
192
- return Rs(wn(t.data));
192
+ return Ps(wn(t.data));
193
193
  },
194
194
  async updateFolder(e, t) {
195
195
  const n = await Fe().patch(`/v1/messaging/folders/${e}`, t);
196
- return Rs(wn(n.data));
196
+ return Ps(wn(n.data));
197
197
  },
198
198
  async deleteFolder(e) {
199
199
  await Fe().delete(`/v1/messaging/folders/${e}`);
@@ -230,28 +230,28 @@ function Rr(e) {
230
230
  const t = e.trim();
231
231
  return t.length > 0 ? t : null;
232
232
  }
233
- function Ps(e) {
233
+ function Is(e) {
234
234
  const t = Rr(e);
235
235
  if (t === null)
236
236
  return null;
237
237
  const n = t.includes("T") ? t : t.replace(" ", "T"), i = /(?:Z|[+-]\d{2}:\d{2})$/i.test(n) ? n : `${n}Z`, o = new Date(i);
238
238
  return Number.isNaN(o.getTime()) ? null : o;
239
239
  }
240
- function Jn(e, t, n = {}) {
240
+ function Zn(e, t, n = {}) {
241
241
  if (e === null)
242
242
  return null;
243
243
  if (e === "offline")
244
244
  return "offline";
245
- const i = Ps(t);
245
+ const i = Is(t);
246
246
  if (i === null)
247
247
  return e;
248
248
  const o = n.now ?? Date.now(), l = n.staleAfterMs ?? Io;
249
249
  return o - i.getTime() > l ? "offline" : e;
250
250
  }
251
- function Zn(e, t = {}) {
251
+ function Qn(e, t = {}) {
252
252
  const n = Rr(e?.last_seen_at), i = Oo(e?.status);
253
253
  return {
254
- status: Jn(i, n, t),
254
+ status: Zn(i, n, t),
255
255
  lastSeenAt: n
256
256
  };
257
257
  }
@@ -298,7 +298,7 @@ const Ci = 1e3, Hs = 4e3, No = 12e4, zo = 300, jo = 1, Bo = 1600, Vs = (e) => {
298
298
  }, Ti = () => ({
299
299
  data: [],
300
300
  has_more: !1
301
- }), Mi = () => $s() === "account_suspended", Vo = (e) => {
301
+ }), Mi = () => Rs() === "account_suspended", Vo = (e) => {
302
302
  if (!gt(e))
303
303
  return !1;
304
304
  const n = (gt(e.data) ? e.data : e).throttled;
@@ -413,14 +413,14 @@ function Jo(e) {
413
413
  } : {}
414
414
  };
415
415
  }
416
- function _s(e) {
416
+ function ws(e) {
417
417
  return typeof e != "string" || e.length === 0 ? null : e;
418
418
  }
419
419
  function xi(e) {
420
420
  if (!(typeof e != "string" || e.length === 0))
421
421
  return e;
422
422
  }
423
- function Is(e) {
423
+ function Ls(e) {
424
424
  return typeof e == "string" && e.length > 0 && !e.startsWith("temp-");
425
425
  }
426
426
  function Zo(e, t = []) {
@@ -461,7 +461,7 @@ function Zo(e, t = []) {
461
461
  });
462
462
  }
463
463
  function Qo(e, t) {
464
- return Object.prototype.hasOwnProperty.call(e, "muted_until") ? _s(e.muted_until) : e.me?.muted_until === null ? null : typeof e.me?.muted_until == "string" ? _s(e.me.muted_until) : _s(t?.muted_until);
464
+ return Object.prototype.hasOwnProperty.call(e, "muted_until") ? ws(e.muted_until) : e.me?.muted_until === null ? null : typeof e.me?.muted_until == "string" ? ws(e.me.muted_until) : ws(t?.muted_until);
465
465
  }
466
466
  function el(e, t) {
467
467
  return Object.prototype.hasOwnProperty.call(e, "folder_id") ? e.folder_id ?? null : e.me?.folder_id === null ? null : typeof e.me?.folder_id == "string" ? e.me.folder_id : t?.folder_id;
@@ -490,7 +490,7 @@ function Cn(e, t) {
490
490
  function tl(e) {
491
491
  return e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
492
492
  }
493
- function ws(e) {
493
+ function Cs(e) {
494
494
  return tl(e) ? 0 : e.unread_count || 0;
495
495
  }
496
496
  function Ei(e, t) {
@@ -498,10 +498,10 @@ function Ei(e, t) {
498
498
  if (Array.isArray(n))
499
499
  for (let i = n.length - 1; i >= 0; i -= 1) {
500
500
  const o = n[i]?.id;
501
- if (Is(o))
501
+ if (Ls(o))
502
502
  return o;
503
503
  }
504
- return Is(e.last_message?.id) ? e.last_message.id : null;
504
+ return Ls(e.last_message?.id) ? e.last_message.id : null;
505
505
  }
506
506
  function gt(e) {
507
507
  return typeof e == "object" && e !== null;
@@ -588,23 +588,26 @@ async function rl(e) {
588
588
  return (await Or([e])).get(e) ?? null;
589
589
  }
590
590
  async function Or(e) {
591
- const t = Array.from(new Set(e.filter((n) => n.length > 0)));
591
+ const t = Array.from(new Set(e.filter((i) => i.length > 0)));
592
592
  if (t.length === 0)
593
593
  return /* @__PURE__ */ new Map();
594
+ const n = { ids: t.join(",") };
594
595
  try {
595
- const n = await js().get("/v1/identity/users/by-ids", {
596
- params: {
597
- ids: t.join(",")
598
- }
599
- }), i = il(n.data), o = /* @__PURE__ */ new Map();
600
- for (const l of i)
601
- t.includes(l.id) && o.set(l.id, {
602
- id: l.id,
603
- name: l.name,
604
- ...l.avatar ? { avatar: l.avatar } : {},
605
- ...l.handle ? { handle: l.handle } : {}
596
+ let i = null;
597
+ try {
598
+ i = await Jn().get("/v1/messenger/identity/resolve", { params: n });
599
+ } catch {
600
+ i = await Jn().get("/v1/identity/users/by-ids", { params: n });
601
+ }
602
+ const o = il(i.data), l = /* @__PURE__ */ new Map();
603
+ for (const u of o)
604
+ t.includes(u.id) && l.set(u.id, {
605
+ id: u.id,
606
+ name: u.name,
607
+ ...u.avatar ? { avatar: u.avatar } : {},
608
+ ...u.handle ? { handle: u.handle } : {}
606
609
  });
607
- return o;
610
+ return l;
608
611
  } catch {
609
612
  return /* @__PURE__ */ new Map();
610
613
  }
@@ -692,7 +695,7 @@ function ol(e, t, n) {
692
695
  });
693
696
  return i ? o : e;
694
697
  }
695
- function Cs(e) {
698
+ function ks(e) {
696
699
  const t = /* @__PURE__ */ new Map();
697
700
  for (const n of e.requests)
698
701
  n.is_request === !0 && t.set(n.id, n);
@@ -731,18 +734,18 @@ const Gt = ur("messaging", {
731
734
  },
732
735
  getMessagesByConversationId: (e) => (t) => e.messages[t] || [],
733
736
  getTypingUsers: (e) => (t) => e.typingUsers[t] || [],
734
- unreadConversationsCount: (e) => e.conversations.filter((t) => ws(t) > 0).length,
735
- unreadCount: (e) => e.conversations.reduce((t, n) => t + ws(n), 0),
736
- totalUnreadCount: (e) => e.conversations.reduce((t, n) => t + ws(n), 0),
737
+ unreadConversationsCount: (e) => e.conversations.filter((t) => Cs(t) > 0).length,
738
+ unreadCount: (e) => e.conversations.reduce((t, n) => t + Cs(n), 0),
739
+ totalUnreadCount: (e) => e.conversations.reduce((t, n) => t + Cs(n), 0),
737
740
  sortedFolders: (e) => Sn(e.folders),
738
741
  folderById: (e) => (t) => e.folders.find((n) => n.id === t),
739
742
  conversationsInFolder: (e) => (t) => e.conversations.filter((n) => n.folder_id === t),
740
743
  hasMoreMessages: (e) => (t) => e.conversationHasMore[t] ?? !1,
741
744
  isLoadingMessages: (e) => (t) => e.loadingMessages[t] ?? !1,
742
745
  // Message request getters
743
- requestConversations: (e) => Cs(e),
744
- requestCount: (e) => Cs(e).length,
745
- unreadRequestCount: (e) => Cs(e).filter((t) => t.unread_count > 0).length
746
+ requestConversations: (e) => ks(e),
747
+ requestCount: (e) => ks(e).length,
748
+ unreadRequestCount: (e) => ks(e).filter((t) => t.unread_count > 0).length
746
749
  },
747
750
  actions: {
748
751
  normalizeFolderAssignmentsState() {
@@ -1064,7 +1067,7 @@ const Gt = ur("messaging", {
1064
1067
  return null;
1065
1068
  for (let l = o.length - 1; l >= 0; l -= 1) {
1066
1069
  const u = o[l]?.id;
1067
- if (Is(u))
1070
+ if (Ls(u))
1068
1071
  return u;
1069
1072
  }
1070
1073
  return null;
@@ -1416,7 +1419,7 @@ const Gt = ur("messaging", {
1416
1419
  params: { ids: t }
1417
1420
  }), i = n.data?.data?.items ?? n.data?.items ?? [];
1418
1421
  for (const o of i) {
1419
- const l = Zn(o);
1422
+ const l = Qn(o);
1420
1423
  l.status !== null && this.updatePresenceForUser(o.id, l.status, l.lastSeenAt, "snapshot");
1421
1424
  }
1422
1425
  },
@@ -1509,7 +1512,7 @@ const Gt = ur("messaging", {
1509
1512
  }
1510
1513
  });
1511
1514
  function ll(e) {
1512
- const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = Ds(), p = u !== null, h = 20, w = 250;
1515
+ const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = Us(), p = u !== null, h = 20, w = 250;
1513
1516
  let y = 0, k = null, x = null;
1514
1517
  const M = C(() => n.currentUser?.id), $ = () => or(e)?.trim() ?? "";
1515
1518
  function R() {
@@ -1590,7 +1593,7 @@ function ll(e) {
1590
1593
  i.value || q();
1591
1594
  }
1592
1595
  typeof window < "u" && window.addEventListener(Pn(), K);
1593
- const ve = is((U) => {
1596
+ const ve = rs((U) => {
1594
1597
  if (U === "connected") {
1595
1598
  i.value || q();
1596
1599
  return;
@@ -1689,7 +1692,7 @@ function _l(e) {
1689
1692
  return e === "messenger" ? {
1690
1693
  initializedEvent: Pn(),
1691
1694
  getConnectionStatus: Tr,
1692
- onConnectionStatusChange: is,
1695
+ onConnectionStatusChange: rs,
1693
1696
  reconnect: ao,
1694
1697
  getEchoConnection: () => Fi(Zt())
1695
1698
  } : {
@@ -1882,7 +1885,7 @@ function kl() {
1882
1885
  }
1883
1886
  const rn = Xs()("GlobalMessaging"), Sl = 25, Tl = 3e4, Ml = (e) => e.replace(/\/+$/, ""), xl = (e) => Ml(window.location.pathname) === `/messages/${e}`, El = (e) => e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
1884
1887
  function Ig() {
1885
- const e = Gt(), t = It()(), n = wl(), i = js(), o = dr(), l = Ds(), { conversations: u, requestConversations: p } = no(e), h = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map();
1888
+ const e = Gt(), t = It()(), n = wl(), i = Jn(), o = dr(), l = Us(), { conversations: u, requestConversations: p } = no(e), h = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map();
1886
1889
  let y = !1;
1887
1890
  function k(q) {
1888
1891
  const K = w.get(q);
@@ -2040,7 +2043,7 @@ function Ig() {
2040
2043
  M(ce.id);
2041
2044
  }
2042
2045
  function A(q) {
2043
- const K = Zn({
2046
+ const K = Qn({
2044
2047
  status: q.status,
2045
2048
  last_seen_at: q.last_seen_at ?? q.ts ?? null
2046
2049
  });
@@ -2061,7 +2064,7 @@ function Ig() {
2061
2064
  params: { ids: q }
2062
2065
  }), ve = K.data?.data?.items ?? K.data?.items ?? [];
2063
2066
  for (const ce of ve) {
2064
- const U = Zn(ce);
2067
+ const U = Qn(ce);
2065
2068
  U.status !== null && e.updatePresenceForUser(ce.id, U.status, U.lastSeenAt, "snapshot");
2066
2069
  }
2067
2070
  } catch (K) {
@@ -2097,7 +2100,7 @@ function Ig() {
2097
2100
  () => {
2098
2101
  R();
2099
2102
  }
2100
- ), ne = is((q) => {
2103
+ ), ne = rs((q) => {
2101
2104
  q === "connected" ? (x(), R(), ae(), L(), I()) : (q === "disconnected" || q === "error") && (x(), ae());
2102
2105
  });
2103
2106
  R(), L(), I();
@@ -2113,10 +2116,10 @@ function Ig() {
2113
2116
  });
2114
2117
  }
2115
2118
  function Lg() {
2116
- const e = N($s());
2119
+ const e = N(Rs());
2117
2120
  let t = null;
2118
2121
  return Yt(() => {
2119
- e.value = $s(), t = ro((n) => {
2122
+ e.value = Rs(), t = ro((n) => {
2120
2123
  e.value = n;
2121
2124
  });
2122
2125
  }), Nt(() => {
@@ -2140,18 +2143,18 @@ const zr = () => null, jr = {
2140
2143
  userAgentResolver: () => navigator.userAgent.slice(0, 256),
2141
2144
  authTokenResolver: zr
2142
2145
  };
2143
- let Qn = { ...jr };
2146
+ let es = { ...jr };
2144
2147
  function Al() {
2145
- return Qn;
2148
+ return es;
2146
2149
  }
2147
2150
  function $l(e) {
2148
- Qn = {
2149
- ...Qn,
2151
+ es = {
2152
+ ...es,
2150
2153
  ...e
2151
2154
  };
2152
2155
  }
2153
2156
  function Rl() {
2154
- Qn = { ...jr };
2157
+ es = { ...jr };
2155
2158
  }
2156
2159
  function Pl(e) {
2157
2160
  return e.authTokenResolver !== zr;
@@ -2184,11 +2187,11 @@ function qr(e) {
2184
2187
  const n = t.data;
2185
2188
  return An(n) && typeof n.code == "string" ? n.code : null;
2186
2189
  }
2187
- function ks(e) {
2190
+ function Ss(e) {
2188
2191
  const t = Br(e), n = qr(e);
2189
2192
  return t === Il && n === Dl || t === Ol && n === Fl;
2190
2193
  }
2191
- function Ss(e) {
2194
+ function Ts(e) {
2192
2195
  const t = Br(e), n = qr(e);
2193
2196
  return t === Ll && n === Ul ? !0 : e instanceof Error ? e.message.toLowerCase().includes("suspended") : !1;
2194
2197
  }
@@ -2209,7 +2212,7 @@ function Bl(e) {
2209
2212
  const i = Number.parseInt(n, 10);
2210
2213
  return Number.isFinite(i) ? i : (t?.removeItem(e), null);
2211
2214
  }
2212
- function Ts(e, t = Date.now()) {
2215
+ function Ms(e, t = Date.now()) {
2213
2216
  const n = In(), i = Bl(e);
2214
2217
  return i === null ? !1 : i <= t ? (n?.removeItem(e), !1) : !0;
2215
2218
  }
@@ -2265,8 +2268,8 @@ function Xl(e, t, n) {
2265
2268
  }
2266
2269
  }
2267
2270
  function Og() {
2268
- const e = It()(), t = Al(), n = js(), i = jl(t.clientIdStorageKey);
2269
- let o = null, l = null, u = !1, p = Ts(t.accountLimitedUntilStorageKey), h = !1, w = !1, y = null, k = 0;
2271
+ const e = It()(), t = Al(), n = Jn(), i = jl(t.clientIdStorageKey);
2272
+ let o = null, l = null, u = !1, p = Ms(t.accountLimitedUntilStorageKey), h = !1, w = !1, y = null, k = 0;
2270
2273
  const x = () => Pl(t) ? t.authTokenResolver() !== null : !0, M = () => {
2271
2274
  o && (clearInterval(o), o = null);
2272
2275
  }, $ = () => {
@@ -2282,11 +2285,11 @@ function Og() {
2282
2285
  try {
2283
2286
  await n.patch(t.statusUrl, { status: H }), y = H;
2284
2287
  } catch (ge) {
2285
- if (ks(ge)) {
2288
+ if (Ss(ge)) {
2286
2289
  A("[Presence] Presence updates paused: account is temporarily limited");
2287
2290
  return;
2288
2291
  }
2289
- Ss(ge) && (h = !0, u = !1, y = null, M(), $());
2292
+ Ts(ge) && (h = !0, u = !1, y = null, M(), $());
2290
2293
  }
2291
2294
  }, L = () => {
2292
2295
  $(), !(!u || w || p || h || document.visibilityState !== "visible") && (l = setTimeout(() => {
@@ -2304,7 +2307,7 @@ function Og() {
2304
2307
  }, O = () => {
2305
2308
  typeof document > "u" || typeof window > "u" || (document.removeEventListener("pointerdown", de), document.removeEventListener("keydown", de), document.removeEventListener("touchstart", de), window.removeEventListener("focus", de));
2306
2309
  }, ne = async () => {
2307
- if (Ts(t.accountLimitedUntilStorageKey))
2310
+ if (Ms(t.accountLimitedUntilStorageKey))
2308
2311
  return p = !0, "account_limited";
2309
2312
  try {
2310
2313
  return await n.post(t.sessionOpenUrl, {
@@ -2312,7 +2315,7 @@ function Og() {
2312
2315
  user_agent: t.userAgentResolver()
2313
2316
  }), Hl(t.accountLimitedUntilStorageKey), p = !1, h = !1, u = !0, y = null, "opened";
2314
2317
  } catch (H) {
2315
- return ks(H) ? (A("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Ss(H) ? (h = !0, u = !1, y = null, M(), $(), "account_suspended") : "failed";
2318
+ return Ss(H) ? (A("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Ts(H) ? (h = !0, u = !1, y = null, M(), $(), "account_suspended") : "failed";
2316
2319
  }
2317
2320
  }, ie = async () => {
2318
2321
  for (let H = 0; H < Nl; H += 1)
@@ -2324,11 +2327,11 @@ function Og() {
2324
2327
  try {
2325
2328
  await n.post(t.sessionHeartbeatUrl, { client_id: i });
2326
2329
  } catch (H) {
2327
- if (ks(H)) {
2330
+ if (Ss(H)) {
2328
2331
  A("[Presence] Heartbeat paused: account is temporarily limited");
2329
2332
  return;
2330
2333
  }
2331
- Ss(H) && (h = !0, u = !1, y = null, M(), $());
2334
+ Ts(H) && (h = !0, u = !1, y = null, M(), $());
2332
2335
  }
2333
2336
  }, K = () => {
2334
2337
  if (!u)
@@ -2361,7 +2364,7 @@ function Og() {
2361
2364
  return;
2362
2365
  }
2363
2366
  if (document.visibilityState === "visible" && !u) {
2364
- p = Ts(t.accountLimitedUntilStorageKey), !p && !h && ve();
2367
+ p = Ms(t.accountLimitedUntilStorageKey), !p && !h && ve();
2365
2368
  return;
2366
2369
  }
2367
2370
  document.visibilityState === "visible" && u && !p && !h && ae();
@@ -2383,7 +2386,7 @@ function Og() {
2383
2386
  }
2384
2387
  const Kl = 12e3;
2385
2388
  function Yl(e) {
2386
- const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = N([]), p = /* @__PURE__ */ new Map(), h = Ds(), w = h !== null, y = 20, k = 250;
2389
+ const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = N([]), p = /* @__PURE__ */ new Map(), h = Us(), w = h !== null, y = 20, k = 250;
2387
2390
  let x = !1, M = null, $ = 0, R = null;
2388
2391
  const A = C(() => n.currentUser?.id), I = () => or(e)?.trim() ?? "", L = () => {
2389
2392
  const f = l.value?.trim() ?? "";
@@ -2508,7 +2511,7 @@ function Yl(e) {
2508
2511
  I() && (M && (M(), M = null), i.value = !1, l.value = null, ce());
2509
2512
  };
2510
2513
  typeof window < "u" && window.addEventListener(Pn(), P);
2511
- const v = is((f) => {
2514
+ const v = rs((f) => {
2512
2515
  if (f === "connected") {
2513
2516
  i.value || ce();
2514
2517
  return;
@@ -2744,15 +2747,15 @@ function zi(e) {
2744
2747
  const Wr = {
2745
2748
  messagesRoute: "/messages"
2746
2749
  };
2747
- let es = { ...Wr };
2750
+ let ts = { ...Wr };
2748
2751
  function Tn() {
2749
- return es;
2752
+ return ts;
2750
2753
  }
2751
2754
  function pc(e) {
2752
- es = { ...es, ...e };
2755
+ ts = { ...ts, ...e };
2753
2756
  }
2754
2757
  function vc() {
2755
- es = { ...Wr };
2758
+ ts = { ...Wr };
2756
2759
  }
2757
2760
  function Dg(e) {
2758
2761
  e.apiClient && Co(e.apiClient), e.mainApiClient && So(e.mainApiClient), e.authStore && Mo(e.authStore), e.mediaApi && Ao(e.mediaApi), e.createLogger && gl(e.createLogger), e.playMessageNotification && Cl(e.playMessageNotification), e.echo && mo(e.echo), e.mainEcho && ml(e.mainEcho), e.presence && $l(e.presence), e.toast && tc(e.toast), e.terms && sc(e.terms), e.moderation && rc(e.moderation), e.getToken && lc(e.getToken), e.normalizeMediaUrl && dc(e.normalizeMediaUrl), e.resolveVideoPlaybackUrl && hc(e.resolveVideoPlaybackUrl), e.widget && pc(e.widget);
@@ -3078,7 +3081,7 @@ class _c extends Yr {
3078
3081
  ), this;
3079
3082
  }
3080
3083
  }
3081
- class ts extends ni {
3084
+ class ns extends ni {
3082
3085
  /**
3083
3086
  * Subscribe to a channel.
3084
3087
  */
@@ -3126,7 +3129,7 @@ class ts extends ni {
3126
3129
  return this;
3127
3130
  }
3128
3131
  }
3129
- class Jr extends ts {
3132
+ class Jr extends ns {
3130
3133
  /**
3131
3134
  * Send a whisper event to other clients in the channel.
3132
3135
  */
@@ -3134,7 +3137,7 @@ class Jr extends ts {
3134
3137
  return this;
3135
3138
  }
3136
3139
  }
3137
- class wc extends ts {
3140
+ class wc extends ns {
3138
3141
  /**
3139
3142
  * Send a whisper event to other clients in the channel.
3140
3143
  */
@@ -3483,13 +3486,13 @@ class ji extends ii {
3483
3486
  * Listen for an event on a channel instance.
3484
3487
  */
3485
3488
  listen(t, n, i) {
3486
- return new ts();
3489
+ return new ns();
3487
3490
  }
3488
3491
  /**
3489
3492
  * Get a channel instance by name.
3490
3493
  */
3491
3494
  channel(t) {
3492
- return new ts();
3495
+ return new ns();
3493
3496
  }
3494
3497
  /**
3495
3498
  * Get a private channel instance by name.
@@ -3705,7 +3708,7 @@ class Sc {
3705
3708
  function Tc(e) {
3706
3709
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3707
3710
  }
3708
- var Ms = { exports: {} };
3711
+ var xs = { exports: {} };
3709
3712
  var Bi;
3710
3713
  function Mc() {
3711
3714
  return Bi || (Bi = 1, (function(e, t) {
@@ -4365,7 +4368,7 @@ function Mc() {
4365
4368
  }
4366
4369
  log(s, ...r) {
4367
4370
  var d = ft.apply(this, arguments);
4368
- vs.log ? vs.log(d) : vs.logToConsole && s.bind(this)(d);
4371
+ gs.log ? gs.log(d) : gs.logToConsole && s.bind(this)(d);
4369
4372
  }
4370
4373
  }
4371
4374
  var Te = new Re(), zt = function(a, s, r, d, g) {
@@ -4958,7 +4961,7 @@ function Mc() {
4958
4961
  }, r);
4959
4962
  }
4960
4963
  }
4961
- class as {
4964
+ class os {
4962
4965
  constructor() {
4963
4966
  this.reset();
4964
4967
  }
@@ -4990,7 +4993,7 @@ function Mc() {
4990
4993
  this.members = {}, this.count = 0, this.myID = null, this.me = null;
4991
4994
  }
4992
4995
  }
4993
- var os = function(a, s, r, d) {
4996
+ var ls = function(a, s, r, d) {
4994
4997
  function g(W) {
4995
4998
  return W instanceof r ? W : new r(function(fe) {
4996
4999
  fe(W);
@@ -5019,10 +5022,10 @@ function Mc() {
5019
5022
  };
5020
5023
  class Ln extends fn {
5021
5024
  constructor(s, r) {
5022
- super(s, r), this.members = new as();
5025
+ super(s, r), this.members = new os();
5023
5026
  }
5024
5027
  authorize(s, r) {
5025
- super.authorize(s, (d, g) => os(this, void 0, void 0, function* () {
5028
+ super.authorize(s, (d, g) => ls(this, void 0, void 0, function* () {
5026
5029
  if (!d)
5027
5030
  if (g = g, g.channel_data != null) {
5028
5031
  var W = JSON.parse(g.channel_data);
@@ -5147,7 +5150,7 @@ function Mc() {
5147
5150
  }
5148
5151
  }
5149
5152
  }
5150
- class ls extends se {
5153
+ class cs extends se {
5151
5154
  constructor(s, r) {
5152
5155
  super(), this.state = "initialized", this.connection = null, this.key = s, this.options = r, this.timeline = this.options.timeline, this.usingTLS = this.options.useTLS, this.errorCallbacks = this.buildErrorCallbacks(), this.connectionCallbacks = this.buildConnectionCallbacks(this.errorCallbacks), this.handshakeCallbacks = this.buildHandshakeCallbacks(this.errorCallbacks);
5153
5156
  var d = De.getNetwork();
@@ -5303,12 +5306,12 @@ function Mc() {
5303
5306
  return this.state === "connecting" || this.state === "connected";
5304
5307
  }
5305
5308
  }
5306
- class cs {
5309
+ class us {
5307
5310
  constructor() {
5308
5311
  this.channels = {};
5309
5312
  }
5310
5313
  add(s, r) {
5311
- return this.channels[s] || (this.channels[s] = us(s, r)), this.channels[s];
5314
+ return this.channels[s] || (this.channels[s] = ds(s, r)), this.channels[s];
5312
5315
  }
5313
5316
  all() {
5314
5317
  return dt(this.channels);
@@ -5326,7 +5329,7 @@ function Mc() {
5326
5329
  });
5327
5330
  }
5328
5331
  }
5329
- function us(a, s) {
5332
+ function ds(a, s) {
5330
5333
  if (a.indexOf("private-encrypted-") === 0) {
5331
5334
  if (s.config.nacl)
5332
5335
  return Bt.createEncryptedChannel(a, s, s.config.nacl);
@@ -5342,12 +5345,12 @@ function Mc() {
5342
5345
  return Bt.createChannel(a, s);
5343
5346
  }
5344
5347
  }
5345
- var ds = {
5348
+ var hs = {
5346
5349
  createChannels() {
5347
- return new cs();
5350
+ return new us();
5348
5351
  },
5349
5352
  createConnectionManager(a, s) {
5350
- return new ls(a, s);
5353
+ return new cs(a, s);
5351
5354
  },
5352
5355
  createChannel(a, s) {
5353
5356
  return new Xt(a, s);
@@ -5370,7 +5373,7 @@ function Mc() {
5370
5373
  createAssistantToTheTransportManager(a, s, r) {
5371
5374
  return new B(a, s, r);
5372
5375
  }
5373
- }, Bt = ds;
5376
+ }, Bt = hs;
5374
5377
  class mn {
5375
5378
  constructor(s) {
5376
5379
  this.options = s || {}, this.livesLeft = this.options.lives || 1 / 0;
@@ -5435,7 +5438,7 @@ function Mc() {
5435
5438
  return yn(this.strategies, s, function(d, g) {
5436
5439
  return function(W, fe) {
5437
5440
  if (g[d].error = W, W) {
5438
- hs(g) && r(!0);
5441
+ fs(g) && r(!0);
5439
5442
  return;
5440
5443
  }
5441
5444
  Ze(g, function(Me) {
@@ -5460,7 +5463,7 @@ function Mc() {
5460
5463
  }
5461
5464
  };
5462
5465
  }
5463
- function hs(a) {
5466
+ function fs(a) {
5464
5467
  return j(a, function(s) {
5465
5468
  return !!s.error;
5466
5469
  });
@@ -5468,7 +5471,7 @@ function Mc() {
5468
5471
  function Un(a) {
5469
5472
  !a.error && !a.aborted && (a.abort(), a.aborted = !0);
5470
5473
  }
5471
- class fs {
5474
+ class ms {
5472
5475
  constructor(s, r, d) {
5473
5476
  this.strategy = s, this.transports = r, this.ttl = d.ttl || 1800 * 1e3, this.usingTLS = d.useTLS, this.timeline = d.timeline;
5474
5477
  }
@@ -5489,7 +5492,7 @@ function Mc() {
5489
5492
  }))) : W++);
5490
5493
  }
5491
5494
  var Oe = Se.now(), Xe = fe.pop().connect(s, function Je(vt, Hn) {
5492
- vt ? (Nn(d), fe.length > 0 ? (Oe = Se.now(), Xe = fe.pop().connect(s, Je)) : r(vt)) : (ms(d, Hn.transport.name, Se.now() - Oe, W), r(null, Hn));
5495
+ vt ? (Nn(d), fe.length > 0 ? (Oe = Se.now(), Xe = fe.pop().connect(s, Je)) : r(vt)) : (ps(d, Hn.transport.name, Se.now() - Oe, W), r(null, Hn));
5493
5496
  });
5494
5497
  return {
5495
5498
  abort: function() {
@@ -5516,7 +5519,7 @@ function Mc() {
5516
5519
  }
5517
5520
  return null;
5518
5521
  }
5519
- function ms(a, s, r, d) {
5522
+ function ps(a, s, r, d) {
5520
5523
  var g = De.getLocalStorage();
5521
5524
  if (g)
5522
5525
  try {
@@ -5626,15 +5629,15 @@ function Mc() {
5626
5629
  fi,
5627
5630
  new vn(mi, { delay: 4e3 })
5628
5631
  ]), mi)
5629
- ], Oe), gs = new tn(Kt(pi), pi, Xa), bs;
5630
- return s.useTLS ? bs = new pn([
5632
+ ], Oe), bs = new tn(Kt(pi), pi, Xa), ys;
5633
+ return s.useTLS ? ys = new pn([
5631
5634
  hi,
5632
- new vn(gs, { delay: 2e3 })
5633
- ]) : bs = new pn([
5635
+ new vn(bs, { delay: 2e3 })
5636
+ ]) : ys = new pn([
5634
5637
  hi,
5635
5638
  new vn(Ga, { delay: 2e3 }),
5636
- new vn(gs, { delay: 5e3 })
5637
- ]), new fs(new zn(new tn(Kt(vt), bs, gs)), d, {
5639
+ new vn(bs, { delay: 5e3 })
5640
+ ]), new ms(new zn(new tn(Kt(vt), ys, bs)), d, {
5638
5641
  ttl: 18e5,
5639
5642
  timeline: s.timeline,
5640
5643
  useTLS: s.useTLS
@@ -5971,11 +5974,11 @@ function Mc() {
5971
5974
  return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0] / Math.pow(2, 32);
5972
5975
  }() * a);
5973
5976
  }
5974
- }, De = ba, ps;
5977
+ }, De = ba, vs;
5975
5978
  (function(a) {
5976
5979
  a[a.ERROR = 3] = "ERROR", a[a.INFO = 6] = "INFO", a[a.DEBUG = 7] = "DEBUG";
5977
- })(ps || (ps = {}));
5978
- var qn = ps;
5980
+ })(vs || (vs = {}));
5981
+ var qn = vs;
5979
5982
  class ya {
5980
5983
  constructor(s, r, d) {
5981
5984
  this.key = s, this.session = r, this.events = [], this.options = d || {}, this.sent = 0, this.uniqueID = 0;
@@ -6391,7 +6394,7 @@ function Mc() {
6391
6394
  }
6392
6395
  }
6393
6396
  Et.instances = [], Et.isReady = !1, Et.logToConsole = !1, Et.Runtime = De, Et.ScriptReceivers = De.ScriptReceivers, Et.DependenciesReceivers = De.DependenciesReceivers, Et.auth_callbacks = De.auth_callbacks;
6394
- var vs = i.default = Et;
6397
+ var gs = i.default = Et;
6395
6398
  function qa(a) {
6396
6399
  if (a == null)
6397
6400
  throw "You must pass your app key when you instantiate Pusher.";
@@ -6402,7 +6405,7 @@ function Mc() {
6402
6405
  ])
6403
6406
  );
6404
6407
  });
6405
- })(Ms)), Ms.exports;
6408
+ })(xs)), xs.exports;
6406
6409
  }
6407
6410
  var xc = Mc();
6408
6411
  const Ec = /* @__PURE__ */ Tc(xc), Ac = "/v1/messenger/bootstrap", $c = 3e4, Rc = 3e4, Pc = 5 * 6e4;
@@ -6747,7 +6750,7 @@ function Fg(e) {
6747
6750
  return he.service.reverb.path && (Pe.wsPath = he.service.reverb.path), h = new Sc(Pe), H(h), L("connecting"), typeof window < "u" && window.dispatchEvent(new CustomEvent(t)), h;
6748
6751
  })().finally(() => {
6749
6752
  w = null;
6750
- }), await w), pe = Fs.create({
6753
+ }), await w), pe = Ns.create({
6751
6754
  timeout: e.requestTimeoutMs ?? Rc,
6752
6755
  withCredentials: !1,
6753
6756
  headers: {
@@ -6783,7 +6786,7 @@ function Fg(e) {
6783
6786
  }), P = (ee) => (A.add(ee), ee(k), () => {
6784
6787
  A.delete(ee);
6785
6788
  }), v = () => u?.auth.tenantId ?? "global", f = (ee) => {
6786
- const J = Ps(ee.ts)?.getTime() ?? Ps(ee.last_seen_at)?.getTime() ?? null;
6789
+ const J = Is(ee.ts)?.getTime() ?? Is(ee.last_seen_at)?.getTime() ?? null;
6787
6790
  if (J === null)
6788
6791
  return !0;
6789
6792
  const he = `${ee.tenant_scope ?? "global"}:${ee.user_id}`, we = I.get(he);
@@ -6974,11 +6977,11 @@ function Fg(e) {
6974
6977
  clearRuntime: O
6975
6978
  };
6976
6979
  }
6977
- const xs = 3, ea = ur("chatWidget", {
6980
+ const Es = 3, ea = ur("chatWidget", {
6978
6981
  state: () => ({
6979
6982
  panelOpen: !1,
6980
6983
  openWindows: [],
6981
- maxWindows: xs
6984
+ maxWindows: Es
6982
6985
  }),
6983
6986
  getters: {
6984
6987
  isWindowOpen: (e) => (t) => e.openWindows.some((n) => n.conversationId === t),
@@ -6997,7 +7000,7 @@ const xs = 3, ea = ur("chatWidget", {
6997
7000
  this.panelOpen = !1;
6998
7001
  },
6999
7002
  setMaxWindows(e) {
7000
- const t = Number.isFinite(e) ? Math.max(1, Math.min(xs, Math.floor(e))) : xs;
7003
+ const t = Number.isFinite(e) ? Math.max(1, Math.min(Es, Math.floor(e))) : Es;
7001
7004
  for (this.maxWindows = t; this.openWindows.length > this.maxWindows; )
7002
7005
  this.openWindows.shift();
7003
7006
  },
@@ -7060,13 +7063,13 @@ function Xc(e) {
7060
7063
  const t = e.replace(/\s+/g, "");
7061
7064
  return t.length === 0 ? !1 : new RegExp("^(?:\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Regional_Indicator}{2}|\\uD83C[\\uDFF4][\\uDB40][\\uDC60-\\uDC7F]{1,6}|\\p{Emoji}\\u200D\\p{Emoji})+$", "u").test(t);
7062
7065
  }
7063
- function Ls(e) {
7066
+ function Os(e) {
7064
7067
  return Kn(e);
7065
7068
  }
7066
7069
  function Kc(e, t) {
7067
7070
  return io(
7068
- Ls(e.created_at),
7069
- Ls(t.created_at)
7071
+ Os(e.created_at),
7072
+ Os(t.created_at)
7070
7073
  );
7071
7074
  }
7072
7075
  function Yc(e, t) {
@@ -7079,7 +7082,7 @@ function Yc(e, t) {
7079
7082
  return i ? !Kc(i, n) : !0;
7080
7083
  }
7081
7084
  function Jc(e) {
7082
- const t = Ls(e.created_at);
7085
+ const t = Os(e.created_at);
7083
7086
  if (hr(t))
7084
7087
  return "Today";
7085
7088
  if (fr(t))
@@ -7096,7 +7099,7 @@ const Ng = (e, t, n, i) => {
7096
7099
  }, Qc = (e) => {
7097
7100
  const t = e.scrollHeight ?? 0, n = e.clientHeight ?? 0;
7098
7101
  return Math.max(0, t - e.scrollTop - n);
7099
- }, Es = (e, t = 72) => Qc(e) <= t, eu = (e, t, n = 80, i = "smooth") => {
7102
+ }, As = (e, t = 72) => Qc(e) <= t, eu = (e, t, n = 80, i = "smooth") => {
7100
7103
  if (typeof e.scrollTo == "function") {
7101
7104
  e.scrollTo({ top: t, behavior: i }), setTimeout(() => {
7102
7105
  Math.abs(e.scrollTop - t) > 1 && (e.scrollTop = t);
@@ -7104,10 +7107,10 @@ const Ng = (e, t, n, i) => {
7104
7107
  return;
7105
7108
  }
7106
7109
  e.scrollTop = t;
7107
- }, rs = /* @__PURE__ */ new Map(), tu = (e) => rs.get(e) ?? 0, nu = (e) => rs.has(e), Zi = (e, t) => {
7108
- rs.set(e, Math.max(0, t));
7110
+ }, as = /* @__PURE__ */ new Map(), tu = (e) => as.get(e) ?? 0, nu = (e) => as.has(e), Zi = (e, t) => {
7111
+ as.set(e, Math.max(0, t));
7109
7112
  }, zg = (e) => {
7110
- rs.delete(e);
7113
+ as.delete(e);
7111
7114
  }, su = (e, t, n) => {
7112
7115
  if (!e || e.unread_count <= 0 || t.length === 0)
7113
7116
  return null;
@@ -7132,7 +7135,7 @@ function ru() {
7132
7135
  function au(e) {
7133
7136
  return typeof e == "function";
7134
7137
  }
7135
- function Os(e, t) {
7138
+ function Ds(e, t) {
7136
7139
  if (!e) return;
7137
7140
  const n = Array.isArray(e) ? e : [e];
7138
7141
  for (const i of n)
@@ -7152,10 +7155,10 @@ function Os(e, t) {
7152
7155
  function ou() {
7153
7156
  const e = {
7154
7157
  fromTo(t, n, i, o) {
7155
- return Os(t, i), e;
7158
+ return Ds(t, i), e;
7156
7159
  },
7157
7160
  to(t, n, i) {
7158
- return Os(t, n), e;
7161
+ return Ds(t, n), e;
7159
7162
  }
7160
7163
  };
7161
7164
  return e;
@@ -7165,7 +7168,7 @@ function lu() {
7165
7168
  return {
7166
7169
  shouldAnimate: e !== null,
7167
7170
  set(n, i) {
7168
- e ? e.set(n, i) : Os(n, i);
7171
+ e ? e.set(n, i) : Ds(n, i);
7169
7172
  },
7170
7173
  timeline() {
7171
7174
  return e ? e.timeline() : ou();
@@ -7961,7 +7964,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
7961
7964
  )?.focus()) : document.removeEventListener("keydown", H);
7962
7965
  }), We(k, (v) => {
7963
7966
  L(v);
7964
- }, { immediate: !0 }), Us(() => {
7967
+ }, { immediate: !0 }), Fs(() => {
7965
7968
  document.removeEventListener("keydown", H);
7966
7969
  for (const [v] of w)
7967
7970
  R(v);
@@ -8063,7 +8066,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8063
8066
  ])
8064
8067
  ], 42, Lu))), 128))
8065
8068
  ], 16, Tu),
8066
- (m(), it(ns, { to: "body" }, [
8069
+ (m(), it(ss, { to: "body" }, [
8067
8070
  i.value ? (m(), b("div", {
8068
8071
  key: 0,
8069
8072
  ref_key: "lightboxOverlayRef",
@@ -8270,7 +8273,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8270
8273
  },
8271
8274
  emits: ["edit", "delete", "copy", "retry", "react", "reply", "scroll-to-message"],
8272
8275
  setup(e, { emit: t }) {
8273
- const n = e, i = t, o = It()(), l = ss(), { term: u } = Vr(), p = ri(), h = N(!1), w = N(!1), y = N(""), k = N(!1), x = N(!1), M = N(!0), $ = N(null), R = N(null), A = N(null), I = N(null), L = N(null), ae = /* @__PURE__ */ new Map(), de = N(null), E = N(null);
8276
+ const n = e, i = t, o = It()(), l = is(), { term: u } = Vr(), p = ri(), h = N(!1), w = N(!1), y = N(""), k = N(!1), x = N(!1), M = N(!0), $ = N(null), R = N(null), A = N(null), I = N(null), L = N(null), ae = /* @__PURE__ */ new Map(), de = N(null), E = N(null);
8274
8277
  let O, ne, ie = null, q = 0, K = 0, ve = !1;
8275
8278
  const ce = [
8276
8279
  { type: "heart", emoji: "❤️", label: "heart" },
@@ -8538,7 +8541,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8538
8541
  },
8539
8542
  { deep: !0 }
8540
8543
  );
8541
- const as = (S) => {
8544
+ const os = (S) => {
8542
8545
  if (ue(), S.touches.length !== 1 || jt(S.target)) {
8543
8546
  se();
8544
8547
  return;
@@ -8549,7 +8552,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8549
8552
  return;
8550
8553
  }
8551
8554
  te(Z.clientX, Z.clientY, null);
8552
- }, os = (S) => {
8555
+ }, ls = (S) => {
8553
8556
  if (S.touches.length !== 1) {
8554
8557
  je();
8555
8558
  return;
@@ -8572,13 +8575,13 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8572
8575
  function Dn() {
8573
8576
  B(), i("reply", n.message.id);
8574
8577
  }
8575
- const ls = () => {
8578
+ const cs = () => {
8576
8579
  D();
8577
- }, cs = () => {
8578
- _();
8579
8580
  }, us = () => {
8580
- D();
8581
+ _();
8581
8582
  }, ds = () => {
8583
+ D();
8584
+ }, hs = () => {
8582
8585
  window.setTimeout(() => {
8583
8586
  if (!k.value)
8584
8587
  return;
@@ -8651,7 +8654,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8651
8654
  B(), y.value = n.message.body || "", h.value = !0;
8652
8655
  }, yn = () => {
8653
8656
  h.value = !1, y.value = "";
8654
- }, hs = () => {
8657
+ }, fs = () => {
8655
8658
  const S = y.value.trim();
8656
8659
  if (!S || S === n.message.body) {
8657
8660
  yn();
@@ -8666,7 +8669,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8666
8669
  } catch {
8667
8670
  }
8668
8671
  }
8669
- }, fs = () => {
8672
+ }, ms = () => {
8670
8673
  const S = qe.value;
8671
8674
  S && l.push(S);
8672
8675
  }, _n = () => {
@@ -8676,7 +8679,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8676
8679
  S && l.push(S);
8677
8680
  }, Fn = () => {
8678
8681
  B(), w.value = !0;
8679
- }, ms = () => {
8682
+ }, ps = () => {
8680
8683
  w.value = !1;
8681
8684
  }, Nn = () => {
8682
8685
  w.value = !1, vn();
@@ -8808,10 +8811,10 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8808
8811
  "aria-label": `React with ${Ae.label}`,
8809
8812
  onPointerdown: Z[0] || (Z[0] = Ve(() => {
8810
8813
  }, ["stop"])),
8811
- onMouseenter: ls,
8812
- onMouseleave: cs,
8813
- onFocus: us,
8814
- onBlur: ds,
8814
+ onMouseenter: cs,
8815
+ onMouseleave: us,
8816
+ onFocus: ds,
8817
+ onBlur: hs,
8815
8818
  onKeydown: Dt(Ve(B, ["prevent"]), ["esc"]),
8816
8819
  onClick: Ve((bt) => fn(Ae.type, bt), ["stop"])
8817
8820
  }, Q(Ae.emoji), 41, ud)), 64))
@@ -8843,8 +8846,8 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8843
8846
  role: "button",
8844
8847
  "aria-label": "Message actions",
8845
8848
  onContextmenu: Ve(Jt, ["prevent"]),
8846
- onTouchstart: as,
8847
- onTouchmove: os,
8849
+ onTouchstart: os,
8850
+ onTouchmove: ls,
8848
8851
  onTouchend: Ln,
8849
8852
  onTouchcancel: Ln,
8850
8853
  onMouseenter: On,
@@ -8894,7 +8897,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
8894
8897
  class: xe(["shared-post-embed", e.isOwnMessage ? "shared-post-embed--own" : "shared-post-embed--other"]),
8895
8898
  "data-testid": `card-shared-post-${e.message.id}`,
8896
8899
  "aria-label": `View shared ${Re.value}`,
8897
- onClick: fs
8900
+ onClick: ms
8898
8901
  }, [
8899
8902
  c("div", wd, [
8900
8903
  zt.value ? (m(), b("img", {
@@ -9118,7 +9121,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
9118
9121
  class: "px-4 py-2 text-sm font-medium text-white rounded-lg transition-all disabled:opacity-40 disabled:cursor-not-allowed edit-modal-save",
9119
9122
  "data-testid": "btn-save-edit",
9120
9123
  "aria-label": "Save edited message",
9121
- onClick: hs
9124
+ onClick: fs
9122
9125
  }, " Save ", 8, Gd)
9123
9126
  ])
9124
9127
  ])
@@ -9142,7 +9145,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
9142
9145
  class: "px-4 py-2 text-sm font-medium rounded-lg transition-colors edit-modal-cancel",
9143
9146
  "data-testid": "btn-cancel-delete",
9144
9147
  "aria-label": "Cancel deleting message",
9145
- onClick: ms
9148
+ onClick: ps
9146
9149
  }, " Cancel "),
9147
9150
  c("button", {
9148
9151
  class: "px-4 py-2 text-sm font-medium text-white rounded-lg transition-all edit-modal-save",
@@ -9611,7 +9614,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
9611
9614
  attributes: !0,
9612
9615
  attributeFilter: ["class", "style", "aria-hidden", "hidden"]
9613
9616
  }));
9614
- }), Us(() => {
9617
+ }), Fs(() => {
9615
9618
  v(), Ge(), ge(), G(), ee(), p.value?.removeEventListener("dragenter", _e), p.value?.removeEventListener("dragover", Re), p.value?.removeEventListener("dragleave", Te), p.value?.removeEventListener("drop", zt), st && (st.dismiss().catch(() => {
9616
9619
  }), st = null), document.removeEventListener("pointerdown", qe, !0), document.removeEventListener("mousedown", qe, !0), document.removeEventListener("touchstart", qe, !0), document.removeEventListener("click", qe, !0), document.removeEventListener("keydown", wt), he?.removeEventListener("input", Ie), he?.removeEventListener("paste", Ne), kt?.disconnect(), kt = null, he = null, q.cleanup();
9617
9620
  });
@@ -9937,7 +9940,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
9937
9940
  }, [
9938
9941
  $e(He, { name: "happyOutline" })
9939
9942
  ], 8, Ih),
9940
- (m(), it(ns, { to: "body" }, [
9943
+ (m(), it(ss, { to: "body" }, [
9941
9944
  I.value ? (m(), b("button", {
9942
9945
  key: 0,
9943
9946
  type: "button",
@@ -10049,7 +10052,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
10049
10052
  class: "chat-window__jump-latest-badge",
10050
10053
  "data-testid": "badge-chat-window-jump-count",
10051
10054
  "aria-hidden": "true"
10052
- }, ff = ["data-testid"], As = 84, mf = 300 * 1e3, pf = 600 * 1e3, vf = /* @__PURE__ */ ot({
10055
+ }, ff = ["data-testid"], $s = 84, mf = 300 * 1e3, pf = 600 * 1e3, vf = /* @__PURE__ */ ot({
10053
10056
  __name: "ChatWindow",
10054
10057
  props: {
10055
10058
  conversationId: {},
@@ -10100,7 +10103,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
10100
10103
  }), re = C(() => qe(v.value)), Ce = C(() => {
10101
10104
  const D = H.value;
10102
10105
  if (!D || D.type !== "dm") return !1;
10103
- const le = Jn(
10106
+ const le = Zn(
10104
10107
  D.other_presence_status ?? null,
10105
10108
  D.other_last_seen_at ?? null
10106
10109
  );
@@ -10251,12 +10254,12 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
10251
10254
  const D = h.value;
10252
10255
  if (!(D instanceof HTMLElement))
10253
10256
  return;
10254
- const le = Es(D, As);
10257
+ const le = As(D, $s);
10255
10258
  E.value = le, O.value = !le, Zi(ce.value, D.scrollTop), le && ((H.value?.unread_count ?? 0) > 0 || ie.value !== null || ne.value > 0) && (ie.value = null, ne.value = 0, O.value = !1, lt());
10256
10259
  }
10257
10260
  function kt(D = !1) {
10258
10261
  if (h.value) {
10259
- if (!D && !Es(h.value, As)) {
10262
+ if (!D && !As(h.value, $s)) {
10260
10263
  E.value = !1, O.value = !0;
10261
10264
  return;
10262
10265
  }
@@ -10447,7 +10450,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
10447
10450
  (D, le) => {
10448
10451
  if (t.minimized || !D || D === le)
10449
10452
  return;
10450
- const be = h.value instanceof HTMLElement && Es(h.value, As);
10453
+ const be = h.value instanceof HTMLElement && As(h.value, $s);
10451
10454
  if (!E.value || !be) {
10452
10455
  E.value = !1;
10453
10456
  const _ = ye.value.at(-1);
@@ -10768,7 +10771,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
10768
10771
  }, Ff = /* @__PURE__ */ ot({
10769
10772
  __name: "ChatWidget",
10770
10773
  setup(e) {
10771
- const t = dr(), n = ss();
10774
+ const t = dr(), n = is();
10772
10775
  function i() {
10773
10776
  try {
10774
10777
  return t.path ?? "";
@@ -10901,7 +10904,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
10901
10904
  v && l.closeAllWindows();
10902
10905
  }, { immediate: !0 }), We(R, (v) => {
10903
10906
  v <= 0 || l.setMaxWindows(v);
10904
- }, { immediate: !0 }), (v, f) => (m(), it(ns, { to: "body" }, [
10907
+ }, { immediate: !0 }), (v, f) => (m(), it(ss, { to: "body" }, [
10905
10908
  $.value ? (m(), b("button", {
10906
10909
  key: 0,
10907
10910
  "data-testid": "chat-widget-button",
@@ -11152,7 +11155,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
11152
11155
  document.addEventListener("keydown", p);
11153
11156
  }), Nt(() => {
11154
11157
  document.removeEventListener("keydown", p), document.body.style.overflow = "";
11155
- }), (h, w) => (m(), it(ns, { to: "body" }, [
11158
+ }), (h, w) => (m(), it(ss, { to: "body" }, [
11156
11159
  $e(Wt, { name: "messenger-modal" }, {
11157
11160
  default: rt(() => [
11158
11161
  o.value ? (m(), b("div", {
@@ -11822,7 +11825,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
11822
11825
  (F, oe) => {
11823
11826
  F !== oe && (ce(), K());
11824
11827
  }
11825
- ), Us(() => {
11828
+ ), Fs(() => {
11826
11829
  I !== null && (clearTimeout(I), I = null), E !== null && (clearTimeout(E), E = null), O !== null && (clearTimeout(O), O = null), ne !== null && (clearTimeout(ne), ne = null), T();
11827
11830
  }), (F, oe) => (m(), b("button", {
11828
11831
  type: "button",
@@ -12173,7 +12176,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
12173
12176
  },
12174
12177
  emits: ["close"],
12175
12178
  setup(e, { emit: t }) {
12176
- const n = e, i = t, o = Gt(), l = It()(), u = ss(), p = C(() => l.user?.id ?? ""), h = C(() => n.conversation?.type === "group"), w = C(() => n.conversation?.participants ?? []), y = N({}), k = N(Date.now());
12179
+ const n = e, i = t, o = Gt(), l = It()(), u = is(), p = C(() => l.user?.id ?? ""), h = C(() => n.conversation?.type === "group"), w = C(() => n.conversation?.participants ?? []), y = N({}), k = N(Date.now());
12177
12180
  let x = null, M = null;
12178
12181
  const $ = () => {
12179
12182
  M !== null && (clearInterval(M), M = null);
@@ -12191,7 +12194,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
12191
12194
  params: { ids: ue }
12192
12195
  }), te = se.data?.data?.items ?? se.data?.items ?? [], je = {};
12193
12196
  for (const Qe of te) {
12194
- const st = Zn(Qe);
12197
+ const st = Qn(Qe);
12195
12198
  je[Qe.id] = {
12196
12199
  status: st.status ?? "offline",
12197
12200
  lastSeenAt: st.lastSeenAt
@@ -12203,7 +12206,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
12203
12206
  }, L = (ue) => {
12204
12207
  if (ue === p.value) return "online";
12205
12208
  const se = y.value[ue];
12206
- return se ? Jn(se.status, se.lastSeenAt, {
12209
+ return se ? Zn(se.status, se.lastSeenAt, {
12207
12210
  now: k.value
12208
12211
  }) ?? "offline" : "offline";
12209
12212
  }, ae = (ue) => {
@@ -12219,7 +12222,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
12219
12222
  }
12220
12223
  }, de = (ue) => ae(L(ue)), E = C(() => {
12221
12224
  const ue = ve.value?.user_id;
12222
- return ue && y.value[ue] ? L(ue) : Jn(
12225
+ return ue && y.value[ue] ? L(ue) : Zn(
12223
12226
  n.conversation?.other_presence_status ?? null,
12224
12227
  n.conversation?.other_last_seen_at ?? null,
12225
12228
  {
@@ -12896,7 +12899,7 @@ const Su = new ku(), Tu = ["data-testid"], Mu = ["data-testid"], xu = ["data-tes
12896
12899
  let p = !1, h = null;
12897
12900
  const w = N("dm"), y = N(""), k = N(""), x = N([]), M = N([]), $ = N([]), R = N(!1), A = N(!1), I = N(!1), L = N(""), ae = N(null), de = N(!1), E = N(!1), O = N(/* @__PURE__ */ new Map());
12898
12901
  let ne = null;
12899
- const ie = ss(), q = Gt(), K = It()(), ve = [
12902
+ const ie = is(), q = Gt(), K = It()(), ve = [
12900
12903
  "#6366f1",
12901
12904
  "#8b5cf6",
12902
12905
  "#a855f7",
@@ -14249,12 +14252,12 @@ export {
14249
14252
  Pn as getEchoInitializedEvent,
14250
14253
  Ke as getErrorMessage,
14251
14254
  Xs as getLoggerFactory,
14252
- js as getMainApi,
14255
+ Jn as getMainApi,
14253
14256
  ul as getMainEcho,
14254
14257
  dl as getMainEchoConnectionStatus,
14255
14258
  cl as getMainEchoInitializedEvent,
14256
14259
  Eo as getMediaApi,
14257
- $s as getMessagingAccessState,
14260
+ Rs as getMessagingAccessState,
14258
14261
  Al as getPresenceRuntimeConfig,
14259
14262
  tu as getSavedScrollTop,
14260
14263
  uc as getToken,
@@ -14267,7 +14270,7 @@ export {
14267
14270
  Xc as isEmojiOnly,
14268
14271
  $g as isError,
14269
14272
  Kc as isSameMessageDay,
14270
- Es as isScrollNearBottom,
14273
+ As as isScrollNearBottom,
14271
14274
  yo as isValidMessageDeletedEvent,
14272
14275
  bo as isValidMessageEditedEvent,
14273
14276
  go as isValidMessageReadEvent,
@@ -14278,10 +14281,10 @@ export {
14278
14281
  mc as normalizeMediaUrl,
14279
14282
  Oo as normalizePresenceStatus,
14280
14283
  Rr as normalizePresenceTimestamp,
14281
- is as onConnectionStatusChange,
14284
+ rs as onConnectionStatusChange,
14282
14285
  hl as onMainEchoConnectionStatusChange,
14283
14286
  ro as onMessagingAccessStateChange,
14284
- Ps as parsePresenceTimestamp,
14287
+ Is as parsePresenceTimestamp,
14285
14288
  ao as reconnectEcho,
14286
14289
  fl as reconnectMainEcho,
14287
14290
  po as resetEchoRuntimeConfig,
@@ -14300,9 +14303,9 @@ export {
14300
14303
  cc as resetTokenProvider,
14301
14304
  vc as resetWidgetConfig,
14302
14305
  su as resolveFirstUnreadMessageId,
14303
- Jn as resolveFreshPresenceStatus,
14306
+ Zn as resolveFreshPresenceStatus,
14304
14307
  zi as resolveMessageVideoPlaybackUrl,
14305
- Zn as resolvePresenceSnapshot,
14308
+ Qn as resolvePresenceSnapshot,
14306
14309
  eu as scrollElementTo,
14307
14310
  mo as setEchoRuntimeConfig,
14308
14311
  gl as setLoggerFactory,
@@ -14,6 +14,7 @@ export interface Participant {
14
14
  joined_at: string;
15
15
  role: 'owner' | 'admin' | 'member';
16
16
  last_read_at?: string | null;
17
+ is_declined?: boolean;
17
18
  }
18
19
  export interface ReplyToPreview {
19
20
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingfactory/messenger-client",
3
- "version": "0.4.13",
3
+ "version": "0.4.14",
4
4
  "description": "Shared messaging frontend: UI components, state management, API helpers, and realtime composables.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",