@ethora/chat-component 26.10.6 → 26.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +14 -0
  2. package/dist/{ChatProfileModal-OJCKwdNp.js → ChatProfileModal-BDZvd0rm.js} +145 -145
  3. package/dist/{FilePreviewModal-DwNUEHei.js → FilePreviewModal-DlOjnYzv.js} +79 -79
  4. package/dist/{ManageDataModal-CaQ2VBPn.js → ManageDataModal-BZLGJZze.js} +16 -16
  5. package/dist/{MarkdownBody-BeoG2cpo.js → MarkdownBody-CtArwCDa.js} +1 -1
  6. package/dist/{MessageSearchModal-DMw9o49-.js → MessageSearchModal-CcUnfZlU.js} +46 -46
  7. package/dist/{PublicChatsModal-CWdYILv_.js → PublicChatsModal-BWn0NXVo.js} +10 -10
  8. package/dist/{SideDrawer-Cl-vbuIG.js → SideDrawer-CqZl9sxK.js} +28 -28
  9. package/dist/UserProfileModal-D0JZ3-uy.js +635 -0
  10. package/dist/{UserSettingsModal-DgCAHmNh.js → UserSettingsModal-OvykYDsT.js} +4 -4
  11. package/dist/{VideoCallOverlay-Cq2cECWj.js → VideoCallOverlay-DrvO2v_g.js} +4616 -4477
  12. package/dist/{VisibilityModal-D7vqGbrA.js → VisibilityModal-pOF9-UXR.js} +11 -11
  13. package/dist/components/Modals/styledModalComponents.d.ts +4 -4
  14. package/dist/components/VideoCalls/VideoCallSession.d.ts +2 -0
  15. package/dist/firebase-messaging-sw.js +918 -96
  16. package/dist/{handleCopyClick-Crn2jEEu.js → handleCopyClick-BUbVvd2G.js} +1 -1
  17. package/dist/helpers/callClaim.d.ts +17 -0
  18. package/dist/helpers/callOutcomeSync.d.ts +23 -0
  19. package/dist/helpers/callPush.d.ts +23 -0
  20. package/dist/helpers/incomingCallPush.d.ts +89 -0
  21. package/dist/helpers/pushRoomHandoff.d.ts +13 -0
  22. package/dist/hooks/useChatSettingState.d.ts +1 -0
  23. package/dist/hooks/usePushNotifications.d.ts +2 -0
  24. package/dist/{main-36gqdbJ8.js → main-CpHMnydn.js} +11799 -11045
  25. package/dist/main.js +17 -17
  26. package/dist/networking/api-requests/rooms.api.d.ts +9 -0
  27. package/dist/networking/xmpp/sendMessageReaction.xmpp.d.ts +13 -1
  28. package/dist/networking/xmppClient.d.ts +2 -1
  29. package/dist/roomStore/Middleware/blockedHydrationMiddleware.d.ts +2 -0
  30. package/dist/roomStore/chatSettingsSlice.d.ts +2 -1
  31. package/dist/types/models/config.model.d.ts +7 -0
  32. package/dist/types/models/xmpp.model.d.ts +2 -1
  33. package/dist/utils/callAuthMirror.d.ts +1 -0
  34. package/dist/utils/callBroadcast.d.ts +12 -0
  35. package/dist/utils/callNotifications.d.ts +67 -0
  36. package/dist/utils/firebasePushNotifications.d.ts +14 -0
  37. package/dist/utils/handledCalls.d.ts +5 -0
  38. package/dist/utils/pushServiceWorkerBridge.d.ts +19 -0
  39. package/dist/utils/webLock.d.ts +13 -0
  40. package/package.json +1 -1
  41. package/public/firebase-messaging-sw.js +918 -96
  42. package/dist/UserProfileModal-B8KtGnwZ.js +0 -594
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { b3 as et, b4 as tt, E as f, b5 as yt, x as Pe, b as Et, b6 as kt, b7 as nt, b8 as rt, b9 as ot, ba as Le, bb as Te, bc as Ce, aK as $e, K as Ae, bd as Ue, be as Pt, G as ke, bf as St, bg as it, a as Rt, a$ as Lt, u as le, aa as _e, bh as Tt, bi as Ct, bj as Se, bk as Mt, ax as ue, bl as Be, bm as It, bn as $t, bo as At, bp as Dt, bq as Ot, aJ as Ne, D as zt, br as Ut } from "./main-36gqdbJ8.js";
2
+ import { bh as et, bi as tt, U as f, bj as yt, M as Pe, f as Et, bk as kt, bl as nt, bm as rt, bn as ot, bo as Le, bp as Te, bq as Ce, aY as $e, Z as Ae, br as Ue, bs as Pt, X as ke, bt as St, bu as it, a as Rt, bd as Lt, u as le, aq as _e, bv as Tt, bw as Ct, bx as Se, by as Mt, aL as ue, bz as Be, bA as It, bB as $t, bC as At, bD as Dt, bE as Ot, aX as Ne, S as zt, bF as Ut } from "./main-CpHMnydn.js";
3
3
  import Me, { useState as F, useRef as U, useEffect as M, useMemo as te, useCallback as B, useLayoutEffect as _t } from "react";
4
4
  const at = (t, o, i) => {
5
5
  const g = document.createElement("a");
@@ -12,7 +12,7 @@ const at = (t, o, i) => {
12
12
  URL.revokeObjectURL(i);
13
13
  }
14
14
  }, Nt = (t, o) => at(t, o, !0);
15
- async function Wt(t, o, i = {}) {
15
+ async function Xt(t, o, i = {}) {
16
16
  const g = i.fetchImpl ?? fetch, E = i.saveBlob ?? Bt, l = i.saveUrl ?? Nt;
17
17
  let w;
18
18
  try {
@@ -22,13 +22,13 @@ async function Wt(t, o, i = {}) {
22
22
  }
23
23
  return w.ok ? (E(new Blob([await w.arrayBuffer()]), o), "blob") : (et(t) && (w.status === 401 || w.status === 403) && tt(), "http-error");
24
24
  }
25
- function We(t, o) {
25
+ function Xe(t, o) {
26
26
  let i;
27
27
  return (...g) => {
28
28
  window.clearTimeout(i), i = window.setTimeout(() => t(...g), o);
29
29
  };
30
30
  }
31
- function Xt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce: 0, scroll: !1, offsetSize: !1 }) {
31
+ function Wt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce: 0, scroll: !1, offsetSize: !1 }) {
32
32
  const E = i || (typeof window > "u" ? class {
33
33
  } : window.ResizeObserver);
34
34
  if (!E) throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
@@ -39,10 +39,10 @@ function Xt({ debounce: t, scroll: o, polyfill: i, offsetSize: g } = { debounce:
39
39
  const [N, S, x] = te(() => {
40
40
  const k = () => {
41
41
  if (!c.current.element) return;
42
- const { left: W, top: V, width: I, height: D, bottom: j, right: R, x: P, y: C } = c.current.element.getBoundingClientRect(), $ = { left: W, top: V, width: I, height: D, bottom: j, right: R, x: P, y: C };
42
+ const { left: X, top: V, width: I, height: D, bottom: j, right: R, x: P, y: C } = c.current.element.getBoundingClientRect(), $ = { left: X, top: V, width: I, height: D, bottom: j, right: R, x: P, y: C };
43
43
  c.current.element instanceof HTMLElement && g && ($.height = c.current.element.offsetHeight, $.width = c.current.element.offsetWidth), Object.freeze($), v.current && !jt(c.current.lastBounds, $) && w(c.current.lastBounds = $);
44
44
  };
45
- return [k, m ? We(k, m) : k, T ? We(k, T) : k];
45
+ return [k, m ? Xe(k, m) : k, T ? Xe(k, T) : k];
46
46
  }, [w, g, T, m]);
47
47
  function O() {
48
48
  c.current.scrollContainers && (c.current.scrollContainers.forEach((k) => k.removeEventListener("scroll", x, !0)), c.current.scrollContainers = null), c.current.resizeObserver && (c.current.resizeObserver.disconnect(), c.current.resizeObserver = null), c.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", c.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", c.current.orientationHandler));
@@ -83,7 +83,7 @@ function st(t) {
83
83
  const { overflow: i, overflowX: g, overflowY: E } = window.getComputedStyle(t);
84
84
  return [i, g, E].some((l) => l === "auto" || l === "scroll") && o.push(t), [...o, ...st(t.parentElement)];
85
85
  }
86
- const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt = (t, o) => Ht.every((i) => t[i] === o[i]), Xe = 0.5, Fe = 3, xe = 1.25, Vt = 2e-3, Ye = 12, He = 16, je = 16, Gt = 72, Ve = 320, Kt = 150, Ge = 4, Zt = 7, qt = "800px 0px", Jt = 2, Qt = 0.9, Ke = { width: 612, height: 792 }, en = f.div`
86
+ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt = (t, o) => Ht.every((i) => t[i] === o[i]), We = 0.5, Fe = 3, xe = 1.25, Vt = 2e-3, Ye = 12, He = 16, je = 16, Gt = 72, Ve = 320, Zt = 150, Ge = 4, Kt = 7, qt = "800px 0px", Jt = 2, Qt = 0.9, Ze = { width: 612, height: 792 }, en = f.div`
87
87
  display: flex;
88
88
  flex-direction: column;
89
89
  align-items: center;
@@ -201,7 +201,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
201
201
  `, un = (t, o, i) => Math.min(i, Math.max(o, t)), fn = (t) => {
202
202
  const o = t;
203
203
  return !o || !o.tagName ? !1 : o.isContentEditable ? !0 : ["INPUT", "TEXTAREA", "SELECT"].includes(o.tagName);
204
- }, Ze = (t, o, i, g) => {
204
+ }, Ke = (t, o, i, g) => {
205
205
  const E = t + o;
206
206
  let l = 0, w = -1;
207
207
  for (let c = 0; c < i.length; c += 1) {
@@ -213,7 +213,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
213
213
  }
214
214
  return l + 1;
215
215
  }, qe = (t, o) => new Set(
216
- [...t].sort((i, g) => Math.abs(i - o) - Math.abs(g - o) || i - g).slice(0, Zt)
216
+ [...t].sort((i, g) => Math.abs(i - o) - Math.abs(g - o) || i - g).slice(0, Kt)
217
217
  ), hn = Me.memo(function({
218
218
  pdfDocument: o,
219
219
  pageNumber: i,
@@ -241,10 +241,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
241
241
  }
242
242
  const A = O.getViewport({ scale: 1 }), H = Math.min(window.devicePixelRatio || 1, Jt), k = O.getViewport({
243
243
  scale: A.width ? g / A.width * H : H
244
- }), W = S.getContext("2d");
245
- if (!W) return;
244
+ }), X = S.getContext("2d");
245
+ if (!X) return;
246
246
  S.width = Math.max(1, Math.floor(k.width)), S.height = Math.max(1, Math.floor(k.height)), m.current?.cancel();
247
- const V = O.render({ canvasContext: W, viewport: k });
247
+ const V = O.render({ canvasContext: X, viewport: k });
248
248
  m.current = V, await V.promise, x || N(!0), O.cleanup();
249
249
  } catch (O) {
250
250
  x || console.warn("[Ethora] PDF page render failed:", O);
@@ -262,12 +262,12 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
262
262
  }
263
263
  );
264
264
  }), pn = ({ pdfUrl: t }) => {
265
- const o = Pe(), { config: i } = Et(), [g, E] = Xt(), l = U(null), w = B(
265
+ const o = Pe(), { config: i } = Et(), [g, E] = Wt(), l = U(null), w = B(
266
266
  (d) => {
267
267
  l.current = d, g(d);
268
268
  },
269
269
  [g]
270
- ), [c, T] = F("loading"), [m, v] = F(null), [N, S] = F([]), [x, O] = F(1), A = U(1), [H, k] = F(0), [W, V] = F(1), I = U(1), [D, j] = F(() => /* @__PURE__ */ new Set()), R = U(null), P = U(null), C = U(null), $ = H > 0 ? H : Ve, Y = m?.numPages ?? 0;
270
+ ), [c, T] = F("loading"), [m, v] = F(null), [N, S] = F([]), [x, O] = F(1), A = U(1), [H, k] = F(0), [X, V] = F(1), I = U(1), [D, j] = F(() => /* @__PURE__ */ new Set()), R = U(null), P = U(null), C = U(null), $ = H > 0 ? H : Ve, Y = m?.numPages ?? 0;
271
271
  M(() => {
272
272
  let d = !1, n = null, e;
273
273
  return T("loading"), v(null), S([]), j(/* @__PURE__ */ new Set()), I.current = 1, V(1), (async () => {
@@ -289,7 +289,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
289
289
  T("error");
290
290
  return;
291
291
  }
292
- S(Array.from({ length: s.numPages }, () => Ke)), v(s), T("ready");
292
+ S(Array.from({ length: s.numPages }, () => Ze)), v(s), T("ready");
293
293
  } catch (s) {
294
294
  d || (console.warn("[Ethora] PDF open failed:", s), T("error"));
295
295
  }
@@ -310,7 +310,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
310
310
  S(Array.from({ length: n }, () => s));
311
311
  for (let u = 2; u <= n; u += Ge) {
312
312
  const y = Math.min(n, u + Ge - 1), z = await Promise.all(
313
- Array.from({ length: y - u + 1 }, async (X, J) => {
313
+ Array.from({ length: y - u + 1 }, async (W, J) => {
314
314
  const Q = u + J, se = await m.getPage(Q), pe = se.getViewport({ scale: 1 });
315
315
  return se.cleanup(), {
316
316
  pageNumber: Q,
@@ -319,9 +319,9 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
319
319
  })
320
320
  );
321
321
  if (d) return;
322
- S((X) => {
323
- if (X.length !== n) return X;
324
- const J = X.slice();
322
+ S((W) => {
323
+ if (W.length !== n) return W;
324
+ const J = W.slice();
325
325
  return z.forEach(({ pageNumber: Q, size: se }) => {
326
326
  J[Q - 1] = se;
327
327
  }), J;
@@ -335,11 +335,11 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
335
335
  };
336
336
  }, [m]);
337
337
  const L = te(() => {
338
- const d = N.length > 0 ? N : [Ke], n = Math.max(1, $ - He * 2) * x, e = Math.max($, n + He * 2), a = [], s = [];
338
+ const d = N.length > 0 ? N : [Ze], n = Math.max(1, $ - He * 2) * x, e = Math.max($, n + He * 2), a = [], s = [];
339
339
  let u = je;
340
340
  d.forEach((z) => {
341
- const X = n * z.height / (z.width || 1);
342
- a.push(u), s.push(X), u += X + Ye;
341
+ const W = n * z.height / (z.width || 1);
342
+ a.push(u), s.push(W), u += W + Ye;
343
343
  });
344
344
  const y = u - Ye;
345
345
  return {
@@ -356,7 +356,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
356
356
  if (!d) return;
357
357
  const n = R.current;
358
358
  n && (R.current = null, d.scrollLeft = n.fx * d.scrollWidth - n.cx, d.scrollTop = n.fy * d.scrollHeight - n.cy);
359
- const e = Ze(
359
+ const e = Ke(
360
360
  d.scrollTop,
361
361
  d.clientHeight,
362
362
  L.tops,
@@ -364,7 +364,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
364
364
  );
365
365
  e !== I.current && (I.current = e, V(e));
366
366
  }, [L]);
367
- const Z = B((d, n) => {
367
+ const K = B((d, n) => {
368
368
  const e = l.current;
369
369
  if (!e || !e.scrollHeight || !e.scrollWidth) return;
370
370
  if (e.scrollTop <= 0 && e.scrollLeft <= 0) {
@@ -380,10 +380,10 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
380
380
  };
381
381
  }, []), _ = B(
382
382
  (d, n, e) => {
383
- const a = un(d, Xe, Fe);
384
- a !== A.current && (Z(n, e), A.current = a, O(a));
383
+ const a = un(d, We, Fe);
384
+ a !== A.current && (K(n, e), A.current = a, O(a));
385
385
  },
386
- [Z]
386
+ [K]
387
387
  ), ee = Math.max(Ve, Math.floor(E.width || 0));
388
388
  M(() => {
389
389
  if (H === 0) {
@@ -392,19 +392,19 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
392
392
  }
393
393
  if (ee === H) return;
394
394
  const d = window.setTimeout(() => {
395
- Z(), k(ee);
396
- }, Kt);
395
+ K(), k(ee);
396
+ }, Zt);
397
397
  return () => window.clearTimeout(d);
398
- }, [ee, H, Z]);
398
+ }, [ee, H, K]);
399
399
  const ne = typeof IntersectionObserver < "u";
400
400
  M(() => {
401
401
  !m || ne || j(
402
402
  qe(
403
403
  Array.from({ length: m.numPages }, (d, n) => n + 1),
404
- W
404
+ X
405
405
  )
406
406
  );
407
- }, [m, W, ne]), M(() => {
407
+ }, [m, X, ne]), M(() => {
408
408
  const d = l.current;
409
409
  if (!m || !d || typeof IntersectionObserver > "u")
410
410
  return;
@@ -422,7 +422,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
422
422
  const de = B(() => {
423
423
  const d = l.current, n = P.current;
424
424
  if (!d || !n) return;
425
- const e = Ze(
425
+ const e = Ke(
426
426
  d.scrollTop,
427
427
  d.clientHeight,
428
428
  n.tops,
@@ -544,7 +544,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
544
544
  ),
545
545
  c === "ready" && /* @__PURE__ */ b(an, { children: [
546
546
  /* @__PURE__ */ b(sn, { children: [
547
- W,
547
+ X,
548
548
  " / ",
549
549
  Y
550
550
  ] }),
@@ -554,7 +554,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
554
554
  {
555
555
  type: "button",
556
556
  onClick: () => _(A.current / xe),
557
- disabled: x <= Xe,
557
+ disabled: x <= We,
558
558
  "aria-label": o("modal.filePreview.zoomOut"),
559
559
  children: /* @__PURE__ */ r(nt, { color: "currentColor" })
560
560
  }
@@ -671,7 +671,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
671
671
  onError: w,
672
672
  onScaleChange: c
673
673
  }, T) => {
674
- const m = U(null), v = U(null), [N, S] = F(!1), [x, O] = F(G), [A, H] = F({ x: 0, y: 0 }), [k, W] = F(!1), [V, I] = F(!1), D = U({ scale: G, offset: { x: 0, y: 0 } });
674
+ const m = U(null), v = U(null), [N, S] = F(!1), [x, O] = F(G), [A, H] = F({ x: 0, y: 0 }), [k, X] = F(!1), [V, I] = F(!1), D = U({ scale: G, offset: { x: 0, y: 0 } });
675
675
  D.current = { scale: x, offset: A };
676
676
  const j = U(null), R = U(null), P = U(
677
677
  null
@@ -679,19 +679,19 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
679
679
  const e = m.current, a = v.current;
680
680
  if (!e) return { x: 0, y: 0 };
681
681
  const s = e.clientWidth, u = e.clientHeight, y = a?.naturalWidth || 0, z = a?.naturalHeight || 0;
682
- let X = s, J = u;
682
+ let W = s, J = u;
683
683
  if (y > 0 && z > 0 && s > 0 && u > 0) {
684
684
  const Q = Math.min(s / y, u / z);
685
- X = y * Q, J = z * Q;
685
+ W = y * Q, J = z * Q;
686
686
  }
687
687
  return {
688
- x: Math.max(0, (X * n - s) / 2),
688
+ x: Math.max(0, (W * n - s) / 2),
689
689
  y: Math.max(0, (J * n - u) / 2)
690
690
  };
691
691
  }, []), $ = B(
692
692
  (n, e, a) => {
693
693
  const s = ve(n, G, Ie), u = C(s);
694
- W(a), O(s), H({
694
+ X(a), O(s), H({
695
695
  x: ve(e.x, -u.x, u.x),
696
696
  y: ve(e.y, -u.y, u.y)
697
697
  });
@@ -712,7 +712,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
712
712
  [$]
713
713
  ), L = B(() => {
714
714
  $(G, { x: 0, y: 0 }, !0);
715
- }, [$]), Z = B(
715
+ }, [$]), K = B(
716
716
  (n) => {
717
717
  Y(D.current.scale * n, 0, 0, !0);
718
718
  },
@@ -721,13 +721,13 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
721
721
  Me.useImperativeHandle(
722
722
  T,
723
723
  () => ({
724
- zoomIn: () => Z(1.5),
725
- zoomOut: () => Z(1 / 1.5),
724
+ zoomIn: () => K(1.5),
725
+ zoomOut: () => K(1 / 1.5),
726
726
  reset: L
727
727
  }),
728
- [Z, L]
728
+ [K, L]
729
729
  ), M(() => {
730
- W(!1), O(G), H({ x: 0, y: 0 });
730
+ X(!1), O(G), H({ x: 0, y: 0 });
731
731
  }, [t]), M(() => {
732
732
  const n = v.current;
733
733
  S(!!(n?.complete && n.naturalWidth > 0));
@@ -823,7 +823,7 @@ const Ht = ["x", "y", "top", "bottom", "left", "right", "width", "height"], jt =
823
823
  s.clientY - u.clientY
824
824
  ), z = m.current;
825
825
  if (!z || y <= 0) return;
826
- const X = z.getBoundingClientRect(), J = (s.clientX + u.clientX) / 2 - X.left - X.width / 2, Q = (s.clientY + u.clientY) / 2 - X.top - X.height / 2;
826
+ const W = z.getBoundingClientRect(), J = (s.clientX + u.clientX) / 2 - W.left - W.width / 2, Q = (s.clientY + u.clientY) / 2 - W.top - W.height / 2;
827
827
  e.moved = !0, Y(
828
828
  e.pinchScale * y / e.pinchDistance,
829
829
  J,
@@ -980,7 +980,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
980
980
  if (!t) return { name: "" };
981
981
  const E = [t.username, t.id].map((v) => Ue(ie(v))).filter(Boolean), l = E.map((v) => o?.[v]).find((v) => v && (ye(v) || v.profileImage)), w = Ue(ie(i?.xmppUsername)), c = !!w && E.includes(w), T = ye(t) || Ee(t.name) || ye(l) || (c ? ye(i) || Ee(i?.name) : "") || E.map(Ee).find(Boolean) || Ee(g) || "", m = ie(t.photo) || ie(l?.profileImage) || (c ? ie(i?.profileImage) : "") || void 0;
982
982
  return { name: T, photo: m };
983
- }, K = "#f5f7fa", ut = "rgba(245, 247, 250, 0.68)", fe = "rgba(255, 255, 255, 0.08)", ft = "rgba(255, 255, 255, 0.18)", ht = "var(--ethora-color-primary, #0052cd)", Sn = Ae`
983
+ }, Z = "#f5f7fa", ut = "rgba(245, 247, 250, 0.68)", fe = "rgba(255, 255, 255, 0.08)", ft = "rgba(255, 255, 255, 0.18)", ht = "var(--ethora-color-primary, #0052cd)", Sn = Ae`
984
984
  from { opacity: 0; transform: scale(0.98); }
985
985
  to { opacity: 1; transform: scale(1); }
986
986
  `, Rn = Ae`
@@ -996,7 +996,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
996
996
  display: flex;
997
997
  flex-direction: column;
998
998
  box-sizing: border-box;
999
- color: ${K};
999
+ color: ${Z};
1000
1000
  background-color: rgba(10, 12, 18, 0.92);
1001
1001
  -webkit-backdrop-filter: blur(8px);
1002
1002
  backdrop-filter: blur(8px);
@@ -1030,7 +1030,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1030
1030
  `, In = f.span`
1031
1031
  font-size: 15px;
1032
1032
  font-weight: 600;
1033
- color: ${K};
1033
+ color: ${Z};
1034
1034
  overflow: hidden;
1035
1035
  text-overflow: ellipsis;
1036
1036
  white-space: nowrap;
@@ -1057,7 +1057,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1057
1057
  border: 0;
1058
1058
  border-radius: 50%;
1059
1059
  background-color: ${fe};
1060
- color: ${K};
1060
+ color: ${Z};
1061
1061
  cursor: pointer;
1062
1062
  transition: background-color 150ms ease;
1063
1063
 
@@ -1066,7 +1066,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1066
1066
  }
1067
1067
 
1068
1068
  &:focus-visible {
1069
- outline: 2px solid ${K};
1069
+ outline: 2px solid ${Z};
1070
1070
  outline-offset: 2px;
1071
1071
  }
1072
1072
 
@@ -1114,7 +1114,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1114
1114
  border: 0;
1115
1115
  border-radius: 50%;
1116
1116
  background-color: rgba(10, 12, 18, 0.55);
1117
- color: ${K};
1117
+ color: ${Z};
1118
1118
  cursor: pointer;
1119
1119
  transition: background-color 150ms ease, opacity 150ms ease;
1120
1120
 
@@ -1123,7 +1123,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1123
1123
  }
1124
1124
 
1125
1125
  &:focus-visible {
1126
- outline: 2px solid ${K};
1126
+ outline: 2px solid ${Z};
1127
1127
  outline-offset: 2px;
1128
1128
  }
1129
1129
 
@@ -1176,7 +1176,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1176
1176
  }
1177
1177
 
1178
1178
  &:focus-visible {
1179
- outline: 2px solid ${K};
1179
+ outline: 2px solid ${Z};
1180
1180
  outline-offset: 2px;
1181
1181
  }
1182
1182
  `, Bn = f.img`
@@ -1201,7 +1201,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1201
1201
  },
1202
1202
  children: /* @__PURE__ */ r("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ r("path", { d: "M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5z" }) })
1203
1203
  }
1204
- ), Wn = () => /* @__PURE__ */ r(
1204
+ ), Xn = () => /* @__PURE__ */ r(
1205
1205
  "span",
1206
1206
  {
1207
1207
  "aria-hidden": "true",
@@ -1212,7 +1212,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1212
1212
  background: "linear-gradient(135deg, #2a3350, #151a2b)"
1213
1213
  }
1214
1214
  }
1215
- ), Xn = f.div`
1215
+ ), Wn = f.div`
1216
1216
  display: grid;
1217
1217
  grid-template-columns: 1fr auto 1fr;
1218
1218
  align-items: center;
@@ -1222,7 +1222,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1222
1222
  padding: 6px 14px;
1223
1223
  border-radius: 999px;
1224
1224
  background-color: ${fe};
1225
- color: ${K};
1225
+ color: ${Z};
1226
1226
  font-size: 13px;
1227
1227
  font-variant-numeric: tabular-nums;
1228
1228
  white-space: nowrap;
@@ -1243,13 +1243,13 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1243
1243
  text-align: center;
1244
1244
  border-radius: 16px;
1245
1245
  background-color: rgba(255, 255, 255, 0.05);
1246
- color: ${K};
1246
+ color: ${Z};
1247
1247
  `, Oe = f.h2`
1248
1248
  margin: 0;
1249
1249
  font-size: 18px;
1250
1250
  font-weight: 600;
1251
1251
  line-height: 1.3;
1252
- color: ${K};
1252
+ color: ${Z};
1253
1253
  `, Hn = f.p`
1254
1254
  margin: 0;
1255
1255
  font-size: 14px;
@@ -1277,7 +1277,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1277
1277
  transition: background-color 150ms ease;
1278
1278
 
1279
1279
  &:focus-visible {
1280
- outline: 2px solid ${K};
1280
+ outline: 2px solid ${Z};
1281
1281
  outline-offset: 2px;
1282
1282
  }
1283
1283
  `, gt = f(pt)`
@@ -1291,7 +1291,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1291
1291
  `, Vn = f(pt)`
1292
1292
  border: 1px solid rgba(255, 255, 255, 0.28);
1293
1293
  background-color: transparent;
1294
- color: ${K};
1294
+ color: ${Z};
1295
1295
 
1296
1296
  &:hover {
1297
1297
  background-color: ${fe};
@@ -1304,7 +1304,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1304
1304
  > span {
1305
1305
  color: #9cc0ff;
1306
1306
  }
1307
- `, Kn = ({
1307
+ `, Zn = ({
1308
1308
  onRetry: t,
1309
1309
  onDownload: o
1310
1310
  }) => {
@@ -1323,7 +1323,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1323
1323
  ] })
1324
1324
  ] })
1325
1325
  ] });
1326
- }, Zn = ({
1326
+ }, Kn = ({
1327
1327
  fileName: t,
1328
1328
  unsupportedText: o,
1329
1329
  onDownload: i
@@ -1362,7 +1362,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1362
1362
  height: 116px;
1363
1363
  border-radius: 12px;
1364
1364
  background-color: ${fe};
1365
- color: ${K};
1365
+ color: ${Z};
1366
1366
  `, Jn = f.span`
1367
1367
  position: absolute;
1368
1368
  bottom: 14px;
@@ -1435,7 +1435,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1435
1435
  ), T = le((h) => h.rooms.usersSet), m = le((h) => h.chatSettingStore.user), v = le((h) => {
1436
1436
  const p = _e(h);
1437
1437
  return p?.type === "private" ? String(p?.title || p?.name || "") : "";
1438
- }), N = U(null), S = U(null), x = U([]), [O, A] = F(G), [H, k] = F(null), [W, V] = F(
1438
+ }), N = U(null), S = U(null), x = U([]), [O, A] = F(G), [H, k] = F(null), [X, V] = F(
1439
1439
  null
1440
1440
  ), I = Tt(l?.mimetype, l?.fileName), D = te(() => Ct(c), [c]), j = l.siblings, R = te(() => {
1441
1441
  if (Se(D, l) >= 0) return D;
@@ -1444,7 +1444,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1444
1444
  }, [D, j, l]), P = te(
1445
1445
  () => I === "image" || I === "video" ? Se(R, l) : -1,
1446
1446
  [R, l, I]
1447
- ), C = P >= 0 && R.length > 1, $ = C && P > 0, Y = C && P < R.length - 1, L = P >= 0 ? R[P] : void 0, Z = L?.fileName || l.fileName, _ = L?.sender ?? l.sender, ee = te(
1447
+ ), C = P >= 0 && R.length > 1, $ = C && P > 0, Y = C && P < R.length - 1, L = P >= 0 ? R[P] : void 0, K = L?.fileName || l.fileName, _ = L?.sender ?? l.sender, ee = te(
1448
1448
  () => Pn({
1449
1449
  sender: _,
1450
1450
  usersSet: T,
@@ -1454,8 +1454,8 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1454
1454
  [_, T, m, v]
1455
1455
  ), ne = ee.name, de = rr(L?.date ?? l.date), re = !!l.fileURL, oe = I === "image" && (!re || H === l.fileURL), d = te(() => {
1456
1456
  const h = ue(l.fileURL, w);
1457
- return W?.url === l.fileURL ? or(h, W.count) : h;
1458
- }, [l.fileURL, w, W]), n = L?.previewURL ? ue(L.previewURL, w) : void 0, e = B(
1457
+ return X?.url === l.fileURL ? or(h, X.count) : h;
1458
+ }, [l.fileURL, w, X]), n = L?.previewURL ? ue(L.previewURL, w) : void 0, e = B(
1459
1459
  (h) => {
1460
1460
  const p = R[h];
1461
1461
  p && o(
@@ -1512,7 +1512,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1512
1512
  }, [C, a, s, I, oe]);
1513
1513
  const u = () => {
1514
1514
  const q = !!it(l.fileName) ? l.fileName : `MEDIA-ETHORA.${I === "image" ? "png" : I === "video" ? "mp4" : "bin"}`;
1515
- Wt(Ne(l.fileURL), q).catch((be) => {
1515
+ Xt(Ne(l.fileURL), q).catch((be) => {
1516
1516
  zt.log(be);
1517
1517
  });
1518
1518
  }, y = () => {
@@ -1523,14 +1523,14 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1523
1523
  );
1524
1524
  }, z = () => {
1525
1525
  o(Be(void 0)), t?.();
1526
- }, X = (h) => {
1526
+ }, W = (h) => {
1527
1527
  h.target === h.currentTarget && z();
1528
1528
  }, J = () => {
1529
1529
  et(l.fileURL) && tt(), k(l.fileURL);
1530
1530
  }, Q = () => {
1531
1531
  V({
1532
1532
  url: l.fileURL,
1533
- count: (W?.url === l.fileURL ? W.count : 0) + 1
1533
+ count: (X?.url === l.fileURL ? X.count : 0) + 1
1534
1534
  }), k(null);
1535
1535
  }, se = (h) => {
1536
1536
  if (h.key !== "Tab" || !N.current) return;
@@ -1543,7 +1543,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1543
1543
  }, pe = l.fileName || i("modal.filePreview.imageAlt"), wt = i("modal.filePreview.unsupported"), ge = ue(l.fileURL, w);
1544
1544
  let ae, me = "media";
1545
1545
  if (oe)
1546
- me = "content", ae = /* @__PURE__ */ r(Kn, { onRetry: Q, onDownload: u });
1546
+ me = "content", ae = /* @__PURE__ */ r(Zn, { onRetry: Q, onDownload: u });
1547
1547
  else
1548
1548
  switch (I) {
1549
1549
  case "image":
@@ -1574,16 +1574,16 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1574
1574
  );
1575
1575
  break;
1576
1576
  case "audio":
1577
- me = "content", ae = /* @__PURE__ */ r(qn, { fileName: Z, src: ge });
1577
+ me = "content", ae = /* @__PURE__ */ r(qn, { fileName: K, src: ge });
1578
1578
  break;
1579
1579
  case "pdf":
1580
1580
  ae = /* @__PURE__ */ r(pn, { pdfUrl: ge });
1581
1581
  break;
1582
1582
  default:
1583
1583
  me = "content", ae = /* @__PURE__ */ r(
1584
- Zn,
1584
+ Kn,
1585
1585
  {
1586
- fileName: Z,
1586
+ fileName: K,
1587
1587
  unsupportedText: wt,
1588
1588
  onDownload: u
1589
1589
  }
@@ -1612,7 +1612,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1612
1612
  ),
1613
1613
  /* @__PURE__ */ b(Mn, { children: [
1614
1614
  ne && /* @__PURE__ */ r(In, { children: ne }),
1615
- /* @__PURE__ */ r($n, { children: [de, Z].filter(Boolean).join(" · ") || i("modal.filePreview.title") })
1615
+ /* @__PURE__ */ r($n, { children: [de, K].filter(Boolean).join(" · ") || i("modal.filePreview.title") })
1616
1616
  ] })
1617
1617
  ] }),
1618
1618
  /* @__PURE__ */ b(An, { children: [
@@ -1649,7 +1649,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1649
1649
  )
1650
1650
  ] })
1651
1651
  ] }),
1652
- /* @__PURE__ */ b(Dn, { onClick: X, "data-testid": "file-viewer-stage", children: [
1652
+ /* @__PURE__ */ b(Dn, { onClick: W, "data-testid": "file-viewer-stage", children: [
1653
1653
  C && /* @__PURE__ */ r(
1654
1654
  Qe,
1655
1655
  {
@@ -1696,7 +1696,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1696
1696
  "aria-current": p === P ? "true" : void 0,
1697
1697
  onClick: () => e(p),
1698
1698
  children: [
1699
- h.kind === "video" && !h.previewURL ? /* @__PURE__ */ r(Wn, {}) : /* @__PURE__ */ r(
1699
+ h.kind === "video" && !h.previewURL ? /* @__PURE__ */ r(Xn, {}) : /* @__PURE__ */ r(
1700
1700
  Bn,
1701
1701
  {
1702
1702
  src: Le(
@@ -1714,7 +1714,7 @@ const ie = (t) => String(t ?? "").trim(), ye = (t) => [ie(t?.firstName), ie(t?.l
1714
1714
  ))
1715
1715
  }
1716
1716
  ),
1717
- /* @__PURE__ */ b(Xn, { children: [
1717
+ /* @__PURE__ */ b(Wn, { children: [
1718
1718
  /* @__PURE__ */ r("span", {}),
1719
1719
  C ? /* @__PURE__ */ r(Fn, { "data-testid": "lightbox-position", "aria-live": "polite", children: i("modal.filePreview.position", {
1720
1720
  current: P + 1,
@@ -1,7 +1,7 @@
1
1
  import { jsxs as o, Fragment as M, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as m, useCallback as T } from "react";
3
- import { aK as I, E as t, aL as j, aM as w, B, u as E, x as R, Q as z, aN as F, S as U, D as x, aO as O, aP as $, aQ as A, aR as P } from "./main-36gqdbJ8.js";
4
- import { S as Q, D as f, a as u, b as D, e as v, f as b } from "./SideDrawer-Cl-vbuIG.js";
3
+ import { aY as I, U as t, aZ as j, a_ as w, I as B, u as U, M as z, a1 as E, a$ as F, a3 as R, S as x, b0 as $, b1 as A, b2 as O, b3 as H } from "./main-CpHMnydn.js";
4
+ import { S as P, D as f, a as u, b as D, e as b, f as v } from "./SideDrawer-CqZl9sxK.js";
5
5
  t(j)`
6
6
  display: flex;
7
7
  box-sizing: border-box;
@@ -66,14 +66,14 @@ const y = t(B)`
66
66
  }
67
67
 
68
68
  ${I}
69
- `, H = t.div`
69
+ `, W = t.div`
70
70
  display: flex;
71
71
  align-items: flex-start;
72
72
  background-color: ${({ bgColor: r }) => r};
73
73
  padding: var(--ethora-space-4, 16px);
74
74
  border-radius: var(--ethora-radius-md, 12px);
75
75
  gap: var(--ethora-space-2, 8px);
76
- `, K = t.div`
76
+ `, Y = t.div`
77
77
  font-size: var(--ethora-font-size-xs, 12px);
78
78
  line-height: var(--ethora-line-height-normal, 1.5);
79
79
  color: var(--ethora-color-text, #141414);
@@ -82,8 +82,8 @@ const y = t(B)`
82
82
  `, J = ({
83
83
  handleCloseModal: r
84
84
  }) => {
85
- const { config: l } = E((s) => s.chatSettingStore), e = R(), { showToast: d } = z(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
86
- const p = (await P()).data;
85
+ const { config: l } = U((s) => s.chatSettingStore), e = z(), { showToast: d } = E(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
86
+ const p = (await H()).data;
87
87
  x.log(p);
88
88
  const L = new Blob([p], { type: "text/plain" }), h = URL.createObjectURL(L), n = document.createElement("a");
89
89
  n.href = h, n.download = "mydata.json", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(h);
@@ -91,7 +91,7 @@ const y = t(B)`
91
91
  if (!i) {
92
92
  g(!0);
93
93
  try {
94
- await F(), c(!1), await U.performLogout();
94
+ await F(), c(!1), await R.performLogout();
95
95
  } catch (s) {
96
96
  x.error("Failed to delete account", s), d({
97
97
  id: Date.now().toString(),
@@ -105,7 +105,7 @@ const y = t(B)`
105
105
  }, [i, d, e]);
106
106
  return /* @__PURE__ */ o(M, { children: [
107
107
  /* @__PURE__ */ o(
108
- Q,
108
+ P,
109
109
  {
110
110
  title: e("settings.manageData.title"),
111
111
  onClose: r,
@@ -113,8 +113,8 @@ const y = t(B)`
113
113
  children: [
114
114
  /* @__PURE__ */ o(f, { children: [
115
115
  /* @__PURE__ */ a(u, { children: e("settings.manageData.section.export") }),
116
- /* @__PURE__ */ a(D, { children: /* @__PURE__ */ o(v, { children: [
117
- /* @__PURE__ */ a(b, { children: e("settings.manageData.downloadDescription") }),
116
+ /* @__PURE__ */ a(D, { children: /* @__PURE__ */ o(b, { children: [
117
+ /* @__PURE__ */ a(v, { children: e("settings.manageData.downloadDescription") }),
118
118
  /* @__PURE__ */ a(
119
119
  y,
120
120
  {
@@ -128,16 +128,16 @@ const y = t(B)`
128
128
  ] }),
129
129
  /* @__PURE__ */ o(f, { children: [
130
130
  /* @__PURE__ */ a(u, { children: e("settings.manageData.deleteLabel") }),
131
- /* @__PURE__ */ a(D, { children: /* @__PURE__ */ o(v, { children: [
132
- /* @__PURE__ */ a(b, { children: e("settings.manageData.deleteDescription") }),
131
+ /* @__PURE__ */ a(D, { children: /* @__PURE__ */ o(b, { children: [
132
+ /* @__PURE__ */ a(v, { children: e("settings.manageData.deleteDescription") }),
133
133
  /* @__PURE__ */ o(
134
- H,
134
+ W,
135
135
  {
136
136
  bgColor: l?.colors?.secondary || "var(--ethora-color-primary-soft, #E7EDF9)",
137
137
  style: { marginTop: "var(--ethora-space-2, 8px)" },
138
138
  children: [
139
- /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(O, { color: $(l) }) }),
140
- /* @__PURE__ */ a(K, { children: e("settings.manageData.deleteDisclosure") })
139
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a($, { color: A(l) }) }),
140
+ /* @__PURE__ */ a(Y, { children: e("settings.manageData.deleteDisclosure") })
141
141
  ]
142
142
  }
143
143
  ),
@@ -159,7 +159,7 @@ const y = t(B)`
159
159
  }
160
160
  ),
161
161
  C && /* @__PURE__ */ a(
162
- A,
162
+ O,
163
163
  {
164
164
  title: e("settings.manageData.deleteConfirmTitle"),
165
165
  description: e("settings.manageData.deleteConfirmDescription"),