@nivaro/react 0.3.8 → 0.3.9
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/replayUploadQueue.js +107 -93
- package/dist/hooks/useSessionRecorder.js +103 -101
- package/dist/index.d.ts +46 -1
- package/dist/index.js +300 -292
- package/dist/shared/components/CollectionBrowserView.js +318 -318
- package/dist/shared/components/DataTable.js +230 -223
- package/dist/shared/components/QueryTable.js +49 -49
- package/dist/shared/components/chat/ChatPanel.js +288 -287
- package/dist/shared/components/panels/CommentPanel.js +237 -236
- package/dist/shared/components/profile/usePersonPresence.js +42 -37
- package/dist/shared/lib/presence-live.js +54 -0
- package/dist/shared/lib/presence-state.js +39 -31
- package/dist/shared/lib/request-gate.js +120 -102
- package/dist/shared/lib/rum.js +45 -36
- package/dist/shared/lib/signed-out.js +114 -0
- package/dist/shared/lib/socket-realtime.js +19 -17
- package/dist/shared/lib/use-online-users.js +11 -10
- package/dist/shared/lib/worker-socket.js +89 -79
- package/package.json +1 -1
|
@@ -6,45 +6,46 @@ import { toast as he } from "sonner";
|
|
|
6
6
|
import { useItemEditAuth as ut, useNavigation as vs, useNivaroClient as Je } from "../../context.js";
|
|
7
7
|
import { get as xe, post as Be, patch as ys } from "../../lib/commands.js";
|
|
8
8
|
import { useLiveRecord as ks, batchTouches as ws, LIVE_ASPECTS as Ns } from "../../lib/live.js";
|
|
9
|
+
import { usePresenceOnlinePoll as Cs } from "../../lib/presence-live.js";
|
|
9
10
|
import { presencePlaceHref as Tn, stuckText as Un, fullHref as Dn } from "../../lib/presence-state.js";
|
|
10
|
-
import { invalidateRecordTasks as
|
|
11
|
-
import { userCardQuery as
|
|
11
|
+
import { invalidateRecordTasks as _s } from "../../lib/record-tasks.js";
|
|
12
|
+
import { userCardQuery as Ss } from "../../lib/user-cards.js";
|
|
12
13
|
import { cn as g, getDisplayTimezone as Mt, formatRelative as zn } from "../../lib/utils.js";
|
|
13
|
-
import { CustomStatusEditor as
|
|
14
|
-
import { DoNotDisturbRow as
|
|
15
|
-
import { FilePreviewLightbox as
|
|
14
|
+
import { CustomStatusEditor as Ts } from "../CustomStatusEditor.js";
|
|
15
|
+
import { DoNotDisturbRow as Us } from "../DoNotDisturb.js";
|
|
16
|
+
import { FilePreviewLightbox as Ds } from "../FilePreviewLightbox.js";
|
|
16
17
|
import { UserChip as Hn } from "../item-edit/UserChip.js";
|
|
17
|
-
import { StaleBuildChip as
|
|
18
|
-
import { UserAvatar as
|
|
18
|
+
import { StaleBuildChip as $s } from "../StaleBuildChip.js";
|
|
19
|
+
import { UserAvatar as Rs } from "../UserAvatar.js";
|
|
19
20
|
import { Popover as Ye, PopoverTrigger as Ze, PopoverContent as Ve } from "../ui/popover.js";
|
|
20
21
|
import { SimpleSelect as Ot } from "../ui/SimpleSelect.js";
|
|
21
|
-
import { useBotStream as
|
|
22
|
-
import { MembershipHistory as
|
|
23
|
-
import { ChannelExtrasEditor as
|
|
22
|
+
import { useBotStream as As, BotStreamBubble as Ms } from "./BotStream.js";
|
|
23
|
+
import { MembershipHistory as Os, ArchiveSuggestionBanner as Ls } from "./ChannelArchive.js";
|
|
24
|
+
import { ChannelExtrasEditor as Ps, BulkInvitePanel as Is, ChannelAuditLog as js } from "./ChannelExtras.js";
|
|
24
25
|
import { ChannelTile as Ke, ChannelLookPicker as Gn } from "./ChannelLook.js";
|
|
25
|
-
import { MentionsView as Qn, ScheduledView as Kn, CatchUpView as Jn, useSearchFilterState as
|
|
26
|
-
import { ChatComposer as
|
|
27
|
-
import { useMyPreferences as Lt, useSetMyPreferences as Yn, useChatRoles as Zn, useChannelDirectory as
|
|
28
|
-
import { useDraftRooms as
|
|
29
|
-
import { useCustomEmoji as
|
|
30
|
-
import { useRoomRecord as sa, useRecordFileTargets as
|
|
31
|
-
import { offHoursNote as
|
|
32
|
-
import { useMessageWindow as
|
|
26
|
+
import { MentionsView as Qn, ScheduledView as Kn, CatchUpView as Jn, useSearchFilterState as qs, FilterToggle as Es, ChatSettingsButton as Bs, SearchFilterBar as Ws } from "./ChatViews.js";
|
|
27
|
+
import { ChatComposer as Fs } from "./Composer.js";
|
|
28
|
+
import { useMyPreferences as Lt, useSetMyPreferences as Yn, useChatRoles as Zn, useChannelDirectory as zs, useRoomMembership as Pt, useCreateChannel as Hs, useChatConfig as Me, useChannelMembers as It, useChannelAdmin as Vn, useUserSearch as jt, GENERAL_CHANNEL_ID as Xn, useChatRooms as ea, useArchivedRooms as ta, sortOnlineUsers as Gs, dmRoom as Ut, CHAT_DEFAULTS as it, ChatConfigContext as na, useChatBotInfo as qt, useChatSearch as Qs, dmPeer as Ne, useChatMessages as Ks, useOpenRoomRegistration as Js, useMarkRoomRead as Ys, useTypingIndicator as Zs, usePeerReadAt as Vs, useEntityRoomLink as Xs, useToggleReaction as er, useRoomPins as tr, useTogglePin as nr, useEditMessage as ar, useDeleteMessage as sr, useChatBotName as rr, useChatThread as lr, useRecordBrowserTimezone as or, chatInitials as ir, chatAvatarColor as cr, useCreateGroupDm as dr, canOpenDm as ur, openDmWith as mr, chatRoomTypesQuery as aa, REACTION_EMOJI as pr } from "./chat-core.js";
|
|
29
|
+
import { useDraftRooms as hr } from "./chat-drafts.js";
|
|
30
|
+
import { useCustomEmoji as fr, EmojiButton as xr, EmojiGlyph as gr } from "./chat-emoji.js";
|
|
31
|
+
import { useRoomRecord as sa, useRecordFileTargets as br } from "./chat-hooks.js";
|
|
32
|
+
import { offHoursNote as vr } from "./chat-local-time.js";
|
|
33
|
+
import { useMessageWindow as yr } from "./chat-window.js";
|
|
33
34
|
import { HuddleFollowHost as $n } from "./huddle/HuddleCollab.js";
|
|
34
|
-
import { HuddleControls as
|
|
35
|
-
import { HuddleLiveBadge as
|
|
36
|
-
import { HuddleScheduleCard as
|
|
37
|
-
import { HuddleScheduleForm as
|
|
38
|
-
import { HuddleStage as
|
|
39
|
-
import { useHuddleLive as
|
|
35
|
+
import { HuddleControls as kr } from "./huddle/HuddleControls.js";
|
|
36
|
+
import { HuddleLiveBadge as wr } from "./huddle/HuddleLiveBadge.js";
|
|
37
|
+
import { HuddleScheduleCard as Nr } from "./huddle/HuddleScheduleCard.js";
|
|
38
|
+
import { HuddleScheduleForm as Cr } from "./huddle/HuddleScheduleForm.js";
|
|
39
|
+
import { HuddleStage as _r } from "./huddle/HuddleStage.js";
|
|
40
|
+
import { useHuddleLive as Sr } from "./huddle/huddle-live.js";
|
|
40
41
|
import { stripHuddleRef as Rn, huddleRefOf as An } from "./huddle/huddle-schedule.js";
|
|
41
|
-
import { useHuddle as
|
|
42
|
-
import { useMessageActions as
|
|
43
|
-
import { FormattedMessage as
|
|
44
|
-
import { PollCard as
|
|
45
|
-
import { RoomStatusMarks as
|
|
46
|
-
import { MemberCountLine as
|
|
47
|
-
import { clipInfo as
|
|
42
|
+
import { useHuddle as Tr } from "./huddle/useHuddle.js";
|
|
43
|
+
import { useMessageActions as Ur, MessageActionsMenu as Dr, actionsForMessage as $r } from "./MessageActions.js";
|
|
44
|
+
import { FormattedMessage as Rr, LinkPreviews as Ar } from "./MessageFormat.js";
|
|
45
|
+
import { PollCard as Mr } from "./PollCard.js";
|
|
46
|
+
import { RoomStatusMarks as Or, headerIconIdle as Mn, headerIconButton as On, RoomHeaderMenu as Lr } from "./RoomHeaderMenu.js";
|
|
47
|
+
import { MemberCountLine as Pr, ChannelIntro as Ir, WelcomeNote as jr, ThreadPane as qr, RoomInfoDrawer as Er } from "./RoomParts.js";
|
|
48
|
+
import { clipInfo as Br, ClipPlayer as Wr } from "./ScreenClip.js";
|
|
48
49
|
import { useOutbox as ra } from "./chat-outbox.js";
|
|
49
50
|
import { OutboxBubbles as la } from "./OutboxBubbles.js";
|
|
50
51
|
const oa = {
|
|
@@ -59,12 +60,12 @@ const oa = {
|
|
|
59
60
|
divider: "border-slate-100 dark:border-border/60"
|
|
60
61
|
}, Et = {};
|
|
61
62
|
Et.current = oa;
|
|
62
|
-
function
|
|
63
|
+
function co({
|
|
63
64
|
children: n,
|
|
64
65
|
me: s,
|
|
65
|
-
onlineUsers:
|
|
66
|
+
onlineUsers: l = [],
|
|
66
67
|
collections: r,
|
|
67
|
-
globalRoom:
|
|
68
|
+
globalRoom: o = it.globalRoom,
|
|
68
69
|
globalLabel: i = it.globalLabel,
|
|
69
70
|
entityPattern: d = it.entityPattern,
|
|
70
71
|
entityUrl: c = () => null,
|
|
@@ -81,7 +82,7 @@ function oo({
|
|
|
81
82
|
const W = fe(
|
|
82
83
|
() => ({
|
|
83
84
|
collections: { ...it.collections, ...r },
|
|
84
|
-
globalRoom:
|
|
85
|
+
globalRoom: o,
|
|
85
86
|
globalLabel: i,
|
|
86
87
|
entityPattern: d,
|
|
87
88
|
entityUrl: c,
|
|
@@ -91,7 +92,7 @@ function oo({
|
|
|
91
92
|
realtime: p,
|
|
92
93
|
subscribeRooms: b,
|
|
93
94
|
me: s,
|
|
94
|
-
onlineUsers:
|
|
95
|
+
onlineUsers: l,
|
|
95
96
|
setTypingRoom: U,
|
|
96
97
|
navigate: $,
|
|
97
98
|
sound: C
|
|
@@ -99,9 +100,9 @@ function oo({
|
|
|
99
100
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
101
|
[
|
|
101
102
|
s == null ? void 0 : s.id,
|
|
102
|
-
o,
|
|
103
|
-
r,
|
|
104
103
|
l,
|
|
104
|
+
r,
|
|
105
|
+
o,
|
|
105
106
|
i,
|
|
106
107
|
d,
|
|
107
108
|
p,
|
|
@@ -115,16 +116,16 @@ function ie() {
|
|
|
115
116
|
return Et.current;
|
|
116
117
|
}
|
|
117
118
|
const Ln = /* @__PURE__ */ new WeakMap();
|
|
118
|
-
function
|
|
119
|
-
const
|
|
119
|
+
function Fr(n, s) {
|
|
120
|
+
const l = String(s).toUpperCase();
|
|
120
121
|
let r = Ln.get(n);
|
|
121
122
|
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, Ln.set(n, r));
|
|
122
|
-
const
|
|
123
|
+
const o = r;
|
|
123
124
|
return new Promise((i) => {
|
|
124
|
-
const d =
|
|
125
|
-
d.push(i),
|
|
126
|
-
const c = new Map(
|
|
127
|
-
|
|
125
|
+
const d = o.ids.get(l) ?? [];
|
|
126
|
+
d.push(i), o.ids.set(l, d), !o.timer && (o.timer = setTimeout(async () => {
|
|
127
|
+
const c = new Map(o.ids);
|
|
128
|
+
o.ids.clear(), o.timer = null;
|
|
128
129
|
const h = [...c.keys()], f = /* @__PURE__ */ new Map();
|
|
129
130
|
for (let u = 0; u < h.length; u += 100)
|
|
130
131
|
try {
|
|
@@ -139,9 +140,9 @@ function Wr(n, s) {
|
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
142
|
function Bt(n, s = !0) {
|
|
142
|
-
const
|
|
143
|
+
const l = Je(), { data: r } = Ce({
|
|
143
144
|
queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
|
|
144
|
-
queryFn: () =>
|
|
145
|
+
queryFn: () => Fr(l, n),
|
|
145
146
|
enabled: !!n && s,
|
|
146
147
|
staleTime: 6e4
|
|
147
148
|
});
|
|
@@ -151,15 +152,15 @@ function ia(n) {
|
|
|
151
152
|
return n != null && n.last_seen ? `last seen ${zn(n.last_seen)}` : null;
|
|
152
153
|
}
|
|
153
154
|
function ca(n) {
|
|
154
|
-
const s = bs(na),
|
|
155
|
-
if (
|
|
156
|
-
const i =
|
|
155
|
+
const s = bs(na), l = pa(), r = String(n).toUpperCase();
|
|
156
|
+
if (l.loaded) {
|
|
157
|
+
const i = l.byUser.get(r);
|
|
157
158
|
if (!i) return { state: "offline", title: "Offline", page: null };
|
|
158
159
|
const d = i.page ?? ha(i.current_path);
|
|
159
160
|
return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: Dt(i), page: d } : { state: "online", title: "Online", page: d };
|
|
160
161
|
}
|
|
161
|
-
const
|
|
162
|
-
return
|
|
162
|
+
const o = s == null ? void 0 : s.onlineUsers.find((i) => String(i.user_id).toUpperCase() === r);
|
|
163
|
+
return o ? o.is_idle ? { state: "idle", title: Dt(o), page: null } : { state: "online", title: "Online", page: null } : { state: "offline", title: "Offline", page: null };
|
|
163
164
|
}
|
|
164
165
|
function da(n) {
|
|
165
166
|
return n != null && n.out_of_office ? n.ooo_end ? `Out of office until ${new Date(n.ooo_end).toLocaleDateString(void 0, {
|
|
@@ -169,10 +170,10 @@ function da(n) {
|
|
|
169
170
|
timeZone: Mt() ?? void 0
|
|
170
171
|
})}` : "Out of office" : null;
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
-
const { state:
|
|
173
|
+
function zr({ id: n, size: s }) {
|
|
174
|
+
const { state: l, title: r, page: o } = ca(n), i = Bt(n), d = l === "offline" ? ia(i) : null, c = da(i), h = s >= 30 ? 10 : 8, f = [
|
|
174
175
|
d ? `Offline · ${d}` : r,
|
|
175
|
-
|
|
176
|
+
o && l !== "offline" ? `On ${o}` : null,
|
|
176
177
|
c,
|
|
177
178
|
c && (i != null && i.delegate) ? `${i.delegate.name} is covering` : null
|
|
178
179
|
].filter(Boolean).join(" · ");
|
|
@@ -182,12 +183,12 @@ function Fr({ id: n, size: s }) {
|
|
|
182
183
|
{
|
|
183
184
|
className: g(
|
|
184
185
|
"absolute -bottom-0.5 -right-0.5 rounded-full border-2 border-white dark:border-card",
|
|
185
|
-
|
|
186
|
+
l === "online" ? "bg-emerald-400" : l === "idle" || l === "away" ? "border-amber-400 bg-white dark:border-amber-400 dark:bg-card" : "bg-slate-300 dark:bg-slate-600"
|
|
186
187
|
),
|
|
187
188
|
style: { width: h, height: h },
|
|
188
189
|
"data-tip": f,
|
|
189
190
|
title: f,
|
|
190
|
-
"data-chat-presence":
|
|
191
|
+
"data-chat-presence": l
|
|
191
192
|
}
|
|
192
193
|
),
|
|
193
194
|
c && // Out of office is its own mark, top-right, so it reads beside any of
|
|
@@ -208,51 +209,51 @@ function Fr({ id: n, size: s }) {
|
|
|
208
209
|
function Z({
|
|
209
210
|
id: n,
|
|
210
211
|
name: s,
|
|
211
|
-
size:
|
|
212
|
+
size: l = 32,
|
|
212
213
|
presence: r = !0
|
|
213
214
|
}) {
|
|
214
|
-
const
|
|
215
|
+
const o = qt(), i = /* @__PURE__ */ e(
|
|
215
216
|
"span",
|
|
216
217
|
{
|
|
217
218
|
className: "flex shrink-0 items-center justify-center rounded-full font-semibold text-[#04263b]",
|
|
218
219
|
style: {
|
|
219
|
-
width:
|
|
220
|
-
height:
|
|
221
|
-
backgroundColor:
|
|
222
|
-
fontSize:
|
|
220
|
+
width: l,
|
|
221
|
+
height: l,
|
|
222
|
+
backgroundColor: cr(n),
|
|
223
|
+
fontSize: l * 0.36
|
|
223
224
|
},
|
|
224
225
|
"aria-hidden": !0,
|
|
225
|
-
children:
|
|
226
|
+
children: ir(s)
|
|
226
227
|
}
|
|
227
228
|
), d = /* @__PURE__ */ e(
|
|
228
|
-
|
|
229
|
+
Rs,
|
|
229
230
|
{
|
|
230
231
|
userId: n,
|
|
231
232
|
fallback: i,
|
|
232
|
-
style: { width:
|
|
233
|
+
style: { width: l, height: l },
|
|
233
234
|
alt: s ?? ""
|
|
234
235
|
}
|
|
235
|
-
), c = n === "__bot__" || !!
|
|
236
|
-
return !r || c ? d : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width:
|
|
236
|
+
), c = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(n).toUpperCase();
|
|
237
|
+
return !r || c ? d : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
|
|
237
238
|
d,
|
|
238
|
-
/* @__PURE__ */ e(
|
|
239
|
+
/* @__PURE__ */ e(zr, { id: n, size: l })
|
|
239
240
|
] });
|
|
240
241
|
}
|
|
241
|
-
function
|
|
242
|
-
const
|
|
243
|
-
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children:
|
|
242
|
+
function Hr({ peerId: n, name: s }) {
|
|
243
|
+
const l = qt(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(Z, { id: n, name: s, size: 28 });
|
|
244
|
+
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Hn, { userId: n, children: /* @__PURE__ */ e(
|
|
244
245
|
"button",
|
|
245
246
|
{
|
|
246
247
|
type: "button",
|
|
247
248
|
className: "mr-1 shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
248
249
|
"aria-label": `${s} — profile`,
|
|
249
250
|
"data-chat-dm-header-avatar": !0,
|
|
250
|
-
children:
|
|
251
|
+
children: o
|
|
251
252
|
}
|
|
252
253
|
) });
|
|
253
254
|
}
|
|
254
|
-
function Pn({ token: n, url: s, mine:
|
|
255
|
-
const r = Me(),
|
|
255
|
+
function Pn({ token: n, url: s, mine: l }) {
|
|
256
|
+
const r = Me(), o = ie(), i = Je(), { data: d } = Ce(aa(i)), { data: c } = Ce({
|
|
256
257
|
queryKey: ["nvr-chat-entity-card", n],
|
|
257
258
|
queryFn: async () => {
|
|
258
259
|
var u, p, b, U;
|
|
@@ -306,7 +307,7 @@ function Pn({ token: n, url: s, mine: o }) {
|
|
|
306
307
|
},
|
|
307
308
|
className: g(
|
|
308
309
|
"inline-flex max-w-full items-center gap-1 align-baseline font-medium underline-offset-2 hover:underline",
|
|
309
|
-
|
|
310
|
+
l ? "underline" : o.accentText
|
|
310
311
|
),
|
|
311
312
|
"data-chat-entity": n,
|
|
312
313
|
children: [
|
|
@@ -317,7 +318,7 @@ function Pn({ token: n, url: s, mine: o }) {
|
|
|
317
318
|
className: "inline-flex items-center rounded-full px-1.5 py-px text-[9px] font-semibold leading-tight",
|
|
318
319
|
style: {
|
|
319
320
|
backgroundColor: c.color ? `${c.color}26` : "rgba(100,116,139,.15)",
|
|
320
|
-
color:
|
|
321
|
+
color: l ? void 0 : c.color ?? void 0
|
|
321
322
|
},
|
|
322
323
|
children: c.state
|
|
323
324
|
}
|
|
@@ -326,12 +327,12 @@ function Pn({ token: n, url: s, mine: o }) {
|
|
|
326
327
|
}
|
|
327
328
|
);
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
-
const s = new Date(n),
|
|
331
|
-
return r.setDate(
|
|
330
|
+
function Gr(n) {
|
|
331
|
+
const s = new Date(n), l = /* @__PURE__ */ new Date(), r = new Date(l);
|
|
332
|
+
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" });
|
|
332
333
|
}
|
|
333
|
-
function
|
|
334
|
-
const s = ie(),
|
|
334
|
+
function Qr({ botName: n }) {
|
|
335
|
+
const s = ie(), l = [
|
|
335
336
|
{
|
|
336
337
|
k: "@name",
|
|
337
338
|
kind: "code",
|
|
@@ -372,7 +373,7 @@ function Gr({ botName: n }) {
|
|
|
372
373
|
];
|
|
373
374
|
return /* @__PURE__ */ a("div", { "data-chat-tips": !0, children: [
|
|
374
375
|
/* @__PURE__ */ e("p", { className: "border-b border-slate-100 px-4 py-2.5 text-[12.5px] font-semibold text-slate-800 dark:border-border/60 dark:text-slate-100", children: "Things this chat can do" }),
|
|
375
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-[122px_1fr] gap-x-3 gap-y-0 px-4 py-1.5", children:
|
|
376
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-[122px_1fr] gap-x-3 gap-y-0 px-4 py-1.5", children: l.map((r) => /* @__PURE__ */ a(
|
|
376
377
|
"div",
|
|
377
378
|
{
|
|
378
379
|
className: "col-span-2 grid grid-cols-subgrid border-b border-slate-100/70 py-2 last:border-b-0 dark:border-border/40",
|
|
@@ -394,8 +395,8 @@ function Gr({ botName: n }) {
|
|
|
394
395
|
)) })
|
|
395
396
|
] });
|
|
396
397
|
}
|
|
397
|
-
function
|
|
398
|
-
const s = Me(),
|
|
398
|
+
function Kr({ room: n }) {
|
|
399
|
+
const s = Me(), l = ie(), r = Je(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, d = o > 0 ? n.slice(o + 1) : null, c = !!i && !!d && n !== s.globalRoom && i !== "dm" && i !== "ch", h = Rt(), { data: f } = Ce({
|
|
399
400
|
queryKey: ["nvr-chat-room-card", n],
|
|
400
401
|
queryFn: async () => {
|
|
401
402
|
var R, G, H, V;
|
|
@@ -428,7 +429,7 @@ function Qr({ room: n }) {
|
|
|
428
429
|
return /* @__PURE__ */ a(
|
|
429
430
|
"div",
|
|
430
431
|
{
|
|
431
|
-
className: g("flex shrink-0 items-center gap-2 border-b px-3 py-1.5",
|
|
432
|
+
className: g("flex shrink-0 items-center gap-2 border-b px-3 py-1.5", l.divider),
|
|
432
433
|
"data-chat-room-card": !0,
|
|
433
434
|
children: [
|
|
434
435
|
/* @__PURE__ */ e("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: f.type_label }),
|
|
@@ -479,7 +480,7 @@ function Qr({ room: n }) {
|
|
|
479
480
|
className: g(
|
|
480
481
|
"text-[11px] font-medium hover:underline",
|
|
481
482
|
u != null && u.owners.length ? "ml-1.5" : "ml-auto",
|
|
482
|
-
|
|
483
|
+
l.accentText
|
|
483
484
|
),
|
|
484
485
|
children: "Open"
|
|
485
486
|
}
|
|
@@ -488,40 +489,40 @@ function Qr({ room: n }) {
|
|
|
488
489
|
}
|
|
489
490
|
);
|
|
490
491
|
}
|
|
491
|
-
function
|
|
492
|
+
function Jr(n, s) {
|
|
492
493
|
if (!n) return null;
|
|
493
|
-
const
|
|
494
|
-
let
|
|
494
|
+
const l = Mt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
|
|
495
|
+
let o, i;
|
|
495
496
|
try {
|
|
496
497
|
const c = (h) => new Intl.DateTimeFormat("en-US", { timeZone: h, hour: "numeric", minute: "2-digit" }).format(
|
|
497
498
|
r
|
|
498
499
|
);
|
|
499
|
-
|
|
500
|
+
o = c(n), i = c(l);
|
|
500
501
|
} catch {
|
|
501
502
|
return null;
|
|
502
503
|
}
|
|
503
|
-
if (
|
|
504
|
+
if (o === i) return null;
|
|
504
505
|
const d = s.split(/\s+/)[0] || s;
|
|
505
|
-
return `${
|
|
506
|
+
return `${o} for ${d}`;
|
|
506
507
|
}
|
|
507
508
|
function ua() {
|
|
508
509
|
const [n, s] = T(0);
|
|
509
510
|
return ae(() => {
|
|
510
|
-
const
|
|
511
|
-
return () => clearInterval(
|
|
511
|
+
const l = setInterval(() => s((r) => r + 1), 6e4);
|
|
512
|
+
return () => clearInterval(l);
|
|
512
513
|
}, []), n;
|
|
513
514
|
}
|
|
514
|
-
function
|
|
515
|
+
function Yr({ peerId: n, name: s }) {
|
|
515
516
|
ua();
|
|
516
|
-
const { state:
|
|
517
|
-
const f = ia(
|
|
517
|
+
const { state: l, title: r } = ca(n), o = Bt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
|
|
518
|
+
const f = ia(o);
|
|
518
519
|
return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
|
|
519
|
-
})() : r, d =
|
|
520
|
+
})() : r, d = Jr((o == null ? void 0 : o.timezone) ?? null, s), c = da(o), h = c ? (o == null ? void 0 : o.delegate) ?? null : null;
|
|
520
521
|
return /* @__PURE__ */ a(
|
|
521
522
|
"p",
|
|
522
523
|
{
|
|
523
524
|
className: "flex min-w-0 items-center gap-1.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
524
|
-
"data-chat-dm-peer-line":
|
|
525
|
+
"data-chat-dm-peer-line": l,
|
|
525
526
|
children: [
|
|
526
527
|
c && /* @__PURE__ */ a(_e, { children: [
|
|
527
528
|
/* @__PURE__ */ e(
|
|
@@ -532,11 +533,11 @@ function Jr({ peerId: n, name: s }) {
|
|
|
532
533
|
children: c
|
|
533
534
|
}
|
|
534
535
|
),
|
|
535
|
-
h &&
|
|
536
|
+
h && ur() && /* @__PURE__ */ a(
|
|
536
537
|
"button",
|
|
537
538
|
{
|
|
538
539
|
type: "button",
|
|
539
|
-
onClick: () =>
|
|
540
|
+
onClick: () => mr(h.id, h.name),
|
|
540
541
|
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",
|
|
541
542
|
"data-chat-dm-delegate": h.id,
|
|
542
543
|
children: [
|
|
@@ -551,7 +552,7 @@ function Jr({ peerId: n, name: s }) {
|
|
|
551
552
|
/* @__PURE__ */ e("span", { className: "truncate", children: i }),
|
|
552
553
|
d && /* @__PURE__ */ a(_e, { children: [
|
|
553
554
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" }),
|
|
554
|
-
/* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (
|
|
555
|
+
/* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (o == null ? void 0 : o.timezone) ?? void 0, children: d })
|
|
555
556
|
] })
|
|
556
557
|
]
|
|
557
558
|
}
|
|
@@ -560,26 +561,26 @@ function Jr({ peerId: n, name: s }) {
|
|
|
560
561
|
function In({
|
|
561
562
|
room: n,
|
|
562
563
|
label: s,
|
|
563
|
-
onBack:
|
|
564
|
+
onBack: l,
|
|
564
565
|
onOpenSettings: r,
|
|
565
|
-
renderMessageBody:
|
|
566
|
+
renderMessageBody: o,
|
|
566
567
|
initialUnread: i,
|
|
567
568
|
anchor: d = null,
|
|
568
569
|
openThread: c = null
|
|
569
570
|
}) {
|
|
570
571
|
var pn, hn, fn, xn, gn, bn, vn, yn, kn, wn;
|
|
571
|
-
const h = Me(), f = ie(), u = Je(), p = h.me, b =
|
|
572
|
-
...
|
|
572
|
+
const h = Me(), f = ie(), u = Je(), p = h.me, b = Tr(n), U = p ? Ne(n, p.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Ce({
|
|
573
|
+
...Ss(u, U),
|
|
573
574
|
enabled: !!U && $,
|
|
574
575
|
staleTime: 12e4
|
|
575
576
|
}), S = $ && U ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : s, [W, M] = T(d);
|
|
576
577
|
ae(() => M(d), [d]);
|
|
577
|
-
const { messages: v, loading: B, hasOlder: R, hasNewer: G, loadOlder: H, loadingOlder: V } =
|
|
578
|
+
const { messages: v, loading: B, hasOlder: R, hasNewer: G, loadOlder: H, loadingOlder: V } = Ks(
|
|
578
579
|
n,
|
|
579
580
|
W
|
|
580
581
|
);
|
|
581
|
-
|
|
582
|
-
const se = ra(n), ee =
|
|
582
|
+
Js(n);
|
|
583
|
+
const se = ra(n), ee = Ys(), te = Zs(n), ge = Vs(n.startsWith("dm:") ? n : null), de = Xs(n), A = er(n), w = tr(n), P = nr(n), x = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== h.globalRoom && n.includes(":"), q = sa(n, x), ve = br(n, !!q), Se = n.startsWith("ch:"), { data: ue = [] } = Ce({
|
|
583
584
|
queryKey: ["chat-read-marks", n],
|
|
584
585
|
queryFn: () => u.request(
|
|
585
586
|
xe(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
|
|
@@ -615,7 +616,7 @@ function In({
|
|
|
615
616
|
);
|
|
616
617
|
},
|
|
617
618
|
onSuccess: () => {
|
|
618
|
-
q &&
|
|
619
|
+
q && _s(ye, q.collection, q.id), he.success("Task created from message — assigned to you");
|
|
619
620
|
},
|
|
620
621
|
onError: () => he.error("Could not create a task")
|
|
621
622
|
}), _ = Ee({
|
|
@@ -647,13 +648,13 @@ function In({
|
|
|
647
648
|
}), E = Ee({
|
|
648
649
|
mutationFn: (t) => u.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
|
|
649
650
|
onSuccess: () => void ye.invalidateQueries({ queryKey: ["nvr-chat", n] })
|
|
650
|
-
}), ne =
|
|
651
|
+
}), ne = ar(n), K = sr(n), { isAdmin: F } = ut(), { setMuted: J, setNotifyMode: fa, setArchived: xa, setStarred: ga, dismissWelcome: ba, leave: va } = Pt(), { rooms: ya, loading: ka } = ea(), Ft = ya.find((t) => t.room === n) ?? null, { rooms: wa } = ta(!ka && !Ft), y = Ft ?? wa.find((t) => t.room === n) ?? null, Na = ma(y), zt = y != null && y.muted ? "muted" : (y == null ? void 0 : y.notify_mode) === "mentions" ? "mentions" : "all", ce = rr(), [Xe, Ca] = T(!1), [et, Ht] = T(""), [_a, mt] = T(null), [Gt, Qt] = T(""), [Sa, pt] = T(null), Ta = Ur(n), [Ua, Kt] = T(null), [Jt, Yt] = T(null), [Zt, Le] = T(null), Vt = lr(c ? n : null, c), Xt = !!Vt.root && !Vt.root.deleted_at;
|
|
651
652
|
ae(() => {
|
|
652
653
|
c && Xt && Le(c);
|
|
653
654
|
}, [c, Xt]);
|
|
654
655
|
const [Da, en] = T(null), [$a, tn] = T(null), [ht, We] = T(!1), [Ra, ft] = T(!1), [le, Fe] = T(null), [ze, tt] = T(
|
|
655
656
|
d && "around" in d ? d.around : null
|
|
656
|
-
), [nt, xt] = T(null), He =
|
|
657
|
+
), [nt, xt] = T(null), He = As(n, (p == null ? void 0 : p.id) ?? null), nn = oe(null), gt = oe(null), bt = oe(Math.max(0, i ?? 0)), Ue = oe(!1), Re = oe(null), an = oe(null), re = oe(!d), Ge = oe(0), Qe = oe(null), vt = oe(0), at = () => {
|
|
657
658
|
const t = Re.current;
|
|
658
659
|
t && (t.scrollTop = t.scrollHeight);
|
|
659
660
|
}, yt = (t) => {
|
|
@@ -754,7 +755,7 @@ function In({
|
|
|
754
755
|
for (let m = we.length - 1; m >= 0; m--)
|
|
755
756
|
if (((t = we[m].sender) == null ? void 0 : t.toLowerCase()) === Pe) return m;
|
|
756
757
|
return -1;
|
|
757
|
-
}, [we, Pe, me]), rn = ge ? new Date(ge).getTime() : 0, Ie = Lt().chat_density === "compact" ? "compact" : "comfortable", ln = oe(null), Oa = fe(() => we.map((t) => t.id), [we]), be =
|
|
758
|
+
}, [we, Pe, me]), rn = ge ? new Date(ge).getTime() : 0, Ie = Lt().chat_density === "compact" ? "compact" : "comfortable", ln = oe(null), Oa = fe(() => we.map((t) => t.id), [we]), be = yr({
|
|
758
759
|
scrollerRef: Re,
|
|
759
760
|
listRef: ln,
|
|
760
761
|
ids: Oa,
|
|
@@ -763,8 +764,8 @@ function In({
|
|
|
763
764
|
pinnedRef: re
|
|
764
765
|
}), z = (y == null ? void 0 : y.channel) ?? null, on = !!z && !!p && String(z.created_by ?? "").toUpperCase() === p.id.toUpperCase(), cn = z != null && z.announce && !on && !F ? z.id === Xn ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, dn = p ? Ne(n, p.id) : null, La = Bt(dn);
|
|
765
766
|
ua();
|
|
766
|
-
const Pa = dn ?
|
|
767
|
-
|
|
767
|
+
const Pa = dn ? vr(La, S, /* @__PURE__ */ new Date()) : null;
|
|
768
|
+
or(), fr();
|
|
768
769
|
const Ia = !!(z != null && z.welcome_note) && !!(y != null && y.joined) && !(y != null && y.welcome_seen_at) && !z.is_direct, ja = (t, m) => t.entity ? /* @__PURE__ */ e(Pn, { token: t.text, url: h.entityUrl(t.entity) }, m) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), qa = (t, m) => t.entity ? /* @__PURE__ */ e(Pn, { token: t.text, url: h.entityUrl(t.entity), mine: !0 }, m) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), un = (t, m = {}) => {
|
|
769
770
|
var Nn, Cn;
|
|
770
771
|
const N = ((Nn = t.sender) == null ? void 0 : Nn.toLowerCase()) === Pe;
|
|
@@ -838,7 +839,7 @@ function In({
|
|
|
838
839
|
),
|
|
839
840
|
"data-chat-msg-actions": !0,
|
|
840
841
|
children: [
|
|
841
|
-
|
|
842
|
+
pr.map((D) => /* @__PURE__ */ e(
|
|
842
843
|
"button",
|
|
843
844
|
{
|
|
844
845
|
type: "button",
|
|
@@ -850,7 +851,7 @@ function In({
|
|
|
850
851
|
D
|
|
851
852
|
)),
|
|
852
853
|
/* @__PURE__ */ e(
|
|
853
|
-
|
|
854
|
+
xr,
|
|
854
855
|
{
|
|
855
856
|
label: "More reactions",
|
|
856
857
|
className: qe,
|
|
@@ -965,10 +966,10 @@ function In({
|
|
|
965
966
|
}
|
|
966
967
|
)),
|
|
967
968
|
/* @__PURE__ */ e(
|
|
968
|
-
|
|
969
|
+
Dr,
|
|
969
970
|
{
|
|
970
971
|
messageId: t.id,
|
|
971
|
-
actions:
|
|
972
|
+
actions: $r(Ta, t, Pe),
|
|
972
973
|
navigate: h.navigate,
|
|
973
974
|
onOpenChange: (D) => Kt(D ? t.id : null)
|
|
974
975
|
}
|
|
@@ -1052,8 +1053,8 @@ function In({
|
|
|
1052
1053
|
]
|
|
1053
1054
|
}
|
|
1054
1055
|
),
|
|
1055
|
-
t.message && Rn(t.message) && (
|
|
1056
|
-
|
|
1056
|
+
t.message && Rn(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
|
|
1057
|
+
Rr,
|
|
1057
1058
|
{
|
|
1058
1059
|
text: Rn(t.message),
|
|
1059
1060
|
mine: N,
|
|
@@ -1064,23 +1065,23 @@ function In({
|
|
|
1064
1065
|
}
|
|
1065
1066
|
)),
|
|
1066
1067
|
An(t.message) != null && /* @__PURE__ */ e(
|
|
1067
|
-
|
|
1068
|
+
Nr,
|
|
1068
1069
|
{
|
|
1069
1070
|
id: An(t.message),
|
|
1070
1071
|
mine: N,
|
|
1071
1072
|
renderAvatar: (D, O) => /* @__PURE__ */ e(Z, { id: D, name: O, size: 18, presence: !1 })
|
|
1072
1073
|
}
|
|
1073
1074
|
),
|
|
1074
|
-
t.poll && /* @__PURE__ */ e(
|
|
1075
|
+
t.poll && /* @__PURE__ */ e(Mr, { poll: t.poll, room: t.room, mine: N }),
|
|
1075
1076
|
(t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: g("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((D) => {
|
|
1076
|
-
const O = kt == null ? void 0 : kt.get(D), rt = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", wt = u.fileUrl(D), Ea = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), lt =
|
|
1077
|
+
const O = kt == null ? void 0 : kt.get(D), rt = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", wt = u.fileUrl(D), Ea = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), lt = Br(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), _n = () => Yt({
|
|
1077
1078
|
id: D,
|
|
1078
1079
|
url: wt,
|
|
1079
1080
|
name: rt,
|
|
1080
1081
|
type: (O == null ? void 0 : O.type) ?? null,
|
|
1081
1082
|
size: (O == null ? void 0 : O.filesize) ?? null
|
|
1082
1083
|
}), ot = q && ve.length > 0 ? /* @__PURE__ */ e(
|
|
1083
|
-
|
|
1084
|
+
Vr,
|
|
1084
1085
|
{
|
|
1085
1086
|
targets: ve,
|
|
1086
1087
|
recordLabel: q.label,
|
|
@@ -1088,7 +1089,7 @@ function In({
|
|
|
1088
1089
|
}
|
|
1089
1090
|
) : null;
|
|
1090
1091
|
return lt ? /* @__PURE__ */ e(
|
|
1091
|
-
|
|
1092
|
+
Wr,
|
|
1092
1093
|
{
|
|
1093
1094
|
url: wt,
|
|
1094
1095
|
poster: lt.poster ? u.fileUrl(lt.poster) : null,
|
|
@@ -1139,7 +1140,7 @@ function In({
|
|
|
1139
1140
|
}
|
|
1140
1141
|
),
|
|
1141
1142
|
!Y && !De && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
|
|
1142
|
-
|
|
1143
|
+
Ar,
|
|
1143
1144
|
{
|
|
1144
1145
|
text: t.message,
|
|
1145
1146
|
navigate: h.navigate,
|
|
@@ -1162,7 +1163,7 @@ function In({
|
|
|
1162
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"
|
|
1163
1164
|
),
|
|
1164
1165
|
children: [
|
|
1165
|
-
/* @__PURE__ */ e(
|
|
1166
|
+
/* @__PURE__ */ e(gr, { value: D }),
|
|
1166
1167
|
/* @__PURE__ */ e("span", { className: "tabular-nums", children: O.count })
|
|
1167
1168
|
]
|
|
1168
1169
|
},
|
|
@@ -1219,7 +1220,7 @@ function In({
|
|
|
1219
1220
|
var O;
|
|
1220
1221
|
const D = Oe(t);
|
|
1221
1222
|
return D.length === 0 ? null : /* @__PURE__ */ e(
|
|
1222
|
-
|
|
1223
|
+
tl,
|
|
1223
1224
|
{
|
|
1224
1225
|
seen: D,
|
|
1225
1226
|
channelId: ((O = y == null ? void 0 : y.channel) == null ? void 0 : O.id) ?? null,
|
|
@@ -1240,7 +1241,7 @@ function In({
|
|
|
1240
1241
|
}
|
|
1241
1242
|
);
|
|
1242
1243
|
}, mn = (t) => /* @__PURE__ */ e(
|
|
1243
|
-
|
|
1244
|
+
Fs,
|
|
1244
1245
|
{
|
|
1245
1246
|
ref: t ? void 0 : nn,
|
|
1246
1247
|
room: n,
|
|
@@ -1284,18 +1285,18 @@ function In({
|
|
|
1284
1285
|
"button",
|
|
1285
1286
|
{
|
|
1286
1287
|
type: "button",
|
|
1287
|
-
onClick:
|
|
1288
|
+
onClick: l,
|
|
1288
1289
|
className: "rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
1289
1290
|
"aria-label": "Back to conversations",
|
|
1290
1291
|
children: /* @__PURE__ */ e(ct, { className: "h-4 w-4", strokeWidth: 2 })
|
|
1291
1292
|
}
|
|
1292
1293
|
),
|
|
1293
1294
|
((y == null ? void 0 : y.kind) === "channel" && !((fn = y.channel) != null && fn.is_direct) || (y == null ? void 0 : y.kind) === "global" && (((xn = y.channel) == null ? void 0 : xn.icon) || ((gn = y.channel) == null ? void 0 : gn.color))) && /* @__PURE__ */ e(Ke, { icon: (bn = y == null ? void 0 : y.channel) == null ? void 0 : bn.icon, color: (vn = y == null ? void 0 : y.channel) == null ? void 0 : vn.color, size: 24 }),
|
|
1294
|
-
p && Ne(n, p.id) && /* @__PURE__ */ e(
|
|
1295
|
+
p && Ne(n, p.id) && /* @__PURE__ */ e(Hr, { peerId: Ne(n, p.id), name: S }),
|
|
1295
1296
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1296
1297
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
1297
1298
|
/* @__PURE__ */ e("span", { className: "truncate", children: S }),
|
|
1298
|
-
y && /* @__PURE__ */ e(
|
|
1299
|
+
y && /* @__PURE__ */ e(Or, { starred: !!y.starred, notify: zt }),
|
|
1299
1300
|
(z == null ? void 0 : z.announce) && /* @__PURE__ */ e(
|
|
1300
1301
|
"span",
|
|
1301
1302
|
{
|
|
@@ -1305,8 +1306,8 @@ function In({
|
|
|
1305
1306
|
}
|
|
1306
1307
|
)
|
|
1307
1308
|
] }),
|
|
1308
|
-
p && Ne(n, p.id) ? /* @__PURE__ */ e(
|
|
1309
|
-
|
|
1309
|
+
p && Ne(n, p.id) ? /* @__PURE__ */ e(Yr, { peerId: Ne(n, p.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
|
|
1310
|
+
Pr,
|
|
1310
1311
|
{
|
|
1311
1312
|
room: n,
|
|
1312
1313
|
me: ((yn = h.me) == null ? void 0 : yn.id) ?? null,
|
|
@@ -1315,7 +1316,7 @@ function In({
|
|
|
1315
1316
|
) : null
|
|
1316
1317
|
] }),
|
|
1317
1318
|
/* @__PURE__ */ e(
|
|
1318
|
-
|
|
1319
|
+
kr,
|
|
1319
1320
|
{
|
|
1320
1321
|
room: n,
|
|
1321
1322
|
roomLabel: S,
|
|
@@ -1337,7 +1338,7 @@ function In({
|
|
|
1337
1338
|
children: /* @__PURE__ */ e(Wn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1338
1339
|
}
|
|
1339
1340
|
),
|
|
1340
|
-
((kn = y == null ? void 0 : y.channel) == null ? void 0 : kn.is_direct) && /* @__PURE__ */ e(
|
|
1341
|
+
((kn = y == null ? void 0 : y.channel) == null ? void 0 : kn.is_direct) && /* @__PURE__ */ e(nl, { channel: y.channel, onLeft: l }),
|
|
1341
1342
|
/* @__PURE__ */ e(
|
|
1342
1343
|
"button",
|
|
1343
1344
|
{
|
|
@@ -1354,11 +1355,11 @@ function In({
|
|
|
1354
1355
|
}
|
|
1355
1356
|
),
|
|
1356
1357
|
/* @__PURE__ */ e(
|
|
1357
|
-
|
|
1358
|
+
Lr,
|
|
1358
1359
|
{
|
|
1359
1360
|
th: f,
|
|
1360
1361
|
huddleSchedule: b.enabled ? (t) => /* @__PURE__ */ e(
|
|
1361
|
-
|
|
1362
|
+
Cr,
|
|
1362
1363
|
{
|
|
1363
1364
|
room: n,
|
|
1364
1365
|
me: (p == null ? void 0 : p.id) ?? null,
|
|
@@ -1421,7 +1422,7 @@ function In({
|
|
|
1421
1422
|
{
|
|
1422
1423
|
description: "Find it under the Archived tab."
|
|
1423
1424
|
}
|
|
1424
|
-
),
|
|
1425
|
+
), l());
|
|
1425
1426
|
}
|
|
1426
1427
|
}
|
|
1427
1428
|
) : void 0,
|
|
@@ -1429,15 +1430,15 @@ function In({
|
|
|
1429
1430
|
onSuccess: () => {
|
|
1430
1431
|
he.success(`Left ${y.label}`, {
|
|
1431
1432
|
description: "Open the record's chat again to rejoin."
|
|
1432
|
-
}),
|
|
1433
|
+
}), l();
|
|
1433
1434
|
}
|
|
1434
1435
|
}) : void 0,
|
|
1435
|
-
tips: /* @__PURE__ */ e(
|
|
1436
|
+
tips: /* @__PURE__ */ e(Qr, { botName: ce })
|
|
1436
1437
|
}
|
|
1437
1438
|
)
|
|
1438
1439
|
] }),
|
|
1439
1440
|
/* @__PURE__ */ e(
|
|
1440
|
-
|
|
1441
|
+
_r,
|
|
1441
1442
|
{
|
|
1442
1443
|
room: n,
|
|
1443
1444
|
me: p,
|
|
@@ -1456,9 +1457,9 @@ function In({
|
|
|
1456
1457
|
"aria-label": "Search messages"
|
|
1457
1458
|
}
|
|
1458
1459
|
) }),
|
|
1459
|
-
/* @__PURE__ */ e(
|
|
1460
|
+
/* @__PURE__ */ e(Kr, { room: n }),
|
|
1460
1461
|
z && !z.is_direct && /* @__PURE__ */ e(
|
|
1461
|
-
|
|
1462
|
+
Ir,
|
|
1462
1463
|
{
|
|
1463
1464
|
description: z.description,
|
|
1464
1465
|
links: z.links,
|
|
@@ -1483,7 +1484,7 @@ function In({
|
|
|
1483
1484
|
}
|
|
1484
1485
|
) }),
|
|
1485
1486
|
(z == null ? void 0 : z.archive_suggested_at) && z.id !== 0 && (on || F) && /* @__PURE__ */ e(
|
|
1486
|
-
|
|
1487
|
+
Ls,
|
|
1487
1488
|
{
|
|
1488
1489
|
channelId: z.id,
|
|
1489
1490
|
channelName: S,
|
|
@@ -1491,7 +1492,7 @@ function In({
|
|
|
1491
1492
|
}
|
|
1492
1493
|
),
|
|
1493
1494
|
Ia && (z == null ? void 0 : z.welcome_note) && /* @__PURE__ */ e(
|
|
1494
|
-
|
|
1495
|
+
jr,
|
|
1495
1496
|
{
|
|
1496
1497
|
note: z.welcome_note,
|
|
1497
1498
|
channelName: S,
|
|
@@ -1549,7 +1550,7 @@ function In({
|
|
|
1549
1550
|
children: [
|
|
1550
1551
|
Y && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
|
|
1551
1552
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
|
|
1552
|
-
/* @__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: Gr(t.date_created) }),
|
|
1553
1554
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
|
|
1554
1555
|
] }),
|
|
1555
1556
|
Ae && /* @__PURE__ */ a(
|
|
@@ -1589,7 +1590,7 @@ function In({
|
|
|
1589
1590
|
),
|
|
1590
1591
|
!me && !G && /* @__PURE__ */ e(la, { items: se, th: f }),
|
|
1591
1592
|
!me && !G && He.live && ce && /* @__PURE__ */ e(
|
|
1592
|
-
|
|
1593
|
+
Ms,
|
|
1593
1594
|
{
|
|
1594
1595
|
live: He.live,
|
|
1595
1596
|
botName: ce,
|
|
@@ -1637,10 +1638,10 @@ function In({
|
|
|
1637
1638
|
]
|
|
1638
1639
|
}
|
|
1639
1640
|
) : te.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: te.typingText }) }),
|
|
1640
|
-
Jt && /* @__PURE__ */ e(
|
|
1641
|
+
Jt && /* @__PURE__ */ e(Ds, { file: Jt, onClose: () => Yt(null) }),
|
|
1641
1642
|
mn(null),
|
|
1642
1643
|
Zt != null && /* @__PURE__ */ e(
|
|
1643
|
-
|
|
1644
|
+
qr,
|
|
1644
1645
|
{
|
|
1645
1646
|
room: n,
|
|
1646
1647
|
rootId: Zt,
|
|
@@ -1648,11 +1649,11 @@ function In({
|
|
|
1648
1649
|
onClose: () => Le(null),
|
|
1649
1650
|
renderRow: (t) => un(t, { inThread: !0 }),
|
|
1650
1651
|
renderComposer: (t) => mn(t),
|
|
1651
|
-
renderOutbox: (t) => /* @__PURE__ */ e(
|
|
1652
|
+
renderOutbox: (t) => /* @__PURE__ */ e(Zr, { room: n, parentId: t, th: f })
|
|
1652
1653
|
}
|
|
1653
1654
|
),
|
|
1654
1655
|
ht && /* @__PURE__ */ e(
|
|
1655
|
-
|
|
1656
|
+
Er,
|
|
1656
1657
|
{
|
|
1657
1658
|
room: n,
|
|
1658
1659
|
label: S,
|
|
@@ -1669,17 +1670,17 @@ function In({
|
|
|
1669
1670
|
}
|
|
1670
1671
|
);
|
|
1671
1672
|
}
|
|
1672
|
-
function
|
|
1673
|
+
function Zr({ room: n, parentId: s, th: l }) {
|
|
1673
1674
|
const r = ra(n, s);
|
|
1674
|
-
return /* @__PURE__ */ e(la, { items: r, th:
|
|
1675
|
+
return /* @__PURE__ */ e(la, { items: r, th: l });
|
|
1675
1676
|
}
|
|
1676
|
-
function
|
|
1677
|
+
function Vr({
|
|
1677
1678
|
targets: n,
|
|
1678
1679
|
recordLabel: s,
|
|
1679
|
-
onPick:
|
|
1680
|
+
onPick: l
|
|
1680
1681
|
}) {
|
|
1681
|
-
const [r,
|
|
1682
|
-
return /* @__PURE__ */ a(Ye, { open: r, onOpenChange:
|
|
1682
|
+
const [r, o] = T(!1);
|
|
1683
|
+
return /* @__PURE__ */ a(Ye, { open: r, onOpenChange: o, children: [
|
|
1683
1684
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1684
1685
|
"button",
|
|
1685
1686
|
{
|
|
@@ -1701,7 +1702,7 @@ function Zr({
|
|
|
1701
1702
|
{
|
|
1702
1703
|
type: "button",
|
|
1703
1704
|
onClick: () => {
|
|
1704
|
-
|
|
1705
|
+
o(!1), l(i.field);
|
|
1705
1706
|
},
|
|
1706
1707
|
className: "flex w-full rounded-md px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
1707
1708
|
children: i.label
|
|
@@ -1722,31 +1723,31 @@ function jn(n) {
|
|
|
1722
1723
|
color: n.color ?? null
|
|
1723
1724
|
};
|
|
1724
1725
|
}
|
|
1725
|
-
const
|
|
1726
|
+
const Xr = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1726
1727
|
function Dt(n) {
|
|
1727
1728
|
const s = typeof n.idle_minutes == "number" ? n.idle_minutes : n.last_active ? Math.floor((Date.now() - new Date(n.last_active).getTime()) / 6e4) : null;
|
|
1728
1729
|
return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
|
|
1729
1730
|
}
|
|
1730
1731
|
function qn(n) {
|
|
1731
1732
|
const s = n == null ? void 0 : n.trim();
|
|
1732
|
-
return !s ||
|
|
1733
|
+
return !s || Xr.test(s) ? null : s;
|
|
1733
1734
|
}
|
|
1734
|
-
function
|
|
1735
|
-
const s = new Date(n),
|
|
1736
|
-
return s.toDateString() ===
|
|
1735
|
+
function el(n) {
|
|
1736
|
+
const s = new Date(n), l = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
1737
|
+
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}`;
|
|
1737
1738
|
}
|
|
1738
|
-
function
|
|
1739
|
+
function tl({
|
|
1739
1740
|
seen: n,
|
|
1740
1741
|
channelId: s,
|
|
1741
|
-
senderId:
|
|
1742
|
+
senderId: l
|
|
1742
1743
|
}) {
|
|
1743
|
-
const r = ie(), [
|
|
1744
|
+
const r = ie(), [o, i] = T(!1), { members: d } = It(o ? s : null), c = new Set(n.map((u) => String(u.user).toUpperCase())), h = d.filter((u) => {
|
|
1744
1745
|
const p = String(u.user).toUpperCase();
|
|
1745
|
-
return p !==
|
|
1746
|
+
return p !== l.toUpperCase() && !c.has(p);
|
|
1746
1747
|
}), f = [...n].sort(
|
|
1747
1748
|
(u, p) => new Date(u.last_read_at).getTime() - new Date(p.last_read_at).getTime()
|
|
1748
1749
|
);
|
|
1749
|
-
return /* @__PURE__ */ a(Ye, { open:
|
|
1750
|
+
return /* @__PURE__ */ a(Ye, { open: o, onOpenChange: i, children: [
|
|
1750
1751
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1751
1752
|
"button",
|
|
1752
1753
|
{
|
|
@@ -1784,7 +1785,7 @@ function el({
|
|
|
1784
1785
|
{
|
|
1785
1786
|
className: "shrink-0 text-[10.5px] tabular-nums text-slate-400",
|
|
1786
1787
|
"data-tip": `Last read the conversation ${new Date(u.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
|
|
1787
|
-
children:
|
|
1788
|
+
children: el(u.last_read_at)
|
|
1788
1789
|
}
|
|
1789
1790
|
)
|
|
1790
1791
|
] }, u.user)),
|
|
@@ -1808,9 +1809,9 @@ function el({
|
|
|
1808
1809
|
)
|
|
1809
1810
|
] });
|
|
1810
1811
|
}
|
|
1811
|
-
function
|
|
1812
|
+
function nl({ channel: n, onLeft: s }) {
|
|
1812
1813
|
var B;
|
|
1813
|
-
const
|
|
1814
|
+
const l = ie(), r = Me(), { isAdmin: o } = ut(), [i, d] = T(!1), { members: c, loading: h } = It(n.id), { addMember: f, removeMember: u } = Vn(n.id), [p, b] = T(""), U = Wt(p, 250), $ = ((B = r.me) == null ? void 0 : B.id.toUpperCase()) ?? "", C = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: S } = jt(U, i && C && !!p.trim()), W = new Set(c.map((R) => String(R.user).toUpperCase())), M = (R) => [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.user, v = [...c].sort((R, G) => {
|
|
1814
1815
|
const H = String(R.user).toUpperCase(), V = String(G.user).toUpperCase();
|
|
1815
1816
|
return H === $ ? -1 : V === $ ? 1 : M(R).localeCompare(M(G));
|
|
1816
1817
|
});
|
|
@@ -1823,7 +1824,7 @@ function tl({ channel: n, onLeft: s }) {
|
|
|
1823
1824
|
"aria-label": "People in this conversation",
|
|
1824
1825
|
className: g(
|
|
1825
1826
|
"flex items-center gap-1 rounded-md px-1 py-1 text-[11px] font-medium tabular-nums transition-colors",
|
|
1826
|
-
i ?
|
|
1827
|
+
i ? l.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
|
|
1827
1828
|
),
|
|
1828
1829
|
"data-chat-group-members": !0,
|
|
1829
1830
|
children: [
|
|
@@ -1837,10 +1838,10 @@ function tl({ channel: n, onLeft: s }) {
|
|
|
1837
1838
|
{
|
|
1838
1839
|
align: "end",
|
|
1839
1840
|
sideOffset: 6,
|
|
1840
|
-
className: g("w-[260px] p-0",
|
|
1841
|
+
className: g("w-[260px] p-0", l.surface),
|
|
1841
1842
|
"data-chat-group-members-panel": !0,
|
|
1842
1843
|
children: [
|
|
1843
|
-
/* @__PURE__ */ e("div", { className: g("border-b px-3 py-2",
|
|
1844
|
+
/* @__PURE__ */ e("div", { className: g("border-b px-3 py-2", l.divider), children: /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
|
|
1844
1845
|
"In this conversation ",
|
|
1845
1846
|
c.length > 0 && `· ${c.length}`
|
|
1846
1847
|
] }) }),
|
|
@@ -1879,14 +1880,14 @@ function tl({ channel: n, onLeft: s }) {
|
|
|
1879
1880
|
);
|
|
1880
1881
|
})
|
|
1881
1882
|
] }),
|
|
1882
|
-
C && /* @__PURE__ */ a("div", { className: g("border-t px-3 py-2",
|
|
1883
|
+
C && /* @__PURE__ */ a("div", { className: g("border-t px-3 py-2", l.divider), children: [
|
|
1883
1884
|
/* @__PURE__ */ e(
|
|
1884
1885
|
"input",
|
|
1885
1886
|
{
|
|
1886
1887
|
value: p,
|
|
1887
1888
|
onChange: (R) => b(R.target.value),
|
|
1888
1889
|
placeholder: "Add someone…",
|
|
1889
|
-
className: g("h-7 w-full rounded-md px-2 text-[12px] outline-none",
|
|
1890
|
+
className: g("h-7 w-full rounded-md px-2 text-[12px] outline-none", l.input),
|
|
1890
1891
|
"data-chat-group-add": !0
|
|
1891
1892
|
}
|
|
1892
1893
|
),
|
|
@@ -1909,7 +1910,7 @@ function tl({ channel: n, onLeft: s }) {
|
|
|
1909
1910
|
);
|
|
1910
1911
|
}) })
|
|
1911
1912
|
] }),
|
|
1912
|
-
$ && W.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5",
|
|
1913
|
+
$ && W.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
|
|
1913
1914
|
"button",
|
|
1914
1915
|
{
|
|
1915
1916
|
type: "button",
|
|
@@ -1930,22 +1931,22 @@ function tl({ channel: n, onLeft: s }) {
|
|
|
1930
1931
|
)
|
|
1931
1932
|
] });
|
|
1932
1933
|
}
|
|
1933
|
-
function
|
|
1934
|
+
function al({
|
|
1934
1935
|
channel: n,
|
|
1935
1936
|
label: s,
|
|
1936
|
-
onBack:
|
|
1937
|
+
onBack: l
|
|
1937
1938
|
}) {
|
|
1938
|
-
const r = ie(),
|
|
1939
|
+
const r = ie(), o = Me(), { isAdmin: i } = ut(), d = Zn(), { members: c, loading: h } = It(n.id), { update: f, addMember: u, removeMember: p } = Vn(n.id), [b, U] = T(s), [$, C] = T(n.topic ?? ""), [S, W] = T(n.visibility), [M, v] = T(n.role ?? ""), [B, R] = T({
|
|
1939
1940
|
icon: n.icon ?? null,
|
|
1940
1941
|
color: n.color ?? null
|
|
1941
|
-
}), [G, H] = T(""), V = Wt(G, 250), { users: se } = jt(V, S === "private"), ee = n.id === Xn, te = i || !ee && !!
|
|
1942
|
+
}), [G, H] = T(""), V = Wt(G, 250), { users: se } = jt(V, S === "private"), ee = n.id === Xn, te = i || !ee && !!o.me && String(n.created_by ?? "") === String(o.me.id), ge = new Set(c.map((A) => String(A.user).toUpperCase())), de = b !== s || $ !== (n.topic ?? "") || S !== n.visibility || B.icon !== (n.icon ?? null) || B.color !== (n.color ?? null) || S === "role" && M !== (n.role ?? "");
|
|
1942
1943
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
|
|
1943
1944
|
/* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
|
|
1944
1945
|
/* @__PURE__ */ e(
|
|
1945
1946
|
"button",
|
|
1946
1947
|
{
|
|
1947
1948
|
type: "button",
|
|
1948
|
-
onClick:
|
|
1949
|
+
onClick: l,
|
|
1949
1950
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
1950
1951
|
"aria-label": "Back to conversation",
|
|
1951
1952
|
children: /* @__PURE__ */ e(ct, { className: "h-4 w-4" })
|
|
@@ -2059,7 +2060,7 @@ function nl({
|
|
|
2059
2060
|
)
|
|
2060
2061
|
] }),
|
|
2061
2062
|
f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: f.error.message }),
|
|
2062
|
-
!n.is_direct && /* @__PURE__ */ e(
|
|
2063
|
+
!n.is_direct && /* @__PURE__ */ e(Ps, { channel: n, th: r, isAdmin: i })
|
|
2063
2064
|
] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
|
|
2064
2065
|
n.topic || "No topic set.",
|
|
2065
2066
|
/* @__PURE__ */ e("br", {}),
|
|
@@ -2118,19 +2119,19 @@ function nl({
|
|
|
2118
2119
|
}) }),
|
|
2119
2120
|
/* @__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." })
|
|
2120
2121
|
] }),
|
|
2121
|
-
te && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(
|
|
2122
|
+
te && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Is, { channelId: n.id, th: r }) })
|
|
2122
2123
|
] }),
|
|
2123
|
-
te && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(
|
|
2124
|
-
!n.is_direct && /* @__PURE__ */ e(
|
|
2124
|
+
te && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Os, { channelId: n.id, border: r.divider }),
|
|
2125
|
+
!n.is_direct && /* @__PURE__ */ e(js, { channelId: n.id, th: r })
|
|
2125
2126
|
] })
|
|
2126
2127
|
] });
|
|
2127
2128
|
}
|
|
2128
2129
|
function Wt(n, s) {
|
|
2129
|
-
const [
|
|
2130
|
+
const [l, r] = T(n);
|
|
2130
2131
|
return ae(() => {
|
|
2131
|
-
const
|
|
2132
|
-
return () => clearTimeout(
|
|
2133
|
-
}, [n, s]),
|
|
2132
|
+
const o = setTimeout(() => r(n), s);
|
|
2133
|
+
return () => clearTimeout(o);
|
|
2134
|
+
}, [n, s]), l;
|
|
2134
2135
|
}
|
|
2135
2136
|
function ma(n) {
|
|
2136
2137
|
var s;
|
|
@@ -2145,22 +2146,22 @@ function En(n) {
|
|
|
2145
2146
|
var s;
|
|
2146
2147
|
return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
|
|
2147
2148
|
}
|
|
2148
|
-
function
|
|
2149
|
-
const
|
|
2150
|
-
return s === "alpha" ?
|
|
2149
|
+
function sl(n, s) {
|
|
2150
|
+
const l = (i, d) => i.label.localeCompare(d.label), r = (i, d) => En(d) - En(i) || l(i, d), o = [...n];
|
|
2151
|
+
return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, d) => +(d.unread > 0) - +(i.unread > 0) || r(i, d)) : o.sort(r);
|
|
2151
2152
|
}
|
|
2152
|
-
function
|
|
2153
|
+
function rl({
|
|
2153
2154
|
value: n,
|
|
2154
2155
|
onChange: s
|
|
2155
2156
|
}) {
|
|
2156
|
-
const [
|
|
2157
|
-
return /* @__PURE__ */ a(Ye, { open:
|
|
2157
|
+
const [l, r] = T(!1), o = Nt.find((i) => i.value === n) ?? Nt[0];
|
|
2158
|
+
return /* @__PURE__ */ a(Ye, { open: l, onOpenChange: r, children: [
|
|
2158
2159
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2159
2160
|
"button",
|
|
2160
2161
|
{
|
|
2161
2162
|
type: "button",
|
|
2162
|
-
title: `Sort: ${
|
|
2163
|
-
"aria-label": `Sort rooms: ${
|
|
2163
|
+
title: `Sort: ${o.label}`,
|
|
2164
|
+
"aria-label": `Sort rooms: ${o.label}`,
|
|
2164
2165
|
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",
|
|
2165
2166
|
"data-chat-sort": n,
|
|
2166
2167
|
children: /* @__PURE__ */ e(ss, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
@@ -2190,12 +2191,12 @@ function sl({
|
|
|
2190
2191
|
function Bn({
|
|
2191
2192
|
rooms: n,
|
|
2192
2193
|
onOpen: s,
|
|
2193
|
-
onNewGroup:
|
|
2194
|
+
onNewGroup: l,
|
|
2194
2195
|
archivedView: r = !1,
|
|
2195
|
-
loading:
|
|
2196
|
+
loading: o = !1,
|
|
2196
2197
|
onView: i
|
|
2197
2198
|
}) {
|
|
2198
|
-
const d = ie(), c = Me(), { setMuted: h, leave: f, setArchived: u, setStarred: p } = Pt(), b =
|
|
2199
|
+
const d = ie(), c = Me(), { setMuted: h, leave: f, setArchived: u, setStarred: p } = Pt(), b = qs(), U = fe(
|
|
2199
2200
|
() => new Map(
|
|
2200
2201
|
c.onlineUsers.map((w) => [
|
|
2201
2202
|
String(w.user_id).toUpperCase(),
|
|
@@ -2203,11 +2204,11 @@ function Bn({
|
|
|
2203
2204
|
])
|
|
2204
2205
|
),
|
|
2205
2206
|
[c.onlineUsers]
|
|
2206
|
-
), $ = qt(), C =
|
|
2207
|
+
), $ = qt(), C = Sr(), [S, W] = T(""), M = Wt(S.trim(), 250), { hits: v, loading: B } = Qs(M, b.filters), R = M.length >= 2 || b.active, G = fe(() => {
|
|
2207
2208
|
const w = /* @__PURE__ */ new Map();
|
|
2208
2209
|
for (const P of v) w.set(P.room, [...w.get(P.room) ?? [], P]);
|
|
2209
2210
|
return [...w.entries()].sort((P, x) => x[1].length - P[1].length);
|
|
2210
|
-
}, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V =
|
|
2211
|
+
}, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V = hr(), se = fe(() => new Map(n.map((w) => [w.room, w])), [n]), ee = Lt(), te = Yn(), ge = ee.chat_sidebar_sort === "unread" || ee.chat_sidebar_sort === "alpha" ? ee.chat_sidebar_sort : "recent", de = sl(
|
|
2211
2212
|
M ? n.filter((w) => w.label.toLowerCase().includes(M.toLowerCase())) : n,
|
|
2212
2213
|
ge
|
|
2213
2214
|
), A = (w) => {
|
|
@@ -2230,20 +2231,20 @@ function Bn({
|
|
|
2230
2231
|
"data-chat-global-search": !0
|
|
2231
2232
|
}
|
|
2232
2233
|
),
|
|
2233
|
-
!r && /* @__PURE__ */ e(
|
|
2234
|
+
!r && /* @__PURE__ */ e(Es, { open: b.open, active: b.active, onClick: () => b.setOpen(!b.open) }),
|
|
2234
2235
|
/* @__PURE__ */ e(
|
|
2235
|
-
|
|
2236
|
+
rl,
|
|
2236
2237
|
{
|
|
2237
2238
|
value: ge,
|
|
2238
2239
|
onChange: (w) => te.mutate({ chat_sidebar_sort: w === "recent" ? null : w })
|
|
2239
2240
|
}
|
|
2240
2241
|
),
|
|
2241
|
-
!r && /* @__PURE__ */ e(
|
|
2242
|
-
|
|
2242
|
+
!r && /* @__PURE__ */ e(Bs, {}),
|
|
2243
|
+
l && /* @__PURE__ */ e(
|
|
2243
2244
|
"button",
|
|
2244
2245
|
{
|
|
2245
2246
|
type: "button",
|
|
2246
|
-
onClick:
|
|
2247
|
+
onClick: l,
|
|
2247
2248
|
title: "New group conversation",
|
|
2248
2249
|
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",
|
|
2249
2250
|
"data-chat-new-group": !0,
|
|
@@ -2251,7 +2252,7 @@ function Bn({
|
|
|
2251
2252
|
}
|
|
2252
2253
|
)
|
|
2253
2254
|
] }),
|
|
2254
|
-
!r && b.open && /* @__PURE__ */ e(
|
|
2255
|
+
!r && b.open && /* @__PURE__ */ e(Ws, { filters: b.filters, onChange: b.setFilters, rooms: n, th: d }),
|
|
2255
2256
|
!r && i && !R && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
|
|
2256
2257
|
/* @__PURE__ */ a(
|
|
2257
2258
|
"button",
|
|
@@ -2347,8 +2348,8 @@ function Bn({
|
|
|
2347
2348
|
] }, w);
|
|
2348
2349
|
})
|
|
2349
2350
|
] }),
|
|
2350
|
-
r && !
|
|
2351
|
-
r &&
|
|
2351
|
+
r && !o && n.length === 0 && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12px] leading-relaxed text-slate-400", children: "Nothing archived. Archiving is just for you: the conversation leaves your chat list and stops alerting you, while everyone else in it carries on as before. Archive from a room's header or its row in your chat list; writing in it again brings it back." }),
|
|
2352
|
+
r && o && /* @__PURE__ */ e("p", { className: "px-3 py-3 text-[12px] text-slate-400", children: "Loading…" }),
|
|
2352
2353
|
!r && $.bot_name && $.bot_user_id && c.me && /* @__PURE__ */ a(
|
|
2353
2354
|
"button",
|
|
2354
2355
|
{
|
|
@@ -2433,7 +2434,7 @@ function Bn({
|
|
|
2433
2434
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
2434
2435
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: x.label }),
|
|
2435
2436
|
x.muted && /* @__PURE__ */ e(Sn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
|
|
2436
|
-
/* @__PURE__ */ e(
|
|
2437
|
+
/* @__PURE__ */ e(wr, { count: C.countFor(x.room), label: x.label }),
|
|
2437
2438
|
V.has(x.room) && /* @__PURE__ */ e(
|
|
2438
2439
|
Ya,
|
|
2439
2440
|
{
|
|
@@ -2533,32 +2534,32 @@ function Bn({
|
|
|
2533
2534
|
)
|
|
2534
2535
|
] });
|
|
2535
2536
|
}
|
|
2536
|
-
function
|
|
2537
|
+
function uo({
|
|
2537
2538
|
view: n,
|
|
2538
2539
|
rooms: s,
|
|
2539
|
-
onBack:
|
|
2540
|
+
onBack: l,
|
|
2540
2541
|
onOpen: r
|
|
2541
2542
|
}) {
|
|
2542
|
-
const
|
|
2543
|
-
return n === "mentions" ? /* @__PURE__ */ e(Qn, { th:
|
|
2543
|
+
const o = ie();
|
|
2544
|
+
return n === "mentions" ? /* @__PURE__ */ e(Qn, { th: o, onBack: l, onOpen: r }) : n === "scheduled" ? /* @__PURE__ */ e(
|
|
2544
2545
|
Kn,
|
|
2545
2546
|
{
|
|
2546
|
-
th:
|
|
2547
|
-
onBack:
|
|
2547
|
+
th: o,
|
|
2548
|
+
onBack: l,
|
|
2548
2549
|
roomLabel: (i) => {
|
|
2549
2550
|
var d;
|
|
2550
2551
|
return ((d = s.find((c) => c.room === i)) == null ? void 0 : d.label) ?? i;
|
|
2551
2552
|
}
|
|
2552
2553
|
}
|
|
2553
|
-
) : /* @__PURE__ */ e(Jn, { rooms: s, th:
|
|
2554
|
+
) : /* @__PURE__ */ e(Jn, { rooms: s, th: o, onBack: l, onOpen: r });
|
|
2554
2555
|
}
|
|
2555
|
-
function
|
|
2556
|
+
function ll({
|
|
2556
2557
|
onOpen: n
|
|
2557
2558
|
}) {
|
|
2558
|
-
const s = ie(), [
|
|
2559
|
+
const s = ie(), [l, r] = T(""), [o, i] = T(!1), [d, c] = T(""), [h, f] = T("open"), [u, p] = T(""), [b, U] = T({
|
|
2559
2560
|
icon: null,
|
|
2560
2561
|
color: null
|
|
2561
|
-
}), $ = Zn(), { channels: C, loading: S } =
|
|
2562
|
+
}), $ = Zn(), { channels: C, loading: S } = zs(l), { join: W } = Pt(), M = Hs();
|
|
2562
2563
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
|
|
2563
2564
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2564
2565
|
/* @__PURE__ */ a("div", { className: "relative flex-1", children: [
|
|
@@ -2566,7 +2567,7 @@ function rl({
|
|
|
2566
2567
|
/* @__PURE__ */ e(
|
|
2567
2568
|
"input",
|
|
2568
2569
|
{
|
|
2569
|
-
value:
|
|
2570
|
+
value: l,
|
|
2570
2571
|
onChange: (v) => r(v.target.value),
|
|
2571
2572
|
placeholder: "Search channels…",
|
|
2572
2573
|
className: g("h-8 w-full rounded-md pl-8 pr-2 text-[12.5px] outline-none", s.input)
|
|
@@ -2589,7 +2590,7 @@ function rl({
|
|
|
2589
2590
|
}
|
|
2590
2591
|
)
|
|
2591
2592
|
] }),
|
|
2592
|
-
|
|
2593
|
+
o && /* @__PURE__ */ a(
|
|
2593
2594
|
"form",
|
|
2594
2595
|
{
|
|
2595
2596
|
className: "flex flex-col gap-2 border-b border-slate-100 p-2 dark:border-border/60",
|
|
@@ -2674,7 +2675,7 @@ function rl({
|
|
|
2674
2675
|
S && /* @__PURE__ */ e("p", { className: "px-2 py-6 text-center text-[12px] text-slate-400", children: "Loading…" }),
|
|
2675
2676
|
!S && C.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-8 text-center", children: [
|
|
2676
2677
|
/* @__PURE__ */ e(_t, { className: "mx-auto h-5 w-5 text-slate-300" }),
|
|
2677
|
-
/* @__PURE__ */ e("p", { className: "mt-2 text-[12.5px] font-medium text-slate-600 dark:text-slate-300", children:
|
|
2678
|
+
/* @__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" }),
|
|
2678
2679
|
/* @__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." })
|
|
2679
2680
|
] }),
|
|
2680
2681
|
C.map((v) => /* @__PURE__ */ a(
|
|
@@ -2721,16 +2722,16 @@ function rl({
|
|
|
2721
2722
|
] })
|
|
2722
2723
|
] });
|
|
2723
2724
|
}
|
|
2724
|
-
function
|
|
2725
|
+
function ol() {
|
|
2725
2726
|
const n = /* @__PURE__ */ new Date();
|
|
2726
2727
|
return n.setHours(23, 59, 59, 999), n;
|
|
2727
2728
|
}
|
|
2728
|
-
function
|
|
2729
|
-
const n = Lt(), s = Yn(), [
|
|
2729
|
+
function il() {
|
|
2730
|
+
const n = Lt(), s = Yn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), d = (h) => {
|
|
2730
2731
|
s.mutate({
|
|
2731
2732
|
presence_override: h === "off" ? null : { mode: "away", until: (h == null ? void 0 : h.toISOString()) ?? null }
|
|
2732
2733
|
}), r(!1);
|
|
2733
|
-
}, c = i && (
|
|
2734
|
+
}, c = i && (o != null && o.until) ? `until ${new Date(o.until).toLocaleString("en-US", {
|
|
2734
2735
|
weekday: "short",
|
|
2735
2736
|
hour: "numeric",
|
|
2736
2737
|
minute: "2-digit",
|
|
@@ -2762,7 +2763,7 @@ function ol() {
|
|
|
2762
2763
|
"data-chat-appear-away-off": !0,
|
|
2763
2764
|
children: "Back online"
|
|
2764
2765
|
}
|
|
2765
|
-
) : /* @__PURE__ */ a(Ye, { open:
|
|
2766
|
+
) : /* @__PURE__ */ a(Ye, { open: l, onOpenChange: r, children: [
|
|
2766
2767
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2767
2768
|
"button",
|
|
2768
2769
|
{
|
|
@@ -2777,7 +2778,7 @@ function ol() {
|
|
|
2777
2778
|
[
|
|
2778
2779
|
["1 hour", () => new Date(Date.now() + 36e5)],
|
|
2779
2780
|
["4 hours", () => new Date(Date.now() + 4 * 36e5)],
|
|
2780
|
-
["The rest of today",
|
|
2781
|
+
["The rest of today", ol],
|
|
2781
2782
|
["Until I switch it off", () => null]
|
|
2782
2783
|
].map(([h, f]) => /* @__PURE__ */ e(
|
|
2783
2784
|
"button",
|
|
@@ -2796,10 +2797,10 @@ function ol() {
|
|
|
2796
2797
|
}
|
|
2797
2798
|
);
|
|
2798
2799
|
}
|
|
2799
|
-
function
|
|
2800
|
+
function cl({ myStatus: n }) {
|
|
2800
2801
|
const s = ie();
|
|
2801
2802
|
return /* @__PURE__ */ e(
|
|
2802
|
-
|
|
2803
|
+
Ts,
|
|
2803
2804
|
{
|
|
2804
2805
|
status: n ? { text: n.text, emoji: n.emoji } : null,
|
|
2805
2806
|
theme: { accentSoft: s.accentSoft, input: s.input, action: s.action },
|
|
@@ -2808,39 +2809,39 @@ function il({ myStatus: n }) {
|
|
|
2808
2809
|
);
|
|
2809
2810
|
}
|
|
2810
2811
|
function pa() {
|
|
2811
|
-
var
|
|
2812
|
-
const n = Je(), { data:
|
|
2812
|
+
var i, d, c;
|
|
2813
|
+
const n = Je(), s = Cs(15e3), { data: l, isFetched: r } = Ce({
|
|
2813
2814
|
queryKey: ["presence-online"],
|
|
2814
2815
|
queryFn: () => n.request(xe("/presence/online")),
|
|
2815
|
-
// Matches the presence heartbeat cadence — the page someone is on
|
|
2816
|
-
// track them around the app,
|
|
2817
|
-
refetchInterval:
|
|
2816
|
+
// Matches the presence heartbeat cadence without a live socket — the page someone is on
|
|
2817
|
+
// should track them around the app. Live, presence:changed carries it and this is 60 s.
|
|
2818
|
+
refetchInterval: s,
|
|
2818
2819
|
staleTime: 5e3
|
|
2819
2820
|
});
|
|
2820
2821
|
return {
|
|
2821
2822
|
byUser: fe(() => {
|
|
2822
|
-
const
|
|
2823
|
-
for (const
|
|
2824
|
-
return
|
|
2825
|
-
}, [
|
|
2826
|
-
fields: ((
|
|
2827
|
-
adminUrl: ((
|
|
2828
|
-
dimensions: ((
|
|
2829
|
-
loaded:
|
|
2823
|
+
const h = /* @__PURE__ */ new Map();
|
|
2824
|
+
for (const f of (l == null ? void 0 : l.data) ?? []) h.set(String(f.user_id).toUpperCase(), f);
|
|
2825
|
+
return h;
|
|
2826
|
+
}, [l]),
|
|
2827
|
+
fields: ((i = l == null ? void 0 : l.config) == null ? void 0 : i.fields) ?? ["role", "page"],
|
|
2828
|
+
adminUrl: ((d = l == null ? void 0 : l.config) == null ? void 0 : d.admin_url) ?? null,
|
|
2829
|
+
dimensions: ((c = l == null ? void 0 : l.config) == null ? void 0 : c.dimensions) ?? [],
|
|
2830
|
+
loaded: r
|
|
2830
2831
|
};
|
|
2831
2832
|
}
|
|
2832
2833
|
function ha(n) {
|
|
2833
2834
|
if (!n) return null;
|
|
2834
2835
|
const s = n.split("/").filter(Boolean);
|
|
2835
2836
|
if (s.length === 0) return "Home";
|
|
2836
|
-
const
|
|
2837
|
-
return r.length === 0 ? "Home" : r.map((
|
|
2837
|
+
const l = /* @__PURE__ */ new Set(["records", "collections", "p"]), r = s.filter((o) => !l.has(o));
|
|
2838
|
+
return r.length === 0 ? "Home" : r.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (d) => d.toUpperCase()) : o).join(" › ");
|
|
2838
2839
|
}
|
|
2839
|
-
function
|
|
2840
|
+
function dl({
|
|
2840
2841
|
onClose: n,
|
|
2841
2842
|
onCreated: s
|
|
2842
2843
|
}) {
|
|
2843
|
-
const
|
|
2844
|
+
const l = ie(), [r, o] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } = jt(r, !0), u = dr(), p = (b) => [b.first_name, b.last_name].filter(Boolean).join(" ") || (b.email ?? "Unknown");
|
|
2844
2845
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
|
|
2845
2846
|
/* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
2846
2847
|
/* @__PURE__ */ e(
|
|
@@ -2860,7 +2861,7 @@ function cl({
|
|
|
2860
2861
|
{
|
|
2861
2862
|
className: g(
|
|
2862
2863
|
"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium",
|
|
2863
|
-
|
|
2864
|
+
l.accentSoft
|
|
2864
2865
|
),
|
|
2865
2866
|
children: [
|
|
2866
2867
|
U,
|
|
@@ -2884,9 +2885,9 @@ function cl({
|
|
|
2884
2885
|
"input",
|
|
2885
2886
|
{
|
|
2886
2887
|
value: r,
|
|
2887
|
-
onChange: (b) =>
|
|
2888
|
+
onChange: (b) => o(b.target.value),
|
|
2888
2889
|
placeholder: "Find people…",
|
|
2889
|
-
className: g("mb-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none",
|
|
2890
|
+
className: g("mb-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none", l.input),
|
|
2890
2891
|
"aria-label": "Find people",
|
|
2891
2892
|
autoFocus: !0
|
|
2892
2893
|
}
|
|
@@ -2903,7 +2904,7 @@ function cl({
|
|
|
2903
2904
|
}),
|
|
2904
2905
|
className: g(
|
|
2905
2906
|
"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[12.5px] transition-colors",
|
|
2906
|
-
U ?
|
|
2907
|
+
U ? l.accentSoft : "hover:bg-slate-50 dark:hover:bg-muted/50"
|
|
2907
2908
|
),
|
|
2908
2909
|
children: [
|
|
2909
2910
|
/* @__PURE__ */ e(Z, { id: b.id, name: p(b), size: 22 }),
|
|
@@ -2922,7 +2923,7 @@ function cl({
|
|
|
2922
2923
|
placeholder: "Group name (optional)",
|
|
2923
2924
|
className: g(
|
|
2924
2925
|
"mb-2 mt-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none",
|
|
2925
|
-
|
|
2926
|
+
l.input
|
|
2926
2927
|
),
|
|
2927
2928
|
"aria-label": "Group name"
|
|
2928
2929
|
}
|
|
@@ -2938,7 +2939,7 @@ function cl({
|
|
|
2938
2939
|
),
|
|
2939
2940
|
className: g(
|
|
2940
2941
|
"flex h-9 items-center justify-center rounded-lg text-[12.5px] font-semibold transition-[filter] hover:brightness-110 disabled:opacity-40",
|
|
2941
|
-
|
|
2942
|
+
l.action
|
|
2942
2943
|
),
|
|
2943
2944
|
children: u.isPending ? "Creating…" : `Start conversation${c.size ? ` (${c.size + 1})` : ""}`
|
|
2944
2945
|
}
|
|
@@ -2946,15 +2947,15 @@ function cl({
|
|
|
2946
2947
|
] });
|
|
2947
2948
|
}
|
|
2948
2949
|
const $t = "nvr-chat-pinned", Ct = 400;
|
|
2949
|
-
function
|
|
2950
|
+
function ul() {
|
|
2950
2951
|
try {
|
|
2951
2952
|
return typeof window < "u" && window.localStorage.getItem($t) === "1";
|
|
2952
2953
|
} catch {
|
|
2953
2954
|
return !1;
|
|
2954
2955
|
}
|
|
2955
2956
|
}
|
|
2956
|
-
function
|
|
2957
|
-
const n = "(min-width: 1024px)", [s,
|
|
2957
|
+
function ml() {
|
|
2958
|
+
const n = "(min-width: 1024px)", [s, l] = T(
|
|
2958
2959
|
() => {
|
|
2959
2960
|
var r;
|
|
2960
2961
|
return typeof window < "u" && !!((r = window.matchMedia) != null && r.call(window, n).matches);
|
|
@@ -2964,19 +2965,19 @@ function ul() {
|
|
|
2964
2965
|
var i;
|
|
2965
2966
|
const r = (i = window.matchMedia) == null ? void 0 : i.call(window, n);
|
|
2966
2967
|
if (!r) return;
|
|
2967
|
-
const
|
|
2968
|
-
return r.addEventListener("change",
|
|
2968
|
+
const o = () => l(r.matches);
|
|
2969
|
+
return r.addEventListener("change", o), () => r.removeEventListener("change", o);
|
|
2969
2970
|
}, []), s;
|
|
2970
2971
|
}
|
|
2971
|
-
function
|
|
2972
|
+
function mo({
|
|
2972
2973
|
open: n,
|
|
2973
2974
|
onClose: s,
|
|
2974
|
-
renderMessageBody:
|
|
2975
|
+
renderMessageBody: l,
|
|
2975
2976
|
requestedDm: r,
|
|
2976
|
-
requestedRoom:
|
|
2977
|
+
requestedRoom: o
|
|
2977
2978
|
}) {
|
|
2978
2979
|
var $e;
|
|
2979
|
-
const i = Me(), d = ie(), c = i.me, [h, f] = T(
|
|
2980
|
+
const i = Me(), d = ie(), c = i.me, [h, f] = T(ul), u = ml(), p = h && u, b = () => {
|
|
2980
2981
|
const k = !h;
|
|
2981
2982
|
f(k);
|
|
2982
2983
|
try {
|
|
@@ -3006,7 +3007,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3006
3007
|
X.set(K, [...X.get(K) ?? [], j]);
|
|
3007
3008
|
}
|
|
3008
3009
|
return [...X.entries()].sort((j, E) => j[0] === "Unassigned" ? 1 : E[0] === "Unassigned" ? -1 : j[0].localeCompare(E[0])).map(([j, E]) => ({ key: j, label: j, users: E }));
|
|
3009
|
-
}, [A, w] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), P = pa(), x = P.loaded ?
|
|
3010
|
+
}, [A, w] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), P = pa(), x = P.loaded ? Gs(
|
|
3010
3011
|
i.onlineUsers.filter((k) => P.byUser.has(String(k.user_id).toUpperCase()))
|
|
3011
3012
|
) : [], q = fe(
|
|
3012
3013
|
() => de(x, A, P.byUser),
|
|
@@ -3025,8 +3026,8 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3025
3026
|
}, [r, c]);
|
|
3026
3027
|
const ke = oe(0);
|
|
3027
3028
|
return ae(() => {
|
|
3028
|
-
!
|
|
3029
|
-
}, [
|
|
3029
|
+
!o || o.nonce === ke.current || (ke.current = o.nonce, $("chat"), H(!1), S({ room: o.room, label: o.label ?? o.room }));
|
|
3030
|
+
}, [o]), n ? /* @__PURE__ */ a(
|
|
3030
3031
|
"div",
|
|
3031
3032
|
{
|
|
3032
3033
|
className: p ? (
|
|
@@ -3108,13 +3109,13 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3108
3109
|
] }),
|
|
3109
3110
|
U === "online" ? /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", "data-chat-online": !0, children: [
|
|
3110
3111
|
/* @__PURE__ */ e(
|
|
3111
|
-
|
|
3112
|
+
cl,
|
|
3112
3113
|
{
|
|
3113
3114
|
myStatus: c ? (($e = P.byUser.get(String(c.id).toUpperCase())) == null ? void 0 : $e.custom_status) ?? null : null
|
|
3114
3115
|
}
|
|
3115
3116
|
),
|
|
3116
|
-
/* @__PURE__ */ e(
|
|
3117
|
-
/* @__PURE__ */ e(
|
|
3117
|
+
/* @__PURE__ */ e(il, {}),
|
|
3118
|
+
/* @__PURE__ */ e(Us, {}),
|
|
3118
3119
|
x.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
|
|
3119
3120
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
|
|
3120
3121
|
/* @__PURE__ */ e(
|
|
@@ -3215,7 +3216,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3215
3216
|
}
|
|
3216
3217
|
) : null;
|
|
3217
3218
|
})(),
|
|
3218
|
-
ve && /* @__PURE__ */ e(
|
|
3219
|
+
ve && /* @__PURE__ */ e($s, { builds: I == null ? void 0 : I.stale_build })
|
|
3219
3220
|
] }),
|
|
3220
3221
|
(() => {
|
|
3221
3222
|
const _ = P.byUser.get(String(L.user_id).toUpperCase()), j = _ == null ? void 0 : _.custom_status;
|
|
@@ -3356,7 +3357,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3356
3357
|
room: V.room,
|
|
3357
3358
|
label: V.label,
|
|
3358
3359
|
onBack: () => se(null),
|
|
3359
|
-
renderMessageBody:
|
|
3360
|
+
renderMessageBody: l
|
|
3360
3361
|
}
|
|
3361
3362
|
) : /* @__PURE__ */ e(
|
|
3362
3363
|
Bn,
|
|
@@ -3371,7 +3372,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3371
3372
|
// switching to Browse with a conversation open kept showing that
|
|
3372
3373
|
// conversation (or its settings) under the Browse tab.
|
|
3373
3374
|
/* @__PURE__ */ e(
|
|
3374
|
-
|
|
3375
|
+
ll,
|
|
3375
3376
|
{
|
|
3376
3377
|
onOpen: (k, L, I) => {
|
|
3377
3378
|
H(!1), S({ room: k, label: L, channel: I }), $("chat");
|
|
@@ -3379,7 +3380,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3379
3380
|
}
|
|
3380
3381
|
)
|
|
3381
3382
|
) : B ? /* @__PURE__ */ e(
|
|
3382
|
-
|
|
3383
|
+
dl,
|
|
3383
3384
|
{
|
|
3384
3385
|
onClose: () => R(!1),
|
|
3385
3386
|
onCreated: (k, L) => {
|
|
@@ -3387,7 +3388,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3387
3388
|
}
|
|
3388
3389
|
}
|
|
3389
3390
|
) : C && G && C.channel ? /* @__PURE__ */ e(
|
|
3390
|
-
|
|
3391
|
+
al,
|
|
3391
3392
|
{
|
|
3392
3393
|
channel: C.channel,
|
|
3393
3394
|
label: C.label,
|
|
@@ -3400,7 +3401,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3400
3401
|
label: C.label,
|
|
3401
3402
|
onOpenSettings: C.channel && !C.channel.is_direct ? () => H(!0) : void 0,
|
|
3402
3403
|
onBack: () => S(null),
|
|
3403
|
-
renderMessageBody:
|
|
3404
|
+
renderMessageBody: l,
|
|
3404
3405
|
initialUnread: C.unread,
|
|
3405
3406
|
anchor: C.anchor ?? null
|
|
3406
3407
|
}
|
|
@@ -3447,13 +3448,13 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3447
3448
|
) : /* @__PURE__ */ e($n, {});
|
|
3448
3449
|
}
|
|
3449
3450
|
export {
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3451
|
+
il as ChatAppearAwayRow,
|
|
3452
|
+
ll as ChatChannelBrowser,
|
|
3453
|
+
al as ChatChannelSettings,
|
|
3454
|
+
mo as ChatPanel,
|
|
3455
|
+
co as ChatProvider,
|
|
3455
3456
|
Bn as ChatRoomList,
|
|
3456
3457
|
In as ChatRoomView,
|
|
3457
|
-
|
|
3458
|
-
|
|
3458
|
+
uo as ChatSideView,
|
|
3459
|
+
ul as isChatPanelPinned
|
|
3459
3460
|
};
|