@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,30 +1,35 @@
|
|
|
1
|
-
import { jsxs as a, jsx as t, Fragment as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Undo2 as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { toastError as
|
|
9
|
-
import {
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as K, useMutation as Q, useQueryClient as ae } from "@tanstack/react-query";
|
|
3
|
+
import { Undo2 as Ce, Loader2 as ne, Check as ge, ShieldCheck as _e, ShieldAlert as xe, SlidersHorizontal as $e, RefreshCw as te, BookUser as qe, MonitorSmartphone as Re, EyeOff as Le, Eye as Te, Copy as Ae, Trash2 as De, KeyRound as Ee, Smartphone as Ke, Monitor as Pe, LogOut as Fe } from "lucide-react";
|
|
4
|
+
import { useMemo as fe, useState as E, useRef as W, useEffect as de } from "react";
|
|
5
|
+
import { toast as A } from "sonner";
|
|
6
|
+
import { useNivaroClient as F } from "../../context.js";
|
|
7
|
+
import { get as P, patch as Oe, put as Me, post as se, del as ye } from "../../lib/commands.js";
|
|
8
|
+
import { toastError as ve } from "../../lib/error-toast.js";
|
|
9
|
+
import { useLiveOps as Qe, useFreshIds as je } from "../../lib/live-ops.js";
|
|
10
|
+
import { useLivePreference as Ue } from "../../lib/live-preference.js";
|
|
11
|
+
import { formatRelative as Be, cn as T, formatDateTime as Ie, formatNumber as B } from "../../lib/utils.js";
|
|
12
|
+
import { ErrorNotice as ze } from "../ErrorNotice.js";
|
|
13
|
+
import { useOverflowTip as ce } from "../TipLayer.js";
|
|
10
14
|
import { SimpleSelect as Z } from "../ui/SimpleSelect.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
15
|
+
import { Skeleton as me } from "../ui/skeleton.js";
|
|
16
|
+
import { SectionCard as J, EmptyLine as ke, ConfirmButton as Y } from "./primitives.js";
|
|
17
|
+
import { useInvalidatePerson as ie, errorText as z } from "./types.js";
|
|
18
|
+
const Je = [
|
|
14
19
|
{ value: "", label: "Person" },
|
|
15
20
|
{ value: "integration", label: "Integration — an external system writes as it" },
|
|
16
21
|
{ value: "service", label: "Service login" },
|
|
17
22
|
{ value: "bot", label: "Bot" },
|
|
18
23
|
{ value: "placeholder", label: "Placeholder — kept so old references resolve" }
|
|
19
24
|
];
|
|
20
|
-
function
|
|
21
|
-
const n =
|
|
25
|
+
function ft({ profile: e }) {
|
|
26
|
+
const n = F(), d = ie(e.id), { data: i = [] } = K({
|
|
22
27
|
queryKey: ["nvr-roles"],
|
|
23
28
|
queryFn: () => n.request(
|
|
24
|
-
|
|
29
|
+
P("/roles")
|
|
25
30
|
).then((m) => m.data),
|
|
26
31
|
staleTime: 5 * 6e4
|
|
27
|
-
}),
|
|
32
|
+
}), o = fe(
|
|
28
33
|
() => {
|
|
29
34
|
var m;
|
|
30
35
|
return {
|
|
@@ -34,38 +39,38 @@ function tt({ profile: e }) {
|
|
|
34
39
|
};
|
|
35
40
|
},
|
|
36
41
|
[e]
|
|
37
|
-
), [
|
|
42
|
+
), [b, h] = E(null), p = b ?? o, k = JSON.stringify(p) !== JSON.stringify(o), l = Q({
|
|
38
43
|
mutationFn: () => n.request(
|
|
39
|
-
|
|
44
|
+
Oe(`/users/${e.id}`, {
|
|
40
45
|
role: p.role || null,
|
|
41
46
|
status: p.status,
|
|
42
47
|
account_kind: p.account_kind || null
|
|
43
48
|
})
|
|
44
49
|
),
|
|
45
50
|
onSuccess: () => {
|
|
46
|
-
|
|
51
|
+
h(null), d(), A.success("Access saved");
|
|
47
52
|
},
|
|
48
|
-
onError: (m) =>
|
|
49
|
-
}),
|
|
53
|
+
onError: (m) => A.error(z(m, "Could not save access"))
|
|
54
|
+
}), c = [
|
|
50
55
|
{ value: "", label: "No role" },
|
|
51
56
|
...i.map((m) => ({ value: m.id, label: m.admin_access ? `${m.name} · admin` : m.name }))
|
|
52
57
|
];
|
|
53
58
|
return /* @__PURE__ */ t(
|
|
54
59
|
J,
|
|
55
60
|
{
|
|
56
|
-
icon: /* @__PURE__ */ t(
|
|
61
|
+
icon: /* @__PURE__ */ t(_e, { className: "h-4 w-4" }),
|
|
57
62
|
title: "Access",
|
|
58
63
|
hint: "Role decides what they can do; status decides whether they can sign in",
|
|
59
64
|
testId: "access",
|
|
60
|
-
actions:
|
|
65
|
+
actions: k && /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
61
66
|
/* @__PURE__ */ a(
|
|
62
67
|
"button",
|
|
63
68
|
{
|
|
64
69
|
type: "button",
|
|
65
|
-
onClick: () =>
|
|
70
|
+
onClick: () => h(null),
|
|
66
71
|
className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] font-medium text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-200",
|
|
67
72
|
children: [
|
|
68
|
-
/* @__PURE__ */ t(
|
|
73
|
+
/* @__PURE__ */ t(Ce, { className: "h-3 w-3" }),
|
|
69
74
|
" Reset"
|
|
70
75
|
]
|
|
71
76
|
}
|
|
@@ -74,12 +79,12 @@ function tt({ profile: e }) {
|
|
|
74
79
|
"button",
|
|
75
80
|
{
|
|
76
81
|
type: "button",
|
|
77
|
-
disabled:
|
|
78
|
-
onClick: () =>
|
|
82
|
+
disabled: l.isPending,
|
|
83
|
+
onClick: () => l.mutate(),
|
|
79
84
|
"data-person-access-save": !0,
|
|
80
85
|
className: "inline-flex h-7 items-center gap-1 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-semibold text-white transition-opacity disabled:opacity-50",
|
|
81
86
|
children: [
|
|
82
|
-
|
|
87
|
+
l.isPending ? /* @__PURE__ */ t(ne, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
|
|
83
88
|
" ",
|
|
84
89
|
"Save"
|
|
85
90
|
]
|
|
@@ -94,8 +99,8 @@ function tt({ profile: e }) {
|
|
|
94
99
|
{
|
|
95
100
|
ariaLabel: "Role",
|
|
96
101
|
value: p.role,
|
|
97
|
-
onChange: (m) =>
|
|
98
|
-
options:
|
|
102
|
+
onChange: (m) => h({ ...p, role: m }),
|
|
103
|
+
options: c,
|
|
99
104
|
className: "h-8 text-[12.5px]"
|
|
100
105
|
}
|
|
101
106
|
)
|
|
@@ -107,7 +112,7 @@ function tt({ profile: e }) {
|
|
|
107
112
|
{
|
|
108
113
|
ariaLabel: "Status",
|
|
109
114
|
value: p.status,
|
|
110
|
-
onChange: (m) =>
|
|
115
|
+
onChange: (m) => h({ ...p, status: m }),
|
|
111
116
|
options: [
|
|
112
117
|
{ value: "active", label: "Active" },
|
|
113
118
|
{ value: "inactive", label: "Inactive" },
|
|
@@ -124,8 +129,8 @@ function tt({ profile: e }) {
|
|
|
124
129
|
{
|
|
125
130
|
ariaLabel: "Account type",
|
|
126
131
|
value: p.account_kind,
|
|
127
|
-
onChange: (m) =>
|
|
128
|
-
options:
|
|
132
|
+
onChange: (m) => h({ ...p, account_kind: m }),
|
|
133
|
+
options: Je,
|
|
129
134
|
className: "h-8 text-[12.5px]"
|
|
130
135
|
}
|
|
131
136
|
),
|
|
@@ -135,7 +140,7 @@ function tt({ profile: e }) {
|
|
|
135
140
|
}
|
|
136
141
|
);
|
|
137
142
|
}
|
|
138
|
-
const
|
|
143
|
+
const Ge = {
|
|
139
144
|
directory: "Directory sync",
|
|
140
145
|
retention: "Retention policy",
|
|
141
146
|
offboarding: "Offboarding",
|
|
@@ -144,11 +149,11 @@ const Ee = {
|
|
|
144
149
|
"legacy-redaction": "Legacy redaction job",
|
|
145
150
|
unknown: "Unknown"
|
|
146
151
|
};
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
const n =
|
|
152
|
+
function yt({ profile: e }) {
|
|
153
|
+
var o;
|
|
154
|
+
const n = F(), d = e.status === "suspended" || !!((o = e.admin) != null && o.is_redacted), { data: i } = K({
|
|
150
155
|
queryKey: ["nvr-user-suspension", e.id],
|
|
151
|
-
queryFn: () => n.request(
|
|
156
|
+
queryFn: () => n.request(P(`/users/${e.id}/suspension`)).then((b) => b.data).catch(() => null),
|
|
152
157
|
enabled: d,
|
|
153
158
|
staleTime: 6e4
|
|
154
159
|
});
|
|
@@ -160,7 +165,7 @@ function rt({ profile: e }) {
|
|
|
160
165
|
children: [
|
|
161
166
|
/* @__PURE__ */ a("p", { className: "font-medium", children: [
|
|
162
167
|
"Cannot sign in — ",
|
|
163
|
-
|
|
168
|
+
Ge[i.source] ?? i.source,
|
|
164
169
|
i.at ? ` · ${new Date(i.at).toLocaleString()}` : "",
|
|
165
170
|
i.by ? ` · by ${i.by.name}` : ""
|
|
166
171
|
] }),
|
|
@@ -171,137 +176,137 @@ function rt({ profile: e }) {
|
|
|
171
176
|
);
|
|
172
177
|
}
|
|
173
178
|
const oe = (e, n) => e.map((d) => ({ id: d.id, label: String(d[n] ?? d.id) }));
|
|
174
|
-
function
|
|
175
|
-
const n =
|
|
179
|
+
function Ne(e) {
|
|
180
|
+
const n = F(), d = e.display_field ?? "name", { data: i = [] } = K({
|
|
176
181
|
queryKey: ["nvr-scope-options", e.name],
|
|
177
182
|
queryFn: () => n.request(
|
|
178
|
-
|
|
183
|
+
P(`/items/${e.target_collection}`, {
|
|
179
184
|
fields: `id,${d}`,
|
|
180
185
|
limit: 200,
|
|
181
186
|
...e.options_sort ? { sort: e.options_sort } : {}
|
|
182
187
|
})
|
|
183
|
-
).then((
|
|
188
|
+
).then((o) => oe(o.data ?? [], d))
|
|
184
189
|
});
|
|
185
190
|
return i;
|
|
186
191
|
}
|
|
187
|
-
function
|
|
188
|
-
const i =
|
|
189
|
-
for (const
|
|
190
|
-
const p = n.filter((
|
|
192
|
+
function we(e, n, d = []) {
|
|
193
|
+
const i = F(), o = e.display_field ?? "name", b = Ne(e), h = new Map(b.map((l) => [String(l.id), l.label]));
|
|
194
|
+
for (const l of d) h.set(String(l.id), l.label);
|
|
195
|
+
const p = n.filter((l) => !h.has(String(l))), { data: k = [] } = K({
|
|
191
196
|
queryKey: ["nvr-scope-selected-labels", e.name, p.map(String).sort().join(",")],
|
|
192
197
|
queryFn: () => i.request(
|
|
193
|
-
|
|
194
|
-
fields: `id,${
|
|
198
|
+
P(`/items/${e.target_collection}`, {
|
|
199
|
+
fields: `id,${o}`,
|
|
195
200
|
limit: 100,
|
|
196
201
|
filter: JSON.stringify({ id: { _in: p } })
|
|
197
202
|
})
|
|
198
|
-
).then((
|
|
203
|
+
).then((l) => oe(l.data ?? [], o)),
|
|
199
204
|
enabled: p.length > 0
|
|
200
205
|
});
|
|
201
|
-
for (const
|
|
202
|
-
return
|
|
206
|
+
for (const l of k) h.set(String(l.id), l.label);
|
|
207
|
+
return h;
|
|
203
208
|
}
|
|
204
|
-
function
|
|
209
|
+
function ue({
|
|
205
210
|
dimension: e,
|
|
206
211
|
selected: n,
|
|
207
212
|
accent: d,
|
|
208
213
|
disabled: i,
|
|
209
|
-
staged:
|
|
210
|
-
removing:
|
|
211
|
-
onToggle:
|
|
214
|
+
staged: o,
|
|
215
|
+
removing: b,
|
|
216
|
+
onToggle: h
|
|
212
217
|
}) {
|
|
213
|
-
const p =
|
|
214
|
-
queryKey: ["nvr-scope-search", e.name,
|
|
218
|
+
const p = F(), k = e.display_field ?? "name", [l, c] = E(""), m = new Set((o ?? []).map(String)), q = new Set((b ?? []).map(String)), $ = Ne(e), R = $.length > 24, { data: N = [], isFetching: y } = K({
|
|
219
|
+
queryKey: ["nvr-scope-search", e.name, l],
|
|
215
220
|
queryFn: () => p.request(
|
|
216
|
-
|
|
217
|
-
fields: `id,${
|
|
221
|
+
P(`/items/${e.target_collection}`, {
|
|
222
|
+
fields: `id,${k}`,
|
|
218
223
|
limit: 30,
|
|
219
|
-
filter: JSON.stringify({ [
|
|
224
|
+
filter: JSON.stringify({ [k]: { _contains: l } }),
|
|
220
225
|
...e.options_sort ? { sort: e.options_sort } : {}
|
|
221
226
|
})
|
|
222
|
-
).then((
|
|
223
|
-
enabled:
|
|
224
|
-
placeholderData: (
|
|
225
|
-
}), s =
|
|
226
|
-
w.has(String(
|
|
227
|
+
).then((g) => oe(g.data ?? [], k)),
|
|
228
|
+
enabled: R && l.trim().length > 0,
|
|
229
|
+
placeholderData: (g) => g
|
|
230
|
+
}), s = we(e, n, N), w = new Set(n.map(String)), S = (g) => h(
|
|
231
|
+
w.has(String(g)) ? n.filter((L) => String(L) !== String(g)) : [...n, g]
|
|
227
232
|
), C = d === "amber" ? "border-amber-400 bg-amber-50 font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400" : "border-nvr-cyan bg-accent font-medium text-nvr-navy dark:text-nvr-cyan";
|
|
228
|
-
return
|
|
229
|
-
n.length > 0 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap gap-1", children: n.map((
|
|
233
|
+
return R ? /* @__PURE__ */ a("div", { className: "max-w-xl", children: [
|
|
234
|
+
n.length > 0 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap gap-1", children: n.map((g) => /* @__PURE__ */ a(
|
|
230
235
|
"span",
|
|
231
236
|
{
|
|
232
|
-
className:
|
|
237
|
+
className: T(
|
|
233
238
|
"inline-flex items-center gap-1 rounded-full border py-0.5 pl-2.5 pr-1 text-[11.5px]",
|
|
234
239
|
C,
|
|
235
|
-
m.has(String(
|
|
240
|
+
m.has(String(g)) && "border-dashed"
|
|
236
241
|
),
|
|
237
242
|
children: [
|
|
238
|
-
s.get(String(
|
|
243
|
+
s.get(String(g)) ?? String(g),
|
|
239
244
|
/* @__PURE__ */ t(
|
|
240
245
|
"button",
|
|
241
246
|
{
|
|
242
247
|
type: "button",
|
|
243
248
|
disabled: i,
|
|
244
|
-
onClick: () => S(
|
|
245
|
-
"aria-label": `Remove ${s.get(String(
|
|
249
|
+
onClick: () => S(g),
|
|
250
|
+
"aria-label": `Remove ${s.get(String(g)) ?? g}`,
|
|
246
251
|
className: "rounded-full px-1 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
|
|
247
252
|
children: "×"
|
|
248
253
|
}
|
|
249
254
|
)
|
|
250
255
|
]
|
|
251
256
|
},
|
|
252
|
-
String(
|
|
257
|
+
String(g)
|
|
253
258
|
)) }),
|
|
254
259
|
/* @__PURE__ */ t(
|
|
255
260
|
"input",
|
|
256
261
|
{
|
|
257
|
-
value:
|
|
258
|
-
onChange: (
|
|
262
|
+
value: l,
|
|
263
|
+
onChange: (g) => c(g.target.value),
|
|
259
264
|
disabled: i,
|
|
260
265
|
placeholder: `Search ${e.label.toLowerCase()} to add…`,
|
|
261
266
|
className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2.5 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-card"
|
|
262
267
|
}
|
|
263
268
|
),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
const
|
|
269
|
+
l.trim().length > 0 && /* @__PURE__ */ a("div", { className: "mt-1 max-h-44 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: [
|
|
270
|
+
N.map((g) => {
|
|
271
|
+
const L = w.has(String(g.id));
|
|
267
272
|
return /* @__PURE__ */ a(
|
|
268
273
|
"button",
|
|
269
274
|
{
|
|
270
275
|
type: "button",
|
|
271
276
|
disabled: i,
|
|
272
|
-
onClick: () => S(
|
|
273
|
-
className:
|
|
277
|
+
onClick: () => S(g.id),
|
|
278
|
+
className: T(
|
|
274
279
|
"flex w-full items-center justify-between px-2.5 py-1.5 text-left text-[12px] hover:bg-muted",
|
|
275
|
-
|
|
280
|
+
L ? "font-medium text-nvr-navy dark:text-nvr-cyan" : "text-slate-600 dark:text-slate-300"
|
|
276
281
|
),
|
|
277
282
|
children: [
|
|
278
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
279
|
-
/* @__PURE__ */ t("span", { className: "pl-2 text-[11px] text-slate-400", children:
|
|
283
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: g.label }),
|
|
284
|
+
/* @__PURE__ */ t("span", { className: "pl-2 text-[11px] text-slate-400", children: L ? "Remove" : "Add" })
|
|
280
285
|
]
|
|
281
286
|
},
|
|
282
|
-
String(
|
|
287
|
+
String(g.id)
|
|
283
288
|
);
|
|
284
289
|
}),
|
|
285
|
-
|
|
290
|
+
N.length === 0 && /* @__PURE__ */ t("p", { className: "px-2.5 py-2 text-[11.5px] text-slate-400", children: y ? "Searching…" : "No matches." })
|
|
286
291
|
] })
|
|
287
|
-
] }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children:
|
|
288
|
-
const
|
|
292
|
+
] }) : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: $.map((g) => {
|
|
293
|
+
const L = w.has(String(g.id));
|
|
289
294
|
return /* @__PURE__ */ t(
|
|
290
295
|
"button",
|
|
291
296
|
{
|
|
292
297
|
type: "button",
|
|
293
|
-
"aria-pressed":
|
|
298
|
+
"aria-pressed": L,
|
|
294
299
|
disabled: i,
|
|
295
|
-
onClick: () => S(
|
|
296
|
-
className:
|
|
300
|
+
onClick: () => S(g.id),
|
|
301
|
+
className: T(
|
|
297
302
|
// No colour transition: a press shows its new state at once.
|
|
298
303
|
"rounded-full border px-2.5 py-0.5 text-[11.5px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 disabled:cursor-wait",
|
|
299
|
-
|
|
300
|
-
|
|
304
|
+
L ? C : q.has(String(g.id)) ? "border-dashed border-amber-400 text-amber-800 line-through decoration-amber-500/70 dark:border-amber-500/60 dark:text-amber-300" : "border-slate-200 text-slate-600 hover:border-slate-300 dark:border-border dark:text-slate-400 dark:hover:border-slate-500",
|
|
305
|
+
L && m.has(String(g.id)) && "border-dashed"
|
|
301
306
|
),
|
|
302
|
-
children:
|
|
307
|
+
children: g.label
|
|
303
308
|
},
|
|
304
|
-
String(
|
|
309
|
+
String(g.id)
|
|
305
310
|
);
|
|
306
311
|
}) });
|
|
307
312
|
}
|
|
@@ -309,107 +314,107 @@ const X = (e, n) => {
|
|
|
309
314
|
if (e.length !== n.length) return !1;
|
|
310
315
|
const d = new Set(e.map(String));
|
|
311
316
|
return n.every((i) => d.has(String(i)));
|
|
312
|
-
},
|
|
317
|
+
}, He = (e, n) => `${e}:${n.map(String).sort().join(",")}`, re = (e) => e.replace(/_/g, " ").replace(/^\w/, (n) => n.toUpperCase()), pe = (e) => /s$/i.test(e) ? e : `${e}s`;
|
|
313
318
|
function ee(e) {
|
|
314
319
|
return e.length <= 1 ? e[0] ?? "" : `${e.slice(0, -1).join(", ")} and ${e.at(-1)}`;
|
|
315
320
|
}
|
|
316
|
-
function
|
|
321
|
+
function vt({
|
|
317
322
|
userId: e,
|
|
318
323
|
previewDelayMs: n = 400
|
|
319
324
|
}) {
|
|
320
|
-
const d =
|
|
321
|
-
queryKey:
|
|
322
|
-
queryFn: () => d.request(
|
|
323
|
-
}), [
|
|
325
|
+
const d = F(), i = ae(), o = fe(() => ["nvr-user-scopes", e], [e]), { data: b } = K({
|
|
326
|
+
queryKey: o,
|
|
327
|
+
queryFn: () => d.request(P(`/user-scopes/${e}`)).then((r) => r.data)
|
|
328
|
+
}), [h, p] = E({}), [k, l] = E({}), c = W({}), m = W({}), q = W({});
|
|
324
329
|
de(() => {
|
|
325
|
-
const r =
|
|
330
|
+
const r = q.current;
|
|
326
331
|
return () => {
|
|
327
|
-
for (const
|
|
332
|
+
for (const u of Object.values(r)) clearTimeout(u);
|
|
328
333
|
};
|
|
329
334
|
}, []);
|
|
330
|
-
const
|
|
331
|
-
clearTimeout(
|
|
332
|
-
const { [r]: f,
|
|
333
|
-
return
|
|
334
|
-
}),
|
|
335
|
-
},
|
|
336
|
-
if (!
|
|
337
|
-
const
|
|
338
|
-
return { ...
|
|
339
|
-
}),
|
|
335
|
+
const $ = (r, u) => {
|
|
336
|
+
clearTimeout(q.current[r]), l((v) => {
|
|
337
|
+
const { [r]: f, ..._ } = v;
|
|
338
|
+
return u ? { ..._, [r]: u } : _;
|
|
339
|
+
}), u === "saved" && (q.current[r] = setTimeout(() => $(r, null), 2400));
|
|
340
|
+
}, R = (r) => i.setQueryData(o, (u) => {
|
|
341
|
+
if (!u) return u;
|
|
342
|
+
const v = r.mode === "restrict" ? "restricted" : "defaults";
|
|
343
|
+
return { ...u, [v]: { ...u[v], [r.dimension]: r.values } };
|
|
344
|
+
}), N = Q({
|
|
340
345
|
// One person's scope saves go out one after another, in click order.
|
|
341
346
|
scope: { id: `nvr-user-scopes:${e}` },
|
|
342
|
-
mutationFn: (r) => d.request(
|
|
347
|
+
mutationFn: (r) => d.request(Me(`/user-scopes/${e}`, r)),
|
|
343
348
|
onMutate: (r) => {
|
|
344
|
-
var
|
|
345
|
-
const
|
|
346
|
-
return m.current[
|
|
349
|
+
var _, U;
|
|
350
|
+
const u = `${r.dimension}:${r.mode}`, v = r.mode === "restrict" ? "restricted" : "defaults", f = ((U = (_ = i.getQueryData(o)) == null ? void 0 : _[v]) == null ? void 0 : U[r.dimension]) ?? [];
|
|
351
|
+
return m.current[u] = (m.current[u] ?? 0) + 1, delete c.current[u], p((M) => ({ ...M, [u]: r.values })), $(u, "saving"), i.cancelQueries({ queryKey: o }), R(r), { before: f };
|
|
347
352
|
},
|
|
348
|
-
onSuccess: (r,
|
|
349
|
-
onError: (r,
|
|
350
|
-
var
|
|
351
|
-
const f = `${
|
|
352
|
-
|
|
353
|
-
if (!V[f] || !X(V[f],
|
|
354
|
-
const { [f]:
|
|
355
|
-
return
|
|
356
|
-
}),
|
|
353
|
+
onSuccess: (r, u) => R(u),
|
|
354
|
+
onError: (r, u, v) => {
|
|
355
|
+
var M, le;
|
|
356
|
+
const f = `${u.dimension}:${u.mode}`, _ = u.mode === "restrict" ? "restricted" : "defaults", U = ((le = (M = i.getQueryData(o)) == null ? void 0 : M[_]) == null ? void 0 : le[u.dimension]) ?? [];
|
|
357
|
+
v && X(U, u.values) && R({ ...u, values: v.before }), p((V) => {
|
|
358
|
+
if (!V[f] || !X(V[f], u.values)) return V;
|
|
359
|
+
const { [f]: et, ...Se } = V;
|
|
360
|
+
return Se;
|
|
361
|
+
}), c.current[f] = u, ve(
|
|
357
362
|
r,
|
|
358
|
-
|
|
359
|
-
{ retry: () =>
|
|
363
|
+
u.mode === "restrict" ? "Could not apply the restriction" : "Could not save the default",
|
|
364
|
+
{ retry: () => N.mutate(u) }
|
|
360
365
|
);
|
|
361
366
|
},
|
|
362
|
-
onSettled: (r,
|
|
363
|
-
const f = `${
|
|
364
|
-
m.current[f] = Math.max(0, (m.current[f] ?? 1) - 1),
|
|
365
|
-
if (
|
|
366
|
-
const { [f]:
|
|
367
|
-
return
|
|
368
|
-
}), m.current[f] === 0 &&
|
|
367
|
+
onSettled: (r, u, v) => {
|
|
368
|
+
const f = `${v.dimension}:${v.mode}`;
|
|
369
|
+
m.current[f] = Math.max(0, (m.current[f] ?? 1) - 1), u || p((_) => {
|
|
370
|
+
if (!_[f] || !X(_[f], v.values)) return _;
|
|
371
|
+
const { [f]: U, ...M } = _;
|
|
372
|
+
return M;
|
|
373
|
+
}), m.current[f] === 0 && $(f, u ? "failed" : "saved"), i.invalidateQueries({ queryKey: o }), i.invalidateQueries({ queryKey: ["nvr-person-profile", e] }), i.invalidateQueries({ queryKey: ["nvr-my-scopes"] }), i.invalidateQueries({ queryKey: ["nvr-profile-scopes"] });
|
|
369
374
|
}
|
|
370
|
-
}), y = (r,
|
|
375
|
+
}), y = (r, u) => h[`${r}:${u}`] ?? (u === "restrict" ? b == null ? void 0 : b.restricted[r] : b == null ? void 0 : b.defaults[r]) ?? [], [s, w] = E(null), [S, C] = E(null), [g, L] = E(0), O = W(0), D = s ? He(s.dimension, s.values) : null;
|
|
371
376
|
de(() => {
|
|
372
|
-
if (!s || !
|
|
373
|
-
const r = ++O.current,
|
|
377
|
+
if (!s || !D) return;
|
|
378
|
+
const r = ++O.current, u = setTimeout(() => {
|
|
374
379
|
d.request(
|
|
375
380
|
se(`/user-scopes/${e}/impact`, {
|
|
376
381
|
dimension: s.dimension,
|
|
377
382
|
values: s.values
|
|
378
383
|
})
|
|
379
384
|
).then(
|
|
380
|
-
(
|
|
381
|
-
r === O.current && C({ key:
|
|
385
|
+
(v) => {
|
|
386
|
+
r === O.current && C({ key: D, answer: v.data, error: null });
|
|
382
387
|
},
|
|
383
|
-
(
|
|
384
|
-
r === O.current && C({ key:
|
|
388
|
+
(v) => {
|
|
389
|
+
r === O.current && C({ key: D, answer: null, error: v });
|
|
385
390
|
}
|
|
386
391
|
);
|
|
387
392
|
}, n);
|
|
388
|
-
return () => clearTimeout(
|
|
389
|
-
}, [
|
|
390
|
-
const G = (r,
|
|
391
|
-
if (X(
|
|
393
|
+
return () => clearTimeout(u);
|
|
394
|
+
}, [D, g, d, e, n]);
|
|
395
|
+
const G = (r, u) => {
|
|
396
|
+
if (X(u, y(r, "restrict"))) {
|
|
392
397
|
O.current++, w(null), C(null);
|
|
393
398
|
return;
|
|
394
399
|
}
|
|
395
|
-
s && s.dimension !== r && C(null), w({ dimension: r, values:
|
|
396
|
-
},
|
|
400
|
+
s && s.dimension !== r && C(null), w({ dimension: r, values: u });
|
|
401
|
+
}, j = () => {
|
|
397
402
|
O.current++, w(null), C(null);
|
|
398
403
|
}, H = () => {
|
|
399
|
-
s && (
|
|
400
|
-
},
|
|
401
|
-
const
|
|
402
|
-
|
|
404
|
+
s && (N.mutate({ dimension: s.dimension, mode: "restrict", values: s.values }), j());
|
|
405
|
+
}, x = (r) => {
|
|
406
|
+
const u = c.current[r];
|
|
407
|
+
u && N.mutate(u);
|
|
403
408
|
};
|
|
404
|
-
return !
|
|
409
|
+
return !b || b.dimensions.length === 0 ? null : /* @__PURE__ */ t(
|
|
405
410
|
J,
|
|
406
411
|
{
|
|
407
|
-
icon: /* @__PURE__ */ t(
|
|
412
|
+
icon: /* @__PURE__ */ t($e, { className: "h-4 w-4" }),
|
|
408
413
|
title: "Scopes",
|
|
409
414
|
hint: "Defaults pre-fill their filters; restrictions limit what they can see",
|
|
410
415
|
testId: "scopes",
|
|
411
|
-
children: /* @__PURE__ */ t("div", { className: "space-y-5", children:
|
|
412
|
-
const
|
|
416
|
+
children: /* @__PURE__ */ t("div", { className: "space-y-5", children: b.dimensions.map((r) => {
|
|
417
|
+
const u = h[`${r.name}:restrict`] != null, v = (s == null ? void 0 : s.dimension) === r.name;
|
|
413
418
|
return /* @__PURE__ */ a("div", { children: [
|
|
414
419
|
/* @__PURE__ */ t("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: r.label }),
|
|
415
420
|
/* @__PURE__ */ a("div", { className: "mt-1.5 space-y-2.5", children: [
|
|
@@ -418,68 +423,68 @@ function at({
|
|
|
418
423
|
"Defaults",
|
|
419
424
|
/* @__PURE__ */ t("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: "pre-filled in their filters" }),
|
|
420
425
|
/* @__PURE__ */ t(
|
|
421
|
-
|
|
426
|
+
be,
|
|
422
427
|
{
|
|
423
428
|
slot: `${r.name}:default`,
|
|
424
|
-
status:
|
|
425
|
-
onRetry:
|
|
429
|
+
status: k[`${r.name}:default`],
|
|
430
|
+
onRetry: x
|
|
426
431
|
}
|
|
427
432
|
)
|
|
428
433
|
] }),
|
|
429
434
|
/* @__PURE__ */ t(
|
|
430
|
-
|
|
435
|
+
ue,
|
|
431
436
|
{
|
|
432
437
|
dimension: r,
|
|
433
438
|
selected: y(r.name, "default"),
|
|
434
439
|
accent: "cyan",
|
|
435
|
-
onToggle: (f) =>
|
|
440
|
+
onToggle: (f) => N.mutate({ dimension: r.name, mode: "default", values: f })
|
|
436
441
|
}
|
|
437
442
|
)
|
|
438
443
|
] }),
|
|
439
444
|
/* @__PURE__ */ a("div", { "data-scope-restrict": r.name, children: [
|
|
440
445
|
/* @__PURE__ */ a("p", { className: "mb-1 flex min-h-4 items-center gap-1.5 text-[11px] font-medium text-slate-600 dark:text-slate-300", children: [
|
|
441
|
-
/* @__PURE__ */ t(
|
|
446
|
+
/* @__PURE__ */ t(xe, { className: "h-3 w-3 text-amber-500", "aria-hidden": !0 }),
|
|
442
447
|
"Restricted to",
|
|
443
|
-
y(r.name, "restrict").length === 0 && !
|
|
448
|
+
y(r.name, "restrict").length === 0 && !v ? /* @__PURE__ */ a("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: [
|
|
444
449
|
"none — sees every ",
|
|
445
450
|
r.label.toLowerCase()
|
|
446
451
|
] }) : /* @__PURE__ */ t("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: "enforced on every read" }),
|
|
447
452
|
/* @__PURE__ */ t(
|
|
448
|
-
|
|
453
|
+
be,
|
|
449
454
|
{
|
|
450
455
|
slot: `${r.name}:restrict`,
|
|
451
|
-
status:
|
|
452
|
-
onRetry:
|
|
456
|
+
status: k[`${r.name}:restrict`],
|
|
457
|
+
onRetry: x
|
|
453
458
|
}
|
|
454
459
|
)
|
|
455
460
|
] }),
|
|
456
461
|
/* @__PURE__ */ t(
|
|
457
|
-
|
|
462
|
+
ue,
|
|
458
463
|
{
|
|
459
464
|
dimension: r,
|
|
460
|
-
selected:
|
|
465
|
+
selected: v && s ? s.values : y(r.name, "restrict"),
|
|
461
466
|
accent: "amber",
|
|
462
|
-
disabled:
|
|
463
|
-
staged:
|
|
464
|
-
(f) => !y(r.name, "restrict").some((
|
|
467
|
+
disabled: u,
|
|
468
|
+
staged: v && s ? s.values.filter(
|
|
469
|
+
(f) => !y(r.name, "restrict").some((_) => String(_) === String(f))
|
|
465
470
|
) : void 0,
|
|
466
|
-
removing:
|
|
467
|
-
(f) => !s.values.some((
|
|
471
|
+
removing: v && s ? y(r.name, "restrict").filter(
|
|
472
|
+
(f) => !s.values.some((_) => String(_) === String(f))
|
|
468
473
|
) : void 0,
|
|
469
474
|
onToggle: (f) => G(r.name, f)
|
|
470
475
|
}
|
|
471
476
|
),
|
|
472
|
-
|
|
473
|
-
|
|
477
|
+
v && s && /* @__PURE__ */ t(
|
|
478
|
+
Ve,
|
|
474
479
|
{
|
|
475
480
|
dimension: r,
|
|
476
481
|
saved: y(r.name, "restrict"),
|
|
477
482
|
values: s.values,
|
|
478
|
-
result: (S == null ? void 0 : S.key) ===
|
|
479
|
-
stale: S && S.key !==
|
|
483
|
+
result: (S == null ? void 0 : S.key) === D ? S : null,
|
|
484
|
+
stale: S && S.key !== D ? S.answer : null,
|
|
480
485
|
onApply: H,
|
|
481
|
-
onCancel:
|
|
482
|
-
onRetry: () =>
|
|
486
|
+
onCancel: j,
|
|
487
|
+
onRetry: () => L((f) => f + 1)
|
|
483
488
|
}
|
|
484
489
|
)
|
|
485
490
|
] })
|
|
@@ -489,7 +494,7 @@ function at({
|
|
|
489
494
|
}
|
|
490
495
|
);
|
|
491
496
|
}
|
|
492
|
-
function
|
|
497
|
+
function be({
|
|
493
498
|
slot: e,
|
|
494
499
|
status: n,
|
|
495
500
|
onRetry: d
|
|
@@ -499,22 +504,22 @@ function ue({
|
|
|
499
504
|
{
|
|
500
505
|
"data-scope-status": e,
|
|
501
506
|
"aria-live": "polite",
|
|
502
|
-
className:
|
|
507
|
+
className: T(
|
|
503
508
|
"inline-flex items-center gap-1 font-normal",
|
|
504
509
|
n === "saved" && "text-emerald-700 dark:text-emerald-400",
|
|
505
510
|
n === "failed" && "font-medium text-red-700 dark:text-red-400",
|
|
506
511
|
n === "saving" && "text-slate-600 dark:text-slate-300"
|
|
507
512
|
),
|
|
508
513
|
children: [
|
|
509
|
-
n === "saving" && /* @__PURE__ */ a(
|
|
514
|
+
n === "saving" && /* @__PURE__ */ a(I, { children: [
|
|
510
515
|
/* @__PURE__ */ t(ne, { className: "h-3 w-3 animate-spin motion-reduce:animate-none", "aria-hidden": !0 }),
|
|
511
516
|
"Saving…"
|
|
512
517
|
] }),
|
|
513
|
-
n === "saved" && /* @__PURE__ */ a(
|
|
514
|
-
/* @__PURE__ */ t(
|
|
518
|
+
n === "saved" && /* @__PURE__ */ a(I, { children: [
|
|
519
|
+
/* @__PURE__ */ t(ge, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
515
520
|
"Saved"
|
|
516
521
|
] }),
|
|
517
|
-
n === "failed" && /* @__PURE__ */ a(
|
|
522
|
+
n === "failed" && /* @__PURE__ */ a(I, { children: [
|
|
518
523
|
"Not saved",
|
|
519
524
|
/* @__PURE__ */ t(
|
|
520
525
|
"button",
|
|
@@ -530,21 +535,21 @@ function ue({
|
|
|
530
535
|
}
|
|
531
536
|
);
|
|
532
537
|
}
|
|
533
|
-
function
|
|
538
|
+
function Ve({
|
|
534
539
|
dimension: e,
|
|
535
540
|
saved: n,
|
|
536
541
|
values: d,
|
|
537
542
|
result: i,
|
|
538
|
-
stale:
|
|
539
|
-
onApply:
|
|
540
|
-
onCancel:
|
|
543
|
+
stale: o,
|
|
544
|
+
onApply: b,
|
|
545
|
+
onCancel: h,
|
|
541
546
|
onRetry: p
|
|
542
547
|
}) {
|
|
543
|
-
var
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
].filter(Boolean).join("; "),
|
|
548
|
+
var j, H;
|
|
549
|
+
const k = we(e, [...n, ...d]), l = (x) => k.get(String(x)) ?? `#${x}`, c = e.label.toLowerCase(), m = new Set(n.map(String)), q = new Set(d.map(String)), $ = d.filter((x) => !m.has(String(x))).map(l), R = n.filter((x) => !q.has(String(x))).map(l), N = (i == null ? void 0 : i.answer) ?? o, y = i ? i.error ? "error" : "ready" : o ? "updating" : "loading", s = (N == null ? void 0 : N.impact) ?? [], w = s.filter((x) => x.proposed === 0 && x.total > 0), S = d.length === 0, C = (x, r = 5) => x.length <= r ? ee(x) : `${x.slice(0, r - 1).join(", ")} and ${x.length - (r - 1)} more`, g = S ? `Remove the ${c} restriction` : n.length === 0 ? `Limit them to ${C(d.map(l))}` : [
|
|
550
|
+
$.length > 0 ? `Also let them see ${C($)}` : null,
|
|
551
|
+
R.length > 0 ? `${$.length > 0 ? "stop" : "Stop"} them seeing ${C(R)}` : null
|
|
552
|
+
].filter(Boolean).join("; "), L = S ? `They will see records in every ${c}.` : `After this they only see records in ${C(d.map(l))}.`, O = y === "updating" ? "opacity-40" : "", D = w.map((x) => x.label ?? re(x.collection)), G = D.length <= 2 ? `they lose all ${ee(D)}` : `they lose ${D.length} record types`;
|
|
548
553
|
return /* @__PURE__ */ a(
|
|
549
554
|
"div",
|
|
550
555
|
{
|
|
@@ -553,8 +558,8 @@ function Qe({
|
|
|
553
558
|
children: [
|
|
554
559
|
/* @__PURE__ */ a("div", { className: "flex items-start gap-3 px-3 pt-2.5", children: [
|
|
555
560
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
556
|
-
/* @__PURE__ */ t("p", { className: "font-semibold", children:
|
|
557
|
-
/* @__PURE__ */ t("p", { className: "mt-0.5 text-amber-900 dark:text-amber-200", children:
|
|
561
|
+
/* @__PURE__ */ t("p", { className: "font-semibold", children: g }),
|
|
562
|
+
/* @__PURE__ */ t("p", { className: "mt-0.5 text-amber-900 dark:text-amber-200", children: L })
|
|
558
563
|
] }),
|
|
559
564
|
(y === "loading" || y === "updating") && /* @__PURE__ */ a("span", { className: "mt-0.5 inline-flex shrink-0 items-center gap-1 text-[11px] text-amber-900 dark:text-amber-200", children: [
|
|
560
565
|
/* @__PURE__ */ t(ne, { className: "h-3 w-3 animate-spin motion-reduce:animate-none", "aria-hidden": !0 }),
|
|
@@ -564,45 +569,45 @@ function Qe({
|
|
|
564
569
|
w.length > 0 && /* @__PURE__ */ a(
|
|
565
570
|
"p",
|
|
566
571
|
{
|
|
567
|
-
className:
|
|
572
|
+
className: T(
|
|
568
573
|
"mx-3 mt-2 flex items-start gap-1.5 font-semibold text-red-700 dark:text-red-300",
|
|
569
574
|
O
|
|
570
575
|
),
|
|
571
576
|
"data-scope-blind": !0,
|
|
572
577
|
children: [
|
|
573
|
-
/* @__PURE__ */ t(
|
|
578
|
+
/* @__PURE__ */ t(xe, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
574
579
|
"They would see nothing in ",
|
|
575
|
-
ee(w.map((
|
|
580
|
+
ee(w.map((x) => x.label ?? re(x.collection))),
|
|
576
581
|
"."
|
|
577
582
|
]
|
|
578
583
|
}
|
|
579
584
|
),
|
|
580
585
|
y === "error" ? /* @__PURE__ */ t("div", { className: "mx-3 mt-2 text-amber-900 dark:text-amber-200", children: /* @__PURE__ */ a("p", { children: [
|
|
581
586
|
"Couldn’t count what changes. Count again, or check the ",
|
|
582
|
-
|
|
587
|
+
pe(c),
|
|
583
588
|
" above before applying."
|
|
584
589
|
] }) }) : s.length > 0 ? /* @__PURE__ */ t(
|
|
585
590
|
"ul",
|
|
586
591
|
{
|
|
587
|
-
className:
|
|
592
|
+
className: T(
|
|
588
593
|
"mx-3 mt-2 w-fit max-w-[calc(100%-1.5rem)] border-t border-amber-200 dark:border-amber-500/20",
|
|
589
594
|
O
|
|
590
595
|
),
|
|
591
596
|
"aria-busy": y === "updating",
|
|
592
|
-
children: s.map((
|
|
597
|
+
children: s.map((x) => /* @__PURE__ */ t(We, { row: x }, x.collection))
|
|
593
598
|
}
|
|
594
|
-
) : y === "loading" ? /* @__PURE__ */ t("div", { className: "mx-3 mt-2 space-y-1.5", "aria-hidden": !0, children: [0, 1, 2].map((
|
|
599
|
+
) : y === "loading" ? /* @__PURE__ */ t("div", { className: "mx-3 mt-2 space-y-1.5", "aria-hidden": !0, children: [0, 1, 2].map((x) => /* @__PURE__ */ t("div", { className: "h-4 max-w-md rounded bg-amber-200/60 dark:bg-amber-400/10" }, x)) }) : /* @__PURE__ */ a("p", { className: "mx-3 mt-2", children: [
|
|
595
600
|
"No records route to ",
|
|
596
|
-
|
|
601
|
+
pe(c),
|
|
597
602
|
", so nothing they see changes."
|
|
598
603
|
] }),
|
|
599
|
-
(((
|
|
604
|
+
(((j = N == null ? void 0 : N.partial) == null ? void 0 : j.length) ?? 0) > 0 && /* @__PURE__ */ a("p", { className: "mx-3 mt-1.5 text-[11px] text-amber-900 dark:text-amber-200", children: [
|
|
600
605
|
"Not counted in time: ",
|
|
601
|
-
(H =
|
|
606
|
+
(H = N == null ? void 0 : N.partial) == null ? void 0 : H.map((x) => x.label).join(", "),
|
|
602
607
|
"."
|
|
603
608
|
] }),
|
|
604
609
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 px-3 pb-2.5 pt-2.5", children: [
|
|
605
|
-
y === "error" ? /* @__PURE__ */ a(
|
|
610
|
+
y === "error" ? /* @__PURE__ */ a(I, { children: [
|
|
606
611
|
/* @__PURE__ */ t(
|
|
607
612
|
"button",
|
|
608
613
|
{
|
|
@@ -617,7 +622,7 @@ function Qe({
|
|
|
617
622
|
{
|
|
618
623
|
type: "button",
|
|
619
624
|
"data-scope-apply": !0,
|
|
620
|
-
onClick:
|
|
625
|
+
onClick: b,
|
|
621
626
|
className: "inline-flex h-7 items-center rounded-md border border-amber-400 px-3 text-[11.5px] font-medium text-amber-900 hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500/40 dark:border-amber-500/50 dark:text-amber-200 dark:hover:bg-amber-400/10",
|
|
622
627
|
children: "Apply without counts"
|
|
623
628
|
}
|
|
@@ -625,7 +630,7 @@ function Qe({
|
|
|
625
630
|
] }) : w.length > 0 && y === "ready" ? /* @__PURE__ */ t("span", { "data-scope-apply-danger": !0, children: /* @__PURE__ */ a(
|
|
626
631
|
Y,
|
|
627
632
|
{
|
|
628
|
-
onConfirm:
|
|
633
|
+
onConfirm: b,
|
|
629
634
|
confirmLabel: `Press again — ${G}`,
|
|
630
635
|
className: "inline-flex h-7 items-center rounded-md bg-red-600 px-3 text-[11.5px] font-medium text-white hover:bg-red-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500/50 focus-visible:ring-offset-1 dark:bg-red-700 dark:hover:bg-red-600",
|
|
631
636
|
armedClassName: "bg-red-700 dark:bg-red-800",
|
|
@@ -640,7 +645,7 @@ function Qe({
|
|
|
640
645
|
type: "button",
|
|
641
646
|
"data-scope-apply": !0,
|
|
642
647
|
disabled: !i,
|
|
643
|
-
onClick:
|
|
648
|
+
onClick: b,
|
|
644
649
|
className: "inline-flex h-7 items-center rounded-md bg-amber-700 px-3 text-[11.5px] font-medium text-[#fff] hover:bg-amber-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500/50 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:bg-amber-700/45 dark:bg-amber-400 dark:text-[#1c1003] dark:hover:bg-amber-300 dark:disabled:bg-amber-400/40",
|
|
645
650
|
children: S ? "Remove restriction" : "Apply restriction"
|
|
646
651
|
}
|
|
@@ -649,7 +654,7 @@ function Qe({
|
|
|
649
654
|
"button",
|
|
650
655
|
{
|
|
651
656
|
type: "button",
|
|
652
|
-
onClick:
|
|
657
|
+
onClick: h,
|
|
653
658
|
className: "inline-flex h-7 items-center rounded-md px-2 text-[11.5px] text-amber-900 hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500/40 dark:text-amber-200 dark:hover:bg-amber-400/10",
|
|
654
659
|
children: "Cancel"
|
|
655
660
|
}
|
|
@@ -660,8 +665,8 @@ function Qe({
|
|
|
660
665
|
}
|
|
661
666
|
);
|
|
662
667
|
}
|
|
663
|
-
function
|
|
664
|
-
return /* @__PURE__ */ t(
|
|
668
|
+
function he({ items: e }) {
|
|
669
|
+
return /* @__PURE__ */ t(I, { children: e.map((n, d) => /* @__PURE__ */ a("span", { children: [
|
|
665
670
|
d > 0 && ", ",
|
|
666
671
|
/^\d+$/.test(n.label) ? /* @__PURE__ */ a("span", { className: "font-mono text-[10.5px]", children: [
|
|
667
672
|
"#",
|
|
@@ -669,9 +674,9 @@ function pe({ items: e }) {
|
|
|
669
674
|
] }) : n.label
|
|
670
675
|
] }, n.id)) });
|
|
671
676
|
}
|
|
672
|
-
function
|
|
673
|
-
var
|
|
674
|
-
const n = e.label ?? re(e.collection), d = e.gained ?? 0, i = e.lost ?? 0,
|
|
677
|
+
function We({ row: e }) {
|
|
678
|
+
var h, p, k, l;
|
|
679
|
+
const n = e.label ?? re(e.collection), d = e.gained ?? 0, i = e.lost ?? 0, o = e.proposed - e.current, b = (c, m) => c > m ? ` and ${B(c - m)} more` : "";
|
|
675
680
|
return /* @__PURE__ */ a(
|
|
676
681
|
"li",
|
|
677
682
|
{
|
|
@@ -680,43 +685,43 @@ function je({ row: e }) {
|
|
|
680
685
|
children: [
|
|
681
686
|
/* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium", children: n }),
|
|
682
687
|
/* @__PURE__ */ a("span", { className: "text-right tabular-nums", children: [
|
|
683
|
-
e.proposed === 0 && e.total > 0 ? /* @__PURE__ */ t("span", { className: "font-semibold text-red-700 dark:text-red-300", children: "none" }) :
|
|
688
|
+
e.proposed === 0 && e.total > 0 ? /* @__PURE__ */ t("span", { className: "font-semibold text-red-700 dark:text-red-300", children: "none" }) : B(e.proposed),
|
|
684
689
|
/* @__PURE__ */ a("span", { className: "text-amber-900 dark:text-amber-200", children: [
|
|
685
690
|
" of ",
|
|
686
|
-
|
|
691
|
+
B(e.total)
|
|
687
692
|
] })
|
|
688
693
|
] }),
|
|
689
694
|
/* @__PURE__ */ t(
|
|
690
695
|
"span",
|
|
691
696
|
{
|
|
692
|
-
className:
|
|
697
|
+
className: T(
|
|
693
698
|
"text-right text-[11.5px] tabular-nums",
|
|
694
|
-
|
|
699
|
+
o > 0 ? "font-semibold text-emerald-700 dark:text-emerald-400" : o < 0 ? "font-semibold text-red-700 dark:text-red-400" : "text-amber-900 dark:text-amber-200"
|
|
695
700
|
),
|
|
696
|
-
children:
|
|
701
|
+
children: o > 0 ? `+${B(o)}` : o < 0 ? `−${B(-o)}` : "no change"
|
|
697
702
|
}
|
|
698
703
|
),
|
|
699
|
-
d > 0 && (((
|
|
704
|
+
d > 0 && (((h = e.gained_sample) == null ? void 0 : h.length) ?? 0) > 0 && /* @__PURE__ */ a(
|
|
700
705
|
"p",
|
|
701
706
|
{
|
|
702
707
|
className: "col-span-3 mt-0.5 truncate text-[11px] text-amber-900 dark:text-amber-200",
|
|
703
708
|
"data-scope-impact-gained": d,
|
|
704
709
|
children: [
|
|
705
710
|
"Newly visible: ",
|
|
706
|
-
/* @__PURE__ */ t(
|
|
707
|
-
|
|
711
|
+
/* @__PURE__ */ t(he, { items: e.gained_sample ?? [] }),
|
|
712
|
+
b(d, ((p = e.gained_sample) == null ? void 0 : p.length) ?? 0)
|
|
708
713
|
]
|
|
709
714
|
}
|
|
710
715
|
),
|
|
711
|
-
i > 0 && (((
|
|
716
|
+
i > 0 && (((k = e.lost_sample) == null ? void 0 : k.length) ?? 0) > 0 && /* @__PURE__ */ a(
|
|
712
717
|
"p",
|
|
713
718
|
{
|
|
714
719
|
className: "col-span-3 mt-0.5 truncate text-[11px] text-amber-900 dark:text-amber-200",
|
|
715
720
|
"data-scope-impact-lost": i,
|
|
716
721
|
children: [
|
|
717
722
|
"No longer visible: ",
|
|
718
|
-
/* @__PURE__ */ t(
|
|
719
|
-
|
|
723
|
+
/* @__PURE__ */ t(he, { items: e.lost_sample ?? [] }),
|
|
724
|
+
b(i, ((l = e.lost_sample) == null ? void 0 : l.length) ?? 0)
|
|
720
725
|
]
|
|
721
726
|
}
|
|
722
727
|
)
|
|
@@ -724,7 +729,7 @@ function je({ row: e }) {
|
|
|
724
729
|
}
|
|
725
730
|
);
|
|
726
731
|
}
|
|
727
|
-
const
|
|
732
|
+
const Xe = [
|
|
728
733
|
{ key: "first_name", label: "First name" },
|
|
729
734
|
{ key: "last_name", label: "Last name" },
|
|
730
735
|
{ key: "title", label: "Title" },
|
|
@@ -738,51 +743,51 @@ const Me = [
|
|
|
738
743
|
{ key: "employee_id", label: "Employee id" },
|
|
739
744
|
{ key: "preferred_language", label: "Language" }
|
|
740
745
|
];
|
|
741
|
-
function
|
|
742
|
-
var
|
|
743
|
-
const n =
|
|
746
|
+
function kt({ profile: e }) {
|
|
747
|
+
var $, R, N, y;
|
|
748
|
+
const n = F(), d = ae(), i = ie(e.id), o = K({
|
|
744
749
|
queryKey: ["nvr-directory-status"],
|
|
745
|
-
queryFn: () => n.request(
|
|
750
|
+
queryFn: () => n.request(P("/directory/status")).then((s) => s.data),
|
|
746
751
|
staleTime: 5 * 6e4
|
|
747
|
-
}),
|
|
752
|
+
}), b = K({
|
|
748
753
|
queryKey: ["nvr-directory-entry", e.email],
|
|
749
|
-
queryFn: () => n.request(
|
|
754
|
+
queryFn: () => n.request(P(`/directory/users/${encodeURIComponent(e.email)}`)).then((s) => s.data).catch((s) => {
|
|
750
755
|
if ((s == null ? void 0 : s.status) === 404) return null;
|
|
751
756
|
throw s;
|
|
752
757
|
}),
|
|
753
|
-
enabled: !!((
|
|
758
|
+
enabled: !!(($ = o.data) != null && $.granted && e.email),
|
|
754
759
|
staleTime: 6e4
|
|
755
|
-
}),
|
|
760
|
+
}), h = Q({
|
|
756
761
|
mutationFn: () => n.request(se(`/directory/sync/${e.id}`)).then((s) => s.data),
|
|
757
762
|
onSuccess: ({ summary: s }) => {
|
|
758
|
-
i(), d.invalidateQueries({ queryKey: ["nvr-directory-entry", e.email] }), s.active > 0 ?
|
|
763
|
+
i(), d.invalidateQueries({ queryKey: ["nvr-directory-entry", e.email] }), s.active > 0 ? A.success("Still with the company — profile synced from the directory") : A.warning(
|
|
759
764
|
`${s.missing > 0 ? "Not in the directory" : "Disabled in Azure"}${s.suspended > 0 ? " — suspended" : ""}`
|
|
760
765
|
);
|
|
761
766
|
},
|
|
762
|
-
onError: (s) =>
|
|
767
|
+
onError: (s) => A.error(z(s, "Directory sync failed"))
|
|
763
768
|
});
|
|
764
|
-
if (
|
|
765
|
-
const p = e,
|
|
769
|
+
if (o.isLoading || !((R = o.data) != null && R.configured)) return null;
|
|
770
|
+
const p = e, k = (s) => {
|
|
766
771
|
var w;
|
|
767
772
|
return p[s] ?? ((w = e.admin) == null ? void 0 : w[s]) ?? null;
|
|
768
|
-
},
|
|
773
|
+
}, l = b.data, c = ((N = e.admin) == null ? void 0 : N.directory_status) ?? null, m = c === "active" ? "border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-400/30 dark:bg-emerald-400/10 dark:text-emerald-200" : c === "disabled" || c === "missing" ? "border-red-200 bg-red-50 text-red-800 dark:border-red-400/30 dark:bg-red-400/10 dark:text-red-200" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-muted-foreground", q = c === "active" ? "Still with the company" : c === "disabled" ? "Account disabled in Azure — no longer with the company" : c === "missing" ? "Not in the Microsoft directory — no longer with the company" : "Not checked against the directory yet";
|
|
769
774
|
return /* @__PURE__ */ a(
|
|
770
775
|
J,
|
|
771
776
|
{
|
|
772
|
-
icon: /* @__PURE__ */ t(
|
|
777
|
+
icon: /* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
|
|
773
778
|
title: "Microsoft directory",
|
|
774
779
|
hint: "Pulling writes every field the directory has a value for; blanks never clear",
|
|
775
780
|
testId: "directory",
|
|
776
|
-
actions:
|
|
781
|
+
actions: o.data.granted && /* @__PURE__ */ a(
|
|
777
782
|
"button",
|
|
778
783
|
{
|
|
779
784
|
type: "button",
|
|
780
|
-
onClick: () =>
|
|
781
|
-
disabled:
|
|
785
|
+
onClick: () => h.mutate(),
|
|
786
|
+
disabled: h.isPending,
|
|
782
787
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
783
788
|
children: [
|
|
784
|
-
/* @__PURE__ */ t(te, { className:
|
|
785
|
-
|
|
789
|
+
/* @__PURE__ */ t(te, { className: T("h-3 w-3", h.isPending && "animate-spin") }),
|
|
790
|
+
h.isPending ? "Checking…" : "Sync from directory"
|
|
786
791
|
]
|
|
787
792
|
}
|
|
788
793
|
),
|
|
@@ -790,38 +795,38 @@ function nt({ profile: e }) {
|
|
|
790
795
|
/* @__PURE__ */ a(
|
|
791
796
|
"div",
|
|
792
797
|
{
|
|
793
|
-
className:
|
|
794
|
-
"data-directory-verdict":
|
|
798
|
+
className: T("rounded-md border px-3 py-2 text-[12.5px]", m),
|
|
799
|
+
"data-directory-verdict": c ?? "unchecked",
|
|
795
800
|
children: [
|
|
796
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
801
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: q }),
|
|
797
802
|
((y = e.admin) == null ? void 0 : y.directory_checked_at) && /* @__PURE__ */ a("span", { className: "ml-2 text-[11px] opacity-70", children: [
|
|
798
803
|
"checked ",
|
|
799
|
-
|
|
804
|
+
Be(e.admin.directory_checked_at)
|
|
800
805
|
] }),
|
|
801
|
-
(
|
|
806
|
+
(c === "disabled" || c === "missing") && /* @__PURE__ */ t("p", { className: "mt-0.5 text-[11.5px] opacity-80", children: "Hand off what they still own under Admin tools. Redaction stays a separate step." })
|
|
802
807
|
]
|
|
803
808
|
}
|
|
804
809
|
),
|
|
805
|
-
|
|
810
|
+
o.data.granted ? b.isLoading ? /* @__PURE__ */ t("p", { className: "mt-3 text-[12px] text-slate-400", children: "Looking up the directory…" }) : b.isError ? /* @__PURE__ */ t("p", { className: "mt-3 text-[12px] text-red-600 dark:text-red-400", children: z(b.error, "The directory lookup failed.") }) : l ? /* @__PURE__ */ a("div", { className: "mt-3 space-y-3", children: [
|
|
806
811
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12px]", children: [
|
|
807
|
-
/* @__PURE__ */ t("span", { className: "font-medium text-slate-800 dark:text-foreground", children:
|
|
808
|
-
|
|
812
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-slate-800 dark:text-foreground", children: l.display_name ?? `${l.first_name ?? ""} ${l.last_name ?? ""}`.trim() }),
|
|
813
|
+
l.upn && l.upn.toLowerCase() !== e.email.toLowerCase() && /* @__PURE__ */ a("span", { className: "text-slate-400", children: [
|
|
809
814
|
"UPN ",
|
|
810
|
-
|
|
815
|
+
l.upn
|
|
811
816
|
] }),
|
|
812
|
-
|
|
813
|
-
|
|
817
|
+
l.account_enabled === !1 && /* @__PURE__ */ t("span", { className: "rounded-full bg-red-50 px-2 py-0.5 text-[11px] font-medium text-red-700 dark:bg-red-400/10 dark:text-red-300", children: "Disabled in Azure" }),
|
|
818
|
+
l.manager && /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
|
|
814
819
|
"Reports to",
|
|
815
820
|
" ",
|
|
816
|
-
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-foreground", children:
|
|
821
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-slate-700 dark:text-foreground", children: l.manager.display_name ?? l.manager.email })
|
|
817
822
|
] })
|
|
818
823
|
] }),
|
|
819
|
-
/* @__PURE__ */ t("dl", { className: "grid gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border sm:grid-cols-2 lg:grid-cols-3", children:
|
|
820
|
-
const w =
|
|
824
|
+
/* @__PURE__ */ t("dl", { className: "grid gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border sm:grid-cols-2 lg:grid-cols-3", children: Xe.filter((s) => s.key in l).map((s) => {
|
|
825
|
+
const w = l[s.key] ?? null, S = k(s.key), C = !!w && w !== S;
|
|
821
826
|
return /* @__PURE__ */ a(
|
|
822
827
|
"div",
|
|
823
828
|
{
|
|
824
|
-
className:
|
|
829
|
+
className: T(
|
|
825
830
|
"bg-white px-3 py-2 dark:bg-card",
|
|
826
831
|
C && "bg-amber-50/60 dark:bg-amber-400/10"
|
|
827
832
|
),
|
|
@@ -843,45 +848,45 @@ function nt({ profile: e }) {
|
|
|
843
848
|
"."
|
|
844
849
|
] }) : /* @__PURE__ */ a("div", { className: "mt-3 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[12px] text-amber-900 dark:border-amber-400/30 dark:bg-amber-400/10 dark:text-amber-200", children: [
|
|
845
850
|
/* @__PURE__ */ t("p", { className: "font-medium", children: "Directory access is not granted yet." }),
|
|
846
|
-
/* @__PURE__ */ t("p", { className: "mt-0.5", children:
|
|
851
|
+
/* @__PURE__ */ t("p", { className: "mt-0.5", children: o.data.reason ?? "The app token cannot read other users. Grant User.Read.All as an application permission with admin consent." })
|
|
847
852
|
] })
|
|
848
853
|
]
|
|
849
854
|
}
|
|
850
855
|
);
|
|
851
856
|
}
|
|
852
|
-
function
|
|
853
|
-
var
|
|
854
|
-
const n =
|
|
857
|
+
function Nt({ profile: e }) {
|
|
858
|
+
var c;
|
|
859
|
+
const n = F(), d = ie(e.id), [i, o] = E(null), [b, h] = E(!1), p = Q({
|
|
855
860
|
mutationFn: () => n.request(se(`/users/${e.id}/token`)).then((m) => m.data.token),
|
|
856
861
|
onSuccess: (m) => {
|
|
857
|
-
|
|
862
|
+
o(m), h(!0), d(), A.success("Token generated — copy it now, it is shown once");
|
|
858
863
|
},
|
|
859
|
-
onError: (m) =>
|
|
860
|
-
}),
|
|
861
|
-
mutationFn: () => n.request(
|
|
864
|
+
onError: (m) => A.error(z(m, "Could not generate a token"))
|
|
865
|
+
}), k = Q({
|
|
866
|
+
mutationFn: () => n.request(ye(`/users/${e.id}/token`)),
|
|
862
867
|
onSuccess: () => {
|
|
863
|
-
|
|
868
|
+
o(null), h(!1), d(), A.success("Token revoked");
|
|
864
869
|
},
|
|
865
|
-
onError: (m) =>
|
|
866
|
-
}),
|
|
870
|
+
onError: (m) => A.error(z(m, "Could not revoke the token"))
|
|
871
|
+
}), l = !!((c = e.admin) != null && c.has_static_token) || !!i;
|
|
867
872
|
return /* @__PURE__ */ t(
|
|
868
873
|
J,
|
|
869
874
|
{
|
|
870
|
-
icon: /* @__PURE__ */ t(
|
|
875
|
+
icon: /* @__PURE__ */ t(Ee, { className: "h-4 w-4" }),
|
|
871
876
|
title: "API token",
|
|
872
877
|
hint: "Static bearer token for scripts and the SDK",
|
|
873
878
|
testId: "api-token",
|
|
874
|
-
children:
|
|
879
|
+
children: l ? /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
875
880
|
i ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
876
|
-
/* @__PURE__ */ t("code", { className: "flex-1 break-all rounded-md border border-slate-200 bg-slate-50 px-3 py-2 font-mono text-[12px] text-slate-700 dark:border-border dark:bg-muted/40 dark:text-slate-200", children:
|
|
881
|
+
/* @__PURE__ */ t("code", { className: "flex-1 break-all rounded-md border border-slate-200 bg-slate-50 px-3 py-2 font-mono text-[12px] text-slate-700 dark:border-border dark:bg-muted/40 dark:text-slate-200", children: b ? i : "•".repeat(24) }),
|
|
877
882
|
/* @__PURE__ */ t(
|
|
878
883
|
"button",
|
|
879
884
|
{
|
|
880
885
|
type: "button",
|
|
881
|
-
onClick: () =>
|
|
882
|
-
"aria-label":
|
|
886
|
+
onClick: () => h((m) => !m),
|
|
887
|
+
"aria-label": b ? "Hide token" : "Reveal token",
|
|
883
888
|
className: "rounded-md border border-slate-200 p-2 text-slate-500 hover:bg-slate-50 dark:border-border dark:hover:bg-muted",
|
|
884
|
-
children:
|
|
889
|
+
children: b ? /* @__PURE__ */ t(Le, { className: "h-4 w-4" }) : /* @__PURE__ */ t(Te, { className: "h-4 w-4" })
|
|
885
890
|
}
|
|
886
891
|
),
|
|
887
892
|
/* @__PURE__ */ t(
|
|
@@ -889,11 +894,11 @@ function st({ profile: e }) {
|
|
|
889
894
|
{
|
|
890
895
|
type: "button",
|
|
891
896
|
onClick: () => {
|
|
892
|
-
navigator.clipboard.writeText(i),
|
|
897
|
+
navigator.clipboard.writeText(i), A.success("Copied");
|
|
893
898
|
},
|
|
894
899
|
"aria-label": "Copy token",
|
|
895
900
|
className: "rounded-md border border-slate-200 p-2 text-slate-500 hover:bg-slate-50 dark:border-border dark:hover:bg-muted",
|
|
896
|
-
children: /* @__PURE__ */ t(
|
|
901
|
+
children: /* @__PURE__ */ t(Ae, { className: "h-4 w-4" })
|
|
897
902
|
}
|
|
898
903
|
)
|
|
899
904
|
] }) : /* @__PURE__ */ t("p", { className: "text-[12.5px] text-slate-600 dark:text-slate-300", children: "A token is set. The value is never shown again — regenerate to issue a new one." }),
|
|
@@ -915,20 +920,20 @@ function st({ profile: e }) {
|
|
|
915
920
|
/* @__PURE__ */ a(
|
|
916
921
|
Y,
|
|
917
922
|
{
|
|
918
|
-
onConfirm: () =>
|
|
919
|
-
disabled:
|
|
923
|
+
onConfirm: () => k.mutate(),
|
|
924
|
+
disabled: k.isPending,
|
|
920
925
|
confirmLabel: "Revoke — scripts using it stop working?",
|
|
921
926
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-red-600 transition-colors hover:bg-red-50 disabled:opacity-50 dark:border-border dark:text-red-400 dark:hover:bg-red-500/10",
|
|
922
927
|
armedClassName: "border-red-300",
|
|
923
928
|
children: [
|
|
924
|
-
/* @__PURE__ */ t(
|
|
929
|
+
/* @__PURE__ */ t(De, { className: "h-3 w-3" }),
|
|
925
930
|
" Revoke"
|
|
926
931
|
]
|
|
927
932
|
}
|
|
928
933
|
)
|
|
929
934
|
] })
|
|
930
935
|
] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
931
|
-
/* @__PURE__ */ t(
|
|
936
|
+
/* @__PURE__ */ t(ke, { children: "No token issued." }),
|
|
932
937
|
/* @__PURE__ */ a(
|
|
933
938
|
"button",
|
|
934
939
|
{
|
|
@@ -937,7 +942,7 @@ function st({ profile: e }) {
|
|
|
937
942
|
disabled: p.isPending,
|
|
938
943
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
939
944
|
children: [
|
|
940
|
-
/* @__PURE__ */ t(te, { className:
|
|
945
|
+
/* @__PURE__ */ t(te, { className: T("h-3 w-3", p.isPending && "animate-spin") }),
|
|
941
946
|
p.isPending ? "Generating…" : "Generate token"
|
|
942
947
|
]
|
|
943
948
|
}
|
|
@@ -946,62 +951,125 @@ function st({ profile: e }) {
|
|
|
946
951
|
}
|
|
947
952
|
);
|
|
948
953
|
}
|
|
949
|
-
function
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
954
|
+
function Ye(e) {
|
|
955
|
+
if (!Number.isFinite(e) || e <= 0) return "Ending now";
|
|
956
|
+
if (e < 3600) return `Ends in ${Math.max(1, Math.round(e / 60))} min`;
|
|
957
|
+
const n = Math.round(e / 3600);
|
|
958
|
+
return n >= 48 ? `Ends in ${Math.round(n / 24)} days` : `Ends in ${n}h`;
|
|
959
|
+
}
|
|
960
|
+
function wt({ userId: e }) {
|
|
961
|
+
const n = F(), d = ae(), i = ["nvr-user-sessions", e], o = K({
|
|
962
|
+
queryKey: i,
|
|
963
|
+
queryFn: () => n.request(P("/security/sessions", { user_id: e })).then((c) => c.data ?? []),
|
|
955
964
|
staleTime: 3e4
|
|
956
|
-
}),
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
965
|
+
}), b = e.toUpperCase();
|
|
966
|
+
Qe(
|
|
967
|
+
"sessions",
|
|
968
|
+
() => {
|
|
969
|
+
d.invalidateQueries({ queryKey: ["nvr-user-sessions", e] }), d.invalidateQueries({ queryKey: ["nvr-signed-in-devices", e] });
|
|
960
970
|
},
|
|
961
|
-
|
|
962
|
-
|
|
971
|
+
{
|
|
972
|
+
debounceMs: 800,
|
|
973
|
+
match: (c) => c.all === !0 || String(c.user_id ?? "").toUpperCase() === b
|
|
974
|
+
}
|
|
975
|
+
);
|
|
976
|
+
const h = Q({
|
|
977
|
+
mutationFn: (c) => n.request(ye(`/security/sessions/${c}`)),
|
|
978
|
+
onSuccess: (c, m) => {
|
|
979
|
+
d.setQueryData(i, (q) => q == null ? void 0 : q.filter(($) => $.sid_prefix !== m)), A.success("That browser is signed out");
|
|
980
|
+
},
|
|
981
|
+
onError: (c) => ve(c, "Could not sign that browser out")
|
|
982
|
+
}), p = o.data ?? [], k = je(p.map((c) => c.sid_prefix)), { quiet: l } = Ue();
|
|
963
983
|
return /* @__PURE__ */ t(
|
|
964
984
|
J,
|
|
965
985
|
{
|
|
966
|
-
icon: /* @__PURE__ */ t(
|
|
967
|
-
title: `
|
|
968
|
-
hint: "
|
|
986
|
+
icon: /* @__PURE__ */ t(Re, { className: "h-4 w-4" }),
|
|
987
|
+
title: o.isSuccess ? `Signed-in browsers · ${p.length}` : "Signed-in browsers",
|
|
988
|
+
hint: "Signing a browser out ends it on its next request",
|
|
969
989
|
testId: "sessions",
|
|
970
|
-
children:
|
|
971
|
-
"
|
|
990
|
+
children: o.isLoading ? /* @__PURE__ */ a("div", { className: "space-y-3", "aria-hidden": !0, children: [
|
|
991
|
+
/* @__PURE__ */ t(me, { className: "h-9 w-full" }),
|
|
992
|
+
/* @__PURE__ */ t(me, { className: "h-9 w-2/3" })
|
|
993
|
+
] }) : o.isError ? /* @__PURE__ */ t(ze, { error: o.error, what: "signed-in browsers", onRetry: () => o.refetch() }) : p.length === 0 ? /* @__PURE__ */ t(ke, { children: "Not signed in on any browser." }) : /* @__PURE__ */ t("ul", { "data-sessions-list": !0, className: "-my-2 divide-y divide-slate-100 dark:divide-border/60", children: p.map((c) => /* @__PURE__ */ t(
|
|
994
|
+
Ze,
|
|
972
995
|
{
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
"…"
|
|
978
|
-
] }),
|
|
979
|
-
/* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: [
|
|
980
|
-
"expires in ",
|
|
981
|
-
Math.max(1, Math.round(c.ttl_seconds / 3600)),
|
|
982
|
-
"h"
|
|
983
|
-
] }),
|
|
984
|
-
/* @__PURE__ */ t(
|
|
985
|
-
Y,
|
|
986
|
-
{
|
|
987
|
-
onConfirm: () => u.mutate(c.sid_prefix),
|
|
988
|
-
confirmLabel: "Sign them out?",
|
|
989
|
-
className: "ml-auto text-[11px] text-red-500 underline decoration-dotted hover:text-red-600",
|
|
990
|
-
children: "Revoke"
|
|
991
|
-
}
|
|
992
|
-
)
|
|
993
|
-
]
|
|
996
|
+
session: c,
|
|
997
|
+
fresh: !l && k.has(c.sid_prefix),
|
|
998
|
+
pending: h.isPending && h.variables === c.sid_prefix,
|
|
999
|
+
onRevoke: () => h.mutate(c.sid_prefix)
|
|
994
1000
|
},
|
|
995
1001
|
c.sid_prefix
|
|
996
1002
|
)) })
|
|
997
1003
|
}
|
|
998
1004
|
);
|
|
999
1005
|
}
|
|
1006
|
+
function Ze({
|
|
1007
|
+
session: e,
|
|
1008
|
+
fresh: n,
|
|
1009
|
+
pending: d,
|
|
1010
|
+
onRevoke: i
|
|
1011
|
+
}) {
|
|
1012
|
+
const o = e.device || "Browser", b = [
|
|
1013
|
+
e.ip,
|
|
1014
|
+
e.signed_in_at ? `Signed in ${Ie(e.signed_in_at)}` : "Signed in before this was recorded",
|
|
1015
|
+
Ye(e.ttl_seconds)
|
|
1016
|
+
].filter(Boolean).join(" · "), h = ce(o), p = ce(b);
|
|
1017
|
+
return /* @__PURE__ */ a(
|
|
1018
|
+
"li",
|
|
1019
|
+
{
|
|
1020
|
+
"data-session-row": !0,
|
|
1021
|
+
"data-fresh": n || void 0,
|
|
1022
|
+
className: T(
|
|
1023
|
+
"-mx-2 flex items-center gap-3 rounded-md px-2 py-2.5 transition-colors duration-700 motion-reduce:transition-none",
|
|
1024
|
+
n && "bg-nvr-cyan/10"
|
|
1025
|
+
),
|
|
1026
|
+
children: [
|
|
1027
|
+
/* @__PURE__ */ t("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-300", children: / on (iOS|Android)$/.test(o) ? /* @__PURE__ */ t(Ke, { className: "h-4 w-4", "aria-hidden": !0 }) : /* @__PURE__ */ t(Pe, { className: "h-4 w-4", "aria-hidden": !0 }) }),
|
|
1028
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1029
|
+
/* @__PURE__ */ t(
|
|
1030
|
+
"span",
|
|
1031
|
+
{
|
|
1032
|
+
ref: h,
|
|
1033
|
+
"data-session-device": !0,
|
|
1034
|
+
className: "block truncate text-[12.5px] font-medium text-slate-800 dark:text-slate-100",
|
|
1035
|
+
children: o
|
|
1036
|
+
}
|
|
1037
|
+
),
|
|
1038
|
+
/* @__PURE__ */ t(
|
|
1039
|
+
"p",
|
|
1040
|
+
{
|
|
1041
|
+
ref: p,
|
|
1042
|
+
"data-session-meta": !0,
|
|
1043
|
+
className: "mt-0.5 truncate text-[11.5px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
1044
|
+
children: b
|
|
1045
|
+
}
|
|
1046
|
+
)
|
|
1047
|
+
] }),
|
|
1048
|
+
/* @__PURE__ */ t("span", { "data-session-sign-out": !0, className: "contents", children: /* @__PURE__ */ a(
|
|
1049
|
+
Y,
|
|
1050
|
+
{
|
|
1051
|
+
title: `Sign out ${o}`,
|
|
1052
|
+
onConfirm: i,
|
|
1053
|
+
confirmLabel: "Sign it out?",
|
|
1054
|
+
disabled: d,
|
|
1055
|
+
className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 transition-colors hover:border-red-300 hover:text-red-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 disabled:opacity-40 dark:border-border dark:text-slate-300 dark:hover:border-red-500/40 dark:hover:text-red-400",
|
|
1056
|
+
armedClassName: "border-red-300 font-semibold text-red-600 dark:border-red-500/40 dark:text-red-400",
|
|
1057
|
+
children: [
|
|
1058
|
+
/* @__PURE__ */ t(Fe, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
1059
|
+
d ? "Signing out…" : "Sign out"
|
|
1060
|
+
]
|
|
1061
|
+
}
|
|
1062
|
+
) })
|
|
1063
|
+
]
|
|
1064
|
+
}
|
|
1065
|
+
);
|
|
1066
|
+
}
|
|
1000
1067
|
export {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1068
|
+
ft as AccessCard,
|
|
1069
|
+
Nt as ApiTokenCard,
|
|
1070
|
+
wt as SessionsCard,
|
|
1071
|
+
yt as SuspensionBanner,
|
|
1072
|
+
kt as UserDirectoryCard,
|
|
1073
|
+
vt as UserScopesCard,
|
|
1074
|
+
Ye as sessionEndsIn
|
|
1007
1075
|
};
|