@nivaro/react 0.3.11 → 0.3.13
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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +109 -102
- package/dist/index.d.ts +17 -0
- package/dist/index.js +583 -582
- package/dist/shared/components/ProfileView.js +115 -109
- package/dist/shared/components/chat/ChatPanel.js +492 -472
- package/dist/shared/components/item-edit/RecordLiveSync.js +196 -181
- package/dist/shared/components/item-edit/UserChip.js +301 -233
- package/dist/shared/components/profile/PersonAdminTools.js +168 -144
- package/dist/shared/components/profile/PersonProfile.js +42 -41
- package/dist/shared/components/profile/session-actions.js +52 -0
- package/dist/shared/context.js +71 -66
- package/dist/shared/lib/replay-checkout.js +20 -0
- package/package.json +1 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as _e } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as Ce, useQueryClient as Rt, useMutation as Ee } from "@tanstack/react-query";
|
|
3
|
-
import { Search as
|
|
4
|
-
import { useState as T, useEffect as ae, useMemo as fe, useRef as oe, useContext as
|
|
3
|
+
import { Search as Fn, Plus as Wa, Hash as _t, Lock as Fa, ChevronLeft as ct, X as dt, PinOff as za, Pin as St, Headphones as Ha, PlayCircle as Ga, MessageCircle as zn, Users as Tt, AtSign as Qa, AlarmClock as Ka, Sparkles as Ja, BellOff as Tn, PencilLine as Ya, Star as Za, ArchiveRestore as Va, Archive as Xa, Bell as es, LogOut as ts, Info as ns, MapPin as as, Check as At, 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 fe, useRef as oe, useContext as gs } from "react";
|
|
5
5
|
import { toast as he } from "sonner";
|
|
6
6
|
import { useItemEditAuth as ut, useNavigation as vs, useNivaroClient as Je } from "../../context.js";
|
|
7
7
|
import { get as xe, post as Be, 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
|
|
10
|
+
import { presencePlaceHref as Un, stuckText as Dn, fullHref as $n } 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
|
|
13
|
+
import { cn as b, getDisplayTimezone as Mt, formatRelative as Hn } 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
|
|
17
|
+
import { UserChip as Ot } from "../item-edit/UserChip.js";
|
|
18
18
|
import { StaleBuildChip as $s } from "../StaleBuildChip.js";
|
|
19
19
|
import { UserAvatar as Rs } from "../UserAvatar.js";
|
|
20
20
|
import { Popover as Ye, PopoverTrigger as Ze, PopoverContent as Ve } from "../ui/popover.js";
|
|
21
|
-
import { SimpleSelect as
|
|
21
|
+
import { SimpleSelect as Lt } from "../ui/SimpleSelect.js";
|
|
22
22
|
import { useBotStream as As, BotStreamBubble as Ms } 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
25
|
import { ChannelTile as Ke, ChannelLookPicker as Gn } from "./ChannelLook.js";
|
|
26
26
|
import { MentionsView as Qn, ScheduledView as Kn, CatchUpView as Jn, 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
|
|
28
|
+
import { useMyPreferences as Pt, useSetMyPreferences as Yn, useChatRoles as Zn, useChannelDirectory as zs, useRoomMembership as It, useCreateChannel as Hs, useChatConfig as Me, useChannelMembers as jt, useChannelAdmin as Vn, useUserSearch as qt, GENERAL_CHANNEL_ID as Xn, useChatRooms as ea, useArchivedRooms as ta, sortOnlineUsers as Gs, dmRoom as Ut, CHAT_DEFAULTS as it, ChatConfigContext as na, useChatBotInfo as Et, useChatSearch as Qs, dmPeer as Ne, 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 aa, REACTION_EMOJI as pr } from "./chat-core.js";
|
|
29
29
|
import { useDraftRooms as hr } from "./chat-drafts.js";
|
|
30
|
-
import { useCustomEmoji as fr, EmojiButton as xr, EmojiGlyph as
|
|
31
|
-
import { useRoomRecord as sa, useRecordFileTargets as
|
|
30
|
+
import { useCustomEmoji as fr, EmojiButton as xr, EmojiGlyph as br } from "./chat-emoji.js";
|
|
31
|
+
import { useRoomRecord as sa, useRecordFileTargets as gr } from "./chat-hooks.js";
|
|
32
32
|
import { offHoursNote as vr } from "./chat-local-time.js";
|
|
33
33
|
import { useMessageWindow as yr } from "./chat-window.js";
|
|
34
|
-
import { HuddleFollowHost as
|
|
34
|
+
import { HuddleFollowHost as Rn } from "./huddle/HuddleCollab.js";
|
|
35
35
|
import { HuddleControls as kr } from "./huddle/HuddleControls.js";
|
|
36
36
|
import { HuddleLiveBadge as wr } from "./huddle/HuddleLiveBadge.js";
|
|
37
37
|
import { HuddleScheduleCard as Nr } from "./huddle/HuddleScheduleCard.js";
|
|
38
38
|
import { HuddleScheduleForm as Cr } from "./huddle/HuddleScheduleForm.js";
|
|
39
39
|
import { HuddleStage as _r } from "./huddle/HuddleStage.js";
|
|
40
40
|
import { useHuddleLive as Sr } from "./huddle/huddle-live.js";
|
|
41
|
-
import { stripHuddleRef as
|
|
41
|
+
import { stripHuddleRef as An, huddleRefOf as Mn } from "./huddle/huddle-schedule.js";
|
|
42
42
|
import { useHuddle as Tr } from "./huddle/useHuddle.js";
|
|
43
43
|
import { useMessageActions as Ur, MessageActionsMenu as Dr, actionsForMessage as $r } from "./MessageActions.js";
|
|
44
44
|
import { FormattedMessage as Rr, LinkPreviews as Ar } from "./MessageFormat.js";
|
|
45
45
|
import { PollCard as Mr } from "./PollCard.js";
|
|
46
|
-
import { RoomStatusMarks as Or, headerIconIdle as
|
|
46
|
+
import { RoomStatusMarks as Or, headerIconIdle as On, headerIconButton as Ln, RoomHeaderMenu as Lr } from "./RoomHeaderMenu.js";
|
|
47
47
|
import { MemberCountLine as Pr, ChannelIntro as Ir, WelcomeNote as jr, ThreadPane as qr, RoomInfoDrawer as Er } from "./RoomParts.js";
|
|
48
48
|
import { clipInfo as Br, ClipPlayer as Wr } from "./ScreenClip.js";
|
|
49
49
|
import { useOutbox as ra } from "./chat-outbox.js";
|
|
@@ -58,8 +58,8 @@ const oa = {
|
|
|
58
58
|
surface: "bg-white dark:bg-card",
|
|
59
59
|
input: "border-slate-200 bg-slate-50 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100",
|
|
60
60
|
divider: "border-slate-100 dark:border-border/60"
|
|
61
|
-
},
|
|
62
|
-
|
|
61
|
+
}, Bt = {};
|
|
62
|
+
Bt.current = oa;
|
|
63
63
|
function co({
|
|
64
64
|
children: n,
|
|
65
65
|
me: s,
|
|
@@ -73,7 +73,7 @@ function co({
|
|
|
73
73
|
recordUrl: f,
|
|
74
74
|
sessionUrl: u,
|
|
75
75
|
realtime: p,
|
|
76
|
-
subscribeRooms:
|
|
76
|
+
subscribeRooms: g,
|
|
77
77
|
setTypingRoom: U,
|
|
78
78
|
navigate: $,
|
|
79
79
|
sound: C = !0,
|
|
@@ -90,7 +90,7 @@ function co({
|
|
|
90
90
|
recordUrl: f,
|
|
91
91
|
sessionUrl: u,
|
|
92
92
|
realtime: p,
|
|
93
|
-
subscribeRooms:
|
|
93
|
+
subscribeRooms: g,
|
|
94
94
|
me: s,
|
|
95
95
|
onlineUsers: l,
|
|
96
96
|
setTypingRoom: U,
|
|
@@ -110,16 +110,16 @@ function co({
|
|
|
110
110
|
C
|
|
111
111
|
]
|
|
112
112
|
);
|
|
113
|
-
return
|
|
113
|
+
return Bt.current = { ...oa, ...S }, /* @__PURE__ */ e(na.Provider, { value: W, children: n });
|
|
114
114
|
}
|
|
115
115
|
function ie() {
|
|
116
|
-
return
|
|
116
|
+
return Bt.current;
|
|
117
117
|
}
|
|
118
|
-
const
|
|
118
|
+
const Pn = /* @__PURE__ */ new WeakMap();
|
|
119
119
|
function Fr(n, s) {
|
|
120
120
|
const l = String(s).toUpperCase();
|
|
121
|
-
let r =
|
|
122
|
-
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null },
|
|
121
|
+
let r = Pn.get(n);
|
|
122
|
+
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, Pn.set(n, r));
|
|
123
123
|
const o = r;
|
|
124
124
|
return new Promise((i) => {
|
|
125
125
|
const d = o.ids.get(l) ?? [];
|
|
@@ -132,14 +132,14 @@ function Fr(n, s) {
|
|
|
132
132
|
const p = await n.request(
|
|
133
133
|
xe("/presence/people", { ids: h.slice(u, u + 100).join(",") })
|
|
134
134
|
);
|
|
135
|
-
for (const
|
|
135
|
+
for (const g of p.data ?? []) f.set(String(g.user_id).toUpperCase(), g);
|
|
136
136
|
} catch {
|
|
137
137
|
}
|
|
138
|
-
for (const [u, p] of c) for (const
|
|
138
|
+
for (const [u, p] of c) for (const g of p) g(f.get(u) ?? null);
|
|
139
139
|
}, 0));
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Wt(n, s = !0) {
|
|
143
143
|
const l = Je(), { data: r } = Ce({
|
|
144
144
|
queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
|
|
145
145
|
queryFn: () => Fr(l, n),
|
|
@@ -149,10 +149,10 @@ function Bt(n, s = !0) {
|
|
|
149
149
|
return r ?? null;
|
|
150
150
|
}
|
|
151
151
|
function ia(n) {
|
|
152
|
-
return n != null && n.last_seen ? `last seen ${
|
|
152
|
+
return n != null && n.last_seen ? `last seen ${Hn(n.last_seen)}` : null;
|
|
153
153
|
}
|
|
154
154
|
function ca(n) {
|
|
155
|
-
const s =
|
|
155
|
+
const s = gs(na), l = pa(), r = String(n).toUpperCase();
|
|
156
156
|
if (l.loaded) {
|
|
157
157
|
const i = l.byUser.get(r);
|
|
158
158
|
if (!i) return { state: "offline", title: "Offline", page: null };
|
|
@@ -171,7 +171,7 @@ function da(n) {
|
|
|
171
171
|
})}` : "Out of office" : null;
|
|
172
172
|
}
|
|
173
173
|
function zr({ id: n, size: s }) {
|
|
174
|
-
const { state: l, title: r, page: o } = ca(n), i =
|
|
174
|
+
const { state: l, title: r, page: o } = ca(n), i = Wt(n), d = l === "offline" ? ia(i) : null, c = da(i), h = s >= 30 ? 10 : 8, f = [
|
|
175
175
|
d ? `Offline · ${d}` : r,
|
|
176
176
|
o && l !== "offline" ? `On ${o}` : null,
|
|
177
177
|
c,
|
|
@@ -181,7 +181,7 @@ function zr({ id: n, size: s }) {
|
|
|
181
181
|
/* @__PURE__ */ e(
|
|
182
182
|
"span",
|
|
183
183
|
{
|
|
184
|
-
className:
|
|
184
|
+
className: b(
|
|
185
185
|
"absolute -bottom-0.5 -right-0.5 rounded-full border-2 border-white dark:border-card",
|
|
186
186
|
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
187
|
),
|
|
@@ -212,7 +212,7 @@ function Z({
|
|
|
212
212
|
size: l = 32,
|
|
213
213
|
presence: r = !0
|
|
214
214
|
}) {
|
|
215
|
-
const o =
|
|
215
|
+
const o = Et(), i = /* @__PURE__ */ e(
|
|
216
216
|
"span",
|
|
217
217
|
{
|
|
218
218
|
className: "flex shrink-0 items-center justify-center rounded-full font-semibold text-[#04263b]",
|
|
@@ -240,8 +240,8 @@ function Z({
|
|
|
240
240
|
] });
|
|
241
241
|
}
|
|
242
242
|
function Hr({ peerId: n, name: s }) {
|
|
243
|
-
const l =
|
|
244
|
-
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(
|
|
243
|
+
const l = Et(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(Z, { id: n, name: s, size: 28 });
|
|
244
|
+
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Ot, { userId: n, children: /* @__PURE__ */ e(
|
|
245
245
|
"button",
|
|
246
246
|
{
|
|
247
247
|
type: "button",
|
|
@@ -252,11 +252,11 @@ function Hr({ peerId: n, name: s }) {
|
|
|
252
252
|
}
|
|
253
253
|
) });
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function In({ token: n, url: s, mine: l }) {
|
|
256
256
|
const r = Me(), o = ie(), i = Je(), { data: d } = Ce(aa(i)), { data: c } = Ce({
|
|
257
257
|
queryKey: ["nvr-chat-entity-card", n],
|
|
258
258
|
queryFn: async () => {
|
|
259
|
-
var u, p,
|
|
259
|
+
var u, p, g, U;
|
|
260
260
|
for (const $ of d ?? [])
|
|
261
261
|
try {
|
|
262
262
|
const S = (p = (u = (await i.request(
|
|
@@ -267,9 +267,9 @@ function Pn({ token: n, url: s, mine: l }) {
|
|
|
267
267
|
})
|
|
268
268
|
)).data) == null ? void 0 : u[0]) == null ? void 0 : p.id;
|
|
269
269
|
if (S == null) continue;
|
|
270
|
-
const M = (U = (
|
|
270
|
+
const M = (U = (g = (await i.request(
|
|
271
271
|
xe(`/pipelines/instance/${$.collection}/${S}`)
|
|
272
|
-
)).data) == null ? void 0 :
|
|
272
|
+
)).data) == null ? void 0 : g.instance) == null ? void 0 : U.current_state_obj;
|
|
273
273
|
return {
|
|
274
274
|
collection: $.collection,
|
|
275
275
|
id: S,
|
|
@@ -305,7 +305,7 @@ function Pn({ token: n, url: s, mine: l }) {
|
|
|
305
305
|
}
|
|
306
306
|
s && ((p = r.navigate) == null || p.call(r, s));
|
|
307
307
|
},
|
|
308
|
-
className:
|
|
308
|
+
className: b(
|
|
309
309
|
"inline-flex max-w-full items-center gap-1 align-baseline font-medium underline-offset-2 hover:underline",
|
|
310
310
|
l ? "underline" : o.accentText
|
|
311
311
|
),
|
|
@@ -381,7 +381,7 @@ function Qr({ botName: n }) {
|
|
|
381
381
|
r.kind === "code" ? /* @__PURE__ */ e(
|
|
382
382
|
"code",
|
|
383
383
|
{
|
|
384
|
-
className:
|
|
384
|
+
className: b(
|
|
385
385
|
"h-fit w-fit self-start whitespace-nowrap rounded px-1.5 py-0.5 text-[10.5px] font-semibold",
|
|
386
386
|
s.accentSoft
|
|
387
387
|
),
|
|
@@ -425,11 +425,11 @@ function Kr({ room: n }) {
|
|
|
425
425
|
staleTime: 6e4
|
|
426
426
|
}), u = sa(n, c && !!f);
|
|
427
427
|
if (!c || !f) return null;
|
|
428
|
-
const
|
|
428
|
+
const g = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (u == null ? void 0 : u.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
429
|
return /* @__PURE__ */ a(
|
|
430
430
|
"div",
|
|
431
431
|
{
|
|
432
|
-
className:
|
|
432
|
+
className: b("flex shrink-0 items-center gap-2 border-b px-3 py-1.5", l.divider),
|
|
433
433
|
"data-chat-room-card": !0,
|
|
434
434
|
children: [
|
|
435
435
|
/* @__PURE__ */ e("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: f.type_label }),
|
|
@@ -448,7 +448,7 @@ function Kr({ room: n }) {
|
|
|
448
448
|
U && /* @__PURE__ */ e(
|
|
449
449
|
"span",
|
|
450
450
|
{
|
|
451
|
-
className:
|
|
451
|
+
className: b("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", $),
|
|
452
452
|
title: U.due_hours != null ? `${Math.round(U.elapsed_hours ?? 0)}h in this state of ${U.due_hours}h allowed` : void 0,
|
|
453
453
|
"data-chat-room-sla": U.status,
|
|
454
454
|
children: U.status === "breached" ? "Past SLA" : U.status === "warning" ? "SLA soon" : "On time"
|
|
@@ -469,15 +469,15 @@ function Kr({ room: n }) {
|
|
|
469
469
|
]
|
|
470
470
|
}
|
|
471
471
|
),
|
|
472
|
-
|
|
472
|
+
g && /* @__PURE__ */ e(
|
|
473
473
|
"button",
|
|
474
474
|
{
|
|
475
475
|
type: "button",
|
|
476
476
|
onClick: () => {
|
|
477
477
|
var C;
|
|
478
|
-
return (C = s.navigate) == null ? void 0 : C.call(s,
|
|
478
|
+
return (C = s.navigate) == null ? void 0 : C.call(s, g);
|
|
479
479
|
},
|
|
480
|
-
className:
|
|
480
|
+
className: b(
|
|
481
481
|
"text-[11px] font-medium hover:underline",
|
|
482
482
|
u != null && u.owners.length ? "ml-1.5" : "ml-auto",
|
|
483
483
|
l.accentText
|
|
@@ -514,7 +514,7 @@ function ua() {
|
|
|
514
514
|
}
|
|
515
515
|
function Yr({ peerId: n, name: s }) {
|
|
516
516
|
ua();
|
|
517
|
-
const { state: l, title: r } = ca(n), o =
|
|
517
|
+
const { state: l, title: r } = ca(n), o = Wt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
|
|
518
518
|
const f = ia(o);
|
|
519
519
|
return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
|
|
520
520
|
})() : r, d = Jr((o == null ? void 0 : o.timezone) ?? null, s), c = da(o), h = c ? (o == null ? void 0 : o.delegate) ?? null : null;
|
|
@@ -558,7 +558,7 @@ function Yr({ peerId: n, name: s }) {
|
|
|
558
558
|
}
|
|
559
559
|
);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function jn({
|
|
562
562
|
room: n,
|
|
563
563
|
label: s,
|
|
564
564
|
onBack: l,
|
|
@@ -568,8 +568,8 @@ function In({
|
|
|
568
568
|
anchor: d = null,
|
|
569
569
|
openThread: c = null
|
|
570
570
|
}) {
|
|
571
|
-
var
|
|
572
|
-
const h = Me(), f = ie(), u = Je(), p = h.me,
|
|
571
|
+
var hn, fn, xn, bn, gn, vn, yn, kn, wn, Nn;
|
|
572
|
+
const h = Me(), f = ie(), u = Je(), p = h.me, g = Tr(n), U = p ? Ne(n, p.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Ce({
|
|
573
573
|
...Ss(u, U),
|
|
574
574
|
enabled: !!U && $,
|
|
575
575
|
staleTime: 12e4
|
|
@@ -580,7 +580,7 @@ function In({
|
|
|
580
580
|
W
|
|
581
581
|
);
|
|
582
582
|
Js(n);
|
|
583
|
-
const se = ra(n), ee = Ys(), te = Zs(n),
|
|
583
|
+
const se = ra(n), ee = Ys(), te = Zs(n), be = Vs(n.startsWith("dm:") ? n : null), de = Xs(n), A = er(n), w = tr(n), P = nr(n), x = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== h.globalRoom && n.includes(":"), q = sa(n, x), ve = gr(n, !!q), Se = n.startsWith("ch:"), { data: ue = [] } = Ce({
|
|
584
584
|
queryKey: ["chat-read-marks", n],
|
|
585
585
|
queryFn: () => u.request(
|
|
586
586
|
xe(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
|
|
@@ -597,7 +597,7 @@ function In({
|
|
|
597
597
|
}), $e = fe(() => new Set(ke.map((t) => t.id)), [ke]), k = Ee({
|
|
598
598
|
mutationFn: (t) => u.request(Be(`/chat/messages/${t}/save`, {})),
|
|
599
599
|
onSuccess: () => void ye.invalidateQueries({ queryKey: ["chat-saved"] })
|
|
600
|
-
}), [
|
|
600
|
+
}), [O, I] = T(null), X = Ee({
|
|
601
601
|
mutationFn: () => u.request(
|
|
602
602
|
Be("/chat/rooms/summary", { room: n })
|
|
603
603
|
).then((t) => t.data),
|
|
@@ -648,20 +648,20 @@ function In({
|
|
|
648
648
|
}), E = Ee({
|
|
649
649
|
mutationFn: (t) => u.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
|
|
650
650
|
onSuccess: () => void ye.invalidateQueries({ queryKey: ["nvr-chat", n] })
|
|
651
|
-
}), ne = ar(n), K = sr(n), { isAdmin: F } = ut(), { setMuted: J, setNotifyMode: fa, setArchived: xa, setStarred:
|
|
651
|
+
}), ne = ar(n), K = sr(n), { isAdmin: F } = ut(), { setMuted: J, setNotifyMode: fa, setArchived: xa, setStarred: ba, dismissWelcome: ga, leave: va } = It(), { rooms: ya, loading: ka } = ea(), zt = ya.find((t) => t.room === n) ?? null, { rooms: wa } = ta(!ka && !zt), y = zt ?? wa.find((t) => t.room === n) ?? null, Na = ma(y), Ht = y != null && y.muted ? "muted" : (y == null ? void 0 : y.notify_mode) === "mentions" ? "mentions" : "all", ce = rr(), [Xe, Ca] = T(!1), [et, Gt] = T(""), [_a, mt] = T(null), [Qt, Kt] = T(""), [Sa, pt] = T(null), Ta = Ur(n), [Ua, Jt] = T(null), [Yt, Zt] = T(null), [Vt, Le] = T(null), Xt = lr(c ? n : null, c), en = !!Xt.root && !Xt.root.deleted_at;
|
|
652
652
|
ae(() => {
|
|
653
|
-
c &&
|
|
654
|
-
}, [c,
|
|
655
|
-
const [Da,
|
|
653
|
+
c && en && Le(c);
|
|
654
|
+
}, [c, en]);
|
|
655
|
+
const [Da, tn] = T(null), [$a, nn] = T(null), [ht, We] = T(!1), [Ra, ft] = T(!1), [le, Fe] = T(null), [ze, tt] = T(
|
|
656
656
|
d && "around" in d ? d.around : null
|
|
657
|
-
), [nt, xt] = T(null), He = As(n, (p == null ? void 0 : p.id) ?? null),
|
|
657
|
+
), [nt, xt] = T(null), He = As(n, (p == null ? void 0 : p.id) ?? null), an = oe(null), bt = oe(null), gt = oe(Math.max(0, i ?? 0)), Ue = oe(!1), Re = oe(null), sn = oe(null), re = oe(!d), Ge = oe(0), Qe = oe(null), vt = oe(0), at = () => {
|
|
658
658
|
const t = Re.current;
|
|
659
659
|
t && (t.scrollTop = t.scrollHeight);
|
|
660
660
|
}, yt = (t) => {
|
|
661
661
|
var N;
|
|
662
662
|
const m = (N = Re.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
|
|
663
|
-
return m ? (m.scrollIntoView({ block: "center" }), re.current = !1, tt(t), !0) :
|
|
664
|
-
},
|
|
663
|
+
return m ? (m.scrollIntoView({ block: "center" }), re.current = !1, tt(t), !0) : ge.reveal(t) ? (re.current = !1, tt(t), !0) : !1;
|
|
664
|
+
}, rn = (t) => {
|
|
665
665
|
We(!1), yt(t) || (Ue.current = !1, re.current = !1, tt(t), M({ around: t }));
|
|
666
666
|
};
|
|
667
667
|
ae(() => {
|
|
@@ -675,7 +675,7 @@ function In({
|
|
|
675
675
|
const t = Re.current, m = ((Ae = v[0]) == null ? void 0 : Ae.id) ?? null;
|
|
676
676
|
if (!Ue.current && v.length > 0) {
|
|
677
677
|
if (Ue.current = !0, Ge.current = v.length, Qe.current = m, ze != null && yt(ze)) return;
|
|
678
|
-
|
|
678
|
+
bt.current && !W ? (bt.current.scrollIntoView({ block: "center" }), re.current = !1) : W || (at(), re.current = !0);
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
681
681
|
if (m !== Qe.current && Qe.current != null && t) {
|
|
@@ -693,7 +693,7 @@ function In({
|
|
|
693
693
|
Fe((pe) => ({ count: ((pe == null ? void 0 : pe.count) ?? 0) + N, firstId: (pe == null ? void 0 : pe.firstId) ?? De.id }));
|
|
694
694
|
}
|
|
695
695
|
}, [v]), ae(() => {
|
|
696
|
-
const t =
|
|
696
|
+
const t = sn.current;
|
|
697
697
|
if (!t || typeof ResizeObserver > "u") return;
|
|
698
698
|
const m = new ResizeObserver(() => {
|
|
699
699
|
var N;
|
|
@@ -708,7 +708,7 @@ function In({
|
|
|
708
708
|
const m = Date.now() - new Date(t.date_created).getTime();
|
|
709
709
|
m > 0 && m < 5 * 6e4 && Math.random() < 0.2 && u.request(Be("/chat/health/delivery", { ms: m })).catch(() => {
|
|
710
710
|
});
|
|
711
|
-
}, [(
|
|
711
|
+
}, [(hn = v[v.length - 1]) == null ? void 0 : hn.id]), ae(() => {
|
|
712
712
|
if (!nt || !ce) return;
|
|
713
713
|
if (v.some(
|
|
714
714
|
(N) => (N.sender_name ?? "").toLowerCase() === ce.toLowerCase() && new Date(N.date_created).getTime() >= nt - 5e3
|
|
@@ -746,7 +746,7 @@ function In({
|
|
|
746
746
|
const m = ce.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
747
747
|
new RegExp(`@\\[?${m}\\]?\\b`, "i").test(t) && xt(Date.now());
|
|
748
748
|
}
|
|
749
|
-
}, Pe = (
|
|
749
|
+
}, Pe = (fn = p == null ? void 0 : p.id) == null ? void 0 : fn.toLowerCase(), me = Xe && et.trim().length > 0, we = fe(
|
|
750
750
|
() => me ? v.filter((t) => t.message.toLowerCase().includes(et.trim().toLowerCase())) : v,
|
|
751
751
|
[v, me, et]
|
|
752
752
|
), Ma = fe(() => {
|
|
@@ -755,20 +755,20 @@ function In({
|
|
|
755
755
|
for (let m = we.length - 1; m >= 0; m--)
|
|
756
756
|
if (((t = we[m].sender) == null ? void 0 : t.toLowerCase()) === Pe) return m;
|
|
757
757
|
return -1;
|
|
758
|
-
}, [we, Pe, me]),
|
|
758
|
+
}, [we, Pe, me]), ln = be ? new Date(be).getTime() : 0, Ie = Pt().chat_density === "compact" ? "compact" : "comfortable", on = oe(null), Oa = fe(() => we.map((t) => t.id), [we]), ge = yr({
|
|
759
759
|
scrollerRef: Re,
|
|
760
|
-
listRef:
|
|
760
|
+
listRef: on,
|
|
761
761
|
ids: Oa,
|
|
762
762
|
estimate: Ie === "compact" ? 40 : 72,
|
|
763
763
|
resetKey: `${n}|${JSON.stringify(W)}|${me ? "search" : ""}`,
|
|
764
764
|
pinnedRef: re
|
|
765
|
-
}), z = (y == null ? void 0 : y.channel) ?? null,
|
|
765
|
+
}), z = (y == null ? void 0 : y.channel) ?? null, cn = !!z && !!p && String(z.created_by ?? "").toUpperCase() === p.id.toUpperCase(), dn = z != null && z.announce && !cn && !F ? z.id === Xn ? "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, un = p ? Ne(n, p.id) : null, La = Wt(un);
|
|
766
766
|
ua();
|
|
767
|
-
const Pa =
|
|
767
|
+
const Pa = un ? vr(La, S, /* @__PURE__ */ new Date()) : null;
|
|
768
768
|
or(), fr();
|
|
769
|
-
const Ia = !!(z != null && z.welcome_note) && !!(y != null && y.joined) && !(y != null && y.welcome_seen_at) && !z.is_direct, ja = (t, m) => t.entity ? /* @__PURE__ */ e(
|
|
770
|
-
var
|
|
771
|
-
const N = ((
|
|
769
|
+
const Ia = !!(z != null && z.welcome_note) && !!(y != null && y.joined) && !(y != null && y.welcome_seen_at) && !z.is_direct, ja = (t, m) => t.entity ? /* @__PURE__ */ e(In, { token: t.text, url: h.entityUrl(t.entity) }, m) : t.mention ? /* @__PURE__ */ e("span", { className: b("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), qa = (t, m) => t.entity ? /* @__PURE__ */ e(In, { token: t.text, url: h.entityUrl(t.entity), mine: !0 }, m) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), mn = (t, m = {}) => {
|
|
770
|
+
var Cn, _n;
|
|
771
|
+
const N = ((Cn = t.sender) == null ? void 0 : Cn.toLowerCase()) === Pe;
|
|
772
772
|
if (t.is_system)
|
|
773
773
|
return /* @__PURE__ */ e(
|
|
774
774
|
"div",
|
|
@@ -785,23 +785,23 @@ function In({
|
|
|
785
785
|
] })
|
|
786
786
|
}
|
|
787
787
|
);
|
|
788
|
-
const Q = m.isLastMine &&
|
|
788
|
+
const Q = m.isLastMine && ln > 0 && new Date(t.date_created).getTime() <= ln, Y = !!t.deleted_at, Ae = N && !Y && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, je = !Y && (N || F), De = _a === t.id, pe = /* @__PURE__ */ new Map();
|
|
789
789
|
for (const D of t.reactions ?? []) {
|
|
790
|
-
const
|
|
791
|
-
|
|
790
|
+
const L = pe.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
|
|
791
|
+
L.count++, ((_n = D.user) == null ? void 0 : _n.toLowerCase()) === Pe && (L.mine = !0), D.user_name && L.names.push(D.user_name), pe.set(D.emoji, L);
|
|
792
792
|
}
|
|
793
793
|
const qe = "rounded-full p-0.5 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200";
|
|
794
794
|
return /* @__PURE__ */ a(
|
|
795
795
|
"div",
|
|
796
796
|
{
|
|
797
|
-
className:
|
|
797
|
+
className: b(
|
|
798
798
|
"group/msg flex gap-2 rounded-lg transition-colors",
|
|
799
799
|
N && "flex-row-reverse",
|
|
800
800
|
ze === t.id && "bg-nvr-cyan/[0.12]"
|
|
801
801
|
),
|
|
802
802
|
"data-chat-msg": t.id,
|
|
803
803
|
children: [
|
|
804
|
-
!N && /* @__PURE__ */ e(
|
|
804
|
+
!N && /* @__PURE__ */ e(Ot, { userId: t.sender, children: /* @__PURE__ */ e(
|
|
805
805
|
"button",
|
|
806
806
|
{
|
|
807
807
|
type: "button",
|
|
@@ -811,7 +811,7 @@ function In({
|
|
|
811
811
|
children: /* @__PURE__ */ e(Z, { id: t.sender, name: t.sender_name, size: Ie === "compact" ? 22 : 26 })
|
|
812
812
|
}
|
|
813
813
|
) }),
|
|
814
|
-
/* @__PURE__ */ a("div", { className:
|
|
814
|
+
/* @__PURE__ */ a("div", { className: b("relative max-w-[78%]", N && "text-right"), children: [
|
|
815
815
|
!N && m.showSender !== !1 && /* @__PURE__ */ a("p", { className: "mb-0.5 text-[10.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
816
816
|
t.sender_name ?? "Unknown",
|
|
817
817
|
t.masquerade_admin_name && /* @__PURE__ */ a(
|
|
@@ -830,7 +830,7 @@ function In({
|
|
|
830
830
|
!Y && !De && /* @__PURE__ */ a(
|
|
831
831
|
"div",
|
|
832
832
|
{
|
|
833
|
-
className:
|
|
833
|
+
className: b(
|
|
834
834
|
"absolute -top-3 z-10 hidden items-center gap-0.5 rounded-full border px-1 py-0.5 shadow-sm group-hover/msg:flex",
|
|
835
835
|
Ua === t.id && "flex",
|
|
836
836
|
f.surface,
|
|
@@ -856,7 +856,7 @@ function In({
|
|
|
856
856
|
label: "More reactions",
|
|
857
857
|
className: qe,
|
|
858
858
|
onPick: (D) => A.mutate({ messageId: t.id, emoji: D }),
|
|
859
|
-
onOpenChange: (D) =>
|
|
859
|
+
onOpenChange: (D) => Jt(D ? t.id : null)
|
|
860
860
|
}
|
|
861
861
|
),
|
|
862
862
|
!m.inThread && !t.parent_id && /* @__PURE__ */ e(
|
|
@@ -877,7 +877,7 @@ function In({
|
|
|
877
877
|
{
|
|
878
878
|
type: "button",
|
|
879
879
|
title: "Quote",
|
|
880
|
-
onClick: () => m.inThread ?
|
|
880
|
+
onClick: () => m.inThread ? nn(t) : tn(t),
|
|
881
881
|
className: qe,
|
|
882
882
|
"data-chat-quote": !0,
|
|
883
883
|
children: /* @__PURE__ */ e(ls, { className: "h-3 w-3" })
|
|
@@ -912,7 +912,7 @@ function In({
|
|
|
912
912
|
type: "button",
|
|
913
913
|
title: w.some((D) => D.id === t.id) ? "Unpin" : "Pin",
|
|
914
914
|
onClick: () => P.mutate(t.id),
|
|
915
|
-
className:
|
|
915
|
+
className: b(
|
|
916
916
|
"rounded-full p-0.5",
|
|
917
917
|
w.some((D) => D.id === t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
|
|
918
918
|
),
|
|
@@ -925,7 +925,7 @@ function In({
|
|
|
925
925
|
type: "button",
|
|
926
926
|
title: $e.has(t.id) ? "Remove from saved" : "Save for later (personal bookmark)",
|
|
927
927
|
onClick: () => k.mutate(t.id),
|
|
928
|
-
className:
|
|
928
|
+
className: b(
|
|
929
929
|
"rounded-full p-0.5",
|
|
930
930
|
$e.has(t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
|
|
931
931
|
),
|
|
@@ -938,7 +938,7 @@ function In({
|
|
|
938
938
|
type: "button",
|
|
939
939
|
title: "Edit",
|
|
940
940
|
onClick: () => {
|
|
941
|
-
mt(t.id),
|
|
941
|
+
mt(t.id), Kt(t.message), pt(null);
|
|
942
942
|
},
|
|
943
943
|
className: qe,
|
|
944
944
|
children: /* @__PURE__ */ e(ds, { className: "h-3 w-3" })
|
|
@@ -971,7 +971,7 @@ function In({
|
|
|
971
971
|
messageId: t.id,
|
|
972
972
|
actions: $r(Ta, t, Pe),
|
|
973
973
|
navigate: h.navigate,
|
|
974
|
-
onOpenChange: (D) =>
|
|
974
|
+
onOpenChange: (D) => Jt(D ? t.id : null)
|
|
975
975
|
}
|
|
976
976
|
)
|
|
977
977
|
]
|
|
@@ -980,7 +980,7 @@ function In({
|
|
|
980
980
|
t.urgent && !Y && /* @__PURE__ */ a(
|
|
981
981
|
"p",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: b(
|
|
984
984
|
"mb-0.5 flex items-center gap-1 text-[10.5px] font-semibold text-red-600 dark:text-red-400",
|
|
985
985
|
N && "justify-end"
|
|
986
986
|
),
|
|
@@ -997,20 +997,20 @@ function In({
|
|
|
997
997
|
className: "flex items-center gap-1",
|
|
998
998
|
onSubmit: (D) => {
|
|
999
999
|
D.preventDefault();
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1000
|
+
const L = Qt.trim();
|
|
1001
|
+
L && L !== t.message && ne.mutate({ messageId: t.id, text: L }), mt(null);
|
|
1002
1002
|
},
|
|
1003
1003
|
children: [
|
|
1004
1004
|
/* @__PURE__ */ e(
|
|
1005
1005
|
"input",
|
|
1006
1006
|
{
|
|
1007
1007
|
autoFocus: !0,
|
|
1008
|
-
value:
|
|
1009
|
-
onChange: (D) =>
|
|
1008
|
+
value: Qt,
|
|
1009
|
+
onChange: (D) => Kt(D.target.value),
|
|
1010
1010
|
onKeyDown: (D) => {
|
|
1011
1011
|
D.key === "Escape" && mt(null);
|
|
1012
1012
|
},
|
|
1013
|
-
className:
|
|
1013
|
+
className: b(
|
|
1014
1014
|
"h-8 w-[240px] rounded-lg border px-2 text-[12px] outline-none",
|
|
1015
1015
|
f.input
|
|
1016
1016
|
),
|
|
@@ -1021,7 +1021,7 @@ function In({
|
|
|
1021
1021
|
"button",
|
|
1022
1022
|
{
|
|
1023
1023
|
type: "submit",
|
|
1024
|
-
className:
|
|
1024
|
+
className: b("rounded-md px-1.5 py-1 text-[11px] font-medium", f.accentText),
|
|
1025
1025
|
children: "Save"
|
|
1026
1026
|
}
|
|
1027
1027
|
)
|
|
@@ -1030,10 +1030,10 @@ function In({
|
|
|
1030
1030
|
) : /* @__PURE__ */ a(
|
|
1031
1031
|
"div",
|
|
1032
1032
|
{
|
|
1033
|
-
className:
|
|
1033
|
+
className: b(
|
|
1034
1034
|
"inline-block max-w-full rounded-2xl text-left leading-snug",
|
|
1035
1035
|
Ie === "compact" ? "px-2.5 py-1 text-[12px]" : "px-3 py-1.5 text-[12.5px]",
|
|
1036
|
-
N ?
|
|
1036
|
+
N ? b("rounded-br-md", f.bubbleMine) : b("rounded-bl-md", f.bubbleOther),
|
|
1037
1037
|
t.urgent && "ring-2 ring-red-400/70"
|
|
1038
1038
|
),
|
|
1039
1039
|
children: [
|
|
@@ -1041,8 +1041,8 @@ function In({
|
|
|
1041
1041
|
"button",
|
|
1042
1042
|
{
|
|
1043
1043
|
type: "button",
|
|
1044
|
-
onClick: () =>
|
|
1045
|
-
className:
|
|
1044
|
+
onClick: () => rn(t.quote.id),
|
|
1045
|
+
className: b(
|
|
1046
1046
|
"mb-1 block w-full rounded-md border-l-2 px-2 py-1 text-left text-[11px]",
|
|
1047
1047
|
N ? "border-white/60 bg-black/10" : "border-slate-400 bg-white/70 dark:border-slate-500 dark:bg-black/20"
|
|
1048
1048
|
),
|
|
@@ -1053,10 +1053,10 @@ function In({
|
|
|
1053
1053
|
]
|
|
1054
1054
|
}
|
|
1055
1055
|
),
|
|
1056
|
-
t.message &&
|
|
1056
|
+
t.message && An(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
|
|
1057
1057
|
Rr,
|
|
1058
1058
|
{
|
|
1059
|
-
text:
|
|
1059
|
+
text: An(t.message),
|
|
1060
1060
|
mine: N,
|
|
1061
1061
|
renderToken: N ? qa : ja,
|
|
1062
1062
|
entityPattern: h.entityPattern,
|
|
@@ -1064,22 +1064,22 @@ function In({
|
|
|
1064
1064
|
navigate: h.navigate
|
|
1065
1065
|
}
|
|
1066
1066
|
)),
|
|
1067
|
-
|
|
1067
|
+
Mn(t.message) != null && /* @__PURE__ */ e(
|
|
1068
1068
|
Nr,
|
|
1069
1069
|
{
|
|
1070
|
-
id:
|
|
1070
|
+
id: Mn(t.message),
|
|
1071
1071
|
mine: N,
|
|
1072
|
-
renderAvatar: (D,
|
|
1072
|
+
renderAvatar: (D, L) => /* @__PURE__ */ e(Z, { id: D, name: L, size: 18, presence: !1 })
|
|
1073
1073
|
}
|
|
1074
1074
|
),
|
|
1075
1075
|
t.poll && /* @__PURE__ */ e(Mr, { poll: t.poll, room: t.room, mine: N }),
|
|
1076
|
-
(t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className:
|
|
1077
|
-
const
|
|
1076
|
+
(t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: b("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((D) => {
|
|
1077
|
+
const L = kt == null ? void 0 : kt.get(D), rt = (L == null ? void 0 : L.title) || (L == null ? void 0 : L.filename_download) || "Attachment", wt = u.fileUrl(D), Ea = ((L == null ? void 0 : L.type) ?? "").startsWith("image/"), lt = Br(L == null ? void 0 : L.tags, L == null ? void 0 : L.type), Sn = () => Zt({
|
|
1078
1078
|
id: D,
|
|
1079
1079
|
url: wt,
|
|
1080
1080
|
name: rt,
|
|
1081
|
-
type: (
|
|
1082
|
-
size: (
|
|
1081
|
+
type: (L == null ? void 0 : L.type) ?? null,
|
|
1082
|
+
size: (L == null ? void 0 : L.filesize) ?? null
|
|
1083
1083
|
}), ot = q && ve.length > 0 ? /* @__PURE__ */ e(
|
|
1084
1084
|
Vr,
|
|
1085
1085
|
{
|
|
@@ -1103,7 +1103,7 @@ function In({
|
|
|
1103
1103
|
"button",
|
|
1104
1104
|
{
|
|
1105
1105
|
type: "button",
|
|
1106
|
-
onClick:
|
|
1106
|
+
onClick: Sn,
|
|
1107
1107
|
className: "block cursor-zoom-in",
|
|
1108
1108
|
children: /* @__PURE__ */ e(
|
|
1109
1109
|
"img",
|
|
@@ -1122,8 +1122,8 @@ function In({
|
|
|
1122
1122
|
"button",
|
|
1123
1123
|
{
|
|
1124
1124
|
type: "button",
|
|
1125
|
-
onClick:
|
|
1126
|
-
className:
|
|
1125
|
+
onClick: Sn,
|
|
1126
|
+
className: b(
|
|
1127
1127
|
"inline-flex max-w-[220px] items-center gap-1.5 rounded-lg border px-2 py-1 text-[11.5px]",
|
|
1128
1128
|
N ? "border-white/30 bg-white/10" : "border-slate-200 bg-white dark:border-border dark:bg-card"
|
|
1129
1129
|
),
|
|
@@ -1139,7 +1139,7 @@ function In({
|
|
|
1139
1139
|
]
|
|
1140
1140
|
}
|
|
1141
1141
|
),
|
|
1142
|
-
!Y && !De && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className:
|
|
1142
|
+
!Y && !De && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: b(N && "flex justify-end"), children: /* @__PURE__ */ e(
|
|
1143
1143
|
Ar,
|
|
1144
1144
|
{
|
|
1145
1145
|
text: t.message,
|
|
@@ -1150,21 +1150,21 @@ function In({
|
|
|
1150
1150
|
pe.size > 0 && /* @__PURE__ */ e(
|
|
1151
1151
|
"div",
|
|
1152
1152
|
{
|
|
1153
|
-
className:
|
|
1153
|
+
className: b("mt-0.5 flex flex-wrap gap-1", N && "justify-end"),
|
|
1154
1154
|
"data-chat-reactions": !0,
|
|
1155
|
-
children: [...pe.entries()].map(([D,
|
|
1155
|
+
children: [...pe.entries()].map(([D, L]) => /* @__PURE__ */ a(
|
|
1156
1156
|
"button",
|
|
1157
1157
|
{
|
|
1158
1158
|
type: "button",
|
|
1159
|
-
title:
|
|
1159
|
+
title: L.names.join(", "),
|
|
1160
1160
|
onClick: () => A.mutate({ messageId: t.id, emoji: D }),
|
|
1161
|
-
className:
|
|
1161
|
+
className: b(
|
|
1162
1162
|
"inline-flex items-center gap-0.5 rounded-full border px-1.5 py-px text-[10.5px] leading-tight transition-colors",
|
|
1163
|
-
|
|
1163
|
+
L.mine ? b("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
1164
|
),
|
|
1165
1165
|
children: [
|
|
1166
|
-
/* @__PURE__ */ e(
|
|
1167
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums", children:
|
|
1166
|
+
/* @__PURE__ */ e(br, { value: D }),
|
|
1167
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: L.count })
|
|
1168
1168
|
]
|
|
1169
1169
|
},
|
|
1170
1170
|
D
|
|
@@ -1176,7 +1176,7 @@ function In({
|
|
|
1176
1176
|
{
|
|
1177
1177
|
type: "button",
|
|
1178
1178
|
onClick: () => Le(t.id),
|
|
1179
|
-
className:
|
|
1179
|
+
className: b(
|
|
1180
1180
|
"mt-1 flex items-center gap-1.5 rounded-md px-1 py-0.5 text-[11px] font-medium hover:bg-slate-100 dark:hover:bg-muted",
|
|
1181
1181
|
f.accentText,
|
|
1182
1182
|
N && "ml-auto"
|
|
@@ -1189,7 +1189,7 @@ function In({
|
|
|
1189
1189
|
t.thread.count === 1 ? "reply" : "replies",
|
|
1190
1190
|
t.thread.last_reply_at && /* @__PURE__ */ a("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: [
|
|
1191
1191
|
"· last ",
|
|
1192
|
-
|
|
1192
|
+
Hn(t.thread.last_reply_at)
|
|
1193
1193
|
] })
|
|
1194
1194
|
]
|
|
1195
1195
|
}
|
|
@@ -1217,18 +1217,18 @@ function In({
|
|
|
1217
1217
|
minute: "2-digit"
|
|
1218
1218
|
}),
|
|
1219
1219
|
N && Se && !Y && (() => {
|
|
1220
|
-
var
|
|
1220
|
+
var L;
|
|
1221
1221
|
const D = Oe(t);
|
|
1222
1222
|
return D.length === 0 ? null : /* @__PURE__ */ e(
|
|
1223
1223
|
tl,
|
|
1224
1224
|
{
|
|
1225
1225
|
seen: D,
|
|
1226
|
-
channelId: ((
|
|
1226
|
+
channelId: ((L = y == null ? void 0 : y.channel) == null ? void 0 : L.id) ?? null,
|
|
1227
1227
|
senderId: String(t.sender ?? "")
|
|
1228
1228
|
}
|
|
1229
1229
|
);
|
|
1230
1230
|
})(),
|
|
1231
|
-
m.isLastMine && n.startsWith("dm:") && (Q ? /* @__PURE__ */ a("span", { className:
|
|
1231
|
+
m.isLastMine && n.startsWith("dm:") && (Q ? /* @__PURE__ */ a("span", { className: b("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
|
|
1232
1232
|
/* @__PURE__ */ e(fs, { className: "h-3 w-3", strokeWidth: 2.4 }),
|
|
1233
1233
|
" Read"
|
|
1234
1234
|
] }) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-0.5", children: [
|
|
@@ -1240,17 +1240,17 @@ function In({
|
|
|
1240
1240
|
]
|
|
1241
1241
|
}
|
|
1242
1242
|
);
|
|
1243
|
-
},
|
|
1243
|
+
}, pn = (t) => /* @__PURE__ */ e(
|
|
1244
1244
|
Fs,
|
|
1245
1245
|
{
|
|
1246
|
-
ref: t ? void 0 :
|
|
1246
|
+
ref: t ? void 0 : an,
|
|
1247
1247
|
room: n,
|
|
1248
1248
|
label: S,
|
|
1249
1249
|
parentId: t,
|
|
1250
1250
|
quote: t ? $a : Da,
|
|
1251
|
-
onClearQuote: () => t ?
|
|
1251
|
+
onClearQuote: () => t ? nn(null) : tn(null),
|
|
1252
1252
|
onSent: Aa,
|
|
1253
|
-
disabledReason: t ? null :
|
|
1253
|
+
disabledReason: t ? null : dn,
|
|
1254
1254
|
quietNote: Pa,
|
|
1255
1255
|
th: f,
|
|
1256
1256
|
renderAvatar: (m, N) => /* @__PURE__ */ e(Z, { id: m, name: N, size: 22, presence: m !== "__bot__" })
|
|
@@ -1262,14 +1262,14 @@ function In({
|
|
|
1262
1262
|
className: "relative flex h-full min-h-0 flex-col",
|
|
1263
1263
|
"data-chat-room": n,
|
|
1264
1264
|
onDragOver: (t) => {
|
|
1265
|
-
t.dataTransfer.types.includes("Files") && !
|
|
1265
|
+
t.dataTransfer.types.includes("Files") && !dn && (t.preventDefault(), ft(!0));
|
|
1266
1266
|
},
|
|
1267
1267
|
onDragLeave: (t) => {
|
|
1268
1268
|
t.currentTarget.contains(t.relatedTarget) || ft(!1);
|
|
1269
1269
|
},
|
|
1270
1270
|
onDrop: (t) => {
|
|
1271
1271
|
var m;
|
|
1272
|
-
t.dataTransfer.files.length && (t.preventDefault(), ft(!1), (m =
|
|
1272
|
+
t.dataTransfer.files.length && (t.preventDefault(), ft(!1), (m = an.current) == null || m.addFiles([...t.dataTransfer.files]));
|
|
1273
1273
|
},
|
|
1274
1274
|
children: [
|
|
1275
1275
|
Ra && /* @__PURE__ */ e(
|
|
@@ -1280,7 +1280,7 @@ function In({
|
|
|
1280
1280
|
children: "Drop to attach to your message"
|
|
1281
1281
|
}
|
|
1282
1282
|
),
|
|
1283
|
-
/* @__PURE__ */ a("div", { className:
|
|
1283
|
+
/* @__PURE__ */ a("div", { className: b("flex shrink-0 items-center gap-1.5 border-b px-3 py-2", f.divider), children: [
|
|
1284
1284
|
/* @__PURE__ */ e(
|
|
1285
1285
|
"button",
|
|
1286
1286
|
{
|
|
@@ -1291,12 +1291,12 @@ function In({
|
|
|
1291
1291
|
children: /* @__PURE__ */ e(ct, { className: "h-4 w-4", strokeWidth: 2 })
|
|
1292
1292
|
}
|
|
1293
1293
|
),
|
|
1294
|
-
((y == null ? void 0 : y.kind) === "channel" && !((
|
|
1294
|
+
((y == null ? void 0 : y.kind) === "channel" && !((xn = y.channel) != null && xn.is_direct) || (y == null ? void 0 : y.kind) === "global" && (((bn = y.channel) == null ? void 0 : bn.icon) || ((gn = y.channel) == null ? void 0 : gn.color))) && /* @__PURE__ */ e(Ke, { icon: (vn = y == null ? void 0 : y.channel) == null ? void 0 : vn.icon, color: (yn = y == null ? void 0 : y.channel) == null ? void 0 : yn.color, size: 24 }),
|
|
1295
1295
|
p && Ne(n, p.id) && /* @__PURE__ */ e(Hr, { peerId: Ne(n, p.id), name: S }),
|
|
1296
1296
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1297
1297
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
1298
1298
|
/* @__PURE__ */ e("span", { className: "truncate", children: S }),
|
|
1299
|
-
y && /* @__PURE__ */ e(Or, { starred: !!y.starred, notify:
|
|
1299
|
+
y && /* @__PURE__ */ e(Or, { starred: !!y.starred, notify: Ht }),
|
|
1300
1300
|
(z == null ? void 0 : z.announce) && /* @__PURE__ */ e(
|
|
1301
1301
|
"span",
|
|
1302
1302
|
{
|
|
@@ -1310,7 +1310,7 @@ function In({
|
|
|
1310
1310
|
Pr,
|
|
1311
1311
|
{
|
|
1312
1312
|
room: n,
|
|
1313
|
-
me: ((
|
|
1313
|
+
me: ((kn = h.me) == null ? void 0 : kn.id) ?? null,
|
|
1314
1314
|
renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 24 })
|
|
1315
1315
|
}
|
|
1316
1316
|
) : null
|
|
@@ -1320,7 +1320,7 @@ function In({
|
|
|
1320
1320
|
{
|
|
1321
1321
|
room: n,
|
|
1322
1322
|
roomLabel: S,
|
|
1323
|
-
huddle:
|
|
1323
|
+
huddle: g,
|
|
1324
1324
|
renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 18, presence: !1 })
|
|
1325
1325
|
}
|
|
1326
1326
|
),
|
|
@@ -1329,16 +1329,16 @@ function In({
|
|
|
1329
1329
|
{
|
|
1330
1330
|
type: "button",
|
|
1331
1331
|
onClick: () => {
|
|
1332
|
-
Ca((t) => !t),
|
|
1332
|
+
Ca((t) => !t), Gt("");
|
|
1333
1333
|
},
|
|
1334
|
-
className:
|
|
1334
|
+
className: b(Ln, Xe ? f.accentSoft : On),
|
|
1335
1335
|
"aria-label": "Search in this conversation",
|
|
1336
1336
|
"aria-pressed": Xe,
|
|
1337
1337
|
"data-tip": "Search this conversation",
|
|
1338
|
-
children: /* @__PURE__ */ e(
|
|
1338
|
+
children: /* @__PURE__ */ e(Fn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1339
1339
|
}
|
|
1340
1340
|
),
|
|
1341
|
-
((
|
|
1341
|
+
((wn = y == null ? void 0 : y.channel) == null ? void 0 : wn.is_direct) && /* @__PURE__ */ e(nl, { channel: y.channel, onLeft: l }),
|
|
1342
1342
|
/* @__PURE__ */ e(
|
|
1343
1343
|
"button",
|
|
1344
1344
|
{
|
|
@@ -1346,7 +1346,7 @@ function In({
|
|
|
1346
1346
|
onClick: () => {
|
|
1347
1347
|
Le(null), We((t) => !t);
|
|
1348
1348
|
},
|
|
1349
|
-
className:
|
|
1349
|
+
className: b(Ln, ht ? f.accentSoft : On),
|
|
1350
1350
|
"aria-label": "Room info — members, pinned, files and links",
|
|
1351
1351
|
"aria-pressed": ht,
|
|
1352
1352
|
"data-tip": "Room info — members, pinned, files and links",
|
|
@@ -1358,7 +1358,7 @@ function In({
|
|
|
1358
1358
|
Lr,
|
|
1359
1359
|
{
|
|
1360
1360
|
th: f,
|
|
1361
|
-
huddleSchedule:
|
|
1361
|
+
huddleSchedule: g.enabled ? (t) => /* @__PURE__ */ e(
|
|
1362
1362
|
Cr,
|
|
1363
1363
|
{
|
|
1364
1364
|
room: n,
|
|
@@ -1369,8 +1369,8 @@ function In({
|
|
|
1369
1369
|
}
|
|
1370
1370
|
) : void 0,
|
|
1371
1371
|
starred: y ? !!y.starred : void 0,
|
|
1372
|
-
onStar: y ? () =>
|
|
1373
|
-
notify: y ?
|
|
1372
|
+
onStar: y ? () => ba.mutate({ room: n, starred: !y.starred }) : void 0,
|
|
1373
|
+
notify: y ? Ht : void 0,
|
|
1374
1374
|
onNotify: y ? (t) => {
|
|
1375
1375
|
t === "muted" ? J.mutate({ room: n, muted: !0 }) : (y.muted && J.mutate({ room: n, muted: !1 }), fa.mutate({ room: n, mode: t }));
|
|
1376
1376
|
} : void 0,
|
|
@@ -1381,7 +1381,7 @@ function In({
|
|
|
1381
1381
|
var t;
|
|
1382
1382
|
return (t = h.navigate) == null ? void 0 : t.call(h, de);
|
|
1383
1383
|
} : void 0,
|
|
1384
|
-
onTeamsCall: n.startsWith("dm:") || (
|
|
1384
|
+
onTeamsCall: n.startsWith("dm:") || (Nn = y == null ? void 0 : y.channel) != null && Nn.is_direct ? async () => {
|
|
1385
1385
|
var t, m;
|
|
1386
1386
|
try {
|
|
1387
1387
|
let N = [];
|
|
@@ -1442,18 +1442,18 @@ function In({
|
|
|
1442
1442
|
{
|
|
1443
1443
|
room: n,
|
|
1444
1444
|
me: p,
|
|
1445
|
-
huddle:
|
|
1445
|
+
huddle: g,
|
|
1446
1446
|
renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 18, presence: !1 })
|
|
1447
1447
|
}
|
|
1448
1448
|
),
|
|
1449
|
-
Xe && /* @__PURE__ */ e("div", { className:
|
|
1449
|
+
Xe && /* @__PURE__ */ e("div", { className: b("shrink-0 border-b px-3 py-1.5", f.divider), children: /* @__PURE__ */ e(
|
|
1450
1450
|
"input",
|
|
1451
1451
|
{
|
|
1452
1452
|
autoFocus: !0,
|
|
1453
1453
|
value: et,
|
|
1454
|
-
onChange: (t) =>
|
|
1454
|
+
onChange: (t) => Gt(t.target.value),
|
|
1455
1455
|
placeholder: "Search messages…",
|
|
1456
|
-
className:
|
|
1456
|
+
className: b("h-7 w-full rounded-md border px-2 text-[12px] outline-none", f.input),
|
|
1457
1457
|
"aria-label": "Search messages"
|
|
1458
1458
|
}
|
|
1459
1459
|
) }),
|
|
@@ -1467,7 +1467,7 @@ function In({
|
|
|
1467
1467
|
navigate: h.navigate
|
|
1468
1468
|
}
|
|
1469
1469
|
),
|
|
1470
|
-
w.length > 0 && /* @__PURE__ */ e("div", { className:
|
|
1470
|
+
w.length > 0 && /* @__PURE__ */ e("div", { className: b("shrink-0 border-b px-3 py-1", f.divider), "data-chat-pins-strip": !0, children: /* @__PURE__ */ a(
|
|
1471
1471
|
"button",
|
|
1472
1472
|
{
|
|
1473
1473
|
type: "button",
|
|
@@ -1483,7 +1483,7 @@ function In({
|
|
|
1483
1483
|
]
|
|
1484
1484
|
}
|
|
1485
1485
|
) }),
|
|
1486
|
-
(z == null ? void 0 : z.archive_suggested_at) && z.id !== 0 && (
|
|
1486
|
+
(z == null ? void 0 : z.archive_suggested_at) && z.id !== 0 && (cn || F) && /* @__PURE__ */ e(
|
|
1487
1487
|
Ls,
|
|
1488
1488
|
{
|
|
1489
1489
|
channelId: z.id,
|
|
@@ -1497,7 +1497,7 @@ function In({
|
|
|
1497
1497
|
note: z.welcome_note,
|
|
1498
1498
|
channelName: S,
|
|
1499
1499
|
th: f,
|
|
1500
|
-
onDismiss: () =>
|
|
1500
|
+
onDismiss: () => ga.mutate(n)
|
|
1501
1501
|
}
|
|
1502
1502
|
),
|
|
1503
1503
|
/* @__PURE__ */ e(
|
|
@@ -1506,11 +1506,11 @@ function In({
|
|
|
1506
1506
|
ref: Re,
|
|
1507
1507
|
onScroll: (t) => {
|
|
1508
1508
|
const m = t.currentTarget;
|
|
1509
|
-
re.current = m.scrollHeight - m.scrollTop - m.clientHeight < 48, vt.current = m.scrollHeight, re.current && le && Fe(null),
|
|
1509
|
+
re.current = m.scrollHeight - m.scrollTop - m.clientHeight < 48, vt.current = m.scrollHeight, re.current && le && Fe(null), ge.onScroll(), m.scrollTop < 200 && R && !V && !me && Ue.current && H();
|
|
1510
1510
|
},
|
|
1511
1511
|
className: "relative min-h-0 flex-1 overflow-y-auto px-3 py-3 [overflow-anchor:none]",
|
|
1512
1512
|
"data-chat-messages": !0,
|
|
1513
|
-
children: /* @__PURE__ */ a("div", { ref:
|
|
1513
|
+
children: /* @__PURE__ */ a("div", { ref: sn, className: Ie === "compact" ? "space-y-1" : "space-y-2.5", children: [
|
|
1514
1514
|
R && !me && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
|
|
1515
1515
|
"button",
|
|
1516
1516
|
{
|
|
@@ -1535,16 +1535,16 @@ function In({
|
|
|
1535
1535
|
] }) }) : /* @__PURE__ */ e(
|
|
1536
1536
|
"div",
|
|
1537
1537
|
{
|
|
1538
|
-
ref:
|
|
1539
|
-
style:
|
|
1540
|
-
"data-chat-rows":
|
|
1541
|
-
children: we.slice(
|
|
1538
|
+
ref: on,
|
|
1539
|
+
style: ge.windowed ? { paddingTop: ge.padTop, paddingBottom: ge.padBottom } : void 0,
|
|
1540
|
+
"data-chat-rows": ge.windowed ? "windowed" : "all",
|
|
1541
|
+
children: we.slice(ge.start, ge.end).map((t, m) => {
|
|
1542
1542
|
var De;
|
|
1543
|
-
const N =
|
|
1543
|
+
const N = ge.start + m, Q = we[N - 1], Y = N === 0 || Q && new Date(Q.date_created).toDateString() !== new Date(t.date_created).toDateString(), Ae = !me && !W && gt.current > 0 && N === Math.max(0, we.length - gt.current), je = Ie === "compact" && !Y && !!Q && Q.sender === t.sender && !Q.is_system && new Date(t.date_created).getTime() - new Date(Q.date_created).getTime() < 5 * 6e4;
|
|
1544
1544
|
return /* @__PURE__ */ a(
|
|
1545
1545
|
"div",
|
|
1546
1546
|
{
|
|
1547
|
-
ref:
|
|
1547
|
+
ref: ge.rowRef(t.id),
|
|
1548
1548
|
"data-chat-row": t.id,
|
|
1549
1549
|
className: N > 0 ? Ie === "compact" ? "pt-1" : "pt-2.5" : void 0,
|
|
1550
1550
|
children: [
|
|
@@ -1556,13 +1556,13 @@ function In({
|
|
|
1556
1556
|
Ae && /* @__PURE__ */ a(
|
|
1557
1557
|
"div",
|
|
1558
1558
|
{
|
|
1559
|
-
ref:
|
|
1559
|
+
ref: bt,
|
|
1560
1560
|
className: "my-2 flex items-center gap-2",
|
|
1561
1561
|
"data-chat-unread-divider": !0,
|
|
1562
1562
|
children: [
|
|
1563
1563
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-red-300 dark:bg-red-500/50" }),
|
|
1564
1564
|
/* @__PURE__ */ e("span", { className: "text-[11px] font-semibold text-red-600 dark:text-red-400", children: "New messages" }),
|
|
1565
|
-
|
|
1565
|
+
gt.current > 20 && /* @__PURE__ */ e(
|
|
1566
1566
|
"button",
|
|
1567
1567
|
{
|
|
1568
1568
|
type: "button",
|
|
@@ -1576,8 +1576,8 @@ function In({
|
|
|
1576
1576
|
]
|
|
1577
1577
|
}
|
|
1578
1578
|
),
|
|
1579
|
-
Ae &&
|
|
1580
|
-
|
|
1579
|
+
Ae && O && /* @__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: O }),
|
|
1580
|
+
mn(t, {
|
|
1581
1581
|
isLastMine: ((De = t.sender) == null ? void 0 : De.toLowerCase()) === Pe && N === Ma,
|
|
1582
1582
|
showSender: !je
|
|
1583
1583
|
})
|
|
@@ -1614,7 +1614,7 @@ function In({
|
|
|
1614
1614
|
}
|
|
1615
1615
|
le && !yt(le.firstId) && at(), Fe(null);
|
|
1616
1616
|
},
|
|
1617
|
-
className:
|
|
1617
|
+
className: b(
|
|
1618
1618
|
"pointer-events-auto rounded-full px-3 py-1 text-[11.5px] font-semibold shadow-md",
|
|
1619
1619
|
f.pill
|
|
1620
1620
|
),
|
|
@@ -1638,17 +1638,17 @@ function In({
|
|
|
1638
1638
|
]
|
|
1639
1639
|
}
|
|
1640
1640
|
) : te.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: te.typingText }) }),
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1641
|
+
Yt && /* @__PURE__ */ e(Ds, { file: Yt, onClose: () => Zt(null) }),
|
|
1642
|
+
pn(null),
|
|
1643
|
+
Vt != null && /* @__PURE__ */ e(
|
|
1644
1644
|
qr,
|
|
1645
1645
|
{
|
|
1646
1646
|
room: n,
|
|
1647
|
-
rootId:
|
|
1647
|
+
rootId: Vt,
|
|
1648
1648
|
th: f,
|
|
1649
1649
|
onClose: () => Le(null),
|
|
1650
|
-
renderRow: (t) =>
|
|
1651
|
-
renderComposer: (t) =>
|
|
1650
|
+
renderRow: (t) => mn(t, { inThread: !0 }),
|
|
1651
|
+
renderComposer: (t) => pn(t),
|
|
1652
1652
|
renderOutbox: (t) => /* @__PURE__ */ e(Zr, { room: n, parentId: t, th: f })
|
|
1653
1653
|
}
|
|
1654
1654
|
),
|
|
@@ -1660,7 +1660,7 @@ function In({
|
|
|
1660
1660
|
th: f,
|
|
1661
1661
|
pins: w,
|
|
1662
1662
|
onClose: () => We(!1),
|
|
1663
|
-
onOpenMessage:
|
|
1663
|
+
onOpenMessage: rn,
|
|
1664
1664
|
onUnpin: (t) => P.mutate(t),
|
|
1665
1665
|
navigate: h.navigate,
|
|
1666
1666
|
renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 22 })
|
|
@@ -1689,7 +1689,7 @@ function Vr({
|
|
|
1689
1689
|
title: `Attach to ${s}`,
|
|
1690
1690
|
"aria-label": `Attach to ${s}`,
|
|
1691
1691
|
"data-chat-attach-to-record": !0,
|
|
1692
|
-
children: /* @__PURE__ */ e(
|
|
1692
|
+
children: /* @__PURE__ */ e(bs, { className: "h-3 w-3" })
|
|
1693
1693
|
}
|
|
1694
1694
|
) }),
|
|
1695
1695
|
/* @__PURE__ */ a(Ve, { align: "end", className: "w-[220px] p-1.5", children: [
|
|
@@ -1712,7 +1712,7 @@ function Vr({
|
|
|
1712
1712
|
] })
|
|
1713
1713
|
] });
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function qn(n) {
|
|
1716
1716
|
return {
|
|
1717
1717
|
id: n.id,
|
|
1718
1718
|
visibility: n.visibility,
|
|
@@ -1728,7 +1728,7 @@ function Dt(n) {
|
|
|
1728
1728
|
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
1729
|
return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1731
|
+
function En(n) {
|
|
1732
1732
|
const s = n == null ? void 0 : n.trim();
|
|
1733
1733
|
return !s || Xr.test(s) ? null : s;
|
|
1734
1734
|
}
|
|
@@ -1741,7 +1741,7 @@ function tl({
|
|
|
1741
1741
|
channelId: s,
|
|
1742
1742
|
senderId: l
|
|
1743
1743
|
}) {
|
|
1744
|
-
const r = ie(), [o, i] = T(!1), { members: d } =
|
|
1744
|
+
const r = ie(), [o, i] = T(!1), { members: d } = jt(o ? s : null), c = new Set(n.map((u) => String(u.user).toUpperCase())), h = d.filter((u) => {
|
|
1745
1745
|
const p = String(u.user).toUpperCase();
|
|
1746
1746
|
return p !== l.toUpperCase() && !c.has(p);
|
|
1747
1747
|
}), f = [...n].sort(
|
|
@@ -1752,7 +1752,7 @@ function tl({
|
|
|
1752
1752
|
"button",
|
|
1753
1753
|
{
|
|
1754
1754
|
type: "button",
|
|
1755
|
-
className:
|
|
1755
|
+
className: b(
|
|
1756
1756
|
"font-medium underline decoration-dotted underline-offset-2 hover:decoration-solid",
|
|
1757
1757
|
r.accentText
|
|
1758
1758
|
),
|
|
@@ -1769,7 +1769,7 @@ function tl({
|
|
|
1769
1769
|
{
|
|
1770
1770
|
align: "end",
|
|
1771
1771
|
sideOffset: 4,
|
|
1772
|
-
className:
|
|
1772
|
+
className: b("w-[240px] p-0", r.surface),
|
|
1773
1773
|
"data-chat-seen-by-panel": !0,
|
|
1774
1774
|
children: [
|
|
1775
1775
|
/* @__PURE__ */ a("p", { className: "border-b border-slate-100 px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400 dark:border-border", children: [
|
|
@@ -1811,7 +1811,7 @@ function tl({
|
|
|
1811
1811
|
}
|
|
1812
1812
|
function nl({ channel: n, onLeft: s }) {
|
|
1813
1813
|
var B;
|
|
1814
|
-
const l = ie(), r = Me(), { isAdmin: o } = ut(), [i, d] = T(!1), { members: c, loading: h } =
|
|
1814
|
+
const l = ie(), r = Me(), { isAdmin: o } = ut(), [i, d] = T(!1), { members: c, loading: h } = jt(n.id), { addMember: f, removeMember: u } = Vn(n.id), [p, g] = T(""), U = Ft(p, 250), $ = ((B = r.me) == null ? void 0 : B.id.toUpperCase()) ?? "", C = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: S } = qt(U, i && C && !!p.trim()), W = new Set(c.map((R) => String(R.user).toUpperCase())), M = (R) => [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.user, v = [...c].sort((R, G) => {
|
|
1815
1815
|
const H = String(R.user).toUpperCase(), V = String(G.user).toUpperCase();
|
|
1816
1816
|
return H === $ ? -1 : V === $ ? 1 : M(R).localeCompare(M(G));
|
|
1817
1817
|
});
|
|
@@ -1822,7 +1822,7 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1822
1822
|
type: "button",
|
|
1823
1823
|
title: "People in this conversation",
|
|
1824
1824
|
"aria-label": "People in this conversation",
|
|
1825
|
-
className:
|
|
1825
|
+
className: b(
|
|
1826
1826
|
"flex items-center gap-1 rounded-md px-1 py-1 text-[11px] font-medium tabular-nums transition-colors",
|
|
1827
1827
|
i ? l.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
|
|
1828
1828
|
),
|
|
@@ -1838,10 +1838,10 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1838
1838
|
{
|
|
1839
1839
|
align: "end",
|
|
1840
1840
|
sideOffset: 6,
|
|
1841
|
-
className:
|
|
1841
|
+
className: b("w-[260px] p-0", l.surface),
|
|
1842
1842
|
"data-chat-group-members-panel": !0,
|
|
1843
1843
|
children: [
|
|
1844
|
-
/* @__PURE__ */ e("div", { className:
|
|
1844
|
+
/* @__PURE__ */ e("div", { className: b("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
1845
|
"In this conversation ",
|
|
1846
1846
|
c.length > 0 && `· ${c.length}`
|
|
1847
1847
|
] }) }),
|
|
@@ -1880,14 +1880,14 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1880
1880
|
);
|
|
1881
1881
|
})
|
|
1882
1882
|
] }),
|
|
1883
|
-
C && /* @__PURE__ */ a("div", { className:
|
|
1883
|
+
C && /* @__PURE__ */ a("div", { className: b("border-t px-3 py-2", l.divider), children: [
|
|
1884
1884
|
/* @__PURE__ */ e(
|
|
1885
1885
|
"input",
|
|
1886
1886
|
{
|
|
1887
1887
|
value: p,
|
|
1888
|
-
onChange: (R) =>
|
|
1888
|
+
onChange: (R) => g(R.target.value),
|
|
1889
1889
|
placeholder: "Add someone…",
|
|
1890
|
-
className:
|
|
1890
|
+
className: b("h-7 w-full rounded-md px-2 text-[12px] outline-none", l.input),
|
|
1891
1891
|
"data-chat-group-add": !0
|
|
1892
1892
|
}
|
|
1893
1893
|
),
|
|
@@ -1898,7 +1898,7 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1898
1898
|
{
|
|
1899
1899
|
type: "button",
|
|
1900
1900
|
onClick: () => {
|
|
1901
|
-
f.mutate(R.id),
|
|
1901
|
+
f.mutate(R.id), g("");
|
|
1902
1902
|
},
|
|
1903
1903
|
className: "flex w-full items-center gap-2 rounded px-1 py-1 text-left hover:bg-muted",
|
|
1904
1904
|
children: [
|
|
@@ -1910,7 +1910,7 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1910
1910
|
);
|
|
1911
1911
|
}) })
|
|
1912
1912
|
] }),
|
|
1913
|
-
$ && W.has($) && /* @__PURE__ */ e("div", { className:
|
|
1913
|
+
$ && W.has($) && /* @__PURE__ */ e("div", { className: b("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
|
|
1914
1914
|
"button",
|
|
1915
1915
|
{
|
|
1916
1916
|
type: "button",
|
|
@@ -1936,12 +1936,12 @@ function al({
|
|
|
1936
1936
|
label: s,
|
|
1937
1937
|
onBack: l
|
|
1938
1938
|
}) {
|
|
1939
|
-
const r = ie(), o = Me(), { isAdmin: i } = ut(), d = Zn(), { members: c, loading: h } =
|
|
1939
|
+
const r = ie(), o = Me(), { isAdmin: i } = ut(), d = Zn(), { members: c, loading: h } = jt(n.id), { update: f, addMember: u, removeMember: p } = Vn(n.id), [g, U] = T(s), [$, C] = T(n.topic ?? ""), [S, W] = T(n.visibility), [M, v] = T(n.role ?? ""), [B, R] = T({
|
|
1940
1940
|
icon: n.icon ?? null,
|
|
1941
1941
|
color: n.color ?? null
|
|
1942
|
-
}), [G, H] = T(""), V =
|
|
1942
|
+
}), [G, H] = T(""), V = Ft(G, 250), { users: se } = qt(V, S === "private"), ee = n.id === Xn, te = i || !ee && !!o.me && String(n.created_by ?? "") === String(o.me.id), be = new Set(c.map((A) => String(A.user).toUpperCase())), de = g !== s || $ !== (n.topic ?? "") || S !== n.visibility || B.icon !== (n.icon ?? null) || B.color !== (n.color ?? null) || S === "role" && M !== (n.role ?? "");
|
|
1943
1943
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
|
|
1944
|
-
/* @__PURE__ */ a("div", { className:
|
|
1944
|
+
/* @__PURE__ */ a("div", { className: b("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
|
|
1945
1945
|
/* @__PURE__ */ e(
|
|
1946
1946
|
"button",
|
|
1947
1947
|
{
|
|
@@ -1964,9 +1964,9 @@ function al({
|
|
|
1964
1964
|
/* @__PURE__ */ e(
|
|
1965
1965
|
"input",
|
|
1966
1966
|
{
|
|
1967
|
-
value:
|
|
1967
|
+
value: g,
|
|
1968
1968
|
onChange: (A) => U(A.target.value),
|
|
1969
|
-
className:
|
|
1969
|
+
className: b("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
|
|
1970
1970
|
}
|
|
1971
1971
|
)
|
|
1972
1972
|
] }),
|
|
@@ -1982,7 +1982,7 @@ function al({
|
|
|
1982
1982
|
value: $,
|
|
1983
1983
|
onChange: (A) => C(A.target.value),
|
|
1984
1984
|
placeholder: "What this channel is for",
|
|
1985
|
-
className:
|
|
1985
|
+
className: b("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
|
|
1986
1986
|
}
|
|
1987
1987
|
)
|
|
1988
1988
|
] }),
|
|
@@ -1997,7 +1997,7 @@ function al({
|
|
|
1997
1997
|
{
|
|
1998
1998
|
type: "button",
|
|
1999
1999
|
onClick: () => W(A),
|
|
2000
|
-
className:
|
|
2000
|
+
className: b(
|
|
2001
2001
|
"rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
|
|
2002
2002
|
S === A ? r.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
|
|
2003
2003
|
),
|
|
@@ -2006,11 +2006,11 @@ function al({
|
|
|
2006
2006
|
A
|
|
2007
2007
|
)) }),
|
|
2008
2008
|
S === "role" && /* @__PURE__ */ e(
|
|
2009
|
-
|
|
2009
|
+
Lt,
|
|
2010
2010
|
{
|
|
2011
2011
|
value: M,
|
|
2012
2012
|
onChange: v,
|
|
2013
|
-
className:
|
|
2013
|
+
className: b(
|
|
2014
2014
|
"mt-2 h-8 w-full rounded-md px-2 text-[12.5px] outline-none",
|
|
2015
2015
|
r.input
|
|
2016
2016
|
),
|
|
@@ -2029,12 +2029,12 @@ function al({
|
|
|
2029
2029
|
disabled: !de || f.isPending || S === "role" && !M,
|
|
2030
2030
|
onClick: () => f.mutate(
|
|
2031
2031
|
ee ? {
|
|
2032
|
-
name:
|
|
2032
|
+
name: g.trim() || s,
|
|
2033
2033
|
topic: $.trim() || null,
|
|
2034
2034
|
icon: B.icon,
|
|
2035
2035
|
color: B.color
|
|
2036
2036
|
} : {
|
|
2037
|
-
name:
|
|
2037
|
+
name: g.trim() || s,
|
|
2038
2038
|
topic: $.trim() || null,
|
|
2039
2039
|
visibility: S,
|
|
2040
2040
|
role: S === "role" ? M : null,
|
|
@@ -2042,7 +2042,7 @@ function al({
|
|
|
2042
2042
|
color: B.color
|
|
2043
2043
|
}
|
|
2044
2044
|
),
|
|
2045
|
-
className:
|
|
2045
|
+
className: b(
|
|
2046
2046
|
"rounded-md px-2.5 py-1 text-[12px] font-medium disabled:opacity-40",
|
|
2047
2047
|
r.action
|
|
2048
2048
|
),
|
|
@@ -2096,10 +2096,10 @@ function al({
|
|
|
2096
2096
|
value: G,
|
|
2097
2097
|
onChange: (A) => H(A.target.value),
|
|
2098
2098
|
placeholder: "Add someone…",
|
|
2099
|
-
className:
|
|
2099
|
+
className: b("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
|
|
2100
2100
|
}
|
|
2101
2101
|
),
|
|
2102
|
-
G.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: se.filter((A) => !
|
|
2102
|
+
G.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: se.filter((A) => !be.has(String(A.id).toUpperCase())).map((A) => {
|
|
2103
2103
|
const w = [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.id;
|
|
2104
2104
|
return /* @__PURE__ */ a(
|
|
2105
2105
|
"button",
|
|
@@ -2126,7 +2126,7 @@ function al({
|
|
|
2126
2126
|
] })
|
|
2127
2127
|
] });
|
|
2128
2128
|
}
|
|
2129
|
-
function
|
|
2129
|
+
function Ft(n, s) {
|
|
2130
2130
|
const [l, r] = T(n);
|
|
2131
2131
|
return ae(() => {
|
|
2132
2132
|
const o = setTimeout(() => r(n), s);
|
|
@@ -2142,12 +2142,12 @@ const Nt = [
|
|
|
2142
2142
|
{ value: "unread", label: "Unread first" },
|
|
2143
2143
|
{ value: "alpha", label: "A–Z" }
|
|
2144
2144
|
];
|
|
2145
|
-
function
|
|
2145
|
+
function Bn(n) {
|
|
2146
2146
|
var s;
|
|
2147
2147
|
return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
|
|
2148
2148
|
}
|
|
2149
2149
|
function sl(n, s) {
|
|
2150
|
-
const l = (i, d) => i.label.localeCompare(d.label), r = (i, d) =>
|
|
2150
|
+
const l = (i, d) => i.label.localeCompare(d.label), r = (i, d) => Bn(d) - Bn(i) || l(i, d), o = [...n];
|
|
2151
2151
|
return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, d) => +(d.unread > 0) - +(i.unread > 0) || r(i, d)) : o.sort(r);
|
|
2152
2152
|
}
|
|
2153
2153
|
function rl({
|
|
@@ -2188,7 +2188,7 @@ function rl({
|
|
|
2188
2188
|
] })
|
|
2189
2189
|
] });
|
|
2190
2190
|
}
|
|
2191
|
-
function
|
|
2191
|
+
function Wn({
|
|
2192
2192
|
rooms: n,
|
|
2193
2193
|
onOpen: s,
|
|
2194
2194
|
onNewGroup: l,
|
|
@@ -2196,7 +2196,7 @@ function Bn({
|
|
|
2196
2196
|
loading: o = !1,
|
|
2197
2197
|
onView: i
|
|
2198
2198
|
}) {
|
|
2199
|
-
const d = ie(), c = Me(), { setMuted: h, leave: f, setArchived: u, setStarred: p } =
|
|
2199
|
+
const d = ie(), c = Me(), { setMuted: h, leave: f, setArchived: u, setStarred: p } = It(), g = qs(), U = fe(
|
|
2200
2200
|
() => new Map(
|
|
2201
2201
|
c.onlineUsers.map((w) => [
|
|
2202
2202
|
String(w.user_id).toUpperCase(),
|
|
@@ -2204,13 +2204,13 @@ function Bn({
|
|
|
2204
2204
|
])
|
|
2205
2205
|
),
|
|
2206
2206
|
[c.onlineUsers]
|
|
2207
|
-
), $ =
|
|
2207
|
+
), $ = Et(), C = Sr(), [S, W] = T(""), M = Ft(S.trim(), 250), { hits: v, loading: B } = Qs(M, g.filters), R = M.length >= 2 || g.active, G = fe(() => {
|
|
2208
2208
|
const w = /* @__PURE__ */ new Map();
|
|
2209
2209
|
for (const P of v) w.set(P.room, [...w.get(P.room) ?? [], P]);
|
|
2210
2210
|
return [...w.entries()].sort((P, x) => x[1].length - P[1].length);
|
|
2211
|
-
}, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V = hr(), se = fe(() => new Map(n.map((w) => [w.room, w])), [n]), ee =
|
|
2211
|
+
}, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V = hr(), se = fe(() => new Map(n.map((w) => [w.room, w])), [n]), ee = Pt(), te = Yn(), be = ee.chat_sidebar_sort === "unread" || ee.chat_sidebar_sort === "alpha" ? ee.chat_sidebar_sort : "recent", de = sl(
|
|
2212
2212
|
M ? n.filter((w) => w.label.toLowerCase().includes(M.toLowerCase())) : n,
|
|
2213
|
-
|
|
2213
|
+
be
|
|
2214
2214
|
), A = (w) => {
|
|
2215
2215
|
var P;
|
|
2216
2216
|
return w.kind === "channel" && ((P = w.channel) == null ? void 0 : P.is_direct);
|
|
@@ -2223,7 +2223,7 @@ function Bn({
|
|
|
2223
2223
|
value: S,
|
|
2224
2224
|
onChange: (w) => W(w.target.value),
|
|
2225
2225
|
placeholder: "Search rooms & messages…",
|
|
2226
|
-
className:
|
|
2226
|
+
className: b(
|
|
2227
2227
|
"h-7 min-w-0 flex-1 rounded-md border px-2 text-[12px] outline-none",
|
|
2228
2228
|
d.input
|
|
2229
2229
|
),
|
|
@@ -2231,11 +2231,11 @@ function Bn({
|
|
|
2231
2231
|
"data-chat-global-search": !0
|
|
2232
2232
|
}
|
|
2233
2233
|
),
|
|
2234
|
-
!r && /* @__PURE__ */ e(Es, { open:
|
|
2234
|
+
!r && /* @__PURE__ */ e(Es, { open: g.open, active: g.active, onClick: () => g.setOpen(!g.open) }),
|
|
2235
2235
|
/* @__PURE__ */ e(
|
|
2236
2236
|
rl,
|
|
2237
2237
|
{
|
|
2238
|
-
value:
|
|
2238
|
+
value: be,
|
|
2239
2239
|
onChange: (w) => te.mutate({ chat_sidebar_sort: w === "recent" ? null : w })
|
|
2240
2240
|
}
|
|
2241
2241
|
),
|
|
@@ -2252,7 +2252,7 @@ function Bn({
|
|
|
2252
2252
|
}
|
|
2253
2253
|
)
|
|
2254
2254
|
] }),
|
|
2255
|
-
!r &&
|
|
2255
|
+
!r && g.open && /* @__PURE__ */ e(Ws, { filters: g.filters, onChange: g.setFilters, rooms: n, th: d }),
|
|
2256
2256
|
!r && i && !R && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
|
|
2257
2257
|
/* @__PURE__ */ a(
|
|
2258
2258
|
"button",
|
|
@@ -2285,7 +2285,7 @@ function Bn({
|
|
|
2285
2285
|
{
|
|
2286
2286
|
type: "button",
|
|
2287
2287
|
onClick: () => i("catchup"),
|
|
2288
|
-
className:
|
|
2288
|
+
className: b(
|
|
2289
2289
|
"inline-flex h-6 items-center gap-1 rounded-full px-2 text-[11px] font-medium",
|
|
2290
2290
|
d.accentSoft
|
|
2291
2291
|
),
|
|
@@ -2335,8 +2335,8 @@ function Bn({
|
|
|
2335
2335
|
"button",
|
|
2336
2336
|
{
|
|
2337
2337
|
type: "button",
|
|
2338
|
-
onClick: () =>
|
|
2339
|
-
className:
|
|
2338
|
+
onClick: () => g.setFilters({ ...g.filters, room: w }),
|
|
2339
|
+
className: b("px-2.5 py-0.5 text-[11px] font-medium", d.accentText),
|
|
2340
2340
|
children: [
|
|
2341
2341
|
"All ",
|
|
2342
2342
|
P.length,
|
|
@@ -2371,7 +2371,7 @@ function Bn({
|
|
|
2371
2371
|
/* @__PURE__ */ e(
|
|
2372
2372
|
"span",
|
|
2373
2373
|
{
|
|
2374
|
-
className:
|
|
2374
|
+
className: b(
|
|
2375
2375
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[13px] font-bold",
|
|
2376
2376
|
d.accentSoft
|
|
2377
2377
|
),
|
|
@@ -2423,17 +2423,17 @@ function Bn({
|
|
|
2423
2423
|
x.kind === "channel" && !((q = x.channel) != null && q.is_direct) || x.kind === "global" && ((ve = x.channel) != null && ve.icon || (Se = x.channel) != null && Se.color) ? /* @__PURE__ */ e(Ke, { icon: (ue = x.channel) == null ? void 0 : ue.icon, color: (Oe = x.channel) == null ? void 0 : Oe.color, size: 32 }) : /* @__PURE__ */ e(
|
|
2424
2424
|
"span",
|
|
2425
2425
|
{
|
|
2426
|
-
className:
|
|
2426
|
+
className: b(
|
|
2427
2427
|
"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",
|
|
2428
2428
|
x.kind === "dm" && c.me && Ne(x.room, c.me.id) && "hidden"
|
|
2429
2429
|
),
|
|
2430
|
-
children: x.kind === "dm" ? /* @__PURE__ */ e(
|
|
2430
|
+
children: x.kind === "dm" ? /* @__PURE__ */ e(zn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (ye = x.channel) != null && ye.is_direct ? /* @__PURE__ */ e(Tt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(_t, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
2431
2431
|
}
|
|
2432
2432
|
),
|
|
2433
2433
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
2434
2434
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
2435
2435
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: x.label }),
|
|
2436
|
-
x.muted && /* @__PURE__ */ e(
|
|
2436
|
+
x.muted && /* @__PURE__ */ e(Tn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
|
|
2437
2437
|
/* @__PURE__ */ e(wr, { count: C.countFor(x.room), label: x.label }),
|
|
2438
2438
|
V.has(x.room) && /* @__PURE__ */ e(
|
|
2439
2439
|
Ya,
|
|
@@ -2463,7 +2463,7 @@ function Bn({
|
|
|
2463
2463
|
x.unread > 0 && /* @__PURE__ */ e(
|
|
2464
2464
|
"span",
|
|
2465
2465
|
{
|
|
2466
|
-
className:
|
|
2466
|
+
className: b(
|
|
2467
2467
|
"flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-1.5 text-[10px] font-bold",
|
|
2468
2468
|
// A muted room still counts, but quietly — it must not
|
|
2469
2469
|
// read like something demanding attention.
|
|
@@ -2488,7 +2488,7 @@ function Bn({
|
|
|
2488
2488
|
children: /* @__PURE__ */ e(
|
|
2489
2489
|
Za,
|
|
2490
2490
|
{
|
|
2491
|
-
className:
|
|
2491
|
+
className: b("h-3 w-3", x.starred && "fill-amber-400 text-amber-500")
|
|
2492
2492
|
}
|
|
2493
2493
|
)
|
|
2494
2494
|
}
|
|
@@ -2512,7 +2512,7 @@ function Bn({
|
|
|
2512
2512
|
title: x.muted ? "Unmute" : "Mute",
|
|
2513
2513
|
onClick: () => h.mutate({ room: x.room, muted: !x.muted }),
|
|
2514
2514
|
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",
|
|
2515
|
-
children: x.muted ? /* @__PURE__ */ e(es, { className: "h-3 w-3" }) : /* @__PURE__ */ e(
|
|
2515
|
+
children: x.muted ? /* @__PURE__ */ e(es, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Tn, { className: "h-3 w-3" })
|
|
2516
2516
|
}
|
|
2517
2517
|
),
|
|
2518
2518
|
(x.kind === "channel" || x.kind === "global" || x.kind === "entity") && x.joined && /* @__PURE__ */ e(
|
|
@@ -2556,21 +2556,21 @@ function uo({
|
|
|
2556
2556
|
function ll({
|
|
2557
2557
|
onOpen: n
|
|
2558
2558
|
}) {
|
|
2559
|
-
const s = ie(), [l, r] = T(""), [o, i] = T(!1), [d, c] = T(""), [h, f] = T("open"), [u, p] = T(""), [
|
|
2559
|
+
const s = ie(), [l, r] = T(""), [o, i] = T(!1), [d, c] = T(""), [h, f] = T("open"), [u, p] = T(""), [g, U] = T({
|
|
2560
2560
|
icon: null,
|
|
2561
2561
|
color: null
|
|
2562
|
-
}), $ = Zn(), { channels: C, loading: S } = zs(l), { join: W } =
|
|
2562
|
+
}), $ = Zn(), { channels: C, loading: S } = zs(l), { join: W } = It(), M = Hs();
|
|
2563
2563
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
|
|
2564
2564
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2565
2565
|
/* @__PURE__ */ a("div", { className: "relative flex-1", children: [
|
|
2566
|
-
/* @__PURE__ */ e(
|
|
2566
|
+
/* @__PURE__ */ e(Fn, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
2567
2567
|
/* @__PURE__ */ e(
|
|
2568
2568
|
"input",
|
|
2569
2569
|
{
|
|
2570
2570
|
value: l,
|
|
2571
2571
|
onChange: (v) => r(v.target.value),
|
|
2572
2572
|
placeholder: "Search channels…",
|
|
2573
|
-
className:
|
|
2573
|
+
className: b("h-8 w-full rounded-md pl-8 pr-2 text-[12.5px] outline-none", s.input)
|
|
2574
2574
|
}
|
|
2575
2575
|
)
|
|
2576
2576
|
] }),
|
|
@@ -2579,7 +2579,7 @@ function ll({
|
|
|
2579
2579
|
{
|
|
2580
2580
|
type: "button",
|
|
2581
2581
|
onClick: () => i((v) => !v),
|
|
2582
|
-
className:
|
|
2582
|
+
className: b(
|
|
2583
2583
|
"flex h-8 shrink-0 items-center gap-1 rounded-md px-2.5 text-[12px] font-medium",
|
|
2584
2584
|
s.action
|
|
2585
2585
|
),
|
|
@@ -2600,8 +2600,8 @@ function ll({
|
|
|
2600
2600
|
name: d.trim(),
|
|
2601
2601
|
visibility: h,
|
|
2602
2602
|
role: h === "role" ? u : null,
|
|
2603
|
-
icon:
|
|
2604
|
-
color:
|
|
2603
|
+
icon: g.icon,
|
|
2604
|
+
color: g.color
|
|
2605
2605
|
},
|
|
2606
2606
|
{
|
|
2607
2607
|
onSuccess: () => {
|
|
@@ -2612,21 +2612,21 @@ function ll({
|
|
|
2612
2612
|
},
|
|
2613
2613
|
children: [
|
|
2614
2614
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2615
|
-
/* @__PURE__ */ e(Ke, { icon:
|
|
2615
|
+
/* @__PURE__ */ e(Ke, { icon: g.icon, color: g.color, size: 32 }),
|
|
2616
2616
|
/* @__PURE__ */ e(
|
|
2617
2617
|
"input",
|
|
2618
2618
|
{
|
|
2619
2619
|
value: d,
|
|
2620
2620
|
onChange: (v) => c(v.target.value),
|
|
2621
2621
|
placeholder: "Channel name",
|
|
2622
|
-
className:
|
|
2622
|
+
className: b(
|
|
2623
2623
|
"h-8 min-w-0 flex-1 rounded-md px-2 text-[12.5px] outline-none",
|
|
2624
2624
|
s.input
|
|
2625
2625
|
)
|
|
2626
2626
|
}
|
|
2627
2627
|
)
|
|
2628
2628
|
] }),
|
|
2629
|
-
/* @__PURE__ */ e(Gn, { icon:
|
|
2629
|
+
/* @__PURE__ */ e(Gn, { icon: g.icon, color: g.color, onChange: U }),
|
|
2630
2630
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2631
2631
|
[
|
|
2632
2632
|
["open", "Anyone"],
|
|
@@ -2637,7 +2637,7 @@ function ll({
|
|
|
2637
2637
|
{
|
|
2638
2638
|
type: "button",
|
|
2639
2639
|
onClick: () => f(v),
|
|
2640
|
-
className:
|
|
2640
|
+
className: b(
|
|
2641
2641
|
"rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
|
|
2642
2642
|
h === v ? s.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
|
|
2643
2643
|
),
|
|
@@ -2650,17 +2650,17 @@ function ll({
|
|
|
2650
2650
|
{
|
|
2651
2651
|
type: "submit",
|
|
2652
2652
|
disabled: !d.trim() || M.isPending || h === "role" && !u,
|
|
2653
|
-
className:
|
|
2653
|
+
className: b("ml-auto rounded-md px-2.5 py-1 text-[12px] font-medium", s.action),
|
|
2654
2654
|
children: M.isPending ? "Creating…" : "Create"
|
|
2655
2655
|
}
|
|
2656
2656
|
)
|
|
2657
2657
|
] }),
|
|
2658
2658
|
h === "role" && /* @__PURE__ */ e(
|
|
2659
|
-
|
|
2659
|
+
Lt,
|
|
2660
2660
|
{
|
|
2661
2661
|
value: u,
|
|
2662
2662
|
onChange: p,
|
|
2663
|
-
className:
|
|
2663
|
+
className: b("h-8 w-auto rounded-md px-2 text-[12.5px] outline-none", s.input),
|
|
2664
2664
|
options: [
|
|
2665
2665
|
{ value: "", label: "Choose a role…" },
|
|
2666
2666
|
...$.map((v) => ({ value: v.id, label: v.name }))
|
|
@@ -2700,7 +2700,7 @@ function ll({
|
|
|
2700
2700
|
"button",
|
|
2701
2701
|
{
|
|
2702
2702
|
type: "button",
|
|
2703
|
-
onClick: () => n(v.room, v.name,
|
|
2703
|
+
onClick: () => n(v.room, v.name, qn(v)),
|
|
2704
2704
|
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",
|
|
2705
2705
|
children: "Open"
|
|
2706
2706
|
}
|
|
@@ -2709,9 +2709,9 @@ function ll({
|
|
|
2709
2709
|
{
|
|
2710
2710
|
type: "button",
|
|
2711
2711
|
onClick: () => W.mutate(v.room, {
|
|
2712
|
-
onSuccess: () => n(v.room, v.name,
|
|
2712
|
+
onSuccess: () => n(v.room, v.name, qn(v))
|
|
2713
2713
|
}),
|
|
2714
|
-
className:
|
|
2714
|
+
className: b("shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium", s.action),
|
|
2715
2715
|
children: "Join"
|
|
2716
2716
|
}
|
|
2717
2717
|
)
|
|
@@ -2727,7 +2727,7 @@ function ol() {
|
|
|
2727
2727
|
return n.setHours(23, 59, 59, 999), n;
|
|
2728
2728
|
}
|
|
2729
2729
|
function il() {
|
|
2730
|
-
const n =
|
|
2730
|
+
const n = Pt(), s = Yn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), d = (h) => {
|
|
2731
2731
|
s.mutate({
|
|
2732
2732
|
presence_override: h === "off" ? null : { mode: "away", until: (h == null ? void 0 : h.toISOString()) ?? null }
|
|
2733
2733
|
}), r(!1);
|
|
@@ -2746,7 +2746,7 @@ function il() {
|
|
|
2746
2746
|
/* @__PURE__ */ e(
|
|
2747
2747
|
"span",
|
|
2748
2748
|
{
|
|
2749
|
-
className:
|
|
2749
|
+
className: b(
|
|
2750
2750
|
"h-2.5 w-2.5 shrink-0 rounded-full border-2",
|
|
2751
2751
|
i ? "border-amber-400 bg-white dark:bg-card" : "border-emerald-400 bg-emerald-400"
|
|
2752
2752
|
),
|
|
@@ -2841,7 +2841,7 @@ function dl({
|
|
|
2841
2841
|
onClose: n,
|
|
2842
2842
|
onCreated: s
|
|
2843
2843
|
}) {
|
|
2844
|
-
const l = ie(), [r, o] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } =
|
|
2844
|
+
const l = ie(), [r, o] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } = qt(r, !0), u = dr(), p = (g) => [g.first_name, g.last_name].filter(Boolean).join(" ") || (g.email ?? "Unknown");
|
|
2845
2845
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
|
|
2846
2846
|
/* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
2847
2847
|
/* @__PURE__ */ e(
|
|
@@ -2856,10 +2856,10 @@ function dl({
|
|
|
2856
2856
|
),
|
|
2857
2857
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "New group conversation" })
|
|
2858
2858
|
] }),
|
|
2859
|
-
c.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...c.entries()].map(([
|
|
2859
|
+
c.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...c.entries()].map(([g, U]) => /* @__PURE__ */ a(
|
|
2860
2860
|
"span",
|
|
2861
2861
|
{
|
|
2862
|
-
className:
|
|
2862
|
+
className: b(
|
|
2863
2863
|
"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium",
|
|
2864
2864
|
l.accentSoft
|
|
2865
2865
|
),
|
|
@@ -2871,7 +2871,7 @@ function dl({
|
|
|
2871
2871
|
type: "button",
|
|
2872
2872
|
onClick: () => h(($) => {
|
|
2873
2873
|
const C = new Map($);
|
|
2874
|
-
return C.delete(
|
|
2874
|
+
return C.delete(g), C;
|
|
2875
2875
|
}),
|
|
2876
2876
|
"aria-label": `Remove ${U}`,
|
|
2877
2877
|
children: /* @__PURE__ */ e(dt, { className: "h-3 w-3" })
|
|
@@ -2879,49 +2879,49 @@ function dl({
|
|
|
2879
2879
|
)
|
|
2880
2880
|
]
|
|
2881
2881
|
},
|
|
2882
|
-
|
|
2882
|
+
g
|
|
2883
2883
|
)) }),
|
|
2884
2884
|
/* @__PURE__ */ e(
|
|
2885
2885
|
"input",
|
|
2886
2886
|
{
|
|
2887
2887
|
value: r,
|
|
2888
|
-
onChange: (
|
|
2888
|
+
onChange: (g) => o(g.target.value),
|
|
2889
2889
|
placeholder: "Find people…",
|
|
2890
|
-
className:
|
|
2890
|
+
className: b("mb-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none", l.input),
|
|
2891
2891
|
"aria-label": "Find people",
|
|
2892
2892
|
autoFocus: !0
|
|
2893
2893
|
}
|
|
2894
2894
|
),
|
|
2895
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((
|
|
2896
|
-
const U = c.has(
|
|
2895
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((g) => {
|
|
2896
|
+
const U = c.has(g.id);
|
|
2897
2897
|
return /* @__PURE__ */ a(
|
|
2898
2898
|
"button",
|
|
2899
2899
|
{
|
|
2900
2900
|
type: "button",
|
|
2901
2901
|
onClick: () => h(($) => {
|
|
2902
2902
|
const C = new Map($);
|
|
2903
|
-
return U ? C.delete(
|
|
2903
|
+
return U ? C.delete(g.id) : C.set(g.id, p(g)), C;
|
|
2904
2904
|
}),
|
|
2905
|
-
className:
|
|
2905
|
+
className: b(
|
|
2906
2906
|
"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[12.5px] transition-colors",
|
|
2907
2907
|
U ? l.accentSoft : "hover:bg-slate-50 dark:hover:bg-muted/50"
|
|
2908
2908
|
),
|
|
2909
2909
|
children: [
|
|
2910
|
-
/* @__PURE__ */ e(Z, { id:
|
|
2911
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: p(
|
|
2910
|
+
/* @__PURE__ */ e(Z, { id: g.id, name: p(g), size: 22 }),
|
|
2911
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: p(g) }),
|
|
2912
2912
|
U && /* @__PURE__ */ e(At, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
|
|
2913
2913
|
]
|
|
2914
2914
|
},
|
|
2915
|
-
|
|
2915
|
+
g.id
|
|
2916
2916
|
);
|
|
2917
2917
|
}) }),
|
|
2918
2918
|
/* @__PURE__ */ e(
|
|
2919
2919
|
"input",
|
|
2920
2920
|
{
|
|
2921
2921
|
value: i,
|
|
2922
|
-
onChange: (
|
|
2922
|
+
onChange: (g) => d(g.target.value),
|
|
2923
2923
|
placeholder: "Group name (optional)",
|
|
2924
|
-
className:
|
|
2924
|
+
className: b(
|
|
2925
2925
|
"mb-2 mt-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none",
|
|
2926
2926
|
l.input
|
|
2927
2927
|
),
|
|
@@ -2935,9 +2935,9 @@ function dl({
|
|
|
2935
2935
|
disabled: c.size === 0 || u.isPending,
|
|
2936
2936
|
onClick: () => u.mutate(
|
|
2937
2937
|
{ user_ids: [...c.keys()], name: i.trim() || void 0 },
|
|
2938
|
-
{ onSuccess: (
|
|
2938
|
+
{ onSuccess: (g) => s(g.room, g.name) }
|
|
2939
2939
|
),
|
|
2940
|
-
className:
|
|
2940
|
+
className: b(
|
|
2941
2941
|
"flex h-9 items-center justify-center rounded-lg text-[12.5px] font-semibold transition-[filter] hover:brightness-110 disabled:opacity-40",
|
|
2942
2942
|
l.action
|
|
2943
2943
|
),
|
|
@@ -2977,7 +2977,7 @@ function mo({
|
|
|
2977
2977
|
requestedRoom: o
|
|
2978
2978
|
}) {
|
|
2979
2979
|
var $e;
|
|
2980
|
-
const i = Me(), d = ie(), c = i.me, [h, f] = T(ul), u = ml(), p = h && u,
|
|
2980
|
+
const i = Me(), d = ie(), c = i.me, [h, f] = T(ul), u = ml(), p = h && u, g = () => {
|
|
2981
2981
|
const k = !h;
|
|
2982
2982
|
f(k);
|
|
2983
2983
|
try {
|
|
@@ -2987,23 +2987,23 @@ function mo({
|
|
|
2987
2987
|
};
|
|
2988
2988
|
ae(() => {
|
|
2989
2989
|
if (!n || !p) return;
|
|
2990
|
-
const k = document.body,
|
|
2990
|
+
const k = document.body, O = k.style.paddingRight;
|
|
2991
2991
|
k.style.paddingRight = `${Ct}px`, k.dataset.nvrChatPinned = "1";
|
|
2992
2992
|
const I = document.createElement("style");
|
|
2993
2993
|
return I.dataset.nvrChatPinnedStyle = "", I.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
|
|
2994
2994
|
body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, document.head.appendChild(I), () => {
|
|
2995
|
-
k.style.paddingRight =
|
|
2995
|
+
k.style.paddingRight = O, delete k.dataset.nvrChatPinned, I.remove();
|
|
2996
2996
|
};
|
|
2997
2997
|
}, [n, p]);
|
|
2998
|
-
const [U, $] = T("online"), [C, S] = T(null), [W, M] = T(null), v = (k,
|
|
2998
|
+
const [U, $] = T("online"), [C, S] = T(null), [W, M] = T(null), v = (k, O, I) => {
|
|
2999
2999
|
const X = ee.find((Te) => Te.room === k);
|
|
3000
|
-
H(!1), S({ room: k, label: (X == null ? void 0 : X.label) ??
|
|
3001
|
-
}, [B, R] = T(!1), [G, H] = T(!1), [V, se] = T(null), { rooms: ee, totalUnread: te } = ea(),
|
|
3000
|
+
H(!1), S({ room: k, label: (X == null ? void 0 : X.label) ?? O, channel: X == null ? void 0 : X.channel, anchor: I });
|
|
3001
|
+
}, [B, R] = T(!1), [G, H] = T(!1), [V, se] = T(null), { rooms: ee, totalUnread: te } = ea(), be = ta(U === "archived"), de = (k, O, I) => {
|
|
3002
3002
|
var Te, _;
|
|
3003
|
-
if (!
|
|
3003
|
+
if (!O) return [{ key: "all", label: null, users: k }];
|
|
3004
3004
|
const X = /* @__PURE__ */ new Map();
|
|
3005
3005
|
for (const j of k) {
|
|
3006
|
-
const E = I.get(String(j.user_id).toUpperCase()), ne =
|
|
3006
|
+
const E = I.get(String(j.user_id).toUpperCase()), ne = O === "__role__" ? [En((E == null ? void 0 : E.role_name) ?? j.role_name) || "No role"] : (_ = (Te = E == null ? void 0 : E.scopes_by_dimension) == null ? void 0 : Te[O]) != null && _.length ? E.scopes_by_dimension[O] : ["Unassigned"], K = [...new Set(ne)].sort((F, J) => F.localeCompare(J)).join(", ");
|
|
3007
3007
|
X.set(K, [...X.get(K) ?? [], j]);
|
|
3008
3008
|
}
|
|
3009
3009
|
return [...X.entries()].sort((j, E) => j[0] === "Unassigned" ? 1 : E[0] === "Unassigned" ? -1 : j[0].localeCompare(E[0])).map(([j, E]) => ({ key: j, label: j, users: E }));
|
|
@@ -3040,11 +3040,11 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3040
3040
|
"data-nvr-recording-hide": !0,
|
|
3041
3041
|
"data-chat-pinned": p ? "1" : void 0,
|
|
3042
3042
|
children: [
|
|
3043
|
-
/* @__PURE__ */ e(
|
|
3043
|
+
/* @__PURE__ */ e(Rn, {}),
|
|
3044
3044
|
/* @__PURE__ */ a(
|
|
3045
3045
|
"aside",
|
|
3046
3046
|
{
|
|
3047
|
-
className:
|
|
3047
|
+
className: b(
|
|
3048
3048
|
"pointer-events-auto absolute right-0 top-0 flex h-full w-full flex-col border-l",
|
|
3049
3049
|
p ? "max-w-none" : "max-w-[400px] shadow-2xl animate-in slide-in-from-right duration-200",
|
|
3050
3050
|
d.surface,
|
|
@@ -3053,13 +3053,13 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3053
3053
|
onClick: (k) => k.stopPropagation(),
|
|
3054
3054
|
"aria-label": "Team",
|
|
3055
3055
|
children: [
|
|
3056
|
-
/* @__PURE__ */ a("div", { className:
|
|
3056
|
+
/* @__PURE__ */ a("div", { className: b("flex shrink-0 items-center gap-2 border-b px-3.5 py-2.5", d.divider), children: [
|
|
3057
3057
|
/* @__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(
|
|
3058
3058
|
"button",
|
|
3059
3059
|
{
|
|
3060
3060
|
type: "button",
|
|
3061
3061
|
onClick: () => $(k),
|
|
3062
|
-
className:
|
|
3062
|
+
className: b(
|
|
3063
3063
|
"flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors",
|
|
3064
3064
|
U === k ? d.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
|
|
3065
3065
|
),
|
|
@@ -3068,7 +3068,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3068
3068
|
k === "chat" && te > 0 && /* @__PURE__ */ e(
|
|
3069
3069
|
"span",
|
|
3070
3070
|
{
|
|
3071
|
-
className:
|
|
3071
|
+
className: b(
|
|
3072
3072
|
"flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold leading-none",
|
|
3073
3073
|
d.pill
|
|
3074
3074
|
),
|
|
@@ -3084,11 +3084,11 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3084
3084
|
"button",
|
|
3085
3085
|
{
|
|
3086
3086
|
type: "button",
|
|
3087
|
-
onClick:
|
|
3087
|
+
onClick: g,
|
|
3088
3088
|
"aria-pressed": h,
|
|
3089
3089
|
title: h ? "Unpin — go back to opening chat over the page" : "Pin — keep chat open beside the page while you work",
|
|
3090
3090
|
"aria-label": h ? "Unpin chat panel" : "Pin chat panel",
|
|
3091
|
-
className:
|
|
3091
|
+
className: b(
|
|
3092
3092
|
"ml-auto hidden rounded-md p-1.5 transition-colors lg:flex",
|
|
3093
3093
|
h ? d.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
|
|
3094
3094
|
),
|
|
@@ -3119,7 +3119,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3119
3119
|
x.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
|
|
3120
3120
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
|
|
3121
3121
|
/* @__PURE__ */ e(
|
|
3122
|
-
|
|
3122
|
+
Lt,
|
|
3123
3123
|
{
|
|
3124
3124
|
value: A,
|
|
3125
3125
|
onChange: (k) => {
|
|
@@ -3144,215 +3144,235 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3144
3144
|
k.label,
|
|
3145
3145
|
/* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
|
|
3146
3146
|
] }),
|
|
3147
|
-
k.users.map((
|
|
3148
|
-
const I = P.byUser.get(String(
|
|
3147
|
+
k.users.map((O) => {
|
|
3148
|
+
const I = P.byUser.get(String(O.user_id).toUpperCase()), X = (I == null ? void 0 : I.is_idle) ?? O.is_idle, Te = I ?? O;
|
|
3149
3149
|
return /* @__PURE__ */ a(
|
|
3150
|
-
"
|
|
3150
|
+
"div",
|
|
3151
3151
|
{
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
title: "Send a direct message",
|
|
3155
|
-
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",
|
|
3152
|
+
className: "flex w-full items-center rounded-lg pl-2.5 transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
|
|
3153
|
+
"data-chat-online-row": !0,
|
|
3156
3154
|
children: [
|
|
3157
|
-
/* @__PURE__ */ e(
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
"
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3155
|
+
/* @__PURE__ */ e(Ot, { userId: O.user_id, children: /* @__PURE__ */ e(
|
|
3156
|
+
"button",
|
|
3157
|
+
{
|
|
3158
|
+
type: "button",
|
|
3159
|
+
className: "shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
3160
|
+
"aria-label": `${O.display_name ?? "Unknown user"} — profile`,
|
|
3161
|
+
"data-chat-online-avatar": !0,
|
|
3162
|
+
children: /* @__PURE__ */ e(Z, { id: O.user_id, name: O.display_name })
|
|
3163
|
+
}
|
|
3164
|
+
) }),
|
|
3165
|
+
/* @__PURE__ */ a(
|
|
3166
|
+
"button",
|
|
3167
|
+
{
|
|
3168
|
+
type: "button",
|
|
3169
|
+
onClick: () => Oe(O),
|
|
3170
|
+
title: "Send a direct message",
|
|
3171
|
+
className: "flex min-w-0 flex-1 items-center gap-3 py-2 pl-3 pr-2.5 text-left",
|
|
3172
|
+
children: [
|
|
3173
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
3174
|
+
/* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
|
|
3175
|
+
O.display_name ?? "Unknown user",
|
|
3176
|
+
X && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: I != null && I.away ? "Away" : Dt(Te) }),
|
|
3177
|
+
!X && (I == null ? void 0 : I.stuck) && (() => {
|
|
3178
|
+
const _ = I.stuck, j = P.fields.includes("page"), E = Un(
|
|
3179
|
+
I.current_path,
|
|
3180
|
+
I.app,
|
|
3181
|
+
P.adminUrl,
|
|
3182
|
+
i.recordUrl,
|
|
3183
|
+
typeof window > "u" ? null : window.location.origin
|
|
3184
|
+
), ne = `${Dn(_)} — at the keyboard, on the same page, nothing saved for ten minutes${E ? `
|
|
3185
|
+
${$n(E)}` : ""}`, K = Dn(
|
|
3186
|
+
j ? { ..._, label: null } : _
|
|
3187
|
+
), F = "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";
|
|
3188
|
+
return E ? (
|
|
3189
|
+
// biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
|
|
3190
|
+
/* @__PURE__ */ e(
|
|
3191
|
+
"span",
|
|
3192
|
+
{
|
|
3193
|
+
role: "link",
|
|
3194
|
+
tabIndex: 0,
|
|
3195
|
+
className: b(F, "cursor-pointer hover:underline"),
|
|
3196
|
+
"data-chat-stuck": _.minutes,
|
|
3197
|
+
"data-tip": ne,
|
|
3198
|
+
"aria-label": `${K}: open the page`,
|
|
3199
|
+
onClick: (J) => {
|
|
3200
|
+
J.stopPropagation(), ue(E);
|
|
3201
|
+
},
|
|
3202
|
+
onKeyDown: (J) => {
|
|
3203
|
+
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), J.stopPropagation(), ue(E));
|
|
3204
|
+
},
|
|
3205
|
+
children: K
|
|
3206
|
+
}
|
|
3207
|
+
)
|
|
3208
|
+
) : /* @__PURE__ */ e(
|
|
3209
|
+
"span",
|
|
3210
|
+
{
|
|
3211
|
+
className: F,
|
|
3212
|
+
"data-chat-stuck": _.minutes,
|
|
3213
|
+
"data-tip": ne,
|
|
3214
|
+
children: K
|
|
3215
|
+
}
|
|
3216
|
+
);
|
|
3217
|
+
})(),
|
|
3218
|
+
(() => {
|
|
3219
|
+
var j;
|
|
3220
|
+
const _ = (j = P.byUser.get(
|
|
3221
|
+
String(O.user_id).toUpperCase()
|
|
3222
|
+
)) == null ? void 0 : j.masquerade;
|
|
3223
|
+
return _ ? /* @__PURE__ */ a(
|
|
3224
|
+
"span",
|
|
3225
|
+
{
|
|
3226
|
+
className: "ml-1.5 rounded-full bg-violet-500/10 px-1.5 py-px text-[10px] font-medium text-violet-700 dark:bg-violet-400/15 dark:text-violet-300",
|
|
3227
|
+
title: `${_.admin_name} is signed in as this person right now`,
|
|
3228
|
+
"data-chat-masquerade": _.admin_id ?? "",
|
|
3229
|
+
children: [
|
|
3230
|
+
_.admin_name,
|
|
3231
|
+
" masquerading"
|
|
3232
|
+
]
|
|
3233
|
+
}
|
|
3234
|
+
) : null;
|
|
3235
|
+
})(),
|
|
3236
|
+
ve && /* @__PURE__ */ e($s, { builds: I == null ? void 0 : I.stale_build })
|
|
3237
|
+
] }),
|
|
3238
|
+
(() => {
|
|
3239
|
+
const _ = P.byUser.get(String(O.user_id).toUpperCase()), j = _ == null ? void 0 : _.custom_status;
|
|
3240
|
+
return !j && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
|
|
3230
3241
|
"span",
|
|
3231
3242
|
{
|
|
3232
|
-
className: "
|
|
3233
|
-
"data-chat-
|
|
3234
|
-
"data-tip": "In a huddle right now",
|
|
3243
|
+
className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
3244
|
+
"data-chat-status": !0,
|
|
3235
3245
|
children: [
|
|
3236
|
-
|
|
3237
|
-
|
|
3246
|
+
(_ == null ? void 0 : _.in_huddle) && /* @__PURE__ */ a(
|
|
3247
|
+
"span",
|
|
3248
|
+
{
|
|
3249
|
+
className: "inline-flex shrink-0 items-center gap-0.5 text-nvr-navy dark:text-nvr-cyan",
|
|
3250
|
+
"data-chat-in-huddle": !0,
|
|
3251
|
+
"data-tip": "In a huddle right now",
|
|
3252
|
+
children: [
|
|
3253
|
+
/* @__PURE__ */ e(Ha, { className: "h-3 w-3", strokeWidth: 2 }),
|
|
3254
|
+
!j && "In a huddle"
|
|
3255
|
+
]
|
|
3256
|
+
}
|
|
3257
|
+
),
|
|
3258
|
+
j && /* @__PURE__ */ a("span", { className: "truncate italic", children: [
|
|
3259
|
+
j.emoji ? `${j.emoji} ` : "",
|
|
3260
|
+
j.text
|
|
3261
|
+
] })
|
|
3238
3262
|
]
|
|
3239
3263
|
}
|
|
3240
|
-
)
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
F && j.push(F);
|
|
3256
|
-
} else if (K === "scopes") {
|
|
3257
|
-
const F = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
|
|
3258
|
-
F && j.push(F);
|
|
3259
|
-
} else if (K === "page") {
|
|
3260
|
-
const F = (_ == null ? void 0 : _.page) ?? L.page ?? ha((_ == null ? void 0 : _.current_path) ?? L.current_path), J = (_ == null ? void 0 : _.app) ?? L.app;
|
|
3261
|
-
E = (J ? `${F ?? ""}${F ? " · " : ""}${J}`.trim() : F) || null;
|
|
3262
|
-
}
|
|
3263
|
-
const ne = j.join(" · ");
|
|
3264
|
-
return !ne && !E ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(_e, { children: [
|
|
3265
|
-
ne && /* @__PURE__ */ e(
|
|
3266
|
-
"span",
|
|
3267
|
-
{
|
|
3268
|
-
className: "block truncate text-[11px] text-slate-400",
|
|
3269
|
-
"data-chat-online-meta": !0,
|
|
3270
|
-
title: ne,
|
|
3271
|
-
children: ne
|
|
3272
|
-
}
|
|
3273
|
-
),
|
|
3274
|
-
E && (() => {
|
|
3275
|
-
const K = Tn(
|
|
3276
|
-
_ == null ? void 0 : _.current_path,
|
|
3277
|
-
_ == null ? void 0 : _.app,
|
|
3278
|
-
P.adminUrl,
|
|
3279
|
-
i.recordUrl,
|
|
3280
|
-
typeof window > "u" ? null : window.location.origin
|
|
3281
|
-
), F = /* @__PURE__ */ a(_e, { children: [
|
|
3282
|
-
/* @__PURE__ */ e(as, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
|
|
3283
|
-
/* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: E })
|
|
3284
|
-
] });
|
|
3285
|
-
return K ? (
|
|
3286
|
-
// biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
|
|
3287
|
-
/* @__PURE__ */ e(
|
|
3288
|
-
"span",
|
|
3289
|
-
{
|
|
3290
|
-
role: "link",
|
|
3291
|
-
tabIndex: 0,
|
|
3292
|
-
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",
|
|
3293
|
-
"data-chat-online-page": !0,
|
|
3294
|
-
"data-chat-online-page-href": K,
|
|
3295
|
-
"data-tip": Dn(K),
|
|
3296
|
-
"aria-label": `${E}: open the page`,
|
|
3297
|
-
onClick: (J) => {
|
|
3298
|
-
J.stopPropagation(), ue(K);
|
|
3299
|
-
},
|
|
3300
|
-
onKeyDown: (J) => {
|
|
3301
|
-
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), J.stopPropagation(), ue(K));
|
|
3302
|
-
},
|
|
3303
|
-
children: F
|
|
3264
|
+
);
|
|
3265
|
+
})(),
|
|
3266
|
+
(() => {
|
|
3267
|
+
const _ = P.byUser.get(String(O.user_id).toUpperCase()), j = [];
|
|
3268
|
+
let E = null;
|
|
3269
|
+
for (const K of P.fields)
|
|
3270
|
+
if (K === "role") {
|
|
3271
|
+
const F = En((_ == null ? void 0 : _.role_name) ?? O.role_name);
|
|
3272
|
+
F && j.push(F);
|
|
3273
|
+
} else if (K === "scopes") {
|
|
3274
|
+
const F = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
|
|
3275
|
+
F && j.push(F);
|
|
3276
|
+
} else if (K === "page") {
|
|
3277
|
+
const F = (_ == null ? void 0 : _.page) ?? O.page ?? ha((_ == null ? void 0 : _.current_path) ?? O.current_path), J = (_ == null ? void 0 : _.app) ?? O.app;
|
|
3278
|
+
E = (J ? `${F ?? ""}${F ? " · " : ""}${J}`.trim() : F) || null;
|
|
3304
3279
|
}
|
|
3305
|
-
)
|
|
3306
|
-
|
|
3280
|
+
const ne = j.join(" · ");
|
|
3281
|
+
return !ne && !E ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(_e, { children: [
|
|
3282
|
+
ne && /* @__PURE__ */ e(
|
|
3283
|
+
"span",
|
|
3284
|
+
{
|
|
3285
|
+
className: "block truncate text-[11px] text-slate-400",
|
|
3286
|
+
"data-chat-online-meta": !0,
|
|
3287
|
+
title: ne,
|
|
3288
|
+
children: ne
|
|
3289
|
+
}
|
|
3290
|
+
),
|
|
3291
|
+
E && (() => {
|
|
3292
|
+
const K = Un(
|
|
3293
|
+
_ == null ? void 0 : _.current_path,
|
|
3294
|
+
_ == null ? void 0 : _.app,
|
|
3295
|
+
P.adminUrl,
|
|
3296
|
+
i.recordUrl,
|
|
3297
|
+
typeof window > "u" ? null : window.location.origin
|
|
3298
|
+
), F = /* @__PURE__ */ a(_e, { children: [
|
|
3299
|
+
/* @__PURE__ */ e(as, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
|
|
3300
|
+
/* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: E })
|
|
3301
|
+
] });
|
|
3302
|
+
return K ? (
|
|
3303
|
+
// biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
|
|
3304
|
+
/* @__PURE__ */ e(
|
|
3305
|
+
"span",
|
|
3306
|
+
{
|
|
3307
|
+
role: "link",
|
|
3308
|
+
tabIndex: 0,
|
|
3309
|
+
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",
|
|
3310
|
+
"data-chat-online-page": !0,
|
|
3311
|
+
"data-chat-online-page-href": K,
|
|
3312
|
+
"data-tip": $n(K),
|
|
3313
|
+
"aria-label": `${E}: open the page`,
|
|
3314
|
+
onClick: (J) => {
|
|
3315
|
+
J.stopPropagation(), ue(K);
|
|
3316
|
+
},
|
|
3317
|
+
onKeyDown: (J) => {
|
|
3318
|
+
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), J.stopPropagation(), ue(K));
|
|
3319
|
+
},
|
|
3320
|
+
children: F
|
|
3321
|
+
}
|
|
3322
|
+
)
|
|
3323
|
+
) : /* @__PURE__ */ e(
|
|
3324
|
+
"span",
|
|
3325
|
+
{
|
|
3326
|
+
className: "flex items-start gap-1 text-[11px] text-slate-500 dark:text-slate-300",
|
|
3327
|
+
"data-chat-online-page": !0,
|
|
3328
|
+
"data-tip": (_ == null ? void 0 : _.current_path) ?? E,
|
|
3329
|
+
children: F
|
|
3330
|
+
}
|
|
3331
|
+
);
|
|
3332
|
+
})()
|
|
3333
|
+
] });
|
|
3334
|
+
})()
|
|
3335
|
+
] }),
|
|
3336
|
+
(() => {
|
|
3337
|
+
var K;
|
|
3338
|
+
const _ = P.byUser.get(String(O.user_id).toUpperCase());
|
|
3339
|
+
if (!ve || !(_ != null && _.recording_id)) return null;
|
|
3340
|
+
const j = ((K = P.adminUrl) == null ? void 0 : K.replace(/\/$/, "")) ?? "", E = !!j && (typeof window > "u" || new URL(j, window.location.origin).origin !== window.location.origin), ne = i.sessionUrl ? i.sessionUrl(_.recording_id, String(O.user_id)) : E ? `${j}/session-replays?recording=${_.recording_id}` : null;
|
|
3341
|
+
return ne ? /* @__PURE__ */ e(
|
|
3307
3342
|
"span",
|
|
3308
3343
|
{
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3344
|
+
role: "link",
|
|
3345
|
+
tabIndex: 0,
|
|
3346
|
+
title: "Watch this session",
|
|
3347
|
+
onClick: (F) => {
|
|
3348
|
+
F.stopPropagation(), ue(ne);
|
|
3349
|
+
},
|
|
3350
|
+
onKeyDown: (F) => {
|
|
3351
|
+
(F.key === "Enter" || F.key === " ") && (F.stopPropagation(), ue(ne));
|
|
3352
|
+
},
|
|
3353
|
+
className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
|
|
3354
|
+
children: /* @__PURE__ */ e(Ga, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
3313
3355
|
}
|
|
3314
|
-
);
|
|
3315
|
-
})()
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
return ne ? /* @__PURE__ */ e(
|
|
3325
|
-
"span",
|
|
3326
|
-
{
|
|
3327
|
-
role: "link",
|
|
3328
|
-
tabIndex: 0,
|
|
3329
|
-
title: "Watch this session",
|
|
3330
|
-
onClick: (F) => {
|
|
3331
|
-
F.stopPropagation(), ue(ne);
|
|
3332
|
-
},
|
|
3333
|
-
onKeyDown: (F) => {
|
|
3334
|
-
(F.key === "Enter" || F.key === " ") && (F.stopPropagation(), ue(ne));
|
|
3335
|
-
},
|
|
3336
|
-
className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
|
|
3337
|
-
children: /* @__PURE__ */ e(Ga, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
3338
|
-
}
|
|
3339
|
-
) : null;
|
|
3340
|
-
})(),
|
|
3341
|
-
/* @__PURE__ */ e(
|
|
3342
|
-
Fn,
|
|
3343
|
-
{
|
|
3344
|
-
className: "h-4 w-4 shrink-0 text-slate-300",
|
|
3345
|
-
strokeWidth: 1.8
|
|
3356
|
+
) : null;
|
|
3357
|
+
})(),
|
|
3358
|
+
/* @__PURE__ */ e(
|
|
3359
|
+
zn,
|
|
3360
|
+
{
|
|
3361
|
+
className: "h-4 w-4 shrink-0 text-slate-300",
|
|
3362
|
+
strokeWidth: 1.8
|
|
3363
|
+
}
|
|
3364
|
+
)
|
|
3365
|
+
]
|
|
3346
3366
|
}
|
|
3347
3367
|
)
|
|
3348
3368
|
]
|
|
3349
3369
|
},
|
|
3350
|
-
|
|
3370
|
+
O.user_id
|
|
3351
3371
|
);
|
|
3352
3372
|
})
|
|
3353
3373
|
] }, k.key))
|
|
3354
3374
|
] }) : U === "archived" ? V ? /* @__PURE__ */ e(
|
|
3355
|
-
|
|
3375
|
+
jn,
|
|
3356
3376
|
{
|
|
3357
3377
|
room: V.room,
|
|
3358
3378
|
label: V.label,
|
|
@@ -3360,10 +3380,10 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3360
3380
|
renderMessageBody: l
|
|
3361
3381
|
}
|
|
3362
3382
|
) : /* @__PURE__ */ e(
|
|
3363
|
-
|
|
3383
|
+
Wn,
|
|
3364
3384
|
{
|
|
3365
|
-
rooms:
|
|
3366
|
-
loading:
|
|
3385
|
+
rooms: be.rooms,
|
|
3386
|
+
loading: be.loading,
|
|
3367
3387
|
archivedView: !0,
|
|
3368
3388
|
onOpen: (k) => se({ room: k.room, label: k.label })
|
|
3369
3389
|
}
|
|
@@ -3374,8 +3394,8 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3374
3394
|
/* @__PURE__ */ e(
|
|
3375
3395
|
ll,
|
|
3376
3396
|
{
|
|
3377
|
-
onOpen: (k,
|
|
3378
|
-
H(!1), S({ room: k, label:
|
|
3397
|
+
onOpen: (k, O, I) => {
|
|
3398
|
+
H(!1), S({ room: k, label: O, channel: I }), $("chat");
|
|
3379
3399
|
}
|
|
3380
3400
|
}
|
|
3381
3401
|
)
|
|
@@ -3383,8 +3403,8 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3383
3403
|
dl,
|
|
3384
3404
|
{
|
|
3385
3405
|
onClose: () => R(!1),
|
|
3386
|
-
onCreated: (k,
|
|
3387
|
-
R(!1), S({ room: k, label:
|
|
3406
|
+
onCreated: (k, O) => {
|
|
3407
|
+
R(!1), S({ room: k, label: O });
|
|
3388
3408
|
}
|
|
3389
3409
|
}
|
|
3390
3410
|
) : C && G && C.channel ? /* @__PURE__ */ e(
|
|
@@ -3395,7 +3415,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3395
3415
|
onBack: () => H(!1)
|
|
3396
3416
|
}
|
|
3397
3417
|
) : C ? /* @__PURE__ */ e(
|
|
3398
|
-
|
|
3418
|
+
jn,
|
|
3399
3419
|
{
|
|
3400
3420
|
room: C.room,
|
|
3401
3421
|
label: C.label,
|
|
@@ -3411,8 +3431,8 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3411
3431
|
th: d,
|
|
3412
3432
|
onBack: () => M(null),
|
|
3413
3433
|
roomLabel: (k) => {
|
|
3414
|
-
var
|
|
3415
|
-
return ((
|
|
3434
|
+
var O;
|
|
3435
|
+
return ((O = ee.find((I) => I.room === k)) == null ? void 0 : O.label) ?? k;
|
|
3416
3436
|
}
|
|
3417
3437
|
}
|
|
3418
3438
|
) : W === "catchup" ? /* @__PURE__ */ e(
|
|
@@ -3424,16 +3444,16 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3424
3444
|
onOpen: v
|
|
3425
3445
|
}
|
|
3426
3446
|
) : /* @__PURE__ */ e(
|
|
3427
|
-
|
|
3447
|
+
Wn,
|
|
3428
3448
|
{
|
|
3429
3449
|
rooms: ee,
|
|
3430
|
-
onOpen: (k,
|
|
3450
|
+
onOpen: (k, O) => {
|
|
3431
3451
|
H(!1), S({
|
|
3432
3452
|
room: k.room,
|
|
3433
3453
|
label: k.label,
|
|
3434
3454
|
channel: k.channel,
|
|
3435
3455
|
unread: k.unread,
|
|
3436
|
-
anchor:
|
|
3456
|
+
anchor: O
|
|
3437
3457
|
});
|
|
3438
3458
|
},
|
|
3439
3459
|
onNewGroup: () => R(!0),
|
|
@@ -3445,7 +3465,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3445
3465
|
)
|
|
3446
3466
|
]
|
|
3447
3467
|
}
|
|
3448
|
-
) : /* @__PURE__ */ e(
|
|
3468
|
+
) : /* @__PURE__ */ e(Rn, {});
|
|
3449
3469
|
}
|
|
3450
3470
|
export {
|
|
3451
3471
|
il as ChatAppearAwayRow,
|
|
@@ -3453,8 +3473,8 @@ export {
|
|
|
3453
3473
|
al as ChatChannelSettings,
|
|
3454
3474
|
mo as ChatPanel,
|
|
3455
3475
|
co as ChatProvider,
|
|
3456
|
-
|
|
3457
|
-
|
|
3476
|
+
Wn as ChatRoomList,
|
|
3477
|
+
jn as ChatRoomView,
|
|
3458
3478
|
uo as ChatSideView,
|
|
3459
3479
|
ul as isChatPanelPinned
|
|
3460
3480
|
};
|