@nivaro/react 0.3.24 → 0.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,40 @@
1
- import { jsxs as r, jsx as e, Fragment as C } from "react/jsx-runtime";
2
- import { Users as O, Link2 as j, ChevronLeft as D, Sparkles as R, Pin as B, X as E, FileText as G, ExternalLink as H } from "lucide-react";
3
- import { useState as g, useRef as Q, useEffect as V } from "react";
4
- import { useNivaroClient as Y } from "../../context.js";
5
- import { cn as m, formatFileSize as q, formatRelative as P } from "../../lib/utils.js";
6
- import { Popover as J, PopoverTrigger as X, PopoverContent as K } from "../ui/popover.js";
7
- import { openDmWith as Z, useChatThread as A, canOpenDm as ee } from "./chat-core.js";
8
- import { useRoomInfo as W, useRoomSummary as F, useRoomShared as te } from "./chat-hooks.js";
9
- function oe({
10
- room: d,
1
+ import { jsxs as r, jsx as e, Fragment as _ } from "react/jsx-runtime";
2
+ import { Users as P, Link2 as B, ChevronLeft as R, Sparkles as F, Pin as E, X as G, FileText as H, ExternalLink as Q } from "lucide-react";
3
+ import { useState as g, useRef as V, useEffect as Y } from "react";
4
+ import { useNivaroClient as q } from "../../context.js";
5
+ import { safeLinkKind as C } from "../../lib/safe-href.js";
6
+ import { cn as m, formatFileSize as J, formatRelative as D } from "../../lib/utils.js";
7
+ import { Popover as K, PopoverTrigger as X, PopoverContent as Z } from "../ui/popover.js";
8
+ import { openDmWith as A, useChatThread as ee, canOpenDm as te } from "./chat-core.js";
9
+ import { useRoomInfo as I, useRoomSummary as U, useRoomShared as ae } from "./chat-hooks.js";
10
+ function xe({
11
+ room: i,
11
12
  rootId: l,
12
- th: s,
13
- onClose: i,
13
+ th: n,
14
+ onClose: d,
14
15
  renderRow: o,
15
16
  renderComposer: x,
16
- renderOutbox: n
17
+ renderOutbox: s
17
18
  }) {
18
- const { root: u, replies: h, loading: y } = A(d, l), a = F(), [c, k] = g(null), b = Q(null);
19
- return V(() => {
19
+ const { root: u, replies: h, loading: y } = ee(i, l), a = U(), [c, k] = g(null), b = V(null);
20
+ return Y(() => {
20
21
  var p;
21
22
  (p = b.current) == null || p.scrollIntoView({ block: "end" });
22
23
  }, [h.length]), /* @__PURE__ */ r(
23
24
  "div",
24
25
  {
25
- className: m("absolute inset-0 z-20 flex min-h-0 flex-col", s.surface),
26
+ className: m("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
26
27
  "data-chat-thread": l,
27
28
  children: [
28
- /* @__PURE__ */ r("div", { className: m("flex shrink-0 items-center gap-2 border-b px-3 py-2", s.divider), children: [
29
+ /* @__PURE__ */ r("div", { className: m("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
29
30
  /* @__PURE__ */ e(
30
31
  "button",
31
32
  {
32
33
  type: "button",
33
- onClick: i,
34
+ onClick: d,
34
35
  className: "rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100",
35
36
  "aria-label": "Back to the conversation",
36
- children: /* @__PURE__ */ e(D, { className: "h-4 w-4", strokeWidth: 2 })
37
+ children: /* @__PURE__ */ e(R, { className: "h-4 w-4", strokeWidth: 2 })
37
38
  }
38
39
  ),
39
40
  /* @__PURE__ */ r("p", { className: "flex-1 text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
@@ -50,16 +51,16 @@ function oe({
50
51
  type: "button",
51
52
  disabled: a.isPending,
52
53
  onClick: () => a.mutate(
53
- { room: d, thread: l },
54
+ { room: i, thread: l },
54
55
  { onSuccess: (p) => k(p.summary ?? "Not enough to summarize yet.") }
55
56
  ),
56
57
  className: m(
57
58
  "flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium hover:bg-slate-100 disabled:opacity-50 dark:hover:bg-muted",
58
- s.accentText
59
+ n.accentText
59
60
  ),
60
61
  "data-chat-thread-summarize": !0,
61
62
  children: [
62
- /* @__PURE__ */ e(R, { className: "h-3.5 w-3.5" }),
63
+ /* @__PURE__ */ e(F, { className: "h-3.5 w-3.5" }),
63
64
  a.isPending ? "Summarizing…" : "Summarize"
64
65
  ]
65
66
  }
@@ -70,16 +71,16 @@ function oe({
70
71
  {
71
72
  className: m(
72
73
  "shrink-0 border-b px-3 py-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200",
73
- s.divider
74
+ n.divider
74
75
  ),
75
76
  children: c
76
77
  }
77
78
  ),
78
79
  /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 space-y-2.5 overflow-y-auto px-3 py-3", children: [
79
- y ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : /* @__PURE__ */ r(C, { children: [
80
- u && /* @__PURE__ */ e("div", { className: m("border-b pb-2.5", s.divider), children: o(u, { inThread: !0 }) }),
80
+ y ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : /* @__PURE__ */ r(_, { children: [
81
+ u && /* @__PURE__ */ e("div", { className: m("border-b pb-2.5", n.divider), children: o(u, { inThread: !0 }) }),
81
82
  h.map((p) => /* @__PURE__ */ e("div", { children: o(p, { inThread: !0 }) }, p.id)),
82
- n(l)
83
+ s(l)
83
84
  ] }),
84
85
  /* @__PURE__ */ e("div", { ref: b })
85
86
  ] }),
@@ -88,67 +89,67 @@ function oe({
88
89
  }
89
90
  );
90
91
  }
91
- function me({
92
- description: d,
92
+ function he({
93
+ description: i,
93
94
  links: l,
94
- th: s,
95
- navigate: i
95
+ th: n,
96
+ navigate: d
96
97
  }) {
97
98
  const [o, x] = g(!1);
98
- return !d && !(l != null && l.length) ? null : /* @__PURE__ */ r("div", { className: m("shrink-0 border-b px-3 py-1.5", s.divider), "data-chat-channel-intro": !0, children: [
99
+ return !i && !(l != null && l.length) ? null : /* @__PURE__ */ r("div", { className: m("shrink-0 border-b px-3 py-1.5", n.divider), "data-chat-channel-intro": !0, children: [
99
100
  /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
100
- d && /* @__PURE__ */ e(
101
+ i && /* @__PURE__ */ e(
101
102
  "p",
102
103
  {
103
104
  className: m(
104
105
  "min-w-0 flex-1 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300",
105
106
  !o && "line-clamp-1"
106
107
  ),
107
- children: d
108
+ children: i
108
109
  }
109
110
  ),
110
- d && d.length > 80 && /* @__PURE__ */ e(
111
+ i && i.length > 80 && /* @__PURE__ */ e(
111
112
  "button",
112
113
  {
113
114
  type: "button",
114
- onClick: () => x((n) => !n),
115
+ onClick: () => x((s) => !s),
115
116
  className: "shrink-0 text-[11px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
116
117
  children: o ? "Less" : "More"
117
118
  }
118
119
  )
119
120
  ] }),
120
- !!(l != null && l.length) && /* @__PURE__ */ e("div", { className: "mt-1 flex flex-wrap gap-1.5", children: l.map((n) => /* @__PURE__ */ r(
121
+ !!(l != null && l.length) && /* @__PURE__ */ e("div", { className: "mt-1 flex flex-wrap gap-1.5", children: l.filter((s) => C(s.url) !== null).map((s) => /* @__PURE__ */ r(
121
122
  "a",
122
123
  {
123
- href: n.url,
124
- target: n.url.startsWith("/") ? void 0 : "_blank",
124
+ href: s.url,
125
+ target: C(s.url) === "internal" ? void 0 : "_blank",
125
126
  rel: "noopener noreferrer",
126
127
  onClick: (u) => {
127
- n.url.startsWith("/") && i && (u.preventDefault(), i(n.url));
128
+ C(s.url) === "internal" && d && (u.preventDefault(), d(s.url));
128
129
  },
129
130
  className: "inline-flex max-w-[200px] items-center gap-1 rounded-full border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-700 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-200",
130
131
  "data-chat-channel-link": !0,
131
132
  children: [
132
- /* @__PURE__ */ e(j, { className: "h-3 w-3 shrink-0 opacity-60" }),
133
- /* @__PURE__ */ e("span", { className: "truncate", children: n.label })
133
+ /* @__PURE__ */ e(B, { className: "h-3 w-3 shrink-0 opacity-60" }),
134
+ /* @__PURE__ */ e("span", { className: "truncate", children: s.label })
134
135
  ]
135
136
  },
136
- n.url
137
+ s.url
137
138
  )) })
138
139
  ] });
139
140
  }
140
- function xe({
141
- note: d,
141
+ function pe({
142
+ note: i,
142
143
  channelName: l,
143
- onDismiss: s,
144
- th: i
144
+ onDismiss: n,
145
+ th: d
145
146
  }) {
146
147
  return /* @__PURE__ */ e(
147
148
  "div",
148
149
  {
149
150
  className: m(
150
151
  "mx-3 mt-3 rounded-xl border px-3 py-2.5",
151
- i.divider,
152
+ d.divider,
152
153
  "bg-slate-50 dark:bg-muted/40"
153
154
  ),
154
155
  "data-chat-welcome": !0,
@@ -158,13 +159,13 @@ function xe({
158
159
  "Welcome to ",
159
160
  l
160
161
  ] }),
161
- /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: d })
162
+ /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: i })
162
163
  ] }),
163
164
  /* @__PURE__ */ e(
164
165
  "button",
165
166
  {
166
167
  type: "button",
167
- onClick: s,
168
+ onClick: n,
168
169
  className: "shrink-0 rounded-md px-2 py-1 text-[11px] font-medium text-slate-600 hover:bg-white dark:text-slate-300 dark:hover:bg-card",
169
170
  "data-chat-welcome-dismiss": !0,
170
171
  children: "Got it"
@@ -174,20 +175,20 @@ function xe({
174
175
  }
175
176
  );
176
177
  }
177
- function he({
178
- onJump: d,
178
+ function ue({
179
+ onJump: i,
179
180
  onDone: l
180
181
  }) {
181
- const [s, i] = g("");
182
- return /* @__PURE__ */ r(C, { children: [
182
+ const [n, d] = g("");
183
+ return /* @__PURE__ */ r(_, { children: [
183
184
  /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: "Jump to a date" }),
184
185
  /* @__PURE__ */ e(
185
186
  "input",
186
187
  {
187
188
  type: "date",
188
- value: s,
189
+ value: n,
189
190
  max: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
190
- onChange: (o) => i(o.target.value),
191
+ onChange: (o) => d(o.target.value),
191
192
  className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-[12px] outline-none dark:border-border dark:bg-background dark:text-slate-100",
192
193
  "aria-label": "Date"
193
194
  }
@@ -201,8 +202,8 @@ function he({
201
202
  {
202
203
  type: "button",
203
204
  onClick: () => {
204
- const n = new Date(Date.now() - x * 864e5);
205
- n.setHours(0, 0, 0, 0), d(n.toISOString()), l == null || l();
205
+ const s = new Date(Date.now() - x * 864e5);
206
+ s.setHours(0, 0, 0, 0), i(s.toISOString()), l == null || l();
206
207
  },
207
208
  className: "flex-1 rounded-md border border-slate-200 px-1 py-1 text-[10.5px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
208
209
  children: o
@@ -213,10 +214,10 @@ function he({
213
214
  "button",
214
215
  {
215
216
  type: "button",
216
- disabled: !s,
217
+ disabled: !n,
217
218
  onClick: () => {
218
- const [o, x, n] = s.split("-").map(Number);
219
- d(new Date(o, x - 1, n).toISOString()), l == null || l();
219
+ const [o, x, s] = n.split("-").map(Number);
220
+ i(new Date(o, x - 1, s).toISOString()), l == null || l();
220
221
  },
221
222
  className: "mt-2 h-8 w-full rounded-md bg-nvr-cyan text-[12px] font-medium text-white disabled:opacity-40",
222
223
  children: "Go"
@@ -224,30 +225,30 @@ function he({
224
225
  )
225
226
  ] });
226
227
  }
227
- function pe({
228
- room: d,
228
+ function be({
229
+ room: i,
229
230
  label: l,
230
- th: s,
231
- pins: i,
231
+ th: n,
232
+ pins: d,
232
233
  onClose: o,
233
234
  onOpenMessage: x,
234
- renderAvatar: n,
235
+ renderAvatar: s,
235
236
  onUnpin: u,
236
237
  navigate: h
237
238
  }) {
238
- const y = Y(), a = W(d), [c, k] = g("members"), b = te(d, c === "files" || c === "links"), [p, I] = g(""), w = p.trim().toLowerCase(), _ = w ? b.files.filter((t) => `${t.name} ${t.sender_name ?? ""}`.toLowerCase().includes(w)) : b.files, $ = w ? b.links.filter((t) => `${t.url} ${t.sender_name ?? ""}`.toLowerCase().includes(w)) : b.links, v = F(), [S, U] = g(""), [L, z] = g(null), M = [
239
+ const y = q(), a = I(i), [c, k] = g("members"), b = ae(i, c === "files" || c === "links"), [p, M] = g(""), w = p.trim().toLowerCase(), $ = w ? b.files.filter((t) => `${t.name} ${t.sender_name ?? ""}`.toLowerCase().includes(w)) : b.files, L = w ? b.links.filter((t) => `${t.url} ${t.sender_name ?? ""}`.toLowerCase().includes(w)) : b.links, v = U(), [S, W] = g(""), [z, T] = g(null), j = [
239
240
  ["members", `Members${a ? ` · ${a.member_count}` : ""}`],
240
- ["pinned", `Pinned${i.length ? ` · ${i.length}` : ""}`],
241
+ ["pinned", `Pinned${d.length ? ` · ${d.length}` : ""}`],
241
242
  ["files", `Files${a != null && a.file_count ? ` · ${a.file_count}` : ""}`],
242
243
  ["links", "Links"]
243
244
  ];
244
245
  return /* @__PURE__ */ r(
245
246
  "div",
246
247
  {
247
- className: m("absolute inset-0 z-20 flex min-h-0 flex-col", s.surface),
248
+ className: m("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
248
249
  "data-chat-room-info": !0,
249
250
  children: [
250
- /* @__PURE__ */ r("div", { className: m("flex shrink-0 items-center gap-2 border-b px-3 py-2", s.divider), children: [
251
+ /* @__PURE__ */ r("div", { className: m("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
251
252
  /* @__PURE__ */ e(
252
253
  "button",
253
254
  {
@@ -255,7 +256,7 @@ function pe({
255
256
  onClick: o,
256
257
  className: "rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100",
257
258
  "aria-label": "Back to the conversation",
258
- children: /* @__PURE__ */ e(D, { className: "h-4 w-4", strokeWidth: 2 })
259
+ children: /* @__PURE__ */ e(R, { className: "h-4 w-4", strokeWidth: 2 })
259
260
  }
260
261
  ),
261
262
  /* @__PURE__ */ e("p", { className: "min-w-0 flex-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: l })
@@ -266,7 +267,7 @@ function pe({
266
267
  {
267
268
  className: m(
268
269
  "grid grid-cols-2 gap-x-3 gap-y-2 border-b px-3 py-3 text-[11.5px]",
269
- s.divider
270
+ n.divider
270
271
  ),
271
272
  children: [
272
273
  /* @__PURE__ */ r("div", { children: [
@@ -291,7 +292,7 @@ function pe({
291
292
  ]
292
293
  }
293
294
  ),
294
- /* @__PURE__ */ r("div", { className: m("border-b px-3 py-2.5", s.divider), "data-chat-summarize-range": !0, children: [
295
+ /* @__PURE__ */ r("div", { className: m("border-b px-3 py-2.5", n.divider), "data-chat-summarize-range": !0, children: [
295
296
  /* @__PURE__ */ e("p", { className: "text-[11.5px] font-semibold text-slate-700 dark:text-slate-200", children: "Summarize" }),
296
297
  /* @__PURE__ */ r("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: [
297
298
  [
@@ -304,11 +305,11 @@ function pe({
304
305
  disabled: v.isPending,
305
306
  onClick: () => v.mutate(
306
307
  {
307
- room: d,
308
+ room: i,
308
309
  since: new Date(Date.now() - N * 864e5).toISOString()
309
310
  },
310
311
  {
311
- onSuccess: (f) => z(
312
+ onSuccess: (f) => T(
312
313
  f.summary ?? `Only ${f.count} messages — nothing to summarize.`
313
314
  )
314
315
  }
@@ -323,7 +324,7 @@ function pe({
323
324
  {
324
325
  type: "date",
325
326
  value: S,
326
- onChange: (t) => U(t.target.value),
327
+ onChange: (t) => W(t.target.value),
327
328
  className: "h-6 rounded-md border border-slate-200 bg-white px-1.5 text-[11px] outline-none dark:border-border dark:bg-background dark:text-slate-100",
328
329
  "aria-label": "Summarize since"
329
330
  }
@@ -336,29 +337,29 @@ function pe({
336
337
  onClick: () => {
337
338
  const [t, N, f] = S.split("-").map(Number);
338
339
  v.mutate(
339
- { room: d, since: new Date(t, N - 1, f).toISOString() },
340
+ { room: i, since: new Date(t, N - 1, f).toISOString() },
340
341
  {
341
- onSuccess: (T) => z(
342
- T.summary ?? `Only ${T.count} messages — nothing to summarize.`
342
+ onSuccess: (O) => T(
343
+ O.summary ?? `Only ${O.count} messages — nothing to summarize.`
343
344
  )
344
345
  }
345
346
  );
346
347
  },
347
348
  className: m(
348
349
  "inline-flex items-center gap-1 text-[11px] font-medium disabled:opacity-40",
349
- s.accentText
350
+ n.accentText
350
351
  ),
351
352
  children: [
352
- /* @__PURE__ */ e(R, { className: "h-3 w-3" }),
353
+ /* @__PURE__ */ e(F, { className: "h-3 w-3" }),
353
354
  " ",
354
355
  v.isPending ? "Summarizing…" : "Since then"
355
356
  ]
356
357
  }
357
358
  )
358
359
  ] }),
359
- L && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200", children: L })
360
+ z && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200", children: z })
360
361
  ] }),
361
- /* @__PURE__ */ e("div", { className: m("flex gap-1 border-b px-2 pt-1.5", s.divider), role: "tablist", children: M.map(([t, N]) => /* @__PURE__ */ e(
362
+ /* @__PURE__ */ e("div", { className: m("flex gap-1 border-b px-2 pt-1.5", n.divider), role: "tablist", children: j.map(([t, N]) => /* @__PURE__ */ e(
362
363
  "button",
363
364
  {
364
365
  type: "button",
@@ -376,15 +377,15 @@ function pe({
376
377
  )) }),
377
378
  /* @__PURE__ */ r("div", { className: "px-3 py-2", children: [
378
379
  c === "members" && (a != null && a.members.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: a.members.map((t) => /* @__PURE__ */ r("li", { className: "flex items-center gap-2 py-0.5", children: [
379
- n(t.id, t.name),
380
+ s(t.id, t.name),
380
381
  /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
381
382
  /* @__PURE__ */ e("span", { className: "block truncate text-[12px] text-slate-800 dark:text-slate-100", children: t.name }),
382
383
  t.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500", children: t.title })
383
384
  ] }),
384
385
  t.online && /* @__PURE__ */ e("span", { className: "text-[10.5px] text-emerald-700 dark:text-emerald-400", children: "Online" })
385
386
  ] }, t.id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: a ? "Anyone who can open this room can read it." : "Loading…" })),
386
- c === "pinned" && (i.length ? /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: i.map((t) => /* @__PURE__ */ r("li", { className: "flex items-start gap-1.5 text-[11.5px]", children: [
387
- /* @__PURE__ */ e(B, { className: "mt-0.5 h-3 w-3 shrink-0 text-slate-400" }),
387
+ c === "pinned" && (d.length ? /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: d.map((t) => /* @__PURE__ */ r("li", { className: "flex items-start gap-1.5 text-[11.5px]", children: [
388
+ /* @__PURE__ */ e(E, { className: "mt-0.5 h-3 w-3 shrink-0 text-slate-400" }),
388
389
  /* @__PURE__ */ r(
389
390
  "button",
390
391
  {
@@ -407,7 +408,7 @@ function pe({
407
408
  onClick: () => u(t.id),
408
409
  className: "shrink-0 text-slate-400 hover:text-red-500",
409
410
  "aria-label": "Unpin",
410
- children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
411
+ children: /* @__PURE__ */ e(G, { className: "h-3 w-3" })
411
412
  }
412
413
  )
413
414
  ] }, t.pin_id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Nothing pinned. Hover a message and use the pin to keep it here." })),
@@ -415,19 +416,19 @@ function pe({
415
416
  "input",
416
417
  {
417
418
  value: p,
418
- onChange: (t) => I(t.target.value),
419
+ onChange: (t) => M(t.target.value),
419
420
  placeholder: c === "files" ? "Search files or people" : "Search links or people",
420
421
  "aria-label": "Search shared items",
421
422
  "data-chat-shared-search": !0,
422
423
  className: "mb-2 h-7 w-full rounded-md border border-slate-200 bg-transparent px-2 text-[11.5px] outline-none focus:border-slate-400 dark:border-slate-700"
423
424
  }
424
425
  ),
425
- c === "files" && (b.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : _.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: _.map((t) => /* @__PURE__ */ r(
426
+ c === "files" && (b.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : $.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: $.map((t) => /* @__PURE__ */ r(
426
427
  "li",
427
428
  {
428
429
  className: "flex items-center gap-2 text-[11.5px]",
429
430
  children: [
430
- /* @__PURE__ */ e(G, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
431
+ /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
431
432
  /* @__PURE__ */ e(
432
433
  "a",
433
434
  {
@@ -440,8 +441,8 @@ function pe({
440
441
  ),
441
442
  /* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
442
443
  t.sender_name ? `${t.sender_name} · ` : "",
443
- t.size != null ? `${q(t.size)} · ` : "",
444
- P(t.date_created)
444
+ t.size != null ? `${J(t.size)} · ` : "",
445
+ D(t.date_created)
445
446
  ] }),
446
447
  /* @__PURE__ */ e(
447
448
  "button",
@@ -456,12 +457,12 @@ function pe({
456
457
  },
457
458
  `${t.message_id}:${t.file_id}`
458
459
  )) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "No files shared here yet." })),
459
- c === "links" && (b.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : $.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: $.map((t) => /* @__PURE__ */ r(
460
+ c === "links" && (b.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : L.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: L.map((t) => /* @__PURE__ */ r(
460
461
  "li",
461
462
  {
462
463
  className: "flex items-center gap-2 text-[11.5px]",
463
464
  children: [
464
- /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
465
+ /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
465
466
  /* @__PURE__ */ e(
466
467
  "a",
467
468
  {
@@ -481,7 +482,7 @@ function pe({
481
482
  ),
482
483
  /* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
483
484
  t.sender_name ?? "",
484
- t.date_created ? ` · ${P(t.date_created)}` : ""
485
+ t.date_created ? ` · ${D(t.date_created)}` : ""
485
486
  ] }),
486
487
  /* @__PURE__ */ e(
487
488
  "button",
@@ -502,47 +503,47 @@ function pe({
502
503
  }
503
504
  );
504
505
  }
505
- function ue({
506
- room: d,
506
+ function fe({
507
+ room: i,
507
508
  renderAvatar: l,
508
- me: s
509
+ me: n
509
510
  }) {
510
- const i = W(d), [o, x] = g(!1);
511
- if (!i) return null;
512
- const n = `${i.member_count} ${i.member_count === 1 ? "member" : "members"} · ${i.online_count} online`;
513
- if (!i.members.length)
511
+ const d = I(i), [o, x] = g(!1);
512
+ if (!d) return null;
513
+ const s = `${d.member_count} ${d.member_count === 1 ? "member" : "members"} · ${d.online_count} online`;
514
+ if (!d.members.length)
514
515
  return /* @__PURE__ */ r(
515
516
  "p",
516
517
  {
517
518
  className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
518
519
  "data-chat-member-count": !0,
519
520
  children: [
520
- /* @__PURE__ */ e(O, { className: "h-3 w-3" }),
521
- n
521
+ /* @__PURE__ */ e(P, { className: "h-3 w-3" }),
522
+ s
522
523
  ]
523
524
  }
524
525
  );
525
- const u = s ? s.toUpperCase() : null, h = [...i.members].sort(
526
+ const u = n ? n.toUpperCase() : null, h = [...d.members].sort(
526
527
  (a, c) => Number(c.online) - Number(a.online) || a.name.localeCompare(c.name)
527
- ), y = ee();
528
- return /* @__PURE__ */ r(J, { open: o, onOpenChange: x, children: [
528
+ ), y = te();
529
+ return /* @__PURE__ */ r(K, { open: o, onOpenChange: x, children: [
529
530
  /* @__PURE__ */ e(X, { asChild: !0, children: /* @__PURE__ */ r(
530
531
  "button",
531
532
  {
532
533
  type: "button",
533
534
  className: "flex max-w-full items-center gap-1 truncate rounded text-[11px] text-slate-500 underline-offset-2 hover:text-slate-800 hover:underline dark:text-slate-400 dark:hover:text-slate-100",
534
- "aria-label": `${n} — show members`,
535
+ "aria-label": `${s} — show members`,
535
536
  "data-chat-member-count": !0,
536
537
  children: [
537
- /* @__PURE__ */ e(O, { className: "h-3 w-3 shrink-0" }),
538
- /* @__PURE__ */ e("span", { className: "truncate", children: n })
538
+ /* @__PURE__ */ e(P, { className: "h-3 w-3 shrink-0" }),
539
+ /* @__PURE__ */ e("span", { className: "truncate", children: s })
539
540
  ]
540
541
  }
541
542
  ) }),
542
- /* @__PURE__ */ r(K, { align: "start", className: "w-[260px] p-0", "data-chat-member-popover": !0, children: [
543
- /* @__PURE__ */ e("p", { className: "border-b border-slate-100 px-3 py-2 text-[11.5px] font-semibold text-slate-800 dark:border-border dark:text-slate-100", children: n }),
543
+ /* @__PURE__ */ r(Z, { align: "start", className: "w-[260px] p-0", "data-chat-member-popover": !0, children: [
544
+ /* @__PURE__ */ e("p", { className: "border-b border-slate-100 px-3 py-2 text-[11.5px] font-semibold text-slate-800 dark:border-border dark:text-slate-100", children: s }),
544
545
  /* @__PURE__ */ e("ul", { className: "max-h-[320px] overflow-y-auto p-1", children: h.map((a) => {
545
- const c = !!u && a.id.toUpperCase() === u, k = /* @__PURE__ */ r(C, { children: [
546
+ const c = !!u && a.id.toUpperCase() === u, k = /* @__PURE__ */ r(_, { children: [
546
547
  l == null ? void 0 : l(a.id, a.name),
547
548
  /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
548
549
  /* @__PURE__ */ r("span", { className: "block truncate text-[12px] text-slate-800 dark:text-slate-100", children: [
@@ -567,7 +568,7 @@ function ue({
567
568
  {
568
569
  type: "button",
569
570
  onClick: () => {
570
- x(!1), Z(a.id, a.name);
571
+ x(!1), A(a.id, a.name);
571
572
  },
572
573
  title: `Message ${a.name}`,
573
574
  className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-muted",
@@ -579,10 +580,10 @@ function ue({
579
580
  ] });
580
581
  }
581
582
  export {
582
- me as ChannelIntro,
583
- he as JumpToDateForm,
584
- ue as MemberCountLine,
585
- pe as RoomInfoDrawer,
586
- oe as ThreadPane,
587
- xe as WelcomeNote
583
+ he as ChannelIntro,
584
+ ue as JumpToDateForm,
585
+ fe as MemberCountLine,
586
+ be as RoomInfoDrawer,
587
+ xe as ThreadPane,
588
+ pe as WelcomeNote
588
589
  };