@nivaro/react 0.3.67 → 0.3.68
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 +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +836 -835
- package/dist/shared/components/ConformanceView.js +34 -34
- package/dist/shared/components/ReportView.js +196 -196
- package/dist/shared/components/SlaRulesView.js +36 -36
- package/dist/shared/components/chat/ChatPanel.js +484 -487
- package/dist/shared/components/chat/ChatViews.js +66 -66
- package/dist/shared/components/chat/RoomParts.js +159 -157
- package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
- package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
- package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
- package/dist/shared/components/item-edit/FieldRow.js +87 -87
- package/dist/shared/components/item-edit/FilePickerField.js +281 -297
- package/dist/shared/components/item-edit/RecordInsights.js +90 -91
- package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
- package/dist/shared/components/panels/AddendumPanel.js +409 -411
- package/dist/shared/components/panels/CommentPanel.js +169 -162
- package/dist/shared/components/panels/PipelinePanel.js +75 -75
- package/dist/shared/components/panels/RevisionsPanel.js +103 -103
- package/dist/shared/components/queue/QueueWorklist.js +142 -141
- package/dist/shared/lib/format-value.js +15 -15
- package/dist/shared/lib/utils.js +58 -53
- package/package.json +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as Te, useQueryClient as
|
|
3
|
-
import { Search as
|
|
4
|
-
import { useState as T, useEffect as ae, useMemo as ve, useRef as de, useContext as
|
|
2
|
+
import { useQuery as Te, useQueryClient as Pt, useMutation as We } from "@tanstack/react-query";
|
|
3
|
+
import { Search as zn, Plus as za, Hash as $t, Lock as Ga, ChevronLeft as ut, X as pt, PinOff as Qa, Pin as Mt, Headphones as Ka, PlayCircle as Ja, MessageCircle as Gn, Users as At, AtSign as Ya, AlarmClock as Za, Sparkles as Va, BellOff as Dn, PencilLine as Xa, Star as es, ArchiveRestore as ts, Archive as ns, Bell as as, LogOut as ss, Info as rs, MapPin as Un, Check as It, ArrowUpDown as ls, MessageSquareReply as os, Quote as is, ClipboardPlus as cs, NotebookPen as ds, Bookmark as us, Pencil as ms, Trash2 as ps, AlertTriangle as hs, Paperclip as fs, Bot as xs, CheckCheck as bs, Plane as gs, FilePlus2 as vs } from "lucide-react";
|
|
4
|
+
import { useState as T, useEffect as ae, useMemo as ve, useRef as de, useContext as ys } from "react";
|
|
5
5
|
import { toast as ge } from "sonner";
|
|
6
|
-
import { useItemEditAuth as ht, useNavigation as
|
|
7
|
-
import { get as ye, post as Fe, patch as
|
|
8
|
-
import { useLiveRecord as
|
|
9
|
-
import { usePresenceOnlinePoll as
|
|
10
|
-
import { presencePlaceHref as
|
|
11
|
-
import { invalidateRecordTasks as
|
|
6
|
+
import { useItemEditAuth as ht, useNavigation as ks, useNivaroClient as Ze } from "../../context.js";
|
|
7
|
+
import { get as ye, post as Fe, patch as ws } from "../../lib/commands.js";
|
|
8
|
+
import { useLiveRecord as Ns, batchTouches as Cs, LIVE_ASPECTS as _s } from "../../lib/live.js";
|
|
9
|
+
import { usePresenceOnlinePoll as Ss } from "../../lib/presence-live.js";
|
|
10
|
+
import { presencePlaceHref as $n, stuckText as Mn, fullHref as An } from "../../lib/presence-state.js";
|
|
11
|
+
import { invalidateRecordTasks as Ts } from "../../lib/record-tasks.js";
|
|
12
12
|
import { userErrorMessage as Qn } from "../../lib/safe-error.js";
|
|
13
|
-
import { userCardQuery as
|
|
14
|
-
import { cn as g, getDisplayTimezone as
|
|
15
|
-
import { CustomStatusEditor as
|
|
16
|
-
import { DoNotDisturbRow as
|
|
17
|
-
import {
|
|
18
|
-
import { UserChip as
|
|
19
|
-
import { StaleBuildChip as
|
|
20
|
-
import { UserAvatar as
|
|
13
|
+
import { userCardQuery as Ds } from "../../lib/user-cards.js";
|
|
14
|
+
import { cn as g, toLocalDateString as Us, getDisplayTimezone as jt, formatRelative as Kn } from "../../lib/utils.js";
|
|
15
|
+
import { CustomStatusEditor as $s } from "../CustomStatusEditor.js";
|
|
16
|
+
import { DoNotDisturbRow as Ms } from "../DoNotDisturb.js";
|
|
17
|
+
import { useFileDownload as As } from "../item-edit/file-download.js";
|
|
18
|
+
import { UserChip as Et } from "../item-edit/UserChip.js";
|
|
19
|
+
import { StaleBuildChip as Rs } from "../StaleBuildChip.js";
|
|
20
|
+
import { UserAvatar as Os } from "../UserAvatar.js";
|
|
21
21
|
import { Popover as Ve, PopoverTrigger as Xe, PopoverContent as et } from "../ui/popover.js";
|
|
22
|
-
import { SimpleSelect as
|
|
23
|
-
import { useBotStream as
|
|
24
|
-
import { MembershipHistory as
|
|
25
|
-
import { ChannelExtrasEditor as
|
|
22
|
+
import { SimpleSelect as qt } from "../ui/SimpleSelect.js";
|
|
23
|
+
import { useBotStream as Ls, BotStreamBubble as Ps } from "./BotStream.js";
|
|
24
|
+
import { MembershipHistory as Is, ArchiveSuggestionBanner as js } from "./ChannelArchive.js";
|
|
25
|
+
import { ChannelExtrasEditor as Es, BulkInvitePanel as qs, ChannelAuditLog as Bs } from "./ChannelExtras.js";
|
|
26
26
|
import { ChannelTile as Ye, ChannelLookPicker as Jn } from "./ChannelLook.js";
|
|
27
|
-
import { MentionsView as Yn, ScheduledView as Zn, CatchUpView as Vn, useSearchFilterState as
|
|
28
|
-
import { ChatComposer as
|
|
29
|
-
import { useMyPreferences as
|
|
30
|
-
import { useDraftRooms as
|
|
31
|
-
import { useCustomEmoji as
|
|
32
|
-
import { useRoomRecord as ia, useRecordFileTargets as
|
|
33
|
-
import { offHoursNote as
|
|
34
|
-
import { useMessageWindow as
|
|
27
|
+
import { MentionsView as Yn, ScheduledView as Zn, CatchUpView as Vn, useSearchFilterState as Ws, FilterToggle as Fs, ChatSettingsButton as Hs, SearchFilterBar as zs } from "./ChatViews.js";
|
|
28
|
+
import { ChatComposer as Gs } from "./Composer.js";
|
|
29
|
+
import { useMyPreferences as Bt, useSetMyPreferences as Xn, useChatRoles as ea, useChannelDirectory as Qs, useRoomMembership as Wt, useCreateChannel as Ks, useChatConfig as Le, useChannelMembers as ta, useChannelAdmin as na, useUserSearch as Ft, GENERAL_CHANNEL_ID as aa, useChatRooms as sa, useArchivedRooms as ra, sortOnlineUsers as Js, dmRoom as Rt, CHAT_DEFAULTS as dt, ChatConfigContext as la, useChatBotInfo as Ht, useChatSearch as Ys, dmPeer as Se, useChatMessages as Zs, useOpenRoomRegistration as Vs, useMarkRoomRead as Xs, useTypingIndicator as er, usePeerReadAt as tr, useEntityRoomLink as nr, useToggleReaction as ar, useRoomPins as sr, useTogglePin as rr, useEditMessage as lr, useDeleteMessage as or, useChatBotName as ir, useChatThread as cr, useRecordBrowserTimezone as dr, chatInitials as ur, chatAvatarColor as mr, useCreateGroupDm as pr, canOpenDm as hr, openDmWith as fr, usePagedMembers as xr, chatRoomTypesQuery as oa, REACTION_EMOJI as br } from "./chat-core.js";
|
|
30
|
+
import { useDraftRooms as gr } from "./chat-drafts.js";
|
|
31
|
+
import { useCustomEmoji as vr, EmojiButton as yr, EmojiGlyph as kr } from "./chat-emoji.js";
|
|
32
|
+
import { useRoomRecord as ia, useRecordFileTargets as wr } from "./chat-hooks.js";
|
|
33
|
+
import { offHoursNote as Nr } from "./chat-local-time.js";
|
|
34
|
+
import { useMessageWindow as Cr } from "./chat-window.js";
|
|
35
35
|
import { HuddleFollowHost as Rn } from "./huddle/HuddleCollab.js";
|
|
36
|
-
import { HuddleControls as
|
|
37
|
-
import { HuddleLiveBadge as
|
|
38
|
-
import { HuddleScheduleCard as
|
|
39
|
-
import { HuddleScheduleForm as
|
|
40
|
-
import { HuddleStage as
|
|
41
|
-
import { useHuddleLive as
|
|
36
|
+
import { HuddleControls as _r } from "./huddle/HuddleControls.js";
|
|
37
|
+
import { HuddleLiveBadge as Sr } from "./huddle/HuddleLiveBadge.js";
|
|
38
|
+
import { HuddleScheduleCard as Tr } from "./huddle/HuddleScheduleCard.js";
|
|
39
|
+
import { HuddleScheduleForm as Dr } from "./huddle/HuddleScheduleForm.js";
|
|
40
|
+
import { HuddleStage as Ur } from "./huddle/HuddleStage.js";
|
|
41
|
+
import { useHuddleLive as $r } from "./huddle/huddle-live.js";
|
|
42
42
|
import { stripHuddleRef as On, huddleRefOf as Ln } from "./huddle/huddle-schedule.js";
|
|
43
|
-
import { useHuddle as
|
|
44
|
-
import { MemberSearchBox as
|
|
45
|
-
import { useMessageActions as
|
|
46
|
-
import { FormattedMessage as
|
|
47
|
-
import { PollCard as
|
|
48
|
-
import { RoomStatusMarks as
|
|
49
|
-
import { MemberCountLine as
|
|
50
|
-
import { clipInfo as
|
|
43
|
+
import { useHuddle as Mr } from "./huddle/useHuddle.js";
|
|
44
|
+
import { MemberSearchBox as Ar, MemberOnlineDot as Rr, MemberLoadMore as Or } from "./MemberPaging.js";
|
|
45
|
+
import { useMessageActions as Lr, MessageActionsMenu as Pr, actionsForMessage as Ir } from "./MessageActions.js";
|
|
46
|
+
import { FormattedMessage as jr, LinkPreviews as Er } from "./MessageFormat.js";
|
|
47
|
+
import { PollCard as qr } from "./PollCard.js";
|
|
48
|
+
import { RoomStatusMarks as Br, headerIconIdle as Pn, headerIconButton as In, RoomHeaderMenu as Wr } from "./RoomHeaderMenu.js";
|
|
49
|
+
import { MemberCountLine as Fr, ChannelIntro as Hr, WelcomeNote as zr, ThreadPane as Gr, RoomInfoDrawer as Qr } from "./RoomParts.js";
|
|
50
|
+
import { clipInfo as Kr, ClipPlayer as Jr } from "./ScreenClip.js";
|
|
51
51
|
import { useOutbox as ca } from "./chat-outbox.js";
|
|
52
52
|
import { OutboxBubbles as da } from "./OutboxBubbles.js";
|
|
53
53
|
const ua = {
|
|
@@ -60,9 +60,9 @@ const ua = {
|
|
|
60
60
|
surface: "bg-white dark:bg-card",
|
|
61
61
|
input: "border-slate-200 bg-slate-50 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100",
|
|
62
62
|
divider: "border-slate-100 dark:border-border/60"
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
function
|
|
63
|
+
}, zt = {};
|
|
64
|
+
zt.current = ua;
|
|
65
|
+
function vo({
|
|
66
66
|
children: n,
|
|
67
67
|
me: s,
|
|
68
68
|
onlineUsers: l = [],
|
|
@@ -76,7 +76,7 @@ function bo({
|
|
|
76
76
|
sessionUrl: u,
|
|
77
77
|
realtime: b,
|
|
78
78
|
subscribeRooms: y,
|
|
79
|
-
setTypingRoom:
|
|
79
|
+
setTypingRoom: D,
|
|
80
80
|
navigate: A,
|
|
81
81
|
sound: C = !0,
|
|
82
82
|
theme: S
|
|
@@ -95,7 +95,7 @@ function bo({
|
|
|
95
95
|
subscribeRooms: y,
|
|
96
96
|
me: s,
|
|
97
97
|
onlineUsers: l,
|
|
98
|
-
setTypingRoom:
|
|
98
|
+
setTypingRoom: D,
|
|
99
99
|
navigate: A,
|
|
100
100
|
sound: C
|
|
101
101
|
}),
|
|
@@ -108,17 +108,17 @@ function bo({
|
|
|
108
108
|
i,
|
|
109
109
|
p,
|
|
110
110
|
b,
|
|
111
|
-
|
|
111
|
+
D,
|
|
112
112
|
C
|
|
113
113
|
]
|
|
114
114
|
);
|
|
115
|
-
return
|
|
115
|
+
return zt.current = { ...ua, ...S }, /* @__PURE__ */ e(la.Provider, { value: B, children: n });
|
|
116
116
|
}
|
|
117
117
|
function ue() {
|
|
118
|
-
return
|
|
118
|
+
return zt.current;
|
|
119
119
|
}
|
|
120
120
|
const jn = /* @__PURE__ */ new WeakMap();
|
|
121
|
-
function
|
|
121
|
+
function Yr(n, s) {
|
|
122
122
|
const l = String(s).toUpperCase();
|
|
123
123
|
let r = jn.get(n);
|
|
124
124
|
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, jn.set(n, r));
|
|
@@ -141,10 +141,10 @@ function Kr(n, s) {
|
|
|
141
141
|
}, 0));
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function Gt(n, s = !0) {
|
|
145
145
|
const l = Ze(), { data: r } = Te({
|
|
146
146
|
queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
|
|
147
|
-
queryFn: () =>
|
|
147
|
+
queryFn: () => Yr(l, n),
|
|
148
148
|
enabled: !!n && s,
|
|
149
149
|
staleTime: 6e4
|
|
150
150
|
});
|
|
@@ -154,26 +154,26 @@ function ma(n) {
|
|
|
154
154
|
return n != null && n.last_seen ? `last seen ${Kn(n.last_seen)}` : null;
|
|
155
155
|
}
|
|
156
156
|
function pa(n) {
|
|
157
|
-
const s =
|
|
157
|
+
const s = ys(la), l = ba(), r = String(n).toUpperCase();
|
|
158
158
|
if (l.loaded) {
|
|
159
159
|
const i = l.byUser.get(r);
|
|
160
160
|
if (!i) return { state: "offline", title: "Offline", page: null };
|
|
161
161
|
const p = i.page ?? ga(i.current_path);
|
|
162
|
-
return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title:
|
|
162
|
+
return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: Ot(i), page: p } : { state: "online", title: "Online", page: p };
|
|
163
163
|
}
|
|
164
164
|
const o = s == null ? void 0 : s.onlineUsers.find((i) => String(i.user_id).toUpperCase() === r);
|
|
165
|
-
return o ? o.is_idle ? { state: "idle", title:
|
|
165
|
+
return o ? o.is_idle ? { state: "idle", title: Ot(o), page: null } : { state: "online", title: "Online", page: null } : { state: "offline", title: "Offline", page: null };
|
|
166
166
|
}
|
|
167
167
|
function ha(n) {
|
|
168
168
|
return n != null && n.out_of_office ? n.ooo_end ? `Out of office until ${new Date(n.ooo_end).toLocaleDateString(void 0, {
|
|
169
169
|
weekday: "short",
|
|
170
170
|
month: "short",
|
|
171
171
|
day: "numeric",
|
|
172
|
-
timeZone:
|
|
172
|
+
timeZone: jt() ?? void 0
|
|
173
173
|
})}` : "Out of office" : null;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const { state: l, title: r, page: o } = pa(n), i =
|
|
175
|
+
function Zr({ id: n, size: s }) {
|
|
176
|
+
const { state: l, title: r, page: o } = pa(n), i = Gt(n), p = l === "offline" ? ma(i) : null, d = ha(i), x = s >= 30 ? 10 : 8, f = [
|
|
177
177
|
p ? `Offline · ${p}` : r,
|
|
178
178
|
o && l !== "offline" ? `On ${o}` : null,
|
|
179
179
|
d,
|
|
@@ -203,7 +203,7 @@ function Jr({ id: n, size: s }) {
|
|
|
203
203
|
"data-chat-ooo": !0,
|
|
204
204
|
title: f,
|
|
205
205
|
"aria-label": d,
|
|
206
|
-
children: /* @__PURE__ */ e(
|
|
206
|
+
children: /* @__PURE__ */ e(gs, { style: { width: x - 3, height: x - 3 }, strokeWidth: 2.5 })
|
|
207
207
|
}
|
|
208
208
|
)
|
|
209
209
|
] });
|
|
@@ -214,21 +214,21 @@ function Q({
|
|
|
214
214
|
size: l = 32,
|
|
215
215
|
presence: r = !0
|
|
216
216
|
}) {
|
|
217
|
-
const o =
|
|
217
|
+
const o = Ht(), i = /* @__PURE__ */ e(
|
|
218
218
|
"span",
|
|
219
219
|
{
|
|
220
220
|
className: "flex shrink-0 items-center justify-center rounded-full font-semibold text-[#04263b]",
|
|
221
221
|
style: {
|
|
222
222
|
width: l,
|
|
223
223
|
height: l,
|
|
224
|
-
backgroundColor:
|
|
224
|
+
backgroundColor: mr(n),
|
|
225
225
|
fontSize: l * 0.36
|
|
226
226
|
},
|
|
227
227
|
"aria-hidden": !0,
|
|
228
|
-
children:
|
|
228
|
+
children: ur(s)
|
|
229
229
|
}
|
|
230
230
|
), p = /* @__PURE__ */ e(
|
|
231
|
-
|
|
231
|
+
Os,
|
|
232
232
|
{
|
|
233
233
|
userId: n,
|
|
234
234
|
fallback: i,
|
|
@@ -238,12 +238,12 @@ function Q({
|
|
|
238
238
|
), d = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(n).toUpperCase();
|
|
239
239
|
return !r || d ? p : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
|
|
240
240
|
p,
|
|
241
|
-
/* @__PURE__ */ e(
|
|
241
|
+
/* @__PURE__ */ e(Zr, { id: n, size: l })
|
|
242
242
|
] });
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const l =
|
|
246
|
-
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(
|
|
244
|
+
function Vr({ peerId: n, name: s }) {
|
|
245
|
+
const l = Ht(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(Q, { id: n, name: s, size: 28 });
|
|
246
|
+
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Et, { userId: n, children: /* @__PURE__ */ e(
|
|
247
247
|
"button",
|
|
248
248
|
{
|
|
249
249
|
type: "button",
|
|
@@ -258,7 +258,7 @@ function En({ token: n, url: s, mine: l }) {
|
|
|
258
258
|
const r = Le(), o = ue(), i = Ze(), { data: p } = Te(oa(i)), { data: d } = Te({
|
|
259
259
|
queryKey: ["nvr-chat-entity-card", n],
|
|
260
260
|
queryFn: async () => {
|
|
261
|
-
var u, b, y,
|
|
261
|
+
var u, b, y, D;
|
|
262
262
|
for (const A of p ?? [])
|
|
263
263
|
try {
|
|
264
264
|
const S = (b = (u = (await i.request(
|
|
@@ -269,14 +269,14 @@ function En({ token: n, url: s, mine: l }) {
|
|
|
269
269
|
})
|
|
270
270
|
)).data) == null ? void 0 : u[0]) == null ? void 0 : b.id;
|
|
271
271
|
if (S == null) continue;
|
|
272
|
-
const
|
|
272
|
+
const $ = (D = (y = (await i.request(
|
|
273
273
|
ye(`/pipelines/instance/${A.collection}/${S}`)
|
|
274
|
-
)).data) == null ? void 0 : y.instance) == null ? void 0 :
|
|
274
|
+
)).data) == null ? void 0 : y.instance) == null ? void 0 : D.current_state_obj;
|
|
275
275
|
return {
|
|
276
276
|
collection: A.collection,
|
|
277
277
|
id: S,
|
|
278
|
-
state: (
|
|
279
|
-
color: (
|
|
278
|
+
state: ($ == null ? void 0 : $.label) ?? null,
|
|
279
|
+
color: ($ == null ? void 0 : $.color) ?? null
|
|
280
280
|
};
|
|
281
281
|
} catch {
|
|
282
282
|
}
|
|
@@ -284,12 +284,12 @@ function En({ token: n, url: s, mine: l }) {
|
|
|
284
284
|
},
|
|
285
285
|
enabled: ((p == null ? void 0 : p.length) ?? 0) > 0,
|
|
286
286
|
staleTime: 10 * 6e4
|
|
287
|
-
}), x =
|
|
288
|
-
return
|
|
287
|
+
}), x = Pt();
|
|
288
|
+
return Ns(
|
|
289
289
|
d == null ? void 0 : d.collection,
|
|
290
290
|
d == null ? void 0 : d.id,
|
|
291
291
|
(u) => {
|
|
292
|
-
|
|
292
|
+
Cs(u, _s.state) && x.invalidateQueries({ queryKey: ["nvr-chat-entity-card", n] });
|
|
293
293
|
},
|
|
294
294
|
{ includeOwn: !0, debounceMs: 400 }
|
|
295
295
|
), /* @__PURE__ */ a(
|
|
@@ -299,9 +299,9 @@ function En({ token: n, url: s, mine: l }) {
|
|
|
299
299
|
onClick: () => {
|
|
300
300
|
var u, b;
|
|
301
301
|
if (d) {
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
304
|
-
(u = r.navigate) == null || u.call(r,
|
|
302
|
+
const D = (r.recordUrl ?? ((A, C) => `/collections/${A}/${C}`))(d.collection, d.id);
|
|
303
|
+
if (D) {
|
|
304
|
+
(u = r.navigate) == null || u.call(r, D);
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -329,11 +329,11 @@ function En({ token: n, url: s, mine: l }) {
|
|
|
329
329
|
}
|
|
330
330
|
);
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function Xr(n) {
|
|
333
333
|
const s = new Date(n), l = /* @__PURE__ */ new Date(), r = new Date(l);
|
|
334
334
|
return r.setDate(l.getDate() - 1), s.toDateString() === l.toDateString() ? "Today" : s.toDateString() === r.toDateString() ? "Yesterday" : s.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function el({ botName: n }) {
|
|
337
337
|
const s = ue(), l = [
|
|
338
338
|
{
|
|
339
339
|
k: "@name",
|
|
@@ -397,28 +397,28 @@ function Vr({ botName: n }) {
|
|
|
397
397
|
)) })
|
|
398
398
|
] });
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
const s = Le(), l = ue(), r = Ze(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, p = o > 0 ? n.slice(o + 1) : null, d = !!i && !!p && n !== s.globalRoom && i !== "dm" && i !== "ch", x =
|
|
400
|
+
function tl({ room: n }) {
|
|
401
|
+
const s = Le(), l = ue(), r = Ze(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, p = o > 0 ? n.slice(o + 1) : null, d = !!i && !!p && n !== s.globalRoom && i !== "dm" && i !== "ch", x = Pt(), { data: f } = Te({
|
|
402
402
|
queryKey: ["nvr-chat-room-card", n],
|
|
403
403
|
queryFn: async () => {
|
|
404
|
-
var J, G, F,
|
|
404
|
+
var J, G, F, R;
|
|
405
405
|
const S = (await x.fetchQuery(oa(r))).find((K) => K.is_active && K.prefix === i);
|
|
406
406
|
if (!S) return null;
|
|
407
|
-
const
|
|
407
|
+
const $ = (G = (J = (await r.request(
|
|
408
408
|
ye(`/items/${S.collection}`, {
|
|
409
409
|
limit: 1,
|
|
410
410
|
fields: "id",
|
|
411
411
|
filter: JSON.stringify({ [S.match_field]: { _eq: p } })
|
|
412
412
|
})
|
|
413
413
|
)).data) == null ? void 0 : J[0]) == null ? void 0 : G.id;
|
|
414
|
-
if (
|
|
415
|
-
const E = (
|
|
416
|
-
ye(`/pipelines/instance/${S.collection}/${
|
|
417
|
-
)).data) == null ? void 0 : F.instance) == null ? void 0 :
|
|
414
|
+
if ($ == null) return null;
|
|
415
|
+
const E = (R = (F = (await r.request(
|
|
416
|
+
ye(`/pipelines/instance/${S.collection}/${$}`)
|
|
417
|
+
)).data) == null ? void 0 : F.instance) == null ? void 0 : R.current_state_obj;
|
|
418
418
|
return {
|
|
419
419
|
collection: S.collection,
|
|
420
420
|
type_label: S.label ?? S.collection.replace(/_/g, " "),
|
|
421
|
-
id:
|
|
421
|
+
id: $,
|
|
422
422
|
state: (E == null ? void 0 : E.label) ?? null,
|
|
423
423
|
color: (E == null ? void 0 : E.color) ?? null
|
|
424
424
|
};
|
|
@@ -427,7 +427,7 @@ function Xr({ room: n }) {
|
|
|
427
427
|
staleTime: 6e4
|
|
428
428
|
}), u = ia(n, d && !!f);
|
|
429
429
|
if (!d || !f) return null;
|
|
430
|
-
const y = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id),
|
|
430
|
+
const y = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), D = (u == null ? void 0 : u.sla) ?? null, A = (D == null ? void 0 : D.status) === "breached" ? "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300" : (D == null ? void 0 : D.status) === "warning" ? "bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300" : "bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300";
|
|
431
431
|
return /* @__PURE__ */ a(
|
|
432
432
|
"div",
|
|
433
433
|
{
|
|
@@ -447,13 +447,13 @@ function Xr({ room: n }) {
|
|
|
447
447
|
children: f.state
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
|
-
|
|
450
|
+
D && /* @__PURE__ */ e(
|
|
451
451
|
"span",
|
|
452
452
|
{
|
|
453
453
|
className: g("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", A),
|
|
454
|
-
title:
|
|
455
|
-
"data-chat-room-sla":
|
|
456
|
-
children:
|
|
454
|
+
title: D.due_hours != null ? `${Math.round(D.elapsed_hours ?? 0)}h in this state of ${D.due_hours}h allowed` : void 0,
|
|
455
|
+
"data-chat-room-sla": D.status,
|
|
456
|
+
children: D.status === "breached" ? "Past SLA" : D.status === "warning" ? "SLA soon" : "On time"
|
|
457
457
|
}
|
|
458
458
|
),
|
|
459
459
|
u && u.owners.length > 0 && /* @__PURE__ */ a(
|
|
@@ -491,9 +491,9 @@ function Xr({ room: n }) {
|
|
|
491
491
|
}
|
|
492
492
|
);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function nl(n, s) {
|
|
495
495
|
if (!n) return null;
|
|
496
|
-
const l =
|
|
496
|
+
const l = jt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
|
|
497
497
|
let o, i;
|
|
498
498
|
try {
|
|
499
499
|
const d = (x) => new Intl.DateTimeFormat("en-US", { timeZone: x, hour: "numeric", minute: "2-digit" }).format(
|
|
@@ -514,12 +514,12 @@ function fa() {
|
|
|
514
514
|
return () => clearInterval(l);
|
|
515
515
|
}, []), n;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function al({ peerId: n, name: s }) {
|
|
518
518
|
fa();
|
|
519
|
-
const { state: l, title: r } = pa(n), o =
|
|
519
|
+
const { state: l, title: r } = pa(n), o = Gt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
|
|
520
520
|
const f = ma(o);
|
|
521
521
|
return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
|
|
522
|
-
})() : r, p =
|
|
522
|
+
})() : r, p = nl((o == null ? void 0 : o.timezone) ?? null, s), d = ha(o), x = d ? (o == null ? void 0 : o.delegate) ?? null : null;
|
|
523
523
|
return /* @__PURE__ */ a(
|
|
524
524
|
"p",
|
|
525
525
|
{
|
|
@@ -535,11 +535,11 @@ function tl({ peerId: n, name: s }) {
|
|
|
535
535
|
children: d
|
|
536
536
|
}
|
|
537
537
|
),
|
|
538
|
-
x &&
|
|
538
|
+
x && hr() && /* @__PURE__ */ a(
|
|
539
539
|
"button",
|
|
540
540
|
{
|
|
541
541
|
type: "button",
|
|
542
|
-
onClick: () =>
|
|
542
|
+
onClick: () => fr(x.id, x.name),
|
|
543
543
|
className: "shrink-0 font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-slate-200 dark:hover:text-white",
|
|
544
544
|
"data-chat-dm-delegate": x.id,
|
|
545
545
|
children: [
|
|
@@ -571,41 +571,41 @@ function qn({
|
|
|
571
571
|
openThread: d = null
|
|
572
572
|
}) {
|
|
573
573
|
var fn, xn, bn, gn, vn, yn, kn, wn, Nn, Cn;
|
|
574
|
-
const x = Le(), f = ue(), u = Ze(), b = x.me, y =
|
|
575
|
-
...
|
|
576
|
-
enabled: !!
|
|
574
|
+
const x = Le(), f = ue(), u = Ze(), b = x.me, y = Mr(n), D = b ? Se(n, b.id) : null, A = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Te({
|
|
575
|
+
...Ds(u, D),
|
|
576
|
+
enabled: !!D && A,
|
|
577
577
|
staleTime: 12e4
|
|
578
|
-
}), S = A &&
|
|
579
|
-
ae(() =>
|
|
580
|
-
const { messages: v, loading: E, hasOlder: J, hasNewer: G, loadOlder: F, loadingOlder:
|
|
578
|
+
}), S = A && D ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : s, [B, $] = T(p);
|
|
579
|
+
ae(() => $(p), [p]);
|
|
580
|
+
const { messages: v, loading: E, hasOlder: J, hasNewer: G, loadOlder: F, loadingOlder: R } = Zs(
|
|
581
581
|
n,
|
|
582
582
|
B
|
|
583
583
|
);
|
|
584
|
-
|
|
585
|
-
const K = ca(n), ee =
|
|
584
|
+
Vs(n);
|
|
585
|
+
const K = ca(n), ee = Xs(), Y = er(n), te = tr(n.startsWith("dm:") ? n : null), oe = nr(n), se = ar(n), me = sr(n), c = rr(n), L = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== x.globalRoom && n.includes(":"), m = ia(n, L), Z = wr(n, !!m), De = n.startsWith("ch:"), { data: he = [] } = Te({
|
|
586
586
|
queryKey: ["chat-read-marks", n],
|
|
587
587
|
queryFn: () => u.request(
|
|
588
588
|
ye(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
|
|
589
589
|
).then((t) => t.data ?? []).catch(() => []),
|
|
590
|
-
enabled:
|
|
591
|
-
refetchInterval:
|
|
590
|
+
enabled: De,
|
|
591
|
+
refetchInterval: De ? 3e4 : !1,
|
|
592
592
|
staleTime: 15e3
|
|
593
593
|
}), Pe = (t) => he.filter(
|
|
594
594
|
(h) => h.user !== String(t.sender ?? "") && new Date(h.last_read_at).getTime() >= new Date(t.date_created).getTime()
|
|
595
|
-
), Ne =
|
|
595
|
+
), Ne = Pt(), { data: Ue = [] } = Te({
|
|
596
596
|
queryKey: ["chat-saved"],
|
|
597
597
|
queryFn: () => u.request(ye("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
|
|
598
598
|
staleTime: 6e4
|
|
599
|
-
}), Ce = ve(() => new Set(
|
|
599
|
+
}), Ce = ve(() => new Set(Ue.map((t) => t.id)), [Ue]), k = We({
|
|
600
600
|
mutationFn: (t) => u.request(Fe(`/chat/messages/${t}/save`, {})),
|
|
601
601
|
onSuccess: () => void Ne.invalidateQueries({ queryKey: ["chat-saved"] })
|
|
602
|
-
}), [
|
|
602
|
+
}), [M, P] = T(null), V = We({
|
|
603
603
|
mutationFn: () => u.request(
|
|
604
604
|
Fe("/chat/rooms/summary", { room: n })
|
|
605
605
|
).then((t) => t.data),
|
|
606
606
|
onSuccess: (t) => P((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
|
|
607
607
|
onError: () => P("Summary unavailable.")
|
|
608
|
-
}),
|
|
608
|
+
}), $e = We({
|
|
609
609
|
mutationFn: async (t) => {
|
|
610
610
|
if (!m || !b) throw new Error("no record");
|
|
611
611
|
await u.request(
|
|
@@ -618,7 +618,7 @@ function qn({
|
|
|
618
618
|
);
|
|
619
619
|
},
|
|
620
620
|
onSuccess: () => {
|
|
621
|
-
m &&
|
|
621
|
+
m && Ts(Ne, m.collection, m.id), ge.success("Task created from message — assigned to you");
|
|
622
622
|
},
|
|
623
623
|
onError: () => ge.error("Could not create a task")
|
|
624
624
|
}), _ = We({
|
|
@@ -648,15 +648,15 @@ function qn({
|
|
|
648
648
|
);
|
|
649
649
|
}
|
|
650
650
|
}), j = We({
|
|
651
|
-
mutationFn: (t) => u.request(
|
|
651
|
+
mutationFn: (t) => u.request(ws(`/chat/messages/${t}`, { no_preview: !0 })),
|
|
652
652
|
onSuccess: () => void Ne.invalidateQueries({ queryKey: ["nvr-chat", n] })
|
|
653
|
-
}), ie =
|
|
653
|
+
}), ie = lr(n), ne = or(n), { isAdmin: X } = ht(), { setMuted: H, setNotifyMode: re, setArchived: fe, setStarred: va, dismissWelcome: ya, leave: ka } = Wt(), { rooms: wa, loading: Na } = sa(), Qt = wa.find((t) => t.room === n) ?? null, { rooms: Ca } = ra(!Na && !Qt), w = Qt ?? Ca.find((t) => t.room === n) ?? null, _a = xa(w), Kt = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", pe = ir(), [tt, Sa] = T(!1), [nt, Jt] = T(""), [Ta, ft] = T(null), [Yt, Zt] = T(""), [Da, xt] = T(null), Ua = Lr(n), [$a, Vt] = T(null), Ma = As(), [Xt, Ie] = T(null), en = cr(d ? n : null, d), tn = !!en.root && !en.root.deleted_at;
|
|
654
654
|
ae(() => {
|
|
655
655
|
d && tn && Ie(d);
|
|
656
656
|
}, [d, tn]);
|
|
657
|
-
const [
|
|
657
|
+
const [Aa, nn] = T(null), [Ra, an] = T(null), [bt, He] = T(!1), [Oa, gt] = T(!1), [ce, ze] = T(null), [Ge, at] = T(
|
|
658
658
|
p && "around" in p ? p.around : null
|
|
659
|
-
), [st, vt] = T(null), Qe =
|
|
659
|
+
), [st, vt] = T(null), Qe = Ls(n, (b == null ? void 0 : b.id) ?? null), sn = de(null), yt = de(null), kt = de(Math.max(0, i ?? 0)), Me = de(!1), Re = de(null), rn = de(null), le = de(!p), Ke = de(0), Je = de(null), wt = de(0), rt = () => {
|
|
660
660
|
const t = Re.current;
|
|
661
661
|
t && (t.scrollTop = t.scrollHeight);
|
|
662
662
|
}, Nt = (t) => {
|
|
@@ -664,19 +664,19 @@ function qn({
|
|
|
664
664
|
const h = (N = Re.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
|
|
665
665
|
return h ? (h.scrollIntoView({ block: "center" }), le.current = !1, at(t), !0) : we.reveal(t) ? (le.current = !1, at(t), !0) : !1;
|
|
666
666
|
}, ln = (t) => {
|
|
667
|
-
|
|
667
|
+
He(!1), Nt(t) || (Me.current = !1, le.current = !1, at(t), $({ around: t }));
|
|
668
668
|
};
|
|
669
669
|
ae(() => {
|
|
670
670
|
if (Ge == null) return;
|
|
671
671
|
const t = setTimeout(() => at(null), 2400);
|
|
672
672
|
return () => clearTimeout(t);
|
|
673
673
|
}, [Ge]), ae(() => {
|
|
674
|
-
|
|
674
|
+
Me.current = !1, Ke.current = 0, ze(null);
|
|
675
675
|
}, [n, B]), ae(() => {
|
|
676
676
|
var Oe, qe;
|
|
677
677
|
const t = Re.current, h = ((Oe = v[0]) == null ? void 0 : Oe.id) ?? null;
|
|
678
|
-
if (
|
|
679
|
-
if (
|
|
678
|
+
if (!Me.current && v.length > 0) {
|
|
679
|
+
if (Me.current = !0, Ke.current = v.length, Je.current = h, Ge != null && Nt(Ge)) return;
|
|
680
680
|
yt.current && !B ? (yt.current.scrollIntoView({ block: "center" }), le.current = !1) : B || (rt(), le.current = !0);
|
|
681
681
|
return;
|
|
682
682
|
}
|
|
@@ -687,12 +687,12 @@ function qn({
|
|
|
687
687
|
Je.current = h;
|
|
688
688
|
const N = v.length - Ke.current;
|
|
689
689
|
if (Ke.current = v.length, N <= 0) return;
|
|
690
|
-
const W = v[v.length - 1],
|
|
691
|
-
if (le.current ||
|
|
692
|
-
rt(), le.current = !0,
|
|
690
|
+
const W = v[v.length - 1], z = !!(W != null && W.sender) && W.sender.toLowerCase() === ((qe = b == null ? void 0 : b.id) == null ? void 0 : qe.toLowerCase());
|
|
691
|
+
if (le.current || z)
|
|
692
|
+
rt(), le.current = !0, ze(null);
|
|
693
693
|
else {
|
|
694
694
|
const Ae = v[v.length - N];
|
|
695
|
-
|
|
695
|
+
ze((be) => ({ count: ((be == null ? void 0 : be.count) ?? 0) + N, firstId: (be == null ? void 0 : be.firstId) ?? Ae.id }));
|
|
696
696
|
}
|
|
697
697
|
}, [v]), ae(() => {
|
|
698
698
|
const t = rn.current;
|
|
@@ -705,7 +705,7 @@ function qn({
|
|
|
705
705
|
}, []), ae(() => {
|
|
706
706
|
var N, W;
|
|
707
707
|
const t = v[v.length - 1];
|
|
708
|
-
if (!t ||
|
|
708
|
+
if (!t || !Me.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((W = b == null ? void 0 : b.id) == null ? void 0 : W.toLowerCase()))
|
|
709
709
|
return;
|
|
710
710
|
const h = Date.now() - new Date(t.date_created).getTime();
|
|
711
711
|
h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && u.request(Fe("/chat/health/delivery", { ms: h })).catch(() => {
|
|
@@ -743,32 +743,32 @@ function qn({
|
|
|
743
743
|
ae(() => {
|
|
744
744
|
B || ee.mutate(n);
|
|
745
745
|
}, [n, v.length, B]);
|
|
746
|
-
const
|
|
747
|
-
if (le.current = !0, B &&
|
|
746
|
+
const La = (t) => {
|
|
747
|
+
if (le.current = !0, B && $(null), pe) {
|
|
748
748
|
const h = pe.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
749
749
|
new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) && vt(Date.now());
|
|
750
750
|
}
|
|
751
751
|
}, je = (xn = b == null ? void 0 : b.id) == null ? void 0 : xn.toLowerCase(), xe = tt && nt.trim().length > 0, _e = ve(
|
|
752
752
|
() => xe ? v.filter((t) => t.message.toLowerCase().includes(nt.trim().toLowerCase())) : v,
|
|
753
753
|
[v, xe, nt]
|
|
754
|
-
),
|
|
754
|
+
), Pa = ve(() => {
|
|
755
755
|
var t;
|
|
756
756
|
if (xe) return -1;
|
|
757
757
|
for (let h = _e.length - 1; h >= 0; h--)
|
|
758
758
|
if (((t = _e[h].sender) == null ? void 0 : t.toLowerCase()) === je) return h;
|
|
759
759
|
return -1;
|
|
760
|
-
}, [_e, je, xe]), on = te ? new Date(te).getTime() : 0, Ee =
|
|
760
|
+
}, [_e, je, xe]), on = te ? new Date(te).getTime() : 0, Ee = Bt().chat_density === "compact" ? "compact" : "comfortable", cn = de(null), Ia = ve(() => _e.map((t) => t.id), [_e]), we = Cr({
|
|
761
761
|
scrollerRef: Re,
|
|
762
762
|
listRef: cn,
|
|
763
|
-
ids:
|
|
763
|
+
ids: Ia,
|
|
764
764
|
estimate: Ee === "compact" ? 40 : 72,
|
|
765
765
|
resetKey: `${n}|${JSON.stringify(B)}|${xe ? "search" : ""}`,
|
|
766
766
|
pinnedRef: le
|
|
767
|
-
}), q = (w == null ? void 0 : w.channel) ?? null, dn = !!q && !!b && String(q.created_by ?? "").toUpperCase() === b.id.toUpperCase(), un = q != null && q.announce && !dn && !X ? q.id === aa ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, mn = b ? Se(n, b.id) : null,
|
|
767
|
+
}), q = (w == null ? void 0 : w.channel) ?? null, dn = !!q && !!b && String(q.created_by ?? "").toUpperCase() === b.id.toUpperCase(), un = q != null && q.announce && !dn && !X ? q.id === aa ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, mn = b ? Se(n, b.id) : null, ja = Gt(mn);
|
|
768
768
|
fa();
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
const
|
|
769
|
+
const Ea = mn ? Nr(ja, S, /* @__PURE__ */ new Date()) : null;
|
|
770
|
+
dr(), vr();
|
|
771
|
+
const qa = !!(q != null && q.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !q.is_direct, Ba = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: x.entityUrl(t.entity) }, h) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), Wa = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: x.entityUrl(t.entity), mine: !0 }, h) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), pn = (t, h = {}) => {
|
|
772
772
|
var _n, Sn;
|
|
773
773
|
const N = ((_n = t.sender) == null ? void 0 : _n.toLowerCase()) === je;
|
|
774
774
|
if (t.is_system)
|
|
@@ -787,10 +787,10 @@ function qn({
|
|
|
787
787
|
] })
|
|
788
788
|
}
|
|
789
789
|
);
|
|
790
|
-
const W = h.isLastMine && on > 0 && new Date(t.date_created).getTime() <= on,
|
|
791
|
-
for (const
|
|
792
|
-
const
|
|
793
|
-
|
|
790
|
+
const W = h.isLastMine && on > 0 && new Date(t.date_created).getTime() <= on, z = !!t.deleted_at, Oe = N && !z && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, qe = !z && (N || X), Ae = Ta === t.id, be = /* @__PURE__ */ new Map();
|
|
791
|
+
for (const U of t.reactions ?? []) {
|
|
792
|
+
const O = be.get(U.emoji) ?? { count: 0, mine: !1, names: [] };
|
|
793
|
+
O.count++, ((Sn = U.user) == null ? void 0 : Sn.toLowerCase()) === je && (O.mine = !0), U.user_name && O.names.push(U.user_name), be.set(U.emoji, O);
|
|
794
794
|
}
|
|
795
795
|
const Be = "rounded-full p-0.5 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200";
|
|
796
796
|
return /* @__PURE__ */ a(
|
|
@@ -803,7 +803,7 @@ function qn({
|
|
|
803
803
|
),
|
|
804
804
|
"data-chat-msg": t.id,
|
|
805
805
|
children: [
|
|
806
|
-
!N && /* @__PURE__ */ e(
|
|
806
|
+
!N && /* @__PURE__ */ e(Et, { userId: t.sender, children: /* @__PURE__ */ e(
|
|
807
807
|
"button",
|
|
808
808
|
{
|
|
809
809
|
type: "button",
|
|
@@ -829,36 +829,36 @@ function qn({
|
|
|
829
829
|
}
|
|
830
830
|
)
|
|
831
831
|
] }),
|
|
832
|
-
!
|
|
832
|
+
!z && !Ae && /* @__PURE__ */ a(
|
|
833
833
|
"div",
|
|
834
834
|
{
|
|
835
835
|
className: g(
|
|
836
836
|
"absolute -top-3 z-10 hidden items-center gap-0.5 rounded-full border px-1 py-0.5 shadow-sm group-hover/msg:flex",
|
|
837
|
-
|
|
837
|
+
$a === t.id && "flex",
|
|
838
838
|
f.surface,
|
|
839
839
|
"border-slate-200 dark:border-border",
|
|
840
840
|
N ? "right-0" : "left-0"
|
|
841
841
|
),
|
|
842
842
|
"data-chat-msg-actions": !0,
|
|
843
843
|
children: [
|
|
844
|
-
|
|
844
|
+
br.map((U) => /* @__PURE__ */ e(
|
|
845
845
|
"button",
|
|
846
846
|
{
|
|
847
847
|
type: "button",
|
|
848
|
-
onClick: () => se.mutate({ messageId: t.id, emoji:
|
|
848
|
+
onClick: () => se.mutate({ messageId: t.id, emoji: U }),
|
|
849
849
|
className: "rounded-full px-0.5 text-[13px] leading-none transition-transform hover:scale-125",
|
|
850
|
-
title: `React ${
|
|
851
|
-
children:
|
|
850
|
+
title: `React ${U}`,
|
|
851
|
+
children: U
|
|
852
852
|
},
|
|
853
|
-
|
|
853
|
+
U
|
|
854
854
|
)),
|
|
855
855
|
/* @__PURE__ */ e(
|
|
856
|
-
|
|
856
|
+
yr,
|
|
857
857
|
{
|
|
858
858
|
label: "More reactions",
|
|
859
859
|
className: Be,
|
|
860
|
-
onPick: (
|
|
861
|
-
onOpenChange: (
|
|
860
|
+
onPick: (U) => se.mutate({ messageId: t.id, emoji: U }),
|
|
861
|
+
onOpenChange: (U) => Vt(U ? t.id : null)
|
|
862
862
|
}
|
|
863
863
|
),
|
|
864
864
|
!h.inThread && !t.parent_id && /* @__PURE__ */ e(
|
|
@@ -867,11 +867,11 @@ function qn({
|
|
|
867
867
|
type: "button",
|
|
868
868
|
title: "Reply in thread",
|
|
869
869
|
onClick: () => {
|
|
870
|
-
|
|
870
|
+
He(!1), Ie(t.id);
|
|
871
871
|
},
|
|
872
872
|
className: Be,
|
|
873
873
|
"data-chat-reply-thread": !0,
|
|
874
|
-
children: /* @__PURE__ */ e(
|
|
874
|
+
children: /* @__PURE__ */ e(os, { className: "h-3 w-3" })
|
|
875
875
|
}
|
|
876
876
|
),
|
|
877
877
|
/* @__PURE__ */ e(
|
|
@@ -882,7 +882,7 @@ function qn({
|
|
|
882
882
|
onClick: () => h.inThread ? an(t) : nn(t),
|
|
883
883
|
className: Be,
|
|
884
884
|
"data-chat-quote": !0,
|
|
885
|
-
children: /* @__PURE__ */ e(
|
|
885
|
+
children: /* @__PURE__ */ e(is, { className: "h-3 w-3" })
|
|
886
886
|
}
|
|
887
887
|
),
|
|
888
888
|
m && /* @__PURE__ */ a(ke, { children: [
|
|
@@ -891,9 +891,9 @@ function qn({
|
|
|
891
891
|
{
|
|
892
892
|
type: "button",
|
|
893
893
|
title: "Make a task from this message",
|
|
894
|
-
onClick: () =>
|
|
894
|
+
onClick: () => $e.mutate(t),
|
|
895
895
|
className: Be,
|
|
896
|
-
children: /* @__PURE__ */ e(
|
|
896
|
+
children: /* @__PURE__ */ e(cs, { className: "h-3 w-3" })
|
|
897
897
|
}
|
|
898
898
|
),
|
|
899
899
|
t.message && /* @__PURE__ */ e(
|
|
@@ -904,7 +904,7 @@ function qn({
|
|
|
904
904
|
onClick: () => _.mutate(t),
|
|
905
905
|
className: Be,
|
|
906
906
|
"data-chat-to-notes": !0,
|
|
907
|
-
children: /* @__PURE__ */ e(
|
|
907
|
+
children: /* @__PURE__ */ e(ds, { className: "h-3 w-3" })
|
|
908
908
|
}
|
|
909
909
|
)
|
|
910
910
|
] }),
|
|
@@ -912,13 +912,13 @@ function qn({
|
|
|
912
912
|
"button",
|
|
913
913
|
{
|
|
914
914
|
type: "button",
|
|
915
|
-
title: me.some((
|
|
915
|
+
title: me.some((U) => U.id === t.id) ? "Unpin" : "Pin",
|
|
916
916
|
onClick: () => c.mutate(t.id),
|
|
917
917
|
className: g(
|
|
918
918
|
"rounded-full p-0.5",
|
|
919
|
-
me.some((
|
|
919
|
+
me.some((U) => U.id === t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
|
|
920
920
|
),
|
|
921
|
-
children: /* @__PURE__ */ e(
|
|
921
|
+
children: /* @__PURE__ */ e(Mt, { className: "h-3 w-3" })
|
|
922
922
|
}
|
|
923
923
|
),
|
|
924
924
|
/* @__PURE__ */ e(
|
|
@@ -931,7 +931,7 @@ function qn({
|
|
|
931
931
|
"rounded-full p-0.5",
|
|
932
932
|
Ce.has(t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
|
|
933
933
|
),
|
|
934
|
-
children: /* @__PURE__ */ e(
|
|
934
|
+
children: /* @__PURE__ */ e(us, { className: "h-3 w-3" })
|
|
935
935
|
}
|
|
936
936
|
),
|
|
937
937
|
Oe && /* @__PURE__ */ e(
|
|
@@ -940,13 +940,13 @@ function qn({
|
|
|
940
940
|
type: "button",
|
|
941
941
|
title: "Edit",
|
|
942
942
|
onClick: () => {
|
|
943
|
-
ft(t.id),
|
|
943
|
+
ft(t.id), Zt(t.message), xt(null);
|
|
944
944
|
},
|
|
945
945
|
className: Be,
|
|
946
|
-
children: /* @__PURE__ */ e(
|
|
946
|
+
children: /* @__PURE__ */ e(ms, { className: "h-3 w-3" })
|
|
947
947
|
}
|
|
948
948
|
),
|
|
949
|
-
qe && (
|
|
949
|
+
qe && (Da === t.id ? /* @__PURE__ */ e(
|
|
950
950
|
"button",
|
|
951
951
|
{
|
|
952
952
|
type: "button",
|
|
@@ -964,22 +964,22 @@ function qn({
|
|
|
964
964
|
title: N ? "Delete" : "Delete (admin)",
|
|
965
965
|
onClick: () => xt(t.id),
|
|
966
966
|
className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
|
|
967
|
-
children: /* @__PURE__ */ e(
|
|
967
|
+
children: /* @__PURE__ */ e(ps, { className: "h-3 w-3" })
|
|
968
968
|
}
|
|
969
969
|
)),
|
|
970
970
|
/* @__PURE__ */ e(
|
|
971
|
-
|
|
971
|
+
Pr,
|
|
972
972
|
{
|
|
973
973
|
messageId: t.id,
|
|
974
|
-
actions:
|
|
974
|
+
actions: Ir(Ua, t, je),
|
|
975
975
|
navigate: x.navigate,
|
|
976
|
-
onOpenChange: (
|
|
976
|
+
onOpenChange: (U) => Vt(U ? t.id : null)
|
|
977
977
|
}
|
|
978
978
|
)
|
|
979
979
|
]
|
|
980
980
|
}
|
|
981
981
|
),
|
|
982
|
-
t.urgent && !
|
|
982
|
+
t.urgent && !z && /* @__PURE__ */ a(
|
|
983
983
|
"p",
|
|
984
984
|
{
|
|
985
985
|
className: g(
|
|
@@ -988,29 +988,29 @@ function qn({
|
|
|
988
988
|
),
|
|
989
989
|
"data-chat-urgent": !0,
|
|
990
990
|
children: [
|
|
991
|
-
/* @__PURE__ */ e(
|
|
991
|
+
/* @__PURE__ */ e(hs, { className: "h-3 w-3" }),
|
|
992
992
|
" Urgent"
|
|
993
993
|
]
|
|
994
994
|
}
|
|
995
995
|
),
|
|
996
|
-
|
|
996
|
+
z ? /* @__PURE__ */ e("div", { className: "inline-block rounded-2xl border border-dashed border-slate-200 px-3 py-1.5 text-left text-[11.5px] italic text-slate-500 dark:border-border", children: "Message removed" }) : Ae ? /* @__PURE__ */ a(
|
|
997
997
|
"form",
|
|
998
998
|
{
|
|
999
999
|
className: "flex items-center gap-1",
|
|
1000
|
-
onSubmit: (
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1000
|
+
onSubmit: (U) => {
|
|
1001
|
+
U.preventDefault();
|
|
1002
|
+
const O = Yt.trim();
|
|
1003
|
+
O && O !== t.message && ie.mutate({ messageId: t.id, text: O }), ft(null);
|
|
1004
1004
|
},
|
|
1005
1005
|
children: [
|
|
1006
1006
|
/* @__PURE__ */ e(
|
|
1007
1007
|
"input",
|
|
1008
1008
|
{
|
|
1009
1009
|
autoFocus: !0,
|
|
1010
|
-
value:
|
|
1011
|
-
onChange: (
|
|
1012
|
-
onKeyDown: (
|
|
1013
|
-
|
|
1010
|
+
value: Yt,
|
|
1011
|
+
onChange: (U) => Zt(U.target.value),
|
|
1012
|
+
onKeyDown: (U) => {
|
|
1013
|
+
U.key === "Escape" && ft(null);
|
|
1014
1014
|
},
|
|
1015
1015
|
className: g(
|
|
1016
1016
|
"h-8 w-[240px] rounded-lg border px-2 text-[12px] outline-none",
|
|
@@ -1056,42 +1056,36 @@ function qn({
|
|
|
1056
1056
|
}
|
|
1057
1057
|
),
|
|
1058
1058
|
t.message && On(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
|
|
1059
|
-
|
|
1059
|
+
jr,
|
|
1060
1060
|
{
|
|
1061
1061
|
text: On(t.message),
|
|
1062
1062
|
mine: N,
|
|
1063
|
-
renderToken: N ?
|
|
1063
|
+
renderToken: N ? Wa : Ba,
|
|
1064
1064
|
entityPattern: x.entityPattern,
|
|
1065
1065
|
timeRefs: t.time_refs,
|
|
1066
1066
|
navigate: x.navigate
|
|
1067
1067
|
}
|
|
1068
1068
|
)),
|
|
1069
1069
|
Ln(t.message) != null && /* @__PURE__ */ e(
|
|
1070
|
-
|
|
1070
|
+
Tr,
|
|
1071
1071
|
{
|
|
1072
1072
|
id: Ln(t.message),
|
|
1073
1073
|
mine: N,
|
|
1074
|
-
renderAvatar: (
|
|
1074
|
+
renderAvatar: (U, O) => /* @__PURE__ */ e(Q, { id: U, name: O, size: 18, presence: !1 })
|
|
1075
1075
|
}
|
|
1076
1076
|
),
|
|
1077
|
-
t.poll && /* @__PURE__ */ e(
|
|
1078
|
-
(t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: g("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
url: _t,
|
|
1082
|
-
name: ot,
|
|
1083
|
-
type: (R == null ? void 0 : R.type) ?? null,
|
|
1084
|
-
size: (R == null ? void 0 : R.filesize) ?? null
|
|
1085
|
-
}), ct = m && Z.length > 0 ? /* @__PURE__ */ e(
|
|
1086
|
-
al,
|
|
1077
|
+
t.poll && /* @__PURE__ */ e(qr, { poll: t.poll, room: t.room, mine: N }),
|
|
1078
|
+
(t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: g("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((U) => {
|
|
1079
|
+
const O = Ct == null ? void 0 : Ct.get(U), ot = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", _t = u.fileUrl(U), Fa = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), it = Kr(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), St = `${_t}?download=1`, Tt = (O == null ? void 0 : O.filename_download) || ot, Tn = Ma(St, Tt), ct = m && Z.length > 0 ? /* @__PURE__ */ e(
|
|
1080
|
+
rl,
|
|
1087
1081
|
{
|
|
1088
1082
|
targets: Z,
|
|
1089
1083
|
recordLabel: m.label,
|
|
1090
|
-
onPick: (
|
|
1084
|
+
onPick: (Ha) => I.mutate({ messageId: t.id, fileId: U, field: Ha })
|
|
1091
1085
|
}
|
|
1092
1086
|
) : null;
|
|
1093
1087
|
return it ? /* @__PURE__ */ e(
|
|
1094
|
-
|
|
1088
|
+
Jr,
|
|
1095
1089
|
{
|
|
1096
1090
|
url: _t,
|
|
1097
1091
|
poster: it.poster ? u.fileUrl(it.poster) : null,
|
|
@@ -1099,14 +1093,16 @@ function qn({
|
|
|
1099
1093
|
durationMs: it.durationMs,
|
|
1100
1094
|
action: ct
|
|
1101
1095
|
},
|
|
1102
|
-
|
|
1103
|
-
) :
|
|
1096
|
+
U
|
|
1097
|
+
) : Fa ? /* @__PURE__ */ a("span", { className: "relative inline-block", children: [
|
|
1104
1098
|
/* @__PURE__ */ e(
|
|
1105
|
-
"
|
|
1099
|
+
"a",
|
|
1106
1100
|
{
|
|
1107
|
-
|
|
1101
|
+
href: St,
|
|
1102
|
+
download: Tt,
|
|
1108
1103
|
onClick: Tn,
|
|
1109
|
-
|
|
1104
|
+
title: "Download",
|
|
1105
|
+
className: "block",
|
|
1110
1106
|
children: /* @__PURE__ */ e(
|
|
1111
1107
|
"img",
|
|
1112
1108
|
{
|
|
@@ -1119,30 +1115,32 @@ function qn({
|
|
|
1119
1115
|
}
|
|
1120
1116
|
),
|
|
1121
1117
|
ct && /* @__PURE__ */ e("span", { className: "absolute right-1 top-1", children: ct })
|
|
1122
|
-
] },
|
|
1118
|
+
] }, U) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1", children: [
|
|
1123
1119
|
/* @__PURE__ */ a(
|
|
1124
|
-
"
|
|
1120
|
+
"a",
|
|
1125
1121
|
{
|
|
1126
|
-
|
|
1122
|
+
href: St,
|
|
1123
|
+
download: Tt,
|
|
1127
1124
|
onClick: Tn,
|
|
1125
|
+
title: "Download",
|
|
1128
1126
|
className: g(
|
|
1129
1127
|
"inline-flex max-w-[220px] items-center gap-1.5 rounded-lg border px-2 py-1 text-[11.5px]",
|
|
1130
1128
|
N ? "border-white/30 bg-white/10" : "border-slate-200 bg-white dark:border-border dark:bg-card"
|
|
1131
1129
|
),
|
|
1132
1130
|
children: [
|
|
1133
|
-
/* @__PURE__ */ e(
|
|
1131
|
+
/* @__PURE__ */ e(fs, { className: "h-3 w-3 shrink-0 opacity-60" }),
|
|
1134
1132
|
/* @__PURE__ */ e("span", { className: "truncate", children: ot })
|
|
1135
1133
|
]
|
|
1136
1134
|
}
|
|
1137
1135
|
),
|
|
1138
1136
|
ct
|
|
1139
|
-
] },
|
|
1137
|
+
] }, U);
|
|
1140
1138
|
}) })
|
|
1141
1139
|
]
|
|
1142
1140
|
}
|
|
1143
1141
|
),
|
|
1144
|
-
!
|
|
1145
|
-
|
|
1142
|
+
!z && !Ae && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
|
|
1143
|
+
Er,
|
|
1146
1144
|
{
|
|
1147
1145
|
text: t.message,
|
|
1148
1146
|
navigate: x.navigate,
|
|
@@ -1154,22 +1152,22 @@ function qn({
|
|
|
1154
1152
|
{
|
|
1155
1153
|
className: g("mt-0.5 flex flex-wrap gap-1", N && "justify-end"),
|
|
1156
1154
|
"data-chat-reactions": !0,
|
|
1157
|
-
children: [...be.entries()].map(([
|
|
1155
|
+
children: [...be.entries()].map(([U, O]) => /* @__PURE__ */ a(
|
|
1158
1156
|
"button",
|
|
1159
1157
|
{
|
|
1160
1158
|
type: "button",
|
|
1161
|
-
title:
|
|
1162
|
-
onClick: () => se.mutate({ messageId: t.id, emoji:
|
|
1159
|
+
title: O.names.join(", "),
|
|
1160
|
+
onClick: () => se.mutate({ messageId: t.id, emoji: U }),
|
|
1163
1161
|
className: g(
|
|
1164
1162
|
"inline-flex items-center gap-0.5 rounded-full border px-1.5 py-px text-[10.5px] leading-tight transition-colors",
|
|
1165
|
-
|
|
1163
|
+
O.mine ? g("font-semibold", f.accentSoft, "border-transparent") : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300 dark:hover:bg-muted"
|
|
1166
1164
|
),
|
|
1167
1165
|
children: [
|
|
1168
|
-
/* @__PURE__ */ e(
|
|
1169
|
-
/* @__PURE__ */ e("span", { className: "tabular-nums", children:
|
|
1166
|
+
/* @__PURE__ */ e(kr, { value: U }),
|
|
1167
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: O.count })
|
|
1170
1168
|
]
|
|
1171
1169
|
},
|
|
1172
|
-
|
|
1170
|
+
U
|
|
1173
1171
|
))
|
|
1174
1172
|
}
|
|
1175
1173
|
),
|
|
@@ -1185,7 +1183,7 @@ function qn({
|
|
|
1185
1183
|
),
|
|
1186
1184
|
"data-chat-thread-summary": t.thread.count,
|
|
1187
1185
|
children: [
|
|
1188
|
-
/* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((
|
|
1186
|
+
/* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((U) => /* @__PURE__ */ e(Q, { id: U.id, name: U.name, size: 16, presence: !1 }, U.id)) }),
|
|
1189
1187
|
t.thread.count,
|
|
1190
1188
|
" ",
|
|
1191
1189
|
t.thread.count === 1 ? "reply" : "replies",
|
|
@@ -1205,7 +1203,7 @@ function qn({
|
|
|
1205
1203
|
"data-tip": `Posted for ${N ? "you" : t.sender_name ?? "this person"} through an app or API key named "${t.via_app}". The name is the app's own, not a person.`,
|
|
1206
1204
|
"data-chat-message-via-app": !0,
|
|
1207
1205
|
children: [
|
|
1208
|
-
/* @__PURE__ */ e(
|
|
1206
|
+
/* @__PURE__ */ e(xs, { className: "h-3 w-3 shrink-0", "aria-hidden": !0 }),
|
|
1209
1207
|
/* @__PURE__ */ a("span", { className: "truncate", children: [
|
|
1210
1208
|
"via app · ",
|
|
1211
1209
|
t.via_app
|
|
@@ -1213,28 +1211,28 @@ function qn({
|
|
|
1213
1211
|
]
|
|
1214
1212
|
}
|
|
1215
1213
|
),
|
|
1216
|
-
t.edited_at && !
|
|
1214
|
+
t.edited_at && !z && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
|
|
1217
1215
|
new Date(t.date_created).toLocaleTimeString("en-US", {
|
|
1218
1216
|
hour: "numeric",
|
|
1219
1217
|
minute: "2-digit"
|
|
1220
1218
|
}),
|
|
1221
|
-
N &&
|
|
1222
|
-
var
|
|
1223
|
-
const
|
|
1224
|
-
return
|
|
1225
|
-
|
|
1219
|
+
N && De && !z && (() => {
|
|
1220
|
+
var O;
|
|
1221
|
+
const U = Pe(t);
|
|
1222
|
+
return U.length === 0 ? null : /* @__PURE__ */ e(
|
|
1223
|
+
il,
|
|
1226
1224
|
{
|
|
1227
|
-
seen:
|
|
1228
|
-
channelId: ((
|
|
1225
|
+
seen: U,
|
|
1226
|
+
channelId: ((O = w == null ? void 0 : w.channel) == null ? void 0 : O.id) ?? null,
|
|
1229
1227
|
senderId: String(t.sender ?? "")
|
|
1230
1228
|
}
|
|
1231
1229
|
);
|
|
1232
1230
|
})(),
|
|
1233
1231
|
h.isLastMine && n.startsWith("dm:") && (W ? /* @__PURE__ */ a("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
|
|
1234
|
-
/* @__PURE__ */ e(
|
|
1232
|
+
/* @__PURE__ */ e(bs, { className: "h-3 w-3", strokeWidth: 2.4 }),
|
|
1235
1233
|
" Read"
|
|
1236
1234
|
] }) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-0.5", children: [
|
|
1237
|
-
/* @__PURE__ */ e(
|
|
1235
|
+
/* @__PURE__ */ e(It, { className: "h-3 w-3", strokeWidth: 2.2 }),
|
|
1238
1236
|
" Sent"
|
|
1239
1237
|
] }))
|
|
1240
1238
|
] })
|
|
@@ -1243,17 +1241,17 @@ function qn({
|
|
|
1243
1241
|
}
|
|
1244
1242
|
);
|
|
1245
1243
|
}, hn = (t) => /* @__PURE__ */ e(
|
|
1246
|
-
|
|
1244
|
+
Gs,
|
|
1247
1245
|
{
|
|
1248
1246
|
ref: t ? void 0 : sn,
|
|
1249
1247
|
room: n,
|
|
1250
1248
|
label: S,
|
|
1251
1249
|
parentId: t,
|
|
1252
|
-
quote: t ?
|
|
1250
|
+
quote: t ? Ra : Aa,
|
|
1253
1251
|
onClearQuote: () => t ? an(null) : nn(null),
|
|
1254
|
-
onSent:
|
|
1252
|
+
onSent: La,
|
|
1255
1253
|
disabledReason: t ? null : un,
|
|
1256
|
-
quietNote:
|
|
1254
|
+
quietNote: Ea,
|
|
1257
1255
|
th: f,
|
|
1258
1256
|
renderAvatar: (h, N) => /* @__PURE__ */ e(Q, { id: h, name: N, size: 22, presence: h !== "__bot__" })
|
|
1259
1257
|
}
|
|
@@ -1274,7 +1272,7 @@ function qn({
|
|
|
1274
1272
|
t.dataTransfer.files.length && (t.preventDefault(), gt(!1), (h = sn.current) == null || h.addFiles([...t.dataTransfer.files]));
|
|
1275
1273
|
},
|
|
1276
1274
|
children: [
|
|
1277
|
-
|
|
1275
|
+
Oa && /* @__PURE__ */ e(
|
|
1278
1276
|
"div",
|
|
1279
1277
|
{
|
|
1280
1278
|
className: "pointer-events-none absolute inset-2 z-30 flex items-center justify-center rounded-xl border-2 border-dashed border-nvr-cyan bg-white/85 text-[13px] font-semibold text-slate-700 dark:bg-card/90 dark:text-slate-100",
|
|
@@ -1294,11 +1292,11 @@ function qn({
|
|
|
1294
1292
|
}
|
|
1295
1293
|
),
|
|
1296
1294
|
((w == null ? void 0 : w.kind) === "channel" && !((bn = w.channel) != null && bn.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((gn = w.channel) == null ? void 0 : gn.icon) || ((vn = w.channel) == null ? void 0 : vn.color))) && /* @__PURE__ */ e(Ye, { icon: (yn = w == null ? void 0 : w.channel) == null ? void 0 : yn.icon, color: (kn = w == null ? void 0 : w.channel) == null ? void 0 : kn.color, size: 24 }),
|
|
1297
|
-
b && Se(n, b.id) && /* @__PURE__ */ e(
|
|
1295
|
+
b && Se(n, b.id) && /* @__PURE__ */ e(Vr, { peerId: Se(n, b.id), name: S }),
|
|
1298
1296
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1299
1297
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
1300
1298
|
/* @__PURE__ */ e("span", { className: "truncate", children: S }),
|
|
1301
|
-
w && /* @__PURE__ */ e(
|
|
1299
|
+
w && /* @__PURE__ */ e(Br, { starred: !!w.starred, notify: Kt }),
|
|
1302
1300
|
(q == null ? void 0 : q.announce) && /* @__PURE__ */ e(
|
|
1303
1301
|
"span",
|
|
1304
1302
|
{
|
|
@@ -1308,8 +1306,8 @@ function qn({
|
|
|
1308
1306
|
}
|
|
1309
1307
|
)
|
|
1310
1308
|
] }),
|
|
1311
|
-
b && Se(n, b.id) ? /* @__PURE__ */ e(
|
|
1312
|
-
|
|
1309
|
+
b && Se(n, b.id) ? /* @__PURE__ */ e(al, { peerId: Se(n, b.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
|
|
1310
|
+
Fr,
|
|
1313
1311
|
{
|
|
1314
1312
|
room: n,
|
|
1315
1313
|
me: ((wn = x.me) == null ? void 0 : wn.id) ?? null,
|
|
@@ -1318,7 +1316,7 @@ function qn({
|
|
|
1318
1316
|
) : null
|
|
1319
1317
|
] }),
|
|
1320
1318
|
/* @__PURE__ */ e(
|
|
1321
|
-
|
|
1319
|
+
_r,
|
|
1322
1320
|
{
|
|
1323
1321
|
room: n,
|
|
1324
1322
|
roomLabel: S,
|
|
@@ -1331,37 +1329,37 @@ function qn({
|
|
|
1331
1329
|
{
|
|
1332
1330
|
type: "button",
|
|
1333
1331
|
onClick: () => {
|
|
1334
|
-
Sa((t) => !t),
|
|
1332
|
+
Sa((t) => !t), Jt("");
|
|
1335
1333
|
},
|
|
1336
1334
|
className: g(In, tt ? f.accentSoft : Pn),
|
|
1337
1335
|
"aria-label": "Search in this conversation",
|
|
1338
1336
|
"aria-pressed": tt,
|
|
1339
1337
|
"data-tip": "Search this conversation",
|
|
1340
|
-
children: /* @__PURE__ */ e(
|
|
1338
|
+
children: /* @__PURE__ */ e(zn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1341
1339
|
}
|
|
1342
1340
|
),
|
|
1343
|
-
((Nn = w == null ? void 0 : w.channel) == null ? void 0 : Nn.is_direct) && /* @__PURE__ */ e(
|
|
1341
|
+
((Nn = w == null ? void 0 : w.channel) == null ? void 0 : Nn.is_direct) && /* @__PURE__ */ e(cl, { channel: w.channel, onLeft: l }),
|
|
1344
1342
|
/* @__PURE__ */ e(
|
|
1345
1343
|
"button",
|
|
1346
1344
|
{
|
|
1347
1345
|
type: "button",
|
|
1348
1346
|
onClick: () => {
|
|
1349
|
-
Ie(null),
|
|
1347
|
+
Ie(null), He((t) => !t);
|
|
1350
1348
|
},
|
|
1351
1349
|
className: g(In, bt ? f.accentSoft : Pn),
|
|
1352
1350
|
"aria-label": "Room info — members, pinned, files and links",
|
|
1353
1351
|
"aria-pressed": bt,
|
|
1354
1352
|
"data-tip": "Room info — members, pinned, files and links",
|
|
1355
1353
|
"data-chat-info-button": !0,
|
|
1356
|
-
children: /* @__PURE__ */ e(
|
|
1354
|
+
children: /* @__PURE__ */ e(rs, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1357
1355
|
}
|
|
1358
1356
|
),
|
|
1359
1357
|
/* @__PURE__ */ e(
|
|
1360
|
-
|
|
1358
|
+
Wr,
|
|
1361
1359
|
{
|
|
1362
1360
|
th: f,
|
|
1363
1361
|
huddleSchedule: y.enabled ? (t) => /* @__PURE__ */ e(
|
|
1364
|
-
|
|
1362
|
+
Dr,
|
|
1365
1363
|
{
|
|
1366
1364
|
room: n,
|
|
1367
1365
|
me: (b == null ? void 0 : b.id) ?? null,
|
|
@@ -1372,12 +1370,12 @@ function qn({
|
|
|
1372
1370
|
) : void 0,
|
|
1373
1371
|
starred: w ? !!w.starred : void 0,
|
|
1374
1372
|
onStar: w ? () => va.mutate({ room: n, starred: !w.starred }) : void 0,
|
|
1375
|
-
notify: w ?
|
|
1373
|
+
notify: w ? Kt : void 0,
|
|
1376
1374
|
onNotify: w ? (t) => {
|
|
1377
|
-
t === "muted" ?
|
|
1375
|
+
t === "muted" ? H.mutate({ room: n, muted: !0 }) : (w.muted && H.mutate({ room: n, muted: !1 }), re.mutate({ room: n, mode: t }));
|
|
1378
1376
|
} : void 0,
|
|
1379
1377
|
onJump: (t) => {
|
|
1380
|
-
|
|
1378
|
+
Me.current = !1, le.current = !1, $({ date: t });
|
|
1381
1379
|
},
|
|
1382
1380
|
onOpenRecord: oe ? () => {
|
|
1383
1381
|
var t;
|
|
@@ -1390,16 +1388,16 @@ function qn({
|
|
|
1390
1388
|
if (n.startsWith("dm:") && b) {
|
|
1391
1389
|
const W = Se(n, b.id);
|
|
1392
1390
|
if (W) {
|
|
1393
|
-
const
|
|
1391
|
+
const z = await u.request(
|
|
1394
1392
|
ye(`/users/${W}`)
|
|
1395
1393
|
);
|
|
1396
|
-
(t =
|
|
1394
|
+
(t = z.data) != null && t.email && (N = [z.data.email]);
|
|
1397
1395
|
}
|
|
1398
1396
|
} else (h = w == null ? void 0 : w.channel) != null && h.id && (N = (await u.request(
|
|
1399
1397
|
ye(
|
|
1400
1398
|
`/chat/channels/${w.channel.id}/members`
|
|
1401
1399
|
)
|
|
1402
|
-
)).data.filter((
|
|
1400
|
+
)).data.filter((z) => z.email && z.user.toUpperCase() !== (b == null ? void 0 : b.id.toUpperCase())).map((z) => z.email));
|
|
1403
1401
|
if (N.length === 0) {
|
|
1404
1402
|
ge.error("No callable participants found");
|
|
1405
1403
|
return;
|
|
@@ -1435,12 +1433,12 @@ function qn({
|
|
|
1435
1433
|
}), l();
|
|
1436
1434
|
}
|
|
1437
1435
|
}) : void 0,
|
|
1438
|
-
tips: /* @__PURE__ */ e(
|
|
1436
|
+
tips: /* @__PURE__ */ e(el, { botName: pe })
|
|
1439
1437
|
}
|
|
1440
1438
|
)
|
|
1441
1439
|
] }),
|
|
1442
1440
|
/* @__PURE__ */ e(
|
|
1443
|
-
|
|
1441
|
+
Ur,
|
|
1444
1442
|
{
|
|
1445
1443
|
room: n,
|
|
1446
1444
|
me: b,
|
|
@@ -1453,15 +1451,15 @@ function qn({
|
|
|
1453
1451
|
{
|
|
1454
1452
|
autoFocus: !0,
|
|
1455
1453
|
value: nt,
|
|
1456
|
-
onChange: (t) =>
|
|
1454
|
+
onChange: (t) => Jt(t.target.value),
|
|
1457
1455
|
placeholder: "Search messages…",
|
|
1458
1456
|
className: g("h-7 w-full rounded-md border px-2 text-[12px] outline-none", f.input),
|
|
1459
1457
|
"aria-label": "Search messages"
|
|
1460
1458
|
}
|
|
1461
1459
|
) }),
|
|
1462
|
-
/* @__PURE__ */ e(
|
|
1460
|
+
/* @__PURE__ */ e(tl, { room: n }),
|
|
1463
1461
|
q && !q.is_direct && /* @__PURE__ */ e(
|
|
1464
|
-
|
|
1462
|
+
Hr,
|
|
1465
1463
|
{
|
|
1466
1464
|
description: q.description,
|
|
1467
1465
|
links: q.links,
|
|
@@ -1474,11 +1472,11 @@ function qn({
|
|
|
1474
1472
|
{
|
|
1475
1473
|
type: "button",
|
|
1476
1474
|
onClick: () => {
|
|
1477
|
-
Ie(null),
|
|
1475
|
+
Ie(null), He(!0);
|
|
1478
1476
|
},
|
|
1479
1477
|
className: "flex w-full items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-slate-400",
|
|
1480
1478
|
children: [
|
|
1481
|
-
/* @__PURE__ */ e(
|
|
1479
|
+
/* @__PURE__ */ e(Mt, { className: "h-3 w-3", strokeWidth: 2 }),
|
|
1482
1480
|
me.length,
|
|
1483
1481
|
" pinned",
|
|
1484
1482
|
/* @__PURE__ */ e(ut, { className: "ml-auto h-3 w-3 -rotate-90" })
|
|
@@ -1486,15 +1484,15 @@ function qn({
|
|
|
1486
1484
|
}
|
|
1487
1485
|
) }),
|
|
1488
1486
|
(q == null ? void 0 : q.archive_suggested_at) && q.id !== 0 && (dn || X) && /* @__PURE__ */ e(
|
|
1489
|
-
|
|
1487
|
+
js,
|
|
1490
1488
|
{
|
|
1491
1489
|
channelId: q.id,
|
|
1492
1490
|
channelName: S,
|
|
1493
1491
|
suggestedAt: q.archive_suggested_at
|
|
1494
1492
|
}
|
|
1495
1493
|
),
|
|
1496
|
-
|
|
1497
|
-
|
|
1494
|
+
qa && (q == null ? void 0 : q.welcome_note) && /* @__PURE__ */ e(
|
|
1495
|
+
zr,
|
|
1498
1496
|
{
|
|
1499
1497
|
note: q.welcome_note,
|
|
1500
1498
|
channelName: S,
|
|
@@ -1508,7 +1506,7 @@ function qn({
|
|
|
1508
1506
|
ref: Re,
|
|
1509
1507
|
onScroll: (t) => {
|
|
1510
1508
|
const h = t.currentTarget;
|
|
1511
|
-
le.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, wt.current = h.scrollHeight, le.current && ce &&
|
|
1509
|
+
le.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, wt.current = h.scrollHeight, le.current && ce && ze(null), we.onScroll(), h.scrollTop < 200 && J && !R && !xe && Me.current && F();
|
|
1512
1510
|
},
|
|
1513
1511
|
className: "relative min-h-0 flex-1 overflow-y-auto px-3 py-3 [overflow-anchor:none]",
|
|
1514
1512
|
"data-chat-messages": !0,
|
|
@@ -1517,14 +1515,14 @@ function qn({
|
|
|
1517
1515
|
"button",
|
|
1518
1516
|
{
|
|
1519
1517
|
type: "button",
|
|
1520
|
-
disabled:
|
|
1518
|
+
disabled: R,
|
|
1521
1519
|
onClick: () => {
|
|
1522
1520
|
var t;
|
|
1523
1521
|
wt.current = ((t = Re.current) == null ? void 0 : t.scrollHeight) ?? 0, F();
|
|
1524
1522
|
},
|
|
1525
1523
|
className: "rounded-full border border-slate-200 px-2.5 py-0.5 text-[11px] font-medium text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:text-slate-300",
|
|
1526
1524
|
"data-chat-load-older": !0,
|
|
1527
|
-
children:
|
|
1525
|
+
children: R ? "Loading…" : "Load earlier messages"
|
|
1528
1526
|
}
|
|
1529
1527
|
) }),
|
|
1530
1528
|
E ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : _e.length === 0 && K.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: xe ? "No messages match." : B ? "Nothing was said around then." : /* @__PURE__ */ a(ke, { children: [
|
|
@@ -1542,7 +1540,7 @@ function qn({
|
|
|
1542
1540
|
"data-chat-rows": we.windowed ? "windowed" : "all",
|
|
1543
1541
|
children: _e.slice(we.start, we.end).map((t, h) => {
|
|
1544
1542
|
var Ae;
|
|
1545
|
-
const N = we.start + h, W = _e[N - 1],
|
|
1543
|
+
const N = we.start + h, W = _e[N - 1], z = N === 0 || W && new Date(W.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !xe && !B && kt.current > 0 && N === Math.max(0, _e.length - kt.current), qe = Ee === "compact" && !z && !!W && W.sender === t.sender && !W.is_system && new Date(t.date_created).getTime() - new Date(W.date_created).getTime() < 5 * 6e4;
|
|
1546
1544
|
return /* @__PURE__ */ a(
|
|
1547
1545
|
"div",
|
|
1548
1546
|
{
|
|
@@ -1550,9 +1548,9 @@ function qn({
|
|
|
1550
1548
|
"data-chat-row": t.id,
|
|
1551
1549
|
className: N > 0 ? Ee === "compact" ? "pt-1" : "pt-2.5" : void 0,
|
|
1552
1550
|
children: [
|
|
1553
|
-
|
|
1551
|
+
z && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
|
|
1554
1552
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
|
|
1555
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children:
|
|
1553
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Xr(t.date_created) }),
|
|
1556
1554
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
|
|
1557
1555
|
] }),
|
|
1558
1556
|
Oe && /* @__PURE__ */ a(
|
|
@@ -1578,9 +1576,9 @@ function qn({
|
|
|
1578
1576
|
]
|
|
1579
1577
|
}
|
|
1580
1578
|
),
|
|
1581
|
-
Oe &&
|
|
1579
|
+
Oe && M && /* @__PURE__ */ e("div", { className: "my-1 rounded-md border border-nvr-cyan/25 bg-nvr-cyan/5 px-2.5 py-1.5 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: M }),
|
|
1582
1580
|
pn(t, {
|
|
1583
|
-
isLastMine: ((Ae = t.sender) == null ? void 0 : Ae.toLowerCase()) === je && N ===
|
|
1581
|
+
isLastMine: ((Ae = t.sender) == null ? void 0 : Ae.toLowerCase()) === je && N === Pa,
|
|
1584
1582
|
showSender: !qe
|
|
1585
1583
|
})
|
|
1586
1584
|
]
|
|
@@ -1592,7 +1590,7 @@ function qn({
|
|
|
1592
1590
|
),
|
|
1593
1591
|
!xe && !G && /* @__PURE__ */ e(da, { items: K, th: f }),
|
|
1594
1592
|
!xe && !G && Qe.live && pe && /* @__PURE__ */ e(
|
|
1595
|
-
|
|
1593
|
+
Ps,
|
|
1596
1594
|
{
|
|
1597
1595
|
live: Qe.live,
|
|
1598
1596
|
botName: pe,
|
|
@@ -1611,10 +1609,10 @@ function qn({
|
|
|
1611
1609
|
type: "button",
|
|
1612
1610
|
onClick: () => {
|
|
1613
1611
|
if (G) {
|
|
1614
|
-
|
|
1612
|
+
Me.current = !1, le.current = !0, $(null);
|
|
1615
1613
|
return;
|
|
1616
1614
|
}
|
|
1617
|
-
ce && !Nt(ce.firstId) && rt(),
|
|
1615
|
+
ce && !Nt(ce.firstId) && rt(), ze(null);
|
|
1618
1616
|
},
|
|
1619
1617
|
className: g(
|
|
1620
1618
|
"pointer-events-auto rounded-full px-3 py-1 text-[11.5px] font-semibold shadow-md",
|
|
@@ -1640,10 +1638,9 @@ function qn({
|
|
|
1640
1638
|
]
|
|
1641
1639
|
}
|
|
1642
1640
|
) : Y.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: Y.typingText }) }),
|
|
1643
|
-
Zt && /* @__PURE__ */ e(Ms, { file: Zt, onClose: () => Vt(null) }),
|
|
1644
1641
|
hn(null),
|
|
1645
1642
|
Xt != null && /* @__PURE__ */ e(
|
|
1646
|
-
|
|
1643
|
+
Gr,
|
|
1647
1644
|
{
|
|
1648
1645
|
room: n,
|
|
1649
1646
|
rootId: Xt,
|
|
@@ -1651,17 +1648,17 @@ function qn({
|
|
|
1651
1648
|
onClose: () => Ie(null),
|
|
1652
1649
|
renderRow: (t) => pn(t, { inThread: !0 }),
|
|
1653
1650
|
renderComposer: (t) => hn(t),
|
|
1654
|
-
renderOutbox: (t) => /* @__PURE__ */ e(
|
|
1651
|
+
renderOutbox: (t) => /* @__PURE__ */ e(sl, { room: n, parentId: t, th: f })
|
|
1655
1652
|
}
|
|
1656
1653
|
),
|
|
1657
1654
|
bt && /* @__PURE__ */ e(
|
|
1658
|
-
|
|
1655
|
+
Qr,
|
|
1659
1656
|
{
|
|
1660
1657
|
room: n,
|
|
1661
1658
|
label: S,
|
|
1662
1659
|
th: f,
|
|
1663
1660
|
pins: me,
|
|
1664
|
-
onClose: () =>
|
|
1661
|
+
onClose: () => He(!1),
|
|
1665
1662
|
onOpenMessage: ln,
|
|
1666
1663
|
onUnpin: (t) => c.mutate(t),
|
|
1667
1664
|
navigate: x.navigate,
|
|
@@ -1672,11 +1669,11 @@ function qn({
|
|
|
1672
1669
|
}
|
|
1673
1670
|
);
|
|
1674
1671
|
}
|
|
1675
|
-
function
|
|
1672
|
+
function sl({ room: n, parentId: s, th: l }) {
|
|
1676
1673
|
const r = ca(n, s);
|
|
1677
1674
|
return /* @__PURE__ */ e(da, { items: r, th: l });
|
|
1678
1675
|
}
|
|
1679
|
-
function
|
|
1676
|
+
function rl({
|
|
1680
1677
|
targets: n,
|
|
1681
1678
|
recordLabel: s,
|
|
1682
1679
|
onPick: l
|
|
@@ -1691,7 +1688,7 @@ function al({
|
|
|
1691
1688
|
title: `Attach to ${s}`,
|
|
1692
1689
|
"aria-label": `Attach to ${s}`,
|
|
1693
1690
|
"data-chat-attach-to-record": !0,
|
|
1694
|
-
children: /* @__PURE__ */ e(
|
|
1691
|
+
children: /* @__PURE__ */ e(vs, { className: "h-3 w-3" })
|
|
1695
1692
|
}
|
|
1696
1693
|
) }),
|
|
1697
1694
|
/* @__PURE__ */ a(et, { align: "end", className: "w-[220px] p-1.5", children: [
|
|
@@ -1725,20 +1722,20 @@ function Bn(n) {
|
|
|
1725
1722
|
color: n.color ?? null
|
|
1726
1723
|
};
|
|
1727
1724
|
}
|
|
1728
|
-
const
|
|
1729
|
-
function
|
|
1725
|
+
const ll = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1726
|
+
function Ot(n) {
|
|
1730
1727
|
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;
|
|
1731
1728
|
return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
|
|
1732
1729
|
}
|
|
1733
1730
|
function Wn(n) {
|
|
1734
1731
|
const s = n == null ? void 0 : n.trim();
|
|
1735
|
-
return !s ||
|
|
1732
|
+
return !s || ll.test(s) ? null : s;
|
|
1736
1733
|
}
|
|
1737
|
-
function
|
|
1734
|
+
function ol(n) {
|
|
1738
1735
|
const s = new Date(n), l = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
1739
1736
|
return s.toDateString() === l.toDateString() ? r : (l.getTime() - s.getTime()) / 864e5 < 6 ? `${s.toLocaleDateString("en-US", { weekday: "short" })} ${r}` : `${s.toLocaleDateString("en-US", { month: "short", day: "numeric" })}, ${r}`;
|
|
1740
1737
|
}
|
|
1741
|
-
function
|
|
1738
|
+
function il({
|
|
1742
1739
|
seen: n,
|
|
1743
1740
|
channelId: s,
|
|
1744
1741
|
senderId: l
|
|
@@ -1787,7 +1784,7 @@ function ll({
|
|
|
1787
1784
|
{
|
|
1788
1785
|
className: "shrink-0 text-[10.5px] tabular-nums text-slate-400",
|
|
1789
1786
|
"data-tip": `Last read the conversation ${new Date(u.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
|
|
1790
|
-
children:
|
|
1787
|
+
children: ol(u.last_read_at)
|
|
1791
1788
|
}
|
|
1792
1789
|
)
|
|
1793
1790
|
] }, u.user)),
|
|
@@ -1811,14 +1808,14 @@ function ll({
|
|
|
1811
1808
|
)
|
|
1812
1809
|
] });
|
|
1813
1810
|
}
|
|
1814
|
-
function
|
|
1811
|
+
function cl({ channel: n, onLeft: s }) {
|
|
1815
1812
|
var F;
|
|
1816
|
-
const l = ue(), r = Le(), { isAdmin: o } = ht(), [i, p] = T(!1), [d, x] = T(""), f = mt(d, 250), u =
|
|
1813
|
+
const l = ue(), r = Le(), { isAdmin: o } = ht(), [i, p] = T(!1), [d, x] = T(""), f = mt(d, 250), u = xr(
|
|
1817
1814
|
`channel-${n.id}`,
|
|
1818
1815
|
`/chat/channels/${n.id}/members`,
|
|
1819
1816
|
f,
|
|
1820
1817
|
i
|
|
1821
|
-
), b = u.members, y = u.loading, { addMember:
|
|
1818
|
+
), b = u.members, y = u.loading, { addMember: D, removeMember: A } = na(n.id), [C, S] = T(""), B = mt(C, 250), $ = ((F = r.me) == null ? void 0 : F.id.toUpperCase()) ?? "", v = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: E } = Ft(B, i && v && !!C.trim()), J = new Set(b.map((R) => R.id.toUpperCase())), G = b;
|
|
1822
1819
|
return /* @__PURE__ */ a(Ve, { open: i, onOpenChange: p, children: [
|
|
1823
1820
|
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1824
1821
|
"button",
|
|
@@ -1832,7 +1829,7 @@ function ol({ channel: n, onLeft: s }) {
|
|
|
1832
1829
|
),
|
|
1833
1830
|
"data-chat-group-members": !0,
|
|
1834
1831
|
children: [
|
|
1835
|
-
/* @__PURE__ */ e(
|
|
1832
|
+
/* @__PURE__ */ e(At, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
1836
1833
|
u.total > 0 && u.total
|
|
1837
1834
|
]
|
|
1838
1835
|
}
|
|
@@ -1850,20 +1847,20 @@ function ol({ channel: n, onLeft: s }) {
|
|
|
1850
1847
|
"In this conversation ",
|
|
1851
1848
|
u.total > 0 && `· ${u.total.toLocaleString("en-US")}`
|
|
1852
1849
|
] }),
|
|
1853
|
-
(u.total > 10 || d) && /* @__PURE__ */ e(
|
|
1850
|
+
(u.total > 10 || d) && /* @__PURE__ */ e(Ar, { value: d, onChange: x, className: "mt-1.5" })
|
|
1854
1851
|
] }),
|
|
1855
1852
|
/* @__PURE__ */ a("div", { className: "max-h-[280px] overflow-y-auto py-1", children: [
|
|
1856
1853
|
y && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
|
|
1857
1854
|
!y && G.length === 0 && d.trim() && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No one matches." }),
|
|
1858
|
-
G.map((
|
|
1859
|
-
const K =
|
|
1855
|
+
G.map((R) => {
|
|
1856
|
+
const K = R.id.toUpperCase(), ee = R.name, Y = K === $, te = String(n.created_by ?? "").toUpperCase() === K;
|
|
1860
1857
|
return /* @__PURE__ */ a(
|
|
1861
1858
|
"div",
|
|
1862
1859
|
{
|
|
1863
1860
|
className: "group flex items-center gap-2 px-3 py-1.5",
|
|
1864
|
-
"data-chat-group-member":
|
|
1861
|
+
"data-chat-group-member": R.id,
|
|
1865
1862
|
children: [
|
|
1866
|
-
/* @__PURE__ */ e(Q, { id:
|
|
1863
|
+
/* @__PURE__ */ e(Q, { id: R.id, name: ee, size: 26 }),
|
|
1867
1864
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
1868
1865
|
/* @__PURE__ */ a("span", { className: "block truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
|
|
1869
1866
|
ee,
|
|
@@ -1871,25 +1868,25 @@ function ol({ channel: n, onLeft: s }) {
|
|
|
1871
1868
|
] }),
|
|
1872
1869
|
te && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
|
|
1873
1870
|
] }),
|
|
1874
|
-
/* @__PURE__ */ e(
|
|
1871
|
+
/* @__PURE__ */ e(Rr, { online: R.online }),
|
|
1875
1872
|
v && !Y && /* @__PURE__ */ e(
|
|
1876
1873
|
"button",
|
|
1877
1874
|
{
|
|
1878
1875
|
type: "button",
|
|
1879
1876
|
title: `Remove ${ee}`,
|
|
1880
1877
|
"aria-label": `Remove ${ee}`,
|
|
1881
|
-
onClick: () => A.mutate(
|
|
1878
|
+
onClick: () => A.mutate(R.id),
|
|
1882
1879
|
className: "rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-red-500 focus:opacity-100 group-hover:opacity-100 dark:hover:bg-muted",
|
|
1883
1880
|
children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
|
|
1884
1881
|
}
|
|
1885
1882
|
)
|
|
1886
1883
|
]
|
|
1887
1884
|
},
|
|
1888
|
-
|
|
1885
|
+
R.id
|
|
1889
1886
|
);
|
|
1890
1887
|
}),
|
|
1891
1888
|
/* @__PURE__ */ e(
|
|
1892
|
-
|
|
1889
|
+
Or,
|
|
1893
1890
|
{
|
|
1894
1891
|
hasMore: u.hasMore,
|
|
1895
1892
|
loading: u.loadingMore,
|
|
@@ -1902,32 +1899,32 @@ function ol({ channel: n, onLeft: s }) {
|
|
|
1902
1899
|
"input",
|
|
1903
1900
|
{
|
|
1904
1901
|
value: C,
|
|
1905
|
-
onChange: (
|
|
1902
|
+
onChange: (R) => S(R.target.value),
|
|
1906
1903
|
placeholder: "Add someone…",
|
|
1907
1904
|
className: g("h-7 w-full rounded-md px-2 text-[12px] outline-none", l.input),
|
|
1908
1905
|
"data-chat-group-add": !0
|
|
1909
1906
|
}
|
|
1910
1907
|
),
|
|
1911
|
-
C.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: E.filter((
|
|
1912
|
-
const K = [
|
|
1908
|
+
C.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: E.filter((R) => !J.has(String(R.id).toUpperCase())).map((R) => {
|
|
1909
|
+
const K = [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.id;
|
|
1913
1910
|
return /* @__PURE__ */ a(
|
|
1914
1911
|
"button",
|
|
1915
1912
|
{
|
|
1916
1913
|
type: "button",
|
|
1917
1914
|
onClick: () => {
|
|
1918
|
-
|
|
1915
|
+
D.mutate(R.id), S("");
|
|
1919
1916
|
},
|
|
1920
1917
|
className: "flex w-full items-center gap-2 rounded px-1 py-1 text-left hover:bg-muted",
|
|
1921
1918
|
children: [
|
|
1922
|
-
/* @__PURE__ */ e(Q, { id:
|
|
1919
|
+
/* @__PURE__ */ e(Q, { id: R.id, name: K, size: 22 }),
|
|
1923
1920
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: K })
|
|
1924
1921
|
]
|
|
1925
1922
|
},
|
|
1926
|
-
|
|
1923
|
+
R.id
|
|
1927
1924
|
);
|
|
1928
1925
|
}) })
|
|
1929
1926
|
] }),
|
|
1930
|
-
|
|
1927
|
+
$ && J.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
|
|
1931
1928
|
"button",
|
|
1932
1929
|
{
|
|
1933
1930
|
type: "button",
|
|
@@ -1948,15 +1945,15 @@ function ol({ channel: n, onLeft: s }) {
|
|
|
1948
1945
|
)
|
|
1949
1946
|
] });
|
|
1950
1947
|
}
|
|
1951
|
-
function
|
|
1948
|
+
function dl({
|
|
1952
1949
|
channel: n,
|
|
1953
1950
|
label: s,
|
|
1954
1951
|
onBack: l
|
|
1955
1952
|
}) {
|
|
1956
|
-
const r = ue(), o = Le(), { isAdmin: i } = ht(), p = ea(), { members: d, loading: x } = ta(n.id), { update: f, addMember: u, removeMember: b } = na(n.id), [y,
|
|
1953
|
+
const r = ue(), o = Le(), { isAdmin: i } = ht(), p = ea(), { members: d, loading: x } = ta(n.id), { update: f, addMember: u, removeMember: b } = na(n.id), [y, D] = T(s), [A, C] = T(n.topic ?? ""), [S, B] = T(n.visibility), [$, v] = T(n.role ?? ""), [E, J] = T({
|
|
1957
1954
|
icon: n.icon ?? null,
|
|
1958
1955
|
color: n.color ?? null
|
|
1959
|
-
}), [G, F] = T(""),
|
|
1956
|
+
}), [G, F] = T(""), R = mt(G, 250), { users: K } = Ft(R, S === "private"), [ee, Y] = T(!1), te = n.id === aa, oe = i || !te && !!o.me && String(n.created_by ?? "") === String(o.me.id), se = new Set(d.map((c) => String(c.user).toUpperCase())), me = y !== s || A !== (n.topic ?? "") || S !== n.visibility || E.icon !== (n.icon ?? null) || E.color !== (n.color ?? null) || S === "role" && $ !== (n.role ?? "");
|
|
1960
1957
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
|
|
1961
1958
|
/* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
|
|
1962
1959
|
/* @__PURE__ */ e(
|
|
@@ -1982,7 +1979,7 @@ function il({
|
|
|
1982
1979
|
"input",
|
|
1983
1980
|
{
|
|
1984
1981
|
value: y,
|
|
1985
|
-
onChange: (c) =>
|
|
1982
|
+
onChange: (c) => D(c.target.value),
|
|
1986
1983
|
className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
|
|
1987
1984
|
}
|
|
1988
1985
|
)
|
|
@@ -2023,9 +2020,9 @@ function il({
|
|
|
2023
2020
|
c
|
|
2024
2021
|
)) }),
|
|
2025
2022
|
S === "role" && /* @__PURE__ */ e(
|
|
2026
|
-
|
|
2023
|
+
qt,
|
|
2027
2024
|
{
|
|
2028
|
-
value:
|
|
2025
|
+
value: $,
|
|
2029
2026
|
onChange: v,
|
|
2030
2027
|
className: g(
|
|
2031
2028
|
"mt-2 h-8 w-full rounded-md px-2 text-[12.5px] outline-none",
|
|
@@ -2043,7 +2040,7 @@ function il({
|
|
|
2043
2040
|
"button",
|
|
2044
2041
|
{
|
|
2045
2042
|
type: "button",
|
|
2046
|
-
disabled: !me || f.isPending || S === "role" &&
|
|
2043
|
+
disabled: !me || f.isPending || S === "role" && !$,
|
|
2047
2044
|
onClick: () => f.mutate(
|
|
2048
2045
|
te ? {
|
|
2049
2046
|
name: y.trim() || s,
|
|
@@ -2054,7 +2051,7 @@ function il({
|
|
|
2054
2051
|
name: y.trim() || s,
|
|
2055
2052
|
topic: A.trim() || null,
|
|
2056
2053
|
visibility: S,
|
|
2057
|
-
role: S === "role" ?
|
|
2054
|
+
role: S === "role" ? $ : null,
|
|
2058
2055
|
icon: E.icon,
|
|
2059
2056
|
color: E.color
|
|
2060
2057
|
}
|
|
@@ -2128,7 +2125,7 @@ function il({
|
|
|
2128
2125
|
}
|
|
2129
2126
|
),
|
|
2130
2127
|
f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Qn(f.error, "Could not save the changes") }),
|
|
2131
|
-
!n.is_direct && /* @__PURE__ */ e(
|
|
2128
|
+
!n.is_direct && /* @__PURE__ */ e(Es, { channel: n, th: r, isAdmin: i })
|
|
2132
2129
|
] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
|
|
2133
2130
|
n.topic || "No topic set.",
|
|
2134
2131
|
/* @__PURE__ */ e("br", {}),
|
|
@@ -2187,10 +2184,10 @@ function il({
|
|
|
2187
2184
|
}) }),
|
|
2188
2185
|
/* @__PURE__ */ e("p", { className: "mt-1 text-[11px] leading-snug text-slate-400", children: "Only members can see an invite-only channel — it is not listed to anyone else." })
|
|
2189
2186
|
] }),
|
|
2190
|
-
oe && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(
|
|
2187
|
+
oe && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(qs, { channelId: n.id, th: r }) })
|
|
2191
2188
|
] }),
|
|
2192
|
-
oe && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(
|
|
2193
|
-
!n.is_direct && /* @__PURE__ */ e(
|
|
2189
|
+
oe && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Is, { channelId: n.id, border: r.divider }),
|
|
2190
|
+
!n.is_direct && /* @__PURE__ */ e(Bs, { channelId: n.id, th: r })
|
|
2194
2191
|
] })
|
|
2195
2192
|
] });
|
|
2196
2193
|
}
|
|
@@ -2205,7 +2202,7 @@ function xa(n) {
|
|
|
2205
2202
|
var s;
|
|
2206
2203
|
return n ? n.kind === "dm" || n.kind === "entity" || n.kind === "channel" && !!((s = n.channel) != null && s.is_direct) : !1;
|
|
2207
2204
|
}
|
|
2208
|
-
const
|
|
2205
|
+
const Dt = [
|
|
2209
2206
|
{ value: "recent", label: "Recent activity" },
|
|
2210
2207
|
{ value: "unread", label: "Unread first" },
|
|
2211
2208
|
{ value: "alpha", label: "A–Z" }
|
|
@@ -2214,15 +2211,15 @@ function Fn(n) {
|
|
|
2214
2211
|
var s;
|
|
2215
2212
|
return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
|
|
2216
2213
|
}
|
|
2217
|
-
function
|
|
2214
|
+
function ul(n, s) {
|
|
2218
2215
|
const l = (i, p) => i.label.localeCompare(p.label), r = (i, p) => Fn(p) - Fn(i) || l(i, p), o = [...n];
|
|
2219
2216
|
return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, p) => +(p.unread > 0) - +(i.unread > 0) || r(i, p)) : o.sort(r);
|
|
2220
2217
|
}
|
|
2221
|
-
function
|
|
2218
|
+
function ml({
|
|
2222
2219
|
value: n,
|
|
2223
2220
|
onChange: s
|
|
2224
2221
|
}) {
|
|
2225
|
-
const [l, r] = T(!1), o =
|
|
2222
|
+
const [l, r] = T(!1), o = Dt.find((i) => i.value === n) ?? Dt[0];
|
|
2226
2223
|
return /* @__PURE__ */ a(Ve, { open: l, onOpenChange: r, children: [
|
|
2227
2224
|
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2228
2225
|
"button",
|
|
@@ -2232,12 +2229,12 @@ function dl({
|
|
|
2232
2229
|
"aria-label": `Sort rooms: ${o.label}`,
|
|
2233
2230
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-border dark:text-slate-400 dark:hover:bg-muted",
|
|
2234
2231
|
"data-chat-sort": n,
|
|
2235
|
-
children: /* @__PURE__ */ e(
|
|
2232
|
+
children: /* @__PURE__ */ e(ls, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2236
2233
|
}
|
|
2237
2234
|
) }),
|
|
2238
2235
|
/* @__PURE__ */ a(et, { align: "end", className: "w-44 p-1", children: [
|
|
2239
2236
|
/* @__PURE__ */ e("p", { className: "px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: "Sort rooms" }),
|
|
2240
|
-
|
|
2237
|
+
Dt.map((i) => /* @__PURE__ */ a(
|
|
2241
2238
|
"button",
|
|
2242
2239
|
{
|
|
2243
2240
|
type: "button",
|
|
@@ -2248,7 +2245,7 @@ function dl({
|
|
|
2248
2245
|
"data-chat-sort-option": i.value,
|
|
2249
2246
|
children: [
|
|
2250
2247
|
i.label,
|
|
2251
|
-
i.value === n && /* @__PURE__ */ e(
|
|
2248
|
+
i.value === n && /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2252
2249
|
]
|
|
2253
2250
|
},
|
|
2254
2251
|
i.value
|
|
@@ -2256,7 +2253,7 @@ function dl({
|
|
|
2256
2253
|
] })
|
|
2257
2254
|
] });
|
|
2258
2255
|
}
|
|
2259
|
-
function
|
|
2256
|
+
function Hn({
|
|
2260
2257
|
rooms: n,
|
|
2261
2258
|
onOpen: s,
|
|
2262
2259
|
onNewGroup: l,
|
|
@@ -2264,7 +2261,7 @@ function zn({
|
|
|
2264
2261
|
loading: o = !1,
|
|
2265
2262
|
onView: i
|
|
2266
2263
|
}) {
|
|
2267
|
-
const p = ue(), d = Le(), { setMuted: x, leave: f, setArchived: u, setStarred: b } =
|
|
2264
|
+
const p = ue(), d = Le(), { setMuted: x, leave: f, setArchived: u, setStarred: b } = Wt(), y = Ws(), D = ve(
|
|
2268
2265
|
() => new Map(
|
|
2269
2266
|
d.onlineUsers.map((c) => [
|
|
2270
2267
|
String(c.user_id).toUpperCase(),
|
|
@@ -2272,12 +2269,12 @@ function zn({
|
|
|
2272
2269
|
])
|
|
2273
2270
|
),
|
|
2274
2271
|
[d.onlineUsers]
|
|
2275
|
-
), A =
|
|
2272
|
+
), A = Ht(), C = $r(), [S, B] = T(""), $ = mt(S.trim(), 250), { hits: v, meaning: E, loading: J } = Ys($, y.filters), G = $.length >= 2 || y.active, F = ve(() => {
|
|
2276
2273
|
const c = /* @__PURE__ */ new Map();
|
|
2277
2274
|
for (const L of v) c.set(L.room, [...c.get(L.room) ?? [], L]);
|
|
2278
2275
|
return [...c.entries()].sort((L, m) => m[1].length - L[1].length);
|
|
2279
|
-
}, [v]),
|
|
2280
|
-
|
|
2276
|
+
}, [v]), R = n.filter((c) => c.unread > 0 && !c.muted).length, K = gr(), ee = ve(() => new Map(n.map((c) => [c.room, c])), [n]), Y = Bt(), te = Xn(), oe = Y.chat_sidebar_sort === "unread" || Y.chat_sidebar_sort === "alpha" ? Y.chat_sidebar_sort : "recent", se = ul(
|
|
2277
|
+
$ ? n.filter((c) => c.label.toLowerCase().includes($.toLowerCase())) : n,
|
|
2281
2278
|
oe
|
|
2282
2279
|
), me = (c) => {
|
|
2283
2280
|
var L;
|
|
@@ -2299,15 +2296,15 @@ function zn({
|
|
|
2299
2296
|
"data-chat-global-search": !0
|
|
2300
2297
|
}
|
|
2301
2298
|
),
|
|
2302
|
-
!r && /* @__PURE__ */ e(
|
|
2299
|
+
!r && /* @__PURE__ */ e(Fs, { open: y.open, active: y.active, onClick: () => y.setOpen(!y.open) }),
|
|
2303
2300
|
/* @__PURE__ */ e(
|
|
2304
|
-
|
|
2301
|
+
ml,
|
|
2305
2302
|
{
|
|
2306
2303
|
value: oe,
|
|
2307
2304
|
onChange: (c) => te.mutate({ chat_sidebar_sort: c === "recent" ? null : c })
|
|
2308
2305
|
}
|
|
2309
2306
|
),
|
|
2310
|
-
!r && /* @__PURE__ */ e(
|
|
2307
|
+
!r && /* @__PURE__ */ e(Hs, {}),
|
|
2311
2308
|
l && /* @__PURE__ */ e(
|
|
2312
2309
|
"button",
|
|
2313
2310
|
{
|
|
@@ -2316,11 +2313,11 @@ function zn({
|
|
|
2316
2313
|
title: "New group conversation",
|
|
2317
2314
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-border dark:text-slate-400 dark:hover:bg-muted",
|
|
2318
2315
|
"data-chat-new-group": !0,
|
|
2319
|
-
children: /* @__PURE__ */ e(
|
|
2316
|
+
children: /* @__PURE__ */ e(At, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2320
2317
|
}
|
|
2321
2318
|
)
|
|
2322
2319
|
] }),
|
|
2323
|
-
!r && y.open && /* @__PURE__ */ e(
|
|
2320
|
+
!r && y.open && /* @__PURE__ */ e(zs, { filters: y.filters, onChange: y.setFilters, rooms: n, th: p }),
|
|
2324
2321
|
!r && i && !G && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
|
|
2325
2322
|
/* @__PURE__ */ a(
|
|
2326
2323
|
"button",
|
|
@@ -2330,7 +2327,7 @@ function zn({
|
|
|
2330
2327
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-slate-200 px-2 text-[11px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
|
|
2331
2328
|
"data-chat-view": "mentions",
|
|
2332
2329
|
children: [
|
|
2333
|
-
/* @__PURE__ */ e(
|
|
2330
|
+
/* @__PURE__ */ e(Ya, { className: "h-3 w-3" }),
|
|
2334
2331
|
" Mentions"
|
|
2335
2332
|
]
|
|
2336
2333
|
}
|
|
@@ -2343,12 +2340,12 @@ function zn({
|
|
|
2343
2340
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-slate-200 px-2 text-[11px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
|
|
2344
2341
|
"data-chat-view": "scheduled",
|
|
2345
2342
|
children: [
|
|
2346
|
-
/* @__PURE__ */ e(
|
|
2343
|
+
/* @__PURE__ */ e(Za, { className: "h-3 w-3" }),
|
|
2347
2344
|
" Scheduled"
|
|
2348
2345
|
]
|
|
2349
2346
|
}
|
|
2350
2347
|
),
|
|
2351
|
-
|
|
2348
|
+
R > 1 && /* @__PURE__ */ a(
|
|
2352
2349
|
"button",
|
|
2353
2350
|
{
|
|
2354
2351
|
type: "button",
|
|
@@ -2359,9 +2356,9 @@ function zn({
|
|
|
2359
2356
|
),
|
|
2360
2357
|
"data-chat-view": "catchup",
|
|
2361
2358
|
children: [
|
|
2362
|
-
/* @__PURE__ */ e(
|
|
2359
|
+
/* @__PURE__ */ e(Va, { className: "h-3 w-3" }),
|
|
2363
2360
|
" Catch up · ",
|
|
2364
|
-
|
|
2361
|
+
R,
|
|
2365
2362
|
" rooms"
|
|
2366
2363
|
]
|
|
2367
2364
|
}
|
|
@@ -2392,7 +2389,7 @@ function zn({
|
|
|
2392
2389
|
children: [
|
|
2393
2390
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5 text-[10.5px] text-slate-400", children: [
|
|
2394
2391
|
/* @__PURE__ */ e("span", { className: "truncate", children: Z.sender_name ?? "Someone" }),
|
|
2395
|
-
/* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children:
|
|
2392
|
+
/* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: Us(Z.date_created) })
|
|
2396
2393
|
] }),
|
|
2397
2394
|
/* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: Z.message })
|
|
2398
2395
|
]
|
|
@@ -2431,7 +2428,7 @@ function zn({
|
|
|
2431
2428
|
{
|
|
2432
2429
|
type: "button",
|
|
2433
2430
|
onClick: () => s({
|
|
2434
|
-
room:
|
|
2431
|
+
room: Rt(d.me.id, A.bot_user_id),
|
|
2435
2432
|
label: `@${A.bot_name}`,
|
|
2436
2433
|
kind: "dm",
|
|
2437
2434
|
lastMessage: null,
|
|
@@ -2481,7 +2478,7 @@ function zn({
|
|
|
2481
2478
|
([c, L]) => L.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mb-1.5", children: [
|
|
2482
2479
|
/* @__PURE__ */ e("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: c }),
|
|
2483
2480
|
L.map((m) => {
|
|
2484
|
-
var Z,
|
|
2481
|
+
var Z, De, he, Pe, Ne, Ue;
|
|
2485
2482
|
return /* @__PURE__ */ a("div", { className: "group/room relative", children: [
|
|
2486
2483
|
/* @__PURE__ */ a(
|
|
2487
2484
|
"button",
|
|
@@ -2493,26 +2490,26 @@ function zn({
|
|
|
2493
2490
|
(() => {
|
|
2494
2491
|
const Ce = m.kind === "dm" && d.me ? Se(m.room, d.me.id) : null;
|
|
2495
2492
|
if (!Ce) return null;
|
|
2496
|
-
const k =
|
|
2493
|
+
const k = D.get(Ce.toUpperCase()) ?? "offline";
|
|
2497
2494
|
return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": k, children: /* @__PURE__ */ e(Q, { id: Ce, name: m.label, size: 32 }) });
|
|
2498
2495
|
})(),
|
|
2499
|
-
m.kind === "channel" && !((Z = m.channel) != null && Z.is_direct) || m.kind === "global" && ((
|
|
2496
|
+
m.kind === "channel" && !((Z = m.channel) != null && Z.is_direct) || m.kind === "global" && ((De = m.channel) != null && De.icon || (he = m.channel) != null && he.color) ? /* @__PURE__ */ e(Ye, { icon: (Pe = m.channel) == null ? void 0 : Pe.icon, color: (Ne = m.channel) == null ? void 0 : Ne.color, size: 32 }) : /* @__PURE__ */ e(
|
|
2500
2497
|
"span",
|
|
2501
2498
|
{
|
|
2502
2499
|
className: g(
|
|
2503
2500
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400",
|
|
2504
2501
|
m.kind === "dm" && d.me && Se(m.room, d.me.id) && "hidden"
|
|
2505
2502
|
),
|
|
2506
|
-
children: m.kind === "dm" ? /* @__PURE__ */ e(Gn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (
|
|
2503
|
+
children: m.kind === "dm" ? /* @__PURE__ */ e(Gn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (Ue = m.channel) != null && Ue.is_direct ? /* @__PURE__ */ e(At, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e($t, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
2507
2504
|
}
|
|
2508
2505
|
),
|
|
2509
2506
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
2510
2507
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
2511
2508
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: m.label }),
|
|
2512
|
-
m.muted && /* @__PURE__ */ e(
|
|
2513
|
-
/* @__PURE__ */ e(
|
|
2509
|
+
m.muted && /* @__PURE__ */ e(Dn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
|
|
2510
|
+
/* @__PURE__ */ e(Sr, { count: C.countFor(m.room), label: m.label }),
|
|
2514
2511
|
K.has(m.room) && /* @__PURE__ */ e(
|
|
2515
|
-
|
|
2512
|
+
Xa,
|
|
2516
2513
|
{
|
|
2517
2514
|
className: "h-3 w-3 shrink-0 text-slate-400",
|
|
2518
2515
|
strokeWidth: 2,
|
|
@@ -2562,7 +2559,7 @@ function zn({
|
|
|
2562
2559
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2563
2560
|
"data-chat-row-star": m.starred ? "on" : "off",
|
|
2564
2561
|
children: /* @__PURE__ */ e(
|
|
2565
|
-
|
|
2562
|
+
es,
|
|
2566
2563
|
{
|
|
2567
2564
|
className: g("h-3 w-3", m.starred && "fill-amber-400 text-amber-500")
|
|
2568
2565
|
}
|
|
@@ -2578,7 +2575,7 @@ function zn({
|
|
|
2578
2575
|
onClick: () => u.mutate({ room: m.room, archived: !r }),
|
|
2579
2576
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2580
2577
|
"data-chat-row-archive": r ? "unarchive" : "archive",
|
|
2581
|
-
children: r ? /* @__PURE__ */ e(
|
|
2578
|
+
children: r ? /* @__PURE__ */ e(ts, { className: "h-3 w-3" }) : /* @__PURE__ */ e(ns, { className: "h-3 w-3" })
|
|
2582
2579
|
}
|
|
2583
2580
|
),
|
|
2584
2581
|
/* @__PURE__ */ e(
|
|
@@ -2588,7 +2585,7 @@ function zn({
|
|
|
2588
2585
|
title: m.muted ? "Unmute" : "Mute",
|
|
2589
2586
|
onClick: () => x.mutate({ room: m.room, muted: !m.muted }),
|
|
2590
2587
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2591
|
-
children: m.muted ? /* @__PURE__ */ e(
|
|
2588
|
+
children: m.muted ? /* @__PURE__ */ e(as, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Dn, { className: "h-3 w-3" })
|
|
2592
2589
|
}
|
|
2593
2590
|
),
|
|
2594
2591
|
(m.kind === "channel" || m.kind === "global" || m.kind === "entity") && m.joined && /* @__PURE__ */ e(
|
|
@@ -2600,7 +2597,7 @@ function zn({
|
|
|
2600
2597
|
"data-chat-row-leave": !0,
|
|
2601
2598
|
onClick: () => f.mutate(m.room),
|
|
2602
2599
|
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",
|
|
2603
|
-
children: /* @__PURE__ */ e(
|
|
2600
|
+
children: /* @__PURE__ */ e(ss, { className: "h-3 w-3" })
|
|
2604
2601
|
}
|
|
2605
2602
|
)
|
|
2606
2603
|
] })
|
|
@@ -2610,7 +2607,7 @@ function zn({
|
|
|
2610
2607
|
)
|
|
2611
2608
|
] });
|
|
2612
2609
|
}
|
|
2613
|
-
function
|
|
2610
|
+
function yo({
|
|
2614
2611
|
view: n,
|
|
2615
2612
|
rooms: s,
|
|
2616
2613
|
onBack: l,
|
|
@@ -2629,17 +2626,17 @@ function go({
|
|
|
2629
2626
|
}
|
|
2630
2627
|
) : /* @__PURE__ */ e(Vn, { rooms: s, th: o, onBack: l, onOpen: r });
|
|
2631
2628
|
}
|
|
2632
|
-
function
|
|
2629
|
+
function pl({
|
|
2633
2630
|
onOpen: n
|
|
2634
2631
|
}) {
|
|
2635
|
-
const s = ue(), [l, r] = T(""), [o, i] = T(!1), [p, d] = T(""), [x, f] = T("open"), [u, b] = T(""), [y,
|
|
2632
|
+
const s = ue(), [l, r] = T(""), [o, i] = T(!1), [p, d] = T(""), [x, f] = T("open"), [u, b] = T(""), [y, D] = T({
|
|
2636
2633
|
icon: null,
|
|
2637
2634
|
color: null
|
|
2638
|
-
}), A = ea(), { channels: C, loading: S } =
|
|
2635
|
+
}), A = ea(), { channels: C, loading: S } = Qs(l), { join: B } = Wt(), $ = Ks();
|
|
2639
2636
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
|
|
2640
2637
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2641
2638
|
/* @__PURE__ */ a("div", { className: "relative flex-1", children: [
|
|
2642
|
-
/* @__PURE__ */ e(
|
|
2639
|
+
/* @__PURE__ */ e(zn, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
2643
2640
|
/* @__PURE__ */ e(
|
|
2644
2641
|
"input",
|
|
2645
2642
|
{
|
|
@@ -2671,7 +2668,7 @@ function ul({
|
|
|
2671
2668
|
{
|
|
2672
2669
|
className: "flex flex-col gap-2 border-b border-slate-100 p-2 dark:border-border/60",
|
|
2673
2670
|
onSubmit: (v) => {
|
|
2674
|
-
v.preventDefault(), p.trim() && (x === "role" && !u ||
|
|
2671
|
+
v.preventDefault(), p.trim() && (x === "role" && !u || $.mutate(
|
|
2675
2672
|
{
|
|
2676
2673
|
name: p.trim(),
|
|
2677
2674
|
visibility: x,
|
|
@@ -2681,7 +2678,7 @@ function ul({
|
|
|
2681
2678
|
},
|
|
2682
2679
|
{
|
|
2683
2680
|
onSuccess: () => {
|
|
2684
|
-
d(""),
|
|
2681
|
+
d(""), D({ icon: null, color: null }), i(!1);
|
|
2685
2682
|
}
|
|
2686
2683
|
}
|
|
2687
2684
|
));
|
|
@@ -2702,7 +2699,7 @@ function ul({
|
|
|
2702
2699
|
}
|
|
2703
2700
|
)
|
|
2704
2701
|
] }),
|
|
2705
|
-
/* @__PURE__ */ e(Jn, { icon: y.icon, color: y.color, onChange:
|
|
2702
|
+
/* @__PURE__ */ e(Jn, { icon: y.icon, color: y.color, onChange: D }),
|
|
2706
2703
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2707
2704
|
[
|
|
2708
2705
|
["open", "Anyone"],
|
|
@@ -2725,14 +2722,14 @@ function ul({
|
|
|
2725
2722
|
"button",
|
|
2726
2723
|
{
|
|
2727
2724
|
type: "submit",
|
|
2728
|
-
disabled: !p.trim() ||
|
|
2725
|
+
disabled: !p.trim() || $.isPending || x === "role" && !u,
|
|
2729
2726
|
className: g("ml-auto rounded-md px-2.5 py-1 text-[12px] font-medium", s.action),
|
|
2730
|
-
children:
|
|
2727
|
+
children: $.isPending ? "Creating…" : "Create"
|
|
2731
2728
|
}
|
|
2732
2729
|
)
|
|
2733
2730
|
] }),
|
|
2734
2731
|
x === "role" && /* @__PURE__ */ e(
|
|
2735
|
-
|
|
2732
|
+
qt,
|
|
2736
2733
|
{
|
|
2737
2734
|
value: u,
|
|
2738
2735
|
onChange: b,
|
|
@@ -2743,14 +2740,14 @@ function ul({
|
|
|
2743
2740
|
]
|
|
2744
2741
|
}
|
|
2745
2742
|
),
|
|
2746
|
-
|
|
2743
|
+
$.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Qn($.error, "Could not create it") })
|
|
2747
2744
|
]
|
|
2748
2745
|
}
|
|
2749
2746
|
),
|
|
2750
2747
|
/* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", children: [
|
|
2751
2748
|
S && /* @__PURE__ */ e("p", { className: "px-2 py-6 text-center text-[12px] text-slate-400", children: "Loading…" }),
|
|
2752
2749
|
!S && C.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-8 text-center", children: [
|
|
2753
|
-
/* @__PURE__ */ e(
|
|
2750
|
+
/* @__PURE__ */ e($t, { className: "mx-auto h-5 w-5 text-slate-300" }),
|
|
2754
2751
|
/* @__PURE__ */ e("p", { className: "mt-2 text-[12.5px] font-medium text-slate-600 dark:text-slate-300", children: l ? `No channel matches “${l}”` : "No channels yet" }),
|
|
2755
2752
|
/* @__PURE__ */ e("p", { className: "mt-1 text-[11.5px] leading-relaxed text-slate-400", children: "Channels and General are shared rooms you join to follow. Record conversations appear on their own once someone posts on a record." })
|
|
2756
2753
|
] }),
|
|
@@ -2765,7 +2762,7 @@ function ul({
|
|
|
2765
2762
|
icon: v.icon,
|
|
2766
2763
|
color: v.color,
|
|
2767
2764
|
size: 32,
|
|
2768
|
-
fallback: v.visibility === "private" ?
|
|
2765
|
+
fallback: v.visibility === "private" ? Ga : $t
|
|
2769
2766
|
}
|
|
2770
2767
|
),
|
|
2771
2768
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
@@ -2798,12 +2795,12 @@ function ul({
|
|
|
2798
2795
|
] })
|
|
2799
2796
|
] });
|
|
2800
2797
|
}
|
|
2801
|
-
function
|
|
2798
|
+
function hl() {
|
|
2802
2799
|
const n = /* @__PURE__ */ new Date();
|
|
2803
2800
|
return n.setHours(23, 59, 59, 999), n;
|
|
2804
2801
|
}
|
|
2805
|
-
function
|
|
2806
|
-
const n =
|
|
2802
|
+
function fl() {
|
|
2803
|
+
const n = Bt(), s = Xn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), p = (x) => {
|
|
2807
2804
|
s.mutate({
|
|
2808
2805
|
presence_override: x === "off" ? null : { mode: "away", until: (x == null ? void 0 : x.toISOString()) ?? null }
|
|
2809
2806
|
}), r(!1);
|
|
@@ -2811,7 +2808,7 @@ function pl() {
|
|
|
2811
2808
|
weekday: "short",
|
|
2812
2809
|
hour: "numeric",
|
|
2813
2810
|
minute: "2-digit",
|
|
2814
|
-
timeZone:
|
|
2811
|
+
timeZone: jt() ?? void 0
|
|
2815
2812
|
})}` : i ? "until you switch it off" : null;
|
|
2816
2813
|
return /* @__PURE__ */ a(
|
|
2817
2814
|
"div",
|
|
@@ -2854,7 +2851,7 @@ function pl() {
|
|
|
2854
2851
|
[
|
|
2855
2852
|
["1 hour", () => new Date(Date.now() + 36e5)],
|
|
2856
2853
|
["4 hours", () => new Date(Date.now() + 4 * 36e5)],
|
|
2857
|
-
["The rest of today",
|
|
2854
|
+
["The rest of today", hl],
|
|
2858
2855
|
["Until I switch it off", () => null]
|
|
2859
2856
|
].map(([x, f]) => /* @__PURE__ */ e(
|
|
2860
2857
|
"button",
|
|
@@ -2873,10 +2870,10 @@ function pl() {
|
|
|
2873
2870
|
}
|
|
2874
2871
|
);
|
|
2875
2872
|
}
|
|
2876
|
-
function
|
|
2873
|
+
function xl({ myStatus: n }) {
|
|
2877
2874
|
const s = ue();
|
|
2878
2875
|
return /* @__PURE__ */ e(
|
|
2879
|
-
|
|
2876
|
+
$s,
|
|
2880
2877
|
{
|
|
2881
2878
|
status: n ? { text: n.text, emoji: n.emoji } : null,
|
|
2882
2879
|
theme: { accentSoft: s.accentSoft, input: s.input, action: s.action },
|
|
@@ -2886,7 +2883,7 @@ function hl({ myStatus: n }) {
|
|
|
2886
2883
|
}
|
|
2887
2884
|
function ba() {
|
|
2888
2885
|
var i, p, d;
|
|
2889
|
-
const n = Ze(), s =
|
|
2886
|
+
const n = Ze(), s = Ss(15e3), { data: l, isFetched: r } = Te({
|
|
2890
2887
|
queryKey: ["presence-online"],
|
|
2891
2888
|
queryFn: () => n.request(ye("/presence/online")),
|
|
2892
2889
|
// Matches the presence heartbeat cadence without a live socket — the page someone is on
|
|
@@ -2913,11 +2910,11 @@ function ga(n) {
|
|
|
2913
2910
|
const l = /* @__PURE__ */ new Set(["records", "collections", "p"]), r = s.filter((o) => !l.has(o));
|
|
2914
2911
|
return r.length === 0 ? "Home" : r.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (p) => p.toUpperCase()) : o).join(" › ");
|
|
2915
2912
|
}
|
|
2916
|
-
function
|
|
2913
|
+
function bl({
|
|
2917
2914
|
onClose: n,
|
|
2918
2915
|
onCreated: s
|
|
2919
2916
|
}) {
|
|
2920
|
-
const l = ue(), [r, o] = T(""), [i, p] = T(""), [d, x] = T(/* @__PURE__ */ new Map()), { users: f } =
|
|
2917
|
+
const l = ue(), [r, o] = T(""), [i, p] = T(""), [d, x] = T(/* @__PURE__ */ new Map()), { users: f } = Ft(r, !0), u = pr(), b = (y) => [y.first_name, y.last_name].filter(Boolean).join(" ") || (y.email ?? "Unknown");
|
|
2921
2918
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
|
|
2922
2919
|
/* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
2923
2920
|
/* @__PURE__ */ e(
|
|
@@ -2932,7 +2929,7 @@ function fl({
|
|
|
2932
2929
|
),
|
|
2933
2930
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "New group conversation" })
|
|
2934
2931
|
] }),
|
|
2935
|
-
d.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...d.entries()].map(([y,
|
|
2932
|
+
d.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...d.entries()].map(([y, D]) => /* @__PURE__ */ a(
|
|
2936
2933
|
"span",
|
|
2937
2934
|
{
|
|
2938
2935
|
className: g(
|
|
@@ -2940,7 +2937,7 @@ function fl({
|
|
|
2940
2937
|
l.accentSoft
|
|
2941
2938
|
),
|
|
2942
2939
|
children: [
|
|
2943
|
-
|
|
2940
|
+
D,
|
|
2944
2941
|
/* @__PURE__ */ e(
|
|
2945
2942
|
"button",
|
|
2946
2943
|
{
|
|
@@ -2949,7 +2946,7 @@ function fl({
|
|
|
2949
2946
|
const C = new Map(A);
|
|
2950
2947
|
return C.delete(y), C;
|
|
2951
2948
|
}),
|
|
2952
|
-
"aria-label": `Remove ${
|
|
2949
|
+
"aria-label": `Remove ${D}`,
|
|
2953
2950
|
children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
|
|
2954
2951
|
}
|
|
2955
2952
|
)
|
|
@@ -2969,23 +2966,23 @@ function fl({
|
|
|
2969
2966
|
}
|
|
2970
2967
|
),
|
|
2971
2968
|
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((y) => {
|
|
2972
|
-
const
|
|
2969
|
+
const D = d.has(y.id);
|
|
2973
2970
|
return /* @__PURE__ */ a(
|
|
2974
2971
|
"button",
|
|
2975
2972
|
{
|
|
2976
2973
|
type: "button",
|
|
2977
2974
|
onClick: () => x((A) => {
|
|
2978
2975
|
const C = new Map(A);
|
|
2979
|
-
return
|
|
2976
|
+
return D ? C.delete(y.id) : C.set(y.id, b(y)), C;
|
|
2980
2977
|
}),
|
|
2981
2978
|
className: g(
|
|
2982
2979
|
"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[12.5px] transition-colors",
|
|
2983
|
-
|
|
2980
|
+
D ? l.accentSoft : "hover:bg-slate-50 dark:hover:bg-muted/50"
|
|
2984
2981
|
),
|
|
2985
2982
|
children: [
|
|
2986
2983
|
/* @__PURE__ */ e(Q, { id: y.id, name: b(y), size: 22 }),
|
|
2987
2984
|
/* @__PURE__ */ e("span", { className: "truncate", children: b(y) }),
|
|
2988
|
-
|
|
2985
|
+
D && /* @__PURE__ */ e(It, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
|
|
2989
2986
|
]
|
|
2990
2987
|
},
|
|
2991
2988
|
y.id
|
|
@@ -3022,15 +3019,15 @@ function fl({
|
|
|
3022
3019
|
)
|
|
3023
3020
|
] });
|
|
3024
3021
|
}
|
|
3025
|
-
const
|
|
3026
|
-
function
|
|
3022
|
+
const Lt = "nvr-chat-pinned", Ut = 400;
|
|
3023
|
+
function gl() {
|
|
3027
3024
|
try {
|
|
3028
|
-
return typeof window < "u" && window.localStorage.getItem(
|
|
3025
|
+
return typeof window < "u" && window.localStorage.getItem(Lt) === "1";
|
|
3029
3026
|
} catch {
|
|
3030
3027
|
return !1;
|
|
3031
3028
|
}
|
|
3032
3029
|
}
|
|
3033
|
-
function
|
|
3030
|
+
function vl() {
|
|
3034
3031
|
const n = "(min-width: 1024px)", [s, l] = T(
|
|
3035
3032
|
() => {
|
|
3036
3033
|
var r;
|
|
@@ -3045,7 +3042,7 @@ function bl() {
|
|
|
3045
3042
|
return r.addEventListener("change", o), () => r.removeEventListener("change", o);
|
|
3046
3043
|
}, []), s;
|
|
3047
3044
|
}
|
|
3048
|
-
function
|
|
3045
|
+
function ko({
|
|
3049
3046
|
open: n,
|
|
3050
3047
|
onClose: s,
|
|
3051
3048
|
renderMessageBody: l,
|
|
@@ -3053,56 +3050,56 @@ function vo({
|
|
|
3053
3050
|
requestedRoom: o
|
|
3054
3051
|
}) {
|
|
3055
3052
|
var Ce;
|
|
3056
|
-
const i = Le(), p = ue(), d = i.me, [x, f] = T(
|
|
3053
|
+
const i = Le(), p = ue(), d = i.me, [x, f] = T(gl), u = vl(), b = x && u, y = () => {
|
|
3057
3054
|
const k = !x;
|
|
3058
3055
|
f(k);
|
|
3059
3056
|
try {
|
|
3060
|
-
k ? window.localStorage.setItem(
|
|
3057
|
+
k ? window.localStorage.setItem(Lt, "1") : window.localStorage.removeItem(Lt);
|
|
3061
3058
|
} catch {
|
|
3062
3059
|
}
|
|
3063
3060
|
};
|
|
3064
3061
|
ae(() => {
|
|
3065
3062
|
if (!n || !b) return;
|
|
3066
|
-
const k = document.body,
|
|
3067
|
-
k.style.paddingRight = `${
|
|
3063
|
+
const k = document.body, M = k.style.paddingRight;
|
|
3064
|
+
k.style.paddingRight = `${Ut}px`, k.dataset.nvrChatPinned = "1";
|
|
3068
3065
|
const P = document.createElement("style");
|
|
3069
3066
|
return P.dataset.nvrChatPinnedStyle = "", P.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
|
|
3070
|
-
body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${
|
|
3071
|
-
k.style.paddingRight =
|
|
3067
|
+
body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ut}px; }`, document.head.appendChild(P), () => {
|
|
3068
|
+
k.style.paddingRight = M, delete k.dataset.nvrChatPinned, P.remove();
|
|
3072
3069
|
};
|
|
3073
3070
|
}, [n, b]);
|
|
3074
|
-
const [
|
|
3075
|
-
const V = ee.find((
|
|
3076
|
-
F(!1), S({ room: k, label: (V == null ? void 0 : V.label) ??
|
|
3077
|
-
}, [E, J] = T(!1), [G, F] = T(!1), [
|
|
3078
|
-
var
|
|
3079
|
-
if (
|
|
3071
|
+
const [D, A] = T("online"), [C, S] = T(null), [B, $] = T(null), v = (k, M, P) => {
|
|
3072
|
+
const V = ee.find(($e) => $e.room === k);
|
|
3073
|
+
F(!1), S({ room: k, label: (V == null ? void 0 : V.label) ?? M, channel: V == null ? void 0 : V.channel, anchor: P });
|
|
3074
|
+
}, [E, J] = T(!1), [G, F] = T(!1), [R, K] = T(null), { rooms: ee, totalUnread: Y } = sa(), te = ra(D === "archived"), oe = (k, M, P) => {
|
|
3075
|
+
var $e, _;
|
|
3076
|
+
if (!M) return [{ key: "all", label: null, users: k }];
|
|
3080
3077
|
const V = /* @__PURE__ */ new Map();
|
|
3081
3078
|
for (const I of k) {
|
|
3082
|
-
const j = P.get(String(I.user_id).toUpperCase()), ie =
|
|
3079
|
+
const j = P.get(String(I.user_id).toUpperCase()), ie = M === "__role__" ? [Wn((j == null ? void 0 : j.role_name) ?? I.role_name) || "No role"] : (_ = ($e = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : $e[M]) != null && _.length ? j.scopes_by_dimension[M] : ["Unassigned"], ne = [...new Set(ie)].sort((X, H) => X.localeCompare(H)).join(", ");
|
|
3083
3080
|
V.set(ne, [...V.get(ne) ?? [], I]);
|
|
3084
3081
|
}
|
|
3085
3082
|
return [...V.entries()].sort((I, j) => I[0] === "Unassigned" ? 1 : j[0] === "Unassigned" ? -1 : I[0].localeCompare(j[0])).map(([I, j]) => ({ key: I, label: I, users: j }));
|
|
3086
|
-
}, [se, me] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c = ba(), L = c.loaded ?
|
|
3083
|
+
}, [se, me] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c = ba(), L = c.loaded ? Js(
|
|
3087
3084
|
i.onlineUsers.filter((k) => c.byUser.has(String(k.user_id).toUpperCase()))
|
|
3088
3085
|
) : [], m = ve(
|
|
3089
3086
|
() => oe(L, se, c.byUser),
|
|
3090
3087
|
// biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
|
|
3091
3088
|
[L, se, c.byUser]
|
|
3092
|
-
), { isAdmin: Z } = ht(), { navigate:
|
|
3093
|
-
/^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") :
|
|
3089
|
+
), { isAdmin: Z } = ht(), { navigate: De } = ks(), he = (k) => {
|
|
3090
|
+
/^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") : De(k);
|
|
3094
3091
|
}, Pe = (k) => {
|
|
3095
|
-
d && (A("chat"), S({ room:
|
|
3092
|
+
d && (A("chat"), S({ room: Rt(d.id, k.user_id), label: k.display_name ?? "Direct message" }));
|
|
3096
3093
|
}, Ne = de(0);
|
|
3097
3094
|
ae(() => {
|
|
3098
3095
|
!r || !d || r.nonce === Ne.current || (Ne.current = r.nonce, A("chat"), F(!1), S({
|
|
3099
|
-
room:
|
|
3096
|
+
room: Rt(d.id, r.userId),
|
|
3100
3097
|
label: r.name ?? "Direct message"
|
|
3101
3098
|
}));
|
|
3102
3099
|
}, [r, d]);
|
|
3103
|
-
const
|
|
3100
|
+
const Ue = de(0);
|
|
3104
3101
|
return ae(() => {
|
|
3105
|
-
!o || o.nonce ===
|
|
3102
|
+
!o || o.nonce === Ue.current || (Ue.current = o.nonce, A("chat"), F(!1), S({ room: o.room, label: o.label ?? o.room }));
|
|
3106
3103
|
}, [o]), n ? /* @__PURE__ */ a(
|
|
3107
3104
|
"div",
|
|
3108
3105
|
{
|
|
@@ -3110,7 +3107,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3110
3107
|
// No backdrop: the rest of the page stays usable.
|
|
3111
3108
|
"pointer-events-none fixed inset-y-0 right-0 z-40"
|
|
3112
3109
|
) : "fixed inset-0 z-40 bg-black/40 animate-in fade-in duration-150",
|
|
3113
|
-
style: b ? { width:
|
|
3110
|
+
style: b ? { width: Ut } : void 0,
|
|
3114
3111
|
onClick: b ? void 0 : s,
|
|
3115
3112
|
"data-chat-panel": !0,
|
|
3116
3113
|
"data-nvr-recording-hide": !0,
|
|
@@ -3138,7 +3135,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3138
3135
|
"data-tip": k === "archived" ? "Conversations you archived for yourself. Everyone else still sees them." : void 0,
|
|
3139
3136
|
className: g(
|
|
3140
3137
|
"flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors",
|
|
3141
|
-
|
|
3138
|
+
D === k ? p.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
|
|
3142
3139
|
),
|
|
3143
3140
|
children: [
|
|
3144
3141
|
k === "online" ? `Online · ${L.length}` : k === "chat" ? "Chat" : k === "browse" ? "Browse" : "Archived",
|
|
@@ -3170,7 +3167,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3170
3167
|
x ? p.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
|
|
3171
3168
|
),
|
|
3172
3169
|
"data-chat-pin": x ? "on" : "off",
|
|
3173
|
-
children: x ? /* @__PURE__ */ e(
|
|
3170
|
+
children: x ? /* @__PURE__ */ e(Qa, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(Mt, { className: "h-4 w-4", strokeWidth: 2 })
|
|
3174
3171
|
}
|
|
3175
3172
|
),
|
|
3176
3173
|
/* @__PURE__ */ e(
|
|
@@ -3184,24 +3181,24 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3184
3181
|
}
|
|
3185
3182
|
)
|
|
3186
3183
|
] }),
|
|
3187
|
-
|
|
3184
|
+
D === "online" ? /* @__PURE__ */ a(
|
|
3188
3185
|
"div",
|
|
3189
3186
|
{
|
|
3190
3187
|
className: "min-h-0 flex-1 overflow-y-auto px-2 pb-2 [&>:first-child]:mt-2",
|
|
3191
3188
|
"data-chat-online": !0,
|
|
3192
3189
|
children: [
|
|
3193
3190
|
/* @__PURE__ */ e(
|
|
3194
|
-
|
|
3191
|
+
xl,
|
|
3195
3192
|
{
|
|
3196
3193
|
myStatus: d ? ((Ce = c.byUser.get(String(d.id).toUpperCase())) == null ? void 0 : Ce.custom_status) ?? null : null
|
|
3197
3194
|
}
|
|
3198
3195
|
),
|
|
3199
|
-
/* @__PURE__ */ e(
|
|
3200
|
-
/* @__PURE__ */ e(
|
|
3196
|
+
/* @__PURE__ */ e(fl, {}),
|
|
3197
|
+
/* @__PURE__ */ e(Ms, {}),
|
|
3201
3198
|
L.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
|
|
3202
3199
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
|
|
3203
3200
|
/* @__PURE__ */ e(
|
|
3204
|
-
|
|
3201
|
+
qt,
|
|
3205
3202
|
{
|
|
3206
3203
|
value: se,
|
|
3207
3204
|
onChange: (k) => {
|
|
@@ -3226,45 +3223,45 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3226
3223
|
k.label,
|
|
3227
3224
|
/* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
|
|
3228
3225
|
] }),
|
|
3229
|
-
k.users.map((
|
|
3230
|
-
const P = c.byUser.get(String(
|
|
3226
|
+
k.users.map((M) => {
|
|
3227
|
+
const P = c.byUser.get(String(M.user_id).toUpperCase()), V = (P == null ? void 0 : P.is_idle) ?? M.is_idle, $e = P ?? M;
|
|
3231
3228
|
return /* @__PURE__ */ a(
|
|
3232
3229
|
"div",
|
|
3233
3230
|
{
|
|
3234
3231
|
className: "flex w-full items-center rounded-lg pl-2.5 transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
|
|
3235
3232
|
"data-chat-online-row": !0,
|
|
3236
3233
|
children: [
|
|
3237
|
-
/* @__PURE__ */ e(
|
|
3234
|
+
/* @__PURE__ */ e(Et, { userId: M.user_id, children: /* @__PURE__ */ e(
|
|
3238
3235
|
"button",
|
|
3239
3236
|
{
|
|
3240
3237
|
type: "button",
|
|
3241
3238
|
className: "shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
3242
|
-
"aria-label": `${
|
|
3239
|
+
"aria-label": `${M.display_name ?? "Unknown user"} — profile`,
|
|
3243
3240
|
"data-chat-online-avatar": !0,
|
|
3244
|
-
children: /* @__PURE__ */ e(Q, { id:
|
|
3241
|
+
children: /* @__PURE__ */ e(Q, { id: M.user_id, name: M.display_name })
|
|
3245
3242
|
}
|
|
3246
3243
|
) }),
|
|
3247
3244
|
/* @__PURE__ */ a(
|
|
3248
3245
|
"button",
|
|
3249
3246
|
{
|
|
3250
3247
|
type: "button",
|
|
3251
|
-
onClick: () => Pe(
|
|
3248
|
+
onClick: () => Pe(M),
|
|
3252
3249
|
title: "Send a direct message",
|
|
3253
3250
|
className: "flex min-w-0 flex-1 items-center gap-3 py-2 pl-3 pr-2.5 text-left",
|
|
3254
3251
|
children: [
|
|
3255
3252
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
3256
3253
|
/* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
|
|
3257
|
-
|
|
3258
|
-
V && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: P != null && P.away ? "Away" :
|
|
3254
|
+
M.display_name ?? "Unknown user",
|
|
3255
|
+
V && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: P != null && P.away ? "Away" : Ot($e) }),
|
|
3259
3256
|
!V && (P == null ? void 0 : P.stuck) && (() => {
|
|
3260
|
-
const _ = P.stuck, I = c.fields.includes("page"), j =
|
|
3257
|
+
const _ = P.stuck, I = c.fields.includes("page"), j = $n(
|
|
3261
3258
|
P.current_path,
|
|
3262
3259
|
P.app,
|
|
3263
3260
|
c.adminUrl,
|
|
3264
3261
|
i.recordUrl,
|
|
3265
3262
|
typeof window > "u" ? null : window.location.origin
|
|
3266
|
-
), ie = `${
|
|
3267
|
-
${An(j)}` : ""}`, ne =
|
|
3263
|
+
), ie = `${Mn(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
|
|
3264
|
+
${An(j)}` : ""}`, ne = Mn(
|
|
3268
3265
|
I ? { ..._, label: null } : _
|
|
3269
3266
|
), X = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
|
|
3270
3267
|
return j ? (
|
|
@@ -3278,11 +3275,11 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3278
3275
|
"data-chat-stuck": _.minutes,
|
|
3279
3276
|
"data-tip": ie,
|
|
3280
3277
|
"aria-label": `${ne}: open the page`,
|
|
3281
|
-
onClick: (
|
|
3282
|
-
|
|
3278
|
+
onClick: (H) => {
|
|
3279
|
+
H.stopPropagation(), he(j);
|
|
3283
3280
|
},
|
|
3284
|
-
onKeyDown: (
|
|
3285
|
-
(
|
|
3281
|
+
onKeyDown: (H) => {
|
|
3282
|
+
(H.key === "Enter" || H.key === " ") && (H.preventDefault(), H.stopPropagation(), he(j));
|
|
3286
3283
|
},
|
|
3287
3284
|
children: ne
|
|
3288
3285
|
}
|
|
@@ -3300,7 +3297,7 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3300
3297
|
(() => {
|
|
3301
3298
|
var I;
|
|
3302
3299
|
const _ = (I = c.byUser.get(
|
|
3303
|
-
String(
|
|
3300
|
+
String(M.user_id).toUpperCase()
|
|
3304
3301
|
)) == null ? void 0 : I.masquerade;
|
|
3305
3302
|
return _ ? /* @__PURE__ */ a(
|
|
3306
3303
|
"span",
|
|
@@ -3315,10 +3312,10 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3315
3312
|
}
|
|
3316
3313
|
) : null;
|
|
3317
3314
|
})(),
|
|
3318
|
-
Z && /* @__PURE__ */ e(
|
|
3315
|
+
Z && /* @__PURE__ */ e(Rs, { builds: P == null ? void 0 : P.stale_build })
|
|
3319
3316
|
] }),
|
|
3320
3317
|
(() => {
|
|
3321
|
-
const _ = c.byUser.get(String(
|
|
3318
|
+
const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = _ == null ? void 0 : _.custom_status;
|
|
3322
3319
|
return !I && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
|
|
3323
3320
|
"span",
|
|
3324
3321
|
{
|
|
@@ -3332,7 +3329,7 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3332
3329
|
"data-chat-in-huddle": !0,
|
|
3333
3330
|
"data-tip": "In a huddle right now",
|
|
3334
3331
|
children: [
|
|
3335
|
-
/* @__PURE__ */ e(
|
|
3332
|
+
/* @__PURE__ */ e(Ka, { className: "h-3 w-3", strokeWidth: 2 }),
|
|
3336
3333
|
!I && "In a huddle"
|
|
3337
3334
|
]
|
|
3338
3335
|
}
|
|
@@ -3346,17 +3343,17 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3346
3343
|
);
|
|
3347
3344
|
})(),
|
|
3348
3345
|
(() => {
|
|
3349
|
-
const _ = c.byUser.get(String(
|
|
3346
|
+
const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = [];
|
|
3350
3347
|
let j = null, ie = !1;
|
|
3351
|
-
for (const
|
|
3352
|
-
if (
|
|
3353
|
-
const re = Wn((_ == null ? void 0 : _.role_name) ??
|
|
3348
|
+
for (const H of c.fields)
|
|
3349
|
+
if (H === "role") {
|
|
3350
|
+
const re = Wn((_ == null ? void 0 : _.role_name) ?? M.role_name);
|
|
3354
3351
|
re && I.push(re);
|
|
3355
|
-
} else if (
|
|
3352
|
+
} else if (H === "scopes") {
|
|
3356
3353
|
const re = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
|
|
3357
3354
|
re && I.push(re);
|
|
3358
|
-
} else if (
|
|
3359
|
-
const re = (_ == null ? void 0 : _.page) ??
|
|
3355
|
+
} else if (H === "page") {
|
|
3356
|
+
const re = (_ == null ? void 0 : _.page) ?? M.page ?? ga((_ == null ? void 0 : _.current_path) ?? M.current_path), fe = (_ == null ? void 0 : _.app) ?? M.app;
|
|
3360
3357
|
j = (fe ? `${re ?? ""}${re ? " · " : ""}${fe}`.trim() : re) || null, ie = !j && !!_ && !_.away;
|
|
3361
3358
|
}
|
|
3362
3359
|
const ne = I.join(" · "), X = ie ? /* @__PURE__ */ a(
|
|
@@ -3366,7 +3363,7 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3366
3363
|
"data-chat-online-page": "background",
|
|
3367
3364
|
"data-tip": "Their app is open in a tab that is not in front, so where they are is not known until they look at it.",
|
|
3368
3365
|
children: [
|
|
3369
|
-
/* @__PURE__ */ e(
|
|
3366
|
+
/* @__PURE__ */ e(Un, { className: "mt-[2px] h-3 w-3 shrink-0 opacity-60" }),
|
|
3370
3367
|
/* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: "Tab in background" })
|
|
3371
3368
|
]
|
|
3372
3369
|
}
|
|
@@ -3383,17 +3380,17 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3383
3380
|
),
|
|
3384
3381
|
X,
|
|
3385
3382
|
j && (() => {
|
|
3386
|
-
const
|
|
3383
|
+
const H = $n(
|
|
3387
3384
|
_ == null ? void 0 : _.current_path,
|
|
3388
3385
|
_ == null ? void 0 : _.app,
|
|
3389
3386
|
c.adminUrl,
|
|
3390
3387
|
i.recordUrl,
|
|
3391
3388
|
typeof window > "u" ? null : window.location.origin
|
|
3392
3389
|
), re = /* @__PURE__ */ a(ke, { children: [
|
|
3393
|
-
/* @__PURE__ */ e(
|
|
3390
|
+
/* @__PURE__ */ e(Un, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
|
|
3394
3391
|
/* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: j })
|
|
3395
3392
|
] });
|
|
3396
|
-
return
|
|
3393
|
+
return H ? (
|
|
3397
3394
|
// biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
|
|
3398
3395
|
/* @__PURE__ */ e(
|
|
3399
3396
|
"span",
|
|
@@ -3402,14 +3399,14 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3402
3399
|
tabIndex: 0,
|
|
3403
3400
|
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",
|
|
3404
3401
|
"data-chat-online-page": !0,
|
|
3405
|
-
"data-chat-online-page-href":
|
|
3406
|
-
"data-tip": An(
|
|
3402
|
+
"data-chat-online-page-href": H,
|
|
3403
|
+
"data-tip": An(H),
|
|
3407
3404
|
"aria-label": `${j}: open the page`,
|
|
3408
3405
|
onClick: (fe) => {
|
|
3409
|
-
fe.stopPropagation(), he(
|
|
3406
|
+
fe.stopPropagation(), he(H);
|
|
3410
3407
|
},
|
|
3411
3408
|
onKeyDown: (fe) => {
|
|
3412
|
-
(fe.key === "Enter" || fe.key === " ") && (fe.preventDefault(), fe.stopPropagation(), he(
|
|
3409
|
+
(fe.key === "Enter" || fe.key === " ") && (fe.preventDefault(), fe.stopPropagation(), he(H));
|
|
3413
3410
|
},
|
|
3414
3411
|
children: re
|
|
3415
3412
|
}
|
|
@@ -3429,9 +3426,9 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3429
3426
|
] }),
|
|
3430
3427
|
(() => {
|
|
3431
3428
|
var ne;
|
|
3432
|
-
const _ = c.byUser.get(String(
|
|
3429
|
+
const _ = c.byUser.get(String(M.user_id).toUpperCase());
|
|
3433
3430
|
if (!Z || !(_ != null && _.recording_id)) return null;
|
|
3434
|
-
const I = ((ne = c.adminUrl) == null ? void 0 : ne.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), ie = i.sessionUrl ? i.sessionUrl(_.recording_id, String(
|
|
3431
|
+
const I = ((ne = c.adminUrl) == null ? void 0 : ne.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), ie = i.sessionUrl ? i.sessionUrl(_.recording_id, String(M.user_id)) : j ? `${I}/session-replays?recording=${_.recording_id}` : null;
|
|
3435
3432
|
return ie ? /* @__PURE__ */ e(
|
|
3436
3433
|
"span",
|
|
3437
3434
|
{
|
|
@@ -3445,7 +3442,7 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3445
3442
|
(X.key === "Enter" || X.key === " ") && (X.stopPropagation(), he(ie));
|
|
3446
3443
|
},
|
|
3447
3444
|
className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
|
|
3448
|
-
children: /* @__PURE__ */ e(
|
|
3445
|
+
children: /* @__PURE__ */ e(Ja, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
3449
3446
|
}
|
|
3450
3447
|
) : null;
|
|
3451
3448
|
})(),
|
|
@@ -3461,51 +3458,51 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3461
3458
|
)
|
|
3462
3459
|
]
|
|
3463
3460
|
},
|
|
3464
|
-
|
|
3461
|
+
M.user_id
|
|
3465
3462
|
);
|
|
3466
3463
|
})
|
|
3467
3464
|
] }, k.key))
|
|
3468
3465
|
]
|
|
3469
3466
|
}
|
|
3470
|
-
) :
|
|
3467
|
+
) : D === "archived" ? R ? /* @__PURE__ */ e(
|
|
3471
3468
|
qn,
|
|
3472
3469
|
{
|
|
3473
|
-
room:
|
|
3474
|
-
label:
|
|
3470
|
+
room: R.room,
|
|
3471
|
+
label: R.label,
|
|
3475
3472
|
onBack: () => K(null),
|
|
3476
3473
|
renderMessageBody: l
|
|
3477
3474
|
},
|
|
3478
|
-
|
|
3475
|
+
R.room
|
|
3479
3476
|
) : /* @__PURE__ */ e(
|
|
3480
|
-
|
|
3477
|
+
Hn,
|
|
3481
3478
|
{
|
|
3482
3479
|
rooms: te.rooms,
|
|
3483
3480
|
loading: te.loading,
|
|
3484
3481
|
archivedView: !0,
|
|
3485
3482
|
onOpen: (k) => K({ room: k.room, label: k.label })
|
|
3486
3483
|
}
|
|
3487
|
-
) :
|
|
3484
|
+
) : D === "browse" ? (
|
|
3488
3485
|
// The tab is checked BEFORE the open room: leaving it last meant
|
|
3489
3486
|
// switching to Browse with a conversation open kept showing that
|
|
3490
3487
|
// conversation (or its settings) under the Browse tab.
|
|
3491
3488
|
/* @__PURE__ */ e(
|
|
3492
|
-
|
|
3489
|
+
pl,
|
|
3493
3490
|
{
|
|
3494
|
-
onOpen: (k,
|
|
3495
|
-
F(!1), S({ room: k, label:
|
|
3491
|
+
onOpen: (k, M, P) => {
|
|
3492
|
+
F(!1), S({ room: k, label: M, channel: P }), A("chat");
|
|
3496
3493
|
}
|
|
3497
3494
|
}
|
|
3498
3495
|
)
|
|
3499
3496
|
) : E ? /* @__PURE__ */ e(
|
|
3500
|
-
|
|
3497
|
+
bl,
|
|
3501
3498
|
{
|
|
3502
3499
|
onClose: () => J(!1),
|
|
3503
|
-
onCreated: (k,
|
|
3504
|
-
J(!1), S({ room: k, label:
|
|
3500
|
+
onCreated: (k, M) => {
|
|
3501
|
+
J(!1), S({ room: k, label: M });
|
|
3505
3502
|
}
|
|
3506
3503
|
}
|
|
3507
3504
|
) : C && G && C.channel ? /* @__PURE__ */ e(
|
|
3508
|
-
|
|
3505
|
+
dl,
|
|
3509
3506
|
{
|
|
3510
3507
|
channel: C.channel,
|
|
3511
3508
|
label: C.label,
|
|
@@ -3523,14 +3520,14 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3523
3520
|
anchor: C.anchor ?? null
|
|
3524
3521
|
},
|
|
3525
3522
|
C.room
|
|
3526
|
-
) : B === "mentions" ? /* @__PURE__ */ e(Yn, { th: p, onBack: () =>
|
|
3523
|
+
) : B === "mentions" ? /* @__PURE__ */ e(Yn, { th: p, onBack: () => $(null), onOpen: v }) : B === "scheduled" ? /* @__PURE__ */ e(
|
|
3527
3524
|
Zn,
|
|
3528
3525
|
{
|
|
3529
3526
|
th: p,
|
|
3530
|
-
onBack: () =>
|
|
3527
|
+
onBack: () => $(null),
|
|
3531
3528
|
roomLabel: (k) => {
|
|
3532
|
-
var
|
|
3533
|
-
return ((
|
|
3529
|
+
var M;
|
|
3530
|
+
return ((M = ee.find((P) => P.room === k)) == null ? void 0 : M.label) ?? k;
|
|
3534
3531
|
}
|
|
3535
3532
|
}
|
|
3536
3533
|
) : B === "catchup" ? /* @__PURE__ */ e(
|
|
@@ -3538,24 +3535,24 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3538
3535
|
{
|
|
3539
3536
|
rooms: ee,
|
|
3540
3537
|
th: p,
|
|
3541
|
-
onBack: () =>
|
|
3538
|
+
onBack: () => $(null),
|
|
3542
3539
|
onOpen: v
|
|
3543
3540
|
}
|
|
3544
3541
|
) : /* @__PURE__ */ e(
|
|
3545
|
-
|
|
3542
|
+
Hn,
|
|
3546
3543
|
{
|
|
3547
3544
|
rooms: ee,
|
|
3548
|
-
onOpen: (k,
|
|
3545
|
+
onOpen: (k, M) => {
|
|
3549
3546
|
F(!1), S({
|
|
3550
3547
|
room: k.room,
|
|
3551
3548
|
label: k.label,
|
|
3552
3549
|
channel: k.channel,
|
|
3553
3550
|
unread: k.unread,
|
|
3554
|
-
anchor:
|
|
3551
|
+
anchor: M
|
|
3555
3552
|
});
|
|
3556
3553
|
},
|
|
3557
3554
|
onNewGroup: () => J(!0),
|
|
3558
|
-
onView:
|
|
3555
|
+
onView: $
|
|
3559
3556
|
}
|
|
3560
3557
|
)
|
|
3561
3558
|
]
|
|
@@ -3566,13 +3563,13 @@ ${An(j)}` : ""}`, ne = $n(
|
|
|
3566
3563
|
) : /* @__PURE__ */ e(Rn, {});
|
|
3567
3564
|
}
|
|
3568
3565
|
export {
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3566
|
+
fl as ChatAppearAwayRow,
|
|
3567
|
+
pl as ChatChannelBrowser,
|
|
3568
|
+
dl as ChatChannelSettings,
|
|
3569
|
+
ko as ChatPanel,
|
|
3570
|
+
vo as ChatProvider,
|
|
3571
|
+
Hn as ChatRoomList,
|
|
3575
3572
|
qn as ChatRoomView,
|
|
3576
|
-
|
|
3577
|
-
|
|
3573
|
+
yo as ChatSideView,
|
|
3574
|
+
gl as isChatPanelPinned
|
|
3578
3575
|
};
|