@nivaro/react 0.3.67 → 0.3.69

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 (32) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +836 -835
  5. package/dist/shared/components/ConformanceView.js +34 -34
  6. package/dist/shared/components/ReportView.js +196 -196
  7. package/dist/shared/components/SlaRulesView.js +36 -36
  8. package/dist/shared/components/chat/ChatPanel.js +484 -487
  9. package/dist/shared/components/chat/ChatViews.js +66 -66
  10. package/dist/shared/components/chat/RoomParts.js +159 -157
  11. package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
  12. package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
  13. package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
  14. package/dist/shared/components/item-edit/FieldRenderer.js +186 -182
  15. package/dist/shared/components/item-edit/FieldRow.js +87 -87
  16. package/dist/shared/components/item-edit/FileDownloadCount.js +94 -0
  17. package/dist/shared/components/item-edit/FilePickerField.js +350 -349
  18. package/dist/shared/components/item-edit/RecordInsights.js +90 -91
  19. package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
  20. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
  21. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +175 -138
  22. package/dist/shared/components/layout-editor/inspector/RulesTab.js +53 -52
  23. package/dist/shared/components/panels/AddendumPanel.js +409 -411
  24. package/dist/shared/components/panels/CommentPanel.js +169 -162
  25. package/dist/shared/components/panels/PipelinePanel.js +75 -75
  26. package/dist/shared/components/panels/RevisionsPanel.js +103 -103
  27. package/dist/shared/components/queue/QueueWorklist.js +142 -141
  28. package/dist/shared/lib/activity-sentence.js +154 -144
  29. package/dist/shared/lib/format-value.js +15 -15
  30. package/dist/shared/lib/placement-behaviour.js +39 -31
  31. package/dist/shared/lib/utils.js +58 -53
  32. package/package.json +1 -1
@@ -1,110 +1,111 @@
1
1
  import { jsxs as r, jsx as e, Fragment as $ } from "react/jsx-runtime";
2
- import { Users as U, Link2 as J, ChevronLeft as Q, Sparkles as W, Pin as K, X, FileText as Z, ExternalLink as A } from "lucide-react";
3
- import { useState as f, useRef as ee, useEffect as te } from "react";
4
- import { useNivaroClient as ae } from "../../context.js";
2
+ import { Users as I, Link2 as K, ChevronLeft as W, Sparkles as B, Pin as X, X as Z, FileText as A, ExternalLink as ee } from "lucide-react";
3
+ import { useState as f, useRef as te, useEffect as ae } from "react";
4
+ import { useNivaroClient as re } from "../../context.js";
5
5
  import { safeLinkKind as T } from "../../lib/safe-href.js";
6
- import { cn as m, formatFileSize as re, formatRelative as F } from "../../lib/utils.js";
7
- import { Popover as le, PopoverTrigger as se, PopoverContent as ne } from "../ui/popover.js";
8
- import { openDmWith as de, useChatThread as ie, useDebouncedMemberQuery as ce, usePagedMembers as oe, canOpenDm as me } from "./chat-core.js";
9
- import { useRoomInfo as B, useRoomSummary as j, useRoomShared as xe } from "./chat-hooks.js";
10
- import { MemberSearchBox as he, memberCountLabel as pe, MemberOnlineDot as ue, MemberLoadMore as be } from "./MemberPaging.js";
11
- function $e({
6
+ import { cn as x, formatFileSize as le, formatRelative as Q } from "../../lib/utils.js";
7
+ import { useFileDownload as se } from "../item-edit/file-download.js";
8
+ import { Popover as ne, PopoverTrigger as de, PopoverContent as ie } from "../ui/popover.js";
9
+ import { openDmWith as oe, useChatThread as ce, useDebouncedMemberQuery as me, usePagedMembers as xe, canOpenDm as he } from "./chat-core.js";
10
+ import { useRoomInfo as j, useRoomSummary as q, useRoomShared as pe } from "./chat-hooks.js";
11
+ import { MemberSearchBox as ue, memberCountLabel as be, MemberOnlineDot as fe, MemberLoadMore as ge } from "./MemberPaging.js";
12
+ function ze({
12
13
  room: d,
13
14
  rootId: l,
14
15
  th: n,
15
- onClose: c,
16
- renderRow: o,
17
- renderComposer: x,
16
+ onClose: o,
17
+ renderRow: m,
18
+ renderComposer: h,
18
19
  renderOutbox: s
19
20
  }) {
20
- const { root: u, replies: h, loading: v } = ie(d, l), a = j(), [i, k] = f(null), b = ee(null);
21
- return te(() => {
21
+ const { root: b, replies: u, loading: k } = ce(d, l), i = q(), [a, c] = f(null), C = te(null);
22
+ return ae(() => {
22
23
  var p;
23
- (p = b.current) == null || p.scrollIntoView({ block: "end" });
24
- }, [h.length]), /* @__PURE__ */ r(
24
+ (p = C.current) == null || p.scrollIntoView({ block: "end" });
25
+ }, [u.length]), /* @__PURE__ */ r(
25
26
  "div",
26
27
  {
27
- className: m("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
28
+ className: x("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
28
29
  "data-chat-thread": l,
29
30
  children: [
30
- /* @__PURE__ */ r("div", { className: m("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
31
+ /* @__PURE__ */ r("div", { className: x("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
31
32
  /* @__PURE__ */ e(
32
33
  "button",
33
34
  {
34
35
  type: "button",
35
- onClick: c,
36
+ onClick: o,
36
37
  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",
37
38
  "aria-label": "Back to the conversation",
38
- children: /* @__PURE__ */ e(Q, { className: "h-4 w-4", strokeWidth: 2 })
39
+ children: /* @__PURE__ */ e(W, { className: "h-4 w-4", strokeWidth: 2 })
39
40
  }
40
41
  ),
41
42
  /* @__PURE__ */ r("p", { className: "flex-1 text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
42
43
  "Thread",
43
44
  /* @__PURE__ */ r("span", { className: "ml-1.5 text-[11px] font-normal text-slate-500 dark:text-slate-400", children: [
44
- h.length,
45
+ u.length,
45
46
  " ",
46
- h.length === 1 ? "reply" : "replies"
47
+ u.length === 1 ? "reply" : "replies"
47
48
  ] })
48
49
  ] }),
49
- h.length >= 2 && /* @__PURE__ */ r(
50
+ u.length >= 2 && /* @__PURE__ */ r(
50
51
  "button",
51
52
  {
52
53
  type: "button",
53
- disabled: a.isPending,
54
- onClick: () => a.mutate(
54
+ disabled: i.isPending,
55
+ onClick: () => i.mutate(
55
56
  { room: d, thread: l },
56
- { onSuccess: (p) => k(p.summary ?? "Not enough to summarize yet.") }
57
+ { onSuccess: (p) => c(p.summary ?? "Not enough to summarize yet.") }
57
58
  ),
58
- className: m(
59
+ className: x(
59
60
  "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",
60
61
  n.accentText
61
62
  ),
62
63
  "data-chat-thread-summarize": !0,
63
64
  children: [
64
- /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
65
- a.isPending ? "Summarizing…" : "Summarize"
65
+ /* @__PURE__ */ e(B, { className: "h-3.5 w-3.5" }),
66
+ i.isPending ? "Summarizing…" : "Summarize"
66
67
  ]
67
68
  }
68
69
  )
69
70
  ] }),
70
- i && /* @__PURE__ */ e(
71
+ a && /* @__PURE__ */ e(
71
72
  "div",
72
73
  {
73
- className: m(
74
+ className: x(
74
75
  "shrink-0 border-b px-3 py-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200",
75
76
  n.divider
76
77
  ),
77
- children: i
78
+ children: a
78
79
  }
79
80
  ),
80
81
  /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 space-y-2.5 overflow-y-auto px-3 py-3", children: [
81
- v ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : /* @__PURE__ */ r($, { children: [
82
- u && /* @__PURE__ */ e("div", { className: m("border-b pb-2.5", n.divider), children: o(u, { inThread: !0 }) }),
83
- h.map((p) => /* @__PURE__ */ e("div", { children: o(p, { inThread: !0 }) }, p.id)),
82
+ k ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : /* @__PURE__ */ r($, { children: [
83
+ b && /* @__PURE__ */ e("div", { className: x("border-b pb-2.5", n.divider), children: m(b, { inThread: !0 }) }),
84
+ u.map((p) => /* @__PURE__ */ e("div", { children: m(p, { inThread: !0 }) }, p.id)),
84
85
  s(l)
85
86
  ] }),
86
- /* @__PURE__ */ e("div", { ref: b })
87
+ /* @__PURE__ */ e("div", { ref: C })
87
88
  ] }),
88
- x(l)
89
+ h(l)
89
90
  ]
90
91
  }
91
92
  );
92
93
  }
93
- function Le({
94
+ function Te({
94
95
  description: d,
95
96
  links: l,
96
97
  th: n,
97
- navigate: c
98
+ navigate: o
98
99
  }) {
99
- const [o, x] = f(!1);
100
- return !d && !(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: [
100
+ const [m, h] = f(!1);
101
+ return !d && !(l != null && l.length) ? null : /* @__PURE__ */ r("div", { className: x("shrink-0 border-b px-3 py-1.5", n.divider), "data-chat-channel-intro": !0, children: [
101
102
  /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
102
103
  d && /* @__PURE__ */ e(
103
104
  "p",
104
105
  {
105
- className: m(
106
+ className: x(
106
107
  "min-w-0 flex-1 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300",
107
- !o && "line-clamp-1"
108
+ !m && "line-clamp-1"
108
109
  ),
109
110
  children: d
110
111
  }
@@ -113,9 +114,9 @@ function Le({
113
114
  "button",
114
115
  {
115
116
  type: "button",
116
- onClick: () => x((s) => !s),
117
+ onClick: () => h((s) => !s),
117
118
  className: "shrink-0 text-[11px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
118
- children: o ? "Less" : "More"
119
+ children: m ? "Less" : "More"
119
120
  }
120
121
  )
121
122
  ] }),
@@ -125,13 +126,13 @@ function Le({
125
126
  href: s.url,
126
127
  target: T(s.url) === "internal" ? void 0 : "_blank",
127
128
  rel: "noopener noreferrer",
128
- onClick: (u) => {
129
- T(s.url) === "internal" && c && (u.preventDefault(), c(s.url));
129
+ onClick: (b) => {
130
+ T(s.url) === "internal" && o && (b.preventDefault(), o(s.url));
130
131
  },
131
132
  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",
132
133
  "data-chat-channel-link": !0,
133
134
  children: [
134
- /* @__PURE__ */ e(J, { className: "h-3 w-3 shrink-0 opacity-60" }),
135
+ /* @__PURE__ */ e(K, { className: "h-3 w-3 shrink-0 opacity-60" }),
135
136
  /* @__PURE__ */ e("span", { className: "truncate", children: s.label })
136
137
  ]
137
138
  },
@@ -139,18 +140,18 @@ function Le({
139
140
  )) })
140
141
  ] });
141
142
  }
142
- function Me({
143
+ function Oe({
143
144
  note: d,
144
145
  channelName: l,
145
146
  onDismiss: n,
146
- th: c
147
+ th: o
147
148
  }) {
148
149
  return /* @__PURE__ */ e(
149
150
  "div",
150
151
  {
151
- className: m(
152
+ className: x(
152
153
  "mx-3 mt-3 rounded-xl border px-3 py-2.5",
153
- c.divider,
154
+ o.divider,
154
155
  "bg-slate-50 dark:bg-muted/40"
155
156
  ),
156
157
  "data-chat-welcome": !0,
@@ -176,11 +177,11 @@ function Me({
176
177
  }
177
178
  );
178
179
  }
179
- function ze({
180
+ function De({
180
181
  onJump: d,
181
182
  onDone: l
182
183
  }) {
183
- const [n, c] = f("");
184
+ const [n, o] = f("");
184
185
  return /* @__PURE__ */ r($, { children: [
185
186
  /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: "Jump to a date" }),
186
187
  /* @__PURE__ */ e(
@@ -189,7 +190,7 @@ function ze({
189
190
  type: "date",
190
191
  value: n,
191
192
  max: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
192
- onChange: (o) => c(o.target.value),
193
+ onChange: (m) => o(m.target.value),
193
194
  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",
194
195
  "aria-label": "Date"
195
196
  }
@@ -198,18 +199,18 @@ function ze({
198
199
  ["Yesterday", 1],
199
200
  ["Last week", 7],
200
201
  ["Last month", 30]
201
- ].map(([o, x]) => /* @__PURE__ */ e(
202
+ ].map(([m, h]) => /* @__PURE__ */ e(
202
203
  "button",
203
204
  {
204
205
  type: "button",
205
206
  onClick: () => {
206
- const s = new Date(Date.now() - x * 864e5);
207
+ const s = new Date(Date.now() - h * 864e5);
207
208
  s.setHours(0, 0, 0, 0), d(s.toISOString()), l == null || l();
208
209
  },
209
210
  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",
210
- children: o
211
+ children: m
211
212
  },
212
- o
213
+ m
213
214
  )) }),
214
215
  /* @__PURE__ */ e(
215
216
  "button",
@@ -217,8 +218,8 @@ function ze({
217
218
  type: "button",
218
219
  disabled: !n,
219
220
  onClick: () => {
220
- const [o, x, s] = n.split("-").map(Number);
221
- d(new Date(o, x - 1, s).toISOString()), l == null || l();
221
+ const [m, h, s] = n.split("-").map(Number);
222
+ d(new Date(m, h - 1, s).toISOString()), l == null || l();
222
223
  },
223
224
  className: "mt-2 h-8 w-full rounded-md bg-nvr-cyan text-[12px] font-medium text-white disabled:opacity-40",
224
225
  children: "Go"
@@ -226,43 +227,43 @@ function ze({
226
227
  )
227
228
  ] });
228
229
  }
229
- function Te({
230
+ function Pe({
230
231
  room: d,
231
232
  label: l,
232
233
  th: n,
233
- pins: c,
234
- onClose: o,
235
- onOpenMessage: x,
234
+ pins: o,
235
+ onClose: m,
236
+ onOpenMessage: h,
236
237
  renderAvatar: s,
237
- onUnpin: u,
238
- navigate: h
238
+ onUnpin: b,
239
+ navigate: u
239
240
  }) {
240
- const v = ae(), a = B(d), [i, k] = f("members"), b = xe(d, i === "files" || i === "links"), [p, q] = f(""), S = p.trim().toLowerCase(), O = S ? b.files.filter((t) => `${t.name} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : b.files, P = S ? b.links.filter((t) => `${t.url} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : b.links, [L, E] = f(""), G = ce(L, 250), _ = L.trim().toLowerCase(), w = !!a && a.members.length >= a.member_count, y = oe(
241
+ const k = re(), i = se(), a = j(d), [c, C] = f("members"), p = pe(d, c === "files" || c === "links"), [O, E] = f(""), S = O.trim().toLowerCase(), D = S ? p.files.filter((t) => `${t.name} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : p.files, P = S ? p.links.filter((t) => `${t.url} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : p.links, [L, G] = f(""), H = me(L, 250), _ = L.trim().toLowerCase(), v = !!a && a.members.length >= a.member_count, y = xe(
241
242
  d,
242
243
  `/chat/rooms/${encodeURIComponent(d)}/members`,
243
- G,
244
- i === "members" && !!a && !w
245
- ), M = w ? _ ? a.members.filter((t) => t.name.toLowerCase().includes(_.replace(/^@/, ""))) : a.members : y.members, H = w ? M.length : y.total, C = j(), [z, V] = f(""), [D, R] = f(null), Y = [
244
+ H,
245
+ c === "members" && !!a && !v
246
+ ), M = v ? _ ? a.members.filter((t) => t.name.toLowerCase().includes(_.replace(/^@/, ""))) : a.members : y.members, V = v ? M.length : y.total, w = q(), [z, Y] = f(""), [R, U] = f(null), J = [
246
247
  ["members", `Members${a ? ` · ${a.member_count}` : ""}`],
247
- ["pinned", `Pinned${c.length ? ` · ${c.length}` : ""}`],
248
+ ["pinned", `Pinned${o.length ? ` · ${o.length}` : ""}`],
248
249
  ["files", `Files${a != null && a.file_count ? ` · ${a.file_count}` : ""}`],
249
250
  ["links", "Links"]
250
251
  ];
251
252
  return /* @__PURE__ */ r(
252
253
  "div",
253
254
  {
254
- className: m("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
255
+ className: x("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
255
256
  "data-chat-room-info": !0,
256
257
  children: [
257
- /* @__PURE__ */ r("div", { className: m("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
258
+ /* @__PURE__ */ r("div", { className: x("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
258
259
  /* @__PURE__ */ e(
259
260
  "button",
260
261
  {
261
262
  type: "button",
262
- onClick: o,
263
+ onClick: m,
263
264
  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",
264
265
  "aria-label": "Back to the conversation",
265
- children: /* @__PURE__ */ e(Q, { className: "h-4 w-4", strokeWidth: 2 })
266
+ children: /* @__PURE__ */ e(W, { className: "h-4 w-4", strokeWidth: 2 })
266
267
  }
267
268
  ),
268
269
  /* @__PURE__ */ e("p", { className: "min-w-0 flex-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: l })
@@ -271,7 +272,7 @@ function Te({
271
272
  /* @__PURE__ */ r(
272
273
  "dl",
273
274
  {
274
- className: m(
275
+ className: x(
275
276
  "grid grid-cols-2 gap-x-3 gap-y-2 border-b px-3 py-3 text-[11.5px]",
276
277
  n.divider
277
278
  ),
@@ -298,7 +299,7 @@ function Te({
298
299
  ]
299
300
  }
300
301
  ),
301
- /* @__PURE__ */ r("div", { className: m("border-b px-3 py-2.5", n.divider), "data-chat-summarize-range": !0, children: [
302
+ /* @__PURE__ */ r("div", { className: x("border-b px-3 py-2.5", n.divider), "data-chat-summarize-range": !0, children: [
302
303
  /* @__PURE__ */ e("p", { className: "text-[11.5px] font-semibold text-slate-700 dark:text-slate-200", children: "Summarize" }),
303
304
  /* @__PURE__ */ r("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: [
304
305
  [
@@ -308,14 +309,14 @@ function Te({
308
309
  "button",
309
310
  {
310
311
  type: "button",
311
- disabled: C.isPending,
312
- onClick: () => C.mutate(
312
+ disabled: w.isPending,
313
+ onClick: () => w.mutate(
313
314
  {
314
315
  room: d,
315
316
  since: new Date(Date.now() - N * 864e5).toISOString()
316
317
  },
317
318
  {
318
- onSuccess: (g) => R(
319
+ onSuccess: (g) => U(
319
320
  g.summary ?? `Only ${g.count} messages — nothing to summarize.`
320
321
  )
321
322
  }
@@ -330,7 +331,7 @@ function Te({
330
331
  {
331
332
  type: "date",
332
333
  value: z,
333
- onChange: (t) => V(t.target.value),
334
+ onChange: (t) => Y(t.target.value),
334
335
  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",
335
336
  "aria-label": "Summarize since"
336
337
  }
@@ -339,42 +340,42 @@ function Te({
339
340
  "button",
340
341
  {
341
342
  type: "button",
342
- disabled: !z || C.isPending,
343
+ disabled: !z || w.isPending,
343
344
  onClick: () => {
344
345
  const [t, N, g] = z.split("-").map(Number);
345
- C.mutate(
346
+ w.mutate(
346
347
  { room: d, since: new Date(t, N - 1, g).toISOString() },
347
348
  {
348
- onSuccess: (I) => R(
349
- I.summary ?? `Only ${I.count} messages — nothing to summarize.`
349
+ onSuccess: (F) => U(
350
+ F.summary ?? `Only ${F.count} messages — nothing to summarize.`
350
351
  )
351
352
  }
352
353
  );
353
354
  },
354
- className: m(
355
+ className: x(
355
356
  "inline-flex items-center gap-1 text-[11px] font-medium disabled:opacity-40",
356
357
  n.accentText
357
358
  ),
358
359
  children: [
359
- /* @__PURE__ */ e(W, { className: "h-3 w-3" }),
360
+ /* @__PURE__ */ e(B, { className: "h-3 w-3" }),
360
361
  " ",
361
- C.isPending ? "Summarizing…" : "Since then"
362
+ w.isPending ? "Summarizing…" : "Since then"
362
363
  ]
363
364
  }
364
365
  )
365
366
  ] }),
366
- D && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200", children: D })
367
+ R && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200", children: R })
367
368
  ] }),
368
- /* @__PURE__ */ e("div", { className: m("flex gap-1 border-b px-2 pt-1.5", n.divider), role: "tablist", children: Y.map(([t, N]) => /* @__PURE__ */ e(
369
+ /* @__PURE__ */ e("div", { className: x("flex gap-1 border-b px-2 pt-1.5", n.divider), role: "tablist", children: J.map(([t, N]) => /* @__PURE__ */ e(
369
370
  "button",
370
371
  {
371
372
  type: "button",
372
373
  role: "tab",
373
- "aria-selected": i === t,
374
- onClick: () => k(t),
375
- className: m(
374
+ "aria-selected": c === t,
375
+ onClick: () => C(t),
376
+ className: x(
376
377
  "-mb-px border-b-2 px-2 pb-1.5 text-[11.5px] font-medium",
377
- i === t ? "border-slate-800 text-slate-800 dark:border-slate-100 dark:text-slate-100" : "border-transparent text-slate-500 hover:text-slate-700 dark:text-slate-400"
378
+ c === t ? "border-slate-800 text-slate-800 dark:border-slate-100 dark:text-slate-100" : "border-transparent text-slate-500 hover:text-slate-700 dark:text-slate-400"
378
379
  ),
379
380
  "data-chat-info-tab": t,
380
381
  children: N
@@ -382,15 +383,15 @@ function Te({
382
383
  t
383
384
  )) }),
384
385
  /* @__PURE__ */ r("div", { className: "px-3 py-2", children: [
385
- i === "members" && /* @__PURE__ */ r($, { children: [
386
+ c === "members" && /* @__PURE__ */ r($, { children: [
386
387
  a && a.member_count > 10 && /* @__PURE__ */ r("div", { className: "mb-2 space-y-1", children: [
387
- /* @__PURE__ */ e(he, { value: L, onChange: E }),
388
+ /* @__PURE__ */ e(ue, { value: L, onChange: G }),
388
389
  /* @__PURE__ */ e(
389
390
  "p",
390
391
  {
391
392
  className: "text-[10.5px] tabular-nums text-slate-500 dark:text-slate-400",
392
393
  "data-chat-member-count": !0,
393
- children: pe(H, !!_)
394
+ children: be(V, !!_)
394
395
  }
395
396
  )
396
397
  ] }),
@@ -401,12 +402,12 @@ function Te({
401
402
  t.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500", children: t.title })
402
403
  ] }),
403
404
  t.online && /* @__PURE__ */ r("span", { className: "flex items-center gap-1 text-[10.5px] text-emerald-700 dark:text-emerald-400", children: [
404
- /* @__PURE__ */ e(ue, { online: !0 }),
405
+ /* @__PURE__ */ e(fe, { online: !0 }),
405
406
  "Online"
406
407
  ] })
407
- ] }, t.id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: !a || !w && y.loading ? "Loading…" : _ ? "No one matches." : "Anyone who can open this room can read it." }),
408
- !w && /* @__PURE__ */ e(
409
- be,
408
+ ] }, t.id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: !a || !v && y.loading ? "Loading…" : _ ? "No one matches." : "Anyone who can open this room can read it." }),
409
+ !v && /* @__PURE__ */ e(
410
+ ge,
410
411
  {
411
412
  hasMore: y.hasMore,
412
413
  loading: y.loadingMore,
@@ -414,13 +415,13 @@ function Te({
414
415
  }
415
416
  )
416
417
  ] }),
417
- i === "pinned" && (c.length ? /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: c.map((t) => /* @__PURE__ */ r("li", { className: "flex items-start gap-1.5 text-[11.5px]", children: [
418
- /* @__PURE__ */ e(K, { className: "mt-0.5 h-3 w-3 shrink-0 text-slate-400" }),
418
+ c === "pinned" && (o.length ? /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: o.map((t) => /* @__PURE__ */ r("li", { className: "flex items-start gap-1.5 text-[11.5px]", children: [
419
+ /* @__PURE__ */ e(X, { className: "mt-0.5 h-3 w-3 shrink-0 text-slate-400" }),
419
420
  /* @__PURE__ */ r(
420
421
  "button",
421
422
  {
422
423
  type: "button",
423
- onClick: () => x(t.id),
424
+ onClick: () => h(t.id),
424
425
  className: "min-w-0 flex-1 text-left text-slate-700 hover:underline dark:text-slate-200",
425
426
  children: [
426
427
  /* @__PURE__ */ r("span", { className: "font-medium", children: [
@@ -435,50 +436,51 @@ function Te({
435
436
  "button",
436
437
  {
437
438
  type: "button",
438
- onClick: () => u(t.id),
439
+ onClick: () => b(t.id),
439
440
  className: "shrink-0 text-slate-400 hover:text-red-500",
440
441
  "aria-label": "Unpin",
441
- children: /* @__PURE__ */ e(X, { className: "h-3 w-3" })
442
+ children: /* @__PURE__ */ e(Z, { className: "h-3 w-3" })
442
443
  }
443
444
  )
444
445
  ] }, 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." })),
445
- (i === "files" || i === "links") && /* @__PURE__ */ e(
446
+ (c === "files" || c === "links") && /* @__PURE__ */ e(
446
447
  "input",
447
448
  {
448
- value: p,
449
- onChange: (t) => q(t.target.value),
450
- placeholder: i === "files" ? "Search files or people" : "Search links or people",
449
+ value: O,
450
+ onChange: (t) => E(t.target.value),
451
+ placeholder: c === "files" ? "Search files or people" : "Search links or people",
451
452
  "aria-label": "Search shared items",
452
453
  "data-chat-shared-search": !0,
453
454
  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"
454
455
  }
455
456
  ),
456
- i === "files" && (b.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : O.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: O.map((t) => /* @__PURE__ */ r(
457
+ c === "files" && (p.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : D.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: D.map((t) => /* @__PURE__ */ r(
457
458
  "li",
458
459
  {
459
460
  className: "flex items-center gap-2 text-[11.5px]",
460
461
  children: [
461
- /* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
462
+ /* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
462
463
  /* @__PURE__ */ e(
463
464
  "a",
464
465
  {
465
- href: v.fileUrl(t.file_id),
466
- target: "_blank",
467
- rel: "noopener noreferrer",
466
+ href: `${k.fileUrl(t.file_id)}?download=1`,
467
+ download: t.name || !0,
468
+ onClick: i(`${k.fileUrl(t.file_id)}?download=1`, t.name),
469
+ title: "Download",
468
470
  className: "min-w-0 flex-1 truncate text-slate-800 hover:underline dark:text-slate-100",
469
471
  children: t.name
470
472
  }
471
473
  ),
472
474
  /* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
473
475
  t.sender_name ? `${t.sender_name} · ` : "",
474
- t.size != null ? `${re(t.size)} · ` : "",
475
- F(t.date_created)
476
+ t.size != null ? `${le(t.size)} · ` : "",
477
+ Q(t.date_created)
476
478
  ] }),
477
479
  /* @__PURE__ */ e(
478
480
  "button",
479
481
  {
480
482
  type: "button",
481
- onClick: () => x(t.message_id),
483
+ onClick: () => h(t.message_id),
482
484
  className: "shrink-0 text-[10.5px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
483
485
  children: "Show"
484
486
  }
@@ -487,12 +489,12 @@ function Te({
487
489
  },
488
490
  `${t.message_id}:${t.file_id}`
489
491
  )) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "No files shared here yet." })),
490
- i === "links" && (b.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : P.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: P.map((t) => /* @__PURE__ */ r(
492
+ c === "links" && (p.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : P.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: P.map((t) => /* @__PURE__ */ r(
491
493
  "li",
492
494
  {
493
495
  className: "flex items-center gap-2 text-[11.5px]",
494
496
  children: [
495
- /* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
497
+ /* @__PURE__ */ e(ee, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
496
498
  /* @__PURE__ */ e(
497
499
  "a",
498
500
  {
@@ -502,7 +504,7 @@ function Te({
502
504
  onClick: (N) => {
503
505
  try {
504
506
  const g = new URL(t.url);
505
- g.origin === window.location.origin && h && (N.preventDefault(), h(`${g.pathname}${g.search}`));
507
+ g.origin === window.location.origin && u && (N.preventDefault(), u(`${g.pathname}${g.search}`));
506
508
  } catch {
507
509
  }
508
510
  },
@@ -512,13 +514,13 @@ function Te({
512
514
  ),
513
515
  /* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
514
516
  t.sender_name ?? "",
515
- t.date_created ? ` · ${F(t.date_created)}` : ""
517
+ t.date_created ? ` · ${Q(t.date_created)}` : ""
516
518
  ] }),
517
519
  /* @__PURE__ */ e(
518
520
  "button",
519
521
  {
520
522
  type: "button",
521
- onClick: () => x(t.message_id),
523
+ onClick: () => h(t.message_id),
522
524
  className: "shrink-0 text-[10.5px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
523
525
  children: "Show"
524
526
  }
@@ -533,31 +535,31 @@ function Te({
533
535
  }
534
536
  );
535
537
  }
536
- function Oe({
538
+ function Re({
537
539
  room: d,
538
540
  renderAvatar: l,
539
541
  me: n
540
542
  }) {
541
- const c = B(d), [o, x] = f(!1);
542
- if (!c) return null;
543
- const s = `${c.member_count} ${c.member_count === 1 ? "member" : "members"} · ${c.online_count} online`;
544
- if (!c.members.length)
543
+ const o = j(d), [m, h] = f(!1);
544
+ if (!o) return null;
545
+ const s = `${o.member_count} ${o.member_count === 1 ? "member" : "members"} · ${o.online_count} online`;
546
+ if (!o.members.length)
545
547
  return /* @__PURE__ */ r(
546
548
  "p",
547
549
  {
548
550
  className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
549
551
  "data-chat-member-count": !0,
550
552
  children: [
551
- /* @__PURE__ */ e(U, { className: "h-3 w-3" }),
553
+ /* @__PURE__ */ e(I, { className: "h-3 w-3" }),
552
554
  s
553
555
  ]
554
556
  }
555
557
  );
556
- const u = n ? n.toUpperCase() : null, h = [...c.members].sort(
557
- (a, i) => Number(i.online) - Number(a.online) || a.name.localeCompare(i.name)
558
- ), v = me();
559
- return /* @__PURE__ */ r(le, { open: o, onOpenChange: x, children: [
560
- /* @__PURE__ */ e(se, { asChild: !0, children: /* @__PURE__ */ r(
558
+ const b = n ? n.toUpperCase() : null, u = [...o.members].sort(
559
+ (i, a) => Number(a.online) - Number(i.online) || i.name.localeCompare(a.name)
560
+ ), k = he();
561
+ return /* @__PURE__ */ r(ne, { open: m, onOpenChange: h, children: [
562
+ /* @__PURE__ */ e(de, { asChild: !0, children: /* @__PURE__ */ r(
561
563
  "button",
562
564
  {
563
565
  type: "button",
@@ -565,55 +567,55 @@ function Oe({
565
567
  "aria-label": `${s} — show members`,
566
568
  "data-chat-member-count": !0,
567
569
  children: [
568
- /* @__PURE__ */ e(U, { className: "h-3 w-3 shrink-0" }),
570
+ /* @__PURE__ */ e(I, { className: "h-3 w-3 shrink-0" }),
569
571
  /* @__PURE__ */ e("span", { className: "truncate", children: s })
570
572
  ]
571
573
  }
572
574
  ) }),
573
- /* @__PURE__ */ r(ne, { align: "start", className: "w-[260px] p-0", "data-chat-member-popover": !0, children: [
575
+ /* @__PURE__ */ r(ie, { align: "start", className: "w-[260px] p-0", "data-chat-member-popover": !0, children: [
574
576
  /* @__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 }),
575
- /* @__PURE__ */ e("ul", { className: "max-h-[320px] overflow-y-auto p-1", children: h.map((a) => {
576
- const i = !!u && a.id.toUpperCase() === u, k = /* @__PURE__ */ r($, { children: [
577
- l == null ? void 0 : l(a.id, a.name),
577
+ /* @__PURE__ */ e("ul", { className: "max-h-[320px] overflow-y-auto p-1", children: u.map((i) => {
578
+ const a = !!b && i.id.toUpperCase() === b, c = /* @__PURE__ */ r($, { children: [
579
+ l == null ? void 0 : l(i.id, i.name),
578
580
  /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
579
581
  /* @__PURE__ */ r("span", { className: "block truncate text-[12px] text-slate-800 dark:text-slate-100", children: [
580
- a.name,
581
- i && /* @__PURE__ */ e("span", { className: "ml-1 text-slate-500 dark:text-slate-400", children: "(you)" })
582
+ i.name,
583
+ a && /* @__PURE__ */ e("span", { className: "ml-1 text-slate-500 dark:text-slate-400", children: "(you)" })
582
584
  ] }),
583
- a.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500 dark:text-slate-400", children: a.title })
585
+ i.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500 dark:text-slate-400", children: i.title })
584
586
  ] }),
585
587
  /* @__PURE__ */ e(
586
588
  "span",
587
589
  {
588
- className: m(
590
+ className: x(
589
591
  "shrink-0 text-[10.5px]",
590
- a.online ? "text-emerald-700 dark:text-emerald-400" : "text-slate-500 dark:text-slate-400"
592
+ i.online ? "text-emerald-700 dark:text-emerald-400" : "text-slate-500 dark:text-slate-400"
591
593
  ),
592
- children: a.online ? "Online" : "Offline"
594
+ children: i.online ? "Online" : "Offline"
593
595
  }
594
596
  )
595
597
  ] });
596
- return /* @__PURE__ */ e("li", { "data-chat-member": a.online ? "online" : "offline", children: v && !i ? /* @__PURE__ */ e(
598
+ return /* @__PURE__ */ e("li", { "data-chat-member": i.online ? "online" : "offline", children: k && !a ? /* @__PURE__ */ e(
597
599
  "button",
598
600
  {
599
601
  type: "button",
600
602
  onClick: () => {
601
- x(!1), de(a.id, a.name);
603
+ h(!1), oe(i.id, i.name);
602
604
  },
603
- title: `Message ${a.name}`,
605
+ title: `Message ${i.name}`,
604
606
  className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-muted",
605
- children: k
607
+ children: c
606
608
  }
607
- ) : /* @__PURE__ */ e("div", { className: "flex items-center gap-2 px-2 py-1.5", children: k }) }, a.id);
609
+ ) : /* @__PURE__ */ e("div", { className: "flex items-center gap-2 px-2 py-1.5", children: c }) }, i.id);
608
610
  }) })
609
611
  ] })
610
612
  ] });
611
613
  }
612
614
  export {
613
- Le as ChannelIntro,
614
- ze as JumpToDateForm,
615
- Oe as MemberCountLine,
616
- Te as RoomInfoDrawer,
617
- $e as ThreadPane,
618
- Me as WelcomeNote
615
+ Te as ChannelIntro,
616
+ De as JumpToDateForm,
617
+ Re as MemberCountLine,
618
+ Pe as RoomInfoDrawer,
619
+ ze as ThreadPane,
620
+ Oe as WelcomeNote
619
621
  };