@nivaro/react 0.3.114 → 0.3.115
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/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1717 -21
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +1 -0
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +1927 -1635
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -1,240 +1,274 @@
|
|
|
1
|
-
import { jsxs as n, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Archive as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as qe } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as Nt, useQuery as H, keepPreviousData as Ct, useMutation as A } from "@tanstack/react-query";
|
|
3
|
+
import { Archive as Me, CheckCheck as St, Search as _t, Check as oe, AlarmClock as ce, ExternalLink as Te, Bell as Le, ShieldCheck as ue, ChevronUp as At, ChevronLeft as Dt, ChevronRight as zt, History as $t, Trash2 as Ft, ChevronDown as qt } from "lucide-react";
|
|
4
|
+
import { useState as c, useEffect as me, useRef as Mt, useCallback as Tt, Fragment as pe } from "react";
|
|
5
|
+
import { useNivaroClient as Lt } from "../../context.js";
|
|
6
|
+
import { get as Q, post as w, patch as Pt, del as Rt } from "../../lib/commands.js";
|
|
7
|
+
import { useTopInserts as Pe, slideIn as Ot } from "../../lib/live-screen.js";
|
|
8
|
+
import { resolveNotificationTargetFor as V, runNotificationTarget as be } from "../../lib/notification-target.js";
|
|
9
|
+
import { openInTabsMessage as It, openInTabs as jt } from "../../lib/open-in-tabs.js";
|
|
10
|
+
import { useRecordPeek as Kt, isNewTabClick as Bt, notificationPeekTarget as Re } from "../../lib/record-peek.js";
|
|
11
|
+
import { cn as b, formatRelative as Oe } from "../../lib/utils.js";
|
|
12
|
+
import { AgentBadge as Ut } from "../AgentBadge.js";
|
|
13
|
+
import { hasSnapshotView as Ht, offersChanges as Qt } from "../NotificationBell.js";
|
|
14
|
+
import { RelativeTime as Ie } from "../RelativeTime.js";
|
|
15
|
+
import { SimpleSelect as he } from "../ui/SimpleSelect.js";
|
|
16
|
+
import { AsItWasSheet as Gt } from "./AsItWasSheet.js";
|
|
17
|
+
import { bundleLocally as Yt, laneTone as Vt, bundleAsNotification as Wt, bundleHeadline as Zt, categoryChipLabel as Jt } from "./bundles.js";
|
|
18
|
+
import { DeliveryChips as Xt } from "./DeliveryChips.js";
|
|
19
|
+
import { NotificationActions as Et } from "./NotificationActions.js";
|
|
20
|
+
import { NotificationChangesList as ea, ResolvedLine as ta, NotificationDetailBits as aa } from "./NotificationDetailBits.js";
|
|
21
|
+
const xe = 25, na = [
|
|
18
22
|
{ key: "all", label: "All" },
|
|
19
23
|
{ key: "inbox", label: "Unread" },
|
|
20
24
|
{ key: "read", label: "Read" },
|
|
21
25
|
{ key: "snoozed", label: "Snoozed" },
|
|
22
26
|
{ key: "archived", label: "Archived" },
|
|
23
27
|
{ key: "sent", label: "Sent" }
|
|
24
|
-
],
|
|
28
|
+
], la = [
|
|
25
29
|
{ key: "all", label: "Every lane" },
|
|
26
30
|
{ key: "critical", label: "Critical" },
|
|
27
31
|
{ key: "needs_you", label: "Needs you" },
|
|
28
32
|
{ key: "fyi", label: "FYI" }
|
|
29
33
|
];
|
|
30
|
-
function
|
|
31
|
-
const
|
|
34
|
+
function je() {
|
|
35
|
+
const m = /* @__PURE__ */ new Date(), h = new Date(m.getTime() + 3600 * 1e3), N = new Date(m);
|
|
32
36
|
N.setDate(N.getDate() + 1), N.setHours(8, 0, 0, 0);
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
{ label: "For 1 hour", until:
|
|
37
|
+
const D = new Date(m);
|
|
38
|
+
return D.setDate(D.getDate() + ((8 - D.getDay()) % 7 || 7)), D.setHours(8, 0, 0, 0), [
|
|
39
|
+
{ label: "For 1 hour", until: h },
|
|
36
40
|
{ label: "Until tomorrow 8am", until: N },
|
|
37
|
-
{ label: "Until next week", until:
|
|
41
|
+
{ label: "Until next week", until: D }
|
|
38
42
|
];
|
|
39
43
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
const Ke = (m) => `b:${m.collection}:${m.item}`, Be = (m) => `n:${m.id}`;
|
|
45
|
+
function Sa({
|
|
46
|
+
routes: m,
|
|
47
|
+
onNavigate: h,
|
|
43
48
|
app: N,
|
|
44
|
-
mailLogUrl:
|
|
45
|
-
subscriptionsPath:
|
|
46
|
-
rulesPath:
|
|
47
|
-
changesId:
|
|
49
|
+
mailLogUrl: D,
|
|
50
|
+
subscriptionsPath: He,
|
|
51
|
+
rulesPath: Qe,
|
|
52
|
+
changesId: fe,
|
|
48
53
|
onNotice: r,
|
|
49
54
|
onError: d,
|
|
50
|
-
className:
|
|
55
|
+
className: Ge
|
|
51
56
|
}) {
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
57
|
+
const p = Lt(), W = Kt(), Z = Nt(), [J, Ye] = c(() => {
|
|
58
|
+
if (fe !== void 0) return fe;
|
|
54
59
|
if (typeof window > "u") return null;
|
|
55
60
|
const e = new URLSearchParams(window.location.search).get("changes"), a = Number(e);
|
|
56
61
|
return e && Number.isInteger(a) && a > 0 ? a : null;
|
|
57
|
-
}), [i,
|
|
58
|
-
queryKey: ["notifications", "sent",
|
|
59
|
-
queryFn: () =>
|
|
60
|
-
|
|
62
|
+
}), [i, Ve] = c("all"), [C, We] = c("all"), [G, Ze] = c(!0), { data: ge = [], isLoading: Je } = H({
|
|
63
|
+
queryKey: ["notifications", "sent", G],
|
|
64
|
+
queryFn: () => p.request(
|
|
65
|
+
Q("/notifications/sent", { lane: G ? "critical" : "all" })
|
|
61
66
|
).then((e) => e.data ?? []),
|
|
62
67
|
enabled: i === "sent",
|
|
63
68
|
refetchInterval: i === "sent" ? 3e4 : !1
|
|
64
|
-
}), [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, [i,
|
|
69
|
+
}), [S, F] = c(1), [Xe, X] = c(null), [ke, ve] = c(null), [E, Ee] = c(""), [I, et] = c(""), [q, tt] = c(""), [j, at] = c(!0), [nt, lt] = c(() => /* @__PURE__ */ new Set()), [v, ye] = c(null), [M, Y] = c(() => /* @__PURE__ */ new Set()), [ee, K] = c(!1), [rt, te] = c(!1), [we, dt] = c(!1), [Ne, it] = c("30");
|
|
70
|
+
me(() => {
|
|
71
|
+
Y(/* @__PURE__ */ new Set()), K(!1), te(!1);
|
|
72
|
+
}, [i, C, S, I, q]), me(() => {
|
|
68
73
|
const e = setTimeout(() => {
|
|
69
|
-
|
|
74
|
+
et(E.trim()), F(1);
|
|
70
75
|
}, 350);
|
|
71
76
|
return () => clearTimeout(e);
|
|
72
|
-
}, [
|
|
73
|
-
const { data:
|
|
77
|
+
}, [E]);
|
|
78
|
+
const { data: y } = H({
|
|
74
79
|
queryKey: ["notification-count"],
|
|
75
|
-
queryFn: () =>
|
|
76
|
-
}), { data:
|
|
80
|
+
queryFn: () => p.request(Q("/notifications/unread-count"))
|
|
81
|
+
}), { data: u, isLoading: st, isPlaceholderData: ot } = H({
|
|
77
82
|
queryKey: [
|
|
78
83
|
"notifications",
|
|
79
84
|
"center",
|
|
80
85
|
i,
|
|
86
|
+
C,
|
|
81
87
|
S,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
T,
|
|
88
|
+
I,
|
|
89
|
+
q,
|
|
85
90
|
N ?? null,
|
|
86
|
-
|
|
91
|
+
j
|
|
87
92
|
],
|
|
88
|
-
queryFn: () =>
|
|
89
|
-
|
|
90
|
-
page:
|
|
91
|
-
limit:
|
|
93
|
+
queryFn: () => p.request(
|
|
94
|
+
Q("/notifications", {
|
|
95
|
+
page: S,
|
|
96
|
+
limit: xe,
|
|
92
97
|
status: i === "snoozed" || i === "sent" ? "all" : i,
|
|
93
98
|
snoozed: i === "snoozed" ? "true" : void 0,
|
|
94
|
-
lane:
|
|
95
|
-
search:
|
|
96
|
-
collection:
|
|
99
|
+
lane: C === "all" ? void 0 : C,
|
|
100
|
+
search: I || void 0,
|
|
101
|
+
collection: q || void 0,
|
|
97
102
|
app: N,
|
|
98
|
-
bundle:
|
|
103
|
+
bundle: j ? "record" : void 0
|
|
99
104
|
})
|
|
100
105
|
).then((e) => {
|
|
101
|
-
if (!
|
|
102
|
-
const a =
|
|
106
|
+
if (!j || e.bundles) return e;
|
|
107
|
+
const a = Yt(e.data ?? []);
|
|
103
108
|
return { ...e, data: a.rows, bundles: a.bundles };
|
|
104
109
|
}),
|
|
105
|
-
placeholderData:
|
|
110
|
+
placeholderData: Ct,
|
|
106
111
|
enabled: i !== "sent"
|
|
107
|
-
}), { data:
|
|
112
|
+
}), { data: ct = [] } = H({
|
|
108
113
|
queryKey: ["notifications", "center", "collections"],
|
|
109
|
-
queryFn: () =>
|
|
110
|
-
|
|
114
|
+
queryFn: () => p.request(
|
|
115
|
+
Q("/collections")
|
|
111
116
|
).then((e) => {
|
|
112
117
|
const a = Array.isArray(e) ? e : e.data ?? [];
|
|
113
118
|
return [...new Set(a.map((l) => l.collection))].sort();
|
|
114
119
|
}),
|
|
115
120
|
staleTime: 3e5
|
|
116
|
-
}),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
}), z = i === "archived" || S > 1 ? [] : (u == null ? void 0 : u.pinned) ?? [], ut = new Set(z.map((e) => e.id)), T = ((u == null ? void 0 : u.data) ?? []).filter((e) => !ut.has(e.id)), B = (u == null ? void 0 : u.bundles) ?? [], $ = (u == null ? void 0 : u.total) ?? 0, ae = Math.max(1, Math.ceil($ / xe)), Ce = i !== "sent" && S === 1 && !!u && !ot, Se = [i, C, I, q, N ?? "", j].join("|"), L = Pe(u ? B : void 0, Ke, {
|
|
122
|
+
enabled: Ce,
|
|
123
|
+
resetKey: Se
|
|
124
|
+
}), P = Pe(u ? T : void 0, Be, {
|
|
125
|
+
enabled: Ce,
|
|
126
|
+
resetKey: Se
|
|
127
|
+
}), mt = u ? L.rows : B, _e = u ? P.rows : T, ne = L.held + P.held, Ae = Mt(null), De = L.rootRef, ze = P.rootRef, pt = Tt(
|
|
128
|
+
(e) => {
|
|
129
|
+
Ae.current = e, De(e), ze(e);
|
|
130
|
+
},
|
|
131
|
+
[De, ze]
|
|
132
|
+
);
|
|
133
|
+
me(() => {
|
|
134
|
+
Ot(Ae.current, [...L.arrived, ...P.arrived]);
|
|
135
|
+
}, [L.arrived, P.arrived]);
|
|
136
|
+
const bt = () => {
|
|
137
|
+
L.reveal(), P.reveal();
|
|
138
|
+
}, k = () => {
|
|
139
|
+
Z.invalidateQueries({ queryKey: ["notifications"] }), Z.invalidateQueries({ queryKey: ["notification-count"] });
|
|
140
|
+
}, ht = A({
|
|
141
|
+
mutationFn: (e) => p.request(w("/notifications/mark-read", { ids: e })),
|
|
142
|
+
onSuccess: k,
|
|
121
143
|
onError: () => d == null ? void 0 : d("Failed to mark the bundle read")
|
|
122
|
-
}),
|
|
123
|
-
mutationFn: () =>
|
|
144
|
+
}), le = A({
|
|
145
|
+
mutationFn: () => p.request(w("/notifications/mark-all-read")),
|
|
124
146
|
onSuccess: () => {
|
|
125
|
-
|
|
147
|
+
k(), r == null || r("All notifications marked as read");
|
|
126
148
|
},
|
|
127
149
|
onError: () => d == null ? void 0 : d("Failed to mark all read")
|
|
128
|
-
}),
|
|
150
|
+
}), U = A({
|
|
129
151
|
mutationFn: ({
|
|
130
152
|
id: e,
|
|
131
153
|
until: a,
|
|
132
154
|
untilChange: l
|
|
133
|
-
}) =>
|
|
134
|
-
|
|
155
|
+
}) => p.request(
|
|
156
|
+
w(
|
|
135
157
|
`/notifications/${e}/snooze`,
|
|
136
158
|
l ? { until_change: !0 } : { until: a ? a.toISOString() : null }
|
|
137
159
|
)
|
|
138
160
|
),
|
|
139
161
|
onSuccess: (e, a) => {
|
|
140
|
-
|
|
162
|
+
k(), ve(null), r == null || r(
|
|
141
163
|
a.untilChange ? "Snoozed — it comes back when someone changes the record" : a.until ? "Snoozed — it will return unread" : "Snooze cleared"
|
|
142
164
|
);
|
|
143
165
|
},
|
|
144
166
|
onError: () => d == null ? void 0 : d("Failed to snooze")
|
|
145
|
-
}),
|
|
146
|
-
mutationFn: (e) =>
|
|
167
|
+
}), $e = A({
|
|
168
|
+
mutationFn: (e) => p.request(w(`/notifications/${e}/acknowledge`)),
|
|
147
169
|
onSuccess: () => {
|
|
148
|
-
|
|
170
|
+
k(), r == null || r("Acknowledged");
|
|
149
171
|
},
|
|
150
172
|
onError: () => d == null ? void 0 : d("Failed to acknowledge")
|
|
151
|
-
}),
|
|
173
|
+
}), xt = () => ({
|
|
152
174
|
status: i === "snoozed" || i === "sent" ? "all" : i,
|
|
153
175
|
snoozed: i === "snoozed" ? "true" : void 0,
|
|
154
|
-
lane:
|
|
155
|
-
search:
|
|
156
|
-
collection:
|
|
157
|
-
}),
|
|
158
|
-
mutationFn: (e) =>
|
|
159
|
-
|
|
176
|
+
lane: C === "all" ? void 0 : C,
|
|
177
|
+
search: I || void 0,
|
|
178
|
+
collection: q || void 0
|
|
179
|
+
}), R = A({
|
|
180
|
+
mutationFn: (e) => p.request(
|
|
181
|
+
w("/notifications/bulk-action", {
|
|
160
182
|
action: e.action,
|
|
161
183
|
until: e.until ? e.until.toISOString() : void 0,
|
|
162
|
-
...
|
|
184
|
+
...ee ? { filter: xt() } : { ids: [...M] }
|
|
163
185
|
})
|
|
164
186
|
),
|
|
165
187
|
onSuccess: (e, a) => {
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
const l = ((
|
|
188
|
+
var s;
|
|
189
|
+
k(), Y(/* @__PURE__ */ new Set()), K(!1), te(!1);
|
|
190
|
+
const l = ((s = e.data) == null ? void 0 : s.updated) ?? 0;
|
|
169
191
|
r == null || r(
|
|
170
192
|
`${l} notification${l === 1 ? "" : "s"} ${a.action === "read" ? "marked read" : a.action === "archive" ? "archived" : "snoozed"}`
|
|
171
193
|
);
|
|
172
194
|
},
|
|
173
195
|
onError: () => d == null ? void 0 : d("That bulk action failed")
|
|
174
|
-
}),
|
|
175
|
-
mutationFn: (e) =>
|
|
196
|
+
}), re = A({
|
|
197
|
+
mutationFn: (e) => p.request(w("/notifications/archive-read", { days: e })),
|
|
176
198
|
onSuccess: (e) => {
|
|
177
199
|
var a;
|
|
178
|
-
|
|
200
|
+
k(), r == null || r(`${((a = e.data) == null ? void 0 : a.updated) ?? 0} archived — find them under Archived`);
|
|
179
201
|
},
|
|
180
202
|
onError: () => d == null ? void 0 : d("Clean-up failed")
|
|
181
|
-
}), { data:
|
|
203
|
+
}), { data: de } = H({
|
|
182
204
|
queryKey: ["nvr-profile-prefs"],
|
|
183
|
-
queryFn: () =>
|
|
205
|
+
queryFn: () => p.request(Q("/users/me")).then((e) => {
|
|
184
206
|
var a;
|
|
185
207
|
return ((a = e.data) == null ? void 0 : a.preferences) ?? {};
|
|
186
208
|
}),
|
|
187
|
-
enabled:
|
|
188
|
-
}),
|
|
189
|
-
mutationFn: (e) =>
|
|
209
|
+
enabled: we
|
|
210
|
+
}), ft = A({
|
|
211
|
+
mutationFn: (e) => p.request(Pt("/users/me/preferences", { notification_cleanup_days: e })),
|
|
190
212
|
onSuccess: () => {
|
|
191
|
-
|
|
213
|
+
Z.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), r == null || r("Automatic clean-up saved");
|
|
192
214
|
},
|
|
193
215
|
onError: () => d == null ? void 0 : d("Could not save the clean-up setting")
|
|
194
|
-
}),
|
|
195
|
-
mutationFn: (e) =>
|
|
216
|
+
}), ie = A({
|
|
217
|
+
mutationFn: (e) => p.request(Rt(`/notifications/${e}`)),
|
|
196
218
|
onSuccess: () => {
|
|
197
|
-
|
|
219
|
+
k(), X(null), r == null || r("Notification deleted");
|
|
198
220
|
},
|
|
199
221
|
onError: () => d == null ? void 0 : d("Failed to delete notification")
|
|
200
|
-
}),
|
|
201
|
-
await
|
|
202
|
-
}),
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
222
|
+
}), gt = async (e) => {
|
|
223
|
+
await p.request(w(`/notifications/${e}/read`)).catch(() => {
|
|
224
|
+
}), k();
|
|
225
|
+
}, kt = async (e, a) => {
|
|
226
|
+
const l = W && !Bt(a) ? Re(e) : null;
|
|
227
|
+
if (l && W) {
|
|
228
|
+
const s = T.map((x) => Re(x)).filter((x) => !!x);
|
|
229
|
+
W.open(l, { list: s }), e.read || p.request(w(`/notifications/${e.id}/read`)).catch(() => {
|
|
230
|
+
}).then(() => k());
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
e.read || (await p.request(w(`/notifications/${e.id}/read`)).catch(() => {
|
|
234
|
+
}), k()), be(V(e, m), h);
|
|
235
|
+
}, vt = (e) => {
|
|
236
|
+
K(!1), Y((a) => {
|
|
208
237
|
const l = new Set(a);
|
|
209
238
|
return l.has(e) ? l.delete(e) : l.add(e), l;
|
|
210
239
|
});
|
|
211
|
-
},
|
|
212
|
-
var
|
|
213
|
-
const l = !e.read,
|
|
214
|
-
/* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
240
|
+
}, se = (e, a = !1) => {
|
|
241
|
+
var O, _, o, f;
|
|
242
|
+
const l = !e.read, s = V(e, m), x = /* @__PURE__ */ n(qe, { children: [
|
|
243
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-baseline gap-x-2 sm:flex-nowrap", children: [
|
|
215
244
|
e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
216
245
|
e.lane === "needs_you" && l && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-nvr-cyan/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-nvr-navy dark:text-nvr-cyan", children: "Needs you" }),
|
|
217
246
|
/* @__PURE__ */ t(
|
|
218
247
|
"span",
|
|
219
248
|
{
|
|
220
|
-
className:
|
|
221
|
-
|
|
249
|
+
className: b(
|
|
250
|
+
// Wraps on a phone so the sender and what changed stay readable; one line on wider screens.
|
|
251
|
+
"min-w-0 break-words text-[13px] sm:truncate",
|
|
222
252
|
l ? "font-medium text-slate-900 dark:text-slate-100" : "font-normal text-slate-600 dark:text-slate-400"
|
|
223
253
|
),
|
|
224
254
|
children: e.subject ?? e.title ?? "—"
|
|
225
255
|
}
|
|
226
256
|
),
|
|
227
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ n("span", { className: "flex shrink-0 items-center gap-1.5 text-[10.5px] text-slate-400", children: [
|
|
258
|
+
/* @__PURE__ */ t(Ut, { label: (O = e.detail) == null ? void 0 : O.via_agent }),
|
|
259
|
+
/* @__PURE__ */ t(Ie, { value: e.created_at ?? /* @__PURE__ */ new Date() })
|
|
260
|
+
] })
|
|
228
261
|
] }),
|
|
229
|
-
e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-
|
|
262
|
+
e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-3 whitespace-pre-line text-[12px] text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
263
|
+
/* @__PURE__ */ t(ta, { resolved: (_ = e.detail) == null ? void 0 : _.resolved, className: "text-[11.5px]" })
|
|
230
264
|
] });
|
|
231
265
|
return /* @__PURE__ */ n(
|
|
232
266
|
"div",
|
|
233
267
|
{
|
|
234
|
-
className:
|
|
268
|
+
className: b(
|
|
235
269
|
"group relative flex items-start gap-3 py-3",
|
|
236
270
|
// Only a row that opens something lights up under the pointer.
|
|
237
|
-
|
|
271
|
+
s && "transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/40",
|
|
238
272
|
a ? "bg-slate-50/50 pl-8 pr-4 dark:bg-muted/30" : "px-4"
|
|
239
273
|
),
|
|
240
274
|
"data-notification-row": e.id,
|
|
@@ -244,8 +278,8 @@ function Yt({
|
|
|
244
278
|
"input",
|
|
245
279
|
{
|
|
246
280
|
type: "checkbox",
|
|
247
|
-
checked:
|
|
248
|
-
onChange: () =>
|
|
281
|
+
checked: M.has(e.id),
|
|
282
|
+
onChange: () => vt(e.id),
|
|
249
283
|
"aria-label": "Select notification",
|
|
250
284
|
"data-notification-select": e.id,
|
|
251
285
|
className: "mt-1.5 h-3.5 w-3.5 shrink-0"
|
|
@@ -254,106 +288,110 @@ function Yt({
|
|
|
254
288
|
/* @__PURE__ */ t(
|
|
255
289
|
"span",
|
|
256
290
|
{
|
|
257
|
-
className:
|
|
291
|
+
className: b(
|
|
258
292
|
"mt-2 h-2 w-2 shrink-0 rounded-full",
|
|
259
293
|
l ? e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan" : "bg-transparent"
|
|
260
294
|
)
|
|
261
295
|
}
|
|
262
296
|
),
|
|
263
297
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
264
|
-
|
|
298
|
+
s ? /* @__PURE__ */ t(
|
|
265
299
|
"button",
|
|
266
300
|
{
|
|
267
301
|
type: "button",
|
|
268
|
-
onClick: () => void
|
|
302
|
+
onClick: (g) => void kt(e, g),
|
|
269
303
|
className: "block w-full text-left",
|
|
270
|
-
children:
|
|
304
|
+
children: x
|
|
271
305
|
}
|
|
272
306
|
) : (
|
|
273
307
|
// Nowhere to open: plain text, read or not. As a button its click
|
|
274
308
|
// only marked the row read, so the row dimmed (or left the Unread
|
|
275
309
|
// list) and opened nothing. Mark read is its own control below.
|
|
276
|
-
/* @__PURE__ */ t("div", { "data-notification-plain": !0, children:
|
|
310
|
+
/* @__PURE__ */ t("div", { "data-notification-plain": !0, children: x })
|
|
277
311
|
),
|
|
278
312
|
/* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap items-center gap-2", children: [
|
|
279
313
|
e.sender_name && /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400", children: [
|
|
280
314
|
"From ",
|
|
281
315
|
e.sender_name
|
|
282
316
|
] }),
|
|
283
|
-
|
|
317
|
+
s && /* @__PURE__ */ t(
|
|
284
318
|
"button",
|
|
285
319
|
{
|
|
286
320
|
type: "button",
|
|
287
|
-
onClick: () =>
|
|
321
|
+
onClick: () => be(s, h),
|
|
322
|
+
...e.collection && !e.item && s.type !== "chat" && s.type !== "external" ? {
|
|
323
|
+
"aria-label": `See what changed in ${Ue(e.collection)}`,
|
|
324
|
+
"data-tip": `See what changed in ${Ue(e.collection)}`
|
|
325
|
+
} : {},
|
|
288
326
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
289
|
-
children:
|
|
327
|
+
children: s.type === "chat" ? "Open chat" : s.type === "external" ? "Open in app ↗" : e.target_label && e.kind !== "record" ? `${e.target_label}${e.item ? ` #${e.item}` : ""}` : e.collection === "__chat__" ? "Chat" : e.collection && !e.item ? "See changes" : e.collection ? `${e.collection} #${e.item}` : "Open"
|
|
290
328
|
}
|
|
291
329
|
),
|
|
292
|
-
l && !
|
|
330
|
+
l && !s && /* @__PURE__ */ n(
|
|
293
331
|
"button",
|
|
294
332
|
{
|
|
295
333
|
type: "button",
|
|
296
334
|
"data-notification-mark-read": e.id,
|
|
297
|
-
onClick: () => void
|
|
335
|
+
onClick: () => void gt(e.id),
|
|
298
336
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
299
337
|
children: [
|
|
300
|
-
/* @__PURE__ */ t(
|
|
338
|
+
/* @__PURE__ */ t(oe, { className: "h-3 w-3" }),
|
|
301
339
|
"Mark read"
|
|
302
340
|
]
|
|
303
341
|
}
|
|
304
342
|
),
|
|
305
|
-
/* @__PURE__ */ t(
|
|
306
|
-
|
|
343
|
+
/* @__PURE__ */ t(Xt, { delivery: e.delivery, mailLogUrl: D, onNavigate: h }),
|
|
344
|
+
Ht(e) && /* @__PURE__ */ n(
|
|
307
345
|
"button",
|
|
308
346
|
{
|
|
309
347
|
type: "button",
|
|
310
348
|
"data-notification-as-it-was": e.id,
|
|
311
349
|
"data-tip": "The record as it was when you were told",
|
|
312
|
-
onClick: () =>
|
|
350
|
+
onClick: () => ye(e),
|
|
313
351
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
314
352
|
children: [
|
|
315
|
-
/* @__PURE__ */ t(
|
|
353
|
+
/* @__PURE__ */ t($t, { className: "h-3 w-3" }),
|
|
316
354
|
"as it was"
|
|
317
355
|
]
|
|
318
356
|
}
|
|
319
357
|
)
|
|
320
358
|
] }),
|
|
321
359
|
/* @__PURE__ */ t(
|
|
322
|
-
|
|
360
|
+
aa,
|
|
323
361
|
{
|
|
324
362
|
detail: e.detail,
|
|
325
363
|
why: e.why,
|
|
326
364
|
delivery: e.delivery,
|
|
327
365
|
notificationId: e.id,
|
|
328
|
-
recordChanges:
|
|
329
|
-
subscriptionsPath:
|
|
330
|
-
rulesPath:
|
|
331
|
-
onNavigate:
|
|
366
|
+
recordChanges: Qt(e),
|
|
367
|
+
subscriptionsPath: He,
|
|
368
|
+
rulesPath: Qe,
|
|
369
|
+
onNavigate: h,
|
|
332
370
|
className: "mt-1"
|
|
333
371
|
}
|
|
334
372
|
),
|
|
335
|
-
((
|
|
336
|
-
/* @__PURE__ */ t(
|
|
373
|
+
((o = e.ack) == null ? void 0 : o.required) && /* @__PURE__ */ t("div", { className: "mt-1.5", "data-notification-ack": e.ack.at ? "acked" : "pending", children: e.ack.at ? /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400", children: [
|
|
374
|
+
/* @__PURE__ */ t(ue, { className: "h-3 w-3" }),
|
|
337
375
|
"Acknowledged ",
|
|
338
|
-
|
|
376
|
+
Oe(e.ack.at)
|
|
339
377
|
] }) : /* @__PURE__ */ n(
|
|
340
378
|
"button",
|
|
341
379
|
{
|
|
342
380
|
type: "button",
|
|
343
|
-
disabled:
|
|
344
|
-
onClick: () =>
|
|
381
|
+
disabled: $e.isPending,
|
|
382
|
+
onClick: () => $e.mutate(e.id),
|
|
345
383
|
"data-notification-acknowledge": e.id,
|
|
346
384
|
className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2.5 py-1 text-[11.5px] font-medium text-white hover:opacity-90 disabled:opacity-50",
|
|
347
385
|
children: [
|
|
348
|
-
/* @__PURE__ */ t(
|
|
386
|
+
/* @__PURE__ */ t(ue, { className: "h-3.5 w-3.5" }),
|
|
349
387
|
"Acknowledge"
|
|
350
388
|
]
|
|
351
389
|
}
|
|
352
390
|
) }),
|
|
353
|
-
e.actions && e.actions.length > 0 && /* @__PURE__ */ t(
|
|
354
|
-
|
|
391
|
+
e.actions && e.actions.length > 0 && !((f = e.detail) != null && f.resolved) && /* @__PURE__ */ t(
|
|
392
|
+
Et,
|
|
355
393
|
{
|
|
356
|
-
actions: l ? e.actions : e.actions.filter((
|
|
394
|
+
actions: l ? e.actions : e.actions.filter((g) => !!g.input),
|
|
357
395
|
notificationId: e.id,
|
|
358
396
|
size: "sm",
|
|
359
397
|
onError: d,
|
|
@@ -367,11 +405,11 @@ function Yt({
|
|
|
367
405
|
"button",
|
|
368
406
|
{
|
|
369
407
|
type: "button",
|
|
370
|
-
onClick: () =>
|
|
408
|
+
onClick: () => U.mutate({ id: e.id, until: null }),
|
|
371
409
|
className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300",
|
|
372
410
|
"data-tip": "Click to wake now",
|
|
373
411
|
children: [
|
|
374
|
-
/* @__PURE__ */ t(
|
|
412
|
+
/* @__PURE__ */ t(ce, { className: "h-3 w-3" }),
|
|
375
413
|
e.snooze_until_change ? "Until it changes" : `Until ${new Date(e.snoozed_until).toLocaleString([], {
|
|
376
414
|
month: "short",
|
|
377
415
|
day: "numeric",
|
|
@@ -384,30 +422,30 @@ function Yt({
|
|
|
384
422
|
"button",
|
|
385
423
|
{
|
|
386
424
|
type: "button",
|
|
387
|
-
onClick: () =>
|
|
425
|
+
onClick: () => ve(ke === e.id ? null : e.id),
|
|
388
426
|
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-amber-50 hover:text-amber-500 group-hover:opacity-100 dark:hover:bg-amber-400/10",
|
|
389
427
|
"aria-label": "Snooze notification",
|
|
390
|
-
children: /* @__PURE__ */ t(
|
|
428
|
+
children: /* @__PURE__ */ t(ce, { className: "h-3.5 w-3.5" })
|
|
391
429
|
}
|
|
392
430
|
),
|
|
393
|
-
|
|
394
|
-
|
|
431
|
+
ke === e.id && /* @__PURE__ */ n("div", { className: "absolute right-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: [
|
|
432
|
+
je().map((g) => /* @__PURE__ */ t(
|
|
395
433
|
"button",
|
|
396
434
|
{
|
|
397
435
|
type: "button",
|
|
398
|
-
disabled:
|
|
399
|
-
onClick: () =>
|
|
436
|
+
disabled: U.isPending,
|
|
437
|
+
onClick: () => U.mutate({ id: e.id, until: g.until }),
|
|
400
438
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
401
|
-
children:
|
|
439
|
+
children: g.label
|
|
402
440
|
},
|
|
403
|
-
|
|
441
|
+
g.label
|
|
404
442
|
)),
|
|
405
443
|
e.collection && e.item != null && /* @__PURE__ */ t(
|
|
406
444
|
"button",
|
|
407
445
|
{
|
|
408
446
|
type: "button",
|
|
409
|
-
disabled:
|
|
410
|
-
onClick: () =>
|
|
447
|
+
disabled: U.isPending,
|
|
448
|
+
onClick: () => U.mutate({ id: e.id, until: null, untilChange: !0 }),
|
|
411
449
|
className: "block w-full border-t border-slate-100 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:border-border dark:text-foreground",
|
|
412
450
|
"data-snooze-until-change": !0,
|
|
413
451
|
children: "Until the record changes"
|
|
@@ -415,12 +453,12 @@ function Yt({
|
|
|
415
453
|
)
|
|
416
454
|
] })
|
|
417
455
|
] }),
|
|
418
|
-
/* @__PURE__ */ t("div", { className: "shrink-0", children:
|
|
456
|
+
/* @__PURE__ */ t("div", { className: "shrink-0", children: Xe === e.id ? /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
419
457
|
/* @__PURE__ */ t(
|
|
420
458
|
"button",
|
|
421
459
|
{
|
|
422
460
|
type: "button",
|
|
423
|
-
onClick: () =>
|
|
461
|
+
onClick: () => X(null),
|
|
424
462
|
className: "h-6 rounded-md border border-slate-200 px-2 text-[11px] dark:border-border",
|
|
425
463
|
children: "Cancel"
|
|
426
464
|
}
|
|
@@ -429,33 +467,34 @@ function Yt({
|
|
|
429
467
|
"button",
|
|
430
468
|
{
|
|
431
469
|
type: "button",
|
|
432
|
-
disabled:
|
|
433
|
-
onClick: () =>
|
|
470
|
+
disabled: ie.isPending,
|
|
471
|
+
onClick: () => ie.mutate(e.id),
|
|
434
472
|
className: "h-6 rounded-md bg-red-500 px-2 text-[11px] text-white hover:bg-red-600",
|
|
435
|
-
children:
|
|
473
|
+
children: ie.isPending ? "Deleting…" : "Delete"
|
|
436
474
|
}
|
|
437
475
|
)
|
|
438
476
|
] }) : /* @__PURE__ */ t(
|
|
439
477
|
"button",
|
|
440
478
|
{
|
|
441
479
|
type: "button",
|
|
442
|
-
onClick: () =>
|
|
480
|
+
onClick: () => X(e.id),
|
|
443
481
|
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-red-50 hover:text-red-400 group-hover:opacity-100",
|
|
444
482
|
"aria-label": "Delete notification",
|
|
445
|
-
children: /* @__PURE__ */ t(
|
|
483
|
+
children: /* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" })
|
|
446
484
|
}
|
|
447
485
|
) })
|
|
448
486
|
]
|
|
449
487
|
}
|
|
450
488
|
);
|
|
451
|
-
},
|
|
452
|
-
const a = `${e.collection}:${e.item}`, l =
|
|
453
|
-
const
|
|
454
|
-
return
|
|
489
|
+
}, yt = (e) => {
|
|
490
|
+
const a = `${e.collection}:${e.item}`, l = nt.has(a), s = Vt(e.lane), x = e.deleted ? null : V(Wt(e), m), O = e.rows.filter((o) => !o.read).map((o) => o.id), _ = () => lt((o) => {
|
|
491
|
+
const f = new Set(o);
|
|
492
|
+
return f.has(a) ? f.delete(a) : f.add(a), f;
|
|
455
493
|
});
|
|
456
494
|
return /* @__PURE__ */ n(
|
|
457
495
|
"div",
|
|
458
496
|
{
|
|
497
|
+
"data-live-key": Ke(e),
|
|
459
498
|
"data-notification-bundle": a,
|
|
460
499
|
"data-notification-bundle-count": e.count,
|
|
461
500
|
"data-notification-bundle-lane": e.lane,
|
|
@@ -469,12 +508,12 @@ function Yt({
|
|
|
469
508
|
"aria-expanded": l,
|
|
470
509
|
"aria-label": l ? "Collapse" : "Expand",
|
|
471
510
|
"data-notification-bundle-expand": a,
|
|
472
|
-
onClick:
|
|
511
|
+
onClick: _,
|
|
473
512
|
className: "mt-1 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
474
513
|
children: /* @__PURE__ */ t(
|
|
475
|
-
|
|
514
|
+
qt,
|
|
476
515
|
{
|
|
477
|
-
className:
|
|
516
|
+
className: b("h-3.5 w-3.5 transition-transform", !l && "-rotate-90")
|
|
478
517
|
}
|
|
479
518
|
)
|
|
480
519
|
}
|
|
@@ -482,20 +521,20 @@ function Yt({
|
|
|
482
521
|
/* @__PURE__ */ t(
|
|
483
522
|
"span",
|
|
484
523
|
{
|
|
485
|
-
className:
|
|
524
|
+
className: b(
|
|
486
525
|
"mt-2 h-2 w-2 shrink-0 rounded-full",
|
|
487
|
-
e.unread > 0 ?
|
|
526
|
+
e.unread > 0 ? s.dot : "bg-transparent"
|
|
488
527
|
)
|
|
489
528
|
}
|
|
490
529
|
),
|
|
491
530
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
492
|
-
/* @__PURE__ */ t("button", { type: "button", onClick:
|
|
531
|
+
/* @__PURE__ */ t("button", { type: "button", onClick: _, className: "block w-full text-left", children: /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
493
532
|
e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ t(
|
|
494
533
|
"span",
|
|
495
534
|
{
|
|
496
|
-
className:
|
|
535
|
+
className: b(
|
|
497
536
|
"shrink-0 rounded px-1 text-[9.5px] font-bold uppercase tracking-wide",
|
|
498
|
-
|
|
537
|
+
s.chip
|
|
499
538
|
),
|
|
500
539
|
children: "Critical"
|
|
501
540
|
}
|
|
@@ -503,14 +542,14 @@ function Yt({
|
|
|
503
542
|
/* @__PURE__ */ t(
|
|
504
543
|
"span",
|
|
505
544
|
{
|
|
506
|
-
className:
|
|
545
|
+
className: b(
|
|
507
546
|
"truncate text-[13px]",
|
|
508
|
-
e.unread > 0 ?
|
|
547
|
+
e.unread > 0 ? b("font-medium", s.text) : "font-normal text-slate-600 dark:text-slate-400"
|
|
509
548
|
),
|
|
510
|
-
children:
|
|
549
|
+
children: Zt(e)
|
|
511
550
|
}
|
|
512
551
|
),
|
|
513
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ?
|
|
552
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ? Oe(e.newest) : "" })
|
|
514
553
|
] }) }),
|
|
515
554
|
/* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap items-center gap-1.5", children: [
|
|
516
555
|
e.collection_label && /* @__PURE__ */ t(
|
|
@@ -529,23 +568,23 @@ function Yt({
|
|
|
529
568
|
children: "deleted"
|
|
530
569
|
}
|
|
531
570
|
),
|
|
532
|
-
e.categories.map((
|
|
571
|
+
e.categories.map((o) => /* @__PURE__ */ t(
|
|
533
572
|
"span",
|
|
534
573
|
{
|
|
535
574
|
className: "rounded bg-slate-100 px-1.5 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
536
|
-
"data-notification-bundle-category":
|
|
537
|
-
children:
|
|
575
|
+
"data-notification-bundle-category": o,
|
|
576
|
+
children: Jt(o)
|
|
538
577
|
},
|
|
539
|
-
|
|
578
|
+
o
|
|
540
579
|
)),
|
|
541
|
-
|
|
580
|
+
x && /* @__PURE__ */ n(
|
|
542
581
|
"button",
|
|
543
582
|
{
|
|
544
583
|
type: "button",
|
|
545
|
-
onClick: () =>
|
|
584
|
+
onClick: () => be(x, h),
|
|
546
585
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
547
586
|
children: [
|
|
548
|
-
/* @__PURE__ */ t(
|
|
587
|
+
/* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
|
|
549
588
|
"Open ",
|
|
550
589
|
e.label
|
|
551
590
|
]
|
|
@@ -557,15 +596,15 @@ function Yt({
|
|
|
557
596
|
] })
|
|
558
597
|
] })
|
|
559
598
|
] }),
|
|
560
|
-
|
|
599
|
+
O.length > 0 && /* @__PURE__ */ n(
|
|
561
600
|
"button",
|
|
562
601
|
{
|
|
563
602
|
type: "button",
|
|
564
603
|
"data-notification-bundle-read": a,
|
|
565
|
-
onClick: () =>
|
|
604
|
+
onClick: () => ht.mutate(O),
|
|
566
605
|
className: "inline-flex items-center gap-1 rounded-md border border-slate-200 px-2 py-1 text-[11px] font-medium text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
567
606
|
children: [
|
|
568
|
-
/* @__PURE__ */ t(
|
|
607
|
+
/* @__PURE__ */ t(oe, { className: "h-3 w-3" }),
|
|
569
608
|
"Mark read"
|
|
570
609
|
]
|
|
571
610
|
}
|
|
@@ -576,39 +615,39 @@ function Yt({
|
|
|
576
615
|
{
|
|
577
616
|
className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border",
|
|
578
617
|
"data-notification-bundle-rows": a,
|
|
579
|
-
children: e.rows.map((
|
|
618
|
+
children: e.rows.map((o) => /* @__PURE__ */ t(pe, { children: se(o, !0) }, o.id))
|
|
580
619
|
}
|
|
581
620
|
)
|
|
582
621
|
]
|
|
583
622
|
},
|
|
584
623
|
`bundle:${a}`
|
|
585
624
|
);
|
|
586
|
-
},
|
|
625
|
+
}, Fe = z.length + T.length + B.reduce((e, a) => e + a.rows.length, 0), wt = (e) => {
|
|
587
626
|
var a;
|
|
588
|
-
return e === "all" ? null : ((a =
|
|
627
|
+
return e === "all" ? null : ((a = y == null ? void 0 : y.lanes) == null ? void 0 : a[e]) ?? null;
|
|
589
628
|
};
|
|
590
|
-
return /* @__PURE__ */ n("div", { className:
|
|
591
|
-
/* @__PURE__ */ n("header", { className: "shrink-0 border-b border-slate-200 bg-white px-
|
|
592
|
-
/* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
629
|
+
return /* @__PURE__ */ n("div", { className: b("flex flex-1 min-h-0 flex-col", Ge), "data-nvr-notification-center": !0, children: [
|
|
630
|
+
/* @__PURE__ */ n("header", { className: "shrink-0 border-b border-slate-200 bg-white px-4 py-5 dark:border-border dark:bg-background sm:px-8", children: [
|
|
631
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2", children: [
|
|
593
632
|
/* @__PURE__ */ n("div", { children: [
|
|
594
633
|
/* @__PURE__ */ t("h1", { className: "text-xl font-bold text-slate-900 dark:text-slate-100", children: "Notifications" }),
|
|
595
634
|
/* @__PURE__ */ n("p", { className: "mt-0.5 text-[13px] text-slate-400", children: [
|
|
596
|
-
|
|
635
|
+
$,
|
|
597
636
|
" notification",
|
|
598
|
-
|
|
599
|
-
(
|
|
637
|
+
$ === 1 ? "" : "s",
|
|
638
|
+
(y == null ? void 0 : y.attention) != null && y.attention > 0 ? ` · ${y.attention} need${y.attention === 1 ? "s" : ""} you` : ""
|
|
600
639
|
] })
|
|
601
640
|
] }),
|
|
602
|
-
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
641
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
603
642
|
/* @__PURE__ */ n(
|
|
604
643
|
"button",
|
|
605
644
|
{
|
|
606
645
|
type: "button",
|
|
607
|
-
onClick: () =>
|
|
646
|
+
onClick: () => dt((e) => !e),
|
|
608
647
|
"data-notification-cleanup-toggle": !0,
|
|
609
|
-
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
648
|
+
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
610
649
|
children: [
|
|
611
|
-
/* @__PURE__ */ t(
|
|
650
|
+
/* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }),
|
|
612
651
|
"Clean up"
|
|
613
652
|
]
|
|
614
653
|
}
|
|
@@ -617,18 +656,18 @@ function Yt({
|
|
|
617
656
|
"button",
|
|
618
657
|
{
|
|
619
658
|
type: "button",
|
|
620
|
-
onClick: () =>
|
|
621
|
-
disabled:
|
|
622
|
-
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
659
|
+
onClick: () => le.mutate(),
|
|
660
|
+
disabled: le.isPending,
|
|
661
|
+
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
623
662
|
children: [
|
|
624
|
-
/* @__PURE__ */ t(
|
|
625
|
-
|
|
663
|
+
/* @__PURE__ */ t(St, { className: "h-3.5 w-3.5" }),
|
|
664
|
+
le.isPending ? "Marking…" : "Mark all read"
|
|
626
665
|
]
|
|
627
666
|
}
|
|
628
667
|
)
|
|
629
668
|
] })
|
|
630
669
|
] }),
|
|
631
|
-
|
|
670
|
+
we && /* @__PURE__ */ n(
|
|
632
671
|
"div",
|
|
633
672
|
{
|
|
634
673
|
className: "mt-3 space-y-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-2.5 text-[12px] text-slate-600 dark:border-border dark:bg-muted/40 dark:text-muted-foreground",
|
|
@@ -637,10 +676,10 @@ function Yt({
|
|
|
637
676
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
638
677
|
"Archive everything read and older than",
|
|
639
678
|
/* @__PURE__ */ t(
|
|
640
|
-
|
|
679
|
+
he,
|
|
641
680
|
{
|
|
642
|
-
value:
|
|
643
|
-
onChange:
|
|
681
|
+
value: Ne,
|
|
682
|
+
onChange: it,
|
|
644
683
|
ariaLabel: "Older than",
|
|
645
684
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
646
685
|
options: [
|
|
@@ -655,21 +694,21 @@ function Yt({
|
|
|
655
694
|
"button",
|
|
656
695
|
{
|
|
657
696
|
type: "button",
|
|
658
|
-
disabled:
|
|
659
|
-
onClick: () =>
|
|
697
|
+
disabled: re.isPending,
|
|
698
|
+
onClick: () => re.mutate(Number(Ne)),
|
|
660
699
|
"data-notification-archive-read": !0,
|
|
661
700
|
className: "h-7 rounded-md bg-slate-900 px-2.5 text-[11.5px] font-medium text-white hover:bg-slate-700 disabled:opacity-50 dark:bg-slate-100 dark:text-slate-900",
|
|
662
|
-
children:
|
|
701
|
+
children: re.isPending ? "Archiving…" : "Archive now"
|
|
663
702
|
}
|
|
664
703
|
)
|
|
665
704
|
] }),
|
|
666
705
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
667
706
|
"Or do it automatically — archive read notifications after",
|
|
668
707
|
/* @__PURE__ */ t(
|
|
669
|
-
|
|
708
|
+
he,
|
|
670
709
|
{
|
|
671
|
-
value: String((
|
|
672
|
-
onChange: (e) =>
|
|
710
|
+
value: String((de == null ? void 0 : de.notification_cleanup_days) ?? ""),
|
|
711
|
+
onChange: (e) => ft.mutate(e ? Number(e) : null),
|
|
673
712
|
ariaLabel: "Automatic clean-up",
|
|
674
713
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
675
714
|
options: [
|
|
@@ -686,19 +725,19 @@ function Yt({
|
|
|
686
725
|
}
|
|
687
726
|
),
|
|
688
727
|
/* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
689
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
690
|
-
const a =
|
|
728
|
+
/* @__PURE__ */ t("div", { className: "flex max-w-full flex-wrap items-center gap-1", children: la.map((e) => {
|
|
729
|
+
const a = wt(e.key);
|
|
691
730
|
return /* @__PURE__ */ n(
|
|
692
731
|
"button",
|
|
693
732
|
{
|
|
694
733
|
type: "button",
|
|
695
734
|
onClick: () => {
|
|
696
|
-
|
|
735
|
+
We(e.key), F(1);
|
|
697
736
|
},
|
|
698
737
|
"data-nvr-lane": e.key,
|
|
699
|
-
className:
|
|
700
|
-
"rounded-md px-3 py-1.5 text-[12.5px] font-medium transition-colors",
|
|
701
|
-
|
|
738
|
+
className: b(
|
|
739
|
+
"shrink-0 whitespace-nowrap rounded-md px-3 py-1.5 text-[12.5px] font-medium transition-colors",
|
|
740
|
+
C === e.key ? e.key === "critical" ? "bg-red-500/10 text-red-700 dark:text-red-400" : "bg-nvr-cyan/10 text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
|
|
702
741
|
),
|
|
703
742
|
children: [
|
|
704
743
|
e.label,
|
|
@@ -708,46 +747,46 @@ function Yt({
|
|
|
708
747
|
e.key
|
|
709
748
|
);
|
|
710
749
|
}) }),
|
|
711
|
-
/* @__PURE__ */ t("span", { className: "mx-1 h-5 w-px bg-slate-200 dark:bg-border" }),
|
|
712
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
750
|
+
/* @__PURE__ */ t("span", { className: "mx-1 hidden h-5 w-px bg-slate-200 dark:bg-border sm:block" }),
|
|
751
|
+
/* @__PURE__ */ t("div", { className: "flex max-w-full flex-wrap items-center gap-1", children: na.map((e) => /* @__PURE__ */ t(
|
|
713
752
|
"button",
|
|
714
753
|
{
|
|
715
754
|
type: "button",
|
|
716
755
|
onClick: () => {
|
|
717
|
-
|
|
756
|
+
Ve(e.key), F(1);
|
|
718
757
|
},
|
|
719
|
-
className:
|
|
720
|
-
"rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
758
|
+
className: b(
|
|
759
|
+
"shrink-0 whitespace-nowrap rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
721
760
|
i === e.key ? "bg-slate-900 text-white dark:bg-slate-100 dark:text-slate-900" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
|
|
722
761
|
),
|
|
723
762
|
children: e.label
|
|
724
763
|
},
|
|
725
764
|
e.key
|
|
726
765
|
)) }),
|
|
727
|
-
/* @__PURE__ */ n("div", { className: "relative ml-auto", children: [
|
|
728
|
-
/* @__PURE__ */ t(
|
|
766
|
+
/* @__PURE__ */ n("div", { className: "relative w-full sm:ml-auto sm:w-auto", children: [
|
|
767
|
+
/* @__PURE__ */ t(_t, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
729
768
|
/* @__PURE__ */ t(
|
|
730
769
|
"input",
|
|
731
770
|
{
|
|
732
|
-
value:
|
|
733
|
-
onChange: (e) =>
|
|
771
|
+
value: E,
|
|
772
|
+
onChange: (e) => Ee(e.target.value),
|
|
734
773
|
placeholder: "Search notifications…",
|
|
735
|
-
className: "h-8 w-
|
|
774
|
+
className: "h-8 w-full rounded-md border border-slate-200 bg-background pl-8 sm:w-[240px] pr-2.5 text-[12.5px] dark:border-border"
|
|
736
775
|
}
|
|
737
776
|
)
|
|
738
777
|
] }),
|
|
739
778
|
/* @__PURE__ */ t(
|
|
740
|
-
|
|
779
|
+
he,
|
|
741
780
|
{
|
|
742
|
-
value:
|
|
781
|
+
value: q,
|
|
743
782
|
onChange: (e) => {
|
|
744
|
-
|
|
783
|
+
tt(e), F(1);
|
|
745
784
|
},
|
|
746
785
|
ariaLabel: "Collection",
|
|
747
786
|
className: "h-8 w-auto rounded-md border-slate-200 bg-background px-2 text-[12.5px] dark:border-border",
|
|
748
787
|
options: [
|
|
749
788
|
{ value: "", label: "All collections" },
|
|
750
|
-
...
|
|
789
|
+
...ct.map((e) => ({ value: e, label: e }))
|
|
751
790
|
]
|
|
752
791
|
}
|
|
753
792
|
),
|
|
@@ -761,8 +800,8 @@ function Yt({
|
|
|
761
800
|
"input",
|
|
762
801
|
{
|
|
763
802
|
type: "checkbox",
|
|
764
|
-
checked:
|
|
765
|
-
onChange: (e) =>
|
|
803
|
+
checked: j,
|
|
804
|
+
onChange: (e) => at(e.target.checked),
|
|
766
805
|
className: "h-3.5 w-3.5",
|
|
767
806
|
"data-notification-group-by-record": !0
|
|
768
807
|
}
|
|
@@ -773,11 +812,11 @@ function Yt({
|
|
|
773
812
|
)
|
|
774
813
|
] })
|
|
775
814
|
] }),
|
|
776
|
-
|
|
815
|
+
J != null && /* @__PURE__ */ n(
|
|
777
816
|
"div",
|
|
778
817
|
{
|
|
779
818
|
className: "shrink-0 border-b border-slate-200 bg-white px-8 py-3 dark:border-border dark:bg-background",
|
|
780
|
-
"data-notification-changes-landing":
|
|
819
|
+
"data-notification-changes-landing": J,
|
|
781
820
|
children: [
|
|
782
821
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2", children: [
|
|
783
822
|
/* @__PURE__ */ t("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "What changed" }),
|
|
@@ -785,33 +824,33 @@ function Yt({
|
|
|
785
824
|
"button",
|
|
786
825
|
{
|
|
787
826
|
type: "button",
|
|
788
|
-
onClick: () =>
|
|
827
|
+
onClick: () => Ye(null),
|
|
789
828
|
className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2 hover:text-slate-600 dark:hover:text-slate-200",
|
|
790
829
|
children: "Dismiss"
|
|
791
830
|
}
|
|
792
831
|
)
|
|
793
832
|
] }),
|
|
794
|
-
/* @__PURE__ */ t(
|
|
833
|
+
/* @__PURE__ */ t(ea, { notificationId: J, className: "max-w-3xl" })
|
|
795
834
|
]
|
|
796
835
|
}
|
|
797
836
|
),
|
|
798
|
-
i !== "sent" &&
|
|
837
|
+
i !== "sent" && M.size > 0 && /* @__PURE__ */ n(
|
|
799
838
|
"div",
|
|
800
839
|
{
|
|
801
840
|
className: "flex shrink-0 flex-wrap items-center gap-2 border-b border-nvr-cyan/30 bg-nvr-cyan/5 px-8 py-2 text-[12px] text-slate-700 dark:text-slate-200",
|
|
802
841
|
"data-notification-bulkbar": !0,
|
|
803
842
|
children: [
|
|
804
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
805
|
-
!
|
|
843
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: ee ? `All ${$} matching` : `${M.size} selected` }),
|
|
844
|
+
!ee && M.size >= Fe && $ > Fe && /* @__PURE__ */ n(
|
|
806
845
|
"button",
|
|
807
846
|
{
|
|
808
847
|
type: "button",
|
|
809
|
-
onClick: () =>
|
|
848
|
+
onClick: () => K(!0),
|
|
810
849
|
"data-notification-select-matching": !0,
|
|
811
850
|
className: "text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
|
|
812
851
|
children: [
|
|
813
852
|
"Select all ",
|
|
814
|
-
|
|
853
|
+
$,
|
|
815
854
|
" matching"
|
|
816
855
|
]
|
|
817
856
|
}
|
|
@@ -821,12 +860,12 @@ function Yt({
|
|
|
821
860
|
"button",
|
|
822
861
|
{
|
|
823
862
|
type: "button",
|
|
824
|
-
disabled:
|
|
825
|
-
onClick: () =>
|
|
863
|
+
disabled: R.isPending,
|
|
864
|
+
onClick: () => R.mutate({ action: "read" }),
|
|
826
865
|
"data-notification-bulk": "read",
|
|
827
866
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
828
867
|
children: [
|
|
829
|
-
/* @__PURE__ */ t(
|
|
868
|
+
/* @__PURE__ */ t(oe, { className: "h-3 w-3" }),
|
|
830
869
|
" Mark read"
|
|
831
870
|
]
|
|
832
871
|
}
|
|
@@ -836,21 +875,21 @@ function Yt({
|
|
|
836
875
|
"button",
|
|
837
876
|
{
|
|
838
877
|
type: "button",
|
|
839
|
-
disabled:
|
|
840
|
-
onClick: () =>
|
|
878
|
+
disabled: R.isPending,
|
|
879
|
+
onClick: () => te((e) => !e),
|
|
841
880
|
"data-notification-bulk": "snooze",
|
|
842
881
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
843
882
|
children: [
|
|
844
|
-
/* @__PURE__ */ t(
|
|
883
|
+
/* @__PURE__ */ t(ce, { className: "h-3 w-3" }),
|
|
845
884
|
" Snooze"
|
|
846
885
|
]
|
|
847
886
|
}
|
|
848
887
|
),
|
|
849
|
-
|
|
888
|
+
rt && /* @__PURE__ */ t("div", { className: "absolute left-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: je().map((e) => /* @__PURE__ */ t(
|
|
850
889
|
"button",
|
|
851
890
|
{
|
|
852
891
|
type: "button",
|
|
853
|
-
onClick: () =>
|
|
892
|
+
onClick: () => R.mutate({ action: "snooze", until: e.until }),
|
|
854
893
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
855
894
|
children: e.label
|
|
856
895
|
},
|
|
@@ -861,12 +900,12 @@ function Yt({
|
|
|
861
900
|
"button",
|
|
862
901
|
{
|
|
863
902
|
type: "button",
|
|
864
|
-
disabled:
|
|
865
|
-
onClick: () =>
|
|
903
|
+
disabled: R.isPending,
|
|
904
|
+
onClick: () => R.mutate({ action: "archive" }),
|
|
866
905
|
"data-notification-bulk": "archive",
|
|
867
906
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
868
907
|
children: [
|
|
869
|
-
/* @__PURE__ */ t(
|
|
908
|
+
/* @__PURE__ */ t(Me, { className: "h-3 w-3" }),
|
|
870
909
|
" Archive"
|
|
871
910
|
]
|
|
872
911
|
}
|
|
@@ -877,17 +916,17 @@ function Yt({
|
|
|
877
916
|
type: "button",
|
|
878
917
|
onClick: () => {
|
|
879
918
|
const e = [];
|
|
880
|
-
for (const a of [...
|
|
881
|
-
if (!
|
|
882
|
-
const l =
|
|
919
|
+
for (const a of [...z, ...T, ...B.flatMap((l) => l.rows)]) {
|
|
920
|
+
if (!M.has(a.id)) continue;
|
|
921
|
+
const l = V(a, m);
|
|
883
922
|
l && (l.type === "external" ? e.push(l.url) : l.type === "path" && typeof window < "u" && e.push(`${window.location.origin}${l.path}`));
|
|
884
923
|
}
|
|
885
|
-
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(
|
|
924
|
+
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(It(jt(e)));
|
|
886
925
|
},
|
|
887
926
|
"data-notification-bulk": "tabs",
|
|
888
927
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
889
928
|
children: [
|
|
890
|
-
/* @__PURE__ */ t(
|
|
929
|
+
/* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
|
|
891
930
|
" Open in tabs"
|
|
892
931
|
]
|
|
893
932
|
}
|
|
@@ -897,7 +936,7 @@ function Yt({
|
|
|
897
936
|
{
|
|
898
937
|
type: "button",
|
|
899
938
|
onClick: () => {
|
|
900
|
-
|
|
939
|
+
Y(/* @__PURE__ */ new Set()), K(!1);
|
|
901
940
|
},
|
|
902
941
|
className: "ml-auto text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2",
|
|
903
942
|
children: "Clear selection"
|
|
@@ -915,8 +954,8 @@ function Yt({
|
|
|
915
954
|
"input",
|
|
916
955
|
{
|
|
917
956
|
type: "checkbox",
|
|
918
|
-
checked:
|
|
919
|
-
onChange: (e) =>
|
|
957
|
+
checked: G,
|
|
958
|
+
onChange: (e) => Ze(e.target.checked),
|
|
920
959
|
className: "h-3.5 w-3.5",
|
|
921
960
|
"data-nvr-sent-critical": !0
|
|
922
961
|
}
|
|
@@ -924,19 +963,19 @@ function Yt({
|
|
|
924
963
|
"Critical only"
|
|
925
964
|
] })
|
|
926
965
|
] }),
|
|
927
|
-
|
|
928
|
-
/* @__PURE__ */ t(
|
|
966
|
+
Je ? /* @__PURE__ */ t("p", { className: "py-10 text-[13px] text-slate-400", children: "Loading…" }) : ge.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
967
|
+
/* @__PURE__ */ t(Le, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
929
968
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "Nothing sent yet" }),
|
|
930
|
-
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children:
|
|
931
|
-
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children:
|
|
969
|
+
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: G ? 'No critical sends. Untick "Critical only" to see everything you sent.' : "Messages you send to stakeholders or colleagues appear here." })
|
|
970
|
+
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: ge.map((e) => /* @__PURE__ */ n("div", { className: "px-4 py-3", "data-nvr-sent-row": !0, children: [
|
|
932
971
|
/* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
933
972
|
e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
934
973
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.subject.replace(/^critical:\s*/i, "") }),
|
|
935
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children:
|
|
974
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(Ie, { value: e.created_at ?? /* @__PURE__ */ new Date() }) }),
|
|
936
975
|
/* @__PURE__ */ n(
|
|
937
976
|
"span",
|
|
938
977
|
{
|
|
939
|
-
className:
|
|
978
|
+
className: b(
|
|
940
979
|
"ml-auto shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-semibold tabular-nums",
|
|
941
980
|
e.read_count === e.total ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-amber-50 text-amber-700 dark:bg-amber-400/10 dark:text-amber-300"
|
|
942
981
|
),
|
|
@@ -963,11 +1002,11 @@ function Yt({
|
|
|
963
1002
|
}
|
|
964
1003
|
)
|
|
965
1004
|
] }),
|
|
966
|
-
e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 text-[12px] text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
1005
|
+
e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 whitespace-pre-line text-[12px] text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
967
1006
|
/* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap gap-1", children: e.recipients.map((a) => /* @__PURE__ */ n(
|
|
968
1007
|
"span",
|
|
969
1008
|
{
|
|
970
|
-
className:
|
|
1009
|
+
className: b(
|
|
971
1010
|
"inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[10.5px]",
|
|
972
1011
|
a.read ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-slate-400"
|
|
973
1012
|
),
|
|
@@ -978,61 +1017,85 @@ function Yt({
|
|
|
978
1017
|
/* @__PURE__ */ t(
|
|
979
1018
|
"span",
|
|
980
1019
|
{
|
|
981
|
-
className:
|
|
1020
|
+
className: b(
|
|
982
1021
|
"h-1.5 w-1.5 rounded-full",
|
|
983
1022
|
a.read ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
984
1023
|
)
|
|
985
1024
|
}
|
|
986
1025
|
),
|
|
987
1026
|
a.name,
|
|
988
|
-
a.ack === "acked" && /* @__PURE__ */ t(
|
|
1027
|
+
a.ack === "acked" && /* @__PURE__ */ t(ue, { className: "h-3 w-3" })
|
|
989
1028
|
]
|
|
990
1029
|
},
|
|
991
1030
|
a.id
|
|
992
1031
|
)) })
|
|
993
1032
|
] }, e.key)) })
|
|
994
|
-
] }) :
|
|
995
|
-
/* @__PURE__ */ t(
|
|
1033
|
+
] }) : st ? /* @__PURE__ */ t("p", { className: "px-8 py-10 text-[13px] text-slate-400", children: "Loading…" }) : T.length === 0 && B.length === 0 && z.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
1034
|
+
/* @__PURE__ */ t(Le, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
996
1035
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "You're all caught up" }),
|
|
997
1036
|
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: i === "inbox" ? "No unread notifications." : "No notifications here." })
|
|
998
|
-
] }) : /* @__PURE__ */ n(
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1037
|
+
] }) : /* @__PURE__ */ n(qe, { children: [
|
|
1038
|
+
ne > 0 && // Zero-height and sticky: floats over the list, never pushes it.
|
|
1039
|
+
/* @__PURE__ */ t("div", { className: "sticky top-2 z-10 flex h-0 justify-center overflow-visible", children: /* @__PURE__ */ n(
|
|
1040
|
+
"button",
|
|
1041
|
+
{
|
|
1042
|
+
type: "button",
|
|
1043
|
+
"data-notification-new-pill": ne,
|
|
1044
|
+
onClick: bt,
|
|
1045
|
+
className: "mt-1 inline-flex h-7 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-white px-3 text-[12px] font-medium text-nvr-navy shadow-sm transition-colors hover:bg-nvr-cyan/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:border-nvr-cyan/40 dark:bg-card dark:text-nvr-cyan dark:hover:bg-nvr-cyan/10",
|
|
1046
|
+
children: [
|
|
1047
|
+
/* @__PURE__ */ t(At, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
1048
|
+
ne,
|
|
1049
|
+
" new"
|
|
1050
|
+
]
|
|
1051
|
+
}
|
|
1052
|
+
) }),
|
|
1053
|
+
/* @__PURE__ */ n(
|
|
1054
|
+
"div",
|
|
1055
|
+
{
|
|
1056
|
+
ref: pt,
|
|
1057
|
+
className: "mx-8 my-6 divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card",
|
|
1058
|
+
children: [
|
|
1059
|
+
z.length > 0 && /* @__PURE__ */ n("div", { "data-notification-pinned": !0, children: [
|
|
1060
|
+
/* @__PURE__ */ n("div", { className: "bg-amber-50 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: [
|
|
1061
|
+
"Needs your acknowledgement · ",
|
|
1062
|
+
z.length
|
|
1063
|
+
] }),
|
|
1064
|
+
z.map((e) => /* @__PURE__ */ t(pe, { children: se(e) }, `pin:${e.id}`))
|
|
1065
|
+
] }),
|
|
1066
|
+
mt.map(yt),
|
|
1067
|
+
_e.map((e, a) => {
|
|
1068
|
+
const l = (_) => {
|
|
1069
|
+
if (!_) return "Older";
|
|
1070
|
+
const o = new Date(_), f = /* @__PURE__ */ new Date(), g = new Date(f.getFullYear(), f.getMonth(), f.getDate());
|
|
1071
|
+
return o >= g ? "Today" : o >= new Date(g.getTime() - 864e5) ? "Yesterday" : o >= new Date(g.getTime() - 5184e5) ? "This week" : "Older";
|
|
1072
|
+
}, s = l(e.created_at), x = a > 0 ? l(_e[a - 1].created_at) : null;
|
|
1073
|
+
return /* @__PURE__ */ n(pe, { children: [
|
|
1074
|
+
s !== x ? /* @__PURE__ */ t("div", { className: "bg-slate-50/80 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-muted/40", children: s }) : null,
|
|
1075
|
+
/* @__PURE__ */ t("div", { "data-live-key": Be(e), children: se(e) })
|
|
1076
|
+
] }, e.id);
|
|
1077
|
+
})
|
|
1078
|
+
]
|
|
1079
|
+
}
|
|
1080
|
+
)
|
|
1018
1081
|
] }),
|
|
1019
|
-
i !== "sent" &&
|
|
1082
|
+
i !== "sent" && $ > xe && /* @__PURE__ */ n("div", { className: "mx-8 mb-6 flex items-center justify-between", children: [
|
|
1020
1083
|
/* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: [
|
|
1021
1084
|
"Page ",
|
|
1022
|
-
|
|
1085
|
+
S,
|
|
1023
1086
|
" of ",
|
|
1024
|
-
|
|
1087
|
+
ae
|
|
1025
1088
|
] }),
|
|
1026
1089
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1027
1090
|
/* @__PURE__ */ n(
|
|
1028
1091
|
"button",
|
|
1029
1092
|
{
|
|
1030
1093
|
type: "button",
|
|
1031
|
-
disabled:
|
|
1032
|
-
onClick: () =>
|
|
1094
|
+
disabled: S <= 1,
|
|
1095
|
+
onClick: () => F((e) => Math.max(1, e - 1)),
|
|
1033
1096
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1034
1097
|
children: [
|
|
1035
|
-
/* @__PURE__ */ t(
|
|
1098
|
+
/* @__PURE__ */ t(Dt, { className: "mr-1 h-3.5 w-3.5" }),
|
|
1036
1099
|
"Previous"
|
|
1037
1100
|
]
|
|
1038
1101
|
}
|
|
@@ -1041,12 +1104,12 @@ function Yt({
|
|
|
1041
1104
|
"button",
|
|
1042
1105
|
{
|
|
1043
1106
|
type: "button",
|
|
1044
|
-
disabled:
|
|
1045
|
-
onClick: () =>
|
|
1107
|
+
disabled: S >= ae,
|
|
1108
|
+
onClick: () => F((e) => Math.min(ae, e + 1)),
|
|
1046
1109
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1047
1110
|
children: [
|
|
1048
1111
|
"Next",
|
|
1049
|
-
/* @__PURE__ */ t(
|
|
1112
|
+
/* @__PURE__ */ t(zt, { className: "ml-1 h-3.5 w-3.5" })
|
|
1050
1113
|
]
|
|
1051
1114
|
}
|
|
1052
1115
|
)
|
|
@@ -1054,15 +1117,19 @@ function Yt({
|
|
|
1054
1117
|
] })
|
|
1055
1118
|
] }),
|
|
1056
1119
|
/* @__PURE__ */ t(
|
|
1057
|
-
|
|
1120
|
+
Gt,
|
|
1058
1121
|
{
|
|
1059
|
-
notificationId: (
|
|
1060
|
-
title: (
|
|
1061
|
-
onClose: () =>
|
|
1122
|
+
notificationId: (v == null ? void 0 : v.id) ?? null,
|
|
1123
|
+
title: (v == null ? void 0 : v.subject) ?? (v == null ? void 0 : v.title) ?? null,
|
|
1124
|
+
onClose: () => ye(null)
|
|
1062
1125
|
}
|
|
1063
1126
|
)
|
|
1064
1127
|
] });
|
|
1065
1128
|
}
|
|
1129
|
+
function Ue(m) {
|
|
1130
|
+
const h = m.replace(/_/g, " ").trim();
|
|
1131
|
+
return h ? h.charAt(0).toUpperCase() + h.slice(1) : m;
|
|
1132
|
+
}
|
|
1066
1133
|
export {
|
|
1067
|
-
|
|
1134
|
+
Sa as NotificationCenterView
|
|
1068
1135
|
};
|