@nivaro/react 0.3.41 → 0.3.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +733 -15
  5. package/dist/index.js +820 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/ProfileView.js +776 -1003
  20. package/dist/shared/components/RecentRecordsRail.js +34 -16
  21. package/dist/shared/components/RecordReadView.js +500 -477
  22. package/dist/shared/components/Skeletons.js +199 -0
  23. package/dist/shared/components/SlowNotice.js +63 -0
  24. package/dist/shared/components/Term.js +23 -0
  25. package/dist/shared/components/WidgetSlot.js +350 -353
  26. package/dist/shared/components/access/PermissionSummary.js +106 -0
  27. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  28. package/dist/shared/components/chat/ChatPanel.js +902 -886
  29. package/dist/shared/components/chat/MemberPaging.js +70 -0
  30. package/dist/shared/components/chat/RoomParts.js +147 -117
  31. package/dist/shared/components/chat/ScreenClip.js +73 -69
  32. package/dist/shared/components/chat/chat-core.js +449 -396
  33. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  34. package/dist/shared/components/help-videos/api.js +2 -5
  35. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  36. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  37. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  38. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  39. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  40. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  41. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  42. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  43. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  44. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  45. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  46. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  47. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  48. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  49. package/dist/shared/components/item-edit/field-sources.js +33 -0
  50. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  51. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  52. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  53. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  54. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  55. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  56. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  57. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  58. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  59. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  60. package/dist/shared/components/list/InlineEdit.js +363 -0
  61. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  62. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  63. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  64. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  65. package/dist/shared/components/notifications/changes-lines.js +24 -0
  66. package/dist/shared/components/notifications/why-lines.js +64 -0
  67. package/dist/shared/components/panels/CommentPanel.js +316 -281
  68. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  69. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  70. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  71. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  72. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  73. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  74. package/dist/shared/components/profile/PersonProfile.js +57 -52
  75. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  76. package/dist/shared/hooks/useSlowReason.js +39 -0
  77. package/dist/shared/lib/activity-sentence.js +670 -0
  78. package/dist/shared/lib/config-sentences.js +418 -0
  79. package/dist/shared/lib/core-glossary.js +229 -0
  80. package/dist/shared/lib/error-hints.js +159 -0
  81. package/dist/shared/lib/error-message.js +105 -0
  82. package/dist/shared/lib/error-toast.js +22 -0
  83. package/dist/shared/lib/field-comments.js +25 -0
  84. package/dist/shared/lib/filter-sentence.js +261 -0
  85. package/dist/shared/lib/glossary.js +55 -48
  86. package/dist/shared/lib/idle-reload.js +138 -0
  87. package/dist/shared/lib/layout-resolve.js +42 -29
  88. package/dist/shared/lib/list-inline-edit.js +190 -0
  89. package/dist/shared/lib/list-link.js +147 -0
  90. package/dist/shared/lib/nav-trail.js +107 -0
  91. package/dist/shared/lib/prefetch.js +259 -106
  92. package/dist/shared/lib/record-ref.js +72 -0
  93. package/dist/shared/lib/reload-holds.js +25 -0
  94. package/dist/shared/lib/safe-error.js +52 -24
  95. package/dist/shared/lib/skeleton-shapes.js +72 -0
  96. package/dist/shared/lib/slow-reason.js +63 -0
  97. package/package.json +1 -1
@@ -1,51 +1,52 @@
1
1
  import { jsxs as a, jsx as e, Fragment as ke } from "react/jsx-runtime";
2
- import { useQuery as Te, useQueryClient as Mt, useMutation as We } from "@tanstack/react-query";
3
- import { Search as Gn, Plus as Fa, Hash as Tt, Lock as za, ChevronLeft as ut, X as mt, PinOff as Ha, Pin as Ut, Headphones as Ga, PlayCircle as Qa, MessageCircle as Qn, Users as Dt, AtSign as Ka, AlarmClock as Ja, Sparkles as Ya, BellOff as Dn, PencilLine as Za, Star as Va, ArchiveRestore as Xa, Archive as es, Bell as ts, LogOut as ns, Info as as, MapPin as $n, Check as Ot, ArrowUpDown as ss, MessageSquareReply as rs, Quote as ls, ClipboardPlus as os, NotebookPen as is, Bookmark as cs, Pencil as ds, Trash2 as us, AlertTriangle as ms, Paperclip as ps, Bot as hs, CheckCheck as fs, Plane as xs, FilePlus2 as bs } from "lucide-react";
4
- import { useState as T, useEffect as X, useMemo as ve, useRef as ce, useContext as gs } from "react";
2
+ import { useQuery as Te, useQueryClient as Ot, useMutation as We } from "@tanstack/react-query";
3
+ import { Search as Hn, Plus as Fa, Hash as Ut, Lock as za, ChevronLeft as ut, X as pt, PinOff as Ha, Pin as Dt, Headphones as Ga, PlayCircle as Qa, MessageCircle as Gn, Users as $t, AtSign as Ka, AlarmClock as Ja, Sparkles as Ya, BellOff as Un, PencilLine as Za, Star as Va, ArchiveRestore as Xa, Archive as es, Bell as ts, LogOut as ns, Info as as, MapPin as Dn, Check as Lt, ArrowUpDown as ss, MessageSquareReply as rs, Quote as ls, ClipboardPlus as os, NotebookPen as is, Bookmark as cs, Pencil as ds, Trash2 as us, AlertTriangle as ms, Paperclip as ps, Bot as hs, CheckCheck as fs, Plane as xs, FilePlus2 as bs } from "lucide-react";
4
+ import { useState as T, useEffect as ae, useMemo as ve, useRef as de, useContext as gs } from "react";
5
5
  import { toast as ge } from "sonner";
6
- import { useItemEditAuth as pt, useNavigation as vs, useNivaroClient as Ze } from "../../context.js";
6
+ import { useItemEditAuth as ht, useNavigation as vs, useNivaroClient as Ze } from "../../context.js";
7
7
  import { get as ye, post as Fe, patch as ys } from "../../lib/commands.js";
8
8
  import { useLiveRecord as ks, batchTouches as ws, LIVE_ASPECTS as Ns } from "../../lib/live.js";
9
9
  import { usePresenceOnlinePoll as Cs } from "../../lib/presence-live.js";
10
- import { presencePlaceHref as An, stuckText as Rn, fullHref as Mn } from "../../lib/presence-state.js";
10
+ import { presencePlaceHref as $n, stuckText as Mn, fullHref as An } from "../../lib/presence-state.js";
11
11
  import { invalidateRecordTasks as _s } from "../../lib/record-tasks.js";
12
12
  import { userCardQuery as Ss } from "../../lib/user-cards.js";
13
- import { cn as g, getDisplayTimezone as Lt, formatRelative as Kn } from "../../lib/utils.js";
13
+ import { cn as g, getDisplayTimezone as Pt, formatRelative as Qn } from "../../lib/utils.js";
14
14
  import { CustomStatusEditor as Ts } from "../CustomStatusEditor.js";
15
15
  import { DoNotDisturbRow as Us } from "../DoNotDisturb.js";
16
16
  import { FilePreviewLightbox as Ds } from "../FilePreviewLightbox.js";
17
- import { UserChip as Pt } from "../item-edit/UserChip.js";
17
+ import { UserChip as It } from "../item-edit/UserChip.js";
18
18
  import { StaleBuildChip as $s } from "../StaleBuildChip.js";
19
- import { UserAvatar as As } from "../UserAvatar.js";
19
+ import { UserAvatar as Ms } from "../UserAvatar.js";
20
20
  import { Popover as Ve, PopoverTrigger as Xe, PopoverContent as et } from "../ui/popover.js";
21
- import { SimpleSelect as It } from "../ui/SimpleSelect.js";
22
- import { useBotStream as Rs, BotStreamBubble as Ms } from "./BotStream.js";
21
+ import { SimpleSelect as jt } from "../ui/SimpleSelect.js";
22
+ import { useBotStream as As, BotStreamBubble as Rs } from "./BotStream.js";
23
23
  import { MembershipHistory as Os, ArchiveSuggestionBanner as Ls } from "./ChannelArchive.js";
24
24
  import { ChannelExtrasEditor as Ps, BulkInvitePanel as Is, ChannelAuditLog as js } from "./ChannelExtras.js";
25
- import { ChannelTile as Ye, ChannelLookPicker as Jn } from "./ChannelLook.js";
26
- import { MentionsView as Yn, ScheduledView as Zn, CatchUpView as Vn, useSearchFilterState as qs, FilterToggle as Es, ChatSettingsButton as Bs, SearchFilterBar as Ws } from "./ChatViews.js";
25
+ import { ChannelTile as Ye, ChannelLookPicker as Kn } from "./ChannelLook.js";
26
+ import { MentionsView as Jn, ScheduledView as Yn, CatchUpView as Zn, useSearchFilterState as qs, FilterToggle as Es, ChatSettingsButton as Bs, SearchFilterBar as Ws } from "./ChatViews.js";
27
27
  import { ChatComposer as Fs } from "./Composer.js";
28
- import { useMyPreferences as jt, useSetMyPreferences as Xn, useChatRoles as ea, useChannelDirectory as zs, useRoomMembership as qt, useCreateChannel as Hs, useChatConfig as Le, useChannelMembers as Et, useChannelAdmin as ta, useUserSearch as Bt, GENERAL_CHANNEL_ID as na, useChatRooms as aa, useArchivedRooms as sa, sortOnlineUsers as Gs, dmRoom as $t, CHAT_DEFAULTS as dt, ChatConfigContext as ra, useChatBotInfo as Wt, useChatSearch as Qs, dmPeer as Se, useChatMessages as Ks, useOpenRoomRegistration as Js, useMarkRoomRead as Ys, useTypingIndicator as Zs, usePeerReadAt as Vs, useEntityRoomLink as Xs, useToggleReaction as er, useRoomPins as tr, useTogglePin as nr, useEditMessage as ar, useDeleteMessage as sr, useChatBotName as rr, useChatThread as lr, useRecordBrowserTimezone as or, chatInitials as ir, chatAvatarColor as cr, useCreateGroupDm as dr, canOpenDm as ur, openDmWith as mr, chatRoomTypesQuery as la, REACTION_EMOJI as pr } from "./chat-core.js";
29
- import { useDraftRooms as hr } from "./chat-drafts.js";
30
- import { useCustomEmoji as fr, EmojiButton as xr, EmojiGlyph as br } from "./chat-emoji.js";
31
- import { useRoomRecord as oa, useRecordFileTargets as gr } from "./chat-hooks.js";
32
- import { offHoursNote as vr } from "./chat-local-time.js";
33
- import { useMessageWindow as yr } from "./chat-window.js";
34
- import { HuddleFollowHost as On } from "./huddle/HuddleCollab.js";
35
- import { HuddleControls as kr } from "./huddle/HuddleControls.js";
36
- import { HuddleLiveBadge as wr } from "./huddle/HuddleLiveBadge.js";
37
- import { HuddleScheduleCard as Nr } from "./huddle/HuddleScheduleCard.js";
38
- import { HuddleScheduleForm as Cr } from "./huddle/HuddleScheduleForm.js";
39
- import { HuddleStage as _r } from "./huddle/HuddleStage.js";
40
- import { useHuddleLive as Sr } from "./huddle/huddle-live.js";
41
- import { stripHuddleRef as Ln, huddleRefOf as Pn } from "./huddle/huddle-schedule.js";
42
- import { useHuddle as Tr } from "./huddle/useHuddle.js";
43
- import { useMessageActions as Ur, MessageActionsMenu as Dr, actionsForMessage as $r } from "./MessageActions.js";
44
- import { FormattedMessage as Ar, LinkPreviews as Rr } from "./MessageFormat.js";
45
- import { PollCard as Mr } from "./PollCard.js";
46
- import { RoomStatusMarks as Or, headerIconIdle as In, headerIconButton as jn, RoomHeaderMenu as Lr } from "./RoomHeaderMenu.js";
47
- import { MemberCountLine as Pr, ChannelIntro as Ir, WelcomeNote as jr, ThreadPane as qr, RoomInfoDrawer as Er } from "./RoomParts.js";
48
- import { clipInfo as Br, ClipPlayer as Wr } from "./ScreenClip.js";
28
+ import { useMyPreferences as qt, useSetMyPreferences as Vn, useChatRoles as Xn, useChannelDirectory as zs, useRoomMembership as Et, useCreateChannel as Hs, useChatConfig as Le, useChannelMembers as ea, useChannelAdmin as ta, useUserSearch as Bt, GENERAL_CHANNEL_ID as na, useChatRooms as aa, useArchivedRooms as sa, sortOnlineUsers as Gs, dmRoom as Mt, CHAT_DEFAULTS as dt, ChatConfigContext as ra, useChatBotInfo as Wt, useChatSearch as Qs, dmPeer as Se, useChatMessages as Ks, useOpenRoomRegistration as Js, useMarkRoomRead as Ys, useTypingIndicator as Zs, usePeerReadAt as Vs, useEntityRoomLink as Xs, useToggleReaction as er, useRoomPins as tr, useTogglePin as nr, useEditMessage as ar, useDeleteMessage as sr, useChatBotName as rr, useChatThread as lr, useRecordBrowserTimezone as or, chatInitials as ir, chatAvatarColor as cr, useCreateGroupDm as dr, canOpenDm as ur, openDmWith as mr, usePagedMembers as pr, chatRoomTypesQuery as la, REACTION_EMOJI as hr } from "./chat-core.js";
29
+ import { useDraftRooms as fr } from "./chat-drafts.js";
30
+ import { useCustomEmoji as xr, EmojiButton as br, EmojiGlyph as gr } from "./chat-emoji.js";
31
+ import { useRoomRecord as oa, useRecordFileTargets as vr } from "./chat-hooks.js";
32
+ import { offHoursNote as yr } from "./chat-local-time.js";
33
+ import { useMessageWindow as kr } from "./chat-window.js";
34
+ import { HuddleFollowHost as Rn } from "./huddle/HuddleCollab.js";
35
+ import { HuddleControls as wr } from "./huddle/HuddleControls.js";
36
+ import { HuddleLiveBadge as Nr } from "./huddle/HuddleLiveBadge.js";
37
+ import { HuddleScheduleCard as Cr } from "./huddle/HuddleScheduleCard.js";
38
+ import { HuddleScheduleForm as _r } from "./huddle/HuddleScheduleForm.js";
39
+ import { HuddleStage as Sr } from "./huddle/HuddleStage.js";
40
+ import { useHuddleLive as Tr } from "./huddle/huddle-live.js";
41
+ import { stripHuddleRef as On, huddleRefOf as Ln } from "./huddle/huddle-schedule.js";
42
+ import { useHuddle as Ur } from "./huddle/useHuddle.js";
43
+ import { MemberSearchBox as Dr, MemberOnlineDot as $r, MemberLoadMore as Mr } from "./MemberPaging.js";
44
+ import { useMessageActions as Ar, MessageActionsMenu as Rr, actionsForMessage as Or } from "./MessageActions.js";
45
+ import { FormattedMessage as Lr, LinkPreviews as Pr } from "./MessageFormat.js";
46
+ import { PollCard as Ir } from "./PollCard.js";
47
+ import { RoomStatusMarks as jr, headerIconIdle as Pn, headerIconButton as In, RoomHeaderMenu as qr } from "./RoomHeaderMenu.js";
48
+ import { MemberCountLine as Er, ChannelIntro as Br, WelcomeNote as Wr, ThreadPane as Fr, RoomInfoDrawer as zr } from "./RoomParts.js";
49
+ import { clipInfo as Hr, ClipPlayer as Gr } from "./ScreenClip.js";
49
50
  import { useOutbox as ia } from "./chat-outbox.js";
50
51
  import { OutboxBubbles as ca } from "./OutboxBubbles.js";
51
52
  const da = {
@@ -60,41 +61,41 @@ const da = {
60
61
  divider: "border-slate-100 dark:border-border/60"
61
62
  }, Ft = {};
62
63
  Ft.current = da;
63
- function co({
64
+ function fo({
64
65
  children: n,
65
66
  me: s,
66
67
  onlineUsers: l = [],
67
68
  collections: r,
68
69
  globalRoom: o = dt.globalRoom,
69
70
  globalLabel: i = dt.globalLabel,
70
- entityPattern: m = dt.entityPattern,
71
+ entityPattern: p = dt.entityPattern,
71
72
  entityUrl: d = () => null,
72
- roomLabel: b,
73
+ roomLabel: x,
73
74
  recordUrl: f,
74
- sessionUrl: p,
75
- realtime: x,
76
- subscribeRooms: v,
75
+ sessionUrl: u,
76
+ realtime: b,
77
+ subscribeRooms: y,
77
78
  setTypingRoom: U,
78
- navigate: $,
79
+ navigate: A,
79
80
  sound: C = !0,
80
81
  theme: S
81
82
  }) {
82
- const E = ve(
83
+ const B = ve(
83
84
  () => ({
84
85
  collections: { ...dt.collections, ...r },
85
86
  globalRoom: o,
86
87
  globalLabel: i,
87
- entityPattern: m,
88
+ entityPattern: p,
88
89
  entityUrl: d,
89
- roomLabel: b,
90
+ roomLabel: x,
90
91
  recordUrl: f,
91
- sessionUrl: p,
92
- realtime: x,
93
- subscribeRooms: v,
92
+ sessionUrl: u,
93
+ realtime: b,
94
+ subscribeRooms: y,
94
95
  me: s,
95
96
  onlineUsers: l,
96
97
  setTypingRoom: U,
97
- navigate: $,
98
+ navigate: A,
98
99
  sound: C
99
100
  }),
100
101
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -104,60 +105,60 @@ function co({
104
105
  r,
105
106
  o,
106
107
  i,
107
- m,
108
- x,
108
+ p,
109
+ b,
109
110
  U,
110
111
  C
111
112
  ]
112
113
  );
113
- return Ft.current = { ...da, ...S }, /* @__PURE__ */ e(ra.Provider, { value: E, children: n });
114
+ return Ft.current = { ...da, ...S }, /* @__PURE__ */ e(ra.Provider, { value: B, children: n });
114
115
  }
115
- function de() {
116
+ function ue() {
116
117
  return Ft.current;
117
118
  }
118
- const qn = /* @__PURE__ */ new WeakMap();
119
- function Fr(n, s) {
119
+ const jn = /* @__PURE__ */ new WeakMap();
120
+ function Qr(n, s) {
120
121
  const l = String(s).toUpperCase();
121
- let r = qn.get(n);
122
- r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, qn.set(n, r));
122
+ let r = jn.get(n);
123
+ r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, jn.set(n, r));
123
124
  const o = r;
124
125
  return new Promise((i) => {
125
- const m = o.ids.get(l) ?? [];
126
- m.push(i), o.ids.set(l, m), !o.timer && (o.timer = setTimeout(async () => {
126
+ const p = o.ids.get(l) ?? [];
127
+ p.push(i), o.ids.set(l, p), !o.timer && (o.timer = setTimeout(async () => {
127
128
  const d = new Map(o.ids);
128
129
  o.ids.clear(), o.timer = null;
129
- const b = [...d.keys()], f = /* @__PURE__ */ new Map();
130
- for (let p = 0; p < b.length; p += 100)
130
+ const x = [...d.keys()], f = /* @__PURE__ */ new Map();
131
+ for (let u = 0; u < x.length; u += 100)
131
132
  try {
132
- const x = await n.request(
133
- ye("/presence/people", { ids: b.slice(p, p + 100).join(",") })
133
+ const b = await n.request(
134
+ ye("/presence/people", { ids: x.slice(u, u + 100).join(",") })
134
135
  );
135
- for (const v of x.data ?? []) f.set(String(v.user_id).toUpperCase(), v);
136
+ for (const y of b.data ?? []) f.set(String(y.user_id).toUpperCase(), y);
136
137
  } catch {
137
138
  }
138
- for (const [p, x] of d) for (const v of x) v(f.get(p) ?? null);
139
+ for (const [u, b] of d) for (const y of b) y(f.get(u) ?? null);
139
140
  }, 0));
140
141
  });
141
142
  }
142
143
  function zt(n, s = !0) {
143
144
  const l = Ze(), { data: r } = Te({
144
145
  queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
145
- queryFn: () => Fr(l, n),
146
+ queryFn: () => Qr(l, n),
146
147
  enabled: !!n && s,
147
148
  staleTime: 6e4
148
149
  });
149
150
  return r ?? null;
150
151
  }
151
152
  function ua(n) {
152
- return n != null && n.last_seen ? `last seen ${Kn(n.last_seen)}` : null;
153
+ return n != null && n.last_seen ? `last seen ${Qn(n.last_seen)}` : null;
153
154
  }
154
155
  function ma(n) {
155
156
  const s = gs(ra), l = xa(), r = String(n).toUpperCase();
156
157
  if (l.loaded) {
157
158
  const i = l.byUser.get(r);
158
159
  if (!i) return { state: "offline", title: "Offline", page: null };
159
- const m = i.page ?? ba(i.current_path);
160
- return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: At(i), page: m } : { state: "online", title: "Online", page: m };
160
+ const p = i.page ?? ba(i.current_path);
161
+ return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: At(i), page: p } : { state: "online", title: "Online", page: p };
161
162
  }
162
163
  const o = s == null ? void 0 : s.onlineUsers.find((i) => String(i.user_id).toUpperCase() === r);
163
164
  return o ? o.is_idle ? { state: "idle", title: At(o), page: null } : { state: "online", title: "Online", page: null } : { state: "offline", title: "Offline", page: null };
@@ -167,12 +168,12 @@ function pa(n) {
167
168
  weekday: "short",
168
169
  month: "short",
169
170
  day: "numeric",
170
- timeZone: Lt() ?? void 0
171
+ timeZone: Pt() ?? void 0
171
172
  })}` : "Out of office" : null;
172
173
  }
173
- function zr({ id: n, size: s }) {
174
- const { state: l, title: r, page: o } = ma(n), i = zt(n), m = l === "offline" ? ua(i) : null, d = pa(i), b = s >= 30 ? 10 : 8, f = [
175
- m ? `Offline · ${m}` : r,
174
+ function Kr({ id: n, size: s }) {
175
+ const { state: l, title: r, page: o } = ma(n), i = zt(n), p = l === "offline" ? ua(i) : null, d = pa(i), x = s >= 30 ? 10 : 8, f = [
176
+ p ? `Offline · ${p}` : r,
176
177
  o && l !== "offline" ? `On ${o}` : null,
177
178
  d,
178
179
  d && (i != null && i.delegate) ? `${i.delegate.name} is covering` : null
@@ -185,7 +186,7 @@ function zr({ id: n, size: s }) {
185
186
  "absolute -bottom-0.5 -right-0.5 rounded-full border-2 border-white dark:border-card",
186
187
  l === "online" ? "bg-emerald-400" : l === "idle" || l === "away" ? "border-amber-400 bg-white dark:border-amber-400 dark:bg-card" : "bg-slate-300 dark:bg-slate-600"
187
188
  ),
188
- style: { width: b, height: b },
189
+ style: { width: x, height: x },
189
190
  "data-tip": f,
190
191
  title: f,
191
192
  "data-chat-presence": l
@@ -197,16 +198,16 @@ function zr({ id: n, size: s }) {
197
198
  "span",
198
199
  {
199
200
  className: "absolute -right-1 -top-1 flex items-center justify-center rounded-full border-2 border-white bg-violet-600 text-white dark:border-card",
200
- style: { width: b + 2, height: b + 2 },
201
+ style: { width: x + 2, height: x + 2 },
201
202
  "data-chat-ooo": !0,
202
203
  title: f,
203
204
  "aria-label": d,
204
- children: /* @__PURE__ */ e(xs, { style: { width: b - 3, height: b - 3 }, strokeWidth: 2.5 })
205
+ children: /* @__PURE__ */ e(xs, { style: { width: x - 3, height: x - 3 }, strokeWidth: 2.5 })
205
206
  }
206
207
  )
207
208
  ] });
208
209
  }
209
- function K({
210
+ function Q({
210
211
  id: n,
211
212
  name: s,
212
213
  size: l = 32,
@@ -225,8 +226,8 @@ function K({
225
226
  "aria-hidden": !0,
226
227
  children: ir(s)
227
228
  }
228
- ), m = /* @__PURE__ */ e(
229
- As,
229
+ ), p = /* @__PURE__ */ e(
230
+ Ms,
230
231
  {
231
232
  userId: n,
232
233
  fallback: i,
@@ -234,14 +235,14 @@ function K({
234
235
  alt: s ?? ""
235
236
  }
236
237
  ), d = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(n).toUpperCase();
237
- return !r || d ? m : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
238
- m,
239
- /* @__PURE__ */ e(zr, { id: n, size: l })
238
+ return !r || d ? p : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
239
+ p,
240
+ /* @__PURE__ */ e(Kr, { id: n, size: l })
240
241
  ] });
241
242
  }
242
- function Hr({ peerId: n, name: s }) {
243
- const l = Wt(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(K, { id: n, name: s, size: 28 });
244
- return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Pt, { userId: n, children: /* @__PURE__ */ e(
243
+ function Jr({ peerId: n, name: s }) {
244
+ const l = Wt(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(Q, { id: n, name: s, size: 28 });
245
+ return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(It, { userId: n, children: /* @__PURE__ */ e(
245
246
  "button",
246
247
  {
247
248
  type: "button",
@@ -252,42 +253,42 @@ function Hr({ peerId: n, name: s }) {
252
253
  }
253
254
  ) });
254
255
  }
255
- function En({ token: n, url: s, mine: l }) {
256
- const r = Le(), o = de(), i = Ze(), { data: m } = Te(la(i)), { data: d } = Te({
256
+ function qn({ token: n, url: s, mine: l }) {
257
+ const r = Le(), o = ue(), i = Ze(), { data: p } = Te(la(i)), { data: d } = Te({
257
258
  queryKey: ["nvr-chat-entity-card", n],
258
259
  queryFn: async () => {
259
- var p, x, v, U;
260
- for (const $ of m ?? [])
260
+ var u, b, y, U;
261
+ for (const A of p ?? [])
261
262
  try {
262
- const S = (x = (p = (await i.request(
263
- ye(`/items/${$.collection}`, {
263
+ const S = (b = (u = (await i.request(
264
+ ye(`/items/${A.collection}`, {
264
265
  limit: 1,
265
266
  fields: "id",
266
- filter: JSON.stringify({ [$.match_field]: { _eq: n } })
267
+ filter: JSON.stringify({ [A.match_field]: { _eq: n } })
267
268
  })
268
- )).data) == null ? void 0 : p[0]) == null ? void 0 : x.id;
269
+ )).data) == null ? void 0 : u[0]) == null ? void 0 : b.id;
269
270
  if (S == null) continue;
270
- const R = (U = (v = (await i.request(
271
- ye(`/pipelines/instance/${$.collection}/${S}`)
272
- )).data) == null ? void 0 : v.instance) == null ? void 0 : U.current_state_obj;
271
+ const $ = (U = (y = (await i.request(
272
+ ye(`/pipelines/instance/${A.collection}/${S}`)
273
+ )).data) == null ? void 0 : y.instance) == null ? void 0 : U.current_state_obj;
273
274
  return {
274
- collection: $.collection,
275
+ collection: A.collection,
275
276
  id: S,
276
- state: (R == null ? void 0 : R.label) ?? null,
277
- color: (R == null ? void 0 : R.color) ?? null
277
+ state: ($ == null ? void 0 : $.label) ?? null,
278
+ color: ($ == null ? void 0 : $.color) ?? null
278
279
  };
279
280
  } catch {
280
281
  }
281
282
  return null;
282
283
  },
283
- enabled: ((m == null ? void 0 : m.length) ?? 0) > 0,
284
+ enabled: ((p == null ? void 0 : p.length) ?? 0) > 0,
284
285
  staleTime: 10 * 6e4
285
- }), b = Mt();
286
+ }), x = Ot();
286
287
  return ks(
287
288
  d == null ? void 0 : d.collection,
288
289
  d == null ? void 0 : d.id,
289
- (p) => {
290
- ws(p, Ns.state) && b.invalidateQueries({ queryKey: ["nvr-chat-entity-card", n] });
290
+ (u) => {
291
+ ws(u, Ns.state) && x.invalidateQueries({ queryKey: ["nvr-chat-entity-card", n] });
291
292
  },
292
293
  { includeOwn: !0, debounceMs: 400 }
293
294
  ), /* @__PURE__ */ a(
@@ -295,15 +296,15 @@ function En({ token: n, url: s, mine: l }) {
295
296
  {
296
297
  type: "button",
297
298
  onClick: () => {
298
- var p, x;
299
+ var u, b;
299
300
  if (d) {
300
- const U = (r.recordUrl ?? (($, C) => `/collections/${$}/${C}`))(d.collection, d.id);
301
+ const U = (r.recordUrl ?? ((A, C) => `/collections/${A}/${C}`))(d.collection, d.id);
301
302
  if (U) {
302
- (p = r.navigate) == null || p.call(r, U);
303
+ (u = r.navigate) == null || u.call(r, U);
303
304
  return;
304
305
  }
305
306
  }
306
- s && ((x = r.navigate) == null || x.call(r, s));
307
+ s && ((b = r.navigate) == null || b.call(r, s));
307
308
  },
308
309
  className: g(
309
310
  "inline-flex max-w-full items-center gap-1 align-baseline font-medium underline-offset-2 hover:underline",
@@ -327,12 +328,12 @@ function En({ token: n, url: s, mine: l }) {
327
328
  }
328
329
  );
329
330
  }
330
- function Gr(n) {
331
+ function Yr(n) {
331
332
  const s = new Date(n), l = /* @__PURE__ */ new Date(), r = new Date(l);
332
333
  return r.setDate(l.getDate() - 1), s.toDateString() === l.toDateString() ? "Today" : s.toDateString() === r.toDateString() ? "Yesterday" : s.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
333
334
  }
334
- function Qr({ botName: n }) {
335
- const s = de(), l = [
335
+ function Zr({ botName: n }) {
336
+ const s = ue(), l = [
336
337
  {
337
338
  k: "@name",
338
339
  kind: "code",
@@ -395,37 +396,37 @@ function Qr({ botName: n }) {
395
396
  )) })
396
397
  ] });
397
398
  }
398
- function Kr({ room: n }) {
399
- const s = Le(), l = de(), r = Ze(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, m = o > 0 ? n.slice(o + 1) : null, d = !!i && !!m && n !== s.globalRoom && i !== "dm" && i !== "ch", b = Mt(), { data: f } = Te({
399
+ function Vr({ room: n }) {
400
+ const s = Le(), l = ue(), r = Ze(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, p = o > 0 ? n.slice(o + 1) : null, d = !!i && !!p && n !== s.globalRoom && i !== "dm" && i !== "ch", x = Ot(), { data: f } = Te({
400
401
  queryKey: ["nvr-chat-room-card", n],
401
402
  queryFn: async () => {
402
- var A, W, F, H;
403
- const S = (await b.fetchQuery(la(r))).find((ee) => ee.is_active && ee.prefix === i);
403
+ var J, G, F, O;
404
+ const S = (await x.fetchQuery(la(r))).find((K) => K.is_active && K.prefix === i);
404
405
  if (!S) return null;
405
- const R = (W = (A = (await r.request(
406
+ const $ = (G = (J = (await r.request(
406
407
  ye(`/items/${S.collection}`, {
407
408
  limit: 1,
408
409
  fields: "id",
409
- filter: JSON.stringify({ [S.match_field]: { _eq: m } })
410
+ filter: JSON.stringify({ [S.match_field]: { _eq: p } })
410
411
  })
411
- )).data) == null ? void 0 : A[0]) == null ? void 0 : W.id;
412
- if (R == null) return null;
413
- const q = (H = (F = (await r.request(
414
- ye(`/pipelines/instance/${S.collection}/${R}`)
415
- )).data) == null ? void 0 : F.instance) == null ? void 0 : H.current_state_obj;
412
+ )).data) == null ? void 0 : J[0]) == null ? void 0 : G.id;
413
+ if ($ == null) return null;
414
+ const q = (O = (F = (await r.request(
415
+ ye(`/pipelines/instance/${S.collection}/${$}`)
416
+ )).data) == null ? void 0 : F.instance) == null ? void 0 : O.current_state_obj;
416
417
  return {
417
418
  collection: S.collection,
418
419
  type_label: S.label ?? S.collection.replace(/_/g, " "),
419
- id: R,
420
+ id: $,
420
421
  state: (q == null ? void 0 : q.label) ?? null,
421
422
  color: (q == null ? void 0 : q.color) ?? null
422
423
  };
423
424
  },
424
425
  enabled: d,
425
426
  staleTime: 6e4
426
- }), p = oa(n, d && !!f);
427
+ }), u = oa(n, d && !!f);
427
428
  if (!d || !f) return null;
428
- const v = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (p == null ? void 0 : p.sla) ?? null, $ = (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";
429
+ const y = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (u == null ? void 0 : u.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";
429
430
  return /* @__PURE__ */ a(
430
431
  "div",
431
432
  {
@@ -433,7 +434,7 @@ function Kr({ room: n }) {
433
434
  "data-chat-room-card": !0,
434
435
  children: [
435
436
  /* @__PURE__ */ e("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: f.type_label }),
436
- /* @__PURE__ */ e("span", { className: "truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: m }),
437
+ /* @__PURE__ */ e("span", { className: "truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: p }),
437
438
  f.state && /* @__PURE__ */ e(
438
439
  "span",
439
440
  {
@@ -448,38 +449,38 @@ function Kr({ room: n }) {
448
449
  U && /* @__PURE__ */ e(
449
450
  "span",
450
451
  {
451
- className: g("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", $),
452
+ className: g("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", A),
452
453
  title: U.due_hours != null ? `${Math.round(U.elapsed_hours ?? 0)}h in this state of ${U.due_hours}h allowed` : void 0,
453
454
  "data-chat-room-sla": U.status,
454
455
  children: U.status === "breached" ? "Past SLA" : U.status === "warning" ? "SLA soon" : "On time"
455
456
  }
456
457
  ),
457
- p && p.owners.length > 0 && /* @__PURE__ */ a(
458
+ u && u.owners.length > 0 && /* @__PURE__ */ a(
458
459
  "span",
459
460
  {
460
461
  className: "ml-auto flex -space-x-1.5",
461
- title: `Owners: ${p.owners.map((C) => C.name).join(", ")}`,
462
- "data-chat-room-owners": p.owners.length,
462
+ title: `Owners: ${u.owners.map((C) => C.name).join(", ")}`,
463
+ "data-chat-room-owners": u.owners.length,
463
464
  children: [
464
- p.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(K, { id: C.id, name: C.name, size: 18, presence: !1 }, C.id)),
465
- p.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: [
465
+ u.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(Q, { id: C.id, name: C.name, size: 18, presence: !1 }, C.id)),
466
+ u.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
467
  "+",
467
- p.owners.length - 4
468
+ u.owners.length - 4
468
469
  ] })
469
470
  ]
470
471
  }
471
472
  ),
472
- v && /* @__PURE__ */ e(
473
+ y && /* @__PURE__ */ e(
473
474
  "button",
474
475
  {
475
476
  type: "button",
476
477
  onClick: () => {
477
478
  var C;
478
- return (C = s.navigate) == null ? void 0 : C.call(s, v);
479
+ return (C = s.navigate) == null ? void 0 : C.call(s, y);
479
480
  },
480
481
  className: g(
481
482
  "text-[11px] font-medium hover:underline",
482
- p != null && p.owners.length ? "ml-1.5" : "ml-auto",
483
+ u != null && u.owners.length ? "ml-1.5" : "ml-auto",
483
484
  l.accentText
484
485
  ),
485
486
  children: "Open"
@@ -489,12 +490,12 @@ function Kr({ room: n }) {
489
490
  }
490
491
  );
491
492
  }
492
- function Jr(n, s) {
493
+ function Xr(n, s) {
493
494
  if (!n) return null;
494
- const l = Lt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
495
+ const l = Pt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
495
496
  let o, i;
496
497
  try {
497
- const d = (b) => new Intl.DateTimeFormat("en-US", { timeZone: b, hour: "numeric", minute: "2-digit" }).format(
498
+ const d = (x) => new Intl.DateTimeFormat("en-US", { timeZone: x, hour: "numeric", minute: "2-digit" }).format(
498
499
  r
499
500
  );
500
501
  o = d(n), i = d(l);
@@ -502,22 +503,22 @@ function Jr(n, s) {
502
503
  return null;
503
504
  }
504
505
  if (o === i) return null;
505
- const m = s.split(/\s+/)[0] || s;
506
- return `${o} for ${m}`;
506
+ const p = s.split(/\s+/)[0] || s;
507
+ return `${o} for ${p}`;
507
508
  }
508
509
  function ha() {
509
510
  const [n, s] = T(0);
510
- return X(() => {
511
+ return ae(() => {
511
512
  const l = setInterval(() => s((r) => r + 1), 6e4);
512
513
  return () => clearInterval(l);
513
514
  }, []), n;
514
515
  }
515
- function Yr({ peerId: n, name: s }) {
516
+ function el({ peerId: n, name: s }) {
516
517
  ha();
517
518
  const { state: l, title: r } = ma(n), o = zt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
518
519
  const f = ua(o);
519
520
  return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
520
- })() : r, m = Jr((o == null ? void 0 : o.timezone) ?? null, s), d = pa(o), b = d ? (o == null ? void 0 : o.delegate) ?? null : null;
521
+ })() : r, p = Xr((o == null ? void 0 : o.timezone) ?? null, s), d = pa(o), x = d ? (o == null ? void 0 : o.delegate) ?? null : null;
521
522
  return /* @__PURE__ */ a(
522
523
  "p",
523
524
  {
@@ -533,16 +534,16 @@ function Yr({ peerId: n, name: s }) {
533
534
  children: d
534
535
  }
535
536
  ),
536
- b && ur() && /* @__PURE__ */ a(
537
+ x && ur() && /* @__PURE__ */ a(
537
538
  "button",
538
539
  {
539
540
  type: "button",
540
- onClick: () => mr(b.id, b.name),
541
+ onClick: () => mr(x.id, x.name),
541
542
  className: "shrink-0 font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-slate-200 dark:hover:text-white",
542
- "data-chat-dm-delegate": b.id,
543
+ "data-chat-dm-delegate": x.id,
543
544
  children: [
544
545
  "Message ",
545
- b.name,
546
+ x.name,
546
547
  " instead"
547
548
  ]
548
549
  }
@@ -550,39 +551,39 @@ function Yr({ peerId: n, name: s }) {
550
551
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" })
551
552
  ] }),
552
553
  /* @__PURE__ */ e("span", { className: "truncate", children: i }),
553
- m && /* @__PURE__ */ a(ke, { children: [
554
+ p && /* @__PURE__ */ a(ke, { children: [
554
555
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" }),
555
- /* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (o == null ? void 0 : o.timezone) ?? void 0, children: m })
556
+ /* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (o == null ? void 0 : o.timezone) ?? void 0, children: p })
556
557
  ] })
557
558
  ]
558
559
  }
559
560
  );
560
561
  }
561
- function Bn({
562
+ function En({
562
563
  room: n,
563
564
  label: s,
564
565
  onBack: l,
565
566
  onOpenSettings: r,
566
567
  renderMessageBody: o,
567
568
  initialUnread: i,
568
- anchor: m = null,
569
+ anchor: p = null,
569
570
  openThread: d = null
570
571
  }) {
571
- var xn, bn, gn, vn, yn, kn, wn, Nn, Cn, _n;
572
- const b = Le(), f = de(), p = Ze(), x = b.me, v = Tr(n), U = x ? Se(n, x.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Te({
573
- ...Ss(p, U),
574
- enabled: !!U && $,
572
+ var fn, xn, bn, gn, vn, yn, kn, wn, Nn, Cn;
573
+ const x = Le(), f = ue(), u = Ze(), b = x.me, y = Ur(n), U = b ? Se(n, b.id) : null, A = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Te({
574
+ ...Ss(u, U),
575
+ enabled: !!U && A,
575
576
  staleTime: 12e4
576
- }), S = $ && 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" : s, [E, R] = T(m);
577
- X(() => R(m), [m]);
578
- const { messages: y, loading: q, hasOlder: A, hasNewer: W, loadOlder: F, loadingOlder: H } = Ks(
577
+ }), 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" : s, [B, $] = T(p);
578
+ ae(() => $(p), [p]);
579
+ const { messages: v, loading: q, hasOlder: J, hasNewer: G, loadOlder: F, loadingOlder: O } = Ks(
579
580
  n,
580
- E
581
+ B
581
582
  );
582
583
  Js(n);
583
- const ee = ia(n), pe = Ys(), te = Zs(n), ne = Vs(n.startsWith("dm:") ? n : null), le = Xs(n), ae = er(n), ue = tr(n), c = nr(n), L = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== b.globalRoom && n.includes(":"), u = oa(n, L), J = gr(n, !!u), Ue = n.startsWith("ch:"), { data: he = [] } = Te({
584
+ const K = ia(n), ee = Ys(), Y = Zs(n), te = Vs(n.startsWith("dm:") ? n : null), oe = Xs(n), se = er(n), me = tr(n), c = nr(n), L = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== x.globalRoom && n.includes(":"), m = oa(n, L), Z = vr(n, !!m), Ue = n.startsWith("ch:"), { data: he = [] } = Te({
584
585
  queryKey: ["chat-read-marks", n],
585
- queryFn: () => p.request(
586
+ queryFn: () => u.request(
586
587
  ye(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
587
588
  ).then((t) => t.data ?? []).catch(() => []),
588
589
  enabled: Ue,
@@ -590,44 +591,44 @@ function Bn({
590
591
  staleTime: 15e3
591
592
  }), Pe = (t) => he.filter(
592
593
  (h) => h.user !== String(t.sender ?? "") && new Date(h.last_read_at).getTime() >= new Date(t.date_created).getTime()
593
- ), Ne = Mt(), { data: De = [] } = Te({
594
+ ), Ne = Ot(), { data: De = [] } = Te({
594
595
  queryKey: ["chat-saved"],
595
- queryFn: () => p.request(ye("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
596
+ queryFn: () => u.request(ye("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
596
597
  staleTime: 6e4
597
598
  }), Ce = ve(() => new Set(De.map((t) => t.id)), [De]), k = We({
598
- mutationFn: (t) => p.request(Fe(`/chat/messages/${t}/save`, {})),
599
+ mutationFn: (t) => u.request(Fe(`/chat/messages/${t}/save`, {})),
599
600
  onSuccess: () => void Ne.invalidateQueries({ queryKey: ["chat-saved"] })
600
- }), [M, P] = T(null), Y = We({
601
- mutationFn: () => p.request(
601
+ }), [M, P] = T(null), V = We({
602
+ mutationFn: () => u.request(
602
603
  Fe("/chat/rooms/summary", { room: n })
603
604
  ).then((t) => t.data),
604
605
  onSuccess: (t) => P((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
605
606
  onError: () => P("Summary unavailable.")
606
607
  }), $e = We({
607
608
  mutationFn: async (t) => {
608
- if (!u || !x) throw new Error("no record");
609
- await p.request(
609
+ if (!m || !b) throw new Error("no record");
610
+ await u.request(
610
611
  Fe("/tasks", {
611
- collection: u.collection,
612
- item: String(u.id),
612
+ collection: m.collection,
613
+ item: String(m.id),
613
614
  title: t.message.replace(/<[^>]*>/g, "").slice(0, 200),
614
- assignee: x.id
615
+ assignee: b.id
615
616
  })
616
617
  );
617
618
  },
618
619
  onSuccess: () => {
619
- u && _s(Ne, u.collection, u.id), ge.success("Task created from message — assigned to you");
620
+ m && _s(Ne, m.collection, m.id), ge.success("Task created from message — assigned to you");
620
621
  },
621
622
  onError: () => ge.error("Could not create a task")
622
623
  }), _ = We({
623
- mutationFn: (t) => p.request(Fe(`/chat/messages/${t.id}/to-notes`, {})),
624
- onSuccess: () => ge.success(`Copied to the Notes of ${(u == null ? void 0 : u.label) ?? "the record"}`),
624
+ mutationFn: (t) => u.request(Fe(`/chat/messages/${t.id}/to-notes`, {})),
625
+ onSuccess: () => ge.success(`Copied to the Notes of ${(m == null ? void 0 : m.label) ?? "the record"}`),
625
626
  onError: (t) => {
626
627
  var h;
627
628
  return ge.error(((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not copy it");
628
629
  }
629
630
  }), I = We({
630
- mutationFn: (t) => p.request(
631
+ mutationFn: (t) => u.request(
631
632
  Fe(`/chat/messages/${t.messageId}/attach-to-record`, {
632
633
  file_id: t.fileId,
633
634
  field: t.field
@@ -636,7 +637,7 @@ function Bn({
636
637
  onSuccess: (t, h) => {
637
638
  var N;
638
639
  return ge.success(
639
- `Attached to ${(u == null ? void 0 : u.label) ?? "the record"} — ${((N = J.find((z) => z.field === h.field)) == null ? void 0 : N.label) ?? h.field}`
640
+ `Attached to ${(m == null ? void 0 : m.label) ?? "the record"} — ${((N = Z.find((W) => W.field === h.field)) == null ? void 0 : N.label) ?? h.field}`
640
641
  );
641
642
  },
642
643
  onError: (t) => {
@@ -646,87 +647,87 @@ function Bn({
646
647
  );
647
648
  }
648
649
  }), j = We({
649
- mutationFn: (t) => p.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
650
+ mutationFn: (t) => u.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
650
651
  onSuccess: () => void Ne.invalidateQueries({ queryKey: ["nvr-chat", n] })
651
- }), oe = ar(n), V = sr(n), { isAdmin: Z } = pt(), { setMuted: G, setNotifyMode: se, setArchived: fe, setStarred: ga, dismissWelcome: va, leave: ya } = qt(), { rooms: ka, loading: wa } = aa(), Gt = ka.find((t) => t.room === n) ?? null, { rooms: Na } = sa(!wa && !Gt), w = Gt ?? Na.find((t) => t.room === n) ?? null, Ca = fa(w), Qt = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", me = rr(), [tt, _a] = T(!1), [nt, Kt] = T(""), [Sa, ht] = T(null), [Jt, Yt] = T(""), [Ta, ft] = T(null), Ua = Ur(n), [Da, Zt] = T(null), [Vt, Xt] = T(null), [en, Ie] = T(null), tn = lr(d ? n : null, d), nn = !!tn.root && !tn.root.deleted_at;
652
- X(() => {
653
- d && nn && Ie(d);
654
- }, [d, nn]);
655
- const [$a, an] = T(null), [Aa, sn] = T(null), [xt, ze] = T(!1), [Ra, bt] = T(!1), [ie, He] = T(null), [Ge, at] = T(
656
- m && "around" in m ? m.around : null
657
- ), [st, gt] = T(null), Qe = Rs(n, (x == null ? void 0 : x.id) ?? null), rn = ce(null), vt = ce(null), yt = ce(Math.max(0, i ?? 0)), Ae = ce(!1), Me = ce(null), ln = ce(null), re = ce(!m), Ke = ce(0), Je = ce(null), kt = ce(0), rt = () => {
658
- const t = Me.current;
652
+ }), ie = ar(n), ne = sr(n), { isAdmin: X } = ht(), { setMuted: z, setNotifyMode: re, setArchived: fe, setStarred: ga, dismissWelcome: va, leave: ya } = Et(), { rooms: ka, loading: wa } = aa(), Ht = ka.find((t) => t.room === n) ?? null, { rooms: Na } = sa(!wa && !Ht), w = Ht ?? Na.find((t) => t.room === n) ?? null, Ca = fa(w), Gt = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", pe = rr(), [tt, _a] = T(!1), [nt, Qt] = T(""), [Sa, ft] = T(null), [Kt, Jt] = T(""), [Ta, xt] = T(null), Ua = Ar(n), [Da, Yt] = T(null), [Zt, Vt] = T(null), [Xt, Ie] = T(null), en = lr(d ? n : null, d), tn = !!en.root && !en.root.deleted_at;
653
+ ae(() => {
654
+ d && tn && Ie(d);
655
+ }, [d, tn]);
656
+ const [$a, nn] = T(null), [Ma, an] = T(null), [bt, ze] = T(!1), [Aa, gt] = T(!1), [ce, He] = T(null), [Ge, at] = T(
657
+ p && "around" in p ? p.around : null
658
+ ), [st, vt] = T(null), Qe = As(n, (b == null ? void 0 : b.id) ?? null), sn = de(null), yt = de(null), kt = de(Math.max(0, i ?? 0)), Me = de(!1), Re = de(null), rn = de(null), le = de(!p), Ke = de(0), Je = de(null), wt = de(0), rt = () => {
659
+ const t = Re.current;
659
660
  t && (t.scrollTop = t.scrollHeight);
660
- }, wt = (t) => {
661
+ }, Nt = (t) => {
661
662
  var N;
662
- const h = (N = Me.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
663
- return h ? (h.scrollIntoView({ block: "center" }), re.current = !1, at(t), !0) : we.reveal(t) ? (re.current = !1, at(t), !0) : !1;
664
- }, on = (t) => {
665
- ze(!1), wt(t) || (Ae.current = !1, re.current = !1, at(t), R({ around: t }));
663
+ const h = (N = Re.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
664
+ return h ? (h.scrollIntoView({ block: "center" }), le.current = !1, at(t), !0) : we.reveal(t) ? (le.current = !1, at(t), !0) : !1;
665
+ }, ln = (t) => {
666
+ ze(!1), Nt(t) || (Me.current = !1, le.current = !1, at(t), $({ around: t }));
666
667
  };
667
- X(() => {
668
+ ae(() => {
668
669
  if (Ge == null) return;
669
670
  const t = setTimeout(() => at(null), 2400);
670
671
  return () => clearTimeout(t);
671
- }, [Ge]), X(() => {
672
- Ae.current = !1, Ke.current = 0, He(null);
673
- }, [n, E]), X(() => {
672
+ }, [Ge]), ae(() => {
673
+ Me.current = !1, Ke.current = 0, He(null);
674
+ }, [n, B]), ae(() => {
674
675
  var Oe, Ee;
675
- const t = Me.current, h = ((Oe = y[0]) == null ? void 0 : Oe.id) ?? null;
676
- if (!Ae.current && y.length > 0) {
677
- if (Ae.current = !0, Ke.current = y.length, Je.current = h, Ge != null && wt(Ge)) return;
678
- vt.current && !E ? (vt.current.scrollIntoView({ block: "center" }), re.current = !1) : E || (rt(), re.current = !0);
676
+ const t = Re.current, h = ((Oe = v[0]) == null ? void 0 : Oe.id) ?? null;
677
+ if (!Me.current && v.length > 0) {
678
+ if (Me.current = !0, Ke.current = v.length, Je.current = h, Ge != null && Nt(Ge)) return;
679
+ yt.current && !B ? (yt.current.scrollIntoView({ block: "center" }), le.current = !1) : B || (rt(), le.current = !0);
679
680
  return;
680
681
  }
681
682
  if (h !== Je.current && Je.current != null && t) {
682
- Je.current = h, Ke.current = y.length;
683
+ Je.current = h, Ke.current = v.length;
683
684
  return;
684
685
  }
685
686
  Je.current = h;
686
- const N = y.length - Ke.current;
687
- if (Ke.current = y.length, N <= 0) return;
688
- const z = y[y.length - 1], Q = !!(z != null && z.sender) && z.sender.toLowerCase() === ((Ee = x == null ? void 0 : x.id) == null ? void 0 : Ee.toLowerCase());
689
- if (re.current || Q)
690
- rt(), re.current = !0, He(null);
687
+ const N = v.length - Ke.current;
688
+ if (Ke.current = v.length, N <= 0) return;
689
+ const W = v[v.length - 1], H = !!(W != null && W.sender) && W.sender.toLowerCase() === ((Ee = b == null ? void 0 : b.id) == null ? void 0 : Ee.toLowerCase());
690
+ if (le.current || H)
691
+ rt(), le.current = !0, He(null);
691
692
  else {
692
- const Re = y[y.length - N];
693
- He((be) => ({ count: ((be == null ? void 0 : be.count) ?? 0) + N, firstId: (be == null ? void 0 : be.firstId) ?? Re.id }));
693
+ const Ae = v[v.length - N];
694
+ He((be) => ({ count: ((be == null ? void 0 : be.count) ?? 0) + N, firstId: (be == null ? void 0 : be.firstId) ?? Ae.id }));
694
695
  }
695
- }, [y]), X(() => {
696
- const t = ln.current;
696
+ }, [v]), ae(() => {
697
+ const t = rn.current;
697
698
  if (!t || typeof ResizeObserver > "u") return;
698
699
  const h = new ResizeObserver(() => {
699
700
  var N;
700
- re.current && rt(), kt.current = ((N = Me.current) == null ? void 0 : N.scrollHeight) ?? 0;
701
+ le.current && rt(), wt.current = ((N = Re.current) == null ? void 0 : N.scrollHeight) ?? 0;
701
702
  });
702
703
  return h.observe(t), () => h.disconnect();
703
- }, []), X(() => {
704
- var N, z;
705
- const t = y[y.length - 1];
706
- if (!t || !Ae.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((z = x == null ? void 0 : x.id) == null ? void 0 : z.toLowerCase()))
704
+ }, []), ae(() => {
705
+ var N, W;
706
+ const t = v[v.length - 1];
707
+ if (!t || !Me.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((W = b == null ? void 0 : b.id) == null ? void 0 : W.toLowerCase()))
707
708
  return;
708
709
  const h = Date.now() - new Date(t.date_created).getTime();
709
- h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && p.request(Fe("/chat/health/delivery", { ms: h })).catch(() => {
710
+ h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && u.request(Fe("/chat/health/delivery", { ms: h })).catch(() => {
710
711
  });
711
- }, [(xn = y[y.length - 1]) == null ? void 0 : xn.id]), X(() => {
712
- if (!st || !me) return;
713
- if (y.some(
714
- (N) => (N.sender_name ?? "").toLowerCase() === me.toLowerCase() && new Date(N.date_created).getTime() >= st - 5e3
712
+ }, [(fn = v[v.length - 1]) == null ? void 0 : fn.id]), ae(() => {
713
+ if (!st || !pe) return;
714
+ if (v.some(
715
+ (N) => (N.sender_name ?? "").toLowerCase() === pe.toLowerCase() && new Date(N.date_created).getTime() >= st - 5e3
715
716
  )) {
716
- gt(null);
717
+ vt(null);
717
718
  return;
718
719
  }
719
- const h = setTimeout(() => gt(null), 9e4);
720
+ const h = setTimeout(() => vt(null), 9e4);
720
721
  return () => clearTimeout(h);
721
- }, [st, me, y]);
722
+ }, [st, pe, v]);
722
723
  const lt = ve(() => {
723
724
  const t = /* @__PURE__ */ new Set();
724
- for (const h of y) for (const N of h.attachments ?? []) t.add(N);
725
+ for (const h of v) for (const N of h.attachments ?? []) t.add(N);
725
726
  return [...t];
726
- }, [y]), { data: Nt } = Te({
727
+ }, [v]), { data: Ct } = Te({
727
728
  queryKey: ["nvr-chat-attachments", lt.slice().sort().join("|")],
728
729
  queryFn: async () => {
729
- const t = await p.request(
730
+ const t = await u.request(
730
731
  ye("/files", {
731
732
  filter: JSON.stringify({ id: { _in: lt } }),
732
733
  limit: String(lt.length),
@@ -738,37 +739,37 @@ function Bn({
738
739
  enabled: lt.length > 0,
739
740
  staleTime: 5 * 6e4
740
741
  });
741
- X(() => {
742
- E || pe.mutate(n);
743
- }, [n, y.length, E]);
744
- const Ma = (t) => {
745
- if (re.current = !0, E && R(null), me) {
746
- const h = me.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
747
- new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) && gt(Date.now());
742
+ ae(() => {
743
+ B || ee.mutate(n);
744
+ }, [n, v.length, B]);
745
+ const Ra = (t) => {
746
+ if (le.current = !0, B && $(null), pe) {
747
+ const h = pe.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
748
+ new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) && vt(Date.now());
748
749
  }
749
- }, je = (bn = x == null ? void 0 : x.id) == null ? void 0 : bn.toLowerCase(), xe = tt && nt.trim().length > 0, _e = ve(
750
- () => xe ? y.filter((t) => t.message.toLowerCase().includes(nt.trim().toLowerCase())) : y,
751
- [y, xe, nt]
750
+ }, je = (xn = b == null ? void 0 : b.id) == null ? void 0 : xn.toLowerCase(), xe = tt && nt.trim().length > 0, _e = ve(
751
+ () => xe ? v.filter((t) => t.message.toLowerCase().includes(nt.trim().toLowerCase())) : v,
752
+ [v, xe, nt]
752
753
  ), Oa = ve(() => {
753
754
  var t;
754
755
  if (xe) return -1;
755
756
  for (let h = _e.length - 1; h >= 0; h--)
756
757
  if (((t = _e[h].sender) == null ? void 0 : t.toLowerCase()) === je) return h;
757
758
  return -1;
758
- }, [_e, je, xe]), cn = ne ? new Date(ne).getTime() : 0, qe = jt().chat_density === "compact" ? "compact" : "comfortable", dn = ce(null), La = ve(() => _e.map((t) => t.id), [_e]), we = yr({
759
- scrollerRef: Me,
760
- listRef: dn,
759
+ }, [_e, je, xe]), on = te ? new Date(te).getTime() : 0, qe = qt().chat_density === "compact" ? "compact" : "comfortable", cn = de(null), La = ve(() => _e.map((t) => t.id), [_e]), we = kr({
760
+ scrollerRef: Re,
761
+ listRef: cn,
761
762
  ids: La,
762
763
  estimate: qe === "compact" ? 40 : 72,
763
- resetKey: `${n}|${JSON.stringify(E)}|${xe ? "search" : ""}`,
764
- pinnedRef: re
765
- }), B = (w == null ? void 0 : w.channel) ?? null, un = !!B && !!x && String(B.created_by ?? "").toUpperCase() === x.id.toUpperCase(), mn = B != null && B.announce && !un && !Z ? B.id === na ? "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, pn = x ? Se(n, x.id) : null, Pa = zt(pn);
764
+ resetKey: `${n}|${JSON.stringify(B)}|${xe ? "search" : ""}`,
765
+ pinnedRef: le
766
+ }), E = (w == null ? void 0 : w.channel) ?? null, dn = !!E && !!b && String(E.created_by ?? "").toUpperCase() === b.id.toUpperCase(), un = E != null && E.announce && !dn && !X ? E.id === na ? "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, mn = b ? Se(n, b.id) : null, Pa = zt(mn);
766
767
  ha();
767
- const Ia = pn ? vr(Pa, S, /* @__PURE__ */ new Date()) : null;
768
- or(), fr();
769
- const ja = !!(B != null && B.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !B.is_direct, qa = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: b.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), Ea = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: b.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), hn = (t, h = {}) => {
770
- var Sn, Tn;
771
- const N = ((Sn = t.sender) == null ? void 0 : Sn.toLowerCase()) === je;
768
+ const Ia = mn ? yr(Pa, S, /* @__PURE__ */ new Date()) : null;
769
+ or(), xr();
770
+ const ja = !!(E != null && E.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !E.is_direct, qa = (t, h) => t.entity ? /* @__PURE__ */ e(qn, { 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), Ea = (t, h) => t.entity ? /* @__PURE__ */ e(qn, { 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), pn = (t, h = {}) => {
771
+ var _n, Sn;
772
+ const N = ((_n = t.sender) == null ? void 0 : _n.toLowerCase()) === je;
772
773
  if (t.is_system)
773
774
  return /* @__PURE__ */ e(
774
775
  "div",
@@ -785,10 +786,10 @@ function Bn({
785
786
  ] })
786
787
  }
787
788
  );
788
- const z = h.isLastMine && cn > 0 && new Date(t.date_created).getTime() <= cn, Q = !!t.deleted_at, Oe = N && !Q && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, Ee = !Q && (N || Z), Re = Sa === t.id, be = /* @__PURE__ */ new Map();
789
+ const W = h.isLastMine && on > 0 && new Date(t.date_created).getTime() <= on, H = !!t.deleted_at, Oe = N && !H && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, Ee = !H && (N || X), Ae = Sa === t.id, be = /* @__PURE__ */ new Map();
789
790
  for (const D of t.reactions ?? []) {
790
- const O = be.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
791
- O.count++, ((Tn = D.user) == null ? void 0 : Tn.toLowerCase()) === je && (O.mine = !0), D.user_name && O.names.push(D.user_name), be.set(D.emoji, O);
791
+ const R = be.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
792
+ R.count++, ((Sn = D.user) == null ? void 0 : Sn.toLowerCase()) === je && (R.mine = !0), D.user_name && R.names.push(D.user_name), be.set(D.emoji, R);
792
793
  }
793
794
  const Be = "rounded-full p-0.5 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200";
794
795
  return /* @__PURE__ */ a(
@@ -801,14 +802,14 @@ function Bn({
801
802
  ),
802
803
  "data-chat-msg": t.id,
803
804
  children: [
804
- !N && /* @__PURE__ */ e(Pt, { userId: t.sender, children: /* @__PURE__ */ e(
805
+ !N && /* @__PURE__ */ e(It, { userId: t.sender, children: /* @__PURE__ */ e(
805
806
  "button",
806
807
  {
807
808
  type: "button",
808
809
  className: "h-fit shrink-0 rounded-full",
809
810
  "aria-label": `${t.sender_name ?? "Sender"} — profile`,
810
811
  "data-chat-avatar-card": !0,
811
- children: /* @__PURE__ */ e(K, { id: t.sender, name: t.sender_name, size: qe === "compact" ? 22 : 26 })
812
+ children: /* @__PURE__ */ e(Q, { id: t.sender, name: t.sender_name, size: qe === "compact" ? 22 : 26 })
812
813
  }
813
814
  ) }),
814
815
  /* @__PURE__ */ a("div", { className: g("relative max-w-[78%]", N && "text-right"), children: [
@@ -827,7 +828,7 @@ function Bn({
827
828
  }
828
829
  )
829
830
  ] }),
830
- !Q && !Re && /* @__PURE__ */ a(
831
+ !H && !Ae && /* @__PURE__ */ a(
831
832
  "div",
832
833
  {
833
834
  className: g(
@@ -839,11 +840,11 @@ function Bn({
839
840
  ),
840
841
  "data-chat-msg-actions": !0,
841
842
  children: [
842
- pr.map((D) => /* @__PURE__ */ e(
843
+ hr.map((D) => /* @__PURE__ */ e(
843
844
  "button",
844
845
  {
845
846
  type: "button",
846
- onClick: () => ae.mutate({ messageId: t.id, emoji: D }),
847
+ onClick: () => se.mutate({ messageId: t.id, emoji: D }),
847
848
  className: "rounded-full px-0.5 text-[13px] leading-none transition-transform hover:scale-125",
848
849
  title: `React ${D}`,
849
850
  children: D
@@ -851,12 +852,12 @@ function Bn({
851
852
  D
852
853
  )),
853
854
  /* @__PURE__ */ e(
854
- xr,
855
+ br,
855
856
  {
856
857
  label: "More reactions",
857
858
  className: Be,
858
- onPick: (D) => ae.mutate({ messageId: t.id, emoji: D }),
859
- onOpenChange: (D) => Zt(D ? t.id : null)
859
+ onPick: (D) => se.mutate({ messageId: t.id, emoji: D }),
860
+ onOpenChange: (D) => Yt(D ? t.id : null)
860
861
  }
861
862
  ),
862
863
  !h.inThread && !t.parent_id && /* @__PURE__ */ e(
@@ -877,13 +878,13 @@ function Bn({
877
878
  {
878
879
  type: "button",
879
880
  title: "Quote",
880
- onClick: () => h.inThread ? sn(t) : an(t),
881
+ onClick: () => h.inThread ? an(t) : nn(t),
881
882
  className: Be,
882
883
  "data-chat-quote": !0,
883
884
  children: /* @__PURE__ */ e(ls, { className: "h-3 w-3" })
884
885
  }
885
886
  ),
886
- u && /* @__PURE__ */ a(ke, { children: [
887
+ m && /* @__PURE__ */ a(ke, { children: [
887
888
  /* @__PURE__ */ e(
888
889
  "button",
889
890
  {
@@ -898,7 +899,7 @@ function Bn({
898
899
  "button",
899
900
  {
900
901
  type: "button",
901
- title: `Copy into the Notes of ${u.label}`,
902
+ title: `Copy into the Notes of ${m.label}`,
902
903
  onClick: () => _.mutate(t),
903
904
  className: Be,
904
905
  "data-chat-to-notes": !0,
@@ -910,13 +911,13 @@ function Bn({
910
911
  "button",
911
912
  {
912
913
  type: "button",
913
- title: ue.some((D) => D.id === t.id) ? "Unpin" : "Pin",
914
+ title: me.some((D) => D.id === t.id) ? "Unpin" : "Pin",
914
915
  onClick: () => c.mutate(t.id),
915
916
  className: g(
916
917
  "rounded-full p-0.5",
917
- ue.some((D) => D.id === t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
918
+ me.some((D) => D.id === t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
918
919
  ),
919
- children: /* @__PURE__ */ e(Ut, { className: "h-3 w-3" })
920
+ children: /* @__PURE__ */ e(Dt, { className: "h-3 w-3" })
920
921
  }
921
922
  ),
922
923
  /* @__PURE__ */ e(
@@ -938,7 +939,7 @@ function Bn({
938
939
  type: "button",
939
940
  title: "Edit",
940
941
  onClick: () => {
941
- ht(t.id), Yt(t.message), ft(null);
942
+ ft(t.id), Jt(t.message), xt(null);
942
943
  },
943
944
  className: Be,
944
945
  children: /* @__PURE__ */ e(ds, { className: "h-3 w-3" })
@@ -950,7 +951,7 @@ function Bn({
950
951
  type: "button",
951
952
  title: "Confirm delete",
952
953
  onClick: () => {
953
- V.mutate(t.id), ft(null);
954
+ ne.mutate(t.id), xt(null);
954
955
  },
955
956
  className: "rounded-full px-1 text-[10px] font-semibold text-red-500",
956
957
  children: "Sure?"
@@ -960,24 +961,24 @@ function Bn({
960
961
  {
961
962
  type: "button",
962
963
  title: N ? "Delete" : "Delete (admin)",
963
- onClick: () => ft(t.id),
964
+ onClick: () => xt(t.id),
964
965
  className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
965
966
  children: /* @__PURE__ */ e(us, { className: "h-3 w-3" })
966
967
  }
967
968
  )),
968
969
  /* @__PURE__ */ e(
969
- Dr,
970
+ Rr,
970
971
  {
971
972
  messageId: t.id,
972
- actions: $r(Ua, t, je),
973
- navigate: b.navigate,
974
- onOpenChange: (D) => Zt(D ? t.id : null)
973
+ actions: Or(Ua, t, je),
974
+ navigate: x.navigate,
975
+ onOpenChange: (D) => Yt(D ? t.id : null)
975
976
  }
976
977
  )
977
978
  ]
978
979
  }
979
980
  ),
980
- t.urgent && !Q && /* @__PURE__ */ a(
981
+ t.urgent && !H && /* @__PURE__ */ a(
981
982
  "p",
982
983
  {
983
984
  className: g(
@@ -991,24 +992,24 @@ function Bn({
991
992
  ]
992
993
  }
993
994
  ),
994
- Q ? /* @__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" }) : Re ? /* @__PURE__ */ a(
995
+ H ? /* @__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" }) : Ae ? /* @__PURE__ */ a(
995
996
  "form",
996
997
  {
997
998
  className: "flex items-center gap-1",
998
999
  onSubmit: (D) => {
999
1000
  D.preventDefault();
1000
- const O = Jt.trim();
1001
- O && O !== t.message && oe.mutate({ messageId: t.id, text: O }), ht(null);
1001
+ const R = Kt.trim();
1002
+ R && R !== t.message && ie.mutate({ messageId: t.id, text: R }), ft(null);
1002
1003
  },
1003
1004
  children: [
1004
1005
  /* @__PURE__ */ e(
1005
1006
  "input",
1006
1007
  {
1007
1008
  autoFocus: !0,
1008
- value: Jt,
1009
- onChange: (D) => Yt(D.target.value),
1009
+ value: Kt,
1010
+ onChange: (D) => Jt(D.target.value),
1010
1011
  onKeyDown: (D) => {
1011
- D.key === "Escape" && ht(null);
1012
+ D.key === "Escape" && ft(null);
1012
1013
  },
1013
1014
  className: g(
1014
1015
  "h-8 w-[240px] rounded-lg border px-2 text-[12px] outline-none",
@@ -1041,7 +1042,7 @@ function Bn({
1041
1042
  "button",
1042
1043
  {
1043
1044
  type: "button",
1044
- onClick: () => on(t.quote.id),
1045
+ onClick: () => ln(t.quote.id),
1045
1046
  className: g(
1046
1047
  "mb-1 block w-full rounded-md border-l-2 px-2 py-1 text-left text-[11px]",
1047
1048
  N ? "border-white/60 bg-black/10" : "border-slate-400 bg-white/70 dark:border-slate-500 dark:bg-black/20"
@@ -1053,46 +1054,46 @@ function Bn({
1053
1054
  ]
1054
1055
  }
1055
1056
  ),
1056
- t.message && Ln(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
1057
- Ar,
1057
+ t.message && On(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
1058
+ Lr,
1058
1059
  {
1059
- text: Ln(t.message),
1060
+ text: On(t.message),
1060
1061
  mine: N,
1061
1062
  renderToken: N ? Ea : qa,
1062
- entityPattern: b.entityPattern,
1063
+ entityPattern: x.entityPattern,
1063
1064
  timeRefs: t.time_refs,
1064
- navigate: b.navigate
1065
+ navigate: x.navigate
1065
1066
  }
1066
1067
  )),
1067
- Pn(t.message) != null && /* @__PURE__ */ e(
1068
- Nr,
1068
+ Ln(t.message) != null && /* @__PURE__ */ e(
1069
+ Cr,
1069
1070
  {
1070
- id: Pn(t.message),
1071
+ id: Ln(t.message),
1071
1072
  mine: N,
1072
- renderAvatar: (D, O) => /* @__PURE__ */ e(K, { id: D, name: O, size: 18, presence: !1 })
1073
+ renderAvatar: (D, R) => /* @__PURE__ */ e(Q, { id: D, name: R, size: 18, presence: !1 })
1073
1074
  }
1074
1075
  ),
1075
- t.poll && /* @__PURE__ */ e(Mr, { poll: t.poll, room: t.room, mine: N }),
1076
+ t.poll && /* @__PURE__ */ e(Ir, { poll: t.poll, room: t.room, mine: N }),
1076
1077
  (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) => {
1077
- const O = Nt == null ? void 0 : Nt.get(D), ot = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", Ct = p.fileUrl(D), Ba = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), it = Br(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), Un = () => Xt({
1078
+ const R = Ct == null ? void 0 : Ct.get(D), ot = (R == null ? void 0 : R.title) || (R == null ? void 0 : R.filename_download) || "Attachment", _t = u.fileUrl(D), Ba = ((R == null ? void 0 : R.type) ?? "").startsWith("image/"), it = Hr(R == null ? void 0 : R.tags, R == null ? void 0 : R.type), Tn = () => Vt({
1078
1079
  id: D,
1079
- url: Ct,
1080
+ url: _t,
1080
1081
  name: ot,
1081
- type: (O == null ? void 0 : O.type) ?? null,
1082
- size: (O == null ? void 0 : O.filesize) ?? null
1083
- }), ct = u && J.length > 0 ? /* @__PURE__ */ e(
1084
- Vr,
1082
+ type: (R == null ? void 0 : R.type) ?? null,
1083
+ size: (R == null ? void 0 : R.filesize) ?? null
1084
+ }), ct = m && Z.length > 0 ? /* @__PURE__ */ e(
1085
+ nl,
1085
1086
  {
1086
- targets: J,
1087
- recordLabel: u.label,
1087
+ targets: Z,
1088
+ recordLabel: m.label,
1088
1089
  onPick: (Wa) => I.mutate({ messageId: t.id, fileId: D, field: Wa })
1089
1090
  }
1090
1091
  ) : null;
1091
1092
  return it ? /* @__PURE__ */ e(
1092
- Wr,
1093
+ Gr,
1093
1094
  {
1094
- url: Ct,
1095
- poster: it.poster ? p.fileUrl(it.poster) : null,
1095
+ url: _t,
1096
+ poster: it.poster ? u.fileUrl(it.poster) : null,
1096
1097
  name: ot,
1097
1098
  durationMs: it.durationMs,
1098
1099
  action: ct
@@ -1103,12 +1104,12 @@ function Bn({
1103
1104
  "button",
1104
1105
  {
1105
1106
  type: "button",
1106
- onClick: Un,
1107
+ onClick: Tn,
1107
1108
  className: "block cursor-zoom-in",
1108
1109
  children: /* @__PURE__ */ e(
1109
1110
  "img",
1110
1111
  {
1111
- src: Ct,
1112
+ src: _t,
1112
1113
  alt: ot,
1113
1114
  className: "max-h-40 max-w-[220px] rounded-lg object-cover",
1114
1115
  loading: "lazy"
@@ -1122,7 +1123,7 @@ function Bn({
1122
1123
  "button",
1123
1124
  {
1124
1125
  type: "button",
1125
- onClick: Un,
1126
+ onClick: Tn,
1126
1127
  className: g(
1127
1128
  "inline-flex max-w-[220px] items-center gap-1.5 rounded-lg border px-2 py-1 text-[11.5px]",
1128
1129
  N ? "border-white/30 bg-white/10" : "border-slate-200 bg-white dark:border-border dark:bg-card"
@@ -1139,11 +1140,11 @@ function Bn({
1139
1140
  ]
1140
1141
  }
1141
1142
  ),
1142
- !Q && !Re && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
1143
- Rr,
1143
+ !H && !Ae && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
1144
+ Pr,
1144
1145
  {
1145
1146
  text: t.message,
1146
- navigate: b.navigate,
1147
+ navigate: x.navigate,
1147
1148
  onDismiss: N ? () => j.mutate(t.id) : void 0
1148
1149
  }
1149
1150
  ) }),
@@ -1152,19 +1153,19 @@ function Bn({
1152
1153
  {
1153
1154
  className: g("mt-0.5 flex flex-wrap gap-1", N && "justify-end"),
1154
1155
  "data-chat-reactions": !0,
1155
- children: [...be.entries()].map(([D, O]) => /* @__PURE__ */ a(
1156
+ children: [...be.entries()].map(([D, R]) => /* @__PURE__ */ a(
1156
1157
  "button",
1157
1158
  {
1158
1159
  type: "button",
1159
- title: O.names.join(", "),
1160
- onClick: () => ae.mutate({ messageId: t.id, emoji: D }),
1160
+ title: R.names.join(", "),
1161
+ onClick: () => se.mutate({ messageId: t.id, emoji: D }),
1161
1162
  className: g(
1162
1163
  "inline-flex items-center gap-0.5 rounded-full border px-1.5 py-px text-[10.5px] leading-tight transition-colors",
1163
- O.mine ? g("font-semibold", f.accentSoft, "border-transparent") : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300 dark:hover:bg-muted"
1164
+ R.mine ? g("font-semibold", f.accentSoft, "border-transparent") : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300 dark:hover:bg-muted"
1164
1165
  ),
1165
1166
  children: [
1166
- /* @__PURE__ */ e(br, { value: D }),
1167
- /* @__PURE__ */ e("span", { className: "tabular-nums", children: O.count })
1167
+ /* @__PURE__ */ e(gr, { value: D }),
1168
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: R.count })
1168
1169
  ]
1169
1170
  },
1170
1171
  D
@@ -1183,13 +1184,13 @@ function Bn({
1183
1184
  ),
1184
1185
  "data-chat-thread-summary": t.thread.count,
1185
1186
  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)) }),
1187
+ /* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((D) => /* @__PURE__ */ e(Q, { id: D.id, name: D.name, size: 16, presence: !1 }, D.id)) }),
1187
1188
  t.thread.count,
1188
1189
  " ",
1189
1190
  t.thread.count === 1 ? "reply" : "replies",
1190
1191
  t.thread.last_reply_at && /* @__PURE__ */ a("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: [
1191
1192
  "· last ",
1192
- Kn(t.thread.last_reply_at)
1193
+ Qn(t.thread.last_reply_at)
1193
1194
  ] })
1194
1195
  ]
1195
1196
  }
@@ -1211,28 +1212,28 @@ function Bn({
1211
1212
  ]
1212
1213
  }
1213
1214
  ),
1214
- t.edited_at && !Q && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
1215
+ t.edited_at && !H && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
1215
1216
  new Date(t.date_created).toLocaleTimeString("en-US", {
1216
1217
  hour: "numeric",
1217
1218
  minute: "2-digit"
1218
1219
  }),
1219
- N && Ue && !Q && (() => {
1220
- var O;
1220
+ N && Ue && !H && (() => {
1221
+ var R;
1221
1222
  const D = Pe(t);
1222
1223
  return D.length === 0 ? null : /* @__PURE__ */ e(
1223
- tl,
1224
+ rl,
1224
1225
  {
1225
1226
  seen: D,
1226
- channelId: ((O = w == null ? void 0 : w.channel) == null ? void 0 : O.id) ?? null,
1227
+ channelId: ((R = w == null ? void 0 : w.channel) == null ? void 0 : R.id) ?? null,
1227
1228
  senderId: String(t.sender ?? "")
1228
1229
  }
1229
1230
  );
1230
1231
  })(),
1231
- h.isLastMine && n.startsWith("dm:") && (z ? /* @__PURE__ */ a("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
1232
+ h.isLastMine && n.startsWith("dm:") && (W ? /* @__PURE__ */ a("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
1232
1233
  /* @__PURE__ */ e(fs, { className: "h-3 w-3", strokeWidth: 2.4 }),
1233
1234
  " Read"
1234
1235
  ] }) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-0.5", children: [
1235
- /* @__PURE__ */ e(Ot, { className: "h-3 w-3", strokeWidth: 2.2 }),
1236
+ /* @__PURE__ */ e(Lt, { className: "h-3 w-3", strokeWidth: 2.2 }),
1236
1237
  " Sent"
1237
1238
  ] }))
1238
1239
  ] })
@@ -1240,20 +1241,20 @@ function Bn({
1240
1241
  ]
1241
1242
  }
1242
1243
  );
1243
- }, fn = (t) => /* @__PURE__ */ e(
1244
+ }, hn = (t) => /* @__PURE__ */ e(
1244
1245
  Fs,
1245
1246
  {
1246
- ref: t ? void 0 : rn,
1247
+ ref: t ? void 0 : sn,
1247
1248
  room: n,
1248
1249
  label: S,
1249
1250
  parentId: t,
1250
- quote: t ? Aa : $a,
1251
- onClearQuote: () => t ? sn(null) : an(null),
1252
- onSent: Ma,
1253
- disabledReason: t ? null : mn,
1251
+ quote: t ? Ma : $a,
1252
+ onClearQuote: () => t ? an(null) : nn(null),
1253
+ onSent: Ra,
1254
+ disabledReason: t ? null : un,
1254
1255
  quietNote: Ia,
1255
1256
  th: f,
1256
- renderAvatar: (h, N) => /* @__PURE__ */ e(K, { id: h, name: N, size: 22, presence: h !== "__bot__" })
1257
+ renderAvatar: (h, N) => /* @__PURE__ */ e(Q, { id: h, name: N, size: 22, presence: h !== "__bot__" })
1257
1258
  }
1258
1259
  );
1259
1260
  return /* @__PURE__ */ a(
@@ -1262,17 +1263,17 @@ function Bn({
1262
1263
  className: "relative flex h-full min-h-0 flex-col",
1263
1264
  "data-chat-room": n,
1264
1265
  onDragOver: (t) => {
1265
- t.dataTransfer.types.includes("Files") && !mn && (t.preventDefault(), bt(!0));
1266
+ t.dataTransfer.types.includes("Files") && !un && (t.preventDefault(), gt(!0));
1266
1267
  },
1267
1268
  onDragLeave: (t) => {
1268
- t.currentTarget.contains(t.relatedTarget) || bt(!1);
1269
+ t.currentTarget.contains(t.relatedTarget) || gt(!1);
1269
1270
  },
1270
1271
  onDrop: (t) => {
1271
1272
  var h;
1272
- t.dataTransfer.files.length && (t.preventDefault(), bt(!1), (h = rn.current) == null || h.addFiles([...t.dataTransfer.files]));
1273
+ t.dataTransfer.files.length && (t.preventDefault(), gt(!1), (h = sn.current) == null || h.addFiles([...t.dataTransfer.files]));
1273
1274
  },
1274
1275
  children: [
1275
- Ra && /* @__PURE__ */ e(
1276
+ Aa && /* @__PURE__ */ e(
1276
1277
  "div",
1277
1278
  {
1278
1279
  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",
@@ -1291,13 +1292,13 @@ function Bn({
1291
1292
  children: /* @__PURE__ */ e(ut, { className: "h-4 w-4", strokeWidth: 2 })
1292
1293
  }
1293
1294
  ),
1294
- ((w == null ? void 0 : w.kind) === "channel" && !((gn = w.channel) != null && gn.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((vn = w.channel) == null ? void 0 : vn.icon) || ((yn = w.channel) == null ? void 0 : yn.color))) && /* @__PURE__ */ e(Ye, { icon: (kn = w == null ? void 0 : w.channel) == null ? void 0 : kn.icon, color: (wn = w == null ? void 0 : w.channel) == null ? void 0 : wn.color, size: 24 }),
1295
- x && Se(n, x.id) && /* @__PURE__ */ e(Hr, { peerId: Se(n, x.id), name: S }),
1295
+ ((w == null ? void 0 : w.kind) === "channel" && !((bn = w.channel) != null && bn.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((gn = w.channel) == null ? void 0 : gn.icon) || ((vn = w.channel) == null ? void 0 : vn.color))) && /* @__PURE__ */ e(Ye, { icon: (yn = w == null ? void 0 : w.channel) == null ? void 0 : yn.icon, color: (kn = w == null ? void 0 : w.channel) == null ? void 0 : kn.color, size: 24 }),
1296
+ b && Se(n, b.id) && /* @__PURE__ */ e(Jr, { peerId: Se(n, b.id), name: S }),
1296
1297
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1297
1298
  /* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
1298
1299
  /* @__PURE__ */ e("span", { className: "truncate", children: S }),
1299
- w && /* @__PURE__ */ e(Or, { starred: !!w.starred, notify: Qt }),
1300
- (B == null ? void 0 : B.announce) && /* @__PURE__ */ e(
1300
+ w && /* @__PURE__ */ e(jr, { starred: !!w.starred, notify: Gt }),
1301
+ (E == null ? void 0 : E.announce) && /* @__PURE__ */ e(
1301
1302
  "span",
1302
1303
  {
1303
1304
  className: "shrink-0 rounded bg-slate-100 px-1.5 py-px text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
@@ -1306,22 +1307,22 @@ function Bn({
1306
1307
  }
1307
1308
  )
1308
1309
  ] }),
1309
- x && Se(n, x.id) ? /* @__PURE__ */ e(Yr, { peerId: Se(n, x.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
1310
- Pr,
1310
+ b && Se(n, b.id) ? /* @__PURE__ */ e(el, { peerId: Se(n, b.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
1311
+ Er,
1311
1312
  {
1312
1313
  room: n,
1313
- me: ((Nn = b.me) == null ? void 0 : Nn.id) ?? null,
1314
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 24 })
1314
+ me: ((wn = x.me) == null ? void 0 : wn.id) ?? null,
1315
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Q, { id: t, name: h, size: 24 })
1315
1316
  }
1316
1317
  ) : null
1317
1318
  ] }),
1318
1319
  /* @__PURE__ */ e(
1319
- kr,
1320
+ wr,
1320
1321
  {
1321
1322
  room: n,
1322
1323
  roomLabel: S,
1323
- huddle: v,
1324
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 18, presence: !1 })
1324
+ huddle: y,
1325
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Q, { id: t, name: h, size: 18, presence: !1 })
1325
1326
  }
1326
1327
  ),
1327
1328
  /* @__PURE__ */ e(
@@ -1329,16 +1330,16 @@ function Bn({
1329
1330
  {
1330
1331
  type: "button",
1331
1332
  onClick: () => {
1332
- _a((t) => !t), Kt("");
1333
+ _a((t) => !t), Qt("");
1333
1334
  },
1334
- className: g(jn, tt ? f.accentSoft : In),
1335
+ className: g(In, tt ? f.accentSoft : Pn),
1335
1336
  "aria-label": "Search in this conversation",
1336
1337
  "aria-pressed": tt,
1337
1338
  "data-tip": "Search this conversation",
1338
- children: /* @__PURE__ */ e(Gn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
1339
+ children: /* @__PURE__ */ e(Hn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
1339
1340
  }
1340
1341
  ),
1341
- ((Cn = w == null ? void 0 : w.channel) == null ? void 0 : Cn.is_direct) && /* @__PURE__ */ e(nl, { channel: w.channel, onLeft: l }),
1342
+ ((Nn = w == null ? void 0 : w.channel) == null ? void 0 : Nn.is_direct) && /* @__PURE__ */ e(ll, { channel: w.channel, onLeft: l }),
1342
1343
  /* @__PURE__ */ e(
1343
1344
  "button",
1344
1345
  {
@@ -1346,58 +1347,58 @@ function Bn({
1346
1347
  onClick: () => {
1347
1348
  Ie(null), ze((t) => !t);
1348
1349
  },
1349
- className: g(jn, xt ? f.accentSoft : In),
1350
+ className: g(In, bt ? f.accentSoft : Pn),
1350
1351
  "aria-label": "Room info — members, pinned, files and links",
1351
- "aria-pressed": xt,
1352
+ "aria-pressed": bt,
1352
1353
  "data-tip": "Room info — members, pinned, files and links",
1353
1354
  "data-chat-info-button": !0,
1354
1355
  children: /* @__PURE__ */ e(as, { className: "h-3.5 w-3.5", strokeWidth: 2 })
1355
1356
  }
1356
1357
  ),
1357
1358
  /* @__PURE__ */ e(
1358
- Lr,
1359
+ qr,
1359
1360
  {
1360
1361
  th: f,
1361
- huddleSchedule: v.enabled ? (t) => /* @__PURE__ */ e(
1362
- Cr,
1362
+ huddleSchedule: y.enabled ? (t) => /* @__PURE__ */ e(
1363
+ _r,
1363
1364
  {
1364
1365
  room: n,
1365
- me: (x == null ? void 0 : x.id) ?? null,
1366
+ me: (b == null ? void 0 : b.id) ?? null,
1366
1367
  theme: { input: f.input },
1367
- renderAvatar: (h, N) => /* @__PURE__ */ e(K, { id: h, name: N, size: 18, presence: !1 }),
1368
+ renderAvatar: (h, N) => /* @__PURE__ */ e(Q, { id: h, name: N, size: 18, presence: !1 }),
1368
1369
  onDone: t
1369
1370
  }
1370
1371
  ) : void 0,
1371
1372
  starred: w ? !!w.starred : void 0,
1372
1373
  onStar: w ? () => ga.mutate({ room: n, starred: !w.starred }) : void 0,
1373
- notify: w ? Qt : void 0,
1374
+ notify: w ? Gt : void 0,
1374
1375
  onNotify: w ? (t) => {
1375
- t === "muted" ? G.mutate({ room: n, muted: !0 }) : (w.muted && G.mutate({ room: n, muted: !1 }), se.mutate({ room: n, mode: t }));
1376
+ t === "muted" ? z.mutate({ room: n, muted: !0 }) : (w.muted && z.mutate({ room: n, muted: !1 }), re.mutate({ room: n, mode: t }));
1376
1377
  } : void 0,
1377
1378
  onJump: (t) => {
1378
- Ae.current = !1, re.current = !1, R({ date: t });
1379
+ Me.current = !1, le.current = !1, $({ date: t });
1379
1380
  },
1380
- onOpenRecord: le ? () => {
1381
+ onOpenRecord: oe ? () => {
1381
1382
  var t;
1382
- return (t = b.navigate) == null ? void 0 : t.call(b, le);
1383
+ return (t = x.navigate) == null ? void 0 : t.call(x, oe);
1383
1384
  } : void 0,
1384
- onTeamsCall: n.startsWith("dm:") || (_n = w == null ? void 0 : w.channel) != null && _n.is_direct ? async () => {
1385
+ onTeamsCall: n.startsWith("dm:") || (Cn = w == null ? void 0 : w.channel) != null && Cn.is_direct ? async () => {
1385
1386
  var t, h;
1386
1387
  try {
1387
1388
  let N = [];
1388
- if (n.startsWith("dm:") && x) {
1389
- const z = Se(n, x.id);
1390
- if (z) {
1391
- const Q = await p.request(
1392
- ye(`/users/${z}`)
1389
+ if (n.startsWith("dm:") && b) {
1390
+ const W = Se(n, b.id);
1391
+ if (W) {
1392
+ const H = await u.request(
1393
+ ye(`/users/${W}`)
1393
1394
  );
1394
- (t = Q.data) != null && t.email && (N = [Q.data.email]);
1395
+ (t = H.data) != null && t.email && (N = [H.data.email]);
1395
1396
  }
1396
- } else (h = w == null ? void 0 : w.channel) != null && h.id && (N = (await p.request(
1397
+ } else (h = w == null ? void 0 : w.channel) != null && h.id && (N = (await u.request(
1397
1398
  ye(
1398
1399
  `/chat/channels/${w.channel.id}/members`
1399
1400
  )
1400
- )).data.filter((Q) => Q.email && Q.user.toUpperCase() !== (x == null ? void 0 : x.id.toUpperCase())).map((Q) => Q.email));
1401
+ )).data.filter((H) => H.email && H.user.toUpperCase() !== (b == null ? void 0 : b.id.toUpperCase())).map((H) => H.email));
1401
1402
  if (N.length === 0) {
1402
1403
  ge.error("No callable participants found");
1403
1404
  return;
@@ -1433,17 +1434,17 @@ function Bn({
1433
1434
  }), l();
1434
1435
  }
1435
1436
  }) : void 0,
1436
- tips: /* @__PURE__ */ e(Qr, { botName: me })
1437
+ tips: /* @__PURE__ */ e(Zr, { botName: pe })
1437
1438
  }
1438
1439
  )
1439
1440
  ] }),
1440
1441
  /* @__PURE__ */ e(
1441
- _r,
1442
+ Sr,
1442
1443
  {
1443
1444
  room: n,
1444
- me: x,
1445
- huddle: v,
1446
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 18, presence: !1 })
1445
+ me: b,
1446
+ huddle: y,
1447
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Q, { id: t, name: h, size: 18, presence: !1 })
1447
1448
  }
1448
1449
  ),
1449
1450
  tt && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1.5", f.divider), children: /* @__PURE__ */ e(
@@ -1451,23 +1452,23 @@ function Bn({
1451
1452
  {
1452
1453
  autoFocus: !0,
1453
1454
  value: nt,
1454
- onChange: (t) => Kt(t.target.value),
1455
+ onChange: (t) => Qt(t.target.value),
1455
1456
  placeholder: "Search messages…",
1456
1457
  className: g("h-7 w-full rounded-md border px-2 text-[12px] outline-none", f.input),
1457
1458
  "aria-label": "Search messages"
1458
1459
  }
1459
1460
  ) }),
1460
- /* @__PURE__ */ e(Kr, { room: n }),
1461
- B && !B.is_direct && /* @__PURE__ */ e(
1462
- Ir,
1461
+ /* @__PURE__ */ e(Vr, { room: n }),
1462
+ E && !E.is_direct && /* @__PURE__ */ e(
1463
+ Br,
1463
1464
  {
1464
- description: B.description,
1465
- links: B.links,
1465
+ description: E.description,
1466
+ links: E.links,
1466
1467
  th: f,
1467
- navigate: b.navigate
1468
+ navigate: x.navigate
1468
1469
  }
1469
1470
  ),
1470
- ue.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(
1471
+ me.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(
1471
1472
  "button",
1472
1473
  {
1473
1474
  type: "button",
@@ -1476,25 +1477,25 @@ function Bn({
1476
1477
  },
1477
1478
  className: "flex w-full items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-slate-400",
1478
1479
  children: [
1479
- /* @__PURE__ */ e(Ut, { className: "h-3 w-3", strokeWidth: 2 }),
1480
- ue.length,
1480
+ /* @__PURE__ */ e(Dt, { className: "h-3 w-3", strokeWidth: 2 }),
1481
+ me.length,
1481
1482
  " pinned",
1482
1483
  /* @__PURE__ */ e(ut, { className: "ml-auto h-3 w-3 -rotate-90" })
1483
1484
  ]
1484
1485
  }
1485
1486
  ) }),
1486
- (B == null ? void 0 : B.archive_suggested_at) && B.id !== 0 && (un || Z) && /* @__PURE__ */ e(
1487
+ (E == null ? void 0 : E.archive_suggested_at) && E.id !== 0 && (dn || X) && /* @__PURE__ */ e(
1487
1488
  Ls,
1488
1489
  {
1489
- channelId: B.id,
1490
+ channelId: E.id,
1490
1491
  channelName: S,
1491
- suggestedAt: B.archive_suggested_at
1492
+ suggestedAt: E.archive_suggested_at
1492
1493
  }
1493
1494
  ),
1494
- ja && (B == null ? void 0 : B.welcome_note) && /* @__PURE__ */ e(
1495
- jr,
1495
+ ja && (E == null ? void 0 : E.welcome_note) && /* @__PURE__ */ e(
1496
+ Wr,
1496
1497
  {
1497
- note: B.welcome_note,
1498
+ note: E.welcome_note,
1498
1499
  channelName: S,
1499
1500
  th: f,
1500
1501
  onDismiss: () => va.mutate(n)
@@ -1503,44 +1504,44 @@ function Bn({
1503
1504
  /* @__PURE__ */ e(
1504
1505
  "div",
1505
1506
  {
1506
- ref: Me,
1507
+ ref: Re,
1507
1508
  onScroll: (t) => {
1508
1509
  const h = t.currentTarget;
1509
- re.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, kt.current = h.scrollHeight, re.current && ie && He(null), we.onScroll(), h.scrollTop < 200 && A && !H && !xe && Ae.current && F();
1510
+ le.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, wt.current = h.scrollHeight, le.current && ce && He(null), we.onScroll(), h.scrollTop < 200 && J && !O && !xe && Me.current && F();
1510
1511
  },
1511
1512
  className: "relative min-h-0 flex-1 overflow-y-auto px-3 py-3 [overflow-anchor:none]",
1512
1513
  "data-chat-messages": !0,
1513
- children: /* @__PURE__ */ a("div", { ref: ln, className: qe === "compact" ? "space-y-1" : "space-y-2.5", children: [
1514
- A && !xe && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
1514
+ children: /* @__PURE__ */ a("div", { ref: rn, className: qe === "compact" ? "space-y-1" : "space-y-2.5", children: [
1515
+ J && !xe && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
1515
1516
  "button",
1516
1517
  {
1517
1518
  type: "button",
1518
- disabled: H,
1519
+ disabled: O,
1519
1520
  onClick: () => {
1520
1521
  var t;
1521
- kt.current = ((t = Me.current) == null ? void 0 : t.scrollHeight) ?? 0, F();
1522
+ wt.current = ((t = Re.current) == null ? void 0 : t.scrollHeight) ?? 0, F();
1522
1523
  },
1523
1524
  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
1525
  "data-chat-load-older": !0,
1525
- children: H ? "Loading…" : "Load earlier messages"
1526
+ children: O ? "Loading…" : "Load earlier messages"
1526
1527
  }
1527
1528
  ) }),
1528
- q ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : _e.length === 0 && ee.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: xe ? "No messages match." : E ? "Nothing was said around then." : /* @__PURE__ */ a(ke, { children: [
1529
+ q ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : _e.length === 0 && K.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: xe ? "No messages match." : B ? "Nothing was said around then." : /* @__PURE__ */ a(ke, { children: [
1529
1530
  /* @__PURE__ */ e("p", { children: "No messages yet — say hello." }),
1530
1531
  /* @__PURE__ */ a("p", { className: "mt-1 text-[11px]", children: [
1531
1532
  "Tip: @ mentions someone",
1532
- me ? `, @${me} asks the AI` : "",
1533
+ pe ? `, @${pe} asks the AI` : "",
1533
1534
  ", # inserts a record, and a record ID like AB26-12345 becomes a live link."
1534
1535
  ] })
1535
1536
  ] }) }) : /* @__PURE__ */ e(
1536
1537
  "div",
1537
1538
  {
1538
- ref: dn,
1539
+ ref: cn,
1539
1540
  style: we.windowed ? { paddingTop: we.padTop, paddingBottom: we.padBottom } : void 0,
1540
1541
  "data-chat-rows": we.windowed ? "windowed" : "all",
1541
1542
  children: _e.slice(we.start, we.end).map((t, h) => {
1542
- var Re;
1543
- const N = we.start + h, z = _e[N - 1], Q = N === 0 || z && new Date(z.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !xe && !E && yt.current > 0 && N === Math.max(0, _e.length - yt.current), Ee = qe === "compact" && !Q && !!z && z.sender === t.sender && !z.is_system && new Date(t.date_created).getTime() - new Date(z.date_created).getTime() < 5 * 6e4;
1543
+ var Ae;
1544
+ const N = we.start + h, W = _e[N - 1], H = N === 0 || W && new Date(W.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !xe && !B && kt.current > 0 && N === Math.max(0, _e.length - kt.current), Ee = qe === "compact" && !H && !!W && W.sender === t.sender && !W.is_system && new Date(t.date_created).getTime() - new Date(W.date_created).getTime() < 5 * 6e4;
1544
1545
  return /* @__PURE__ */ a(
1545
1546
  "div",
1546
1547
  {
@@ -1548,28 +1549,28 @@ function Bn({
1548
1549
  "data-chat-row": t.id,
1549
1550
  className: N > 0 ? qe === "compact" ? "pt-1" : "pt-2.5" : void 0,
1550
1551
  children: [
1551
- Q && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
1552
+ H && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
1552
1553
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
1553
- /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Gr(t.date_created) }),
1554
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Yr(t.date_created) }),
1554
1555
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
1555
1556
  ] }),
1556
1557
  Oe && /* @__PURE__ */ a(
1557
1558
  "div",
1558
1559
  {
1559
- ref: vt,
1560
+ ref: yt,
1560
1561
  className: "my-2 flex items-center gap-2",
1561
1562
  "data-chat-unread-divider": !0,
1562
1563
  children: [
1563
1564
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-red-300 dark:bg-red-500/50" }),
1564
1565
  /* @__PURE__ */ e("span", { className: "text-[11px] font-semibold text-red-600 dark:text-red-400", children: "New messages" }),
1565
- yt.current > 20 && /* @__PURE__ */ e(
1566
+ kt.current > 20 && /* @__PURE__ */ e(
1566
1567
  "button",
1567
1568
  {
1568
1569
  type: "button",
1569
- disabled: Y.isPending,
1570
- onClick: () => Y.mutate(),
1570
+ disabled: V.isPending,
1571
+ onClick: () => V.mutate(),
1571
1572
  className: "rounded-full border border-red-200 px-1.5 py-px text-[9.5px] font-medium text-red-500 hover:text-red-600 disabled:opacity-50 dark:border-red-500/40",
1572
- children: Y.isPending ? "Summarizing…" : "✨ What did I miss?"
1573
+ children: V.isPending ? "Summarizing…" : "✨ What did I miss?"
1573
1574
  }
1574
1575
  ),
1575
1576
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-red-300 dark:bg-red-500/50" })
@@ -1577,8 +1578,8 @@ function Bn({
1577
1578
  }
1578
1579
  ),
1579
1580
  Oe && M && /* @__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: M }),
1580
- hn(t, {
1581
- isLastMine: ((Re = t.sender) == null ? void 0 : Re.toLowerCase()) === je && N === Oa,
1581
+ pn(t, {
1582
+ isLastMine: ((Ae = t.sender) == null ? void 0 : Ae.toLowerCase()) === je && N === Oa,
1582
1583
  showSender: !Ee
1583
1584
  })
1584
1585
  ]
@@ -1588,12 +1589,12 @@ function Bn({
1588
1589
  })
1589
1590
  }
1590
1591
  ),
1591
- !xe && !W && /* @__PURE__ */ e(ca, { items: ee, th: f }),
1592
- !xe && !W && Qe.live && me && /* @__PURE__ */ e(
1593
- Ms,
1592
+ !xe && !G && /* @__PURE__ */ e(ca, { items: K, th: f }),
1593
+ !xe && !G && Qe.live && pe && /* @__PURE__ */ e(
1594
+ Rs,
1594
1595
  {
1595
1596
  live: Qe.live,
1596
- botName: me,
1597
+ botName: pe,
1597
1598
  bubbleClass: f.bubbleOther,
1598
1599
  accentClass: f.accentText,
1599
1600
  onStop: Qe.stop,
@@ -1603,26 +1604,26 @@ function Bn({
1603
1604
  ] })
1604
1605
  }
1605
1606
  ),
1606
- (ie || W) && /* @__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
+ (ce || 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(
1607
1608
  "button",
1608
1609
  {
1609
1610
  type: "button",
1610
1611
  onClick: () => {
1611
- if (W) {
1612
- Ae.current = !1, re.current = !0, R(null);
1612
+ if (G) {
1613
+ Me.current = !1, le.current = !0, $(null);
1613
1614
  return;
1614
1615
  }
1615
- ie && !wt(ie.firstId) && rt(), He(null);
1616
+ ce && !Nt(ce.firstId) && rt(), He(null);
1616
1617
  },
1617
1618
  className: g(
1618
1619
  "pointer-events-auto rounded-full px-3 py-1 text-[11.5px] font-semibold shadow-md",
1619
1620
  f.pill
1620
1621
  ),
1621
- "data-chat-new-pill": (ie == null ? void 0 : ie.count) ?? 0,
1622
- children: W ? "Jump to the latest ↓" : `${ie == null ? void 0 : ie.count} new ${(ie == null ? void 0 : ie.count) === 1 ? "message" : "messages"} ↓`
1622
+ "data-chat-new-pill": (ce == null ? void 0 : ce.count) ?? 0,
1623
+ children: G ? "Jump to the latest ↓" : `${ce == null ? void 0 : ce.count} new ${(ce == null ? void 0 : ce.count) === 1 ? "message" : "messages"} ↓`
1623
1624
  }
1624
1625
  ) }),
1625
- /* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children: st && me && !Qe.live ? /* @__PURE__ */ a(
1626
+ /* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children: st && pe && !Qe.live ? /* @__PURE__ */ a(
1626
1627
  "p",
1627
1628
  {
1628
1629
  className: "flex items-center gap-1.5 text-[11px] italic text-slate-500",
@@ -1633,48 +1634,48 @@ function Bn({
1633
1634
  /* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:150ms]" }),
1634
1635
  /* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:300ms]" })
1635
1636
  ] }),
1636
- me,
1637
+ pe,
1637
1638
  " is thinking…"
1638
1639
  ]
1639
1640
  }
1640
- ) : te.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: te.typingText }) }),
1641
- Vt && /* @__PURE__ */ e(Ds, { file: Vt, onClose: () => Xt(null) }),
1642
- fn(null),
1643
- en != null && /* @__PURE__ */ e(
1644
- qr,
1641
+ ) : Y.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: Y.typingText }) }),
1642
+ Zt && /* @__PURE__ */ e(Ds, { file: Zt, onClose: () => Vt(null) }),
1643
+ hn(null),
1644
+ Xt != null && /* @__PURE__ */ e(
1645
+ Fr,
1645
1646
  {
1646
1647
  room: n,
1647
- rootId: en,
1648
+ rootId: Xt,
1648
1649
  th: f,
1649
1650
  onClose: () => Ie(null),
1650
- renderRow: (t) => hn(t, { inThread: !0 }),
1651
- renderComposer: (t) => fn(t),
1652
- renderOutbox: (t) => /* @__PURE__ */ e(Zr, { room: n, parentId: t, th: f })
1651
+ renderRow: (t) => pn(t, { inThread: !0 }),
1652
+ renderComposer: (t) => hn(t),
1653
+ renderOutbox: (t) => /* @__PURE__ */ e(tl, { room: n, parentId: t, th: f })
1653
1654
  }
1654
1655
  ),
1655
- xt && /* @__PURE__ */ e(
1656
- Er,
1656
+ bt && /* @__PURE__ */ e(
1657
+ zr,
1657
1658
  {
1658
1659
  room: n,
1659
1660
  label: S,
1660
1661
  th: f,
1661
- pins: ue,
1662
+ pins: me,
1662
1663
  onClose: () => ze(!1),
1663
- onOpenMessage: on,
1664
+ onOpenMessage: ln,
1664
1665
  onUnpin: (t) => c.mutate(t),
1665
- navigate: b.navigate,
1666
- renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 22 })
1666
+ navigate: x.navigate,
1667
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Q, { id: t, name: h, size: 22 })
1667
1668
  }
1668
1669
  )
1669
1670
  ]
1670
1671
  }
1671
1672
  );
1672
1673
  }
1673
- function Zr({ room: n, parentId: s, th: l }) {
1674
+ function tl({ room: n, parentId: s, th: l }) {
1674
1675
  const r = ia(n, s);
1675
1676
  return /* @__PURE__ */ e(ca, { items: r, th: l });
1676
1677
  }
1677
- function Vr({
1678
+ function nl({
1678
1679
  targets: n,
1679
1680
  recordLabel: s,
1680
1681
  onPick: l
@@ -1712,7 +1713,7 @@ function Vr({
1712
1713
  ] })
1713
1714
  ] });
1714
1715
  }
1715
- function Wn(n) {
1716
+ function Bn(n) {
1716
1717
  return {
1717
1718
  id: n.id,
1718
1719
  visibility: n.visibility,
@@ -1723,29 +1724,29 @@ function Wn(n) {
1723
1724
  color: n.color ?? null
1724
1725
  };
1725
1726
  }
1726
- const Xr = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1727
+ const al = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1727
1728
  function At(n) {
1728
1729
  const s = typeof n.idle_minutes == "number" ? n.idle_minutes : n.last_active ? Math.floor((Date.now() - new Date(n.last_active).getTime()) / 6e4) : null;
1729
1730
  return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
1730
1731
  }
1731
- function Fn(n) {
1732
+ function Wn(n) {
1732
1733
  const s = n == null ? void 0 : n.trim();
1733
- return !s || Xr.test(s) ? null : s;
1734
+ return !s || al.test(s) ? null : s;
1734
1735
  }
1735
- function el(n) {
1736
+ function sl(n) {
1736
1737
  const s = new Date(n), l = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
1737
1738
  return s.toDateString() === l.toDateString() ? r : (l.getTime() - s.getTime()) / 864e5 < 6 ? `${s.toLocaleDateString("en-US", { weekday: "short" })} ${r}` : `${s.toLocaleDateString("en-US", { month: "short", day: "numeric" })}, ${r}`;
1738
1739
  }
1739
- function tl({
1740
+ function rl({
1740
1741
  seen: n,
1741
1742
  channelId: s,
1742
1743
  senderId: l
1743
1744
  }) {
1744
- const r = de(), [o, i] = T(!1), { members: m } = Et(o ? s : null), d = new Set(n.map((p) => String(p.user).toUpperCase())), b = m.filter((p) => {
1745
- const x = String(p.user).toUpperCase();
1746
- return x !== l.toUpperCase() && !d.has(x);
1745
+ const r = ue(), [o, i] = T(!1), { members: p } = ea(o ? s : null), d = new Set(n.map((u) => String(u.user).toUpperCase())), x = p.filter((u) => {
1746
+ const b = String(u.user).toUpperCase();
1747
+ return b !== l.toUpperCase() && !d.has(b);
1747
1748
  }), f = [...n].sort(
1748
- (p, x) => new Date(p.last_read_at).getTime() - new Date(x.last_read_at).getTime()
1749
+ (u, b) => new Date(u.last_read_at).getTime() - new Date(b.last_read_at).getTime()
1749
1750
  );
1750
1751
  return /* @__PURE__ */ a(Ve, { open: o, onOpenChange: i, children: [
1751
1752
  /* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ a(
@@ -1777,29 +1778,29 @@ function tl({
1777
1778
  n.length
1778
1779
  ] }),
1779
1780
  /* @__PURE__ */ a("div", { className: "max-h-[260px] overflow-y-auto py-1", children: [
1780
- f.map((p) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
1781
- /* @__PURE__ */ e(K, { id: p.user, name: p.name || null, size: 22 }),
1782
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: p.name || "Someone" }),
1781
+ f.map((u) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
1782
+ /* @__PURE__ */ e(Q, { id: u.user, name: u.name || null, size: 22 }),
1783
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: u.name || "Someone" }),
1783
1784
  /* @__PURE__ */ e(
1784
1785
  "span",
1785
1786
  {
1786
1787
  className: "shrink-0 text-[10.5px] tabular-nums text-slate-400",
1787
- "data-tip": `Last read the conversation ${new Date(p.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
1788
- children: el(p.last_read_at)
1788
+ "data-tip": `Last read the conversation ${new Date(u.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
1789
+ children: sl(u.last_read_at)
1789
1790
  }
1790
1791
  )
1791
- ] }, p.user)),
1792
- b.length > 0 && /* @__PURE__ */ a(ke, { children: [
1792
+ ] }, u.user)),
1793
+ x.length > 0 && /* @__PURE__ */ a(ke, { children: [
1793
1794
  /* @__PURE__ */ a("p", { className: "px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1794
1795
  "Not seen yet · ",
1795
- b.length
1796
+ x.length
1796
1797
  ] }),
1797
- b.map((p) => {
1798
- const x = [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email || "Someone";
1798
+ x.map((u) => {
1799
+ const b = [u.first_name, u.last_name].filter(Boolean).join(" ") || u.email || "Someone";
1799
1800
  return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5 opacity-70", children: [
1800
- /* @__PURE__ */ e(K, { id: p.user, name: x, size: 22 }),
1801
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300", children: x })
1802
- ] }, p.user);
1801
+ /* @__PURE__ */ e(Q, { id: u.user, name: b, size: 22 }),
1802
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300", children: b })
1803
+ ] }, u.user);
1803
1804
  })
1804
1805
  ] })
1805
1806
  ] }),
@@ -1809,13 +1810,15 @@ function tl({
1809
1810
  )
1810
1811
  ] });
1811
1812
  }
1812
- function nl({ channel: n, onLeft: s }) {
1813
- var q;
1814
- const l = de(), r = Le(), { isAdmin: o } = pt(), [i, m] = T(!1), { members: d, loading: b } = Et(n.id), { addMember: f, removeMember: p } = ta(n.id), [x, v] = T(""), U = Ht(x, 250), $ = ((q = r.me) == null ? void 0 : q.id.toUpperCase()) ?? "", C = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: S } = Bt(U, i && C && !!x.trim()), E = new Set(d.map((A) => String(A.user).toUpperCase())), R = (A) => [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.user, y = [...d].sort((A, W) => {
1815
- const F = String(A.user).toUpperCase(), H = String(W.user).toUpperCase();
1816
- return F === $ ? -1 : H === $ ? 1 : R(A).localeCompare(R(W));
1817
- });
1818
- return /* @__PURE__ */ a(Ve, { open: i, onOpenChange: m, children: [
1813
+ function ll({ channel: n, onLeft: s }) {
1814
+ var F;
1815
+ const l = ue(), r = Le(), { isAdmin: o } = ht(), [i, p] = T(!1), [d, x] = T(""), f = mt(d, 250), u = pr(
1816
+ `channel-${n.id}`,
1817
+ `/chat/channels/${n.id}/members`,
1818
+ f,
1819
+ i
1820
+ ), b = u.members, y = u.loading, { addMember: U, removeMember: A } = ta(n.id), [C, S] = T(""), B = mt(C, 250), $ = ((F = r.me) == null ? void 0 : F.id.toUpperCase()) ?? "", v = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: q } = Bt(B, i && v && !!C.trim()), J = new Set(b.map((O) => O.id.toUpperCase())), G = b;
1821
+ return /* @__PURE__ */ a(Ve, { open: i, onOpenChange: p, children: [
1819
1822
  /* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ a(
1820
1823
  "button",
1821
1824
  {
@@ -1828,8 +1831,8 @@ function nl({ channel: n, onLeft: s }) {
1828
1831
  ),
1829
1832
  "data-chat-group-members": !0,
1830
1833
  children: [
1831
- /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
1832
- d.length > 0 && d.length
1834
+ /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
1835
+ u.total > 0 && u.total
1833
1836
  ]
1834
1837
  }
1835
1838
  ) }),
@@ -1841,83 +1844,96 @@ function nl({ channel: n, onLeft: s }) {
1841
1844
  className: g("w-[260px] p-0", l.surface),
1842
1845
  "data-chat-group-members-panel": !0,
1843
1846
  children: [
1844
- /* @__PURE__ */ e("div", { className: g("border-b px-3 py-2", l.divider), children: /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1845
- "In this conversation ",
1846
- d.length > 0 && `· ${d.length}`
1847
- ] }) }),
1847
+ /* @__PURE__ */ a("div", { className: g("border-b px-3 py-2", l.divider), children: [
1848
+ /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1849
+ "In this conversation ",
1850
+ u.total > 0 && `· ${u.total.toLocaleString("en-US")}`
1851
+ ] }),
1852
+ (u.total > 10 || d) && /* @__PURE__ */ e(Dr, { value: d, onChange: x, className: "mt-1.5" })
1853
+ ] }),
1848
1854
  /* @__PURE__ */ a("div", { className: "max-h-[280px] overflow-y-auto py-1", children: [
1849
- b && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
1850
- y.map((A) => {
1851
- const W = String(A.user).toUpperCase(), F = R(A), H = W === $, ee = String(n.created_by ?? "").toUpperCase() === W;
1855
+ y && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
1856
+ !y && G.length === 0 && d.trim() && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No one matches." }),
1857
+ G.map((O) => {
1858
+ const K = O.id.toUpperCase(), ee = O.name, Y = K === $, te = String(n.created_by ?? "").toUpperCase() === K;
1852
1859
  return /* @__PURE__ */ a(
1853
1860
  "div",
1854
1861
  {
1855
1862
  className: "group flex items-center gap-2 px-3 py-1.5",
1856
- "data-chat-group-member": A.user,
1863
+ "data-chat-group-member": O.id,
1857
1864
  children: [
1858
- /* @__PURE__ */ e(K, { id: A.user, name: F, size: 26 }),
1865
+ /* @__PURE__ */ e(Q, { id: O.id, name: ee, size: 26 }),
1859
1866
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
1860
1867
  /* @__PURE__ */ a("span", { className: "block truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
1861
- F,
1862
- H && /* @__PURE__ */ e("span", { className: "text-slate-400", children: " (you)" })
1868
+ ee,
1869
+ Y && /* @__PURE__ */ e("span", { className: "text-slate-400", children: " (you)" })
1863
1870
  ] }),
1864
- ee && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
1871
+ te && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
1865
1872
  ] }),
1866
- C && !H && /* @__PURE__ */ e(
1873
+ /* @__PURE__ */ e($r, { online: O.online }),
1874
+ v && !Y && /* @__PURE__ */ e(
1867
1875
  "button",
1868
1876
  {
1869
1877
  type: "button",
1870
- title: `Remove ${F}`,
1871
- "aria-label": `Remove ${F}`,
1872
- onClick: () => p.mutate(A.user),
1878
+ title: `Remove ${ee}`,
1879
+ "aria-label": `Remove ${ee}`,
1880
+ onClick: () => A.mutate(O.id),
1873
1881
  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",
1874
- children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
1882
+ children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
1875
1883
  }
1876
1884
  )
1877
1885
  ]
1878
1886
  },
1879
- A.user
1887
+ O.id
1880
1888
  );
1881
- })
1889
+ }),
1890
+ /* @__PURE__ */ e(
1891
+ Mr,
1892
+ {
1893
+ hasMore: u.hasMore,
1894
+ loading: u.loadingMore,
1895
+ onLoad: u.loadMore
1896
+ }
1897
+ )
1882
1898
  ] }),
1883
- C && /* @__PURE__ */ a("div", { className: g("border-t px-3 py-2", l.divider), children: [
1899
+ v && /* @__PURE__ */ a("div", { className: g("border-t px-3 py-2", l.divider), children: [
1884
1900
  /* @__PURE__ */ e(
1885
1901
  "input",
1886
1902
  {
1887
- value: x,
1888
- onChange: (A) => v(A.target.value),
1903
+ value: C,
1904
+ onChange: (O) => S(O.target.value),
1889
1905
  placeholder: "Add someone…",
1890
1906
  className: g("h-7 w-full rounded-md px-2 text-[12px] outline-none", l.input),
1891
1907
  "data-chat-group-add": !0
1892
1908
  }
1893
1909
  ),
1894
- x.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: S.filter((A) => !E.has(String(A.id).toUpperCase())).map((A) => {
1895
- const W = [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.id;
1910
+ C.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: q.filter((O) => !J.has(String(O.id).toUpperCase())).map((O) => {
1911
+ const K = [O.first_name, O.last_name].filter(Boolean).join(" ") || O.email || O.id;
1896
1912
  return /* @__PURE__ */ a(
1897
1913
  "button",
1898
1914
  {
1899
1915
  type: "button",
1900
1916
  onClick: () => {
1901
- f.mutate(A.id), v("");
1917
+ U.mutate(O.id), S("");
1902
1918
  },
1903
1919
  className: "flex w-full items-center gap-2 rounded px-1 py-1 text-left hover:bg-muted",
1904
1920
  children: [
1905
- /* @__PURE__ */ e(K, { id: A.id, name: W, size: 22 }),
1906
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: W })
1921
+ /* @__PURE__ */ e(Q, { id: O.id, name: K, size: 22 }),
1922
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: K })
1907
1923
  ]
1908
1924
  },
1909
- A.id
1925
+ O.id
1910
1926
  );
1911
1927
  }) })
1912
1928
  ] }),
1913
- $ && E.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
1929
+ $ && J.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
1914
1930
  "button",
1915
1931
  {
1916
1932
  type: "button",
1917
1933
  onClick: () => {
1918
- p.mutate(r.me.id, {
1934
+ A.mutate(r.me.id, {
1919
1935
  onSuccess: () => {
1920
- m(!1), s();
1936
+ p(!1), s();
1921
1937
  }
1922
1938
  });
1923
1939
  },
@@ -1931,15 +1947,15 @@ function nl({ channel: n, onLeft: s }) {
1931
1947
  )
1932
1948
  ] });
1933
1949
  }
1934
- function al({
1950
+ function ol({
1935
1951
  channel: n,
1936
1952
  label: s,
1937
1953
  onBack: l
1938
1954
  }) {
1939
- const r = de(), o = Le(), { isAdmin: i } = pt(), m = ea(), { members: d, loading: b } = Et(n.id), { update: f, addMember: p, removeMember: x } = ta(n.id), [v, U] = T(s), [$, C] = T(n.topic ?? ""), [S, E] = T(n.visibility), [R, y] = T(n.role ?? ""), [q, A] = T({
1955
+ const r = ue(), o = Le(), { isAdmin: i } = ht(), p = Xn(), { members: d, loading: x } = ea(n.id), { update: f, addMember: u, removeMember: b } = ta(n.id), [y, U] = T(s), [A, C] = T(n.topic ?? ""), [S, B] = T(n.visibility), [$, v] = T(n.role ?? ""), [q, J] = T({
1940
1956
  icon: n.icon ?? null,
1941
1957
  color: n.color ?? null
1942
- }), [W, F] = T(""), H = Ht(W, 250), { users: ee } = Bt(H, S === "private"), [pe, te] = T(!1), ne = n.id === na, le = i || !ne && !!o.me && String(n.created_by ?? "") === String(o.me.id), ae = new Set(d.map((c) => String(c.user).toUpperCase())), ue = v !== s || $ !== (n.topic ?? "") || S !== n.visibility || q.icon !== (n.icon ?? null) || q.color !== (n.color ?? null) || S === "role" && R !== (n.role ?? "");
1958
+ }), [G, F] = T(""), O = mt(G, 250), { users: K } = Bt(O, S === "private"), [ee, Y] = T(!1), te = n.id === na, oe = i || !te && !!o.me && String(n.created_by ?? "") === String(o.me.id), se = new Set(d.map((c) => String(c.user).toUpperCase())), me = y !== s || A !== (n.topic ?? "") || S !== n.visibility || q.icon !== (n.icon ?? null) || q.color !== (n.color ?? null) || S === "role" && $ !== (n.role ?? "");
1943
1959
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
1944
1960
  /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
1945
1961
  /* @__PURE__ */ e(
@@ -1958,13 +1974,13 @@ function al({
1958
1974
  ] })
1959
1975
  ] }),
1960
1976
  /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto p-3", children: [
1961
- le ? /* @__PURE__ */ a(ke, { children: [
1977
+ oe ? /* @__PURE__ */ a(ke, { children: [
1962
1978
  /* @__PURE__ */ a("label", { className: "block", children: [
1963
1979
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Name" }),
1964
1980
  /* @__PURE__ */ e(
1965
1981
  "input",
1966
1982
  {
1967
- value: v,
1983
+ value: y,
1968
1984
  onChange: (c) => U(c.target.value),
1969
1985
  className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
1970
1986
  }
@@ -1972,21 +1988,21 @@ function al({
1972
1988
  ] }),
1973
1989
  !n.is_direct && /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
1974
1990
  /* @__PURE__ */ e(Ye, { icon: q.icon, color: q.color, size: 40 }),
1975
- /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Jn, { icon: q.icon, color: q.color, onChange: A }) })
1991
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Kn, { icon: q.icon, color: q.color, onChange: J }) })
1976
1992
  ] }),
1977
1993
  /* @__PURE__ */ a("label", { className: "block", children: [
1978
1994
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Topic" }),
1979
1995
  /* @__PURE__ */ e(
1980
1996
  "input",
1981
1997
  {
1982
- value: $,
1998
+ value: A,
1983
1999
  onChange: (c) => C(c.target.value),
1984
2000
  placeholder: "What this channel is for",
1985
2001
  className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
1986
2002
  }
1987
2003
  )
1988
2004
  ] }),
1989
- !ne && /* @__PURE__ */ a("div", { children: [
2005
+ !te && /* @__PURE__ */ a("div", { children: [
1990
2006
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Who can see it" }),
1991
2007
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: [
1992
2008
  ["open", "Anyone"],
@@ -1996,7 +2012,7 @@ function al({
1996
2012
  "button",
1997
2013
  {
1998
2014
  type: "button",
1999
- onClick: () => E(c),
2015
+ onClick: () => B(c),
2000
2016
  className: g(
2001
2017
  "rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
2002
2018
  S === c ? r.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
@@ -2006,17 +2022,17 @@ function al({
2006
2022
  c
2007
2023
  )) }),
2008
2024
  S === "role" && /* @__PURE__ */ e(
2009
- It,
2025
+ jt,
2010
2026
  {
2011
- value: R,
2012
- onChange: y,
2027
+ value: $,
2028
+ onChange: v,
2013
2029
  className: g(
2014
2030
  "mt-2 h-8 w-full rounded-md px-2 text-[12.5px] outline-none",
2015
2031
  r.input
2016
2032
  ),
2017
2033
  options: [
2018
2034
  { value: "", label: "Choose a role…" },
2019
- ...m.map((c) => ({ value: c.id, label: c.name }))
2035
+ ...p.map((c) => ({ value: c.id, label: c.name }))
2020
2036
  ]
2021
2037
  }
2022
2038
  )
@@ -2026,18 +2042,18 @@ function al({
2026
2042
  "button",
2027
2043
  {
2028
2044
  type: "button",
2029
- disabled: !ue || f.isPending || S === "role" && !R,
2045
+ disabled: !me || f.isPending || S === "role" && !$,
2030
2046
  onClick: () => f.mutate(
2031
- ne ? {
2032
- name: v.trim() || s,
2033
- topic: $.trim() || null,
2047
+ te ? {
2048
+ name: y.trim() || s,
2049
+ topic: A.trim() || null,
2034
2050
  icon: q.icon,
2035
2051
  color: q.color
2036
2052
  } : {
2037
- name: v.trim() || s,
2038
- topic: $.trim() || null,
2053
+ name: y.trim() || s,
2054
+ topic: A.trim() || null,
2039
2055
  visibility: S,
2040
- role: S === "role" ? R : null,
2056
+ role: S === "role" ? $ : null,
2041
2057
  icon: q.icon,
2042
2058
  color: q.color
2043
2059
  }
@@ -2049,19 +2065,19 @@ function al({
2049
2065
  children: f.isPending ? "Saving…" : "Save"
2050
2066
  }
2051
2067
  ),
2052
- ne ? /* @__PURE__ */ e("span", { className: "ml-auto text-[11px] text-slate-400", children: "Open to everyone · cannot be archived" }) : /* @__PURE__ */ e(
2068
+ te ? /* @__PURE__ */ e("span", { className: "ml-auto text-[11px] text-slate-400", children: "Open to everyone · cannot be archived" }) : /* @__PURE__ */ e(
2053
2069
  "button",
2054
2070
  {
2055
2071
  type: "button",
2056
- onClick: () => te(!0),
2057
- disabled: pe,
2072
+ onClick: () => Y(!0),
2073
+ disabled: ee,
2058
2074
  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",
2059
2075
  "data-chat-archive-everyone": !0,
2060
2076
  children: "Archive for everyone"
2061
2077
  }
2062
2078
  )
2063
2079
  ] }),
2064
- pe && !ne && /* @__PURE__ */ a(
2080
+ ee && !te && /* @__PURE__ */ a(
2065
2081
  "div",
2066
2082
  {
2067
2083
  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",
@@ -2101,7 +2117,7 @@ function al({
2101
2117
  "button",
2102
2118
  {
2103
2119
  type: "button",
2104
- onClick: () => te(!1),
2120
+ onClick: () => Y(!1),
2105
2121
  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",
2106
2122
  children: "Cancel"
2107
2123
  }
@@ -2115,53 +2131,53 @@ function al({
2115
2131
  ] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
2116
2132
  n.topic || "No topic set.",
2117
2133
  /* @__PURE__ */ e("br", {}),
2118
- ne ? "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."
2134
+ te ? "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."
2119
2135
  ] }),
2120
2136
  /* @__PURE__ */ a("div", { children: [
2121
2137
  /* @__PURE__ */ a("p", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2122
2138
  "Members ",
2123
2139
  d.length > 0 && `· ${d.length}`
2124
2140
  ] }),
2125
- b && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Loading…" }),
2141
+ x && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Loading…" }),
2126
2142
  d.map((c) => {
2127
2143
  const L = [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email || c.user;
2128
2144
  return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 rounded-lg px-1 py-1", children: [
2129
- /* @__PURE__ */ e(K, { id: c.user, name: L }),
2145
+ /* @__PURE__ */ e(Q, { id: c.user, name: L }),
2130
2146
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: L }),
2131
- le && /* @__PURE__ */ e(
2147
+ oe && /* @__PURE__ */ e(
2132
2148
  "button",
2133
2149
  {
2134
2150
  type: "button",
2135
2151
  title: "Remove from channel",
2136
- onClick: () => x.mutate(c.user),
2152
+ onClick: () => b.mutate(c.user),
2137
2153
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-red-500 dark:hover:bg-muted",
2138
- children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
2154
+ children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
2139
2155
  }
2140
2156
  )
2141
2157
  ] }, c.user);
2142
2158
  }),
2143
- le && S === "private" && /* @__PURE__ */ a("div", { className: "mt-2", children: [
2159
+ oe && S === "private" && /* @__PURE__ */ a("div", { className: "mt-2", children: [
2144
2160
  /* @__PURE__ */ e(
2145
2161
  "input",
2146
2162
  {
2147
- value: W,
2163
+ value: G,
2148
2164
  onChange: (c) => F(c.target.value),
2149
2165
  placeholder: "Add someone…",
2150
2166
  className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
2151
2167
  }
2152
2168
  ),
2153
- W.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: ee.filter((c) => !ae.has(String(c.id).toUpperCase())).map((c) => {
2169
+ G.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: K.filter((c) => !se.has(String(c.id).toUpperCase())).map((c) => {
2154
2170
  const L = [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email || c.id;
2155
2171
  return /* @__PURE__ */ a(
2156
2172
  "button",
2157
2173
  {
2158
2174
  type: "button",
2159
2175
  onClick: () => {
2160
- p.mutate(c.id), F("");
2176
+ u.mutate(c.id), F("");
2161
2177
  },
2162
2178
  className: "flex w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-muted/50",
2163
2179
  children: [
2164
- /* @__PURE__ */ e(K, { id: c.id, name: L }),
2180
+ /* @__PURE__ */ e(Q, { id: c.id, name: L }),
2165
2181
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: L })
2166
2182
  ]
2167
2183
  },
@@ -2170,16 +2186,16 @@ function al({
2170
2186
  }) }),
2171
2187
  /* @__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." })
2172
2188
  ] }),
2173
- le && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Is, { channelId: n.id, th: r }) })
2189
+ oe && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Is, { channelId: n.id, th: r }) })
2174
2190
  ] }),
2175
- le && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Os, { channelId: n.id, border: r.divider }),
2191
+ oe && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Os, { channelId: n.id, border: r.divider }),
2176
2192
  !n.is_direct && /* @__PURE__ */ e(js, { channelId: n.id, th: r })
2177
2193
  ] })
2178
2194
  ] });
2179
2195
  }
2180
- function Ht(n, s) {
2196
+ function mt(n, s) {
2181
2197
  const [l, r] = T(n);
2182
- return X(() => {
2198
+ return ae(() => {
2183
2199
  const o = setTimeout(() => r(n), s);
2184
2200
  return () => clearTimeout(o);
2185
2201
  }, [n, s]), l;
@@ -2188,24 +2204,24 @@ function fa(n) {
2188
2204
  var s;
2189
2205
  return n ? n.kind === "dm" || n.kind === "entity" || n.kind === "channel" && !!((s = n.channel) != null && s.is_direct) : !1;
2190
2206
  }
2191
- const _t = [
2207
+ const St = [
2192
2208
  { value: "recent", label: "Recent activity" },
2193
2209
  { value: "unread", label: "Unread first" },
2194
2210
  { value: "alpha", label: "A–Z" }
2195
2211
  ];
2196
- function zn(n) {
2212
+ function Fn(n) {
2197
2213
  var s;
2198
2214
  return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
2199
2215
  }
2200
- function sl(n, s) {
2201
- const l = (i, m) => i.label.localeCompare(m.label), r = (i, m) => zn(m) - zn(i) || l(i, m), o = [...n];
2202
- return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, m) => +(m.unread > 0) - +(i.unread > 0) || r(i, m)) : o.sort(r);
2216
+ function il(n, s) {
2217
+ const l = (i, p) => i.label.localeCompare(p.label), r = (i, p) => Fn(p) - Fn(i) || l(i, p), o = [...n];
2218
+ return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, p) => +(p.unread > 0) - +(i.unread > 0) || r(i, p)) : o.sort(r);
2203
2219
  }
2204
- function rl({
2220
+ function cl({
2205
2221
  value: n,
2206
2222
  onChange: s
2207
2223
  }) {
2208
- const [l, r] = T(!1), o = _t.find((i) => i.value === n) ?? _t[0];
2224
+ const [l, r] = T(!1), o = St.find((i) => i.value === n) ?? St[0];
2209
2225
  return /* @__PURE__ */ a(Ve, { open: l, onOpenChange: r, children: [
2210
2226
  /* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ e(
2211
2227
  "button",
@@ -2220,7 +2236,7 @@ function rl({
2220
2236
  ) }),
2221
2237
  /* @__PURE__ */ a(et, { align: "end", className: "w-44 p-1", children: [
2222
2238
  /* @__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" }),
2223
- _t.map((i) => /* @__PURE__ */ a(
2239
+ St.map((i) => /* @__PURE__ */ a(
2224
2240
  "button",
2225
2241
  {
2226
2242
  type: "button",
@@ -2231,7 +2247,7 @@ function rl({
2231
2247
  "data-chat-sort-option": i.value,
2232
2248
  children: [
2233
2249
  i.label,
2234
- i.value === n && /* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2250
+ i.value === n && /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2235
2251
  ]
2236
2252
  },
2237
2253
  i.value
@@ -2239,7 +2255,7 @@ function rl({
2239
2255
  ] })
2240
2256
  ] });
2241
2257
  }
2242
- function Hn({
2258
+ function zn({
2243
2259
  rooms: n,
2244
2260
  onOpen: s,
2245
2261
  onNewGroup: l,
@@ -2247,7 +2263,7 @@ function Hn({
2247
2263
  loading: o = !1,
2248
2264
  onView: i
2249
2265
  }) {
2250
- const m = de(), d = Le(), { setMuted: b, leave: f, setArchived: p, setStarred: x } = qt(), v = qs(), U = ve(
2266
+ const p = ue(), d = Le(), { setMuted: x, leave: f, setArchived: u, setStarred: b } = Et(), y = qs(), U = ve(
2251
2267
  () => new Map(
2252
2268
  d.onlineUsers.map((c) => [
2253
2269
  String(c.user_id).toUpperCase(),
@@ -2255,14 +2271,14 @@ function Hn({
2255
2271
  ])
2256
2272
  ),
2257
2273
  [d.onlineUsers]
2258
- ), $ = Wt(), C = Sr(), [S, E] = T(""), R = Ht(S.trim(), 250), { hits: y, meaning: q, loading: A } = Qs(R, v.filters), W = R.length >= 2 || v.active, F = ve(() => {
2274
+ ), A = Wt(), C = Tr(), [S, B] = T(""), $ = mt(S.trim(), 250), { hits: v, meaning: q, loading: J } = Qs($, y.filters), G = $.length >= 2 || y.active, F = ve(() => {
2259
2275
  const c = /* @__PURE__ */ new Map();
2260
- for (const L of y) c.set(L.room, [...c.get(L.room) ?? [], L]);
2261
- return [...c.entries()].sort((L, u) => u[1].length - L[1].length);
2262
- }, [y]), H = n.filter((c) => c.unread > 0 && !c.muted).length, ee = hr(), pe = ve(() => new Map(n.map((c) => [c.room, c])), [n]), te = jt(), ne = Xn(), le = te.chat_sidebar_sort === "unread" || te.chat_sidebar_sort === "alpha" ? te.chat_sidebar_sort : "recent", ae = sl(
2263
- R ? n.filter((c) => c.label.toLowerCase().includes(R.toLowerCase())) : n,
2264
- le
2265
- ), ue = (c) => {
2276
+ for (const L of v) c.set(L.room, [...c.get(L.room) ?? [], L]);
2277
+ return [...c.entries()].sort((L, m) => m[1].length - L[1].length);
2278
+ }, [v]), O = n.filter((c) => c.unread > 0 && !c.muted).length, K = fr(), ee = ve(() => new Map(n.map((c) => [c.room, c])), [n]), Y = qt(), te = Vn(), oe = Y.chat_sidebar_sort === "unread" || Y.chat_sidebar_sort === "alpha" ? Y.chat_sidebar_sort : "recent", se = il(
2279
+ $ ? n.filter((c) => c.label.toLowerCase().includes($.toLowerCase())) : n,
2280
+ oe
2281
+ ), me = (c) => {
2266
2282
  var L;
2267
2283
  return c.kind === "channel" && ((L = c.channel) == null ? void 0 : L.is_direct);
2268
2284
  };
@@ -2272,22 +2288,22 @@ function Hn({
2272
2288
  "input",
2273
2289
  {
2274
2290
  value: S,
2275
- onChange: (c) => E(c.target.value),
2291
+ onChange: (c) => B(c.target.value),
2276
2292
  placeholder: "Search rooms & messages…",
2277
2293
  className: g(
2278
2294
  "h-7 min-w-0 flex-1 rounded-md border px-2 text-[12px] outline-none",
2279
- m.input
2295
+ p.input
2280
2296
  ),
2281
2297
  "aria-label": "Search rooms and messages",
2282
2298
  "data-chat-global-search": !0
2283
2299
  }
2284
2300
  ),
2285
- !r && /* @__PURE__ */ e(Es, { open: v.open, active: v.active, onClick: () => v.setOpen(!v.open) }),
2301
+ !r && /* @__PURE__ */ e(Es, { open: y.open, active: y.active, onClick: () => y.setOpen(!y.open) }),
2286
2302
  /* @__PURE__ */ e(
2287
- rl,
2303
+ cl,
2288
2304
  {
2289
- value: le,
2290
- onChange: (c) => ne.mutate({ chat_sidebar_sort: c === "recent" ? null : c })
2305
+ value: oe,
2306
+ onChange: (c) => te.mutate({ chat_sidebar_sort: c === "recent" ? null : c })
2291
2307
  }
2292
2308
  ),
2293
2309
  !r && /* @__PURE__ */ e(Bs, {}),
@@ -2299,12 +2315,12 @@ function Hn({
2299
2315
  title: "New group conversation",
2300
2316
  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",
2301
2317
  "data-chat-new-group": !0,
2302
- children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2318
+ children: /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2303
2319
  }
2304
2320
  )
2305
2321
  ] }),
2306
- !r && v.open && /* @__PURE__ */ e(Ws, { filters: v.filters, onChange: v.setFilters, rooms: n, th: m }),
2307
- !r && i && !W && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
2322
+ !r && y.open && /* @__PURE__ */ e(Ws, { filters: y.filters, onChange: y.setFilters, rooms: n, th: p }),
2323
+ !r && i && !G && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
2308
2324
  /* @__PURE__ */ a(
2309
2325
  "button",
2310
2326
  {
@@ -2331,74 +2347,74 @@ function Hn({
2331
2347
  ]
2332
2348
  }
2333
2349
  ),
2334
- H > 1 && /* @__PURE__ */ a(
2350
+ O > 1 && /* @__PURE__ */ a(
2335
2351
  "button",
2336
2352
  {
2337
2353
  type: "button",
2338
2354
  onClick: () => i("catchup"),
2339
2355
  className: g(
2340
2356
  "inline-flex h-6 items-center gap-1 rounded-full px-2 text-[11px] font-medium",
2341
- m.accentSoft
2357
+ p.accentSoft
2342
2358
  ),
2343
2359
  "data-chat-view": "catchup",
2344
2360
  children: [
2345
2361
  /* @__PURE__ */ e(Ya, { className: "h-3 w-3" }),
2346
2362
  " Catch up · ",
2347
- H,
2363
+ O,
2348
2364
  " rooms"
2349
2365
  ]
2350
2366
  }
2351
2367
  )
2352
2368
  ] }),
2353
- W && !r && /* @__PURE__ */ a("div", { className: "mb-1.5", "data-chat-search-results": !0, children: [
2369
+ G && !r && /* @__PURE__ */ a("div", { className: "mb-1.5", "data-chat-search-results": !0, children: [
2354
2370
  /* @__PURE__ */ a("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2355
2371
  "Messages",
2356
- y.length ? ` · ${y.length}` : ""
2372
+ v.length ? ` · ${v.length}` : ""
2357
2373
  ] }),
2358
- A ? /* @__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." }) : F.map(([c, L]) => {
2359
- const u = pe.get(c);
2374
+ J ? /* @__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." }) : F.map(([c, L]) => {
2375
+ const m = ee.get(c);
2360
2376
  return /* @__PURE__ */ a("div", { className: "mb-1", "data-chat-search-group": c, children: [
2361
2377
  /* @__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: [
2362
- /* @__PURE__ */ e("span", { className: "truncate", children: (u == null ? void 0 : u.label) ?? c }),
2378
+ /* @__PURE__ */ e("span", { className: "truncate", children: (m == null ? void 0 : m.label) ?? c }),
2363
2379
  /* @__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: L.length })
2364
2380
  ] }),
2365
- L.slice(0, 5).map((J) => /* @__PURE__ */ a(
2381
+ L.slice(0, 5).map((Z) => /* @__PURE__ */ a(
2366
2382
  "button",
2367
2383
  {
2368
2384
  type: "button",
2369
- disabled: !u,
2385
+ disabled: !m,
2370
2386
  onClick: () => {
2371
- u && s(u, { around: J.parent_id ?? J.id });
2387
+ m && s(m, { around: Z.parent_id ?? Z.id });
2372
2388
  },
2373
2389
  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",
2374
- "data-chat-search-hit": J.id,
2390
+ "data-chat-search-hit": Z.id,
2375
2391
  children: [
2376
2392
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5 text-[10.5px] text-slate-400", children: [
2377
- /* @__PURE__ */ e("span", { className: "truncate", children: J.sender_name ?? "Someone" }),
2378
- /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(J.date_created).toLocaleDateString() })
2393
+ /* @__PURE__ */ e("span", { className: "truncate", children: Z.sender_name ?? "Someone" }),
2394
+ /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(Z.date_created).toLocaleDateString() })
2379
2395
  ] }),
2380
- /* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: J.message })
2396
+ /* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: Z.message })
2381
2397
  ]
2382
2398
  },
2383
- J.id
2399
+ Z.id
2384
2400
  )),
2385
- L.length > 5 && u && /* @__PURE__ */ a(
2401
+ L.length > 5 && m && /* @__PURE__ */ a(
2386
2402
  "button",
2387
2403
  {
2388
2404
  type: "button",
2389
- onClick: () => v.setFilters({ ...v.filters, room: c }),
2390
- className: g("px-2.5 py-0.5 text-[11px] font-medium", m.accentText),
2405
+ onClick: () => y.setFilters({ ...y.filters, room: c }),
2406
+ className: g("px-2.5 py-0.5 text-[11px] font-medium", p.accentText),
2391
2407
  children: [
2392
2408
  "All ",
2393
2409
  L.length,
2394
2410
  " in ",
2395
- u.label
2411
+ m.label
2396
2412
  ]
2397
2413
  }
2398
2414
  )
2399
2415
  ] }, c);
2400
2416
  }),
2401
- !A && q === "words" && /* @__PURE__ */ e(
2417
+ !J && q === "words" && /* @__PURE__ */ e(
2402
2418
  "p",
2403
2419
  {
2404
2420
  className: "px-2.5 pb-1 pt-1.5 text-[10.5px] leading-snug text-slate-400",
@@ -2409,13 +2425,13 @@ function Hn({
2409
2425
  ] }),
2410
2426
  r && !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." }),
2411
2427
  r && o && /* @__PURE__ */ e("p", { className: "px-3 py-3 text-[12px] text-slate-400", children: "Loading…" }),
2412
- !r && $.bot_name && $.bot_user_id && d.me && /* @__PURE__ */ a(
2428
+ !r && A.bot_name && A.bot_user_id && d.me && /* @__PURE__ */ a(
2413
2429
  "button",
2414
2430
  {
2415
2431
  type: "button",
2416
2432
  onClick: () => s({
2417
- room: $t(d.me.id, $.bot_user_id),
2418
- label: `@${$.bot_name}`,
2433
+ room: Mt(d.me.id, A.bot_user_id),
2434
+ label: `@${A.bot_name}`,
2419
2435
  kind: "dm",
2420
2436
  lastMessage: null,
2421
2437
  unread: 0,
@@ -2432,7 +2448,7 @@ function Hn({
2432
2448
  {
2433
2449
  className: g(
2434
2450
  "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[13px] font-bold",
2435
- m.accentSoft
2451
+ p.accentSoft
2436
2452
  ),
2437
2453
  children: "@"
2438
2454
  }
@@ -2440,7 +2456,7 @@ function Hn({
2440
2456
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2441
2457
  /* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
2442
2458
  "Ask @",
2443
- $.bot_name
2459
+ A.bot_name
2444
2460
  ] }),
2445
2461
  /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Your AI assistant — questions, summaries, reminders" })
2446
2462
  ] })
@@ -2448,53 +2464,53 @@ function Hn({
2448
2464
  }
2449
2465
  ),
2450
2466
  [
2451
- ["Starred", ae.filter((c) => c.starred)],
2467
+ ["Starred", se.filter((c) => c.starred)],
2452
2468
  [
2453
2469
  "Channels",
2454
- ae.filter(
2455
- (c) => !c.starred && (c.kind === "global" || c.kind === "channel") && !ue(c)
2470
+ se.filter(
2471
+ (c) => !c.starred && (c.kind === "global" || c.kind === "channel") && !me(c)
2456
2472
  )
2457
2473
  ],
2458
2474
  [
2459
2475
  "Direct messages",
2460
- ae.filter((c) => !c.starred && (c.kind === "dm" || ue(c)))
2476
+ se.filter((c) => !c.starred && (c.kind === "dm" || me(c)))
2461
2477
  ],
2462
- ["Records", ae.filter((c) => !c.starred && c.kind === "entity")]
2478
+ ["Records", se.filter((c) => !c.starred && c.kind === "entity")]
2463
2479
  ].map(
2464
2480
  ([c, L]) => L.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mb-1.5", children: [
2465
2481
  /* @__PURE__ */ e("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: c }),
2466
- L.map((u) => {
2467
- var J, Ue, he, Pe, Ne, De;
2482
+ L.map((m) => {
2483
+ var Z, Ue, he, Pe, Ne, De;
2468
2484
  return /* @__PURE__ */ a("div", { className: "group/room relative", children: [
2469
2485
  /* @__PURE__ */ a(
2470
2486
  "button",
2471
2487
  {
2472
2488
  type: "button",
2473
- onClick: () => s(u),
2489
+ onClick: () => s(m),
2474
2490
  className: "flex w-full items-center gap-3 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
2475
2491
  children: [
2476
2492
  (() => {
2477
- const Ce = u.kind === "dm" && d.me ? Se(u.room, d.me.id) : null;
2493
+ const Ce = m.kind === "dm" && d.me ? Se(m.room, d.me.id) : null;
2478
2494
  if (!Ce) return null;
2479
2495
  const k = U.get(Ce.toUpperCase()) ?? "offline";
2480
- return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": k, children: /* @__PURE__ */ e(K, { id: Ce, name: u.label, size: 32 }) });
2496
+ return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": k, children: /* @__PURE__ */ e(Q, { id: Ce, name: m.label, size: 32 }) });
2481
2497
  })(),
2482
- u.kind === "channel" && !((J = u.channel) != null && J.is_direct) || u.kind === "global" && ((Ue = u.channel) != null && Ue.icon || (he = u.channel) != null && he.color) ? /* @__PURE__ */ e(Ye, { icon: (Pe = u.channel) == null ? void 0 : Pe.icon, color: (Ne = u.channel) == null ? void 0 : Ne.color, size: 32 }) : /* @__PURE__ */ e(
2498
+ m.kind === "channel" && !((Z = m.channel) != null && Z.is_direct) || m.kind === "global" && ((Ue = m.channel) != null && Ue.icon || (he = m.channel) != null && he.color) ? /* @__PURE__ */ e(Ye, { icon: (Pe = m.channel) == null ? void 0 : Pe.icon, color: (Ne = m.channel) == null ? void 0 : Ne.color, size: 32 }) : /* @__PURE__ */ e(
2483
2499
  "span",
2484
2500
  {
2485
2501
  className: g(
2486
2502
  "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",
2487
- u.kind === "dm" && d.me && Se(u.room, d.me.id) && "hidden"
2503
+ m.kind === "dm" && d.me && Se(m.room, d.me.id) && "hidden"
2488
2504
  ),
2489
- children: u.kind === "dm" ? /* @__PURE__ */ e(Qn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (De = u.channel) != null && De.is_direct ? /* @__PURE__ */ e(Dt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(Tt, { className: "h-4 w-4", strokeWidth: 1.8 })
2505
+ children: m.kind === "dm" ? /* @__PURE__ */ e(Gn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (De = m.channel) != null && De.is_direct ? /* @__PURE__ */ e($t, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(Ut, { className: "h-4 w-4", strokeWidth: 1.8 })
2490
2506
  }
2491
2507
  ),
2492
2508
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2493
2509
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
2494
- /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u.label }),
2495
- u.muted && /* @__PURE__ */ e(Dn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
2496
- /* @__PURE__ */ e(wr, { count: C.countFor(u.room), label: u.label }),
2497
- ee.has(u.room) && /* @__PURE__ */ e(
2510
+ /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: m.label }),
2511
+ m.muted && /* @__PURE__ */ e(Un, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
2512
+ /* @__PURE__ */ e(Nr, { count: C.countFor(m.room), label: m.label }),
2513
+ K.has(m.room) && /* @__PURE__ */ e(
2498
2514
  Za,
2499
2515
  {
2500
2516
  className: "h-3 w-3 shrink-0 text-slate-400",
@@ -2505,30 +2521,30 @@ function Hn({
2505
2521
  }
2506
2522
  )
2507
2523
  ] }),
2508
- u.lastMessage && /* @__PURE__ */ a("span", { className: "block truncate text-[11px] text-slate-400", children: [
2509
- u.lastMessage.sender_name ? `${u.lastMessage.sender_name}: ` : "",
2510
- u.lastMessage.message
2524
+ m.lastMessage && /* @__PURE__ */ a("span", { className: "block truncate text-[11px] text-slate-400", children: [
2525
+ m.lastMessage.sender_name ? `${m.lastMessage.sender_name}: ` : "",
2526
+ m.lastMessage.message
2511
2527
  ] })
2512
2528
  ] }),
2513
- (u.mentions ?? 0) > 0 && /* @__PURE__ */ e(
2529
+ (m.mentions ?? 0) > 0 && /* @__PURE__ */ e(
2514
2530
  "span",
2515
2531
  {
2516
2532
  className: "flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white",
2517
- title: `${u.mentions} mention you`,
2518
- "data-chat-room-mentions": u.mentions,
2533
+ title: `${m.mentions} mention you`,
2534
+ "data-chat-room-mentions": m.mentions,
2519
2535
  children: "@"
2520
2536
  }
2521
2537
  ),
2522
- u.unread > 0 && /* @__PURE__ */ e(
2538
+ m.unread > 0 && /* @__PURE__ */ e(
2523
2539
  "span",
2524
2540
  {
2525
2541
  className: g(
2526
2542
  "flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-1.5 text-[10px] font-bold",
2527
2543
  // A muted room still counts, but quietly — it must not
2528
2544
  // read like something demanding attention.
2529
- u.muted ? "bg-slate-100 text-slate-400 dark:bg-muted dark:text-slate-500" : m.pill
2545
+ m.muted ? "bg-slate-100 text-slate-400 dark:bg-muted dark:text-slate-500" : p.pill
2530
2546
  ),
2531
- children: u.unread > 99 ? "99+" : u.unread
2547
+ children: m.unread > 99 ? "99+" : m.unread
2532
2548
  }
2533
2549
  )
2534
2550
  ]
@@ -2539,26 +2555,26 @@ function Hn({
2539
2555
  "button",
2540
2556
  {
2541
2557
  type: "button",
2542
- title: u.starred ? "Unstar" : "Star — keep it at the top",
2543
- "aria-label": u.starred ? `Unstar ${u.label}` : `Star ${u.label}`,
2544
- onClick: () => x.mutate({ room: u.room, starred: !u.starred }),
2558
+ title: m.starred ? "Unstar" : "Star — keep it at the top",
2559
+ "aria-label": m.starred ? `Unstar ${m.label}` : `Star ${m.label}`,
2560
+ onClick: () => b.mutate({ room: m.room, starred: !m.starred }),
2545
2561
  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",
2546
- "data-chat-row-star": u.starred ? "on" : "off",
2562
+ "data-chat-row-star": m.starred ? "on" : "off",
2547
2563
  children: /* @__PURE__ */ e(
2548
2564
  Va,
2549
2565
  {
2550
- className: g("h-3 w-3", u.starred && "fill-amber-400 text-amber-500")
2566
+ className: g("h-3 w-3", m.starred && "fill-amber-400 text-amber-500")
2551
2567
  }
2552
2568
  )
2553
2569
  }
2554
2570
  ),
2555
- fa(u) && /* @__PURE__ */ e(
2571
+ fa(m) && /* @__PURE__ */ e(
2556
2572
  "button",
2557
2573
  {
2558
2574
  type: "button",
2559
2575
  title: r ? "Unarchive — back to your chats" : "Archive for me — hides it from my list and stops my alerts. Others in the conversation are not affected.",
2560
- "aria-label": r ? `Unarchive ${u.label}` : `Archive ${u.label} for me`,
2561
- onClick: () => p.mutate({ room: u.room, archived: !r }),
2576
+ "aria-label": r ? `Unarchive ${m.label}` : `Archive ${m.label} for me`,
2577
+ onClick: () => u.mutate({ room: m.room, archived: !r }),
2562
2578
  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",
2563
2579
  "data-chat-row-archive": r ? "unarchive" : "archive",
2564
2580
  children: r ? /* @__PURE__ */ e(Xa, { className: "h-3 w-3" }) : /* @__PURE__ */ e(es, { className: "h-3 w-3" })
@@ -2568,66 +2584,66 @@ function Hn({
2568
2584
  "button",
2569
2585
  {
2570
2586
  type: "button",
2571
- title: u.muted ? "Unmute" : "Mute",
2572
- onClick: () => b.mutate({ room: u.room, muted: !u.muted }),
2587
+ title: m.muted ? "Unmute" : "Mute",
2588
+ onClick: () => x.mutate({ room: m.room, muted: !m.muted }),
2573
2589
  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",
2574
- children: u.muted ? /* @__PURE__ */ e(ts, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Dn, { className: "h-3 w-3" })
2590
+ children: m.muted ? /* @__PURE__ */ e(ts, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Un, { className: "h-3 w-3" })
2575
2591
  }
2576
2592
  ),
2577
- (u.kind === "channel" || u.kind === "global" || u.kind === "entity") && u.joined && /* @__PURE__ */ e(
2593
+ (m.kind === "channel" || m.kind === "global" || m.kind === "entity") && m.joined && /* @__PURE__ */ e(
2578
2594
  "button",
2579
2595
  {
2580
2596
  type: "button",
2581
- title: u.kind === "global" ? "Leave General" : u.kind === "entity" ? "Leave this record's chat — open it from the record again to rejoin" : "Leave channel",
2582
- "aria-label": `Leave ${u.label}`,
2597
+ title: m.kind === "global" ? "Leave General" : m.kind === "entity" ? "Leave this record's chat — open it from the record again to rejoin" : "Leave channel",
2598
+ "aria-label": `Leave ${m.label}`,
2583
2599
  "data-chat-row-leave": !0,
2584
- onClick: () => f.mutate(u.room),
2600
+ onClick: () => f.mutate(m.room),
2585
2601
  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",
2586
2602
  children: /* @__PURE__ */ e(ns, { className: "h-3 w-3" })
2587
2603
  }
2588
2604
  )
2589
2605
  ] })
2590
- ] }, u.room);
2606
+ ] }, m.room);
2591
2607
  })
2592
2608
  ] }, c)
2593
2609
  )
2594
2610
  ] });
2595
2611
  }
2596
- function uo({
2612
+ function xo({
2597
2613
  view: n,
2598
2614
  rooms: s,
2599
2615
  onBack: l,
2600
2616
  onOpen: r
2601
2617
  }) {
2602
- const o = de();
2603
- return n === "mentions" ? /* @__PURE__ */ e(Yn, { th: o, onBack: l, onOpen: r }) : n === "scheduled" ? /* @__PURE__ */ e(
2604
- Zn,
2618
+ const o = ue();
2619
+ return n === "mentions" ? /* @__PURE__ */ e(Jn, { th: o, onBack: l, onOpen: r }) : n === "scheduled" ? /* @__PURE__ */ e(
2620
+ Yn,
2605
2621
  {
2606
2622
  th: o,
2607
2623
  onBack: l,
2608
2624
  roomLabel: (i) => {
2609
- var m;
2610
- return ((m = s.find((d) => d.room === i)) == null ? void 0 : m.label) ?? i;
2625
+ var p;
2626
+ return ((p = s.find((d) => d.room === i)) == null ? void 0 : p.label) ?? i;
2611
2627
  }
2612
2628
  }
2613
- ) : /* @__PURE__ */ e(Vn, { rooms: s, th: o, onBack: l, onOpen: r });
2629
+ ) : /* @__PURE__ */ e(Zn, { rooms: s, th: o, onBack: l, onOpen: r });
2614
2630
  }
2615
- function ll({
2631
+ function dl({
2616
2632
  onOpen: n
2617
2633
  }) {
2618
- const s = de(), [l, r] = T(""), [o, i] = T(!1), [m, d] = T(""), [b, f] = T("open"), [p, x] = T(""), [v, U] = T({
2634
+ const s = ue(), [l, r] = T(""), [o, i] = T(!1), [p, d] = T(""), [x, f] = T("open"), [u, b] = T(""), [y, U] = T({
2619
2635
  icon: null,
2620
2636
  color: null
2621
- }), $ = ea(), { channels: C, loading: S } = zs(l), { join: E } = qt(), R = Hs();
2637
+ }), A = Xn(), { channels: C, loading: S } = zs(l), { join: B } = Et(), $ = Hs();
2622
2638
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
2623
2639
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
2624
2640
  /* @__PURE__ */ a("div", { className: "relative flex-1", children: [
2625
- /* @__PURE__ */ e(Gn, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
2641
+ /* @__PURE__ */ e(Hn, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
2626
2642
  /* @__PURE__ */ e(
2627
2643
  "input",
2628
2644
  {
2629
2645
  value: l,
2630
- onChange: (y) => r(y.target.value),
2646
+ onChange: (v) => r(v.target.value),
2631
2647
  placeholder: "Search channels…",
2632
2648
  className: g("h-8 w-full rounded-md pl-8 pr-2 text-[12.5px] outline-none", s.input)
2633
2649
  }
@@ -2637,7 +2653,7 @@ function ll({
2637
2653
  "button",
2638
2654
  {
2639
2655
  type: "button",
2640
- onClick: () => i((y) => !y),
2656
+ onClick: () => i((v) => !v),
2641
2657
  className: g(
2642
2658
  "flex h-8 shrink-0 items-center gap-1 rounded-md px-2.5 text-[12px] font-medium",
2643
2659
  s.action
@@ -2653,14 +2669,14 @@ function ll({
2653
2669
  "form",
2654
2670
  {
2655
2671
  className: "flex flex-col gap-2 border-b border-slate-100 p-2 dark:border-border/60",
2656
- onSubmit: (y) => {
2657
- y.preventDefault(), m.trim() && (b === "role" && !p || R.mutate(
2672
+ onSubmit: (v) => {
2673
+ v.preventDefault(), p.trim() && (x === "role" && !u || $.mutate(
2658
2674
  {
2659
- name: m.trim(),
2660
- visibility: b,
2661
- role: b === "role" ? p : null,
2662
- icon: v.icon,
2663
- color: v.color
2675
+ name: p.trim(),
2676
+ visibility: x,
2677
+ role: x === "role" ? u : null,
2678
+ icon: y.icon,
2679
+ color: y.color
2664
2680
  },
2665
2681
  {
2666
2682
  onSuccess: () => {
@@ -2671,12 +2687,12 @@ function ll({
2671
2687
  },
2672
2688
  children: [
2673
2689
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2674
- /* @__PURE__ */ e(Ye, { icon: v.icon, color: v.color, size: 32 }),
2690
+ /* @__PURE__ */ e(Ye, { icon: y.icon, color: y.color, size: 32 }),
2675
2691
  /* @__PURE__ */ e(
2676
2692
  "input",
2677
2693
  {
2678
- value: m,
2679
- onChange: (y) => d(y.target.value),
2694
+ value: p,
2695
+ onChange: (v) => d(v.target.value),
2680
2696
  placeholder: "Channel name",
2681
2697
  className: g(
2682
2698
  "h-8 min-w-0 flex-1 rounded-md px-2 text-[12.5px] outline-none",
@@ -2685,59 +2701,59 @@ function ll({
2685
2701
  }
2686
2702
  )
2687
2703
  ] }),
2688
- /* @__PURE__ */ e(Jn, { icon: v.icon, color: v.color, onChange: U }),
2704
+ /* @__PURE__ */ e(Kn, { icon: y.icon, color: y.color, onChange: U }),
2689
2705
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2690
2706
  [
2691
2707
  ["open", "Anyone"],
2692
2708
  ["role", "One role"],
2693
2709
  ["private", "Invite only"]
2694
- ].map(([y, q]) => /* @__PURE__ */ e(
2710
+ ].map(([v, q]) => /* @__PURE__ */ e(
2695
2711
  "button",
2696
2712
  {
2697
2713
  type: "button",
2698
- onClick: () => f(y),
2714
+ onClick: () => f(v),
2699
2715
  className: g(
2700
2716
  "rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
2701
- b === y ? s.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2717
+ x === v ? s.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2702
2718
  ),
2703
2719
  children: q
2704
2720
  },
2705
- y
2721
+ v
2706
2722
  )),
2707
2723
  /* @__PURE__ */ e(
2708
2724
  "button",
2709
2725
  {
2710
2726
  type: "submit",
2711
- disabled: !m.trim() || R.isPending || b === "role" && !p,
2727
+ disabled: !p.trim() || $.isPending || x === "role" && !u,
2712
2728
  className: g("ml-auto rounded-md px-2.5 py-1 text-[12px] font-medium", s.action),
2713
- children: R.isPending ? "Creating…" : "Create"
2729
+ children: $.isPending ? "Creating…" : "Create"
2714
2730
  }
2715
2731
  )
2716
2732
  ] }),
2717
- b === "role" && /* @__PURE__ */ e(
2718
- It,
2733
+ x === "role" && /* @__PURE__ */ e(
2734
+ jt,
2719
2735
  {
2720
- value: p,
2721
- onChange: x,
2736
+ value: u,
2737
+ onChange: b,
2722
2738
  className: g("h-8 w-auto rounded-md px-2 text-[12.5px] outline-none", s.input),
2723
2739
  options: [
2724
2740
  { value: "", label: "Choose a role…" },
2725
- ...$.map((y) => ({ value: y.id, label: y.name }))
2741
+ ...A.map((v) => ({ value: v.id, label: v.name }))
2726
2742
  ]
2727
2743
  }
2728
2744
  ),
2729
- R.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: R.error.message })
2745
+ $.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: $.error.message })
2730
2746
  ]
2731
2747
  }
2732
2748
  ),
2733
2749
  /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", children: [
2734
2750
  S && /* @__PURE__ */ e("p", { className: "px-2 py-6 text-center text-[12px] text-slate-400", children: "Loading…" }),
2735
2751
  !S && C.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-8 text-center", children: [
2736
- /* @__PURE__ */ e(Tt, { className: "mx-auto h-5 w-5 text-slate-300" }),
2752
+ /* @__PURE__ */ e(Ut, { className: "mx-auto h-5 w-5 text-slate-300" }),
2737
2753
  /* @__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" }),
2738
2754
  /* @__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." })
2739
2755
  ] }),
2740
- C.map((y) => /* @__PURE__ */ a(
2756
+ C.map((v) => /* @__PURE__ */ a(
2741
2757
  "div",
2742
2758
  {
2743
2759
  className: "flex items-center gap-2.5 rounded-lg px-2.5 py-2 hover:bg-slate-50 dark:hover:bg-muted/50",
@@ -2745,21 +2761,21 @@ function ll({
2745
2761
  /* @__PURE__ */ e(
2746
2762
  Ye,
2747
2763
  {
2748
- icon: y.icon,
2749
- color: y.color,
2764
+ icon: v.icon,
2765
+ color: v.color,
2750
2766
  size: 32,
2751
- fallback: y.visibility === "private" ? za : Tt
2767
+ fallback: v.visibility === "private" ? za : Ut
2752
2768
  }
2753
2769
  ),
2754
2770
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2755
- /* @__PURE__ */ e("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: y.name }),
2756
- /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: y.topic || `${y.members} member${y.members === 1 ? "" : "s"}` })
2771
+ /* @__PURE__ */ e("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: v.name }),
2772
+ /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: v.topic || `${v.members} member${v.members === 1 ? "" : "s"}` })
2757
2773
  ] }),
2758
- y.joined ? /* @__PURE__ */ e(
2774
+ v.joined ? /* @__PURE__ */ e(
2759
2775
  "button",
2760
2776
  {
2761
2777
  type: "button",
2762
- onClick: () => n(y.room, y.name, Wn(y)),
2778
+ onClick: () => n(v.room, v.name, Bn(v)),
2763
2779
  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",
2764
2780
  children: "Open"
2765
2781
  }
@@ -2767,8 +2783,8 @@ function ll({
2767
2783
  "button",
2768
2784
  {
2769
2785
  type: "button",
2770
- onClick: () => E.mutate(y.room, {
2771
- onSuccess: () => n(y.room, y.name, Wn(y))
2786
+ onClick: () => B.mutate(v.room, {
2787
+ onSuccess: () => n(v.room, v.name, Bn(v))
2772
2788
  }),
2773
2789
  className: g("shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium", s.action),
2774
2790
  children: "Join"
@@ -2776,25 +2792,25 @@ function ll({
2776
2792
  )
2777
2793
  ]
2778
2794
  },
2779
- y.key
2795
+ v.key
2780
2796
  ))
2781
2797
  ] })
2782
2798
  ] });
2783
2799
  }
2784
- function ol() {
2800
+ function ul() {
2785
2801
  const n = /* @__PURE__ */ new Date();
2786
2802
  return n.setHours(23, 59, 59, 999), n;
2787
2803
  }
2788
- function il() {
2789
- const n = jt(), s = Xn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), m = (b) => {
2804
+ function ml() {
2805
+ const n = qt(), s = Vn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), p = (x) => {
2790
2806
  s.mutate({
2791
- presence_override: b === "off" ? null : { mode: "away", until: (b == null ? void 0 : b.toISOString()) ?? null }
2807
+ presence_override: x === "off" ? null : { mode: "away", until: (x == null ? void 0 : x.toISOString()) ?? null }
2792
2808
  }), r(!1);
2793
2809
  }, d = i && (o != null && o.until) ? `until ${new Date(o.until).toLocaleString("en-US", {
2794
2810
  weekday: "short",
2795
2811
  hour: "numeric",
2796
2812
  minute: "2-digit",
2797
- timeZone: Lt() ?? void 0
2813
+ timeZone: Pt() ?? void 0
2798
2814
  })}` : i ? "until you switch it off" : null;
2799
2815
  return /* @__PURE__ */ a(
2800
2816
  "div",
@@ -2817,7 +2833,7 @@ function il() {
2817
2833
  "button",
2818
2834
  {
2819
2835
  type: "button",
2820
- onClick: () => m("off"),
2836
+ onClick: () => p("off"),
2821
2837
  className: "shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
2822
2838
  "data-chat-appear-away-off": !0,
2823
2839
  children: "Back online"
@@ -2837,18 +2853,18 @@ function il() {
2837
2853
  [
2838
2854
  ["1 hour", () => new Date(Date.now() + 36e5)],
2839
2855
  ["4 hours", () => new Date(Date.now() + 4 * 36e5)],
2840
- ["The rest of today", ol],
2856
+ ["The rest of today", ul],
2841
2857
  ["Until I switch it off", () => null]
2842
- ].map(([b, f]) => /* @__PURE__ */ e(
2858
+ ].map(([x, f]) => /* @__PURE__ */ e(
2843
2859
  "button",
2844
2860
  {
2845
2861
  type: "button",
2846
- onClick: () => m(f()),
2862
+ onClick: () => p(f()),
2847
2863
  className: "flex w-full rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
2848
- "data-chat-appear-away-option": b,
2849
- children: b
2864
+ "data-chat-appear-away-option": x,
2865
+ children: x
2850
2866
  },
2851
- b
2867
+ x
2852
2868
  ))
2853
2869
  ] })
2854
2870
  ] })
@@ -2856,8 +2872,8 @@ function il() {
2856
2872
  }
2857
2873
  );
2858
2874
  }
2859
- function cl({ myStatus: n }) {
2860
- const s = de();
2875
+ function pl({ myStatus: n }) {
2876
+ const s = ue();
2861
2877
  return /* @__PURE__ */ e(
2862
2878
  Ts,
2863
2879
  {
@@ -2868,7 +2884,7 @@ function cl({ myStatus: n }) {
2868
2884
  );
2869
2885
  }
2870
2886
  function xa() {
2871
- var i, m, d;
2887
+ var i, p, d;
2872
2888
  const n = Ze(), s = Cs(15e3), { data: l, isFetched: r } = Te({
2873
2889
  queryKey: ["presence-online"],
2874
2890
  queryFn: () => n.request(ye("/presence/online")),
@@ -2879,12 +2895,12 @@ function xa() {
2879
2895
  });
2880
2896
  return {
2881
2897
  byUser: ve(() => {
2882
- const b = /* @__PURE__ */ new Map();
2883
- for (const f of (l == null ? void 0 : l.data) ?? []) b.set(String(f.user_id).toUpperCase(), f);
2884
- return b;
2898
+ const x = /* @__PURE__ */ new Map();
2899
+ for (const f of (l == null ? void 0 : l.data) ?? []) x.set(String(f.user_id).toUpperCase(), f);
2900
+ return x;
2885
2901
  }, [l]),
2886
2902
  fields: ((i = l == null ? void 0 : l.config) == null ? void 0 : i.fields) ?? ["role", "page"],
2887
- adminUrl: ((m = l == null ? void 0 : l.config) == null ? void 0 : m.admin_url) ?? null,
2903
+ adminUrl: ((p = l == null ? void 0 : l.config) == null ? void 0 : p.admin_url) ?? null,
2888
2904
  dimensions: ((d = l == null ? void 0 : l.config) == null ? void 0 : d.dimensions) ?? [],
2889
2905
  loaded: r
2890
2906
  };
@@ -2894,13 +2910,13 @@ function ba(n) {
2894
2910
  const s = n.split("/").filter(Boolean);
2895
2911
  if (s.length === 0) return "Home";
2896
2912
  const l = /* @__PURE__ */ new Set(["records", "collections", "p"]), r = s.filter((o) => !l.has(o));
2897
- return r.length === 0 ? "Home" : r.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (m) => m.toUpperCase()) : o).join(" › ");
2913
+ return r.length === 0 ? "Home" : r.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (p) => p.toUpperCase()) : o).join(" › ");
2898
2914
  }
2899
- function dl({
2915
+ function hl({
2900
2916
  onClose: n,
2901
2917
  onCreated: s
2902
2918
  }) {
2903
- const l = de(), [r, o] = T(""), [i, m] = T(""), [d, b] = T(/* @__PURE__ */ new Map()), { users: f } = Bt(r, !0), p = dr(), x = (v) => [v.first_name, v.last_name].filter(Boolean).join(" ") || (v.email ?? "Unknown");
2919
+ const l = ue(), [r, o] = T(""), [i, p] = T(""), [d, x] = T(/* @__PURE__ */ new Map()), { users: f } = Bt(r, !0), u = dr(), b = (y) => [y.first_name, y.last_name].filter(Boolean).join(" ") || (y.email ?? "Unknown");
2904
2920
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
2905
2921
  /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
2906
2922
  /* @__PURE__ */ e(
@@ -2915,7 +2931,7 @@ function dl({
2915
2931
  ),
2916
2932
  /* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "New group conversation" })
2917
2933
  ] }),
2918
- d.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...d.entries()].map(([v, U]) => /* @__PURE__ */ a(
2934
+ d.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...d.entries()].map(([y, U]) => /* @__PURE__ */ a(
2919
2935
  "span",
2920
2936
  {
2921
2937
  className: g(
@@ -2928,57 +2944,57 @@ function dl({
2928
2944
  "button",
2929
2945
  {
2930
2946
  type: "button",
2931
- onClick: () => b(($) => {
2932
- const C = new Map($);
2933
- return C.delete(v), C;
2947
+ onClick: () => x((A) => {
2948
+ const C = new Map(A);
2949
+ return C.delete(y), C;
2934
2950
  }),
2935
2951
  "aria-label": `Remove ${U}`,
2936
- children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
2952
+ children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
2937
2953
  }
2938
2954
  )
2939
2955
  ]
2940
2956
  },
2941
- v
2957
+ y
2942
2958
  )) }),
2943
2959
  /* @__PURE__ */ e(
2944
2960
  "input",
2945
2961
  {
2946
2962
  value: r,
2947
- onChange: (v) => o(v.target.value),
2963
+ onChange: (y) => o(y.target.value),
2948
2964
  placeholder: "Find people…",
2949
2965
  className: g("mb-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none", l.input),
2950
2966
  "aria-label": "Find people",
2951
2967
  autoFocus: !0
2952
2968
  }
2953
2969
  ),
2954
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((v) => {
2955
- const U = d.has(v.id);
2970
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((y) => {
2971
+ const U = d.has(y.id);
2956
2972
  return /* @__PURE__ */ a(
2957
2973
  "button",
2958
2974
  {
2959
2975
  type: "button",
2960
- onClick: () => b(($) => {
2961
- const C = new Map($);
2962
- return U ? C.delete(v.id) : C.set(v.id, x(v)), C;
2976
+ onClick: () => x((A) => {
2977
+ const C = new Map(A);
2978
+ return U ? C.delete(y.id) : C.set(y.id, b(y)), C;
2963
2979
  }),
2964
2980
  className: g(
2965
2981
  "flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[12.5px] transition-colors",
2966
2982
  U ? l.accentSoft : "hover:bg-slate-50 dark:hover:bg-muted/50"
2967
2983
  ),
2968
2984
  children: [
2969
- /* @__PURE__ */ e(K, { id: v.id, name: x(v), size: 22 }),
2970
- /* @__PURE__ */ e("span", { className: "truncate", children: x(v) }),
2971
- U && /* @__PURE__ */ e(Ot, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
2985
+ /* @__PURE__ */ e(Q, { id: y.id, name: b(y), size: 22 }),
2986
+ /* @__PURE__ */ e("span", { className: "truncate", children: b(y) }),
2987
+ U && /* @__PURE__ */ e(Lt, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
2972
2988
  ]
2973
2989
  },
2974
- v.id
2990
+ y.id
2975
2991
  );
2976
2992
  }) }),
2977
2993
  /* @__PURE__ */ e(
2978
2994
  "input",
2979
2995
  {
2980
2996
  value: i,
2981
- onChange: (v) => m(v.target.value),
2997
+ onChange: (y) => p(y.target.value),
2982
2998
  placeholder: "Group name (optional)",
2983
2999
  className: g(
2984
3000
  "mb-2 mt-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none",
@@ -2991,36 +3007,36 @@ function dl({
2991
3007
  "button",
2992
3008
  {
2993
3009
  type: "button",
2994
- disabled: d.size === 0 || p.isPending,
2995
- onClick: () => p.mutate(
3010
+ disabled: d.size === 0 || u.isPending,
3011
+ onClick: () => u.mutate(
2996
3012
  { user_ids: [...d.keys()], name: i.trim() || void 0 },
2997
- { onSuccess: (v) => s(v.room, v.name) }
3013
+ { onSuccess: (y) => s(y.room, y.name) }
2998
3014
  ),
2999
3015
  className: g(
3000
3016
  "flex h-9 items-center justify-center rounded-lg text-[12.5px] font-semibold transition-[filter] hover:brightness-110 disabled:opacity-40",
3001
3017
  l.action
3002
3018
  ),
3003
- children: p.isPending ? "Creating…" : `Start conversation${d.size ? ` (${d.size + 1})` : ""}`
3019
+ children: u.isPending ? "Creating…" : `Start conversation${d.size ? ` (${d.size + 1})` : ""}`
3004
3020
  }
3005
3021
  )
3006
3022
  ] });
3007
3023
  }
3008
- const Rt = "nvr-chat-pinned", St = 400;
3009
- function ul() {
3024
+ const Rt = "nvr-chat-pinned", Tt = 400;
3025
+ function fl() {
3010
3026
  try {
3011
3027
  return typeof window < "u" && window.localStorage.getItem(Rt) === "1";
3012
3028
  } catch {
3013
3029
  return !1;
3014
3030
  }
3015
3031
  }
3016
- function ml() {
3032
+ function xl() {
3017
3033
  const n = "(min-width: 1024px)", [s, l] = T(
3018
3034
  () => {
3019
3035
  var r;
3020
3036
  return typeof window < "u" && !!((r = window.matchMedia) != null && r.call(window, n).matches);
3021
3037
  }
3022
3038
  );
3023
- return X(() => {
3039
+ return ae(() => {
3024
3040
  var i;
3025
3041
  const r = (i = window.matchMedia) == null ? void 0 : i.call(window, n);
3026
3042
  if (!r) return;
@@ -3028,7 +3044,7 @@ function ml() {
3028
3044
  return r.addEventListener("change", o), () => r.removeEventListener("change", o);
3029
3045
  }, []), s;
3030
3046
  }
3031
- function mo({
3047
+ function bo({
3032
3048
  open: n,
3033
3049
  onClose: s,
3034
3050
  renderMessageBody: l,
@@ -3036,104 +3052,104 @@ function mo({
3036
3052
  requestedRoom: o
3037
3053
  }) {
3038
3054
  var Ce;
3039
- const i = Le(), m = de(), d = i.me, [b, f] = T(ul), p = ml(), x = b && p, v = () => {
3040
- const k = !b;
3055
+ const i = Le(), p = ue(), d = i.me, [x, f] = T(fl), u = xl(), b = x && u, y = () => {
3056
+ const k = !x;
3041
3057
  f(k);
3042
3058
  try {
3043
3059
  k ? window.localStorage.setItem(Rt, "1") : window.localStorage.removeItem(Rt);
3044
3060
  } catch {
3045
3061
  }
3046
3062
  };
3047
- X(() => {
3048
- if (!n || !x) return;
3063
+ ae(() => {
3064
+ if (!n || !b) return;
3049
3065
  const k = document.body, M = k.style.paddingRight;
3050
- k.style.paddingRight = `${St}px`, k.dataset.nvrChatPinned = "1";
3066
+ k.style.paddingRight = `${Tt}px`, k.dataset.nvrChatPinned = "1";
3051
3067
  const P = document.createElement("style");
3052
3068
  return P.dataset.nvrChatPinnedStyle = "", P.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
3053
- body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${St}px; }`, document.head.appendChild(P), () => {
3069
+ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, document.head.appendChild(P), () => {
3054
3070
  k.style.paddingRight = M, delete k.dataset.nvrChatPinned, P.remove();
3055
3071
  };
3056
- }, [n, x]);
3057
- const [U, $] = T("online"), [C, S] = T(null), [E, R] = T(null), y = (k, M, P) => {
3058
- const Y = pe.find(($e) => $e.room === k);
3059
- F(!1), S({ room: k, label: (Y == null ? void 0 : Y.label) ?? M, channel: Y == null ? void 0 : Y.channel, anchor: P });
3060
- }, [q, A] = T(!1), [W, F] = T(!1), [H, ee] = T(null), { rooms: pe, totalUnread: te } = aa(), ne = sa(U === "archived"), le = (k, M, P) => {
3072
+ }, [n, b]);
3073
+ const [U, A] = T("online"), [C, S] = T(null), [B, $] = T(null), v = (k, M, P) => {
3074
+ const V = ee.find(($e) => $e.room === k);
3075
+ F(!1), S({ room: k, label: (V == null ? void 0 : V.label) ?? M, channel: V == null ? void 0 : V.channel, anchor: P });
3076
+ }, [q, J] = T(!1), [G, F] = T(!1), [O, K] = T(null), { rooms: ee, totalUnread: Y } = aa(), te = sa(U === "archived"), oe = (k, M, P) => {
3061
3077
  var $e, _;
3062
3078
  if (!M) return [{ key: "all", label: null, users: k }];
3063
- const Y = /* @__PURE__ */ new Map();
3079
+ const V = /* @__PURE__ */ new Map();
3064
3080
  for (const I of k) {
3065
- const j = P.get(String(I.user_id).toUpperCase()), oe = M === "__role__" ? [Fn((j == null ? void 0 : j.role_name) ?? I.role_name) || "No role"] : (_ = ($e = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : $e[M]) != null && _.length ? j.scopes_by_dimension[M] : ["Unassigned"], V = [...new Set(oe)].sort((Z, G) => Z.localeCompare(G)).join(", ");
3066
- Y.set(V, [...Y.get(V) ?? [], I]);
3081
+ const j = P.get(String(I.user_id).toUpperCase()), ie = M === "__role__" ? [Wn((j == null ? void 0 : j.role_name) ?? I.role_name) || "No role"] : (_ = ($e = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : $e[M]) != null && _.length ? j.scopes_by_dimension[M] : ["Unassigned"], ne = [...new Set(ie)].sort((X, z) => X.localeCompare(z)).join(", ");
3082
+ V.set(ne, [...V.get(ne) ?? [], I]);
3067
3083
  }
3068
- return [...Y.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 }));
3069
- }, [ae, ue] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c = xa(), L = c.loaded ? Gs(
3084
+ return [...V.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 }));
3085
+ }, [se, me] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c = xa(), L = c.loaded ? Gs(
3070
3086
  i.onlineUsers.filter((k) => c.byUser.has(String(k.user_id).toUpperCase()))
3071
- ) : [], u = ve(
3072
- () => le(L, ae, c.byUser),
3087
+ ) : [], m = ve(
3088
+ () => oe(L, se, c.byUser),
3073
3089
  // biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
3074
- [L, ae, c.byUser]
3075
- ), { isAdmin: J } = pt(), { navigate: Ue } = vs(), he = (k) => {
3090
+ [L, se, c.byUser]
3091
+ ), { isAdmin: Z } = ht(), { navigate: Ue } = vs(), he = (k) => {
3076
3092
  /^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") : Ue(k);
3077
3093
  }, Pe = (k) => {
3078
- d && ($("chat"), S({ room: $t(d.id, k.user_id), label: k.display_name ?? "Direct message" }));
3079
- }, Ne = ce(0);
3080
- X(() => {
3081
- !r || !d || r.nonce === Ne.current || (Ne.current = r.nonce, $("chat"), F(!1), S({
3082
- room: $t(d.id, r.userId),
3094
+ d && (A("chat"), S({ room: Mt(d.id, k.user_id), label: k.display_name ?? "Direct message" }));
3095
+ }, Ne = de(0);
3096
+ ae(() => {
3097
+ !r || !d || r.nonce === Ne.current || (Ne.current = r.nonce, A("chat"), F(!1), S({
3098
+ room: Mt(d.id, r.userId),
3083
3099
  label: r.name ?? "Direct message"
3084
3100
  }));
3085
3101
  }, [r, d]);
3086
- const De = ce(0);
3087
- return X(() => {
3088
- !o || o.nonce === De.current || (De.current = o.nonce, $("chat"), F(!1), S({ room: o.room, label: o.label ?? o.room }));
3102
+ const De = de(0);
3103
+ return ae(() => {
3104
+ !o || o.nonce === De.current || (De.current = o.nonce, A("chat"), F(!1), S({ room: o.room, label: o.label ?? o.room }));
3089
3105
  }, [o]), n ? /* @__PURE__ */ a(
3090
3106
  "div",
3091
3107
  {
3092
- className: x ? (
3108
+ className: b ? (
3093
3109
  // No backdrop: the rest of the page stays usable.
3094
3110
  "pointer-events-none fixed inset-y-0 right-0 z-40"
3095
3111
  ) : "fixed inset-0 z-40 bg-black/40 animate-in fade-in duration-150",
3096
- style: x ? { width: St } : void 0,
3097
- onClick: x ? void 0 : s,
3112
+ style: b ? { width: Tt } : void 0,
3113
+ onClick: b ? void 0 : s,
3098
3114
  "data-chat-panel": !0,
3099
3115
  "data-nvr-recording-hide": !0,
3100
- "data-chat-pinned": x ? "1" : void 0,
3116
+ "data-chat-pinned": b ? "1" : void 0,
3101
3117
  children: [
3102
- /* @__PURE__ */ e(On, {}),
3118
+ /* @__PURE__ */ e(Rn, {}),
3103
3119
  /* @__PURE__ */ a(
3104
3120
  "aside",
3105
3121
  {
3106
3122
  className: g(
3107
3123
  "pointer-events-auto absolute right-0 top-0 flex h-full w-full flex-col border-l",
3108
- x ? "max-w-none" : "max-w-[400px] shadow-2xl animate-in slide-in-from-right duration-200",
3109
- m.surface,
3124
+ b ? "max-w-none" : "max-w-[400px] shadow-2xl animate-in slide-in-from-right duration-200",
3125
+ p.surface,
3110
3126
  "border-slate-200 dark:border-border"
3111
3127
  ),
3112
3128
  onClick: (k) => k.stopPropagation(),
3113
3129
  "aria-label": "Team",
3114
3130
  children: [
3115
- /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3.5 py-2.5", m.divider), children: [
3131
+ /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3.5 py-2.5", p.divider), children: [
3116
3132
  /* @__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(
3117
3133
  "button",
3118
3134
  {
3119
3135
  type: "button",
3120
- onClick: () => $(k),
3136
+ onClick: () => A(k),
3121
3137
  "data-tip": k === "archived" ? "Conversations you archived for yourself. Everyone else still sees them." : void 0,
3122
3138
  className: g(
3123
3139
  "flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors",
3124
- U === k ? m.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
3140
+ U === k ? p.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
3125
3141
  ),
3126
3142
  children: [
3127
3143
  k === "online" ? `Online · ${L.length}` : k === "chat" ? "Chat" : k === "browse" ? "Browse" : "Archived",
3128
- k === "chat" && te > 0 && /* @__PURE__ */ e(
3144
+ k === "chat" && Y > 0 && /* @__PURE__ */ e(
3129
3145
  "span",
3130
3146
  {
3131
3147
  className: g(
3132
3148
  "flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold leading-none",
3133
- m.pill
3149
+ p.pill
3134
3150
  ),
3135
- title: `${te} unread`,
3136
- children: te > 99 ? "99+" : te
3151
+ title: `${Y} unread`,
3152
+ children: Y > 99 ? "99+" : Y
3137
3153
  }
3138
3154
  )
3139
3155
  ]
@@ -3144,16 +3160,16 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${St}px; }`, do
3144
3160
  "button",
3145
3161
  {
3146
3162
  type: "button",
3147
- onClick: v,
3148
- "aria-pressed": b,
3149
- title: b ? "Unpin — go back to opening chat over the page" : "Pin — keep chat open beside the page while you work",
3150
- "aria-label": b ? "Unpin chat panel" : "Pin chat panel",
3163
+ onClick: y,
3164
+ "aria-pressed": x,
3165
+ title: x ? "Unpin — go back to opening chat over the page" : "Pin — keep chat open beside the page while you work",
3166
+ "aria-label": x ? "Unpin chat panel" : "Pin chat panel",
3151
3167
  className: g(
3152
3168
  "ml-auto hidden rounded-md p-1.5 transition-colors lg:flex",
3153
- b ? m.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
3169
+ x ? p.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
3154
3170
  ),
3155
- "data-chat-pin": b ? "on" : "off",
3156
- children: b ? /* @__PURE__ */ e(Ha, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(Ut, { className: "h-4 w-4", strokeWidth: 2 })
3171
+ "data-chat-pin": x ? "on" : "off",
3172
+ children: x ? /* @__PURE__ */ e(Ha, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(Dt, { className: "h-4 w-4", strokeWidth: 2 })
3157
3173
  }
3158
3174
  ),
3159
3175
  /* @__PURE__ */ e(
@@ -3163,7 +3179,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${St}px; }`, do
3163
3179
  onClick: s,
3164
3180
  className: "rounded-md p-1.5 text-slate-400 hover:bg-slate-100 hover:text-slate-600 max-lg:ml-auto dark:hover:bg-white/10 dark:hover:text-slate-100",
3165
3181
  "aria-label": "Close panel",
3166
- children: /* @__PURE__ */ e(mt, { className: "h-4 w-4", strokeWidth: 2 })
3182
+ children: /* @__PURE__ */ e(pt, { className: "h-4 w-4", strokeWidth: 2 })
3167
3183
  }
3168
3184
  )
3169
3185
  ] }),
@@ -3174,21 +3190,21 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${St}px; }`, do
3174
3190
  "data-chat-online": !0,
3175
3191
  children: [
3176
3192
  /* @__PURE__ */ e(
3177
- cl,
3193
+ pl,
3178
3194
  {
3179
3195
  myStatus: d ? ((Ce = c.byUser.get(String(d.id).toUpperCase())) == null ? void 0 : Ce.custom_status) ?? null : null
3180
3196
  }
3181
3197
  ),
3182
- /* @__PURE__ */ e(il, {}),
3198
+ /* @__PURE__ */ e(ml, {}),
3183
3199
  /* @__PURE__ */ e(Us, {}),
3184
3200
  L.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
3185
3201
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
3186
3202
  /* @__PURE__ */ e(
3187
- It,
3203
+ jt,
3188
3204
  {
3189
- value: ae,
3205
+ value: se,
3190
3206
  onChange: (k) => {
3191
- ue(k);
3207
+ me(k);
3192
3208
  try {
3193
3209
  localStorage.setItem("nvr_chat_group_by", k);
3194
3210
  } catch {
@@ -3204,27 +3220,27 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${St}px; }`, do
3204
3220
  }
3205
3221
  )
3206
3222
  ] }),
3207
- L.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." }) : u.map((k) => /* @__PURE__ */ a("div", { "data-chat-online-group": k.key, children: [
3223
+ L.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." }) : m.map((k) => /* @__PURE__ */ a("div", { "data-chat-online-group": k.key, children: [
3208
3224
  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: [
3209
3225
  k.label,
3210
3226
  /* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
3211
3227
  ] }),
3212
3228
  k.users.map((M) => {
3213
- const P = c.byUser.get(String(M.user_id).toUpperCase()), Y = (P == null ? void 0 : P.is_idle) ?? M.is_idle, $e = P ?? M;
3229
+ const P = c.byUser.get(String(M.user_id).toUpperCase()), V = (P == null ? void 0 : P.is_idle) ?? M.is_idle, $e = P ?? M;
3214
3230
  return /* @__PURE__ */ a(
3215
3231
  "div",
3216
3232
  {
3217
3233
  className: "flex w-full items-center rounded-lg pl-2.5 transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
3218
3234
  "data-chat-online-row": !0,
3219
3235
  children: [
3220
- /* @__PURE__ */ e(Pt, { userId: M.user_id, children: /* @__PURE__ */ e(
3236
+ /* @__PURE__ */ e(It, { userId: M.user_id, children: /* @__PURE__ */ e(
3221
3237
  "button",
3222
3238
  {
3223
3239
  type: "button",
3224
3240
  className: "shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
3225
3241
  "aria-label": `${M.display_name ?? "Unknown user"} — profile`,
3226
3242
  "data-chat-online-avatar": !0,
3227
- children: /* @__PURE__ */ e(K, { id: M.user_id, name: M.display_name })
3243
+ children: /* @__PURE__ */ e(Q, { id: M.user_id, name: M.display_name })
3228
3244
  }
3229
3245
  ) }),
3230
3246
  /* @__PURE__ */ a(
@@ -3238,18 +3254,18 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${St}px; }`, do
3238
3254
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
3239
3255
  /* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
3240
3256
  M.display_name ?? "Unknown user",
3241
- Y && /* @__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: P != null && P.away ? "Away" : At($e) }),
3242
- !Y && (P == null ? void 0 : P.stuck) && (() => {
3243
- const _ = P.stuck, I = c.fields.includes("page"), j = An(
3257
+ V && /* @__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: P != null && P.away ? "Away" : At($e) }),
3258
+ !V && (P == null ? void 0 : P.stuck) && (() => {
3259
+ const _ = P.stuck, I = c.fields.includes("page"), j = $n(
3244
3260
  P.current_path,
3245
3261
  P.app,
3246
3262
  c.adminUrl,
3247
3263
  i.recordUrl,
3248
3264
  typeof window > "u" ? null : window.location.origin
3249
- ), oe = `${Rn(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
3250
- ${Mn(j)}` : ""}`, V = Rn(
3265
+ ), ie = `${Mn(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
3266
+ ${An(j)}` : ""}`, ne = Mn(
3251
3267
  I ? { ..._, label: null } : _
3252
- ), Z = "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";
3268
+ ), X = "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";
3253
3269
  return j ? (
3254
3270
  // biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
3255
3271
  /* @__PURE__ */ e(
@@ -3257,26 +3273,26 @@ ${Mn(j)}` : ""}`, V = Rn(
3257
3273
  {
3258
3274
  role: "link",
3259
3275
  tabIndex: 0,
3260
- className: g(Z, "cursor-pointer hover:underline"),
3276
+ className: g(X, "cursor-pointer hover:underline"),
3261
3277
  "data-chat-stuck": _.minutes,
3262
- "data-tip": oe,
3263
- "aria-label": `${V}: open the page`,
3264
- onClick: (G) => {
3265
- G.stopPropagation(), he(j);
3278
+ "data-tip": ie,
3279
+ "aria-label": `${ne}: open the page`,
3280
+ onClick: (z) => {
3281
+ z.stopPropagation(), he(j);
3266
3282
  },
3267
- onKeyDown: (G) => {
3268
- (G.key === "Enter" || G.key === " ") && (G.preventDefault(), G.stopPropagation(), he(j));
3283
+ onKeyDown: (z) => {
3284
+ (z.key === "Enter" || z.key === " ") && (z.preventDefault(), z.stopPropagation(), he(j));
3269
3285
  },
3270
- children: V
3286
+ children: ne
3271
3287
  }
3272
3288
  )
3273
3289
  ) : /* @__PURE__ */ e(
3274
3290
  "span",
3275
3291
  {
3276
- className: Z,
3292
+ className: X,
3277
3293
  "data-chat-stuck": _.minutes,
3278
- "data-tip": oe,
3279
- children: V
3294
+ "data-tip": ie,
3295
+ children: ne
3280
3296
  }
3281
3297
  );
3282
3298
  })(),
@@ -3298,7 +3314,7 @@ ${Mn(j)}` : ""}`, V = Rn(
3298
3314
  }
3299
3315
  ) : null;
3300
3316
  })(),
3301
- J && /* @__PURE__ */ e($s, { builds: P == null ? void 0 : P.stale_build })
3317
+ Z && /* @__PURE__ */ e($s, { builds: P == null ? void 0 : P.stale_build })
3302
3318
  ] }),
3303
3319
  (() => {
3304
3320
  const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = _ == null ? void 0 : _.custom_status;
@@ -3330,53 +3346,53 @@ ${Mn(j)}` : ""}`, V = Rn(
3330
3346
  })(),
3331
3347
  (() => {
3332
3348
  const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = [];
3333
- let j = null, oe = !1;
3334
- for (const G of c.fields)
3335
- if (G === "role") {
3336
- const se = Fn((_ == null ? void 0 : _.role_name) ?? M.role_name);
3337
- se && I.push(se);
3338
- } else if (G === "scopes") {
3339
- const se = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
3340
- se && I.push(se);
3341
- } else if (G === "page") {
3342
- const se = (_ == null ? void 0 : _.page) ?? M.page ?? ba((_ == null ? void 0 : _.current_path) ?? M.current_path), fe = (_ == null ? void 0 : _.app) ?? M.app;
3343
- j = (fe ? `${se ?? ""}${se ? " · " : ""}${fe}`.trim() : se) || null, oe = !j && !!_ && !_.away;
3349
+ let j = null, ie = !1;
3350
+ for (const z of c.fields)
3351
+ if (z === "role") {
3352
+ const re = Wn((_ == null ? void 0 : _.role_name) ?? M.role_name);
3353
+ re && I.push(re);
3354
+ } else if (z === "scopes") {
3355
+ const re = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
3356
+ re && I.push(re);
3357
+ } else if (z === "page") {
3358
+ const re = (_ == null ? void 0 : _.page) ?? M.page ?? ba((_ == null ? void 0 : _.current_path) ?? M.current_path), fe = (_ == null ? void 0 : _.app) ?? M.app;
3359
+ j = (fe ? `${re ?? ""}${re ? " · " : ""}${fe}`.trim() : re) || null, ie = !j && !!_ && !_.away;
3344
3360
  }
3345
- const V = I.join(" · "), Z = oe ? /* @__PURE__ */ a(
3361
+ const ne = I.join(" · "), X = ie ? /* @__PURE__ */ a(
3346
3362
  "span",
3347
3363
  {
3348
3364
  className: "flex items-start gap-1 text-[11px] italic text-slate-400 dark:text-slate-500",
3349
3365
  "data-chat-online-page": "background",
3350
3366
  "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.",
3351
3367
  children: [
3352
- /* @__PURE__ */ e($n, { className: "mt-[2px] h-3 w-3 shrink-0 opacity-60" }),
3368
+ /* @__PURE__ */ e(Dn, { className: "mt-[2px] h-3 w-3 shrink-0 opacity-60" }),
3353
3369
  /* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: "Tab in background" })
3354
3370
  ]
3355
3371
  }
3356
3372
  ) : null;
3357
- return !V && !j && !Z ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(ke, { children: [
3358
- V && /* @__PURE__ */ e(
3373
+ return !ne && !j && !X ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(ke, { children: [
3374
+ ne && /* @__PURE__ */ e(
3359
3375
  "span",
3360
3376
  {
3361
3377
  className: "block truncate text-[11px] text-slate-400",
3362
3378
  "data-chat-online-meta": !0,
3363
- title: V,
3364
- children: V
3379
+ title: ne,
3380
+ children: ne
3365
3381
  }
3366
3382
  ),
3367
- Z,
3383
+ X,
3368
3384
  j && (() => {
3369
- const G = An(
3385
+ const z = $n(
3370
3386
  _ == null ? void 0 : _.current_path,
3371
3387
  _ == null ? void 0 : _.app,
3372
3388
  c.adminUrl,
3373
3389
  i.recordUrl,
3374
3390
  typeof window > "u" ? null : window.location.origin
3375
- ), se = /* @__PURE__ */ a(ke, { children: [
3376
- /* @__PURE__ */ e($n, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
3391
+ ), re = /* @__PURE__ */ a(ke, { children: [
3392
+ /* @__PURE__ */ e(Dn, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
3377
3393
  /* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: j })
3378
3394
  ] });
3379
- return G ? (
3395
+ return z ? (
3380
3396
  // biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
3381
3397
  /* @__PURE__ */ e(
3382
3398
  "span",
@@ -3385,16 +3401,16 @@ ${Mn(j)}` : ""}`, V = Rn(
3385
3401
  tabIndex: 0,
3386
3402
  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",
3387
3403
  "data-chat-online-page": !0,
3388
- "data-chat-online-page-href": G,
3389
- "data-tip": Mn(G),
3404
+ "data-chat-online-page-href": z,
3405
+ "data-tip": An(z),
3390
3406
  "aria-label": `${j}: open the page`,
3391
3407
  onClick: (fe) => {
3392
- fe.stopPropagation(), he(G);
3408
+ fe.stopPropagation(), he(z);
3393
3409
  },
3394
3410
  onKeyDown: (fe) => {
3395
- (fe.key === "Enter" || fe.key === " ") && (fe.preventDefault(), fe.stopPropagation(), he(G));
3411
+ (fe.key === "Enter" || fe.key === " ") && (fe.preventDefault(), fe.stopPropagation(), he(z));
3396
3412
  },
3397
- children: se
3413
+ children: re
3398
3414
  }
3399
3415
  )
3400
3416
  ) : /* @__PURE__ */ e(
@@ -3403,7 +3419,7 @@ ${Mn(j)}` : ""}`, V = Rn(
3403
3419
  className: "flex items-start gap-1 text-[11px] text-slate-500 dark:text-slate-300",
3404
3420
  "data-chat-online-page": !0,
3405
3421
  "data-tip": (_ == null ? void 0 : _.current_path) ?? j,
3406
- children: se
3422
+ children: re
3407
3423
  }
3408
3424
  );
3409
3425
  })()
@@ -3411,21 +3427,21 @@ ${Mn(j)}` : ""}`, V = Rn(
3411
3427
  })()
3412
3428
  ] }),
3413
3429
  (() => {
3414
- var V;
3430
+ var ne;
3415
3431
  const _ = c.byUser.get(String(M.user_id).toUpperCase());
3416
- if (!J || !(_ != null && _.recording_id)) return null;
3417
- const I = ((V = c.adminUrl) == null ? void 0 : V.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), oe = i.sessionUrl ? i.sessionUrl(_.recording_id, String(M.user_id)) : j ? `${I}/session-replays?recording=${_.recording_id}` : null;
3418
- return oe ? /* @__PURE__ */ e(
3432
+ if (!Z || !(_ != null && _.recording_id)) return null;
3433
+ const I = ((ne = c.adminUrl) == null ? void 0 : ne.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), ie = i.sessionUrl ? i.sessionUrl(_.recording_id, String(M.user_id)) : j ? `${I}/session-replays?recording=${_.recording_id}` : null;
3434
+ return ie ? /* @__PURE__ */ e(
3419
3435
  "span",
3420
3436
  {
3421
3437
  role: "link",
3422
3438
  tabIndex: 0,
3423
3439
  title: "Watch this session",
3424
- onClick: (Z) => {
3425
- Z.stopPropagation(), he(oe);
3440
+ onClick: (X) => {
3441
+ X.stopPropagation(), he(ie);
3426
3442
  },
3427
- onKeyDown: (Z) => {
3428
- (Z.key === "Enter" || Z.key === " ") && (Z.stopPropagation(), he(oe));
3443
+ onKeyDown: (X) => {
3444
+ (X.key === "Enter" || X.key === " ") && (X.stopPropagation(), he(ie));
3429
3445
  },
3430
3446
  className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
3431
3447
  children: /* @__PURE__ */ e(Qa, { className: "h-4 w-4", strokeWidth: 1.8 })
@@ -3433,7 +3449,7 @@ ${Mn(j)}` : ""}`, V = Rn(
3433
3449
  ) : null;
3434
3450
  })(),
3435
3451
  /* @__PURE__ */ e(
3436
- Qn,
3452
+ Gn,
3437
3453
  {
3438
3454
  className: "h-4 w-4 shrink-0 text-slate-300",
3439
3455
  strokeWidth: 1.8
@@ -3450,52 +3466,52 @@ ${Mn(j)}` : ""}`, V = Rn(
3450
3466
  ] }, k.key))
3451
3467
  ]
3452
3468
  }
3453
- ) : U === "archived" ? H ? /* @__PURE__ */ e(
3454
- Bn,
3469
+ ) : U === "archived" ? O ? /* @__PURE__ */ e(
3470
+ En,
3455
3471
  {
3456
- room: H.room,
3457
- label: H.label,
3458
- onBack: () => ee(null),
3472
+ room: O.room,
3473
+ label: O.label,
3474
+ onBack: () => K(null),
3459
3475
  renderMessageBody: l
3460
3476
  },
3461
- H.room
3477
+ O.room
3462
3478
  ) : /* @__PURE__ */ e(
3463
- Hn,
3479
+ zn,
3464
3480
  {
3465
- rooms: ne.rooms,
3466
- loading: ne.loading,
3481
+ rooms: te.rooms,
3482
+ loading: te.loading,
3467
3483
  archivedView: !0,
3468
- onOpen: (k) => ee({ room: k.room, label: k.label })
3484
+ onOpen: (k) => K({ room: k.room, label: k.label })
3469
3485
  }
3470
3486
  ) : U === "browse" ? (
3471
3487
  // The tab is checked BEFORE the open room: leaving it last meant
3472
3488
  // switching to Browse with a conversation open kept showing that
3473
3489
  // conversation (or its settings) under the Browse tab.
3474
3490
  /* @__PURE__ */ e(
3475
- ll,
3491
+ dl,
3476
3492
  {
3477
3493
  onOpen: (k, M, P) => {
3478
- F(!1), S({ room: k, label: M, channel: P }), $("chat");
3494
+ F(!1), S({ room: k, label: M, channel: P }), A("chat");
3479
3495
  }
3480
3496
  }
3481
3497
  )
3482
3498
  ) : q ? /* @__PURE__ */ e(
3483
- dl,
3499
+ hl,
3484
3500
  {
3485
- onClose: () => A(!1),
3501
+ onClose: () => J(!1),
3486
3502
  onCreated: (k, M) => {
3487
- A(!1), S({ room: k, label: M });
3503
+ J(!1), S({ room: k, label: M });
3488
3504
  }
3489
3505
  }
3490
- ) : C && W && C.channel ? /* @__PURE__ */ e(
3491
- al,
3506
+ ) : C && G && C.channel ? /* @__PURE__ */ e(
3507
+ ol,
3492
3508
  {
3493
3509
  channel: C.channel,
3494
3510
  label: C.label,
3495
3511
  onBack: () => F(!1)
3496
3512
  }
3497
3513
  ) : C ? /* @__PURE__ */ e(
3498
- Bn,
3514
+ En,
3499
3515
  {
3500
3516
  room: C.room,
3501
3517
  label: C.label,
@@ -3506,28 +3522,28 @@ ${Mn(j)}` : ""}`, V = Rn(
3506
3522
  anchor: C.anchor ?? null
3507
3523
  },
3508
3524
  C.room
3509
- ) : E === "mentions" ? /* @__PURE__ */ e(Yn, { th: m, onBack: () => R(null), onOpen: y }) : E === "scheduled" ? /* @__PURE__ */ e(
3510
- Zn,
3525
+ ) : B === "mentions" ? /* @__PURE__ */ e(Jn, { th: p, onBack: () => $(null), onOpen: v }) : B === "scheduled" ? /* @__PURE__ */ e(
3526
+ Yn,
3511
3527
  {
3512
- th: m,
3513
- onBack: () => R(null),
3528
+ th: p,
3529
+ onBack: () => $(null),
3514
3530
  roomLabel: (k) => {
3515
3531
  var M;
3516
- return ((M = pe.find((P) => P.room === k)) == null ? void 0 : M.label) ?? k;
3532
+ return ((M = ee.find((P) => P.room === k)) == null ? void 0 : M.label) ?? k;
3517
3533
  }
3518
3534
  }
3519
- ) : E === "catchup" ? /* @__PURE__ */ e(
3520
- Vn,
3535
+ ) : B === "catchup" ? /* @__PURE__ */ e(
3536
+ Zn,
3521
3537
  {
3522
- rooms: pe,
3523
- th: m,
3524
- onBack: () => R(null),
3525
- onOpen: y
3538
+ rooms: ee,
3539
+ th: p,
3540
+ onBack: () => $(null),
3541
+ onOpen: v
3526
3542
  }
3527
3543
  ) : /* @__PURE__ */ e(
3528
- Hn,
3544
+ zn,
3529
3545
  {
3530
- rooms: pe,
3546
+ rooms: ee,
3531
3547
  onOpen: (k, M) => {
3532
3548
  F(!1), S({
3533
3549
  room: k.room,
@@ -3537,8 +3553,8 @@ ${Mn(j)}` : ""}`, V = Rn(
3537
3553
  anchor: M
3538
3554
  });
3539
3555
  },
3540
- onNewGroup: () => A(!0),
3541
- onView: R
3556
+ onNewGroup: () => J(!0),
3557
+ onView: $
3542
3558
  }
3543
3559
  )
3544
3560
  ]
@@ -3546,16 +3562,16 @@ ${Mn(j)}` : ""}`, V = Rn(
3546
3562
  )
3547
3563
  ]
3548
3564
  }
3549
- ) : /* @__PURE__ */ e(On, {});
3565
+ ) : /* @__PURE__ */ e(Rn, {});
3550
3566
  }
3551
3567
  export {
3552
- il as ChatAppearAwayRow,
3553
- ll as ChatChannelBrowser,
3554
- al as ChatChannelSettings,
3555
- mo as ChatPanel,
3556
- co as ChatProvider,
3557
- Hn as ChatRoomList,
3558
- Bn as ChatRoomView,
3559
- uo as ChatSideView,
3560
- ul as isChatPanelPinned
3568
+ ml as ChatAppearAwayRow,
3569
+ dl as ChatChannelBrowser,
3570
+ ol as ChatChannelSettings,
3571
+ bo as ChatPanel,
3572
+ fo as ChatProvider,
3573
+ zn as ChatRoomList,
3574
+ En as ChatRoomView,
3575
+ xo as ChatSideView,
3576
+ fl as isChatPanelPinned
3561
3577
  };