@nivaro/react 0.3.114 → 0.3.116
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 +1728 -22
- 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 +4909 -4182
- 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 +612 -551
- 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/OverflowRail.js +326 -0
- 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/SignalCard.js +84 -77
- 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/list/PhonePager.js +50 -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 +389 -323
- 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 +2050 -1942
- 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/OwnerAvatars.js +9 -9
- 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 +2407 -1950
- package/dist/shared/components/queue/worklist-helpers.js +10 -6
- 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/ui/popover.js +53 -29
- 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/keep-row-focus.js +43 -0
- 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/obligation-banner.js +17 -17
- 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/rail-menu-context.js +9 -0
- 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/row-surface.js +7 -0
- 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/table-pins.js +20 -18
- 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 +62 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-below-md.js +29 -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 { ChevronUp as St, Archive as Me, CheckCheck as _t, Search as At, Check as oe, AlarmClock as ce, ExternalLink as Te, Bell as Le, ShieldCheck as ue, 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 Kt } from "../../lib/open-in-tabs.js";
|
|
10
|
+
import { useRecordPeek as jt, 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 Ke() {
|
|
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 je = (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 = jt(), 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(""), [K, at] = c(!0), [nt, lt] = c(() => /* @__PURE__ */ new Set()), [v, ye] = c(null), [M, Y] = c(() => /* @__PURE__ */ new Set()), [ee, j] = c(!1), [rt, te] = c(!1), [we, dt] = c(!1), [Ne, it] = c("30");
|
|
70
|
+
me(() => {
|
|
71
|
+
Y(/* @__PURE__ */ new Set()), j(!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
|
+
K
|
|
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: K ? "record" : void 0
|
|
99
104
|
})
|
|
100
105
|
).then((e) => {
|
|
101
|
-
if (!
|
|
102
|
-
const a =
|
|
106
|
+
if (!K || 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 ?? "", K].join("|"), L = Pe(u ? B : void 0, je, {
|
|
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()), j(!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
|
+
j(!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
|
+
Ke().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": je(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,55 @@ 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
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
634
|
+
/* @__PURE__ */ t("h1", { className: "text-xl font-bold text-slate-900 dark:text-slate-100", children: "Notifications" }),
|
|
635
|
+
ne > 0 && /* @__PURE__ */ n(
|
|
636
|
+
"button",
|
|
637
|
+
{
|
|
638
|
+
type: "button",
|
|
639
|
+
"data-notification-new-pill": ne,
|
|
640
|
+
onClick: bt,
|
|
641
|
+
className: "inline-flex h-7 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-3 text-[12px] font-medium text-nvr-navy transition-colors hover:bg-nvr-cyan/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:border-nvr-cyan/40 dark:bg-nvr-cyan/15 dark:text-nvr-cyan dark:hover:bg-nvr-cyan/25",
|
|
642
|
+
children: [
|
|
643
|
+
/* @__PURE__ */ t(St, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
644
|
+
ne,
|
|
645
|
+
" new"
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
] }),
|
|
595
650
|
/* @__PURE__ */ n("p", { className: "mt-0.5 text-[13px] text-slate-400", children: [
|
|
596
|
-
|
|
651
|
+
$,
|
|
597
652
|
" notification",
|
|
598
|
-
|
|
599
|
-
(
|
|
653
|
+
$ === 1 ? "" : "s",
|
|
654
|
+
(y == null ? void 0 : y.attention) != null && y.attention > 0 ? ` · ${y.attention} need${y.attention === 1 ? "s" : ""} you` : ""
|
|
600
655
|
] })
|
|
601
656
|
] }),
|
|
602
|
-
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
657
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
603
658
|
/* @__PURE__ */ n(
|
|
604
659
|
"button",
|
|
605
660
|
{
|
|
606
661
|
type: "button",
|
|
607
|
-
onClick: () =>
|
|
662
|
+
onClick: () => dt((e) => !e),
|
|
608
663
|
"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",
|
|
664
|
+
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
665
|
children: [
|
|
611
|
-
/* @__PURE__ */ t(
|
|
666
|
+
/* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }),
|
|
612
667
|
"Clean up"
|
|
613
668
|
]
|
|
614
669
|
}
|
|
@@ -617,18 +672,18 @@ function Yt({
|
|
|
617
672
|
"button",
|
|
618
673
|
{
|
|
619
674
|
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",
|
|
675
|
+
onClick: () => le.mutate(),
|
|
676
|
+
disabled: le.isPending,
|
|
677
|
+
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
678
|
children: [
|
|
624
|
-
/* @__PURE__ */ t(
|
|
625
|
-
|
|
679
|
+
/* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" }),
|
|
680
|
+
le.isPending ? "Marking…" : "Mark all read"
|
|
626
681
|
]
|
|
627
682
|
}
|
|
628
683
|
)
|
|
629
684
|
] })
|
|
630
685
|
] }),
|
|
631
|
-
|
|
686
|
+
we && /* @__PURE__ */ n(
|
|
632
687
|
"div",
|
|
633
688
|
{
|
|
634
689
|
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 +692,10 @@ function Yt({
|
|
|
637
692
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
638
693
|
"Archive everything read and older than",
|
|
639
694
|
/* @__PURE__ */ t(
|
|
640
|
-
|
|
695
|
+
he,
|
|
641
696
|
{
|
|
642
|
-
value:
|
|
643
|
-
onChange:
|
|
697
|
+
value: Ne,
|
|
698
|
+
onChange: it,
|
|
644
699
|
ariaLabel: "Older than",
|
|
645
700
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
646
701
|
options: [
|
|
@@ -655,21 +710,21 @@ function Yt({
|
|
|
655
710
|
"button",
|
|
656
711
|
{
|
|
657
712
|
type: "button",
|
|
658
|
-
disabled:
|
|
659
|
-
onClick: () =>
|
|
713
|
+
disabled: re.isPending,
|
|
714
|
+
onClick: () => re.mutate(Number(Ne)),
|
|
660
715
|
"data-notification-archive-read": !0,
|
|
661
716
|
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:
|
|
717
|
+
children: re.isPending ? "Archiving…" : "Archive now"
|
|
663
718
|
}
|
|
664
719
|
)
|
|
665
720
|
] }),
|
|
666
721
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
667
722
|
"Or do it automatically — archive read notifications after",
|
|
668
723
|
/* @__PURE__ */ t(
|
|
669
|
-
|
|
724
|
+
he,
|
|
670
725
|
{
|
|
671
|
-
value: String((
|
|
672
|
-
onChange: (e) =>
|
|
726
|
+
value: String((de == null ? void 0 : de.notification_cleanup_days) ?? ""),
|
|
727
|
+
onChange: (e) => ft.mutate(e ? Number(e) : null),
|
|
673
728
|
ariaLabel: "Automatic clean-up",
|
|
674
729
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
675
730
|
options: [
|
|
@@ -686,19 +741,19 @@ function Yt({
|
|
|
686
741
|
}
|
|
687
742
|
),
|
|
688
743
|
/* @__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 =
|
|
744
|
+
/* @__PURE__ */ t("div", { className: "flex max-w-full flex-wrap items-center gap-1", children: la.map((e) => {
|
|
745
|
+
const a = wt(e.key);
|
|
691
746
|
return /* @__PURE__ */ n(
|
|
692
747
|
"button",
|
|
693
748
|
{
|
|
694
749
|
type: "button",
|
|
695
750
|
onClick: () => {
|
|
696
|
-
|
|
751
|
+
We(e.key), F(1);
|
|
697
752
|
},
|
|
698
753
|
"data-nvr-lane": e.key,
|
|
699
|
-
className:
|
|
700
|
-
"rounded-md px-3 py-1.5 text-[12.5px] font-medium transition-colors",
|
|
701
|
-
|
|
754
|
+
className: b(
|
|
755
|
+
"shrink-0 whitespace-nowrap rounded-md px-3 py-1.5 text-[12.5px] font-medium transition-colors",
|
|
756
|
+
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
757
|
),
|
|
703
758
|
children: [
|
|
704
759
|
e.label,
|
|
@@ -708,46 +763,46 @@ function Yt({
|
|
|
708
763
|
e.key
|
|
709
764
|
);
|
|
710
765
|
}) }),
|
|
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:
|
|
766
|
+
/* @__PURE__ */ t("span", { className: "mx-1 hidden h-5 w-px bg-slate-200 dark:bg-border sm:block" }),
|
|
767
|
+
/* @__PURE__ */ t("div", { className: "flex max-w-full flex-wrap items-center gap-1", children: na.map((e) => /* @__PURE__ */ t(
|
|
713
768
|
"button",
|
|
714
769
|
{
|
|
715
770
|
type: "button",
|
|
716
771
|
onClick: () => {
|
|
717
|
-
|
|
772
|
+
Ve(e.key), F(1);
|
|
718
773
|
},
|
|
719
|
-
className:
|
|
720
|
-
"rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
774
|
+
className: b(
|
|
775
|
+
"shrink-0 whitespace-nowrap rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
721
776
|
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
777
|
),
|
|
723
778
|
children: e.label
|
|
724
779
|
},
|
|
725
780
|
e.key
|
|
726
781
|
)) }),
|
|
727
|
-
/* @__PURE__ */ n("div", { className: "relative ml-auto", children: [
|
|
728
|
-
/* @__PURE__ */ t(
|
|
782
|
+
/* @__PURE__ */ n("div", { className: "relative w-full sm:ml-auto sm:w-auto", children: [
|
|
783
|
+
/* @__PURE__ */ t(At, { 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
784
|
/* @__PURE__ */ t(
|
|
730
785
|
"input",
|
|
731
786
|
{
|
|
732
|
-
value:
|
|
733
|
-
onChange: (e) =>
|
|
787
|
+
value: E,
|
|
788
|
+
onChange: (e) => Ee(e.target.value),
|
|
734
789
|
placeholder: "Search notifications…",
|
|
735
|
-
className: "h-8 w-
|
|
790
|
+
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
791
|
}
|
|
737
792
|
)
|
|
738
793
|
] }),
|
|
739
794
|
/* @__PURE__ */ t(
|
|
740
|
-
|
|
795
|
+
he,
|
|
741
796
|
{
|
|
742
|
-
value:
|
|
797
|
+
value: q,
|
|
743
798
|
onChange: (e) => {
|
|
744
|
-
|
|
799
|
+
tt(e), F(1);
|
|
745
800
|
},
|
|
746
801
|
ariaLabel: "Collection",
|
|
747
802
|
className: "h-8 w-auto rounded-md border-slate-200 bg-background px-2 text-[12.5px] dark:border-border",
|
|
748
803
|
options: [
|
|
749
804
|
{ value: "", label: "All collections" },
|
|
750
|
-
...
|
|
805
|
+
...ct.map((e) => ({ value: e, label: e }))
|
|
751
806
|
]
|
|
752
807
|
}
|
|
753
808
|
),
|
|
@@ -761,8 +816,8 @@ function Yt({
|
|
|
761
816
|
"input",
|
|
762
817
|
{
|
|
763
818
|
type: "checkbox",
|
|
764
|
-
checked:
|
|
765
|
-
onChange: (e) =>
|
|
819
|
+
checked: K,
|
|
820
|
+
onChange: (e) => at(e.target.checked),
|
|
766
821
|
className: "h-3.5 w-3.5",
|
|
767
822
|
"data-notification-group-by-record": !0
|
|
768
823
|
}
|
|
@@ -773,11 +828,11 @@ function Yt({
|
|
|
773
828
|
)
|
|
774
829
|
] })
|
|
775
830
|
] }),
|
|
776
|
-
|
|
831
|
+
J != null && /* @__PURE__ */ n(
|
|
777
832
|
"div",
|
|
778
833
|
{
|
|
779
834
|
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":
|
|
835
|
+
"data-notification-changes-landing": J,
|
|
781
836
|
children: [
|
|
782
837
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2", children: [
|
|
783
838
|
/* @__PURE__ */ t("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "What changed" }),
|
|
@@ -785,33 +840,33 @@ function Yt({
|
|
|
785
840
|
"button",
|
|
786
841
|
{
|
|
787
842
|
type: "button",
|
|
788
|
-
onClick: () =>
|
|
843
|
+
onClick: () => Ye(null),
|
|
789
844
|
className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2 hover:text-slate-600 dark:hover:text-slate-200",
|
|
790
845
|
children: "Dismiss"
|
|
791
846
|
}
|
|
792
847
|
)
|
|
793
848
|
] }),
|
|
794
|
-
/* @__PURE__ */ t(
|
|
849
|
+
/* @__PURE__ */ t(ea, { notificationId: J, className: "max-w-3xl" })
|
|
795
850
|
]
|
|
796
851
|
}
|
|
797
852
|
),
|
|
798
|
-
i !== "sent" &&
|
|
853
|
+
i !== "sent" && M.size > 0 && /* @__PURE__ */ n(
|
|
799
854
|
"div",
|
|
800
855
|
{
|
|
801
856
|
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
857
|
"data-notification-bulkbar": !0,
|
|
803
858
|
children: [
|
|
804
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
805
|
-
!
|
|
859
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: ee ? `All ${$} matching` : `${M.size} selected` }),
|
|
860
|
+
!ee && M.size >= Fe && $ > Fe && /* @__PURE__ */ n(
|
|
806
861
|
"button",
|
|
807
862
|
{
|
|
808
863
|
type: "button",
|
|
809
|
-
onClick: () =>
|
|
864
|
+
onClick: () => j(!0),
|
|
810
865
|
"data-notification-select-matching": !0,
|
|
811
866
|
className: "text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
|
|
812
867
|
children: [
|
|
813
868
|
"Select all ",
|
|
814
|
-
|
|
869
|
+
$,
|
|
815
870
|
" matching"
|
|
816
871
|
]
|
|
817
872
|
}
|
|
@@ -821,12 +876,12 @@ function Yt({
|
|
|
821
876
|
"button",
|
|
822
877
|
{
|
|
823
878
|
type: "button",
|
|
824
|
-
disabled:
|
|
825
|
-
onClick: () =>
|
|
879
|
+
disabled: R.isPending,
|
|
880
|
+
onClick: () => R.mutate({ action: "read" }),
|
|
826
881
|
"data-notification-bulk": "read",
|
|
827
882
|
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
883
|
children: [
|
|
829
|
-
/* @__PURE__ */ t(
|
|
884
|
+
/* @__PURE__ */ t(oe, { className: "h-3 w-3" }),
|
|
830
885
|
" Mark read"
|
|
831
886
|
]
|
|
832
887
|
}
|
|
@@ -836,21 +891,21 @@ function Yt({
|
|
|
836
891
|
"button",
|
|
837
892
|
{
|
|
838
893
|
type: "button",
|
|
839
|
-
disabled:
|
|
840
|
-
onClick: () =>
|
|
894
|
+
disabled: R.isPending,
|
|
895
|
+
onClick: () => te((e) => !e),
|
|
841
896
|
"data-notification-bulk": "snooze",
|
|
842
897
|
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
898
|
children: [
|
|
844
|
-
/* @__PURE__ */ t(
|
|
899
|
+
/* @__PURE__ */ t(ce, { className: "h-3 w-3" }),
|
|
845
900
|
" Snooze"
|
|
846
901
|
]
|
|
847
902
|
}
|
|
848
903
|
),
|
|
849
|
-
|
|
904
|
+
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: Ke().map((e) => /* @__PURE__ */ t(
|
|
850
905
|
"button",
|
|
851
906
|
{
|
|
852
907
|
type: "button",
|
|
853
|
-
onClick: () =>
|
|
908
|
+
onClick: () => R.mutate({ action: "snooze", until: e.until }),
|
|
854
909
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
855
910
|
children: e.label
|
|
856
911
|
},
|
|
@@ -861,12 +916,12 @@ function Yt({
|
|
|
861
916
|
"button",
|
|
862
917
|
{
|
|
863
918
|
type: "button",
|
|
864
|
-
disabled:
|
|
865
|
-
onClick: () =>
|
|
919
|
+
disabled: R.isPending,
|
|
920
|
+
onClick: () => R.mutate({ action: "archive" }),
|
|
866
921
|
"data-notification-bulk": "archive",
|
|
867
922
|
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
923
|
children: [
|
|
869
|
-
/* @__PURE__ */ t(
|
|
924
|
+
/* @__PURE__ */ t(Me, { className: "h-3 w-3" }),
|
|
870
925
|
" Archive"
|
|
871
926
|
]
|
|
872
927
|
}
|
|
@@ -877,17 +932,17 @@ function Yt({
|
|
|
877
932
|
type: "button",
|
|
878
933
|
onClick: () => {
|
|
879
934
|
const e = [];
|
|
880
|
-
for (const a of [...
|
|
881
|
-
if (!
|
|
882
|
-
const l =
|
|
935
|
+
for (const a of [...z, ...T, ...B.flatMap((l) => l.rows)]) {
|
|
936
|
+
if (!M.has(a.id)) continue;
|
|
937
|
+
const l = V(a, m);
|
|
883
938
|
l && (l.type === "external" ? e.push(l.url) : l.type === "path" && typeof window < "u" && e.push(`${window.location.origin}${l.path}`));
|
|
884
939
|
}
|
|
885
|
-
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(
|
|
940
|
+
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(It(Kt(e)));
|
|
886
941
|
},
|
|
887
942
|
"data-notification-bulk": "tabs",
|
|
888
943
|
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
944
|
children: [
|
|
890
|
-
/* @__PURE__ */ t(
|
|
945
|
+
/* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
|
|
891
946
|
" Open in tabs"
|
|
892
947
|
]
|
|
893
948
|
}
|
|
@@ -897,7 +952,7 @@ function Yt({
|
|
|
897
952
|
{
|
|
898
953
|
type: "button",
|
|
899
954
|
onClick: () => {
|
|
900
|
-
|
|
955
|
+
Y(/* @__PURE__ */ new Set()), j(!1);
|
|
901
956
|
},
|
|
902
957
|
className: "ml-auto text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2",
|
|
903
958
|
children: "Clear selection"
|
|
@@ -915,8 +970,8 @@ function Yt({
|
|
|
915
970
|
"input",
|
|
916
971
|
{
|
|
917
972
|
type: "checkbox",
|
|
918
|
-
checked:
|
|
919
|
-
onChange: (e) =>
|
|
973
|
+
checked: G,
|
|
974
|
+
onChange: (e) => Ze(e.target.checked),
|
|
920
975
|
className: "h-3.5 w-3.5",
|
|
921
976
|
"data-nvr-sent-critical": !0
|
|
922
977
|
}
|
|
@@ -924,19 +979,19 @@ function Yt({
|
|
|
924
979
|
"Critical only"
|
|
925
980
|
] })
|
|
926
981
|
] }),
|
|
927
|
-
|
|
928
|
-
/* @__PURE__ */ t(
|
|
982
|
+
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: [
|
|
983
|
+
/* @__PURE__ */ t(Le, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
929
984
|
/* @__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:
|
|
985
|
+
/* @__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." })
|
|
986
|
+
] }) : /* @__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
987
|
/* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
|
|
933
988
|
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
989
|
/* @__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:
|
|
990
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(Ie, { value: e.created_at ?? /* @__PURE__ */ new Date() }) }),
|
|
936
991
|
/* @__PURE__ */ n(
|
|
937
992
|
"span",
|
|
938
993
|
{
|
|
939
|
-
className:
|
|
994
|
+
className: b(
|
|
940
995
|
"ml-auto shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-semibold tabular-nums",
|
|
941
996
|
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
997
|
),
|
|
@@ -963,11 +1018,11 @@ function Yt({
|
|
|
963
1018
|
}
|
|
964
1019
|
)
|
|
965
1020
|
] }),
|
|
966
|
-
e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 text-[12px] text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
1021
|
+
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
1022
|
/* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap gap-1", children: e.recipients.map((a) => /* @__PURE__ */ n(
|
|
968
1023
|
"span",
|
|
969
1024
|
{
|
|
970
|
-
className:
|
|
1025
|
+
className: b(
|
|
971
1026
|
"inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[10.5px]",
|
|
972
1027
|
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
1028
|
),
|
|
@@ -978,61 +1033,68 @@ function Yt({
|
|
|
978
1033
|
/* @__PURE__ */ t(
|
|
979
1034
|
"span",
|
|
980
1035
|
{
|
|
981
|
-
className:
|
|
1036
|
+
className: b(
|
|
982
1037
|
"h-1.5 w-1.5 rounded-full",
|
|
983
1038
|
a.read ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
984
1039
|
)
|
|
985
1040
|
}
|
|
986
1041
|
),
|
|
987
1042
|
a.name,
|
|
988
|
-
a.ack === "acked" && /* @__PURE__ */ t(
|
|
1043
|
+
a.ack === "acked" && /* @__PURE__ */ t(ue, { className: "h-3 w-3" })
|
|
989
1044
|
]
|
|
990
1045
|
},
|
|
991
1046
|
a.id
|
|
992
1047
|
)) })
|
|
993
1048
|
] }, e.key)) })
|
|
994
|
-
] }) :
|
|
995
|
-
/* @__PURE__ */ t(
|
|
1049
|
+
] }) : 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: [
|
|
1050
|
+
/* @__PURE__ */ t(Le, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
996
1051
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "You're all caught up" }),
|
|
997
1052
|
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: i === "inbox" ? "No unread notifications." : "No notifications here." })
|
|
998
|
-
] }) : /* @__PURE__ */
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1053
|
+
] }) : /* @__PURE__ */ t(qe, { children: /* @__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
|
+
) }),
|
|
1081
|
+
i !== "sent" && $ > xe && /* @__PURE__ */ n("div", { className: "mx-8 mb-6 flex items-center justify-between", children: [
|
|
1020
1082
|
/* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: [
|
|
1021
1083
|
"Page ",
|
|
1022
|
-
|
|
1084
|
+
S,
|
|
1023
1085
|
" of ",
|
|
1024
|
-
|
|
1086
|
+
ae
|
|
1025
1087
|
] }),
|
|
1026
1088
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1027
1089
|
/* @__PURE__ */ n(
|
|
1028
1090
|
"button",
|
|
1029
1091
|
{
|
|
1030
1092
|
type: "button",
|
|
1031
|
-
disabled:
|
|
1032
|
-
onClick: () =>
|
|
1093
|
+
disabled: S <= 1,
|
|
1094
|
+
onClick: () => F((e) => Math.max(1, e - 1)),
|
|
1033
1095
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1034
1096
|
children: [
|
|
1035
|
-
/* @__PURE__ */ t(
|
|
1097
|
+
/* @__PURE__ */ t(Dt, { className: "mr-1 h-3.5 w-3.5" }),
|
|
1036
1098
|
"Previous"
|
|
1037
1099
|
]
|
|
1038
1100
|
}
|
|
@@ -1041,12 +1103,12 @@ function Yt({
|
|
|
1041
1103
|
"button",
|
|
1042
1104
|
{
|
|
1043
1105
|
type: "button",
|
|
1044
|
-
disabled:
|
|
1045
|
-
onClick: () =>
|
|
1106
|
+
disabled: S >= ae,
|
|
1107
|
+
onClick: () => F((e) => Math.min(ae, e + 1)),
|
|
1046
1108
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1047
1109
|
children: [
|
|
1048
1110
|
"Next",
|
|
1049
|
-
/* @__PURE__ */ t(
|
|
1111
|
+
/* @__PURE__ */ t(zt, { className: "ml-1 h-3.5 w-3.5" })
|
|
1050
1112
|
]
|
|
1051
1113
|
}
|
|
1052
1114
|
)
|
|
@@ -1054,15 +1116,19 @@ function Yt({
|
|
|
1054
1116
|
] })
|
|
1055
1117
|
] }),
|
|
1056
1118
|
/* @__PURE__ */ t(
|
|
1057
|
-
|
|
1119
|
+
Gt,
|
|
1058
1120
|
{
|
|
1059
|
-
notificationId: (
|
|
1060
|
-
title: (
|
|
1061
|
-
onClose: () =>
|
|
1121
|
+
notificationId: (v == null ? void 0 : v.id) ?? null,
|
|
1122
|
+
title: (v == null ? void 0 : v.subject) ?? (v == null ? void 0 : v.title) ?? null,
|
|
1123
|
+
onClose: () => ye(null)
|
|
1062
1124
|
}
|
|
1063
1125
|
)
|
|
1064
1126
|
] });
|
|
1065
1127
|
}
|
|
1128
|
+
function Ue(m) {
|
|
1129
|
+
const h = m.replace(/_/g, " ").trim();
|
|
1130
|
+
return h ? h.charAt(0).toUpperCase() + h.slice(1) : m;
|
|
1131
|
+
}
|
|
1066
1132
|
export {
|
|
1067
|
-
|
|
1133
|
+
Sa as NotificationCenterView
|
|
1068
1134
|
};
|