@nivaro/react 0.3.78 → 0.3.80

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,56 +1,56 @@
1
- import { jsxs as a, jsx as e, Fragment as ke } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as e, Fragment as we } from "react/jsx-runtime";
2
2
  import { useQuery as Ue, useQueryClient as qt, useMutation as Fe } from "@tanstack/react-query";
3
- import { Search as Jn, Plus as za, Hash as Ot, Lock as Ga, ChevronLeft as ft, X as bt, PinOff as Qa, Pin as Lt, Headphones as Ka, PlayCircle as Ja, MessageCircle as Yn, Users as Pt, AtSign as Ya, AlarmClock as Za, Sparkles as Va, BellOff as An, PencilLine as Xa, Star as es, ArchiveRestore as ts, Archive as ns, Bell as as, LogOut as ss, Info as rs, MapPin as Rn, Check as Bt, ArrowUpDown as ls, MessageSquareReply as os, Quote as is, ClipboardPlus as cs, NotebookPen as ds, Bookmark as us, Pencil as ms, Trash2 as ps, AlertTriangle as hs, Paperclip as fs, Bot as xs, CheckCheck as bs, Plane as gs, FilePlus2 as vs } from "lucide-react";
4
- import { useState as T, useEffect as ae, useMemo as ve, useRef as ue, useContext as ys } from "react";
5
- import { toast as ge } from "sonner";
3
+ import { Search as Ka, Plus as zn, Hash as Ot, Lock as Gn, ChevronLeft as ft, X as bt, PinOff as Qn, Pin as Lt, Headphones as Kn, PlayCircle as Jn, MessageCircle as Ja, Users as Pt, AtSign as Yn, AlarmClock as Zn, Sparkles as Vn, BellOff as Ma, PencilLine as Xn, Star as es, ArchiveRestore as ts, Archive as as, Bell as ns, LogOut as ss, Info as rs, MapPin as Aa, Check as Bt, ArrowUpDown as ls, MessageSquareReply as os, Quote as is, ClipboardPlus as cs, NotebookPen as ds, Bookmark as us, Pencil as ms, Trash2 as ps, AlertTriangle as hs, Paperclip as fs, Bot as xs, CheckCheck as bs, Plane as gs, FilePlus2 as vs } from "lucide-react";
4
+ import { useState as T, useEffect as ne, useMemo as ye, useRef as ue, useContext as ys } from "react";
5
+ import { toast as ve } from "sonner";
6
6
  import { useItemEditAuth as gt, useNavigation as ks, useNivaroClient as tt } from "../../context.js";
7
- import { get as ye, post as He, patch as ws } from "../../lib/commands.js";
7
+ import { get as ke, post as He, patch as ws } from "../../lib/commands.js";
8
8
  import { useLiveRecord as Ns, batchTouches as Cs, LIVE_ASPECTS as _s } from "../../lib/live.js";
9
9
  import { usePresenceOnlinePoll as Ss } from "../../lib/presence-live.js";
10
- import { presencePlaceHref as On, stuckText as Ln, fullHref as Pn } from "../../lib/presence-state.js";
10
+ import { presencePlaceHref as Ra, stuckText as Oa, fullHref as La } from "../../lib/presence-state.js";
11
11
  import { invalidateRecordTasks as Ts } from "../../lib/record-tasks.js";
12
- import { userErrorMessage as Zn } from "../../lib/safe-error.js";
12
+ import { userErrorMessage as Ya } from "../../lib/safe-error.js";
13
13
  import { userCardQuery as Us } from "../../lib/user-cards.js";
14
- import { cn as g, toLocalDateString as Ds, getDisplayTimezone as Wt, formatRelative as Vn } from "../../lib/utils.js";
14
+ import { cn as g, toLocalDateString as Ds, getDisplayTimezone as Wt, formatRelative as Za } from "../../lib/utils.js";
15
15
  import { CustomStatusEditor as $s } from "../CustomStatusEditor.js";
16
16
  import { DoNotDisturbRow as Ms } from "../DoNotDisturb.js";
17
17
  import { useFileDownload as As } from "../item-edit/file-download.js";
18
18
  import { UserChip as Ft } from "../item-edit/UserChip.js";
19
19
  import { StaleBuildChip as Rs } from "../StaleBuildChip.js";
20
20
  import { UserAvatar as Os } from "../UserAvatar.js";
21
- import { Popover as nt, PopoverTrigger as at, PopoverContent as st } from "../ui/popover.js";
21
+ import { Popover as at, PopoverTrigger as nt, PopoverContent as st } from "../ui/popover.js";
22
22
  import { SimpleSelect as Ht } from "../ui/SimpleSelect.js";
23
23
  import { useBotStream as Ls, BotStreamBubble as Ps } from "./BotStream.js";
24
24
  import { MembershipHistory as Is, ArchiveSuggestionBanner as js } from "./ChannelArchive.js";
25
25
  import { ChannelExtrasEditor as Es, BulkInvitePanel as qs, ChannelAuditLog as Bs } from "./ChannelExtras.js";
26
- import { ChannelTile as et, ChannelLookPicker as Xn } from "./ChannelLook.js";
27
- import { MentionsView as ea, ScheduledView as ta, CatchUpView as na, useSearchFilterState as Ws, FilterToggle as Fs, ChatSettingsButton as Hs, SearchFilterBar as zs } from "./ChatViews.js";
26
+ import { ChannelTile as et, ChannelLookPicker as Va } from "./ChannelLook.js";
27
+ import { MentionsView as Xa, ScheduledView as en, CatchUpView as tn, useSearchFilterState as Ws, FilterToggle as Fs, ChatSettingsButton as Hs, SearchFilterBar as zs } from "./ChatViews.js";
28
28
  import { ChatComposer as Gs } from "./Composer.js";
29
- import { useMyPreferences as zt, useSetMyPreferences as aa, useChatRoles as sa, useChannelDirectory as Qs, useRoomMembership as Gt, useCreateChannel as Ks, useChatConfig as Le, useChannelMembers as ra, useChannelAdmin as la, useUserSearch as Qt, GENERAL_CHANNEL_ID as oa, useChatRooms as ia, useArchivedRooms as ca, sortOnlineUsers as Js, dmRoom as It, CHAT_DEFAULTS as ht, ChatConfigContext as da, useChatBotInfo as Kt, useChatSearch as Ys, dmPeer as Te, useChatMessages as Zs, useOpenRoomRegistration as Vs, useMarkRoomRead as Xs, useTypingIndicator as er, usePeerReadAt as tr, useEntityRoomLink as nr, useToggleReaction as ar, useRoomPins as sr, useTogglePin as rr, useEditMessage as lr, useDeleteMessage as or, useChatBotName as ir, useChatThread as cr, useRecordBrowserTimezone as dr, chatInitials as ur, chatAvatarColor as mr, useCreateGroupDm as pr, canOpenDm as hr, openDmWith as fr, usePagedMembers as xr, chatRoomTypesQuery as ua, REACTION_EMOJI as br } from "./chat-core.js";
29
+ import { useMyPreferences as zt, useSetMyPreferences as an, useChatRoles as nn, useChannelDirectory as Qs, useRoomMembership as Gt, useCreateChannel as Ks, useChatConfig as Le, useChannelMembers as sn, useChannelAdmin as rn, useUserSearch as Qt, GENERAL_CHANNEL_ID as ln, useChatRooms as on, useArchivedRooms as cn, sortOnlineUsers as Js, dmRoom as It, CHAT_DEFAULTS as ht, ChatConfigContext as dn, useChatBotInfo as Kt, useChatSearch as Ys, dmPeer as Te, useChatMessages as Zs, useOpenRoomRegistration as Vs, useMarkRoomRead as Xs, useTypingIndicator as er, usePeerReadAt as tr, useEntityRoomLink as ar, useToggleReaction as nr, useRoomPins as sr, useTogglePin as rr, useEditMessage as lr, useDeleteMessage as or, useChatBotName as ir, useChatThread as cr, useRecordBrowserTimezone as dr, chatInitials as ur, chatAvatarColor as mr, useCreateGroupDm as pr, canOpenDm as hr, openDmWith as fr, usePagedMembers as xr, chatRoomTypesQuery as un, REACTION_EMOJI as br } from "./chat-core.js";
30
30
  import { useDraftRooms as gr } from "./chat-drafts.js";
31
31
  import { useCustomEmoji as vr, EmojiButton as yr, EmojiGlyph as kr } from "./chat-emoji.js";
32
- import { useRoomRecord as ma, useRecordFileTargets as wr } from "./chat-hooks.js";
32
+ import { useRoomRecord as mn, useRecordFileTargets as wr } from "./chat-hooks.js";
33
33
  import { offHoursNote as Nr } from "./chat-local-time.js";
34
34
  import { useMessageWindow as Cr } from "./chat-window.js";
35
- import { HuddleFollowHost as In } from "./huddle/HuddleCollab.js";
35
+ import { HuddleFollowHost as Pa } from "./huddle/HuddleCollab.js";
36
36
  import { HuddleControls as _r } from "./huddle/HuddleControls.js";
37
37
  import { HuddleLiveBadge as Sr } from "./huddle/HuddleLiveBadge.js";
38
38
  import { HuddleScheduleCard as Tr } from "./huddle/HuddleScheduleCard.js";
39
39
  import { HuddleScheduleForm as Ur } from "./huddle/HuddleScheduleForm.js";
40
40
  import { HuddleStage as Dr } from "./huddle/HuddleStage.js";
41
41
  import { useHuddleLive as $r } from "./huddle/huddle-live.js";
42
- import { stripHuddleRef as jn, huddleRefOf as En } from "./huddle/huddle-schedule.js";
42
+ import { stripHuddleRef as Ia, huddleRefOf as ja } from "./huddle/huddle-schedule.js";
43
43
  import { useHuddle as Mr } from "./huddle/useHuddle.js";
44
44
  import { MemberSearchBox as Ar, MemberOnlineDot as Rr, MemberLoadMore as Or } from "./MemberPaging.js";
45
45
  import { useMessageActions as Lr, MessageActionsMenu as Pr, actionsForMessage as Ir } from "./MessageActions.js";
46
46
  import { FormattedMessage as jr, LinkPreviews as Er } from "./MessageFormat.js";
47
47
  import { PollCard as qr } from "./PollCard.js";
48
- import { RoomStatusMarks as Br, headerIconIdle as qn, headerIconButton as Bn, RoomHeaderMenu as Wr } from "./RoomHeaderMenu.js";
48
+ import { RoomStatusMarks as Br, headerIconIdle as Ea, headerIconButton as qa, RoomHeaderMenu as Wr } from "./RoomHeaderMenu.js";
49
49
  import { MemberCountLine as Fr, ChannelIntro as Hr, WelcomeNote as zr, ThreadPane as Gr, RoomInfoDrawer as Qr } from "./RoomParts.js";
50
50
  import { clipInfo as Kr, ClipPlayer as Jr } from "./ScreenClip.js";
51
- import { useOutbox as pa } from "./chat-outbox.js";
52
- import { OutboxBubbles as ha } from "./OutboxBubbles.js";
53
- const fa = {
51
+ import { useOutbox as pn } from "./chat-outbox.js";
52
+ import { OutboxBubbles as hn } from "./OutboxBubbles.js";
53
+ const fn = {
54
54
  bubbleMine: "bg-nvr-cyan text-white",
55
55
  bubbleOther: "bg-slate-100 text-slate-800 dark:bg-muted dark:text-slate-100",
56
56
  accentText: "text-nvr-navy dark:text-nvr-cyan",
@@ -61,9 +61,9 @@ const fa = {
61
61
  input: "border-slate-200 bg-slate-50 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100",
62
62
  divider: "border-slate-100 dark:border-border/60"
63
63
  }, Jt = {};
64
- Jt.current = fa;
64
+ Jt.current = fn;
65
65
  function yo({
66
- children: n,
66
+ children: a,
67
67
  me: r,
68
68
  onlineUsers: l = [],
69
69
  collections: s,
@@ -75,13 +75,13 @@ function yo({
75
75
  recordUrl: f,
76
76
  sessionUrl: d,
77
77
  realtime: b,
78
- subscribeRooms: y,
78
+ subscribeRooms: k,
79
79
  setTypingRoom: U,
80
- navigate: M,
80
+ navigate: A,
81
81
  sound: C = !0,
82
82
  theme: S
83
83
  }) {
84
- const W = ve(
84
+ const W = ye(
85
85
  () => ({
86
86
  collections: { ...ht.collections, ...s },
87
87
  globalRoom: o,
@@ -92,11 +92,11 @@ function yo({
92
92
  recordUrl: f,
93
93
  sessionUrl: d,
94
94
  realtime: b,
95
- subscribeRooms: y,
95
+ subscribeRooms: k,
96
96
  me: r,
97
97
  onlineUsers: l,
98
98
  setTypingRoom: U,
99
- navigate: M,
99
+ navigate: A,
100
100
  sound: C
101
101
  }),
102
102
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -112,16 +112,16 @@ function yo({
112
112
  C
113
113
  ]
114
114
  );
115
- return Jt.current = { ...fa, ...S }, /* @__PURE__ */ e(da.Provider, { value: W, children: n });
115
+ return Jt.current = { ...fn, ...S }, /* @__PURE__ */ e(dn.Provider, { value: W, children: a });
116
116
  }
117
117
  function me() {
118
118
  return Jt.current;
119
119
  }
120
- const Wn = /* @__PURE__ */ new WeakMap();
121
- function Yr(n, r) {
120
+ const Ba = /* @__PURE__ */ new WeakMap();
121
+ function Yr(a, r) {
122
122
  const l = String(r).toUpperCase();
123
- let s = Wn.get(n);
124
- s || (s = { ids: /* @__PURE__ */ new Map(), timer: null }, Wn.set(n, s));
123
+ let s = Ba.get(a);
124
+ s || (s = { ids: /* @__PURE__ */ new Map(), timer: null }, Ba.set(a, s));
125
125
  const o = s;
126
126
  return new Promise((i) => {
127
127
  const m = o.ids.get(l) ?? [];
@@ -131,55 +131,55 @@ function Yr(n, r) {
131
131
  const x = [...c.keys()], f = /* @__PURE__ */ new Map();
132
132
  for (let d = 0; d < x.length; d += 100)
133
133
  try {
134
- const b = await n.request(
135
- ye("/presence/people", { ids: x.slice(d, d + 100).join(",") })
134
+ const b = await a.request(
135
+ ke("/presence/people", { ids: x.slice(d, d + 100).join(",") })
136
136
  );
137
- for (const y of b.data ?? []) f.set(String(y.user_id).toUpperCase(), y);
137
+ for (const k of b.data ?? []) f.set(String(k.user_id).toUpperCase(), k);
138
138
  } catch {
139
139
  }
140
- for (const [d, b] of c) for (const y of b) y(f.get(d) ?? null);
140
+ for (const [d, b] of c) for (const k of b) k(f.get(d) ?? null);
141
141
  }, 0));
142
142
  });
143
143
  }
144
- function Yt(n, r = !0) {
144
+ function Yt(a, r = !0) {
145
145
  const l = tt(), { data: s } = Ue({
146
- queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
147
- queryFn: () => Yr(l, n),
148
- enabled: !!n && r,
146
+ queryKey: ["nvr-person-info", a ? String(a).toUpperCase() : null],
147
+ queryFn: () => Yr(l, a),
148
+ enabled: !!a && r,
149
149
  staleTime: 6e4
150
150
  });
151
151
  return s ?? null;
152
152
  }
153
- function xa(n) {
154
- return n != null && n.last_seen ? `last seen ${Vn(n.last_seen)}` : null;
153
+ function xn(a) {
154
+ return a != null && a.last_seen ? `last seen ${Za(a.last_seen)}` : null;
155
155
  }
156
- function ba(n) {
157
- const r = ys(da), l = ka(), s = String(n).toUpperCase();
156
+ function bn(a) {
157
+ const r = ys(dn), l = kn(), s = String(a).toUpperCase();
158
158
  if (l.loaded) {
159
159
  const i = l.byUser.get(s);
160
160
  if (!i) return { state: "offline", title: "Offline", page: null };
161
- const m = i.page ?? wa(i.current_path);
161
+ const m = i.page ?? wn(i.current_path);
162
162
  return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: jt(i), page: m } : { state: "online", title: "Online", page: m };
163
163
  }
164
164
  const o = r == null ? void 0 : r.onlineUsers.find((i) => String(i.user_id).toUpperCase() === s);
165
165
  return o ? o.is_idle ? { state: "idle", title: jt(o), page: null } : { state: "online", title: "Online", page: null } : { state: "offline", title: "Offline", page: null };
166
166
  }
167
- function ga(n) {
168
- return n != null && n.out_of_office ? n.ooo_end ? `Out of office until ${new Date(n.ooo_end).toLocaleDateString(void 0, {
167
+ function gn(a) {
168
+ return a != null && a.out_of_office ? a.ooo_end ? `Out of office until ${new Date(a.ooo_end).toLocaleDateString(void 0, {
169
169
  weekday: "short",
170
170
  month: "short",
171
171
  day: "numeric",
172
172
  timeZone: Wt() ?? void 0
173
173
  })}` : "Out of office" : null;
174
174
  }
175
- function Zr({ id: n, size: r }) {
176
- const { state: l, title: s, page: o } = ba(n), i = Yt(n), m = l === "offline" ? xa(i) : null, c = ga(i), x = r >= 30 ? 10 : 8, f = [
175
+ function Zr({ id: a, size: r }) {
176
+ const { state: l, title: s, page: o } = bn(a), i = Yt(a), m = l === "offline" ? xn(i) : null, c = gn(i), x = r >= 30 ? 10 : 8, f = [
177
177
  m ? `Offline · ${m}` : s,
178
178
  o && l !== "offline" ? `On ${o}` : null,
179
179
  c,
180
180
  c && (i != null && i.delegate) ? `${i.delegate.name} is covering` : null
181
181
  ].filter(Boolean).join(" · ");
182
- return /* @__PURE__ */ a(ke, { children: [
182
+ return /* @__PURE__ */ n(we, { children: [
183
183
  /* @__PURE__ */ e(
184
184
  "span",
185
185
  {
@@ -208,8 +208,8 @@ function Zr({ id: n, size: r }) {
208
208
  )
209
209
  ] });
210
210
  }
211
- function K({
212
- id: n,
211
+ function J({
212
+ id: a,
213
213
  name: r,
214
214
  size: l = 32,
215
215
  presence: s = !0
@@ -221,7 +221,7 @@ function K({
221
221
  style: {
222
222
  width: l,
223
223
  height: l,
224
- backgroundColor: mr(n),
224
+ backgroundColor: mr(a),
225
225
  fontSize: l * 0.36
226
226
  },
227
227
  "aria-hidden": !0,
@@ -230,20 +230,20 @@ function K({
230
230
  ), m = /* @__PURE__ */ e(
231
231
  Os,
232
232
  {
233
- userId: n,
233
+ userId: a,
234
234
  fallback: i,
235
235
  style: { width: l, height: l },
236
236
  alt: r ?? ""
237
237
  }
238
- ), c = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(n).toUpperCase();
239
- return !s || c ? m : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
238
+ ), c = a === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(a).toUpperCase();
239
+ return !s || c ? m : /* @__PURE__ */ n("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
240
240
  m,
241
- /* @__PURE__ */ e(Zr, { id: n, size: l })
241
+ /* @__PURE__ */ e(Zr, { id: a, size: l })
242
242
  ] });
243
243
  }
244
- function Vr({ peerId: n, name: r }) {
245
- const l = Kt(), s = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(K, { id: n, name: r, size: 28 });
246
- return s ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Ft, { userId: n, children: /* @__PURE__ */ e(
244
+ function Vr({ peerId: a, name: r }) {
245
+ const l = Kt(), s = a === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === a.toUpperCase(), o = /* @__PURE__ */ e(J, { id: a, name: r, size: 28 });
246
+ return s ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Ft, { userId: a, children: /* @__PURE__ */ e(
247
247
  "button",
248
248
  {
249
249
  type: "button",
@@ -254,26 +254,26 @@ function Vr({ peerId: n, name: r }) {
254
254
  }
255
255
  ) });
256
256
  }
257
- function Fn({ token: n, url: r, mine: l }) {
258
- const s = Le(), o = me(), i = tt(), { data: m } = Ue(ua(i)), { data: c } = Ue({
259
- queryKey: ["nvr-chat-entity-card", n],
257
+ function Wa({ token: a, url: r, mine: l }) {
258
+ const s = Le(), o = me(), i = tt(), { data: m } = Ue(un(i)), { data: c } = Ue({
259
+ queryKey: ["nvr-chat-entity-card", a],
260
260
  queryFn: async () => {
261
- var d, b, y, U;
262
- for (const M of m ?? [])
261
+ var d, b, k, U;
262
+ for (const A of m ?? [])
263
263
  try {
264
264
  const S = (b = (d = (await i.request(
265
- ye(`/items/${M.collection}`, {
265
+ ke(`/items/${A.collection}`, {
266
266
  limit: 1,
267
267
  fields: "id",
268
- filter: JSON.stringify({ [M.match_field]: { _eq: n } })
268
+ filter: JSON.stringify({ [A.match_field]: { _eq: a } })
269
269
  })
270
270
  )).data) == null ? void 0 : d[0]) == null ? void 0 : b.id;
271
271
  if (S == null) continue;
272
- const $ = (U = (y = (await i.request(
273
- ye(`/pipelines/instance/${M.collection}/${S}`)
274
- )).data) == null ? void 0 : y.instance) == null ? void 0 : U.current_state_obj;
272
+ const $ = (U = (k = (await i.request(
273
+ ke(`/pipelines/instance/${A.collection}/${S}`)
274
+ )).data) == null ? void 0 : k.instance) == null ? void 0 : U.current_state_obj;
275
275
  return {
276
- collection: M.collection,
276
+ collection: A.collection,
277
277
  id: S,
278
278
  state: ($ == null ? void 0 : $.label) ?? null,
279
279
  color: ($ == null ? void 0 : $.color) ?? null
@@ -289,17 +289,17 @@ function Fn({ token: n, url: r, mine: l }) {
289
289
  c == null ? void 0 : c.collection,
290
290
  c == null ? void 0 : c.id,
291
291
  (d) => {
292
- Cs(d, _s.state) && x.invalidateQueries({ queryKey: ["nvr-chat-entity-card", n] });
292
+ Cs(d, _s.state) && x.invalidateQueries({ queryKey: ["nvr-chat-entity-card", a] });
293
293
  },
294
294
  { includeOwn: !0, debounceMs: 400 }
295
- ), /* @__PURE__ */ a(
295
+ ), /* @__PURE__ */ n(
296
296
  "button",
297
297
  {
298
298
  type: "button",
299
299
  onClick: () => {
300
300
  var d, b;
301
301
  if (c) {
302
- const U = (s.recordUrl ?? ((M, C) => `/collections/${M}/${C}`))(c.collection, c.id);
302
+ const U = (s.recordUrl ?? ((A, C) => `/collections/${A}/${C}`))(c.collection, c.id);
303
303
  if (U) {
304
304
  (d = s.navigate) == null || d.call(s, U);
305
305
  return;
@@ -311,9 +311,9 @@ function Fn({ token: n, url: r, mine: l }) {
311
311
  "inline-flex max-w-full items-center gap-1 align-baseline font-medium underline-offset-2 hover:underline",
312
312
  l ? "underline" : o.accentText
313
313
  ),
314
- "data-chat-entity": n,
314
+ "data-chat-entity": a,
315
315
  children: [
316
- n,
316
+ a,
317
317
  (c == null ? void 0 : c.state) && /* @__PURE__ */ e(
318
318
  "span",
319
319
  {
@@ -329,20 +329,20 @@ function Fn({ token: n, url: r, mine: l }) {
329
329
  }
330
330
  );
331
331
  }
332
- function Xr(n) {
333
- const r = new Date(n), l = /* @__PURE__ */ new Date(), s = new Date(l);
332
+ function Xr(a) {
333
+ const r = new Date(a), l = /* @__PURE__ */ new Date(), s = new Date(l);
334
334
  return s.setDate(l.getDate() - 1), r.toDateString() === l.toDateString() ? "Today" : r.toDateString() === s.toDateString() ? "Yesterday" : r.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
335
335
  }
336
- function el({ botName: n }) {
336
+ function el({ botName: a }) {
337
337
  const r = me(), l = [
338
338
  {
339
339
  k: "@name",
340
340
  kind: "code",
341
341
  v: "Mention someone — they get notified even with the panel closed."
342
342
  },
343
- ...n ? [
343
+ ...a ? [
344
344
  {
345
- k: `@${n} …`,
345
+ k: `@${a} …`,
346
346
  kind: "code",
347
347
  v: "Ask the AI assistant anything about your data, right in the room."
348
348
  }
@@ -373,9 +373,9 @@ function el({ botName: n }) {
373
373
  v: 'Workflows and requests have a "Chat" button in their header — discuss the record in its own room or send it to any conversation.'
374
374
  }
375
375
  ];
376
- return /* @__PURE__ */ a("div", { "data-chat-tips": !0, children: [
376
+ return /* @__PURE__ */ n("div", { "data-chat-tips": !0, children: [
377
377
  /* @__PURE__ */ e("p", { className: "border-b border-slate-100 px-4 py-2.5 text-[12.5px] font-semibold text-slate-800 dark:border-border/60 dark:text-slate-100", children: "Things this chat can do" }),
378
- /* @__PURE__ */ e("div", { className: "grid grid-cols-[122px_1fr] gap-x-3 gap-y-0 px-4 py-1.5", children: l.map((s) => /* @__PURE__ */ a(
378
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-[122px_1fr] gap-x-3 gap-y-0 px-4 py-1.5", children: l.map((s) => /* @__PURE__ */ n(
379
379
  "div",
380
380
  {
381
381
  className: "col-span-2 grid grid-cols-subgrid border-b border-slate-100/70 py-2 last:border-b-0 dark:border-border/40",
@@ -397,24 +397,24 @@ function el({ botName: n }) {
397
397
  )) })
398
398
  ] });
399
399
  }
400
- function tl({ room: n }) {
401
- const r = Le(), l = me(), s = tt(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, m = o > 0 ? n.slice(o + 1) : null, c = !!i && !!m && n !== r.globalRoom && i !== "dm" && i !== "ch", x = qt(), { data: f } = Ue({
402
- queryKey: ["nvr-chat-room-card", n],
400
+ function tl({ room: a }) {
401
+ const r = Le(), l = me(), s = tt(), o = a.indexOf(":"), i = o > 0 ? a.slice(0, o) : null, m = o > 0 ? a.slice(o + 1) : null, c = !!i && !!m && a !== r.globalRoom && i !== "dm" && i !== "ch", x = qt(), { data: f } = Ue({
402
+ queryKey: ["nvr-chat-room-card", a],
403
403
  queryFn: async () => {
404
- var Y, G, H, R;
405
- const S = (await x.fetchQuery(ua(s))).find((J) => J.is_active && J.prefix === i);
404
+ var Z, Q, z, R;
405
+ const S = (await x.fetchQuery(un(s))).find((Y) => Y.is_active && Y.prefix === i);
406
406
  if (!S) return null;
407
- const $ = (G = (Y = (await s.request(
408
- ye(`/items/${S.collection}`, {
407
+ const $ = (Q = (Z = (await s.request(
408
+ ke(`/items/${S.collection}`, {
409
409
  limit: 1,
410
410
  fields: "id",
411
411
  filter: JSON.stringify({ [S.match_field]: { _eq: m } })
412
412
  })
413
- )).data) == null ? void 0 : Y[0]) == null ? void 0 : G.id;
413
+ )).data) == null ? void 0 : Z[0]) == null ? void 0 : Q.id;
414
414
  if ($ == null) return null;
415
- const q = (R = (H = (await s.request(
416
- ye(`/pipelines/instance/${S.collection}/${$}`)
417
- )).data) == null ? void 0 : H.instance) == null ? void 0 : R.current_state_obj;
415
+ const q = (R = (z = (await s.request(
416
+ ke(`/pipelines/instance/${S.collection}/${$}`)
417
+ )).data) == null ? void 0 : z.instance) == null ? void 0 : R.current_state_obj;
418
418
  return {
419
419
  collection: S.collection,
420
420
  type_label: S.label ?? S.collection.replace(/_/g, " "),
@@ -425,10 +425,10 @@ function tl({ room: n }) {
425
425
  },
426
426
  enabled: c,
427
427
  staleTime: 6e4
428
- }), d = ma(n, c && !!f);
428
+ }), d = mn(a, c && !!f);
429
429
  if (!c || !f) return null;
430
- const y = (r.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (d == null ? void 0 : d.sla) ?? null, M = (U == null ? void 0 : U.status) === "breached" ? "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300" : (U == null ? void 0 : U.status) === "warning" ? "bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300" : "bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300";
431
- return /* @__PURE__ */ a(
430
+ const k = (r.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (d == null ? void 0 : d.sla) ?? null, A = (U == null ? void 0 : U.status) === "breached" ? "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300" : (U == null ? void 0 : U.status) === "warning" ? "bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300" : "bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300";
431
+ return /* @__PURE__ */ n(
432
432
  "div",
433
433
  {
434
434
  className: g("flex shrink-0 items-center gap-2 border-b px-3 py-1.5", l.divider),
@@ -450,34 +450,34 @@ function tl({ room: n }) {
450
450
  U && /* @__PURE__ */ e(
451
451
  "span",
452
452
  {
453
- className: g("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", M),
453
+ className: g("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", A),
454
454
  title: U.due_hours != null ? `${Math.round(U.elapsed_hours ?? 0)}h in this state of ${U.due_hours}h allowed` : void 0,
455
455
  "data-chat-room-sla": U.status,
456
456
  children: U.status === "breached" ? "Past SLA" : U.status === "warning" ? "SLA soon" : "On time"
457
457
  }
458
458
  ),
459
- d && d.owners.length > 0 && /* @__PURE__ */ a(
459
+ d && d.owners.length > 0 && /* @__PURE__ */ n(
460
460
  "span",
461
461
  {
462
462
  className: "ml-auto flex -space-x-1.5",
463
463
  title: `Owners: ${d.owners.map((C) => C.name).join(", ")}`,
464
464
  "data-chat-room-owners": d.owners.length,
465
465
  children: [
466
- d.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(K, { id: C.id, name: C.name, size: 18, presence: !1 }, C.id)),
467
- d.owners.length > 4 && /* @__PURE__ */ a("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-slate-200 px-1 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-slate-300", children: [
466
+ d.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(J, { id: C.id, name: C.name, size: 18, presence: !1 }, C.id)),
467
+ d.owners.length > 4 && /* @__PURE__ */ n("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-slate-200 px-1 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-slate-300", children: [
468
468
  "+",
469
469
  d.owners.length - 4
470
470
  ] })
471
471
  ]
472
472
  }
473
473
  ),
474
- y && /* @__PURE__ */ e(
474
+ k && /* @__PURE__ */ e(
475
475
  "button",
476
476
  {
477
477
  type: "button",
478
478
  onClick: () => {
479
479
  var C;
480
- return (C = r.navigate) == null ? void 0 : C.call(r, y);
480
+ return (C = r.navigate) == null ? void 0 : C.call(r, k);
481
481
  },
482
482
  className: g(
483
483
  "text-[11px] font-medium hover:underline",
@@ -491,15 +491,15 @@ function tl({ room: n }) {
491
491
  }
492
492
  );
493
493
  }
494
- function nl(n, r) {
495
- if (!n) return null;
494
+ function al(a, r) {
495
+ if (!a) return null;
496
496
  const l = Wt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, s = /* @__PURE__ */ new Date();
497
497
  let o, i;
498
498
  try {
499
499
  const c = (x) => new Intl.DateTimeFormat("en-US", { timeZone: x, hour: "numeric", minute: "2-digit" }).format(
500
500
  s
501
501
  );
502
- o = c(n), i = c(l);
502
+ o = c(a), i = c(l);
503
503
  } catch {
504
504
  return null;
505
505
  }
@@ -507,26 +507,26 @@ function nl(n, r) {
507
507
  const m = r.split(/\s+/)[0] || r;
508
508
  return `${o} for ${m}`;
509
509
  }
510
- function va() {
511
- const [n, r] = T(0);
512
- return ae(() => {
510
+ function vn() {
511
+ const [a, r] = T(0);
512
+ return ne(() => {
513
513
  const l = setInterval(() => r((s) => s + 1), 6e4);
514
514
  return () => clearInterval(l);
515
- }, []), n;
515
+ }, []), a;
516
516
  }
517
- function al({ peerId: n, name: r }) {
518
- va();
519
- const { state: l, title: s } = ba(n), o = Yt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
520
- const f = xa(o);
517
+ function nl({ peerId: a, name: r }) {
518
+ vn();
519
+ const { state: l, title: s } = bn(a), o = Yt(a), i = l === "online" ? "Active now" : l === "offline" ? (() => {
520
+ const f = xn(o);
521
521
  return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
522
- })() : s, m = nl((o == null ? void 0 : o.timezone) ?? null, r), c = ga(o), x = c ? (o == null ? void 0 : o.delegate) ?? null : null;
523
- return /* @__PURE__ */ a(
522
+ })() : s, m = al((o == null ? void 0 : o.timezone) ?? null, r), c = gn(o), x = c ? (o == null ? void 0 : o.delegate) ?? null : null;
523
+ return /* @__PURE__ */ n(
524
524
  "p",
525
525
  {
526
526
  className: "flex min-w-0 items-center gap-1.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
527
527
  "data-chat-dm-peer-line": l,
528
528
  children: [
529
- c && /* @__PURE__ */ a(ke, { children: [
529
+ c && /* @__PURE__ */ n(we, { children: [
530
530
  /* @__PURE__ */ e(
531
531
  "span",
532
532
  {
@@ -535,7 +535,7 @@ function al({ peerId: n, name: r }) {
535
535
  children: c
536
536
  }
537
537
  ),
538
- x && hr() && /* @__PURE__ */ a(
538
+ x && hr() && /* @__PURE__ */ n(
539
539
  "button",
540
540
  {
541
541
  type: "button",
@@ -552,7 +552,7 @@ function al({ peerId: n, name: r }) {
552
552
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" })
553
553
  ] }),
554
554
  /* @__PURE__ */ e("span", { className: "truncate", children: i }),
555
- m && /* @__PURE__ */ a(ke, { children: [
555
+ m && /* @__PURE__ */ n(we, { children: [
556
556
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" }),
557
557
  /* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (o == null ? void 0 : o.timezone) ?? void 0, children: m })
558
558
  ] })
@@ -560,8 +560,8 @@ function al({ peerId: n, name: r }) {
560
560
  }
561
561
  );
562
562
  }
563
- function Hn({
564
- room: n,
563
+ function Fa({
564
+ room: a,
565
565
  label: r,
566
566
  onBack: l,
567
567
  onOpenSettings: s,
@@ -570,42 +570,42 @@ function Hn({
570
570
  anchor: m = null,
571
571
  openThread: c = null
572
572
  }) {
573
- var vn, yn, kn, wn, Nn, Cn, _n, Sn, Tn, Un;
574
- const x = Le(), f = me(), d = tt(), b = x.me, y = Mr(n), U = b ? Te(n, b.id) : null, M = !r.trim() || r.toLowerCase() === n.toLowerCase() || /^dm:/i.test(r), { data: C } = Ue({
573
+ var ga, va, ya, ka, wa, Na, Ca, _a, Sa, Ta;
574
+ const x = Le(), f = me(), d = tt(), b = x.me, k = Mr(a), U = b ? Te(a, b.id) : null, A = !r.trim() || r.toLowerCase() === a.toLowerCase() || /^dm:/i.test(r), { data: C } = Ue({
575
575
  ...Us(d, U),
576
- enabled: !!U && M,
576
+ enabled: !!U && A,
577
577
  staleTime: 12e4
578
- }), S = M && U ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : r, [W, $] = T(m);
579
- ae(() => $(m), [m]);
580
- const { messages: v, loading: q, hasOlder: Y, hasNewer: G, loadOlder: H, loadingOlder: R } = Zs(
581
- n,
578
+ }), S = A && U ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : r, [W, $] = T(m);
579
+ ne(() => $(m), [m]);
580
+ const { messages: y, loading: q, hasOlder: Z, hasNewer: Q, loadOlder: z, loadingOlder: R } = Zs(
581
+ a,
582
582
  W
583
583
  );
584
- Vs(n);
585
- const J = pa(n), V = Xs(), Z = er(n), X = tr(n.startsWith("dm:") ? n : null), oe = nr(n), se = ar(n), pe = sr(n), p = rr(n), E = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== x.globalRoom && n.includes(":"), u = ma(n, E), P = wr(n, !!u), Ce = n.startsWith("ch:"), { data: we = [] } = Ue({
586
- queryKey: ["chat-read-marks", n],
584
+ Vs(a);
585
+ const Y = pn(a), X = Xs(), V = er(a), ee = tr(a.startsWith("dm:") ? a : null), oe = ar(a), se = nr(a), pe = sr(a), p = rr(a), E = !a.startsWith("dm:") && !a.startsWith("ch:") && a !== x.globalRoom && a.includes(":"), u = mn(a, E), P = wr(a, !!u), Ce = a.startsWith("ch:"), { data: he = [] } = Ue({
586
+ queryKey: ["chat-read-marks", a],
587
587
  queryFn: () => d.request(
588
- ye(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
588
+ ke(`/chat/rooms/${encodeURIComponent(a)}/read-marks`)
589
589
  ).then((t) => t.data ?? []).catch(() => []),
590
590
  enabled: Ce,
591
591
  refetchInterval: Ce ? 3e4 : !1,
592
592
  staleTime: 15e3
593
- }), Pe = (t) => we.filter(
593
+ }), Pe = (t) => he.filter(
594
594
  (h) => h.user !== String(t.sender ?? "") && new Date(h.last_read_at).getTime() >= new Date(t.date_created).getTime()
595
595
  ), _e = qt(), { data: Ae = [] } = Ue({
596
596
  queryKey: ["chat-saved"],
597
- queryFn: () => d.request(ye("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
597
+ queryFn: () => d.request(ke("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
598
598
  staleTime: 6e4
599
- }), ie = ve(() => new Set(Ae.map((t) => t.id)), [Ae]), ze = Fe({
599
+ }), ie = ye(() => new Set(Ae.map((t) => t.id)), [Ae]), ze = Fe({
600
600
  mutationFn: (t) => d.request(He(`/chat/messages/${t}/save`, {})),
601
601
  onSuccess: () => void _e.invalidateQueries({ queryKey: ["chat-saved"] })
602
602
  }), [Ge, Qe] = T(null), Ie = Fe({
603
603
  mutationFn: () => d.request(
604
- He("/chat/rooms/summary", { room: n })
604
+ He("/chat/rooms/summary", { room: a })
605
605
  ).then((t) => t.data),
606
606
  onSuccess: (t) => Qe((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
607
607
  onError: () => Qe("Summary unavailable.")
608
- }), k = Fe({
608
+ }), v = Fe({
609
609
  mutationFn: async (t) => {
610
610
  if (!u || !b) throw new Error("no record");
611
611
  await d.request(
@@ -618,17 +618,17 @@ function Hn({
618
618
  );
619
619
  },
620
620
  onSuccess: () => {
621
- u && Ts(_e, u.collection, u.id), ge.success("Task created from message — assigned to you");
621
+ u && Ts(_e, u.collection, u.id), ve.success("Task created from message — assigned to you");
622
622
  },
623
- onError: () => ge.error("Could not create a task")
624
- }), A = Fe({
623
+ onError: () => ve.error("Could not create a task")
624
+ }), M = Fe({
625
625
  mutationFn: (t) => d.request(He(`/chat/messages/${t.id}/to-notes`, {})),
626
- onSuccess: () => ge.success(`Copied to the Notes of ${(u == null ? void 0 : u.label) ?? "the record"}`),
626
+ onSuccess: () => ve.success(`Copied to the Notes of ${(u == null ? void 0 : u.label) ?? "the record"}`),
627
627
  onError: (t) => {
628
628
  var h;
629
- return ge.error(((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not copy it");
629
+ return ve.error(((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not copy it");
630
630
  }
631
- }), I = Fe({
631
+ }), L = Fe({
632
632
  mutationFn: (t) => d.request(
633
633
  He(`/chat/messages/${t.messageId}/attach-to-record`, {
634
634
  file_id: t.fileId,
@@ -637,99 +637,99 @@ function Hn({
637
637
  ),
638
638
  onSuccess: (t, h) => {
639
639
  var N;
640
- return ge.success(
641
- `Attached to ${(u == null ? void 0 : u.label) ?? "the record"} — ${((N = P.find((F) => F.field === h.field)) == null ? void 0 : N.label) ?? h.field}`
640
+ return ve.success(
641
+ `Attached to ${(u == null ? void 0 : u.label) ?? "the record"} — ${((N = P.find((H) => H.field === h.field)) == null ? void 0 : N.label) ?? h.field}`
642
642
  );
643
643
  },
644
644
  onError: (t) => {
645
645
  var h;
646
- return ge.error(
646
+ return ve.error(
647
647
  ((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not attach it"
648
648
  );
649
649
  }
650
- }), te = Fe({
650
+ }), F = Fe({
651
651
  mutationFn: (t) => d.request(ws(`/chat/messages/${t}`, { no_preview: !0 })),
652
- onSuccess: () => void _e.invalidateQueries({ queryKey: ["nvr-chat", n] })
653
- }), De = lr(n), _ = or(n), { isAdmin: L } = gt(), { setMuted: j, setNotifyMode: ce, setArchived: ee, setStarred: ne, dismissWelcome: Q, leave: re } = Gt(), { rooms: fe, loading: Na } = ia(), Zt = fe.find((t) => t.room === n) ?? null, { rooms: Ca } = ca(!Na && !Zt), w = Zt ?? Ca.find((t) => t.room === n) ?? null, _a = ya(w), Vt = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", he = ir(), [rt, Sa] = T(!1), [lt, Xt] = T(""), [Ta, vt] = T(null), [en, tn] = T(""), [Ua, yt] = T(null), Da = Lr(n), [$a, nn] = T(null), Ma = As(), [an, je] = T(null), sn = cr(c ? n : null, c), rn = !!sn.root && !sn.root.deleted_at;
654
- ae(() => {
655
- c && rn && je(c);
656
- }, [c, rn]);
657
- const [Aa, ln] = T(null), [Ra, on] = T(null), [kt, Ke] = T(!1), [Oa, wt] = T(!1), [de, Je] = T(null), [Ye, ot] = T(
652
+ onSuccess: () => void _e.invalidateQueries({ queryKey: ["nvr-chat", a] })
653
+ }), De = lr(a), _ = or(a), { isAdmin: I } = gt(), { setMuted: j, setNotifyMode: ce, setArchived: te, setStarred: ae, dismissWelcome: K, leave: re } = Gt(), { rooms: xe, loading: Nn } = on(), Zt = xe.find((t) => t.room === a) ?? null, { rooms: Cn } = cn(!Nn && !Zt), w = Zt ?? Cn.find((t) => t.room === a) ?? null, _n = yn(w), Vt = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", fe = ir(), [rt, Sn] = T(!1), [lt, Xt] = T(""), [Tn, vt] = T(null), [ea, ta] = T(""), [Un, yt] = T(null), Dn = Lr(a), [$n, aa] = T(null), Mn = As(), [na, je] = T(null), sa = cr(c ? a : null, c), ra = !!sa.root && !sa.root.deleted_at;
654
+ ne(() => {
655
+ c && ra && je(c);
656
+ }, [c, ra]);
657
+ const [An, la] = T(null), [Rn, oa] = T(null), [kt, Ke] = T(!1), [On, wt] = T(!1), [de, Je] = T(null), [Ye, ot] = T(
658
658
  m && "around" in m ? m.around : null
659
- ), [it, Nt] = T(null), Ze = Ls(n, (b == null ? void 0 : b.id) ?? null), cn = ue(null), Ct = ue(null), _t = ue(Math.max(0, i ?? 0)), $e = ue(!1), Re = ue(null), dn = ue(null), le = ue(!m), Ve = ue(0), Xe = ue(null), St = ue(0), ct = () => {
659
+ ), [it, Nt] = T(null), Ze = Ls(a, (b == null ? void 0 : b.id) ?? null), ia = ue(null), Ct = ue(null), _t = ue(Math.max(0, i ?? 0)), $e = ue(!1), Re = ue(null), ca = ue(null), le = ue(!m), Ve = ue(0), Xe = ue(null), St = ue(0), ct = () => {
660
660
  const t = Re.current;
661
661
  t && (t.scrollTop = t.scrollHeight);
662
662
  }, Tt = (t) => {
663
663
  var N;
664
664
  const h = (N = Re.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
665
665
  return h ? (h.scrollIntoView({ block: "center" }), le.current = !1, ot(t), !0) : Ne.reveal(t) ? (le.current = !1, ot(t), !0) : !1;
666
- }, un = (t) => {
666
+ }, da = (t) => {
667
667
  Ke(!1), Tt(t) || ($e.current = !1, le.current = !1, ot(t), $({ around: t }));
668
668
  };
669
- ae(() => {
669
+ ne(() => {
670
670
  if (Ye == null) return;
671
671
  const t = setTimeout(() => ot(null), 2400);
672
672
  return () => clearTimeout(t);
673
- }, [Ye]), ae(() => {
673
+ }, [Ye]), ne(() => {
674
674
  $e.current = !1, Ve.current = 0, Je(null);
675
- }, [n, W]), ae(() => {
675
+ }, [a, W]), ne(() => {
676
676
  var Oe, Be;
677
- const t = Re.current, h = ((Oe = v[0]) == null ? void 0 : Oe.id) ?? null;
678
- if (!$e.current && v.length > 0) {
679
- if ($e.current = !0, Ve.current = v.length, Xe.current = h, Ye != null && Tt(Ye)) return;
677
+ const t = Re.current, h = ((Oe = y[0]) == null ? void 0 : Oe.id) ?? null;
678
+ if (!$e.current && y.length > 0) {
679
+ if ($e.current = !0, Ve.current = y.length, Xe.current = h, Ye != null && Tt(Ye)) return;
680
680
  Ct.current && !W ? (Ct.current.scrollIntoView({ block: "center" }), le.current = !1) : W || (ct(), le.current = !0);
681
681
  return;
682
682
  }
683
683
  if (h !== Xe.current && Xe.current != null && t) {
684
- Xe.current = h, Ve.current = v.length;
684
+ Xe.current = h, Ve.current = y.length;
685
685
  return;
686
686
  }
687
687
  Xe.current = h;
688
- const N = v.length - Ve.current;
689
- if (Ve.current = v.length, N <= 0) return;
690
- const F = v[v.length - 1], z = !!(F != null && F.sender) && F.sender.toLowerCase() === ((Be = b == null ? void 0 : b.id) == null ? void 0 : Be.toLowerCase());
691
- if (le.current || z)
688
+ const N = y.length - Ve.current;
689
+ if (Ve.current = y.length, N <= 0) return;
690
+ const H = y[y.length - 1], G = !!(H != null && H.sender) && H.sender.toLowerCase() === ((Be = b == null ? void 0 : b.id) == null ? void 0 : Be.toLowerCase());
691
+ if (le.current || G)
692
692
  ct(), le.current = !0, Je(null);
693
693
  else {
694
- const Me = v[v.length - N];
695
- Je((be) => ({ count: ((be == null ? void 0 : be.count) ?? 0) + N, firstId: (be == null ? void 0 : be.firstId) ?? Me.id }));
694
+ const Me = y[y.length - N];
695
+ Je((ge) => ({ count: ((ge == null ? void 0 : ge.count) ?? 0) + N, firstId: (ge == null ? void 0 : ge.firstId) ?? Me.id }));
696
696
  }
697
- }, [v]), ae(() => {
698
- const t = dn.current;
697
+ }, [y]), ne(() => {
698
+ const t = ca.current;
699
699
  if (!t || typeof ResizeObserver > "u") return;
700
700
  const h = new ResizeObserver(() => {
701
701
  var N;
702
702
  le.current && ct(), St.current = ((N = Re.current) == null ? void 0 : N.scrollHeight) ?? 0;
703
703
  });
704
704
  return h.observe(t), () => h.disconnect();
705
- }, []), ae(() => {
706
- var N, F;
707
- const t = v[v.length - 1];
708
- if (!t || !$e.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((F = b == null ? void 0 : b.id) == null ? void 0 : F.toLowerCase()))
705
+ }, []), ne(() => {
706
+ var N, H;
707
+ const t = y[y.length - 1];
708
+ if (!t || !$e.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((H = b == null ? void 0 : b.id) == null ? void 0 : H.toLowerCase()))
709
709
  return;
710
710
  const h = Date.now() - new Date(t.date_created).getTime();
711
711
  h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && d.request(He("/chat/health/delivery", { ms: h })).catch(() => {
712
712
  });
713
- }, [(vn = v[v.length - 1]) == null ? void 0 : vn.id]), ae(() => {
714
- if (!it || !he) return;
715
- if (v.some(
716
- (N) => (N.sender_name ?? "").toLowerCase() === he.toLowerCase() && new Date(N.date_created).getTime() >= it - 5e3
713
+ }, [(ga = y[y.length - 1]) == null ? void 0 : ga.id]), ne(() => {
714
+ if (!it || !fe) return;
715
+ if (y.some(
716
+ (N) => (N.sender_name ?? "").toLowerCase() === fe.toLowerCase() && new Date(N.date_created).getTime() >= it - 5e3
717
717
  )) {
718
718
  Nt(null);
719
719
  return;
720
720
  }
721
721
  const h = setTimeout(() => Nt(null), 9e4);
722
722
  return () => clearTimeout(h);
723
- }, [it, he, v]);
724
- const dt = ve(() => {
723
+ }, [it, fe, y]);
724
+ const dt = ye(() => {
725
725
  const t = /* @__PURE__ */ new Set();
726
- for (const h of v) for (const N of h.attachments ?? []) t.add(N);
726
+ for (const h of y) for (const N of h.attachments ?? []) t.add(N);
727
727
  return [...t];
728
- }, [v]), { data: Ut } = Ue({
728
+ }, [y]), { data: Ut } = Ue({
729
729
  queryKey: ["nvr-chat-attachments", dt.slice().sort().join("|")],
730
730
  queryFn: async () => {
731
731
  const t = await d.request(
732
- ye("/files", {
732
+ ke("/files", {
733
733
  filter: JSON.stringify({ id: { _in: dt } }),
734
734
  limit: String(dt.length),
735
735
  fields: "id,filename_download,title,type,filesize,tags"
@@ -740,37 +740,37 @@ function Hn({
740
740
  enabled: dt.length > 0,
741
741
  staleTime: 5 * 6e4
742
742
  });
743
- ae(() => {
744
- W || V.mutate(n);
745
- }, [n, v.length, W]);
746
- const La = (t) => {
747
- if (le.current = !0, W && $(null), he) {
748
- const h = he.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
743
+ ne(() => {
744
+ W || X.mutate(a);
745
+ }, [a, y.length, W]);
746
+ const Ln = (t) => {
747
+ if (le.current = !0, W && $(null), fe) {
748
+ const h = fe.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
749
749
  new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) && Nt(Date.now());
750
750
  }
751
- }, Ee = (yn = b == null ? void 0 : b.id) == null ? void 0 : yn.toLowerCase(), xe = rt && lt.trim().length > 0, Se = ve(
752
- () => xe ? v.filter((t) => t.message.toLowerCase().includes(lt.trim().toLowerCase())) : v,
753
- [v, xe, lt]
754
- ), Pa = ve(() => {
751
+ }, Ee = (va = b == null ? void 0 : b.id) == null ? void 0 : va.toLowerCase(), be = rt && lt.trim().length > 0, Se = ye(
752
+ () => be ? y.filter((t) => t.message.toLowerCase().includes(lt.trim().toLowerCase())) : y,
753
+ [y, be, lt]
754
+ ), Pn = ye(() => {
755
755
  var t;
756
- if (xe) return -1;
756
+ if (be) return -1;
757
757
  for (let h = Se.length - 1; h >= 0; h--)
758
758
  if (((t = Se[h].sender) == null ? void 0 : t.toLowerCase()) === Ee) return h;
759
759
  return -1;
760
- }, [Se, Ee, xe]), mn = X ? new Date(X).getTime() : 0, qe = zt().chat_density === "compact" ? "compact" : "comfortable", pn = ue(null), Ia = ve(() => Se.map((t) => t.id), [Se]), Ne = Cr({
760
+ }, [Se, Ee, be]), ua = ee ? new Date(ee).getTime() : 0, qe = zt().chat_density === "compact" ? "compact" : "comfortable", ma = ue(null), In = ye(() => Se.map((t) => t.id), [Se]), Ne = Cr({
761
761
  scrollerRef: Re,
762
- listRef: pn,
763
- ids: Ia,
762
+ listRef: ma,
763
+ ids: In,
764
764
  estimate: qe === "compact" ? 40 : 72,
765
- resetKey: `${n}|${JSON.stringify(W)}|${xe ? "search" : ""}`,
765
+ resetKey: `${a}|${JSON.stringify(W)}|${be ? "search" : ""}`,
766
766
  pinnedRef: le
767
- }), B = (w == null ? void 0 : w.channel) ?? null, hn = !!B && !!b && String(B.created_by ?? "").toUpperCase() === b.id.toUpperCase(), fn = B != null && B.announce && !hn && !L ? B.id === oa ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, xn = b ? Te(n, b.id) : null, ja = Yt(xn);
768
- va();
769
- const Ea = xn ? Nr(ja, S, /* @__PURE__ */ new Date()) : null;
767
+ }), B = (w == null ? void 0 : w.channel) ?? null, pa = !!B && !!b && String(B.created_by ?? "").toUpperCase() === b.id.toUpperCase(), ha = B != null && B.announce && !pa && !I ? B.id === ln ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, fa = b ? Te(a, b.id) : null, jn = Yt(fa);
768
+ vn();
769
+ const En = fa ? Nr(jn, S, /* @__PURE__ */ new Date()) : null;
770
770
  dr(), vr();
771
- const qa = !!(B != null && B.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !B.is_direct, Ba = (t, h) => t.entity ? /* @__PURE__ */ e(Fn, { token: t.text, url: x.entityUrl(t.entity) }, h) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), Wa = (t, h) => t.entity ? /* @__PURE__ */ e(Fn, { token: t.text, url: x.entityUrl(t.entity), mine: !0 }, h) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), bn = (t, h = {}) => {
772
- var Dn, $n;
773
- const N = ((Dn = t.sender) == null ? void 0 : Dn.toLowerCase()) === Ee;
771
+ const qn = !!(B != null && B.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !B.is_direct, Bn = (t, h) => t.entity ? /* @__PURE__ */ e(Wa, { token: t.text, url: x.entityUrl(t.entity) }, h) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), Wn = (t, h) => t.entity ? /* @__PURE__ */ e(Wa, { token: t.text, url: x.entityUrl(t.entity), mine: !0 }, h) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), xa = (t, h = {}) => {
772
+ var Ua, Da;
773
+ const N = ((Ua = t.sender) == null ? void 0 : Ua.toLowerCase()) === Ee;
774
774
  if (t.is_system)
775
775
  return /* @__PURE__ */ e(
776
776
  "div",
@@ -778,7 +778,7 @@ function Hn({
778
778
  className: "flex justify-center px-4 py-0.5 text-center text-[11px] leading-snug text-slate-500 dark:text-slate-400",
779
779
  "data-chat-msg": t.id,
780
780
  "data-chat-system": !0,
781
- children: /* @__PURE__ */ a("span", { children: [
781
+ children: /* @__PURE__ */ n("span", { children: [
782
782
  t.message,
783
783
  /* @__PURE__ */ e("span", { className: "ml-1.5 text-[10px] text-slate-400", children: new Date(t.date_created).toLocaleTimeString("en-US", {
784
784
  hour: "numeric",
@@ -787,13 +787,13 @@ function Hn({
787
787
  ] })
788
788
  }
789
789
  );
790
- const F = h.isLastMine && mn > 0 && new Date(t.date_created).getTime() <= mn, z = !!t.deleted_at, Oe = N && !z && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, Be = !z && (N || L), Me = Ta === t.id, be = /* @__PURE__ */ new Map();
790
+ const H = h.isLastMine && ua > 0 && new Date(t.date_created).getTime() <= ua, G = !!t.deleted_at, Oe = N && !G && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, Be = !G && (N || I), Me = Tn === t.id, ge = /* @__PURE__ */ new Map();
791
791
  for (const D of t.reactions ?? []) {
792
- const O = be.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
793
- O.count++, (($n = D.user) == null ? void 0 : $n.toLowerCase()) === Ee && (O.mine = !0), D.user_name && O.names.push(D.user_name), be.set(D.emoji, O);
792
+ const O = ge.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
793
+ O.count++, ((Da = D.user) == null ? void 0 : Da.toLowerCase()) === Ee && (O.mine = !0), D.user_name && O.names.push(D.user_name), ge.set(D.emoji, O);
794
794
  }
795
795
  const We = "rounded-full p-0.5 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200";
796
- return /* @__PURE__ */ a(
796
+ return /* @__PURE__ */ n(
797
797
  "div",
798
798
  {
799
799
  className: g(
@@ -810,13 +810,13 @@ function Hn({
810
810
  className: "h-fit shrink-0 rounded-full",
811
811
  "aria-label": `${t.sender_name ?? "Sender"} — profile`,
812
812
  "data-chat-avatar-card": !0,
813
- children: /* @__PURE__ */ e(K, { id: t.sender, name: t.sender_name, size: qe === "compact" ? 22 : 26 })
813
+ children: /* @__PURE__ */ e(J, { id: t.sender, name: t.sender_name, size: qe === "compact" ? 22 : 26 })
814
814
  }
815
815
  ) }),
816
- /* @__PURE__ */ a("div", { className: g("relative max-w-[78%]", N && "text-right"), children: [
817
- !N && h.showSender !== !1 && /* @__PURE__ */ a("p", { className: "mb-0.5 text-[10.5px] font-medium text-slate-500 dark:text-slate-400", children: [
816
+ /* @__PURE__ */ n("div", { className: g("relative max-w-[78%]", N && "text-right"), children: [
817
+ !N && h.showSender !== !1 && /* @__PURE__ */ n("p", { className: "mb-0.5 text-[10.5px] font-medium text-slate-500 dark:text-slate-400", children: [
818
818
  t.sender_name ?? "Unknown",
819
- t.masquerade_admin_name && /* @__PURE__ */ a(
819
+ t.masquerade_admin_name && /* @__PURE__ */ n(
820
820
  "span",
821
821
  {
822
822
  className: "ml-1 font-normal text-violet-600 dark:text-violet-300",
@@ -829,12 +829,12 @@ function Hn({
829
829
  }
830
830
  )
831
831
  ] }),
832
- !z && !Me && /* @__PURE__ */ a(
832
+ !G && !Me && /* @__PURE__ */ n(
833
833
  "div",
834
834
  {
835
835
  className: g(
836
836
  "absolute -top-3 z-10 hidden items-center gap-0.5 rounded-full border px-1 py-0.5 shadow-sm group-hover/msg:flex",
837
- $a === t.id && "flex",
837
+ $n === t.id && "flex",
838
838
  f.surface,
839
839
  "border-slate-200 dark:border-border",
840
840
  N ? "right-0" : "left-0"
@@ -858,7 +858,7 @@ function Hn({
858
858
  label: "More reactions",
859
859
  className: We,
860
860
  onPick: (D) => se.mutate({ messageId: t.id, emoji: D }),
861
- onOpenChange: (D) => nn(D ? t.id : null)
861
+ onOpenChange: (D) => aa(D ? t.id : null)
862
862
  }
863
863
  ),
864
864
  !h.inThread && !t.parent_id && /* @__PURE__ */ e(
@@ -879,19 +879,19 @@ function Hn({
879
879
  {
880
880
  type: "button",
881
881
  title: "Quote",
882
- onClick: () => h.inThread ? on(t) : ln(t),
882
+ onClick: () => h.inThread ? oa(t) : la(t),
883
883
  className: We,
884
884
  "data-chat-quote": !0,
885
885
  children: /* @__PURE__ */ e(is, { className: "h-3 w-3" })
886
886
  }
887
887
  ),
888
- u && /* @__PURE__ */ a(ke, { children: [
888
+ u && /* @__PURE__ */ n(we, { children: [
889
889
  /* @__PURE__ */ e(
890
890
  "button",
891
891
  {
892
892
  type: "button",
893
893
  title: "Make a task from this message",
894
- onClick: () => k.mutate(t),
894
+ onClick: () => v.mutate(t),
895
895
  className: We,
896
896
  children: /* @__PURE__ */ e(cs, { className: "h-3 w-3" })
897
897
  }
@@ -901,7 +901,7 @@ function Hn({
901
901
  {
902
902
  type: "button",
903
903
  title: `Copy into the Notes of ${u.label}`,
904
- onClick: () => A.mutate(t),
904
+ onClick: () => M.mutate(t),
905
905
  className: We,
906
906
  "data-chat-to-notes": !0,
907
907
  children: /* @__PURE__ */ e(ds, { className: "h-3 w-3" })
@@ -940,13 +940,13 @@ function Hn({
940
940
  type: "button",
941
941
  title: "Edit",
942
942
  onClick: () => {
943
- vt(t.id), tn(t.message), yt(null);
943
+ vt(t.id), ta(t.message), yt(null);
944
944
  },
945
945
  className: We,
946
946
  children: /* @__PURE__ */ e(ms, { className: "h-3 w-3" })
947
947
  }
948
948
  ),
949
- Be && (Ua === t.id ? /* @__PURE__ */ e(
949
+ Be && (Un === t.id ? /* @__PURE__ */ e(
950
950
  "button",
951
951
  {
952
952
  type: "button",
@@ -971,15 +971,15 @@ function Hn({
971
971
  Pr,
972
972
  {
973
973
  messageId: t.id,
974
- actions: Ir(Da, t, Ee),
974
+ actions: Ir(Dn, t, Ee),
975
975
  navigate: x.navigate,
976
- onOpenChange: (D) => nn(D ? t.id : null)
976
+ onOpenChange: (D) => aa(D ? t.id : null)
977
977
  }
978
978
  )
979
979
  ]
980
980
  }
981
981
  ),
982
- t.urgent && !z && /* @__PURE__ */ a(
982
+ t.urgent && !G && /* @__PURE__ */ n(
983
983
  "p",
984
984
  {
985
985
  className: g(
@@ -993,13 +993,13 @@ function Hn({
993
993
  ]
994
994
  }
995
995
  ),
996
- z ? /* @__PURE__ */ e("div", { className: "inline-block rounded-2xl border border-dashed border-slate-200 px-3 py-1.5 text-left text-[11.5px] italic text-slate-500 dark:border-border", children: "Message removed" }) : Me ? /* @__PURE__ */ a(
996
+ G ? /* @__PURE__ */ e("div", { className: "inline-block rounded-2xl border border-dashed border-slate-200 px-3 py-1.5 text-left text-[11.5px] italic text-slate-500 dark:border-border", children: "Message removed" }) : Me ? /* @__PURE__ */ n(
997
997
  "form",
998
998
  {
999
999
  className: "flex items-center gap-1",
1000
1000
  onSubmit: (D) => {
1001
1001
  D.preventDefault();
1002
- const O = en.trim();
1002
+ const O = ea.trim();
1003
1003
  O && O !== t.message && De.mutate({ messageId: t.id, text: O }), vt(null);
1004
1004
  },
1005
1005
  children: [
@@ -1007,8 +1007,8 @@ function Hn({
1007
1007
  "input",
1008
1008
  {
1009
1009
  autoFocus: !0,
1010
- value: en,
1011
- onChange: (D) => tn(D.target.value),
1010
+ value: ea,
1011
+ onChange: (D) => ta(D.target.value),
1012
1012
  onKeyDown: (D) => {
1013
1013
  D.key === "Escape" && vt(null);
1014
1014
  },
@@ -1029,7 +1029,7 @@ function Hn({
1029
1029
  )
1030
1030
  ]
1031
1031
  }
1032
- ) : /* @__PURE__ */ a(
1032
+ ) : /* @__PURE__ */ n(
1033
1033
  "div",
1034
1034
  {
1035
1035
  className: g(
@@ -1039,11 +1039,11 @@ function Hn({
1039
1039
  t.urgent && "ring-2 ring-red-400/70"
1040
1040
  ),
1041
1041
  children: [
1042
- t.quote && /* @__PURE__ */ a(
1042
+ t.quote && /* @__PURE__ */ n(
1043
1043
  "button",
1044
1044
  {
1045
1045
  type: "button",
1046
- onClick: () => un(t.quote.id),
1046
+ onClick: () => da(t.quote.id),
1047
1047
  className: g(
1048
1048
  "mb-1 block w-full rounded-md border-l-2 px-2 py-1 text-left text-[11px]",
1049
1049
  N ? "border-white/60 bg-black/10" : "border-slate-400 bg-white/70 dark:border-slate-500 dark:bg-black/20"
@@ -1055,33 +1055,33 @@ function Hn({
1055
1055
  ]
1056
1056
  }
1057
1057
  ),
1058
- t.message && jn(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
1058
+ t.message && Ia(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
1059
1059
  jr,
1060
1060
  {
1061
- text: jn(t.message),
1061
+ text: Ia(t.message),
1062
1062
  mine: N,
1063
- renderToken: N ? Wa : Ba,
1063
+ renderToken: N ? Wn : Bn,
1064
1064
  entityPattern: x.entityPattern,
1065
1065
  timeRefs: t.time_refs,
1066
1066
  navigate: x.navigate
1067
1067
  }
1068
1068
  )),
1069
- En(t.message) != null && /* @__PURE__ */ e(
1069
+ ja(t.message) != null && /* @__PURE__ */ e(
1070
1070
  Tr,
1071
1071
  {
1072
- id: En(t.message),
1072
+ id: ja(t.message),
1073
1073
  mine: N,
1074
- renderAvatar: (D, O) => /* @__PURE__ */ e(K, { id: D, name: O, size: 18, presence: !1 })
1074
+ renderAvatar: (D, O) => /* @__PURE__ */ e(J, { id: D, name: O, size: 18, presence: !1 })
1075
1075
  }
1076
1076
  ),
1077
1077
  t.poll && /* @__PURE__ */ e(qr, { poll: t.poll, room: t.room, mine: N }),
1078
1078
  (t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: g("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((D) => {
1079
- const O = Ut == null ? void 0 : Ut.get(D), ut = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", Dt = d.fileUrl(D), Fa = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), mt = Kr(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), $t = `${Dt}?download=1`, Mt = (O == null ? void 0 : O.filename_download) || ut, Mn = Ma($t, Mt), pt = u && P.length > 0 ? /* @__PURE__ */ e(
1079
+ const O = Ut == null ? void 0 : Ut.get(D), ut = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", Dt = d.fileUrl(D), Fn = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), mt = Kr(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), $t = `${Dt}?download=1`, Mt = (O == null ? void 0 : O.filename_download) || ut, $a = Mn($t, Mt), pt = u && P.length > 0 ? /* @__PURE__ */ e(
1080
1080
  rl,
1081
1081
  {
1082
1082
  targets: P,
1083
1083
  recordLabel: u.label,
1084
- onPick: (Ha) => I.mutate({ messageId: t.id, fileId: D, field: Ha })
1084
+ onPick: (Hn) => L.mutate({ messageId: t.id, fileId: D, field: Hn })
1085
1085
  }
1086
1086
  ) : null;
1087
1087
  return mt ? /* @__PURE__ */ e(
@@ -1094,13 +1094,13 @@ function Hn({
1094
1094
  action: pt
1095
1095
  },
1096
1096
  D
1097
- ) : Fa ? /* @__PURE__ */ a("span", { className: "relative inline-block", children: [
1097
+ ) : Fn ? /* @__PURE__ */ n("span", { className: "relative inline-block", children: [
1098
1098
  /* @__PURE__ */ e(
1099
1099
  "a",
1100
1100
  {
1101
1101
  href: $t,
1102
1102
  download: Mt,
1103
- onClick: Mn,
1103
+ onClick: $a,
1104
1104
  title: "Download",
1105
1105
  className: "block",
1106
1106
  children: /* @__PURE__ */ e(
@@ -1115,13 +1115,13 @@ function Hn({
1115
1115
  }
1116
1116
  ),
1117
1117
  pt && /* @__PURE__ */ e("span", { className: "absolute right-1 top-1", children: pt })
1118
- ] }, D) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1", children: [
1119
- /* @__PURE__ */ a(
1118
+ ] }, D) : /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
1119
+ /* @__PURE__ */ n(
1120
1120
  "a",
1121
1121
  {
1122
1122
  href: $t,
1123
1123
  download: Mt,
1124
- onClick: Mn,
1124
+ onClick: $a,
1125
1125
  title: "Download",
1126
1126
  className: g(
1127
1127
  "inline-flex max-w-[220px] items-center gap-1.5 rounded-lg border px-2 py-1 text-[11.5px]",
@@ -1139,20 +1139,20 @@ function Hn({
1139
1139
  ]
1140
1140
  }
1141
1141
  ),
1142
- !z && !Me && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
1142
+ !G && !Me && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
1143
1143
  Er,
1144
1144
  {
1145
1145
  text: t.message,
1146
1146
  navigate: x.navigate,
1147
- onDismiss: N ? () => te.mutate(t.id) : void 0
1147
+ onDismiss: N ? () => F.mutate(t.id) : void 0
1148
1148
  }
1149
1149
  ) }),
1150
- be.size > 0 && /* @__PURE__ */ e(
1150
+ ge.size > 0 && /* @__PURE__ */ e(
1151
1151
  "div",
1152
1152
  {
1153
1153
  className: g("mt-0.5 flex flex-wrap gap-1", N && "justify-end"),
1154
1154
  "data-chat-reactions": !0,
1155
- children: [...be.entries()].map(([D, O]) => /* @__PURE__ */ a(
1155
+ children: [...ge.entries()].map(([D, O]) => /* @__PURE__ */ n(
1156
1156
  "button",
1157
1157
  {
1158
1158
  type: "button",
@@ -1171,7 +1171,7 @@ function Hn({
1171
1171
  ))
1172
1172
  }
1173
1173
  ),
1174
- !h.inThread && t.thread && t.thread.count > 0 && /* @__PURE__ */ a(
1174
+ !h.inThread && t.thread && t.thread.count > 0 && /* @__PURE__ */ n(
1175
1175
  "button",
1176
1176
  {
1177
1177
  type: "button",
@@ -1183,20 +1183,20 @@ function Hn({
1183
1183
  ),
1184
1184
  "data-chat-thread-summary": t.thread.count,
1185
1185
  children: [
1186
- /* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((D) => /* @__PURE__ */ e(K, { id: D.id, name: D.name, size: 16, presence: !1 }, D.id)) }),
1186
+ /* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((D) => /* @__PURE__ */ e(J, { id: D.id, name: D.name, size: 16, presence: !1 }, D.id)) }),
1187
1187
  t.thread.count,
1188
1188
  " ",
1189
1189
  t.thread.count === 1 ? "reply" : "replies",
1190
- t.thread.last_reply_at && /* @__PURE__ */ a("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: [
1190
+ t.thread.last_reply_at && /* @__PURE__ */ n("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: [
1191
1191
  "· last ",
1192
- Vn(t.thread.last_reply_at)
1192
+ Za(t.thread.last_reply_at)
1193
1193
  ] })
1194
1194
  ]
1195
1195
  }
1196
1196
  ),
1197
- /* @__PURE__ */ a("p", { className: "mt-0.5 flex items-center justify-end gap-1 text-[10px] text-slate-500 dark:text-slate-400", children: [
1197
+ /* @__PURE__ */ n("p", { className: "mt-0.5 flex items-center justify-end gap-1 text-[10px] text-slate-500 dark:text-slate-400", children: [
1198
1198
  !N && /* @__PURE__ */ e("span", { className: "mr-auto" }),
1199
- t.via_app && /* @__PURE__ */ a(
1199
+ t.via_app && /* @__PURE__ */ n(
1200
1200
  "span",
1201
1201
  {
1202
1202
  className: "inline-flex max-w-[16rem] items-center gap-0.5 font-normal",
@@ -1204,19 +1204,19 @@ function Hn({
1204
1204
  "data-chat-message-via-app": !0,
1205
1205
  children: [
1206
1206
  /* @__PURE__ */ e(xs, { className: "h-3 w-3 shrink-0", "aria-hidden": !0 }),
1207
- /* @__PURE__ */ a("span", { className: "truncate", children: [
1207
+ /* @__PURE__ */ n("span", { className: "truncate", children: [
1208
1208
  "via app · ",
1209
1209
  t.via_app
1210
1210
  ] })
1211
1211
  ]
1212
1212
  }
1213
1213
  ),
1214
- t.edited_at && !z && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
1214
+ t.edited_at && !G && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
1215
1215
  new Date(t.date_created).toLocaleTimeString("en-US", {
1216
1216
  hour: "numeric",
1217
1217
  minute: "2-digit"
1218
1218
  }),
1219
- N && Ce && !z && (() => {
1219
+ N && Ce && !G && (() => {
1220
1220
  var O;
1221
1221
  const D = Pe(t);
1222
1222
  return D.length === 0 ? null : /* @__PURE__ */ e(
@@ -1228,10 +1228,10 @@ function Hn({
1228
1228
  }
1229
1229
  );
1230
1230
  })(),
1231
- h.isLastMine && n.startsWith("dm:") && (F ? /* @__PURE__ */ a("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
1231
+ h.isLastMine && a.startsWith("dm:") && (H ? /* @__PURE__ */ n("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
1232
1232
  /* @__PURE__ */ e(bs, { className: "h-3 w-3", strokeWidth: 2.4 }),
1233
1233
  " Read"
1234
- ] }) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-0.5", children: [
1234
+ ] }) : /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-0.5", children: [
1235
1235
  /* @__PURE__ */ e(Bt, { className: "h-3 w-3", strokeWidth: 2.2 }),
1236
1236
  " Sent"
1237
1237
  ] }))
@@ -1240,39 +1240,39 @@ function Hn({
1240
1240
  ]
1241
1241
  }
1242
1242
  );
1243
- }, gn = (t) => /* @__PURE__ */ e(
1243
+ }, ba = (t) => /* @__PURE__ */ e(
1244
1244
  Gs,
1245
1245
  {
1246
- ref: t ? void 0 : cn,
1247
- room: n,
1246
+ ref: t ? void 0 : ia,
1247
+ room: a,
1248
1248
  label: S,
1249
1249
  parentId: t,
1250
- quote: t ? Ra : Aa,
1251
- onClearQuote: () => t ? on(null) : ln(null),
1252
- onSent: La,
1253
- disabledReason: t ? null : fn,
1254
- quietNote: Ea,
1250
+ quote: t ? Rn : An,
1251
+ onClearQuote: () => t ? oa(null) : la(null),
1252
+ onSent: Ln,
1253
+ disabledReason: t ? null : ha,
1254
+ quietNote: En,
1255
1255
  th: f,
1256
- renderAvatar: (h, N) => /* @__PURE__ */ e(K, { id: h, name: N, size: 22, presence: h !== "__bot__" })
1256
+ renderAvatar: (h, N) => /* @__PURE__ */ e(J, { id: h, name: N, size: 22, presence: h !== "__bot__" })
1257
1257
  }
1258
1258
  );
1259
- return /* @__PURE__ */ a(
1259
+ return /* @__PURE__ */ n(
1260
1260
  "div",
1261
1261
  {
1262
1262
  className: "relative flex h-full min-h-0 flex-col",
1263
- "data-chat-room": n,
1263
+ "data-chat-room": a,
1264
1264
  onDragOver: (t) => {
1265
- t.dataTransfer.types.includes("Files") && !fn && (t.preventDefault(), wt(!0));
1265
+ t.dataTransfer.types.includes("Files") && !ha && (t.preventDefault(), wt(!0));
1266
1266
  },
1267
1267
  onDragLeave: (t) => {
1268
1268
  t.currentTarget.contains(t.relatedTarget) || wt(!1);
1269
1269
  },
1270
1270
  onDrop: (t) => {
1271
1271
  var h;
1272
- t.dataTransfer.files.length && (t.preventDefault(), wt(!1), (h = cn.current) == null || h.addFiles([...t.dataTransfer.files]));
1272
+ t.dataTransfer.files.length && (t.preventDefault(), wt(!1), (h = ia.current) == null || h.addFiles([...t.dataTransfer.files]));
1273
1273
  },
1274
1274
  children: [
1275
- Oa && /* @__PURE__ */ e(
1275
+ On && /* @__PURE__ */ e(
1276
1276
  "div",
1277
1277
  {
1278
1278
  className: "pointer-events-none absolute inset-2 z-30 flex items-center justify-center rounded-xl border-2 border-dashed border-nvr-cyan bg-white/85 text-[13px] font-semibold text-slate-700 dark:bg-card/90 dark:text-slate-100",
@@ -1280,7 +1280,7 @@ function Hn({
1280
1280
  children: "Drop to attach to your message"
1281
1281
  }
1282
1282
  ),
1283
- /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-1.5 border-b px-3 py-2", f.divider), children: [
1283
+ /* @__PURE__ */ n("div", { className: g("flex shrink-0 items-center gap-1.5 border-b px-3 py-2", f.divider), children: [
1284
1284
  /* @__PURE__ */ e(
1285
1285
  "button",
1286
1286
  {
@@ -1291,10 +1291,10 @@ function Hn({
1291
1291
  children: /* @__PURE__ */ e(ft, { className: "h-4 w-4", strokeWidth: 2 })
1292
1292
  }
1293
1293
  ),
1294
- ((w == null ? void 0 : w.kind) === "channel" && !((kn = w.channel) != null && kn.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((wn = w.channel) == null ? void 0 : wn.icon) || ((Nn = w.channel) == null ? void 0 : Nn.color))) && /* @__PURE__ */ e(et, { icon: (Cn = w == null ? void 0 : w.channel) == null ? void 0 : Cn.icon, color: (_n = w == null ? void 0 : w.channel) == null ? void 0 : _n.color, size: 24 }),
1295
- b && Te(n, b.id) && /* @__PURE__ */ e(Vr, { peerId: Te(n, b.id), name: S }),
1296
- /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1297
- /* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
1294
+ ((w == null ? void 0 : w.kind) === "channel" && !((ya = w.channel) != null && ya.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((ka = w.channel) == null ? void 0 : ka.icon) || ((wa = w.channel) == null ? void 0 : wa.color))) && /* @__PURE__ */ e(et, { icon: (Na = w == null ? void 0 : w.channel) == null ? void 0 : Na.icon, color: (Ca = w == null ? void 0 : w.channel) == null ? void 0 : Ca.color, size: 24 }),
1295
+ b && Te(a, b.id) && /* @__PURE__ */ e(Vr, { peerId: Te(a, b.id), name: S }),
1296
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
1297
+ /* @__PURE__ */ n("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
1298
1298
  /* @__PURE__ */ e("span", { className: "truncate", children: S }),
1299
1299
  w && /* @__PURE__ */ e(Br, { starred: !!w.starred, notify: Vt }),
1300
1300
  (B == null ? void 0 : B.announce) && /* @__PURE__ */ e(
@@ -1306,22 +1306,22 @@ function Hn({
1306
1306
  }
1307
1307
  )
1308
1308
  ] }),
1309
- b && Te(n, b.id) ? /* @__PURE__ */ e(al, { peerId: Te(n, b.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
1309
+ b && Te(a, b.id) ? /* @__PURE__ */ e(nl, { peerId: Te(a, b.id), name: S }) : a.startsWith("ch:") ? /* @__PURE__ */ e(
1310
1310
  Fr,
1311
1311
  {
1312
- room: n,
1313
- me: ((Sn = x.me) == null ? void 0 : Sn.id) ?? null,
1314
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 24 })
1312
+ room: a,
1313
+ me: ((_a = x.me) == null ? void 0 : _a.id) ?? null,
1314
+ renderAvatar: (t, h) => /* @__PURE__ */ e(J, { id: t, name: h, size: 24 })
1315
1315
  }
1316
1316
  ) : null
1317
1317
  ] }),
1318
1318
  /* @__PURE__ */ e(
1319
1319
  _r,
1320
1320
  {
1321
- room: n,
1321
+ room: a,
1322
1322
  roomLabel: S,
1323
- huddle: y,
1324
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 18, presence: !1 })
1323
+ huddle: k,
1324
+ renderAvatar: (t, h) => /* @__PURE__ */ e(J, { id: t, name: h, size: 18, presence: !1 })
1325
1325
  }
1326
1326
  ),
1327
1327
  /* @__PURE__ */ e(
@@ -1329,16 +1329,16 @@ function Hn({
1329
1329
  {
1330
1330
  type: "button",
1331
1331
  onClick: () => {
1332
- Sa((t) => !t), Xt("");
1332
+ Sn((t) => !t), Xt("");
1333
1333
  },
1334
- className: g(Bn, rt ? f.accentSoft : qn),
1334
+ className: g(qa, rt ? f.accentSoft : Ea),
1335
1335
  "aria-label": "Search in this conversation",
1336
1336
  "aria-pressed": rt,
1337
1337
  "data-tip": "Search this conversation",
1338
- children: /* @__PURE__ */ e(Jn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
1338
+ children: /* @__PURE__ */ e(Ka, { className: "h-3.5 w-3.5", strokeWidth: 2 })
1339
1339
  }
1340
1340
  ),
1341
- ((Tn = w == null ? void 0 : w.channel) == null ? void 0 : Tn.is_direct) && /* @__PURE__ */ e(cl, { channel: w.channel, onLeft: l }),
1341
+ ((Sa = w == null ? void 0 : w.channel) == null ? void 0 : Sa.is_direct) && /* @__PURE__ */ e(cl, { channel: w.channel, onLeft: l }),
1342
1342
  /* @__PURE__ */ e(
1343
1343
  "button",
1344
1344
  {
@@ -1346,7 +1346,7 @@ function Hn({
1346
1346
  onClick: () => {
1347
1347
  je(null), Ke((t) => !t);
1348
1348
  },
1349
- className: g(Bn, kt ? f.accentSoft : qn),
1349
+ className: g(qa, kt ? f.accentSoft : Ea),
1350
1350
  "aria-label": "Room info — members, pinned, files and links",
1351
1351
  "aria-pressed": kt,
1352
1352
  "data-tip": "Room info — members, pinned, files and links",
@@ -1358,21 +1358,21 @@ function Hn({
1358
1358
  Wr,
1359
1359
  {
1360
1360
  th: f,
1361
- huddleSchedule: y.enabled ? (t) => /* @__PURE__ */ e(
1361
+ huddleSchedule: k.enabled ? (t) => /* @__PURE__ */ e(
1362
1362
  Ur,
1363
1363
  {
1364
- room: n,
1364
+ room: a,
1365
1365
  me: (b == null ? void 0 : b.id) ?? null,
1366
1366
  theme: { input: f.input },
1367
- renderAvatar: (h, N) => /* @__PURE__ */ e(K, { id: h, name: N, size: 18, presence: !1 }),
1367
+ renderAvatar: (h, N) => /* @__PURE__ */ e(J, { id: h, name: N, size: 18, presence: !1 }),
1368
1368
  onDone: t
1369
1369
  }
1370
1370
  ) : void 0,
1371
1371
  starred: w ? !!w.starred : void 0,
1372
- onStar: w ? () => ne.mutate({ room: n, starred: !w.starred }) : void 0,
1372
+ onStar: w ? () => ae.mutate({ room: a, starred: !w.starred }) : void 0,
1373
1373
  notify: w ? Vt : void 0,
1374
1374
  onNotify: w ? (t) => {
1375
- t === "muted" ? j.mutate({ room: n, muted: !0 }) : (w.muted && j.mutate({ room: n, muted: !1 }), ce.mutate({ room: n, mode: t }));
1375
+ t === "muted" ? j.mutate({ room: a, muted: !0 }) : (w.muted && j.mutate({ room: a, muted: !1 }), ce.mutate({ room: a, mode: t }));
1376
1376
  } : void 0,
1377
1377
  onJump: (t) => {
1378
1378
  $e.current = !1, le.current = !1, $({ date: t });
@@ -1381,25 +1381,25 @@ function Hn({
1381
1381
  var t;
1382
1382
  return (t = x.navigate) == null ? void 0 : t.call(x, oe);
1383
1383
  } : void 0,
1384
- onTeamsCall: n.startsWith("dm:") || (Un = w == null ? void 0 : w.channel) != null && Un.is_direct ? async () => {
1384
+ onTeamsCall: a.startsWith("dm:") || (Ta = w == null ? void 0 : w.channel) != null && Ta.is_direct ? async () => {
1385
1385
  var t, h;
1386
1386
  try {
1387
1387
  let N = [];
1388
- if (n.startsWith("dm:") && b) {
1389
- const F = Te(n, b.id);
1390
- if (F) {
1391
- const z = await d.request(
1392
- ye(`/users/${F}`)
1388
+ if (a.startsWith("dm:") && b) {
1389
+ const H = Te(a, b.id);
1390
+ if (H) {
1391
+ const G = await d.request(
1392
+ ke(`/users/${H}`)
1393
1393
  );
1394
- (t = z.data) != null && t.email && (N = [z.data.email]);
1394
+ (t = G.data) != null && t.email && (N = [G.data.email]);
1395
1395
  }
1396
1396
  } else (h = w == null ? void 0 : w.channel) != null && h.id && (N = (await d.request(
1397
- ye(
1397
+ ke(
1398
1398
  `/chat/channels/${w.channel.id}/members`
1399
1399
  )
1400
- )).data.filter((z) => z.email && z.user.toUpperCase() !== (b == null ? void 0 : b.id.toUpperCase())).map((z) => z.email));
1400
+ )).data.filter((G) => G.email && G.user.toUpperCase() !== (b == null ? void 0 : b.id.toUpperCase())).map((G) => G.email));
1401
1401
  if (N.length === 0) {
1402
- ge.error("No callable participants found");
1402
+ ve.error("No callable participants found");
1403
1403
  return;
1404
1404
  }
1405
1405
  window.open(
@@ -1408,16 +1408,16 @@ function Hn({
1408
1408
  "noopener"
1409
1409
  );
1410
1410
  } catch {
1411
- ge.error("Could not resolve participants");
1411
+ ve.error("Could not resolve participants");
1412
1412
  }
1413
1413
  } : void 0,
1414
1414
  onSettings: s,
1415
1415
  archived: !!(w != null && w.archived),
1416
- onArchive: w && _a ? () => ee.mutate(
1417
- { room: n, archived: !w.archived },
1416
+ onArchive: w && _n ? () => te.mutate(
1417
+ { room: a, archived: !w.archived },
1418
1418
  {
1419
1419
  onSuccess: () => {
1420
- w.archived ? ge.success("Moved back to your chats") : (ge.success(
1420
+ w.archived ? ve.success("Moved back to your chats") : (ve.success(
1421
1421
  "Archived for you — others in the conversation still see it",
1422
1422
  {
1423
1423
  description: "Find it under the Archived tab."
@@ -1426,24 +1426,24 @@ function Hn({
1426
1426
  }
1427
1427
  }
1428
1428
  ) : void 0,
1429
- onLeave: (w == null ? void 0 : w.kind) === "entity" && w.joined ? () => re.mutate(n, {
1429
+ onLeave: (w == null ? void 0 : w.kind) === "entity" && w.joined ? () => re.mutate(a, {
1430
1430
  onSuccess: () => {
1431
- ge.success(`Left ${w.label}`, {
1431
+ ve.success(`Left ${w.label}`, {
1432
1432
  description: "Open the record's chat again to rejoin."
1433
1433
  }), l();
1434
1434
  }
1435
1435
  }) : void 0,
1436
- tips: /* @__PURE__ */ e(el, { botName: he })
1436
+ tips: /* @__PURE__ */ e(el, { botName: fe })
1437
1437
  }
1438
1438
  )
1439
1439
  ] }),
1440
1440
  /* @__PURE__ */ e(
1441
1441
  Dr,
1442
1442
  {
1443
- room: n,
1443
+ room: a,
1444
1444
  me: b,
1445
- huddle: y,
1446
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 18, presence: !1 })
1445
+ huddle: k,
1446
+ renderAvatar: (t, h) => /* @__PURE__ */ e(J, { id: t, name: h, size: 18, presence: !1 })
1447
1447
  }
1448
1448
  ),
1449
1449
  rt && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1.5", f.divider), children: /* @__PURE__ */ e(
@@ -1457,7 +1457,7 @@ function Hn({
1457
1457
  "aria-label": "Search messages"
1458
1458
  }
1459
1459
  ) }),
1460
- /* @__PURE__ */ e(tl, { room: n }),
1460
+ /* @__PURE__ */ e(tl, { room: a }),
1461
1461
  B && !B.is_direct && /* @__PURE__ */ e(
1462
1462
  Hr,
1463
1463
  {
@@ -1467,7 +1467,7 @@ function Hn({
1467
1467
  navigate: x.navigate
1468
1468
  }
1469
1469
  ),
1470
- pe.length > 0 && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1", f.divider), "data-chat-pins-strip": !0, children: /* @__PURE__ */ a(
1470
+ pe.length > 0 && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1", f.divider), "data-chat-pins-strip": !0, children: /* @__PURE__ */ n(
1471
1471
  "button",
1472
1472
  {
1473
1473
  type: "button",
@@ -1483,7 +1483,7 @@ function Hn({
1483
1483
  ]
1484
1484
  }
1485
1485
  ) }),
1486
- (B == null ? void 0 : B.archive_suggested_at) && B.id !== 0 && (hn || L) && /* @__PURE__ */ e(
1486
+ (B == null ? void 0 : B.archive_suggested_at) && B.id !== 0 && (pa || I) && /* @__PURE__ */ e(
1487
1487
  js,
1488
1488
  {
1489
1489
  channelId: B.id,
@@ -1491,13 +1491,13 @@ function Hn({
1491
1491
  suggestedAt: B.archive_suggested_at
1492
1492
  }
1493
1493
  ),
1494
- qa && (B == null ? void 0 : B.welcome_note) && /* @__PURE__ */ e(
1494
+ qn && (B == null ? void 0 : B.welcome_note) && /* @__PURE__ */ e(
1495
1495
  zr,
1496
1496
  {
1497
1497
  note: B.welcome_note,
1498
1498
  channelName: S,
1499
1499
  th: f,
1500
- onDismiss: () => Q.mutate(n)
1500
+ onDismiss: () => K.mutate(a)
1501
1501
  }
1502
1502
  ),
1503
1503
  /* @__PURE__ */ e(
@@ -1506,54 +1506,54 @@ function Hn({
1506
1506
  ref: Re,
1507
1507
  onScroll: (t) => {
1508
1508
  const h = t.currentTarget;
1509
- le.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, St.current = h.scrollHeight, le.current && de && Je(null), Ne.onScroll(), h.scrollTop < 200 && Y && !R && !xe && $e.current && H();
1509
+ le.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, St.current = h.scrollHeight, le.current && de && Je(null), Ne.onScroll(), h.scrollTop < 200 && Z && !R && !be && $e.current && z();
1510
1510
  },
1511
1511
  className: "relative min-h-0 flex-1 overflow-y-auto px-3 py-3 [overflow-anchor:none]",
1512
1512
  "data-chat-messages": !0,
1513
- children: /* @__PURE__ */ a("div", { ref: dn, className: qe === "compact" ? "space-y-1" : "space-y-2.5", children: [
1514
- Y && !xe && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
1513
+ children: /* @__PURE__ */ n("div", { ref: ca, className: qe === "compact" ? "space-y-1" : "space-y-2.5", children: [
1514
+ Z && !be && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
1515
1515
  "button",
1516
1516
  {
1517
1517
  type: "button",
1518
1518
  disabled: R,
1519
1519
  onClick: () => {
1520
1520
  var t;
1521
- St.current = ((t = Re.current) == null ? void 0 : t.scrollHeight) ?? 0, H();
1521
+ St.current = ((t = Re.current) == null ? void 0 : t.scrollHeight) ?? 0, z();
1522
1522
  },
1523
1523
  className: "rounded-full border border-slate-200 px-2.5 py-0.5 text-[11px] font-medium text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:text-slate-300",
1524
1524
  "data-chat-load-older": !0,
1525
1525
  children: R ? "Loading…" : "Load earlier messages"
1526
1526
  }
1527
1527
  ) }),
1528
- q ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : Se.length === 0 && J.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: xe ? "No messages match." : W ? "Nothing was said around then." : /* @__PURE__ */ a(ke, { children: [
1528
+ q ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : Se.length === 0 && Y.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: be ? "No messages match." : W ? "Nothing was said around then." : /* @__PURE__ */ n(we, { children: [
1529
1529
  /* @__PURE__ */ e("p", { children: "No messages yet — say hello." }),
1530
- /* @__PURE__ */ a("p", { className: "mt-1 text-[11px]", children: [
1530
+ /* @__PURE__ */ n("p", { className: "mt-1 text-[11px]", children: [
1531
1531
  "Tip: @ mentions someone",
1532
- he ? `, @${he} asks the AI` : "",
1532
+ fe ? `, @${fe} asks the AI` : "",
1533
1533
  ", # inserts a record, and a record ID like AB26-12345 becomes a live link."
1534
1534
  ] })
1535
1535
  ] }) }) : /* @__PURE__ */ e(
1536
1536
  "div",
1537
1537
  {
1538
- ref: pn,
1538
+ ref: ma,
1539
1539
  style: Ne.windowed ? { paddingTop: Ne.padTop, paddingBottom: Ne.padBottom } : void 0,
1540
1540
  "data-chat-rows": Ne.windowed ? "windowed" : "all",
1541
1541
  children: Se.slice(Ne.start, Ne.end).map((t, h) => {
1542
1542
  var Me;
1543
- const N = Ne.start + h, F = Se[N - 1], z = N === 0 || F && new Date(F.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !xe && !W && _t.current > 0 && N === Math.max(0, Se.length - _t.current), Be = qe === "compact" && !z && !!F && F.sender === t.sender && !F.is_system && new Date(t.date_created).getTime() - new Date(F.date_created).getTime() < 5 * 6e4;
1544
- return /* @__PURE__ */ a(
1543
+ const N = Ne.start + h, H = Se[N - 1], G = N === 0 || H && new Date(H.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !be && !W && _t.current > 0 && N === Math.max(0, Se.length - _t.current), Be = qe === "compact" && !G && !!H && H.sender === t.sender && !H.is_system && new Date(t.date_created).getTime() - new Date(H.date_created).getTime() < 5 * 6e4;
1544
+ return /* @__PURE__ */ n(
1545
1545
  "div",
1546
1546
  {
1547
1547
  ref: Ne.rowRef(t.id),
1548
1548
  "data-chat-row": t.id,
1549
1549
  className: N > 0 ? qe === "compact" ? "pt-1" : "pt-2.5" : void 0,
1550
1550
  children: [
1551
- z && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
1551
+ G && /* @__PURE__ */ n("div", { className: "my-2 flex items-center gap-2", children: [
1552
1552
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
1553
1553
  /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Xr(t.date_created) }),
1554
1554
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
1555
1555
  ] }),
1556
- Oe && /* @__PURE__ */ a(
1556
+ Oe && /* @__PURE__ */ n(
1557
1557
  "div",
1558
1558
  {
1559
1559
  ref: Ct,
@@ -1577,8 +1577,8 @@ function Hn({
1577
1577
  }
1578
1578
  ),
1579
1579
  Oe && Ge && /* @__PURE__ */ e("div", { className: "my-1 rounded-md border border-nvr-cyan/25 bg-nvr-cyan/5 px-2.5 py-1.5 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: Ge }),
1580
- bn(t, {
1581
- isLastMine: ((Me = t.sender) == null ? void 0 : Me.toLowerCase()) === Ee && N === Pa,
1580
+ xa(t, {
1581
+ isLastMine: ((Me = t.sender) == null ? void 0 : Me.toLowerCase()) === Ee && N === Pn,
1582
1582
  showSender: !Be
1583
1583
  })
1584
1584
  ]
@@ -1588,12 +1588,12 @@ function Hn({
1588
1588
  })
1589
1589
  }
1590
1590
  ),
1591
- !xe && !G && /* @__PURE__ */ e(ha, { items: J, th: f }),
1592
- !xe && !G && Ze.live && he && /* @__PURE__ */ e(
1591
+ !be && !Q && /* @__PURE__ */ e(hn, { items: Y, th: f }),
1592
+ !be && !Q && Ze.live && fe && /* @__PURE__ */ e(
1593
1593
  Ps,
1594
1594
  {
1595
1595
  live: Ze.live,
1596
- botName: he,
1596
+ botName: fe,
1597
1597
  bubbleClass: f.bubbleOther,
1598
1598
  accentClass: f.accentText,
1599
1599
  onStop: Ze.stop,
@@ -1603,12 +1603,12 @@ function Hn({
1603
1603
  ] })
1604
1604
  }
1605
1605
  ),
1606
- (de || G) && /* @__PURE__ */ e("div", { className: "pointer-events-none relative z-10 -mt-9 flex h-9 shrink-0 items-center justify-center", children: /* @__PURE__ */ e(
1606
+ (de || Q) && /* @__PURE__ */ e("div", { className: "pointer-events-none relative z-10 -mt-9 flex h-9 shrink-0 items-center justify-center", children: /* @__PURE__ */ e(
1607
1607
  "button",
1608
1608
  {
1609
1609
  type: "button",
1610
1610
  onClick: () => {
1611
- if (G) {
1611
+ if (Q) {
1612
1612
  $e.current = !1, le.current = !0, $(null);
1613
1613
  return;
1614
1614
  }
@@ -1619,68 +1619,68 @@ function Hn({
1619
1619
  f.pill
1620
1620
  ),
1621
1621
  "data-chat-new-pill": (de == null ? void 0 : de.count) ?? 0,
1622
- children: G ? "Jump to the latest ↓" : `${de == null ? void 0 : de.count} new ${(de == null ? void 0 : de.count) === 1 ? "message" : "messages"} ↓`
1622
+ children: Q ? "Jump to the latest ↓" : `${de == null ? void 0 : de.count} new ${(de == null ? void 0 : de.count) === 1 ? "message" : "messages"} ↓`
1623
1623
  }
1624
1624
  ) }),
1625
- /* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children: it && he && !Ze.live ? /* @__PURE__ */ a(
1625
+ /* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children: it && fe && !Ze.live ? /* @__PURE__ */ n(
1626
1626
  "p",
1627
1627
  {
1628
1628
  className: "flex items-center gap-1.5 text-[11px] italic text-slate-500",
1629
1629
  "data-chat-bot-thinking": !0,
1630
1630
  children: [
1631
- /* @__PURE__ */ a("span", { className: "inline-flex gap-0.5", children: [
1631
+ /* @__PURE__ */ n("span", { className: "inline-flex gap-0.5", children: [
1632
1632
  /* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:0ms]" }),
1633
1633
  /* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:150ms]" }),
1634
1634
  /* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:300ms]" })
1635
1635
  ] }),
1636
- he,
1636
+ fe,
1637
1637
  " is thinking…"
1638
1638
  ]
1639
1639
  }
1640
- ) : Z.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: Z.typingText }) }),
1641
- gn(null),
1642
- an != null && /* @__PURE__ */ e(
1640
+ ) : V.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: V.typingText }) }),
1641
+ ba(null),
1642
+ na != null && /* @__PURE__ */ e(
1643
1643
  Gr,
1644
1644
  {
1645
- room: n,
1646
- rootId: an,
1645
+ room: a,
1646
+ rootId: na,
1647
1647
  th: f,
1648
1648
  onClose: () => je(null),
1649
- renderRow: (t) => bn(t, { inThread: !0 }),
1650
- renderComposer: (t) => gn(t),
1651
- renderOutbox: (t) => /* @__PURE__ */ e(sl, { room: n, parentId: t, th: f })
1649
+ renderRow: (t) => xa(t, { inThread: !0 }),
1650
+ renderComposer: (t) => ba(t),
1651
+ renderOutbox: (t) => /* @__PURE__ */ e(sl, { room: a, parentId: t, th: f })
1652
1652
  }
1653
1653
  ),
1654
1654
  kt && /* @__PURE__ */ e(
1655
1655
  Qr,
1656
1656
  {
1657
- room: n,
1657
+ room: a,
1658
1658
  label: S,
1659
1659
  th: f,
1660
1660
  pins: pe,
1661
1661
  onClose: () => Ke(!1),
1662
- onOpenMessage: un,
1662
+ onOpenMessage: da,
1663
1663
  onUnpin: (t) => p.mutate(t),
1664
1664
  navigate: x.navigate,
1665
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 22 })
1665
+ renderAvatar: (t, h) => /* @__PURE__ */ e(J, { id: t, name: h, size: 22 })
1666
1666
  }
1667
1667
  )
1668
1668
  ]
1669
1669
  }
1670
1670
  );
1671
1671
  }
1672
- function sl({ room: n, parentId: r, th: l }) {
1673
- const s = pa(n, r);
1674
- return /* @__PURE__ */ e(ha, { items: s, th: l });
1672
+ function sl({ room: a, parentId: r, th: l }) {
1673
+ const s = pn(a, r);
1674
+ return /* @__PURE__ */ e(hn, { items: s, th: l });
1675
1675
  }
1676
1676
  function rl({
1677
- targets: n,
1677
+ targets: a,
1678
1678
  recordLabel: r,
1679
1679
  onPick: l
1680
1680
  }) {
1681
1681
  const [s, o] = T(!1);
1682
- return /* @__PURE__ */ a(nt, { open: s, onOpenChange: o, children: [
1683
- /* @__PURE__ */ e(at, { asChild: !0, children: /* @__PURE__ */ e(
1682
+ return /* @__PURE__ */ n(at, { open: s, onOpenChange: o, children: [
1683
+ /* @__PURE__ */ e(nt, { asChild: !0, children: /* @__PURE__ */ e(
1684
1684
  "button",
1685
1685
  {
1686
1686
  type: "button",
@@ -1691,12 +1691,12 @@ function rl({
1691
1691
  children: /* @__PURE__ */ e(vs, { className: "h-3 w-3" })
1692
1692
  }
1693
1693
  ) }),
1694
- /* @__PURE__ */ a(st, { align: "end", className: "w-[220px] p-1.5", children: [
1695
- /* @__PURE__ */ a("p", { className: "px-2 pb-1 pt-0.5 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: [
1694
+ /* @__PURE__ */ n(st, { align: "end", className: "w-[220px] p-1.5", children: [
1695
+ /* @__PURE__ */ n("p", { className: "px-2 pb-1 pt-0.5 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: [
1696
1696
  "Attach to ",
1697
1697
  r
1698
1698
  ] }),
1699
- n.map((i) => /* @__PURE__ */ e(
1699
+ a.map((i) => /* @__PURE__ */ e(
1700
1700
  "button",
1701
1701
  {
1702
1702
  type: "button",
@@ -1711,43 +1711,43 @@ function rl({
1711
1711
  ] })
1712
1712
  ] });
1713
1713
  }
1714
- function zn(n) {
1714
+ function Ha(a) {
1715
1715
  return {
1716
- id: n.id,
1717
- visibility: n.visibility,
1718
- role: n.role,
1719
- topic: n.topic,
1720
- created_by: n.created_by ?? null,
1721
- icon: n.icon ?? null,
1722
- color: n.color ?? null
1716
+ id: a.id,
1717
+ visibility: a.visibility,
1718
+ role: a.role,
1719
+ topic: a.topic,
1720
+ created_by: a.created_by ?? null,
1721
+ icon: a.icon ?? null,
1722
+ color: a.color ?? null
1723
1723
  };
1724
1724
  }
1725
1725
  const ll = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1726
- function jt(n) {
1727
- const r = typeof n.idle_minutes == "number" ? n.idle_minutes : n.last_active ? Math.floor((Date.now() - new Date(n.last_active).getTime()) / 6e4) : null;
1726
+ function jt(a) {
1727
+ const r = typeof a.idle_minutes == "number" ? a.idle_minutes : a.last_active ? Math.floor((Date.now() - new Date(a.last_active).getTime()) / 6e4) : null;
1728
1728
  return r == null || r < 1 ? "Idle" : r < 60 ? `Idle · ${r}m` : `Idle · ${Math.floor(r / 60)}h ${r % 60}m`;
1729
1729
  }
1730
- function Gn(n) {
1731
- const r = n == null ? void 0 : n.trim();
1730
+ function za(a) {
1731
+ const r = a == null ? void 0 : a.trim();
1732
1732
  return !r || ll.test(r) ? null : r;
1733
1733
  }
1734
- function ol(n) {
1735
- const r = new Date(n), l = /* @__PURE__ */ new Date(), s = r.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
1734
+ function ol(a) {
1735
+ const r = new Date(a), l = /* @__PURE__ */ new Date(), s = r.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
1736
1736
  return r.toDateString() === l.toDateString() ? s : (l.getTime() - r.getTime()) / 864e5 < 6 ? `${r.toLocaleDateString("en-US", { weekday: "short" })} ${s}` : `${r.toLocaleDateString("en-US", { month: "short", day: "numeric" })}, ${s}`;
1737
1737
  }
1738
1738
  function il({
1739
- seen: n,
1739
+ seen: a,
1740
1740
  channelId: r,
1741
1741
  senderId: l
1742
1742
  }) {
1743
- const s = me(), [o, i] = T(!1), { members: m } = ra(o ? r : null), c = new Set(n.map((d) => String(d.user).toUpperCase())), x = m.filter((d) => {
1743
+ const s = me(), [o, i] = T(!1), { members: m } = sn(o ? r : null), c = new Set(a.map((d) => String(d.user).toUpperCase())), x = m.filter((d) => {
1744
1744
  const b = String(d.user).toUpperCase();
1745
1745
  return b !== l.toUpperCase() && !c.has(b);
1746
- }), f = [...n].sort(
1746
+ }), f = [...a].sort(
1747
1747
  (d, b) => new Date(d.last_read_at).getTime() - new Date(b.last_read_at).getTime()
1748
1748
  );
1749
- return /* @__PURE__ */ a(nt, { open: o, onOpenChange: i, children: [
1750
- /* @__PURE__ */ e(at, { asChild: !0, children: /* @__PURE__ */ a(
1749
+ return /* @__PURE__ */ n(at, { open: o, onOpenChange: i, children: [
1750
+ /* @__PURE__ */ e(nt, { asChild: !0, children: /* @__PURE__ */ n(
1751
1751
  "button",
1752
1752
  {
1753
1753
  type: "button",
@@ -1755,15 +1755,15 @@ function il({
1755
1755
  "font-medium underline decoration-dotted underline-offset-2 hover:decoration-solid",
1756
1756
  s.accentText
1757
1757
  ),
1758
- "aria-label": `Seen by ${n.length} — show who`,
1759
- "data-chat-seen-by": n.length,
1758
+ "aria-label": `Seen by ${a.length} — show who`,
1759
+ "data-chat-seen-by": a.length,
1760
1760
  children: [
1761
1761
  "Seen by ",
1762
- n.length
1762
+ a.length
1763
1763
  ]
1764
1764
  }
1765
1765
  ) }),
1766
- /* @__PURE__ */ a(
1766
+ /* @__PURE__ */ n(
1767
1767
  st,
1768
1768
  {
1769
1769
  align: "end",
@@ -1771,13 +1771,13 @@ function il({
1771
1771
  className: g("w-[240px] p-0", s.surface),
1772
1772
  "data-chat-seen-by-panel": !0,
1773
1773
  children: [
1774
- /* @__PURE__ */ a("p", { className: "border-b border-slate-100 px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400 dark:border-border", children: [
1774
+ /* @__PURE__ */ n("p", { className: "border-b border-slate-100 px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400 dark:border-border", children: [
1775
1775
  "Seen by ",
1776
- n.length
1776
+ a.length
1777
1777
  ] }),
1778
- /* @__PURE__ */ a("div", { className: "max-h-[260px] overflow-y-auto py-1", children: [
1779
- f.map((d) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
1780
- /* @__PURE__ */ e(K, { id: d.user, name: d.name || null, size: 22 }),
1778
+ /* @__PURE__ */ n("div", { className: "max-h-[260px] overflow-y-auto py-1", children: [
1779
+ f.map((d) => /* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
1780
+ /* @__PURE__ */ e(J, { id: d.user, name: d.name || null, size: 22 }),
1781
1781
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: d.name || "Someone" }),
1782
1782
  /* @__PURE__ */ e(
1783
1783
  "span",
@@ -1788,15 +1788,15 @@ function il({
1788
1788
  }
1789
1789
  )
1790
1790
  ] }, d.user)),
1791
- x.length > 0 && /* @__PURE__ */ a(ke, { children: [
1792
- /* @__PURE__ */ a("p", { className: "px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1791
+ x.length > 0 && /* @__PURE__ */ n(we, { children: [
1792
+ /* @__PURE__ */ n("p", { className: "px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1793
1793
  "Not seen yet · ",
1794
1794
  x.length
1795
1795
  ] }),
1796
1796
  x.map((d) => {
1797
1797
  const b = [d.first_name, d.last_name].filter(Boolean).join(" ") || d.email || "Someone";
1798
- return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5 opacity-70", children: [
1799
- /* @__PURE__ */ e(K, { id: d.user, name: b, size: 22 }),
1798
+ return /* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-1.5 opacity-70", children: [
1799
+ /* @__PURE__ */ e(J, { id: d.user, name: b, size: 22 }),
1800
1800
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300", children: b })
1801
1801
  ] }, d.user);
1802
1802
  })
@@ -1808,16 +1808,16 @@ function il({
1808
1808
  )
1809
1809
  ] });
1810
1810
  }
1811
- function cl({ channel: n, onLeft: r }) {
1812
- var H;
1811
+ function cl({ channel: a, onLeft: r }) {
1812
+ var z;
1813
1813
  const l = me(), s = Le(), { isAdmin: o } = gt(), [i, m] = T(!1), [c, x] = T(""), f = xt(c, 250), d = xr(
1814
- `channel-${n.id}`,
1815
- `/chat/channels/${n.id}/members`,
1814
+ `channel-${a.id}`,
1815
+ `/chat/channels/${a.id}/members`,
1816
1816
  f,
1817
1817
  i
1818
- ), b = d.members, y = d.loading, { addMember: U, removeMember: M } = la(n.id), [C, S] = T(""), W = xt(C, 250), $ = ((H = s.me) == null ? void 0 : H.id.toUpperCase()) ?? "", v = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: q } = Qt(W, i && v && !!C.trim()), Y = new Set(b.map((R) => R.id.toUpperCase())), G = b;
1819
- return /* @__PURE__ */ a(nt, { open: i, onOpenChange: m, children: [
1820
- /* @__PURE__ */ e(at, { asChild: !0, children: /* @__PURE__ */ a(
1818
+ ), b = d.members, k = d.loading, { addMember: U, removeMember: A } = rn(a.id), [C, S] = T(""), W = xt(C, 250), $ = ((z = s.me) == null ? void 0 : z.id.toUpperCase()) ?? "", y = o || !!$ && String(a.created_by ?? "").toUpperCase() === $, { users: q } = Qt(W, i && y && !!C.trim()), Z = new Set(b.map((R) => R.id.toUpperCase())), Q = b;
1819
+ return /* @__PURE__ */ n(at, { open: i, onOpenChange: m, children: [
1820
+ /* @__PURE__ */ e(nt, { asChild: !0, children: /* @__PURE__ */ n(
1821
1821
  "button",
1822
1822
  {
1823
1823
  type: "button",
@@ -1834,7 +1834,7 @@ function cl({ channel: n, onLeft: r }) {
1834
1834
  ]
1835
1835
  }
1836
1836
  ) }),
1837
- /* @__PURE__ */ a(
1837
+ /* @__PURE__ */ n(
1838
1838
  st,
1839
1839
  {
1840
1840
  align: "end",
@@ -1842,40 +1842,40 @@ function cl({ channel: n, onLeft: r }) {
1842
1842
  className: g("w-[260px] p-0", l.surface),
1843
1843
  "data-chat-group-members-panel": !0,
1844
1844
  children: [
1845
- /* @__PURE__ */ a("div", { className: g("border-b px-3 py-2", l.divider), children: [
1846
- /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1845
+ /* @__PURE__ */ n("div", { className: g("border-b px-3 py-2", l.divider), children: [
1846
+ /* @__PURE__ */ n("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1847
1847
  "In this conversation ",
1848
1848
  d.total > 0 && `· ${d.total.toLocaleString("en-US")}`
1849
1849
  ] }),
1850
1850
  (d.total > 10 || c) && /* @__PURE__ */ e(Ar, { value: c, onChange: x, className: "mt-1.5" })
1851
1851
  ] }),
1852
- /* @__PURE__ */ a("div", { className: "max-h-[280px] overflow-y-auto py-1", children: [
1853
- y && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
1854
- !y && G.length === 0 && c.trim() && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No one matches." }),
1855
- G.map((R) => {
1856
- const J = R.id.toUpperCase(), V = R.name, Z = J === $, X = String(n.created_by ?? "").toUpperCase() === J;
1857
- return /* @__PURE__ */ a(
1852
+ /* @__PURE__ */ n("div", { className: "max-h-[280px] overflow-y-auto py-1", children: [
1853
+ k && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
1854
+ !k && Q.length === 0 && c.trim() && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No one matches." }),
1855
+ Q.map((R) => {
1856
+ const Y = R.id.toUpperCase(), X = R.name, V = Y === $, ee = String(a.created_by ?? "").toUpperCase() === Y;
1857
+ return /* @__PURE__ */ n(
1858
1858
  "div",
1859
1859
  {
1860
1860
  className: "group flex items-center gap-2 px-3 py-1.5",
1861
1861
  "data-chat-group-member": R.id,
1862
1862
  children: [
1863
- /* @__PURE__ */ e(K, { id: R.id, name: V, size: 26 }),
1864
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
1865
- /* @__PURE__ */ a("span", { className: "block truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
1866
- V,
1867
- Z && /* @__PURE__ */ e("span", { className: "text-slate-400", children: " (you)" })
1863
+ /* @__PURE__ */ e(J, { id: R.id, name: X, size: 26 }),
1864
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
1865
+ /* @__PURE__ */ n("span", { className: "block truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
1866
+ X,
1867
+ V && /* @__PURE__ */ e("span", { className: "text-slate-400", children: " (you)" })
1868
1868
  ] }),
1869
- X && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
1869
+ ee && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
1870
1870
  ] }),
1871
1871
  /* @__PURE__ */ e(Rr, { online: R.online }),
1872
- v && !Z && /* @__PURE__ */ e(
1872
+ y && !V && /* @__PURE__ */ e(
1873
1873
  "button",
1874
1874
  {
1875
1875
  type: "button",
1876
- title: `Remove ${V}`,
1877
- "aria-label": `Remove ${V}`,
1878
- onClick: () => M.mutate(R.id),
1876
+ title: `Remove ${X}`,
1877
+ "aria-label": `Remove ${X}`,
1878
+ onClick: () => A.mutate(R.id),
1879
1879
  className: "rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-red-500 focus:opacity-100 group-hover:opacity-100 dark:hover:bg-muted",
1880
1880
  children: /* @__PURE__ */ e(bt, { className: "h-3 w-3" })
1881
1881
  }
@@ -1894,7 +1894,7 @@ function cl({ channel: n, onLeft: r }) {
1894
1894
  }
1895
1895
  )
1896
1896
  ] }),
1897
- v && /* @__PURE__ */ a("div", { className: g("border-t px-3 py-2", l.divider), children: [
1897
+ y && /* @__PURE__ */ n("div", { className: g("border-t px-3 py-2", l.divider), children: [
1898
1898
  /* @__PURE__ */ e(
1899
1899
  "input",
1900
1900
  {
@@ -1905,9 +1905,9 @@ function cl({ channel: n, onLeft: r }) {
1905
1905
  "data-chat-group-add": !0
1906
1906
  }
1907
1907
  ),
1908
- C.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: q.filter((R) => !Y.has(String(R.id).toUpperCase())).map((R) => {
1909
- const J = [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.id;
1910
- return /* @__PURE__ */ a(
1908
+ C.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: q.filter((R) => !Z.has(String(R.id).toUpperCase())).map((R) => {
1909
+ const Y = [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.id;
1910
+ return /* @__PURE__ */ n(
1911
1911
  "button",
1912
1912
  {
1913
1913
  type: "button",
@@ -1916,20 +1916,20 @@ function cl({ channel: n, onLeft: r }) {
1916
1916
  },
1917
1917
  className: "flex w-full items-center gap-2 rounded px-1 py-1 text-left hover:bg-muted",
1918
1918
  children: [
1919
- /* @__PURE__ */ e(K, { id: R.id, name: J, size: 22 }),
1920
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: J })
1919
+ /* @__PURE__ */ e(J, { id: R.id, name: Y, size: 22 }),
1920
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: Y })
1921
1921
  ]
1922
1922
  },
1923
1923
  R.id
1924
1924
  );
1925
1925
  }) })
1926
1926
  ] }),
1927
- $ && Y.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
1927
+ $ && Z.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
1928
1928
  "button",
1929
1929
  {
1930
1930
  type: "button",
1931
1931
  onClick: () => {
1932
- M.mutate(s.me.id, {
1932
+ A.mutate(s.me.id, {
1933
1933
  onSuccess: () => {
1934
1934
  m(!1), r();
1935
1935
  }
@@ -1946,16 +1946,16 @@ function cl({ channel: n, onLeft: r }) {
1946
1946
  ] });
1947
1947
  }
1948
1948
  function dl({
1949
- channel: n,
1949
+ channel: a,
1950
1950
  label: r,
1951
1951
  onBack: l
1952
1952
  }) {
1953
- const s = me(), o = Le(), { isAdmin: i } = gt(), m = sa(), { members: c, loading: x } = ra(n.id), { update: f, addMember: d, removeMember: b } = la(n.id), [y, U] = T(r), [M, C] = T(n.topic ?? ""), [S, W] = T(n.visibility), [$, v] = T(n.role ?? ""), [q, Y] = T({
1954
- icon: n.icon ?? null,
1955
- color: n.color ?? null
1956
- }), [G, H] = T(""), R = xt(G, 250), { users: J } = Qt(R, S === "private"), [V, Z] = T(!1), X = n.id === oa, oe = i || !X && !!o.me && String(n.created_by ?? "") === String(o.me.id), se = new Set(c.map((p) => String(p.user).toUpperCase())), pe = y !== r || M !== (n.topic ?? "") || S !== n.visibility || q.icon !== (n.icon ?? null) || q.color !== (n.color ?? null) || S === "role" && $ !== (n.role ?? "");
1957
- return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
1958
- /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", s.divider), children: [
1953
+ const s = me(), o = Le(), { isAdmin: i } = gt(), m = nn(), { members: c, loading: x } = sn(a.id), { update: f, addMember: d, removeMember: b } = rn(a.id), [k, U] = T(r), [A, C] = T(a.topic ?? ""), [S, W] = T(a.visibility), [$, y] = T(a.role ?? ""), [q, Z] = T({
1954
+ icon: a.icon ?? null,
1955
+ color: a.color ?? null
1956
+ }), [Q, z] = T(""), R = xt(Q, 250), { users: Y } = Qt(R, S === "private"), [X, V] = T(!1), ee = a.id === ln, oe = i || !ee && !!o.me && String(a.created_by ?? "") === String(o.me.id), se = new Set(c.map((p) => String(p.user).toUpperCase())), pe = k !== r || A !== (a.topic ?? "") || S !== a.visibility || q.icon !== (a.icon ?? null) || q.color !== (a.color ?? null) || S === "role" && $ !== (a.role ?? "");
1957
+ return /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
1958
+ /* @__PURE__ */ n("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", s.divider), children: [
1959
1959
  /* @__PURE__ */ e(
1960
1960
  "button",
1961
1961
  {
@@ -1966,41 +1966,41 @@ function dl({
1966
1966
  children: /* @__PURE__ */ e(ft, { className: "h-4 w-4" })
1967
1967
  }
1968
1968
  ),
1969
- /* @__PURE__ */ a("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
1969
+ /* @__PURE__ */ n("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
1970
1970
  r,
1971
1971
  " · settings"
1972
1972
  ] })
1973
1973
  ] }),
1974
- /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto p-3", children: [
1975
- oe ? /* @__PURE__ */ a(ke, { children: [
1976
- /* @__PURE__ */ a("label", { className: "block", children: [
1974
+ /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto p-3", children: [
1975
+ oe ? /* @__PURE__ */ n(we, { children: [
1976
+ /* @__PURE__ */ n("label", { className: "block", children: [
1977
1977
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Name" }),
1978
1978
  /* @__PURE__ */ e(
1979
1979
  "input",
1980
1980
  {
1981
- value: y,
1981
+ value: k,
1982
1982
  onChange: (p) => U(p.target.value),
1983
1983
  className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", s.input)
1984
1984
  }
1985
1985
  )
1986
1986
  ] }),
1987
- !n.is_direct && /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
1987
+ !a.is_direct && /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
1988
1988
  /* @__PURE__ */ e(et, { icon: q.icon, color: q.color, size: 40 }),
1989
- /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Xn, { icon: q.icon, color: q.color, onChange: Y }) })
1989
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Va, { icon: q.icon, color: q.color, onChange: Z }) })
1990
1990
  ] }),
1991
- /* @__PURE__ */ a("label", { className: "block", children: [
1991
+ /* @__PURE__ */ n("label", { className: "block", children: [
1992
1992
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Topic" }),
1993
1993
  /* @__PURE__ */ e(
1994
1994
  "input",
1995
1995
  {
1996
- value: M,
1996
+ value: A,
1997
1997
  onChange: (p) => C(p.target.value),
1998
1998
  placeholder: "What this channel is for",
1999
1999
  className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", s.input)
2000
2000
  }
2001
2001
  )
2002
2002
  ] }),
2003
- !X && /* @__PURE__ */ a("div", { children: [
2003
+ !ee && /* @__PURE__ */ n("div", { children: [
2004
2004
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Who can see it" }),
2005
2005
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: [
2006
2006
  ["open", "Anyone"],
@@ -2023,7 +2023,7 @@ function dl({
2023
2023
  Ht,
2024
2024
  {
2025
2025
  value: $,
2026
- onChange: v,
2026
+ onChange: y,
2027
2027
  className: g(
2028
2028
  "mt-2 h-8 w-full rounded-md px-2 text-[12.5px] outline-none",
2029
2029
  s.input
@@ -2035,21 +2035,21 @@ function dl({
2035
2035
  }
2036
2036
  )
2037
2037
  ] }),
2038
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2038
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2039
2039
  /* @__PURE__ */ e(
2040
2040
  "button",
2041
2041
  {
2042
2042
  type: "button",
2043
2043
  disabled: !pe || f.isPending || S === "role" && !$,
2044
2044
  onClick: () => f.mutate(
2045
- X ? {
2046
- name: y.trim() || r,
2047
- topic: M.trim() || null,
2045
+ ee ? {
2046
+ name: k.trim() || r,
2047
+ topic: A.trim() || null,
2048
2048
  icon: q.icon,
2049
2049
  color: q.color
2050
2050
  } : {
2051
- name: y.trim() || r,
2052
- topic: M.trim() || null,
2051
+ name: k.trim() || r,
2052
+ topic: A.trim() || null,
2053
2053
  visibility: S,
2054
2054
  role: S === "role" ? $ : null,
2055
2055
  icon: q.icon,
@@ -2063,44 +2063,44 @@ function dl({
2063
2063
  children: f.isPending ? "Saving…" : "Save"
2064
2064
  }
2065
2065
  ),
2066
- X ? /* @__PURE__ */ e("span", { className: "ml-auto text-[11px] text-slate-400", children: "Open to everyone · cannot be archived" }) : /* @__PURE__ */ e(
2066
+ ee ? /* @__PURE__ */ e("span", { className: "ml-auto text-[11px] text-slate-400", children: "Open to everyone · cannot be archived" }) : /* @__PURE__ */ e(
2067
2067
  "button",
2068
2068
  {
2069
2069
  type: "button",
2070
- onClick: () => Z(!0),
2071
- disabled: V,
2070
+ onClick: () => V(!0),
2071
+ disabled: X,
2072
2072
  className: "ml-auto rounded-md px-2 py-1 text-[11.5px] font-medium text-red-500 hover:bg-red-50 disabled:opacity-40 dark:hover:bg-red-950/40",
2073
2073
  "data-chat-archive-everyone": !0,
2074
2074
  children: "Archive for everyone"
2075
2075
  }
2076
2076
  )
2077
2077
  ] }),
2078
- V && !X && /* @__PURE__ */ a(
2078
+ X && !ee && /* @__PURE__ */ n(
2079
2079
  "div",
2080
2080
  {
2081
2081
  className: "space-y-2 rounded-md border border-red-200 bg-red-50 p-2.5 text-[11.5px] leading-relaxed text-red-800 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",
2082
2082
  "data-chat-archive-confirm": !0,
2083
2083
  children: [
2084
- /* @__PURE__ */ a("p", { children: [
2084
+ /* @__PURE__ */ n("p", { children: [
2085
2085
  "Archive ",
2086
- n.is_direct ? "this conversation" : `#${r}`,
2086
+ a.is_direct ? "this conversation" : `#${r}`,
2087
2087
  " for everyone? It closes for all ",
2088
2088
  c.length ? `${c.length} ` : "",
2089
2089
  "members: it leaves their chat lists and nobody can read or post in it any more.",
2090
2090
  " ",
2091
- n.is_direct ? /* @__PURE__ */ a(ke, { children: [
2091
+ a.is_direct ? /* @__PURE__ */ n(we, { children: [
2092
2092
  "To only hide it from your own list, use",
2093
2093
  " ",
2094
2094
  /* @__PURE__ */ e("span", { className: "font-semibold", children: "Archive for me" }),
2095
2095
  " in the room's menu instead."
2096
- ] }) : /* @__PURE__ */ a(ke, { children: [
2096
+ ] }) : /* @__PURE__ */ n(we, { children: [
2097
2097
  "To only stop hearing from it yourself, set",
2098
2098
  " ",
2099
2099
  /* @__PURE__ */ e("span", { className: "font-semibold", children: "Notify me" }),
2100
2100
  " to Never in the room's menu instead."
2101
2101
  ] })
2102
2102
  ] }),
2103
- /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
2103
+ /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
2104
2104
  /* @__PURE__ */ e(
2105
2105
  "button",
2106
2106
  {
@@ -2115,7 +2115,7 @@ function dl({
2115
2115
  "button",
2116
2116
  {
2117
2117
  type: "button",
2118
- onClick: () => Z(!1),
2118
+ onClick: () => V(!1),
2119
2119
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-muted dark:border-border dark:bg-card dark:text-slate-200",
2120
2120
  children: "Cancel"
2121
2121
  }
@@ -2124,23 +2124,23 @@ function dl({
2124
2124
  ]
2125
2125
  }
2126
2126
  ),
2127
- f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Zn(f.error, "Could not save the changes") }),
2128
- !n.is_direct && /* @__PURE__ */ e(Es, { channel: n, th: s, isAdmin: i })
2129
- ] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
2130
- n.topic || "No topic set.",
2127
+ f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Ya(f.error, "Could not save the changes") }),
2128
+ !a.is_direct && /* @__PURE__ */ e(Es, { channel: a, th: s, isAdmin: i })
2129
+ ] }) : /* @__PURE__ */ n("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
2130
+ a.topic || "No topic set.",
2131
2131
  /* @__PURE__ */ e("br", {}),
2132
- X ? "Everyone in the portal can find and join General." : n.visibility === "private" ? "Invite only — you were added by the channel owner." : n.visibility === "role" ? "Everyone with a particular role can see this channel." : "Anyone in the portal can find and join this channel."
2132
+ ee ? "Everyone in the portal can find and join General." : a.visibility === "private" ? "Invite only — you were added by the channel owner." : a.visibility === "role" ? "Everyone with a particular role can see this channel." : "Anyone in the portal can find and join this channel."
2133
2133
  ] }),
2134
- /* @__PURE__ */ a("div", { children: [
2135
- /* @__PURE__ */ a("p", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2134
+ /* @__PURE__ */ n("div", { children: [
2135
+ /* @__PURE__ */ n("p", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2136
2136
  "Members ",
2137
2137
  c.length > 0 && `· ${c.length}`
2138
2138
  ] }),
2139
2139
  x && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Loading…" }),
2140
2140
  c.map((p) => {
2141
2141
  const E = [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email || p.user;
2142
- return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 rounded-lg px-1 py-1", children: [
2143
- /* @__PURE__ */ e(K, { id: p.user, name: E }),
2142
+ return /* @__PURE__ */ n("div", { className: "flex items-center gap-2 rounded-lg px-1 py-1", children: [
2143
+ /* @__PURE__ */ e(J, { id: p.user, name: E }),
2144
2144
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: E }),
2145
2145
  oe && /* @__PURE__ */ e(
2146
2146
  "button",
@@ -2154,28 +2154,28 @@ function dl({
2154
2154
  )
2155
2155
  ] }, p.user);
2156
2156
  }),
2157
- oe && S === "private" && /* @__PURE__ */ a("div", { className: "mt-2", children: [
2157
+ oe && S === "private" && /* @__PURE__ */ n("div", { className: "mt-2", children: [
2158
2158
  /* @__PURE__ */ e(
2159
2159
  "input",
2160
2160
  {
2161
- value: G,
2162
- onChange: (p) => H(p.target.value),
2161
+ value: Q,
2162
+ onChange: (p) => z(p.target.value),
2163
2163
  placeholder: "Add someone…",
2164
2164
  className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", s.input)
2165
2165
  }
2166
2166
  ),
2167
- G.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: J.filter((p) => !se.has(String(p.id).toUpperCase())).map((p) => {
2167
+ Q.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: Y.filter((p) => !se.has(String(p.id).toUpperCase())).map((p) => {
2168
2168
  const E = [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email || p.id;
2169
- return /* @__PURE__ */ a(
2169
+ return /* @__PURE__ */ n(
2170
2170
  "button",
2171
2171
  {
2172
2172
  type: "button",
2173
2173
  onClick: () => {
2174
- d.mutate(p.id), H("");
2174
+ d.mutate(p.id), z("");
2175
2175
  },
2176
2176
  className: "flex w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-muted/50",
2177
2177
  children: [
2178
- /* @__PURE__ */ e(K, { id: p.id, name: E }),
2178
+ /* @__PURE__ */ e(J, { id: p.id, name: E }),
2179
2179
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: E })
2180
2180
  ]
2181
2181
  },
@@ -2184,57 +2184,57 @@ function dl({
2184
2184
  }) }),
2185
2185
  /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] leading-snug text-slate-400", children: "Only members can see an invite-only channel — it is not listed to anyone else." })
2186
2186
  ] }),
2187
- oe && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(qs, { channelId: n.id, th: s }) })
2187
+ oe && !a.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(qs, { channelId: a.id, th: s }) })
2188
2188
  ] }),
2189
- oe && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Is, { channelId: n.id, border: s.divider }),
2190
- !n.is_direct && /* @__PURE__ */ e(Bs, { channelId: n.id, th: s })
2189
+ oe && !a.is_direct && a.id !== 0 && /* @__PURE__ */ e(Is, { channelId: a.id, border: s.divider }),
2190
+ !a.is_direct && /* @__PURE__ */ e(Bs, { channelId: a.id, th: s })
2191
2191
  ] })
2192
2192
  ] });
2193
2193
  }
2194
- function xt(n, r) {
2195
- const [l, s] = T(n);
2196
- return ae(() => {
2197
- const o = setTimeout(() => s(n), r);
2194
+ function xt(a, r) {
2195
+ const [l, s] = T(a);
2196
+ return ne(() => {
2197
+ const o = setTimeout(() => s(a), r);
2198
2198
  return () => clearTimeout(o);
2199
- }, [n, r]), l;
2199
+ }, [a, r]), l;
2200
2200
  }
2201
- function ya(n) {
2201
+ function yn(a) {
2202
2202
  var r;
2203
- return n ? n.kind === "dm" || n.kind === "entity" || n.kind === "channel" && !!((r = n.channel) != null && r.is_direct) : !1;
2203
+ return a ? a.kind === "dm" || a.kind === "entity" || a.kind === "channel" && !!((r = a.channel) != null && r.is_direct) : !1;
2204
2204
  }
2205
2205
  const At = [
2206
2206
  { value: "recent", label: "Recent activity" },
2207
2207
  { value: "unread", label: "Unread first" },
2208
2208
  { value: "alpha", label: "A–Z" }
2209
2209
  ];
2210
- function Qn(n) {
2210
+ function Ga(a) {
2211
2211
  var r;
2212
- return (r = n.lastMessage) != null && r.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
2212
+ return (r = a.lastMessage) != null && r.date_created ? new Date(a.lastMessage.date_created).getTime() : 0;
2213
2213
  }
2214
- function ul(n, r) {
2215
- const l = (i, m) => i.label.localeCompare(m.label), s = (i, m) => Qn(m) - Qn(i) || l(i, m), o = [...n];
2214
+ function ul(a, r) {
2215
+ const l = (i, m) => i.label.localeCompare(m.label), s = (i, m) => Ga(m) - Ga(i) || l(i, m), o = [...a];
2216
2216
  return r === "alpha" ? o.sort(l) : r === "unread" ? o.sort((i, m) => +(m.unread > 0) - +(i.unread > 0) || s(i, m)) : o.sort(s);
2217
2217
  }
2218
2218
  function ml({
2219
- value: n,
2219
+ value: a,
2220
2220
  onChange: r
2221
2221
  }) {
2222
- const [l, s] = T(!1), o = At.find((i) => i.value === n) ?? At[0];
2223
- return /* @__PURE__ */ a(nt, { open: l, onOpenChange: s, children: [
2224
- /* @__PURE__ */ e(at, { asChild: !0, children: /* @__PURE__ */ e(
2222
+ const [l, s] = T(!1), o = At.find((i) => i.value === a) ?? At[0];
2223
+ return /* @__PURE__ */ n(at, { open: l, onOpenChange: s, children: [
2224
+ /* @__PURE__ */ e(nt, { asChild: !0, children: /* @__PURE__ */ e(
2225
2225
  "button",
2226
2226
  {
2227
2227
  type: "button",
2228
2228
  title: `Sort: ${o.label}`,
2229
2229
  "aria-label": `Sort rooms: ${o.label}`,
2230
2230
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-border dark:text-slate-400 dark:hover:bg-muted",
2231
- "data-chat-sort": n,
2231
+ "data-chat-sort": a,
2232
2232
  children: /* @__PURE__ */ e(ls, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2233
2233
  }
2234
2234
  ) }),
2235
- /* @__PURE__ */ a(st, { align: "end", className: "w-44 p-1", children: [
2235
+ /* @__PURE__ */ n(st, { align: "end", className: "w-44 p-1", children: [
2236
2236
  /* @__PURE__ */ e("p", { className: "px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: "Sort rooms" }),
2237
- At.map((i) => /* @__PURE__ */ a(
2237
+ At.map((i) => /* @__PURE__ */ n(
2238
2238
  "button",
2239
2239
  {
2240
2240
  type: "button",
@@ -2245,7 +2245,7 @@ function ml({
2245
2245
  "data-chat-sort-option": i.value,
2246
2246
  children: [
2247
2247
  i.label,
2248
- i.value === n && /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2248
+ i.value === a && /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2249
2249
  ]
2250
2250
  },
2251
2251
  i.value
@@ -2253,15 +2253,15 @@ function ml({
2253
2253
  ] })
2254
2254
  ] });
2255
2255
  }
2256
- function Kn({
2257
- rooms: n,
2256
+ function Qa({
2257
+ rooms: a,
2258
2258
  onOpen: r,
2259
2259
  onNewGroup: l,
2260
2260
  archivedView: s = !1,
2261
2261
  loading: o = !1,
2262
2262
  onView: i
2263
2263
  }) {
2264
- const m = me(), c = Le(), { setMuted: x, leave: f, setArchived: d, setStarred: b } = Gt(), y = Ws(), U = ve(
2264
+ const m = me(), c = Le(), { setMuted: x, leave: f, setArchived: d, setStarred: b } = Gt(), k = Ws(), U = ye(
2265
2265
  () => new Map(
2266
2266
  c.onlineUsers.map((p) => [
2267
2267
  String(p.user_id).toUpperCase(),
@@ -2269,19 +2269,19 @@ function Kn({
2269
2269
  ])
2270
2270
  ),
2271
2271
  [c.onlineUsers]
2272
- ), M = Kt(), C = $r(), [S, W] = T(""), $ = xt(S.trim(), 250), { hits: v, meaning: q, loading: Y } = Ys($, y.filters), G = $.length >= 2 || y.active, H = ve(() => {
2272
+ ), A = Kt(), C = $r(), [S, W] = T(""), $ = xt(S.trim(), 250), { hits: y, meaning: q, loading: Z } = Ys($, k.filters), Q = $.length >= 2 || k.active, z = ye(() => {
2273
2273
  const p = /* @__PURE__ */ new Map();
2274
- for (const E of v) p.set(E.room, [...p.get(E.room) ?? [], E]);
2274
+ for (const E of y) p.set(E.room, [...p.get(E.room) ?? [], E]);
2275
2275
  return [...p.entries()].sort((E, u) => u[1].length - E[1].length);
2276
- }, [v]), R = n.filter((p) => p.unread > 0 && !p.muted).length, J = gr(), V = ve(() => new Map(n.map((p) => [p.room, p])), [n]), Z = zt(), X = aa(), oe = Z.chat_sidebar_sort === "unread" || Z.chat_sidebar_sort === "alpha" ? Z.chat_sidebar_sort : "recent", se = ul(
2277
- $ ? n.filter((p) => p.label.toLowerCase().includes($.toLowerCase())) : n,
2276
+ }, [y]), R = a.filter((p) => p.unread > 0 && !p.muted).length, Y = gr(), X = ye(() => new Map(a.map((p) => [p.room, p])), [a]), V = zt(), ee = an(), oe = V.chat_sidebar_sort === "unread" || V.chat_sidebar_sort === "alpha" ? V.chat_sidebar_sort : "recent", se = ul(
2277
+ $ ? a.filter((p) => p.label.toLowerCase().includes($.toLowerCase())) : a,
2278
2278
  oe
2279
2279
  ), pe = (p) => {
2280
2280
  var E;
2281
2281
  return p.kind === "channel" && ((E = p.channel) == null ? void 0 : E.is_direct);
2282
2282
  };
2283
- return /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", "data-chat-room-list": !0, children: [
2284
- /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
2283
+ return /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", "data-chat-room-list": !0, children: [
2284
+ /* @__PURE__ */ n("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
2285
2285
  /* @__PURE__ */ e(
2286
2286
  "input",
2287
2287
  {
@@ -2296,12 +2296,12 @@ function Kn({
2296
2296
  "data-chat-global-search": !0
2297
2297
  }
2298
2298
  ),
2299
- !s && /* @__PURE__ */ e(Fs, { open: y.open, active: y.active, onClick: () => y.setOpen(!y.open) }),
2299
+ !s && /* @__PURE__ */ e(Fs, { open: k.open, active: k.active, onClick: () => k.setOpen(!k.open) }),
2300
2300
  /* @__PURE__ */ e(
2301
2301
  ml,
2302
2302
  {
2303
2303
  value: oe,
2304
- onChange: (p) => X.mutate({ chat_sidebar_sort: p === "recent" ? null : p })
2304
+ onChange: (p) => ee.mutate({ chat_sidebar_sort: p === "recent" ? null : p })
2305
2305
  }
2306
2306
  ),
2307
2307
  !s && /* @__PURE__ */ e(Hs, {}),
@@ -2317,9 +2317,9 @@ function Kn({
2317
2317
  }
2318
2318
  )
2319
2319
  ] }),
2320
- !s && y.open && /* @__PURE__ */ e(zs, { filters: y.filters, onChange: y.setFilters, rooms: n, th: m }),
2321
- !s && i && !G && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
2322
- /* @__PURE__ */ a(
2320
+ !s && k.open && /* @__PURE__ */ e(zs, { filters: k.filters, onChange: k.setFilters, rooms: a, th: m }),
2321
+ !s && i && !Q && /* @__PURE__ */ n("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
2322
+ /* @__PURE__ */ n(
2323
2323
  "button",
2324
2324
  {
2325
2325
  type: "button",
@@ -2327,12 +2327,12 @@ function Kn({
2327
2327
  className: "inline-flex h-6 items-center gap-1 rounded-full border border-slate-200 px-2 text-[11px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
2328
2328
  "data-chat-view": "mentions",
2329
2329
  children: [
2330
- /* @__PURE__ */ e(Ya, { className: "h-3 w-3" }),
2330
+ /* @__PURE__ */ e(Yn, { className: "h-3 w-3" }),
2331
2331
  " Mentions"
2332
2332
  ]
2333
2333
  }
2334
2334
  ),
2335
- /* @__PURE__ */ a(
2335
+ /* @__PURE__ */ n(
2336
2336
  "button",
2337
2337
  {
2338
2338
  type: "button",
@@ -2340,12 +2340,12 @@ function Kn({
2340
2340
  className: "inline-flex h-6 items-center gap-1 rounded-full border border-slate-200 px-2 text-[11px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
2341
2341
  "data-chat-view": "scheduled",
2342
2342
  children: [
2343
- /* @__PURE__ */ e(Za, { className: "h-3 w-3" }),
2343
+ /* @__PURE__ */ e(Zn, { className: "h-3 w-3" }),
2344
2344
  " Scheduled"
2345
2345
  ]
2346
2346
  }
2347
2347
  ),
2348
- R > 1 && /* @__PURE__ */ a(
2348
+ R > 1 && /* @__PURE__ */ n(
2349
2349
  "button",
2350
2350
  {
2351
2351
  type: "button",
@@ -2356,7 +2356,7 @@ function Kn({
2356
2356
  ),
2357
2357
  "data-chat-view": "catchup",
2358
2358
  children: [
2359
- /* @__PURE__ */ e(Va, { className: "h-3 w-3" }),
2359
+ /* @__PURE__ */ e(Vn, { className: "h-3 w-3" }),
2360
2360
  " Catch up · ",
2361
2361
  R,
2362
2362
  " rooms"
@@ -2364,19 +2364,19 @@ function Kn({
2364
2364
  }
2365
2365
  )
2366
2366
  ] }),
2367
- G && !s && /* @__PURE__ */ a("div", { className: "mb-1.5", "data-chat-search-results": !0, children: [
2368
- /* @__PURE__ */ a("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2367
+ Q && !s && /* @__PURE__ */ n("div", { className: "mb-1.5", "data-chat-search-results": !0, children: [
2368
+ /* @__PURE__ */ n("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2369
2369
  "Messages",
2370
- v.length ? ` · ${v.length}` : ""
2370
+ y.length ? ` · ${y.length}` : ""
2371
2371
  ] }),
2372
- Y ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "Searching…" }) : v.length === 0 ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "No messages match." }) : H.map(([p, E]) => {
2373
- const u = V.get(p);
2374
- return /* @__PURE__ */ a("div", { className: "mb-1", "data-chat-search-group": p, children: [
2375
- /* @__PURE__ */ a("p", { className: "flex items-center gap-1.5 px-2.5 pb-0.5 pt-1 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: [
2372
+ Z ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "Searching…" }) : y.length === 0 ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "No messages match." }) : z.map(([p, E]) => {
2373
+ const u = X.get(p);
2374
+ return /* @__PURE__ */ n("div", { className: "mb-1", "data-chat-search-group": p, children: [
2375
+ /* @__PURE__ */ n("p", { className: "flex items-center gap-1.5 px-2.5 pb-0.5 pt-1 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: [
2376
2376
  /* @__PURE__ */ e("span", { className: "truncate", children: (u == null ? void 0 : u.label) ?? p }),
2377
2377
  /* @__PURE__ */ e("span", { className: "rounded-full bg-slate-100 px-1.5 text-[10px] font-medium tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: E.length })
2378
2378
  ] }),
2379
- E.slice(0, 5).map((P) => /* @__PURE__ */ a(
2379
+ E.slice(0, 5).map((P) => /* @__PURE__ */ n(
2380
2380
  "button",
2381
2381
  {
2382
2382
  type: "button",
@@ -2387,7 +2387,7 @@ function Kn({
2387
2387
  className: "flex w-full flex-col gap-0.5 rounded-lg px-2.5 py-1.5 text-left transition-colors hover:bg-slate-50 disabled:cursor-default dark:hover:bg-muted/50",
2388
2388
  "data-chat-search-hit": P.id,
2389
2389
  children: [
2390
- /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5 text-[10.5px] text-slate-400", children: [
2390
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[10.5px] text-slate-400", children: [
2391
2391
  /* @__PURE__ */ e("span", { className: "truncate", children: P.sender_name ?? "Someone" }),
2392
2392
  /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: Ds(P.date_created) })
2393
2393
  ] }),
@@ -2396,11 +2396,11 @@ function Kn({
2396
2396
  },
2397
2397
  P.id
2398
2398
  )),
2399
- E.length > 5 && u && /* @__PURE__ */ a(
2399
+ E.length > 5 && u && /* @__PURE__ */ n(
2400
2400
  "button",
2401
2401
  {
2402
2402
  type: "button",
2403
- onClick: () => y.setFilters({ ...y.filters, room: p }),
2403
+ onClick: () => k.setFilters({ ...k.filters, room: p }),
2404
2404
  className: g("px-2.5 py-0.5 text-[11px] font-medium", m.accentText),
2405
2405
  children: [
2406
2406
  "All ",
@@ -2412,7 +2412,7 @@ function Kn({
2412
2412
  )
2413
2413
  ] }, p);
2414
2414
  }),
2415
- !Y && q === "words" && /* @__PURE__ */ e(
2415
+ !Z && q === "words" && /* @__PURE__ */ e(
2416
2416
  "p",
2417
2417
  {
2418
2418
  className: "px-2.5 pb-1 pt-1.5 text-[10.5px] leading-snug text-slate-400",
@@ -2421,15 +2421,15 @@ function Kn({
2421
2421
  }
2422
2422
  )
2423
2423
  ] }),
2424
- s && !o && n.length === 0 && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12px] leading-relaxed text-slate-400", children: "Nothing archived. Archiving is just for you: the conversation leaves your chat list and stops alerting you, while everyone else in it carries on as before. Archive from a room's header or its row in your chat list; writing in it again brings it back." }),
2424
+ s && !o && a.length === 0 && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12px] leading-relaxed text-slate-400", children: "Nothing archived. Archiving is just for you: the conversation leaves your chat list and stops alerting you, while everyone else in it carries on as before. Archive from a room's header or its row in your chat list; writing in it again brings it back." }),
2425
2425
  s && o && /* @__PURE__ */ e("p", { className: "px-3 py-3 text-[12px] text-slate-400", children: "Loading…" }),
2426
- !s && M.bot_name && M.bot_user_id && c.me && /* @__PURE__ */ a(
2426
+ !s && A.bot_name && A.bot_user_id && c.me && /* @__PURE__ */ n(
2427
2427
  "button",
2428
2428
  {
2429
2429
  type: "button",
2430
2430
  onClick: () => r({
2431
- room: It(c.me.id, M.bot_user_id),
2432
- label: `@${M.bot_name}`,
2431
+ room: It(c.me.id, A.bot_user_id),
2432
+ label: `@${A.bot_name}`,
2433
2433
  kind: "dm",
2434
2434
  lastMessage: null,
2435
2435
  unread: 0,
@@ -2451,10 +2451,10 @@ function Kn({
2451
2451
  children: "@"
2452
2452
  }
2453
2453
  ),
2454
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2455
- /* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
2454
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
2455
+ /* @__PURE__ */ n("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
2456
2456
  "Ask @",
2457
- M.bot_name
2457
+ A.bot_name
2458
2458
  ] }),
2459
2459
  /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Your AI assistant — questions, summaries, reminders" })
2460
2460
  ] })
@@ -2475,12 +2475,12 @@ function Kn({
2475
2475
  ],
2476
2476
  ["Records", se.filter((p) => !p.starred && p.kind === "entity")]
2477
2477
  ].map(
2478
- ([p, E]) => E.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mb-1.5", children: [
2478
+ ([p, E]) => E.length === 0 ? null : /* @__PURE__ */ n("div", { className: "mb-1.5", children: [
2479
2479
  /* @__PURE__ */ e("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: p }),
2480
2480
  E.map((u) => {
2481
- var P, Ce, we, Pe, _e, Ae;
2482
- return /* @__PURE__ */ a("div", { className: "group/room relative", children: [
2483
- /* @__PURE__ */ a(
2481
+ var P, Ce, he, Pe, _e, Ae;
2482
+ return /* @__PURE__ */ n("div", { className: "group/room relative", children: [
2483
+ /* @__PURE__ */ n(
2484
2484
  "button",
2485
2485
  {
2486
2486
  type: "button",
@@ -2491,25 +2491,25 @@ function Kn({
2491
2491
  const ie = u.kind === "dm" && c.me ? Te(u.room, c.me.id) : null;
2492
2492
  if (!ie) return null;
2493
2493
  const ze = U.get(ie.toUpperCase()) ?? "offline";
2494
- return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": ze, children: /* @__PURE__ */ e(K, { id: ie, name: u.label, size: 32 }) });
2494
+ return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": ze, children: /* @__PURE__ */ e(J, { id: ie, name: u.label, size: 32 }) });
2495
2495
  })(),
2496
- u.kind === "channel" && !((P = u.channel) != null && P.is_direct) || u.kind === "global" && ((Ce = u.channel) != null && Ce.icon || (we = u.channel) != null && we.color) ? /* @__PURE__ */ e(et, { icon: (Pe = u.channel) == null ? void 0 : Pe.icon, color: (_e = u.channel) == null ? void 0 : _e.color, size: 32 }) : /* @__PURE__ */ e(
2496
+ u.kind === "channel" && !((P = u.channel) != null && P.is_direct) || u.kind === "global" && ((Ce = u.channel) != null && Ce.icon || (he = u.channel) != null && he.color) ? /* @__PURE__ */ e(et, { icon: (Pe = u.channel) == null ? void 0 : Pe.icon, color: (_e = u.channel) == null ? void 0 : _e.color, size: 32 }) : /* @__PURE__ */ e(
2497
2497
  "span",
2498
2498
  {
2499
2499
  className: g(
2500
2500
  "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400",
2501
2501
  u.kind === "dm" && c.me && Te(u.room, c.me.id) && "hidden"
2502
2502
  ),
2503
- children: u.kind === "dm" ? /* @__PURE__ */ e(Yn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (Ae = u.channel) != null && Ae.is_direct ? /* @__PURE__ */ e(Pt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(Ot, { className: "h-4 w-4", strokeWidth: 1.8 })
2503
+ children: u.kind === "dm" ? /* @__PURE__ */ e(Ja, { className: "h-4 w-4", strokeWidth: 1.8 }) : (Ae = u.channel) != null && Ae.is_direct ? /* @__PURE__ */ e(Pt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(Ot, { className: "h-4 w-4", strokeWidth: 1.8 })
2504
2504
  }
2505
2505
  ),
2506
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2507
- /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
2506
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
2507
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5", children: [
2508
2508
  /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u.label }),
2509
- u.muted && /* @__PURE__ */ e(An, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
2509
+ u.muted && /* @__PURE__ */ e(Ma, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
2510
2510
  /* @__PURE__ */ e(Sr, { count: C.countFor(u.room), label: u.label }),
2511
- J.has(u.room) && /* @__PURE__ */ e(
2512
- Xa,
2511
+ Y.has(u.room) && /* @__PURE__ */ e(
2512
+ Xn,
2513
2513
  {
2514
2514
  className: "h-3 w-3 shrink-0 text-slate-400",
2515
2515
  strokeWidth: 2,
@@ -2519,7 +2519,7 @@ function Kn({
2519
2519
  }
2520
2520
  )
2521
2521
  ] }),
2522
- u.lastMessage && /* @__PURE__ */ a("span", { className: "block truncate text-[11px] text-slate-400", children: [
2522
+ u.lastMessage && /* @__PURE__ */ n("span", { className: "block truncate text-[11px] text-slate-400", children: [
2523
2523
  u.lastMessage.sender_name ? `${u.lastMessage.sender_name}: ` : "",
2524
2524
  u.lastMessage.message
2525
2525
  ] })
@@ -2548,7 +2548,7 @@ function Kn({
2548
2548
  ]
2549
2549
  }
2550
2550
  ),
2551
- /* @__PURE__ */ a("span", { className: "absolute right-1.5 top-1.5 hidden items-center gap-0.5 group-hover/room:flex", children: [
2551
+ /* @__PURE__ */ n("span", { className: "absolute right-1.5 top-1.5 hidden items-center gap-0.5 group-hover/room:flex", children: [
2552
2552
  !s && /* @__PURE__ */ e(
2553
2553
  "button",
2554
2554
  {
@@ -2566,7 +2566,7 @@ function Kn({
2566
2566
  )
2567
2567
  }
2568
2568
  ),
2569
- ya(u) && /* @__PURE__ */ e(
2569
+ yn(u) && /* @__PURE__ */ e(
2570
2570
  "button",
2571
2571
  {
2572
2572
  type: "button",
@@ -2575,7 +2575,7 @@ function Kn({
2575
2575
  onClick: () => d.mutate({ room: u.room, archived: !s }),
2576
2576
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
2577
2577
  "data-chat-row-archive": s ? "unarchive" : "archive",
2578
- children: s ? /* @__PURE__ */ e(ts, { className: "h-3 w-3" }) : /* @__PURE__ */ e(ns, { className: "h-3 w-3" })
2578
+ children: s ? /* @__PURE__ */ e(ts, { className: "h-3 w-3" }) : /* @__PURE__ */ e(as, { className: "h-3 w-3" })
2579
2579
  }
2580
2580
  ),
2581
2581
  /* @__PURE__ */ e(
@@ -2585,7 +2585,7 @@ function Kn({
2585
2585
  title: u.muted ? "Unmute" : "Mute",
2586
2586
  onClick: () => x.mutate({ room: u.room, muted: !u.muted }),
2587
2587
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
2588
- children: u.muted ? /* @__PURE__ */ e(as, { className: "h-3 w-3" }) : /* @__PURE__ */ e(An, { className: "h-3 w-3" })
2588
+ children: u.muted ? /* @__PURE__ */ e(ns, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Ma, { className: "h-3 w-3" })
2589
2589
  }
2590
2590
  ),
2591
2591
  (u.kind === "channel" || u.kind === "global" || u.kind === "entity") && u.joined && /* @__PURE__ */ e(
@@ -2608,14 +2608,14 @@ function Kn({
2608
2608
  ] });
2609
2609
  }
2610
2610
  function ko({
2611
- view: n,
2611
+ view: a,
2612
2612
  rooms: r,
2613
2613
  onBack: l,
2614
2614
  onOpen: s
2615
2615
  }) {
2616
2616
  const o = me();
2617
- return n === "mentions" ? /* @__PURE__ */ e(ea, { th: o, onBack: l, onOpen: s }) : n === "scheduled" ? /* @__PURE__ */ e(
2618
- ta,
2617
+ return a === "mentions" ? /* @__PURE__ */ e(Xa, { th: o, onBack: l, onOpen: s }) : a === "scheduled" ? /* @__PURE__ */ e(
2618
+ en,
2619
2619
  {
2620
2620
  th: o,
2621
2621
  onBack: l,
@@ -2624,57 +2624,57 @@ function ko({
2624
2624
  return ((m = r.find((c) => c.room === i)) == null ? void 0 : m.label) ?? i;
2625
2625
  }
2626
2626
  }
2627
- ) : /* @__PURE__ */ e(na, { rooms: r, th: o, onBack: l, onOpen: s });
2627
+ ) : /* @__PURE__ */ e(tn, { rooms: r, th: o, onBack: l, onOpen: s });
2628
2628
  }
2629
2629
  function pl({
2630
- onOpen: n
2630
+ onOpen: a
2631
2631
  }) {
2632
- const r = me(), [l, s] = T(""), [o, i] = T(!1), [m, c] = T(""), [x, f] = T("open"), [d, b] = T(""), [y, U] = T({
2632
+ const r = me(), [l, s] = T(""), [o, i] = T(!1), [m, c] = T(""), [x, f] = T("open"), [d, b] = T(""), [k, U] = T({
2633
2633
  icon: null,
2634
2634
  color: null
2635
- }), M = sa(), { channels: C, loading: S } = Qs(l), { join: W } = Gt(), $ = Ks();
2636
- return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
2637
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
2638
- /* @__PURE__ */ a("div", { className: "relative flex-1", children: [
2639
- /* @__PURE__ */ e(Jn, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
2635
+ }), A = nn(), { channels: C, loading: S } = Qs(l), { join: W } = Gt(), $ = Ks();
2636
+ return /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
2637
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2 p-2", children: [
2638
+ /* @__PURE__ */ n("div", { className: "relative flex-1", children: [
2639
+ /* @__PURE__ */ e(Ka, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
2640
2640
  /* @__PURE__ */ e(
2641
2641
  "input",
2642
2642
  {
2643
2643
  value: l,
2644
- onChange: (v) => s(v.target.value),
2644
+ onChange: (y) => s(y.target.value),
2645
2645
  placeholder: "Search channels…",
2646
2646
  className: g("h-8 w-full rounded-md pl-8 pr-2 text-[12.5px] outline-none", r.input)
2647
2647
  }
2648
2648
  )
2649
2649
  ] }),
2650
- /* @__PURE__ */ a(
2650
+ /* @__PURE__ */ n(
2651
2651
  "button",
2652
2652
  {
2653
2653
  type: "button",
2654
- onClick: () => i((v) => !v),
2654
+ onClick: () => i((y) => !y),
2655
2655
  className: g(
2656
2656
  "flex h-8 shrink-0 items-center gap-1 rounded-md px-2.5 text-[12px] font-medium",
2657
2657
  r.action
2658
2658
  ),
2659
2659
  children: [
2660
- /* @__PURE__ */ e(za, { className: "h-3.5 w-3.5" }),
2660
+ /* @__PURE__ */ e(zn, { className: "h-3.5 w-3.5" }),
2661
2661
  " New"
2662
2662
  ]
2663
2663
  }
2664
2664
  )
2665
2665
  ] }),
2666
- o && /* @__PURE__ */ a(
2666
+ o && /* @__PURE__ */ n(
2667
2667
  "form",
2668
2668
  {
2669
2669
  className: "flex flex-col gap-2 border-b border-slate-100 p-2 dark:border-border/60",
2670
- onSubmit: (v) => {
2671
- v.preventDefault(), m.trim() && (x === "role" && !d || $.mutate(
2670
+ onSubmit: (y) => {
2671
+ y.preventDefault(), m.trim() && (x === "role" && !d || $.mutate(
2672
2672
  {
2673
2673
  name: m.trim(),
2674
2674
  visibility: x,
2675
2675
  role: x === "role" ? d : null,
2676
- icon: y.icon,
2677
- color: y.color
2676
+ icon: k.icon,
2677
+ color: k.color
2678
2678
  },
2679
2679
  {
2680
2680
  onSuccess: () => {
@@ -2684,13 +2684,13 @@ function pl({
2684
2684
  ));
2685
2685
  },
2686
2686
  children: [
2687
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2688
- /* @__PURE__ */ e(et, { icon: y.icon, color: y.color, size: 32 }),
2687
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2688
+ /* @__PURE__ */ e(et, { icon: k.icon, color: k.color, size: 32 }),
2689
2689
  /* @__PURE__ */ e(
2690
2690
  "input",
2691
2691
  {
2692
2692
  value: m,
2693
- onChange: (v) => c(v.target.value),
2693
+ onChange: (y) => c(y.target.value),
2694
2694
  placeholder: "Channel name",
2695
2695
  className: g(
2696
2696
  "h-8 min-w-0 flex-1 rounded-md px-2 text-[12.5px] outline-none",
@@ -2699,24 +2699,24 @@ function pl({
2699
2699
  }
2700
2700
  )
2701
2701
  ] }),
2702
- /* @__PURE__ */ e(Xn, { icon: y.icon, color: y.color, onChange: U }),
2703
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2702
+ /* @__PURE__ */ e(Va, { icon: k.icon, color: k.color, onChange: U }),
2703
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2704
2704
  [
2705
2705
  ["open", "Anyone"],
2706
2706
  ["role", "One role"],
2707
2707
  ["private", "Invite only"]
2708
- ].map(([v, q]) => /* @__PURE__ */ e(
2708
+ ].map(([y, q]) => /* @__PURE__ */ e(
2709
2709
  "button",
2710
2710
  {
2711
2711
  type: "button",
2712
- onClick: () => f(v),
2712
+ onClick: () => f(y),
2713
2713
  className: g(
2714
2714
  "rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
2715
- x === v ? r.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2715
+ x === y ? r.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2716
2716
  ),
2717
2717
  children: q
2718
2718
  },
2719
- v
2719
+ y
2720
2720
  )),
2721
2721
  /* @__PURE__ */ e(
2722
2722
  "button",
@@ -2736,22 +2736,22 @@ function pl({
2736
2736
  className: g("h-8 w-auto rounded-md px-2 text-[12.5px] outline-none", r.input),
2737
2737
  options: [
2738
2738
  { value: "", label: "Choose a role…" },
2739
- ...M.map((v) => ({ value: v.id, label: v.name }))
2739
+ ...A.map((y) => ({ value: y.id, label: y.name }))
2740
2740
  ]
2741
2741
  }
2742
2742
  ),
2743
- $.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Zn($.error, "Could not create it") })
2743
+ $.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Ya($.error, "Could not create it") })
2744
2744
  ]
2745
2745
  }
2746
2746
  ),
2747
- /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", children: [
2747
+ /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", children: [
2748
2748
  S && /* @__PURE__ */ e("p", { className: "px-2 py-6 text-center text-[12px] text-slate-400", children: "Loading…" }),
2749
- !S && C.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-8 text-center", children: [
2749
+ !S && C.length === 0 && /* @__PURE__ */ n("div", { className: "px-3 py-8 text-center", children: [
2750
2750
  /* @__PURE__ */ e(Ot, { className: "mx-auto h-5 w-5 text-slate-300" }),
2751
2751
  /* @__PURE__ */ e("p", { className: "mt-2 text-[12.5px] font-medium text-slate-600 dark:text-slate-300", children: l ? `No channel matches “${l}”` : "No channels yet" }),
2752
2752
  /* @__PURE__ */ e("p", { className: "mt-1 text-[11.5px] leading-relaxed text-slate-400", children: "Channels and General are shared rooms you join to follow. Record conversations appear on their own once someone posts on a record." })
2753
2753
  ] }),
2754
- C.map((v) => /* @__PURE__ */ a(
2754
+ C.map((y) => /* @__PURE__ */ n(
2755
2755
  "div",
2756
2756
  {
2757
2757
  className: "flex items-center gap-2.5 rounded-lg px-2.5 py-2 hover:bg-slate-50 dark:hover:bg-muted/50",
@@ -2759,21 +2759,21 @@ function pl({
2759
2759
  /* @__PURE__ */ e(
2760
2760
  et,
2761
2761
  {
2762
- icon: v.icon,
2763
- color: v.color,
2762
+ icon: y.icon,
2763
+ color: y.color,
2764
2764
  size: 32,
2765
- fallback: v.visibility === "private" ? Ga : Ot
2765
+ fallback: y.visibility === "private" ? Gn : Ot
2766
2766
  }
2767
2767
  ),
2768
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2769
- /* @__PURE__ */ e("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: v.name }),
2770
- /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: v.topic || `${v.members} member${v.members === 1 ? "" : "s"}` })
2768
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
2769
+ /* @__PURE__ */ e("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: y.name }),
2770
+ /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: y.topic || `${y.members} member${y.members === 1 ? "" : "s"}` })
2771
2771
  ] }),
2772
- v.joined ? /* @__PURE__ */ e(
2772
+ y.joined ? /* @__PURE__ */ e(
2773
2773
  "button",
2774
2774
  {
2775
2775
  type: "button",
2776
- onClick: () => n(v.room, v.name, zn(v)),
2776
+ onClick: () => a(y.room, y.name, Ha(y)),
2777
2777
  className: "shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium text-slate-500 hover:bg-slate-100 dark:hover:bg-muted",
2778
2778
  children: "Open"
2779
2779
  }
@@ -2781,8 +2781,8 @@ function pl({
2781
2781
  "button",
2782
2782
  {
2783
2783
  type: "button",
2784
- onClick: () => W.mutate(v.room, {
2785
- onSuccess: () => n(v.room, v.name, zn(v))
2784
+ onClick: () => W.mutate(y.room, {
2785
+ onSuccess: () => a(y.room, y.name, Ha(y))
2786
2786
  }),
2787
2787
  className: g("shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium", r.action),
2788
2788
  children: "Join"
@@ -2790,17 +2790,17 @@ function pl({
2790
2790
  )
2791
2791
  ]
2792
2792
  },
2793
- v.key
2793
+ y.key
2794
2794
  ))
2795
2795
  ] })
2796
2796
  ] });
2797
2797
  }
2798
2798
  function hl() {
2799
- const n = /* @__PURE__ */ new Date();
2800
- return n.setHours(23, 59, 59, 999), n;
2799
+ const a = /* @__PURE__ */ new Date();
2800
+ return a.setHours(23, 59, 59, 999), a;
2801
2801
  }
2802
2802
  function fl() {
2803
- const n = zt(), r = aa(), [l, s] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), m = (x) => {
2803
+ const a = zt(), r = an(), [l, s] = T(!1), o = a.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), m = (x) => {
2804
2804
  r.mutate({
2805
2805
  presence_override: x === "off" ? null : { mode: "away", until: (x == null ? void 0 : x.toISOString()) ?? null }
2806
2806
  }), s(!1);
@@ -2810,7 +2810,7 @@ function fl() {
2810
2810
  minute: "2-digit",
2811
2811
  timeZone: Wt() ?? void 0
2812
2812
  })}` : i ? "until you switch it off" : null;
2813
- return /* @__PURE__ */ a(
2813
+ return /* @__PURE__ */ n(
2814
2814
  "div",
2815
2815
  {
2816
2816
  className: "mb-1.5 flex items-center gap-2 px-1 text-[12px]",
@@ -2836,8 +2836,8 @@ function fl() {
2836
2836
  "data-chat-appear-away-off": !0,
2837
2837
  children: "Back online"
2838
2838
  }
2839
- ) : /* @__PURE__ */ a(nt, { open: l, onOpenChange: s, children: [
2840
- /* @__PURE__ */ e(at, { asChild: !0, children: /* @__PURE__ */ e(
2839
+ ) : /* @__PURE__ */ n(at, { open: l, onOpenChange: s, children: [
2840
+ /* @__PURE__ */ e(nt, { asChild: !0, children: /* @__PURE__ */ e(
2841
2841
  "button",
2842
2842
  {
2843
2843
  type: "button",
@@ -2846,7 +2846,7 @@ function fl() {
2846
2846
  children: "Appear away"
2847
2847
  }
2848
2848
  ) }),
2849
- /* @__PURE__ */ a(st, { align: "end", className: "w-48 p-1", children: [
2849
+ /* @__PURE__ */ n(st, { align: "end", className: "w-48 p-1", children: [
2850
2850
  /* @__PURE__ */ e("p", { className: "px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: "Appear away for" }),
2851
2851
  [
2852
2852
  ["1 hour", () => new Date(Date.now() + 36e5)],
@@ -2870,29 +2870,29 @@ function fl() {
2870
2870
  }
2871
2871
  );
2872
2872
  }
2873
- function xl(n, r) {
2873
+ function xl(a, r) {
2874
2874
  const l = (s) => {
2875
2875
  const o = r(s);
2876
2876
  return o != null && o.away ? 2 : o != null && o.is_idle ? 1 : 0;
2877
2877
  };
2878
- return n.map((s, o) => ({ u: s, i: o, r: l(s) })).sort((s, o) => s.r - o.r || s.i - o.i).map((s) => s.u);
2878
+ return a.map((s, o) => ({ u: s, i: o, r: l(s) })).sort((s, o) => s.r - o.r || s.i - o.i).map((s) => s.u);
2879
2879
  }
2880
2880
  function bl({
2881
- myStatus: n,
2881
+ myStatus: a,
2882
2882
  onlineFirst: r,
2883
2883
  onOnlineFirst: l
2884
2884
  }) {
2885
2885
  const s = me();
2886
- return /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-start justify-between gap-2 px-1", children: [
2886
+ return /* @__PURE__ */ n("div", { className: "mb-1.5 flex items-start justify-between gap-2 px-1", children: [
2887
2887
  /* @__PURE__ */ e(
2888
2888
  $s,
2889
2889
  {
2890
- status: n ? { text: n.text, emoji: n.emoji } : null,
2890
+ status: a ? { text: a.text, emoji: a.emoji } : null,
2891
2891
  theme: { accentSoft: s.accentSoft, input: s.input, action: s.action },
2892
2892
  className: "min-w-0"
2893
2893
  }
2894
2894
  ),
2895
- r != null && l && /* @__PURE__ */ a(
2895
+ r != null && l && /* @__PURE__ */ n(
2896
2896
  "button",
2897
2897
  {
2898
2898
  type: "button",
@@ -2922,18 +2922,18 @@ function bl({
2922
2922
  )
2923
2923
  ] });
2924
2924
  }
2925
- function ka() {
2925
+ function kn() {
2926
2926
  var i, m, c;
2927
- const n = tt(), r = Ss(15e3), { data: l, isFetched: s } = Ue({
2927
+ const a = tt(), r = Ss(15e3), { data: l, isFetched: s } = Ue({
2928
2928
  queryKey: ["presence-online"],
2929
- queryFn: () => n.request(ye("/presence/online")),
2929
+ queryFn: () => a.request(ke("/presence/online")),
2930
2930
  // Matches the presence heartbeat cadence without a live socket — the page someone is on
2931
2931
  // should track them around the app. Live, presence:changed carries it and this is 60 s.
2932
2932
  refetchInterval: r,
2933
2933
  staleTime: 5e3
2934
2934
  });
2935
2935
  return {
2936
- byUser: ve(() => {
2936
+ byUser: ye(() => {
2937
2937
  const x = /* @__PURE__ */ new Map();
2938
2938
  for (const f of (l == null ? void 0 : l.data) ?? []) x.set(String(f.user_id).toUpperCase(), f);
2939
2939
  return x;
@@ -2944,25 +2944,25 @@ function ka() {
2944
2944
  loaded: s
2945
2945
  };
2946
2946
  }
2947
- function wa(n) {
2948
- if (!n) return null;
2949
- const r = n.split("/").filter(Boolean);
2947
+ function wn(a) {
2948
+ if (!a) return null;
2949
+ const r = a.split("/").filter(Boolean);
2950
2950
  if (r.length === 0) return "Home";
2951
2951
  const l = /* @__PURE__ */ new Set(["records", "collections", "p"]), s = r.filter((o) => !l.has(o));
2952
2952
  return s.length === 0 ? "Home" : s.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (m) => m.toUpperCase()) : o).join(" › ");
2953
2953
  }
2954
2954
  function gl({
2955
- onClose: n,
2955
+ onClose: a,
2956
2956
  onCreated: r
2957
2957
  }) {
2958
- const l = me(), [s, o] = T(""), [i, m] = T(""), [c, x] = T(/* @__PURE__ */ new Map()), { users: f } = Qt(s, !0), d = pr(), b = (y) => [y.first_name, y.last_name].filter(Boolean).join(" ") || (y.email ?? "Unknown");
2959
- return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
2960
- /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
2958
+ const l = me(), [s, o] = T(""), [i, m] = T(""), [c, x] = T(/* @__PURE__ */ new Map()), { users: f } = Qt(s, !0), d = pr(), b = (k) => [k.first_name, k.last_name].filter(Boolean).join(" ") || (k.email ?? "Unknown");
2959
+ return /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
2960
+ /* @__PURE__ */ n("div", { className: "mb-2 flex items-center gap-2", children: [
2961
2961
  /* @__PURE__ */ e(
2962
2962
  "button",
2963
2963
  {
2964
2964
  type: "button",
2965
- onClick: n,
2965
+ onClick: a,
2966
2966
  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",
2967
2967
  "aria-label": "Back",
2968
2968
  children: /* @__PURE__ */ e(ft, { className: "h-4 w-4", strokeWidth: 2 })
@@ -2970,7 +2970,7 @@ function gl({
2970
2970
  ),
2971
2971
  /* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "New group conversation" })
2972
2972
  ] }),
2973
- c.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...c.entries()].map(([y, U]) => /* @__PURE__ */ a(
2973
+ c.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...c.entries()].map(([k, U]) => /* @__PURE__ */ n(
2974
2974
  "span",
2975
2975
  {
2976
2976
  className: g(
@@ -2983,9 +2983,9 @@ function gl({
2983
2983
  "button",
2984
2984
  {
2985
2985
  type: "button",
2986
- onClick: () => x((M) => {
2987
- const C = new Map(M);
2988
- return C.delete(y), C;
2986
+ onClick: () => x((A) => {
2987
+ const C = new Map(A);
2988
+ return C.delete(k), C;
2989
2989
  }),
2990
2990
  "aria-label": `Remove ${U}`,
2991
2991
  children: /* @__PURE__ */ e(bt, { className: "h-3 w-3" })
@@ -2993,47 +2993,47 @@ function gl({
2993
2993
  )
2994
2994
  ]
2995
2995
  },
2996
- y
2996
+ k
2997
2997
  )) }),
2998
2998
  /* @__PURE__ */ e(
2999
2999
  "input",
3000
3000
  {
3001
3001
  value: s,
3002
- onChange: (y) => o(y.target.value),
3002
+ onChange: (k) => o(k.target.value),
3003
3003
  placeholder: "Find people…",
3004
3004
  className: g("mb-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none", l.input),
3005
3005
  "aria-label": "Find people",
3006
3006
  autoFocus: !0
3007
3007
  }
3008
3008
  ),
3009
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((y) => {
3010
- const U = c.has(y.id);
3011
- return /* @__PURE__ */ a(
3009
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((k) => {
3010
+ const U = c.has(k.id);
3011
+ return /* @__PURE__ */ n(
3012
3012
  "button",
3013
3013
  {
3014
3014
  type: "button",
3015
- onClick: () => x((M) => {
3016
- const C = new Map(M);
3017
- return U ? C.delete(y.id) : C.set(y.id, b(y)), C;
3015
+ onClick: () => x((A) => {
3016
+ const C = new Map(A);
3017
+ return U ? C.delete(k.id) : C.set(k.id, b(k)), C;
3018
3018
  }),
3019
3019
  className: g(
3020
3020
  "flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[12.5px] transition-colors",
3021
3021
  U ? l.accentSoft : "hover:bg-slate-50 dark:hover:bg-muted/50"
3022
3022
  ),
3023
3023
  children: [
3024
- /* @__PURE__ */ e(K, { id: y.id, name: b(y), size: 22 }),
3025
- /* @__PURE__ */ e("span", { className: "truncate", children: b(y) }),
3024
+ /* @__PURE__ */ e(J, { id: k.id, name: b(k), size: 22 }),
3025
+ /* @__PURE__ */ e("span", { className: "truncate", children: b(k) }),
3026
3026
  U && /* @__PURE__ */ e(Bt, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
3027
3027
  ]
3028
3028
  },
3029
- y.id
3029
+ k.id
3030
3030
  );
3031
3031
  }) }),
3032
3032
  /* @__PURE__ */ e(
3033
3033
  "input",
3034
3034
  {
3035
3035
  value: i,
3036
- onChange: (y) => m(y.target.value),
3036
+ onChange: (k) => m(k.target.value),
3037
3037
  placeholder: "Group name (optional)",
3038
3038
  className: g(
3039
3039
  "mb-2 mt-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none",
@@ -3049,7 +3049,7 @@ function gl({
3049
3049
  disabled: c.size === 0 || d.isPending,
3050
3050
  onClick: () => d.mutate(
3051
3051
  { user_ids: [...c.keys()], name: i.trim() || void 0 },
3052
- { onSuccess: (y) => r(y.room, y.name) }
3052
+ { onSuccess: (k) => r(k.room, k.name) }
3053
3053
  ),
3054
3054
  className: g(
3055
3055
  "flex h-9 items-center justify-center rounded-lg text-[12.5px] font-semibold transition-[filter] hover:brightness-110 disabled:opacity-40",
@@ -3069,94 +3069,94 @@ function vl() {
3069
3069
  }
3070
3070
  }
3071
3071
  function yl() {
3072
- const n = "(min-width: 1024px)", [r, l] = T(
3072
+ const a = "(min-width: 1024px)", [r, l] = T(
3073
3073
  () => {
3074
3074
  var s;
3075
- return typeof window < "u" && !!((s = window.matchMedia) != null && s.call(window, n).matches);
3075
+ return typeof window < "u" && !!((s = window.matchMedia) != null && s.call(window, a).matches);
3076
3076
  }
3077
3077
  );
3078
- return ae(() => {
3078
+ return ne(() => {
3079
3079
  var i;
3080
- const s = (i = window.matchMedia) == null ? void 0 : i.call(window, n);
3080
+ const s = (i = window.matchMedia) == null ? void 0 : i.call(window, a);
3081
3081
  if (!s) return;
3082
3082
  const o = () => l(s.matches);
3083
3083
  return s.addEventListener("change", o), () => s.removeEventListener("change", o);
3084
3084
  }, []), r;
3085
3085
  }
3086
3086
  function wo({
3087
- open: n,
3087
+ open: a,
3088
3088
  onClose: r,
3089
3089
  renderMessageBody: l,
3090
3090
  requestedDm: s,
3091
3091
  requestedRoom: o
3092
3092
  }) {
3093
3093
  var Ie;
3094
- const i = Le(), m = me(), c = i.me, [x, f] = T(vl), d = yl(), b = x && d, y = () => {
3095
- const k = !x;
3096
- f(k);
3094
+ const i = Le(), m = me(), c = i.me, [x, f] = T(vl), d = yl(), b = x && d, k = () => {
3095
+ const v = !x;
3096
+ f(v);
3097
3097
  try {
3098
- k ? window.localStorage.setItem(Et, "1") : window.localStorage.removeItem(Et);
3098
+ v ? window.localStorage.setItem(Et, "1") : window.localStorage.removeItem(Et);
3099
3099
  } catch {
3100
3100
  }
3101
3101
  };
3102
- ae(() => {
3103
- if (!n || !b) return;
3104
- const k = document.body, A = k.style.paddingRight;
3105
- k.style.paddingRight = `${Rt}px`, k.dataset.nvrChatPinned = "1";
3106
- const I = document.createElement("style");
3107
- return I.dataset.nvrChatPinnedStyle = "", I.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
3108
- body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, document.head.appendChild(I), () => {
3109
- k.style.paddingRight = A, delete k.dataset.nvrChatPinned, I.remove();
3102
+ ne(() => {
3103
+ if (!a || !b) return;
3104
+ const v = document.body, M = v.style.paddingRight;
3105
+ v.style.paddingRight = `${Rt}px`, v.dataset.nvrChatPinned = "1";
3106
+ const L = document.createElement("style");
3107
+ return L.dataset.nvrChatPinnedStyle = "", L.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
3108
+ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, document.head.appendChild(L), () => {
3109
+ v.style.paddingRight = M, delete v.dataset.nvrChatPinned, L.remove();
3110
3110
  };
3111
- }, [n, b]);
3112
- const [U, M] = T("online"), [C, S] = T(null), [W, $] = T(null), v = (k, A, I) => {
3113
- const te = V.find((De) => De.room === k);
3114
- H(!1), S({ room: k, label: (te == null ? void 0 : te.label) ?? A, channel: te == null ? void 0 : te.channel, anchor: I });
3115
- }, [q, Y] = T(!1), [G, H] = T(!1), [R, J] = T(null), { rooms: V, totalUnread: Z } = ia(), X = ca(U === "archived"), oe = (k, A, I) => {
3111
+ }, [a, b]);
3112
+ const [U, A] = T("online"), [C, S] = T(null), [W, $] = T(null), y = (v, M, L) => {
3113
+ const F = X.find((De) => De.room === v);
3114
+ z(!1), S({ room: v, label: (F == null ? void 0 : F.label) ?? M, channel: F == null ? void 0 : F.channel, anchor: L });
3115
+ }, [q, Z] = T(!1), [Q, z] = T(!1), [R, Y] = T(null), { rooms: X, totalUnread: V } = on(), ee = cn(U === "archived"), oe = (v, M, L) => {
3116
3116
  var De, _;
3117
- if (!A) return [{ key: "all", label: null, users: k }];
3118
- const te = /* @__PURE__ */ new Map();
3119
- for (const L of k) {
3120
- const j = I.get(String(L.user_id).toUpperCase()), ce = A === "__role__" ? [Gn((j == null ? void 0 : j.role_name) ?? L.role_name) || "No role"] : (_ = (De = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : De[A]) != null && _.length ? j.scopes_by_dimension[A] : ["Unassigned"], ee = [...new Set(ce)].sort((ne, Q) => ne.localeCompare(Q)).join(", ");
3121
- te.set(ee, [...te.get(ee) ?? [], L]);
3117
+ if (!M) return [{ key: "all", label: null, users: v }];
3118
+ const F = /* @__PURE__ */ new Map();
3119
+ for (const I of v) {
3120
+ const j = L.get(String(I.user_id).toUpperCase()), ce = M === "__role__" ? [za((j == null ? void 0 : j.role_name) ?? I.role_name) || "No role"] : (_ = (De = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : De[M]) != null && _.length ? j.scopes_by_dimension[M] : ["Unassigned"], te = [...new Set(ce)].sort((ae, K) => ae.localeCompare(K)).join(", ");
3121
+ F.set(te, [...F.get(te) ?? [], I]);
3122
3122
  }
3123
- return [...te.entries()].sort((L, j) => L[0] === "Unassigned" ? 1 : j[0] === "Unassigned" ? -1 : L[0].localeCompare(j[0])).map(([L, j]) => ({ key: L, label: L, users: j }));
3123
+ return [...F.entries()].sort((I, j) => I[0] === "Unassigned" ? 1 : j[0] === "Unassigned" ? -1 : I[0].localeCompare(j[0])).map(([I, j]) => ({ key: I, label: I, users: j }));
3124
3124
  }, [se, pe] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), [p, E] = T(() => {
3125
3125
  try {
3126
3126
  return typeof window < "u" && localStorage.getItem("nvr_chat_online_first") === "1";
3127
3127
  } catch {
3128
3128
  return !1;
3129
3129
  }
3130
- }), u = (k) => {
3131
- E(k);
3130
+ }), u = (v) => {
3131
+ E(v);
3132
3132
  try {
3133
- localStorage.setItem("nvr_chat_online_first", k ? "1" : "0");
3133
+ localStorage.setItem("nvr_chat_online_first", v ? "1" : "0");
3134
3134
  } catch {
3135
3135
  }
3136
- }, P = ka(), Ce = P.loaded ? Js(
3137
- i.onlineUsers.filter((k) => P.byUser.has(String(k.user_id).toUpperCase()))
3138
- ) : [], we = p ? xl(
3136
+ }, P = kn(), Ce = P.loaded ? Js(
3137
+ i.onlineUsers.filter((v) => P.byUser.has(String(v.user_id).toUpperCase()))
3138
+ ) : [], he = p ? xl(
3139
3139
  Ce,
3140
- (k) => P.byUser.get(String(k.user_id).toUpperCase())
3141
- ) : Ce, Pe = ve(
3142
- () => oe(we, se, P.byUser),
3140
+ (v) => P.byUser.get(String(v.user_id).toUpperCase())
3141
+ ) : Ce, Pe = ye(
3142
+ () => oe(he, se, P.byUser),
3143
3143
  // biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
3144
- [we, se, P.byUser]
3145
- ), { isAdmin: _e } = gt(), { navigate: Ae } = ks(), ie = (k) => {
3146
- /^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") : Ae(k);
3147
- }, ze = (k) => {
3148
- c && (M("chat"), S({ room: It(c.id, k.user_id), label: k.display_name ?? "Direct message" }));
3144
+ [he, se, P.byUser]
3145
+ ), { isAdmin: _e } = gt(), { navigate: Ae } = ks(), ie = (v) => {
3146
+ /^https?:\/\//i.test(v) ? window.open(v, "_blank", "noopener") : Ae(v);
3147
+ }, ze = (v) => {
3148
+ c && (A("chat"), S({ room: It(c.id, v.user_id), label: v.display_name ?? "Direct message" }));
3149
3149
  }, Ge = ue(0);
3150
- ae(() => {
3151
- !s || !c || s.nonce === Ge.current || (Ge.current = s.nonce, M("chat"), H(!1), S({
3150
+ ne(() => {
3151
+ !s || !c || s.nonce === Ge.current || (Ge.current = s.nonce, A("chat"), z(!1), S({
3152
3152
  room: It(c.id, s.userId),
3153
3153
  label: s.name ?? "Direct message"
3154
3154
  }));
3155
3155
  }, [s, c]);
3156
3156
  const Qe = ue(0);
3157
- return ae(() => {
3158
- !o || o.nonce === Qe.current || (Qe.current = o.nonce, M("chat"), H(!1), S({ room: o.room, label: o.label ?? o.room }));
3159
- }, [o]), n ? /* @__PURE__ */ a(
3157
+ return ne(() => {
3158
+ !o || o.nonce === Qe.current || (Qe.current = o.nonce, A("chat"), z(!1), S({ room: o.room, label: o.label ?? o.room }));
3159
+ }, [o]), a ? /* @__PURE__ */ n(
3160
3160
  "div",
3161
3161
  {
3162
3162
  className: b ? (
@@ -3169,8 +3169,8 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, do
3169
3169
  "data-nvr-recording-hide": !0,
3170
3170
  "data-chat-pinned": b ? "1" : void 0,
3171
3171
  children: [
3172
- /* @__PURE__ */ e(In, {}),
3173
- /* @__PURE__ */ a(
3172
+ /* @__PURE__ */ e(Pa, {}),
3173
+ /* @__PURE__ */ n(
3174
3174
  "aside",
3175
3175
  {
3176
3176
  className: g(
@@ -3179,42 +3179,42 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, do
3179
3179
  m.surface,
3180
3180
  "border-slate-200 dark:border-border"
3181
3181
  ),
3182
- onClick: (k) => k.stopPropagation(),
3182
+ onClick: (v) => v.stopPropagation(),
3183
3183
  "aria-label": "Team",
3184
3184
  children: [
3185
- /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3.5 py-2.5", m.divider), children: [
3186
- /* @__PURE__ */ e("div", { className: "flex gap-0.5 rounded-lg border border-slate-200 p-0.5 dark:border-border", children: ["online", "chat", "browse", "archived"].map((k) => /* @__PURE__ */ a(
3185
+ /* @__PURE__ */ n("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3.5 py-2.5", m.divider), children: [
3186
+ /* @__PURE__ */ e("div", { className: "flex gap-0.5 rounded-lg border border-slate-200 p-0.5 dark:border-border", children: ["online", "chat", "browse", "archived"].map((v) => /* @__PURE__ */ n(
3187
3187
  "button",
3188
3188
  {
3189
3189
  type: "button",
3190
- onClick: () => M(k),
3191
- "data-tip": k === "archived" ? "Conversations you archived for yourself. Everyone else still sees them." : void 0,
3190
+ onClick: () => A(v),
3191
+ "data-tip": v === "archived" ? "Conversations you archived for yourself. Everyone else still sees them." : void 0,
3192
3192
  className: g(
3193
3193
  "flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors",
3194
- U === k ? m.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
3194
+ U === v ? m.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
3195
3195
  ),
3196
3196
  children: [
3197
- k === "online" ? `Online · ${we.length}` : k === "chat" ? "Chat" : k === "browse" ? "Browse" : "Archived",
3198
- k === "chat" && Z > 0 && /* @__PURE__ */ e(
3197
+ v === "online" ? `Online · ${he.length}` : v === "chat" ? "Chat" : v === "browse" ? "Browse" : "Archived",
3198
+ v === "chat" && V > 0 && /* @__PURE__ */ e(
3199
3199
  "span",
3200
3200
  {
3201
3201
  className: g(
3202
3202
  "flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold leading-none",
3203
3203
  m.pill
3204
3204
  ),
3205
- title: `${Z} unread`,
3206
- children: Z > 99 ? "99+" : Z
3205
+ title: `${V} unread`,
3206
+ children: V > 99 ? "99+" : V
3207
3207
  }
3208
3208
  )
3209
3209
  ]
3210
3210
  },
3211
- k
3211
+ v
3212
3212
  )) }),
3213
3213
  /* @__PURE__ */ e(
3214
3214
  "button",
3215
3215
  {
3216
3216
  type: "button",
3217
- onClick: y,
3217
+ onClick: k,
3218
3218
  "aria-pressed": x,
3219
3219
  title: x ? "Unpin — go back to opening chat over the page" : "Pin — keep chat open beside the page while you work",
3220
3220
  "aria-label": x ? "Unpin chat panel" : "Pin chat panel",
@@ -3223,7 +3223,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, do
3223
3223
  x ? m.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
3224
3224
  ),
3225
3225
  "data-chat-pin": x ? "on" : "off",
3226
- children: x ? /* @__PURE__ */ e(Qa, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(Lt, { className: "h-4 w-4", strokeWidth: 2 })
3226
+ children: x ? /* @__PURE__ */ e(Qn, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(Lt, { className: "h-4 w-4", strokeWidth: 2 })
3227
3227
  }
3228
3228
  ),
3229
3229
  /* @__PURE__ */ e(
@@ -3237,7 +3237,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, do
3237
3237
  }
3238
3238
  )
3239
3239
  ] }),
3240
- U === "online" ? /* @__PURE__ */ a(
3240
+ U === "online" ? /* @__PURE__ */ n(
3241
3241
  "div",
3242
3242
  {
3243
3243
  className: "min-h-0 flex-1 overflow-y-auto px-2 pb-2 [&>:first-child]:mt-2",
@@ -3253,16 +3253,16 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, do
3253
3253
  ),
3254
3254
  /* @__PURE__ */ e(fl, {}),
3255
3255
  /* @__PURE__ */ e(Ms, {}),
3256
- we.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
3256
+ he.length > 0 && /* @__PURE__ */ n("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
3257
3257
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
3258
3258
  /* @__PURE__ */ e(
3259
3259
  Ht,
3260
3260
  {
3261
3261
  value: se,
3262
- onChange: (k) => {
3263
- pe(k);
3262
+ onChange: (v) => {
3263
+ pe(v);
3264
3264
  try {
3265
- localStorage.setItem("nvr_chat_group_by", k);
3265
+ localStorage.setItem("nvr_chat_group_by", v);
3266
3266
  } catch {
3267
3267
  }
3268
3268
  },
@@ -3271,57 +3271,91 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Rt}px; }`, do
3271
3271
  options: [
3272
3272
  { value: "", label: "No grouping" },
3273
3273
  { value: "__role__", label: "Role" },
3274
- ...P.dimensions.map((k) => ({ value: k.name, label: k.label }))
3274
+ ...P.dimensions.map((v) => ({ value: v.name, label: v.label }))
3275
3275
  ]
3276
3276
  }
3277
- )
3277
+ ),
3278
+ (() => {
3279
+ let v = 0;
3280
+ for (const L of he) {
3281
+ const F = P.byUser.get(String(L.user_id).toUpperCase());
3282
+ (F != null && F.away || ((F == null ? void 0 : F.is_idle) ?? L.is_idle)) && v++;
3283
+ }
3284
+ const M = he.length - v;
3285
+ return /* @__PURE__ */ n(
3286
+ "span",
3287
+ {
3288
+ className: "ml-auto flex items-center gap-2 whitespace-nowrap text-[11px] tabular-nums text-slate-500 dark:text-muted-foreground",
3289
+ "data-chat-online-counts": !0,
3290
+ "aria-live": "polite",
3291
+ children: [
3292
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
3293
+ /* @__PURE__ */ e("span", { className: "h-2 w-2 rounded-full bg-emerald-500", "aria-hidden": !0 }),
3294
+ M,
3295
+ " active"
3296
+ ] }),
3297
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
3298
+ /* @__PURE__ */ e(
3299
+ "span",
3300
+ {
3301
+ className: "h-2 w-2 rounded-full border-[1.5px] border-amber-500",
3302
+ "aria-hidden": !0
3303
+ }
3304
+ ),
3305
+ v,
3306
+ " idle"
3307
+ ] })
3308
+ ]
3309
+ }
3310
+ );
3311
+ })()
3278
3312
  ] }),
3279
- we.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12px] text-slate-400", children: "No one else is online right now." }) : Pe.map((k) => /* @__PURE__ */ a("div", { "data-chat-online-group": k.key, children: [
3280
- k.label !== null && /* @__PURE__ */ a("div", { className: "sticky top-0 z-[1] flex items-center gap-1.5 bg-white px-2 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-card", children: [
3281
- k.label,
3282
- /* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
3313
+ he.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12px] text-slate-400", children: "No one else is online right now." }) : Pe.map((v) => /* @__PURE__ */ n("div", { "data-chat-online-group": v.key, children: [
3314
+ v.label !== null && /* @__PURE__ */ n("div", { className: "sticky top-0 z-[1] flex items-center gap-1.5 bg-white px-2 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-card", children: [
3315
+ v.label,
3316
+ /* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: v.users.length })
3283
3317
  ] }),
3284
- k.users.map((A) => {
3285
- const I = P.byUser.get(String(A.user_id).toUpperCase()), te = (I == null ? void 0 : I.is_idle) ?? A.is_idle, De = I ?? A;
3286
- return /* @__PURE__ */ a(
3318
+ v.users.map((M) => {
3319
+ const L = P.byUser.get(String(M.user_id).toUpperCase()), F = (L == null ? void 0 : L.is_idle) ?? M.is_idle, De = L ?? M;
3320
+ return /* @__PURE__ */ n(
3287
3321
  "div",
3288
3322
  {
3289
3323
  className: "flex w-full items-center rounded-lg pl-2.5 transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
3290
3324
  "data-chat-online-row": !0,
3291
3325
  children: [
3292
- /* @__PURE__ */ e(Ft, { userId: A.user_id, children: /* @__PURE__ */ e(
3326
+ /* @__PURE__ */ e(Ft, { userId: M.user_id, children: /* @__PURE__ */ e(
3293
3327
  "button",
3294
3328
  {
3295
3329
  type: "button",
3296
3330
  className: "shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
3297
- "aria-label": `${A.display_name ?? "Unknown user"} — profile`,
3331
+ "aria-label": `${M.display_name ?? "Unknown user"} — profile`,
3298
3332
  "data-chat-online-avatar": !0,
3299
- children: /* @__PURE__ */ e(K, { id: A.user_id, name: A.display_name })
3333
+ children: /* @__PURE__ */ e(J, { id: M.user_id, name: M.display_name })
3300
3334
  }
3301
3335
  ) }),
3302
- /* @__PURE__ */ a(
3336
+ /* @__PURE__ */ n(
3303
3337
  "button",
3304
3338
  {
3305
3339
  type: "button",
3306
- onClick: () => ze(A),
3340
+ onClick: () => ze(M),
3307
3341
  title: "Send a direct message",
3308
3342
  className: "flex min-w-0 flex-1 items-center gap-3 py-2 pl-3 pr-2.5 text-left",
3309
3343
  children: [
3310
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
3311
- /* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
3312
- A.display_name ?? "Unknown user",
3313
- te && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: I != null && I.away ? "Away" : jt(De) }),
3314
- !te && (I == null ? void 0 : I.stuck) && (() => {
3315
- const _ = I.stuck, L = P.fields.includes("page"), j = On(
3316
- I.current_path,
3317
- I.app,
3344
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
3345
+ /* @__PURE__ */ n("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
3346
+ M.display_name ?? "Unknown user",
3347
+ F && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: L != null && L.away ? "Away" : jt(De) }),
3348
+ !F && (L == null ? void 0 : L.stuck) && (() => {
3349
+ const _ = L.stuck, I = P.fields.includes("page"), j = Ra(
3350
+ L.current_path,
3351
+ L.app,
3318
3352
  P.adminUrl,
3319
3353
  i.recordUrl,
3320
3354
  typeof window > "u" ? null : window.location.origin
3321
- ), ce = `${Ln(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
3322
- ${Pn(j)}` : ""}`, ee = Ln(
3323
- L ? { ..._, label: null } : _
3324
- ), ne = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
3355
+ ), ce = `${Oa(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
3356
+ ${La(j)}` : ""}`, te = Oa(
3357
+ I ? { ..._, label: null } : _
3358
+ ), ae = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
3325
3359
  return j ? (
3326
3360
  // biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
3327
3361
  /* @__PURE__ */ e(
@@ -3329,35 +3363,35 @@ ${Pn(j)}` : ""}`, ee = Ln(
3329
3363
  {
3330
3364
  role: "link",
3331
3365
  tabIndex: 0,
3332
- className: g(ne, "cursor-pointer hover:underline"),
3366
+ className: g(ae, "cursor-pointer hover:underline"),
3333
3367
  "data-chat-stuck": _.minutes,
3334
3368
  "data-tip": ce,
3335
- "aria-label": `${ee}: open the page`,
3336
- onClick: (Q) => {
3337
- Q.stopPropagation(), ie(j);
3369
+ "aria-label": `${te}: open the page`,
3370
+ onClick: (K) => {
3371
+ K.stopPropagation(), ie(j);
3338
3372
  },
3339
- onKeyDown: (Q) => {
3340
- (Q.key === "Enter" || Q.key === " ") && (Q.preventDefault(), Q.stopPropagation(), ie(j));
3373
+ onKeyDown: (K) => {
3374
+ (K.key === "Enter" || K.key === " ") && (K.preventDefault(), K.stopPropagation(), ie(j));
3341
3375
  },
3342
- children: ee
3376
+ children: te
3343
3377
  }
3344
3378
  )
3345
3379
  ) : /* @__PURE__ */ e(
3346
3380
  "span",
3347
3381
  {
3348
- className: ne,
3382
+ className: ae,
3349
3383
  "data-chat-stuck": _.minutes,
3350
3384
  "data-tip": ce,
3351
- children: ee
3385
+ children: te
3352
3386
  }
3353
3387
  );
3354
3388
  })(),
3355
3389
  (() => {
3356
- var L;
3357
- const _ = (L = P.byUser.get(
3358
- String(A.user_id).toUpperCase()
3359
- )) == null ? void 0 : L.masquerade;
3360
- return _ ? /* @__PURE__ */ a(
3390
+ var I;
3391
+ const _ = (I = P.byUser.get(
3392
+ String(M.user_id).toUpperCase()
3393
+ )) == null ? void 0 : I.masquerade;
3394
+ return _ ? /* @__PURE__ */ n(
3361
3395
  "span",
3362
3396
  {
3363
3397
  className: "ml-1.5 rounded-full bg-violet-500/10 px-1.5 py-px text-[10px] font-medium text-violet-700 dark:bg-violet-400/15 dark:text-violet-300",
@@ -3370,85 +3404,85 @@ ${Pn(j)}` : ""}`, ee = Ln(
3370
3404
  }
3371
3405
  ) : null;
3372
3406
  })(),
3373
- _e && /* @__PURE__ */ e(Rs, { builds: I == null ? void 0 : I.stale_build })
3407
+ _e && /* @__PURE__ */ e(Rs, { builds: L == null ? void 0 : L.stale_build })
3374
3408
  ] }),
3375
3409
  (() => {
3376
- const _ = P.byUser.get(String(A.user_id).toUpperCase()), L = _ == null ? void 0 : _.custom_status;
3377
- return !L && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
3410
+ const _ = P.byUser.get(String(M.user_id).toUpperCase()), I = _ == null ? void 0 : _.custom_status;
3411
+ return !I && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ n(
3378
3412
  "span",
3379
3413
  {
3380
3414
  className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
3381
3415
  "data-chat-status": !0,
3382
3416
  children: [
3383
- (_ == null ? void 0 : _.in_huddle) && /* @__PURE__ */ a(
3417
+ (_ == null ? void 0 : _.in_huddle) && /* @__PURE__ */ n(
3384
3418
  "span",
3385
3419
  {
3386
3420
  className: "inline-flex shrink-0 items-center gap-0.5 text-nvr-navy dark:text-nvr-cyan",
3387
3421
  "data-chat-in-huddle": !0,
3388
3422
  "data-tip": "In a huddle right now",
3389
3423
  children: [
3390
- /* @__PURE__ */ e(Ka, { className: "h-3 w-3", strokeWidth: 2 }),
3391
- !L && "In a huddle"
3424
+ /* @__PURE__ */ e(Kn, { className: "h-3 w-3", strokeWidth: 2 }),
3425
+ !I && "In a huddle"
3392
3426
  ]
3393
3427
  }
3394
3428
  ),
3395
- L && /* @__PURE__ */ a("span", { className: "truncate italic", children: [
3396
- L.emoji ? `${L.emoji} ` : "",
3397
- L.text
3429
+ I && /* @__PURE__ */ n("span", { className: "truncate italic", children: [
3430
+ I.emoji ? `${I.emoji} ` : "",
3431
+ I.text
3398
3432
  ] })
3399
3433
  ]
3400
3434
  }
3401
3435
  );
3402
3436
  })(),
3403
3437
  (() => {
3404
- const _ = P.byUser.get(String(A.user_id).toUpperCase()), L = [];
3438
+ const _ = P.byUser.get(String(M.user_id).toUpperCase()), I = [];
3405
3439
  let j = null, ce = !1;
3406
- for (const Q of P.fields)
3407
- if (Q === "role") {
3408
- const re = Gn((_ == null ? void 0 : _.role_name) ?? A.role_name);
3409
- re && L.push(re);
3410
- } else if (Q === "scopes") {
3440
+ for (const K of P.fields)
3441
+ if (K === "role") {
3442
+ const re = za((_ == null ? void 0 : _.role_name) ?? M.role_name);
3443
+ re && I.push(re);
3444
+ } else if (K === "scopes") {
3411
3445
  const re = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
3412
- re && L.push(re);
3413
- } else if (Q === "page") {
3414
- const re = (_ == null ? void 0 : _.page) ?? A.page ?? wa((_ == null ? void 0 : _.current_path) ?? A.current_path), fe = (_ == null ? void 0 : _.app) ?? A.app;
3415
- j = (fe ? `${re ?? ""}${re ? " · " : ""}${fe}`.trim() : re) || null, ce = !j && !!_ && !_.away;
3446
+ re && I.push(re);
3447
+ } else if (K === "page") {
3448
+ const re = (_ == null ? void 0 : _.page) ?? M.page ?? wn((_ == null ? void 0 : _.current_path) ?? M.current_path), xe = (_ == null ? void 0 : _.app) ?? M.app;
3449
+ j = (xe ? `${re ?? ""}${re ? " · " : ""}${xe}`.trim() : re) || null, ce = !j && !!_ && !_.away;
3416
3450
  }
3417
- const ee = L.join(" · "), ne = ce ? /* @__PURE__ */ a(
3451
+ const te = I.join(" · "), ae = ce ? /* @__PURE__ */ n(
3418
3452
  "span",
3419
3453
  {
3420
3454
  className: "flex items-start gap-1 text-[11px] italic text-slate-400 dark:text-slate-500",
3421
3455
  "data-chat-online-page": "background",
3422
3456
  "data-tip": "Their app is open in a tab that is not in front, so where they are is not known until they look at it.",
3423
3457
  children: [
3424
- /* @__PURE__ */ e(Rn, { className: "mt-[2px] h-3 w-3 shrink-0 opacity-60" }),
3458
+ /* @__PURE__ */ e(Aa, { className: "mt-[2px] h-3 w-3 shrink-0 opacity-60" }),
3425
3459
  /* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: "Tab in background" })
3426
3460
  ]
3427
3461
  }
3428
3462
  ) : null;
3429
- return !ee && !j && !ne ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(ke, { children: [
3430
- ee && /* @__PURE__ */ e(
3463
+ return !te && !j && !ae ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ n(we, { children: [
3464
+ te && /* @__PURE__ */ e(
3431
3465
  "span",
3432
3466
  {
3433
3467
  className: "block truncate text-[11px] text-slate-400",
3434
3468
  "data-chat-online-meta": !0,
3435
- title: ee,
3436
- children: ee
3469
+ title: te,
3470
+ children: te
3437
3471
  }
3438
3472
  ),
3439
- ne,
3473
+ ae,
3440
3474
  j && (() => {
3441
- const Q = On(
3475
+ const K = Ra(
3442
3476
  _ == null ? void 0 : _.current_path,
3443
3477
  _ == null ? void 0 : _.app,
3444
3478
  P.adminUrl,
3445
3479
  i.recordUrl,
3446
3480
  typeof window > "u" ? null : window.location.origin
3447
- ), re = /* @__PURE__ */ a(ke, { children: [
3448
- /* @__PURE__ */ e(Rn, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
3481
+ ), re = /* @__PURE__ */ n(we, { children: [
3482
+ /* @__PURE__ */ e(Aa, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
3449
3483
  /* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: j })
3450
3484
  ] });
3451
- return Q ? (
3485
+ return K ? (
3452
3486
  // biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
3453
3487
  /* @__PURE__ */ e(
3454
3488
  "span",
@@ -3457,14 +3491,14 @@ ${Pn(j)}` : ""}`, ee = Ln(
3457
3491
  tabIndex: 0,
3458
3492
  className: "-mx-1 flex w-fit max-w-full cursor-pointer items-start gap-1 rounded px-1 text-[11px] text-slate-500 hover:bg-slate-100 hover:text-nvr-cyan hover:underline dark:text-slate-300 dark:hover:bg-muted",
3459
3493
  "data-chat-online-page": !0,
3460
- "data-chat-online-page-href": Q,
3461
- "data-tip": Pn(Q),
3494
+ "data-chat-online-page-href": K,
3495
+ "data-tip": La(K),
3462
3496
  "aria-label": `${j}: open the page`,
3463
- onClick: (fe) => {
3464
- fe.stopPropagation(), ie(Q);
3497
+ onClick: (xe) => {
3498
+ xe.stopPropagation(), ie(K);
3465
3499
  },
3466
- onKeyDown: (fe) => {
3467
- (fe.key === "Enter" || fe.key === " ") && (fe.preventDefault(), fe.stopPropagation(), ie(Q));
3500
+ onKeyDown: (xe) => {
3501
+ (xe.key === "Enter" || xe.key === " ") && (xe.preventDefault(), xe.stopPropagation(), ie(K));
3468
3502
  },
3469
3503
  children: re
3470
3504
  }
@@ -3483,29 +3517,29 @@ ${Pn(j)}` : ""}`, ee = Ln(
3483
3517
  })()
3484
3518
  ] }),
3485
3519
  (() => {
3486
- var ee;
3487
- const _ = P.byUser.get(String(A.user_id).toUpperCase());
3520
+ var te;
3521
+ const _ = P.byUser.get(String(M.user_id).toUpperCase());
3488
3522
  if (!_e || !(_ != null && _.recording_id)) return null;
3489
- const L = ((ee = P.adminUrl) == null ? void 0 : ee.replace(/\/$/, "")) ?? "", j = !!L && (typeof window > "u" || new URL(L, window.location.origin).origin !== window.location.origin), ce = i.sessionUrl ? i.sessionUrl(_.recording_id, String(A.user_id)) : j ? `${L}/session-replays?recording=${_.recording_id}` : null;
3523
+ const I = ((te = P.adminUrl) == null ? void 0 : te.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), ce = i.sessionUrl ? i.sessionUrl(_.recording_id, String(M.user_id)) : j ? `${I}/session-replays?recording=${_.recording_id}` : null;
3490
3524
  return ce ? /* @__PURE__ */ e(
3491
3525
  "span",
3492
3526
  {
3493
3527
  role: "link",
3494
3528
  tabIndex: 0,
3495
3529
  title: "Watch this session",
3496
- onClick: (ne) => {
3497
- ne.stopPropagation(), ie(ce);
3530
+ onClick: (ae) => {
3531
+ ae.stopPropagation(), ie(ce);
3498
3532
  },
3499
- onKeyDown: (ne) => {
3500
- (ne.key === "Enter" || ne.key === " ") && (ne.stopPropagation(), ie(ce));
3533
+ onKeyDown: (ae) => {
3534
+ (ae.key === "Enter" || ae.key === " ") && (ae.stopPropagation(), ie(ce));
3501
3535
  },
3502
3536
  className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
3503
- children: /* @__PURE__ */ e(Ja, { className: "h-4 w-4", strokeWidth: 1.8 })
3537
+ children: /* @__PURE__ */ e(Jn, { className: "h-4 w-4", strokeWidth: 1.8 })
3504
3538
  }
3505
3539
  ) : null;
3506
3540
  })(),
3507
3541
  /* @__PURE__ */ e(
3508
- Yn,
3542
+ Ja,
3509
3543
  {
3510
3544
  className: "h-4 w-4 shrink-0 text-slate-300",
3511
3545
  strokeWidth: 1.8
@@ -3516,28 +3550,28 @@ ${Pn(j)}` : ""}`, ee = Ln(
3516
3550
  )
3517
3551
  ]
3518
3552
  },
3519
- A.user_id
3553
+ M.user_id
3520
3554
  );
3521
3555
  })
3522
- ] }, k.key))
3556
+ ] }, v.key))
3523
3557
  ]
3524
3558
  }
3525
3559
  ) : U === "archived" ? R ? /* @__PURE__ */ e(
3526
- Hn,
3560
+ Fa,
3527
3561
  {
3528
3562
  room: R.room,
3529
3563
  label: R.label,
3530
- onBack: () => J(null),
3564
+ onBack: () => Y(null),
3531
3565
  renderMessageBody: l
3532
3566
  },
3533
3567
  R.room
3534
3568
  ) : /* @__PURE__ */ e(
3535
- Kn,
3569
+ Qa,
3536
3570
  {
3537
- rooms: X.rooms,
3538
- loading: X.loading,
3571
+ rooms: ee.rooms,
3572
+ loading: ee.loading,
3539
3573
  archivedView: !0,
3540
- onOpen: (k) => J({ room: k.room, label: k.label })
3574
+ onOpen: (v) => Y({ room: v.room, label: v.label })
3541
3575
  }
3542
3576
  ) : U === "browse" ? (
3543
3577
  // The tab is checked BEFORE the open room: leaving it last meant
@@ -3546,70 +3580,70 @@ ${Pn(j)}` : ""}`, ee = Ln(
3546
3580
  /* @__PURE__ */ e(
3547
3581
  pl,
3548
3582
  {
3549
- onOpen: (k, A, I) => {
3550
- H(!1), S({ room: k, label: A, channel: I }), M("chat");
3583
+ onOpen: (v, M, L) => {
3584
+ z(!1), S({ room: v, label: M, channel: L }), A("chat");
3551
3585
  }
3552
3586
  }
3553
3587
  )
3554
3588
  ) : q ? /* @__PURE__ */ e(
3555
3589
  gl,
3556
3590
  {
3557
- onClose: () => Y(!1),
3558
- onCreated: (k, A) => {
3559
- Y(!1), S({ room: k, label: A });
3591
+ onClose: () => Z(!1),
3592
+ onCreated: (v, M) => {
3593
+ Z(!1), S({ room: v, label: M });
3560
3594
  }
3561
3595
  }
3562
- ) : C && G && C.channel ? /* @__PURE__ */ e(
3596
+ ) : C && Q && C.channel ? /* @__PURE__ */ e(
3563
3597
  dl,
3564
3598
  {
3565
3599
  channel: C.channel,
3566
3600
  label: C.label,
3567
- onBack: () => H(!1)
3601
+ onBack: () => z(!1)
3568
3602
  }
3569
3603
  ) : C ? /* @__PURE__ */ e(
3570
- Hn,
3604
+ Fa,
3571
3605
  {
3572
3606
  room: C.room,
3573
3607
  label: C.label,
3574
- onOpenSettings: C.channel && !C.channel.is_direct ? () => H(!0) : void 0,
3608
+ onOpenSettings: C.channel && !C.channel.is_direct ? () => z(!0) : void 0,
3575
3609
  onBack: () => S(null),
3576
3610
  renderMessageBody: l,
3577
3611
  initialUnread: C.unread,
3578
3612
  anchor: C.anchor ?? null
3579
3613
  },
3580
3614
  C.room
3581
- ) : W === "mentions" ? /* @__PURE__ */ e(ea, { th: m, onBack: () => $(null), onOpen: v }) : W === "scheduled" ? /* @__PURE__ */ e(
3582
- ta,
3615
+ ) : W === "mentions" ? /* @__PURE__ */ e(Xa, { th: m, onBack: () => $(null), onOpen: y }) : W === "scheduled" ? /* @__PURE__ */ e(
3616
+ en,
3583
3617
  {
3584
3618
  th: m,
3585
3619
  onBack: () => $(null),
3586
- roomLabel: (k) => {
3587
- var A;
3588
- return ((A = V.find((I) => I.room === k)) == null ? void 0 : A.label) ?? k;
3620
+ roomLabel: (v) => {
3621
+ var M;
3622
+ return ((M = X.find((L) => L.room === v)) == null ? void 0 : M.label) ?? v;
3589
3623
  }
3590
3624
  }
3591
3625
  ) : W === "catchup" ? /* @__PURE__ */ e(
3592
- na,
3626
+ tn,
3593
3627
  {
3594
- rooms: V,
3628
+ rooms: X,
3595
3629
  th: m,
3596
3630
  onBack: () => $(null),
3597
- onOpen: v
3631
+ onOpen: y
3598
3632
  }
3599
3633
  ) : /* @__PURE__ */ e(
3600
- Kn,
3634
+ Qa,
3601
3635
  {
3602
- rooms: V,
3603
- onOpen: (k, A) => {
3604
- H(!1), S({
3605
- room: k.room,
3606
- label: k.label,
3607
- channel: k.channel,
3608
- unread: k.unread,
3609
- anchor: A
3636
+ rooms: X,
3637
+ onOpen: (v, M) => {
3638
+ z(!1), S({
3639
+ room: v.room,
3640
+ label: v.label,
3641
+ channel: v.channel,
3642
+ unread: v.unread,
3643
+ anchor: M
3610
3644
  });
3611
3645
  },
3612
- onNewGroup: () => Y(!0),
3646
+ onNewGroup: () => Z(!0),
3613
3647
  onView: $
3614
3648
  }
3615
3649
  )
@@ -3618,7 +3652,7 @@ ${Pn(j)}` : ""}`, ee = Ln(
3618
3652
  )
3619
3653
  ]
3620
3654
  }
3621
- ) : /* @__PURE__ */ e(In, {});
3655
+ ) : /* @__PURE__ */ e(Pa, {});
3622
3656
  }
3623
3657
  export {
3624
3658
  fl as ChatAppearAwayRow,
@@ -3626,8 +3660,8 @@ export {
3626
3660
  dl as ChatChannelSettings,
3627
3661
  wo as ChatPanel,
3628
3662
  yo as ChatProvider,
3629
- Kn as ChatRoomList,
3630
- Hn as ChatRoomView,
3663
+ Qa as ChatRoomList,
3664
+ Fa as ChatRoomView,
3631
3665
  ko as ChatSideView,
3632
3666
  vl as isChatPanelPinned,
3633
3667
  xl as onlineFirstOrder