@ethora/chat-component 26.9.6 → 26.9.8

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 (57) hide show
  1. package/README.md +44 -2
  2. package/dist/{ChatProfileModal-DKuxJsdM.js → ChatProfileModal-3UH0H5Ec.js} +571 -567
  3. package/dist/{FilePreviewModal-BcaSoO3-.js → FilePreviewModal-Cgj1iHry.js} +168 -168
  4. package/dist/{ManageDataModal-Dw4dCQll.js → ManageDataModal-BblTuE9g.js} +14 -14
  5. package/dist/{MarkdownBody-xtKDMR0h.js → MarkdownBody-RMEx8yW2.js} +1 -1
  6. package/dist/{MessageSearchModal-BVKU6H3v.js → MessageSearchModal-CrYR2EH8.js} +105 -113
  7. package/dist/{PublicChatsModal-CscOnVaQ.js → PublicChatsModal-Bi5r4mrV.js} +13 -13
  8. package/dist/{SideDrawer-WneDrrWG.js → SideDrawer-CDAoobvX.js} +16 -16
  9. package/dist/{UserProfileModal-CMHFq1I9.js → UserProfileModal-4Frgvam-.js} +3 -3
  10. package/dist/{UserSettingsModal-BoZXZ0oR.js → UserSettingsModal-C-mb-9cb.js} +2 -2
  11. package/dist/{VideoCallOverlay-CQNi7wp5.js → VideoCallOverlay-92dFLb9U.js} +1 -1
  12. package/dist/{VisibilityModal-BPsNiMzJ.js → VisibilityModal-zIAV6dAP.js} +9 -9
  13. package/dist/components/InputComponents/MentionDropdown.d.ts +2 -0
  14. package/dist/components/MainComponents/scrollAnchor.d.ts +19 -0
  15. package/dist/components/MainComponents/useJumpToMessage.d.ts +42 -11
  16. package/dist/components/MainComponents/useScrollAnchor.d.ts +29 -0
  17. package/dist/components/Modals/MessageSearchModal/MessageHitResults.d.ts +5 -0
  18. package/dist/components/Modals/styledModalComponents.d.ts +0 -8
  19. package/dist/{handleCopyClick-B70vLjJD.js → handleCopyClick-BtXos0AJ.js} +1 -1
  20. package/dist/helpers/checkUniqueUsers.d.ts +2 -2
  21. package/dist/helpers/dedupeMembers.d.ts +10 -0
  22. package/dist/helpers/historyPreloadConfig.d.ts +25 -0
  23. package/dist/helpers/historyPreloadScheduler.d.ts +3 -0
  24. package/dist/helpers/insertMessageWithDelimiter.d.ts +1 -0
  25. package/dist/helpers/isMessageSearchEnabled.d.ts +9 -0
  26. package/dist/helpers/jumpThread.d.ts +56 -0
  27. package/dist/helpers/jumpWindow.d.ts +73 -0
  28. package/dist/helpers/openThreadForJump.d.ts +26 -0
  29. package/dist/helpers/pdf/loadPdfjs.d.ts +8 -1
  30. package/dist/helpers/roomUserCount.d.ts +19 -0
  31. package/dist/helpers/userResolver.d.ts +57 -0
  32. package/dist/helpers/xmppIdShape.d.ts +1 -1
  33. package/dist/hooks/useChatWrapperInit.d.ts +6 -0
  34. package/dist/hooks/usePdfThumbnail.d.ts +2 -1
  35. package/dist/hooks/useRoomDirectory.d.ts +11 -0
  36. package/dist/{main-rJpE4hh-.js → main-BnLtessp.js} +22850 -21155
  37. package/dist/main.css +1 -1
  38. package/dist/main.js +11 -11
  39. package/dist/networking/api-requests/roomMembers.api.d.ts +18 -0
  40. package/dist/networking/ethoraEvents.d.ts +44 -0
  41. package/dist/networking/stanzaHandlers.d.ts +2 -2
  42. package/dist/networking/xmpp/allRoomPresences.xmpp.d.ts +18 -1
  43. package/dist/networking/xmpp/presenceInRoom.xmpp.d.ts +1 -1
  44. package/dist/networking/xmppClient.d.ts +56 -2
  45. package/dist/roomStore/Middleware/jumpThreadMiddleware.d.ts +2 -0
  46. package/dist/roomStore/index.d.ts +12 -0
  47. package/dist/roomStore/roomsSlice.d.ts +33 -1
  48. package/dist/roomStore/safeKey.d.ts +12 -0
  49. package/dist/roomStore/usersSetCap.d.ts +15 -0
  50. package/dist/types/models/config.model.d.ts +70 -3
  51. package/dist/types/models/room.model.d.ts +14 -0
  52. package/dist/types/models/xmpp.model.d.ts +21 -1
  53. package/dist/version.d.ts +1 -1
  54. package/package.json +2 -1
  55. package/dist/components/MainComponents/computeAnchoredScrollTop.d.ts +0 -9
  56. package/dist/components/Modals/NewChatModal/UpdNewChatModal.d.ts +0 -3
  57. package/dist/components/SortDropDown/index.d.ts +0 -8
@@ -1,8 +1,8 @@
1
1
  import { jsxs as o, Fragment as T, jsx as a } from "react/jsx-runtime";
2
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)`
3
+ import { aE as I, x as t, aF as j, aG as w, B, u as E, p as F, J as z, aH as R, L as U, w as x, aI as $, aJ as A, aK as H, aL as J } from "./main-BnLtessp.js";
4
+ import { S as O, D as f, a as u, b as D, e as v, f as b } from "./SideDrawer-CDAoobvX.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,15 +65,15 @@ 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
+ `, G = 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
+ `, K = 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(j)`
82
82
  `, Q = ({
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 = F(), { showToast: d } = z(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
86
+ const p = (await J()).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);
@@ -105,7 +105,7 @@ const y = t(j)`
105
105
  }, [i, d, e]);
106
106
  return /* @__PURE__ */ o(T, { children: [
107
107
  /* @__PURE__ */ o(
108
- J,
108
+ O,
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
+ G,
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($, { color: A(l) }) }),
140
+ /* @__PURE__ */ a(K, { 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
+ H,
163
163
  {
164
164
  title: e("settings.manageData.deleteConfirmTitle"),
165
165
  description: e("settings.manageData.deleteConfirmDescription"),
@@ -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 { o as ei } from "./main-BnLtessp.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 { p as Y, a as K, aO as W, u as z, ao as X, an as Z, ap as ee, aP as re, aQ as te, aw as ae, aR as oe, aS as se, aT as ne, x as c, q as ie } from "./main-BnLtessp.js";
4
+ import { S as ce, i as le, j as de, f as S } from "./SideDrawer-CDAoobvX.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 pe(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 ue = (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 p = [], u = [], 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 ? p : u).push({ id: d, name: b }), p.length >= l))
43
43
  break;
44
44
  }
45
- return [...p, ...g].slice(0, c);
45
+ return [...p, ...u].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
+ `, Q = 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
+ `, O = 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,74 +169,66 @@ 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 = K(), k = W(767), p = J(null), u = 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
- 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(
184
+ const [d, b] = h(""), [s, $] = h(
185
+ n ? "chat" : "all"
186
+ ), F = n ? n.split("@")[0] : void 0, [C, U] = h(!1), [m, T] = h(""), [f, L] = h(""), [g, M] = h(
203
187
  null
204
- ), [k, N] = h(""), v = ne(u, f), U = I(
188
+ ), [v, N] = h(""), y = ue(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 : pe(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), E = () => {
196
+ M(null), N(""), T(""), L("");
197
+ }, P = n ? u[n] : void 0, { members: D } = X(
198
+ n || void 0,
199
+ s === "chat" && Z(P) && (C || v.trim() !== "")
200
+ ), A = I(() => {
201
+ if (!v.trim()) return [];
202
+ let r;
203
+ if (s === "chat") {
204
+ const H = n && u[n]?.members || [];
205
+ D.length > 0 ? r = ee([...H, ...D]) : r = H;
206
+ } else
207
+ r = Object.values(x || {});
208
+ return fe(r, v);
209
+ }, [v, s, u, n, x, D]), o = re(
210
+ y ? "" : d,
219
211
  s,
220
- R,
221
- U
212
+ F,
213
+ j
222
214
  );
223
- _(() => {
215
+ V(() => {
224
216
  p.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: q } = te(), _ = (r) => {
219
+ q(r) && k && l(ie(void 0));
220
+ }, R = I(() => o.items, [o.items]), B = 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
233
  ref: p,
242
234
  "data-autofocus": !0,
@@ -250,47 +242,47 @@ 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
+ Q,
256
248
  {
257
249
  type: "button",
258
250
  $active: s === "chat",
259
251
  "aria-pressed": s === "chat",
260
- disabled: !R,
261
- onClick: () => O("chat"),
252
+ disabled: !F,
253
+ onClick: () => $("chat"),
262
254
  children: e("search.messages.scopeChat")
263
255
  }
264
256
  ),
265
257
  /* @__PURE__ */ a(
266
- H,
258
+ Q,
267
259
  {
268
260
  type: "button",
269
261
  $active: s === "all",
270
262
  "aria-pressed": s === "all",
271
- onClick: () => O("all"),
263
+ onClick: () => $("all"),
272
264
  children: e("search.messages.scopeAll")
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: () => U((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(O, { 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 && A.length > 0 && /* @__PURE__ */ a(Se, { role: "listbox", children: A.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(O, { 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(O, { 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,
337
+ min: m || void 0,
346
338
  onChange: (r) => L(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: E, 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: B ? 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,
359
+ hits: R,
368
360
  query: B,
369
361
  showRoom: s === "all",
370
- onOpen: Q
362
+ onOpen: _
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 N, useCallback as P, useEffect as T, useMemo as z } from "react";
3
+ import { g as U, aU as E, p as _, a as q, aO as F, u as A, aw as H, x as c, a2 as J, q as G } from "./main-BnLtessp.js";
4
+ import { S as V, i as Z, j as K, f as S } from "./SideDrawer-CDAoobvX.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 = U.getState().chatSettingStore.user?.token || "", s = (await E.get("/v1/chats/public", {
12
12
  params: { limit: Math.min(t, I), offset: r },
13
13
  headers: { Authorization: x },
14
14
  signal: u
@@ -105,16 +105,16 @@ const W = c.ul`
105
105
  }) => {
106
106
  const t = _(), u = q(), x = F(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, O] = p(0), [v, $] = p(0), [n, w] = p("loading"), [h, D] = p(""), m = N(0), f = P(async (e) => {
109
109
  const o = ++m.current;
110
110
  w(e ? "loadingMore" : "loading");
111
111
  try {
112
112
  const g = await Q({ offset: e });
113
113
  if (o !== m.current) return;
114
114
  i((k) => {
115
- const R = new Set(k.map((C) => C.name));
116
- return e ? [...k, ...g.items.filter((C) => !R.has(C.name))] : g.items;
117
- }), $(g.total), D(g.nextOffset), w("done");
115
+ const B = new Set(k.map((C) => C.name));
116
+ return e ? [...k, ...g.items.filter((C) => !B.has(C.name))] : g.items;
117
+ }), O(g.total), $(g.nextOffset), w("done");
118
118
  } catch {
119
119
  o === m.current && w("error");
120
120
  }
@@ -122,7 +122,7 @@ const W = c.ul`
122
122
  T(() => (f(0), () => {
123
123
  m.current += 1;
124
124
  }), [f]);
125
- const O = z(
125
+ const L = z(
126
126
  () => new Set(Object.keys(b).map((e) => e.split("@")[0])),
127
127
  [b]
128
128
  ), y = z(() => {
@@ -130,7 +130,7 @@ 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]), R = (e) => {
134
134
  const o = (s || "").trim();
135
135
  o && (u(J({ roomJID: `${e.name}@${o}` })), x && u(G(void 0)));
136
136
  }, M = v < j;
@@ -148,7 +148,7 @@ const W = c.ul`
148
148
  {
149
149
  type: "search",
150
150
  value: h,
151
- onChange: (e) => L(e.target.value),
151
+ onChange: (e) => D(e.target.value),
152
152
  placeholder: t("publicChats.filter"),
153
153
  "aria-label": t("publicChats.filter")
154
154
  }
@@ -164,7 +164,7 @@ const W = c.ul`
164
164
  ] }),
165
165
  n !== "loading" && n !== "error" && y.length === 0 && /* @__PURE__ */ a(S, { children: h.trim() && M ? t("publicChats.emptyFilterMore") : t("publicChats.empty") }),
166
166
  y.length > 0 && /* @__PURE__ */ a(W, { children: y.map((e) => {
167
- const o = O.has(e.name);
167
+ const o = L.has(e.name);
168
168
  return /* @__PURE__ */ d(X, { children: [
169
169
  /* @__PURE__ */ a(Y, { $src: e.picture, "aria-hidden": "true", children: !e.picture && oe(e) }),
170
170
  /* @__PURE__ */ d(ee, { children: [
@@ -176,7 +176,7 @@ const W = c.ul`
176
176
  {
177
177
  type: "button",
178
178
  $open: o,
179
- onClick: () => N(e),
179
+ onClick: () => R(e),
180
180
  children: t(o ? "publicChats.open" : "publicChats.join")
181
181
  }
182
182
  )