@nivaro/react 0.3.36 → 0.3.38
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/components/slots/CommentsSlot.js +44 -36
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/AgentBadge.js +26 -0
- package/dist/shared/components/AgentQuestionsCard.js +198 -0
- package/dist/shared/components/ItemEditForm.js +3329 -3263
- package/dist/shared/components/McpConnectionScope.js +480 -0
- package/dist/shared/components/MyWorkView.js +223 -208
- package/dist/shared/components/RecordReadView.js +620 -575
- package/dist/shared/components/chat/ChatPanel.js +683 -671
- package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
- package/dist/shared/components/imports/ImportConsole.js +106 -104
- package/dist/shared/components/imports/RunDetailSheet.js +34 -32
- package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
- package/dist/shared/components/item-edit/FormTour.js +279 -0
- package/dist/shared/components/item-edit/GroupSection.js +377 -360
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
- package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
- package/dist/shared/components/item-edit/form-density.js +36 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
- package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
- package/dist/shared/components/layout-editor/AddPanel.js +349 -192
- package/dist/shared/components/layout-editor/DesignNode.js +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
- package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
- package/dist/shared/components/layout-editor/add-target.js +54 -43
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
- package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
- package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
- package/dist/shared/components/layout-editor/dnd/node.js +115 -105
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
- package/dist/shared/components/layout-editor/even-row.js +86 -0
- package/dist/shared/components/layout-editor/field-list.js +99 -0
- package/dist/shared/components/layout-editor/format-painter.js +102 -0
- package/dist/shared/components/layout-editor/grid-guides.js +15 -13
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
- package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
- package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
- package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
- package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
- package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
- package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
- package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
- package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
- package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
- package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
- package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
- package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
- package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/pin.js +37 -19
- package/dist/shared/components/layout-editor/place-clip.js +257 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
- package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
- package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
- package/dist/shared/components/layout-editor/removed-log.js +151 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
- package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
- package/dist/shared/components/layout-editor/revert-element.js +140 -0
- package/dist/shared/components/layout-editor/section-structure.js +193 -170
- package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
- package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
- package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
- package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
- package/dist/shared/components/layout-editor/shortcuts.js +21 -16
- package/dist/shared/components/layout-editor/structure-ops.js +221 -195
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
- package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
- package/dist/shared/components/panels/CommentPanel.js +47 -45
- package/dist/shared/components/panels/RevisionsPanel.js +66 -64
- package/dist/shared/components/panels/TaskPanel.js +395 -332
- package/dist/shared/components/profile/AgentsPanel.js +196 -147
- package/dist/shared/components/profile/ConnectionRollback.js +329 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
- package/dist/shared/lib/entry-config.js +22 -22
- package/dist/shared/lib/form-usage-beacon.js +91 -55
- package/dist/shared/lib/layout-lint.js +530 -284
- package/dist/shared/lib/layout-resolve.js +58 -44
- package/package.json +1 -1
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e, Fragment as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Search as
|
|
4
|
-
import { useState as T, useEffect as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useItemEditAuth as
|
|
7
|
-
import { get as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as Te, useQueryClient as Mt, useMutation as We } from "@tanstack/react-query";
|
|
3
|
+
import { Search as Gn, Plus as Fa, Hash as Tt, Lock as za, ChevronLeft as ut, X as mt, PinOff as Ha, Pin as Ut, Headphones as Ga, PlayCircle as Qa, MessageCircle as Qn, Users as Dt, AtSign as Ka, AlarmClock as Ja, Sparkles as Ya, BellOff as Dn, PencilLine as Za, Star as Va, ArchiveRestore as Xa, Archive as es, Bell as ts, LogOut as ns, Info as as, MapPin as $n, Check as Ot, ArrowUpDown as ss, MessageSquareReply as rs, Quote as ls, ClipboardPlus as os, NotebookPen as is, Bookmark as cs, Pencil as ds, Trash2 as us, AlertTriangle as ms, Paperclip as ps, Bot as hs, CheckCheck as fs, Plane as xs, FilePlus2 as bs } from "lucide-react";
|
|
4
|
+
import { useState as T, useEffect as X, useMemo as ve, useRef as ce, useContext as gs } from "react";
|
|
5
|
+
import { toast as ge } from "sonner";
|
|
6
|
+
import { useItemEditAuth as pt, useNavigation as vs, useNivaroClient as Ze } from "../../context.js";
|
|
7
|
+
import { get as ye, post as Fe, patch as ys } from "../../lib/commands.js";
|
|
8
8
|
import { useLiveRecord as ks, batchTouches as ws, LIVE_ASPECTS as Ns } from "../../lib/live.js";
|
|
9
9
|
import { usePresenceOnlinePoll as Cs } from "../../lib/presence-live.js";
|
|
10
|
-
import { presencePlaceHref as
|
|
10
|
+
import { presencePlaceHref as An, stuckText as Rn, fullHref as Mn } from "../../lib/presence-state.js";
|
|
11
11
|
import { invalidateRecordTasks as _s } from "../../lib/record-tasks.js";
|
|
12
12
|
import { userCardQuery as Ss } from "../../lib/user-cards.js";
|
|
13
|
-
import { cn as g, getDisplayTimezone as
|
|
13
|
+
import { cn as g, getDisplayTimezone as Lt, formatRelative as Kn } from "../../lib/utils.js";
|
|
14
14
|
import { CustomStatusEditor as Ts } from "../CustomStatusEditor.js";
|
|
15
15
|
import { DoNotDisturbRow as Us } from "../DoNotDisturb.js";
|
|
16
16
|
import { FilePreviewLightbox as Ds } from "../FilePreviewLightbox.js";
|
|
17
|
-
import { UserChip as
|
|
17
|
+
import { UserChip as Pt } from "../item-edit/UserChip.js";
|
|
18
18
|
import { StaleBuildChip as $s } from "../StaleBuildChip.js";
|
|
19
19
|
import { UserAvatar as As } from "../UserAvatar.js";
|
|
20
|
-
import { Popover as
|
|
21
|
-
import { SimpleSelect as
|
|
20
|
+
import { Popover as Ve, PopoverTrigger as Xe, PopoverContent as et } from "../ui/popover.js";
|
|
21
|
+
import { SimpleSelect as It } from "../ui/SimpleSelect.js";
|
|
22
22
|
import { useBotStream as Rs, BotStreamBubble as Ms } from "./BotStream.js";
|
|
23
23
|
import { MembershipHistory as Os, ArchiveSuggestionBanner as Ls } from "./ChannelArchive.js";
|
|
24
24
|
import { ChannelExtrasEditor as Ps, BulkInvitePanel as Is, ChannelAuditLog as js } from "./ChannelExtras.js";
|
|
25
|
-
import { ChannelTile as
|
|
26
|
-
import { MentionsView as
|
|
25
|
+
import { ChannelTile as Ye, ChannelLookPicker as Jn } from "./ChannelLook.js";
|
|
26
|
+
import { MentionsView as Yn, ScheduledView as Zn, CatchUpView as Vn, useSearchFilterState as qs, FilterToggle as Es, ChatSettingsButton as Bs, SearchFilterBar as Ws } from "./ChatViews.js";
|
|
27
27
|
import { ChatComposer as Fs } from "./Composer.js";
|
|
28
|
-
import { useMyPreferences as
|
|
28
|
+
import { useMyPreferences as jt, useSetMyPreferences as Xn, useChatRoles as ea, useChannelDirectory as zs, useRoomMembership as qt, useCreateChannel as Hs, useChatConfig as Le, useChannelMembers as Et, useChannelAdmin as ta, useUserSearch as Bt, GENERAL_CHANNEL_ID as na, useChatRooms as aa, useArchivedRooms as sa, sortOnlineUsers as Gs, dmRoom as $t, CHAT_DEFAULTS as dt, ChatConfigContext as ra, useChatBotInfo as Wt, useChatSearch as Qs, dmPeer as Se, useChatMessages as Ks, useOpenRoomRegistration as Js, useMarkRoomRead as Ys, useTypingIndicator as Zs, usePeerReadAt as Vs, useEntityRoomLink as Xs, useToggleReaction as er, useRoomPins as tr, useTogglePin as nr, useEditMessage as ar, useDeleteMessage as sr, useChatBotName as rr, useChatThread as lr, useRecordBrowserTimezone as or, chatInitials as ir, chatAvatarColor as cr, useCreateGroupDm as dr, canOpenDm as ur, openDmWith as mr, chatRoomTypesQuery as la, REACTION_EMOJI as pr } from "./chat-core.js";
|
|
29
29
|
import { useDraftRooms as hr } from "./chat-drafts.js";
|
|
30
30
|
import { useCustomEmoji as fr, EmojiButton as xr, EmojiGlyph as br } from "./chat-emoji.js";
|
|
31
|
-
import { useRoomRecord as
|
|
31
|
+
import { useRoomRecord as oa, useRecordFileTargets as gr } from "./chat-hooks.js";
|
|
32
32
|
import { offHoursNote as vr } from "./chat-local-time.js";
|
|
33
33
|
import { useMessageWindow as yr } from "./chat-window.js";
|
|
34
|
-
import { HuddleFollowHost as
|
|
34
|
+
import { HuddleFollowHost as On } from "./huddle/HuddleCollab.js";
|
|
35
35
|
import { HuddleControls as kr } from "./huddle/HuddleControls.js";
|
|
36
36
|
import { HuddleLiveBadge as wr } from "./huddle/HuddleLiveBadge.js";
|
|
37
37
|
import { HuddleScheduleCard as Nr } from "./huddle/HuddleScheduleCard.js";
|
|
38
38
|
import { HuddleScheduleForm as Cr } from "./huddle/HuddleScheduleForm.js";
|
|
39
39
|
import { HuddleStage as _r } from "./huddle/HuddleStage.js";
|
|
40
40
|
import { useHuddleLive as Sr } from "./huddle/huddle-live.js";
|
|
41
|
-
import { stripHuddleRef as
|
|
41
|
+
import { stripHuddleRef as Ln, huddleRefOf as Pn } from "./huddle/huddle-schedule.js";
|
|
42
42
|
import { useHuddle as Tr } from "./huddle/useHuddle.js";
|
|
43
43
|
import { useMessageActions as Ur, MessageActionsMenu as Dr, actionsForMessage as $r } from "./MessageActions.js";
|
|
44
44
|
import { FormattedMessage as Ar, LinkPreviews as Rr } from "./MessageFormat.js";
|
|
45
45
|
import { PollCard as Mr } from "./PollCard.js";
|
|
46
|
-
import { RoomStatusMarks as Or, headerIconIdle as
|
|
46
|
+
import { RoomStatusMarks as Or, headerIconIdle as In, headerIconButton as jn, RoomHeaderMenu as Lr } from "./RoomHeaderMenu.js";
|
|
47
47
|
import { MemberCountLine as Pr, ChannelIntro as Ir, WelcomeNote as jr, ThreadPane as qr, RoomInfoDrawer as Er } from "./RoomParts.js";
|
|
48
48
|
import { clipInfo as Br, ClipPlayer as Wr } from "./ScreenClip.js";
|
|
49
|
-
import { useOutbox as
|
|
50
|
-
import { OutboxBubbles as
|
|
51
|
-
const
|
|
49
|
+
import { useOutbox as ia } from "./chat-outbox.js";
|
|
50
|
+
import { OutboxBubbles as ca } from "./OutboxBubbles.js";
|
|
51
|
+
const da = {
|
|
52
52
|
bubbleMine: "bg-nvr-cyan text-white",
|
|
53
53
|
bubbleOther: "bg-slate-100 text-slate-800 dark:bg-muted dark:text-slate-100",
|
|
54
54
|
accentText: "text-nvr-navy dark:text-nvr-cyan",
|
|
@@ -58,16 +58,16 @@ const oa = {
|
|
|
58
58
|
surface: "bg-white dark:bg-card",
|
|
59
59
|
input: "border-slate-200 bg-slate-50 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100",
|
|
60
60
|
divider: "border-slate-100 dark:border-border/60"
|
|
61
|
-
},
|
|
62
|
-
|
|
61
|
+
}, Ft = {};
|
|
62
|
+
Ft.current = da;
|
|
63
63
|
function co({
|
|
64
64
|
children: n,
|
|
65
65
|
me: s,
|
|
66
66
|
onlineUsers: l = [],
|
|
67
67
|
collections: r,
|
|
68
|
-
globalRoom: o =
|
|
69
|
-
globalLabel: i =
|
|
70
|
-
entityPattern: m =
|
|
68
|
+
globalRoom: o = dt.globalRoom,
|
|
69
|
+
globalLabel: i = dt.globalLabel,
|
|
70
|
+
entityPattern: m = dt.entityPattern,
|
|
71
71
|
entityUrl: d = () => null,
|
|
72
72
|
roomLabel: b,
|
|
73
73
|
recordUrl: f,
|
|
@@ -79,9 +79,9 @@ function co({
|
|
|
79
79
|
sound: C = !0,
|
|
80
80
|
theme: S
|
|
81
81
|
}) {
|
|
82
|
-
const E =
|
|
82
|
+
const E = ve(
|
|
83
83
|
() => ({
|
|
84
|
-
collections: { ...
|
|
84
|
+
collections: { ...dt.collections, ...r },
|
|
85
85
|
globalRoom: o,
|
|
86
86
|
globalLabel: i,
|
|
87
87
|
entityPattern: m,
|
|
@@ -110,16 +110,16 @@ function co({
|
|
|
110
110
|
C
|
|
111
111
|
]
|
|
112
112
|
);
|
|
113
|
-
return
|
|
113
|
+
return Ft.current = { ...da, ...S }, /* @__PURE__ */ e(ra.Provider, { value: E, children: n });
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function de() {
|
|
116
|
+
return Ft.current;
|
|
117
117
|
}
|
|
118
|
-
const
|
|
118
|
+
const qn = /* @__PURE__ */ new WeakMap();
|
|
119
119
|
function Fr(n, s) {
|
|
120
120
|
const l = String(s).toUpperCase();
|
|
121
|
-
let r =
|
|
122
|
-
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null },
|
|
121
|
+
let r = qn.get(n);
|
|
122
|
+
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, qn.set(n, r));
|
|
123
123
|
const o = r;
|
|
124
124
|
return new Promise((i) => {
|
|
125
125
|
const m = o.ids.get(l) ?? [];
|
|
@@ -130,7 +130,7 @@ function Fr(n, s) {
|
|
|
130
130
|
for (let p = 0; p < b.length; p += 100)
|
|
131
131
|
try {
|
|
132
132
|
const x = await n.request(
|
|
133
|
-
|
|
133
|
+
ye("/presence/people", { ids: b.slice(p, p + 100).join(",") })
|
|
134
134
|
);
|
|
135
135
|
for (const v of x.data ?? []) f.set(String(v.user_id).toUpperCase(), v);
|
|
136
136
|
} catch {
|
|
@@ -139,8 +139,8 @@ function Fr(n, s) {
|
|
|
139
139
|
}, 0));
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
const l =
|
|
142
|
+
function zt(n, s = !0) {
|
|
143
|
+
const l = Ze(), { data: r } = Te({
|
|
144
144
|
queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
|
|
145
145
|
queryFn: () => Fr(l, n),
|
|
146
146
|
enabled: !!n && s,
|
|
@@ -148,36 +148,36 @@ function Wt(n, s = !0) {
|
|
|
148
148
|
});
|
|
149
149
|
return r ?? null;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
return n != null && n.last_seen ? `last seen ${
|
|
151
|
+
function ua(n) {
|
|
152
|
+
return n != null && n.last_seen ? `last seen ${Kn(n.last_seen)}` : null;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
const s = gs(
|
|
154
|
+
function ma(n) {
|
|
155
|
+
const s = gs(ra), l = xa(), r = String(n).toUpperCase();
|
|
156
156
|
if (l.loaded) {
|
|
157
157
|
const i = l.byUser.get(r);
|
|
158
158
|
if (!i) return { state: "offline", title: "Offline", page: null };
|
|
159
|
-
const m = i.page ??
|
|
160
|
-
return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title:
|
|
159
|
+
const m = i.page ?? ba(i.current_path);
|
|
160
|
+
return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: At(i), page: m } : { state: "online", title: "Online", page: m };
|
|
161
161
|
}
|
|
162
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:
|
|
163
|
+
return o ? o.is_idle ? { state: "idle", title: At(o), page: null } : { state: "online", title: "Online", page: null } : { state: "offline", title: "Offline", page: null };
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function pa(n) {
|
|
166
166
|
return n != null && n.out_of_office ? n.ooo_end ? `Out of office until ${new Date(n.ooo_end).toLocaleDateString(void 0, {
|
|
167
167
|
weekday: "short",
|
|
168
168
|
month: "short",
|
|
169
169
|
day: "numeric",
|
|
170
|
-
timeZone:
|
|
170
|
+
timeZone: Lt() ?? void 0
|
|
171
171
|
})}` : "Out of office" : null;
|
|
172
172
|
}
|
|
173
173
|
function zr({ id: n, size: s }) {
|
|
174
|
-
const { state: l, title: r, page: o } =
|
|
174
|
+
const { state: l, title: r, page: o } = ma(n), i = zt(n), m = l === "offline" ? ua(i) : null, d = pa(i), b = s >= 30 ? 10 : 8, f = [
|
|
175
175
|
m ? `Offline · ${m}` : r,
|
|
176
176
|
o && l !== "offline" ? `On ${o}` : null,
|
|
177
177
|
d,
|
|
178
178
|
d && (i != null && i.delegate) ? `${i.delegate.name} is covering` : null
|
|
179
179
|
].filter(Boolean).join(" · ");
|
|
180
|
-
return /* @__PURE__ */ a(
|
|
180
|
+
return /* @__PURE__ */ a(ke, { children: [
|
|
181
181
|
/* @__PURE__ */ e(
|
|
182
182
|
"span",
|
|
183
183
|
{
|
|
@@ -206,13 +206,13 @@ function zr({ id: n, size: s }) {
|
|
|
206
206
|
)
|
|
207
207
|
] });
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function K({
|
|
210
210
|
id: n,
|
|
211
211
|
name: s,
|
|
212
212
|
size: l = 32,
|
|
213
213
|
presence: r = !0
|
|
214
214
|
}) {
|
|
215
|
-
const o =
|
|
215
|
+
const o = Wt(), i = /* @__PURE__ */ e(
|
|
216
216
|
"span",
|
|
217
217
|
{
|
|
218
218
|
className: "flex shrink-0 items-center justify-center rounded-full font-semibold text-[#04263b]",
|
|
@@ -240,8 +240,8 @@ function Y({
|
|
|
240
240
|
] });
|
|
241
241
|
}
|
|
242
242
|
function Hr({ peerId: n, name: s }) {
|
|
243
|
-
const l =
|
|
244
|
-
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(
|
|
243
|
+
const l = Wt(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(K, { id: n, name: s, size: 28 });
|
|
244
|
+
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Pt, { userId: n, children: /* @__PURE__ */ e(
|
|
245
245
|
"button",
|
|
246
246
|
{
|
|
247
247
|
type: "button",
|
|
@@ -252,15 +252,15 @@ function Hr({ peerId: n, name: s }) {
|
|
|
252
252
|
}
|
|
253
253
|
) });
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
const r =
|
|
255
|
+
function En({ token: n, url: s, mine: l }) {
|
|
256
|
+
const r = Le(), o = de(), i = Ze(), { data: m } = Te(la(i)), { data: d } = Te({
|
|
257
257
|
queryKey: ["nvr-chat-entity-card", n],
|
|
258
258
|
queryFn: async () => {
|
|
259
259
|
var p, x, v, U;
|
|
260
260
|
for (const $ of m ?? [])
|
|
261
261
|
try {
|
|
262
262
|
const S = (x = (p = (await i.request(
|
|
263
|
-
|
|
263
|
+
ye(`/items/${$.collection}`, {
|
|
264
264
|
limit: 1,
|
|
265
265
|
fields: "id",
|
|
266
266
|
filter: JSON.stringify({ [$.match_field]: { _eq: n } })
|
|
@@ -268,7 +268,7 @@ function In({ token: n, url: s, mine: l }) {
|
|
|
268
268
|
)).data) == null ? void 0 : p[0]) == null ? void 0 : x.id;
|
|
269
269
|
if (S == null) continue;
|
|
270
270
|
const R = (U = (v = (await i.request(
|
|
271
|
-
|
|
271
|
+
ye(`/pipelines/instance/${$.collection}/${S}`)
|
|
272
272
|
)).data) == null ? void 0 : v.instance) == null ? void 0 : U.current_state_obj;
|
|
273
273
|
return {
|
|
274
274
|
collection: $.collection,
|
|
@@ -282,7 +282,7 @@ function In({ token: n, url: s, mine: l }) {
|
|
|
282
282
|
},
|
|
283
283
|
enabled: ((m == null ? void 0 : m.length) ?? 0) > 0,
|
|
284
284
|
staleTime: 10 * 6e4
|
|
285
|
-
}), b =
|
|
285
|
+
}), b = Mt();
|
|
286
286
|
return ks(
|
|
287
287
|
d == null ? void 0 : d.collection,
|
|
288
288
|
d == null ? void 0 : d.id,
|
|
@@ -332,7 +332,7 @@ function Gr(n) {
|
|
|
332
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" });
|
|
333
333
|
}
|
|
334
334
|
function Qr({ botName: n }) {
|
|
335
|
-
const s =
|
|
335
|
+
const s = de(), l = [
|
|
336
336
|
{
|
|
337
337
|
k: "@name",
|
|
338
338
|
kind: "code",
|
|
@@ -396,23 +396,23 @@ function Qr({ botName: n }) {
|
|
|
396
396
|
] });
|
|
397
397
|
}
|
|
398
398
|
function Kr({ room: n }) {
|
|
399
|
-
const s =
|
|
399
|
+
const s = Le(), l = de(), r = Ze(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, m = o > 0 ? n.slice(o + 1) : null, d = !!i && !!m && n !== s.globalRoom && i !== "dm" && i !== "ch", b = Mt(), { data: f } = Te({
|
|
400
400
|
queryKey: ["nvr-chat-room-card", n],
|
|
401
401
|
queryFn: async () => {
|
|
402
|
-
var A,
|
|
403
|
-
const S = (await b.fetchQuery(
|
|
402
|
+
var A, W, F, H;
|
|
403
|
+
const S = (await b.fetchQuery(la(r))).find((ee) => ee.is_active && ee.prefix === i);
|
|
404
404
|
if (!S) return null;
|
|
405
|
-
const R = (
|
|
406
|
-
|
|
405
|
+
const R = (W = (A = (await r.request(
|
|
406
|
+
ye(`/items/${S.collection}`, {
|
|
407
407
|
limit: 1,
|
|
408
408
|
fields: "id",
|
|
409
409
|
filter: JSON.stringify({ [S.match_field]: { _eq: m } })
|
|
410
410
|
})
|
|
411
|
-
)).data) == null ? void 0 : A[0]) == null ? void 0 :
|
|
411
|
+
)).data) == null ? void 0 : A[0]) == null ? void 0 : W.id;
|
|
412
412
|
if (R == null) return null;
|
|
413
|
-
const q = (
|
|
414
|
-
|
|
415
|
-
)).data) == null ? void 0 :
|
|
413
|
+
const q = (H = (F = (await r.request(
|
|
414
|
+
ye(`/pipelines/instance/${S.collection}/${R}`)
|
|
415
|
+
)).data) == null ? void 0 : F.instance) == null ? void 0 : H.current_state_obj;
|
|
416
416
|
return {
|
|
417
417
|
collection: S.collection,
|
|
418
418
|
type_label: S.label ?? S.collection.replace(/_/g, " "),
|
|
@@ -423,7 +423,7 @@ function Kr({ room: n }) {
|
|
|
423
423
|
},
|
|
424
424
|
enabled: d,
|
|
425
425
|
staleTime: 6e4
|
|
426
|
-
}), p =
|
|
426
|
+
}), p = oa(n, d && !!f);
|
|
427
427
|
if (!d || !f) return null;
|
|
428
428
|
const v = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (p == null ? void 0 : p.sla) ?? null, $ = (U == null ? void 0 : U.status) === "breached" ? "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300" : (U == null ? void 0 : U.status) === "warning" ? "bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300" : "bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300";
|
|
429
429
|
return /* @__PURE__ */ a(
|
|
@@ -461,7 +461,7 @@ function Kr({ room: n }) {
|
|
|
461
461
|
title: `Owners: ${p.owners.map((C) => C.name).join(", ")}`,
|
|
462
462
|
"data-chat-room-owners": p.owners.length,
|
|
463
463
|
children: [
|
|
464
|
-
p.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(
|
|
464
|
+
p.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(K, { id: C.id, name: C.name, size: 18, presence: !1 }, C.id)),
|
|
465
465
|
p.owners.length > 4 && /* @__PURE__ */ a("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-slate-200 px-1 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-slate-300", children: [
|
|
466
466
|
"+",
|
|
467
467
|
p.owners.length - 4
|
|
@@ -491,7 +491,7 @@ function Kr({ room: n }) {
|
|
|
491
491
|
}
|
|
492
492
|
function Jr(n, s) {
|
|
493
493
|
if (!n) return null;
|
|
494
|
-
const l =
|
|
494
|
+
const l = Lt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
|
|
495
495
|
let o, i;
|
|
496
496
|
try {
|
|
497
497
|
const d = (b) => new Intl.DateTimeFormat("en-US", { timeZone: b, hour: "numeric", minute: "2-digit" }).format(
|
|
@@ -505,26 +505,26 @@ function Jr(n, s) {
|
|
|
505
505
|
const m = s.split(/\s+/)[0] || s;
|
|
506
506
|
return `${o} for ${m}`;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function ha() {
|
|
509
509
|
const [n, s] = T(0);
|
|
510
|
-
return
|
|
510
|
+
return X(() => {
|
|
511
511
|
const l = setInterval(() => s((r) => r + 1), 6e4);
|
|
512
512
|
return () => clearInterval(l);
|
|
513
513
|
}, []), n;
|
|
514
514
|
}
|
|
515
515
|
function Yr({ peerId: n, name: s }) {
|
|
516
|
-
|
|
517
|
-
const { state: l, title: r } =
|
|
518
|
-
const f =
|
|
516
|
+
ha();
|
|
517
|
+
const { state: l, title: r } = ma(n), o = zt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
|
|
518
|
+
const f = ua(o);
|
|
519
519
|
return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
|
|
520
|
-
})() : r, m = Jr((o == null ? void 0 : o.timezone) ?? null, s), d =
|
|
520
|
+
})() : r, m = Jr((o == null ? void 0 : o.timezone) ?? null, s), d = pa(o), b = d ? (o == null ? void 0 : o.delegate) ?? null : null;
|
|
521
521
|
return /* @__PURE__ */ a(
|
|
522
522
|
"p",
|
|
523
523
|
{
|
|
524
524
|
className: "flex min-w-0 items-center gap-1.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
525
525
|
"data-chat-dm-peer-line": l,
|
|
526
526
|
children: [
|
|
527
|
-
d && /* @__PURE__ */ a(
|
|
527
|
+
d && /* @__PURE__ */ a(ke, { children: [
|
|
528
528
|
/* @__PURE__ */ e(
|
|
529
529
|
"span",
|
|
530
530
|
{
|
|
@@ -550,7 +550,7 @@ function Yr({ peerId: n, name: s }) {
|
|
|
550
550
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" })
|
|
551
551
|
] }),
|
|
552
552
|
/* @__PURE__ */ e("span", { className: "truncate", children: i }),
|
|
553
|
-
m && /* @__PURE__ */ a(
|
|
553
|
+
m && /* @__PURE__ */ a(ke, { children: [
|
|
554
554
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" }),
|
|
555
555
|
/* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (o == null ? void 0 : o.timezone) ?? void 0, children: m })
|
|
556
556
|
] })
|
|
@@ -558,7 +558,7 @@ function Yr({ peerId: n, name: s }) {
|
|
|
558
558
|
}
|
|
559
559
|
);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Bn({
|
|
562
562
|
room: n,
|
|
563
563
|
label: s,
|
|
564
564
|
onBack: l,
|
|
@@ -568,46 +568,46 @@ function jn({
|
|
|
568
568
|
anchor: m = null,
|
|
569
569
|
openThread: d = null
|
|
570
570
|
}) {
|
|
571
|
-
var
|
|
572
|
-
const b =
|
|
571
|
+
var xn, bn, gn, vn, yn, kn, wn, Nn, Cn, _n;
|
|
572
|
+
const b = Le(), f = de(), p = Ze(), x = b.me, v = Tr(n), U = x ? Se(n, x.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Te({
|
|
573
573
|
...Ss(p, U),
|
|
574
574
|
enabled: !!U && $,
|
|
575
575
|
staleTime: 12e4
|
|
576
576
|
}), S = $ && U ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : s, [E, R] = T(m);
|
|
577
|
-
|
|
578
|
-
const { messages: y, loading: q, hasOlder: A, hasNewer:
|
|
577
|
+
X(() => R(m), [m]);
|
|
578
|
+
const { messages: y, loading: q, hasOlder: A, hasNewer: W, loadOlder: F, loadingOlder: H } = Ks(
|
|
579
579
|
n,
|
|
580
580
|
E
|
|
581
581
|
);
|
|
582
582
|
Js(n);
|
|
583
|
-
const
|
|
583
|
+
const ee = ia(n), pe = Ys(), te = Zs(n), ne = Vs(n.startsWith("dm:") ? n : null), le = Xs(n), ae = er(n), ue = tr(n), c = nr(n), L = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== b.globalRoom && n.includes(":"), u = oa(n, L), J = gr(n, !!u), Ue = n.startsWith("ch:"), { data: he = [] } = Te({
|
|
584
584
|
queryKey: ["chat-read-marks", n],
|
|
585
585
|
queryFn: () => p.request(
|
|
586
|
-
|
|
586
|
+
ye(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
|
|
587
587
|
).then((t) => t.data ?? []).catch(() => []),
|
|
588
|
-
enabled:
|
|
589
|
-
refetchInterval:
|
|
588
|
+
enabled: Ue,
|
|
589
|
+
refetchInterval: Ue ? 3e4 : !1,
|
|
590
590
|
staleTime: 15e3
|
|
591
|
-
}),
|
|
591
|
+
}), Pe = (t) => he.filter(
|
|
592
592
|
(h) => h.user !== String(t.sender ?? "") && new Date(h.last_read_at).getTime() >= new Date(t.date_created).getTime()
|
|
593
|
-
),
|
|
593
|
+
), Ne = Mt(), { data: De = [] } = Te({
|
|
594
594
|
queryKey: ["chat-saved"],
|
|
595
|
-
queryFn: () => p.request(
|
|
595
|
+
queryFn: () => p.request(ye("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
|
|
596
596
|
staleTime: 6e4
|
|
597
|
-
}),
|
|
598
|
-
mutationFn: (t) => p.request(
|
|
599
|
-
onSuccess: () => void
|
|
600
|
-
}), [M, P] = T(null),
|
|
597
|
+
}), Ce = ve(() => new Set(De.map((t) => t.id)), [De]), k = We({
|
|
598
|
+
mutationFn: (t) => p.request(Fe(`/chat/messages/${t}/save`, {})),
|
|
599
|
+
onSuccess: () => void Ne.invalidateQueries({ queryKey: ["chat-saved"] })
|
|
600
|
+
}), [M, P] = T(null), Y = We({
|
|
601
601
|
mutationFn: () => p.request(
|
|
602
|
-
|
|
602
|
+
Fe("/chat/rooms/summary", { room: n })
|
|
603
603
|
).then((t) => t.data),
|
|
604
604
|
onSuccess: (t) => P((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
|
|
605
605
|
onError: () => P("Summary unavailable.")
|
|
606
|
-
}),
|
|
606
|
+
}), $e = We({
|
|
607
607
|
mutationFn: async (t) => {
|
|
608
608
|
if (!u || !x) throw new Error("no record");
|
|
609
609
|
await p.request(
|
|
610
|
-
|
|
610
|
+
Fe("/tasks", {
|
|
611
611
|
collection: u.collection,
|
|
612
612
|
item: String(u.id),
|
|
613
613
|
title: t.message.replace(/<[^>]*>/g, "").slice(0, 200),
|
|
@@ -616,159 +616,159 @@ function jn({
|
|
|
616
616
|
);
|
|
617
617
|
},
|
|
618
618
|
onSuccess: () => {
|
|
619
|
-
u && _s(
|
|
619
|
+
u && _s(Ne, u.collection, u.id), ge.success("Task created from message — assigned to you");
|
|
620
620
|
},
|
|
621
|
-
onError: () =>
|
|
622
|
-
}), _ =
|
|
623
|
-
mutationFn: (t) => p.request(
|
|
624
|
-
onSuccess: () =>
|
|
621
|
+
onError: () => ge.error("Could not create a task")
|
|
622
|
+
}), _ = We({
|
|
623
|
+
mutationFn: (t) => p.request(Fe(`/chat/messages/${t.id}/to-notes`, {})),
|
|
624
|
+
onSuccess: () => ge.success(`Copied to the Notes of ${(u == null ? void 0 : u.label) ?? "the record"}`),
|
|
625
625
|
onError: (t) => {
|
|
626
626
|
var h;
|
|
627
|
-
return
|
|
627
|
+
return ge.error(((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not copy it");
|
|
628
628
|
}
|
|
629
|
-
}), I =
|
|
629
|
+
}), I = We({
|
|
630
630
|
mutationFn: (t) => p.request(
|
|
631
|
-
|
|
631
|
+
Fe(`/chat/messages/${t.messageId}/attach-to-record`, {
|
|
632
632
|
file_id: t.fileId,
|
|
633
633
|
field: t.field
|
|
634
634
|
})
|
|
635
635
|
),
|
|
636
636
|
onSuccess: (t, h) => {
|
|
637
637
|
var N;
|
|
638
|
-
return
|
|
639
|
-
`Attached to ${(u == null ? void 0 : u.label) ?? "the record"} — ${((N =
|
|
638
|
+
return ge.success(
|
|
639
|
+
`Attached to ${(u == null ? void 0 : u.label) ?? "the record"} — ${((N = J.find((z) => z.field === h.field)) == null ? void 0 : N.label) ?? h.field}`
|
|
640
640
|
);
|
|
641
641
|
},
|
|
642
642
|
onError: (t) => {
|
|
643
643
|
var h;
|
|
644
|
-
return
|
|
644
|
+
return ge.error(
|
|
645
645
|
((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not attach it"
|
|
646
646
|
);
|
|
647
647
|
}
|
|
648
|
-
}), j =
|
|
648
|
+
}), j = We({
|
|
649
649
|
mutationFn: (t) => p.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
|
|
650
|
-
onSuccess: () => void
|
|
651
|
-
}),
|
|
652
|
-
|
|
653
|
-
d &&
|
|
654
|
-
}, [d,
|
|
655
|
-
const [
|
|
650
|
+
onSuccess: () => void Ne.invalidateQueries({ queryKey: ["nvr-chat", n] })
|
|
651
|
+
}), oe = ar(n), V = sr(n), { isAdmin: Z } = pt(), { setMuted: G, setNotifyMode: se, setArchived: fe, setStarred: ga, dismissWelcome: va, leave: ya } = qt(), { rooms: ka, loading: wa } = aa(), Gt = ka.find((t) => t.room === n) ?? null, { rooms: Na } = sa(!wa && !Gt), w = Gt ?? Na.find((t) => t.room === n) ?? null, Ca = fa(w), Qt = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", me = rr(), [tt, _a] = T(!1), [nt, Kt] = T(""), [Sa, ht] = T(null), [Jt, Yt] = T(""), [Ta, ft] = T(null), Ua = Ur(n), [Da, Zt] = T(null), [Vt, Xt] = T(null), [en, Ie] = T(null), tn = lr(d ? n : null, d), nn = !!tn.root && !tn.root.deleted_at;
|
|
652
|
+
X(() => {
|
|
653
|
+
d && nn && Ie(d);
|
|
654
|
+
}, [d, nn]);
|
|
655
|
+
const [$a, an] = T(null), [Aa, sn] = T(null), [xt, ze] = T(!1), [Ra, bt] = T(!1), [ie, He] = T(null), [Ge, at] = T(
|
|
656
656
|
m && "around" in m ? m.around : null
|
|
657
|
-
), [
|
|
658
|
-
const t =
|
|
657
|
+
), [st, gt] = T(null), Qe = Rs(n, (x == null ? void 0 : x.id) ?? null), rn = ce(null), vt = ce(null), yt = ce(Math.max(0, i ?? 0)), Ae = ce(!1), Me = ce(null), ln = ce(null), re = ce(!m), Ke = ce(0), Je = ce(null), kt = ce(0), rt = () => {
|
|
658
|
+
const t = Me.current;
|
|
659
659
|
t && (t.scrollTop = t.scrollHeight);
|
|
660
|
-
},
|
|
660
|
+
}, wt = (t) => {
|
|
661
661
|
var N;
|
|
662
|
-
const h = (N =
|
|
663
|
-
return h ? (h.scrollIntoView({ block: "center" }), re.current = !1,
|
|
664
|
-
},
|
|
665
|
-
|
|
662
|
+
const h = (N = Me.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
|
|
663
|
+
return h ? (h.scrollIntoView({ block: "center" }), re.current = !1, at(t), !0) : we.reveal(t) ? (re.current = !1, at(t), !0) : !1;
|
|
664
|
+
}, on = (t) => {
|
|
665
|
+
ze(!1), wt(t) || (Ae.current = !1, re.current = !1, at(t), R({ around: t }));
|
|
666
666
|
};
|
|
667
|
-
|
|
668
|
-
if (
|
|
669
|
-
const t = setTimeout(() =>
|
|
667
|
+
X(() => {
|
|
668
|
+
if (Ge == null) return;
|
|
669
|
+
const t = setTimeout(() => at(null), 2400);
|
|
670
670
|
return () => clearTimeout(t);
|
|
671
|
-
}, [
|
|
672
|
-
|
|
673
|
-
}, [n, E]),
|
|
674
|
-
var
|
|
675
|
-
const t =
|
|
676
|
-
if (!
|
|
677
|
-
if (
|
|
678
|
-
|
|
671
|
+
}, [Ge]), X(() => {
|
|
672
|
+
Ae.current = !1, Ke.current = 0, He(null);
|
|
673
|
+
}, [n, E]), X(() => {
|
|
674
|
+
var Oe, Ee;
|
|
675
|
+
const t = Me.current, h = ((Oe = y[0]) == null ? void 0 : Oe.id) ?? null;
|
|
676
|
+
if (!Ae.current && y.length > 0) {
|
|
677
|
+
if (Ae.current = !0, Ke.current = y.length, Je.current = h, Ge != null && wt(Ge)) return;
|
|
678
|
+
vt.current && !E ? (vt.current.scrollIntoView({ block: "center" }), re.current = !1) : E || (rt(), re.current = !0);
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
681
|
-
if (h !==
|
|
682
|
-
|
|
681
|
+
if (h !== Je.current && Je.current != null && t) {
|
|
682
|
+
Je.current = h, Ke.current = y.length;
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
|
-
|
|
686
|
-
const N = y.length -
|
|
687
|
-
if (
|
|
688
|
-
const
|
|
689
|
-
if (re.current ||
|
|
690
|
-
|
|
685
|
+
Je.current = h;
|
|
686
|
+
const N = y.length - Ke.current;
|
|
687
|
+
if (Ke.current = y.length, N <= 0) return;
|
|
688
|
+
const z = y[y.length - 1], Q = !!(z != null && z.sender) && z.sender.toLowerCase() === ((Ee = x == null ? void 0 : x.id) == null ? void 0 : Ee.toLowerCase());
|
|
689
|
+
if (re.current || Q)
|
|
690
|
+
rt(), re.current = !0, He(null);
|
|
691
691
|
else {
|
|
692
|
-
const
|
|
693
|
-
|
|
692
|
+
const Re = y[y.length - N];
|
|
693
|
+
He((be) => ({ count: ((be == null ? void 0 : be.count) ?? 0) + N, firstId: (be == null ? void 0 : be.firstId) ?? Re.id }));
|
|
694
694
|
}
|
|
695
|
-
}, [y]),
|
|
696
|
-
const t =
|
|
695
|
+
}, [y]), X(() => {
|
|
696
|
+
const t = ln.current;
|
|
697
697
|
if (!t || typeof ResizeObserver > "u") return;
|
|
698
698
|
const h = new ResizeObserver(() => {
|
|
699
699
|
var N;
|
|
700
|
-
re.current &&
|
|
700
|
+
re.current && rt(), kt.current = ((N = Me.current) == null ? void 0 : N.scrollHeight) ?? 0;
|
|
701
701
|
});
|
|
702
702
|
return h.observe(t), () => h.disconnect();
|
|
703
|
-
}, []),
|
|
704
|
-
var N,
|
|
703
|
+
}, []), X(() => {
|
|
704
|
+
var N, z;
|
|
705
705
|
const t = y[y.length - 1];
|
|
706
|
-
if (!t || !
|
|
706
|
+
if (!t || !Ae.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((z = x == null ? void 0 : x.id) == null ? void 0 : z.toLowerCase()))
|
|
707
707
|
return;
|
|
708
708
|
const h = Date.now() - new Date(t.date_created).getTime();
|
|
709
|
-
h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && p.request(
|
|
709
|
+
h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && p.request(Fe("/chat/health/delivery", { ms: h })).catch(() => {
|
|
710
710
|
});
|
|
711
|
-
}, [(
|
|
712
|
-
if (!
|
|
711
|
+
}, [(xn = y[y.length - 1]) == null ? void 0 : xn.id]), X(() => {
|
|
712
|
+
if (!st || !me) return;
|
|
713
713
|
if (y.some(
|
|
714
|
-
(N) => (N.sender_name ?? "").toLowerCase() ===
|
|
714
|
+
(N) => (N.sender_name ?? "").toLowerCase() === me.toLowerCase() && new Date(N.date_created).getTime() >= st - 5e3
|
|
715
715
|
)) {
|
|
716
|
-
|
|
716
|
+
gt(null);
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
|
-
const h = setTimeout(() =>
|
|
719
|
+
const h = setTimeout(() => gt(null), 9e4);
|
|
720
720
|
return () => clearTimeout(h);
|
|
721
|
-
}, [
|
|
722
|
-
const
|
|
721
|
+
}, [st, me, y]);
|
|
722
|
+
const lt = ve(() => {
|
|
723
723
|
const t = /* @__PURE__ */ new Set();
|
|
724
724
|
for (const h of y) for (const N of h.attachments ?? []) t.add(N);
|
|
725
725
|
return [...t];
|
|
726
|
-
}, [y]), { data:
|
|
727
|
-
queryKey: ["nvr-chat-attachments",
|
|
726
|
+
}, [y]), { data: Nt } = Te({
|
|
727
|
+
queryKey: ["nvr-chat-attachments", lt.slice().sort().join("|")],
|
|
728
728
|
queryFn: async () => {
|
|
729
729
|
const t = await p.request(
|
|
730
|
-
|
|
731
|
-
filter: JSON.stringify({ id: { _in:
|
|
732
|
-
limit: String(
|
|
730
|
+
ye("/files", {
|
|
731
|
+
filter: JSON.stringify({ id: { _in: lt } }),
|
|
732
|
+
limit: String(lt.length),
|
|
733
733
|
fields: "id,filename_download,title,type,filesize,tags"
|
|
734
734
|
})
|
|
735
735
|
);
|
|
736
736
|
return new Map((t.data ?? []).map((h) => [h.id, h]));
|
|
737
737
|
},
|
|
738
|
-
enabled:
|
|
738
|
+
enabled: lt.length > 0,
|
|
739
739
|
staleTime: 5 * 6e4
|
|
740
740
|
});
|
|
741
|
-
|
|
742
|
-
E ||
|
|
741
|
+
X(() => {
|
|
742
|
+
E || pe.mutate(n);
|
|
743
743
|
}, [n, y.length, E]);
|
|
744
|
-
const
|
|
745
|
-
if (re.current = !0, E && R(null),
|
|
746
|
-
const h =
|
|
747
|
-
new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) &&
|
|
744
|
+
const Ma = (t) => {
|
|
745
|
+
if (re.current = !0, E && R(null), me) {
|
|
746
|
+
const h = me.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
747
|
+
new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) && gt(Date.now());
|
|
748
748
|
}
|
|
749
|
-
},
|
|
750
|
-
() =>
|
|
751
|
-
[y,
|
|
752
|
-
),
|
|
749
|
+
}, je = (bn = x == null ? void 0 : x.id) == null ? void 0 : bn.toLowerCase(), xe = tt && nt.trim().length > 0, _e = ve(
|
|
750
|
+
() => xe ? y.filter((t) => t.message.toLowerCase().includes(nt.trim().toLowerCase())) : y,
|
|
751
|
+
[y, xe, nt]
|
|
752
|
+
), Oa = ve(() => {
|
|
753
753
|
var t;
|
|
754
|
-
if (
|
|
755
|
-
for (let h =
|
|
756
|
-
if (((t =
|
|
754
|
+
if (xe) return -1;
|
|
755
|
+
for (let h = _e.length - 1; h >= 0; h--)
|
|
756
|
+
if (((t = _e[h].sender) == null ? void 0 : t.toLowerCase()) === je) return h;
|
|
757
757
|
return -1;
|
|
758
|
-
}, [
|
|
759
|
-
scrollerRef:
|
|
760
|
-
listRef:
|
|
761
|
-
ids:
|
|
762
|
-
estimate:
|
|
763
|
-
resetKey: `${n}|${JSON.stringify(E)}|${
|
|
758
|
+
}, [_e, je, xe]), cn = ne ? new Date(ne).getTime() : 0, qe = jt().chat_density === "compact" ? "compact" : "comfortable", dn = ce(null), La = ve(() => _e.map((t) => t.id), [_e]), we = yr({
|
|
759
|
+
scrollerRef: Me,
|
|
760
|
+
listRef: dn,
|
|
761
|
+
ids: La,
|
|
762
|
+
estimate: qe === "compact" ? 40 : 72,
|
|
763
|
+
resetKey: `${n}|${JSON.stringify(E)}|${xe ? "search" : ""}`,
|
|
764
764
|
pinnedRef: re
|
|
765
|
-
}),
|
|
766
|
-
|
|
767
|
-
const
|
|
765
|
+
}), B = (w == null ? void 0 : w.channel) ?? null, un = !!B && !!x && String(B.created_by ?? "").toUpperCase() === x.id.toUpperCase(), mn = B != null && B.announce && !un && !Z ? B.id === na ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, pn = x ? Se(n, x.id) : null, Pa = zt(pn);
|
|
766
|
+
ha();
|
|
767
|
+
const Ia = pn ? vr(Pa, S, /* @__PURE__ */ new Date()) : null;
|
|
768
768
|
or(), fr();
|
|
769
|
-
const
|
|
770
|
-
var
|
|
771
|
-
const N = ((
|
|
769
|
+
const ja = !!(B != null && B.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !B.is_direct, qa = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: b.entityUrl(t.entity) }, h) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), Ea = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: b.entityUrl(t.entity), mine: !0 }, h) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), hn = (t, h = {}) => {
|
|
770
|
+
var Sn, Tn;
|
|
771
|
+
const N = ((Sn = t.sender) == null ? void 0 : Sn.toLowerCase()) === je;
|
|
772
772
|
if (t.is_system)
|
|
773
773
|
return /* @__PURE__ */ e(
|
|
774
774
|
"div",
|
|
@@ -785,30 +785,30 @@ function jn({
|
|
|
785
785
|
] })
|
|
786
786
|
}
|
|
787
787
|
);
|
|
788
|
-
const
|
|
788
|
+
const z = h.isLastMine && cn > 0 && new Date(t.date_created).getTime() <= cn, Q = !!t.deleted_at, Oe = N && !Q && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, Ee = !Q && (N || Z), Re = Sa === t.id, be = /* @__PURE__ */ new Map();
|
|
789
789
|
for (const D of t.reactions ?? []) {
|
|
790
|
-
const O =
|
|
791
|
-
O.count++, ((
|
|
790
|
+
const O = be.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
|
|
791
|
+
O.count++, ((Tn = D.user) == null ? void 0 : Tn.toLowerCase()) === je && (O.mine = !0), D.user_name && O.names.push(D.user_name), be.set(D.emoji, O);
|
|
792
792
|
}
|
|
793
|
-
const
|
|
793
|
+
const Be = "rounded-full p-0.5 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200";
|
|
794
794
|
return /* @__PURE__ */ a(
|
|
795
795
|
"div",
|
|
796
796
|
{
|
|
797
797
|
className: g(
|
|
798
798
|
"group/msg flex gap-2 rounded-lg transition-colors",
|
|
799
799
|
N && "flex-row-reverse",
|
|
800
|
-
|
|
800
|
+
Ge === t.id && "bg-nvr-cyan/[0.12]"
|
|
801
801
|
),
|
|
802
802
|
"data-chat-msg": t.id,
|
|
803
803
|
children: [
|
|
804
|
-
!N && /* @__PURE__ */ e(
|
|
804
|
+
!N && /* @__PURE__ */ e(Pt, { userId: t.sender, children: /* @__PURE__ */ e(
|
|
805
805
|
"button",
|
|
806
806
|
{
|
|
807
807
|
type: "button",
|
|
808
808
|
className: "h-fit shrink-0 rounded-full",
|
|
809
809
|
"aria-label": `${t.sender_name ?? "Sender"} — profile`,
|
|
810
810
|
"data-chat-avatar-card": !0,
|
|
811
|
-
children: /* @__PURE__ */ e(
|
|
811
|
+
children: /* @__PURE__ */ e(K, { id: t.sender, name: t.sender_name, size: qe === "compact" ? 22 : 26 })
|
|
812
812
|
}
|
|
813
813
|
) }),
|
|
814
814
|
/* @__PURE__ */ a("div", { className: g("relative max-w-[78%]", N && "text-right"), children: [
|
|
@@ -827,12 +827,12 @@ function jn({
|
|
|
827
827
|
}
|
|
828
828
|
)
|
|
829
829
|
] }),
|
|
830
|
-
!
|
|
830
|
+
!Q && !Re && /* @__PURE__ */ a(
|
|
831
831
|
"div",
|
|
832
832
|
{
|
|
833
833
|
className: g(
|
|
834
834
|
"absolute -top-3 z-10 hidden items-center gap-0.5 rounded-full border px-1 py-0.5 shadow-sm group-hover/msg:flex",
|
|
835
|
-
|
|
835
|
+
Da === t.id && "flex",
|
|
836
836
|
f.surface,
|
|
837
837
|
"border-slate-200 dark:border-border",
|
|
838
838
|
N ? "right-0" : "left-0"
|
|
@@ -843,7 +843,7 @@ function jn({
|
|
|
843
843
|
"button",
|
|
844
844
|
{
|
|
845
845
|
type: "button",
|
|
846
|
-
onClick: () =>
|
|
846
|
+
onClick: () => ae.mutate({ messageId: t.id, emoji: D }),
|
|
847
847
|
className: "rounded-full px-0.5 text-[13px] leading-none transition-transform hover:scale-125",
|
|
848
848
|
title: `React ${D}`,
|
|
849
849
|
children: D
|
|
@@ -854,9 +854,9 @@ function jn({
|
|
|
854
854
|
xr,
|
|
855
855
|
{
|
|
856
856
|
label: "More reactions",
|
|
857
|
-
className:
|
|
858
|
-
onPick: (D) =>
|
|
859
|
-
onOpenChange: (D) =>
|
|
857
|
+
className: Be,
|
|
858
|
+
onPick: (D) => ae.mutate({ messageId: t.id, emoji: D }),
|
|
859
|
+
onOpenChange: (D) => Zt(D ? t.id : null)
|
|
860
860
|
}
|
|
861
861
|
),
|
|
862
862
|
!h.inThread && !t.parent_id && /* @__PURE__ */ e(
|
|
@@ -865,9 +865,9 @@ function jn({
|
|
|
865
865
|
type: "button",
|
|
866
866
|
title: "Reply in thread",
|
|
867
867
|
onClick: () => {
|
|
868
|
-
|
|
868
|
+
ze(!1), Ie(t.id);
|
|
869
869
|
},
|
|
870
|
-
className:
|
|
870
|
+
className: Be,
|
|
871
871
|
"data-chat-reply-thread": !0,
|
|
872
872
|
children: /* @__PURE__ */ e(rs, { className: "h-3 w-3" })
|
|
873
873
|
}
|
|
@@ -877,20 +877,20 @@ function jn({
|
|
|
877
877
|
{
|
|
878
878
|
type: "button",
|
|
879
879
|
title: "Quote",
|
|
880
|
-
onClick: () => h.inThread ?
|
|
881
|
-
className:
|
|
880
|
+
onClick: () => h.inThread ? sn(t) : an(t),
|
|
881
|
+
className: Be,
|
|
882
882
|
"data-chat-quote": !0,
|
|
883
883
|
children: /* @__PURE__ */ e(ls, { className: "h-3 w-3" })
|
|
884
884
|
}
|
|
885
885
|
),
|
|
886
|
-
u && /* @__PURE__ */ a(
|
|
886
|
+
u && /* @__PURE__ */ a(ke, { children: [
|
|
887
887
|
/* @__PURE__ */ e(
|
|
888
888
|
"button",
|
|
889
889
|
{
|
|
890
890
|
type: "button",
|
|
891
891
|
title: "Make a task from this message",
|
|
892
|
-
onClick: () =>
|
|
893
|
-
className:
|
|
892
|
+
onClick: () => $e.mutate(t),
|
|
893
|
+
className: Be,
|
|
894
894
|
children: /* @__PURE__ */ e(os, { className: "h-3 w-3" })
|
|
895
895
|
}
|
|
896
896
|
),
|
|
@@ -900,7 +900,7 @@ function jn({
|
|
|
900
900
|
type: "button",
|
|
901
901
|
title: `Copy into the Notes of ${u.label}`,
|
|
902
902
|
onClick: () => _.mutate(t),
|
|
903
|
-
className:
|
|
903
|
+
className: Be,
|
|
904
904
|
"data-chat-to-notes": !0,
|
|
905
905
|
children: /* @__PURE__ */ e(is, { className: "h-3 w-3" })
|
|
906
906
|
}
|
|
@@ -910,47 +910,47 @@ function jn({
|
|
|
910
910
|
"button",
|
|
911
911
|
{
|
|
912
912
|
type: "button",
|
|
913
|
-
title:
|
|
913
|
+
title: ue.some((D) => D.id === t.id) ? "Unpin" : "Pin",
|
|
914
914
|
onClick: () => c.mutate(t.id),
|
|
915
915
|
className: g(
|
|
916
916
|
"rounded-full p-0.5",
|
|
917
|
-
|
|
917
|
+
ue.some((D) => D.id === t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
|
|
918
918
|
),
|
|
919
|
-
children: /* @__PURE__ */ e(
|
|
919
|
+
children: /* @__PURE__ */ e(Ut, { className: "h-3 w-3" })
|
|
920
920
|
}
|
|
921
921
|
),
|
|
922
922
|
/* @__PURE__ */ e(
|
|
923
923
|
"button",
|
|
924
924
|
{
|
|
925
925
|
type: "button",
|
|
926
|
-
title:
|
|
926
|
+
title: Ce.has(t.id) ? "Remove from saved" : "Save for later (personal bookmark)",
|
|
927
927
|
onClick: () => k.mutate(t.id),
|
|
928
928
|
className: g(
|
|
929
929
|
"rounded-full p-0.5",
|
|
930
|
-
|
|
930
|
+
Ce.has(t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
|
|
931
931
|
),
|
|
932
932
|
children: /* @__PURE__ */ e(cs, { className: "h-3 w-3" })
|
|
933
933
|
}
|
|
934
934
|
),
|
|
935
|
-
|
|
935
|
+
Oe && /* @__PURE__ */ e(
|
|
936
936
|
"button",
|
|
937
937
|
{
|
|
938
938
|
type: "button",
|
|
939
939
|
title: "Edit",
|
|
940
940
|
onClick: () => {
|
|
941
|
-
|
|
941
|
+
ht(t.id), Yt(t.message), ft(null);
|
|
942
942
|
},
|
|
943
|
-
className:
|
|
943
|
+
className: Be,
|
|
944
944
|
children: /* @__PURE__ */ e(ds, { className: "h-3 w-3" })
|
|
945
945
|
}
|
|
946
946
|
),
|
|
947
|
-
|
|
947
|
+
Ee && (Ta === t.id ? /* @__PURE__ */ e(
|
|
948
948
|
"button",
|
|
949
949
|
{
|
|
950
950
|
type: "button",
|
|
951
951
|
title: "Confirm delete",
|
|
952
952
|
onClick: () => {
|
|
953
|
-
|
|
953
|
+
V.mutate(t.id), ft(null);
|
|
954
954
|
},
|
|
955
955
|
className: "rounded-full px-1 text-[10px] font-semibold text-red-500",
|
|
956
956
|
children: "Sure?"
|
|
@@ -960,7 +960,7 @@ function jn({
|
|
|
960
960
|
{
|
|
961
961
|
type: "button",
|
|
962
962
|
title: N ? "Delete" : "Delete (admin)",
|
|
963
|
-
onClick: () =>
|
|
963
|
+
onClick: () => ft(t.id),
|
|
964
964
|
className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
|
|
965
965
|
children: /* @__PURE__ */ e(us, { className: "h-3 w-3" })
|
|
966
966
|
}
|
|
@@ -969,15 +969,15 @@ function jn({
|
|
|
969
969
|
Dr,
|
|
970
970
|
{
|
|
971
971
|
messageId: t.id,
|
|
972
|
-
actions: $r(
|
|
972
|
+
actions: $r(Ua, t, je),
|
|
973
973
|
navigate: b.navigate,
|
|
974
|
-
onOpenChange: (D) =>
|
|
974
|
+
onOpenChange: (D) => Zt(D ? t.id : null)
|
|
975
975
|
}
|
|
976
976
|
)
|
|
977
977
|
]
|
|
978
978
|
}
|
|
979
979
|
),
|
|
980
|
-
t.urgent && !
|
|
980
|
+
t.urgent && !Q && /* @__PURE__ */ a(
|
|
981
981
|
"p",
|
|
982
982
|
{
|
|
983
983
|
className: g(
|
|
@@ -991,24 +991,24 @@ function jn({
|
|
|
991
991
|
]
|
|
992
992
|
}
|
|
993
993
|
),
|
|
994
|
-
|
|
994
|
+
Q ? /* @__PURE__ */ e("div", { className: "inline-block rounded-2xl border border-dashed border-slate-200 px-3 py-1.5 text-left text-[11.5px] italic text-slate-500 dark:border-border", children: "Message removed" }) : Re ? /* @__PURE__ */ a(
|
|
995
995
|
"form",
|
|
996
996
|
{
|
|
997
997
|
className: "flex items-center gap-1",
|
|
998
998
|
onSubmit: (D) => {
|
|
999
999
|
D.preventDefault();
|
|
1000
|
-
const O =
|
|
1001
|
-
O && O !== t.message &&
|
|
1000
|
+
const O = Jt.trim();
|
|
1001
|
+
O && O !== t.message && oe.mutate({ messageId: t.id, text: O }), ht(null);
|
|
1002
1002
|
},
|
|
1003
1003
|
children: [
|
|
1004
1004
|
/* @__PURE__ */ e(
|
|
1005
1005
|
"input",
|
|
1006
1006
|
{
|
|
1007
1007
|
autoFocus: !0,
|
|
1008
|
-
value:
|
|
1009
|
-
onChange: (D) =>
|
|
1008
|
+
value: Jt,
|
|
1009
|
+
onChange: (D) => Yt(D.target.value),
|
|
1010
1010
|
onKeyDown: (D) => {
|
|
1011
|
-
D.key === "Escape" &&
|
|
1011
|
+
D.key === "Escape" && ht(null);
|
|
1012
1012
|
},
|
|
1013
1013
|
className: g(
|
|
1014
1014
|
"h-8 w-[240px] rounded-lg border px-2 text-[12px] outline-none",
|
|
@@ -1032,7 +1032,7 @@ function jn({
|
|
|
1032
1032
|
{
|
|
1033
1033
|
className: g(
|
|
1034
1034
|
"inline-block max-w-full rounded-2xl text-left leading-snug",
|
|
1035
|
-
|
|
1035
|
+
qe === "compact" ? "px-2.5 py-1 text-[12px]" : "px-3 py-1.5 text-[12.5px]",
|
|
1036
1036
|
N ? g("rounded-br-md", f.bubbleMine) : g("rounded-bl-md", f.bubbleOther),
|
|
1037
1037
|
t.urgent && "ring-2 ring-red-400/70"
|
|
1038
1038
|
),
|
|
@@ -1041,7 +1041,7 @@ function jn({
|
|
|
1041
1041
|
"button",
|
|
1042
1042
|
{
|
|
1043
1043
|
type: "button",
|
|
1044
|
-
onClick: () =>
|
|
1044
|
+
onClick: () => on(t.quote.id),
|
|
1045
1045
|
className: g(
|
|
1046
1046
|
"mb-1 block w-full rounded-md border-l-2 px-2 py-1 text-left text-[11px]",
|
|
1047
1047
|
N ? "border-white/60 bg-black/10" : "border-slate-400 bg-white/70 dark:border-slate-500 dark:bg-black/20"
|
|
@@ -1053,93 +1053,93 @@ function jn({
|
|
|
1053
1053
|
]
|
|
1054
1054
|
}
|
|
1055
1055
|
),
|
|
1056
|
-
t.message &&
|
|
1056
|
+
t.message && Ln(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
|
|
1057
1057
|
Ar,
|
|
1058
1058
|
{
|
|
1059
|
-
text:
|
|
1059
|
+
text: Ln(t.message),
|
|
1060
1060
|
mine: N,
|
|
1061
|
-
renderToken: N ?
|
|
1061
|
+
renderToken: N ? Ea : qa,
|
|
1062
1062
|
entityPattern: b.entityPattern,
|
|
1063
1063
|
timeRefs: t.time_refs,
|
|
1064
1064
|
navigate: b.navigate
|
|
1065
1065
|
}
|
|
1066
1066
|
)),
|
|
1067
|
-
|
|
1067
|
+
Pn(t.message) != null && /* @__PURE__ */ e(
|
|
1068
1068
|
Nr,
|
|
1069
1069
|
{
|
|
1070
|
-
id:
|
|
1070
|
+
id: Pn(t.message),
|
|
1071
1071
|
mine: N,
|
|
1072
|
-
renderAvatar: (D, O) => /* @__PURE__ */ e(
|
|
1072
|
+
renderAvatar: (D, O) => /* @__PURE__ */ e(K, { id: D, name: O, size: 18, presence: !1 })
|
|
1073
1073
|
}
|
|
1074
1074
|
),
|
|
1075
1075
|
t.poll && /* @__PURE__ */ e(Mr, { poll: t.poll, room: t.room, mine: N }),
|
|
1076
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) => {
|
|
1077
|
-
const O =
|
|
1077
|
+
const O = Nt == null ? void 0 : Nt.get(D), ot = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", Ct = p.fileUrl(D), Ba = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), it = Br(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), Un = () => Xt({
|
|
1078
1078
|
id: D,
|
|
1079
|
-
url:
|
|
1080
|
-
name:
|
|
1079
|
+
url: Ct,
|
|
1080
|
+
name: ot,
|
|
1081
1081
|
type: (O == null ? void 0 : O.type) ?? null,
|
|
1082
1082
|
size: (O == null ? void 0 : O.filesize) ?? null
|
|
1083
|
-
}),
|
|
1083
|
+
}), ct = u && J.length > 0 ? /* @__PURE__ */ e(
|
|
1084
1084
|
Vr,
|
|
1085
1085
|
{
|
|
1086
|
-
targets:
|
|
1086
|
+
targets: J,
|
|
1087
1087
|
recordLabel: u.label,
|
|
1088
|
-
onPick: (
|
|
1088
|
+
onPick: (Wa) => I.mutate({ messageId: t.id, fileId: D, field: Wa })
|
|
1089
1089
|
}
|
|
1090
1090
|
) : null;
|
|
1091
|
-
return
|
|
1091
|
+
return it ? /* @__PURE__ */ e(
|
|
1092
1092
|
Wr,
|
|
1093
1093
|
{
|
|
1094
|
-
url:
|
|
1095
|
-
poster:
|
|
1096
|
-
name:
|
|
1097
|
-
durationMs:
|
|
1098
|
-
action:
|
|
1094
|
+
url: Ct,
|
|
1095
|
+
poster: it.poster ? p.fileUrl(it.poster) : null,
|
|
1096
|
+
name: ot,
|
|
1097
|
+
durationMs: it.durationMs,
|
|
1098
|
+
action: ct
|
|
1099
1099
|
},
|
|
1100
1100
|
D
|
|
1101
|
-
) :
|
|
1101
|
+
) : Ba ? /* @__PURE__ */ a("span", { className: "relative inline-block", children: [
|
|
1102
1102
|
/* @__PURE__ */ e(
|
|
1103
1103
|
"button",
|
|
1104
1104
|
{
|
|
1105
1105
|
type: "button",
|
|
1106
|
-
onClick:
|
|
1106
|
+
onClick: Un,
|
|
1107
1107
|
className: "block cursor-zoom-in",
|
|
1108
1108
|
children: /* @__PURE__ */ e(
|
|
1109
1109
|
"img",
|
|
1110
1110
|
{
|
|
1111
|
-
src:
|
|
1112
|
-
alt:
|
|
1111
|
+
src: Ct,
|
|
1112
|
+
alt: ot,
|
|
1113
1113
|
className: "max-h-40 max-w-[220px] rounded-lg object-cover",
|
|
1114
1114
|
loading: "lazy"
|
|
1115
1115
|
}
|
|
1116
1116
|
)
|
|
1117
1117
|
}
|
|
1118
1118
|
),
|
|
1119
|
-
|
|
1119
|
+
ct && /* @__PURE__ */ e("span", { className: "absolute right-1 top-1", children: ct })
|
|
1120
1120
|
] }, D) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1", children: [
|
|
1121
1121
|
/* @__PURE__ */ a(
|
|
1122
1122
|
"button",
|
|
1123
1123
|
{
|
|
1124
1124
|
type: "button",
|
|
1125
|
-
onClick:
|
|
1125
|
+
onClick: Un,
|
|
1126
1126
|
className: g(
|
|
1127
1127
|
"inline-flex max-w-[220px] items-center gap-1.5 rounded-lg border px-2 py-1 text-[11.5px]",
|
|
1128
1128
|
N ? "border-white/30 bg-white/10" : "border-slate-200 bg-white dark:border-border dark:bg-card"
|
|
1129
1129
|
),
|
|
1130
1130
|
children: [
|
|
1131
1131
|
/* @__PURE__ */ e(ps, { className: "h-3 w-3 shrink-0 opacity-60" }),
|
|
1132
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
1132
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: ot })
|
|
1133
1133
|
]
|
|
1134
1134
|
}
|
|
1135
1135
|
),
|
|
1136
|
-
|
|
1136
|
+
ct
|
|
1137
1137
|
] }, D);
|
|
1138
1138
|
}) })
|
|
1139
1139
|
]
|
|
1140
1140
|
}
|
|
1141
1141
|
),
|
|
1142
|
-
!
|
|
1142
|
+
!Q && !Re && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
|
|
1143
1143
|
Rr,
|
|
1144
1144
|
{
|
|
1145
1145
|
text: t.message,
|
|
@@ -1147,17 +1147,17 @@ function jn({
|
|
|
1147
1147
|
onDismiss: N ? () => j.mutate(t.id) : void 0
|
|
1148
1148
|
}
|
|
1149
1149
|
) }),
|
|
1150
|
-
|
|
1150
|
+
be.size > 0 && /* @__PURE__ */ e(
|
|
1151
1151
|
"div",
|
|
1152
1152
|
{
|
|
1153
1153
|
className: g("mt-0.5 flex flex-wrap gap-1", N && "justify-end"),
|
|
1154
1154
|
"data-chat-reactions": !0,
|
|
1155
|
-
children: [...
|
|
1155
|
+
children: [...be.entries()].map(([D, O]) => /* @__PURE__ */ a(
|
|
1156
1156
|
"button",
|
|
1157
1157
|
{
|
|
1158
1158
|
type: "button",
|
|
1159
1159
|
title: O.names.join(", "),
|
|
1160
|
-
onClick: () =>
|
|
1160
|
+
onClick: () => ae.mutate({ messageId: t.id, emoji: D }),
|
|
1161
1161
|
className: g(
|
|
1162
1162
|
"inline-flex items-center gap-0.5 rounded-full border px-1.5 py-px text-[10.5px] leading-tight transition-colors",
|
|
1163
1163
|
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"
|
|
@@ -1175,7 +1175,7 @@ function jn({
|
|
|
1175
1175
|
"button",
|
|
1176
1176
|
{
|
|
1177
1177
|
type: "button",
|
|
1178
|
-
onClick: () =>
|
|
1178
|
+
onClick: () => Ie(t.id),
|
|
1179
1179
|
className: g(
|
|
1180
1180
|
"mt-1 flex items-center gap-1.5 rounded-md px-1 py-0.5 text-[11px] font-medium hover:bg-slate-100 dark:hover:bg-muted",
|
|
1181
1181
|
f.accentText,
|
|
@@ -1183,13 +1183,13 @@ function jn({
|
|
|
1183
1183
|
),
|
|
1184
1184
|
"data-chat-thread-summary": t.thread.count,
|
|
1185
1185
|
children: [
|
|
1186
|
-
/* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((D) => /* @__PURE__ */ e(
|
|
1186
|
+
/* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((D) => /* @__PURE__ */ e(K, { id: D.id, name: D.name, size: 16, presence: !1 }, D.id)) }),
|
|
1187
1187
|
t.thread.count,
|
|
1188
1188
|
" ",
|
|
1189
1189
|
t.thread.count === 1 ? "reply" : "replies",
|
|
1190
1190
|
t.thread.last_reply_at && /* @__PURE__ */ a("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: [
|
|
1191
1191
|
"· last ",
|
|
1192
|
-
|
|
1192
|
+
Kn(t.thread.last_reply_at)
|
|
1193
1193
|
] })
|
|
1194
1194
|
]
|
|
1195
1195
|
}
|
|
@@ -1211,14 +1211,14 @@ function jn({
|
|
|
1211
1211
|
]
|
|
1212
1212
|
}
|
|
1213
1213
|
),
|
|
1214
|
-
t.edited_at && !
|
|
1214
|
+
t.edited_at && !Q && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
|
|
1215
1215
|
new Date(t.date_created).toLocaleTimeString("en-US", {
|
|
1216
1216
|
hour: "numeric",
|
|
1217
1217
|
minute: "2-digit"
|
|
1218
1218
|
}),
|
|
1219
|
-
N &&
|
|
1219
|
+
N && Ue && !Q && (() => {
|
|
1220
1220
|
var O;
|
|
1221
|
-
const D =
|
|
1221
|
+
const D = Pe(t);
|
|
1222
1222
|
return D.length === 0 ? null : /* @__PURE__ */ e(
|
|
1223
1223
|
tl,
|
|
1224
1224
|
{
|
|
@@ -1228,11 +1228,11 @@ function jn({
|
|
|
1228
1228
|
}
|
|
1229
1229
|
);
|
|
1230
1230
|
})(),
|
|
1231
|
-
h.isLastMine && n.startsWith("dm:") && (
|
|
1231
|
+
h.isLastMine && n.startsWith("dm:") && (z ? /* @__PURE__ */ a("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
|
|
1232
1232
|
/* @__PURE__ */ e(fs, { className: "h-3 w-3", strokeWidth: 2.4 }),
|
|
1233
1233
|
" Read"
|
|
1234
1234
|
] }) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-0.5", children: [
|
|
1235
|
-
/* @__PURE__ */ e(
|
|
1235
|
+
/* @__PURE__ */ e(Ot, { className: "h-3 w-3", strokeWidth: 2.2 }),
|
|
1236
1236
|
" Sent"
|
|
1237
1237
|
] }))
|
|
1238
1238
|
] })
|
|
@@ -1240,20 +1240,20 @@ function jn({
|
|
|
1240
1240
|
]
|
|
1241
1241
|
}
|
|
1242
1242
|
);
|
|
1243
|
-
},
|
|
1243
|
+
}, fn = (t) => /* @__PURE__ */ e(
|
|
1244
1244
|
Fs,
|
|
1245
1245
|
{
|
|
1246
|
-
ref: t ? void 0 :
|
|
1246
|
+
ref: t ? void 0 : rn,
|
|
1247
1247
|
room: n,
|
|
1248
1248
|
label: S,
|
|
1249
1249
|
parentId: t,
|
|
1250
|
-
quote: t ?
|
|
1251
|
-
onClearQuote: () => t ?
|
|
1252
|
-
onSent:
|
|
1253
|
-
disabledReason: t ? null :
|
|
1254
|
-
quietNote:
|
|
1250
|
+
quote: t ? Aa : $a,
|
|
1251
|
+
onClearQuote: () => t ? sn(null) : an(null),
|
|
1252
|
+
onSent: Ma,
|
|
1253
|
+
disabledReason: t ? null : mn,
|
|
1254
|
+
quietNote: Ia,
|
|
1255
1255
|
th: f,
|
|
1256
|
-
renderAvatar: (h, N) => /* @__PURE__ */ e(
|
|
1256
|
+
renderAvatar: (h, N) => /* @__PURE__ */ e(K, { id: h, name: N, size: 22, presence: h !== "__bot__" })
|
|
1257
1257
|
}
|
|
1258
1258
|
);
|
|
1259
1259
|
return /* @__PURE__ */ a(
|
|
@@ -1262,17 +1262,17 @@ function jn({
|
|
|
1262
1262
|
className: "relative flex h-full min-h-0 flex-col",
|
|
1263
1263
|
"data-chat-room": n,
|
|
1264
1264
|
onDragOver: (t) => {
|
|
1265
|
-
t.dataTransfer.types.includes("Files") && !
|
|
1265
|
+
t.dataTransfer.types.includes("Files") && !mn && (t.preventDefault(), bt(!0));
|
|
1266
1266
|
},
|
|
1267
1267
|
onDragLeave: (t) => {
|
|
1268
|
-
t.currentTarget.contains(t.relatedTarget) ||
|
|
1268
|
+
t.currentTarget.contains(t.relatedTarget) || bt(!1);
|
|
1269
1269
|
},
|
|
1270
1270
|
onDrop: (t) => {
|
|
1271
1271
|
var h;
|
|
1272
|
-
t.dataTransfer.files.length && (t.preventDefault(),
|
|
1272
|
+
t.dataTransfer.files.length && (t.preventDefault(), bt(!1), (h = rn.current) == null || h.addFiles([...t.dataTransfer.files]));
|
|
1273
1273
|
},
|
|
1274
1274
|
children: [
|
|
1275
|
-
|
|
1275
|
+
Ra && /* @__PURE__ */ e(
|
|
1276
1276
|
"div",
|
|
1277
1277
|
{
|
|
1278
1278
|
className: "pointer-events-none absolute inset-2 z-30 flex items-center justify-center rounded-xl border-2 border-dashed border-nvr-cyan bg-white/85 text-[13px] font-semibold text-slate-700 dark:bg-card/90 dark:text-slate-100",
|
|
@@ -1288,16 +1288,16 @@ function jn({
|
|
|
1288
1288
|
onClick: l,
|
|
1289
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",
|
|
1290
1290
|
"aria-label": "Back to conversations",
|
|
1291
|
-
children: /* @__PURE__ */ e(
|
|
1291
|
+
children: /* @__PURE__ */ e(ut, { className: "h-4 w-4", strokeWidth: 2 })
|
|
1292
1292
|
}
|
|
1293
1293
|
),
|
|
1294
|
-
((w == null ? void 0 : w.kind) === "channel" && !((
|
|
1295
|
-
x &&
|
|
1294
|
+
((w == null ? void 0 : w.kind) === "channel" && !((gn = w.channel) != null && gn.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((vn = w.channel) == null ? void 0 : vn.icon) || ((yn = w.channel) == null ? void 0 : yn.color))) && /* @__PURE__ */ e(Ye, { icon: (kn = w == null ? void 0 : w.channel) == null ? void 0 : kn.icon, color: (wn = w == null ? void 0 : w.channel) == null ? void 0 : wn.color, size: 24 }),
|
|
1295
|
+
x && Se(n, x.id) && /* @__PURE__ */ e(Hr, { peerId: Se(n, x.id), name: S }),
|
|
1296
1296
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1297
1297
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
1298
1298
|
/* @__PURE__ */ e("span", { className: "truncate", children: S }),
|
|
1299
|
-
w && /* @__PURE__ */ e(Or, { starred: !!w.starred, notify:
|
|
1300
|
-
(
|
|
1299
|
+
w && /* @__PURE__ */ e(Or, { starred: !!w.starred, notify: Qt }),
|
|
1300
|
+
(B == null ? void 0 : B.announce) && /* @__PURE__ */ e(
|
|
1301
1301
|
"span",
|
|
1302
1302
|
{
|
|
1303
1303
|
className: "shrink-0 rounded bg-slate-100 px-1.5 py-px text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
@@ -1306,12 +1306,12 @@ function jn({
|
|
|
1306
1306
|
}
|
|
1307
1307
|
)
|
|
1308
1308
|
] }),
|
|
1309
|
-
x &&
|
|
1309
|
+
x && Se(n, x.id) ? /* @__PURE__ */ e(Yr, { peerId: Se(n, x.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
|
|
1310
1310
|
Pr,
|
|
1311
1311
|
{
|
|
1312
1312
|
room: n,
|
|
1313
|
-
me: ((
|
|
1314
|
-
renderAvatar: (t, h) => /* @__PURE__ */ e(
|
|
1313
|
+
me: ((Nn = b.me) == null ? void 0 : Nn.id) ?? null,
|
|
1314
|
+
renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 24 })
|
|
1315
1315
|
}
|
|
1316
1316
|
) : null
|
|
1317
1317
|
] }),
|
|
@@ -1321,7 +1321,7 @@ function jn({
|
|
|
1321
1321
|
room: n,
|
|
1322
1322
|
roomLabel: S,
|
|
1323
1323
|
huddle: v,
|
|
1324
|
-
renderAvatar: (t, h) => /* @__PURE__ */ e(
|
|
1324
|
+
renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 18, presence: !1 })
|
|
1325
1325
|
}
|
|
1326
1326
|
),
|
|
1327
1327
|
/* @__PURE__ */ e(
|
|
@@ -1329,29 +1329,29 @@ function jn({
|
|
|
1329
1329
|
{
|
|
1330
1330
|
type: "button",
|
|
1331
1331
|
onClick: () => {
|
|
1332
|
-
|
|
1332
|
+
_a((t) => !t), Kt("");
|
|
1333
1333
|
},
|
|
1334
|
-
className: g(
|
|
1334
|
+
className: g(jn, tt ? f.accentSoft : In),
|
|
1335
1335
|
"aria-label": "Search in this conversation",
|
|
1336
|
-
"aria-pressed":
|
|
1336
|
+
"aria-pressed": tt,
|
|
1337
1337
|
"data-tip": "Search this conversation",
|
|
1338
|
-
children: /* @__PURE__ */ e(
|
|
1338
|
+
children: /* @__PURE__ */ e(Gn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1339
1339
|
}
|
|
1340
1340
|
),
|
|
1341
|
-
((
|
|
1341
|
+
((Cn = w == null ? void 0 : w.channel) == null ? void 0 : Cn.is_direct) && /* @__PURE__ */ e(nl, { channel: w.channel, onLeft: l }),
|
|
1342
1342
|
/* @__PURE__ */ e(
|
|
1343
1343
|
"button",
|
|
1344
1344
|
{
|
|
1345
1345
|
type: "button",
|
|
1346
1346
|
onClick: () => {
|
|
1347
|
-
|
|
1347
|
+
Ie(null), ze((t) => !t);
|
|
1348
1348
|
},
|
|
1349
|
-
className: g(
|
|
1349
|
+
className: g(jn, xt ? f.accentSoft : In),
|
|
1350
1350
|
"aria-label": "Room info — members, pinned, files and links",
|
|
1351
|
-
"aria-pressed":
|
|
1351
|
+
"aria-pressed": xt,
|
|
1352
1352
|
"data-tip": "Room info — members, pinned, files and links",
|
|
1353
1353
|
"data-chat-info-button": !0,
|
|
1354
|
-
children: /* @__PURE__ */ e(
|
|
1354
|
+
children: /* @__PURE__ */ e(as, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1355
1355
|
}
|
|
1356
1356
|
),
|
|
1357
1357
|
/* @__PURE__ */ e(
|
|
@@ -1364,42 +1364,42 @@ function jn({
|
|
|
1364
1364
|
room: n,
|
|
1365
1365
|
me: (x == null ? void 0 : x.id) ?? null,
|
|
1366
1366
|
theme: { input: f.input },
|
|
1367
|
-
renderAvatar: (h, N) => /* @__PURE__ */ e(
|
|
1367
|
+
renderAvatar: (h, N) => /* @__PURE__ */ e(K, { id: h, name: N, size: 18, presence: !1 }),
|
|
1368
1368
|
onDone: t
|
|
1369
1369
|
}
|
|
1370
1370
|
) : void 0,
|
|
1371
1371
|
starred: w ? !!w.starred : void 0,
|
|
1372
|
-
onStar: w ? () =>
|
|
1373
|
-
notify: w ?
|
|
1372
|
+
onStar: w ? () => ga.mutate({ room: n, starred: !w.starred }) : void 0,
|
|
1373
|
+
notify: w ? Qt : void 0,
|
|
1374
1374
|
onNotify: w ? (t) => {
|
|
1375
|
-
t === "muted" ?
|
|
1375
|
+
t === "muted" ? G.mutate({ room: n, muted: !0 }) : (w.muted && G.mutate({ room: n, muted: !1 }), se.mutate({ room: n, mode: t }));
|
|
1376
1376
|
} : void 0,
|
|
1377
1377
|
onJump: (t) => {
|
|
1378
|
-
|
|
1378
|
+
Ae.current = !1, re.current = !1, R({ date: t });
|
|
1379
1379
|
},
|
|
1380
1380
|
onOpenRecord: le ? () => {
|
|
1381
1381
|
var t;
|
|
1382
1382
|
return (t = b.navigate) == null ? void 0 : t.call(b, le);
|
|
1383
1383
|
} : void 0,
|
|
1384
|
-
onTeamsCall: n.startsWith("dm:") || (
|
|
1384
|
+
onTeamsCall: n.startsWith("dm:") || (_n = w == null ? void 0 : w.channel) != null && _n.is_direct ? async () => {
|
|
1385
1385
|
var t, h;
|
|
1386
1386
|
try {
|
|
1387
1387
|
let N = [];
|
|
1388
1388
|
if (n.startsWith("dm:") && x) {
|
|
1389
|
-
const
|
|
1390
|
-
if (
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1389
|
+
const z = Se(n, x.id);
|
|
1390
|
+
if (z) {
|
|
1391
|
+
const Q = await p.request(
|
|
1392
|
+
ye(`/users/${z}`)
|
|
1393
1393
|
);
|
|
1394
|
-
(t =
|
|
1394
|
+
(t = Q.data) != null && t.email && (N = [Q.data.email]);
|
|
1395
1395
|
}
|
|
1396
1396
|
} else (h = w == null ? void 0 : w.channel) != null && h.id && (N = (await p.request(
|
|
1397
|
-
|
|
1397
|
+
ye(
|
|
1398
1398
|
`/chat/channels/${w.channel.id}/members`
|
|
1399
1399
|
)
|
|
1400
|
-
)).data.filter((
|
|
1400
|
+
)).data.filter((Q) => Q.email && Q.user.toUpperCase() !== (x == null ? void 0 : x.id.toUpperCase())).map((Q) => Q.email));
|
|
1401
1401
|
if (N.length === 0) {
|
|
1402
|
-
|
|
1402
|
+
ge.error("No callable participants found");
|
|
1403
1403
|
return;
|
|
1404
1404
|
}
|
|
1405
1405
|
window.open(
|
|
@@ -1408,16 +1408,16 @@ function jn({
|
|
|
1408
1408
|
"noopener"
|
|
1409
1409
|
);
|
|
1410
1410
|
} catch {
|
|
1411
|
-
|
|
1411
|
+
ge.error("Could not resolve participants");
|
|
1412
1412
|
}
|
|
1413
1413
|
} : void 0,
|
|
1414
1414
|
onSettings: r,
|
|
1415
1415
|
archived: !!(w != null && w.archived),
|
|
1416
|
-
onArchive: w &&
|
|
1416
|
+
onArchive: w && Ca ? () => fe.mutate(
|
|
1417
1417
|
{ room: n, archived: !w.archived },
|
|
1418
1418
|
{
|
|
1419
1419
|
onSuccess: () => {
|
|
1420
|
-
w.archived ?
|
|
1420
|
+
w.archived ? ge.success("Moved back to your chats") : (ge.success(
|
|
1421
1421
|
"Archived for you — others in the conversation still see it",
|
|
1422
1422
|
{
|
|
1423
1423
|
description: "Find it under the Archived tab."
|
|
@@ -1426,14 +1426,14 @@ function jn({
|
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
1428
1428
|
) : void 0,
|
|
1429
|
-
onLeave: (w == null ? void 0 : w.kind) === "entity" && w.joined ? () =>
|
|
1429
|
+
onLeave: (w == null ? void 0 : w.kind) === "entity" && w.joined ? () => ya.mutate(n, {
|
|
1430
1430
|
onSuccess: () => {
|
|
1431
|
-
|
|
1431
|
+
ge.success(`Left ${w.label}`, {
|
|
1432
1432
|
description: "Open the record's chat again to rejoin."
|
|
1433
1433
|
}), l();
|
|
1434
1434
|
}
|
|
1435
1435
|
}) : void 0,
|
|
1436
|
-
tips: /* @__PURE__ */ e(Qr, { botName:
|
|
1436
|
+
tips: /* @__PURE__ */ e(Qr, { botName: me })
|
|
1437
1437
|
}
|
|
1438
1438
|
)
|
|
1439
1439
|
] }),
|
|
@@ -1443,143 +1443,143 @@ function jn({
|
|
|
1443
1443
|
room: n,
|
|
1444
1444
|
me: x,
|
|
1445
1445
|
huddle: v,
|
|
1446
|
-
renderAvatar: (t, h) => /* @__PURE__ */ e(
|
|
1446
|
+
renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 18, presence: !1 })
|
|
1447
1447
|
}
|
|
1448
1448
|
),
|
|
1449
|
-
|
|
1449
|
+
tt && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1.5", f.divider), children: /* @__PURE__ */ e(
|
|
1450
1450
|
"input",
|
|
1451
1451
|
{
|
|
1452
1452
|
autoFocus: !0,
|
|
1453
|
-
value:
|
|
1454
|
-
onChange: (t) =>
|
|
1453
|
+
value: nt,
|
|
1454
|
+
onChange: (t) => Kt(t.target.value),
|
|
1455
1455
|
placeholder: "Search messages…",
|
|
1456
1456
|
className: g("h-7 w-full rounded-md border px-2 text-[12px] outline-none", f.input),
|
|
1457
1457
|
"aria-label": "Search messages"
|
|
1458
1458
|
}
|
|
1459
1459
|
) }),
|
|
1460
1460
|
/* @__PURE__ */ e(Kr, { room: n }),
|
|
1461
|
-
|
|
1461
|
+
B && !B.is_direct && /* @__PURE__ */ e(
|
|
1462
1462
|
Ir,
|
|
1463
1463
|
{
|
|
1464
|
-
description:
|
|
1465
|
-
links:
|
|
1464
|
+
description: B.description,
|
|
1465
|
+
links: B.links,
|
|
1466
1466
|
th: f,
|
|
1467
1467
|
navigate: b.navigate
|
|
1468
1468
|
}
|
|
1469
1469
|
),
|
|
1470
|
-
|
|
1470
|
+
ue.length > 0 && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1", f.divider), "data-chat-pins-strip": !0, children: /* @__PURE__ */ a(
|
|
1471
1471
|
"button",
|
|
1472
1472
|
{
|
|
1473
1473
|
type: "button",
|
|
1474
1474
|
onClick: () => {
|
|
1475
|
-
|
|
1475
|
+
Ie(null), ze(!0);
|
|
1476
1476
|
},
|
|
1477
1477
|
className: "flex w-full items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-slate-400",
|
|
1478
1478
|
children: [
|
|
1479
|
-
/* @__PURE__ */ e(
|
|
1480
|
-
|
|
1479
|
+
/* @__PURE__ */ e(Ut, { className: "h-3 w-3", strokeWidth: 2 }),
|
|
1480
|
+
ue.length,
|
|
1481
1481
|
" pinned",
|
|
1482
|
-
/* @__PURE__ */ e(
|
|
1482
|
+
/* @__PURE__ */ e(ut, { className: "ml-auto h-3 w-3 -rotate-90" })
|
|
1483
1483
|
]
|
|
1484
1484
|
}
|
|
1485
1485
|
) }),
|
|
1486
|
-
(
|
|
1486
|
+
(B == null ? void 0 : B.archive_suggested_at) && B.id !== 0 && (un || Z) && /* @__PURE__ */ e(
|
|
1487
1487
|
Ls,
|
|
1488
1488
|
{
|
|
1489
|
-
channelId:
|
|
1489
|
+
channelId: B.id,
|
|
1490
1490
|
channelName: S,
|
|
1491
|
-
suggestedAt:
|
|
1491
|
+
suggestedAt: B.archive_suggested_at
|
|
1492
1492
|
}
|
|
1493
1493
|
),
|
|
1494
|
-
|
|
1494
|
+
ja && (B == null ? void 0 : B.welcome_note) && /* @__PURE__ */ e(
|
|
1495
1495
|
jr,
|
|
1496
1496
|
{
|
|
1497
|
-
note:
|
|
1497
|
+
note: B.welcome_note,
|
|
1498
1498
|
channelName: S,
|
|
1499
1499
|
th: f,
|
|
1500
|
-
onDismiss: () =>
|
|
1500
|
+
onDismiss: () => va.mutate(n)
|
|
1501
1501
|
}
|
|
1502
1502
|
),
|
|
1503
1503
|
/* @__PURE__ */ e(
|
|
1504
1504
|
"div",
|
|
1505
1505
|
{
|
|
1506
|
-
ref:
|
|
1506
|
+
ref: Me,
|
|
1507
1507
|
onScroll: (t) => {
|
|
1508
1508
|
const h = t.currentTarget;
|
|
1509
|
-
re.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48,
|
|
1509
|
+
re.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, kt.current = h.scrollHeight, re.current && ie && He(null), we.onScroll(), h.scrollTop < 200 && A && !H && !xe && Ae.current && F();
|
|
1510
1510
|
},
|
|
1511
1511
|
className: "relative min-h-0 flex-1 overflow-y-auto px-3 py-3 [overflow-anchor:none]",
|
|
1512
1512
|
"data-chat-messages": !0,
|
|
1513
|
-
children: /* @__PURE__ */ a("div", { ref:
|
|
1514
|
-
A && !
|
|
1513
|
+
children: /* @__PURE__ */ a("div", { ref: ln, className: qe === "compact" ? "space-y-1" : "space-y-2.5", children: [
|
|
1514
|
+
A && !xe && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
|
|
1515
1515
|
"button",
|
|
1516
1516
|
{
|
|
1517
1517
|
type: "button",
|
|
1518
|
-
disabled:
|
|
1518
|
+
disabled: H,
|
|
1519
1519
|
onClick: () => {
|
|
1520
1520
|
var t;
|
|
1521
|
-
|
|
1521
|
+
kt.current = ((t = Me.current) == null ? void 0 : t.scrollHeight) ?? 0, F();
|
|
1522
1522
|
},
|
|
1523
1523
|
className: "rounded-full border border-slate-200 px-2.5 py-0.5 text-[11px] font-medium text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:text-slate-300",
|
|
1524
1524
|
"data-chat-load-older": !0,
|
|
1525
|
-
children:
|
|
1525
|
+
children: H ? "Loading…" : "Load earlier messages"
|
|
1526
1526
|
}
|
|
1527
1527
|
) }),
|
|
1528
|
-
q ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) :
|
|
1528
|
+
q ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : _e.length === 0 && ee.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: xe ? "No messages match." : E ? "Nothing was said around then." : /* @__PURE__ */ a(ke, { children: [
|
|
1529
1529
|
/* @__PURE__ */ e("p", { children: "No messages yet — say hello." }),
|
|
1530
1530
|
/* @__PURE__ */ a("p", { className: "mt-1 text-[11px]", children: [
|
|
1531
1531
|
"Tip: @ mentions someone",
|
|
1532
|
-
|
|
1532
|
+
me ? `, @${me} asks the AI` : "",
|
|
1533
1533
|
", # inserts a record, and a record ID like AB26-12345 becomes a live link."
|
|
1534
1534
|
] })
|
|
1535
1535
|
] }) }) : /* @__PURE__ */ e(
|
|
1536
1536
|
"div",
|
|
1537
1537
|
{
|
|
1538
|
-
ref:
|
|
1539
|
-
style:
|
|
1540
|
-
"data-chat-rows":
|
|
1541
|
-
children:
|
|
1542
|
-
var
|
|
1543
|
-
const N =
|
|
1538
|
+
ref: dn,
|
|
1539
|
+
style: we.windowed ? { paddingTop: we.padTop, paddingBottom: we.padBottom } : void 0,
|
|
1540
|
+
"data-chat-rows": we.windowed ? "windowed" : "all",
|
|
1541
|
+
children: _e.slice(we.start, we.end).map((t, h) => {
|
|
1542
|
+
var Re;
|
|
1543
|
+
const N = we.start + h, z = _e[N - 1], Q = N === 0 || z && new Date(z.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !xe && !E && yt.current > 0 && N === Math.max(0, _e.length - yt.current), Ee = qe === "compact" && !Q && !!z && z.sender === t.sender && !z.is_system && new Date(t.date_created).getTime() - new Date(z.date_created).getTime() < 5 * 6e4;
|
|
1544
1544
|
return /* @__PURE__ */ a(
|
|
1545
1545
|
"div",
|
|
1546
1546
|
{
|
|
1547
|
-
ref:
|
|
1547
|
+
ref: we.rowRef(t.id),
|
|
1548
1548
|
"data-chat-row": t.id,
|
|
1549
|
-
className: N > 0 ?
|
|
1549
|
+
className: N > 0 ? qe === "compact" ? "pt-1" : "pt-2.5" : void 0,
|
|
1550
1550
|
children: [
|
|
1551
|
-
|
|
1551
|
+
Q && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
|
|
1552
1552
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
|
|
1553
1553
|
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Gr(t.date_created) }),
|
|
1554
1554
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
|
|
1555
1555
|
] }),
|
|
1556
|
-
|
|
1556
|
+
Oe && /* @__PURE__ */ a(
|
|
1557
1557
|
"div",
|
|
1558
1558
|
{
|
|
1559
|
-
ref:
|
|
1559
|
+
ref: vt,
|
|
1560
1560
|
className: "my-2 flex items-center gap-2",
|
|
1561
1561
|
"data-chat-unread-divider": !0,
|
|
1562
1562
|
children: [
|
|
1563
1563
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-red-300 dark:bg-red-500/50" }),
|
|
1564
1564
|
/* @__PURE__ */ e("span", { className: "text-[11px] font-semibold text-red-600 dark:text-red-400", children: "New messages" }),
|
|
1565
|
-
|
|
1565
|
+
yt.current > 20 && /* @__PURE__ */ e(
|
|
1566
1566
|
"button",
|
|
1567
1567
|
{
|
|
1568
1568
|
type: "button",
|
|
1569
|
-
disabled:
|
|
1570
|
-
onClick: () =>
|
|
1569
|
+
disabled: Y.isPending,
|
|
1570
|
+
onClick: () => Y.mutate(),
|
|
1571
1571
|
className: "rounded-full border border-red-200 px-1.5 py-px text-[9.5px] font-medium text-red-500 hover:text-red-600 disabled:opacity-50 dark:border-red-500/40",
|
|
1572
|
-
children:
|
|
1572
|
+
children: Y.isPending ? "Summarizing…" : "✨ What did I miss?"
|
|
1573
1573
|
}
|
|
1574
1574
|
),
|
|
1575
1575
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-red-300 dark:bg-red-500/50" })
|
|
1576
1576
|
]
|
|
1577
1577
|
}
|
|
1578
1578
|
),
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
isLastMine: ((
|
|
1582
|
-
showSender: !
|
|
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 }),
|
|
1580
|
+
hn(t, {
|
|
1581
|
+
isLastMine: ((Re = t.sender) == null ? void 0 : Re.toLowerCase()) === je && N === Oa,
|
|
1582
|
+
showSender: !Ee
|
|
1583
1583
|
})
|
|
1584
1584
|
]
|
|
1585
1585
|
},
|
|
@@ -1588,41 +1588,41 @@ function jn({
|
|
|
1588
1588
|
})
|
|
1589
1589
|
}
|
|
1590
1590
|
),
|
|
1591
|
-
!
|
|
1592
|
-
!
|
|
1591
|
+
!xe && !W && /* @__PURE__ */ e(ca, { items: ee, th: f }),
|
|
1592
|
+
!xe && !W && Qe.live && me && /* @__PURE__ */ e(
|
|
1593
1593
|
Ms,
|
|
1594
1594
|
{
|
|
1595
|
-
live:
|
|
1596
|
-
botName:
|
|
1595
|
+
live: Qe.live,
|
|
1596
|
+
botName: me,
|
|
1597
1597
|
bubbleClass: f.bubbleOther,
|
|
1598
1598
|
accentClass: f.accentText,
|
|
1599
|
-
onStop:
|
|
1600
|
-
onDismiss:
|
|
1599
|
+
onStop: Qe.stop,
|
|
1600
|
+
onDismiss: Qe.dismiss
|
|
1601
1601
|
}
|
|
1602
1602
|
)
|
|
1603
1603
|
] })
|
|
1604
1604
|
}
|
|
1605
1605
|
),
|
|
1606
|
-
(
|
|
1606
|
+
(ie || W) && /* @__PURE__ */ e("div", { className: "pointer-events-none relative z-10 -mt-9 flex h-9 shrink-0 items-center justify-center", children: /* @__PURE__ */ e(
|
|
1607
1607
|
"button",
|
|
1608
1608
|
{
|
|
1609
1609
|
type: "button",
|
|
1610
1610
|
onClick: () => {
|
|
1611
|
-
if (
|
|
1612
|
-
|
|
1611
|
+
if (W) {
|
|
1612
|
+
Ae.current = !1, re.current = !0, R(null);
|
|
1613
1613
|
return;
|
|
1614
1614
|
}
|
|
1615
|
-
|
|
1615
|
+
ie && !wt(ie.firstId) && rt(), He(null);
|
|
1616
1616
|
},
|
|
1617
1617
|
className: g(
|
|
1618
1618
|
"pointer-events-auto rounded-full px-3 py-1 text-[11.5px] font-semibold shadow-md",
|
|
1619
1619
|
f.pill
|
|
1620
1620
|
),
|
|
1621
|
-
"data-chat-new-pill": (
|
|
1622
|
-
children:
|
|
1621
|
+
"data-chat-new-pill": (ie == null ? void 0 : ie.count) ?? 0,
|
|
1622
|
+
children: W ? "Jump to the latest ↓" : `${ie == null ? void 0 : ie.count} new ${(ie == null ? void 0 : ie.count) === 1 ? "message" : "messages"} ↓`
|
|
1623
1623
|
}
|
|
1624
1624
|
) }),
|
|
1625
|
-
/* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children:
|
|
1625
|
+
/* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children: st && me && !Qe.live ? /* @__PURE__ */ a(
|
|
1626
1626
|
"p",
|
|
1627
1627
|
{
|
|
1628
1628
|
className: "flex items-center gap-1.5 text-[11px] italic text-slate-500",
|
|
@@ -1633,37 +1633,37 @@ function jn({
|
|
|
1633
1633
|
/* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:150ms]" }),
|
|
1634
1634
|
/* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:300ms]" })
|
|
1635
1635
|
] }),
|
|
1636
|
-
|
|
1636
|
+
me,
|
|
1637
1637
|
" is thinking…"
|
|
1638
1638
|
]
|
|
1639
1639
|
}
|
|
1640
|
-
) :
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1640
|
+
) : te.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: te.typingText }) }),
|
|
1641
|
+
Vt && /* @__PURE__ */ e(Ds, { file: Vt, onClose: () => Xt(null) }),
|
|
1642
|
+
fn(null),
|
|
1643
|
+
en != null && /* @__PURE__ */ e(
|
|
1644
1644
|
qr,
|
|
1645
1645
|
{
|
|
1646
1646
|
room: n,
|
|
1647
|
-
rootId:
|
|
1647
|
+
rootId: en,
|
|
1648
1648
|
th: f,
|
|
1649
|
-
onClose: () =>
|
|
1650
|
-
renderRow: (t) =>
|
|
1651
|
-
renderComposer: (t) =>
|
|
1649
|
+
onClose: () => Ie(null),
|
|
1650
|
+
renderRow: (t) => hn(t, { inThread: !0 }),
|
|
1651
|
+
renderComposer: (t) => fn(t),
|
|
1652
1652
|
renderOutbox: (t) => /* @__PURE__ */ e(Zr, { room: n, parentId: t, th: f })
|
|
1653
1653
|
}
|
|
1654
1654
|
),
|
|
1655
|
-
|
|
1655
|
+
xt && /* @__PURE__ */ e(
|
|
1656
1656
|
Er,
|
|
1657
1657
|
{
|
|
1658
1658
|
room: n,
|
|
1659
1659
|
label: S,
|
|
1660
1660
|
th: f,
|
|
1661
|
-
pins:
|
|
1662
|
-
onClose: () =>
|
|
1663
|
-
onOpenMessage:
|
|
1661
|
+
pins: ue,
|
|
1662
|
+
onClose: () => ze(!1),
|
|
1663
|
+
onOpenMessage: on,
|
|
1664
1664
|
onUnpin: (t) => c.mutate(t),
|
|
1665
1665
|
navigate: b.navigate,
|
|
1666
|
-
renderAvatar: (t, h) => /* @__PURE__ */ e(
|
|
1666
|
+
renderAvatar: (t, h) => /* @__PURE__ */ e(K, { id: t, name: h, size: 22 })
|
|
1667
1667
|
}
|
|
1668
1668
|
)
|
|
1669
1669
|
]
|
|
@@ -1671,8 +1671,8 @@ function jn({
|
|
|
1671
1671
|
);
|
|
1672
1672
|
}
|
|
1673
1673
|
function Zr({ room: n, parentId: s, th: l }) {
|
|
1674
|
-
const r =
|
|
1675
|
-
return /* @__PURE__ */ e(
|
|
1674
|
+
const r = ia(n, s);
|
|
1675
|
+
return /* @__PURE__ */ e(ca, { items: r, th: l });
|
|
1676
1676
|
}
|
|
1677
1677
|
function Vr({
|
|
1678
1678
|
targets: n,
|
|
@@ -1680,8 +1680,8 @@ function Vr({
|
|
|
1680
1680
|
onPick: l
|
|
1681
1681
|
}) {
|
|
1682
1682
|
const [r, o] = T(!1);
|
|
1683
|
-
return /* @__PURE__ */ a(
|
|
1684
|
-
/* @__PURE__ */ e(
|
|
1683
|
+
return /* @__PURE__ */ a(Ve, { open: r, onOpenChange: o, children: [
|
|
1684
|
+
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1685
1685
|
"button",
|
|
1686
1686
|
{
|
|
1687
1687
|
type: "button",
|
|
@@ -1692,7 +1692,7 @@ function Vr({
|
|
|
1692
1692
|
children: /* @__PURE__ */ e(bs, { className: "h-3 w-3" })
|
|
1693
1693
|
}
|
|
1694
1694
|
) }),
|
|
1695
|
-
/* @__PURE__ */ a(
|
|
1695
|
+
/* @__PURE__ */ a(et, { align: "end", className: "w-[220px] p-1.5", children: [
|
|
1696
1696
|
/* @__PURE__ */ a("p", { className: "px-2 pb-1 pt-0.5 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
1697
1697
|
"Attach to ",
|
|
1698
1698
|
s
|
|
@@ -1712,7 +1712,7 @@ function Vr({
|
|
|
1712
1712
|
] })
|
|
1713
1713
|
] });
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function Wn(n) {
|
|
1716
1716
|
return {
|
|
1717
1717
|
id: n.id,
|
|
1718
1718
|
visibility: n.visibility,
|
|
@@ -1724,11 +1724,11 @@ function qn(n) {
|
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
1726
|
const Xr = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1727
|
-
function
|
|
1727
|
+
function At(n) {
|
|
1728
1728
|
const s = typeof n.idle_minutes == "number" ? n.idle_minutes : n.last_active ? Math.floor((Date.now() - new Date(n.last_active).getTime()) / 6e4) : null;
|
|
1729
1729
|
return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1731
|
+
function Fn(n) {
|
|
1732
1732
|
const s = n == null ? void 0 : n.trim();
|
|
1733
1733
|
return !s || Xr.test(s) ? null : s;
|
|
1734
1734
|
}
|
|
@@ -1741,14 +1741,14 @@ function tl({
|
|
|
1741
1741
|
channelId: s,
|
|
1742
1742
|
senderId: l
|
|
1743
1743
|
}) {
|
|
1744
|
-
const r =
|
|
1744
|
+
const r = de(), [o, i] = T(!1), { members: m } = Et(o ? s : null), d = new Set(n.map((p) => String(p.user).toUpperCase())), b = m.filter((p) => {
|
|
1745
1745
|
const x = String(p.user).toUpperCase();
|
|
1746
1746
|
return x !== l.toUpperCase() && !d.has(x);
|
|
1747
1747
|
}), f = [...n].sort(
|
|
1748
1748
|
(p, x) => new Date(p.last_read_at).getTime() - new Date(x.last_read_at).getTime()
|
|
1749
1749
|
);
|
|
1750
|
-
return /* @__PURE__ */ a(
|
|
1751
|
-
/* @__PURE__ */ e(
|
|
1750
|
+
return /* @__PURE__ */ a(Ve, { open: o, onOpenChange: i, children: [
|
|
1751
|
+
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1752
1752
|
"button",
|
|
1753
1753
|
{
|
|
1754
1754
|
type: "button",
|
|
@@ -1765,7 +1765,7 @@ function tl({
|
|
|
1765
1765
|
}
|
|
1766
1766
|
) }),
|
|
1767
1767
|
/* @__PURE__ */ a(
|
|
1768
|
-
|
|
1768
|
+
et,
|
|
1769
1769
|
{
|
|
1770
1770
|
align: "end",
|
|
1771
1771
|
sideOffset: 4,
|
|
@@ -1778,7 +1778,7 @@ function tl({
|
|
|
1778
1778
|
] }),
|
|
1779
1779
|
/* @__PURE__ */ a("div", { className: "max-h-[260px] overflow-y-auto py-1", children: [
|
|
1780
1780
|
f.map((p) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
|
|
1781
|
-
/* @__PURE__ */ e(
|
|
1781
|
+
/* @__PURE__ */ e(K, { id: p.user, name: p.name || null, size: 22 }),
|
|
1782
1782
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: p.name || "Someone" }),
|
|
1783
1783
|
/* @__PURE__ */ e(
|
|
1784
1784
|
"span",
|
|
@@ -1789,7 +1789,7 @@ function tl({
|
|
|
1789
1789
|
}
|
|
1790
1790
|
)
|
|
1791
1791
|
] }, p.user)),
|
|
1792
|
-
b.length > 0 && /* @__PURE__ */ a(
|
|
1792
|
+
b.length > 0 && /* @__PURE__ */ a(ke, { children: [
|
|
1793
1793
|
/* @__PURE__ */ a("p", { className: "px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
|
|
1794
1794
|
"Not seen yet · ",
|
|
1795
1795
|
b.length
|
|
@@ -1797,7 +1797,7 @@ function tl({
|
|
|
1797
1797
|
b.map((p) => {
|
|
1798
1798
|
const x = [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email || "Someone";
|
|
1799
1799
|
return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5 opacity-70", children: [
|
|
1800
|
-
/* @__PURE__ */ e(
|
|
1800
|
+
/* @__PURE__ */ e(K, { id: p.user, name: x, size: 22 }),
|
|
1801
1801
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300", children: x })
|
|
1802
1802
|
] }, p.user);
|
|
1803
1803
|
})
|
|
@@ -1811,12 +1811,12 @@ function tl({
|
|
|
1811
1811
|
}
|
|
1812
1812
|
function nl({ channel: n, onLeft: s }) {
|
|
1813
1813
|
var q;
|
|
1814
|
-
const l =
|
|
1815
|
-
const
|
|
1816
|
-
return
|
|
1814
|
+
const l = de(), r = Le(), { isAdmin: o } = pt(), [i, m] = T(!1), { members: d, loading: b } = Et(n.id), { addMember: f, removeMember: p } = ta(n.id), [x, v] = T(""), U = Ht(x, 250), $ = ((q = r.me) == null ? void 0 : q.id.toUpperCase()) ?? "", C = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: S } = Bt(U, i && C && !!x.trim()), E = new Set(d.map((A) => String(A.user).toUpperCase())), R = (A) => [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.user, y = [...d].sort((A, W) => {
|
|
1815
|
+
const F = String(A.user).toUpperCase(), H = String(W.user).toUpperCase();
|
|
1816
|
+
return F === $ ? -1 : H === $ ? 1 : R(A).localeCompare(R(W));
|
|
1817
1817
|
});
|
|
1818
|
-
return /* @__PURE__ */ a(
|
|
1819
|
-
/* @__PURE__ */ e(
|
|
1818
|
+
return /* @__PURE__ */ a(Ve, { open: i, onOpenChange: m, children: [
|
|
1819
|
+
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1820
1820
|
"button",
|
|
1821
1821
|
{
|
|
1822
1822
|
type: "button",
|
|
@@ -1828,13 +1828,13 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1828
1828
|
),
|
|
1829
1829
|
"data-chat-group-members": !0,
|
|
1830
1830
|
children: [
|
|
1831
|
-
/* @__PURE__ */ e(
|
|
1831
|
+
/* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
1832
1832
|
d.length > 0 && d.length
|
|
1833
1833
|
]
|
|
1834
1834
|
}
|
|
1835
1835
|
) }),
|
|
1836
1836
|
/* @__PURE__ */ a(
|
|
1837
|
-
|
|
1837
|
+
et,
|
|
1838
1838
|
{
|
|
1839
1839
|
align: "end",
|
|
1840
1840
|
sideOffset: 6,
|
|
@@ -1848,30 +1848,30 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1848
1848
|
/* @__PURE__ */ a("div", { className: "max-h-[280px] overflow-y-auto py-1", children: [
|
|
1849
1849
|
b && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
|
|
1850
1850
|
y.map((A) => {
|
|
1851
|
-
const
|
|
1851
|
+
const W = String(A.user).toUpperCase(), F = R(A), H = W === $, ee = String(n.created_by ?? "").toUpperCase() === W;
|
|
1852
1852
|
return /* @__PURE__ */ a(
|
|
1853
1853
|
"div",
|
|
1854
1854
|
{
|
|
1855
1855
|
className: "group flex items-center gap-2 px-3 py-1.5",
|
|
1856
1856
|
"data-chat-group-member": A.user,
|
|
1857
1857
|
children: [
|
|
1858
|
-
/* @__PURE__ */ e(
|
|
1858
|
+
/* @__PURE__ */ e(K, { id: A.user, name: F, size: 26 }),
|
|
1859
1859
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
1860
1860
|
/* @__PURE__ */ a("span", { className: "block truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
|
|
1861
|
-
|
|
1862
|
-
|
|
1861
|
+
F,
|
|
1862
|
+
H && /* @__PURE__ */ e("span", { className: "text-slate-400", children: " (you)" })
|
|
1863
1863
|
] }),
|
|
1864
|
-
|
|
1864
|
+
ee && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
|
|
1865
1865
|
] }),
|
|
1866
|
-
C && !
|
|
1866
|
+
C && !H && /* @__PURE__ */ e(
|
|
1867
1867
|
"button",
|
|
1868
1868
|
{
|
|
1869
1869
|
type: "button",
|
|
1870
|
-
title: `Remove ${
|
|
1871
|
-
"aria-label": `Remove ${
|
|
1870
|
+
title: `Remove ${F}`,
|
|
1871
|
+
"aria-label": `Remove ${F}`,
|
|
1872
1872
|
onClick: () => p.mutate(A.user),
|
|
1873
1873
|
className: "rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-red-500 focus:opacity-100 group-hover:opacity-100 dark:hover:bg-muted",
|
|
1874
|
-
children: /* @__PURE__ */ e(
|
|
1874
|
+
children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
|
|
1875
1875
|
}
|
|
1876
1876
|
)
|
|
1877
1877
|
]
|
|
@@ -1892,7 +1892,7 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1892
1892
|
}
|
|
1893
1893
|
),
|
|
1894
1894
|
x.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: S.filter((A) => !E.has(String(A.id).toUpperCase())).map((A) => {
|
|
1895
|
-
const
|
|
1895
|
+
const W = [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.id;
|
|
1896
1896
|
return /* @__PURE__ */ a(
|
|
1897
1897
|
"button",
|
|
1898
1898
|
{
|
|
@@ -1902,8 +1902,8 @@ function nl({ channel: n, onLeft: s }) {
|
|
|
1902
1902
|
},
|
|
1903
1903
|
className: "flex w-full items-center gap-2 rounded px-1 py-1 text-left hover:bg-muted",
|
|
1904
1904
|
children: [
|
|
1905
|
-
/* @__PURE__ */ e(
|
|
1906
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children:
|
|
1905
|
+
/* @__PURE__ */ e(K, { id: A.id, name: W, size: 22 }),
|
|
1906
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: W })
|
|
1907
1907
|
]
|
|
1908
1908
|
},
|
|
1909
1909
|
A.id
|
|
@@ -1936,10 +1936,10 @@ function al({
|
|
|
1936
1936
|
label: s,
|
|
1937
1937
|
onBack: l
|
|
1938
1938
|
}) {
|
|
1939
|
-
const r =
|
|
1939
|
+
const r = de(), o = Le(), { isAdmin: i } = pt(), m = ea(), { members: d, loading: b } = Et(n.id), { update: f, addMember: p, removeMember: x } = ta(n.id), [v, U] = T(s), [$, C] = T(n.topic ?? ""), [S, E] = T(n.visibility), [R, y] = T(n.role ?? ""), [q, A] = T({
|
|
1940
1940
|
icon: n.icon ?? null,
|
|
1941
1941
|
color: n.color ?? null
|
|
1942
|
-
}), [
|
|
1942
|
+
}), [W, F] = T(""), H = Ht(W, 250), { users: ee } = Bt(H, S === "private"), [pe, te] = T(!1), ne = n.id === na, le = i || !ne && !!o.me && String(n.created_by ?? "") === String(o.me.id), ae = new Set(d.map((c) => String(c.user).toUpperCase())), ue = v !== s || $ !== (n.topic ?? "") || S !== n.visibility || q.icon !== (n.icon ?? null) || q.color !== (n.color ?? null) || S === "role" && R !== (n.role ?? "");
|
|
1943
1943
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
|
|
1944
1944
|
/* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
|
|
1945
1945
|
/* @__PURE__ */ e(
|
|
@@ -1949,7 +1949,7 @@ function al({
|
|
|
1949
1949
|
onClick: l,
|
|
1950
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",
|
|
1951
1951
|
"aria-label": "Back to conversation",
|
|
1952
|
-
children: /* @__PURE__ */ e(
|
|
1952
|
+
children: /* @__PURE__ */ e(ut, { className: "h-4 w-4" })
|
|
1953
1953
|
}
|
|
1954
1954
|
),
|
|
1955
1955
|
/* @__PURE__ */ a("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
@@ -1958,7 +1958,7 @@ function al({
|
|
|
1958
1958
|
] })
|
|
1959
1959
|
] }),
|
|
1960
1960
|
/* @__PURE__ */ a("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto p-3", children: [
|
|
1961
|
-
le ? /* @__PURE__ */ a(
|
|
1961
|
+
le ? /* @__PURE__ */ a(ke, { children: [
|
|
1962
1962
|
/* @__PURE__ */ a("label", { className: "block", children: [
|
|
1963
1963
|
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Name" }),
|
|
1964
1964
|
/* @__PURE__ */ e(
|
|
@@ -1971,8 +1971,8 @@ function al({
|
|
|
1971
1971
|
)
|
|
1972
1972
|
] }),
|
|
1973
1973
|
!n.is_direct && /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
1974
|
-
/* @__PURE__ */ e(
|
|
1975
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
1974
|
+
/* @__PURE__ */ e(Ye, { icon: q.icon, color: q.color, size: 40 }),
|
|
1975
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Jn, { icon: q.icon, color: q.color, onChange: A }) })
|
|
1976
1976
|
] }),
|
|
1977
1977
|
/* @__PURE__ */ a("label", { className: "block", children: [
|
|
1978
1978
|
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Topic" }),
|
|
@@ -1986,7 +1986,7 @@ function al({
|
|
|
1986
1986
|
}
|
|
1987
1987
|
)
|
|
1988
1988
|
] }),
|
|
1989
|
-
!
|
|
1989
|
+
!ne && /* @__PURE__ */ a("div", { children: [
|
|
1990
1990
|
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Who can see it" }),
|
|
1991
1991
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
1992
1992
|
["open", "Anyone"],
|
|
@@ -2006,7 +2006,7 @@ function al({
|
|
|
2006
2006
|
c
|
|
2007
2007
|
)) }),
|
|
2008
2008
|
S === "role" && /* @__PURE__ */ e(
|
|
2009
|
-
|
|
2009
|
+
It,
|
|
2010
2010
|
{
|
|
2011
2011
|
value: R,
|
|
2012
2012
|
onChange: y,
|
|
@@ -2026,9 +2026,9 @@ function al({
|
|
|
2026
2026
|
"button",
|
|
2027
2027
|
{
|
|
2028
2028
|
type: "button",
|
|
2029
|
-
disabled: !
|
|
2029
|
+
disabled: !ue || f.isPending || S === "role" && !R,
|
|
2030
2030
|
onClick: () => f.mutate(
|
|
2031
|
-
|
|
2031
|
+
ne ? {
|
|
2032
2032
|
name: v.trim() || s,
|
|
2033
2033
|
topic: $.trim() || null,
|
|
2034
2034
|
icon: q.icon,
|
|
@@ -2049,19 +2049,19 @@ function al({
|
|
|
2049
2049
|
children: f.isPending ? "Saving…" : "Save"
|
|
2050
2050
|
}
|
|
2051
2051
|
),
|
|
2052
|
-
|
|
2052
|
+
ne ? /* @__PURE__ */ e("span", { className: "ml-auto text-[11px] text-slate-400", children: "Open to everyone · cannot be archived" }) : /* @__PURE__ */ e(
|
|
2053
2053
|
"button",
|
|
2054
2054
|
{
|
|
2055
2055
|
type: "button",
|
|
2056
|
-
onClick: () =>
|
|
2057
|
-
disabled:
|
|
2056
|
+
onClick: () => te(!0),
|
|
2057
|
+
disabled: pe,
|
|
2058
2058
|
className: "ml-auto rounded-md px-2 py-1 text-[11.5px] font-medium text-red-500 hover:bg-red-50 disabled:opacity-40 dark:hover:bg-red-950/40",
|
|
2059
2059
|
"data-chat-archive-everyone": !0,
|
|
2060
2060
|
children: "Archive for everyone"
|
|
2061
2061
|
}
|
|
2062
2062
|
)
|
|
2063
2063
|
] }),
|
|
2064
|
-
|
|
2064
|
+
pe && !ne && /* @__PURE__ */ a(
|
|
2065
2065
|
"div",
|
|
2066
2066
|
{
|
|
2067
2067
|
className: "space-y-2 rounded-md border border-red-200 bg-red-50 p-2.5 text-[11.5px] leading-relaxed text-red-800 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",
|
|
@@ -2074,12 +2074,12 @@ function al({
|
|
|
2074
2074
|
d.length ? `${d.length} ` : "",
|
|
2075
2075
|
"members: it leaves their chat lists and nobody can read or post in it any more.",
|
|
2076
2076
|
" ",
|
|
2077
|
-
n.is_direct ? /* @__PURE__ */ a(
|
|
2077
|
+
n.is_direct ? /* @__PURE__ */ a(ke, { children: [
|
|
2078
2078
|
"To only hide it from your own list, use",
|
|
2079
2079
|
" ",
|
|
2080
2080
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: "Archive for me" }),
|
|
2081
2081
|
" in the room's menu instead."
|
|
2082
|
-
] }) : /* @__PURE__ */ a(
|
|
2082
|
+
] }) : /* @__PURE__ */ a(ke, { children: [
|
|
2083
2083
|
"To only stop hearing from it yourself, set",
|
|
2084
2084
|
" ",
|
|
2085
2085
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: "Notify me" }),
|
|
@@ -2101,7 +2101,7 @@ function al({
|
|
|
2101
2101
|
"button",
|
|
2102
2102
|
{
|
|
2103
2103
|
type: "button",
|
|
2104
|
-
onClick: () =>
|
|
2104
|
+
onClick: () => te(!1),
|
|
2105
2105
|
className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-muted dark:border-border dark:bg-card dark:text-slate-200",
|
|
2106
2106
|
children: "Cancel"
|
|
2107
2107
|
}
|
|
@@ -2115,7 +2115,7 @@ function al({
|
|
|
2115
2115
|
] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
|
|
2116
2116
|
n.topic || "No topic set.",
|
|
2117
2117
|
/* @__PURE__ */ e("br", {}),
|
|
2118
|
-
|
|
2118
|
+
ne ? "Everyone in the portal can find and join General." : n.visibility === "private" ? "Invite only — you were added by the channel owner." : n.visibility === "role" ? "Everyone with a particular role can see this channel." : "Anyone in the portal can find and join this channel."
|
|
2119
2119
|
] }),
|
|
2120
2120
|
/* @__PURE__ */ a("div", { children: [
|
|
2121
2121
|
/* @__PURE__ */ a("p", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
|
|
@@ -2126,7 +2126,7 @@ function al({
|
|
|
2126
2126
|
d.map((c) => {
|
|
2127
2127
|
const L = [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email || c.user;
|
|
2128
2128
|
return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 rounded-lg px-1 py-1", children: [
|
|
2129
|
-
/* @__PURE__ */ e(
|
|
2129
|
+
/* @__PURE__ */ e(K, { id: c.user, name: L }),
|
|
2130
2130
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: L }),
|
|
2131
2131
|
le && /* @__PURE__ */ e(
|
|
2132
2132
|
"button",
|
|
@@ -2135,7 +2135,7 @@ function al({
|
|
|
2135
2135
|
title: "Remove from channel",
|
|
2136
2136
|
onClick: () => x.mutate(c.user),
|
|
2137
2137
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-red-500 dark:hover:bg-muted",
|
|
2138
|
-
children: /* @__PURE__ */ e(
|
|
2138
|
+
children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
|
|
2139
2139
|
}
|
|
2140
2140
|
)
|
|
2141
2141
|
] }, c.user);
|
|
@@ -2144,24 +2144,24 @@ function al({
|
|
|
2144
2144
|
/* @__PURE__ */ e(
|
|
2145
2145
|
"input",
|
|
2146
2146
|
{
|
|
2147
|
-
value:
|
|
2148
|
-
onChange: (c) =>
|
|
2147
|
+
value: W,
|
|
2148
|
+
onChange: (c) => F(c.target.value),
|
|
2149
2149
|
placeholder: "Add someone…",
|
|
2150
2150
|
className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
|
|
2151
2151
|
}
|
|
2152
2152
|
),
|
|
2153
|
-
|
|
2153
|
+
W.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: ee.filter((c) => !ae.has(String(c.id).toUpperCase())).map((c) => {
|
|
2154
2154
|
const L = [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email || c.id;
|
|
2155
2155
|
return /* @__PURE__ */ a(
|
|
2156
2156
|
"button",
|
|
2157
2157
|
{
|
|
2158
2158
|
type: "button",
|
|
2159
2159
|
onClick: () => {
|
|
2160
|
-
p.mutate(c.id),
|
|
2160
|
+
p.mutate(c.id), F("");
|
|
2161
2161
|
},
|
|
2162
2162
|
className: "flex w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-muted/50",
|
|
2163
2163
|
children: [
|
|
2164
|
-
/* @__PURE__ */ e(
|
|
2164
|
+
/* @__PURE__ */ e(K, { id: c.id, name: L }),
|
|
2165
2165
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: L })
|
|
2166
2166
|
]
|
|
2167
2167
|
},
|
|
@@ -2177,37 +2177,37 @@ function al({
|
|
|
2177
2177
|
] })
|
|
2178
2178
|
] });
|
|
2179
2179
|
}
|
|
2180
|
-
function
|
|
2180
|
+
function Ht(n, s) {
|
|
2181
2181
|
const [l, r] = T(n);
|
|
2182
|
-
return
|
|
2182
|
+
return X(() => {
|
|
2183
2183
|
const o = setTimeout(() => r(n), s);
|
|
2184
2184
|
return () => clearTimeout(o);
|
|
2185
2185
|
}, [n, s]), l;
|
|
2186
2186
|
}
|
|
2187
|
-
function
|
|
2187
|
+
function fa(n) {
|
|
2188
2188
|
var s;
|
|
2189
2189
|
return n ? n.kind === "dm" || n.kind === "entity" || n.kind === "channel" && !!((s = n.channel) != null && s.is_direct) : !1;
|
|
2190
2190
|
}
|
|
2191
|
-
const
|
|
2191
|
+
const _t = [
|
|
2192
2192
|
{ value: "recent", label: "Recent activity" },
|
|
2193
2193
|
{ value: "unread", label: "Unread first" },
|
|
2194
2194
|
{ value: "alpha", label: "A–Z" }
|
|
2195
2195
|
];
|
|
2196
|
-
function
|
|
2196
|
+
function zn(n) {
|
|
2197
2197
|
var s;
|
|
2198
2198
|
return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
|
|
2199
2199
|
}
|
|
2200
2200
|
function sl(n, s) {
|
|
2201
|
-
const l = (i, m) => i.label.localeCompare(m.label), r = (i, m) =>
|
|
2201
|
+
const l = (i, m) => i.label.localeCompare(m.label), r = (i, m) => zn(m) - zn(i) || l(i, m), o = [...n];
|
|
2202
2202
|
return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, m) => +(m.unread > 0) - +(i.unread > 0) || r(i, m)) : o.sort(r);
|
|
2203
2203
|
}
|
|
2204
2204
|
function rl({
|
|
2205
2205
|
value: n,
|
|
2206
2206
|
onChange: s
|
|
2207
2207
|
}) {
|
|
2208
|
-
const [l, r] = T(!1), o =
|
|
2209
|
-
return /* @__PURE__ */ a(
|
|
2210
|
-
/* @__PURE__ */ e(
|
|
2208
|
+
const [l, r] = T(!1), o = _t.find((i) => i.value === n) ?? _t[0];
|
|
2209
|
+
return /* @__PURE__ */ a(Ve, { open: l, onOpenChange: r, children: [
|
|
2210
|
+
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2211
2211
|
"button",
|
|
2212
2212
|
{
|
|
2213
2213
|
type: "button",
|
|
@@ -2218,9 +2218,9 @@ function rl({
|
|
|
2218
2218
|
children: /* @__PURE__ */ e(ss, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2219
2219
|
}
|
|
2220
2220
|
) }),
|
|
2221
|
-
/* @__PURE__ */ a(
|
|
2221
|
+
/* @__PURE__ */ a(et, { align: "end", className: "w-44 p-1", children: [
|
|
2222
2222
|
/* @__PURE__ */ e("p", { className: "px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: "Sort rooms" }),
|
|
2223
|
-
|
|
2223
|
+
_t.map((i) => /* @__PURE__ */ a(
|
|
2224
2224
|
"button",
|
|
2225
2225
|
{
|
|
2226
2226
|
type: "button",
|
|
@@ -2231,7 +2231,7 @@ function rl({
|
|
|
2231
2231
|
"data-chat-sort-option": i.value,
|
|
2232
2232
|
children: [
|
|
2233
2233
|
i.label,
|
|
2234
|
-
i.value === n && /* @__PURE__ */ e(
|
|
2234
|
+
i.value === n && /* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2235
2235
|
]
|
|
2236
2236
|
},
|
|
2237
2237
|
i.value
|
|
@@ -2239,7 +2239,7 @@ function rl({
|
|
|
2239
2239
|
] })
|
|
2240
2240
|
] });
|
|
2241
2241
|
}
|
|
2242
|
-
function
|
|
2242
|
+
function Hn({
|
|
2243
2243
|
rooms: n,
|
|
2244
2244
|
onOpen: s,
|
|
2245
2245
|
onNewGroup: l,
|
|
@@ -2247,7 +2247,7 @@ function Wn({
|
|
|
2247
2247
|
loading: o = !1,
|
|
2248
2248
|
onView: i
|
|
2249
2249
|
}) {
|
|
2250
|
-
const m =
|
|
2250
|
+
const m = de(), d = Le(), { setMuted: b, leave: f, setArchived: p, setStarred: x } = qt(), v = qs(), U = ve(
|
|
2251
2251
|
() => new Map(
|
|
2252
2252
|
d.onlineUsers.map((c) => [
|
|
2253
2253
|
String(c.user_id).toUpperCase(),
|
|
@@ -2255,14 +2255,14 @@ function Wn({
|
|
|
2255
2255
|
])
|
|
2256
2256
|
),
|
|
2257
2257
|
[d.onlineUsers]
|
|
2258
|
-
), $ =
|
|
2258
|
+
), $ = Wt(), C = Sr(), [S, E] = T(""), R = Ht(S.trim(), 250), { hits: y, meaning: q, loading: A } = Qs(R, v.filters), W = R.length >= 2 || v.active, F = ve(() => {
|
|
2259
2259
|
const c = /* @__PURE__ */ new Map();
|
|
2260
2260
|
for (const L of y) c.set(L.room, [...c.get(L.room) ?? [], L]);
|
|
2261
2261
|
return [...c.entries()].sort((L, u) => u[1].length - L[1].length);
|
|
2262
|
-
}, [y]),
|
|
2262
|
+
}, [y]), H = n.filter((c) => c.unread > 0 && !c.muted).length, ee = hr(), pe = ve(() => new Map(n.map((c) => [c.room, c])), [n]), te = jt(), ne = Xn(), le = te.chat_sidebar_sort === "unread" || te.chat_sidebar_sort === "alpha" ? te.chat_sidebar_sort : "recent", ae = sl(
|
|
2263
2263
|
R ? n.filter((c) => c.label.toLowerCase().includes(R.toLowerCase())) : n,
|
|
2264
2264
|
le
|
|
2265
|
-
),
|
|
2265
|
+
), ue = (c) => {
|
|
2266
2266
|
var L;
|
|
2267
2267
|
return c.kind === "channel" && ((L = c.channel) == null ? void 0 : L.is_direct);
|
|
2268
2268
|
};
|
|
@@ -2287,7 +2287,7 @@ function Wn({
|
|
|
2287
2287
|
rl,
|
|
2288
2288
|
{
|
|
2289
2289
|
value: le,
|
|
2290
|
-
onChange: (c) =>
|
|
2290
|
+
onChange: (c) => ne.mutate({ chat_sidebar_sort: c === "recent" ? null : c })
|
|
2291
2291
|
}
|
|
2292
2292
|
),
|
|
2293
2293
|
!r && /* @__PURE__ */ e(Bs, {}),
|
|
@@ -2299,12 +2299,12 @@ function Wn({
|
|
|
2299
2299
|
title: "New group conversation",
|
|
2300
2300
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-border dark:text-slate-400 dark:hover:bg-muted",
|
|
2301
2301
|
"data-chat-new-group": !0,
|
|
2302
|
-
children: /* @__PURE__ */ e(
|
|
2302
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2303
2303
|
}
|
|
2304
2304
|
)
|
|
2305
2305
|
] }),
|
|
2306
2306
|
!r && v.open && /* @__PURE__ */ e(Ws, { filters: v.filters, onChange: v.setFilters, rooms: n, th: m }),
|
|
2307
|
-
!r && i && !
|
|
2307
|
+
!r && i && !W && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
|
|
2308
2308
|
/* @__PURE__ */ a(
|
|
2309
2309
|
"button",
|
|
2310
2310
|
{
|
|
@@ -2313,7 +2313,7 @@ function Wn({
|
|
|
2313
2313
|
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",
|
|
2314
2314
|
"data-chat-view": "mentions",
|
|
2315
2315
|
children: [
|
|
2316
|
-
/* @__PURE__ */ e(
|
|
2316
|
+
/* @__PURE__ */ e(Ka, { className: "h-3 w-3" }),
|
|
2317
2317
|
" Mentions"
|
|
2318
2318
|
]
|
|
2319
2319
|
}
|
|
@@ -2326,12 +2326,12 @@ function Wn({
|
|
|
2326
2326
|
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",
|
|
2327
2327
|
"data-chat-view": "scheduled",
|
|
2328
2328
|
children: [
|
|
2329
|
-
/* @__PURE__ */ e(
|
|
2329
|
+
/* @__PURE__ */ e(Ja, { className: "h-3 w-3" }),
|
|
2330
2330
|
" Scheduled"
|
|
2331
2331
|
]
|
|
2332
2332
|
}
|
|
2333
2333
|
),
|
|
2334
|
-
|
|
2334
|
+
H > 1 && /* @__PURE__ */ a(
|
|
2335
2335
|
"button",
|
|
2336
2336
|
{
|
|
2337
2337
|
type: "button",
|
|
@@ -2342,45 +2342,45 @@ function Wn({
|
|
|
2342
2342
|
),
|
|
2343
2343
|
"data-chat-view": "catchup",
|
|
2344
2344
|
children: [
|
|
2345
|
-
/* @__PURE__ */ e(
|
|
2345
|
+
/* @__PURE__ */ e(Ya, { className: "h-3 w-3" }),
|
|
2346
2346
|
" Catch up · ",
|
|
2347
|
-
|
|
2347
|
+
H,
|
|
2348
2348
|
" rooms"
|
|
2349
2349
|
]
|
|
2350
2350
|
}
|
|
2351
2351
|
)
|
|
2352
2352
|
] }),
|
|
2353
|
-
|
|
2353
|
+
W && !r && /* @__PURE__ */ a("div", { className: "mb-1.5", "data-chat-search-results": !0, children: [
|
|
2354
2354
|
/* @__PURE__ */ a("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
|
|
2355
2355
|
"Messages",
|
|
2356
2356
|
y.length ? ` · ${y.length}` : ""
|
|
2357
2357
|
] }),
|
|
2358
|
-
A ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "Searching…" }) : y.length === 0 ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "No messages match." }) :
|
|
2359
|
-
const u =
|
|
2358
|
+
A ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "Searching…" }) : y.length === 0 ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "No messages match." }) : F.map(([c, L]) => {
|
|
2359
|
+
const u = pe.get(c);
|
|
2360
2360
|
return /* @__PURE__ */ a("div", { className: "mb-1", "data-chat-search-group": c, children: [
|
|
2361
2361
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1.5 px-2.5 pb-0.5 pt-1 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
2362
2362
|
/* @__PURE__ */ e("span", { className: "truncate", children: (u == null ? void 0 : u.label) ?? c }),
|
|
2363
2363
|
/* @__PURE__ */ e("span", { className: "rounded-full bg-slate-100 px-1.5 text-[10px] font-medium tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: L.length })
|
|
2364
2364
|
] }),
|
|
2365
|
-
L.slice(0, 5).map((
|
|
2365
|
+
L.slice(0, 5).map((J) => /* @__PURE__ */ a(
|
|
2366
2366
|
"button",
|
|
2367
2367
|
{
|
|
2368
2368
|
type: "button",
|
|
2369
2369
|
disabled: !u,
|
|
2370
2370
|
onClick: () => {
|
|
2371
|
-
u && s(u, { around:
|
|
2371
|
+
u && s(u, { around: J.parent_id ?? J.id });
|
|
2372
2372
|
},
|
|
2373
2373
|
className: "flex w-full flex-col gap-0.5 rounded-lg px-2.5 py-1.5 text-left transition-colors hover:bg-slate-50 disabled:cursor-default dark:hover:bg-muted/50",
|
|
2374
|
-
"data-chat-search-hit":
|
|
2374
|
+
"data-chat-search-hit": J.id,
|
|
2375
2375
|
children: [
|
|
2376
2376
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5 text-[10.5px] text-slate-400", children: [
|
|
2377
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2378
|
-
/* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(
|
|
2377
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: J.sender_name ?? "Someone" }),
|
|
2378
|
+
/* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(J.date_created).toLocaleDateString() })
|
|
2379
2379
|
] }),
|
|
2380
|
-
/* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children:
|
|
2380
|
+
/* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: J.message })
|
|
2381
2381
|
]
|
|
2382
2382
|
},
|
|
2383
|
-
|
|
2383
|
+
J.id
|
|
2384
2384
|
)),
|
|
2385
2385
|
L.length > 5 && u && /* @__PURE__ */ a(
|
|
2386
2386
|
"button",
|
|
@@ -2414,7 +2414,7 @@ function Wn({
|
|
|
2414
2414
|
{
|
|
2415
2415
|
type: "button",
|
|
2416
2416
|
onClick: () => s({
|
|
2417
|
-
room:
|
|
2417
|
+
room: $t(d.me.id, $.bot_user_id),
|
|
2418
2418
|
label: `@${$.bot_name}`,
|
|
2419
2419
|
kind: "dm",
|
|
2420
2420
|
lastMessage: null,
|
|
@@ -2448,23 +2448,23 @@ function Wn({
|
|
|
2448
2448
|
}
|
|
2449
2449
|
),
|
|
2450
2450
|
[
|
|
2451
|
-
["Starred",
|
|
2451
|
+
["Starred", ae.filter((c) => c.starred)],
|
|
2452
2452
|
[
|
|
2453
2453
|
"Channels",
|
|
2454
|
-
|
|
2455
|
-
(c) => !c.starred && (c.kind === "global" || c.kind === "channel") && !
|
|
2454
|
+
ae.filter(
|
|
2455
|
+
(c) => !c.starred && (c.kind === "global" || c.kind === "channel") && !ue(c)
|
|
2456
2456
|
)
|
|
2457
2457
|
],
|
|
2458
2458
|
[
|
|
2459
2459
|
"Direct messages",
|
|
2460
|
-
|
|
2460
|
+
ae.filter((c) => !c.starred && (c.kind === "dm" || ue(c)))
|
|
2461
2461
|
],
|
|
2462
|
-
["Records",
|
|
2462
|
+
["Records", ae.filter((c) => !c.starred && c.kind === "entity")]
|
|
2463
2463
|
].map(
|
|
2464
2464
|
([c, L]) => L.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mb-1.5", children: [
|
|
2465
2465
|
/* @__PURE__ */ e("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: c }),
|
|
2466
2466
|
L.map((u) => {
|
|
2467
|
-
var
|
|
2467
|
+
var J, Ue, he, Pe, Ne, De;
|
|
2468
2468
|
return /* @__PURE__ */ a("div", { className: "group/room relative", children: [
|
|
2469
2469
|
/* @__PURE__ */ a(
|
|
2470
2470
|
"button",
|
|
@@ -2474,28 +2474,28 @@ function Wn({
|
|
|
2474
2474
|
className: "flex w-full items-center gap-3 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
|
|
2475
2475
|
children: [
|
|
2476
2476
|
(() => {
|
|
2477
|
-
const
|
|
2478
|
-
if (!
|
|
2479
|
-
const k = U.get(
|
|
2480
|
-
return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": k, children: /* @__PURE__ */ e(
|
|
2477
|
+
const Ce = u.kind === "dm" && d.me ? Se(u.room, d.me.id) : null;
|
|
2478
|
+
if (!Ce) return null;
|
|
2479
|
+
const k = U.get(Ce.toUpperCase()) ?? "offline";
|
|
2480
|
+
return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": k, children: /* @__PURE__ */ e(K, { id: Ce, name: u.label, size: 32 }) });
|
|
2481
2481
|
})(),
|
|
2482
|
-
u.kind === "channel" && !((
|
|
2482
|
+
u.kind === "channel" && !((J = u.channel) != null && J.is_direct) || u.kind === "global" && ((Ue = u.channel) != null && Ue.icon || (he = u.channel) != null && he.color) ? /* @__PURE__ */ e(Ye, { icon: (Pe = u.channel) == null ? void 0 : Pe.icon, color: (Ne = u.channel) == null ? void 0 : Ne.color, size: 32 }) : /* @__PURE__ */ e(
|
|
2483
2483
|
"span",
|
|
2484
2484
|
{
|
|
2485
2485
|
className: g(
|
|
2486
2486
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400",
|
|
2487
|
-
u.kind === "dm" && d.me &&
|
|
2487
|
+
u.kind === "dm" && d.me && Se(u.room, d.me.id) && "hidden"
|
|
2488
2488
|
),
|
|
2489
|
-
children: u.kind === "dm" ? /* @__PURE__ */ e(
|
|
2489
|
+
children: u.kind === "dm" ? /* @__PURE__ */ e(Qn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (De = u.channel) != null && De.is_direct ? /* @__PURE__ */ e(Dt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(Tt, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
2490
2490
|
}
|
|
2491
2491
|
),
|
|
2492
2492
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
2493
2493
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
2494
2494
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u.label }),
|
|
2495
|
-
u.muted && /* @__PURE__ */ e(
|
|
2495
|
+
u.muted && /* @__PURE__ */ e(Dn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
|
|
2496
2496
|
/* @__PURE__ */ e(wr, { count: C.countFor(u.room), label: u.label }),
|
|
2497
|
-
|
|
2498
|
-
|
|
2497
|
+
ee.has(u.room) && /* @__PURE__ */ e(
|
|
2498
|
+
Za,
|
|
2499
2499
|
{
|
|
2500
2500
|
className: "h-3 w-3 shrink-0 text-slate-400",
|
|
2501
2501
|
strokeWidth: 2,
|
|
@@ -2545,14 +2545,14 @@ function Wn({
|
|
|
2545
2545
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2546
2546
|
"data-chat-row-star": u.starred ? "on" : "off",
|
|
2547
2547
|
children: /* @__PURE__ */ e(
|
|
2548
|
-
|
|
2548
|
+
Va,
|
|
2549
2549
|
{
|
|
2550
2550
|
className: g("h-3 w-3", u.starred && "fill-amber-400 text-amber-500")
|
|
2551
2551
|
}
|
|
2552
2552
|
)
|
|
2553
2553
|
}
|
|
2554
2554
|
),
|
|
2555
|
-
|
|
2555
|
+
fa(u) && /* @__PURE__ */ e(
|
|
2556
2556
|
"button",
|
|
2557
2557
|
{
|
|
2558
2558
|
type: "button",
|
|
@@ -2561,7 +2561,7 @@ function Wn({
|
|
|
2561
2561
|
onClick: () => p.mutate({ room: u.room, archived: !r }),
|
|
2562
2562
|
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
2563
|
"data-chat-row-archive": r ? "unarchive" : "archive",
|
|
2564
|
-
children: r ? /* @__PURE__ */ e(
|
|
2564
|
+
children: r ? /* @__PURE__ */ e(Xa, { className: "h-3 w-3" }) : /* @__PURE__ */ e(es, { className: "h-3 w-3" })
|
|
2565
2565
|
}
|
|
2566
2566
|
),
|
|
2567
2567
|
/* @__PURE__ */ e(
|
|
@@ -2571,7 +2571,7 @@ function Wn({
|
|
|
2571
2571
|
title: u.muted ? "Unmute" : "Mute",
|
|
2572
2572
|
onClick: () => b.mutate({ room: u.room, muted: !u.muted }),
|
|
2573
2573
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2574
|
-
children: u.muted ? /* @__PURE__ */ e(
|
|
2574
|
+
children: u.muted ? /* @__PURE__ */ e(ts, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Dn, { className: "h-3 w-3" })
|
|
2575
2575
|
}
|
|
2576
2576
|
),
|
|
2577
2577
|
(u.kind === "channel" || u.kind === "global" || u.kind === "entity") && u.joined && /* @__PURE__ */ e(
|
|
@@ -2583,7 +2583,7 @@ function Wn({
|
|
|
2583
2583
|
"data-chat-row-leave": !0,
|
|
2584
2584
|
onClick: () => f.mutate(u.room),
|
|
2585
2585
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2586
|
-
children: /* @__PURE__ */ e(
|
|
2586
|
+
children: /* @__PURE__ */ e(ns, { className: "h-3 w-3" })
|
|
2587
2587
|
}
|
|
2588
2588
|
)
|
|
2589
2589
|
] })
|
|
@@ -2599,9 +2599,9 @@ function uo({
|
|
|
2599
2599
|
onBack: l,
|
|
2600
2600
|
onOpen: r
|
|
2601
2601
|
}) {
|
|
2602
|
-
const o =
|
|
2603
|
-
return n === "mentions" ? /* @__PURE__ */ e(
|
|
2604
|
-
|
|
2602
|
+
const o = de();
|
|
2603
|
+
return n === "mentions" ? /* @__PURE__ */ e(Yn, { th: o, onBack: l, onOpen: r }) : n === "scheduled" ? /* @__PURE__ */ e(
|
|
2604
|
+
Zn,
|
|
2605
2605
|
{
|
|
2606
2606
|
th: o,
|
|
2607
2607
|
onBack: l,
|
|
@@ -2610,19 +2610,19 @@ function uo({
|
|
|
2610
2610
|
return ((m = s.find((d) => d.room === i)) == null ? void 0 : m.label) ?? i;
|
|
2611
2611
|
}
|
|
2612
2612
|
}
|
|
2613
|
-
) : /* @__PURE__ */ e(
|
|
2613
|
+
) : /* @__PURE__ */ e(Vn, { rooms: s, th: o, onBack: l, onOpen: r });
|
|
2614
2614
|
}
|
|
2615
2615
|
function ll({
|
|
2616
2616
|
onOpen: n
|
|
2617
2617
|
}) {
|
|
2618
|
-
const s =
|
|
2618
|
+
const s = de(), [l, r] = T(""), [o, i] = T(!1), [m, d] = T(""), [b, f] = T("open"), [p, x] = T(""), [v, U] = T({
|
|
2619
2619
|
icon: null,
|
|
2620
2620
|
color: null
|
|
2621
|
-
}), $ =
|
|
2621
|
+
}), $ = ea(), { channels: C, loading: S } = zs(l), { join: E } = qt(), R = Hs();
|
|
2622
2622
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
|
|
2623
2623
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2624
2624
|
/* @__PURE__ */ a("div", { className: "relative flex-1", children: [
|
|
2625
|
-
/* @__PURE__ */ e(
|
|
2625
|
+
/* @__PURE__ */ e(Gn, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
2626
2626
|
/* @__PURE__ */ e(
|
|
2627
2627
|
"input",
|
|
2628
2628
|
{
|
|
@@ -2643,7 +2643,7 @@ function ll({
|
|
|
2643
2643
|
s.action
|
|
2644
2644
|
),
|
|
2645
2645
|
children: [
|
|
2646
|
-
/* @__PURE__ */ e(
|
|
2646
|
+
/* @__PURE__ */ e(Fa, { className: "h-3.5 w-3.5" }),
|
|
2647
2647
|
" New"
|
|
2648
2648
|
]
|
|
2649
2649
|
}
|
|
@@ -2671,7 +2671,7 @@ function ll({
|
|
|
2671
2671
|
},
|
|
2672
2672
|
children: [
|
|
2673
2673
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2674
|
-
/* @__PURE__ */ e(
|
|
2674
|
+
/* @__PURE__ */ e(Ye, { icon: v.icon, color: v.color, size: 32 }),
|
|
2675
2675
|
/* @__PURE__ */ e(
|
|
2676
2676
|
"input",
|
|
2677
2677
|
{
|
|
@@ -2685,7 +2685,7 @@ function ll({
|
|
|
2685
2685
|
}
|
|
2686
2686
|
)
|
|
2687
2687
|
] }),
|
|
2688
|
-
/* @__PURE__ */ e(
|
|
2688
|
+
/* @__PURE__ */ e(Jn, { icon: v.icon, color: v.color, onChange: U }),
|
|
2689
2689
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2690
2690
|
[
|
|
2691
2691
|
["open", "Anyone"],
|
|
@@ -2715,7 +2715,7 @@ function ll({
|
|
|
2715
2715
|
)
|
|
2716
2716
|
] }),
|
|
2717
2717
|
b === "role" && /* @__PURE__ */ e(
|
|
2718
|
-
|
|
2718
|
+
It,
|
|
2719
2719
|
{
|
|
2720
2720
|
value: p,
|
|
2721
2721
|
onChange: x,
|
|
@@ -2733,7 +2733,7 @@ function ll({
|
|
|
2733
2733
|
/* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", children: [
|
|
2734
2734
|
S && /* @__PURE__ */ e("p", { className: "px-2 py-6 text-center text-[12px] text-slate-400", children: "Loading…" }),
|
|
2735
2735
|
!S && C.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-8 text-center", children: [
|
|
2736
|
-
/* @__PURE__ */ e(
|
|
2736
|
+
/* @__PURE__ */ e(Tt, { className: "mx-auto h-5 w-5 text-slate-300" }),
|
|
2737
2737
|
/* @__PURE__ */ e("p", { className: "mt-2 text-[12.5px] font-medium text-slate-600 dark:text-slate-300", children: l ? `No channel matches “${l}”` : "No channels yet" }),
|
|
2738
2738
|
/* @__PURE__ */ e("p", { className: "mt-1 text-[11.5px] leading-relaxed text-slate-400", children: "Channels and General are shared rooms you join to follow. Record conversations appear on their own once someone posts on a record." })
|
|
2739
2739
|
] }),
|
|
@@ -2743,12 +2743,12 @@ function ll({
|
|
|
2743
2743
|
className: "flex items-center gap-2.5 rounded-lg px-2.5 py-2 hover:bg-slate-50 dark:hover:bg-muted/50",
|
|
2744
2744
|
children: [
|
|
2745
2745
|
/* @__PURE__ */ e(
|
|
2746
|
-
|
|
2746
|
+
Ye,
|
|
2747
2747
|
{
|
|
2748
2748
|
icon: y.icon,
|
|
2749
2749
|
color: y.color,
|
|
2750
2750
|
size: 32,
|
|
2751
|
-
fallback: y.visibility === "private" ?
|
|
2751
|
+
fallback: y.visibility === "private" ? za : Tt
|
|
2752
2752
|
}
|
|
2753
2753
|
),
|
|
2754
2754
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
@@ -2759,7 +2759,7 @@ function ll({
|
|
|
2759
2759
|
"button",
|
|
2760
2760
|
{
|
|
2761
2761
|
type: "button",
|
|
2762
|
-
onClick: () => n(y.room, y.name,
|
|
2762
|
+
onClick: () => n(y.room, y.name, Wn(y)),
|
|
2763
2763
|
className: "shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium text-slate-500 hover:bg-slate-100 dark:hover:bg-muted",
|
|
2764
2764
|
children: "Open"
|
|
2765
2765
|
}
|
|
@@ -2768,7 +2768,7 @@ function ll({
|
|
|
2768
2768
|
{
|
|
2769
2769
|
type: "button",
|
|
2770
2770
|
onClick: () => E.mutate(y.room, {
|
|
2771
|
-
onSuccess: () => n(y.room, y.name,
|
|
2771
|
+
onSuccess: () => n(y.room, y.name, Wn(y))
|
|
2772
2772
|
}),
|
|
2773
2773
|
className: g("shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium", s.action),
|
|
2774
2774
|
children: "Join"
|
|
@@ -2786,7 +2786,7 @@ function ol() {
|
|
|
2786
2786
|
return n.setHours(23, 59, 59, 999), n;
|
|
2787
2787
|
}
|
|
2788
2788
|
function il() {
|
|
2789
|
-
const n =
|
|
2789
|
+
const n = jt(), s = Xn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), m = (b) => {
|
|
2790
2790
|
s.mutate({
|
|
2791
2791
|
presence_override: b === "off" ? null : { mode: "away", until: (b == null ? void 0 : b.toISOString()) ?? null }
|
|
2792
2792
|
}), r(!1);
|
|
@@ -2794,7 +2794,7 @@ function il() {
|
|
|
2794
2794
|
weekday: "short",
|
|
2795
2795
|
hour: "numeric",
|
|
2796
2796
|
minute: "2-digit",
|
|
2797
|
-
timeZone:
|
|
2797
|
+
timeZone: Lt() ?? void 0
|
|
2798
2798
|
})}` : i ? "until you switch it off" : null;
|
|
2799
2799
|
return /* @__PURE__ */ a(
|
|
2800
2800
|
"div",
|
|
@@ -2822,8 +2822,8 @@ function il() {
|
|
|
2822
2822
|
"data-chat-appear-away-off": !0,
|
|
2823
2823
|
children: "Back online"
|
|
2824
2824
|
}
|
|
2825
|
-
) : /* @__PURE__ */ a(
|
|
2826
|
-
/* @__PURE__ */ e(
|
|
2825
|
+
) : /* @__PURE__ */ a(Ve, { open: l, onOpenChange: r, children: [
|
|
2826
|
+
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2827
2827
|
"button",
|
|
2828
2828
|
{
|
|
2829
2829
|
type: "button",
|
|
@@ -2832,7 +2832,7 @@ function il() {
|
|
|
2832
2832
|
children: "Appear away"
|
|
2833
2833
|
}
|
|
2834
2834
|
) }),
|
|
2835
|
-
/* @__PURE__ */ a(
|
|
2835
|
+
/* @__PURE__ */ a(et, { align: "end", className: "w-48 p-1", children: [
|
|
2836
2836
|
/* @__PURE__ */ e("p", { className: "px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: "Appear away for" }),
|
|
2837
2837
|
[
|
|
2838
2838
|
["1 hour", () => new Date(Date.now() + 36e5)],
|
|
@@ -2857,7 +2857,7 @@ function il() {
|
|
|
2857
2857
|
);
|
|
2858
2858
|
}
|
|
2859
2859
|
function cl({ myStatus: n }) {
|
|
2860
|
-
const s =
|
|
2860
|
+
const s = de();
|
|
2861
2861
|
return /* @__PURE__ */ e(
|
|
2862
2862
|
Ts,
|
|
2863
2863
|
{
|
|
@@ -2867,18 +2867,18 @@ function cl({ myStatus: n }) {
|
|
|
2867
2867
|
}
|
|
2868
2868
|
);
|
|
2869
2869
|
}
|
|
2870
|
-
function
|
|
2870
|
+
function xa() {
|
|
2871
2871
|
var i, m, d;
|
|
2872
|
-
const n =
|
|
2872
|
+
const n = Ze(), s = Cs(15e3), { data: l, isFetched: r } = Te({
|
|
2873
2873
|
queryKey: ["presence-online"],
|
|
2874
|
-
queryFn: () => n.request(
|
|
2874
|
+
queryFn: () => n.request(ye("/presence/online")),
|
|
2875
2875
|
// Matches the presence heartbeat cadence without a live socket — the page someone is on
|
|
2876
2876
|
// should track them around the app. Live, presence:changed carries it and this is 60 s.
|
|
2877
2877
|
refetchInterval: s,
|
|
2878
2878
|
staleTime: 5e3
|
|
2879
2879
|
});
|
|
2880
2880
|
return {
|
|
2881
|
-
byUser:
|
|
2881
|
+
byUser: ve(() => {
|
|
2882
2882
|
const b = /* @__PURE__ */ new Map();
|
|
2883
2883
|
for (const f of (l == null ? void 0 : l.data) ?? []) b.set(String(f.user_id).toUpperCase(), f);
|
|
2884
2884
|
return b;
|
|
@@ -2889,7 +2889,7 @@ function pa() {
|
|
|
2889
2889
|
loaded: r
|
|
2890
2890
|
};
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2892
|
+
function ba(n) {
|
|
2893
2893
|
if (!n) return null;
|
|
2894
2894
|
const s = n.split("/").filter(Boolean);
|
|
2895
2895
|
if (s.length === 0) return "Home";
|
|
@@ -2900,7 +2900,7 @@ function dl({
|
|
|
2900
2900
|
onClose: n,
|
|
2901
2901
|
onCreated: s
|
|
2902
2902
|
}) {
|
|
2903
|
-
const l =
|
|
2903
|
+
const l = de(), [r, o] = T(""), [i, m] = T(""), [d, b] = T(/* @__PURE__ */ new Map()), { users: f } = Bt(r, !0), p = dr(), x = (v) => [v.first_name, v.last_name].filter(Boolean).join(" ") || (v.email ?? "Unknown");
|
|
2904
2904
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
|
|
2905
2905
|
/* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
2906
2906
|
/* @__PURE__ */ e(
|
|
@@ -2910,7 +2910,7 @@ function dl({
|
|
|
2910
2910
|
onClick: n,
|
|
2911
2911
|
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",
|
|
2912
2912
|
"aria-label": "Back",
|
|
2913
|
-
children: /* @__PURE__ */ e(
|
|
2913
|
+
children: /* @__PURE__ */ e(ut, { className: "h-4 w-4", strokeWidth: 2 })
|
|
2914
2914
|
}
|
|
2915
2915
|
),
|
|
2916
2916
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "New group conversation" })
|
|
@@ -2933,7 +2933,7 @@ function dl({
|
|
|
2933
2933
|
return C.delete(v), C;
|
|
2934
2934
|
}),
|
|
2935
2935
|
"aria-label": `Remove ${U}`,
|
|
2936
|
-
children: /* @__PURE__ */ e(
|
|
2936
|
+
children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
|
|
2937
2937
|
}
|
|
2938
2938
|
)
|
|
2939
2939
|
]
|
|
@@ -2966,9 +2966,9 @@ function dl({
|
|
|
2966
2966
|
U ? l.accentSoft : "hover:bg-slate-50 dark:hover:bg-muted/50"
|
|
2967
2967
|
),
|
|
2968
2968
|
children: [
|
|
2969
|
-
/* @__PURE__ */ e(
|
|
2969
|
+
/* @__PURE__ */ e(K, { id: v.id, name: x(v), size: 22 }),
|
|
2970
2970
|
/* @__PURE__ */ e("span", { className: "truncate", children: x(v) }),
|
|
2971
|
-
U && /* @__PURE__ */ e(
|
|
2971
|
+
U && /* @__PURE__ */ e(Ot, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
|
|
2972
2972
|
]
|
|
2973
2973
|
},
|
|
2974
2974
|
v.id
|
|
@@ -3005,10 +3005,10 @@ function dl({
|
|
|
3005
3005
|
)
|
|
3006
3006
|
] });
|
|
3007
3007
|
}
|
|
3008
|
-
const
|
|
3008
|
+
const Rt = "nvr-chat-pinned", St = 400;
|
|
3009
3009
|
function ul() {
|
|
3010
3010
|
try {
|
|
3011
|
-
return typeof window < "u" && window.localStorage.getItem(
|
|
3011
|
+
return typeof window < "u" && window.localStorage.getItem(Rt) === "1";
|
|
3012
3012
|
} catch {
|
|
3013
3013
|
return !1;
|
|
3014
3014
|
}
|
|
@@ -3020,7 +3020,7 @@ function ml() {
|
|
|
3020
3020
|
return typeof window < "u" && !!((r = window.matchMedia) != null && r.call(window, n).matches);
|
|
3021
3021
|
}
|
|
3022
3022
|
);
|
|
3023
|
-
return
|
|
3023
|
+
return X(() => {
|
|
3024
3024
|
var i;
|
|
3025
3025
|
const r = (i = window.matchMedia) == null ? void 0 : i.call(window, n);
|
|
3026
3026
|
if (!r) return;
|
|
@@ -3035,57 +3035,57 @@ function mo({
|
|
|
3035
3035
|
requestedDm: r,
|
|
3036
3036
|
requestedRoom: o
|
|
3037
3037
|
}) {
|
|
3038
|
-
var
|
|
3039
|
-
const i =
|
|
3038
|
+
var Ce;
|
|
3039
|
+
const i = Le(), m = de(), d = i.me, [b, f] = T(ul), p = ml(), x = b && p, v = () => {
|
|
3040
3040
|
const k = !b;
|
|
3041
3041
|
f(k);
|
|
3042
3042
|
try {
|
|
3043
|
-
k ? window.localStorage.setItem(
|
|
3043
|
+
k ? window.localStorage.setItem(Rt, "1") : window.localStorage.removeItem(Rt);
|
|
3044
3044
|
} catch {
|
|
3045
3045
|
}
|
|
3046
3046
|
};
|
|
3047
|
-
|
|
3047
|
+
X(() => {
|
|
3048
3048
|
if (!n || !x) return;
|
|
3049
3049
|
const k = document.body, M = k.style.paddingRight;
|
|
3050
|
-
k.style.paddingRight = `${
|
|
3050
|
+
k.style.paddingRight = `${St}px`, k.dataset.nvrChatPinned = "1";
|
|
3051
3051
|
const P = document.createElement("style");
|
|
3052
3052
|
return P.dataset.nvrChatPinnedStyle = "", P.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
|
|
3053
|
-
body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${
|
|
3053
|
+
body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${St}px; }`, document.head.appendChild(P), () => {
|
|
3054
3054
|
k.style.paddingRight = M, delete k.dataset.nvrChatPinned, P.remove();
|
|
3055
3055
|
};
|
|
3056
3056
|
}, [n, x]);
|
|
3057
3057
|
const [U, $] = T("online"), [C, S] = T(null), [E, R] = T(null), y = (k, M, P) => {
|
|
3058
|
-
const
|
|
3059
|
-
|
|
3060
|
-
}, [q, A] = T(!1), [
|
|
3061
|
-
var
|
|
3058
|
+
const Y = pe.find(($e) => $e.room === k);
|
|
3059
|
+
F(!1), S({ room: k, label: (Y == null ? void 0 : Y.label) ?? M, channel: Y == null ? void 0 : Y.channel, anchor: P });
|
|
3060
|
+
}, [q, A] = T(!1), [W, F] = T(!1), [H, ee] = T(null), { rooms: pe, totalUnread: te } = aa(), ne = sa(U === "archived"), le = (k, M, P) => {
|
|
3061
|
+
var $e, _;
|
|
3062
3062
|
if (!M) return [{ key: "all", label: null, users: k }];
|
|
3063
|
-
const
|
|
3063
|
+
const Y = /* @__PURE__ */ new Map();
|
|
3064
3064
|
for (const I of k) {
|
|
3065
|
-
const j = P.get(String(I.user_id).toUpperCase()),
|
|
3066
|
-
|
|
3065
|
+
const j = P.get(String(I.user_id).toUpperCase()), oe = M === "__role__" ? [Fn((j == null ? void 0 : j.role_name) ?? I.role_name) || "No role"] : (_ = ($e = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : $e[M]) != null && _.length ? j.scopes_by_dimension[M] : ["Unassigned"], V = [...new Set(oe)].sort((Z, G) => Z.localeCompare(G)).join(", ");
|
|
3066
|
+
Y.set(V, [...Y.get(V) ?? [], I]);
|
|
3067
3067
|
}
|
|
3068
|
-
return [...
|
|
3069
|
-
}, [
|
|
3068
|
+
return [...Y.entries()].sort((I, j) => I[0] === "Unassigned" ? 1 : j[0] === "Unassigned" ? -1 : I[0].localeCompare(j[0])).map(([I, j]) => ({ key: I, label: I, users: j }));
|
|
3069
|
+
}, [ae, ue] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c = xa(), L = c.loaded ? Gs(
|
|
3070
3070
|
i.onlineUsers.filter((k) => c.byUser.has(String(k.user_id).toUpperCase()))
|
|
3071
|
-
) : [], u =
|
|
3072
|
-
() => le(L,
|
|
3071
|
+
) : [], u = ve(
|
|
3072
|
+
() => le(L, ae, c.byUser),
|
|
3073
3073
|
// biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
|
|
3074
|
-
[L,
|
|
3075
|
-
), { isAdmin:
|
|
3076
|
-
/^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") :
|
|
3077
|
-
},
|
|
3078
|
-
d && ($("chat"), S({ room:
|
|
3079
|
-
},
|
|
3080
|
-
|
|
3081
|
-
!r || !d || r.nonce ===
|
|
3082
|
-
room:
|
|
3074
|
+
[L, ae, c.byUser]
|
|
3075
|
+
), { isAdmin: J } = pt(), { navigate: Ue } = vs(), he = (k) => {
|
|
3076
|
+
/^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") : Ue(k);
|
|
3077
|
+
}, Pe = (k) => {
|
|
3078
|
+
d && ($("chat"), S({ room: $t(d.id, k.user_id), label: k.display_name ?? "Direct message" }));
|
|
3079
|
+
}, Ne = ce(0);
|
|
3080
|
+
X(() => {
|
|
3081
|
+
!r || !d || r.nonce === Ne.current || (Ne.current = r.nonce, $("chat"), F(!1), S({
|
|
3082
|
+
room: $t(d.id, r.userId),
|
|
3083
3083
|
label: r.name ?? "Direct message"
|
|
3084
3084
|
}));
|
|
3085
3085
|
}, [r, d]);
|
|
3086
|
-
const
|
|
3087
|
-
return
|
|
3088
|
-
!o || o.nonce ===
|
|
3086
|
+
const De = ce(0);
|
|
3087
|
+
return X(() => {
|
|
3088
|
+
!o || o.nonce === De.current || (De.current = o.nonce, $("chat"), F(!1), S({ room: o.room, label: o.label ?? o.room }));
|
|
3089
3089
|
}, [o]), n ? /* @__PURE__ */ a(
|
|
3090
3090
|
"div",
|
|
3091
3091
|
{
|
|
@@ -3093,13 +3093,13 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3093
3093
|
// No backdrop: the rest of the page stays usable.
|
|
3094
3094
|
"pointer-events-none fixed inset-y-0 right-0 z-40"
|
|
3095
3095
|
) : "fixed inset-0 z-40 bg-black/40 animate-in fade-in duration-150",
|
|
3096
|
-
style: x ? { width:
|
|
3096
|
+
style: x ? { width: St } : void 0,
|
|
3097
3097
|
onClick: x ? void 0 : s,
|
|
3098
3098
|
"data-chat-panel": !0,
|
|
3099
3099
|
"data-nvr-recording-hide": !0,
|
|
3100
3100
|
"data-chat-pinned": x ? "1" : void 0,
|
|
3101
3101
|
children: [
|
|
3102
|
-
/* @__PURE__ */ e(
|
|
3102
|
+
/* @__PURE__ */ e(On, {}),
|
|
3103
3103
|
/* @__PURE__ */ a(
|
|
3104
3104
|
"aside",
|
|
3105
3105
|
{
|
|
@@ -3125,15 +3125,15 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3125
3125
|
),
|
|
3126
3126
|
children: [
|
|
3127
3127
|
k === "online" ? `Online · ${L.length}` : k === "chat" ? "Chat" : k === "browse" ? "Browse" : "Archived",
|
|
3128
|
-
k === "chat" &&
|
|
3128
|
+
k === "chat" && te > 0 && /* @__PURE__ */ e(
|
|
3129
3129
|
"span",
|
|
3130
3130
|
{
|
|
3131
3131
|
className: g(
|
|
3132
3132
|
"flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold leading-none",
|
|
3133
3133
|
m.pill
|
|
3134
3134
|
),
|
|
3135
|
-
title: `${
|
|
3136
|
-
children:
|
|
3135
|
+
title: `${te} unread`,
|
|
3136
|
+
children: te > 99 ? "99+" : te
|
|
3137
3137
|
}
|
|
3138
3138
|
)
|
|
3139
3139
|
]
|
|
@@ -3153,7 +3153,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3153
3153
|
b ? m.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
|
|
3154
3154
|
),
|
|
3155
3155
|
"data-chat-pin": b ? "on" : "off",
|
|
3156
|
-
children: b ? /* @__PURE__ */ e(
|
|
3156
|
+
children: b ? /* @__PURE__ */ e(Ha, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(Ut, { className: "h-4 w-4", strokeWidth: 2 })
|
|
3157
3157
|
}
|
|
3158
3158
|
),
|
|
3159
3159
|
/* @__PURE__ */ e(
|
|
@@ -3163,7 +3163,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3163
3163
|
onClick: s,
|
|
3164
3164
|
className: "rounded-md p-1.5 text-slate-400 hover:bg-slate-100 hover:text-slate-600 max-lg:ml-auto dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
3165
3165
|
"aria-label": "Close panel",
|
|
3166
|
-
children: /* @__PURE__ */ e(
|
|
3166
|
+
children: /* @__PURE__ */ e(mt, { className: "h-4 w-4", strokeWidth: 2 })
|
|
3167
3167
|
}
|
|
3168
3168
|
)
|
|
3169
3169
|
] }),
|
|
@@ -3176,7 +3176,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3176
3176
|
/* @__PURE__ */ e(
|
|
3177
3177
|
cl,
|
|
3178
3178
|
{
|
|
3179
|
-
myStatus: d ? ((
|
|
3179
|
+
myStatus: d ? ((Ce = c.byUser.get(String(d.id).toUpperCase())) == null ? void 0 : Ce.custom_status) ?? null : null
|
|
3180
3180
|
}
|
|
3181
3181
|
),
|
|
3182
3182
|
/* @__PURE__ */ e(il, {}),
|
|
@@ -3184,11 +3184,11 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3184
3184
|
L.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
|
|
3185
3185
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
|
|
3186
3186
|
/* @__PURE__ */ e(
|
|
3187
|
-
|
|
3187
|
+
It,
|
|
3188
3188
|
{
|
|
3189
|
-
value:
|
|
3189
|
+
value: ae,
|
|
3190
3190
|
onChange: (k) => {
|
|
3191
|
-
|
|
3191
|
+
ue(k);
|
|
3192
3192
|
try {
|
|
3193
3193
|
localStorage.setItem("nvr_chat_group_by", k);
|
|
3194
3194
|
} catch {
|
|
@@ -3210,46 +3210,46 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3210
3210
|
/* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
|
|
3211
3211
|
] }),
|
|
3212
3212
|
k.users.map((M) => {
|
|
3213
|
-
const P = c.byUser.get(String(M.user_id).toUpperCase()),
|
|
3213
|
+
const P = c.byUser.get(String(M.user_id).toUpperCase()), Y = (P == null ? void 0 : P.is_idle) ?? M.is_idle, $e = P ?? M;
|
|
3214
3214
|
return /* @__PURE__ */ a(
|
|
3215
3215
|
"div",
|
|
3216
3216
|
{
|
|
3217
3217
|
className: "flex w-full items-center rounded-lg pl-2.5 transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
|
|
3218
3218
|
"data-chat-online-row": !0,
|
|
3219
3219
|
children: [
|
|
3220
|
-
/* @__PURE__ */ e(
|
|
3220
|
+
/* @__PURE__ */ e(Pt, { userId: M.user_id, children: /* @__PURE__ */ e(
|
|
3221
3221
|
"button",
|
|
3222
3222
|
{
|
|
3223
3223
|
type: "button",
|
|
3224
3224
|
className: "shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
3225
3225
|
"aria-label": `${M.display_name ?? "Unknown user"} — profile`,
|
|
3226
3226
|
"data-chat-online-avatar": !0,
|
|
3227
|
-
children: /* @__PURE__ */ e(
|
|
3227
|
+
children: /* @__PURE__ */ e(K, { id: M.user_id, name: M.display_name })
|
|
3228
3228
|
}
|
|
3229
3229
|
) }),
|
|
3230
3230
|
/* @__PURE__ */ a(
|
|
3231
3231
|
"button",
|
|
3232
3232
|
{
|
|
3233
3233
|
type: "button",
|
|
3234
|
-
onClick: () =>
|
|
3234
|
+
onClick: () => Pe(M),
|
|
3235
3235
|
title: "Send a direct message",
|
|
3236
3236
|
className: "flex min-w-0 flex-1 items-center gap-3 py-2 pl-3 pr-2.5 text-left",
|
|
3237
3237
|
children: [
|
|
3238
3238
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
3239
3239
|
/* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
|
|
3240
3240
|
M.display_name ?? "Unknown user",
|
|
3241
|
-
|
|
3242
|
-
!
|
|
3243
|
-
const _ = P.stuck, I = c.fields.includes("page"), j =
|
|
3241
|
+
Y && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: P != null && P.away ? "Away" : At($e) }),
|
|
3242
|
+
!Y && (P == null ? void 0 : P.stuck) && (() => {
|
|
3243
|
+
const _ = P.stuck, I = c.fields.includes("page"), j = An(
|
|
3244
3244
|
P.current_path,
|
|
3245
3245
|
P.app,
|
|
3246
3246
|
c.adminUrl,
|
|
3247
3247
|
i.recordUrl,
|
|
3248
3248
|
typeof window > "u" ? null : window.location.origin
|
|
3249
|
-
),
|
|
3250
|
-
${
|
|
3249
|
+
), oe = `${Rn(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
|
|
3250
|
+
${Mn(j)}` : ""}`, V = Rn(
|
|
3251
3251
|
I ? { ..._, label: null } : _
|
|
3252
|
-
),
|
|
3252
|
+
), Z = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
|
|
3253
3253
|
return j ? (
|
|
3254
3254
|
// biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
|
|
3255
3255
|
/* @__PURE__ */ e(
|
|
@@ -3257,26 +3257,26 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3257
3257
|
{
|
|
3258
3258
|
role: "link",
|
|
3259
3259
|
tabIndex: 0,
|
|
3260
|
-
className: g(
|
|
3260
|
+
className: g(Z, "cursor-pointer hover:underline"),
|
|
3261
3261
|
"data-chat-stuck": _.minutes,
|
|
3262
|
-
"data-tip":
|
|
3263
|
-
"aria-label": `${
|
|
3264
|
-
onClick: (
|
|
3265
|
-
|
|
3262
|
+
"data-tip": oe,
|
|
3263
|
+
"aria-label": `${V}: open the page`,
|
|
3264
|
+
onClick: (G) => {
|
|
3265
|
+
G.stopPropagation(), he(j);
|
|
3266
3266
|
},
|
|
3267
|
-
onKeyDown: (
|
|
3268
|
-
(
|
|
3267
|
+
onKeyDown: (G) => {
|
|
3268
|
+
(G.key === "Enter" || G.key === " ") && (G.preventDefault(), G.stopPropagation(), he(j));
|
|
3269
3269
|
},
|
|
3270
|
-
children:
|
|
3270
|
+
children: V
|
|
3271
3271
|
}
|
|
3272
3272
|
)
|
|
3273
3273
|
) : /* @__PURE__ */ e(
|
|
3274
3274
|
"span",
|
|
3275
3275
|
{
|
|
3276
|
-
className:
|
|
3276
|
+
className: Z,
|
|
3277
3277
|
"data-chat-stuck": _.minutes,
|
|
3278
|
-
"data-tip":
|
|
3279
|
-
children:
|
|
3278
|
+
"data-tip": oe,
|
|
3279
|
+
children: V
|
|
3280
3280
|
}
|
|
3281
3281
|
);
|
|
3282
3282
|
})(),
|
|
@@ -3298,7 +3298,7 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3298
3298
|
}
|
|
3299
3299
|
) : null;
|
|
3300
3300
|
})(),
|
|
3301
|
-
|
|
3301
|
+
J && /* @__PURE__ */ e($s, { builds: P == null ? void 0 : P.stale_build })
|
|
3302
3302
|
] }),
|
|
3303
3303
|
(() => {
|
|
3304
3304
|
const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = _ == null ? void 0 : _.custom_status;
|
|
@@ -3315,7 +3315,7 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3315
3315
|
"data-chat-in-huddle": !0,
|
|
3316
3316
|
"data-tip": "In a huddle right now",
|
|
3317
3317
|
children: [
|
|
3318
|
-
/* @__PURE__ */ e(
|
|
3318
|
+
/* @__PURE__ */ e(Ga, { className: "h-3 w-3", strokeWidth: 2 }),
|
|
3319
3319
|
!I && "In a huddle"
|
|
3320
3320
|
]
|
|
3321
3321
|
}
|
|
@@ -3330,41 +3330,53 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3330
3330
|
})(),
|
|
3331
3331
|
(() => {
|
|
3332
3332
|
const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = [];
|
|
3333
|
-
let j = null;
|
|
3334
|
-
for (const
|
|
3335
|
-
if (
|
|
3336
|
-
const
|
|
3337
|
-
|
|
3338
|
-
} else if (
|
|
3339
|
-
const
|
|
3340
|
-
|
|
3341
|
-
} else if (
|
|
3342
|
-
const
|
|
3343
|
-
j = (
|
|
3333
|
+
let j = null, oe = !1;
|
|
3334
|
+
for (const G of c.fields)
|
|
3335
|
+
if (G === "role") {
|
|
3336
|
+
const se = Fn((_ == null ? void 0 : _.role_name) ?? M.role_name);
|
|
3337
|
+
se && I.push(se);
|
|
3338
|
+
} else if (G === "scopes") {
|
|
3339
|
+
const se = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
|
|
3340
|
+
se && I.push(se);
|
|
3341
|
+
} else if (G === "page") {
|
|
3342
|
+
const se = (_ == null ? void 0 : _.page) ?? M.page ?? ba((_ == null ? void 0 : _.current_path) ?? M.current_path), fe = (_ == null ? void 0 : _.app) ?? M.app;
|
|
3343
|
+
j = (fe ? `${se ?? ""}${se ? " · " : ""}${fe}`.trim() : se) || null, oe = !j && !!_ && !_.away;
|
|
3344
|
+
}
|
|
3345
|
+
const V = I.join(" · "), Z = oe ? /* @__PURE__ */ a(
|
|
3346
|
+
"span",
|
|
3347
|
+
{
|
|
3348
|
+
className: "flex items-start gap-1 text-[11px] italic text-slate-400 dark:text-slate-500",
|
|
3349
|
+
"data-chat-online-page": "background",
|
|
3350
|
+
"data-tip": "Their app is open in a tab that is not in front, so where they are is not known until they look at it.",
|
|
3351
|
+
children: [
|
|
3352
|
+
/* @__PURE__ */ e($n, { className: "mt-[2px] h-3 w-3 shrink-0 opacity-60" }),
|
|
3353
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: "Tab in background" })
|
|
3354
|
+
]
|
|
3344
3355
|
}
|
|
3345
|
-
|
|
3346
|
-
return !
|
|
3347
|
-
|
|
3356
|
+
) : null;
|
|
3357
|
+
return !V && !j && !Z ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(ke, { children: [
|
|
3358
|
+
V && /* @__PURE__ */ e(
|
|
3348
3359
|
"span",
|
|
3349
3360
|
{
|
|
3350
3361
|
className: "block truncate text-[11px] text-slate-400",
|
|
3351
3362
|
"data-chat-online-meta": !0,
|
|
3352
|
-
title:
|
|
3353
|
-
children:
|
|
3363
|
+
title: V,
|
|
3364
|
+
children: V
|
|
3354
3365
|
}
|
|
3355
3366
|
),
|
|
3367
|
+
Z,
|
|
3356
3368
|
j && (() => {
|
|
3357
|
-
const
|
|
3369
|
+
const G = An(
|
|
3358
3370
|
_ == null ? void 0 : _.current_path,
|
|
3359
3371
|
_ == null ? void 0 : _.app,
|
|
3360
3372
|
c.adminUrl,
|
|
3361
3373
|
i.recordUrl,
|
|
3362
3374
|
typeof window > "u" ? null : window.location.origin
|
|
3363
|
-
),
|
|
3364
|
-
/* @__PURE__ */ e(
|
|
3375
|
+
), se = /* @__PURE__ */ a(ke, { children: [
|
|
3376
|
+
/* @__PURE__ */ e($n, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
|
|
3365
3377
|
/* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: j })
|
|
3366
3378
|
] });
|
|
3367
|
-
return
|
|
3379
|
+
return G ? (
|
|
3368
3380
|
// biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
|
|
3369
3381
|
/* @__PURE__ */ e(
|
|
3370
3382
|
"span",
|
|
@@ -3373,16 +3385,16 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3373
3385
|
tabIndex: 0,
|
|
3374
3386
|
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",
|
|
3375
3387
|
"data-chat-online-page": !0,
|
|
3376
|
-
"data-chat-online-page-href":
|
|
3377
|
-
"data-tip":
|
|
3388
|
+
"data-chat-online-page-href": G,
|
|
3389
|
+
"data-tip": Mn(G),
|
|
3378
3390
|
"aria-label": `${j}: open the page`,
|
|
3379
|
-
onClick: (
|
|
3380
|
-
|
|
3391
|
+
onClick: (fe) => {
|
|
3392
|
+
fe.stopPropagation(), he(G);
|
|
3381
3393
|
},
|
|
3382
|
-
onKeyDown: (
|
|
3383
|
-
(
|
|
3394
|
+
onKeyDown: (fe) => {
|
|
3395
|
+
(fe.key === "Enter" || fe.key === " ") && (fe.preventDefault(), fe.stopPropagation(), he(G));
|
|
3384
3396
|
},
|
|
3385
|
-
children:
|
|
3397
|
+
children: se
|
|
3386
3398
|
}
|
|
3387
3399
|
)
|
|
3388
3400
|
) : /* @__PURE__ */ e(
|
|
@@ -3391,7 +3403,7 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3391
3403
|
className: "flex items-start gap-1 text-[11px] text-slate-500 dark:text-slate-300",
|
|
3392
3404
|
"data-chat-online-page": !0,
|
|
3393
3405
|
"data-tip": (_ == null ? void 0 : _.current_path) ?? j,
|
|
3394
|
-
children:
|
|
3406
|
+
children: se
|
|
3395
3407
|
}
|
|
3396
3408
|
);
|
|
3397
3409
|
})()
|
|
@@ -3399,29 +3411,29 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3399
3411
|
})()
|
|
3400
3412
|
] }),
|
|
3401
3413
|
(() => {
|
|
3402
|
-
var
|
|
3414
|
+
var V;
|
|
3403
3415
|
const _ = c.byUser.get(String(M.user_id).toUpperCase());
|
|
3404
|
-
if (!
|
|
3405
|
-
const I = ((
|
|
3406
|
-
return
|
|
3416
|
+
if (!J || !(_ != null && _.recording_id)) return null;
|
|
3417
|
+
const I = ((V = c.adminUrl) == null ? void 0 : V.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), oe = i.sessionUrl ? i.sessionUrl(_.recording_id, String(M.user_id)) : j ? `${I}/session-replays?recording=${_.recording_id}` : null;
|
|
3418
|
+
return oe ? /* @__PURE__ */ e(
|
|
3407
3419
|
"span",
|
|
3408
3420
|
{
|
|
3409
3421
|
role: "link",
|
|
3410
3422
|
tabIndex: 0,
|
|
3411
3423
|
title: "Watch this session",
|
|
3412
|
-
onClick: (
|
|
3413
|
-
|
|
3424
|
+
onClick: (Z) => {
|
|
3425
|
+
Z.stopPropagation(), he(oe);
|
|
3414
3426
|
},
|
|
3415
|
-
onKeyDown: (
|
|
3416
|
-
(
|
|
3427
|
+
onKeyDown: (Z) => {
|
|
3428
|
+
(Z.key === "Enter" || Z.key === " ") && (Z.stopPropagation(), he(oe));
|
|
3417
3429
|
},
|
|
3418
3430
|
className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
|
|
3419
|
-
children: /* @__PURE__ */ e(
|
|
3431
|
+
children: /* @__PURE__ */ e(Qa, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
3420
3432
|
}
|
|
3421
3433
|
) : null;
|
|
3422
3434
|
})(),
|
|
3423
3435
|
/* @__PURE__ */ e(
|
|
3424
|
-
|
|
3436
|
+
Qn,
|
|
3425
3437
|
{
|
|
3426
3438
|
className: "h-4 w-4 shrink-0 text-slate-300",
|
|
3427
3439
|
strokeWidth: 1.8
|
|
@@ -3438,22 +3450,22 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3438
3450
|
] }, k.key))
|
|
3439
3451
|
]
|
|
3440
3452
|
}
|
|
3441
|
-
) : U === "archived" ?
|
|
3442
|
-
|
|
3453
|
+
) : U === "archived" ? H ? /* @__PURE__ */ e(
|
|
3454
|
+
Bn,
|
|
3443
3455
|
{
|
|
3444
|
-
room:
|
|
3445
|
-
label:
|
|
3446
|
-
onBack: () =>
|
|
3456
|
+
room: H.room,
|
|
3457
|
+
label: H.label,
|
|
3458
|
+
onBack: () => ee(null),
|
|
3447
3459
|
renderMessageBody: l
|
|
3448
3460
|
},
|
|
3449
|
-
|
|
3461
|
+
H.room
|
|
3450
3462
|
) : /* @__PURE__ */ e(
|
|
3451
|
-
|
|
3463
|
+
Hn,
|
|
3452
3464
|
{
|
|
3453
|
-
rooms:
|
|
3454
|
-
loading:
|
|
3465
|
+
rooms: ne.rooms,
|
|
3466
|
+
loading: ne.loading,
|
|
3455
3467
|
archivedView: !0,
|
|
3456
|
-
onOpen: (k) =>
|
|
3468
|
+
onOpen: (k) => ee({ room: k.room, label: k.label })
|
|
3457
3469
|
}
|
|
3458
3470
|
) : U === "browse" ? (
|
|
3459
3471
|
// The tab is checked BEFORE the open room: leaving it last meant
|
|
@@ -3463,7 +3475,7 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3463
3475
|
ll,
|
|
3464
3476
|
{
|
|
3465
3477
|
onOpen: (k, M, P) => {
|
|
3466
|
-
|
|
3478
|
+
F(!1), S({ room: k, label: M, channel: P }), $("chat");
|
|
3467
3479
|
}
|
|
3468
3480
|
}
|
|
3469
3481
|
)
|
|
@@ -3475,49 +3487,49 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3475
3487
|
A(!1), S({ room: k, label: M });
|
|
3476
3488
|
}
|
|
3477
3489
|
}
|
|
3478
|
-
) : C &&
|
|
3490
|
+
) : C && W && C.channel ? /* @__PURE__ */ e(
|
|
3479
3491
|
al,
|
|
3480
3492
|
{
|
|
3481
3493
|
channel: C.channel,
|
|
3482
3494
|
label: C.label,
|
|
3483
|
-
onBack: () =>
|
|
3495
|
+
onBack: () => F(!1)
|
|
3484
3496
|
}
|
|
3485
3497
|
) : C ? /* @__PURE__ */ e(
|
|
3486
|
-
|
|
3498
|
+
Bn,
|
|
3487
3499
|
{
|
|
3488
3500
|
room: C.room,
|
|
3489
3501
|
label: C.label,
|
|
3490
|
-
onOpenSettings: C.channel && !C.channel.is_direct ? () =>
|
|
3502
|
+
onOpenSettings: C.channel && !C.channel.is_direct ? () => F(!0) : void 0,
|
|
3491
3503
|
onBack: () => S(null),
|
|
3492
3504
|
renderMessageBody: l,
|
|
3493
3505
|
initialUnread: C.unread,
|
|
3494
3506
|
anchor: C.anchor ?? null
|
|
3495
3507
|
},
|
|
3496
3508
|
C.room
|
|
3497
|
-
) : E === "mentions" ? /* @__PURE__ */ e(
|
|
3498
|
-
|
|
3509
|
+
) : E === "mentions" ? /* @__PURE__ */ e(Yn, { th: m, onBack: () => R(null), onOpen: y }) : E === "scheduled" ? /* @__PURE__ */ e(
|
|
3510
|
+
Zn,
|
|
3499
3511
|
{
|
|
3500
3512
|
th: m,
|
|
3501
3513
|
onBack: () => R(null),
|
|
3502
3514
|
roomLabel: (k) => {
|
|
3503
3515
|
var M;
|
|
3504
|
-
return ((M =
|
|
3516
|
+
return ((M = pe.find((P) => P.room === k)) == null ? void 0 : M.label) ?? k;
|
|
3505
3517
|
}
|
|
3506
3518
|
}
|
|
3507
3519
|
) : E === "catchup" ? /* @__PURE__ */ e(
|
|
3508
|
-
|
|
3520
|
+
Vn,
|
|
3509
3521
|
{
|
|
3510
|
-
rooms:
|
|
3522
|
+
rooms: pe,
|
|
3511
3523
|
th: m,
|
|
3512
3524
|
onBack: () => R(null),
|
|
3513
3525
|
onOpen: y
|
|
3514
3526
|
}
|
|
3515
3527
|
) : /* @__PURE__ */ e(
|
|
3516
|
-
|
|
3528
|
+
Hn,
|
|
3517
3529
|
{
|
|
3518
|
-
rooms:
|
|
3530
|
+
rooms: pe,
|
|
3519
3531
|
onOpen: (k, M) => {
|
|
3520
|
-
|
|
3532
|
+
F(!1), S({
|
|
3521
3533
|
room: k.room,
|
|
3522
3534
|
label: k.label,
|
|
3523
3535
|
channel: k.channel,
|
|
@@ -3534,7 +3546,7 @@ ${$n(j)}` : ""}`, Q = Dn(
|
|
|
3534
3546
|
)
|
|
3535
3547
|
]
|
|
3536
3548
|
}
|
|
3537
|
-
) : /* @__PURE__ */ e(
|
|
3549
|
+
) : /* @__PURE__ */ e(On, {});
|
|
3538
3550
|
}
|
|
3539
3551
|
export {
|
|
3540
3552
|
il as ChatAppearAwayRow,
|
|
@@ -3542,8 +3554,8 @@ export {
|
|
|
3542
3554
|
al as ChatChannelSettings,
|
|
3543
3555
|
mo as ChatPanel,
|
|
3544
3556
|
co as ChatProvider,
|
|
3545
|
-
|
|
3546
|
-
|
|
3557
|
+
Hn as ChatRoomList,
|
|
3558
|
+
Bn as ChatRoomView,
|
|
3547
3559
|
uo as ChatSideView,
|
|
3548
3560
|
ul as isChatPanelPinned
|
|
3549
3561
|
};
|