@ethora/chat-component 26.9.6 → 26.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +45 -3
  2. package/dist/{ChatProfileModal-DKuxJsdM.js → ChatProfileModal-Bf5jGPBZ.js} +566 -562
  3. package/dist/FilePreviewModal-Bwx0RZZw.js +1763 -0
  4. package/dist/{ManageDataModal-Dw4dCQll.js → ManageDataModal-Dhkp0LWH.js} +20 -20
  5. package/dist/{MarkdownBody-xtKDMR0h.js → MarkdownBody-_sUhW2O8.js} +1 -1
  6. package/dist/{MessageSearchModal-BVKU6H3v.js → MessageSearchModal-rwwWrILl.js} +106 -114
  7. package/dist/{PublicChatsModal-CscOnVaQ.js → PublicChatsModal-Byso6_vt.js} +13 -13
  8. package/dist/{SideDrawer-WneDrrWG.js → SideDrawer-CQPOf0ek.js} +38 -38
  9. package/dist/{UserProfileModal-CMHFq1I9.js → UserProfileModal-Vj2kICvc.js} +10 -10
  10. package/dist/{UserSettingsModal-BoZXZ0oR.js → UserSettingsModal-CioX4ZIV.js} +5 -5
  11. package/dist/{VideoCallOverlay-CQNi7wp5.js → VideoCallOverlay-DodAkiam.js} +3824 -3708
  12. package/dist/{VisibilityModal-BPsNiMzJ.js → VisibilityModal-CIl7rkBM.js} +12 -12
  13. package/dist/assets/icons.d.ts +2 -3
  14. package/dist/components/Files/fileCategory.d.ts +4 -2
  15. package/dist/components/InputComponents/MentionDropdown.d.ts +2 -0
  16. package/dist/components/MainComponents/AlbumGrid.d.ts +22 -0
  17. package/dist/components/MainComponents/AttachmentList.d.ts +6 -6
  18. package/dist/components/MainComponents/ImageUnavailable.d.ts +21 -0
  19. package/dist/components/MainComponents/MediaUploadOverlay.d.ts +31 -0
  20. package/dist/components/MainComponents/MessageContainer.d.ts +3 -0
  21. package/dist/components/MainComponents/scrollAnchor.d.ts +19 -0
  22. package/dist/components/MainComponents/useJumpToMessage.d.ts +42 -11
  23. package/dist/components/MainComponents/useScrollAnchor.d.ts +29 -0
  24. package/dist/components/MessageBubble/MediaCaption.d.ts +9 -0
  25. package/dist/components/MessageBubble/MessageAvatarPhoto.d.ts +17 -0
  26. package/dist/components/MessageBubble/MessageReaction.d.ts +6 -0
  27. package/dist/components/MessageBubble/QuickReplies.d.ts +2 -0
  28. package/dist/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +8 -10
  29. package/dist/components/Modals/FilePreviewModal/ImageLightbox.d.ts +4 -0
  30. package/dist/components/Modals/FilePreviewModal/PdfView.d.ts +4 -0
  31. package/dist/components/Modals/FilePreviewModal/ViewerChrome.d.ts +64 -0
  32. package/dist/components/Modals/MessageSearchModal/MessageHitResults.d.ts +5 -0
  33. package/dist/components/Modals/styledModalComponents.d.ts +0 -8
  34. package/dist/components/RoomComponents/LastMessageItem.d.ts +2 -0
  35. package/dist/components/RoomComponents/styled/LastMessageMedia.d.ts +19 -0
  36. package/dist/components/RoomComponents/styled/LastTextMessage.d.ts +2 -2
  37. package/dist/components/RoomComponents/styled/StyledRoomComponents.d.ts +10 -3
  38. package/dist/components/VideoCalls/VideoCallSession.d.ts +13 -0
  39. package/dist/components/styled/FileCard.d.ts +20 -0
  40. package/dist/components/styled/MediaSurface.d.ts +50 -0
  41. package/dist/components/styled/MessageImage.d.ts +9 -10
  42. package/dist/components/styled/SendInput.d.ts +12 -2
  43. package/dist/components/styled/StyledComponents.d.ts +69 -2
  44. package/dist/components/styled/StyledInputComponents/MediaComponents.d.ts +36 -24
  45. package/dist/components/styled/UnsupportedType.d.ts +1 -0
  46. package/dist/components/styled/VideoMessage.d.ts +11 -6
  47. package/dist/e2ee/callKey.d.ts +32 -0
  48. package/dist/e2ee/fileEnvelope.d.ts +16 -5
  49. package/dist/e2ee/omemo.d.ts +18 -0
  50. package/dist/firebase-messaging-sw.js +20 -3
  51. package/dist/{handleCopyClick-B70vLjJD.js → handleCopyClick-DGaZhy_u.js} +1 -1
  52. package/dist/helpers/albumLayout.d.ts +53 -0
  53. package/dist/helpers/attachments.d.ts +22 -1
  54. package/dist/helpers/avatarImageCache.d.ts +9 -0
  55. package/dist/helpers/caption.d.ts +63 -0
  56. package/dist/helpers/checkUniqueUsers.d.ts +2 -2
  57. package/dist/helpers/composerFocus.d.ts +22 -0
  58. package/dist/helpers/createMainMessageForThread.d.ts +1 -1
  59. package/dist/helpers/dedupeMembers.d.ts +10 -0
  60. package/dist/helpers/downloadFile.d.ts +19 -0
  61. package/dist/helpers/fileKind.d.ts +17 -0
  62. package/dist/helpers/historyPreloadConfig.d.ts +25 -0
  63. package/dist/helpers/historyPreloadScheduler.d.ts +3 -0
  64. package/dist/helpers/insertMessageWithDelimiter.d.ts +1 -0
  65. package/dist/helpers/isMessageSearchEnabled.d.ts +9 -0
  66. package/dist/helpers/jumpThread.d.ts +56 -0
  67. package/dist/helpers/jumpWindow.d.ts +73 -0
  68. package/dist/helpers/lastMessagePreview.d.ts +55 -0
  69. package/dist/helpers/mapWithConcurrency.d.ts +8 -0
  70. package/dist/helpers/mediaBox.d.ts +110 -0
  71. package/dist/helpers/mediaBubble.d.ts +39 -0
  72. package/dist/helpers/mediaLabel.d.ts +10 -0
  73. package/dist/helpers/mediaSendRetry.d.ts +25 -0
  74. package/dist/helpers/messageRuns.d.ts +10 -0
  75. package/dist/helpers/openThreadForJump.d.ts +26 -0
  76. package/dist/helpers/pdf/loadPdfjs.d.ts +8 -1
  77. package/dist/helpers/repairFilenameEncoding.d.ts +11 -0
  78. package/dist/helpers/roomImageGallery.d.ts +34 -0
  79. package/dist/helpers/roomUserCount.d.ts +19 -0
  80. package/dist/helpers/safeUrl.d.ts +15 -0
  81. package/dist/helpers/secureFileUrl.d.ts +4 -1
  82. package/dist/helpers/userResolver.d.ts +57 -0
  83. package/dist/helpers/viewerSender.d.ts +47 -0
  84. package/dist/helpers/xmppIdShape.d.ts +1 -1
  85. package/dist/hooks/useAvatarImage.d.ts +21 -0
  86. package/dist/hooks/useChatWrapperInit.d.ts +6 -0
  87. package/dist/hooks/useIsMobileViewport.d.ts +5 -0
  88. package/dist/hooks/useMediaProbe.d.ts +40 -0
  89. package/dist/hooks/usePaneWidthVar.d.ts +11 -0
  90. package/dist/hooks/usePdfThumbnail.d.ts +2 -2
  91. package/dist/hooks/usePrefersReducedMotion.d.ts +2 -0
  92. package/dist/hooks/useRoomDirectory.d.ts +11 -0
  93. package/dist/hooks/useSendMessage.d.ts +4 -1
  94. package/dist/{main-rJpE4hh-.js → main-CUB_w8AZ.js} +29136 -24217
  95. package/dist/main.css +1 -1
  96. package/dist/main.js +16 -16
  97. package/dist/networking/api-requests/auth.api.d.ts +2 -0
  98. package/dist/networking/api-requests/roomMembers.api.d.ts +18 -0
  99. package/dist/networking/callKeyStanza.d.ts +7 -0
  100. package/dist/networking/ethoraEvents.d.ts +44 -0
  101. package/dist/networking/stanzaHandlers.d.ts +6 -4
  102. package/dist/networking/xmpp/allRoomPresences.xmpp.d.ts +18 -1
  103. package/dist/networking/xmpp/presenceInRoom.xmpp.d.ts +1 -1
  104. package/dist/networking/xmpp/sendDisplayedMarker.xmpp.d.ts +2 -0
  105. package/dist/networking/xmpp/sendMediaMessage.xmpp.d.ts +8 -0
  106. package/dist/networking/xmpp/sendReceivedReceipt.xmpp.d.ts +2 -0
  107. package/dist/networking/xmppClient.d.ts +61 -2
  108. package/dist/roomStore/Middleware/jumpThreadMiddleware.d.ts +2 -0
  109. package/dist/roomStore/callSlice.d.ts +6 -1
  110. package/dist/roomStore/index.d.ts +22 -0
  111. package/dist/roomStore/roomsSlice.d.ts +51 -4
  112. package/dist/roomStore/safeKey.d.ts +12 -0
  113. package/dist/roomStore/usersSetCap.d.ts +15 -0
  114. package/dist/styles/motion.d.ts +22 -2
  115. package/dist/types/models/attachment.model.d.ts +19 -0
  116. package/dist/types/models/config.model.d.ts +98 -5
  117. package/dist/types/models/customComponents.model.d.ts +2 -0
  118. package/dist/types/models/message.model.d.ts +9 -0
  119. package/dist/types/models/modal.model.d.ts +19 -0
  120. package/dist/types/models/room.model.d.ts +30 -0
  121. package/dist/types/models/xmpp.model.d.ts +24 -1
  122. package/dist/utils/messageNotificationContent.d.ts +34 -0
  123. package/dist/version.d.ts +1 -1
  124. package/package.json +2 -1
  125. package/public/firebase-messaging-sw.js +20 -3
  126. package/dist/FilePreviewModal-BcaSoO3-.js +0 -743
  127. package/dist/components/MainComponents/computeAnchoredScrollTop.d.ts +0 -9
  128. package/dist/components/Modals/NewChatModal/UpdNewChatModal.d.ts +0 -3
  129. package/dist/components/RoomComponents/styled/LastAudioMessage.d.ts +0 -6
  130. package/dist/components/RoomComponents/styled/LastMessageFile.d.ts +0 -6
  131. package/dist/components/RoomComponents/styled/LastMessagePhoto.d.ts +0 -6
  132. package/dist/components/RoomComponents/styled/LastMessageVideo.d.ts +0 -6
  133. package/dist/components/SortDropDown/index.d.ts +0 -8
@@ -1,8 +1,8 @@
1
- import { jsxs as o, Fragment as T, jsx as a } from "react/jsx-runtime";
2
- import { useState as m, useCallback as M } from "react";
3
- import { ay as B, x as t, az as I, aA as w, B as j, u as z, p as E, J as F, aB as R, L as U, w as x, aC as A, aD as $, aE as O, aF as H } from "./main-rJpE4hh-.js";
4
- import { S as J, D as f, a as u, b as D, e as v, f as b } from "./SideDrawer-WneDrrWG.js";
5
- t(I)`
1
+ import { jsxs as o, Fragment as M, jsx as a } from "react/jsx-runtime";
2
+ import { useState as m, useCallback as T } from "react";
3
+ import { aJ as I, E as t, aK as j, aL as w, B, u as E, x as z, Q as F, aM as R, S as U, D as x, aN as O, aO as $, aP as A, aQ as P } from "./main-CUB_w8AZ.js";
4
+ import { S as Q, D as f, a as u, b as D, e as v, f as b } from "./SideDrawer-CQPOf0ek.js";
5
+ t(j)`
6
6
  display: flex;
7
7
  box-sizing: border-box;
8
8
  align-items: flex-start;
@@ -36,7 +36,7 @@ t(w)`
36
36
  text-align: start;
37
37
  color: var(--ethora-color-text-muted, #8c8c8c);
38
38
  `;
39
- const y = t(j)`
39
+ const y = t(B)`
40
40
  min-height: 44px;
41
41
  display: flex;
42
42
  flex-direction: column;
@@ -65,29 +65,29 @@ const y = t(j)`
65
65
  box-shadow: var(--ethora-shadow-sm, 0 1px 2px rgba(16, 24, 40, 0.06));
66
66
  }
67
67
 
68
- ${B}
69
- `, P = t.div`
68
+ ${I}
69
+ `, H = 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
- `, W = t.div`
76
+ `, J = 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);
80
80
  display: flex;
81
81
  text-align: start;
82
- `, Q = ({
82
+ `, G = ({
83
83
  handleCloseModal: r
84
84
  }) => {
85
- const { config: l } = z((s) => s.chatSettingStore), e = E(), { showToast: d } = F(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
86
- const p = (await H()).data;
85
+ const { config: l } = E((s) => s.chatSettingStore), e = z(), { showToast: d } = F(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
86
+ const p = (await P()).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);
90
- }, k = M(async () => {
90
+ }, k = T(async () => {
91
91
  if (!i) {
92
92
  g(!0);
93
93
  try {
@@ -103,9 +103,9 @@ const y = t(j)`
103
103
  }
104
104
  }
105
105
  }, [i, d, e]);
106
- return /* @__PURE__ */ o(T, { children: [
106
+ return /* @__PURE__ */ o(M, { children: [
107
107
  /* @__PURE__ */ o(
108
- J,
108
+ Q,
109
109
  {
110
110
  title: e("settings.manageData.title"),
111
111
  onClose: r,
@@ -131,13 +131,13 @@ const y = t(j)`
131
131
  /* @__PURE__ */ a(D, { children: /* @__PURE__ */ o(v, { children: [
132
132
  /* @__PURE__ */ a(b, { children: e("settings.manageData.deleteDescription") }),
133
133
  /* @__PURE__ */ o(
134
- P,
134
+ H,
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(A, { color: $(l) }) }),
140
- /* @__PURE__ */ a(W, { children: e("settings.manageData.deleteDisclosure") })
139
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(O, { color: $(l) }) }),
140
+ /* @__PURE__ */ a(J, { children: e("settings.manageData.deleteDisclosure") })
141
141
  ]
142
142
  }
143
143
  ),
@@ -159,7 +159,7 @@ const y = t(j)`
159
159
  }
160
160
  ),
161
161
  C && /* @__PURE__ */ a(
162
- O,
162
+ A,
163
163
  {
164
164
  title: e("settings.manageData.deleteConfirmTitle"),
165
165
  description: e("settings.manageData.deleteConfirmDescription"),
@@ -174,5 +174,5 @@ const y = t(j)`
174
174
  ] });
175
175
  };
176
176
  export {
177
- Q as default
177
+ G as default
178
178
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as fs, jsx as ie, Fragment as hs } from "react/jsx-runtime";
2
2
  import "react";
3
- import { o as ei } from "./main-rJpE4hh-.js";
3
+ import { w as ei } from "./main-CUB_w8AZ.js";
4
4
  function zr(e) {
5
5
  const t = [], n = String(e || "");
6
6
  let r = n.indexOf(","), u = 0, i = !1;
@@ -1,11 +1,11 @@
1
- import { jsx as a, jsxs as n, Fragment as q } from "react/jsx-runtime";
2
- import { useRef as J, useState as h, useMemo as I, useEffect as _ } from "react";
3
- import { p as G, a as P, aI as K, u as z, aJ as V, aK as Y, ar as W, aL as X, aM as Z, x as i, q as ee } from "./main-rJpE4hh-.js";
4
- import { S as re, i as te, j as ae, f as y } from "./SideDrawer-WneDrrWG.js";
5
- function oe(t) {
1
+ import { jsx as a, jsxs as i, Fragment as G } from "react/jsx-runtime";
2
+ import { useRef as J, useState as h, useMemo as I, useEffect as V } from "react";
3
+ import { x as Y, a as W, aT as X, u as z, at as K, as as Z, au as ee, aU as re, aV as te, aB as ae, aW as oe, aX as se, aY as ne, E as c, y as ie } from "./main-CUB_w8AZ.js";
4
+ import { S as ce, i as le, j as de, f as S } from "./SideDrawer-CQPOf0ek.js";
5
+ function he(t) {
6
6
  const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t || "");
7
7
  if (!e) return;
8
- const c = new Date(
8
+ const l = new Date(
9
9
  Number(e[1]),
10
10
  Number(e[2]) - 1,
11
11
  Number(e[3]),
@@ -14,12 +14,12 @@ function oe(t) {
14
14
  0,
15
15
  0
16
16
  );
17
- return Number.isNaN(c.getTime()) ? void 0 : c.toISOString();
17
+ return Number.isNaN(l.getTime()) ? void 0 : l.toISOString();
18
18
  }
19
- function se(t) {
19
+ function ue(t) {
20
20
  const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t || "");
21
21
  if (!e) return;
22
- const c = new Date(
22
+ const l = new Date(
23
23
  Number(e[1]),
24
24
  Number(e[2]) - 1,
25
25
  Number(e[3]),
@@ -28,31 +28,31 @@ function se(t) {
28
28
  59,
29
29
  999
30
30
  );
31
- return Number.isNaN(c.getTime()) ? void 0 : c.toISOString();
31
+ return Number.isNaN(l.getTime()) ? void 0 : l.toISOString();
32
32
  }
33
- const ne = (t, e) => !!(t && e && t > e), ie = (t) => `${t.firstName || ""} ${t.lastName || ""}`.trim() || t.name || "";
34
- function ce(t, e, c = 8) {
35
- const S = e.trim().toLowerCase();
36
- if (!S) return [];
37
- const p = [], g = [], l = /* @__PURE__ */ new Set();
33
+ const pe = (t, e) => !!(t && e && t > e), me = (t) => `${t.firstName || ""} ${t.lastName || ""}`.trim() || t.name || "";
34
+ function fe(t, e, l = 8) {
35
+ const k = e.trim().toLowerCase();
36
+ if (!k) return [];
37
+ const u = [], p = [], n = /* @__PURE__ */ new Set();
38
38
  for (const x of t) {
39
- const d = x._id, b = ie(x);
40
- if (!d || !b || l.has(d)) continue;
41
- const s = b.toLowerCase().indexOf(S);
42
- if (s !== -1 && (l.add(d), (s === 0 ? p : g).push({ id: d, name: b }), p.length >= c))
39
+ const d = x._id, b = me(x);
40
+ if (!d || !b || n.has(d)) continue;
41
+ const s = b.toLowerCase().indexOf(k);
42
+ if (s !== -1 && (n.add(d), (s === 0 ? u : p).push({ id: d, name: b }), u.length >= l))
43
43
  break;
44
44
  }
45
- return [...p, ...g].slice(0, c);
45
+ return [...u, ...p].slice(0, l);
46
46
  }
47
- const le = i.div`
47
+ const ge = c.div`
48
48
  display: flex;
49
49
  flex-direction: column;
50
50
  gap: var(--ethora-space-3, 12px);
51
51
  min-height: 0;
52
- `, de = i.div`
52
+ `, xe = c.div`
53
53
  display: flex;
54
54
  gap: var(--ethora-space-2, 8px);
55
- `, H = i.button`
55
+ `, E = c.button`
56
56
  flex: 1 1 0;
57
57
  height: 32px;
58
58
  border: 1px solid
@@ -65,7 +65,7 @@ const le = i.div`
65
65
  font-weight: var(--ethora-font-weight-medium, 500);
66
66
  cursor: pointer;
67
67
  transition: background-color var(--ethora-motion-fast, 150ms);
68
- `, he = i.button`
68
+ `, be = c.button`
69
69
  align-self: flex-start;
70
70
  display: inline-flex;
71
71
  align-items: center;
@@ -87,14 +87,14 @@ const le = i.div`
87
87
  font-size: var(--ethora-font-size-xs, 12px);
88
88
  text-align: center;
89
89
  }
90
- `, pe = i.div`
90
+ `, ve = c.div`
91
91
  display: flex;
92
92
  flex-direction: column;
93
93
  gap: var(--ethora-space-2, 8px);
94
94
  padding: var(--ethora-space-3, 12px);
95
95
  border: 1px solid var(--ethora-color-border, #e6e8ec);
96
96
  border-radius: var(--ethora-radius-md, 12px);
97
- `, $ = i.label`
97
+ `, $ = c.label`
98
98
  display: flex;
99
99
  flex-direction: column;
100
100
  gap: 4px;
@@ -112,11 +112,11 @@ const le = i.div`
112
112
  font: inherit;
113
113
  font-size: var(--ethora-font-size-sm, 14px);
114
114
  }
115
- `, ue = i.div`
115
+ `, ye = c.div`
116
116
  display: grid;
117
117
  grid-template-columns: 1fr 1fr;
118
118
  gap: var(--ethora-space-2, 8px);
119
- `, fe = i.ul`
119
+ `, Se = c.ul`
120
120
  list-style: none;
121
121
  margin: 0;
122
122
  padding: 4px;
@@ -140,7 +140,7 @@ const le = i.div`
140
140
  button:focus-visible {
141
141
  background: var(--ethora-color-bg-hover, #f0f2f5);
142
142
  }
143
- `, me = i.span`
143
+ `, ke = c.span`
144
144
  display: inline-flex;
145
145
  align-items: center;
146
146
  gap: 6px;
@@ -159,7 +159,7 @@ const le = i.div`
159
159
  cursor: pointer;
160
160
  padding: 0 6px;
161
161
  }
162
- `, ge = i.button`
162
+ `, Ce = c.button`
163
163
  align-self: flex-start;
164
164
  border: none;
165
165
  background: transparent;
@@ -169,76 +169,68 @@ const le = i.div`
169
169
  text-decoration: underline;
170
170
  cursor: pointer;
171
171
  padding: 0;
172
- `, xe = i.div`
172
+ `, we = c.div`
173
173
  font-size: var(--ethora-font-size-xs, 12px);
174
174
  color: var(--ethora-color-text-muted, #6c6c6c);
175
- `, be = i.button`
176
- align-self: center;
177
- margin-top: var(--ethora-space-2, 8px);
178
- padding: 6px 14px;
179
- border: 1px solid var(--ethora-color-border, #e6e8ec);
180
- border-radius: var(--ethora-radius-full, 999px);
181
- background: transparent;
182
- color: var(--ethora-color-text-secondary, #5a5f66);
183
- font: inherit;
184
- font-size: var(--ethora-font-size-sm, 14px);
185
- cursor: pointer;
186
-
187
- &:disabled {
188
- opacity: 0.6;
189
- cursor: default;
190
- }
191
- `, Ce = ({
175
+ `, Re = ({
192
176
  handleCloseModal: t
193
177
  }) => {
194
- const e = G(), c = P(), S = K(767), p = J(null), g = z((r) => r.rooms.rooms), l = z(
178
+ const e = Y(), l = W(), k = X(767), u = J(null), p = z((r) => r.rooms.rooms), n = z(
195
179
  (r) => r.rooms.activeRoomJID
196
180
  ), x = z((r) => r.rooms.usersSet);
197
181
  z(
198
182
  (r) => r.chatSettingStore.user?.xmppUsername
199
183
  );
200
184
  const [d, b] = h(""), [s, O] = h(
201
- l ? "chat" : "all"
202
- ), R = l ? l.split("@")[0] : void 0, [w, T] = h(!1), [u, F] = h(""), [f, L] = h(""), [m, M] = h(
185
+ n ? "chat" : "all"
186
+ ), F = n ? n.split("@")[0] : void 0, [C, H] = h(!1), [m, T] = h(""), [f, B] = h(""), [g, M] = h(
203
187
  null
204
- ), [k, N] = h(""), v = ne(u, f), U = I(
188
+ ), [v, N] = h(""), y = pe(m, f), j = I(
205
189
  () => ({
206
- fromUserId: m?.id,
207
- since: v ? void 0 : oe(u),
208
- until: v ? void 0 : se(f)
190
+ fromUserId: g?.id,
191
+ since: y ? void 0 : he(m),
192
+ until: y ? void 0 : ue(f)
209
193
  }),
210
- [m?.id, u, f, v]
211
- ), C = (m ? 1 : 0) + (u ? 1 : 0) + (f ? 1 : 0), j = () => {
212
- M(null), N(""), F(""), L("");
213
- }, A = I(() => {
214
- if (!k.trim()) return [];
215
- const r = s === "chat" ? l && g[l]?.members || [] : Object.values(x || {});
216
- return ce(r, k);
217
- }, [k, s, g, l, x]), o = V(
218
- v ? "" : d,
194
+ [g?.id, m, f, y]
195
+ ), w = (g ? 1 : 0) + (m ? 1 : 0) + (f ? 1 : 0), Q = () => {
196
+ M(null), N(""), T(""), B("");
197
+ }, P = n ? p[n] : void 0, { members: D } = K(
198
+ n || void 0,
199
+ s === "chat" && Z(P) && (C || v.trim() !== "")
200
+ ), L = I(() => {
201
+ if (!v.trim()) return [];
202
+ let r;
203
+ if (s === "chat") {
204
+ const A = n && p[n]?.members || [];
205
+ D.length > 0 ? r = ee([...A, ...D]) : r = A;
206
+ } else
207
+ r = Object.values(x || {});
208
+ return fe(r, v);
209
+ }, [v, s, p, n, x, D]), o = re(
210
+ y ? "" : d,
219
211
  s,
220
- R,
221
- U
212
+ F,
213
+ j
222
214
  );
223
- _(() => {
224
- p.current?.focus();
215
+ V(() => {
216
+ u.current?.focus();
225
217
  }, []);
226
- const { open: E } = Y(), Q = (r) => {
227
- E(r) && S && c(ee(void 0));
228
- }, D = I(() => o.items, [o.items]), B = d.trim();
218
+ const { open: _ } = te(), q = (r) => {
219
+ _(r) && k && l(ie(void 0));
220
+ }, R = I(() => o.items, [o.items]), U = d.trim();
229
221
  return /* @__PURE__ */ a(
230
- re,
222
+ ce,
231
223
  {
232
224
  title: e("search.messages.title"),
233
225
  onClose: t,
234
226
  backLabel: e("action.close"),
235
- children: /* @__PURE__ */ n(le, { children: [
236
- /* @__PURE__ */ n(te, { children: [
237
- /* @__PURE__ */ a(W, {}),
227
+ children: /* @__PURE__ */ i(ge, { children: [
228
+ /* @__PURE__ */ i(le, { children: [
229
+ /* @__PURE__ */ a(ae, {}),
238
230
  /* @__PURE__ */ a(
239
- ae,
231
+ de,
240
232
  {
241
- ref: p,
233
+ ref: u,
242
234
  "data-autofocus": !0,
243
235
  type: "search",
244
236
  value: d,
@@ -250,20 +242,20 @@ const le = i.div`
250
242
  }
251
243
  )
252
244
  ] }),
253
- /* @__PURE__ */ n(de, { role: "group", "aria-label": e("search.messages.scope"), children: [
245
+ /* @__PURE__ */ i(xe, { role: "group", "aria-label": e("search.messages.scope"), children: [
254
246
  /* @__PURE__ */ a(
255
- H,
247
+ E,
256
248
  {
257
249
  type: "button",
258
250
  $active: s === "chat",
259
251
  "aria-pressed": s === "chat",
260
- disabled: !R,
252
+ disabled: !F,
261
253
  onClick: () => O("chat"),
262
254
  children: e("search.messages.scopeChat")
263
255
  }
264
256
  ),
265
257
  /* @__PURE__ */ a(
266
- H,
258
+ E,
267
259
  {
268
260
  type: "button",
269
261
  $active: s === "all",
@@ -273,24 +265,24 @@ const le = i.div`
273
265
  }
274
266
  )
275
267
  ] }),
276
- /* @__PURE__ */ n(
277
- he,
268
+ /* @__PURE__ */ i(
269
+ be,
278
270
  {
279
271
  type: "button",
280
- $active: w || C > 0,
281
- "aria-expanded": w,
282
- onClick: () => T((r) => !r),
272
+ $active: C || w > 0,
273
+ "aria-expanded": C,
274
+ onClick: () => H((r) => !r),
283
275
  children: [
284
276
  e("search.messages.filters"),
285
- C > 0 && /* @__PURE__ */ a("span", { children: C })
277
+ w > 0 && /* @__PURE__ */ a("span", { children: w })
286
278
  ]
287
279
  }
288
280
  ),
289
- w && /* @__PURE__ */ n(pe, { children: [
290
- /* @__PURE__ */ n($, { children: [
281
+ C && /* @__PURE__ */ i(ve, { children: [
282
+ /* @__PURE__ */ i($, { children: [
291
283
  e("search.messages.filterSender"),
292
- m ? /* @__PURE__ */ n(me, { children: [
293
- m.name,
284
+ g ? /* @__PURE__ */ i(ke, { children: [
285
+ g.name,
294
286
  /* @__PURE__ */ a(
295
287
  "button",
296
288
  {
@@ -304,13 +296,13 @@ const le = i.div`
304
296
  "input",
305
297
  {
306
298
  type: "search",
307
- value: k,
299
+ value: v,
308
300
  onChange: (r) => N(r.target.value),
309
301
  placeholder: e("search.messages.filterSenderPlaceholder")
310
302
  }
311
303
  )
312
304
  ] }),
313
- !m && A.length > 0 && /* @__PURE__ */ a(fe, { role: "listbox", children: A.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
305
+ !g && L.length > 0 && /* @__PURE__ */ a(Se, { role: "listbox", children: L.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
314
306
  "button",
315
307
  {
316
308
  type: "button",
@@ -322,56 +314,56 @@ const le = i.div`
322
314
  children: r.name
323
315
  }
324
316
  ) }, r.id)) }),
325
- /* @__PURE__ */ n(ue, { children: [
326
- /* @__PURE__ */ n($, { children: [
317
+ /* @__PURE__ */ i(ye, { children: [
318
+ /* @__PURE__ */ i($, { children: [
327
319
  e("search.messages.filterSince"),
328
320
  /* @__PURE__ */ a(
329
321
  "input",
330
322
  {
331
323
  type: "date",
332
- value: u,
324
+ value: m,
333
325
  max: f || void 0,
334
- onChange: (r) => F(r.target.value)
326
+ onChange: (r) => T(r.target.value)
335
327
  }
336
328
  )
337
329
  ] }),
338
- /* @__PURE__ */ n($, { children: [
330
+ /* @__PURE__ */ i($, { children: [
339
331
  e("search.messages.filterUntil"),
340
332
  /* @__PURE__ */ a(
341
333
  "input",
342
334
  {
343
335
  type: "date",
344
336
  value: f,
345
- min: u || void 0,
346
- onChange: (r) => L(r.target.value)
337
+ min: m || void 0,
338
+ onChange: (r) => B(r.target.value)
347
339
  }
348
340
  )
349
341
  ] })
350
342
  ] }),
351
- v && /* @__PURE__ */ a(y, { role: "alert", children: e("search.messages.dateOrder") }),
352
- C > 0 && /* @__PURE__ */ a(ge, { type: "button", onClick: j, children: e("search.messages.filterClearAll") })
343
+ y && /* @__PURE__ */ a(S, { role: "alert", children: e("search.messages.dateOrder") }),
344
+ w > 0 && /* @__PURE__ */ a(Ce, { type: "button", onClick: Q, children: e("search.messages.filterClearAll") })
353
345
  ] }),
354
- !o.searchable && /* @__PURE__ */ a(y, { children: B ? e("search.messages.tooShort", { count: X }) : e("search.messages.hint") }),
355
- o.searchable && o.status === "loading" && /* @__PURE__ */ a(y, { role: "status", children: e("search.messages.searching") }),
356
- o.status === "error" && /* @__PURE__ */ n(y, { role: "alert", children: [
346
+ !o.searchable && /* @__PURE__ */ a(S, { children: U ? e("search.messages.tooShort", { count: oe }) : e("search.messages.hint") }),
347
+ o.searchable && o.status === "loading" && /* @__PURE__ */ a(S, { role: "status", children: e("search.messages.searching") }),
348
+ o.status === "error" && /* @__PURE__ */ i(S, { role: "alert", children: [
357
349
  e("search.messages.error"),
358
350
  " ",
359
351
  /* @__PURE__ */ a("button", { type: "button", onClick: o.retry, children: e("search.messages.retry") })
360
352
  ] }),
361
- o.searchable && o.status === "done" && D.length === 0 && /* @__PURE__ */ a(y, { children: e("search.messages.empty") }),
362
- D.length > 0 && /* @__PURE__ */ n(q, { children: [
363
- /* @__PURE__ */ a(xe, { role: "status", children: e("search.messages.count", { count: o.total }) }),
353
+ o.searchable && o.status === "done" && R.length === 0 && /* @__PURE__ */ a(S, { children: e("search.messages.empty") }),
354
+ R.length > 0 && /* @__PURE__ */ i(G, { children: [
355
+ /* @__PURE__ */ a(we, { role: "status", children: e("search.messages.count", { count: o.total }) }),
364
356
  /* @__PURE__ */ a(
365
- Z,
357
+ se,
366
358
  {
367
- hits: D,
368
- query: B,
359
+ hits: R,
360
+ query: U,
369
361
  showRoom: s === "all",
370
- onOpen: Q
362
+ onOpen: q
371
363
  }
372
364
  ),
373
365
  o.hasMore && /* @__PURE__ */ a(
374
- be,
366
+ ne,
375
367
  {
376
368
  type: "button",
377
369
  onClick: o.loadMore,
@@ -385,5 +377,5 @@ const le = i.div`
385
377
  );
386
378
  };
387
379
  export {
388
- Ce as default
380
+ Re as default
389
381
  };
@@ -1,14 +1,14 @@
1
1
  import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import { useState as p, useRef as B, useCallback as P, useEffect as T, useMemo as z } from "react";
3
- import { g as E, aN as U, p as _, a as q, aI as F, u as A, ar as H, x as c, a2 as J, q as G } from "./main-rJpE4hh-.js";
4
- import { S as V, i as Z, j as K, f as S } from "./SideDrawer-WneDrrWG.js";
2
+ import { useState as p, useRef as T, useCallback as E, useEffect as N, useMemo as z } from "react";
3
+ import { l as P, aZ as U, x as _, a as F, aT as H, u as A, aB as J, E as c, a7 as Z, y as q } from "./main-CUB_w8AZ.js";
4
+ import { S as G, i as V, j as K, f as S } from "./SideDrawer-CQPOf0ek.js";
5
5
  const I = 50;
6
6
  async function Q({
7
7
  offset: r = 0,
8
8
  limit: t = I,
9
9
  signal: u
10
10
  } = {}) {
11
- const x = E.getState().chatSettingStore.user?.token || "", s = (await U.get("/v1/chats/public", {
11
+ const x = P.getState().chatSettingStore.user?.token || "", s = (await U.get("/v1/chats/public", {
12
12
  params: { limit: Math.min(t, I), offset: r },
13
13
  headers: { Authorization: x },
14
14
  signal: u
@@ -103,9 +103,9 @@ const W = c.ul`
103
103
  `, oe = (r) => (r.title || r.name).trim().charAt(0).toUpperCase() || "#", le = ({
104
104
  handleCloseModal: r
105
105
  }) => {
106
- const t = _(), u = q(), x = F(767), b = A((e) => e.rooms.rooms), s = A(
106
+ const t = _(), u = F(), x = H(767), b = A((e) => e.rooms.rooms), s = A(
107
107
  (e) => e.chatSettingStore.config?.xmppSettings?.conference
108
- ), [l, i] = p([]), [j, $] = p(0), [v, D] = p(0), [n, w] = p("loading"), [h, L] = p(""), m = B(0), f = P(async (e) => {
108
+ ), [l, i] = p([]), [j, $] = p(0), [v, D] = p(0), [n, w] = p("loading"), [h, L] = p(""), m = T(0), f = E(async (e) => {
109
109
  const o = ++m.current;
110
110
  w(e ? "loadingMore" : "loading");
111
111
  try {
@@ -119,7 +119,7 @@ const W = c.ul`
119
119
  o === m.current && w("error");
120
120
  }
121
121
  }, []);
122
- T(() => (f(0), () => {
122
+ N(() => (f(0), () => {
123
123
  m.current += 1;
124
124
  }), [f]);
125
125
  const O = z(
@@ -130,19 +130,19 @@ const W = c.ul`
130
130
  return e ? l.filter(
131
131
  (o) => o.title.toLowerCase().includes(e) || o.description.toLowerCase().includes(e)
132
132
  ) : l;
133
- }, [l, h]), N = (e) => {
133
+ }, [l, h]), B = (e) => {
134
134
  const o = (s || "").trim();
135
- o && (u(J({ roomJID: `${e.name}@${o}` })), x && u(G(void 0)));
135
+ o && (u(Z({ roomJID: `${e.name}@${o}` })), x && u(q(void 0)));
136
136
  }, M = v < j;
137
137
  return /* @__PURE__ */ d(
138
- V,
138
+ G,
139
139
  {
140
140
  title: t("publicChats.title"),
141
141
  onClose: r,
142
142
  backLabel: t("action.close"),
143
143
  children: [
144
- /* @__PURE__ */ d(Z, { children: [
145
- /* @__PURE__ */ a(H, {}),
144
+ /* @__PURE__ */ d(V, { children: [
145
+ /* @__PURE__ */ a(J, {}),
146
146
  /* @__PURE__ */ a(
147
147
  K,
148
148
  {
@@ -176,7 +176,7 @@ const W = c.ul`
176
176
  {
177
177
  type: "button",
178
178
  $open: o,
179
- onClick: () => N(e),
179
+ onClick: () => B(e),
180
180
  children: t(o ? "publicChats.open" : "publicChats.join")
181
181
  }
182
182
  )